From 466e640255e45d9daf92f54c83bd7002ffe2b4f5 Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Tue, 22 Sep 2020 00:32:51 +0200 Subject: [PATCH] Bug 26503: Add limit for standing orders to acq advanced search This allows to filter on standing orders on the acq advanced search checkbox. For this purpose a new checkbox is shown behind the order status search option. As both not yet ordered and standing orders have the status 'new' or partially received internally, this seems like a good placement as it will help distinguish these cases clearly. new + standing order = standing order, but nothing received yet partially received + standing order = active standing order all status + standing order = all standing orders To test: - Create some baskets with at least one order, some 'standing' and others not - In the top toolbar choose tab Orders search > Advanced search - Make some searches with and without the new 'Standing order' option - Verify the right orders are found - In the search results standing orders will now show with the status + (standing order). Signed-off-by: David Nind --- C4/Acquisition.pm | 9 +++++++++ acqui/histsearch.pl | 1 + koha-tmpl/intranet-tmpl/prog/en/includes/filter-orders.inc | 6 ++++++ koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt | 1 + 4 files changed, 17 insertions(+) diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index 3aff14d667..6fabf465c7 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -2093,6 +2093,7 @@ params: budget orderstatus (note that orderstatus '' will retrieve orders of any status except cancelled) + is_standing managing_library biblionumber get_canceled_order (if set to a true value, cancelled orders will @@ -2116,6 +2117,7 @@ returns: 'quantityreceived' => undef, 'title' => 'The Adventures of Huckleberry Finn', 'managing_library' => 'CPL' + 'is_standing' => '1' } =cut @@ -2136,6 +2138,7 @@ sub GetHistory { my $basketgroupname = $params{basketgroupname}; my $budget = $params{budget}; my $orderstatus = $params{orderstatus}; + my $is_standing = $params{is_standing}; my $biblionumber = $params{biblionumber}; my $get_canceled_order = $params{get_canceled_order} || 0; my $ordernumber = $params{ordernumber}; @@ -2176,6 +2179,7 @@ sub GetHistory { aqbasket.basketname, aqbasket.basketgroupid, aqbasket.authorisedby, + aqbasket.is_standing, concat( borrowers.firstname,' ',borrowers.surname) AS authorisedbyname, branch as managing_library, aqbasketgroups.name as groupname, @@ -2269,6 +2273,11 @@ sub GetHistory { push @query_params, "$orderstatus"; } + if ( $is_standing ) { + $query .= " AND is_standing = ? "; + push @query_params, $is_standing; + } + if ($basket) { if ($basket =~ m/^\d+$/) { $query .= " AND aqorders.basketno = ? "; diff --git a/acqui/histsearch.pl b/acqui/histsearch.pl index 64802dddaa..aa0187ab9c 100755 --- a/acqui/histsearch.pl +++ b/acqui/histsearch.pl @@ -85,6 +85,7 @@ my $filters = { booksellerinvoicenumber => scalar $input->param('booksellerinvoicenumber'), budget => scalar $input->param('budget'), orderstatus => scalar $input->param('orderstatus'), + is_standing => scalar $input->param('is_standing'), ordernumber => scalar $input->param('ordernumber'), search_children_too => scalar $input->param('search_children_too'), created_by => [ $input->multi_param('created_by') ], diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/filter-orders.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/filter-orders.inc index 7011692637..8e343b0117 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/filter-orders.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/filter-orders.inc @@ -75,6 +75,12 @@ [% END %] + [% IF filters.is_standing %] + + [% ELSE %] + + [% END %] +
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt index e4f0f2fe45..67daf85bdd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt @@ -67,6 +67,7 @@ [% CASE 'complete' %]Received [% CASE 'cancelled' %]Cancelled [% END %] + [% IF order.is_standing %](standing order)[% END %] [% order.basketname | html %] ([% order.basketno | html %]) [% order.authorisedbyname | html %] -- 2.11.0