premium-minds / billy

An opensource invoicing engine
https://premium-minds.github.io/billy/
GNU Lesser General Public License v3.0
41 stars 16 forks source link

Scale and precision inconsistencies in some locations #495

Open thenmaster opened 11 months ago

thenmaster commented 11 months ago

In various locations, BillyMathContext and BillyMathContext.SCALE are used when performaing calculations on BIgDecimal instances that represent the amount of an entry/invoice/etc. with or without taxes to determine other values relevant for the billing process(ex: calculating the tax amount when the amount given for an entry already includes the tax value). However there are some inconsistencies that can lead to some problems in runtime.

Most of these problems are independent from each other so they can/should be addressed separately to reduce complexity and facilitate testing.