|
|
@@ -292,18 +292,13 @@ class StatKdClass extends BaseClass
|
|
|
$staffName = $hdOrder['shopAdminName'] ?? '';
|
|
|
$repeat = $hdOrder['repeat'] ?? 0;
|
|
|
|
|
|
+ $currentAmount = 0;
|
|
|
if ($onlinePay == dict::getDict('onlinePay', 'yes')) {
|
|
|
|
|
|
- if (isset($staffAmountList[$staffId])) {
|
|
|
- $staffAmountList[$staffId]['num'] = bcadd($staffAmountList[$staffId]['num'], 1);
|
|
|
- $staffAmountList[$staffId]['amount'] = bcadd($staffAmountList[$staffId]['amount'], $mainPay, 2);
|
|
|
- } else {
|
|
|
- $staffAmountList[$staffId] = ['num' => 1, 'amount' => $mainPay, 'staffName' => $staffName];
|
|
|
- }
|
|
|
-
|
|
|
//现金 和 微信支付宝付款,微信支付宝还存在退款情况
|
|
|
$tkPrice = $hdOrder['tkPrice'] ?? 0;
|
|
|
$mainPay = bcsub($mainPay, $tkPrice, 2);
|
|
|
+
|
|
|
$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);
|
|
|
@@ -319,30 +314,21 @@ class StatKdClass extends BaseClass
|
|
|
$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);
|
|
|
}
|
|
|
+ $currentAmount = bcadd($mainPay, $cash, 2);
|
|
|
} else {
|
|
|
|
|
|
- if (isset($staffAmountList[$staffId])) {
|
|
|
- $staffAmountList[$staffId]['num'] = bcadd($staffAmountList[$staffId]['num'], 1);
|
|
|
- $staffAmountList[$staffId]['amount'] = bcadd($staffAmountList[$staffId]['amount'], $actPrice, 2);
|
|
|
- } else {
|
|
|
- $staffAmountList[$staffId] = ['num' => 1, 'amount' => $actPrice, 'staffName' => $staffName];
|
|
|
- }
|
|
|
-
|
|
|
if ($fromType == dict::getDict('fromType', 'mt')) {
|
|
|
//美团!!!
|
|
|
$incomeList['mt']['amount'] = bcadd($incomeList['mt']['amount'], $actPrice, 2);
|
|
|
$incomeList['mt']['num'] = bcadd($incomeList['mt']['num'], 1);
|
|
|
} else {
|
|
|
-
|
|
|
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);
|
|
|
}
|
|
|
-
|
|
|
$clearDebt = bcsub($debtPrice, $remainDebtPrice, 2);
|
|
|
if ($clearDebt > 0) {
|
|
|
$incomeList['debtClear']['amount'] = bcadd($incomeList['debtClear']['amount'], $clearDebt, 2);
|
|
|
@@ -350,13 +336,10 @@ class StatKdClass extends BaseClass
|
|
|
$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 = bcsub($mainPay, $debtPrice, 2);
|
|
|
-
|
|
|
} else {
|
|
|
$currentAmount = $mainPay;
|
|
|
}
|
|
|
-
|
|
|
if ($currentAmount > 0) {
|
|
|
//使用非在线支付
|
|
|
switch ($payWay) {
|
|
|
@@ -412,9 +395,14 @@ class StatKdClass extends BaseClass
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
+ //员工业绩
|
|
|
+ if (isset($staffAmountList[$staffId])) {
|
|
|
+ $staffAmountList[$staffId]['num'] = bcadd($staffAmountList[$staffId]['num'], 1);
|
|
|
+ $staffAmountList[$staffId]['amount'] = bcadd($staffAmountList[$staffId]['amount'], $currentAmount, 2);
|
|
|
+ } else {
|
|
|
+ $staffAmountList[$staffId] = ['num' => 1, 'amount' => $currentAmount, 'staffName' => $staffName];
|
|
|
+ }
|
|
|
}
|
|
|
return ['incomeList' => $incomeList, 'staffAmountList' => $staffAmountList, 'payCodeIncome' => $payCodeIncome];
|
|
|
|