An advance is booked at its own rate and the payable at the invoice’s, so applying one posts a third leg — the realized gain or loss. Reversing a payment now also gives the advance back, and a contra takes the date of the journal it reverses.
Reversing a Payment Gives the Advance Back
An advance applied to an invoice used to be silently detached when the payment was reversed, leaving its journal standing. The invoice reopened in the sub-ledger while the general ledger still showed the payable relieved.
The application is now unwound properly, and a give-back that cannot post abandons the whole reversal rather than deleting a row against a live journal.
A Contra Takes the Date of the Journal It Reverses
The Bank Book is the bank account’s ledger read by posting date, so a July payment reversed in September showed the cash gone for two months that the bank statement never lost — and no reconciliation in between could close.
Each contra now mirrors its own original’s date, so an advance paid in July and applied in August produces two contras on two dates. A closed period is refused by name, never slid forward to today. A dishonoured cheque is the one real later event and states today explicitly.
A Reversal Is Linked to Its Original, and TDS Actually Reverses
The payables reversal produced an unlinked contra: a journal that merely happened to be the opposite of another. Nothing then stopped a second contra being posted — which credits the bank all over again — the GL ledger marked neither side, and the Bank Book could not pair them to hide a reversed pair. Both are now linked, and a journal that is already reversed is refused.
TDS reversal had never run once: it filtered on a column the record did not have, so every call failed into a one-line log entry and a reversed payment left its tax standing in the statutory register for ever. The register now carries the payment reference, the original row is marked reversed rather than deleted with a negative mirror booked beside it, and the register nets to zero with both facts still on it. The same missing field is why a payment advice has never shown its per-section TDS breakdown; it does now.
Administrators: run batch_migrate --app fi_ap_core and batch_migrate --app fi_ap per tenant, then set the realized gain and loss accounts per company under Finance › FX Revaluation.
Applying a Foreign Advance Posts the Exchange Difference
A foreign-currency advance is booked at the payment-date rate and the payable at the invoice-date rate, so applying one moves two different rupee amounts. Posting both legs at a single rate left a residue in Trade Payables that no invoice explained and no allocation ever cleared.
Applying an advance now debits Trade Payables at the invoice’s rate, credits Advance to Vendors at the advance’s rate, and posts the difference to exchange gain or loss — the payables mirror of the customer receipt engine, reading the same configured accounts.
A rate of exactly 1.000000 on a foreign document means “nobody entered one”, not one-to-one. It is refused at entry, which is the only moment it can still be typed correctly, as well as at allocation. A domestic allocation still posts exactly the two legs it always did.