Settle-up transfers are stored as fixed amounts, but a foreign-currency expense was re-converted with live rates on every settlement calc. When the rate drifted, the fixed transfer no longer cancelled the re-valued expense and a few-cent residual re-opened the settled position. Foreign-currency expenses now freeze the live rate at entry time into the existing budget_items.exchange_rate column, and the settlement converts with that frozen rate when working in the trip currency. Legacy rows (exchange_rate = 1) keep using live rates, so historical data is unchanged until re-edited; rate fetch failures fall back to live rates. |
||
|---|---|---|
| .. | ||
| db | ||
| mcp | ||
| middleware | ||
| nest | ||
| services | ||
| systemNotices | ||
| utils | ||
| idempotency-cleanup.test.ts | ||
| scheduler.test.ts | ||
| shared-contract.test.ts | ||