From 04539f5cb8f19d0db009f7d79802d559234f0680 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Tue, 7 Aug 2012 15:07:36 +0200 Subject: [PATCH] Bug 7168: Add basket group search field in histsearch.pl Allow to search orders by basket group name Signed-off-by: Marc Veron Displays search field for baketgroup as expected. Signed-off-by: Paul Poulain --- C4/Acquisition.pm | 6 ++++++ acqui/histsearch.pl | 3 +++ koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index f6f58058aa..3b7d842c01 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -1761,6 +1761,7 @@ sub GetHistory { my $to_placed_on = $params{to_placed_on}; my $basket = $params{basket}; my $booksellerinvoicenumber = $params{booksellerinvoicenumber}; + my $basketgroupname = $params{basketgroupname}; my @order_loop; my $total_qty = 0; my $total_qtyreceived = 0; @@ -1850,6 +1851,11 @@ sub GetHistory { push @query_params, "%$booksellerinvoicenumber%", "%$booksellerinvoicenumber%"; } + if ($basketgroupname) { + $query .= " AND aqbasketgroups.name LIKE ? "; + push @query_params, "%$basketgroupname%"; + } + if ( C4::Context->preference("IndependantBranches") ) { my $userenv = C4::Context->userenv; if ( $userenv && ($userenv->{flags} || 0) != 1 ) { diff --git a/acqui/histsearch.pl b/acqui/histsearch.pl index 7f799b5f9c..e89bcae394 100755 --- a/acqui/histsearch.pl +++ b/acqui/histsearch.pl @@ -65,6 +65,7 @@ my $isbn = $input->param('isbn'); my $name = $input->param( 'name' ); my $ean = $input->param('ean'); my $basket = $input->param( 'basket' ); +my $basketgroupname = $input->param('basketgroupname'); my $booksellerinvoicenumber = $input->param( 'booksellerinvoicenumber' ); my $do_search = $input->param('do_search') || 0; my $from_placed_on = C4::Dates->new($input->param('from')); @@ -108,6 +109,7 @@ if ($do_search) { to_placed_on => $to_iso, basket => $basket, booksellerinvoicenumber => $booksellerinvoicenumber, + basketgroupname => $basketgroupname, ); } @@ -127,6 +129,7 @@ $template->param( name => $name, basket => $basket, booksellerinvoicenumber => $booksellerinvoicenumber, + basketgroupname => $basketgroupname, from_placed_on => $from_date, to_placed_on => $to_date, DHTMLcalendar_dateformat=> C4::Dates->DHTMLcalendar(), 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 b6875be3ec..ef720e0bd0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt @@ -42,6 +42,10 @@
  • +
  • + + +
  • [% INCLUDE 'date-format.inc' %]
    -- 2.39.5