shish 2 lat temu
rodzic
commit
a55f096d70
1 zmienionych plików z 10 dodań i 4 usunięć
  1. 10 4
      biz-ghs/order/classes/OrderClass.php

+ 10 - 4
biz-ghs/order/classes/OrderClass.php

@@ -1127,6 +1127,7 @@ class OrderClass extends BaseClass
         $content .= '--------------------------------<BR>';
         $content .= '--------------------------------<BR>';
 
 
         $totalNum = 0;
         $totalNum = 0;
+        $refundTotalNum = 0;
         foreach ($new as $current) {
         foreach ($new as $current) {
             //58mm的机器,一行打印16个汉字,32个字母
             //58mm的机器,一行打印16个汉字,32个字母
             $productPrice = $current['xhUnitPrice'] ?? '';
             $productPrice = $current['xhUnitPrice'] ?? '';
@@ -1137,10 +1138,14 @@ class OrderClass extends BaseClass
             $productNum = $current['xhNum'] ?? '';
             $productNum = $current['xhNum'] ?? '';
             $unitName = $current['xhUnitName'] ?? '扎';
             $unitName = $current['xhUnitName'] ?? '扎';
             $count = $productNum . $unitName;
             $count = $productNum . $unitName;
+            $show = $name . ' ' . $count;
             if (isset($current['refundNum']) && $current['refundNum'] > 0) {
             if (isset($current['refundNum']) && $current['refundNum'] > 0) {
-                $show = $name . ' ' . $count . '(退' . $current['refundNum'] . $unitName . ')';
-            } else {
-                $show = $name . ' ' . $count;
+                $show .= '(退' . $current['refundNum'] . $unitName . ')';
+                $refundTotalNum = bcadd($refundTotalNum, $current['refundNum']);
+            }
+            if (isset($current['giveNum']) && $current['giveNum'] > 0) {
+                $show .= '(送' . $current['giveNum'] . $unitName . ')';
+                $totalNum = bcadd($totalNum, $current['giveNum']);
             }
             }
             $content .= '<B>' . $show . '</B><BR>';
             $content .= '<B>' . $show . '</B><BR>';
             $content .= $productNum . ' = ' . $productPrice . '元<BR>';
             $content .= $productNum . ' = ' . $productPrice . '元<BR>';
@@ -1150,8 +1155,9 @@ class OrderClass extends BaseClass
 
 
         $content .= '********************************<BR>';
         $content .= '********************************<BR>';
         $kindNum = count($new);
         $kindNum = count($new);
+        $remainNum = bcsub($totalNum, $refundTotalNum);
         $content .= "<CB>共{$kindNum}种";
         $content .= "<CB>共{$kindNum}种";
-        $content .= ",{$totalNum}扎";
+        $content .= ",{$remainNum}扎";
         $content .= "</CB>";
         $content .= "</CB>";
         $content .= '********************************<BR><BR>';
         $content .= '********************************<BR><BR>';