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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt (+19 lines)
Lines 638-643 Link Here
638
                $("#returned, #refund_type").focus();
638
                $("#returned, #refund_type").focus();
639
            });
639
            });
640
640
641
            // Validate cash register requirement for refunds
642
            [% IF Koha.Preference('UseCashRegisters') %]
643
                $("#refund_form").on("submit", function(e) {
644
                    var refund_type = $("#refund_type").val();
645
                    var register = $("#refund_registerid").val();
646
647
                    // Only require register for non-AC refunds with CASH or SIP00 payment types
648
                    if (refund_type && refund_type !== 'AC' && (refund_type === 'CASH' || refund_type.match(/^SIP\d{2}$/))) {
649
                        if (!register || register === '') {
650
                            e.preventDefault();
651
                            alert(_("Cash register is required for cash refunds"));
652
                            $("#refund_registerid").focus();
653
                            return false;
654
                        }
655
                    }
656
                    return true;
657
                });
658
            [% END %]
659
641
            $("#applyDiscountModal").on("shown.bs.modal", function(e){
660
            $("#applyDiscountModal").on("shown.bs.modal", function(e){
642
                var button = $(e.relatedTarget);
661
                var button = $(e.relatedTarget);
643
                var item = button.data('item');
662
                var item = button.data('item');
(-)a/pos/register.pl (-12 / +16 lines)
Lines 137-155 if ( !$registers->count ) { Link Here
137
                            amount         => $amount
137
                            amount         => $amount
138
                        }
138
                        }
139
                    );
139
                    );
140
                    my $payout = $refund->payout(
140
                    unless ( $refund_type eq 'AC' ) {
141
                        {
141
                        my $payout = $refund->payout(
142
                            payout_type   => $refund_type,
142
                            {
143
                            branch        => $library_id,
143
                                payout_type   => $refund_type,
144
                            staff_id      => $logged_in_user->id,
144
                                branch        => $library_id,
145
                            cash_register => $cash_register->id,
145
                                staff_id      => $logged_in_user->id,
146
                            interface     => 'intranet',
146
                                cash_register => $registerid,
147
                            amount        => $amount
147
                                interface     => 'intranet',
148
                        }
148
                                amount        => $amount
149
                    );
149
                            }
150
150
                        );
151
                    }
151
                }
152
                }
152
            );
153
            );
154
155
            # Redirect to prevent duplicate submissions (POST/REDIRECT/GET pattern)
156
            print $input->redirect( "/cgi-bin/koha/pos/register.pl?registerid=" . $registerid );
157
            exit;
153
        } else {
158
        } else {
154
            $template->param( error_refund_permission => 1 );
159
            $template->param( error_refund_permission => 1 );
155
        }
160
        }
156
- 

Return to bug 41585