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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt (-6 / +14 lines)
Lines 248-253 Link Here
248
[% MACRO jsinclude BLOCK %]
248
[% MACRO jsinclude BLOCK %]
249
    [% INCLUDE 'format_price.inc' %]
249
    [% INCLUDE 'format_price.inc' %]
250
    [% INCLUDE 'datatables.inc' %]
250
    [% INCLUDE 'datatables.inc' %]
251
    <script>
252
        var items_table_settings = [% TablesSettings.GetTableSettings('pos', 'pay', 'invoices', 'json') | $raw %];
253
        var zero_formatted = "[% 0 | $Price %]";
254
        const payment_id = "[% payment_id | html %]";
255
        const tendered = "[% tendered | html %]";
256
        const change = "[% change | html %]";
257
        addPrefs({
258
            FinePaymentAutoPopup: [% Koha.Preference('FinePaymentAutoPopup') ? 1 : 0 | html %],
259
        });
260
    </script>
261
251
    <script>
262
    <script>
252
        function moneyFormat(textObj) {
263
        function moneyFormat(textObj) {
253
            var newValue = textObj.value;
264
            var newValue = textObj.value;
Lines 315-321 Link Here
315
326
316
        function updateChangeValues() {
327
        function updateChangeValues() {
317
            var change = $('#change')[0];
328
            var change = $('#change')[0];
318
            var zero_formatted = "[% 0 | $Price %]";
319
            change.innerHTML = Math.round(($('#tendered')[0].value - $('#paid')[0].value) * 100) / 100;
329
            change.innerHTML = Math.round(($('#tendered')[0].value - $('#paid')[0].value) * 100) / 100;
320
            if (change.innerHTML <= 0) {
330
            if (change.innerHTML <= 0) {
321
                var paid = $('#paid')[0];
331
                var paid = $('#paid')[0];
Lines 438-444 Link Here
438
                }
448
                }
439
            });
449
            });
440
450
441
            var items_table_settings = [% TablesSettings.GetTableSettings('pos', 'pay', 'invoices', 'json') | $raw %];
442
            var items_table = $("#invoices").kohaTable(
451
            var items_table = $("#invoices").kohaTable(
443
                {
452
                {
444
                    pagingType: "full",
453
                    pagingType: "full",
Lines 519-531 Link Here
519
                }
528
                }
520
            });
529
            });
521
530
522
            [% IF payment_id && Koha.Preference('FinePaymentAutoPopup') %]
531
            if (payment_id && prefs.FinePaymentAutoPopup){
523
                $("#printReceipt").click(function() {
532
                $("#printReceipt").click(function() {
524
                    var win = window.open('/cgi-bin/koha/pos/printreceipt.pl?action=print&accountlines_id=[% payment_id | uri %]&tendered=[% tendered | uri %]&change=[% change | uri %]', '_blank');
533
                    var win = window.open(`/cgi-bin/koha/pos/printreceipt.pl?action=print&accountlines_id=${payment_id}&tendered=${tendered}&change=${change}`, '_blank');
525
                    win.focus();
534
                    win.focus();
526
                });
535
                });
527
                $("#printReceipt").click();
536
                $("#printReceipt").click();
528
            [% END %]
537
            }
529
        });
538
        });
530
    </script>
539
    </script>
531
[% END %]
540
[% END %]
532
- 

Return to bug 41575