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 143-148 Link Here
143
                        <h4 class="modal-title" id="issuePayoutLabel">Issue payout</h4>
145
                        <h4 class="modal-title" id="issuePayoutLabel">Issue payout</h4>
144
                    </div>
146
                    </div>
145
                    <div class="modal-body">
147
                    <div class="modal-body">
148
                        [% IF Koha.Preference('UseCashRegisters') && ( registers.size == 0 ) %]
149
                        <div id="payout_error" class="dialog alert">
150
                            You must have at least one cash register associated with this branch before you can record cash payouts.
151
                        </div>
152
                        [% END %]
146
                        <fieldset class="rows">
153
                        <fieldset class="rows">
147
                            <ol>
154
                            <ol>
148
                                <li>
155
                                <li>
Lines 172-184 Link Here
172
                                <li>
179
                                <li>
173
                                    <label for="registerid">Cash register: </label>
180
                                    <label for="registerid">Cash register: </label>
174
                                    <select name="registerid" id="payout_registerid">
181
                                    <select name="registerid" id="payout_registerid">
175
                                        [% FOREACH register IN registers %]
182
                                        [% 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>
183
                                    </select>
183
                                </li>
184
                                </li>
184
                                [% END %]
185
                                [% END %]
Lines 209-214 Link Here
209
                        <h4 class="modal-title" id="issueRefundLabel">Issue refund</h4>
210
                        <h4 class="modal-title" id="issueRefundLabel">Issue refund</h4>
210
                    </div>
211
                    </div>
211
                    <div class="modal-body">
212
                    <div class="modal-body">
213
                        [% IF Koha.Preference('UseCashRegisters') && ( registers.size == 0 ) %]
214
                        <div id="refund_error" class="dialog alert">
215
                            You must have at least one cash register associated with this branch before you can record cash refunds.
216
                        </div>
217
                        [% END %]
212
                        <fieldset class="rows">
218
                        <fieldset class="rows">
213
                            <ol>
219
                            <ol>
214
                                <li>
220
                                <li>
Lines 239-251 Link Here
239
                                <li>
245
                                <li>
240
                                    <label for="registerid">Cash register: </label>
246
                                    <label for="registerid">Cash register: </label>
241
                                    <select name="registerid" id="refund_registerid">
247
                                    <select name="registerid" id="refund_registerid">
242
                                        [% FOREACH register IN registers %]
248
                                        [% 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>
249
                                    </select>
250
                                </li>
250
                                </li>
251
                                [% END %]
251
                                [% 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