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 (-7 / +4 lines)
Lines 1-11 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 %]
5
[% USE TablesSettings %]
6
[% USE TablesSettings %]
7
[% USE Registers %]
6
[% SET footerjs = 1 %]
8
[% SET footerjs = 1 %]
7
[% PROCESS 'payments.inc' %]
9
[% PROCESS 'payments.inc' %]
8
[% INCLUDE 'doc-head-open.inc' %]
10
[% INCLUDE 'doc-head-open.inc' %]
11
[% SET registers = Registers.all( filters => { current_branch => 1 } ) %]
9
<title>Koha &rsaquo; Payments</title>
12
<title>Koha &rsaquo; Payments</title>
10
[% INCLUDE 'doc-head-close.inc' %]
13
[% INCLUDE 'doc-head-close.inc' %]
11
</head>
14
</head>
Lines 126-138 Link Here
126
                            <li>
129
                            <li>
127
                                <label for="registerid">Cash register: </label>
130
                                <label for="registerid">Cash register: </label>
128
                                <select name="registerid" id="registerid">
131
                                <select name="registerid" id="registerid">
129
                                    [% FOREACH register IN registers %]
132
                                    [% PROCESS options_for_registers register_required => 1 %]
130
                                      [% IF register.id == default_register %]
131
                                    <option value="[% register.id | html %]" selected="selected">[% register.name | html %]</option>
132
                                      [% ELSE %]
133
                                    <option value="[% register.id | html %]">[% register.name | html %]</option>
134
                                      [% END %]
135
                                    [% END %]
136
                                </select>
133
                                </select>
137
                            </li>
134
                            </li>
138
                        </ol>
135
                        </ol>
(-)a/pos/pay.pl (-23 lines)
Lines 32-59 my $logged_in_user = Koha::Patrons->find($loggedinuser) or die "Not logged in"; Link Here
32
32
33
my $library_id         = C4::Context->userenv->{'branch'};
33
my $library_id         = C4::Context->userenv->{'branch'};
34
my $registerid         = $input->param('registerid');
34
my $registerid         = $input->param('registerid');
35
my $default_registerid = $input->param('default_register');
36
my $registers          = Koha::Cash::Registers->search(
37
    { branch   => $library_id, archived => 0 },
38
    { order_by => { '-asc' => 'name' } }
39
);
40
41
if ( !$registers->count ) {
42
    $template->param( error_registers => 1 );
43
}
44
else {
45
    if ( !$default_registerid ) {
46
        my $default_register = Koha::Cash::Registers->find(
47
            { branch => $library_id, branch_default => 1 } );
48
        $default_registerid =
49
          $default_register ? $default_register->id : $registers->next->id;
50
    }
51
52
    $template->param(
53
        default_register => $default_registerid,
54
        registers        => $registers,
55
    );
56
}
57
35
58
my $invoice_types =
36
my $invoice_types =
59
  Koha::Account::DebitTypes->search_with_library_limits( { can_be_sold => 1 },
37
  Koha::Account::DebitTypes->search_with_library_limits( { can_be_sold => 1 },
60
- 

Return to bug 24786