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

SF.net SVN: ledger-smb: [726] branches/1.2/bin/cp.pl



Revision: 726
          http://svn.sourceforge.net/ledger-smb/?rev=726&view=rev
Author:   einhverfr
Date:     2006-12-05 15:13:22 -0800 (Tue, 05 Dec 2006)

Log Message:
-----------
Fixing NaN issues with cash screens.

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

Modified: branches/1.2/bin/cp.pl
===================================================================
--- branches/1.2/bin/cp.pl	2006-12-05 23:12:52 UTC (rev 725)
+++ branches/1.2/bin/cp.pl	2006-12-05 23:13:22 UTC (rev 726)
@@ -373,7 +373,11 @@
     
     $totalamount += $form->{"amount_$i"};
     $totaldue += $form->{"due_$i"};
-    $totalpaid += $form->{"paid_$i"};
+    if ($form->{"paid_$i"} =~ /NaN/){
+        $form->{"paid_$i"} = '';
+    } else {
+        $totalpaid += $form->{"paid_$i"};
+    }
 
     for (qw(amount due paid)) { $form->{"${_}_$i"} = $form->format_amount(\%myconfig, $form->{"${_}_$i"}, 2) }
 
@@ -387,6 +391,9 @@
     $column_data{due} = qq|<td align=right>$form->{"due_$i"}</td>
       <input type=hidden name="due_$i" value=$form->{"due_$i"}>|;
 
+    if ($form->{"paid_$i"} =~ /NaN/){
+        $form->{"paid_$i"} = '';
+    }
     $column_data{paid} = qq|<td align=right><input name="paid_$i" size=10 value=$form->{"paid_$i"}></td>|;
 
     if ($same_id eq $form->{"$form->{vc}_id_$i"}) {
@@ -992,10 +999,13 @@
   for $i (1 .. $form->{rowcount}) {
 
     for (qw(amount due paid)) { $form->{"${_}_$i"} = $form->parse_amount(\%myconfig, $form->{"${_}_$i"}) }
-    
+
+
     $totalamount += $form->{"amount_$i"};
     $totaldue += $form->{"due_$i"};
-    $totalpaid += $form->{"paid_$i"};
+    if ($form->{"paid_$i"} !~ /NaN/){
+       $totalpaid += $form->{"paid_$i"};
+    }
 
     for (qw(amount due paid)) { $form->{"${_}_$i"} = $form->format_amount(\%myconfig, $form->{"${_}_$i"}, 2) }
 
@@ -1008,6 +1018,9 @@
       <input type=hidden name="amount_$i" value=$form->{"amount_$i"}>|;
     $column_data{due} = qq|<td align=right width=15%>$form->{"due_$i"}</td>
       <input type=hidden name="due_$i" value=$form->{"due_$i"}>|;
+    if ($form->{"paid_$i"} =~ /NaN/){
+        $form->{"paid_$i"} = '';
+    }
 
     $column_data{paid} = qq|<td align=right width=15%><input name="paid_$i" size=10 value=$form->{"paid_$i"}></td>|;
 


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