From bf2133de02409b0f9aa497eb0ed32a3e2550ba84 Mon Sep 17 00:00:00 2001 From: einhverfr Date: Mon, 29 Sep 2008 23:38:19 +0000 Subject: Correcting payment bug: contact total shows 0 when Some radio button is selected Also moved the bulk post function to use a temp table to try to get performance gains (if this doesn't work, we will have to go to the one stored proc per invoice approach which I would rather not do). git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@2344 4979c152-3d1c-0410-bac9-87ea11338e46 --- scripts/payment.pl | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'scripts/payment.pl') diff --git a/scripts/payment.pl b/scripts/payment.pl index b9d6f94c..f5173e24 100644 --- a/scripts/payment.pl +++ b/scripts/payment.pl @@ -368,11 +368,10 @@ sub display_payments { for my $invoice (@{$_->{invoices}}){ if (($payment->{action} ne 'update_payments') or (defined $payment->{"id_$_->{contact_id}"})){ - if ($payment->{"paid_$_->{contact_id}"} eq 'some'){ my $i_id = $invoice->[0]; $contact_total - += $payment->{"paid_$_->{contact_id}_$i_id"}; + += $payment->{"payment_$i_id"}; } } $invoice->[3] = $payment->format_amount(amount => $invoice->[3], @@ -383,8 +382,8 @@ sub display_payments { money => 1); $invoice->[6] = $payment->format_amount(amount => $invoice->[6], money => 1); - if (!$payment->{action} ne 'update_payments'){ - my $fld = "payment_" . $invoice->[0]; + my $fld = "payment_" . $invoice->[0]; + if (!defined $payment->{"$fld"} ){ $payment->{"$fld"} = $invoice->[6]; } } -- cgit v1.2.3