|
Lines 47-52
BEGIN {
Link Here
|
| 47 |
&makepartialpayment |
47 |
&makepartialpayment |
| 48 |
&recordpayment_selectaccts |
48 |
&recordpayment_selectaccts |
| 49 |
&WriteOffFee |
49 |
&WriteOffFee |
|
|
50 |
&GetTotalFines |
| 50 |
); |
51 |
); |
| 51 |
} |
52 |
} |
| 52 |
|
53 |
|
|
Lines 814-819
sub WriteOffFee {
Link Here
|
| 814 |
|
815 |
|
| 815 |
} |
816 |
} |
| 816 |
|
817 |
|
|
|
818 |
=head2 GetTotalFines |
| 819 |
|
| 820 |
my $total_fines_owed = GetTotalFines( $borrowernumber ); |
| 821 |
|
| 822 |
Returns the total amount owed by the given borrower. |
| 823 |
|
| 824 |
=cut |
| 825 |
|
| 826 |
sub GetTotalFines { |
| 827 |
my ( $borrowernumber ) = @_; |
| 828 |
my $dbh = C4::Context->dbh(); |
| 829 |
my $query = "SELECT SUM( amountoutstanding ) AS total FROM accountlines WHERE borrowernumber = ?"; |
| 830 |
my $sth = $dbh->prepare( $query ); |
| 831 |
$sth->execute( $borrowernumber ); |
| 832 |
my $row = $sth->fetchrow_hashref(); |
| 833 |
my $total = $row->{'total'}; |
| 834 |
$total = $total || 0; |
| 835 |
return $total; |
| 836 |
} |
| 837 |
|
| 817 |
END { } # module clean-up code here (global destructor) |
838 |
END { } # module clean-up code here (global destructor) |
| 818 |
|
839 |
|
| 819 |
1; |
840 |
1; |