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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc (-1 / +1 lines)
Lines 25-31 Link Here
25
25
26
[% BLOCK options_for_registers %]
26
[% BLOCK options_for_registers %]
27
    <!-- <option hidden disabled selected value> -- select an option -- </option> -->
27
    <!-- <option hidden disabled selected value> -- select an option -- </option> -->
28
    <option id="noregister" value="">-- None --</option>
28
    <option id="noregister"[% IF register_required %] disabled selected [% END %] value="">-- None --</option>
29
    [% FOREACH r IN registers %]
29
    [% FOREACH r IN registers %]
30
        [% IF r.branch == branch %]
30
        [% IF r.branch == branch %]
31
            [% IF r.selected %]
31
            [% IF r.selected %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt (-8 / +5 lines)
Lines 1-10 Link Here
1
[% USE raw %]
1
[% USE raw %]
2
[% USE Asset %]
2
[% USE Asset %]
3
[% USE Branches %]
3
[% USE Koha %]
4
[% USE Koha %]
4
[% USE Price %]
5
[% USE Price %]
6
[% USE Registers %]
5
[% SET footerjs = 1 %]
7
[% SET footerjs = 1 %]
6
[% PROCESS 'payments.inc' %]
8
[% PROCESS 'payments.inc' %]
7
[% INCLUDE 'doc-head-open.inc' %]
9
[% INCLUDE 'doc-head-open.inc' %]
10
[% SET registers = Registers.all( filters => { current_branch => 1 } ) %]
8
<title>Koha &rsaquo; Payments</title>
11
<title>Koha &rsaquo; Payments</title>
9
[% INCLUDE 'doc-head-close.inc' %]
12
[% INCLUDE 'doc-head-close.inc' %]
10
</head>
13
</head>
Lines 19-25 Link Here
19
    <div class="row">
22
    <div class="row">
20
        <div class="col-sm-10 col-sm-push-2">
23
        <div class="col-sm-10 col-sm-push-2">
21
24
22
        [% IF ( error_registers ) %]
25
        [% IF registers.size == 0 %]
23
        <div id="error_message" class="dialog alert">
26
        <div id="error_message" class="dialog alert">
24
            You must have at least one cash register associated with this branch before you can record payments.
27
            You must have at least one cash register associated with this branch before you can record payments.
25
        </div>
28
        </div>
Lines 117-129 Link Here
117
                            <li>
120
                            <li>
118
                                <label for="registerid">Cash register: </label>
121
                                <label for="registerid">Cash register: </label>
119
                                <select name="registerid" id="registerid">
122
                                <select name="registerid" id="registerid">
120
                                    [% FOREACH register IN registers %]
123
                                    [% PROCESS options_for_registers register_required => 1 %]
121
                                      [% IF register.id == default_register %]
122
                                    <option value="[% register.id | html %]" selected="selected">[% register.name | html %]</option>
123
                                      [% ELSE %]
124
                                    <option value="[% register.id | html %]">[% register.name | html %]</option>
125
                                      [% END %]
126
                                    [% END %]
127
                                </select>
124
                                </select>
128
                            </li>
125
                            </li>
129
                        </ol>
126
                        </ol>
(-)a/pos/pay.pl (-23 lines)
Lines 33-60 my $logged_in_user = Koha::Patrons->find($loggedinuser) or die "Not logged in"; Link Here
33
33
34
my $library_id         = C4::Context->userenv->{'branch'};
34
my $library_id         = C4::Context->userenv->{'branch'};
35
my $registerid         = $input->param('registerid');
35
my $registerid         = $input->param('registerid');
36
my $default_registerid = $input->param('default_register');
37
my $registers          = Koha::Cash::Registers->search(
38
    { branch   => $library_id, archived => 0 },
39
    { order_by => { '-asc' => 'name' } }
40
);
41
42
if ( !$registers->count ) {
43
    $template->param( error_registers => 1 );
44
}
45
else {
46
    if ( !$default_registerid ) {
47
        my $default_register = Koha::Cash::Registers->find(
48
            { branch => $library_id, branch_default => 1 } );
49
        $default_registerid =
50
          $default_register ? $default_register->id : $registers->next->id;
51
    }
52
53
    $template->param(
54
        default_register => $default_registerid,
55
        registers        => $registers,
56
    );
57
}
58
36
59
my $invoice_types =
37
my $invoice_types =
60
  Koha::Account::DebitTypes->search_with_library_limits( { can_be_sold => 1 },
38
  Koha::Account::DebitTypes->search_with_library_limits( { can_be_sold => 1 },
61
- 

Return to bug 24786