fix(money): zero-decimal currency handling (D7)
Stripe sends zero-decimal currencies (JPY/KRW/VND/...) already in the major unit; the unconditional /100 recorded a JPY dues charge 100x understated in the ledger + receipt. minorToMajor is now currency-aware (shared ZERO_DECIMAL_CURRENCIES/isZeroDecimalCurrency in notifications-logic); formatMoney renders no fractional part for those. Never fires for USD; closes silent ledger corruption for such tenants. Tests added; suite 526+.
This commit is contained in:
@@ -85,6 +85,10 @@ describe('formatMoney', () => {
|
||||
expect(formatMoney(undefined, 'usd')).toBe('')
|
||||
expect(formatMoney(NaN, 'usd')).toBe('')
|
||||
})
|
||||
it('renders zero-decimal currencies with no fractional part', () => {
|
||||
expect(formatMoney(3000, 'jpy')).toBe('3000 JPY')
|
||||
expect(formatMoney(50000, 'KRW')).toBe('50000 KRW')
|
||||
})
|
||||
})
|
||||
|
||||
describe('renderDuesEmail', () => {
|
||||
|
||||
Reference in New Issue
Block a user