diff --git a/Application/Admin/Controller/AggregateFinanceStatementController.class.php b/Application/Admin/Controller/AggregateFinanceStatementController.class.php
index 00f678bb7..7f72a3510 100644
--- a/Application/Admin/Controller/AggregateFinanceStatementController.class.php
+++ b/Application/Admin/Controller/AggregateFinanceStatementController.class.php
@@ -11,7 +11,7 @@ class AggregateFinanceStatementController extends ThinkController
"-4"=>"汇总审批拒绝",
"-3"=>"撤销汇总",
"-1"=>"审批拒绝",
- "0"=>"未申请开票",
+ "0"=>"未审批",
"1"=>"申请开票",
"2"=>"审批同意",
"3"=>"已开票",
@@ -162,7 +162,11 @@ class AggregateFinanceStatementController extends ThinkController
$this->setAggregateDetail(2,1,'申请开票',$id);
if ($company_info['collection'] == 1) {
$pay_company_id = 0;
+ $this->assign('first_channel_id',$id);
+ $this->assign('second_company_id',$id);
} else if ($company_info['collection'] == 2) {
+ $this->assign('first_channel_id',$id);
+ $this->assign('second_company_id',$id);
$pay_company_id = 1;
}
// dump($pay_company_id);die();
@@ -170,8 +174,7 @@ class AggregateFinanceStatementController extends ThinkController
$this->assign("pay_company_id",$pay_company_id);
$this->assign('first_partner_type',$first_partner_type);
- $this->assign('first_channel_id',$company_info['first_company_id']);
- $this->assign('second_company_id',$company_info['second_company_id']);
+
$statement_info = json_decode($info['statement_info'],true);
$this->assign('company_info',$company_info);
@@ -212,6 +215,7 @@ class AggregateFinanceStatementController extends ThinkController
"verify_status"=>$verify_status,
"create_time"=>time()
);
+
$id = $_REQUEST['statement_id'];
$res = M("aggregate_statement","tab_")->where("id = '{$id}'")->save($adddata);
if($res !== false){
@@ -226,11 +230,15 @@ class AggregateFinanceStatementController extends ThinkController
public function getCompanyList()
{
$id = $_REQUEST['id'];
- $cpCompany = M("aggregate_statement","tab_")->field("channel_id id,second_party_info")->where("id={$id}")->find();
+ $cpCompany = M("aggregate_statement","tab_")->field("id,first_party_info,second_party_info")->where("id={$id}")->find();
$data = array();
- $data['ptCompany']= M("CompanyInfo","tab_")->field('id,partner')->select();
- $data['cpCompany']= [[
+// $data['ptCompany']= M("CompanyInfo","tab_")->field('id,partner')->select();
+ $data['ptCompany']=[[
+ "id"=> $cpCompany['id'],
+ "partner"=>json_decode($cpCompany['first_party_info'],true)['partner']
+ ]];
+ $data['cpCompany']= [[
"id"=> $cpCompany['id'],
"partner"=>json_decode($cpCompany['second_party_info'],true)['partner']
]];
@@ -241,12 +249,16 @@ class AggregateFinanceStatementController extends ThinkController
$CompanyId = $_REQUEST['company_id'];
$company_type = $_REQUEST['company_type'];
if($company_type == 'pt'){
- $info = M("CompanyInfo","tab_")->field("id,partner,link_man,link_phone,address,company_tax_no,payee_name,bank_account,opening_bank")->where("id = '{$CompanyId}'")->find();
+// $info = M("CompanyInfo","tab_")->field("id,partner,link_man,link_phone,address,company_tax_no,payee_name,bank_account,opening_bank")->where("id = '{$CompanyId}'")->find();
+
+ $cpCompany = M("aggregate_statement","tab_")->field("channel_id id,first_party_info,channel_id")->where("id={$CompanyId}")->find();
+ $info = json_decode($cpCompany['first_party_info'],true);
}else{
- $cpCompany = M("aggregate_statement","tab_")->field("channel_id id,second_party_info,channel_id")->where("channel_id={$CompanyId}")->find();
+ $cpCompany = M("aggregate_statement","tab_")->field("channel_id id,second_party_info,channel_id")->where("id={$CompanyId}")->find();
+
$info = json_decode($cpCompany['second_party_info'],true);
- $relation = M("company_relation","tab_")->where("first_company_id={$cpCompany['channel_id']} or second_company_id = {$cpCompany['channel_id']}")->find();
+// $relation = M("company_relation","tab_")->where("(first_company_id={$cpCompany['channel_id']} and first_company_type=3) or (second_company_id = {$cpCompany['channel_id']} and first_company_type=3)")->find();
// $info['link_man'] = $info['connection_person'];
// $info['link_phone'] = $info['phone'];
// $info['address'] = $info['send_address'];
@@ -257,17 +269,17 @@ class AggregateFinanceStatementController extends ThinkController
// $info['company_tax_no'] = $info['tax_identification_number'];
}
- $info['invoice_item'] = "信息技术服务费";
- $info['invoice_type'] = "增值税专用发票";
-
- if ($relation['invoice_type'] == 1) {
- $info['invoice_type'] = "专票";
- } else if($relation['invoice_type'] == 2) {
- $info['invoice_type'] = "普票";
- }
- if($relation['invoice_content']) {
- $info['invoice_item'] = $relation['invoice_content'];
- }
+// $info['invoice_item'] = "信息技术服务费";
+// $info['invoice_type'] = "增值税专用发票";
+//
+// if ($relation['invoice_type'] == 1) {
+// $info['invoice_type'] = "专票";
+// } else if($relation['invoice_type'] == 2) {
+// $info['invoice_type'] = "普票";
+// }
+// if($relation['invoice_content']) {
+// $info['invoice_item'] = $relation['invoice_content'];
+// }
if(empty($info)){
$this->ajaxReturn(array("error"=>"no find","code"=>2000));
diff --git a/Application/Admin/View/AggregateFinanceStatement/createStatement.html b/Application/Admin/View/AggregateFinanceStatement/createStatement.html
index cd9724958..75a4280e7 100644
--- a/Application/Admin/View/AggregateFinanceStatement/createStatement.html
+++ b/Application/Admin/View/AggregateFinanceStatement/createStatement.html
@@ -627,7 +627,9 @@
}else{
company_type = "cp";
}
+ console.log(comid)
PUBLIC.postData(url,{company_id:comid,company_type:company_type},function(data){
+
DATAOBJ.second_part_company = data.success.partner;
DATAOBJ.second_party_info = data.success;
data.success.type = "second_party_info";
@@ -865,7 +867,7 @@
EVENT.changeStatementType();
}
var pay_company_id = "{$pay_company_id}";
- console.log(pay_company_id)
+
// $("#second_partner_id").val(second_company_id);
$('#statement_type').find('option[value='+pay_company_id+']').prop('selected',true);
$("#statement_type").change();
@@ -897,7 +899,7 @@
showStatementList(flag){
if(flag){
var data = {list:DATAOBJ.statement_info,count:DATAOBJ.statement_count,fine:DATAOBJ.fine};
- console.log(DATAOBJ);
+
$("#statementInit").addClass("hidebox");
var tpl =$("#statementTpl").html();
var html = juicer(tpl, data);
diff --git a/Application/Admin/View/AggregateFinanceStatement/lists.html b/Application/Admin/View/AggregateFinanceStatement/lists.html
index ef32a8999..f49220582 100644
--- a/Application/Admin/View/AggregateFinanceStatement/lists.html
+++ b/Application/Admin/View/AggregateFinanceStatement/lists.html
@@ -296,11 +296,11 @@
}
}).get().join(",");
if(text == ''){
- layer.msg("" + '无需要审批通过的结算单,仅[已申请发票]状态可以进行审批通过' + "");
+ layer.msg("" + '无需要审批通过的结算单,仅[未申请发票]状态可以进行审批通过' + "");
return;
}
if(flag){
- layer.confirm("审批成功仅会对 [已申请发票] 结算单处理,选择中包含其他的状态的结算单将被忽略,点击取消停止操作",{title:false}, function(index){
+ layer.confirm("审批成功仅会对 [未申请发票] 结算单处理,选择中包含其他的状态的结算单将被忽略,点击取消停止操作",{title:false}, function(index){
_doAgreeApply();
layer.close(index);
});
@@ -338,11 +338,11 @@
}
}).get().join(",");
if(text == ''){
- layer.msg("" + '无需要批拒绝的结算单,仅[已申请发票]状态可以进行审批拒绝' + "");
+ layer.msg("" + '无需要批拒绝的结算单,仅[未申请发票]状态可以进行审批拒绝' + "");
return;
}
if(flag){
- layer.confirm("审批拒绝仅会对 [已申请发票] 结算单处理,选择中包含其他的状态的结算单将被忽略,点击取消停止操作",{title:false}, function(index){
+ layer.confirm("审批拒绝仅会对 [未申请发票] 结算单处理,选择中包含其他的状态的结算单将被忽略,点击取消停止操作",{title:false}, function(index){
_doRefuseApply();
layer.close(index);
});