Bug 21159: Update item location on checkout
authorAlex Buckley <alexbuckley@catalyst.net.nz>
Wed, 10 Aug 2022 00:54:20 +0000 (00:54 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Mon, 6 Nov 2023 14:34:48 +0000 (11:34 -0300)
commit81826a7af7c57bdfbe4f7443bfbc0ace7de6a1c5
tree5593a07f9bd3af45cf47401b5cef3a3643840bc5
parent5ef2c565a8d79d607ec5d6a19e742c8b4fbf6cbc
Bug 21159: Update item location on checkout

This patchset shifts the logic for changing the item location on checkin
(controlled by the UpdateItemLocationOnCheckin system preference) to a
new subroutine in Koha/Items.pm

That subroutine logic is shared with the UpdateItemLocationOnCheckout
system preference.

Test plan:
1. Apply patches, update databases and restart services

2. Set the following system preferences:
- UpdateItemLocationOnCheckin:
FIC: PROC

- UpdateItemLocationOnCheckout:
PROC: FIC

3. Checkout an an item with items.location = 'PROC'. Observe it's
location is changed to 'FIC'

4. Return the item. Observe it's location is changed to 'PROC'

5. Change UpdateItemLocationOnCheckout to:
PROC: _BLANK_

6. Issue the item with items.location = 'PROC' and confirm it's location
is blanked on checkout

7. Issue and return an item with a different location e.g. 'REF' (don't
use 'CART' as this is blanked by bug 14576 on checkout).
Observe the location does not change on issue or return.

8. Run unit tests
sudo koha-shell kohadev
prove t/db_dependent/Circulation/issue.t

Sponsored-by: Toi Ohomai Institute of Technology, New Zealand
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
C4/Circulation.pm
Koha/Item.pm
t/db_dependent/Circulation/issue.t