|
|
@@ -192,17 +192,15 @@ class CgRefundService extends BaseService
|
|
|
$cgRefund->thirdRefundNo = $wxRefundId;
|
|
|
$cgRefund->save();
|
|
|
|
|
|
- //采购单总金额还要减去退款
|
|
|
- $currentRefund = bcadd($cg->refundPrice, $refundPrice, 2);
|
|
|
- $cg->refundPrice = $currentRefund;
|
|
|
+ $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();
|
|
|
@@ -222,25 +220,23 @@ class CgRefundService extends BaseService
|
|
|
util::fail('订单已经结帐,无法再发起退款');
|
|
|
}
|
|
|
|
|
|
- //采购单总金额还要减去退款
|
|
|
- $currentRefund = bcadd($cg->refundPrice, $refundPrice, 2);
|
|
|
- $cg->refundPrice = $currentRefund;
|
|
|
+ $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;
|
|
|
|
|
|
$currentRemainDebt = bcsub($cg->remainDebtPrice, $refundPrice, 2);
|
|
|
if ($currentRemainDebt < 0) {
|
|
|
- util::fail('退款金额有问题哦');
|
|
|
+ util::fail('可退款金额不足哦');
|
|
|
}
|
|
|
if ($currentRemainDebt == 0) {
|
|
|
$cg->debt = PurchaseClass::DEBT_NO;
|
|
|
@@ -264,8 +260,7 @@ class CgRefundService extends BaseService
|
|
|
util::fail('余额支付暂不支持退款');
|
|
|
|
|
|
//采购单总金额还要减去退款
|
|
|
- $currentRefund = bcadd($cg->refundPrice, $refundPrice, 2);
|
|
|
- $cg->refundPrice = $currentRefund;
|
|
|
+ $cg->refundPrice = $refundPrice;
|
|
|
$currentActPrice = bcsub($cg->actPrice, $refundPrice, 2);
|
|
|
if ($currentActPrice < 0) {
|
|
|
util::fail('退款金额有问题!');
|
|
|
@@ -282,17 +277,15 @@ class CgRefundService extends BaseService
|
|
|
ShopClass::cgRefundAddBalance($main, $shop, $refundPrice, $cgRefund, $ghs);
|
|
|
} else {
|
|
|
//其它线下退款直接完成
|
|
|
- //采购单总金额还要减去退款
|
|
|
- $currentRefund = bcadd($cg->refundPrice, $refundPrice, 2);
|
|
|
- $cg->refundPrice = $currentRefund;
|
|
|
+ $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();
|