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

SF.net SVN: ledger-smb: [214] trunk/bin/rc.pl



Revision: 214
          http://svn.sourceforge.net/ledger-smb/?rev=214&view=rev
Author:   tetragon
Date:     2006-10-13 10:31:13 -0700 (Fri, 13 Oct 2006)

Log Message:
-----------
Round displayed values in till breakdown

Modified Paths:
--------------
    trunk/bin/rc.pl

Modified: trunk/bin/rc.pl
===================================================================
--- trunk/bin/rc.pl	2006-10-13 17:19:32 UTC (rev 213)
+++ trunk/bin/rc.pl	2006-10-13 17:31:13 UTC (rev 214)
@@ -250,6 +250,7 @@
 function custom_calc_total(){
   |;
   my $subgen = 'document.forms[0].sub_sub.value = ';
+  my $toround = '';
   foreach my $unit (@{$pos_config{'breakdown'}}) {
     # XXX Needs to take into account currencies that don't use 2 dp
     my $parsed = $form->parse_amount(\%pos_config, $unit);
@@ -261,8 +262,12 @@
   document.forms[0].${subval}.value = document.forms[0].${calcval}.value * $parsed;
     |;
     $subgen .= "document.forms[0].${subval}.value * 1 + ";
+    $toround .= qq|
+    	document.forms[0].${subval}.value = 
+    	money_round(document.forms[0].${subval}.value); |;
   }
   print $subgen . "0;";
+  print $toround;
   print qq|document.forms[0].sub_sub.value = 
            money_round(document.forms[0].sub_sub.value);
   document.forms[0].amount_cash.value = money_round(


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