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

(-)a/Koha/Template/Plugin/Registers.pm (-1 / +8 lines)
Lines 89-97 sub all { Link Here
89
    $where->{branch} = C4::Context->userenv->{'branch'}
89
    $where->{branch} = C4::Context->userenv->{'branch'}
90
      if ( $filters->{current_branch} && C4::Context->userenv );
90
      if ( $filters->{current_branch} && C4::Context->userenv );
91
    my $registers = Koha::Cash::Registers->search($where)->unblessed();
91
    my $registers = Koha::Cash::Registers->search($where)->unblessed();
92
93
    my $selected = $params->{selected};
92
    for my $register ( @{$registers} ) {
94
    for my $register ( @{$registers} ) {
93
        $register->{selected} = ( defined( $self->session_register_id )
95
        if ( defined($selected) ) {
96
            $register->{selected} = ( $register->{id} == $selected ) ? 1 : 0;
97
        }
98
        else {
99
            $register->{selected} = ( defined( $self->session_register_id )
94
              && $register->{id} eq $self->session_register_id ) ? 1 : 0;
100
              && $register->{id} eq $self->session_register_id ) ? 1 : 0;
101
        }
95
    }
102
    }
96
103
97
    return $registers;
104
    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 61-66 my @debit_types = Link Here
61
  Koha::Account::DebitTypes->search()->as_list;
61
  Koha::Account::DebitTypes->search()->as_list;
62
my @credit_types =
62
my @credit_types =
63
  Koha::Account::CreditTypes->search()->as_list;
63
  Koha::Account::CreditTypes->search()->as_list;
64
my $registerid;
64
65
65
if ($do_it) {
66
if ($do_it) {
66
67
Lines 94-99 if ($do_it) { Link Here
94
        push @extra_params, $manager_branchcode;
95
        push @extra_params, $manager_branchcode;
95
    }
96
    }
96
97
98
    my $whereRegister = q{};
99
    $registerid = $input->param("registerid");
100
    if ($registerid) {
101
        $whereRegister = q{ AND al.register_id = ?};
102
        push @extra_params, $registerid;
103
    }
97
104
98
    my $query = "
105
    my $query = "
99
    SELECT round(amount,2) AS amount, description,
106
    SELECT round(amount,2) AS amount, description,
Lines 110-115 if ($do_it) { Link Here
110
        WHERE CAST(al.date AS DATE) BETWEEN ? AND ?
117
        WHERE CAST(al.date AS DATE) BETWEEN ? AND ?
111
        $whereTType
118
        $whereTType
112
        $whereBranchCode
119
        $whereBranchCode
120
        $whereRegister
113
        ORDER BY al.date
121
        ORDER BY al.date
114
    ";
122
    ";
115
    my $sth_stats = $dbh->prepare($query) or die "Unable to prepare query " . $dbh->errstr;
123
    my $sth_stats = $dbh->prepare($query) or die "Unable to prepare query " . $dbh->errstr;
Lines 191-196 $template->param( Link Here
191
    branchloop       => Koha::Libraries->search({}, { order_by => ['branchname'] })->unblessed,
199
    branchloop       => Koha::Libraries->search({}, { order_by => ['branchname'] })->unblessed,
192
    debit_types      => \@debit_types,
200
    debit_types      => \@debit_types,
193
    credit_types     => \@credit_types,
201
    credit_types     => \@credit_types,
202
    registerid       => $registerid,
194
    CGIsepChoice => GetDelimiterChoices,
203
    CGIsepChoice => GetDelimiterChoices,
195
);
204
);
196
205
197
- 

Return to bug 24665