Lines 537-544
sub UpdateFine {
Link Here
|
537 |
# "REF" is Cash Refund |
537 |
# "REF" is Cash Refund |
538 |
my $sth = $dbh->prepare( |
538 |
my $sth = $dbh->prepare( |
539 |
"SELECT * FROM accountlines |
539 |
"SELECT * FROM accountlines |
540 |
WHERE borrowernumber=? |
540 |
WHERE borrowernumber=? AND |
541 |
AND accounttype IN ('FU','O','F','M')" |
541 |
(( accounttype IN ('O','F','M') AND amountoutstanding<>0 ) OR |
|
|
542 |
accounttype = 'FU' )" |
542 |
); |
543 |
); |
543 |
$sth->execute( $borrowernumber ); |
544 |
$sth->execute( $borrowernumber ); |
544 |
my $data; |
545 |
my $data; |
Lines 549-557
sub UpdateFine {
Link Here
|
549 |
# - accumulate fines for other items |
550 |
# - accumulate fines for other items |
550 |
# so we can update $itemnum fine taking in account fine caps |
551 |
# so we can update $itemnum fine taking in account fine caps |
551 |
while (my $rec = $sth->fetchrow_hashref) { |
552 |
while (my $rec = $sth->fetchrow_hashref) { |
552 |
if ( $rec->{issue_id} == $issue_id ) { |
553 |
if ( $rec->{issue_id} == $issue_id && $rec->{accounttype} eq 'FU' ) { |
553 |
if ($data) { |
554 |
if ($data) { |
554 |
warn "Not a unique accountlines record for issue_id $issue_id"; |
555 |
warn "Not a unique accountlines record for issue_id $issue_id"; |
|
|
556 |
#FIXME Should we still count this one in total_amount ?? |
555 |
} |
557 |
} |
556 |
else { |
558 |
else { |
557 |
$data = $rec; |
559 |
$data = $rec; |
558 |
- |
|
|