Lines 87-92
elsif ( $input->param('writeoff_selected') ) {
Link Here
|
87 |
elsif ( $input->param('woall') ) { |
87 |
elsif ( $input->param('woall') ) { |
88 |
writeoff_all(@names); |
88 |
writeoff_all(@names); |
89 |
} |
89 |
} |
|
|
90 |
elsif ( $input->param('apply_credits') ) { |
91 |
apply_credits({ patron => $patron, cgi => $input }); |
92 |
} |
90 |
elsif ( $input->param('confirm_writeoff') ) { |
93 |
elsif ( $input->param('confirm_writeoff') ) { |
91 |
my $accountlines_id = $input->param('accountlines_id'); |
94 |
my $accountlines_id = $input->param('accountlines_id'); |
92 |
my $amount = $input->param('amountwrittenoff'); |
95 |
my $amount = $input->param('amountwrittenoff'); |
Lines 138-144
output_html_with_http_headers $input, $cookie, $template->output;
Link Here
|
138 |
sub add_accounts_to_template { |
141 |
sub add_accounts_to_template { |
139 |
|
142 |
|
140 |
my $patron = Koha::Patrons->find( $borrowernumber ); |
143 |
my $patron = Koha::Patrons->find( $borrowernumber ); |
141 |
my $account_lines = $patron->account->outstanding_debits; |
144 |
my $account = $patron->account; |
|
|
145 |
my $outstanding_credits = $account->outstanding_credits; |
146 |
my $account_lines = $account->outstanding_debits; |
142 |
my $total = $account_lines->total_outstanding; |
147 |
my $total = $account_lines->total_outstanding; |
143 |
my @accounts; |
148 |
my @accounts; |
144 |
while ( my $account_line = $account_lines->next ) { |
149 |
while ( my $account_line = $account_lines->next ) { |
Lines 157-163
sub add_accounts_to_template {
Link Here
|
157 |
patron => $patron, |
162 |
patron => $patron, |
158 |
accounts => \@accounts, |
163 |
accounts => \@accounts, |
159 |
total => $total, |
164 |
total => $total, |
|
|
165 |
outstanding_credits => $outstanding_credits |
160 |
); |
166 |
); |
|
|
167 |
|
161 |
return; |
168 |
return; |
162 |
|
169 |
|
163 |
} |
170 |
} |
Lines 273-275
sub payselected {
Link Here
|
273 |
print $input->redirect($redirect); |
280 |
print $input->redirect($redirect); |
274 |
return; |
281 |
return; |
275 |
} |
282 |
} |
276 |
- |
283 |
|
|
|
284 |
sub apply_credits { |
285 |
my ($args) = @_; |
286 |
|
287 |
my $patron = $args->{patron}; |
288 |
my $cgi = $args->{cgi}; |
289 |
|
290 |
$patron->account->reconcile_balance(); |
291 |
|
292 |
print $cgi->redirect("/cgi-bin/koha/members/pay.pl?borrowernumber=" . $patron->borrowernumber ); |
293 |
return; |
294 |
} |