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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt (-1 / +1 lines)
Lines 121-127 Link Here
121
    <script>
121
    <script>
122
        $(document).ready(function() {
122
        $(document).ready(function() {
123
            [% IF payment_id && Koha.Preference('FinePaymentAutoPopup') %]
123
            [% IF payment_id && Koha.Preference('FinePaymentAutoPopup') %]
124
                window.open('/cgi-bin/koha/members/printfeercpt.pl?action=print&accountlines_id=[% payment_id | html %]&borrowernumber=[% patron.borrowernumber | html %]', '_blank');
124
                window.open('/cgi-bin/koha/members/printfeercpt.pl?action=print&change_given=[% change_given | html %]&accountlines_id=[% payment_id | html %]&borrowernumber=[% patron.borrowernumber | html %]', '_blank');
125
            [% END %]
125
            [% END %]
126
126
127
            var txtActivefilter = _("Filter paid transactions");
127
            var txtActivefilter = _("Filter paid transactions");
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt (-1 / +1 lines)
Lines 180-186 Link Here
180
        }
180
        }
181
        $(document).ready(function(){
181
        $(document).ready(function(){
182
            [% IF payment_id && Koha.Preference('FinePaymentAutoPopup') %]
182
            [% IF payment_id && Koha.Preference('FinePaymentAutoPopup') %]
183
                window.open('/cgi-bin/koha/members/printfeercpt.pl?action=print&accountlines_id=[% payment_id | html %]&borrowernumber=[% patron.borrowernumber | html %]', '_blank');
183
                window.open('/cgi-bin/koha/members/printfeercpt.pl?action=print&accountlines_id=[% payment_id | html %]&change_given=[% change_given | html %]&borrowernumber=[% patron.borrowernumber | html %]', '_blank');
184
            [% END %]
184
            [% END %]
185
185
186
            $('#pay-fines-form').preventDoubleFormSubmit();
186
            $('#pay-fines-form').preventDoubleFormSubmit();
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt (-1 / +6 lines)
Lines 78-83 Link Here
78
    <input type="hidden" name="amountoutstanding" id="amountoutstanding" value="[% amountoutstanding | html %]" />
78
    <input type="hidden" name="amountoutstanding" id="amountoutstanding" value="[% amountoutstanding | html %]" />
79
    <input type="hidden" name="accountlines_id" id="accountlines_id" value="[% accountlines_id | html %]" />
79
    <input type="hidden" name="accountlines_id" id="accountlines_id" value="[% accountlines_id | html %]" />
80
    <input type="hidden" name="title" id="title" value="[% title | html %]" />
80
    <input type="hidden" name="title" id="title" value="[% title | html %]" />
81
    <input type="hidden" name="change_given" id="change_given" />
81
82
82
<fieldset class="rows">
83
<fieldset class="rows">
83
    <legend>Pay an individual fine</legend>
84
    <legend>Pay an individual fine</legend>
Lines 167-172 Link Here
167
    <input type="hidden" name="payment_note" id="payment_note" value="[% payment_note | html %]" />
168
    <input type="hidden" name="payment_note" id="payment_note" value="[% payment_note | html %]" />
168
    <input type="hidden" name="amountoutstanding" id="amountoutstanding" value="[% amountoutstanding | html %]" />
169
    <input type="hidden" name="amountoutstanding" id="amountoutstanding" value="[% amountoutstanding | html %]" />
169
    <input type="hidden" name="confirm_writeoff" id="confirm_writeoff" value="1" />
170
    <input type="hidden" name="confirm_writeoff" id="confirm_writeoff" value="1" />
171
    <input type="hidden" name="change_given" id="change_given" />
170
    <table>
172
    <table>
171
    <thead><tr>
173
    <thead><tr>
172
            <th>Description</th>
174
            <th>Description</th>
Lines 209-214 Link Here
209
    <input type="hidden" name="selected_accts" id="selected_accts" value="[% selected_accts | html %]" />
211
    <input type="hidden" name="selected_accts" id="selected_accts" value="[% selected_accts | html %]" />
210
    <input type="hidden" name="total" id="total" value="[% total | html %]" />
212
    <input type="hidden" name="total" id="total" value="[% total | html %]" />
211
    <input type="hidden" name="type" value="[% type | html %]" />
213
    <input type="hidden" name="type" value="[% type | html %]" />
214
    <input type="hidden" name="change_given" id="change_given" />
212
215
213
    <fieldset class="rows">
216
    <fieldset class="rows">
214
    [% IF ( selected_accts ) %]
217
    [% IF ( selected_accts ) %]
Lines 324-330 Link Here
324
    <script>
327
    <script>
325
        $(document).ready(function() {
328
        $(document).ready(function() {
326
            [% IF payment_id && Koha.Preference('FinePaymentAutoPopup') %]
329
            [% IF payment_id && Koha.Preference('FinePaymentAutoPopup') %]
327
                window.open('/cgi-bin/koha/members/printfeercpt.pl?action=print&accountlines_id=[% payment_id | html %]&borrowernumber=[% patron.borrowernumber | html %]', '_blank');
330
                window.open('/cgi-bin/koha/members/printfeercpt.pl?action=print&accountlines_id=[% payment_id | html %]&change_given=[% change_given | html %]&borrowernumber=[% patron.borrowernumber | html %]', '_blank');
328
            [% END %]
331
            [% END %]
329
332
330
            var forms = $('#payindivfine, #payfine');
333
            var forms = $('#payindivfine, #payfine');
Lines 431-440 Link Here
431
            change.innerHTML = Math.round(($('#collected')[0].value - $('#paid')[0].value) * 100) / 100;
434
            change.innerHTML = Math.round(($('#collected')[0].value - $('#paid')[0].value) * 100) / 100;
432
            if (change.innerHTML <= 0) {
435
            if (change.innerHTML <= 0) {
433
                change.innerHTML = "0.00";
436
                change.innerHTML = "0.00";
437
                $('input[name="change_given"]').val('0.00');
434
            } else {
438
            } else {
435
                change.value = change.innerHTML;
439
                change.value = change.innerHTML;
436
                moneyFormat(change);
440
                moneyFormat(change);
437
                change.innerHTML = change.value;
441
                change.innerHTML = change.value;
442
                $('input[name="change_given"]').val(change.value);
438
            }
443
            }
439
444
440
            $('#modal_change').html(change.innerHTML);
445
            $('#modal_change').html(change.innerHTML);
(-)a/members/boraccount.pl (+2 lines)
Lines 49-54 my ($template, $loggedinuser, $cookie) = get_template_and_user( Link Here
49
49
50
my $borrowernumber = $input->param('borrowernumber');
50
my $borrowernumber = $input->param('borrowernumber');
51
my $payment_id     = $input->param('payment_id');
51
my $payment_id     = $input->param('payment_id');
52
my $change_given   = $input->param('change_given');
52
my $action         = $input->param('action') || '';
53
my $action         = $input->param('action') || '';
53
54
54
my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in";
55
my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in";
Lines 86-91 $template->param( Link Here
86
    totalcredit         => $totalcredit,
87
    totalcredit         => $totalcredit,
87
    accounts            => \@accountlines,
88
    accounts            => \@accountlines,
88
    payment_id          => $payment_id,
89
    payment_id          => $payment_id,
90
    change_given        => $change_given,
89
);
91
);
90
92
91
output_html_with_http_headers $input, $cookie, $template->output;
93
output_html_with_http_headers $input, $cookie, $template->output;
(-)a/members/pay.pl (-1 / +5 lines)
Lines 64-69 if ( !$borrowernumber ) { Link Here
64
}
64
}
65
65
66
my $payment_id = $input->param('payment_id');
66
my $payment_id = $input->param('payment_id');
67
our $change_given = $input->param('change_given');
67
68
68
# get borrower details
69
# get borrower details
69
my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in";
70
my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in";
Lines 77-83 our $branch = C4::Context->userenv->{'branch'}; Link Here
77
78
78
if ( $input->param('paycollect') ) {
79
if ( $input->param('paycollect') ) {
79
    print $input->redirect(
80
    print $input->redirect(
80
        "/cgi-bin/koha/members/paycollect.pl?borrowernumber=$borrowernumber");
81
        "/cgi-bin/koha/members/paycollect.pl?borrowernumber=$borrowernumber&change_given=$change_given");
81
}
82
}
82
elsif ( $input->param('payselected') ) {
83
elsif ( $input->param('payselected') ) {
83
    payselected({ params => \@names });
84
    payselected({ params => \@names });
Lines 105-110 elsif ( $input->param('confirm_writeoff') ) { Link Here
105
              . "&amountoutstanding=" . $accountline->amountoutstanding
106
              . "&amountoutstanding=" . $accountline->amountoutstanding
106
              . "&accounttype=" . $accountline->accounttype
107
              . "&accounttype=" . $accountline->accounttype
107
              . "&accountlines_id=" . $accountlines_id
108
              . "&accountlines_id=" . $accountlines_id
109
              . "&change_given=" . $change_given
108
              . "&writeoff_individual=1"
110
              . "&writeoff_individual=1"
109
              . "&error_over=1" );
111
              . "&error_over=1" );
110
112
Lines 135-140 for (@names) { Link Here
135
$template->param(
137
$template->param(
136
    finesview  => 1,
138
    finesview  => 1,
137
    payment_id => $payment_id,
139
    payment_id => $payment_id,
140
    change_given => $change_given,
138
);
141
);
139
142
140
add_accounts_to_template();
143
add_accounts_to_template();
Lines 198-203 sub redirect_to_paycollect { Link Here
198
    $redirect .= get_for_redirect( 'accountlines_id', "accountlines_id$line_no", 0 );
201
    $redirect .= get_for_redirect( 'accountlines_id', "accountlines_id$line_no", 0 );
199
    $redirect .= q{&} . 'payment_note' . q{=} . uri_escape_utf8( scalar $input->param("payment_note_$line_no") );
202
    $redirect .= q{&} . 'payment_note' . q{=} . uri_escape_utf8( scalar $input->param("payment_note_$line_no") );
200
    $redirect .= '&remote_user=';
203
    $redirect .= '&remote_user=';
204
    $redirect .= "change_given=$change_given";
201
    $redirect .= $user;
205
    $redirect .= $user;
202
    return print $input->redirect($redirect);
206
    return print $input->redirect($redirect);
203
}
207
}
(-)a/members/paycollect.pl (-2 / +3 lines)
Lines 39-44 my $input = CGI->new(); Link Here
39
39
40
my $payment_id          = $input->param('payment_id');
40
my $payment_id          = $input->param('payment_id');
41
my $writeoff_individual = $input->param('writeoff_individual');
41
my $writeoff_individual = $input->param('writeoff_individual');
42
my $change_given        = $input->param('change_given');
42
my $type                = scalar $input->param('type') || 'payment';
43
my $type                = scalar $input->param('type') || 'payment';
43
44
44
my $updatecharges_permissions = ($writeoff_individual || $type eq 'writeoff') ? 'writeoff' : 'remaining_permissions';
45
my $updatecharges_permissions = ($writeoff_individual || $type eq 'writeoff') ? 'writeoff' : 'remaining_permissions';
Lines 162-168 if ( $total_paid and $total_paid ne '0.00' ) { Link Here
162
                }
163
                }
163
            );
164
            );
164
            print $input->redirect(
165
            print $input->redirect(
165
                "/cgi-bin/koha/members/pay.pl?borrowernumber=$borrowernumber&payment_id=$payment_id");
166
                "/cgi-bin/koha/members/pay.pl?borrowernumber=$borrowernumber&payment_id=$payment_id&change_given=$change_given");
166
        } else {
167
        } else {
167
            if ($select) {
168
            if ($select) {
168
                if ( $select =~ /^([\d,]*).*/ ) {
169
                if ( $select =~ /^([\d,]*).*/ ) {
Lines 208-214 if ( $total_paid and $total_paid ne '0.00' ) { Link Here
208
                );
209
                );
209
            }
210
            }
210
211
211
            print $input->redirect("/cgi-bin/koha/members/boraccount.pl?borrowernumber=$borrowernumber&payment_id=$payment_id");
212
            print $input->redirect("/cgi-bin/koha/members/boraccount.pl?borrowernumber=$borrowernumber&payment_id=$payment_id&change_given=$change_given");
212
        }
213
        }
213
    }
214
    }
214
} else {
215
} else {
(-)a/members/printfeercpt.pl (-1 / +3 lines)
Lines 50-55 my ($template, $loggedinuser, $cookie) Link Here
50
my $borrowernumber=$input->param('borrowernumber');
50
my $borrowernumber=$input->param('borrowernumber');
51
my $action = $input->param('action') || '';
51
my $action = $input->param('action') || '';
52
my $accountlines_id = $input->param('accountlines_id');
52
my $accountlines_id = $input->param('accountlines_id');
53
my $change_given = $input->param('change_given');
53
54
54
my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in";
55
my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in";
55
my $patron         = Koha::Patrons->find( $borrowernumber );
56
my $patron         = Koha::Patrons->find( $borrowernumber );
Lines 92-97 $template->param( Link Here
92
    total       => $total,
93
    total       => $total,
93
    totalcredit => $totalcredit,
94
    totalcredit => $totalcredit,
94
    accounts    => [$accountline],        # FIXME There is always only 1 row!
95
    accounts    => [$accountline],        # FIXME There is always only 1 row!
96
97
    change_given => $change_given,
95
);
98
);
96
99
97
output_html_with_http_headers $input, $cookie, $template->output;
100
output_html_with_http_headers $input, $cookie, $template->output;
98
- 

Return to bug 23507