basketno => $basketno,
owner => $owner,
pending => $pending
+ ordered => $ordered
});
Searches for orders.
C<$owner> Finds order for the logged in user.
C<$pending> Finds pending orders. Ignores completed and cancelled orders.
+C<$ordered> Finds orders to receive only (status 'ordered' or 'partial').
C<@results> is an array of references-to-hash with the keys are fields
WHERE (datecancellationprinted is NULL)
};
- if ( $pending ) {
+ if ( $pending or $ordered ) {
$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" )};
}
use C4::Bookseller qw( GetBookSellerFromId );
-use Test::More tests => 64;
+use Test::More tests => 66;
BEGIN {
use_ok('C4::Acquisition');
"SearchOrders with pending params gets only pending orders (bug 10723)"
);
+$search_orders = SearchOrders({
+ booksellerid => $booksellerid,
+ basketno => $basketno,
+ pending => 1,
+ ordered => 1,
+});
+is( scalar (@$search_orders), 0, "SearchOrders with pending and ordered params gets only pending ordered orders (bug 11170)" );
+
+
#
# Test GetBudgetByOrderNumber
#
is( join( " ", @$test_different_fields ),
'', "GetLateOrders gets orders with the right content in every fields" );
+$search_orders = SearchOrders({
+ booksellerid => $booksellerid,
+ basketno => $basketno,
+ pending => 1,
+ ordered => 1,
+});
+is( scalar (@$search_orders), 3, "SearchOrders with pending and ordered params gets only pending ordered orders. After closing the basket, orders are marked as 'ordered' (bug 11170)" );
+
+
#
# Test AddClaim
#