This method should implement the current behaviour: - Mark all open orders as 'requested' - Mark the basket as closed
Created attachment 111003 [details] [review] Bug 26582: Unit tests
Created attachment 111004 [details] [review] Bug 26582: Add Koha::Acquisition::Basket->close This patch adds two methods to Koha::Acquisition::Basket: - 'closed': that tells if the basket is closed - 'close': that closes the basket It inherits the behaviour from CloseBasket (as it actually makes sense). It improves CloseBasket by wrapping the action inside a transaction. It uses the $orders->update call with no_trigger as there's no trigger to trigger and the update can be done on a single DB call. A new exceptions file is added for basket-related exceptions. The only specific exception that gets added is Koha::Exceptions::Acquisition::Basket::AlreadyClosed To test: 1. Apply this patches 2. Run: $ kshell k$ prove t/db_dependent/Koha/Acquisition/Basket.t => SUCCESS: Tests pass! 3. Sign off :-D
Created attachment 111032 [details] [review] Bug 26582: Unit tests Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 111033 [details] [review] Bug 26582: Add Koha::Acquisition::Basket->close This patch adds two methods to Koha::Acquisition::Basket: - 'closed': that tells if the basket is closed - 'close': that closes the basket It inherits the behaviour from CloseBasket (as it actually makes sense). It improves CloseBasket by wrapping the action inside a transaction. It uses the $orders->update call with no_trigger as there's no trigger to trigger and the update can be done on a single DB call. A new exceptions file is added for basket-related exceptions. The only specific exception that gets added is Koha::Exceptions::Acquisition::Basket::AlreadyClosed To test: 1. Apply this patches 2. Run: $ kshell k$ prove t/db_dependent/Koha/Acquisition/Basket.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Works as expected, tests pass.. QA Script throws a false failure (POD). Signing off
Created attachment 111528 [details] [review] Bug 26582: Unit tests Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 111529 [details] [review] Bug 26582: Add Koha::Acquisition::Basket->close This patch adds two methods to Koha::Acquisition::Basket: - 'closed': that tells if the basket is closed - 'close': that closes the basket It inherits the behaviour from CloseBasket (as it actually makes sense). It improves CloseBasket by wrapping the action inside a transaction. It uses the $orders->update call with no_trigger as there's no trigger to trigger and the update can be done on a single DB call. A new exceptions file is added for basket-related exceptions. The only specific exception that gets added is Koha::Exceptions::Acquisition::Basket::AlreadyClosed To test: 1. Apply this patches 2. Run: $ kshell k$ prove t/db_dependent/Koha/Acquisition/Basket.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
"closed" should be "is_closed" (and we need a guideline for this).
Created attachment 111748 [details] [review] Bug 26582: (QA follow-up) Rename closed => is_closed Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Pushed to master for 20.11, thanks to everybody involved!
enhancement will not be backported to 20.05.x