Bug 29220: Minor fixes and improved code readability
authorDavid Gustafsson <glasklas@gmail.com>
Wed, 13 Oct 2021 13:36:43 +0000 (15:36 +0200)
committerAndrew Fuerste-Henry <andrew@bywatersolutions.com>
Sun, 20 Mar 2022 15:42:40 +0000 (15:42 +0000)
commit68f7dbe2fbc58ba2c99fa6a9a910ca01d9730121
treec600ed85f6920dd2b5d2d2d67620ba121d7e748e
parent14a77ce99d4f23e0b83a5201f8ef80669c01ba36
Bug 29220: Minor fixes and improved code readability

The current handling of onsite checkouts with OnSiteCheckoutsForce
syspref enabled is confusing and hard to understand. It's also fragile
with a high risk future changes could result in subtle bugs.

Also fix an inconsistency in which errors (DEBT_GUARANTORS) are considered blocking for
forced onsite checkouts.

To test:
1) Enable OnSiteCheckouts, disable OnSiteCheckoutsForce
2) Edit a biblio item and for example set Not for loan to a value
restricting loans
3) Try to check out the item for some patron
4) A message that item is not for loan should be displayed
5) Select "On-site checkout" and try again
6) The same message should be displayed
7) Try to checkout with some invalid barcode
8) A message that barcode was not found should be displayed
9) Now enable OnSiteCheckoutsForce
10) Try to checkout the item for some patron
11) A message that item is not for loan should be displayed
12) Select "On-site checkout" and try again
13) Checkout should now succeed, no messages should be displayed
14) Try to checkout with some invalid barcode
15) A message that barcode was not found should be displayed
16) All of the above steps should produce the same result with and without this patch

Additional:
Before patch:
 a) Set  NoIssuesChargeGuarantorsWithGuarantees to 1
 b) add a guarantee with another guarantor
 c) charge a 1.01 fine to other guarantor
 d) checkout is blocked due to fines
Apply patch
 e) checkout is allowed when onsite checkouts forced

Sponsored-by: Gothenburg University Library
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit ad5699ea1dc95b4ed22bc56a9615dfcff02a2990)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
circ/circulation.pl