Skip to content

feat: display per-row exchange rates on FA(3) invoices#164

Open
nawrotadam wants to merge 6 commits into
ksef4dev:masterfrom
nawrotadam:line-exchange-rates
Open

feat: display per-row exchange rates on FA(3) invoices#164
nawrotadam wants to merge 6 commits into
ksef4dev:masterfrom
nawrotadam:line-exchange-rates

Conversation

@nawrotadam

Copy link
Copy Markdown

Description

FA(3) invoices issued in a foreign currency can carry a different exchange rate (KursWaluty) per invoice line, but currently the exchange rate is not displayed per line. This PR adds per-line visualization of exchange rates and changes when a single rate common to the whole invoice is displayed.

Implemented behaviour:

  • If all lines share one rate, the rate is shown in the invoice header along with the note that it is common to all lines. Per-line exchange rates are not shown.
  • If lines have different rates, or some lines have no rate, a per-line exchange rate column is added to the positions table, showing each line rate.
  • Rates are compared numerically, so equal values formatted differently (e.g. with trailing zeros) are treated as the same rate.
  • For correction invoices with a pair of before and after rows (StanPrzed), the common header is never shown. The per-line exchange rate is shown when the rate was actually corrected (before != after), and no exchange rate is shown when it is unchanged (before and after have the same value).

References

Fixes #140

Testing

Unit tests added in ExchangeRateTest, covering five scenarios:

  • all lines share one rate
  • different rates
  • incomplete rates
  • correction invoice with a changed rate
  • correction invoice without a rate change

Test invoice examples added to test/resources/ExchangeRateTest.

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.

FA(3): no support for per-line exchange rates in invoice positions table

1 participant