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-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 20-26 Link Here
20
    <div class="row">
23
    <div class="row">
21
        <div class="col-sm-10 col-sm-push-2">
24
        <div class="col-sm-10 col-sm-push-2">
22
25
23
        [% IF ( error_registers ) %]
26
        [% IF registers.size == 0 %]
24
        <div id="error_message" class="dialog alert">
27
        <div id="error_message" class="dialog alert">
25
            You must have at least one cash register associated with this branch before you can record payments.
28
            You must have at least one cash register associated with this branch before you can record payments.
26
        </div>
29
        </div>
Lines 118-130 Link Here
118
                            <li>
121
                            <li>
119
                                <label for="registerid">Cash register: </label>
122
                                <label for="registerid">Cash register: </label>
120
                                <select name="registerid" id="registerid">
123
                                <select name="registerid" id="registerid">
121
                                    [% FOREACH register IN registers %]
124
                                    [% PROCESS options_for_registers register_required => 1 %]
122
                                      [% IF register.id == default_register %]
123
                                    <option value="[% register.id | html %]" selected="selected">[% register.name | html %]</option>
124
                                      [% ELSE %]
125
                                    <option value="[% register.id | html %]">[% register.name | html %]</option>
126
                                      [% END %]
127
                                    [% END %]
128
                                </select>
125
                                </select>
129
                            </li>
126
                            </li>
130
                        </ol>
127
                        </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