Number formatting invoice

Hey there,

first of all, InvoiceNinja is great. I setup self-hosting and so far everything is working fine.

I have one small issue with the invoice design. It is not feasible for the tax region I live in, to change invoices after they are created, so this balance and balancedue thing is not applicable. I created a custom design with this code:


{
    "columns": [
      "$notesAndTerms",
      {
        "alignment": "right",
        "table": {
          "widths": [
            "*",
            "32%"
          ],
          "body": [
            [
              "Zwischensumme",
              "€$invoice.subtotal_amount"
            ],
            [
              "Mwst. 19%",
              "€$invoice.tax_amount1"
            ],
            [
              "Gesamt",
              "$invoice.amount"
            ]
          ]
        },
        "layout": {
          "hLineWidth": "$none",
          "vLineWidth": "$none",
          "paddingLeft": "$amount:0",
          "paddingRight": "$amount:8",
          "paddingTop": "$amount:4",
          "paddingBottom": "$amount:4"
        }
      }
    ]
  },

This is working but $invoice.subtotal_amount and $invoice.tax_amount1 are not formatted correct. If the subtotal is an integer it is show as 175 instead of 175.00 and both of them are formatted with a period as the sperator instead of a comma. The subtotal should be shown as 175,00 instead of 175 or 175.00

Any hints?

Applying formatting to those fields isn’t supported, you’d need to modify the source code.

Is there any other way to just show Total Amount and not the redundant due/paid stuff?

$invoiceTotal

Sry for the confusion. I need subtotal, tax and total. Nothing more. $invoiceTotal gives me nothing?!

Are you using $invoiceTotal or %invoiceTotal, it should be $invoiceTotal.

The app doesn’t support breaking down the other fields, you’d need to use the field stack used in the default designs.

Hey Hillel,

thank you for this prompt support.

Unfortunately, $invoiceTotal doesn’t help either. I do have the correct total in the right format. I need Subtotal and Tax in the right format.

Okay, I wanted a quick solution and thought, just set the Localization/Language to English. I don’t mind if everything has a period. Möp. Doesn’t work either. Everything still is the same?!? A mix of commas and periods. Grmppf.

FYI: I have never ever seen this “Outstanding, Paid to Date and Balance Due” on Germnan invoices. We have something called “Abschlagsrechnung”, but this is working completely different and has a set of rules which are regulated, like so many things in Germany.

If you use a standard design (rather than the custom design) the formatting should be correct.

You can use this feature to lock the invoices.

https://invoice-ninja.readthedocs.io/en/latest/configure.html#lock-invoices

Yes, but then there is also the redundant Paid to Date / Balance stuff. This is a problem with using this app in Germany.

Locking the invoice doesn’t prevent InvoiceNinja from showing Paid to Date when a payment is entered after the invoice is sent, so I am not sure why you are suggesting this?!

Just trying to help… I may have misunderstood your “It is not feasible … to change invoices after they are created” comment.

Ooops, my bad. I didn’t mean to sound rude. It ma have been my wording. You support is awesome!

Any chance you fix the formatting of $invoice.subtotal_amount and $invoice.tax_amount1 in the future? It prevents me from using your great piece of software.

We’ll definitely keep this use case in mind for v2 but it’s unlikely we’ll support it in the current version.