[Koha-bugs] [Bug 5789] Fines don't work when items have null homebranch

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Sun May 6 18:26:22 CEST 2018


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=5789

Saiful Amin <saiful at semanticconsulting.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|FIXED                       |---
             Status|RESOLVED                    |REOPENED

--- Comment #6 from Saiful Amin <saiful at semanticconsulting.com> ---
After posting that I thought of changing the status from RESOLVED to something
else, but didn't see any option to modify.

Coming back to testing, it was done on a fresh installation of 17.11.05.000
installed from Debian repo on Ubuntu 17.04, using MariaDB.

- We migrated data from another ILS for all bibs, items, patrons and
circulation transactions.
- There is only one branch for all items and borrowers.
- After migration we checked there are no NULL values in items.homebranch,
issues.branchcode, borrowers.branchcode columns.
- In preferences,
  - Checkout policy 'CircControl' is set to 'ItemHomeLibrary' ("the library the
item is from.")
  - 'item-level_itypes' is set to 'specific item' (1)
  - 'finesMode' set to 'Calculate and charge'

We run this command (copied from cron file):
koha-foreach --chdir --enabled /usr/share/koha/bin/cronjobs/fines.pl

The fines don't get generated and we see this error:

Use of uninitialized value $branchcode in exists at
/usr/share/koha/bin/cronjobs/fines.pl line 115.
No branchcode argument passed to Koha::Calendar->new at
/usr/share/koha/bin/cronjobs/fines.pl line 179.

With the following change:

-         ( $control eq 'ItemHomeLibrary' ) ? $overdue->{homebranch}
+         ( $control eq 'ItemHomeLibrary' ) ? $overdue->{branchcode}

the error goes away and fines are getting calculated.

My comment about 'issues' not containing 'homebranch' was not relevant since I
realize now that the Getoverdues() function left joins the 'item' table (which
contains the 'homebranch').

Should I add a pull request for this so that someone can run other tests?

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the QA Contact for the bug.


More information about the Koha-bugs mailing list