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 / +5 lines)
Lines 146-151 Link Here
146
    <input type="hidden" name="payment_note" id="payment_note" value="[% payment_note | html %]" />
146
    <input type="hidden" name="payment_note" id="payment_note" value="[% payment_note | html %]" />
147
    <input type="hidden" name="amountoutstanding" id="amountoutstanding" value="[% amountoutstanding | html %]" />
147
    <input type="hidden" name="amountoutstanding" id="amountoutstanding" value="[% amountoutstanding | html %]" />
148
    <input type="hidden" name="confirm_writeoff" id="confirm_writeoff" value="1" />
148
    <input type="hidden" name="confirm_writeoff" id="confirm_writeoff" value="1" />
149
    <input type="hidden" name="change_given" id="change_given" />
149
    <table>
150
    <table>
150
    <thead><tr>
151
    <thead><tr>
151
            <th>Description</th>
152
            <th>Description</th>
Lines 183-188 Link Here
183
    <input type="hidden" name="selected_accts" id="selected_accts" value="[% selected_accts | html %]" />
184
    <input type="hidden" name="selected_accts" id="selected_accts" value="[% selected_accts | html %]" />
184
    <input type="hidden" name="total" id="total" value="[% total | html %]" />
185
    <input type="hidden" name="total" id="total" value="[% total | html %]" />
185
    <input type="hidden" name="type" value="[% type | html %]" />
186
    <input type="hidden" name="type" value="[% type | html %]" />
187
    <input type="hidden" name="change_given" id="change_given" />
186
188
187
    <fieldset class="rows">
189
    <fieldset class="rows">
188
    [% IF ( selected_accts ) %]
190
    [% IF ( selected_accts ) %]
Lines 278-284 Link Here
278
    <script>
280
    <script>
279
        $(document).ready(function() {
281
        $(document).ready(function() {
280
            [% IF payment_id && Koha.Preference('FinePaymentAutoPopup') %]
282
            [% IF payment_id && Koha.Preference('FinePaymentAutoPopup') %]
281
                window.open('/cgi-bin/koha/members/printfeercpt.pl?action=print&accountlines_id=[% payment_id | html %]&borrowernumber=[% patron.borrowernumber | html %]', '_blank');
283
                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');
282
            [% END %]
284
            [% END %]
283
285
284
            var forms = $('#payindivfine, #payfine');
286
            var forms = $('#payindivfine, #payfine');
Lines 385-394 Link Here
385
            change.innerHTML = Math.round(($('#collected')[0].value - $('#paid')[0].value) * 100) / 100;
387
            change.innerHTML = Math.round(($('#collected')[0].value - $('#paid')[0].value) * 100) / 100;
386
            if (change.innerHTML <= 0) {
388
            if (change.innerHTML <= 0) {
387
                change.innerHTML = "0.00";
389
                change.innerHTML = "0.00";
390
                $('input[name="change_given"]').val('0.00');
388
            } else {
391
            } else {
389
                change.value = change.innerHTML;
392
                change.value = change.innerHTML;
390
                moneyFormat(change);
393
                moneyFormat(change);
391
                change.innerHTML = change.value;
394
                change.innerHTML = change.value;
395
                $('input[name="change_given"]').val(change.value);
392
            }
396
            }
393
397
394
            $('#modal_change').html(change.innerHTML);
398
            $('#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 / +4 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 198-203 sub redirect_to_paycollect { Link Here
198
    $redirect .= get_for_redirect( 'accountlines_id', "accountlines_id$line_no", 0 );
200
    $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") );
201
    $redirect .= q{&} . 'payment_note' . q{=} . uri_escape_utf8( scalar $input->param("payment_note_$line_no") );
200
    $redirect .= '&remote_user=';
202
    $redirect .= '&remote_user=';
203
    $redirect .= "change_given=$change_given";
201
    $redirect .= $user;
204
    $redirect .= $user;
202
    return print $input->redirect($redirect);
205
    return print $input->redirect($redirect);
203
}
206
}
(-)a/members/paycollect.pl (-2 / +3 lines)
Lines 38-43 my $input = CGI->new(); Link Here
38
38
39
my $payment_id          = $input->param('payment_id');
39
my $payment_id          = $input->param('payment_id');
40
my $writeoff_individual = $input->param('writeoff_individual');
40
my $writeoff_individual = $input->param('writeoff_individual');
41
my $change_given        = $input->param('change_given');
41
my $type                = scalar $input->param('type') || 'payment';
42
my $type                = scalar $input->param('type') || 'payment';
42
43
43
my $updatecharges_permissions = ($writeoff_individual || $type eq 'writeoff') ? 'writeoff' : 'remaining_permissions';
44
my $updatecharges_permissions = ($writeoff_individual || $type eq 'writeoff') ? 'writeoff' : 'remaining_permissions';
Lines 133-139 if ( $total_paid and $total_paid ne '0.00' ) { Link Here
133
                }
134
                }
134
            );
135
            );
135
            print $input->redirect(
136
            print $input->redirect(
136
                "/cgi-bin/koha/members/pay.pl?borrowernumber=$borrowernumber&payment_id=$payment_id");
137
                "/cgi-bin/koha/members/pay.pl?borrowernumber=$borrowernumber&payment_id=$payment_id&change_given=$change_given");
137
        } else {
138
        } else {
138
            if ($select) {
139
            if ($select) {
139
                if ( $select =~ /^([\d,]*).*/ ) {
140
                if ( $select =~ /^([\d,]*).*/ ) {
Lines 176-182 if ( $total_paid and $total_paid ne '0.00' ) { Link Here
176
                );
177
                );
177
            }
178
            }
178
179
179
            print $input->redirect("/cgi-bin/koha/members/boraccount.pl?borrowernumber=$borrowernumber&payment_id=$payment_id");
180
            print $input->redirect("/cgi-bin/koha/members/boraccount.pl?borrowernumber=$borrowernumber&payment_id=$payment_id&change_given=$change_given");
180
        }
181
        }
181
    }
182
    }
182
} else {
183
} 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