优化下游结算单导出

master
chenzhi 4 years ago
parent 82787ca561
commit 9ee69f9bd4

@ -1974,7 +1974,7 @@ function excelUpStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_all_
$statement_begin_time = date('Y.m.d', $data['statement_begin_time']);//对账开始时间 $statement_begin_time = date('Y.m.d', $data['statement_begin_time']);//对账开始时间
$statement_end_time = date('Y.m.d',$data['statement_end_time']);//对账截止时间 $statement_end_time = date('Y.m.d',$data['statement_end_time']);//对账截止时间
$fileName = "{$data['second_party_info']['partner']}&{$data['first_party_info']['partner']}-对账单{$statement_begin_time}-{$statement_end_time}"; $fileName = "{$data['company_name']}&{$data['my_company']}-对账单{$statement_begin_time}-{$statement_end_time}";
ob_end_clean();//清除缓冲区,避免乱码 ob_end_clean();//清除缓冲区,避免乱码
header('pragma:public'); header('pragma:public');
@ -2013,7 +2013,8 @@ function excelDownStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_al
$line = 3; $line = 3;
$pay_amount_str = "="; $pay_amount_str = "=SUM(F3:";
$plat_amount_str = "=SUM(C3:";
foreach ($data['statement_info'] as $key => $value) { foreach ($data['statement_info'] as $key => $value) {
$objPHPExcel->getActiveSheet()->insertNewRowBefore($line,1); $objPHPExcel->getActiveSheet()->insertNewRowBefore($line,1);
$objPHPExcel->getActiveSheet()->removeConditionalStyles(); $objPHPExcel->getActiveSheet()->removeConditionalStyles();
@ -2061,12 +2062,11 @@ function excelDownStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_al
$objPHPExcel->getActiveSheet()->setCellValue('F'.$line,"=C{$line}*D{$line}*(1-E{$line})"); $objPHPExcel->getActiveSheet()->setCellValue('F'.$line,"=C{$line}*D{$line}*(1-E{$line})");
} }
$objPHPExcel->getActiveSheet()->setCellValue('B'.$line, $product_name); $objPHPExcel->getActiveSheet()->setCellValue('B'.$line, $product_name);
$pay_amount_str .= "F{$line}+";
$line++; $line++;
} }
$objPHPExcel->getActiveSheet()->setCellValue('C'.($line), $data['pay_amount']);//合计-平台总额 $objPHPExcel->getActiveSheet()->setCellValue('C'.($line), $plat_amount_str."C".($line-1).")");//合计-平台总额
$objPHPExcel->getActiveSheet()->setCellValue('F'.($line), trim($pay_amount_str,"+"));//合计-结算金额 $objPHPExcel->getActiveSheet()->setCellValue('F'.($line), $pay_amount_str."F".($line-1).")");//合计-结算金额
// $objPHPExcel->getActiveSheet()->setCellValue('B'.($line+1), $big_all_sum_money);//大写支付结算金额 // $objPHPExcel->getActiveSheet()->setCellValue('B'.($line+1), $big_all_sum_money);//大写支付结算金额

@ -440,12 +440,13 @@ class CompanyStatementController extends ThinkController
} else{ } else{
$data['receive_company']['invoice_type']="普票"; $data['receive_company']['invoice_type']="普票";
} }
if ($data['company_belong'] == 9) {//上游
if($data['company_name'] == $data['first_party_info']['partner']){ if($data['company_name'] == $data['first_party_info']['partner']){
$data['my_company'] = $data['second_party_info']['partner']; $data['my_company'] = $data['second_party_info']['partner'];
}else{ }else{
$data['my_company'] = $data['first_party_info']['partner']; $data['my_company'] = $data['first_party_info']['partner'];
} }
if ($data['company_belong'] == 9) {//上游
excelUpStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_all_sum_money); excelUpStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_all_sum_money);
} else { } else {
//下游 //下游

Loading…
Cancel
Save