|
|
@@ -266,70 +266,78 @@ class StatKdClass extends BaseClass
|
|
|
|
|
|
//非美团!!!
|
|
|
if ($debtPrice > 0) {
|
|
|
+
|
|
|
if ($remainDebtPrice > 0) {
|
|
|
$incomeList['debt']['amount'] = bcadd($incomeList['debt']['amount'], $remainDebtPrice, 2);
|
|
|
$incomeList['debt']['num'] = bcadd($incomeList['debt']['num'], 1);
|
|
|
$incomeList['debt']['category']['ls']['amount'] = bcadd($incomeList['debt']['category']['ls']['amount'], $remainDebtPrice, 2);
|
|
|
$incomeList['debt']['category']['ls']['num'] = bcadd($incomeList['debt']['category']['ls']['num'], 1);
|
|
|
- } else {
|
|
|
- $incomeList['debtClear']['amount'] = bcadd($incomeList['debtClear']['amount'], $debtPrice, 2);
|
|
|
+ }
|
|
|
+
|
|
|
+ $clearDebt = bcsub($debtPrice, $remainDebtPrice, 2);
|
|
|
+ if ($clearDebt > 0) {
|
|
|
+ $incomeList['debtClear']['amount'] = bcadd($incomeList['debtClear']['amount'], $clearDebt, 2);
|
|
|
$incomeList['debtClear']['num'] = bcadd($incomeList['debtClear']['num'], 1);
|
|
|
- $incomeList['debtClear']['category']['ls']['amount'] = bcadd($incomeList['debtClear']['category']['ls']['amount'], $debtPrice, 2);
|
|
|
+ $incomeList['debtClear']['category']['ls']['amount'] = bcadd($incomeList['debtClear']['category']['ls']['amount'], $clearDebt, 2);
|
|
|
$incomeList['debtClear']['category']['ls']['num'] = bcadd($incomeList['debtClear']['category']['ls']['num'], 1);
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- //付订金的情况!!
|
|
|
- $currentAmount = $remainDebtPrice > 0 ? bcsub($mainPay, $remainDebtPrice, 2) : $mainPay;
|
|
|
+ $currentAmount = bcsub($mainPay, $debtPrice, 2);
|
|
|
|
|
|
- //使用非在线支付
|
|
|
- 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);
|
|
|
- }
|
|
|
- //每个客服收的明细
|
|
|
- if (isset($incomeList['kfWx']['class'][$getStaffId]['itemList']['ls'])) {
|
|
|
- $incomeList['kfWx']['class'][$getStaffId]['itemList']['ls']['amount'] = floatval(bcadd($incomeList['kfWx']['class'][$getStaffId]['itemList']['ls']['amount'], $actPrice, 2));
|
|
|
- $incomeList['kfWx']['class'][$getStaffId]['itemList']['ls']['num'] = bcadd($incomeList['kfWx']['class'][$getStaffId]['itemList']['ls']['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'], $currentAmount, 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'], $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:
|
|
|
+ } else {
|
|
|
+ $currentAmount = $mainPay;
|
|
|
}
|
|
|
|
|
|
+ if ($currentAmount > 0) {
|
|
|
+ //使用非在线支付
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ //每个客服收的明细
|
|
|
+ if (isset($incomeList['kfWx']['class'][$getStaffId]['itemList']['ls'])) {
|
|
|
+ $incomeList['kfWx']['class'][$getStaffId]['itemList']['ls']['amount'] = floatval(bcadd($incomeList['kfWx']['class'][$getStaffId]['itemList']['ls']['amount'], $actPrice, 2));
|
|
|
+ $incomeList['kfWx']['class'][$getStaffId]['itemList']['ls']['num'] = bcadd($incomeList['kfWx']['class'][$getStaffId]['itemList']['ls']['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'], $currentAmount, 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'], $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:
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|