Created attachment 38702 [details] status pull down You can do all statuses except cancelled or individual statuses but not all statuses.
*** Bug 30919 has been marked as a duplicate of this bug. ***
Created attachment 155851 [details] [review] Bug 14092: Add 'any status' option to acq order search form Sometimes it's really helpful to see all orders for a basket, a vendor or a standing order, including the cancelled ones. Currently this is not possible, as we have search options for every single status and one for "any except cancelled", but no "Any status" option. This patch adds the "Any status" option. The sometimes appearing empty entry is updated to "Any status except cancelled" as this is what it does. Testing data: * Requires multiple order lines with different order status * Must include at least one order line with status 'cancelled' To test: * Go to acquisitions * Open the advanced search page from the top search options: Order search > config icon > Advanced search link * Verify the status pull down looks as described above * Apply patch * Verify there is now an "Any status" option in the pull down * Try searches for different status, including "Any status" * Verify the results are as expected * Create a new basket * Create an order line by 'From an existing order (copy)' * Verify the search form there also works as expected
Created attachment 155853 [details] [review] Bug 14092: Add 'any status' option to acq order search form Sometimes it's really helpful to see all orders for a basket, a vendor or a standing order, including the cancelled ones. Currently this is not possible, as we have search options for every single status and one for "any except cancelled", but no "Any status" option. This patch adds the "Any status" option. The sometimes appearing empty entry is updated to "Any status except cancelled" as this is what it does. Testing data: * Requires multiple order lines with different order status * Must include at least one order line with status 'cancelled' To test: * Go to acquisitions * Open the advanced search page from the top search options: Order search > config icon > Advanced search link * Verify the status pull down looks as described above * Apply patch * Verify there is now an "Any status" option in the pull down * Try searches for different status, including "Any status" * Verify the results are as expected * Create a new basket * Create an order line by 'From an existing order (copy)' * Verify the search form there also works as expected
I tried to find a good way of making this change, while meeting some requirements: * I wanted "Any status" to be an additional entry in the status pull down, not a checkbox or similar on the form * We need to make sure that the right status is always selected, especially after completing the search, so it shows correctly in the filters on the right
Created attachment 156093 [details] [review] Bug 14092: Add 'any status' option to acq order search form Sometimes it's really helpful to see all orders for a basket, a vendor or a standing order, including the cancelled ones. Currently this is not possible, as we have search options for every single status and one for "any except cancelled", but no "Any status" option. This patch adds the "Any status" option. The sometimes appearing empty entry is updated to "Any status except cancelled" as this is what it does. Testing data: * Requires multiple order lines with different order status * Must include at least one order line with status 'cancelled' To test: * Go to acquisitions * Open the advanced search page from the top search options: Order search > config icon > Advanced search link * Verify the status pull down looks as described above * Apply patch * Verify there is now an "Any status" option in the pull down * Try searches for different status, including "Any status" * Verify the results are as expected * Create a new basket * Create an order line by 'From an existing order (copy)' * Verify the search form there also works as expected Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Created attachment 156097 [details] [review] Bug 14092: Add 'any status' option to acq order search form Sometimes it's really helpful to see all orders for a basket, a vendor or a standing order, including the cancelled ones. Currently this is not possible, as we have search options for every single status and one for "any except cancelled", but no "Any status" option. This patch adds the "Any status" option. The sometimes appearing empty entry is updated to "Any status except cancelled" as this is what it does. Testing data: * Requires multiple order lines with different order status * Must include at least one order line with status 'cancelled' To test: * Go to acquisitions * Open the advanced search page from the top search options: Order search > config icon > Advanced search link * Verify the status pull down looks as described above * Apply patch * Verify there is now an "Any status" option in the pull down * Try searches for different status, including "Any status" * Verify the results are as expected * Create a new basket * Create an order line by 'From an existing order (copy)' * Verify the search form there also works as expected
Created attachment 156098 [details] [review] Bug 14092: (QA follow-up) Avoid fiddling with he hash in the template
Created attachment 156100 [details] [review] Bug 14092: Add 'any status' option to acq order search form Sometimes it's really helpful to see all orders for a basket, a vendor or a standing order, including the cancelled ones. Currently this is not possible, as we have search options for every single status and one for "any except cancelled", but no "Any status" option. This patch adds the "Any status" option. The sometimes appearing empty entry is updated to "Any status except cancelled" as this is what it does. Testing data: * Requires multiple order lines with different order status * Must include at least one order line with status 'cancelled' To test: * Go to acquisitions * Open the advanced search page from the top search options: Order search > config icon > Advanced search link * Verify the status pull down looks as described above * Apply patch * Verify there is now an "Any status" option in the pull down * Try searches for different status, including "Any status" * Verify the results are as expected * Create a new basket * Create an order line by 'From an existing order (copy)' * Verify the search form there also works as expected
Created attachment 156101 [details] [review] Bug 14092: (QA follow-up) Avoid fiddling with he hash in the template prove t/db_dependent/Acquisition.t
This is much better! One final thing: + $orders = GetHistory( order_status => "new", vendornote => 'status search' ); + is( scalar(@$orders), 1, 'GetHistory with order status "new" returns 1 order' ); + + my $orders = GetHistory( get_canceled_order => 1, order_status => "any", vendornote => 'status search' ); + is( scalar(@$orders), 2, 'GetHistory with order status "any" returns all orders' ); + + $orders = GetHistory( order_status => "", vendornote => 'status search' ); + is( scalar(@$orders), 1, 'GetHistory with order status "all except cancelled" returns zero orders' ); The last test does not read very well. If orders == 1 then it returns 0 orders?? Please adjust. No big blocker but you assume that there are no orders in the system when you get a count. So your test may very well fail with some orders being there. Since you created a new basket, you could also pass the param basket to GetHistory [my $basket = $params{basket} ]. Which would resolve the issue with other orders. GetHistory( basket => $order_basket->{basketno}, etc.
diff --git a/t/db_dependent/Acquisition.t b/t/db_dependent/Acquisition.t index d102a343a0..a5a165d777 100755 --- a/t/db_dependent/Acquisition.t +++ b/t/db_dependent/Acquisition.t @@ -995,13 +995,13 @@ subtest 'GetHistory status search' => sub { }; $order = $builder->build( { source => 'Aqorder', value => $orderinfo2 } ); - $orders = GetHistory( order_status => "new", vendornote => 'status search' ); + $orders = GetHistory( basket => $order_basket->{basketno}, order_status => "new", vendornote => 'status search' ); is( scalar(@$orders), 1, 'GetHistory with order status "new" returns 1 order' ); - my $orders = GetHistory( get_canceled_order => 1, order_status => "any", vendornote => 'status search' ); + my $orders = GetHistory( basket => $order_basket->{basketno}, get_canceled_order => 1, order_status => "any", vendornote => 'status search' ); is( scalar(@$orders), 2, 'GetHistory with order status "any" returns all orders' ); - $orders = GetHistory( order_status => "", vendornote => 'status search' ); + $orders = GetHistory( basket => $order_basket->{basketno}, order_status => "", vendornote => 'status search' ); is( scalar(@$orders), 1, 'GetHistory with order status "all except cancelled" returns zero orders' ); };
Patches may be squashed.
Note to myself: instead of note we could use the basketno.
Created attachment 156526 [details] [review] Bug 14092: Add 'any status' option to acq order search form Sometimes it's really helpful to see all orders for a basket, a vendor or a standing order, including the cancelled ones. Currently this is not possible, as we have search options for every single status and one for "any except cancelled", but no "Any status" option. This patch adds the "Any status" option. The sometimes appearing empty entry is updated to "Any status except cancelled" as this is what it does. Testing data: * Requires multiple order lines with different order status * Must include at least one order line with status 'cancelled' To test: * Go to acquisitions * Open the advanced search page from the top search options: Order search > config icon > Advanced search link * Verify the status pull down looks as described above * Apply patch * Verify there is now an "Any status" option in the pull down * Try searches for different status, including "Any status" * Verify the results are as expected * Create a new basket * Create an order line by 'From an existing order (copy)' * Verify the search form there also works as expected
Created attachment 156527 [details] [review] Bug 14092: (QA follow-up) Avoid fiddling with the hash in the template prove t/db_dependent/Acquisition.t
Hi Marcel, ready for another go. As you suggested a squash I added my follow-up into the last patch: * Corrected the unit test result message * Removed the vendor_note as 'identifier' for the order lines in favor of the basketno
Created attachment 156590 [details] [review] Bug 14092: Add 'any status' option to acq order search form Sometimes it's really helpful to see all orders for a basket, a vendor or a standing order, including the cancelled ones. Currently this is not possible, as we have search options for every single status and one for "any except cancelled", but no "Any status" option. This patch adds the "Any status" option. The sometimes appearing empty entry is updated to "Any status except cancelled" as this is what it does. Testing data: * Requires multiple order lines with different order status * Must include at least one order line with status 'cancelled' To test: * Go to acquisitions * Open the advanced search page from the top search options: Order search > config icon > Advanced search link * Verify the status pull down looks as described above * Apply patch * Verify there is now an "Any status" option in the pull down * Try searches for different status, including "Any status" * Verify the results are as expected * Create a new basket * Create an order line by 'From an existing order (copy)' * Verify the search form there also works as expected Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 156591 [details] [review] Bug 14092: (QA follow-up) Avoid fiddling with the hash in the template prove t/db_dependent/Acquisition.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
*** Bug 23014 has been marked as a duplicate of this bug. ***
Pushed to master for 23.11. Nice work everyone, thanks!
Enhancement not pushed to 23.05.x
The orders advanced search is already documented in the manual, without specifying details and options of each field. I will close this.