|
|
@@ -72,7 +72,7 @@ class OrderClearClass extends BaseClass
|
|
|
$custom->debtNum = $num;
|
|
|
$custom->save();
|
|
|
|
|
|
- //客户门店应付供应商款减少
|
|
|
+ //应付供应商款减少
|
|
|
$customShopId = $custom->shopId;
|
|
|
$customShop = ShopClass::getLockById($customShopId);
|
|
|
if (empty($customShop)) {
|
|
|
@@ -120,8 +120,12 @@ class OrderClearClass extends BaseClass
|
|
|
$ghs->debtNum = $num;
|
|
|
$ghs->debt = $remainAmount > 0 ? 2 : 1;
|
|
|
$ghs->save();
|
|
|
+ if ($ghs->debtNum == 0) {
|
|
|
+ $customShop->mayPayNum -= 1;
|
|
|
+ $customShop->save();
|
|
|
+ }
|
|
|
|
|
|
- //供应商的门店应收客户款减少
|
|
|
+ //应收客户款减少
|
|
|
$shopId = $ghs->shopId;
|
|
|
$shop = ShopClass::getLockById($shopId);
|
|
|
$currentGathering = bcsub($shop->mayGathering, $amount, 2);
|