Fixes for the ZUGFeRD implementation

This commit is contained in:
Lars Kusch 2023-07-03 19:31:54 +02:00
parent 295d6971f6
commit f4e571fee5

View File

@ -98,8 +98,10 @@ class ZugferdEInvoice extends AbstractService
if (!empty($item->notes)){
$xrechnung->setDocumentPositionProductDetails($item->product_key, $item->notes);
}
else {
$xrechnung->setDocumentPositionProductDetails($item->product_key);
}
}
else {
if (!empty($item->notes)){
$xrechnung->setDocumentPositionProductDetails($item->notes);
@ -161,7 +163,7 @@ class ZugferdEInvoice extends AbstractService
if ($this->invoice->isPartial()) {
$xrechnung->setDocumentSummation($this->invoice->amount, $this->invoice->balance, $invoicing_data->getSubTotal(), $invoicing_data->getTotalSurcharges(), $invoicing_data->getTotalDiscount(), $invoicing_data->getSubTotal(), $invoicing_data->getItemTotalTaxes(), null, $this->invoice->partial);
$xrechnung->setDocumentSummation($this->invoice->amount, $this->invoice->balance, $invoicing_data->getSubTotal(), $invoicing_data->getTotalSurcharges(), $invoicing_data->getTotalDiscount(), $invoicing_data->getSubTotal(), $invoicing_data->getItemTotalTaxes(), null, (float) $this->invoice->partial);
} else {
$xrechnung->setDocumentSummation($this->invoice->amount, $this->invoice->balance, $invoicing_data->getSubTotal(), $invoicing_data->getTotalSurcharges(), $invoicing_data->getTotalDiscount(), $invoicing_data->getSubTotal(), $invoicing_data->getItemTotalTaxes(), null, 0.0);
}
@ -236,7 +238,8 @@ class ZugferdEInvoice extends AbstractService
}
return $tax_type;
}
private function addtoTaxMap(string $tax_type, float $net_amount, float $tax_rate){
private function addtoTaxMap(string $tax_type, float $net_amount, float $tax_rate): void
{
$hash = hash("md5", $tax_type."-".$tax_rate);
if (array_key_exists($hash, $this->tax_map)){
$this->tax_map[$hash]["net_amount"] += $net_amount;