schoero / swissqrbill

Swiss QR Bill generation in Node.js and browsers
MIT License
155 stars 29 forks source link

Invoice with different currencies #395

Closed krava77 closed 1 year ago

krava77 commented 1 year ago

Hello. Is it possible to create pdf invoices with different currencies (e.g. USD, GBP etc.)? At the moment I have got an error, but sometimes is necessary to display an invoice for customers in different currencies without QR code. Thank you!

schoero commented 1 year ago

The error is intentional because the Swiss QR Bill only supports "CHF" and "EUR". This is an official limitation of the Swiss QR Bill, you can search for currency in the official specifications to verify that.

If we would allow other currencies anyway, this would probably lead to errors when scanning the QR Bill.

krava77 commented 1 year ago

Thank you for the answer. I saw it in the source code. Is it possible to allow other currencies without a QR code? For example, if the currency is not "CHF" and "EUR" QR code is not appear.

schoero commented 1 year ago

This is something I would rather not implement. If it looks like a QR Bill, it should also behave like a QR Bill.

In addition to that, leaving parts out also violates the official design guidelines.

If the transaction has to be in a different currency, I suggest to create a custom Bill, that just includes the necessary payment information and not use the Swiss QR Bill at all.

If you just want to display the amount in another currency, you could display that above the payment part of the QR Bill and leave the actual payment part of the QR Bill in "CHF" or "EUR".

schoero commented 1 year ago

Closing as this does not comply with the specifications.