#878 1.4 Rounding issues

1.4
closed-fixed
None
5
2014-01-17
2013-07-26
No

This issue is being updated based on a problem in all current versions -- the inability to close out an invoice that has a fractional amount -- when payment is received, it is rounded, and thus the end transaction can never get fully balanced.

One common source of this problem is sales tax, when a tax amount is added as a line item and disregards the rounding issue.

So there might need to be two different fixes here:

  1. Round all tax amounts to the specified precision, and never store amounts in acc_trans that are not properly rounded

  2. Provide a mechanism to close out invoices with fractional amounts out of balance, presumably putting the result in an "adjustments" account.

Thoughts?

Original report (John Locke):

Some precision/rounding issues -- would like to have numbers formatted in two decimals, for dollars and cents, rather than dropping trailing zeros or showing more digits -- that shows up in a lot of places

... there is a setting on the preferences page for precision that handles that issue just fine.

Discussion

  • John Locke

    John Locke - 2013-08-14
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,3 +1,19 @@
    -John Locke reports:
    +This issue is being updated based on a problem in all current versions -- the inability to close out an invoice that has a fractional amount -- when payment is received, it is rounded, and thus the end transaction can never get fully balanced.
    +
    +One common source of this problem is sales tax, when a tax amount is added as a line item and disregards the rounding issue.
    +
    +So there might need to be two different fixes here:
    +
    +1. Round all tax amounts to the specified precision, and never store amounts in acc_trans that are not properly rounded
    +
    +2. Provide a mechanism to close out invoices with fractional amounts out of balance, presumably putting the result in an "adjustments" account.
    +
    +Thoughts?
    +
    +
    +
    +Original report (John Locke):
    
     Some precision/rounding issues -- would like to have numbers formatted in two decimals, for dollars and cents, rather than dropping trailing zeros or showing more digits -- that shows up in a lot of places
    +
    +... there is a setting on the preferences page for precision that handles that issue just fine.
    
     
  • Chris Travers

    Chris Travers - 2014-01-11

    There is a column in ar and ap force_closed that could be used to do this. We could extend the reports to do this but there is no UI currently to set this.

    The problem of course is that rules can change. I would like to have a default rounding account for ar/ap but not sure how practical that is for 1.4.

     
  • Chris Travers

    Chris Travers - 2014-01-11

    What I would like to propose are essentially two things:

    1. Build a rounding tax module which rounds taxes to nearest cent.
    2. Look at better handling of fractional currency in 1.5.

    The tax module could be an addon for 1.3 as well and this would not require any deep changes to our accounting assumptions.

     
  • Chris Travers

    Chris Travers - 2014-01-15

    Speaking of which, in 1.4, we aren't looking at the force_closed field and we probably should (in both payments and outstanding). The original reason was to handle problematic imports and historical data from SQL-Ledger but it could be used for other things too. We'd probably want to talk about handling from a payment-reversal perspective.

     
  • Chris Travers

    Chris Travers - 2014-01-15
    • assigned_to: Chris Travers
     
  • Chris Travers

    Chris Travers - 2014-01-17

    Rounded tax module added in svn 6485. Note that this cannot be easily backported to 1.3 without a related fix to LedgerSMB::Tax.

     
  • Chris Travers

    Chris Travers - 2014-01-17
    • status: open --> closed-fixed
     
  • Chris Travers

    Chris Travers - 2014-01-17

    force_closed handling added in svn 6486. Closing ticket.

    We should discuss how force_closed should be treated relative to on_hold, on the mailing list. however this completes the toolkit necessary to generally handle and prevent rounding issues. In 1.5 we should address questions of fractional cents in ar/ap accounts.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks