|
|
@@ -200,69 +200,75 @@ class StatKdClass extends BaseClass
|
|
|
$getStaffId = $hdOrder['getStaffId'] ?? 0;
|
|
|
$debtPrice = $hdOrder['debtPrice'] ?? 0;
|
|
|
$onlinePay = $hdOrder['onlinePay'] ?? 0;
|
|
|
- if ($debtPrice > 0) {
|
|
|
- //不管是否结清,只要$debtPrice > 0,说明曾经是欠款单
|
|
|
- $incomeList['debt']['amount'] = bcadd($incomeList['debt']['amount'], $debtPrice, 2);
|
|
|
- $incomeList['debt']['num'] = bcadd($incomeList['debt']['num'], 1);
|
|
|
- $incomeList['debt']['category']['ls']['amount'] = bcadd($incomeList['debt']['category']['ls']['amount'], $debtPrice, 2);
|
|
|
- $incomeList['debt']['category']['ls']['num'] = bcadd($incomeList['debt']['category']['ls']['num'], 1);
|
|
|
+
|
|
|
+ if ($onlinePay == dict::getDict('onlinePay', 'yes')) {
|
|
|
+ //使用在线支付
|
|
|
+ $incomeList['system']['amount'] = bcadd($incomeList['system']['amount'], $mainPay, 2);
|
|
|
+ $incomeList['system']['num'] = bcadd($incomeList['system']['num'], 1);
|
|
|
+ $incomeList['system']['category']['ls']['amount'] = bcadd($incomeList['system']['category']['ls']['amount'], $mainPay, 2);
|
|
|
+ $incomeList['system']['category']['ls']['num'] = bcadd($incomeList['system']['category']['ls']['num'], 1);
|
|
|
+ if ($cash > 0) {
|
|
|
+ $incomeList['cash']['amount'] = bcadd($incomeList['cash']['amount'], $cash, 2);
|
|
|
+ $incomeList['cash']['num'] = bcadd($incomeList['cash']['num'], 1);
|
|
|
+ $incomeList['cash']['category']['ls']['amount'] = bcadd($incomeList['cash']['category']['ls']['amount'], $cash, 2);
|
|
|
+ $incomeList['cash']['category']['ls']['num'] = bcadd($incomeList['cash']['category']['ls']['num'], 1);
|
|
|
+ }
|
|
|
} else {
|
|
|
- if ($onlinePay == dict::getDict('onlinePay', 'yes')) {
|
|
|
- //使用在线支付
|
|
|
- $incomeList['system']['amount'] = bcadd($incomeList['system']['amount'], $mainPay, 2);
|
|
|
- $incomeList['system']['num'] = bcadd($incomeList['system']['num'], 1);
|
|
|
- $incomeList['system']['category']['ls']['amount'] = bcadd($incomeList['system']['category']['ls']['amount'], $mainPay, 2);
|
|
|
- $incomeList['system']['category']['ls']['num'] = bcadd($incomeList['system']['category']['ls']['num'], 1);
|
|
|
- if ($cash > 0) {
|
|
|
- $incomeList['cash']['amount'] = bcadd($incomeList['cash']['amount'], $cash, 2);
|
|
|
+
|
|
|
+ if ($debtPrice > 0) {
|
|
|
+ //不管是否结清,只要$debtPrice > 0,说明曾经是欠款单
|
|
|
+ $incomeList['debt']['amount'] = bcadd($incomeList['debt']['amount'], $debtPrice, 2);
|
|
|
+ $incomeList['debt']['num'] = bcadd($incomeList['debt']['num'], 1);
|
|
|
+ $incomeList['debt']['category']['ls']['amount'] = bcadd($incomeList['debt']['category']['ls']['amount'], $debtPrice, 2);
|
|
|
+ $incomeList['debt']['category']['ls']['num'] = bcadd($incomeList['debt']['category']['ls']['num'], 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ //付订金的情况!!
|
|
|
+ $currentAmount = $debtPrice > 0 ? bcsub($actPrice, $debtPrice, 2) : $actPrice;
|
|
|
+
|
|
|
+ //使用非在线支付
|
|
|
+ switch ($payWay) {
|
|
|
+ case dict::getDict('payWay', 'wxPay'):
|
|
|
+ //客服微信总共收了多少笔多少钱
|
|
|
+ $incomeList['kfWx']['amount'] = bcadd($incomeList['kfWx']['amount'], $currentAmount, 2);
|
|
|
+ $incomeList['kfWx']['num'] = bcadd($incomeList['kfWx']['num'], 1);
|
|
|
+ //批发开单、零售开单、批发结账、零售尾款各收了多少现金
|
|
|
+ $incomeList['kfWx']['category']['ls']['amount'] = bcadd($incomeList['kfWx']['category']['ls']['amount'], $currentAmount, 2);
|
|
|
+ $incomeList['kfWx']['category']['ls']['num'] = bcadd($incomeList['kfWx']['category']['ls']['num'], 1);
|
|
|
+ //客1 客2 客3各收了多少钱
|
|
|
+ if (isset($incomeList['kfWx']['class'][$getStaffId])) {
|
|
|
+ $incomeList['kfWx']['class'][$getStaffId]['amount'] = bcadd($incomeList['kfWx']['class'][$getStaffId]['amount'], $currentAmount, 2);
|
|
|
+ $incomeList['kfWx']['class'][$getStaffId]['num'] = bcadd($incomeList['kfWx']['class'][$getStaffId]['num'], 1);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case dict::getDict('payWay', 'alipay'):
|
|
|
+ $incomeList['aliPay']['amount'] = bcadd($incomeList['aliPay']['amount'], $currentAmount, 2);
|
|
|
+ $incomeList['aliPay']['num'] = bcadd($incomeList['aliPay']['num'], 1);
|
|
|
+ $incomeList['aliPay']['category']['ls']['amount'] = bcadd($incomeList['aliPay']['category']['ls']['amount'], $currentAmount, 2);
|
|
|
+ $incomeList['aliPay']['category']['ls']['num'] = bcadd($incomeList['aliPay']['category']['ls']['num'], 1);
|
|
|
+ break;
|
|
|
+ case dict::getDict('payWay', 'cash'):
|
|
|
+ $incomeList['cash']['amount'] = bcadd($incomeList['cash']['amount'], $currentAmount, 2);
|
|
|
$incomeList['cash']['num'] = bcadd($incomeList['cash']['num'], 1);
|
|
|
- $incomeList['cash']['category']['ls']['amount'] = bcadd($incomeList['cash']['category']['ls']['amount'], $cash, 2);
|
|
|
+ $incomeList['cash']['category']['ls']['amount'] = bcadd($incomeList['cash']['category']['ls']['amount'], $currentAmount, 2);
|
|
|
$incomeList['cash']['category']['ls']['num'] = bcadd($incomeList['cash']['category']['ls']['num'], 1);
|
|
|
- }
|
|
|
- } else {
|
|
|
- //使用非在线支付
|
|
|
- switch ($payWay) {
|
|
|
- case dict::getDict('payWay', 'wxPay'):
|
|
|
- //客服微信总共收了多少笔多少钱
|
|
|
- $incomeList['kfWx']['amount'] = bcadd($incomeList['kfWx']['amount'], $actPrice, 2);
|
|
|
- $incomeList['kfWx']['num'] = bcadd($incomeList['kfWx']['num'], 1);
|
|
|
- //批发开单、零售开单、批发结账、零售尾款各收了多少现金
|
|
|
- $incomeList['kfWx']['category']['ls']['amount'] = bcadd($incomeList['kfWx']['category']['ls']['amount'], $actPrice, 2);
|
|
|
- $incomeList['kfWx']['category']['ls']['num'] = bcadd($incomeList['kfWx']['category']['ls']['num'], 1);
|
|
|
- //客1 客2 客3各收了多少钱
|
|
|
- if (isset($incomeList['kfWx']['class'][$getStaffId])) {
|
|
|
- $incomeList['kfWx']['class'][$getStaffId]['amount'] = bcadd($incomeList['kfWx']['class'][$getStaffId]['amount'], $actPrice, 2);
|
|
|
- $incomeList['kfWx']['class'][$getStaffId]['num'] = bcadd($incomeList['kfWx']['class'][$getStaffId]['num'], 1);
|
|
|
- }
|
|
|
- break;
|
|
|
- case dict::getDict('payWay', 'alipay'):
|
|
|
- $incomeList['aliPay']['amount'] = bcadd($incomeList['aliPay']['amount'], $actPrice, 2);
|
|
|
- $incomeList['aliPay']['num'] = bcadd($incomeList['aliPay']['num'], 1);
|
|
|
- $incomeList['aliPay']['category']['ls']['amount'] = bcadd($incomeList['aliPay']['category']['ls']['amount'], $actPrice, 2);
|
|
|
- $incomeList['aliPay']['category']['ls']['num'] = bcadd($incomeList['aliPay']['category']['ls']['num'], 1);
|
|
|
- break;
|
|
|
- case dict::getDict('payWay', 'cash'):
|
|
|
- $incomeList['cash']['amount'] = bcadd($incomeList['cash']['amount'], $actPrice, 2);
|
|
|
- $incomeList['cash']['num'] = bcadd($incomeList['cash']['num'], 1);
|
|
|
- $incomeList['cash']['category']['ls']['amount'] = bcadd($incomeList['cash']['category']['ls']['amount'], $actPrice, 2);
|
|
|
- $incomeList['cash']['category']['ls']['num'] = bcadd($incomeList['cash']['category']['ls']['num'], 1);
|
|
|
- break;
|
|
|
- case dict::getDict('payWay', 'bankCard'):
|
|
|
- $incomeList['bankCard']['amount'] = bcadd($incomeList['aliPay']['amount'], $actPrice, 2);
|
|
|
- $incomeList['bankCard']['num'] = bcadd($incomeList['aliPay']['num'], 1);
|
|
|
- $incomeList['bankCard']['category']['ls']['amount'] = bcadd($incomeList['bankCard']['category']['ls']['amount'], $actPrice, 2);
|
|
|
- $incomeList['bankCard']['category']['ls']['num'] = bcadd($incomeList['bankCard']['category']['ls']['num'], 1);
|
|
|
- break;
|
|
|
- case dict::getDict('payWay', 'unknown'):
|
|
|
- $incomeList['other']['amount'] = bcadd($incomeList['aliPay']['amount'], $actPrice, 2);
|
|
|
- $incomeList['other']['num'] = bcadd($incomeList['aliPay']['num'], 1);
|
|
|
- $incomeList['other']['category']['ls']['amount'] = bcadd($incomeList['other']['category']['ls']['amount'], $actPrice, 2);
|
|
|
- $incomeList['other']['category']['ls']['num'] = bcadd($incomeList['other']['category']['ls']['num'], 1);
|
|
|
- break;
|
|
|
- default:
|
|
|
- }
|
|
|
+ break;
|
|
|
+ case dict::getDict('payWay', 'bankCard'):
|
|
|
+ $incomeList['bankCard']['amount'] = bcadd($incomeList['aliPay']['amount'], $currentAmount, 2);
|
|
|
+ $incomeList['bankCard']['num'] = bcadd($incomeList['aliPay']['num'], 1);
|
|
|
+ $incomeList['bankCard']['category']['ls']['amount'] = bcadd($incomeList['bankCard']['category']['ls']['amount'], $currentAmount, 2);
|
|
|
+ $incomeList['bankCard']['category']['ls']['num'] = bcadd($incomeList['bankCard']['category']['ls']['num'], 1);
|
|
|
+ break;
|
|
|
+ case dict::getDict('payWay', 'unknown'):
|
|
|
+ $incomeList['other']['amount'] = bcadd($incomeList['aliPay']['amount'], $currentAmount, 2);
|
|
|
+ $incomeList['other']['num'] = bcadd($incomeList['aliPay']['num'], 1);
|
|
|
+ $incomeList['other']['category']['ls']['amount'] = bcadd($incomeList['other']['category']['ls']['amount'], $currentAmount, 2);
|
|
|
+ $incomeList['other']['category']['ls']['num'] = bcadd($incomeList['other']['category']['ls']['num'], 1);
|
|
|
+ break;
|
|
|
+ default:
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
//批发结帐收入
|