diff --git a/Application/Admin/Common/extend.php b/Application/Admin/Common/extend.php index 825ea9ac0..5a5f262ec 100644 --- a/Application/Admin/Common/extend.php +++ b/Application/Admin/Common/extend.php @@ -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_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();//清除缓冲区,避免乱码 header('pragma:public'); @@ -2013,7 +2013,8 @@ function excelDownStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_al $line = 3; - $pay_amount_str = "="; + $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(); @@ -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('B'.$line, $product_name); - $pay_amount_str .= "F{$line}+"; $line++; } - $objPHPExcel->getActiveSheet()->setCellValue('C'.($line), $data['pay_amount']);//合计-平台总额 - $objPHPExcel->getActiveSheet()->setCellValue('F'.($line), trim($pay_amount_str,"+"));//合计-结算金额 + $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('B'.($line+1), $big_all_sum_money);//大写支付结算金额 diff --git a/Application/Admin/Controller/CompanyStatementController.class.php b/Application/Admin/Controller/CompanyStatementController.class.php index 88586be60..991faac34 100644 --- a/Application/Admin/Controller/CompanyStatementController.class.php +++ b/Application/Admin/Controller/CompanyStatementController.class.php @@ -440,12 +440,13 @@ class CompanyStatementController extends ThinkController } else{ $data['receive_company']['invoice_type']="普票"; } + if($data['company_name'] == $data['first_party_info']['partner']){ + $data['my_company'] = $data['second_party_info']['partner']; + }else{ + $data['my_company'] = $data['first_party_info']['partner']; + } + if ($data['company_belong'] == 9) {//上游 - if($data['company_name'] == $data['first_party_info']['partner']){ - $data['my_company'] = $data['second_party_info']['partner']; - }else{ - $data['my_company'] = $data['first_party_info']['partner']; - } excelUpStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_all_sum_money); } else { //下游 diff --git a/Public/Admin/excel/down_stream.xls b/Public/Admin/excel/down_stream.xls index 49582ce0d..a8539a39d 100644 Binary files a/Public/Admin/excel/down_stream.xls and b/Public/Admin/excel/down_stream.xls differ