ekmungai / eloquent-ifrs

Eloquent Double Entry Accounting with a focus on IFRS Compliant Reporting
MIT License
332 stars 67 forks source link

Fixed ledger loading precision fix #124

Closed kvmarkovich closed 1 year ago

kvmarkovich commented 1 year ago

For a some reason floating point has been lost on my environment. Fixed that issue.

ekmungai commented 1 year ago

Hi @kvmarkovich could you please provide some more details about the loss? perhaps the database type or maybe a stacktrace of an error.

Cheers, Edward

kvmarkovich commented 1 year ago

Hi Edward,

Sure, running test I had an error that expected 75.5 but got 75

I'm pretty sure that it's some SQLite issue but it's better to avoid it.

Best, Kostia

ekmungai commented 1 year ago

Hi Kostia,

That's exactly why I'm reluctant to have code that depends on the underlying database in the package. For instance, in postgres the rounding you added to the ledger model would fail because they do not meet the requirements of the SQL dialect for postgres. Its also the reason why there's so little raw sql anywhere in the package, instead letting Eloquent handle the sql generation based on the db type.

Cheers, Edward

kvmarkovich commented 1 year ago

Hi Edward,

I've got it. Thank you for the explanation.

Best, Kostia