|
|
@@ -282,6 +282,20 @@ class CgRefundService extends BaseService
|
|
|
ShopClass::cgRefundAddBalance($main, $shop, $refundPrice, $cgRefund, $ghs);
|
|
|
} else {
|
|
|
//其它线下退款直接完成
|
|
|
+ //采购单总金额还要减去退款
|
|
|
+ $currentRefund = bcadd($cg->refundPrice, $refundPrice, 2);
|
|
|
+ $cg->refundPrice = $currentRefund;
|
|
|
+ $currentActPrice = bcsub($cg->actPrice, $refundPrice, 2);
|
|
|
+ if ($currentActPrice < 0) {
|
|
|
+ util::fail('退款金额有问题!');
|
|
|
+ }
|
|
|
+ $cg->actPrice = $currentActPrice;
|
|
|
+ $currentRealPrice = bcsub($cg->realPrice, $refundPrice, 2);
|
|
|
+ if ($currentRealPrice < 0) {
|
|
|
+ util::fail('退款金额有问题,请排查');
|
|
|
+ }
|
|
|
+ $cg->realPrice = $currentRealPrice;
|
|
|
+ $cg->save();
|
|
|
}
|
|
|
}
|
|
|
|