|
|
|
@ -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 ($p['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 ($p['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();
|
|
|
|
@ -563,8 +589,15 @@ class AggregateRelationController extends AdminController
|
|
|
|
|
$map['id'] = $id;
|
|
|
|
|
|
|
|
|
|
$dbres = $this->DBModel->where($map)->find();
|
|
|
|
|
$this->assign('first_company_info',$this->getCompanyInfo($dbres['first_company_type'],$dbres['first_company_id']));
|
|
|
|
|
$this->assign('second_company_info',$this->getCompanyInfo($dbres['second_company_type'],$dbres['second_company_id']));
|
|
|
|
|
|
|
|
|
|
$first_company_info = $this->getCompanyInfo($dbres['first_company_type'],$dbres['first_company_id']);
|
|
|
|
|
$first_company_info['invoice_type'] = $first_company_info['invoice_type'] == "专票" ? 1 : ($first_company_info['invoice_type'] == "普票"?2:'');
|
|
|
|
|
|
|
|
|
|
$this->assign('first_company_info',$first_company_info);
|
|
|
|
|
|
|
|
|
|
$second_company_info = $this->getCompanyInfo($dbres['second_company_type'],$dbres['second_company_id']);
|
|
|
|
|
$second_company_info['invoice_type'] = $second_company_info['invoice_type'] == "专票" ? 1 : ($second_company_info['invoice_type'] == "普票"?2:'');
|
|
|
|
|
$this->assign('second_company_info',$second_company_info);
|
|
|
|
|
|
|
|
|
|
$dbres['first_company_type'] =$this->CompanyType[$dbres['first_company_type']];
|
|
|
|
|
$dbres['second_company_type'] =$this->CompanyType[$dbres['second_company_type']];
|
|
|
|
@ -632,7 +665,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);
|
|
|
|
|
|
|
|
|
@ -661,6 +703,11 @@ class AggregateRelationController extends AdminController
|
|
|
|
|
if($type == 0){
|
|
|
|
|
//己方公司
|
|
|
|
|
$companyInfo = M("CompanyInfo","tab_")->field("id,partner company_name,partner,link_man,link_phone,address,company_tax_no,payee_name,bank_account,opening_bank,invoice_item,invoice_type,register_phone,register_address")->where("status='1' AND id='{$id}'")->find();
|
|
|
|
|
if (strstr($companyInfo['invoice_type'],'专')) {
|
|
|
|
|
$companyInfo['invoice_type'] = "专票";
|
|
|
|
|
} else if (strstr($companyInfo['invoice_type'],'普')) {
|
|
|
|
|
$companyInfo['invoice_type'] = "普票";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if($type == 1){
|
|
|
|
|
//上游
|
|
|
|
|