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

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



Revision: 2769
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2769&view=rev
Author:   einhverfr
Date:     2009-10-14 15:28:29 +0000 (Wed, 14 Oct 2009)

Log Message:
-----------
Fix for sales tax rounding issue

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

Modified: branches/1.2/bin/io.pl
===================================================================
--- branches/1.2/bin/io.pl	2009-09-15 16:00:17 UTC (rev 2768)
+++ branches/1.2/bin/io.pl	2009-10-14 15:28:29 UTC (rev 2769)
@@ -84,10 +84,10 @@
 sub _calc_taxes {
     for $i (1 .. $form->{rowcount}){
         my $linetotal = 
-             $form->parse_amount(\%myconfig, $form->{"sellprice_$i"}) 
-             * $form->parse_amount(\%myconfig, $form->{"qty_$i"}) 
+             $form->round_amount($form->parse_amount(\%myconfig, $form->{"sellprice_$i"}) 
              * (1 - $form->parse_amount(\%myconfig, $form->{"discount_$i"})
-                    / 100);
+                    / 100), 2)
+             * $form->parse_amount(\%myconfig, $form->{"qty_$i"});
         $linetotal = $form->round_amount($linetotal, 2); 
         @taxaccounts = Tax::init_taxes(
             $form, $form->{"taxaccounts_$i"},


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