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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt (+15 lines)
Lines 61-66 Link Here
61
[% END %]
61
[% END %]
62
62
63
[% IF ( pay_individual ) %]
63
[% IF ( pay_individual ) %]
64
    [% IF ( error_registers ) %]
65
    <div id="error_message" class="dialog alert">
66
        You must have at least one cash register associated with this branch before you can record payments.
67
    </div>
68
    [% ELSE %]
69
64
    <form name="payindivfine" id="payindivfine" method="post" action="/cgi-bin/koha/members/paycollect.pl">
70
    <form name="payindivfine" id="payindivfine" method="post" action="/cgi-bin/koha/members/paycollect.pl">
65
    <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
71
    <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
66
    <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" />
72
    <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" />
Lines 144-149 Link Here
144
            <a class="cancel" href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber | html %]">Cancel</a>
150
            <a class="cancel" href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber | html %]">Cancel</a>
145
        </div>
151
        </div>
146
    </form>
152
    </form>
153
    [% END %]
147
[% ELSIF ( writeoff_individual ) %]
154
[% ELSIF ( writeoff_individual ) %]
148
    <form name="woindivfine" id="woindivfine" action="/cgi-bin/koha/members/pay.pl" method="post" >
155
    <form name="woindivfine" id="woindivfine" action="/cgi-bin/koha/members/pay.pl" method="post" >
149
    <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
156
    <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
Lines 190-195 Link Here
190
        </div>
197
        </div>
191
    </form>
198
    </form>
192
[% ELSE %]
199
[% ELSE %]
200
    [% IF ( error_registers && type != 'writeoff' ) %]
201
    <div id="error_message" class="dialog alert">
202
        You must have at least one cash register associated with this branch before you can record payments.
203
    </div>
204
    [% ELSE %]
193
205
194
    <form name="payfine" id="payfine" method="post" action="/cgi-bin/koha/members/paycollect.pl">
206
    <form name="payfine" id="payfine" method="post" action="/cgi-bin/koha/members/paycollect.pl">
195
    <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
207
    <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
Lines 231-236 Link Here
231
        <span id="change">0.00</span>
243
        <span id="change">0.00</span>
232
    </li>
244
    </li>
233
245
246
    [% IF type != 'writeoff' %]
234
    [% SET payment_types = AuthorisedValues.GetAuthValueDropbox('PAYMENT_TYPE') %]
247
    [% SET payment_types = AuthorisedValues.GetAuthValueDropbox('PAYMENT_TYPE') %]
235
    [% IF payment_types %]
248
    [% IF payment_types %]
236
        <li>
249
        <li>
Lines 258-263 Link Here
258
        </select>
271
        </select>
259
    </li>
272
    </li>
260
    [% END %]
273
    [% END %]
274
    [% END %]
261
275
262
    <li>
276
    <li>
263
        <label for="selected_accts_notes">Note: </label>
277
        <label for="selected_accts_notes">Note: </label>
Lines 270-275 Link Here
270
        <a class="cancel" href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber | html %]">Cancel</a>
284
        <a class="cancel" href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber | html %]">Cancel</a>
271
    </div>
285
    </div>
272
    </form>
286
    </form>
287
    [% END %]
273
[% END %]
288
[% END %]
274
</div></div>
289
</div></div>
275
290
(-)a/members/paycollect.pl (-14 / +25 lines)
Lines 74-93 my $payment_note = uri_unescape scalar $input->param('payment_note'); Link Here
74
my $payment_type = scalar $input->param('payment_type');
74
my $payment_type = scalar $input->param('payment_type');
75
my $accountlines_id;
75
my $accountlines_id;
76
76
77
my $registerid = $input->param('registerid');
77
my $registerid;
78
if ( !$registerid ) {
78
if ( C4::Context->preference('UseCashRegisters') ) {
79
    $registerid = Koha::Cash::Registers->find(
79
    $registerid = $input->param('registerid');
80
        { branch => $library_id, branch_default => 1 },
80
    my $registers  = Koha::Cash::Registers->search(
81
    )->id;
81
        { branch   => $library_id, archived => 0 },
82
        { order_by => { '-asc' => 'name' } }
83
    );
84
85
    if ( !$registers->count ) {
86
        $template->param( error_registers => 1 );
87
    }
88
    else {
89
90
        if ( !$registerid ) {
91
            my $default_register = Koha::Cash::Registers->find(
92
                { branch => $library_id, branch_default => 1 } );
93
            $registerid = $default_register->id if $default_register;
94
        }
95
        $registerid = $registers->next->id if !$registerid;
96
97
        $template->param(
98
            registerid => $registerid,
99
            registers  => $registers,
100
        );
101
    }
82
}
102
}
83
my $registers = Koha::Cash::Registers->search(
84
    { branch   => $library_id, archived => 0 },
85
    { order_by => { '-asc' => 'name' } }
86
);
87
$template->param(
88
    registerid => $registerid,
89
    registers  => $registers,
90
);
91
103
92
if ( $pay_individual || $writeoff_individual ) {
104
if ( $pay_individual || $writeoff_individual ) {
93
    if ($pay_individual) {
105
    if ($pay_individual) {
94
- 

Return to bug 23321