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

(-)a/Koha/Template/Plugin/Registers.pm (-2 / +9 lines)
Lines 58-66 sub all { Link Here
58
    $where->{branch} = C4::Context->userenv->{'branch'}
58
    $where->{branch} = C4::Context->userenv->{'branch'}
59
      if $filters->{current_branch};
59
      if $filters->{current_branch};
60
    my $registers = Koha::Cash::Registers->search($where)->unblessed();
60
    my $registers = Koha::Cash::Registers->search($where)->unblessed();
61
62
    my $selected = $params->{selected};
61
    for my $register ( @{$registers} ) {
63
    for my $register ( @{$registers} ) {
62
        $register->{selected} = ( defined( $self->session_register )
64
        if ( defined($selected) ) {
63
              && $register->{id} == $self->session_register ) ? 1 : 0;
65
            $register->{selected} = ( $register->{id} == $selected ) ? 1 : 0;
66
        }
67
        else {
68
            $register->{selected} = ( defined( $self->session_register )
69
                  && $register->{id} == $self->session_register ) ? 1 : 0;
70
        }
64
    }
71
    }
65
72
66
    return $registers;
73
    return $registers;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash_register_stats.tt (-2 / +12 lines)
Lines 1-8 Link Here
1
[% USE raw %]
1
[% USE raw %]
2
[% USE Asset %]
2
[% USE Asset %]
3
[% USE Branches %]
4
[% USE Koha %]
3
[% USE KohaDates %]
5
[% USE KohaDates %]
4
[% USE Price %]
6
[% USE Price %]
5
[% USE ItemTypes %]
7
[% USE ItemTypes %]
8
[% USE Registers %]
6
[% SET footerjs = 1 %]
9
[% SET footerjs = 1 %]
7
[% PROCESS 'accounts.inc' %]
10
[% PROCESS 'accounts.inc' %]
8
[% INCLUDE 'doc-head-open.inc' %]
11
[% INCLUDE 'doc-head-open.inc' %]
Lines 96-104 Link Here
96
                            [% END %]
99
                            [% END %]
97
                        [% END %]
100
                        [% END %]
98
                    </select>
101
                    </select>
99
             </td>
100
        </tr>
101
                </li>
102
                </li>
103
                [% IF Koha.Preference('UseCashRegisters') %]
104
                <li>
105
                    <label for="registerid">Cash register: </label>
106
                    <select name="registerid" id="registerid">
107
                        [% PROCESS options_for_registers registers => Registers.all( selected => registerid ) %]
108
                    </select>
109
                </li>
110
                [% END %]
102
            </ol>
111
            </ol>
103
        </fieldset>
112
        </fieldset>
104
113
Lines 186-191 Link Here
186
     </div> <!-- /.row -->
195
     </div> <!-- /.row -->
187
196
188
[% MACRO jsinclude BLOCK %]
197
[% MACRO jsinclude BLOCK %]
198
    [% Asset.js("js/register_selection.js") | $raw %]
189
    [% INCLUDE 'datatables.inc' %]
199
    [% INCLUDE 'datatables.inc' %]
190
    <script id="js">
200
    <script id="js">
191
        $(document).ready(function() {
201
        $(document).ready(function() {
(-)a/reports/cash_register_stats.pl (-1 / +9 lines)
Lines 62-67 my @debit_types = Link Here
62
  Koha::Account::DebitTypes->search()->as_list;
62
  Koha::Account::DebitTypes->search()->as_list;
63
my @credit_types =
63
my @credit_types =
64
  Koha::Account::CreditTypes->search()->as_list;
64
  Koha::Account::CreditTypes->search()->as_list;
65
my $registerid;
65
66
66
if ($do_it) {
67
if ($do_it) {
67
68
Lines 95-100 if ($do_it) { Link Here
95
        push @extra_params, $manager_branchcode;
96
        push @extra_params, $manager_branchcode;
96
    }
97
    }
97
98
99
    my $whereRegister = q{};
100
    $registerid = $input->param("registerid");
101
    if ($registerid) {
102
        $whereRegister = q{ AND al.register_id = ?};
103
        push @extra_params, $registerid;
104
    }
98
105
99
    my $query = "
106
    my $query = "
100
    SELECT round(amount,2) AS amount, description,
107
    SELECT round(amount,2) AS amount, description,
Lines 111-116 if ($do_it) { Link Here
111
        WHERE CAST(al.date AS DATE) BETWEEN ? AND ?
118
        WHERE CAST(al.date AS DATE) BETWEEN ? AND ?
112
        $whereTType
119
        $whereTType
113
        $whereBranchCode
120
        $whereBranchCode
121
        $whereRegister
114
        ORDER BY al.date
122
        ORDER BY al.date
115
    ";
123
    ";
116
    my $sth_stats = $dbh->prepare($query) or die "Unable to prepare query " . $dbh->errstr;
124
    my $sth_stats = $dbh->prepare($query) or die "Unable to prepare query " . $dbh->errstr;
Lines 192-197 $template->param( Link Here
192
    branchloop       => Koha::Libraries->search({}, { order_by => ['branchname'] })->unblessed,
200
    branchloop       => Koha::Libraries->search({}, { order_by => ['branchname'] })->unblessed,
193
    debit_types      => \@debit_types,
201
    debit_types      => \@debit_types,
194
    credit_types     => \@credit_types,
202
    credit_types     => \@credit_types,
203
    registerid       => $registerid,
195
    CGIsepChoice => GetDelimiterChoices,
204
    CGIsepChoice => GetDelimiterChoices,
196
);
205
);
197
206
198
- 

Return to bug 24665