|
Lines 49-54
BEGIN {
Link Here
|
| 49 |
&makepartialpayment |
49 |
&makepartialpayment |
| 50 |
&recordpayment_selectaccts |
50 |
&recordpayment_selectaccts |
| 51 |
&WriteOffFee |
51 |
&WriteOffFee |
|
|
52 |
&GetTotalFines |
| 52 |
); |
53 |
); |
| 53 |
} |
54 |
} |
| 54 |
|
55 |
|
|
Lines 824-829
sub WriteOffFee {
Link Here
|
| 824 |
|
825 |
|
| 825 |
} |
826 |
} |
| 826 |
|
827 |
|
|
|
828 |
=head2 GetTotalFines |
| 829 |
|
| 830 |
my $total_fines_owed = GetTotalFines( $borrowernumber ); |
| 831 |
|
| 832 |
Returns the total amount owed by the given borrower. |
| 833 |
|
| 834 |
=cut |
| 835 |
|
| 836 |
sub GetTotalFines { |
| 837 |
my ( $borrowernumber ) = @_; |
| 838 |
my $dbh = C4::Context->dbh(); |
| 839 |
my $query = "SELECT SUM( amountoutstanding ) AS total FROM accountlines WHERE borrowernumber = ?"; |
| 840 |
my $sth = $dbh->prepare( $query ); |
| 841 |
$sth->execute( $borrowernumber ); |
| 842 |
my $row = $sth->fetchrow_hashref(); |
| 843 |
my $total = $row->{'total'}; |
| 844 |
$total = $total || 0; |
| 845 |
return $total; |
| 846 |
} |
| 847 |
|
| 827 |
END { } # module clean-up code here (global destructor) |
848 |
END { } # module clean-up code here (global destructor) |
| 828 |
|
849 |
|
| 829 |
1; |
850 |
1; |