|
@@ -723,10 +723,12 @@ class OrderInv extends BaseController{
|
|
|
if($company==false)return error_show(1004,"开票业务公司未找到");
|
|
|
$invoiceinfo =Db::name("invoice_ticket")->where(["invNo"=>$invNo])->find();
|
|
|
if($invoiceinfo==false)return error_show(1004,"发票详细信息未找到");
|
|
|
+ $invoiceConf=Config::get('invoice');
|
|
|
+ if(!isset($invoiceConf[$company['company_license']]))return error_show(1004,'金税配置不存在');
|
|
|
+ $invoice = $invoiceConf[$company['company_license']];
|
|
|
+ $tax =new \TaxInvoice($invoice['appKey'],$invoice['appSecret'],$invoice['entCode']);
|
|
|
Db::startTrans();
|
|
|
try{
|
|
|
- $invoice=Config::get("invoice");
|
|
|
- $tax =new \TaxInvoice($invoice['appKey'],$invoice['appSecret'],$invoice['entCode']);
|
|
|
$result=$tax->DeprecateInvoices($company['company_license'],$this->kingInvoice[$invoiceinfo['inv_type']],$invoiceinfo['inv_code'],$invoiceinfo['inv_number'],1);
|
|
|
if(isset($result['ZTDM']) && $result['ZTDM']=='050000'){
|
|
|
$up =Db::name("invoice_pool")->where($invinfo)->update(["status"=>6,"updatetime"=>date("Y-m-d H:i:s")]);
|
|
@@ -1047,7 +1049,9 @@ class OrderInv extends BaseController{
|
|
|
//红冲票
|
|
|
|
|
|
private function addDiscard($ticket=[],$returnCode){
|
|
|
- $invoice=Config::get("invoice");
|
|
|
+ $invoiceConf=Config::get('invoice');
|
|
|
+ if(!isset($invoiceConf[$ticket['seller_id']]))throw new \Exception('金税配置不存在', 1006);
|
|
|
+ $invoice = $invoiceConf[$ticket['seller_id']];
|
|
|
$tax =new \TaxInvoice($invoice['appKey'],$invoice['appSecret'],$invoice['entCode']);
|
|
|
$result=$tax->DeprecateInvoices($ticket['seller_id'],$ticket['inv_type'],$ticket['inv_code'],$ticket['inv_number'],1);
|
|
|
if(isset($result['ZTDM']) && ($result['ZTDM']=='050000' || $result['ZTDM']=='053000')){
|
|
@@ -1207,7 +1211,9 @@ class OrderInv extends BaseController{
|
|
|
* @throws \think\db\exception\ModelNotFoundException
|
|
|
*/
|
|
|
private function addApplyRed($ticket=[],$return_reason,$returnCode,$red_desc){
|
|
|
- $invoice=Config::get("invoice");
|
|
|
+ $invoiceConf=Config::get('invoice');
|
|
|
+ if(!isset($invoiceConf[$ticket['seller_id']]))throw new \Exception('金税配置不存在', 1006);
|
|
|
+ $invoice = $invoiceConf[$ticket['seller_id']];
|
|
|
$Tax =new \TaxInvoice($invoice['appKey'],$invoice['appSecret'],$invoice['entCode']);
|
|
|
$redticketList=[];
|
|
|
$redticketArry=[
|
|
@@ -1782,7 +1788,9 @@ class OrderInv extends BaseController{
|
|
|
if(empty($ticket)) return error_show(1004,"未找到开票信息");
|
|
|
$company =Db::name("company_info")->where(["companyNo"=>'GS2207150956046617'])->findOrEmpty();
|
|
|
if(empty($company)) return error_show(1004,"业务企业信息未找到");
|
|
|
- $invoice=Config::get("invoice");
|
|
|
+ $invoiceConf=Config::get('invoice');
|
|
|
+ if(!isset($invoiceConf[$company['company_license']]))throw new \Exception('金税配置不存在', 1006);
|
|
|
+ $invoice = $invoiceConf[$company['company_license']];
|
|
|
$Tax =new \TaxInvoice($invoice['appKey'],$invoice['appSecret'],$invoice['entCode']);
|
|
|
$redticketList=[];
|
|
|
$redticketArry=[
|
|
@@ -1926,7 +1934,9 @@ class OrderInv extends BaseController{
|
|
|
if(empty($ticketArr)){
|
|
|
return error_show(1004,"未找到开票信息");
|
|
|
}
|
|
|
- $invoice=Config::get("invoice");
|
|
|
+ $invoiceConf=Config::get('invoice');
|
|
|
+ if(!isset($invoiceConf[$company['company_license']]))throw new \Exception('金税配置不存在', 1006);
|
|
|
+ $invoice = $invoiceConf[$company['company_license']];
|
|
|
$Tax =new \TaxInvoice($invoice['appKey'],$invoice['appSecret'],$invoice['entCode']);
|
|
|
Db::startTrans();
|
|
|
try{
|