From e2d2c7de2447a0afe8d45907fffc6f1b3949ea71 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 --- 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 9678ffc..9c54368 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -1756,6 +1756,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; @@ -1845,6 +1846,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 7f799b5..e89bcae 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 b6875be..ef720e0 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' %]
    -- 1.7.10.4