Bug 41265

Summary: NoIssuesChargeGuarantees and NoIssuesChargeGuarantorsWithGuarantees circulation checks not precise enough
Product: Koha Reporter: Thibaud Guillot (thibaud_g) <thibaud.guillot>
Component: CirculationAssignee: Bugs List <koha-bugs>
Status: Needs Signoff --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: gmcharlt, kyle
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39261
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 41265: Checks if NoIssuesChargeGuarantees && NoIssuesChargeGuarantorsWithGuarantees sysprefs limits are not empty

Description Thibaud Guillot (thibaud_g) 2025-11-18 15:57:42 UTC
Hello all

When a checkout is performed, the NoIssuesChargeGuarantees and NoIssuesChargeGuarantorsWithGuarantees values are checked. This is an ‘if’ statement with check values, but by default, these are empty strings and therefore defined in this way. I therefore believe that the verification is not exactly what we want, particularly when SIP performs the checkout without permission to force it.

Furthermore, in kohastructure, the default value would be NULL from what I understand, and it has not been included in the syprefs sql file. Perhaps there are some cases that I am overlooking, but I will suggest a simple fix anyway.
Comment 1 Thibaud Guillot (thibaud_g) 2025-11-18 15:59:17 UTC
I added Bug 39261 which also deals with the format of these sysprefs
Comment 2 Thibaud Guillot (thibaud_g) 2025-11-19 08:45:50 UTC
Created attachment 189694 [details] [review]
Bug 41265: Checks if NoIssuesChargeGuarantees && NoIssuesChargeGuarantorsWithGuarantees sysprefs limits are not empty

Test plan:

1) Create relation between guarantor and guarantees
2) Be sure that one (or both) has outstanding charges
3) Be sure that concerning sysprefs are "empty" / not defined
4) Perform a checkout
5) A warning appears normally, you can fore checkout if you have enough
   permission
6) Apply this patch
7) Repeat step 4), no warning appears

Sponsored-by: BibLibre