Handle UBL errors
This commit is contained in:
parent
889ffb431a
commit
f98a4deeff
1 changed files with 9 additions and 1 deletions
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
namespace App\Jobs;
|
||||
|
||||
use Utils;
|
||||
use Exception;
|
||||
use App\Jobs\Job;
|
||||
use CleverIt\UBL\Invoice\Generator;
|
||||
use CleverIt\UBL\Invoice\Invoice;
|
||||
|
|
@ -73,7 +75,13 @@ class ConvertInvoiceToUbl extends Job
|
|||
->setTaxExclusiveAmount($taxable)
|
||||
->setPayableAmount($invoice->balance));
|
||||
|
||||
return Generator::invoice($ublInvoice, $invoice->client->getCurrencyCode());
|
||||
try {
|
||||
return Generator::invoice($ublInvoice, $invoice->client->getCurrencyCode());
|
||||
} catch (Exception $exception) {
|
||||
Utils::logError($exception);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private function createParty($company, $user)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue