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

SF.net SVN: ledger-smb:[2822] branches/1.2/bin/io.pl



Revision: 2822
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2822&view=rev
Author:   einhverfr
Date:     2009-12-13 19:36:50 +0000 (Sun, 13 Dec 2009)

Log Message:
-----------
Correction for rare tax rounding bug

Modified Paths:
--------------
    branches/1.2/bin/io.pl

Modified: branches/1.2/bin/io.pl
===================================================================
--- branches/1.2/bin/io.pl	2009-12-13 01:45:14 UTC (rev 2821)
+++ branches/1.2/bin/io.pl	2009-12-13 19:36:50 UTC (rev 2822)
@@ -257,12 +257,9 @@
             }
         }
 
-        $discount =
-          $form->round_amount(
-            $form->{"sellprice_$i"} * $form->{"discount_$i"} / 100,
-            $decimalplaces );
-        $linetotal = $form->round_amount( $form->{"sellprice_$i"} - $discount,
-            $decimalplaces );
+        $linetotal = $form->round_amount( $form->{"sellprice_$i"}
+                                          * (1 - ($form->{"discount_$i"} / 100),
+                                          $decimalplaces);
         $linetotal = $form->round_amount( $linetotal * $form->{"qty_$i"}, 2 );
 
         if (


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.