Skip to content

fix: book foreign-currency invoices in the organization currency - #68

Open
berolinux wants to merge 1 commit into
Scanix:developfrom
berolinux:fix/foreign-currency-ledger
Open

berolinux wants to merge 1 commit into
Scanix:developfrom
berolinux:fix/foreign-currency-ledger

Conversation

@berolinux

Copy link
Copy Markdown

Summary

The Community Edition invoice form accepts EUR (and other currencies), and the preview formats that currency correctly. Posting then copies the same number into the ledger, which has no currency of its own, and every journal screen formats amounts as CHF. A 100.00 EUR invoice is booked as 100.00 CHF, not as the franc equivalent.

This is reusable accounting behavior, so it belongs in the public edition. FEATURE_MULTI_CURRENCY only hid the exchange-rate screen; it did not stop a foreign-currency invoice from being issued.

  • Convert invoice, credit-note, payment, and expense amounts into the organization currency using the newest exchange rate on or before the document date (direct or inverse).
  • Keep the invoice document in its own currency. The journal description records the original amount and rate.
  • Refuse to post, with a clear error, when no rate exists. Do not fall back to 1:1.
  • The receivable is the sum of the converted lines, so rounding cannot unbalance the entry.
  • Exchange rates stay reachable without the multi-currency module, because posting now depends on them.

Payments use the invoice-date rate so the receivable clears. A later payment-date exchange difference is not posted.

Test plan

  • test_eur_invoice_is_booked_in_the_organization_currency — 1,621.50 EUR at 0.95 posts 1,540.43 CHF
  • test_foreign_invoice_without_an_exchange_rate_is_not_posted
  • Finalize an existing EUR draft again after adding an ECB rate (already-posted entries are unchanged)

A EUR invoice kept its currency on the document, but posting copied
the same number into the single-currency ledger and the UI labeled
it CHF. Convert at the exchange rate on or before the document date,
and refuse to post when no rate exists.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant