@@ -, +, @@ to receive - create a basket. - create an order. - verify the order is not listed on the parcel page (i.e. you cannot receive it). - close the basket. - verify the order is listed on the parcel page. --- C4/Acquisition.pm | 12 +++++++++--- acqui/parcel.pl | 3 ++- 2 files changed, 11 insertions(+), 4 deletions(-) --- a/C4/Acquisition.pm +++ a/C4/Acquisition.pm @@ -1494,6 +1494,7 @@ sub SearchOrders { my $basketgroupname = $params->{basketgroupname}; my $owner = $params->{owner}; my $pending = $params->{pending}; + my $ordered = $params->{ordered}; my $dbh = C4::Context->dbh; my @args = (); @@ -1517,9 +1518,14 @@ sub SearchOrders { WHERE (datecancellationprinted is NULL) }; - $query .= q{ - AND (quantity > quantityreceived OR quantityreceived is NULL) - } if $pending; + if ( $pending ) { + $query .= q{ AND (quantity > quantityreceived OR quantityreceived is NULL)}; + } + if ( $ordered ) { + $query .= q{ AND (quantity > quantityreceived OR quantityreceived is NULL)} + unless $pending; + $query .= q{ AND aqorders.orderstatus IN ( "ordered", "partial" )}; + } my $userenv = C4::Context->userenv; if ( C4::Context->preference("IndependentBranches") ) { --- a/acqui/parcel.pl +++ a/acqui/parcel.pl @@ -219,6 +219,7 @@ unless( defined $invoice->{closedate} ) { ean => $ean, basketgroupname => $basketgroupname, pending => 1, + ordered => 1, }); $template->param( summaryfilter => $search, @@ -230,7 +231,7 @@ unless( defined $invoice->{closedate} ) { }else{ $pendingorders = SearchOrders({ booksellerid => $booksellerid, - pending => 1 + ordered => 1 }); } my $countpendings = scalar @$pendingorders; --