shish 1 anno fa
parent
commit
1e4ccfd727
1 ha cambiato i file con 8 aggiunte e 0 eliminazioni
  1. 8 0
      app-ghs/controllers/OrderController.php

+ 8 - 0
app-ghs/controllers/OrderController.php

@@ -2440,6 +2440,7 @@ class OrderController extends BaseController
         $totalActPrice = 0;
         $totalOrderPrice = 0;
         $totalCarton = 0;
+        $totalCartonNum = 0;
         $totalPack = 0;
         $totalFreight = 0;
         $totalTkPrice = 0;
@@ -2465,6 +2466,7 @@ class OrderController extends BaseController
                 }
 
                 $carton = 0;
+                $cartonNum = 0;
                 $pack = 0;
                 $freight = 0;
                 $orderItemList = OrderItemClass::getAllByCondition(['orderSn' => $orderSn], null, '*');
@@ -2482,6 +2484,7 @@ class OrderController extends BaseController
                                     $amount = bcmul($remainNum, $unitPrice, 2);
                                     if ($classId == 72106) {
                                         $carton = bcadd($carton, $amount, 2);
+                                        $cartonNum = bcadd($cartonNum,$remainNum);
                                     }
                                     if ($classId == 72108) {
                                         $pack = bcadd($pack, $amount, 2);
@@ -2496,6 +2499,7 @@ class OrderController extends BaseController
                                     $amount = bcmul($remainNum, $unitPrice, 2);
                                     if ($classId == 90497) {
                                         $carton = bcadd($carton, $amount, 2);
+                                        $cartonNum = bcadd($cartonNum,$remainNum);
                                     }
                                     if ($classId == 90501) {
                                         $freight = bcadd($freight, $amount, 2);
@@ -2507,6 +2511,7 @@ class OrderController extends BaseController
                                     $amount = bcmul($remainNum, $unitPrice, 2);
                                     if ($classId == 71495) {
                                         $carton = bcadd($carton, $amount, 2);
+                                        $cartonNum = bcadd($cartonNum,$remainNum);
                                     }
                                     if ($classId == 91009) {
                                         $freight = bcadd($freight, $amount, 2);
@@ -2533,6 +2538,7 @@ class OrderController extends BaseController
                 }
 
                 $totalCarton = bcadd($totalCarton, $carton, 2);
+                $totalCartonNum = bcadd($totalCartonNum, $cartonNum);
                 $totalPack = bcadd($totalPack, $pack, 2);
                 $totalFreight = bcadd($totalFreight, $freight, 2);
                 $totalTkPrice = bcadd($totalTkPrice, $tkPrice, 2);
@@ -2544,6 +2550,7 @@ class OrderController extends BaseController
                     $list[$customId]['orderPrice'] = bcadd($list[$customId]['orderPrice'], $orderPrice, 2);
                     $list[$customId]['num'] = bcadd($list[$customId]['num'], 1);
                     $list[$customId]['carton'] = bcadd($list[$customId]['carton'], $carton, 2);
+                    $list[$customId]['cartonNum'] = bcadd($list[$customId]['cartonNum'], $cartonNum);
                     $list[$customId]['pack'] = bcadd($list[$customId]['pack'], $pack, 2);
                     $list[$customId]['freight'] = bcadd($list[$customId]['freight'], $freight, 2);
                     $list[$customId]['tkPrice'] = bcadd($list[$customId]['tkPrice'], $tkPrice, 2);
@@ -2558,6 +2565,7 @@ class OrderController extends BaseController
                         'actPrice' => $actPrice,
                         'num' => 1,
                         'carton' => $carton,
+                        'cartonNum' => $cartonNum,
                         'pack' => $pack,
                         'freight' => $freight,
                         'tkPrice' => $tkPrice,