From 1573cb7a25063d1f598e73b32c3e9935bc5c181e Mon Sep 17 00:00:00 2001 From: Lars Kusch Date: Wed, 3 May 2023 16:41:38 +0200 Subject: [PATCH] Minor fix --- app/Services/Invoice/EInvoice/ZugferdEInvoice.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/app/Services/Invoice/EInvoice/ZugferdEInvoice.php b/app/Services/Invoice/EInvoice/ZugferdEInvoice.php index af01c174ea15..1dcb7b7cb514 100644 --- a/app/Services/Invoice/EInvoice/ZugferdEInvoice.php +++ b/app/Services/Invoice/EInvoice/ZugferdEInvoice.php @@ -148,6 +148,9 @@ class ZugferdEInvoice extends AbstractService $xrechnung->addDocumentPositionTax($taxtype, 'VAT', $this->invoice->tax_rate3); $this->addtoTaxMap($taxtype, $linenetamount, $this->invoice->tax_rate3); } else { + $taxtype = ZugferdDutyTaxFeeCategories::ZERO_RATED_GOODS; + $xrechnung->addDocumentPositionTax($taxtype, 'VAT', 0); + $this->addtoTaxMap($taxtype, $linenetamount, 0); nlog("Can't add correct tax position"); } } @@ -230,16 +233,16 @@ class ZugferdEInvoice extends AbstractService } return $tax_type; } - private function addtoTaxMap(string $taxtype, float $netamount, float $taxrate){ - $hash = hash("md5", $taxtype."-".$taxrate); + private function addtoTaxMap(string $tax_type, float $net_amount, float $tax_rate){ + $hash = hash("md5", $tax_type."-".$tax_rate); if (array_key_exists($hash, $this->tax_map)){ - $this->tax_map[$hash]["net_amount"] += $netamount; + $this->tax_map[$hash]["net_amount"] += $net_amount; } else{ $this->tax_map[$hash] = [ - "tax_type" => $taxtype, - "net_amount" => $netamount, - "tax_rate" => $taxrate / 100 + "tax_type" => $tax_type, + "net_amount" => $net_amount, + "tax_rate" => $tax_rate / 100 ]; } }