新增上游导出查看

master
chenzhi 4 years ago
parent 10707657c5
commit b75bcdbb1c

@ -2001,6 +2001,83 @@ function excelUpStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_all_
}
//子站上游cp对账单导出
function excelSubUpStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_all_sum_money) {
header("Content-type: text/html; charset=utf-8");
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
Vendor("PHPExcel.PHPExcel");
$objReader = \PHPExcel_IOFactory::createReader('Excel5');
//设置模板文件
$objPHPExcel = $objReader->load("Public/Admin/excel/sub_up_stream.xls");
//增加甲方信息
$objPHPExcel->getActiveSheet()->setCellValue('D2', $data['first_party_info']['partner']);
$objPHPExcel->getActiveSheet()->setCellValue('D3', $data['first_party_info']['link_man']);
$objPHPExcel->getActiveSheet()->setCellValue('D4', $data['first_party_info']['link_phone']."\t");
$objPHPExcel->getActiveSheet()->setCellValue('D5', $data['first_party_info']['address']);
$objPHPExcel->getActiveSheet()->setCellValue('D6', $data['first_party_info']['company_tax_no']);
//增加乙方信息
$objPHPExcel->getActiveSheet()->setCellValue('J2', $data['second_party_info']['partner']);
$objPHPExcel->getActiveSheet()->setCellValue('J3', $data['second_party_info']['link_man']);
$objPHPExcel->getActiveSheet()->setCellValue('J4', $data['second_party_info']['link_phone']."\t");
$objPHPExcel->getActiveSheet()->setCellValue('J5', $data['second_party_info']['address']);
$objPHPExcel->getActiveSheet()->setCellValue('J6', $data['second_party_info']['company_tax_no']." ");
$objPHPExcel->getActiveSheet()->setCellValue('C7', "支付给:".$data['receive_company']['partner']); //增加支付给对应公司
$line = 9;
//记录统计项目
$pay_amount_str = "=SUM(J9:";
$plat_amount_str = "=SUM(E9:";
$listCount = count($data['statement_info']);
$listLineMax = $line+$listCount-1;
$objPHPExcel->getActiveSheet()->insertNewRowBefore($line,$listCount)->mergeCells("F$line:G{$listLineMax}")->mergeCells("H$line:I{$listLineMax}")->mergeCells("J$line:K{$listLineMax}");
//增加结算记录
foreach ($data['statement_info'] as $key => $value) {
if($line == 9){
//初始行
$objPHPExcel->getActiveSheet()->setCellValue('F'.$line, $value['promote_ratio'] . '%')->setCellValue('H'.$line, $value['fax_ratio'] . '%')->setCellValue('J'.$line, $all_pay_amount);
}
$objPHPExcel->getActiveSheet()->mergeCells("D$line:E{$line}");
$objPHPExcel->getActiveSheet()->setCellValue('C'.$line, $value['statement_begin_time'].'-'.$value['statement_end_time']);
if ($value['statement_type'] > 0) {
} else {
$product_name = $value['game_name'];
$objPHPExcel->getActiveSheet()->setCellValue('D'.$line, $product_name);
}
$line++;
}
$objPHPExcel->getActiveSheet()->setCellValue("J" . ($line), "=J9"); //本月分成总金额(人民币大写)
//收款方
$objPHPExcel->getActiveSheet()->setCellValue("D" . ($line+1), $data['receive_company']['payee_name']);
$objPHPExcel->getActiveSheet()->setCellValue("D" . ($line+2), $data['receive_company']['bank_account']."\t");
$objPHPExcel->getActiveSheet()->setCellValue("D" . ($line+3), $data['receive_company']['opening_bank']);
//付款方
$objPHPExcel->getActiveSheet()->setCellValue("J" . ($line+1), $data['pay_company']['payee_name']);
$objPHPExcel->getActiveSheet()->setCellValue("J" . ($line+2), $data['pay_company']['bank_account']."\t");
$objPHPExcel->getActiveSheet()->setCellValue("J" . ($line+3), $data['pay_company']['opening_bank']);
$statement_begin_time = date('Y.m.d', $data['statement_begin_time']);//对账开始时间
$statement_end_time = date('Y.m.d',$data['statement_end_time']);//对账截止时间
$fileName = "{$data['company_name']}&{$data['my_company']}-对账单{$statement_begin_time}-{$statement_end_time}";
ob_end_clean();//清除缓冲区,避免乱码
header('pragma:public');
header('Content-type:application/vnd.ms-excel;charset=utf-8;name="' . $fileName .'".xls');
header("Content-Disposition:attachment;filename={$fileName}.xls");//attachment新窗口打印inline本窗口打印
$objWriter = \PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter->save('php://output');
exit;
}
//下游工会对账单导出
function excelSpecialComplementEmplate($data, $all_sum_money, $all_pay_amount, $big_all_sum_money) {

@ -284,14 +284,20 @@ class CompanyStatementController extends ThinkController
"first_party_info"=>$first_party_info,
"second_party_info"=>$second_party_info,
"statement_info"=>$statement_info,
"statement_count"=>array("pay_amount"=>$dbres['pay_amount'],"statement_money"=>$dbres['statement_money'],"big_ratio_money"=>convertAmountToCn($dbres['statement_money']))
"statement_count"=>array("pay_amount"=>$dbres['pay_amount'],"list_count"=>count($statement_info),"statement_money"=>$dbres['statement_money'],"big_ratio_money"=>convertAmountToCn($dbres['statement_money']))
);
$this->assign("data",$senddata);
// dd($senddata);
if($dbres["company_belong"] == 9){
//上游
$this->display("viewCpStatement");
if(!IS_SUBSITE){
$this->display("viewCpStatement");
}else{
$this->display("subViewCpStatement");
}
}else{
if ($dbres["withdraw_type"] == 3) {
if($dbres["company_type"] == 1){
@ -562,7 +568,12 @@ class CompanyStatementController extends ThinkController
}
if ($data['company_belong'] == 9) {//上游
excelUpStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_all_sum_money);
if(!IS_SUBSITE){
excelUpStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_all_sum_money);
}else{
excelSubUpStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_all_sum_money);
}
} else {
//下游
// if($dbres["company_type"] == 1){

@ -0,0 +1,273 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" type="text/css" href="__CSS__/base.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/common.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/style.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/default_color.css" media="all">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<script type="text/javascript" src="__STATIC__/jquery-2.0.3.min.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<script type="text/javascript" src="__STATIC__/layer3/layer.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"charset="UTF-8"></script>
<script src="__STATIC__/juicer-min.js" type="text/javascript"></script>
</head>
<style>
html {
min-width:100%;
}
body {
padding: 0px 0px 150px;
width: 960px;
margin: auto;
}
.tabcon1711 table{
width: 480px;
}
table{
margin: auto;
}
.hidebox{
display: none;
}
.r{
width: 300px;
}
.l{
width: 180px;
}
.select2-container--default .select2-selection--single {
color: #000;
resize: none;
border-width: 1px;
border-style: solid;
border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
box-shadow: 0px 3px 3px #F7F8F9 inset;
height: 35px;
height: 28px;
border-radius: 3px;
font-size: 12px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
line-height: 35px;
line-height: 28px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height: 26px;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
height: 26px;
line-height: 26px;
font-size: 12px;
}
.select2-results__option[aria-selected] {
font-size: 12px;
}
.input-list, .i_list {
float: left;
margin: 0;
}
</style>
<body>
<!-- <div style="width: 100%;line-height: 100px;font-size: 25px;font-weight: 600;text-align: center;">
海南万盟天下科技有限公司
</div> -->
<div style="display: flex;margin: auto;">
<if condition="$data['first_party_info']">
<div class="tab-content tabcon1711" id="firstPartBaseInfo">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="l">甲方:</td>
<td class="r">
<div class="input-list input-list-game search_label_rehab">
<select id="first_partner_id" name="partner_id" class="select_gallery">
<option value="{$data['first_party_info']['id']}" selected>{$data['first_part_company']}</option>
</select>
</div>
</td>
</tr>
<tbody id="first_part_bser_info_show">
<tr>
<td class="l">联系人:</td>
<td class="r">
<input type="text" class="txt" name="link_man" value="{$data['first_party_info']['link_man']}" disabled="disabled" placeholder="">
</td>
</tr>
<tr>
<td class="l">联系电话:</td>
<td class="r">
<input type="text" class="txt" name="link_phone" value="{$data['first_party_info']['link_phone']}" disabled="disabled" placeholder="">
</td>
</tr>
<tr>
<td class="l">邮寄地址:</td>
<td class="r">
<input type="text" class="txt" name="address" value="{$data['first_party_info']['address']}" disabled="disabled" placeholder="">
</td>
</tr>
<tr>
<td class="l">公司税号:</td>
<td class="r">
<input type="text" class="txt" name="company_tax_no" disabled="disabled" value="{$data['first_party_info']['company_tax_no']}" placeholder="">
</td>
</tr>
</tbody>
</tbody>
</table>
</div>
</if>
<if condition="$data['second_party_info']">
<div class="tab-content tabcon1711" id="secondPartBaseInfo">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="l">乙方:</td>
<td class="r">
<div class="input-list input-list-game search_label_rehab">
<select id="second_partner_id" name="partner_id" class="select_gallery">
<option value="{$data['second_party_info']['id']}" selected>{$data['second_part_company']}</option>
</select>
</div>
</td>
</tr>
<tbody id="second_part_bser_info_show">
<tr>
<td class="l">联系人:</td>
<td class="r">
<input type="text" class="txt" name="link_man" value="{$data['second_party_info']['link_man']}" disabled="disabled" placeholder="">
</td>
</tr>
<tr>
<td class="l">联系电话:</td>
<td class="r">
<input type="text" class="txt" name="link_phone" value="{$data['second_party_info']['link_phone']}" disabled="disabled" placeholder="">
</td>
</tr>
<tr>
<td class="l">邮寄地址:</td>
<td class="r">
<input type="text" class="txt" name="address" value="{$data['second_party_info']['address']}" disabled="disabled" placeholder="">
</td>
</tr>
<tr>
<td class="l">公司税号:</td>
<td class="r">
<input type="text" class="txt" name="company_tax_no" value="{$data['second_party_info']['company_tax_no']}" disabled="disabled" placeholder="">
</td>
</tr>
</tbody>
</tbody>
</table>
</div>
</if>
</div>
<if condition="$data['company']">
<div style="padding: 30px 0px 10px;display: block;height:30px;">
<div class="input-list input-list-server search_label_rehab">
<p style="font-size: 20px;font-weight: 600;">支付给:<spen style="margin-left: 15px;font-size: 16px;">{$data.company}
</spen>
</p>
</div>
</div>
</if>
<div class="data_list box_mt" style="margin-top: 10px;">
<div class="">
<table>
<!-- 表头 -->
<thead>
<tr>
<th style="border-right: solid 1px #b6cad2;">结算时间</th>
<th style="border-right: solid 1px #b6cad2;">合作产品</th>
<th style="border-right: solid 1px #b6cad2;">渠道费率</th>
<th style="border-right: solid 1px #b6cad2;">税费费率</th>
<th>结算金额</th>
</tr>
</thead>
<tbody id="statementShow">
<foreach name="data.statement_info" item="it" >
<tr>
<td>{$it.statement_begin_time}-{$it.statement_end_time}</td>
<td>{$it.game_name}</td>
<if condition="$key eq 0">
<td rowspan="{$data['statement_count']['list_count']}">{$it.promote_ratio|showNumPercent}</td>
<td rowspan="{$data['statement_count']['list_count']}">{$it.fax_ratio|showNumPercent}</td>
<td rowspan="{$data['statement_count']['list_count']}">{$data['statement_count']['statement_money']}</td>
</if>
</tr>
</foreach>
<tr style="border-top: solid 1px #b6cad2;">
<td colspan=4>本月分成总金额(人民币大写):</td>
<td>{$data.statement_count.big_ratio_money}</td>
</tr>
</tbody>
</table>
</div>
</div>
<if condition="$data['payinfo']">
<div id="partpatinfo" style="display: flex;margin: auto;">
<div class="tab-content tabcon1711" id="skf_payinfo">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="l">收款方名称:</td>
<td class="r">
<input type="text" class="txt" name="" disabled="disabled" placeholder="" value="{$data.payinfo.payee_name}">
</td>
</tr>
<tr>
<td class="l">银行账号:</td>
<td class="r">
<input type="text" class="txt" name="" value="{$data.payinfo.bank_account}" disabled="disabled" placeholder="">
</td>
</tr>
<tr>
<td class="l">开户行:</td>
<td class="r">
<input type="text" class="txt" name="password" value="{$data.payinfo.opening_bank}" disabled="disabled" placeholder="请先选择支付给谁">
</td>
</tr>
</tbody>
</table>
</div>
<div class="tab-content tabcon1711" id="fkf_payinfo">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="l">付款方名称:</td>
<td class="r">
<input type="text" class="txt" name="" disabled="disabled" placeholder="" value="{$data.fkf_payinfo.payee_name}">
</td>
</tr>
<tr>
<td class="l">银行账号:</td>
<td class="r">
<input type="text" class="txt" name="" value="{$data.fkf_payinfo.bank_account}" disabled="disabled" placeholder="">
</td>
</tr>
<tr>
<td class="l">开户行:</td>
<td class="r">
<input type="text" class="txt" name="password" value="{$data.fkf_payinfo.opening_bank}" disabled="disabled" placeholder="请先选择支付给谁">
</td>
</tr>
</tbody>
</table>
</div>
</div>
</if>
</body>
</html>
Loading…
Cancel
Save