From 3d6097b23ede8753e35a11fe69fa65db8847b470 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 21 Nov 2024 15:35:00 +0100 Subject: [PATCH] Bug 38343: Add info if there are closed invoices not displayed --- acqui/parcels.pl | 14 ++++++++++++++ .../intranet-tmpl/prog/en/modules/acqui/parcels.tt | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/acqui/parcels.pl b/acqui/parcels.pl index 23baa663f36..fa7c6173209 100755 --- a/acqui/parcels.pl +++ b/acqui/parcels.pl @@ -161,6 +161,20 @@ my @parcels = GetInvoices( ); my $count_parcels = @parcels; +unless ($include_closed) { + + # FIXME Implement and use Koha::Acquisition::Bookseller->invoices; + my $closed_invoices = Koha::Acquisition::Invoices->search( + { + booksellerid => $booksellerid, + ( $datefrom ? ( shipmentdatefrom => $datefrom ) : () ), + ( $dateto ? ( shipmentdateto => $dateto ) : () ), + closedate => { '!=' => undef }, + } + ); + $template->param( closed_invoices => $closed_invoices->count ); +} + # multi page display gestion $startfrom ||= 0; if ( $count_parcels > $resultsperpage ) { 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 e8698d49b21..2501b191fb5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt @@ -39,6 +39,10 @@ [% INCLUDE 'messages.inc' %]

Receive shipment from vendor [% name | html %]

+ [% IF closed_invoices %] +

[% I18N.tnx("There is one closed invoice not included in this search.", "There are {closed_invoices} closed invoices not included in this search.", closed_invoices, { closed_invoices => closed_invoices }) %]

+ [% END %] + [% IF ( error_failed_to_create_invoice ) %]

An error has occurred. Invoice cannot be created.

-- 2.34.1