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 75-94 my $payment_note = uri_unescape scalar $input->param('payment_note'); Link Here
75
my $payment_type = scalar $input->param('payment_type');
75
my $payment_type = scalar $input->param('payment_type');
76
my $accountlines_id;
76
my $accountlines_id;
77
77
78
my $registerid = $input->param('registerid');
78
my $registerid;
79
if ( !$registerid ) {
79
if ( C4::Context->preference('UseCashRegisters') ) {
80
    $registerid = Koha::Cash::Registers->find(
80
    $registerid = $input->param('registerid');
81
        { branch => $library_id, branch_default => 1 },
81
    my $registers  = Koha::Cash::Registers->search(
82
    )->id;
82
        { branch   => $library_id, archived => 0 },
83
        { order_by => { '-asc' => 'name' } }
84
    );
85
86
    if ( !$registers->count ) {
87
        $template->param( error_registers => 1 );
88
    }
89
    else {
90
91
        if ( !$registerid ) {
92
            my $default_register = Koha::Cash::Registers->find(
93
                { branch => $library_id, branch_default => 1 } );
94
            $registerid = $default_register->id if $default_register;
95
        }
96
        $registerid = $registers->next->id if !$registerid;
97
98
        $template->param(
99
            registerid => $registerid,
100
            registers  => $registers,
101
        );
102
    }
83
}
103
}
84
my $registers = Koha::Cash::Registers->search(
85
    { branch   => $library_id, archived => 0 },
86
    { order_by => { '-asc' => 'name' } }
87
);
88
$template->param(
89
    registerid => $registerid,
90
    registers  => $registers,
91
);
92
104
93
if ( $pay_individual || $writeoff_individual ) {
105
if ( $pay_individual || $writeoff_individual ) {
94
    if ($pay_individual) {
106
    if ($pay_individual) {
95
- 

Return to bug 23321