Browse Source

库存成本修改outPrice逻辑

shensong 5 years ago
parent
commit
76c9eff53b
1 changed files with 6 additions and 1 deletions
  1. 6 1
      app/Console/Commands/SyncMjWarehouse.php

+ 6 - 1
app/Console/Commands/SyncMjWarehouse.php

72
                     $up['realPrice'] = $up['totalCost'] / $up['quantity'];
72
                     $up['realPrice'] = $up['totalCost'] / $up['quantity'];
73
 //                    $up['outPrice'] = ceil($up['realPrice'] * 1.15);
73
 //                    $up['outPrice'] = ceil($up['realPrice'] * 1.15);
74
                 } else {
74
                 } else {
75
-                    $up['realPrice'] = 0;
75
+//                    $up['realPrice'] = 0;
76
 //                    $up['outPrice'] = 0;
76
 //                    $up['outPrice'] = 0;
77
                 }
77
                 }
78
+                if(!$cost['outPrice']){
79
+                    if(isset($up['realPrice'])){
80
+                        $up['outPrice'] = ceil($up['realPrice']*1.15);
81
+                    }
82
+                }
78
                 $up['cost'] = isset($sku['cost']) ? $sku['cost'] : 0;
83
                 $up['cost'] = isset($sku['cost']) ? $sku['cost'] : 0;
79
                 //实际库存=库存-冻结
84
                 //实际库存=库存-冻结
80
                 $up['quantity'] = $real_quantity;
85
                 $up['quantity'] = $real_quantity;