Rounding Up or Down?

SOLVED

Please consider this:

Subtotal 295.00
GST (5%) 14.75
QST (9.975%) 29.42625
Total 339.1763

How does sage round the final total, we are using the SDK, the amount is off by 0.01$ sometimes does it round up to 339.18 or down to 339.17

Thanks

Top Replies

  • How does sage round the final total

    [ x ]  None of the above.

    Sage calculates and rounds line-by-line, so it doesn't use the subtotal in the calculations. 

    For one detail line of $295.00…

  • +1
    verified answer
    How does sage round the final total

    [ x ]  None of the above.

    Sage calculates and rounds line-by-line, so it doesn't use the subtotal in the calculations. 

    For one detail line of $295.00, the QST is rounded to $29.43, and the total is $339.18

    LIne no. Lines GST Rounded QST Rounded Sum
    5.000% 9.975%
    1      295.00 14.75        14.75 29.42625        29.43      339.18
    Total      295.00 14.75        14.75 29.42625        29.43      339.18

    For two detail lines of $91.06 and $203.94, the QST is rounded to $29.42, and the total is $339.17:

    Lines GST Rounded QST Rounded Sum
    5.000% 9.975%
           91.06 4.553          4.55 9.083235          9.08      104.69
         203.94 10.197        10.20 20.34302        20.34      234.48
    Total      295.00 14.75        14.75 29.42625        29.42      339.17

    The above are from Excel, since Sage 50 Canadian isn't open source if you're using the SDK you'll need to test back and forth with the client software interface to see whether it is behaving as expected / as coded.

    Off the top of my head, some additional test cases could be:

     - billing out of small line item amounts

     - 4 digit pricing properly rounded off to 2 digit line amount

     - Line item is discounted

     - Early Payment discount on Cash, Cheque, or Credit Card paid invoice - is discount before / after tax by law, and are settings correct?

     - Foreign Currency 

      - Returns

    Combinations of those.   Foreign Currency rounding on Inventory returns doesn't work properly even in the software, so that's fun.

    I hope that helps, please post back.

    Randy Wester

  • 0 in reply to RandyW

    So,the answer is Sage 50 CA does not round !!! it truncates and it calculates line by line as above

    FYI: (Math.Truncate(29.42625 * 100) / 100)

  • 0 in reply to Zulander
    Sage 50 CA does not round !!! it truncates and it calculates line by line as above

    No,  forget about using the subtotal to calculate tax.  It's only used to calculate the invoice grand total.

    Sage 50 CA does not truncate line by line before summing, nor does it sum then truncate

    Sage 50 CA rounds and stores each invoice amount and tax amount by line, then sums the rounded amounts.

    FYI When stored, the relvars appear to be:

    titlulit.dTaxAmount  for invoice line item, by sales tax type, and

    titlut for total invoice tax by type.

    LIne total of all sales taxes is also stored in titluli.dTaxAmt, the main invoice table titlu stores only the grand total.

    The reason it's coded that way appears (to me) to be that not every line will have the same tax or the same rates applied, in every situation, and there is the option to print the tax amounts on each line of the invoice.  (see below)

    In Excel terms, it appears to do this (I picked two numbers X and $295.00 minus X) to get to $295.00:

    =(Round(91.06*.09975,2) + Round(203.94*.09975,2)) = 29.42

    =(Round(9.083235,2) + Round(20.34302,2)) = 29.42.

    Sage 50 does not use the subtotal of the invoice to calculate the sales taxes, and does not have a setting to make it function that way.

    (Round(X*.09975,2) + Round((295-X)*.09975,2)) does not equal Round(295*.09975,2) for all values of X.