From f077aa6c1fd9a217bfa6f4e2e789901f22208a3b Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Sun, 6 Jan 2008 18:58:53 -0600 Subject: [PATCH] Fix for bug 1730 fixing display for pay.pl Signed-off-by: Joshua Ferraro --- C4/Members.pm | 3 ++- C4/Overdues.pm | 14 +++++++------- .../intranet-tmpl/prog/en/modules/members/pay.tmpl | 11 +++++++++-- members/pay.pl | 7 ++++--- 4 files changed, 22 insertions(+), 13 deletions(-) diff --git a/C4/Members.pm b/C4/Members.pm index 79635986ac..bcb0f00e06 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -1132,10 +1132,11 @@ sub GetBorNotifyAcctRecord { FROM accountlines WHERE borrowernumber=? AND notify_id=? - AND (accounttype='FU' OR accounttype='N' OR accounttype='M'OR accounttype='A'OR accounttype='F'OR accounttype='L' OR accounttype='IP' OR accounttype='CH' OR accounttype='RE' OR accounttype='RL') AND amountoutstanding != '0' ORDER BY notify_id,accounttype "); +# AND (accounttype='FU' OR accounttype='N' OR accounttype='M'OR accounttype='A'OR accounttype='F'OR accounttype='L' OR accounttype='IP' OR accounttype='CH' OR accounttype='RE' OR accounttype='RL') + $sth->execute( $borrowernumber, $notifyid ); my $total = 0; while ( my $data = $sth->fetchrow_hashref ) { diff --git a/C4/Overdues.pm b/C4/Overdues.pm index 7cf64ab883..87dfbb64a6 100644 --- a/C4/Overdues.pm +++ b/C4/Overdues.pm @@ -695,9 +695,9 @@ return $result; } -=item AmountNotify +=item NumberNotifyId -(@notify) = &AmountNotify($borrowernumber); +(@notify) = &NumberNotifyId($borrowernumber); Returns amount for all file per borrowers C<@notify> array contains all file per borrowers @@ -733,19 +733,19 @@ C<$notifyid> is the file number C<$totalnotify> contains amount of a file -C<$notify_id> contains the file number for the borrower number nad item number +C<$notify_id> contains the file number for the borrower number and item number =cut sub AmountNotify{ - my ($notifyid)=@_; + my ($notifyid,$borrowernumber)=@_; my $dbh = C4::Context->dbh; my $query=qq| SELECT sum(amountoutstanding) FROM accountlines - WHERE notify_id=?|; + WHERE notify_id=? AND borrowernumber = ?|; my $sth=$dbh->prepare($query); - $sth->execute($notifyid); - my $totalnotify=$sth->fetchrow; + $sth->execute($notifyid,$borrowernumber); + my $totalnotify=$sth->fetchrow; $sth->finish; return ($totalnotify); } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tmpl index c80f9a0845..a3bcaa026c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tmpl @@ -49,11 +49,14 @@ - "> + " value="" /> " value="" /> " value="" /> @@ -75,11 +78,15 @@ - Total Due + Sub Total + + Total Due + +
">Cancel

has no outstanding fines.

diff --git a/members/pay.pl b/members/pay.pl index 4e060c483f..a1213bbd2a 100755 --- a/members/pay.pl +++ b/members/pay.pl @@ -99,7 +99,7 @@ if ( $check == 0 ) { GetBorNotifyAcctRecord( $borrowernumber, $notify[$j] ); for ( my $i = 0 ; $i < $numaccts ; $i++ ) { my %line; - if ( $accts->[$i]{'amountoutstanding'} > 0 ) { + if ( $accts->[$i]{'amountoutstanding'} != 0 ) { $accts->[$i]{'amount'} += 0.00; $accts->[$i]{'amountoutstanding'} += 0.00; $line{i} = $j . "" . $i; @@ -119,13 +119,14 @@ if ( $check == 0 ) { push( @loop_pay, \%line ); } - my $totalnotify = AmountNotify( $notify[$j] ); + my $totalnotify = AmountNotify( $notify[$j], $borrowernumber ); ( $totalnotify = '0' ) if ( $totalnotify =~ /^0.00/ ); push @allfile, { 'loop_pay' => \@loop_pay, 'notify' => $notify[$j], - 'total' => $totalnotify + 'total' => sprintf( "%.2f",$totalnotify), + }; } -- 2.39.2