Closed moiristo closed 5 years ago
Hmm, yeah, unfortunately way too many fields in camt files are actually optional.
What would your expectation be in terms of behaviour? I could imagine both: a better exception or defaulting to 0, which is technically correct for something that has no amount.
Could you provide us with a little bit of background on the reason for that transaction not having an amount? What kind of transaction is it?
I wish I knew, but unfortunately I can't see what the user has uploaded. However, I'd say that the most logical behaviour would be that amount_in_cents
and amount
both yield nil
when no value is set, as no amount has been passed?
Yeah, that's true. We will adapt it accordingly
Resolved in #22 and released as v2.6.1
Thanks!
Hi,
Somehow a client of us managed to get hold of a CAMT file with transactions without an amount. This yields the error described with the trace below. As this is not easy to catch, I think the gem should check the value before building the BigDecimal. Maybe a validation? I'm using
amount_in_cents
now, as this yields zero when no amount is set.