Bug 6934: fix problem when export it open in LibreOffice - show values of itype and...
authorBouzid Fergani <bouzid.fergani@inlibro.com>
Tue, 19 Jul 2016 16:05:14 +0000 (12:05 -0400)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 28 Oct 2016 11:50:26 +0000 (11:50 +0000)
Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash_register_stats.tt
reports/cash_register_stats.pl

index 276c3e7..29d2bb6 100644 (file)
@@ -1,10 +1,11 @@
 [% USE KohaDates %]
+[% USE Price %]
+[% USE ItemTypes %]
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Reports [% IF ( do_it ) %]&rsaquo; Cash register statistics &rsaquo; Results[% ELSE %]&rsaquo; Cash register statistics[% END %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
 [% INCLUDE 'datatables.inc' %]
-[% INCLUDE 'datatables-strings.inc' %]
 <script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
 <script type="text/javascript" id="js">
  $(document).ready(function() {
@@ -276,10 +277,10 @@ $(document).ready(function() {
                     [% END %]
                 </td>
                 <td>[% loopresul.note %]</td>
-                <td style="text-align:right;">[% loopresul.amount %]</td>
+                <td style="text-align:right;">[% loopresul.amount | $Price %]</td>
                 <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loopresul.biblionumber %]">[% loopresul.title %]</a></td>
                 <td>[% loopresul.barcode %]</td>
-                <td>[% loopresul.itype %]</td>
+                <td>[% ItemTypes.GetDescription(loopresul.itype) %]</td>
             </tr>
         [% END %]
         <tfoot>
index 409aa4e..00561c3 100755 (executable)
@@ -144,9 +144,8 @@ if ($do_it) {
         my $reportfilename = $reportname ? "$reportname.$format" : "reportresults.$format" ;
         #my $reportfilename = "$reportname.html" ;
         my $delimiter = C4::Context->preference('delimiter') || ',';
-        my ( $type, $content );
+        my ( $content );
         if ( $format eq 'csv' ) {
-            my $type = 'application/csv';
             my $csv = Text::CSV::Encoded->new({ encoding_out => 'UTF-8', sep_char => $delimiter});
             $csv or die "Text::CSV::Encoded->new({binary => 1}) FAILED: " . Text::CSV::Encoded->error_diag();
             my @headers = ();
@@ -175,7 +174,7 @@ if ($do_it) {
                         $row->{accounttype},
                         $row->{amount},
                         $row->{title},
-                        $row->{barcode};
+                        $row->{barcode},
                         $row->{itype};
                 if ($csv->combine(@rowValues)) {
                     $content .= Encode::decode('UTF-8',$csv->string()) . "\n";
@@ -185,7 +184,7 @@ if ($do_it) {
             }
         }
         print $input->header(
-            -type => $type,
+            -type => 'text/csv',
             -attachment=> $reportfilename
         );
         print $content;