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

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Oct 13 13:18:46 CEST 2020


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

Katrin Fischer <katrin.fischer at bsz-bw.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #111033|0                           |1
        is obsolete|                            |

--- Comment #7 from Katrin Fischer <katrin.fischer at bsz-bw.de> ---
Created attachment 111529
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=111529&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

Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83 at web.de>

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


More information about the Koha-bugs mailing list