See bug 27834. Thinking here about an alternative approach (without messing up the original report).
Created attachment 189836 [details] [review] Bug 41280: Add check on branchcode of patron_maxissueqty rule Test plan: Still coming
Created attachment 189837 [details] [review] Bug 41280: Add patron library scope to PatronLibrary for branch level rules At the same time bringing both CircControl blocks more in sync by using $branch and a new $prefetch variable.
Created attachment 189838 [details] [review] Bug 41280: Add check on branchcode of patron_maxissueqty rule Test plan: Still coming
Created attachment 189839 [details] [review] Bug 41280: Add patron library scope to PatronLibrary for branch level rules At the same time bringing both CircControl blocks more in sync by using $branch and a new $prefetch variable.
Fixed: Can't call method "branchcode" on unblessed reference at /usr/share/koha/C4/Circulation.pm line 594
Created attachment 189911 [details] [review] Bug 41280: Fix missing branchcode for patron qty rule Since we now want to check if the rule is global or not, we need more than the rule value returned by GetBranchBorrowerCircRule. This highlights another issue in this code (for a new report): the code assumes that there is a regular issue rule on the same level (global or branch) for regular issues when counting onsite issues. Theoretically, this may not be the case. Added FIXMEs.
Opened bug 41290 to have a closer look at circ scope for onsite checkouts. This feels wrong as it is now (too much assumptions).
Before getting further here, I need feedback. After that we can fix tests etc.