|
|
@@ -56,7 +56,6 @@ class PurchaseService extends BaseService
|
|
|
$couponId = $data['couponId'] ?? 0;
|
|
|
$discountType = $respond->discountType ?? dict::getDict('discountType', 'noDiscount');
|
|
|
$discountAmount = $respond->discountAmount ?? 0;
|
|
|
- $customPrice = $respond->actPrice;
|
|
|
$arr = [
|
|
|
'product' => $product,
|
|
|
'sjId' => $currentSjId,
|
|
|
@@ -82,7 +81,6 @@ class PurchaseService extends BaseService
|
|
|
'couponId' => $couponId,
|
|
|
'discountType' => $discountType,
|
|
|
'discountAmount' => $discountAmount,
|
|
|
- 'customPrice' => $customPrice,
|
|
|
];
|
|
|
$result = OrderClass::addOrder($arr);
|
|
|
$saleId = $result['id'] ?? 0;
|
|
|
@@ -237,9 +235,10 @@ class PurchaseService extends BaseService
|
|
|
util::fail('没有找到门店');
|
|
|
}
|
|
|
$actPrice = $info->actPrice;
|
|
|
+ $realPrice = $info->realPrice;
|
|
|
/**余额支付引起余额减少**/
|
|
|
if ($payWay == dict::getDict('payWay', 'balancePay')) {
|
|
|
- ShopClass::purchaseReduceBalance($shop, $actPrice, $info);
|
|
|
+ ShopClass::purchaseReduceBalance($shop, $realPrice, $info);
|
|
|
}
|
|
|
$shop->totalPurchase = bcadd($shop->totalPurchase, $actPrice, 2);
|
|
|
$shop->totalPurchaseOrder += 1;
|
|
|
@@ -249,7 +248,7 @@ class PurchaseService extends BaseService
|
|
|
$shop->cgUnSend += 1;
|
|
|
if ($payWay == dict::getDict('payWay', 'debtPay')) {
|
|
|
//欠款支付会增加【应付供货商款】
|
|
|
- $currentMayPay = bcadd($shop->mayPay, $actPrice, 2);
|
|
|
+ $currentMayPay = bcadd($shop->mayPay, $realPrice, 2);
|
|
|
$shop->mayPay = $currentMayPay;
|
|
|
}
|
|
|
$shop->save();
|
|
|
@@ -274,7 +273,7 @@ class PurchaseService extends BaseService
|
|
|
if ($payWay == dict::getDict('payWay', 'debtPay')) {
|
|
|
//欠款支付
|
|
|
$ghs->debt = 2;
|
|
|
- $ghs->debtAmount = bcadd($ghs->debtAmount, $actPrice, 2);
|
|
|
+ $ghs->debtAmount = bcadd($ghs->debtAmount, $realPrice, 2);
|
|
|
$ghs->debtNum += 1;
|
|
|
}
|
|
|
$ghs->expendAmount = bcadd($ghs->expendAmount, $actPrice, 2);
|