Main Koha release repository https://koha-community.org
Find a file
Joonas Kylmälä 8a63d78c4b
Bug 27259: Add HomeOrHoldingBranch checks where it was missing from
The TooMany() function and fine calculation functions were incorrectly
hard coded to use homebranch for fetching the circulation rules. Those
ignored completely the syspref HomeOrHoldingBranch where the user
might have set it to holdingbranch and therefore the fines and whether
patron has too many checkouts (TooMany()) were counted using the
unintended branch's rules. This problem only arises in the cases where
there are branch specific circulation rules defined.

Test plan:
1. Make sure following tests pass:
   $ prove t/db_dependent/Circulation/_CalculateAndUpdateFine.t
   $ prove t/db_dependent/Circulation/TooMany.t

Test plan for fines.pl:
1. Add branch specific fine rules for branches A and B. A having a
   fine of 1 per day and B having a fine of 0 per day.
2. Set sysprefs:
   CircControl = the library the items is from
   finesMode = Calculate and charge
   HomeOrHoldingBranch = holdingbranch
3. Create an item with home and holding branch of A
4. Checkout the item with a due date in the past (the past due date can be
   specified by clicking "Checkout settings" in the checkout page) and
   make sure the branch you are checking from is B.
5. Run perl /usr/share/koha/bin/cronjobs/fines.pl
6. Notice that fines have popped up now to the patron incorrectly
7. Apply patch
8. Pay fines, Check-in the item and check it out again
9. Run perl /usr/share/koha/bin/cronjobs/fines.pl
10. Notice that fine is now 0. This means that the branch
    B (holdingbranch of the checked-out item) specific rule is used.

Test plan for staticfines.pl:
1. Add branch specific fine rules for branches A and B. A having a
   fine of 1 per day and B having a fine of 0 per day.
2. Set sysprefs:
   CircControl = the library the items is from
   finesMode = Calculate and charge
   HomeOrHoldingBranch = holdingbranch
3. Create an item with homebranch A and holding branch of A
4. Checkout the item with a due date in the past (the past due date can be
   specified by clicking "Checkout settings" in the checkout page) and
   make sure the branch you are checking from is B.
5. Run perl staticfines.pl --library A --library B --category <PATRONS_CATEGORYCODE>
   and notice that now there is inccorectly fines
6. Apply patch
7. Pay fines, Check-in the item and check it out again
8. Run perl staticfines.pl --library A --library B --category <PATRONS_CATEGORYCODE>
    and notice the fines are now not generated

Rebased-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-11-04 19:04:18 -03:00
acqui Bug 25763: Allow updating of order fund from invoice 2022-10-24 15:30:46 -03:00
admin Bug 21381: (follow-up) fix typo in columns setting yml 2022-11-04 19:01:56 -03:00
api Bug 23012: Show the PROCESSING_FOUND account credit type 2022-10-24 17:43:28 -03:00
authorities
basket
bin
C4 Bug 27259: Add HomeOrHoldingBranch checks where it was missing from 2022-11-04 19:04:18 -03:00
catalogue Bug 31664: Display pending transfer information on details page 2022-11-02 19:18:01 -03:00
cataloguing Bug 31873: Check ->find before calling ->safe_delete 2022-11-03 10:02:55 -03:00
circ Bug 23012: Apply processing fee return policy when lost item found 2022-10-24 17:43:29 -03:00
clubs
course_reserves
debian Bug 25716: (QA follow-up) Move additional options to etc/z3950/config.xml 2022-10-24 13:11:27 -03:00
docs Bug 30808: Add the 22.05 release team. 2022-05-25 23:56:12 -10:00
errors
etc Bug 25716: (QA follow-up) Make sure a comment doesn't break tests 2022-10-24 18:52:35 -03:00
ill
installer Bug 31713: Fix permissions 2022-11-03 15:42:20 -03:00
Koha Bug 29672: (QA follow-up) Add POD 2022-11-03 11:29:43 -03:00
koha-tmpl Bug 31881: Fix search link in MARC view 2022-11-04 19:03:40 -03:00
labels
lib/CGI/Session/Serialize
members Bug 31422: Add patron's current category to dropdown while editing 2022-11-03 09:45:25 -03:00
misc Bug 27259: Add HomeOrHoldingBranch checks where it was missing from 2022-11-04 19:04:18 -03:00
offline_circ Bug 30016: Remove GetOpenIssue subroutine 2022-08-31 08:50:37 -03:00
opac Bug 31963: Only show hold fee msg on OPAC if patron will be charged 2022-11-02 19:40:23 -03:00
patron_lists
patroncards Bug 24001: Fix patron card template edition 2022-04-28 10:49:20 -10:00
plugins
pos Bug 30619: Add email receipt to POS 2022-09-07 15:59:34 -07:00
recalls
reports
reserve Bug 31575: Missing warning for holds where AllowHoldPolicyOverride can be used to force a hold to be placed 2022-10-11 10:12:35 -03:00
reviews Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
rotating_collections
serials
services
skel
suggestion Bug 30718: Use flatpickr's altInput 2022-08-19 08:26:31 -03:00
svc
t Bug 27259: Test HomeOrHoldingBranch usage in _CalculateAndUpdateFine() 2022-11-04 19:04:18 -03:00
tags
tmp/modified_authorities
tools Bug 31590: Remove Text::CSV::Unicode 2022-09-21 16:07:21 -03:00
virtualshelves
xt
.editorconfig
.eslintrc.json
.gitignore
.htaccess Fix file permissions: if it is not a script, it should not be executable. 2010-04-16 00:40:34 -04:00
.mailmap
.perlcriticrc
.proverc.dist
.stylelintrc.json
about.pl
app.psgi
changelanguage.pl
cpanfile Bug 31588: Update cpanfile for new OpenAPI versions (master) 2022-10-21 11:32:51 -03:00
fix-perl-path.PL
gulpfile.js
help.pl
INSTALL
Koha.pm Bug 31713: DBRev 22.06.00.077 2022-11-03 10:36:39 -03:00
koha_perl_deps.pl
kohaversion.pl
LICENSE
mainpage.pl
Makefile.PL
MANIFEST.SKIP
package.json
README
README.md
README.robots
rewrite-config.PL
yarn.lock

Koha is a free software integrated library system (ILS).

Koha is distributed under the GNU GPL version 3 or later.

Note: Koha does not accept pull requests from git hosting sites.

Note: This project has its own bug tracker, to report a bug or submit a patch visit http://bugs.koha-community.org.

For guidelines on submitting patches for Koha please visit https://wiki.koha-community.org/wiki/SubmitingAPatch

The developers handbook can be found at https://wiki.koha-community.org/wiki/Developer_handbook

http://koha-community.org/

Koha Logo