|
|
@@ -244,17 +244,18 @@ class PurchaseService extends BaseService
|
|
|
util::fail('没有找到门店');
|
|
|
}
|
|
|
$realPrice = $info->realPrice;
|
|
|
+ $actPrice = $info->actPrice;
|
|
|
/**余额支付引起余额减少**/
|
|
|
if ($payWay == dict::getDict('payWay', 'balancePay')) {
|
|
|
ShopClass::purchaseReduceBalance($shop, $realPrice, $info);
|
|
|
}
|
|
|
- $shop->totalPurchase = bcadd($shop->totalPurchase, $realPrice, 2);
|
|
|
- $currentExpend = bcadd($shop->totalExpend, $realPrice, 2);
|
|
|
+ $shop->totalPurchase = bcadd($shop->totalPurchase, $actPrice, 2);
|
|
|
+ $currentExpend = bcadd($shop->totalExpend, $actPrice, 2);
|
|
|
$shop->totalExpend = $currentExpend;
|
|
|
$shop->cgUnPay -= 1;
|
|
|
$shop->cgUnSend += 1;
|
|
|
if ($payWay == dict::getDict('payWay', 'debtPay')) {
|
|
|
- //欠款支付会增加【应付供应商款】
|
|
|
+ //应付供应商款增加
|
|
|
$currentMayPay = bcadd($shop->mayPay, $realPrice, 2);
|
|
|
$shop->mayPay = $currentMayPay;
|
|
|
}
|
|
|
@@ -270,7 +271,7 @@ class PurchaseService extends BaseService
|
|
|
'io' => 0,
|
|
|
'totalExpend' => $currentExpend,
|
|
|
'payWay' => $payWay,
|
|
|
- 'amount' => $realPrice,
|
|
|
+ 'amount' => $actPrice,
|
|
|
'sjId' => $sjId,
|
|
|
'shopId' => $shopId,
|
|
|
'event' => $event,
|
|
|
@@ -297,7 +298,7 @@ class PurchaseService extends BaseService
|
|
|
util::fail('没有找到供应商');
|
|
|
}
|
|
|
if ($payWay == dict::getDict('payWay', 'debtPay')) {
|
|
|
- if($ghs->debtNum == 0){
|
|
|
+ if ($ghs->debtNum == 0) {
|
|
|
$shop->mayPayNum += 1;
|
|
|
$shop->save();
|
|
|
}
|
|
|
@@ -306,7 +307,7 @@ class PurchaseService extends BaseService
|
|
|
$ghs->debtAmount = bcadd($ghs->debtAmount, $realPrice, 2);
|
|
|
$ghs->debtNum += 1;
|
|
|
}
|
|
|
- $ghs->expendAmount = bcadd($ghs->expendAmount, $realPrice, 2);
|
|
|
+ $ghs->expendAmount = bcadd($ghs->expendAmount, $actPrice, 2);
|
|
|
$ghs->expendNum += 1;
|
|
|
$ghs->save();
|
|
|
|