|
|
@@ -393,6 +393,13 @@ class OrderService extends BaseService
|
|
|
if (isset($order->debt) == false) {
|
|
|
util::fail('订单有问题,没有欠款项');
|
|
|
}
|
|
|
+
|
|
|
+ $customId = $order->customId;
|
|
|
+ $custom = CustomClass::getLockById($customId);
|
|
|
+ if (empty($custom)) {
|
|
|
+ util::fail('没有找到客户信息');
|
|
|
+ }
|
|
|
+
|
|
|
/**门店资产变化**/
|
|
|
$amount = $order->actPrice ?? 0.00;
|
|
|
$currentShopId = $order->shopId ?? 0;
|
|
|
@@ -410,6 +417,10 @@ class OrderService extends BaseService
|
|
|
//客户欠款支付会增加【应收客户款】
|
|
|
$currentGathering = bcadd($shop->mayGathering, $amount, 2);
|
|
|
$shop->mayGathering = $currentGathering;
|
|
|
+ //客户第一次欠款的增加一个欠款客户
|
|
|
+ if ($custom->debtNum == 0) {
|
|
|
+ $shop->mayGatheringNum += 1;
|
|
|
+ }
|
|
|
}
|
|
|
$shop->save();
|
|
|
|
|
|
@@ -465,11 +476,6 @@ class OrderService extends BaseService
|
|
|
StatYjClass::addYj($order);
|
|
|
|
|
|
/**客户资产变化**/
|
|
|
- $customId = $order->customId;
|
|
|
- $custom = CustomClass::getLockById($customId);
|
|
|
- if (empty($custom)) {
|
|
|
- util::fail('没有找到客户信息');
|
|
|
- }
|
|
|
if ($payWay == dict::getDict('payWay', 'debtPay')) {
|
|
|
//欠款支付
|
|
|
$custom->isDebt = CustomClass::IS_DEBT_YES;
|