|
@@ -122,6 +122,13 @@ class CgRefundService extends BaseService
|
|
|
$cg->refund = PurchaseClass::REFUND_YES;
|
|
$cg->refund = PurchaseClass::REFUND_YES;
|
|
|
$cg->save();
|
|
$cg->save();
|
|
|
|
|
|
|
|
|
|
+ $ghsId = $cg->ghsId;
|
|
|
|
|
+ $ghs = GhsClass::getLockById($ghsId);
|
|
|
|
|
+ if (empty($ghs)) {
|
|
|
|
|
+ util::fail('没有找到供应商');
|
|
|
|
|
+ }
|
|
|
|
|
+ $ghsName = $ghs->name ?? '';
|
|
|
|
|
+
|
|
|
if ($payWay == dict::getDict('payWay', 'wxPay')) {
|
|
if ($payWay == dict::getDict('payWay', 'wxPay')) {
|
|
|
|
|
|
|
|
//微信收款的原路退回
|
|
//微信收款的原路退回
|
|
@@ -214,12 +221,7 @@ class CgRefundService extends BaseService
|
|
|
$shop->mayPay = $currentMayPay;
|
|
$shop->mayPay = $currentMayPay;
|
|
|
$shop->save();
|
|
$shop->save();
|
|
|
|
|
|
|
|
- //门店应付供应商款减少
|
|
|
|
|
- $ghsId = $cg->ghsId;
|
|
|
|
|
- $ghs = GhsClass::getLockById($ghsId);
|
|
|
|
|
- if (empty($ghs)) {
|
|
|
|
|
- util::fail('没有找到供应商');
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ //应付供应商款减少
|
|
|
$currentDebtAmount = bcsub($ghs->debtAmount, $refundPrice, 2);
|
|
$currentDebtAmount = bcsub($ghs->debtAmount, $refundPrice, 2);
|
|
|
if ($currentDebtAmount < 0) {
|
|
if ($currentDebtAmount < 0) {
|
|
|
util::fail('供应商欠款有问题!');
|
|
util::fail('供应商欠款有问题!');
|
|
@@ -242,7 +244,7 @@ class CgRefundService extends BaseService
|
|
|
|
|
|
|
|
$sjId = $cg->sjId ?? 0;
|
|
$sjId = $cg->sjId ?? 0;
|
|
|
$shopId = $cg->shopId ?? 0;
|
|
$shopId = $cg->shopId ?? 0;
|
|
|
- $event = '采购退款';
|
|
|
|
|
|
|
+ $event = "采购退款({$ghsName})";
|
|
|
$capitalData = [
|
|
$capitalData = [
|
|
|
'capitalType' => $currentType,
|
|
'capitalType' => $currentType,
|
|
|
'io' => 1,
|
|
'io' => 1,
|