|
|
@@ -81,6 +81,8 @@ class PurchaseOrderItemController extends BaseController
|
|
|
$itemList = ProductClass::getByIds($productIdList, null, 'id');
|
|
|
foreach ($list as $key => $info) {
|
|
|
$productId = $info['productId'] ?? 0;
|
|
|
+ $cost = $info['cost'] ?? 0;
|
|
|
+ $cost = round($cost);
|
|
|
$current = $itemList[$productId] ?? [];
|
|
|
//待入库的,需要计算新的平均成本,用于改价参考
|
|
|
if ($cg->status == 3) {
|
|
|
@@ -111,9 +113,9 @@ class PurchaseOrderItemController extends BaseController
|
|
|
$suggestSkPrice = $info['saveSkPrice'] ?? 0;
|
|
|
$suggestHjPrice = $info['saveHjPrice'] ?? 0;
|
|
|
} else {
|
|
|
- $suggestPrice = bcadd(round($newAvCost), $addPrice, 2);
|
|
|
- $suggestSkPrice = bcadd(round($newAvCost), $skMore, 2);
|
|
|
- $suggestHjPrice = bcadd(round($newAvCost), $hjAddPrice, 2);
|
|
|
+ $suggestPrice = bcadd($cost, $addPrice, 2);
|
|
|
+ $suggestSkPrice = bcadd($cost, $skMore, 2);
|
|
|
+ $suggestHjPrice = bcadd($cost, $hjAddPrice, 2);
|
|
|
}
|
|
|
$suggestPrice = floatval($suggestPrice);
|
|
|
$suggestSkPrice = floatval($suggestSkPrice);
|