X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=reports%2Forders_by_fund.pl;h=c831bf20441703e6025fd36344f4d7ca7b3e5668;hb=0d7ba6e5201b16f7e7a2332af7204cb6416c289a;hp=7f50e9af38d61e410ea21eea1e16da560f16b90b;hpb=638786e719fb297ae976061b09a71f3d788416f4;p=koha-ffzg.git diff --git a/reports/orders_by_fund.pl b/reports/orders_by_fund.pl index 7f50e9af38..c831bf2044 100755 --- a/reports/orders_by_fund.pl +++ b/reports/orders_by_fund.pl @@ -28,23 +28,20 @@ This script displays all orders associated to a selected budget. use Modern::Perl; use CGI qw( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::Budgets; -use C4::Biblio; -use C4::Reports; -use C4::Acquisition; #GetBasket() +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Budgets qw( GetBudgetsReport GetBudgetHierarchy ); +use C4::Acquisition qw( GetBasket get_rounded_price ); +use C4::Context; use Koha::Biblios; -use Koha::DateUtils; -my $query = new CGI; +my $query = CGI->new; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { template_name => "reports/orders_by_budget.tt", query => $query, type => "intranet", flagsrequired => { reports => '*' }, - debug => 1, } ); @@ -109,9 +106,7 @@ if ( $get_orders ) { $order->{'total_rrp'} = get_rounded_price($order->{'quantity'}) * $order->{'rrp'}; $order->{'total_ecost'} = get_rounded_price($order->{'quantity'}) * $order->{'ecost'}; - # Format the dates and currencies correctly - $order->{'datereceived'} = output_pref(dt_from_string($order->{'datereceived'})); - $order->{'entrydate'} = output_pref(dt_from_string($order->{'entrydate'})); + # Format the currencies correctly $total_quantity += $order->{'quantity'}; $total_rrp += $order->{'total_rrp'}; $total_ecost += $order->{'total_ecost'}; @@ -134,8 +129,7 @@ if ( $get_orders ) { # If we are outputting to a file, create it and exit. else { my $basename = $params->{"basename"}; - my $sep = $params->{"sep"}; - $sep = "\t" if ($sep eq 'tabulation'); + my $sep = C4::Context->csv_delimiter(scalar $params->{"sep"}); # TODO Use Text::CSV to generate the CSV file print $query->header( @@ -209,7 +203,7 @@ else { $template->param( budgetsloop => \@{$budgetloop}, outputFormatloop => \@outputFormats, delimiterloop => \@CSVdelimiters, - delimiterPreference => C4::Context->preference('delimiter') + delimiterPreference => C4::Context->preference('CSVDelimiter') ); }