Commit a41032ec authored by hangjun83's avatar hangjun83

财务开票模块更新

parent 6e1d0825
......@@ -715,23 +715,29 @@ class InvoiceService
return $downloadUrl;
}
public function resetApplyInvoice($params)
public function resetApplyInvoice($invoiceNumber)
{
try{
$invoice = $this->invoiceRecordRepository->getInvoiceRecordByNumber($params);
$invoice = $this->invoiceRecordRepository->getInvoiceRecordByNumber($invoiceNumber);
if($invoice){
$invoice = current($invoice);
//设置发票平台
$this->apiService->setInvoicePlatform($invoice['invoice_platform']);
$values = $this->apiService->getPlatformDataEntries('invoice_apply_'.$params,'data_values');
$values = $this->apiService->getPlatformDataEntries('invoice_apply_'.$invoiceNumber,'data_values');
$response = $this->apiService->applyElecInvoice($values);
if($response){
return true;
}
}
}catch(\Throwable $exception){
var_dump($exception->getMessage());
$update = [];
$update['invoice_number'] = $invoice['invoice_number'];
$update['api_response'] = $exception->getMessage();
$this->saveInvoiceRecord($update);
SimpleLogs::writeLog($exception->getMessage(),__CLASS__.':'.__FUNCTION__,'error');
throw $exception;
//var_dump($exception->getMessage());
}
}
......
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