From c4fe230a1c28726085da06bea48e090beb4cd861 Mon Sep 17 00:00:00 2001 From: Amit Gupta Date: Tue, 13 Aug 2013 10:44:04 +0530 Subject: [PATCH] [SIGNED-OFF] Bug 10530 - PO number search Content-Type: text/plain; charset="utf-8" Ability to search the purchase order Test plan: 1) Create an basket 2) Create an order 3) Click on order search link and click on plus symbol 4) Purchase order no input box will come give the no and click on sumbit 5) Click on Advance search link search order screen will appear enter value in the purcahse ordernumber textbox. Signed-off-by: Owen Leonard Made minor edit during signoff: Changed "ordernumber" in table header to "order number." --- C4/Acquisition.pm | 9 ++++++++- acqui/histsearch.pl | 3 +++ .../prog/en/includes/acquisitions-search.inc | 1 + .../prog/en/modules/acqui/histsearch.tt | 6 ++++++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index 74aae85..6695453 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -1942,6 +1942,7 @@ sub GetHistory { my $from_placed_on = $params{from_placed_on}; my $to_placed_on = $params{to_placed_on}; my $basket = $params{basket}; + my $purchaseordernumber = $params{purchaseordernumber}; my $booksellerinvoicenumber = $params{booksellerinvoicenumber}; my $basketgroupname = $params{basketgroupname}; my @order_loop; @@ -1970,7 +1971,8 @@ sub GetHistory { aqorders.invoiceid, aqinvoices.invoicenumber, aqbooksellers.id as id, - aqorders.biblionumber + aqorders.biblionumber, + aqorders.purchaseordernumber FROM aqorders LEFT JOIN aqbasket ON aqorders.basketno=aqbasket.basketno LEFT JOIN aqbasketgroups ON aqbasket.basketgroupid=aqbasketgroups.id @@ -2035,6 +2037,11 @@ sub GetHistory { push @query_params, "%$booksellerinvoicenumber%"; } + if ($purchaseordernumber) { + $query .= " AND aqorders.purchaseordernumber LIKE ? "; + push @query_params, "%$purchaseordernumber%"; + } + if ($basketgroupname) { $query .= " AND aqbasketgroups.name LIKE ? "; push @query_params, "%$basketgroupname%"; diff --git a/acqui/histsearch.pl b/acqui/histsearch.pl index 971fc18..012ce43 100755 --- a/acqui/histsearch.pl +++ b/acqui/histsearch.pl @@ -67,6 +67,7 @@ my $ean = $input->param('ean'); my $basket = $input->param( 'basket' ); my $basketgroupname = $input->param('basketgroupname'); my $booksellerinvoicenumber = $input->param( 'booksellerinvoicenumber' ); +my $purchaseordernumber = $input->param( 'purchaseordernumber' ); my $do_search = $input->param('do_search') || 0; my $from_placed_on = C4::Dates->new($input->param('from')); my $to_placed_on = C4::Dates->new($input->param('to')); @@ -110,6 +111,7 @@ if ($do_search) { basket => $basket, booksellerinvoicenumber => $booksellerinvoicenumber, basketgroupname => $basketgroupname, + purchaseordernumber => $purchaseordernumber, ); } @@ -129,6 +131,7 @@ $template->param( name => $name, basket => $basket, booksellerinvoicenumber => $booksellerinvoicenumber, + purchaseordernumber => $purchaseordernumber, basketgroupname => $basketgroupname, from_placed_on => $from_date, to_placed_on => $to_date, diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-search.inc index 5aebf54..d449e1e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-search.inc @@ -20,6 +20,7 @@ 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 4132edb..3c1a31c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt @@ -49,6 +49,10 @@ +
  • + + +
  • [% INCLUDE 'date-format.inc' %]
    @@ -71,6 +75,7 @@ Basket group Invoice number Order number + Purchase ordernumber Summary Vendor Placed on @@ -97,6 +102,7 @@ [% END %] [% suggestions_loo.ordernumber %] + [% suggestions_loo.purchaseordernumber %] [% suggestions_loo.title |html %]
    [% suggestions_loo.author %]
    [% suggestions_loo.isbn %] [% suggestions_loo.name %] -- 1.7.9.5