|
|
@@ -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 = [];
|