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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash_register_stats.tt (-3 / +4 lines)
Lines 1-10 Link Here
1
[% USE KohaDates %]
1
[% USE KohaDates %]
2
[% USE Price %]
3
[% USE ItemTypes %]
2
[% INCLUDE 'doc-head-open.inc' %]
4
[% INCLUDE 'doc-head-open.inc' %]
3
<title>Koha &rsaquo; Reports [% IF ( do_it ) %]&rsaquo; Cash register statistics &rsaquo; Results[% ELSE %]&rsaquo; Cash register statistics[% END %]</title>
5
<title>Koha &rsaquo; Reports [% IF ( do_it ) %]&rsaquo; Cash register statistics &rsaquo; Results[% ELSE %]&rsaquo; Cash register statistics[% END %]</title>
4
[% INCLUDE 'doc-head-close.inc' %]
6
[% INCLUDE 'doc-head-close.inc' %]
5
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
7
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
6
[% INCLUDE 'datatables.inc' %]
8
[% INCLUDE 'datatables.inc' %]
7
[% INCLUDE 'datatables-strings.inc' %]
8
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
9
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
9
<script type="text/javascript" id="js">
10
<script type="text/javascript" id="js">
10
 $(document).ready(function() {
11
 $(document).ready(function() {
Lines 276-285 $(document).ready(function() { Link Here
276
                    [% END %]
277
                    [% END %]
277
                </td>
278
                </td>
278
                <td>[% loopresul.note %]</td>
279
                <td>[% loopresul.note %]</td>
279
                <td style="text-align:right;">[% loopresul.amount %]</td>
280
                <td style="text-align:right;">[% loopresul.amount | $Price %]</td>
280
                <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loopresul.biblionumber %]">[% loopresul.title %]</a></td>
281
                <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loopresul.biblionumber %]">[% loopresul.title %]</a></td>
281
                <td>[% loopresul.barcode %]</td>
282
                <td>[% loopresul.barcode %]</td>
282
                <td>[% loopresul.itype %]</td>
283
                <td>[% ItemTypes.GetDescription(loopresul.itype) %]</td>
283
            </tr>
284
            </tr>
284
        [% END %]
285
        [% END %]
285
        <tfoot>
286
        <tfoot>
(-)a/reports/cash_register_stats.pl (-5 / +3 lines)
Lines 144-152 if ($do_it) { Link Here
144
        my $reportfilename = $reportname ? "$reportname.$format" : "reportresults.$format" ;
144
        my $reportfilename = $reportname ? "$reportname.$format" : "reportresults.$format" ;
145
        #my $reportfilename = "$reportname.html" ;
145
        #my $reportfilename = "$reportname.html" ;
146
        my $delimiter = C4::Context->preference('delimiter') || ',';
146
        my $delimiter = C4::Context->preference('delimiter') || ',';
147
        my ( $type, $content );
147
        my ( $content );
148
        if ( $format eq 'csv' ) {
148
        if ( $format eq 'csv' ) {
149
            my $type = 'application/csv';
150
            my $csv = Text::CSV::Encoded->new({ encoding_out => 'UTF-8', sep_char => $delimiter});
149
            my $csv = Text::CSV::Encoded->new({ encoding_out => 'UTF-8', sep_char => $delimiter});
151
            $csv or die "Text::CSV::Encoded->new({binary => 1}) FAILED: " . Text::CSV::Encoded->error_diag();
150
            $csv or die "Text::CSV::Encoded->new({binary => 1}) FAILED: " . Text::CSV::Encoded->error_diag();
152
            my @headers = ();
151
            my @headers = ();
Lines 175-181 if ($do_it) { Link Here
175
                        $row->{accounttype},
174
                        $row->{accounttype},
176
                        $row->{amount},
175
                        $row->{amount},
177
                        $row->{title},
176
                        $row->{title},
178
                        $row->{barcode};
177
                        $row->{barcode},
179
                        $row->{itype};
178
                        $row->{itype};
180
                if ($csv->combine(@rowValues)) {
179
                if ($csv->combine(@rowValues)) {
181
                    $content .= Encode::decode('UTF-8',$csv->string()) . "\n";
180
                    $content .= Encode::decode('UTF-8',$csv->string()) . "\n";
Lines 185-191 if ($do_it) { Link Here
185
            }
184
            }
186
        }
185
        }
187
        print $input->header(
186
        print $input->header(
188
            -type => $type,
187
            -type => 'text/csv',
189
            -attachment=> $reportfilename
188
            -attachment=> $reportfilename
190
        );
189
        );
191
        print $content;
190
        print $content;
192
- 

Return to bug 6934