quicktill icon indicating copy to clipboard operation
quicktill copied to clipboard

Xero integration doesn't deal with negative payment method totals

Open sde1000 opened this issue 8 years ago • 1 comments

We ran into this problem at the Coalheavers the other day: we had done a lot of cashback, so the cash total for the day was negative (although the overall total was positive, as usual).

Adding the payments to the invoice via the Xero API was rejected with the following validation errors:

  • Payment amounts must be positive amounts
  • Payment amount exceeds the amount outstanding on this document

After some fiddling with Xero, I have a plan to make this work.

  1. For each negative payment total, add a line to the invoice recording that total against the suspense account with No VAT. When sending the payments, don't send the negative ones.
  2. For each negative payment, create a Spend Money transaction between the configured account for that payment method and the suspense account.

The suspense account balance should be unchanged by this, and the payment method accounts should all have transactions of the correct values.

We should record the Spend Money transaction IDs in the session log. We might need a new log entry type for this.

sde1000 avatar Feb 18 '17 12:02 sde1000

Current state: the invoice is sent to Xero with a line for each negative payment recording it against the suspense account, but the Spend Money transaction is not created automatically. The invoice is left in "Draft" state.

sde1000 avatar Jan 24 '24 17:01 sde1000