diff --git a/Application/Admin/Controller/CompanyStatementPoolController.class.php b/Application/Admin/Controller/CompanyStatementPoolController.class.php index e9be8af63..50f3f3fba 100644 --- a/Application/Admin/Controller/CompanyStatementPoolController.class.php +++ b/Application/Admin/Controller/CompanyStatementPoolController.class.php @@ -605,7 +605,7 @@ class CompanyStatementPoolController extends ThinkController //周结算金额计算 for ($i=0;;$i++) { if ($sv[$i]['sum_money']) { - $game_data['week_amount'] += $sv[$i]['sum_money']- $sv[$i]['withhold']; + $game_data['week_amount'] += $sv[$i]['sum_money']- $sv[$i]['withhold']+$sv[$i]['reward']-$sv[$i]['fine']; $game_data['withhold_amount'] += $sv[$i]['withhold']; $game_data['fine'] += $sv[$i]['fine']; $game_data['reward'] += $sv[$i]['reward']; @@ -1705,6 +1705,10 @@ class CompanyStatementPoolController extends ThinkController $amount = 0; $statement_amount = 0; $statement_lack_amount = 0; + $reward = 0; + $fine = 0; + $lreward = 0; + $lfine = 0; foreach ($increment_ratio as $key => $value) { @@ -1720,6 +1724,7 @@ class CompanyStatementPoolController extends ThinkController $statement_data = $model->where(['id'=>$key])->find(); + $statement_info = json_decode($statement_data['statement_info'],true); foreach ($statement_info as $k => $v) { @@ -1745,6 +1750,7 @@ class CompanyStatementPoolController extends ThinkController $statement_amount += $sum_money[$key][$v['account']][$gk]-$statement_info[$k]['game_list'][$gk]['withhold']; } else { $statement_lack_amount += $sum_money[$key][$v['account']][$gk]-$statement_info[$k]['game_list'][$gk]['withhold']; + } } @@ -1753,7 +1759,16 @@ class CompanyStatementPoolController extends ThinkController $statement_info_data = json_encode($statement_info); - $model->where(['id'=>$key])->save(['statement_info'=>$statement_info_data,'statement_money'=>$amount,'pay_amount'=>$amount,'remark'=>$remark[$key]]); + $r_data = $model->field("fine,reward")->where(['id'=>$key])->find(); + if($model == M("company_statement_info","tab_")) { + $reward += $r_data['reward']; + $fine += $r_data['fine']; + } else { + $lreward += $r_data['reward']; + $lfine += $r_data['fine']; + } + + $model->where(['id'=>$key])->save(['statement_info'=>$statement_info_data,'statement_money'=>$amount+($r_data['reward']?$r_data['reward']:0)-($r_data['fine']?$r_data['fine']:0),'pay_amount'=>$amount,'remark'=>$remark[$key]]); $amount = 0; @@ -1762,7 +1777,7 @@ class CompanyStatementPoolController extends ThinkController } - M("company_statement_pool","tab_")->where(['id'=>$id])->save(['pay_amount'=>$statement_amount,'statement_money'=>$statement_amount,'lack_statement_money'=>$statement_lack_amount]); + M("company_statement_pool","tab_")->where(['id'=>$id])->save(['pay_amount'=>$statement_amount,'statement_money'=>$statement_amount+$reward-$fine,'lack_statement_money'=>$statement_lack_amount+$lreward-$lfine]); $this->ajaxReturn(['status'=>1,'info'=>'保存成功']); diff --git a/Application/Admin/Controller/FinancialSummaryController.class.php b/Application/Admin/Controller/FinancialSummaryController.class.php index 5e598b42b..b2f60892b 100644 --- a/Application/Admin/Controller/FinancialSummaryController.class.php +++ b/Application/Admin/Controller/FinancialSummaryController.class.php @@ -23,7 +23,7 @@ class FinancialSummaryController extends AdminController public function index($p=1) { if(!array_key_exists("year",$_REQUEST) || !array_key_exists("type",$_REQUEST)){ - $this->redirect(ACTION_NAME, array('year' => date('Y',time()),"type"=>2)); + $this->redirect(ACTION_NAME, array('year' => date('Y',time()),"type"=>3)); } if(!IS_ROOT){ $this->OpAuthList= getModuleControllerAuth(); diff --git a/Application/Admin/Controller/TimingController.class.php b/Application/Admin/Controller/TimingController.class.php index e2d08f314..71a83319e 100644 --- a/Application/Admin/Controller/TimingController.class.php +++ b/Application/Admin/Controller/TimingController.class.php @@ -810,9 +810,9 @@ class TimingController extends AdminController { } // if (isset($return[$value['company_id']."-".$sval['promote_id']."-".$v['relation_game_id']])) { - $return[$value['company_id']."-".$sval['promote_id']."-".$v['relation_game_id']] = !$is_inside?$v['sum_money']:0; + $return[$value['company_id']."-".$sval['promote_id']."-".$v['relation_game_id']] = !$is_inside?($v['sum_money']-($v['withhold']?$v['withhold']:0)):0; } else { - $return[$value['company_id']."-".$sval['promote_id']."-".$v['relation_game_id']] += !$is_inside?$v['sum_money']:0; + $return[$value['company_id']."-".$sval['promote_id']."-".$v['relation_game_id']] += !$is_inside?($v['sum_money']-($v['withhold']?$v['withhold']:0)):0; } } diff --git a/Application/Admin/View/CompanyStatementPool/editPuPool.html b/Application/Admin/View/CompanyStatementPool/editPuPool.html index 778e15be9..d0e7b276e 100644 --- a/Application/Admin/View/CompanyStatementPool/editPuPool.html +++ b/Application/Admin/View/CompanyStatementPool/editPuPool.html @@ -466,6 +466,11 @@ withhold = 0; $(_this).parent().parent().find(".withhold").val(withhold); } + + if (!oldwithhold ) { + oldwithhold = 0; + $(_this).parent().parent().find(".oldwithhold").val(oldwithhold); + } // else if(parseFloat(withhold) > parseFloat(pay_money)) { // withhold = pay_money; // $(_this).parent().parent().find(".withhold").val(withhold); @@ -509,7 +514,7 @@ } } - var D_value = parseFloat(old_amount)-parseFloat(this_amount) + (withhold-oldwithhold); + var D_value = parseFloat(old_amount)-parseFloat(this_amount) + parseFloat(withhold-oldwithhold); week_amount_find.find(".week_amount").text((parseFloat(week_amount) - D_value).toFixed(2)); diff --git a/Application/Admin/View/CompanyStatementPool/editSpecialPuPool.html b/Application/Admin/View/CompanyStatementPool/editSpecialPuPool.html index bcc213f90..02709bf51 100644 --- a/Application/Admin/View/CompanyStatementPool/editSpecialPuPool.html +++ b/Application/Admin/View/CompanyStatementPool/editSpecialPuPool.html @@ -471,6 +471,11 @@ withhold = 0; $(_this).parent().parent().find(".withhold").val(withhold); } + + if (!oldwithhold ) { + oldwithhold = 0; + $(_this).parent().parent().find(".oldwithhold").val(oldwithhold); + } // else if(parseFloat(withhold) > parseFloat(pay_money)) { // withhold = pay_money; // $(_this).parent().parent().find(".withhold").val(withhold); @@ -514,7 +519,7 @@ var this_amount = week_amount_find.find(".sum_money_span").text(); - var D_value = parseFloat(old_amount)-parseFloat(this_amount) + (withhold-oldwithhold) ; + var D_value = parseFloat(old_amount)-parseFloat(this_amount) + parseFloat(withhold-oldwithhold) ; week_amount_find.find(".week_amount").text((parseFloat(week_amount)-D_value).toFixed(2)); // week_amount_find.find(".week_amount_input").val((parseFloat(week_amount)-D_value- parseFloat(withhold))); diff --git a/Application/Admin/View/FinancialSummary/index.html b/Application/Admin/View/FinancialSummary/index.html index a1a4968aa..d24b8ff3a 100644 --- a/Application/Admin/View/FinancialSummary/index.html +++ b/Application/Admin/View/FinancialSummary/index.html @@ -72,9 +72,9 @@