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

SF.net SVN: ledger-smb:[6239] branches/1.3



Revision: 6239
          http://sourceforge.net/p/ledger-smb/code/6239
Author:   einhverfr
Date:     2013-11-07 08:28:39 +0000 (Thu, 07 Nov 2013)
Log Message:
-----------
Giovani's roundign fixes for 1.3, merged from trunk

Modified Paths:
--------------
    branches/1.3/Changelog
    branches/1.3/bin/io.pl

Modified: branches/1.3/Changelog
===================================================================
--- branches/1.3/Changelog	2013-11-07 08:26:08 UTC (rev 6238)
+++ branches/1.3/Changelog	2013-11-07 08:28:39 UTC (rev 6239)
@@ -6,7 +6,13 @@
 * Set default date for AP invoice creation to current date (Chris T)
 * Removed "apply discount" from use overpayment screen (Chris T)
 * Fixed tax checkbox problem when one tax id includes another (Chris T)
+* Fixed update forgetting creditor (Nick P)
+* Fixed invoices rounding and printing differently (Giovanni B)
 
+Chris T is Chris Travers
+Nick P is Nick Prater
+Giovanni B is Giovanni Biscuolo
+
 Changelog for 1.3.35
 * Fixed uninitialized value warnings when cached template enabled (Chris T)
 * Fixed error in logs about failed login during initial login (Chris T, 858)

Modified: branches/1.3/bin/io.pl
===================================================================
--- branches/1.3/bin/io.pl	2013-11-07 08:26:08 UTC (rev 6238)
+++ branches/1.3/bin/io.pl	2013-11-07 08:28:39 UTC (rev 6239)
@@ -89,11 +89,14 @@
 sub _calc_taxes {
     $form->{subtotal} = $form->{invsubtotal};
     for $i (1 .. $form->{rowcount}){
-        my $linetotal = 
-             $form->parse_amount(\%myconfig, $form->{"sellprice_$i"}) 
-             * $form->parse_amount(\%myconfig, $form->{"qty_$i"}) 
-             * (1 - $form->parse_amount(\%myconfig, $form->{"discount_$i"})
-                    / 100);
+        my $discount_amount = $form->round_amount( $form->{"sellprice_$i"} 
+        		       			   * ($form->{"discount_$i"} / 100), 
+		  	       			   $decimalplaces);
+        my $linetotal = $form->round_amount( $form->{"sellprice_$i"}
+                         		     - $discount_amount,
+                         		     $decimalplaces);
+        $linetotal = $form->round_amount( $linetotal * $form->{"qty_$i"}, 
+                                          $moneyplaces);
         @taxaccounts = Tax::init_taxes(
             $form, $form->{"taxaccounts_$i"},
             $form->{'taxaccounts'}
@@ -279,8 +282,11 @@
             }
         }
 
+	my $discount_amount = $form->round_amount( $form->{"sellprice_$i"} 
+			   			   * ($form->{"discount_$i"} / 100), 
+						   $decimalplaces);
         $linetotal = $form->round_amount( $form->{"sellprice_$i"}
-                                          * (1 - ($form->{"discount_$i"} / 100)),
+                                          - $discount_amount,
                                           $decimalplaces);
         $linetotal = $form->round_amount( $linetotal * $form->{"qty_$i"}, 
                                          $moneyplaces);

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


------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits