Koha/C4
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
..
AuthoritiesMarc
Barcodes Bug 30718: Use flatpickr's altInput 2022-08-19 08:26:31 -03:00
ClassSortRoutine
ClassSplitRoutine
Creators
External
Form
Heading Bug 30218: Add subfield g to field 150 in C4::Heading::MARC21 mappings 2022-08-19 15:45:09 -03:00
ILSDI Bug 31177: Fix misplaced import in C4::ILSDI::Services 2022-08-31 14:28:28 -03:00
Installer
Labels
Linker Bug 30280: Add support for subject headings from different thesaurus when using Elasticsearch 2022-10-03 10:00:04 -03:00
Members
OAI Bug 30308: Fix bulkmarcimport.pl broken by OAI-PMH:AutoUpdateSets(EmbedItemData) 2022-07-29 15:43:39 -03:00
Output
Patroncards
Reports Bug 30718: Use flatpickr's altInput 2022-08-19 08:26:31 -03:00
Search Bug 30718: Use flatpickr's altInput 2022-08-19 08:26:31 -03:00
Serials
SIP Bug 31552: SIP2 option format_due_date not honored for AH field in item information response 2022-10-12 14:56:57 -03:00
Utils
Accounts.pm Bug 29184: Fix warn about undefined replacecost 2022-09-08 10:50:30 -07:00
Acquisition.pm Bug 31115: Add additional_attributes support to GetInvoices 2022-10-24 14:11:07 -03:00
Auth.pm Bug 32066: Check 2FA pref in check_cookie_auth 2022-11-04 19:02:38 -03:00
Auth_cas_servers.yaml.sample
Auth_with_cas.pm Bug 27342: Remove dbh from C4::Auth 2022-08-16 10:45:41 -03:00
Auth_with_ldap.pm Bug 30646: (follow-up) Set to send immediately 2022-10-03 14:02:40 -03:00
Auth_with_shibboleth.pm Bug 30646: (follow-up) Set to send immediately 2022-10-03 14:02:40 -03:00
AuthoritiesMarc.pm Bug 19693: (QA follow-up) Replace changed tag test 2022-10-24 17:20:26 -03:00
BackgroundJob.pm
Barcodes.pm
Biblio.pm Bug 30025: Split BiblioAddsAuthorities into two sysprefs 2022-09-16 16:48:30 -03:00
Breeding.pm
Budgets.pm Bug 27550: "Duplicate budget" does not keep users associated with that budget 2022-09-22 08:18:33 -03:00
Calendar.pm
Charset.pm
Circulation.pm Bug 27259: Add HomeOrHoldingBranch checks where it was missing from 2022-11-04 19:04:18 -03:00
ClassSortRoutine.pm
ClassSource.pm
ClassSplitRoutine.pm
Context.pm Bug 31614: Adds a koha-conf.xml config to set Zebra connection timeout 2022-10-12 09:10:07 -03:00
Contract.pm
CourseReserves.pm Bug 30016: Remove GetOpenIssue subroutine 2022-08-31 08:50:37 -03:00
Creators.pm
Heading.pm Bug 30280: (follow-up) Removing tab character in Heading.pm 2022-10-03 10:00:08 -03:00
HoldsQueue.pm Bug 29196: (Bug 27068 follow-up) - Remove unnecessary check 2022-10-03 13:39:30 -03:00
HTML5Media.pm
ImportBatch.pm Bug 27421: (QA follow-up) BatchCommitImportRecords needs param for skipping commits 2022-09-19 15:14:59 -03:00
ImportExportFramework.pm
InstallAuth.pm
Installer.pm Bug 29673: Allow English sql localization script 2022-08-16 10:24:41 -03:00
ItemCirculationAlertPreference.pm
Items.pm Bug 31437: (bug 30718 follow-up) Prevent useless indexation call from ModDateLastSeen 2022-10-14 09:25:10 -03:00
Koha.pm
Labels.pm
Languages.pm
Letters.pm Bug 31626: Add letter id to the message queue table 2022-10-18 09:41:41 -03:00
Linker.pm
Log.pm Bug 31203: Add End action to cronjobs and log viewer 2022-10-05 16:12:55 -03:00
MarcModificationTemplates.pm
Matcher.pm Bug 28290: Don't send subfields to 'as_string' if none to send 2022-09-07 13:50:21 -07:00
Members.pm Bug 30718: Use flatpickr's altInput 2022-08-19 08:26:31 -03:00
Message.pm
Output.pm Bug 30969: Cross site scripting (XSS) attack in OPAC authority search ( opac-authorities-home.pl ) 2022-07-25 11:18:11 -03:00
Overdues.pm Bug 27259: Add HomeOrHoldingBranch checks where it was missing from 2022-11-04 19:04:18 -03:00
Patroncards.pm
Record.pm Bug 29697: Fix t/db_dependent/Exporter/Record.t 2022-07-25 09:30:35 -03:00
Reports.pm
Reserves.pm Bug 31963: Only show hold fee msg on OPAC if patron will be charged 2022-11-02 19:40:23 -03:00
Ris.pm
RotatingCollections.pm
Scheduler.pm
Scrubber.pm
Search.pm Bug 17170: Add the ability to create 'saved searches' for use as filters when searching the catalog 2022-10-21 11:15:18 -03:00
Serials.pm Bug 30718: Use flatpickr's altInput 2022-08-19 08:26:31 -03:00
Service.pm
ShelfBrowser.pm
SMS.pm
SocialData.pm
Stats.pm Bug 7021: Terminology - usercode -> categorycode 2022-09-22 09:31:28 -03:00
Suggestions.pm
Tags.pm
Templates.pm Bug 31390: Remove noisy warns in C4::Templates 2022-08-22 13:25:00 -03:00
TmplToken.pm
TmplTokenType.pm
TTParser.pm
UsageStats.pm Bug 30025: Replace AllowManualAuthorityEditing with RequireChoosingExistingAuthority 2022-09-16 16:48:34 -03:00
XISBN.pm
XSLT.pm Bug 28375: (follow-up) Use C4::Context->interface 2022-10-20 11:50:53 -03:00