From 455ba62ef4b011b72d6459fb20c31edf3d35b84a Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 15 Feb 2023 08:56:22 +0100 Subject: [PATCH] Bug 32705: Display the column if 1 order has an invoice price On 25655 we added a new patch to store the invoice unitprice and currency even if it's the active currency. Here we then want to display the column if at least one order has an invoice price in a currency that is not the active one. Signed-off-by: Michaela Sieber Signed-off-by: Katrin Fischer --- acqui/invoice.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/acqui/invoice.pl b/acqui/invoice.pl index 5f5a9345e3..b9d1bf5d0b 100755 --- a/acqui/invoice.pl +++ b/acqui/invoice.pl @@ -251,6 +251,7 @@ elsif ( $op && $op eq 'mod_adj' ) { } } +my $active_currency = Koha::Acquisition::Currencies->get_active, my $details = GetInvoiceDetails($invoiceid); my $bookseller = Koha::Acquisition::Booksellers->find( $details->{booksellerid} ); my @orders_loop = (); @@ -283,7 +284,7 @@ foreach my $order (@$orders) { $total_tax_included += get_rounded_price($$line{total_tax_included}); $line->{orderline} = $line->{parent_ordernumber}; - $has_invoice_unitprice = 1 if defined $line->{invoice_unitprice}; + $has_invoice_unitprice = 1 if $line->{invoice_currency} ne $active_currency->currency; push @orders_loop, $line; } @@ -343,7 +344,7 @@ $template->param( total_tax_excluded_shipment => $total_tax_excluded + $shipmentcost, total_tax_included_shipment => $total_tax_included + $shipmentcost, invoiceincgst => $bookseller->invoiceincgst, - currency => Koha::Acquisition::Currencies->get_active, + currency => $active_currency, budgets => $budget_loop, budget => GetBudget( $shipmentcost_budgetid ), has_invoice_unitprice => $has_invoice_unitprice, -- 2.30.2