diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index 58c19ca6d1..5372b8f0ba 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -2433,7 +2433,13 @@ sub GetInvoices { ) ) AS is_linked_to_subscriptions, SUM(aqorders.quantityreceived) AS receiveditems, - SUM(aqorders.quantity) AS itemsexpected + SUM(aqorders.quantity) AS itemsexpected, + COALESCE(SUM(aqorders.unitprice_tax_excluded * aqorders.quantity), 0) AS total_tax_excluded, + COALESCE(SUM(aqorders.unitprice_tax_included * aqorders.quantity), 0) AS total_tax_included, + COALESCE( + (SELECT SUM(adj.adjustment) FROM aqinvoice_adjustments adj WHERE adj.invoiceid = aqinvoices.invoiceid), + 0 + ) AS total_adj FROM aqinvoices LEFT JOIN aqbooksellers ON aqbooksellers.id = aqinvoices.booksellerid LEFT JOIN aqorders ON aqorders.invoiceid = aqinvoices.invoiceid diff --git a/acqui/parcels.pl b/acqui/parcels.pl index 27ce71dd96..a52c101682 100755 --- a/acqui/parcels.pl +++ b/acqui/parcels.pl @@ -184,6 +184,10 @@ my $next_page_start = $startfrom + $resultsperpage; my $last_row = ( $next_page_start < $count_parcels ) ? $next_page_start - 1 : $count_parcels - 1; for my $i ( $startfrom .. $last_row ) { my $p = $parcels[$i]; + my $orders_total = + $bookseller->invoiceincgst + ? ( $p->{total_tax_included} // 0 ) + : ( $p->{total_tax_excluded} // 0 ); push @{$loopres}, { @@ -197,6 +201,7 @@ for my $i ( $startfrom .. $last_row ) { bibcount => $p->{receivedbiblios} || 0, reccount => $p->{receiveditems} || 0, itemcount => $p->{itemsexpected} || 0, + totalamount => $orders_total + ( $p->{total_adj} // 0 ) + ( $p->{shipmentcost} // 0 ), }; } if ($count_parcels) { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt index bc5c3e9bc4..7fabc5cf9f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt @@ -2,6 +2,7 @@ [% USE Koha %] [% USE Asset %] [% USE KohaDates %] +[% USE Price %] [% PROCESS 'i18n.inc' %] [% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] @@ -94,6 +95,7 @@ Item count [% tp("Bibliographic record", "Record count") | html %] Items expected + Total @@ -112,6 +114,7 @@ [% searchresult.reccount | html %] [% searchresult.bibcount | html %] [% searchresult.itemcount | html %] + [% searchresult.totalamount | $Price %] [% END %]