summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2006-12-05 23:13:22 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2006-12-05 23:13:22 +0000
commit75debecc210de2bbc7d8d4cbe70f5e95d9ce1b1e (patch)
tree561b634690da5b29ca5b7d0bdb11dc647639446a /bin
parent2479af974477a3b41c34788f8cbf6c054eb066c7 (diff)
Fixing NaN issues with cash screens.
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@726 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'bin')
-rwxr-xr-xbin/cp.pl19
1 files changed, 16 insertions, 3 deletions
diff --git a/bin/cp.pl b/bin/cp.pl
index c0f2c2eb..0e8a4255 100755
--- a/bin/cp.pl
+++ b/bin/cp.pl
@@ -373,7 +373,11 @@ sub invoices_due {
$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 @@ sub invoices_due {
$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 @@ sub list_invoices {
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 @@ sub list_invoices {
<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>|;