Lines 88-93
if ($payselected) {
Link Here
|
88 |
my $writeoff_all = $input->param('woall'); # writeoff all fines |
88 |
my $writeoff_all = $input->param('woall'); # writeoff all fines |
89 |
if ($writeoff_all) { |
89 |
if ($writeoff_all) { |
90 |
writeoff_all(@names); |
90 |
writeoff_all(@names); |
|
|
91 |
} elsif ( $input->param('apply_credits') ) { |
92 |
apply_credits({ patron => $patron, cgi => $input }); |
91 |
} elsif ($writeoff_item) { |
93 |
} elsif ($writeoff_item) { |
92 |
my $accountlines_id = $input->param('accountlines_id'); |
94 |
my $accountlines_id = $input->param('accountlines_id'); |
93 |
my $amount = $input->param('amountwrittenoff'); |
95 |
my $amount = $input->param('amountwrittenoff'); |
Lines 141-147
output_html_with_http_headers $input, $cookie, $template->output;
Link Here
|
141 |
sub add_accounts_to_template { |
143 |
sub add_accounts_to_template { |
142 |
|
144 |
|
143 |
my $patron = Koha::Patrons->find( $borrowernumber ); |
145 |
my $patron = Koha::Patrons->find( $borrowernumber ); |
144 |
my $account_lines = $patron->account->outstanding_debits; |
146 |
my $account = $patron->account; |
|
|
147 |
my $outstanding_credits = $account->outstanding_credits; |
148 |
my $account_lines = $account->outstanding_debits; |
145 |
my $total = $account_lines->total_outstanding; |
149 |
my $total = $account_lines->total_outstanding; |
146 |
my @accounts; |
150 |
my @accounts; |
147 |
while ( my $account_line = $account_lines->next ) { |
151 |
while ( my $account_line = $account_lines->next ) { |
Lines 160-166
sub add_accounts_to_template {
Link Here
|
160 |
patron => $patron, |
164 |
patron => $patron, |
161 |
accounts => \@accounts, |
165 |
accounts => \@accounts, |
162 |
total => $total, |
166 |
total => $total, |
|
|
167 |
outstanding_credits => $outstanding_credits |
163 |
); |
168 |
); |
|
|
169 |
|
164 |
return; |
170 |
return; |
165 |
|
171 |
|
166 |
} |
172 |
} |
Lines 279-281
sub payselected {
Link Here
|
279 |
print $input->redirect($redirect); |
285 |
print $input->redirect($redirect); |
280 |
return; |
286 |
return; |
281 |
} |
287 |
} |
282 |
- |
288 |
|
|
|
289 |
sub apply_credits { |
290 |
my ($args) = @_; |
291 |
|
292 |
my $patron = $args->{patron}; |
293 |
my $cgi = $args->{cgi}; |
294 |
|
295 |
$patron->account->reconcile_balance(); |
296 |
|
297 |
print $cgi->redirect("/cgi-bin/koha/members/pay.pl?borrowernumber=" . $patron->borrowernumber ); |
298 |
return; |
299 |
} |