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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt (-14 / +13 lines)
Lines 8-13 Link Here
8
[% USE Price %]
8
[% USE Price %]
9
[% USE Branches %]
9
[% USE Branches %]
10
[% SET footerjs = 1 %]
10
[% SET footerjs = 1 %]
11
[% SET registers = Registers.all( filters => { current_branch => 1 } ) %]
11
12
12
[% PROCESS 'accounts.inc' %]
13
[% PROCESS 'accounts.inc' %]
13
14
Lines 141-146 Link Here
141
                        <h4 class="modal-title" id="issuePayoutLabel">Issue payout</h4>
142
                        <h4 class="modal-title" id="issuePayoutLabel">Issue payout</h4>
142
                    </div>
143
                    </div>
143
                    <div class="modal-body">
144
                    <div class="modal-body">
145
                        [% IF Koha.Preference('UseCashRegisters') && ( registers.size == 0 ) %]
146
                        <div id="error_message" class="dialog alert">
147
                            You must have at least one cash register associated with this branch before you can record cash payouts.
148
                        </div>
149
                        [% END %]
144
                        <fieldset class="rows">
150
                        <fieldset class="rows">
145
                            <ol>
151
                            <ol>
146
                                <li>
152
                                <li>
Lines 170-182 Link Here
170
                                <li>
176
                                <li>
171
                                    <label for="registerid">Cash register: </label>
177
                                    <label for="registerid">Cash register: </label>
172
                                    <select name="registerid" id="payout_registerid">
178
                                    <select name="registerid" id="payout_registerid">
173
                                        [% FOREACH register IN registers %]
179
                                        [% PROCESS options_for_registers register_required => 1 %]
174
                                          [% IF register.id == registerid %]
175
                                        <option value="[% register.id | html %]" selected="selected">[% register.name | html %]</option>
176
                                          [% ELSE %]
177
                                        <option value="[% register.id | html %]">[% register.name | html %]</option>
178
                                          [% END %]
179
                                        [% END %]
180
                                    </select>
180
                                    </select>
181
                                </li>
181
                                </li>
182
                                [% END %]
182
                                [% END %]
Lines 207-212 Link Here
207
                        <h4 class="modal-title" id="issueRefundLabel">Issue refund</h4>
207
                        <h4 class="modal-title" id="issueRefundLabel">Issue refund</h4>
208
                    </div>
208
                    </div>
209
                    <div class="modal-body">
209
                    <div class="modal-body">
210
                        [% IF Koha.Preference('UseCashRegisters') && ( registers.size == 0 ) %]
211
                        <div id="error_message" class="dialog alert">
212
                            You must have at least one cash register associated with this branch before you can record cash refunds.
213
                        </div>
214
                        [% END %]
210
                        <fieldset class="rows">
215
                        <fieldset class="rows">
211
                            <ol>
216
                            <ol>
212
                                <li>
217
                                <li>
Lines 237-249 Link Here
237
                                <li>
242
                                <li>
238
                                    <label for="registerid">Cash register: </label>
243
                                    <label for="registerid">Cash register: </label>
239
                                    <select name="registerid" id="refund_registerid">
244
                                    <select name="registerid" id="refund_registerid">
240
                                        [% FOREACH register IN registers %]
245
                                        [% PROCESS options_for_registers register_required => 1 %]
241
                                          [% IF register.id == registerid %]
242
                                        <option value="[% register.id | html %]" selected="selected">[% register.name | html %]</option>
243
                                          [% ELSE %]
244
                                        <option value="[% register.id | html %]">[% register.name | html %]</option>
245
                                          [% END %]
246
                                        [% END %]
247
                                    </select>
246
                                    </select>
248
                                </li>
247
                                </li>
249
                                [% END %]
248
                                [% END %]
(-)a/members/boraccount.pl (-27 / +1 lines)
Lines 67-98 unless ( $patron ) { Link Here
67
67
68
output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
68
output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
69
69
70
my $registerid;
70
my $registerid = $input->param('registerid');
71
if ( C4::Context->preference('UseCashRegisters') ) {
72
    $registerid = scalar $input->param('registerid');
73
    my $registers  = Koha::Cash::Registers->search(
74
        { branch   => $library_id, archived => 0 },
75
        { order_by => { '-asc' => 'name' } }
76
    );
77
78
    if ( !$registers->count ) {
79
        $template->param( error_registers => 1 );
80
    }
81
    else {
82
83
        if ( !$registerid ) {
84
            my $default_register = Koha::Cash::Registers->find(
85
                { branch => $library_id, branch_default => 1 } );
86
            $registerid = $default_register->id if $default_register;
87
        }
88
        $registerid = $registers->next->id if !$registerid;
89
90
        $template->param(
91
            registerid => $registerid,
92
            registers  => $registers,
93
        );
94
    }
95
}
96
71
97
if ( $action eq 'void' ) {
72
if ( $action eq 'void' ) {
98
    my $payment_id = scalar $input->param('accountlines_id');
73
    my $payment_id = scalar $input->param('accountlines_id');
99
- 

Return to bug 24786