|
@@ -288,24 +288,21 @@ class StatKdClass extends BaseClass
|
|
|
$remainDebtPrice = $hdOrder['remainDebtPrice'] ?? 0;
|
|
$remainDebtPrice = $hdOrder['remainDebtPrice'] ?? 0;
|
|
|
$onlinePay = $hdOrder['onlinePay'] ?? 0;
|
|
$onlinePay = $hdOrder['onlinePay'] ?? 0;
|
|
|
$fromType = $hdOrder['fromType'] ?? 0;
|
|
$fromType = $hdOrder['fromType'] ?? 0;
|
|
|
-
|
|
|
|
|
- $staffId = $ghsOrder['shopAdminId'] ?? 0;
|
|
|
|
|
- $staffName = $ghsOrder['shopAdminName'] ?? '';
|
|
|
|
|
-
|
|
|
|
|
|
|
+ $staffId = $hdOrder['shopAdminId'] ?? 0;
|
|
|
|
|
+ $staffName = $hdOrder['shopAdminName'] ?? '';
|
|
|
$repeat = $hdOrder['repeat'] ?? 0;
|
|
$repeat = $hdOrder['repeat'] ?? 0;
|
|
|
|
|
+ $forward = $hdOrder['forward'] ?? 0;
|
|
|
|
|
+ $tkPrice = $hdOrder['tkPrice'] ?? 0;
|
|
|
|
|
+ $mainPay = bcsub($mainPay, $tkPrice, 2);
|
|
|
|
|
|
|
|
- if ($onlinePay == dict::getDict('onlinePay', 'yes')) {
|
|
|
|
|
|
|
+ if ($forward == 1) {
|
|
|
|
|
+ //售后付款不属于收入
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- 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];
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ $currentAmount = 0;
|
|
|
|
|
+ if ($onlinePay == dict::getDict('onlinePay', 'yes')) {
|
|
|
|
|
|
|
|
- //现金 和 微信支付宝付款,微信支付宝还存在退款情况
|
|
|
|
|
- $tkPrice = $hdOrder['tkPrice'] ?? 0;
|
|
|
|
|
- $mainPay = bcsub($mainPay, $tkPrice, 2);
|
|
|
|
|
$incomeList['system']['amount'] = bcadd($incomeList['system']['amount'], $mainPay, 2);
|
|
$incomeList['system']['amount'] = bcadd($incomeList['system']['amount'], $mainPay, 2);
|
|
|
$incomeList['system']['num'] = bcadd($incomeList['system']['num'], 1);
|
|
$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']['amount'] = bcadd($incomeList['system']['category']['ls']['amount'], $mainPay, 2);
|
|
@@ -321,31 +318,21 @@ class StatKdClass extends BaseClass
|
|
|
$incomeList['cash']['category']['ls']['amount'] = bcadd($incomeList['cash']['category']['ls']['amount'], $cash, 2);
|
|
$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);
|
|
$incomeList['cash']['category']['ls']['num'] = bcadd($incomeList['cash']['category']['ls']['num'], 1);
|
|
|
}
|
|
}
|
|
|
|
|
+ $currentAmount = bcadd($mainPay, $cash, 2);
|
|
|
} else {
|
|
} 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')) {
|
|
if ($fromType == dict::getDict('fromType', 'mt')) {
|
|
|
//美团!!!
|
|
//美团!!!
|
|
|
$incomeList['mt']['amount'] = bcadd($incomeList['mt']['amount'], $actPrice, 2);
|
|
$incomeList['mt']['amount'] = bcadd($incomeList['mt']['amount'], $actPrice, 2);
|
|
|
$incomeList['mt']['num'] = bcadd($incomeList['mt']['num'], 1);
|
|
$incomeList['mt']['num'] = bcadd($incomeList['mt']['num'], 1);
|
|
|
} else {
|
|
} else {
|
|
|
-
|
|
|
|
|
- //非美团!!!
|
|
|
|
|
if ($debtPrice > 0) {
|
|
if ($debtPrice > 0) {
|
|
|
-
|
|
|
|
|
if ($remainDebtPrice > 0) {
|
|
if ($remainDebtPrice > 0) {
|
|
|
$incomeList['debt']['amount'] = bcadd($incomeList['debt']['amount'], $remainDebtPrice, 2);
|
|
$incomeList['debt']['amount'] = bcadd($incomeList['debt']['amount'], $remainDebtPrice, 2);
|
|
|
$incomeList['debt']['num'] = bcadd($incomeList['debt']['num'], 1);
|
|
$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']['amount'] = bcadd($incomeList['debt']['category']['ls']['amount'], $remainDebtPrice, 2);
|
|
|
$incomeList['debt']['category']['ls']['num'] = bcadd($incomeList['debt']['category']['ls']['num'], 1);
|
|
$incomeList['debt']['category']['ls']['num'] = bcadd($incomeList['debt']['category']['ls']['num'], 1);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
$clearDebt = bcsub($debtPrice, $remainDebtPrice, 2);
|
|
$clearDebt = bcsub($debtPrice, $remainDebtPrice, 2);
|
|
|
if ($clearDebt > 0) {
|
|
if ($clearDebt > 0) {
|
|
|
$incomeList['debtClear']['amount'] = bcadd($incomeList['debtClear']['amount'], $clearDebt, 2);
|
|
$incomeList['debtClear']['amount'] = bcadd($incomeList['debtClear']['amount'], $clearDebt, 2);
|
|
@@ -353,13 +340,10 @@ class StatKdClass extends BaseClass
|
|
|
$incomeList['debtClear']['category']['ls']['amount'] = bcadd($incomeList['debtClear']['category']['ls']['amount'], $clearDebt, 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);
|
|
$incomeList['debtClear']['category']['ls']['num'] = bcadd($incomeList['debtClear']['category']['ls']['num'], 1);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- $currentAmount = bcsub($mainPay, $debtPrice, 2);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ $currentAmount = bcadd($remainDebtPrice, $clearDebt, 2);
|
|
|
} else {
|
|
} else {
|
|
|
$currentAmount = $mainPay;
|
|
$currentAmount = $mainPay;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
if ($currentAmount > 0) {
|
|
if ($currentAmount > 0) {
|
|
|
//使用非在线支付
|
|
//使用非在线支付
|
|
|
switch ($payWay) {
|
|
switch ($payWay) {
|
|
@@ -415,9 +399,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];
|
|
return ['incomeList' => $incomeList, 'staffAmountList' => $staffAmountList, 'payCodeIncome' => $payCodeIncome];
|
|
|
|
|
|