[Koha-bugs] [Bug 26582] Add Koha::Acquisition::Basket->close

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Sep 30 19:48:50 CEST 2020


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26582

--- Comment #2 from Tomás Cohen Arazi <tomascohen at gmail.com> ---
Created attachment 111004
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=111004&action=edit
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

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list