|
|
@@ -354,25 +354,20 @@ class CgRefundClass extends BaseClass
|
|
|
|
|
|
} elseif ($payWay == dict::getDict('payWay', 'balancePay')) {
|
|
|
|
|
|
- util::fail('余额支付暂不支持退款');
|
|
|
-
|
|
|
- //采购单总金额还要减去退款
|
|
|
+ // 余额支付:资金在销售单 payAfter 成对账户扣减,退款由 RefundOrderClass 原路退回;采购单仅更新金额
|
|
|
$cg->refundPrice = $refundPrice;
|
|
|
$currentActPrice = bcsub($cg->actPrice, $refundPrice, 2);
|
|
|
if ($currentActPrice < 0) {
|
|
|
- util::fail('退款金额有问题!');
|
|
|
+ util::fail('可退款金额不足');
|
|
|
}
|
|
|
$cg->actPrice = $currentActPrice;
|
|
|
$currentRealPrice = bcsub($cg->realPrice, $refundPrice, 2);
|
|
|
if ($currentRealPrice < 0) {
|
|
|
- util::fail('退款金额有问题,请排查');
|
|
|
+ util::fail('可退款金额不足,请排查');
|
|
|
}
|
|
|
$cg->realPrice = $currentRealPrice;
|
|
|
$cg->save();
|
|
|
|
|
|
- //门店余额增加
|
|
|
- \biz\shop\classes\ShopClass::cgRefundAddBalance($main, $shop, $refundPrice, $cgRefund, $ghs);
|
|
|
-
|
|
|
} elseif ($payWay == dict::getDict('payWay', 'cash')) {
|
|
|
$cg->refundPrice = $refundPrice;
|
|
|
$currentActPrice = bcsub($cg->actPrice, $refundPrice, 2);
|