Update release notes for 20.05.00 release
[koha-ffzg.git] / reports / orders_by_fund.pl
index 469b2c2..4e797c2 100755 (executable)
@@ -34,6 +34,7 @@ use C4::Budgets;
 use C4::Biblio;
 use C4::Reports;
 use C4::Acquisition; #GetBasket()
+use Koha::Biblios;
 use Koha::DateUtils;
 
 my $query = new CGI;
@@ -97,16 +98,17 @@ if ( $get_orders ) {
     # Format the order's informations
     foreach my $order (@orders) {
         # Get the title of the ordered item
-        my $biblio = C4::Biblio::GetBiblio($order->{'biblionumber'});
+        my $biblio = Koha::Biblios->find( $order->{biblionumber} );
         my $basket = C4::Acquisition::GetBasket($order->{'basketno'});
 
         $order->{'basketname'} = $basket->{'basketname'};
         $order->{'authorisedbyname'} = $basket->{'authorisedbyname'};
 
-        $order->{'title'} = $biblio->{'title'} || $order->{'biblionumber'};
+        $order->{title} = $biblio ? $biblio->title : '';
+        $order->{title} ||= $order->{biblionumber};
 
-        $order->{'total_rrp'} = $order->{'quantity'} * $order->{'rrp'};
-        $order->{'total_ecost'} = $order->{'quantity'} * $order->{'ecost'};
+        $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'}));