View | Details | Raw Unified | Return to bug 18805
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt (+3 lines)
Lines 123-128 Link Here
123
[% IF CAN_user_updatecharges_writeoff %]<input type="submit" name="woall"  id="woall" value="Write off all" class="submit" />[% END %]
123
[% IF CAN_user_updatecharges_writeoff %]<input type="submit" name="woall"  id="woall" value="Write off all" class="submit" />[% END %]
124
<input type="submit" id="payselected" name="payselected"  value="Pay selected" class="submit" />
124
<input type="submit" id="payselected" name="payselected"  value="Pay selected" class="submit" />
125
<input type="submit" id="writeoff-selected" name="writeoff_selected"  value="Write off selected" class="submit" />
125
<input type="submit" id="writeoff-selected" name="writeoff_selected"  value="Write off selected" class="submit" />
126
[% IF outstanding_credits.total_outstanding < 0 %]
127
<input type="submit" id="normalize_account" name="normalize_account"  value="Normalize account" class="submit" />
128
[% END %]
126
<a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber | html %]">Cancel</a>
129
<a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber | html %]">Cancel</a>
127
</fieldset>
130
</fieldset>
128
</form>
131
</form>
(-)a/members/pay.pl (-2 / +20 lines)
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('normalize_account') ) {
91
    normalize_account({ 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 normalize_account {
285
    my ($args) = @_;
286
287
    my $patron = $args->{patron};
288
    my $cgi    = $args->{cgi};
289
290
    $patron->account->normalize_balance();
291
292
    print $cgi->redirect("/cgi-bin/koha/members/pay.pl?borrowernumber=" . $patron->borrowernumber );
293
    return;
294
}

Return to bug 18805