|
|
@@ -6,6 +6,8 @@ use biz\ghs\classes\GhsClass;
|
|
|
use biz\shop\classes\ShopCapitalClass;
|
|
|
use biz\shop\classes\ShopClass;
|
|
|
use biz\wx\classes\WxMessageClass;
|
|
|
+use bizGhs\cg\classes\CgClass;
|
|
|
+use bizGhs\order\classes\PurchaseOrderClass;
|
|
|
use bizGhs\product\classes\ProductClass;
|
|
|
use bizGhs\stock\classes\StockRecordClass;
|
|
|
use bizHd\base\services\BaseService;
|
|
|
@@ -111,6 +113,12 @@ class CgRefundService extends BaseService
|
|
|
|
|
|
$currentType = dict::getDict('capitalType', 'cgRefund', 'id');
|
|
|
|
|
|
+ //退款增加,兼容多次退款累加
|
|
|
+ $currentRefund = bcadd($cg->refundPrice, $refundPrice, 2);
|
|
|
+ $cg->refundPrice = $currentRefund;
|
|
|
+ $cg->refund = PurchaseClass::REFUND_YES;
|
|
|
+ $cg->save();
|
|
|
+
|
|
|
if ($payWay == dict::getDict('payWay', 'wxPay')) {
|
|
|
|
|
|
//微信收款的原路退回
|
|
|
@@ -155,12 +163,9 @@ class CgRefundService extends BaseService
|
|
|
|
|
|
$clearId = $cg->clearId ?? 0;
|
|
|
if (!empty($clearId)) {
|
|
|
- util::fail('订单已经月结,无法再发起退款');
|
|
|
+ util::fail('订单已结帐,无法退款');
|
|
|
}
|
|
|
|
|
|
- //采购单减掉退款
|
|
|
- $currentRefund = bcadd($cg->refundPrice, $refundPrice, 2);
|
|
|
- $cg->refundPrice = $currentRefund;
|
|
|
$currentActPrice = bcsub($cg->actPrice, $refundPrice, 2);
|
|
|
if ($currentActPrice < 0) {
|
|
|
util::fail('退款金额有问题!');
|