Why does my Xero invoice round differently when I go to edit it?

TL;DR

Xero has an issue with their old invoice edit page, which changes value discounts to percentage discounts rounded to 2 decimal places in order to display them. This can result in rounding errors as it tries to force a value discount into its old display. To resolve the issue, simply switch to their new style invoicing page.

Explanation

Xero accepts invoices from Breww with either a discount percentage or a discount value. However, Xero’s old invoice edit page doesn’t accept value discounts - it only accepts percentage discounts to 2 decimal places. This means that when trying to display an invoice with value discounts on its edit page, Xero converts it into a 2d.p. percentage discount, which can result in rounding errors.

Example

Take this Breww invoice:

It has a £10 discount on a unit price of £148, resulting in a total value of (£148 - £10) x 2 = £276. All of these details are uploaded to Xero, including that the discount is a value discount at £10 per product.

However, Xero’s old invoice edit page doesn’t support value discounts. So if you go to update that invoice in Xero, it will populate the discount field with £10 / £148 = 6.7567%, rounded to 6.76%. A 6.76% discount on the pre-discount value of £296 is £296 x (1 - 0.0676) = £275.99.

This is all happening in the display - Xero hasn’t actually saved the new rounded details until you click update or save, whereupon it will override the discount to the rounded percentage discount it has calculated.

If you haven’t saved those new details, you can simply click “Switch to new invoicing”:

Xero’s new invoicing edit page can handle value discounts in the display, you will see the correct values calculated using a discount value, not a rounded discount percentage.