[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: percentage discount not calculating properly



Hello Folks,
First of all, I want to say thank you for all the comment and discussion
on this topic.  It helped me a lot to understand the problem and the
possible methods to address it.  Also, I am sorry to  bring a dead horse
back to life...
I have talked it over with my client, and they are in agreement that by
the math, rounding to two decimals is a good as to four (maybe even
better).
However, in our little corner of the world, the vast majority of
businesses use a program produced by Sage called Simply Accounting.  It
is so overwhelmingly in use that regardless of correctness (which I am
sure it is very correct), it is the standard that everyone expects to
work by.  
That program uses 4 decimals.  So we are hoping to use 4 too.

> >
> > Starting on line 307 of IS.pm (1.2.18), the linetotal is rounded to 2
> > decimal places, no matter what it was before.  Could this be changed to
> > use $decimalplaces without causing problems down stream?  That would get
> > my stage 2 from a previous message.
> 
> I am pretty sure it could.  However, that would be a behavior change
> that we might not necessarily want to make for everyone without
> getting a lot of input first.  Hence a patch that can be
> downloaded/installed would be better.

To say this another way, this may be appropriate for me at this
time ;)  

I have looked this section of code over, and if I read it correctly, I
see two places where the number 2 *might need to be changed:

Line 309      2 );
Line 351      $form->format_amount( $myconfig, $linetotal, 2 );

Being the mildly adventurous sort, I tried setting them both to 4, then
one to 4, then the other to 4, none of those combinations made updating
an invoice do  the math to include the 3rd and 4th decimal places
without adjusting the dollar value to four decimals.  Am I in the wrong
place, or adjusting the wrong thing?

It was suggested by my client to adjust the sell price on all of our
parts/services to include 4 decimal points, but adding the extra
characters didn't stick.  It also appears that the database drops silent
zeros at the end of the number in those fields as well - an even dollar
amount doesn't even have a decimal place in the sellprice field of the
parts table.

Are there any other places I might be looking?

Thank you.

Bob Miller
334-7117/633-3760
http://computerisms.ca
..hidden..
Network, Internet, Server,
and Open Source Solutions