From 53ba2c7698fa8717ecfd5817c9f56d0a3dfb55ec Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Wed, 3 Feb 2021 18:22:02 +0800 Subject: [PATCH] =?UTF-8?q?2.7=E5=8F=B7=E5=8A=9F=E8=83=BD=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Common/extend.php | 54 ++- .../CompanyStatementController.class.php | 297 ++++++++++----- .../CompanyStatementPoolController.class.php | 9 + .../editPcComplementStatement.html | 56 +-- .../editPuComplementStatement.html | 80 ++-- .../Admin/View/CompanyStatement/lists.html | 14 +- .../CompanyStatement/viewPcStatement.html | 48 ++- .../viewPuComplementStatement.html | 23 +- .../viewSpecialComplement.html | 359 +++++++++++++----- .../View/CompanyStatementPool/viewPuPool.html | 8 +- .../Base/Factory/BaseFactory.class.php | 4 + .../SpecialCompoentCaculateFactory.class.php | 164 ++++++++ .../Factory/SpecialCompoentFactory.class.php | 86 +++++ Application/Common/index.html | 2 +- 14 files changed, 896 insertions(+), 308 deletions(-) create mode 100644 Application/Base/Factory/SpecialCompoentCaculateFactory.class.php create mode 100644 Application/Base/Factory/SpecialCompoentFactory.class.php diff --git a/Application/Admin/Common/extend.php b/Application/Admin/Common/extend.php index 24bc6b573..1d51bcf8d 100644 --- a/Application/Admin/Common/extend.php +++ b/Application/Admin/Common/extend.php @@ -2000,6 +2000,7 @@ function excelUpStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_all_ } + //下游工会对账单导出 function excelSpecialComplementEmplate($data, $all_sum_money, $all_pay_amount, $big_all_sum_money) { @@ -2020,10 +2021,11 @@ function excelSpecialComplementEmplate($data, $all_sum_money, $all_pay_amount, $ $statement_begin_time = date('Y.m.d', $data['statement_begin_time']);//对账开始时间 $statement_end_time = date('Y.m.d',$data['statement_end_time']);//对账截止时间 - $objPHPExcel->getActiveSheet()->setCellValue('A1', "《 {$data['company_name']} 》结算单\n({$statement_begin_time}-{$statement_end_time})"); + $objPHPExcel->getActiveSheet()->setCellValue('A1', "《 {$data['company_name']} 》特殊补点结算单\n({$statement_begin_time}-{$statement_end_time})"); if ($data['withdraw_type'] == '2') { $objPHPExcel->getActiveSheet()->setCellValue('D2','补点比例'); } + if ($data['withdraw_type'] == 3) { $objPHPExcel->getActiveSheet()->setCellValue('E2','特殊补点比例'); } @@ -2054,15 +2056,7 @@ function excelSpecialComplementEmplate($data, $all_sum_money, $all_pay_amount, $ $objPHPExcel->getActiveSheet()->getStyle('E'.$line)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE); $objPHPExcel->getActiveSheet()->getStyle('C'.$line)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER_00); $objPHPExcel->getActiveSheet()->getStyle('F'.$line)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER_00); - if($data['withdraw_type'] != 3) { - - if($value['increment_ratio'] == 0){ - $value['increment_ratio'] = 0; - }else{ - $value['increment_ratio'] = number_format($value['first_ratio']); - } - } if($value['ratio'] == 0) { $value['ratio'] = 0; }else{ @@ -2070,28 +2064,12 @@ function excelSpecialComplementEmplate($data, $all_sum_money, $all_pay_amount, $ } if($value['fax_ratio'] == 0) $value['fax_ratio'] = 0; + $objPHPExcel->getActiveSheet()->setCellValue('D'.$line, $value['ratio'] . '%'); - if ($data['withdraw_type'] == 2) { - $objPHPExcel->getActiveSheet()->setCellValue('D'.$line, $value['increment_ratio'] . '%'); - }else{ - $objPHPExcel->getActiveSheet()->setCellValue('D'.$line, $value['ratio'] . '%'); - } - - - if ($data['withdraw_type'] != 3) { - $objPHPExcel->getActiveSheet()->setCellValue('E'.$line, $value['fax_ratio'] . '%'); - } else { - $objPHPExcel->getActiveSheet()->setCellValue('E'.$line, $value['increment_ratio'] . '%'); - } - + $objPHPExcel->getActiveSheet()->setCellValue('E'.$line, $value['increment_ratio'] . '%'); $objPHPExcel->getActiveSheet()->setCellValue('C'.$line, $value['pay_amount']); - // $objPHPExcel->getActiveSheet()->setCellValue('F'.$line, $value['sum_money']); - if ($data['withdraw_type'] != 3) { - $objPHPExcel->getActiveSheet()->setCellValue('F'.$line,"=ROUND(C{$line}*D{$line}*(1-E{$line}),2)"); - } else { - $objPHPExcel->getActiveSheet()->setCellValue('F'.$line,"=ROUND(C{$line}*E{$line}),2)"); - } + $objPHPExcel->getActiveSheet()->setCellValue('F'.$line,"=ROUND(C{$line}*E{$line},2)"); } $objPHPExcel->getActiveSheet()->setCellValue('B'.$line, $product_name); $line++; @@ -2120,6 +2098,26 @@ function excelSpecialComplementEmplate($data, $all_sum_money, $all_pay_amount, $ $objPHPExcel->getActiveSheet()->setCellValue('E'.($line+9), $data['receive_company']['bank_account']."\t");//银行账号 $objPHPExcel->getActiveSheet()->setCellValue('E'.($line+10), $data['receive_company']['opening_bank']);//开户行 + $height = 20; + $font_size = 44; + + if (strlen($data['pay_company']['partner'])getActiveSheet()->getStyle("E".($line+3).":E".($line+10))->getAlignment()->setWrapText(true); + $objPHPExcel->getActiveSheet()->getStyle("B".($line+3).":B".($line+7))->getAlignment()->setWrapText(true); + $objPHPExcel->getActiveSheet()->getRowDimension(($line+3))->setRowHeight($height*$partner_height); + $objPHPExcel->getActiveSheet()->getRowDimension(($line+6))->setRowHeight($address_height*$height); + $objPHPExcel->getActiveSheet()->getRowDimension(($line+8))->setRowHeight($payee_name_height*$height); + $objPHPExcel->getActiveSheet()->getRowDimension(($line+10))->setRowHeight($opening_bank_height*$height); + $fileName = "{$data['company_name']}&{$data['my_company']}-对账单{$statement_begin_time}-{$statement_end_time}"; // dd($fileName); ob_end_clean();//清除缓冲区,避免乱码 diff --git a/Application/Admin/Controller/CompanyStatementController.class.php b/Application/Admin/Controller/CompanyStatementController.class.php index 72bf601b9..826c93902 100644 --- a/Application/Admin/Controller/CompanyStatementController.class.php +++ b/Application/Admin/Controller/CompanyStatementController.class.php @@ -1,6 +1,8 @@ admininfo = $_SESSION['onethink_admin']['user_auth']; $this->DBModel = SM("CompanyStatement","tab_"); + $Factory = BaseFactory::getInstance(); + self::$specialCompoent = $Factory->factoryClass("SpecialCompoent"); + parent::_initialize(); } public function lists() { @@ -270,6 +279,7 @@ class CompanyStatementController extends ThinkController "first_part_company"=>$first_party_info['partner'], "second_part_company"=>$second_party_info['partner'], "pay_type"=>$dbres['pay_type'], + "is_payment"=>$dbres['is_payment'], "withdraw_type"=>$dbres['withdraw_type'],//2补丁 "first_party_info"=>$first_party_info, "second_party_info"=>$second_party_info, @@ -398,12 +408,7 @@ class CompanyStatementController extends ThinkController // $dbres = $this->DBModel->where("id in ({$ids}) and verify_status = 0")->delete(); $dbres = $this->DBModel->where("id in ({$ids})")->select(); foreach ($dbres as $key=>$value) { - if($value['withdraw_type'] !=3) { - $this->DBModel->where("id = {$value['id']} and verify_status = 0")->delete(); - } else { - $this->DBModel->where("id = {$value['id']} and verify_status != 2")->delete(); - } - + $this->DBModel->where("id = {$value['id']} and verify_status = 0")->delete(); } addOperationLog(['op_type'=>2,'key'=>$ids,"op_name"=>"删除结算单",'url'=>U('lists')]); $this->ajaxReturn(array( @@ -484,19 +489,31 @@ class CompanyStatementController extends ThinkController foreach($dbres as $k=>&$v){ // if(in_array($v['verify_status'],[3,4])) continue; //合作方确认后不进行重算 //重算 - $res = A("CompanyStatementSet")->updateCompanyStatementData($v['id'],$this->admininfo["username"]); - if($res === false){ - $this->ajaxReturn(array( - 'status' => 0, - "info"=>"重算金额错误" - )); + if ($v['withdraw_type']!=3) { + $res = A("CompanyStatementSet")->updateCompanyStatementData($v['id'],$this->admininfo["username"]); + if($res === false){ + $this->ajaxReturn(array( + 'status' => 0, + "info"=>"重算金额错误" + )); + } + } else { + $res = self::$specialCompoent->updateSpecialStatement($v['id'],$v['withdraw_type']); + if($res === false){ + $this->ajaxReturn(array( + 'status' => 0, + "info"=>"重算金额错误" + )); + } } + } $this->ajaxReturn(array( 'status' => 1, "info"=>"重算金额成功" )); - } + } + //导出 public function export() { @@ -565,6 +582,7 @@ class CompanyStatementController extends ThinkController $dbres=[$dbres]; $this->assign("title","下游个人特殊补点"); + $this->assign("is_special_export",true); $this->exportSpecialComplement($dbres,1); } else if ($data['withdraw_type'] == 3 && $data['company_type'] != 2){ @@ -655,17 +673,6 @@ class CompanyStatementController extends ThinkController $count['sum_money'] += $val['sum_money']; } } - // if($is_export){ - // //J3*(K3+L3)+M3-N3 - // if($va['statement_type'] > 0){ //罚款服务器费用 - // $va['sum_money'] = "=J{$line}"; - // }else{ - // $va['sum_money'] = "=J{$line}*(K{$line}+L{$line})+M{$line}-N{$line}"; - // } - // }else{ - // $count['platform_amount'] += $va['pay_amount']; - // $count['sum_money'] += $va['sum_money']; - // } } $v['row'] = $row; if($is_export){ @@ -675,22 +682,15 @@ class CompanyStatementController extends ThinkController } else { $v['statement_money'] = substr($v['statement_money'],0,strlen($v['statement_money'])-1).",2)"; } -// dump($v['statement_money']);die(); } } -// if($is_export){ -// $count["platform_amount"] = "=ROUND(SUM(K2:K".$line."),2)"; -// $count["sum_money"] = "=ROUND(SUM(Q2:Q".$line."),2)"; -// } - if($is_export){ $count["platform_amount"] = "=ROUND(SUM(K2:K".$line."),2)"; $count["week_money"] = "=ROUND(SUM(S2:S".$line."),2)"; $count["sum_money"] = "=ROUND(SUM(T2:T".$line."),2)"; } - $this->assign("withdraw_type",3); $this->assign("data",$infolist); $this->assign("count",$count); $this->assign("is_export",$is_export); @@ -1162,6 +1162,73 @@ class CompanyStatementController extends ThinkController } + public function checkComplementHistory() { + + $data = json_decode($_REQUEST['data'],true); + $return_data = []; + + foreach ($data as $dkey => $dval) { + + $check_add = $this->DBModel->field("statement_begin_time,statement_end_time,statement_info,company_type")->where(['company_id'=>$dval['company_id'],'withdraw_type'=>3])->select(); + + $start_time = strtotime($dval['statement_begin_time']); + $end_time = strtotime($dval['statement_end_time']) + 86399; + + $relation_game_data = array_column($dval['statement_info'],'relation_game_id'); + + foreach ($check_add as $key => $value) { + + + $statementInfo = json_decode($value['statement_info'],true);; + if ($value['company_type'] == 2) { + + foreach ($statementInfo as $sk => $sv) { + $statementInfos = $sv['game_list']; + foreach ($statementInfos as $k => $v) { + if (strtotime(str_replace('.','-',$v['statement_end_time'])) >= $start_time && strtotime(str_replace('.','-',$v['statement_end_time']))<=$end_time + ||strtotime(str_replace('.','-',$v['statement_begin_time']))>=$start_time && strtotime(str_replace('.','-',$v['statement_begin_time']))<=$end_time + ||strtotime(str_replace('.','-',$v['statement_begin_time']))<=$start_time && strtotime(str_replace('.','-',$v['statement_end_time'])) >= $end_time) { + + if (!in_array($v['game_name'], $return_data[$dval['company_name']])) { + $return_data[$dval['company_name']][]=$v['game_name']; + } + + } + } + } + } else { + foreach ($statementInfo as $k => $v) { + if (strtotime(str_replace('.','-',$v['statement_end_time'])) >= $start_time && strtotime(str_replace('.','-',$v['statement_end_time']))<=$end_time + ||strtotime(str_replace('.','-',$v['statement_begin_time']))>=$start_time && strtotime(str_replace('.','-',$v['statement_begin_time']))<=$end_time + ||strtotime(str_replace('.','-',$v['statement_begin_time']))<=$start_time && strtotime(str_replace('.','-',$v['statement_end_time'])) >= $end_time) { + + if (!in_array($v['game_name'], $return_data[$dval['company_name']])) { + $return_data[$dval['company_name']][]=$v['game_name']; + } + + } + } + } + + } + } + + $return_str = ""; + + foreach ($return_data as $key => $value) { + + $return_str .= "[{$key}]"; + + } + + if (!$return_data) { + $this->ajaxReturn(['status' => 0, 'data' => $return_str]); + } else { + $this->ajaxReturn(['status' => 1, 'data' => $return_str]); + } + + } + public function addSpecialComplement() { $map = []; @@ -1195,46 +1262,47 @@ class CompanyStatementController extends ThinkController $start_time = strtotime($_REQUEST['time_start']); $end_time = strtotime($_REQUEST['time_end']) + 86399; - $check_add = $this->DBModel->field("statement_begin_time,statement_end_time,statement_info,company_type")->where(['company_id'=>$_REQUEST['company_id'],'withdraw_type'=>3])->select(); - - foreach ($check_add as $key => $value) { - -// if ($value['statement_end_time'] >= $start_time && $value['statement_end_time']<=$end_time -// ||$value['statement_begin_time']>=$start_time && $value['statement_begin_time']<=$end_time -// ||$value['statement_begin_time']<=$start_time && $value['statement_end_time'] >= $end_time) -// { - - $statementInfo = json_decode($value['statement_info'],true);; - if ($value['company_type'] == 2) { - - foreach ($statementInfo as $sk => $sv) { - $statementInfos = $sv['game_list']; - foreach ($statementInfos as $k => $v) { - if (strtotime(str_replace('.','-',$v['statement_end_time'])) >= $start_time && strtotime(str_replace('.','-',$v['statement_end_time']))<=$end_time - ||strtotime(str_replace('.','-',$v['statement_begin_time']))>=$start_time && strtotime(str_replace('.','-',$v['statement_begin_time']))<=$end_time - ||strtotime(str_replace('.','-',$v['statement_begin_time']))<=$start_time && strtotime(str_replace('.','-',$v['statement_end_time'])) >= $end_time) { - if (in_array($v['relation_game_id'], $relation_game_data)) { - $this->ajaxReturn(['status' => 0, 'data' => [], 'msg' => "《{$v['game_name']}》在日期:{$_REQUEST['time_start']}-{$_REQUEST['time_end']}有结算过的部分,请重新选择"]); - } - } - } - } - } else { - foreach ($statementInfo as $k => $v) { - if (strtotime(str_replace('.','-',$v['statement_end_time'])) >= $start_time && strtotime(str_replace('.','-',$v['statement_end_time']))<=$end_time - ||strtotime(str_replace('.','-',$v['statement_begin_time']))>=$start_time && strtotime(str_replace('.','-',$v['statement_begin_time']))<=$end_time - ||strtotime(str_replace('.','-',$v['statement_begin_time']))<=$start_time && strtotime(str_replace('.','-',$v['statement_end_time'])) >= $end_time) { - if (in_array($v['relation_game_id'], $relation_game_data)) { - $this->ajaxReturn(['status' => 0, 'data' => [], 'msg' => "《{$v['game_name']}》在日期:{$_REQUEST['time_start']}-{$_REQUEST['time_end']}有结算过的部分,请重新选择"]); - } - } - } - } - +// $check_add = $this->DBModel->field("statement_begin_time,statement_end_time,statement_info,company_type")->where(['company_id'=>$_REQUEST['company_id'],'withdraw_type'=>3])->select(); +// +// foreach ($check_add as $key => $value) { +// +//// if ($value['statement_end_time'] >= $start_time && $value['statement_end_time']<=$end_time +//// ||$value['statement_begin_time']>=$start_time && $value['statement_begin_time']<=$end_time +//// ||$value['statement_begin_time']<=$start_time && $value['statement_end_time'] >= $end_time) +//// { +// +// $statementInfo = json_decode($value['statement_info'],true);; +// if ($value['company_type'] == 2) { +// +// foreach ($statementInfo as $sk => $sv) { +// $statementInfos = $sv['game_list']; +// foreach ($statementInfos as $k => $v) { +// if (strtotime(str_replace('.','-',$v['statement_end_time'])) >= $start_time && strtotime(str_replace('.','-',$v['statement_end_time']))<=$end_time +// ||strtotime(str_replace('.','-',$v['statement_begin_time']))>=$start_time && strtotime(str_replace('.','-',$v['statement_begin_time']))<=$end_time +// ||strtotime(str_replace('.','-',$v['statement_begin_time']))<=$start_time && strtotime(str_replace('.','-',$v['statement_end_time'])) >= $end_time) { +// if (in_array($v['relation_game_id'], $relation_game_data)) { +// $this->ajaxReturn(['status' => 0, 'data' => [], 'msg' => "《{$v['game_name']}》在日期:{$_REQUEST['time_start']}-{$_REQUEST['time_end']}有结算过的部分,请重新选择"]); +// } +// } +// } +// } +// } else { +// foreach ($statementInfo as $k => $v) { +// if (strtotime(str_replace('.','-',$v['statement_end_time'])) >= $start_time && strtotime(str_replace('.','-',$v['statement_end_time']))<=$end_time +// ||strtotime(str_replace('.','-',$v['statement_begin_time']))>=$start_time && strtotime(str_replace('.','-',$v['statement_begin_time']))<=$end_time +// ||strtotime(str_replace('.','-',$v['statement_begin_time']))<=$start_time && strtotime(str_replace('.','-',$v['statement_end_time'])) >= $end_time) { +// if (in_array($v['relation_game_id'], $relation_game_data)) { +// $this->ajaxReturn(['status' => 0, 'data' => [], 'msg' => "《{$v['game_name']}》在日期:{$_REQUEST['time_start']}-{$_REQUEST['time_end']}有结算过的部分,请重新选择"]); +// } +// } +// } // } - - } +// +// +//// } +// +// } if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) { @@ -1286,9 +1354,12 @@ class CompanyStatementController extends ThinkController $handleRadioData[$value['relation_game_id']] = $value['relation_game_name']; } + $relationWhere = '(first_company_type=2 and first_company_id=' . $_REQUEST['company_id'] . + ') or (second_company_type=2 and second_company_id=' . $_REQUEST['company_id'] . ')'; + $relation = M('company_relation', 'tab_')->where($relationWhere)->find(); $companyData = M("promote_company","tab_") - ->field("company_name") + ->field("company_name,ali_user,ali_account,bank_address,bank_card,bank_name") ->where(['id'=>$_REQUEST['company_id']]) ->find(); @@ -1303,6 +1374,15 @@ class CompanyStatementController extends ThinkController ->find(); $handleData[$_REQUEST['company_id']]['company_id'] = $_REQUEST['company_id']; + + $handleData[$_REQUEST['company_id']]['is_payment'] = $relation['is_payment']; + + $handleData[$_REQUEST['company_id']]['ali_user'] = $companyData['ali_user']; + $handleData[$_REQUEST['company_id']]['ali_account'] = $companyData['ali_account']; + $handleData[$_REQUEST['company_id']]['payee_name'] = $companyData['bank_address']; + $handleData[$_REQUEST['company_id']]['bank_account'] = $companyData['bank_card']; + $handleData[$_REQUEST['company_id']]['opening_bank'] = $companyData['bank_name']; + $handleData[$_REQUEST['company_id']]['company_name'] = $companyData['company_name']; $handleData[$_REQUEST['company_id']]['begin_time'][] = strtotime(I('time_start')); $handleData[$_REQUEST['company_id']]['end_time'][] = strtotime(I('time_end')) + 86399; @@ -1336,6 +1416,18 @@ class CompanyStatementController extends ThinkController $handleData[$_REQUEST['company_id']]['end_time'][] = strtotime(I('time_end')) + 86399; } $handleData[$_REQUEST['company_id']]['company_id'] = $_REQUEST['company_id']; + + $handleData[$_REQUEST['company_id']]['is_payment'] = $relation['is_payment']; + if ($relation['is_payment'] == 1) { + $handleData[$_REQUEST['company_id']]['payee_name'] = $companyData['ali_user']; + $handleData[$_REQUEST['company_id']]['bank_account'] = $companyData['ali_account']; + $handleData[$_REQUEST['company_id']]['opening_bank'] = ''; + } else { + $handleData[$_REQUEST['company_id']]['payee_name'] = $companyData['bank_address']; + $handleData[$_REQUEST['company_id']]['bank_account'] = $companyData['bank_card']; + $handleData[$_REQUEST['company_id']]['opening_bank'] = $companyData['bank_name']; + } + $handleData[$_REQUEST['company_id']]['company_name'] = $companyData['company_name']; $handleData[$_REQUEST['company_id']]['relation_game_id'][] = $value['relation_game_id']; $handleData[$_REQUEST['company_id']]['relation_game_name'][] = $value['relation_game_name']; @@ -1347,6 +1439,18 @@ class CompanyStatementController extends ThinkController if ($key == 0) { if (strtotime(I('time_start')) < $value['begin_time']) { $handleData[$_REQUEST['company_id']]['company_id'] = $_REQUEST['company_id']; + + $handleData[$_REQUEST['company_id']]['is_payment'] = $relation['is_payment']; + if ($relation['is_payment'] == 1) { + $handleData[$_REQUEST['company_id']]['payee_name'] = $companyData['ali_user']; + $handleData[$_REQUEST['company_id']]['bank_account'] = $companyData['ali_account']; + $handleData[$_REQUEST['company_id']]['opening_bank'] = ''; + } else { + $handleData[$_REQUEST['company_id']]['payee_name'] = $companyData['bank_address']; + $handleData[$_REQUEST['company_id']]['bank_account'] = $companyData['bank_card']; + $handleData[$_REQUEST['company_id']]['opening_bank'] = $companyData['bank_name']; + } + $handleData[$_REQUEST['company_id']]['company_name'] = $companyData['company_name']; $handleData[$_REQUEST['company_id']]['begin_time'][] = strtotime(I('time_start')); $handleData[$_REQUEST['company_id']]['end_time'][] = $value['begin_time']-1; @@ -1362,6 +1466,18 @@ class CompanyStatementController extends ThinkController if (strtotime(I('time_end')) > $value['end_time'] && $value['end_time']!=0) { $handleData[$_REQUEST['company_id']]['company_id'] = $_REQUEST['company_id']; + + $handleData[$_REQUEST['company_id']]['is_payment'] = $relation['is_payment']; + if ($relation['is_payment'] == 1) { + $handleData[$_REQUEST['company_id']]['payee_name'] = $companyData['ali_user']; + $handleData[$_REQUEST['company_id']]['bank_account'] = $companyData['ali_account']; + $handleData[$_REQUEST['company_id']]['opening_bank'] = ''; + } else { + $handleData[$_REQUEST['company_id']]['payee_name'] = $companyData['bank_address']; + $handleData[$_REQUEST['company_id']]['bank_account'] = $companyData['bank_card']; + $handleData[$_REQUEST['company_id']]['opening_bank'] = $companyData['bank_name']; + } + $handleData[$_REQUEST['company_id']]['company_name'] = $companyData['company_name']; $handleData[$_REQUEST['company_id']]['begin_time'][] = $value['end_time'] + 1; $handleData[$_REQUEST['company_id']]['end_time'][] = strtotime(I('time_end'))-86399; @@ -1376,6 +1492,18 @@ class CompanyStatementController extends ThinkController if ($radioData[$key+1]) { if ($radioData[$key+1]['begin_time'] != ($value['end_time']+1)&&$value['end_time']!=0) { $handleData[$_REQUEST['company_id']]['company_id'] = $_REQUEST['company_id']; + + $handleData[$_REQUEST['company_id']]['is_payment'] = $relation['is_payment']; + if ($relation['is_payment'] == 1) { + $handleData[$_REQUEST['company_id']]['payee_name'] = $companyData['ali_user']; + $handleData[$_REQUEST['company_id']]['bank_account'] = $companyData['ali_account']; + $handleData[$_REQUEST['company_id']]['opening_bank'] = ''; + } else { + $handleData[$_REQUEST['company_id']]['payee_name'] = $companyData['bank_address']; + $handleData[$_REQUEST['company_id']]['bank_account'] = $companyData['bank_card']; + $handleData[$_REQUEST['company_id']]['opening_bank'] = $companyData['bank_name']; + } + $handleData[$_REQUEST['company_id']]['company_name'] = $companyData['company_name']; $handleData[$_REQUEST['company_id']]['begin_time'][] = $value['end_time'] + 1; $handleData[$_REQUEST['company_id']]['end_time'][] = $radioData[$key+1]['begin_time'] - 1; @@ -1437,7 +1565,6 @@ class CompanyStatementController extends ThinkController } - $this->ajaxReturn(['status'=>1,'data'=>$handleData,'msg'=>'']); } @@ -1466,15 +1593,15 @@ class CompanyStatementController extends ThinkController $begin_time = 99999999999; $end_time = 0; $statement_data = []; + $company_data = M("promote_company","tab_")->where(['id'=>$value['company_id']])->find(); -// dump($company_data);die(); + $company_type = M("company_relation","tab_") + ->where("(first_company_id={$value['company_id']} and first_company_type =2) or (second_company_id={$value['company_id']} and second_company_type=2)") + ->find(); - $company_type = M("company_relation","tab_")->where("first_company_id={$value['company_id']} or second_company_id={$value['company_id']}")->find(); + $insert['is_payment'] = $value['is_payment']; - $insert['is_payment'] = $company_type['is_payment']; -// $insert['statement_begin_time'] = strtotime($value['statement_begin_time']); -// $insert['statement_end_time'] = strtotime($value['statement_end_time']); $insert['withdraw_type'] = $withdraw_type; $insert['company_belong'] = $company_data['company_belong']; $insert['company_name'] = $company_data['company_name']; @@ -1488,18 +1615,18 @@ class CompanyStatementController extends ThinkController $proCompany_info['link_man'] = $company_data['settlement_contact']; $proCompany_info['link_phone'] =$company_data['contact_phone']; $proCompany_info['address'] = $company_data['address']; - $proCompany_info['payee_name'] =$company_data['bank_address']; + $proCompany_info['payee_name'] =$value['payee_name']; - $proCompany_info['bank_account'] = $company_data['bank_card']; - $proCompany_info['opening_bank'] =$company_data['bank_name']; + $proCompany_info['bank_account'] = $value['bank_account']; + $proCompany_info['opening_bank'] =$value['opening_bank']; $proCompany_info['fax_ratio'] = $company_data['fax_ratio']; $proCompany_info['taxation_rate'] = $company_data['taxation_rate']; $proCompany_info['company_belong'] = $company_data['company_belong']; $proCompany_info['company_type'] = $company_data['company_type']; $proCompany_info['develop_type'] = $company_data['develop_type']; - $proCompany_info['ali_user'] = $company_data['ali_user']; - $proCompany_info['ali_account'] =$company_data['ali_account']; + $proCompany_info['ali_user'] = $value['ali_user']; + $proCompany_info['ali_account'] =$value['ali_account']; $proCompany_info['has_server_fee'] = $company_data['has_server_fee']; $proCompany_info['server_fee'] =$company_data['server_fee']; @@ -1605,7 +1732,7 @@ class CompanyStatementController extends ThinkController $game_list['game_name'] = $aval['relation_game_name']; $game_list['game_type_name'] = $aval['game_type_name']; - $game_list['ratio'] = $v['ratio']; + $game_list['ratio'] = floatval($v['ratio']); $game_list['fax_ratio'] = $company_data['fax_ratio']; $game_list['sum_money'] = ($aval['pay_amount']*($v['increment_ratio']))/100; $game_list['increment_ratio'] = $v['increment_ratio']; @@ -1712,9 +1839,9 @@ class CompanyStatementController extends ThinkController $optist = array_diff($optist, ["addRemark"]); } - if ($withdraw_type == 3) { - $optist = array_diff($optist, ["editStatement"]); - } +// if ($withdraw_type == 3) { +// $optist = array_diff($optist, ["editStatement"]); +// } $resarr = []; foreach ($optist as $k => $v) { diff --git a/Application/Admin/Controller/CompanyStatementPoolController.class.php b/Application/Admin/Controller/CompanyStatementPoolController.class.php index 411003d29..377a00c0a 100644 --- a/Application/Admin/Controller/CompanyStatementPoolController.class.php +++ b/Application/Admin/Controller/CompanyStatementPoolController.class.php @@ -2153,12 +2153,21 @@ class CompanyStatementPoolController extends ThinkController if ($info['company_type'] == 2 && $info['verify_status'] == '0') { array_push($optist,'editSpecialPuPool'); } + } if(($info['verify_status'] == '6' || $info['verify_status'] == '0') &&!($info['company_type'] == 2 && $info['withdraw_type'] == "特殊补点")) { array_push($optist,"editPool"); } + if ($info['withdraw_type'] == "特殊补点") { + $optist = array_diff($optist, ["cancelPool"]); + + if ($info['verify_status'] == '0') { + array_push($optist,"cancelPool"); + } + } + if(empty($info['ext_file'])){ //未上传凭证 $optist = array_diff($optist, ["viewVoucher", "editVoucher"]); diff --git a/Application/Admin/View/CompanyStatement/editPcComplementStatement.html b/Application/Admin/View/CompanyStatement/editPcComplementStatement.html index ef64612f4..2150e8ba0 100644 --- a/Application/Admin/View/CompanyStatement/editPcComplementStatement.html +++ b/Application/Admin/View/CompanyStatement/editPcComplementStatement.html @@ -234,24 +234,26 @@
- - - - - - - - + + + + + + + + + +
收款方名称: - -
银行账号: - -
收款方名称:支付宝真实姓名: + value="${party_info.payee_name}"value="${party_info.ali_user}"> +
银行账号:支付宝账号: + value="${party_info.bank_account}"value="${party_info.ali_account}" placeholder=""> +
开户行: - +
@@ -317,24 +319,26 @@
- - - - - - - - + + + + + + + + + +
收款方名称: - -
银行账号: - -
收款方名称:支付宝真实姓名: + data-change="${type}.payee_name" name="payee_name" value="${party_info.payee_name}"value="${party_info.ali_user}" data-change="${type}.ali_user" name="ali_user" > +
银行账号:支付宝账号: + data-change="${type}.bank_account" name="bank_account" value="${party_info.bank_account}"value="${party_info.ali_account}" data-change="${type}.ali_account" name="ali_account" placeholder=""> +
开户行: - +
diff --git a/Application/Admin/View/CompanyStatement/editPuComplementStatement.html b/Application/Admin/View/CompanyStatement/editPuComplementStatement.html index 3efbfb386..a1d18ff01 100644 --- a/Application/Admin/View/CompanyStatement/editPuComplementStatement.html +++ b/Application/Admin/View/CompanyStatement/editPuComplementStatement.html @@ -236,23 +236,25 @@ - + - + - - - - + + + + + +
收款方名称:收款方名称:支付宝真实姓名: - + value="{$data.payinfo.payee_name}"value="{$data.payinfo.ali_user}">
银行账号:银行账号:支付宝账号: - -
开户行: - + value="{$data.payinfo.bank_account}"value="{$data.payinfo.ali_account}" disabled="disabled" placeholder="">
开户行: + +
@@ -319,23 +321,25 @@ - + - + - - - - + + + + + +
收款方名称:收款方名称:支付宝真实姓名: - + data-change="${type}.payee_name" name="payee_name" value="${party_info.payee_name}" data-change="${type}.ali_user" name="ali_user" value="${party_info.ali_user}">
银行账号:银行账号:支付宝账号: - -
开户行: - + data-change="${type}.bank_account" name="bank_account" value="${party_info.bank_account}"data-change="${type}.ali_account" name="ali_account" value="${party_info.ali_account}" placeholder="">
开户行: + +
@@ -391,11 +395,11 @@ {@if it['game_list'][0]['statement_type']==0} {@if withdraw_type==2} - % + % {@else} - % + % {@/if} - % + % {@else} @@ -421,11 +425,11 @@ {@/if} {@if it_g['statement_type']==0} {@if withdraw_type==2} - % + % {@else} - % + % {@/if} - % + % {@else} @@ -571,6 +575,7 @@ $(".statementchange").on("blur",function(){ var sort = $(this).data("change"); var val = $(this).val(); + var vdata = eval("DATAOBJ."+sort);//原先值 var dom = $(this); @@ -589,30 +594,25 @@ } eval(str); var index = $(this).data("index"); - var td = DATAOBJ.statement_info[index]; + var secindex = $(this).data("secindex"); + var td = DATAOBJ.statement_info[index].game_list[secindex]; + var withdraw_type = DATAOBJ['withdraw_type']; var rname = $(this).attr("name"); var ratio = 0; - if( rname == "fax_ratio" || rname == "ratio"){ + if( rname == "fax_ratio" || rname == "ratio" || rname == "increment_ratio" ){ ratio = val; }else{ ratio = td['ratio']; } - var gamelist = td['game_list']; - td['sum_money'] = 0; - for (var item in gamelist) { - - td['sum_money'] += (gamelist[item]['pay_amount'] * parseInt(val))/100; - console.log(td['sum_money']) + DATAOBJ.statement_money = PUBLIC.floatCut(DATAOBJ.statement_money,td['sum_money']); + if (withdraw_type == 3) { + td['sum_money'] = td['pay_amount']*ratio/100; + } else { + td['sum_money'] = Math.round(td['pay_amount']*ratio*(100-td['fax_ratio'])/100,2)/100; } - console.log(td['sum_money']);return - - DATAOBJ.statement_money = PUBLIC.floatCut(DATAOBJ.statement_money,td['sum_money']); - td['sum_money'] = td['pay_amount']*(parseFloat(ratio))/100; - td['sum_money'] = (td['sum_money']).toFixed(2); - DATAOBJ.statement_money=PUBLIC.floatAdd(DATAOBJ.statement_money,td['sum_money']); TPLSHOW.showStatementList(true); diff --git a/Application/Admin/View/CompanyStatement/lists.html b/Application/Admin/View/CompanyStatement/lists.html index 609360396..32126b2e5 100644 --- a/Application/Admin/View/CompanyStatement/lists.html +++ b/Application/Admin/View/CompanyStatement/lists.html @@ -486,7 +486,7 @@ }else if(id=="delStatement"){ var opname = "批量删除"; var opurl = "{:U('delStatement')}"; - var opst ="[未进行审批,特殊补点(除汇总状态)]"; + var opst ="[未进行审批]"; var status = [0]; var confirm = true; } @@ -494,11 +494,13 @@ var flag = false; var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) { - if (id=="delStatement"&&$(elem).data("type")==3&&$(elem).data("status") == 2) { - flag = true; - } + // if (id=="delStatement"&&$(elem).data("type")==3&&$(elem).data("status") == 0) { + // return $(elem).val(); + // } else if(id=="delStatement"&&$(elem).data("type")==3&&$(elem).data("status") == 2) { + // flag = true; + // } - if($.inArray( $(elem).data("status"),status) == -1||(id=="updateStatement" && $(elem).data("type")==3)){ + if($.inArray( $(elem).data("status"),status) == -1){ flag = true; }else{ return $(elem).val(); @@ -514,7 +516,7 @@ return; } text = text.join(","); - console.log(text); + // console.log(text); if(flag){ layer.confirm(opname+"仅会对"+opst+"的申请进行处理,选择中包含其他的状态的申请将被忽略,点击取消停止操作",{title:false}, function(index){ layer.close(index); diff --git a/Application/Admin/View/CompanyStatement/viewPcStatement.html b/Application/Admin/View/CompanyStatement/viewPcStatement.html index 32dfe40df..b0ae3a7d6 100644 --- a/Application/Admin/View/CompanyStatement/viewPcStatement.html +++ b/Application/Admin/View/CompanyStatement/viewPcStatement.html @@ -267,25 +267,47 @@
+ + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + +
收款方名称: - -
银行账号: - -
收款方名称:支付宝真实姓名: + value="{$data.payinfo.payee_name}"value="{$data.payinfo.ali_user}"> +
银行账号:支付宝账号: + value="{$data.payinfo.bank_account}"value="{$data.payinfo.ali_account}" placeholder=""> +
开户行: - +
diff --git a/Application/Admin/View/CompanyStatement/viewPuComplementStatement.html b/Application/Admin/View/CompanyStatement/viewPuComplementStatement.html index 44181396d..0e846aa60 100644 --- a/Application/Admin/View/CompanyStatement/viewPuComplementStatement.html +++ b/Application/Admin/View/CompanyStatement/viewPuComplementStatement.html @@ -196,18 +196,19 @@ - + - - - - - + + + + + +
开户名:开户名:支付宝真实姓名: - -
开户支行: - + value="{$data.payinfo.payee_name}"value="{$data.payinfo.ali_user}">
开户支行: + value="{$data.payinfo.opening_bank}"value="" disabled="disabled"> +
@@ -215,9 +216,9 @@ - + diff --git a/Application/Admin/View/CompanyStatement/viewSpecialComplement.html b/Application/Admin/View/CompanyStatement/viewSpecialComplement.html index b99494de1..3fce5c2e3 100644 --- a/Application/Admin/View/CompanyStatement/viewSpecialComplement.html +++ b/Application/Admin/View/CompanyStatement/viewSpecialComplement.html @@ -208,6 +208,10 @@ + + + + @@ -219,6 +223,10 @@ + + + +
银行卡号:银行卡号:支付宝账号: - + value="{$data.payinfo.bank_account}"value="{$data.payinfo.ali_account}" disabled="disabled" placeholder="">
分成比例 特殊补点 结算金额是否支付宝打款户名账号开户行 操作