Commit ba8cbddd authored by hangjun83's avatar hangjun83

财务开票模块更新

parent f2766303
...@@ -6,6 +6,7 @@ use App\Finance\Repositories\Contracts\InvoiceRecordRepository; ...@@ -6,6 +6,7 @@ use App\Finance\Repositories\Contracts\InvoiceRecordRepository;
use App\Finance\Repositories\Eloquent\RhawnInvoiceItemsRepositoryEloquent; use App\Finance\Repositories\Eloquent\RhawnInvoiceItemsRepositoryEloquent;
use App\Finance\Repositories\Eloquent\RhawnInvoiceRepositoryEloquent; use App\Finance\Repositories\Eloquent\RhawnInvoiceRepositoryEloquent;
use App\Finance\Services\Api\BaiwangApiService; use App\Finance\Services\Api\BaiwangApiService;
use App\Mailer\MailService;
use App\Repositories\Contracts\ThirdApiPlatformRepository; use App\Repositories\Contracts\ThirdApiPlatformRepository;
use App\Services\ThirdPlatform\PlatformBaseService; use App\Services\ThirdPlatform\PlatformBaseService;
use App\Support\Facades\SimpleLogs; use App\Support\Facades\SimpleLogs;
...@@ -75,6 +76,8 @@ class InvoiceService ...@@ -75,6 +76,8 @@ class InvoiceService
*/ */
public function applyInvoice($invoiceParams) public function applyInvoice($invoiceParams)
{ {
app(MailService::class)->sendMailToHtml('测试', 'hangjun@rhawn.cn','111111');
exit;
if(!isset($invoiceParams['invoice_platform']) || empty($invoiceParams['invoice_platform'])){ if(!isset($invoiceParams['invoice_platform']) || empty($invoiceParams['invoice_platform'])){
throw new \Exception('开票平台不存在',502); throw new \Exception('开票平台不存在',502);
} }
...@@ -152,7 +155,7 @@ class InvoiceService ...@@ -152,7 +155,7 @@ class InvoiceService
$applyInvoiceParams['sksbh'] = $platformInfo['nsrsbh']; $applyInvoiceParams['sksbh'] = $platformInfo['nsrsbh'];
$applyInvoiceParams['bmbBbh'] = ''; $applyInvoiceParams['bmbBbh'] = '';
$applyInvoiceParams['ddlsh'] = $invoiceNumber; $applyInvoiceParams['ddlsh'] = $invoiceNumber;
$applyInvoiceParams['fplxdm'] = '0'.$invoiceParams['invoice_category']; $applyInvoiceParams['fplxdm'] = '0'.$invoiceParams['invoice_category'] == 2 ? '1' : '2';
$applyInvoiceParams['kplx'] = $invoiceParams['invoice_type'] == 'blue' ? 0 : 1; $applyInvoiceParams['kplx'] = $invoiceParams['invoice_type'] == 'blue' ? 0 : 1;
$applyInvoiceParams['tspz'] = ''; $applyInvoiceParams['tspz'] = '';
$applyInvoiceParams['zsfs'] = 0; $applyInvoiceParams['zsfs'] = 0;
...@@ -432,8 +435,8 @@ class InvoiceService ...@@ -432,8 +435,8 @@ class InvoiceService
//更新对应的发票数据,并反写回相应的平台发票 //更新对应的发票数据,并反写回相应的平台发票
try{ try{
$updateInvoice = []; $updateInvoice = [];
if($callBackParams['status'] == 1){
$updateInvoice['inovice_number'] = $callBackParams['ddlsh']; $updateInvoice['inovice_number'] = $callBackParams['ddlsh'];
if($callBackParams['status'] == 1){
$updateInvoice['invoice_status'] = 1; $updateInvoice['invoice_status'] = 1;
$updateInvoice['invoice_real_number'] = $callBackParams['fphm']; $updateInvoice['invoice_real_number'] = $callBackParams['fphm'];
$updateInvoice['invoice_real_date'] = $callBackParams['kprq']; $updateInvoice['invoice_real_date'] = $callBackParams['kprq'];
...@@ -460,6 +463,9 @@ class InvoiceService ...@@ -460,6 +463,9 @@ class InvoiceService
//发送邮件 //发送邮件
} }
}else{
$updateInvoice['invoice_status'] = 2;
$updatedInvoiceResult = $this->invoiceRecordRepository->saveInvoice($updateInvoice);
} }
} }
}catch(\Throwable $exception){ }catch(\Throwable $exception){
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment