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

(-)a/reports/orders_by_fund.pl (-7 / +6 lines)
Lines 25-41 This script displays all orders associated to a selected budget. Link Here
25
25
26
=cut
26
=cut
27
27
28
use strict;
29
use warnings;
30
use Modern::Perl;
28
use Modern::Perl;
31
29
32
use CGI;
30
use CGI qw( -utf8 );
33
use C4::Auth;
31
use C4::Auth;
34
use C4::Output;
32
use C4::Output;
35
use C4::Budgets;
33
use C4::Budgets;
36
use C4::Biblio;
34
use C4::Biblio;
37
use C4::Reports;
35
use C4::Reports;
38
use C4::Acquisition; #GetBasket()
36
use C4::Acquisition; #GetBasket()
37
use Koha::DateUtils;
39
38
40
my $query = new CGI;
39
my $query = new CGI;
41
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
40
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Lines 110-117 if ( $get_orders ) { Link Here
110
        $order->{'total_ecost'} = $order->{'quantity'} * $order->{'ecost'};
109
        $order->{'total_ecost'} = $order->{'quantity'} * $order->{'ecost'};
111
110
112
        # Format the dates and currencies correctly
111
        # Format the dates and currencies correctly
113
        $order->{'datereceived'} = Koha::DateUtils::output_pref(Koha::DateUtils::dt_from_string($order->{'datereceived'}));
112
        $order->{'datereceived'} = output_pref(dt_from_string($order->{'datereceived'}));
114
        $order->{'entrydate'} = Koha::DateUtils::output_pref(Koha::DateUtils::dt_from_string($order->{'entrydate'}));
113
        $order->{'entrydate'} = output_pref(dt_from_string($order->{'entrydate'}));
115
        $total_quantity += $order->{'quantity'};
114
        $total_quantity += $order->{'quantity'};
116
        $total_rrp += $order->{'total_rrp'};
115
        $total_rrp += $order->{'total_rrp'};
117
        $total_ecost += $order->{'total_ecost'};
116
        $total_ecost += $order->{'total_ecost'};
Lines 137-144 if ( $get_orders ) { Link Here
137
        my $sep = $params->{"sep"};
136
        my $sep = $params->{"sep"};
138
        $sep = "\t" if ($sep eq 'tabulation');
137
        $sep = "\t" if ($sep eq 'tabulation');
139
138
139
        # TODO Use Text::CSV to generate the CSV file
140
        print $query->header(
140
        print $query->header(
141
           -type       => 'application/vnd.sun.xml.calc',
141
           -type       => 'text/csv',
142
           -encoding    => 'utf-8',
142
           -encoding    => 'utf-8',
143
           -attachment => "$basename.csv",
143
           -attachment => "$basename.csv",
144
           -name       => "$basename.csv"
144
           -name       => "$basename.csv"
145
- 

Return to bug 16594