Fixes for Zugferd

This commit is contained in:
David Bomba 2025-03-11 06:51:49 +11:00
parent 16fd0ba151
commit 4f79dcb2b5
2 changed files with 6 additions and 2 deletions

View File

@ -70,7 +70,7 @@ class PrintEntityBatch implements ShouldQueue
})->catch(function (Batch $batch, Throwable $e) {
// First batch job failure detected...
// nlog("PrintEntityBatch failed: {$e->getMessage()}");
nlog("PrintEntityBatch failed: {$e->getMessage()}");
})->finally(function (Batch $batch) {
// The batch has finished executing...
// nlog("I have finished");

View File

@ -257,7 +257,11 @@ class ZugferdEDocument extends AbstractService
$br = new \App\DataMapper\Tax\BaseRule();
$eu_states = $br->eu_country_codes;
$item = $this->document->line_items[0];
$item = $this->document->line_items[0] ?? null;
if(is_null($item)){
return $this;
}
if (!in_array($this->document->client->country->iso_3166_2, $eu_states)) {
$this->tax_code = ZugferdDutyTaxFeeCategories::FREE_EXPORT_ITEM_TAX_NOT_CHARGED;