shish 1 month ago
parent
commit
8b001aa03f
1 changed files with 5 additions and 0 deletions
  1. 5 0
      biz-ghs/cg/services/CgRefundService.php

+ 5 - 0
biz-ghs/cg/services/CgRefundService.php

@@ -42,6 +42,11 @@ class CgRefundService extends BaseService
         $order->actPrice = $currentActPrice;
         $order->realPrice = $currentRealPrice;
         $order->refund = 2;
+        // 待结采购单售后退尽:actPrice 已为 0 须同步改为已结清,否则会留下 debt=待结 的幽灵单
+        if (intval($order->debt ?? 0) === PurchaseOrderClass::DEBT_YES
+            && bccomp($currentActPrice, '0', 2) <= 0) {
+            $order->debt = PurchaseOrderClass::DEBT_NO;
+        }
         $order->save();
 
         $data = [];