Merge branch 'feature/add_item' of wmtx/platform into release

聚合结算单导出个人与公司导出不相同
master
郑永星 4 years ago committed by Gogs
commit ac14a6be90

@ -644,7 +644,30 @@ class AggregateFinanceStatementController extends ThinkController
$data['pay_company'] = $data['first_party_info'];
}
$this->doAddOperationLog($id,"导出");
$this->excelDownStreamTemplate($data,$big_pay_money);
$relation = M("company_relation","tab_")->where("(first_company_id={$data['channel_id']} and first_company_type=3) or (second_company_id = {$data['channel_id']} and second_company_type=3)")->find();
$company_type = 0;
$company_info = [];
if ($relation['first_company_type'] == 3) {
$company_info = json_decode($relation['first_company_info'],true);
} elseif($relation['second_company_type'] == 3) {
$company_info = json_decode($relation['second_company_info'],true);
}
if ($company_info['company_type']=='个人') {
$company_type = 1;
} elseif($company_info['company_type']=='公司') {
$company_type = 2;
}
if ($company_type == 1) {
$this->excelDownStreamPersonTemplate($data,$big_pay_money);
} else {
$this->excelDownStreamTemplate($data,$big_pay_money);
}
}
public function excelDownStreamTemplate($data,$big_all_sum_money) {
@ -670,6 +693,8 @@ class AggregateFinanceStatementController extends ThinkController
$objPHPExcel->getActiveSheet()->setCellValue('D2','补点比例');
}
$line = 3;
$pay_amount_str = "=SUM(F3:";
$plat_amount_str = "=SUM(C3:";
foreach ($data['statement_info'] as $key => $value) {
$objPHPExcel->getActiveSheet()->insertNewRowBefore($line,1);
$objPHPExcel->getActiveSheet()->removeConditionalStyles();
@ -690,8 +715,12 @@ class AggregateFinanceStatementController extends ThinkController
$objPHPExcel->getActiveSheet()->getStyle('F'.$line)->getFont()->setBold(false);
$line++;
}
$objPHPExcel->getActiveSheet()->setCellValue('C'.($line), $data['pay_money']);//合计-平台总额
$objPHPExcel->getActiveSheet()->setCellValue('F'.($line), $data['ratio_money']);//合计-结算金额
$objPHPExcel->getActiveSheet()->setCellValue('C'.($line), $plat_amount_str."C".($line-1).")");//合计-平台总额
$objPHPExcel->getActiveSheet()->setCellValue('F'.($line), $pay_amount_str."F".($line-1).")");//合计-结算金额
// $objPHPExcel->getActiveSheet()->setCellValue('C'.($line), $data['pay_money']);//合计-平台总额
// $objPHPExcel->getActiveSheet()->setCellValue('F'.($line), $data['ratio_money']);//合计-结算金额
$objPHPExcel->getActiveSheet()->setCellValue('B'.($line+1), $big_all_sum_money);//大写支付结算金额
//甲方信息
$objPHPExcel->getActiveSheet()->setCellValue('B'.($line+3), $data['first_party_info']['partner']);//甲方
@ -751,7 +780,7 @@ class AggregateFinanceStatementController extends ThinkController
$objPHPExcel = new \PHPExcel();
$objReader = \PHPExcel_IOFactory::createReader('Excel5');
//设置模板文件
$objPHPExcel = $objReader->load("Public/Admin/excel/aggregate_stream.xls");
$objPHPExcel = $objReader->load("Public/Admin/excel/aggregate_person_stream.xls");
$statement_begin_time = date('Y.m.d', $data['begintime']);//对账开始时间
$statement_end_time = date('Y.m.d',$data['endtime']);//对账截止时间

@ -261,8 +261,8 @@ class AggregateStatementPoolController extends ThinkController
$v['statement_count'] = count($v['statement_info']);
}
if($is_export){
$count["platform_amount"] = "=SUM(G2:G".$line.")";
$count["sum_money"] = "=SUM(L2:L".$line.")";
$count["platform_amount"] = "=ROUND(SUM(G2:G".$line."),2)";
$count["sum_money"] = "=ROUND(SUM(L2:L".$line."),2)";
}
$this->assign("data",$infolist);

Loading…
Cancel
Save