From 6c83ccc1dd618510752a74f75d045d29061f8eff Mon Sep 17 00:00:00 2001 From: Arne Breitsprecher Date: Fri, 13 Sep 2024 15:25:39 +0200 Subject: [PATCH] E-Invoice: Payment means type codecontains a code for credit transfer only 30, 58 are allowd --- app/Services/EDocument/Standards/ZugferdEDokument.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Services/EDocument/Standards/ZugferdEDokument.php b/app/Services/EDocument/Standards/ZugferdEDokument.php index 537d396944..aecd50f433 100644 --- a/app/Services/EDocument/Standards/ZugferdEDokument.php +++ b/app/Services/EDocument/Standards/ZugferdEDokument.php @@ -121,10 +121,11 @@ class ZugferdEDokument extends AbstractService if (isset($client->shipping_address1) && $client->shipping_country) { $this->xdocument->setDocumentShipToAddress($client->shipping_address1, $client->shipping_address2, "", $client->shipping_postal_code, $client->shipping_city, $client->shipping_country->iso_3166_2, $client->shipping_state); } - + $custom_value1=$company->settings->custom_value1; + //BR-DE-23 - If „Payment means type code“ (BT-81) contains a code for credit transfer (30, 58), „CREDIT TRANSFER“ (BG-17) shall be provided. //Payment Means - Switcher - if($company->settings->custom_value1 == '42') { - $this->xdocument->addDocumentPaymentMean(typecode: 42, payeeIban: $company->settings->custom_value2, payeeAccountName: $company->settings->custom_value4, payeeBic: $company->settings->custom_value3); + if(isset($custom_value1) && !empty($custom_value1) && ($custom_value1 == '30'|| $custom_value1=='58')) { + $this->xdocument->addDocumentPaymentMean(typecode: $company->settings->custom_value1, payeeIban: $company->settings->custom_value2, payeeAccountName: $company->settings->custom_value4, payeeBic: $company->settings->custom_value3); } else { $this->xdocument->addDocumentPaymentMean(68, ctrans("texts.xinvoice_online_payment")); }