1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-19 16:01:34 +02:00

Merge pull request #9988 from arnebr/patch-einvoice

E-Invoice: Payment means code can only contain  credit transfer codes
This commit is contained in:
David Bomba 2024-09-14 07:24:33 +10:00 committed by GitHub
commit 50f0f7d3ec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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"));
}