From 5d1bf2ba3ccae5be4240f08aaf3a76895574c440 Mon Sep 17 00:00:00 2001 From: Mathieu Saby Date: Sat, 9 Mar 2013 18:48:12 +0100 Subject: [PATCH] Bug 9560: Add a filter by basketgroup number in receipt page Currently, it is not possible to filter received items using basketgroup number. For libraries using basketgroup, this could be an interesting feature. This patch add a filter by basketgroup number in receipt page. Additionally, it renames "basket" filter into more explicit "basket number" (before, librarians could think the filter take into account basket name), and it move EAN filter (visible only in unimarc flavor) in 2d position. to test: 1. create a basket with some orders 2. close it and put in a basketgroup. Note the number of the basketgroup. 3. try the old and the new filters in reception page --- C4/Acquisition.pm | 8 ++++-- acqui/parcel.pl | 3 ++- .../intranet-tmpl/prog/en/modules/acqui/parcel.tt | 28 +++++++++++--------- 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index 4a9eae6..1d3dd5d 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -819,7 +819,7 @@ sub GetBasketgroups { =head3 GetPendingOrders -$orders = &GetPendingOrders($supplierid,$grouped,$owner,$basketno,$ordernumber,$search,$ean); +$orders = &GetPendingOrders($supplierid,$grouped,$owner,$basketno,$ordernumber,$search,$ean,$basketgroupno); Finds pending orders from the bookseller with the given ID. Ignores completed and cancelled orders. @@ -845,7 +845,7 @@ Results are ordered from most to least recent. =cut sub GetPendingOrders { - my ($supplierid,$grouped,$owner,$basketno,$ordernumber,$search,$ean) = @_; + my ($supplierid,$grouped,$owner,$basketno,$ordernumber,$search,$ean,$basketgroupno) = @_; my $dbh = C4::Context->dbh; my $strsth = " SELECT ".($grouped?"count(*),":"")."aqbasket.basketno, @@ -892,6 +892,10 @@ sub GetPendingOrders { $strsth .= " AND aqbasket.authorisedby=? "; push @query_params, $userenv->{'number'}; } + if ($basketgroupno) { + $strsth .= " AND aqbasket.basketgroupid=? "; + push @query_params, $basketgroupno; + } $strsth .= " group by aqbasket.basketno" if $grouped; $strsth .= " order by aqbasket.basketno"; my $sth = $dbh->prepare($strsth); diff --git a/acqui/parcel.pl b/acqui/parcel.pl index 15578a9..7700a43 100755 --- a/acqui/parcel.pl +++ b/acqui/parcel.pl @@ -220,9 +220,10 @@ if(!defined $invoice->{closedate}) { my $ean = $input->param('eanfilter') || ''; my $basketno = $input->param('basketfilter') || ''; my $orderno = $input->param('orderfilter') || ''; + my $basketgroupno = $input->param('basketgroupfilter') || ''; my $grouped; my $owner; - $pendingorders = GetPendingOrders($booksellerid,$grouped,$owner,$basketno,$orderno,$search,$ean); + $pendingorders = GetPendingOrders($booksellerid,$grouped,$owner,$basketno,$orderno,$search,$ean,$basketgroupno); }else{ $pendingorders = GetPendingOrders($booksellerid); } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt index fae8473..050b6f7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt @@ -374,22 +374,24 @@ - + [% IF (UNIMARC) %] +
  • + + +
  • + [% END %]
  • - - -
  • - + + +
  • - - + + +
  • +
  • + +
  • - [% IF (UNIMARC) %] -
  • - - -
  • - [% END %]
    -- 1.7.9.5