diff --git a/Application/Admin/Controller/AggregateFinanceStatementController.class.php b/Application/Admin/Controller/AggregateFinanceStatementController.class.php
index 7f72a3510..b004f839a 100644
--- a/Application/Admin/Controller/AggregateFinanceStatementController.class.php
+++ b/Application/Admin/Controller/AggregateFinanceStatementController.class.php
@@ -115,6 +115,15 @@ class AggregateFinanceStatementController extends ThinkController
$data[$key]['detail'] = json_decode($value['detail'],true);
+ $data[$key]['detail']['pool'] = str_replace(")",")
",$data[$key]['detail']['pool']);
+
+ $data[$key]['detail']['apply'] = str_replace(")",")
",$data[$key]['detail']['apply']);
+
+ $data[$key]['detail']['invoiced'] = str_replace(")",")
",$data[$key]['detail']['invoiced']);
+
+ $data[$key]['detail']['received'] = str_replace(")",")
",$data[$key]['detail']['received']);
+
+
$data[$key]['oplist'] = $this->OpAuth($value);
}
// dump($data);die();
@@ -670,7 +679,8 @@ class AggregateFinanceStatementController extends ThinkController
$objPHPExcel->getActiveSheet()->setCellValue('E'.$line, $value['fax_ratio'] . '%');
$objPHPExcel->getActiveSheet()->setCellValue('C'.$line, $value['money']);
$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('B'.$line)->getFont()->setBold(false);
diff --git a/Application/Admin/Controller/AggregateRelationController.class.php b/Application/Admin/Controller/AggregateRelationController.class.php
index 5703b6540..e222df899 100644
--- a/Application/Admin/Controller/AggregateRelationController.class.php
+++ b/Application/Admin/Controller/AggregateRelationController.class.php
@@ -517,6 +517,8 @@ class AggregateRelationController extends AdminController
$p['second_company_id'] = $y['second_company_id'];
$p['second_company_name'] = $y['second_company_name'];
$p['second_company_type'] = $y['second_company_type'];
+ } else {
+ $this->error('未做任何修改');
}
if($p['first_company_type'] > 0){
$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'];
+
+ 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);
- }else if ($y['second_company_type'] == 3) {
- $company_info = json_decode($y['second_company_info'],true);
+ }else if ($y['collection'] == 2) {
+
+ $company_info = json_decode($p['second_company_info'],true);
$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);
+
}
$hasdb = $this->DBlogModel->where($where)->find();
@@ -632,7 +658,16 @@ class AggregateRelationController extends AdminController
$companyInfo = [];
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);
diff --git a/Application/Admin/Controller/AggregateStatementPoolController.class.php b/Application/Admin/Controller/AggregateStatementPoolController.class.php
index 6edde72ac..bc92958b6 100644
--- a/Application/Admin/Controller/AggregateStatementPoolController.class.php
+++ b/Application/Admin/Controller/AggregateStatementPoolController.class.php
@@ -252,6 +252,7 @@ class AggregateStatementPoolController extends ThinkController
}else{
$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{
$count['platform_amount'] += $va['money'];
$count['sum_money'] += $va['ratio_money'];
diff --git a/Application/Admin/View/AggregateRelation/addRelation.html b/Application/Admin/View/AggregateRelation/addRelation.html
index 4bc8c5701..35b523dba 100644
--- a/Application/Admin/View/AggregateRelation/addRelation.html
+++ b/Application/Admin/View/AggregateRelation/addRelation.html
@@ -174,7 +174,7 @@