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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt (-62 / +10 lines)
Lines 4-9 Link Here
4
[% USE KohaDates %]
4
[% USE KohaDates %]
5
[% USE AuthorisedValues %]
5
[% USE AuthorisedValues %]
6
[% USE Price %]
6
[% USE Price %]
7
[% USE Registers %]
8
[% SET registers = Registers.all( filters => { current_branch => 1 } ) %]
7
[% PROCESS 'i18n.inc' %]
9
[% PROCESS 'i18n.inc' %]
8
[% SET footerjs = 1 %]
10
[% SET footerjs = 1 %]
9
[% PROCESS 'accounts.inc' %]
11
[% PROCESS 'accounts.inc' %]
Lines 150-155 Link Here
150
                                                        data-accountline="[% credit.debit.accountlines_id | html %]"
152
                                                        data-accountline="[% credit.debit.accountlines_id | html %]"
151
                                                        data-amount="[% credit.debit.amount | $Price %]"
153
                                                        data-amount="[% credit.debit.amount | $Price %]"
152
                                                        data-amountoutstanding="[% credit.debit.amountoutstanding | $Price %]"
154
                                                        data-amountoutstanding="[% credit.debit.amountoutstanding | $Price %]"
155
                                                        data-payment-type="[% AuthorisedValues.GetByCode( 'PAYMENT_TYPE', accountline.payment_type ) | html %]"
153
                                                        data-member="[% credit.debit.borrowernumber | html %]"
156
                                                        data-member="[% credit.debit.borrowernumber | html %]"
154
                                                        ><i class="fa-solid fa-money-bill-1"></i> Issue refund</button
157
                                                        ><i class="fa-solid fa-money-bill-1"></i> Issue refund</button
155
                                                    >
158
                                                    >
Lines 163-168 Link Here
163
                                                        data-accountline="[% credit.debit.accountlines_id | html %]"
166
                                                        data-accountline="[% credit.debit.accountlines_id | html %]"
164
                                                        data-amount="[% credit.debit.amount | $Price %]"
167
                                                        data-amount="[% credit.debit.amount | $Price %]"
165
                                                        data-amountoutstanding="[% credit.debit.amountoutstanding | $Price %]"
168
                                                        data-amountoutstanding="[% credit.debit.amountoutstanding | $Price %]"
169
                                                        data-payment-type="[% AuthorisedValues.GetByCode( 'PAYMENT_TYPE', accountline.payment_type ) | html %]"
166
                                                        data-member="[% credit.debit.borrowernumber | html %]"
170
                                                        data-member="[% credit.debit.borrowernumber | html %]"
167
                                                        ><i class="fa-solid fa-money-bill-1"></i> Issue refund</button
171
                                                        ><i class="fa-solid fa-money-bill-1"></i> Issue refund</button
168
                                                    >
172
                                                    >
Lines 285-290 Link Here
285
                                                        data-accountline="[% credit.debit.accountlines_id | html %]"
289
                                                        data-accountline="[% credit.debit.accountlines_id | html %]"
286
                                                        data-amount="[% credit.debit.amount | $Price %]"
290
                                                        data-amount="[% credit.debit.amount | $Price %]"
287
                                                        data-amountoutstanding="[% credit.debit.amountoutstanding | $Price %]"
291
                                                        data-amountoutstanding="[% credit.debit.amountoutstanding | $Price %]"
292
                                                        data-payment-type="[% AuthorisedValues.GetByCode( 'PAYMENT_TYPE', accountline.payment_type ) | html %]"
288
                                                        data-member="[% credit.debit.borrowernumber | html %]"
293
                                                        data-member="[% credit.debit.borrowernumber | html %]"
289
                                                        ><i class="fa-solid fa-money-bill-1"></i> Issue refund</button
294
                                                        ><i class="fa-solid fa-money-bill-1"></i> Issue refund</button
290
                                                    >
295
                                                    >
Lines 298-303 Link Here
298
                                                        data-accountline="[% credit.debit.accountlines_id | html %]"
303
                                                        data-accountline="[% credit.debit.accountlines_id | html %]"
299
                                                        data-amount="[% credit.debit.amount | $Price %]"
304
                                                        data-amount="[% credit.debit.amount | $Price %]"
300
                                                        data-amountoutstanding="[% credit.debit.amountoutstanding | $Price %]"
305
                                                        data-amountoutstanding="[% credit.debit.amountoutstanding | $Price %]"
306
                                                        data-payment-type="[% AuthorisedValues.GetByCode( 'PAYMENT_TYPE', accountline.payment_type ) | html %]"
301
                                                        data-member="[% credit.debit.borrowernumber | html %]"
307
                                                        data-member="[% credit.debit.borrowernumber | html %]"
302
                                                        ><i class="fa-solid fa-money-bill-1"></i> Issue refund</button
308
                                                        ><i class="fa-solid fa-money-bill-1"></i> Issue refund</button
303
                                                    >
309
                                                    >
Lines 397-444 Link Here
397
</div>
403
</div>
398
<!-- /#confirmCashupModal -->
404
<!-- /#confirmCashupModal -->
399
405
400
<!-- Issue refund modal -->
406
[% INCLUDE 'modals/refund_modal.inc' refund_form_action = '/cgi-bin/koha/pos/register.pl' register_id = register.id registers = registers %]
401
<div class="modal" id="issueRefundModal" tabindex="-1" role="dialog" aria-labelledby="issueRefundLabel">
402
    <form id="refund_form" method="post" enctype="multipart/form-data" class="validated">
403
        [% INCLUDE 'csrf-token.inc' %]
404
        <input type="hidden" name="accountline_id" value="" id="refundline" />
405
        <div class="modal-dialog">
406
            <div class="modal-content">
407
                <div class="modal-header">
408
                    <h1 class="modal-title" id="issueRefundLabel">Issue refund from <em>[% register.description | html %]</em></h1>
409
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
410
                </div>
411
                <div class="modal-body">
412
                    <fieldset class="rows">
413
                        <ol>
414
                            <li> <span id="item" class="label">Item: </span><span></span> </li>
415
                            <li> <span id="paid" class="label">Amount paid: </span><span></span> </li>
416
                            <li>
417
                                <label class="required" for="amount">Returned to patron: </label>
418
                                <input type="text" inputmode="decimal" pattern="^\d+(\.\d{2})?$" id="returned" name="amount" required="required" />
419
                                <span class="required">Required</span>
420
                            </li>
421
                            [% INCLUDE 'transaction_types.inc' type="refund" %]
422
                        </ol>
423
                    </fieldset>
424
                    <!-- /.rows -->
425
                </div>
426
                <!-- /.modal-body -->
427
                <div class="modal-footer">
428
                    <input type="hidden" name="registerid" value="[% register.id | html %]" />
429
                    <input type="hidden" name="op" value="cud-refund" />
430
                    <button type="submit" class="btn btn-default" id="pos_refund_confirm">Confirm</button>
431
                    <button type="button" class="btn btn-default" data-bs-dismiss="modal">Cancel</button>
432
                </div>
433
                <!-- /.modal-footer -->
434
            </div>
435
            <!-- /.modal-content -->
436
        </div>
437
        <!-- /.modal-dialog -->
438
    </form>
439
    <!-- /#refund_form -->
440
</div>
441
<!-- /#issueRefundModal -->
442
407
443
[% INCLUDE 'modals/cashup_summary.inc' %]
408
[% INCLUDE 'modals/cashup_summary.inc' %]
444
409
Lines 448-453 Link Here
448
    [% INCLUDE 'js-date-format.inc' %]
413
    [% INCLUDE 'js-date-format.inc' %]
449
    [% Asset.js("js/cashup_modal.js") | $raw %]
414
    [% Asset.js("js/cashup_modal.js") | $raw %]
450
    [% Asset.js("js/modal_printer.js") | $raw %]
415
    [% Asset.js("js/modal_printer.js") | $raw %]
416
    [% Asset.js("js/refund_modal.js") | $raw %]
451
    [% INCLUDE 'calendar.inc' %]
417
    [% INCLUDE 'calendar.inc' %]
452
    <script>
418
    <script>
453
        var sales_table = $("#sales").kohaTable({
419
        var sales_table = $("#sales").kohaTable({
Lines 499-523 Link Here
499
            }
465
            }
500
        });
466
        });
501
467
502
        $("#issueRefundModal").on("shown.bs.modal", function(e){
468
        // Initialize refund modal
503
           var button = $(e.relatedTarget);
469
        initRefundModal();
504
           var item = button.data('item');
505
           $("#item + span").replaceWith(item);
506
           var accountline = button.data('accountline');
507
           $('#refundline').val(accountline);
508
           var amount = button.data('amount');
509
           var amountoutstanding = button.data('amountoutstanding') || 0;
510
           var paid = amount - amountoutstanding;
511
           $("#paid + span").text(paid.format_price());
512
           $("#returned").attr({ "value": paid.format_price(), "max": paid });
513
           var member = button.data('member');
514
           if ( member === '' ) {
515
               $("#refund_type option[value='AC']").remove();
516
           } else if ( $("#refund_type option[value='AC']").length == 0 ) {
517
               $("#refund_type").prepend('<option value="AC" selected="selected">Account credit</option>');
518
           }
519
           $("#returned, #refund_type").focus();
520
        });
521
470
522
        $("body").on('click', ".printReceipt", function() {
471
        $("body").on('click', ".printReceipt", function() {
523
            var accountlines_id = $(this).data('accountline');
472
            var accountlines_id = $(this).data('accountline');
524
- 

Return to bug 41592