汇总bug修正

master
zhengyongxing 4 years ago
parent f028794473
commit 3f78880f7d

@ -115,6 +115,15 @@ class AggregateFinanceStatementController extends ThinkController
$data[$key]['detail'] = json_decode($value['detail'],true); $data[$key]['detail'] = json_decode($value['detail'],true);
$data[$key]['detail']['pool'] = str_replace(")",")<br>",$data[$key]['detail']['pool']);
$data[$key]['detail']['apply'] = str_replace(")",")<br>",$data[$key]['detail']['apply']);
$data[$key]['detail']['invoiced'] = str_replace(")",")<br>",$data[$key]['detail']['invoiced']);
$data[$key]['detail']['received'] = str_replace(")",")<br>",$data[$key]['detail']['received']);
$data[$key]['oplist'] = $this->OpAuth($value); $data[$key]['oplist'] = $this->OpAuth($value);
} }
// dump($data);die(); // dump($data);die();
@ -670,7 +679,8 @@ class AggregateFinanceStatementController extends ThinkController
$objPHPExcel->getActiveSheet()->setCellValue('E'.$line, $value['fax_ratio'] . '%'); $objPHPExcel->getActiveSheet()->setCellValue('E'.$line, $value['fax_ratio'] . '%');
$objPHPExcel->getActiveSheet()->setCellValue('C'.$line, $value['money']); $objPHPExcel->getActiveSheet()->setCellValue('C'.$line, $value['money']);
$objPHPExcel->getActiveSheet()->setCellValue('B'.$line, $product_name); $objPHPExcel->getActiveSheet()->setCellValue('B'.$line, $product_name);
$objPHPExcel->getActiveSheet()->setCellValue('F'.$line, $value['ratio_money']); // $objPHPExcel->getActiveSheet()->setCellValue('F'.$line, $value['ratio_money']);
$objPHPExcel->getActiveSheet()->setCellValue('F'.$line,"=C{$line}*D{$line}*(1-E{$line})");
$objPHPExcel->getActiveSheet()->getStyle('A'.$line)->getFont()->setBold(false); $objPHPExcel->getActiveSheet()->getStyle('A'.$line)->getFont()->setBold(false);
$objPHPExcel->getActiveSheet()->getStyle('B'.$line)->getFont()->setBold(false); $objPHPExcel->getActiveSheet()->getStyle('B'.$line)->getFont()->setBold(false);

@ -517,6 +517,8 @@ class AggregateRelationController extends AdminController
$p['second_company_id'] = $y['second_company_id']; $p['second_company_id'] = $y['second_company_id'];
$p['second_company_name'] = $y['second_company_name']; $p['second_company_name'] = $y['second_company_name'];
$p['second_company_type'] = $y['second_company_type']; $p['second_company_type'] = $y['second_company_type'];
} else {
$this->error('未做任何修改');
} }
if($p['first_company_type'] > 0){ if($p['first_company_type'] > 0){
$where = " $where = "
@ -532,15 +534,39 @@ class AggregateRelationController extends AdminController
"; ";
} }
if ($y['first_company_type'] == 3) {
$company_info = json_decode($y['first_company_info'],true); $p['first_company_info'] = $this->getCompanyInfo($p['first_company_type'],$p['first_company_id']);
$p['first_company_info']['type'] = 'first_party_info';
$p['first_company_info'] = json_encode($p['first_company_info']);
$p['second_company_info'] = $this->getCompanyInfo($p['second_company_type'],$p['second_company_id']);
$p['second_company_info']['type'] = 'second_party_info';
$p['second_company_info'] = json_encode($p['second_company_info']);
if ($y['collection'] == 1) {
$company_info = json_decode($p['first_company_info'],true);
$company_info['invoice_item'] = $p['invoice_content']; $company_info['invoice_item'] = $p['invoice_content'];
if ($p['invoice_type'] == 1) {
$company_info['invoice_type'] = "专票";
} elseif($p['invoice_type'] == 2) {
$company_info['invoice_type'] = "普票";
}
$p['first_company_info'] = json_encode($company_info); $p['first_company_info'] = json_encode($company_info);
}else if ($y['second_company_type'] == 3) { }else if ($y['collection'] == 2) {
$company_info = json_decode($y['second_company_info'],true);
$company_info = json_decode($p['second_company_info'],true);
$company_info['invoice_item'] = $p['invoice_content']; $company_info['invoice_item'] = $p['invoice_content'];
if ($p['invoice_type'] == 1) {
$company_info['invoice_type'] = "专票";
} elseif($p['invoice_type'] == 2) {
$company_info['invoice_type'] = "普票";
}
$p['second_company_info'] = json_encode($company_info); $p['second_company_info'] = json_encode($company_info);
} }
$hasdb = $this->DBlogModel->where($where)->find(); $hasdb = $this->DBlogModel->where($where)->find();
@ -632,7 +658,16 @@ class AggregateRelationController extends AdminController
$companyInfo = []; $companyInfo = [];
if($type == 0){ if($type == 0){
//己方公司 //己方公司
$companyInfo = M("CompanyInfo","tab_")->field("id,partner company_name,link_man,link_phone")->where("status='1'")->select(); $companyInfo = M("CompanyInfo","tab_")->field("id,partner company_name,link_man,link_phone,invoice_type,invoice_item,1 type")->where("status='1'")->select();
foreach ($companyInfo as $key => $value) {
if (strstr($value['invoice_type'],'专')) {
$companyInfo[$key]['invoice_type'] = 1;
} else if (strstr($value['invoice_type'],'普')) {
$companyInfo[$key]['invoice_type'] = 2;
}
}
} }
$b = $this->getBindCompanyId($type); $b = $this->getBindCompanyId($type);

@ -252,6 +252,7 @@ class AggregateStatementPoolController extends ThinkController
}else{ }else{
$va['sum_money'] = "=J{$line}*(K{$line}+L{$line})+M{$line}-N{$line}"; $va['sum_money'] = "=J{$line}*(K{$line}+L{$line})+M{$line}-N{$line}";
} }
$va['ratio_money'] = "=ROUND(G{$line}*H{$line}*(1-I{$line})-J{$line}-K{$line},2)";
}else{ }else{
$count['platform_amount'] += $va['money']; $count['platform_amount'] += $va['money'];
$count['sum_money'] += $va['ratio_money']; $count['sum_money'] += $va['ratio_money'];

@ -174,7 +174,7 @@
<tr> <tr>
<td class="l"><i class="mustmark">*</i>结算周期:</td> <td class="l"><i class="mustmark">*</i>结算周期:</td>
<td class="r"> <td class="r">
<select name="settlement_type" id="settlement_type" class="select_gallery" disabled> <select name="settlement_type" id="settlement_type" class="select_gallery" >
<option value="0"></option> <option value="0"></option>
<option value="1" selected>周结</option> <option value="1" selected>周结</option>
<option value="2">月结</option> <option value="2">月结</option>
@ -197,7 +197,7 @@
<tr> <tr>
<td class="l">开票内容:</td> <td class="l">开票内容:</td>
<td class="r table_radio"> <td class="r table_radio">
<input type="text" id="invoice_content" class="input" value="信息服务费" disabled > <input type="text" id="invoice_content" class="input" value="信息服务费" >
<input type="hidden" name="invoice_content" id="invoice_content_other" class="input invoice_content" value="信息服务费" > <input type="hidden" name="invoice_content" id="invoice_content_other" class="input invoice_content" value="信息服务费" >
</td> </td>
</tr> </tr>
@ -345,7 +345,7 @@ $(function(){
}) })
console.log(companyinfo) console.log(companyinfo)
if (companyinfo.type) { if (companyinfo.type) {
setAggregateInfo(companyinfo.invoice_item,companyinfo.withdraw_type,companyinfo.invoice_type); setAggregateInfo(companyinfo.invoice_item,companyinfo.withdraw_type,companyinfo.invoice_type,1);
} }
$("#first_company_name").val(companyinfo.company_name); $("#first_company_name").val(companyinfo.company_name);
@ -382,41 +382,68 @@ $(function(){
}) })
if (companyinfo.type) { if (companyinfo.type) {
setAggregateInfo(companyinfo.invoice_item,companyinfo.withdraw_type,companyinfo.invoice_type); setAggregateInfo(companyinfo.invoice_item,companyinfo.withdraw_type,companyinfo.invoice_type,2);
} }
$("#second_company_name").val(companyinfo.company_name); $("#second_company_name").val(companyinfo.company_name);
$("#second_company_info").html(setCompanyInfo(companyinfo)); $("#second_company_info").html(setCompanyInfo(companyinfo));
}); });
function setAggregateInfo(invoice_content,settlement_type,invoice_type) { $("#collection").on("change",function() {
if (invoice_content) { var get_collection = $(this).find("option:selected").val();
var companyinfo;
var id;
if (get_collection == 1) {
id = $("#first_company_id").find("option:selected").val();
companyinfo = first_company.find(function(x){
return x.id == id;
});
} else if (get_collection == 2) {
id = $("#second_company_id").find("option:selected").val();
companyinfo = second_company.find(function(x){
return x.id == id;
});
}
setAggregateInfo(companyinfo.invoice_item,companyinfo.withdraw_type,companyinfo.invoice_type,get_collection);
});
$('#invoice_content').on("change",function() {
$('#invoice_content').val($(this).val());
});
function setAggregateInfo(invoice_content,settlement_type,invoice_type,collection) {
var get_collection = $("#collection").find("option:selected").val();
if (collection == get_collection) {
$('.invoice_content').val(invoice_content); $('.invoice_content').val(invoice_content);
$('#invoice_content').val(invoice_content); $('#invoice_content').val(invoice_content);
}
$('#settlement_type').find("option").each(function() {
$(this).removeAttr("selected");
});
// if (!settlement_type) {
// $('#settlement_type').removeAttr("disabled");
// } else {
// $('#settlement_type').prop("disabled",true);
// }
$('#invoice_type').find("option").each(function() {
$(this).removeAttr("selected");
});
$('#settlement_type').find("option").each(function() { // if (!invoice_type) {
$(this).removeAttr("selected"); // $('#invoice_type').removeAttr("disabled");
}); // } else {
// if (!settlement_type) { // $('#invoice_type').prop("disabled",true);
// $('#settlement_type').removeAttr("disabled"); // }
// } else { $("#settlement_type").find("option[value="+settlement_type+"]").prop("selected",true);
$('#settlement_type').prop("disabled",true);
// } $("#invoice_type").find("option[value="+invoice_type+"]").prop("selected",true);
$('#invoice_type').find("option").each(function() { $("#settlement_type").change();
$(this).removeAttr("selected"); $("#invoice_type").change();
});
// if (!invoice_type) { }
// $('#invoice_type').removeAttr("disabled");
// } else {
$('#invoice_type').prop("disabled",true);
// }
$("#settlement_type").find("option[value="+settlement_type+"]").prop("selected",true);
$("#invoice_type").find("option[value="+invoice_type+"]").prop("selected",true);
$("#settlement_type").change();
$("#invoice_type").change();
} }

@ -151,7 +151,7 @@
<tr> <tr>
<td class="l"><i class="mustmark">*</i>结算周期:</td> <td class="l"><i class="mustmark">*</i>结算周期:</td>
<td class="r"> <td class="r">
<select name="settlement_type" id="settlement_type" class="select_gallery" disabled> <select name="settlement_type" id="settlement_type" class="select_gallery">
<option value="0" <if condition="$data['settlement_type'] eq 0">selected</if>>无</option> <option value="0" <if condition="$data['settlement_type'] eq 0">selected</if>>无</option>
<option value="1" <if condition="$data['settlement_type'] eq 1">selected</if>>周结</option> <option value="1" <if condition="$data['settlement_type'] eq 1">selected</if>>周结</option>
<option value="2" <if condition="$data['settlement_type'] eq 2">selected</if>>月结</option> <option value="2" <if condition="$data['settlement_type'] eq 2">selected</if>>月结</option>
@ -162,7 +162,7 @@
<tr> <tr>
<td class="l"><i class="mustmark">*</i>开票类型:</td> <td class="l"><i class="mustmark">*</i>开票类型:</td>
<td class="r"> <td class="r">
<select name="invoice_type" id="invoice_type" class="select_gallery" disabled> <select name="invoice_type" id="invoice_type" class="select_gallery">
<option value="0" <if condition="$data['invoice_type'] eq 0">selected</if>>无</option> <option value="0" <if condition="$data['invoice_type'] eq 0">selected</if>>无</option>
<option value="1" <if condition="$data['invoice_type'] eq 1">selected</if>>专票</option> <option value="1" <if condition="$data['invoice_type'] eq 1">selected</if>>专票</option>
<option value="2" <if condition="$data['invoice_type'] eq 2">selected</if>>普票</option> <option value="2" <if condition="$data['invoice_type'] eq 2">selected</if>>普票</option>

Loading…
Cancel
Save