Thx for your response and your hint!
I am close to the solution. For the address I had to change the format from S(tructured) to K(ombined), as Invoiceninja does not split up the address1 field. This is fine though.
Some of the fields can be accessed using variables, but I’m struggling with two fields:
- The country: I was only able to get the
$account.country_id
, which shows the value 756 (for Switzerland) but I need “CH”. I can workaround that by hardcoding “CH” into the QR field as invoices are only sent from one account. - The currency: So far I’ve not been able to retrieve the “CHF” or “EUR” value of an invoice’s currency. Here I cannot do a hard-coded workaround as invoice currencies depend on the customer. I tried it with $client.currency_id but the value is empty.
So far what I have:
"qr": "SPC\n0200\n1\nHard-Coded-IBAN\nK\n$account.name\n$account.address1\n$account.postal_code $account.city\n\n\nCH\n\n\n\n\n\n\n\n$invoice.balance\n$client.currency_id\n\n\n\n\n\n\nNON\n\n$invoice_number\nEPD",
"fit": "100",
"eccLevel": "H",
"alignment": "right"
Only the currency is left until the QR code contains the needed data.
Update: Actually the amount is also not correctly showing up. In the custom template editor $invoice.balance
showed 0.00 but it doesnt seem correct. So the correct variable name is needed here, too.
Update 2: The amount to pay could be solved with https://github.com/invoiceninja/invoiceninja/issues/2930#issuecomment-526619709
So it’s only the currency missing now.