市场结算管理市场业绩公式修正

master
zhengyongxing 4 years ago
parent ccca696de2
commit d5e7546c51

@ -486,7 +486,8 @@ class MarketPercentageController extends ThinkController
'maintain_commission_ratio'=>'维护业绩提成比例(%)', 'maintain_commission_ratio'=>'维护业绩提成比例(%)',
'appraisal_bonuses_ratio'=>'开发考核奖金比例(%)', 'appraisal_bonuses_ratio'=>'开发考核奖金比例(%)',
'maintain_appraisal_bonuses_ratio'=>'维护奖金考核比例(%)', 'maintain_appraisal_bonuses_ratio'=>'维护奖金考核比例(%)',
'company_profit'=>'税后毛利', 'achievement_profit'=>'开发税后毛利',
'performance_profit'=>'维护税后毛利',
'performance_commission' => '业绩提成', 'performance_commission' => '业绩提成',
'achievement_bonus' => '绩效考核奖金', 'achievement_bonus' => '绩效考核奖金',
'commission' => '当月合计', 'commission' => '当月合计',
@ -500,29 +501,38 @@ class MarketPercentageController extends ThinkController
$data[$key]['performance_commission'] = "=ROUND("; $data[$key]['performance_commission'] = "=ROUND(";
$data[$key]['achievement_bonus'] = "=ROUND("; $data[$key]['achievement_bonus'] = "=ROUND(";
if ($value['performance_revenue'] != "0.00") { if ($value['performance_profit'] != "0.00") {
$data[$key]['performance_commission'] .= "J{$line}*(F{$line}/100)"; $data[$key]['performance_commission'] .= "J{$line}*(F{$line}/100)";
$data[$key]['achievement_bonus'] .= "J{$line}*(H{$line}/100)"; $data[$key]['achievement_bonus'] .= "J{$line}*(H{$line}/100)";
} }
if ($value['appraisal_bonuses'] != "0.00") { if ($value['achievement_profit'] != "0.00") {
if ($data[$key]['performance_commission'] == "=ROUND(") { if ($data[$key]['performance_commission'] == "=ROUND(") {
$data[$key]['performance_commission'] .= "J{$line}*(G{$line}/100),2)"; $data[$key]['performance_commission'] .= "K{$line}*(G{$line}/100),2)";
} else { } else {
$data[$key]['performance_commission'] .= "+J{$line}*(G{$line}/100),2)"; $data[$key]['performance_commission'] .= "+K{$line}*(G{$line}/100),2)";
} }
if ($data[$key]['achievement_bonus'] == "=ROUND(") { if ($data[$key]['achievement_bonus'] == "=ROUND(") {
$data[$key]['achievement_bonus'] .= "J{$line}*(I{$line}/100),2)"; $data[$key]['achievement_bonus'] .= "K{$line}*(I{$line}/100),2)";
} else { } else {
$data[$key]['achievement_bonus'] .= "+J{$line}*(I{$line}/100),2)"; $data[$key]['achievement_bonus'] .= "+K{$line}*(I{$line}/100),2)";
} }
} else { } else {
$data[$key]['performance_commission'] .= ",2)"; $data[$key]['performance_commission'] .= ",2)";
$data[$key]['achievement_bonus'] .= ",2)"; $data[$key]['achievement_bonus'] .= ",2)";
} }
if ($data[$key]['performance_commission'] == '=ROUND(,2)') {
$data[$key]['performance_commission'] = "0.00";
}
if ($data[$key]['achievement_bonus'] == '=ROUND(,2)') {
$data[$key]['achievement_bonus'] = "0.00";
}
// $data[$key]['performance_commission'] = "=ROUND(J{$line}*(F{$line}/100)+J{$line}*(G{$line}/100),2)"; // $data[$key]['performance_commission'] = "=ROUND(J{$line}*(F{$line}/100)+J{$line}*(G{$line}/100),2)";
// $data[$key]['achievement_bonus'] = "=ROUND(J{$line}*(H{$line}/100)+J{$line}*(I{$line}/100),2)"; // $data[$key]['achievement_bonus'] = "=ROUND(J{$line}*(H{$line}/100)+J{$line}*(I{$line}/100),2)";
$data[$key]['commission'] = "=ROUND(K{$line}+L{$line},2)"; $data[$key]['commission'] = "=ROUND(L{$line}+M{$line},2)";
} }
$data = array_merge($data,[$sum]); $data = array_merge($data,[$sum]);

@ -1051,10 +1051,13 @@ class TimingController extends AdminController {
if($v['develop_type'] == 1 || $v['develop_type'] == 2) { if($v['develop_type'] == 1 || $v['develop_type'] == 2) {
$all_data[$key]['performance_commission'] += $v['company_profit']*($market_percentage['develop_commission_ratio']/100); $all_data[$key]['performance_commission'] += $v['company_profit']*($market_percentage['develop_commission_ratio']/100);
$all_data[$key]['achievement_profit'] += $v['company_profit'];
} }
if ($v['develop_type'] == 3) { if ($v['develop_type'] == 3) {
$all_data[$key]['performance_commission'] += $v['company_profit']*($market_percentage['maintain_commission_ratio']/100); $all_data[$key]['performance_commission'] += $v['company_profit']*($market_percentage['maintain_commission_ratio']/100);
$all_data[$key]['performance_profit'] += $v['company_profit'];
} }
//绩效考核奖金 //绩效考核奖金
@ -1071,10 +1074,10 @@ class TimingController extends AdminController {
$all_data[$key]['achievement_bonus'] = number_format($all_data[$key]['achievement_bonus'], 2, '.', ''); $all_data[$key]['achievement_bonus'] = number_format($all_data[$key]['achievement_bonus'], 2, '.', '');
$sum_amount <$market_percentage['performance_revenue'] ? ($all_data[$key]['performance_commission'] = 0):""; $sum_amount <$market_percentage['performance_revenue'] ? ($all_data[$key]['performance_commission'] = 0):"";
// $all_data[$key]['achievement_bonus'] = $sum_amount <$market_percentage['performance_revenue'] ? ($all_data[$key]['achievement_profit'] = 0):"";
// number_format($value['company_profit']*($market_percentage['appraisal_bonuses_ratio']/100) +
// $value['company_profit']*($market_percentage['maintain_appraisal_bonuses_ratio']/100), 2, '.', '');
$sum_amount <$market_percentage['appraisal_bonuses'] ? ($all_data[$key]['achievement_bonus'] = 0):""; $sum_amount <$market_percentage['appraisal_bonuses'] ? ($all_data[$key]['achievement_bonus'] = 0):"";
$sum_amount <$market_percentage['appraisal_bonuses'] ? ($all_data[$key]['performance_profit'] = 0):"";
//总提成 //总提成
$all_data[$key]['commission'] = number_format($all_data[$key]['performance_commission']+$all_data[$key]['achievement_bonus'], 2, '.', ''); $all_data[$key]['commission'] = number_format($all_data[$key]['performance_commission']+$all_data[$key]['achievement_bonus'], 2, '.', '');
//应发金额 //应发金额
@ -1113,6 +1116,10 @@ class TimingController extends AdminController {
$insert['wait_performance_commission'] = number_format($all_data[$key]['performance_commission'] * (1-($market_percentage['performance_monthly_ratio']/100)), 2, '.', ''); $insert['wait_performance_commission'] = number_format($all_data[$key]['performance_commission'] * (1-($market_percentage['performance_monthly_ratio']/100)), 2, '.', '');
//待发绩效奖金 //待发绩效奖金
$insert['wait_achievement_commission'] = number_format($all_data[$key]['achievement_bonus'] * (1-($market_percentage['month_bonus_ratio']/100)), 2, '.', ''); $insert['wait_achievement_commission'] = number_format($all_data[$key]['achievement_bonus'] * (1-($market_percentage['month_bonus_ratio']/100)), 2, '.', '');
$insert['achievement_profit'] = number_format($all_data[$key]['achievement_profit'], 2, '.', '');
$insert['performance_profit'] = number_format($all_data[$key]['performance_profit'], 2, '.', '');
// $insert['wait_commission'] = ($insert['wait_performance_commission']+$insert['wait_achievement_commission']); // $insert['wait_commission'] = ($insert['wait_performance_commission']+$insert['wait_achievement_commission']);
$is_hav = M("market_altogether","tab_") $is_hav = M("market_altogether","tab_")
->where(['admin_id'=>$value['admin_id'],'pay_time'=>$value['pay_time']]) ->where(['admin_id'=>$value['admin_id'],'pay_time'=>$value['pay_time']])

@ -2401,3 +2401,8 @@ INSERT INTO `sys_kv`(`id`, `key`, `value`, `type`, `remark`) VALUES (4, 'cp_comp
ALTER TABLE `sj_game_channel`.`sj_cptogether_company` ALTER TABLE `sj_game_channel`.`sj_cptogether_company`
ADD COLUMN `is_qualifity` tinyint(2) NULL COMMENT '是否具有游戏资质 0 否 1 是' AFTER `is_received`; ADD COLUMN `is_qualifity` tinyint(2) NULL COMMENT '是否具有游戏资质 0 否 1 是' AFTER `is_received`;
ALTER TABLE `tab_market_altogether`
ADD COLUMN `achievement_profit` decimal(13, 2) NULL DEFAULT 0.00 COMMENT '开发毛利' AFTER `wait_achievement_commission`,
ADD COLUMN `performance_profit` decimal(13, 2) NULL DEFAULT 0.00 COMMENT '维护毛利' AFTER `achievement_profit`;
Loading…
Cancel
Save