test(crm): dunning fee math, VAT-toggle gating + invoice immutability

Covers the tax-sensitive bits the dunning rework added (previously untested):
flat vs percent fee, the VAT toggle applying the org rate AND no-op'ing when
the org has no VAT rate, per-reminder accumulation (2nd=1x / 3rd=2x), the
invoice total staying immutable while the fee is tracked, and the 3-reminder
cap. Exports the fee resolvers + applyReminder for testing; PDF render stubbed
(flaky in CI, verified manually). 6/6 pass.
This commit is contained in:
Luca
2026-06-23 13:30:48 +02:00
parent 5ed2fec2fe
commit 83dc95a62b
2 changed files with 114 additions and 0 deletions
+4
View File
@@ -3528,6 +3528,10 @@ module.exports = {
validateInstallmentPlanInput,
sendInvoice,
sendReminder,
applyReminder,
resolveLateFeeNetMinor,
resolveLateFeeVatRate,
resolvePerReminderFeeMinor,
markPaid,
cancelInvoice,
releaseForDelivery,