|
@@ -53,9 +53,24 @@ class StockWastageOrderClass extends BaseClass
|
|
|
//花材列表
|
|
//花材列表
|
|
|
$ghsItemInfo = $post['product'];
|
|
$ghsItemInfo = $post['product'];
|
|
|
$ghsItemInfo = self::mergeItemInfo($ghsItemInfo);
|
|
$ghsItemInfo = self::mergeItemInfo($ghsItemInfo);
|
|
|
- $sumNum = self::sumNumByItemInfo($ghsItemInfo);
|
|
|
|
|
- $data['bigNum'] = $sumNum['bigNum'];
|
|
|
|
|
- $data['smallNum'] = $sumNum['smallNum'];
|
|
|
|
|
|
|
+ $totalNum = 0;
|
|
|
|
|
+ $totalBig = 0;
|
|
|
|
|
+ $totalSmall = 0;
|
|
|
|
|
+ if (!empty($ghsItemInfo)) {
|
|
|
|
|
+ foreach ($ghsItemInfo as $current) {
|
|
|
|
|
+ $bigNum = $current['bigNum'] ?? 0;
|
|
|
|
|
+ $totalNum = bcadd($totalNum, $bigNum, 2);
|
|
|
|
|
+ $smallNum = $current['smallNum'] ?? 0;
|
|
|
|
|
+ $ratio = isset($current['ratio']) && $current['ratio'] > 0 ? $current['ratio'] : 1;
|
|
|
|
|
+ $div = bcdiv($smallNum, $ratio, 2);
|
|
|
|
|
+ $totalNum = bcadd($totalNum, $div, 2);
|
|
|
|
|
+ $totalBig = bcadd($totalBig, $bigNum);
|
|
|
|
|
+ $totalSmall = bcadd($totalSmall, $smallNum);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ $data['bigNum'] = $totalBig;
|
|
|
|
|
+ $data['smallNum'] = $totalSmall;
|
|
|
|
|
+ $data['num'] = $totalNum;
|
|
|
$data['remark'] = $post['remark'] ?? '';
|
|
$data['remark'] = $post['remark'] ?? '';
|
|
|
$data['mainId'] = $mainId;
|
|
$data['mainId'] = $mainId;
|
|
|
|
|
|