Proper allocation of prepayments on sales orders
If possible could you write the coding so that in an advanced sale that has a prepayment, it only applies the amount of prepayment appropriate to the amount of the invoice?
Here is the issue I run into daily:
Sync error when syncing to Xero "Cannot import payment because payment is greater than the amount due on the invoice"
This happens because we have multiple fulfillments and so multiple invoices for the same order. The default invoice created before the order was converted to an advanced sale has the full prepayment automatically allocated to it, even if the invoice amount is less than the prepayment. Then it bonks when it tries to sync to Xero.