Jelajahi Sumber

售后 打印与支付

shish 1 tahun lalu
induk
melakukan
a73d61720d

+ 12 - 3
app-hd/controllers/OrderController.php

@@ -231,6 +231,9 @@ class OrderController extends BaseController
         if (empty($order)) {
             util::fail('没有找到订单');
         }
+        if ($order->forward == 1) {
+            util::fail('售后付款单不能打印');
+        }
         OrderClass::valid($order, $this->mainId);
         OrderClass::onlinePrint($order, true);
         util::complete();
@@ -513,8 +516,6 @@ class OrderController extends BaseController
         $hdName = $hd->name ?? '';
         $post['hdId'] = $hdId;
         $post['hdName'] = $hdName;
-
-        //$post['customId'] = $customId;
         $customName = $custom->name ?? '';
         $post['customName'] = $customName;
         $post['customNamePy'] = stringUtil::py($customName);
@@ -540,7 +541,15 @@ class OrderController extends BaseController
         $forward = $post['forward'] ?? 0;
         if ($forward == 1) {
             if ($hasPay != 1) {
-                util::fail('负数订单只能线下转账');
+                util::fail('售后付款单只能走线下转账');
+            }
+        } else {
+            //如果不是售后付款单,并且选的不是余额支付,余额又够付当前订单,则自动切到余额支付
+            $balance = $custom->balance ?? 0;
+            $modifyPrice = $post['modifyPrice'] ?? 0;
+            if ($hasPay != 4 && $balance > $modifyPrice) {
+                $post['hasPay'] = 4;
+                $hasPay = 4;
             }
         }
 

+ 2 - 5
biz-ghs/stat/classes/StatKdClass.php

@@ -288,10 +288,8 @@ class StatKdClass extends BaseClass
             $remainDebtPrice = $hdOrder['remainDebtPrice'] ?? 0;
             $onlinePay = $hdOrder['onlinePay'] ?? 0;
             $fromType = $hdOrder['fromType'] ?? 0;
-
-            $staffId = $ghsOrder['shopAdminId'] ?? 0;
-            $staffName = $ghsOrder['shopAdminName'] ?? '';
-
+            $staffId = $hdOrder['shopAdminId'] ?? 0;
+            $staffName = $hdOrder['shopAdminName'] ?? '';
             $repeat = $hdOrder['repeat'] ?? 0;
 
             if ($onlinePay == dict::getDict('onlinePay', 'yes')) {
@@ -336,7 +334,6 @@ class StatKdClass extends BaseClass
                     $incomeList['mt']['num'] = bcadd($incomeList['mt']['num'], 1);
                 } else {
 
-                    //非美团!!!
                     if ($debtPrice > 0) {
 
                         if ($remainDebtPrice > 0) {