Koha/koha-tmpl/intranet-tmpl/prog/en/modules/circ
Jonathan Druart 9427d44568 Bug 16534: Make CanBookBeIssued test if the issue can be returned
If an issue is already checked out, CanBookBeIssued must check if the
issue can be checked in before processing the return.
In such cases (depending of the AllowReturnToBranch pref), the issue
should not be allowed.

Prior to this patch, the checkin was not done and the checkout failed
with "Duplicate entry '1204321' for key 'itemnumber'". Indeed since bug
14978, there is an uniq key on issues.itemnumber. Before bug 14978 the
issue existed but was hidden (and some weird behaviors certainly
happened!).

To avoid Koha to crash, a check is added to CanBookBeIssued (call to
CanBookBeReturned) and the librarian is not able to process the
checkout.

Test plan:

- Set AllowReturnToBranch to anywhere
- Check an item (homebranch Library 1, holding branch Library 1) out from Library 1
- Check the item out from Library 2
=> Confirm the checkout (should work with and without this patch)

- Set AllowReturnToBranch to holdinbranch ("only the library the item
  was checked out from").
- Check an item (homebranch Library 1, holding branch Library 1) out from Library 1
- Check the item out from Library 2
=> Without this patch, Koha crashed
=> With this patch, you will be warned that the checkin is not possible.

Try other combinations of the AllowReturnToBranch syspref

Followed test plan, works as expected
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-06-24 11:45:00 +00:00
..
bookcount.tt Bug 15927 - Remove use of <tr class="highlight"> for alternating row colors 2016-03-02 22:07:13 +00:00
branchoverdues.tt Revert bug 13618 - "Prevent XSS in the Staff Client and the OPAC" due to performance issues 2016-02-11 19:39:53 +00:00
branchtransfers.tt Revert bug 13618 - "Prevent XSS in the Staff Client and the OPAC" due to performance issues 2016-02-11 19:39:53 +00:00
circulation-home.tt Bug 16225 - Extra closing quote in circulation home page template 2016-04-22 23:02:02 +00:00
circulation.tt Bug 16534: Make CanBookBeIssued test if the issue can be returned 2016-06-24 11:45:00 +00:00
circulation_batch_checkouts.tt Bug 15919: Batch checkout - Display the due date 2016-05-06 04:08:20 +00:00
offline-mf.tt Bug 16242 - Move staff client JavaScript out of language directory 2016-04-29 14:32:42 +00:00
offline.tt Bug 16242 [Follow-up] Move staff client JavaScript out of language directory 2016-04-29 14:32:42 +00:00
on-site_checkouts.tt Bug 16241 - Move staff client CSS out of language directory 2016-04-29 13:54:37 +00:00
overdue.tt Revert bug 13618 - "Prevent XSS in the Staff Client and the OPAC" due to performance issues 2016-02-11 19:39:53 +00:00
pendingreserves.tt Bug 16241 - Move staff client CSS out of language directory 2016-04-29 13:54:37 +00:00
printslip.tt Bug 16218: printfeercpt.tt (and others) does not include jQuery 2016-04-29 14:14:54 +00:00
renew.tt Bug 15821: Use Font Awesome icons in confirmation dialogs - Circulation 2016-03-02 03:52:01 +00:00
reserveratios.tt Bug 16241 - Move staff client CSS out of language directory 2016-04-29 13:54:37 +00:00
returns.tt Bug 9543: Separate MTT with commas 2016-06-03 08:47:48 +00:00
selectbranchprinter.tt Revert bug 13618 - "Prevent XSS in the Staff Client and the OPAC" due to performance issues 2016-02-11 19:39:53 +00:00
transfer-slip.tt Revert bug 13618 - "Prevent XSS in the Staff Client and the OPAC" due to performance issues 2016-02-11 19:39:53 +00:00
transferstoreceive.tt Bug 16241 - Move staff client CSS out of language directory 2016-04-29 13:54:37 +00:00
view_holdsqueue.tt Bug 16241 - Move staff client CSS out of language directory 2016-04-29 13:54:37 +00:00
waitingreserves.tt Bug 16241 - Move staff client CSS out of language directory 2016-04-29 13:54:37 +00:00