From 4c0708d19f4945afc100951e438b4c8f071562a8 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 7 Feb 2023 09:19:01 +0100 Subject: [PATCH] Bug 32705: Display invoice price On bug 25655 we are storing the unit price and currency used for invoicing. Here we are displaying them on the invoice page. Test plan: Reuse the test plan from 25655 and go to the invoice page Notice that a new 'Invoice price' column is displayed if at least one order of the invoice had a price given in a foreign currency We could discuss the display of the prices here, we've decided to not format them. We cannot do better for now as we are not storing the format along with the currency. Sponsored-by: The Research University in the Helmholtz Association (KIT) Signed-off-by: Michaela Sieber --- acqui/invoice.pl | 3 +++ .../prog/en/modules/acqui/invoice.tt | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/acqui/invoice.pl b/acqui/invoice.pl index 0e21a20c11..5f5a9345e3 100755 --- a/acqui/invoice.pl +++ b/acqui/invoice.pl @@ -262,6 +262,7 @@ my $total_quantity = 0; my $total_tax_excluded = 0; my $total_tax_included = 0; my $total_tax_value = 0; +my $has_invoice_unitprice; foreach my $order (@$orders) { my $line = get_infos( $order, $bookseller); @@ -282,6 +283,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}; push @orders_loop, $line; } @@ -344,6 +346,7 @@ $template->param( currency => Koha::Acquisition::Currencies->get_active, budgets => $budget_loop, budget => GetBudget( $shipmentcost_budgetid ), + has_invoice_unitprice => $has_invoice_unitprice, ); defined( $invoice_files ) && $template->param( files => $invoice_files->GetFilesInfo() ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt index f6ac0bea3a..4da396eb7f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt @@ -312,6 +312,9 @@ Summary Library + [% IF has_invoice_unitprice %] + Invoice price + [% END %] Actual cost tax exc. Actual cost tax inc. Replacement price @@ -343,6 +346,13 @@ [% END %]

[% order.branchcode | html %]

+ [% IF has_invoice_unitprice %] + + [% IF order.invoice_unitprice %] + [% order.invoice_unitprice | $Price %] [% order.invoice_currency | html %] + [% END %] + + [% END %] [% order.unitprice_tax_excluded | $Price %] [% order.unitprice_tax_included | $Price %] [% order.replacementprice | $Price %] [% IF ( order.uncertainprice ) %] (Uncertain) [% END %] @@ -362,6 +372,9 @@ [% FOR tf IN foot_loop %] Total (GST [% tf.tax_rate * 100 | html %] %) + [% IF has_invoice_unitprice %] + + [% END %] @@ -375,6 +388,9 @@ [% END %] Total ([% currency.symbol | html %]) + [% IF has_invoice_unitprice %] + + [% END %] @@ -387,6 +403,9 @@ Total + adjustments + shipment cost ([% currency.symbol | html %]) + [% IF has_invoice_unitprice %] + + [% END %] -- 2.30.2