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

Return to bug 24786