sinabe / dolibarr-swissqr

Swiss QR invoice for Dolibarr
6 stars 3 forks source link

Hardcoded Invoice Language #3

Closed j1schmid closed 1 year ago

j1schmid commented 1 year ago

The texts in the invoice, fom example the string "Section paiement" just above the QR-Code, seems to be hardcoded in htdocs/core/modules/facture/doc/pdf_swissqr.modules.php.

$output = new QrBill\PaymentPart\Output\TcPdfOutput\TcPdfOutput($qrBill, 'fr', $pdf);

Is there a reasonable way to pass that parameter from Dolibarr? We have just hardcoded the value to our preferred language. For German the patch is:

diff --git a/htdocs/core/modules/facture/doc/pdf_swissqr.modules.php b/htdocs/core/modules/facture/doc/pdf_swissqr.modules.php
index cfa572d..8ac6274 100644
--- a/htdocs/core/modules/facture/doc/pdf_swissqr.modules.php
+++ b/htdocs/core/modules/facture/doc/pdf_swissqr.modules.php
@@ -960,7 +960,7 @@ class pdf_swissqr extends ModelePDFFactures
             exit;
         }

-        $output = new QrBill\PaymentPart\Output\TcPdfOutput\TcPdfOutput($qrBill, 'fr', $pdf);
+        $output = new QrBill\PaymentPart\Output\TcPdfOutput\TcPdfOutput($qrBill, 'de', $pdf);
         $output->setPrintable(false)->getPaymentPart();
     }
benvia commented 1 year ago

Thanks for your feedback. I will push a new version soon

benvia commented 1 year ago

The QR part of the invoice use the same language as the Dolibarr part of the invoice. Supported languages are German, French, Italian, English Default language is English