|
|
@@ -246,6 +246,21 @@ class CgRefundService extends BaseService
|
|
|
|
|
|
} elseif ($payWay == dict::getDict('payWay', 'balancePay')) {
|
|
|
|
|
|
+ //采购单总金额还要减去退款
|
|
|
+ $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();
|
|
|
+
|
|
|
//门店余额增加
|
|
|
ShopClass::cgRefundAddBalance($shop, $refundPrice, $cgRefund, $ghs);
|
|
|
|