|
|
@@ -157,6 +157,23 @@ class CgRefundService extends BaseService
|
|
|
$cgRefund->thirdRefundNo = $wxRefundId;
|
|
|
$cgRefund->save();
|
|
|
|
|
|
+
|
|
|
+ //采购单总金额还要减去退款
|
|
|
+ $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();
|
|
|
+
|
|
|
+
|
|
|
} elseif ($payWay == dict::getDict('payWay', 'debtPay')) {
|
|
|
|
|
|
$clearId = $cg->clearId ?? 0;
|