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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt (-48 / +48 lines)
Lines 585-595 Link Here
585
        const change_given = "[% change_given | html %]";
585
        const change_given = "[% change_given | html %]";
586
        const payment_id = "[% payment_id | html %]";
586
        const payment_id = "[% payment_id | html %]";
587
    </script>
587
    </script>
588
589
    <script>
588
    <script>
590
        $(document).ready(function() {
589
        $(document).ready(function () {
591
            if (payment_id && prefs.FinePaymentAutoPopup){
590
            if (payment_id && prefs.FinePaymentAutoPopup) {
592
                window.open(`/cgi-bin/koha/members/printfeercpt.pl?action=print&change_given=${change_given}&accountlines_id=${payment_id}`, '_blank');
591
                window.open(`/cgi-bin/koha/members/printfeercpt.pl?action=print&change_given=${change_given}&accountlines_id=${payment_id}`, "_blank");
593
            }
592
            }
594
593
595
            var txtActivefilter = _("Filter paid transactions");
594
            var txtActivefilter = _("Filter paid transactions");
Lines 602-686 Link Here
602
                },
601
                },
603
                table_settings
602
                table_settings
604
            );
603
            );
605
            $("#filter_c").html('<p><a href="#" id="filter_transacs"><i class="fa fa-filter"></i> '+txtActivefilter+'</a>');
604
            $("#filter_c").html('<p><a href="#" id="filter_transacs"><i class="fa fa-filter"></i> ' + txtActivefilter + "</a>");
606
            $('#filter_transacs').click(function(e) {
605
            $("#filter_transacs").click(function (e) {
607
                e.preventDefault();
606
                e.preventDefault();
608
                if ($(this).hasClass('filtered')) {
607
                if ($(this).hasClass("filtered")) {
609
                    var filteredValue = '';
608
                    var filteredValue = "";
610
                    $(this).html('<i class="fa fa-filter"></i> '+txtActivefilter);
609
                    $(this).html('<i class="fa fa-filter"></i> ' + txtActivefilter);
611
                } else { //Not filtered. Let's do it!
610
                } else {
612
                    var filteredValue = '^((?!0.00).*)$'; //Filter not matching 0.00 http://stackoverflow.com/a/406408
611
                    //Not filtered. Let's do it!
613
                    $(this).html('<i class="fa fa-filter"></i> '+txtInactivefilter);
612
                    var filteredValue = "^((?!0.00).*)$"; //Filter not matching 0.00 http://stackoverflow.com/a/406408
613
                    $(this).html('<i class="fa fa-filter"></i> ' + txtInactivefilter);
614
                }
614
                }
615
                table_account_fines.DataTable().columns( 14 ).search( filteredValue, true, false ).draw();
615
                table_account_fines.DataTable().columns(14).search(filteredValue, true, false).draw();
616
                $(this).toggleClass('filtered');
616
                $(this).toggleClass("filtered");
617
            });
617
            });
618
618
619
            $("#issuePayoutModal").on("shown.bs.modal", function(e){
619
            $("#issuePayoutModal").on("shown.bs.modal", function (e) {
620
                var button = $(e.relatedTarget);
620
                var button = $(e.relatedTarget);
621
                var accountline = button.data('accountline');
621
                var accountline = button.data("accountline");
622
                $('#payoutline').val(accountline);
622
                $("#payoutline").val(accountline);
623
                var amount = button.data('amount') * -1;
623
                var amount = button.data("amount") * -1;
624
                $("#paid + span").text(amount.format_price());
624
                $("#paid + span").text(amount.format_price());
625
                $("#amount").attr({ "value": amount.format_price(), "max": amount, "min": 0 });
625
                $("#amount").attr({ value: amount.format_price(), max: amount, min: 0 });
626
                $("#amount, #payout_transaction_type").focus();
626
                $("#amount, #payout_transaction_type").focus();
627
            });
627
            });
628
628
629
            $("#issueRefundModal").on("shown.bs.modal", function(e){
629
            $("#issueRefundModal").on("shown.bs.modal", function (e) {
630
                var button = $(e.relatedTarget);
630
                var button = $(e.relatedTarget);
631
                var item = button.data('item');
631
                var item = button.data("item");
632
                $("#item + span").replaceWith(item);
632
                $("#item + span").replaceWith(item);
633
                var accountline = button.data('accountline');
633
                var accountline = button.data("accountline");
634
                $('#refundline').val(accountline);
634
                $("#refundline").val(accountline);
635
                var amount = button.data('amount');
635
                var amount = button.data("amount");
636
                var amountoutstanding = button.data('amountoutstanding') || 0;
636
                var amountoutstanding = button.data("amountoutstanding") || 0;
637
                var paid = amount - amountoutstanding;
637
                var paid = amount - amountoutstanding;
638
                $("#paid + span").text(paid.format_price());
638
                $("#paid + span").text(paid.format_price());
639
                $("#returned").attr({ "value": paid.format_price(), "max": paid.format_price(), "min": 0 });
639
                $("#returned").attr({ value: paid.format_price(), max: paid.format_price(), min: 0 });
640
                var member = button.data('member');
640
                var member = button.data("member");
641
                if ( member === '' ) {
641
                if (member === "") {
642
                    $("#refund_type option[value='AC']").remove();
642
                    $("#refund_type option[value='AC']").remove();
643
                } else if ( $("#refund_type option[value='AC']").length == 0 ) {
643
                } else if ($("#refund_type option[value='AC']").length == 0) {
644
                    $("#refund_type").prepend('<option value="AC" selected="selected">Account credit</option>');
644
                    $("#refund_type").prepend('<option value="AC" selected="selected">Account credit</option>');
645
                }
645
                }
646
                $("#returned, #refund_type").focus();
646
                $("#returned, #refund_type").focus();
647
            });
647
            });
648
648
649
            $("#applyDiscountModal").on("shown.bs.modal", function(e){
649
            $("#applyDiscountModal").on("shown.bs.modal", function (e) {
650
                var button = $(e.relatedTarget);
650
                var button = $(e.relatedTarget);
651
                var item = button.data('item');
651
                var item = button.data("item");
652
                $("#apply_discount_item + span").replaceWith(item);
652
                $("#apply_discount_item + span").replaceWith(item);
653
                var accountline = button.data('accountline');
653
                var accountline = button.data("accountline");
654
                $('#discountline').val(accountline);
654
                $("#discountline").val(accountline);
655
                var amountoutstanding = button.data('amountoutstanding');
655
                var amountoutstanding = button.data("amountoutstanding");
656
                $("#charged + span").text(amountoutstanding);
656
                $("#charged + span").text(amountoutstanding);
657
                $("#discount").attr({ "value": (0).format_price(), "max": amountoutstanding, "min": 0 });
657
                $("#discount").attr({ value: (0).format_price(), max: amountoutstanding, min: 0 });
658
                $("#discount").focus();
658
                $("#discount").focus();
659
            });
659
            });
660
660
661
            $("#voidPaymentModal").on("shown.bs.modal", function(e){
661
            $("#voidPaymentModal").on("shown.bs.modal", function (e) {
662
                var button = $(e.relatedTarget);
662
                var button = $(e.relatedTarget);
663
                var item = button.data('accountline');
663
                var item = button.data("accountline");
664
                $('#voidline').val(item);
664
                $("#voidline").val(item);
665
            });
665
            });
666
666
667
            $("#cancelChargeModal").on("shown.bs.modal", function(e){
667
            $("#cancelChargeModal").on("shown.bs.modal", function (e) {
668
                var button = $(e.relatedTarget);
668
                var button = $(e.relatedTarget);
669
                var item = button.data('accountlines_id');
669
                var item = button.data("accountlines_id");
670
                $('#accountlines_id').val(item);
670
                $("#accountlines_id").val(item);
671
            });
671
            });
672
672
673
            $("#editNoteModal").on("shown.bs.modal", function(e) {
673
            $("#editNoteModal").on("shown.bs.modal", function (e) {
674
                var button = $(e.relatedTarget);
674
                var button = $(e.relatedTarget);
675
                var accountline = button.data('accountline');
675
                var accountline = button.data("accountline");
676
                $('#noteline').val(accountline);
676
                $("#noteline").val(accountline);
677
                var note = button.data('note');
677
                var note = button.data("note");
678
                $('#edited_note').val(note);
678
                $("#edited_note").val(note);
679
            });
679
            });
680
680
681
            $(".receipt-email-action").on("click", function(e){
681
            $(".receipt-email-action").on("click", function (e) {
682
                e.preventDefault();
682
                e.preventDefault();
683
                return $(this).siblings('form').submit();
683
                return $(this).siblings("form").submit();
684
            });
684
            });
685
        });
685
        });
686
    </script>
686
    </script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt (-4 / +3 lines)
Lines 177-185 Link Here
177
        var holds_columns = [% TablesSettings.GetTableSettings( 'circ', 'print_summary', 'print-summary-holds', 'json' ) | $raw %];
177
        var holds_columns = [% TablesSettings.GetTableSettings( 'circ', 'print_summary', 'print-summary-holds', 'json' ) | $raw %];
178
        var fines_columns = [% TablesSettings.GetTableSettings( 'circ', 'print_summary', 'print-summary-fines', 'json' ) | $raw %];
178
        var fines_columns = [% TablesSettings.GetTableSettings( 'circ', 'print_summary', 'print-summary-fines', 'json' ) | $raw %];
179
    </script>
179
    </script>
180
181
    <script>
180
    <script>
182
        function initTables(){
181
        function initTables() {
183
            $("#print-summary-checkouts").kohaTable(
182
            $("#print-summary-checkouts").kohaTable(
184
                {
183
                {
185
                    dom: '<"dt-info"><"top pager"<"table_controls"B>>t',
184
                    dom: '<"dt-info"><"top pager"<"table_controls"B>>t',
Lines 208-217 Link Here
208
            );
207
            );
209
        }
208
        }
210
209
211
        if( autoprint ){
210
        if (autoprint) {
212
            window.onbeforeprint = initTables();
211
            window.onbeforeprint = initTables();
213
        } else {
212
        } else {
214
            $(document).ready(function(){
213
            $(document).ready(function () {
215
                initTables();
214
                initTables();
216
            });
215
            });
217
        }
216
        }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt (-1 lines)
Lines 243-249 Link Here
243
            FinePaymentAutoPopup: [% Koha.Preference('FinePaymentAutoPopup') ? 1 : 0 | html %],
243
            FinePaymentAutoPopup: [% Koha.Preference('FinePaymentAutoPopup') ? 1 : 0 | html %],
244
        });
244
        });
245
    </script>
245
    </script>
246
247
    <script>
246
    <script>
248
        function enableCheckboxActions(){
247
        function enableCheckboxActions(){
249
            // Enable/disable controls if checkboxes are checked
248
            // Enable/disable controls if checkboxes are checked
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt (-5 / +3 lines)
Lines 169-177 Link Here
169
169
170
        var table_settings = [% TablesSettings.GetTableSettings('members', 'checkouthistory', 'checkouthistory-table', 'json') | $raw %];
170
        var table_settings = [% TablesSettings.GetTableSettings('members', 'checkouthistory', 'checkouthistory-table', 'json') | $raw %];
171
    </script>
171
    </script>
172
173
    <script>
172
    <script>
174
        $(document).ready(function() {
173
        $(document).ready(function () {
175
            var table = $("#table_readingrec").kohaTable(
174
            var table = $("#table_readingrec").kohaTable(
176
                {
175
                {
177
                    pagingType: "full",
176
                    pagingType: "full",
Lines 184-192 Link Here
184
            $("#tabs a[data-bs-toggle='tab']").on("shown.bs.tab", function (e) {
183
            $("#tabs a[data-bs-toggle='tab']").on("shown.bs.tab", function (e) {
185
                active_tab = $(this).attr("href");
184
                active_tab = $(this).attr("href");
186
                let pattern = "";
185
                let pattern = "";
187
                if( active_tab == "#tab_checkout_panel" ){
186
                if (active_tab == "#tab_checkout_panel") {
188
                    pattern = "standard_checkout";
187
                    pattern = "standard_checkout";
189
                } else if( active_tab == "#tab_onsite_checkout_panel" ){
188
                } else if (active_tab == "#tab_onsite_checkout_panel") {
190
                    pattern = "onsite_checkout";
189
                    pattern = "onsite_checkout";
191
                }
190
                }
192
                table_dt.columns(0).search(pattern).draw();
191
                table_dt.columns(0).search(pattern).draw();
193
- 

Return to bug 41572