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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt (-14 / +14 lines)
Lines 7-13 Link Here
7
[% USE AuthorisedValues %]
7
[% USE AuthorisedValues %]
8
[% USE Price %]
8
[% USE Price %]
9
[% USE Branches %]
9
[% USE Branches %]
10
[% USE Registers %]
10
[% SET footerjs = 1 %]
11
[% SET footerjs = 1 %]
12
[% SET registers = Registers.all( filters => { current_branch => 1 } ) %]
11
13
12
[% PROCESS 'accounts.inc' %]
14
[% PROCESS 'accounts.inc' %]
13
15
Lines 149-154 Link Here
149
                        <h4 class="modal-title" id="issuePayoutLabel">Issue payout</h4>
151
                        <h4 class="modal-title" id="issuePayoutLabel">Issue payout</h4>
150
                    </div>
152
                    </div>
151
                    <div class="modal-body">
153
                    <div class="modal-body">
154
                        [% IF Koha.Preference('UseCashRegisters') && ( registers.size == 0 ) %]
155
                        <div id="payout_error" class="dialog alert">
156
                            You must have at least one cash register associated with this branch before you can record cash payouts.
157
                        </div>
158
                        [% END %]
152
                        <fieldset class="rows">
159
                        <fieldset class="rows">
153
                            <ol>
160
                            <ol>
154
                                <li>
161
                                <li>
Lines 178-190 Link Here
178
                                <li>
185
                                <li>
179
                                    <label for="registerid">Cash register: </label>
186
                                    <label for="registerid">Cash register: </label>
180
                                    <select name="registerid" id="payout_registerid">
187
                                    <select name="registerid" id="payout_registerid">
181
                                        [% FOREACH register IN registers %]
188
                                        [% PROCESS options_for_registers register_required => 1 %]
182
                                          [% IF register.id == registerid %]
183
                                        <option value="[% register.id | html %]" selected="selected">[% register.name | html %]</option>
184
                                          [% ELSE %]
185
                                        <option value="[% register.id | html %]">[% register.name | html %]</option>
186
                                          [% END %]
187
                                        [% END %]
188
                                    </select>
189
                                    </select>
189
                                </li>
190
                                </li>
190
                                [% END %]
191
                                [% END %]
Lines 215-220 Link Here
215
                        <h4 class="modal-title" id="issueRefundLabel">Issue refund</h4>
216
                        <h4 class="modal-title" id="issueRefundLabel">Issue refund</h4>
216
                    </div>
217
                    </div>
217
                    <div class="modal-body">
218
                    <div class="modal-body">
219
                        [% IF Koha.Preference('UseCashRegisters') && ( registers.size == 0 ) %]
220
                        <div id="refund_error" class="dialog alert">
221
                            You must have at least one cash register associated with this branch before you can record cash refunds.
222
                        </div>
223
                        [% END %]
218
                        <fieldset class="rows">
224
                        <fieldset class="rows">
219
                            <ol>
225
                            <ol>
220
                                <li>
226
                                <li>
Lines 245-257 Link Here
245
                                <li>
251
                                <li>
246
                                    <label for="registerid">Cash register: </label>
252
                                    <label for="registerid">Cash register: </label>
247
                                    <select name="registerid" id="refund_registerid">
253
                                    <select name="registerid" id="refund_registerid">
248
                                        [% FOREACH register IN registers %]
254
                                        [% PROCESS options_for_registers register_required => 1 %]
249
                                          [% IF register.id == registerid %]
250
                                        <option value="[% register.id | html %]" selected="selected">[% register.name | html %]</option>
251
                                          [% ELSE %]
252
                                        <option value="[% register.id | html %]">[% register.name | html %]</option>
253
                                          [% END %]
254
                                        [% END %]
255
                                    </select>
255
                                    </select>
256
                                </li>
256
                                </li>
257
                                [% END %]
257
                                [% 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