|
Lines 50-55
BEGIN {
Link Here
|
| 50 |
&makepartialpayment |
50 |
&makepartialpayment |
| 51 |
&recordpayment_selectaccts |
51 |
&recordpayment_selectaccts |
| 52 |
&WriteOffFee |
52 |
&WriteOffFee |
|
|
53 |
&GetTotalFines |
| 53 |
); |
54 |
); |
| 54 |
} |
55 |
} |
| 55 |
|
56 |
|
|
Lines 997-1002
sub WriteOffFee {
Link Here
|
| 997 |
|
998 |
|
| 998 |
} |
999 |
} |
| 999 |
|
1000 |
|
|
|
1001 |
=head2 GetTotalFines |
| 1002 |
|
| 1003 |
my $total_fines_owed = GetTotalFines( $borrowernumber ); |
| 1004 |
|
| 1005 |
Returns the total amount owed by the given borrower. |
| 1006 |
|
| 1007 |
=cut |
| 1008 |
|
| 1009 |
sub GetTotalFines { |
| 1010 |
my ( $borrowernumber ) = @_; |
| 1011 |
my $dbh = C4::Context->dbh(); |
| 1012 |
my $query = "SELECT SUM( amountoutstanding ) AS total FROM accountlines WHERE borrowernumber = ?"; |
| 1013 |
my $sth = $dbh->prepare( $query ); |
| 1014 |
$sth->execute( $borrowernumber ); |
| 1015 |
my $row = $sth->fetchrow_hashref(); |
| 1016 |
my $total = $row->{'total'}; |
| 1017 |
$total = $total || 0; |
| 1018 |
return $total; |
| 1019 |
} |
| 1020 |
|
| 1000 |
END { } # module clean-up code here (global destructor) |
1021 |
END { } # module clean-up code here (global destructor) |
| 1001 |
|
1022 |
|
| 1002 |
1; |
1023 |
1; |