[Koha-bugs] [Bug 8607] overdue_notices is broken

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Sun Aug 12 04:22:43 CEST 2012


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8607

wajasu <matted-34813 at mypacks.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #11497|0                           |1
        is obsolete|                            |

--- Comment #2 from wajasu <matted-34813 at mypacks.net> ---
Created attachment 11561
  -->
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=11561&action=edit
SIGNED-OFF-Bug-8607-FIX-overdues_notices-script-date.patch


AS STAFF:
I set More -> Tools -> Patrons and Circulation -> Overdue notice/status
triggers
   Select a library: Midway
   First
   Student  1  Overdue Notice

which adds a row to the overduerules  table (with branchcode 'MPL'
categorycode='ST' delay1 letter1='ODUE'

I cataloged a biblio with a barcode (so we can check it out)
I set up a borrower Joe Cool who belongs to Midway Branch Library

AS BORROWER:
I signed in as my borrwer Joe
I checked out the cataloged book.
My summary for Joe shows a book checked out.

AS DBA:
To force the book overdue I used mysql to edit the issue.
mysql -uroot -p koha
> select * from issues;      TO FIND THE CHECKED OUT BOOK
> update issues set date_due='2012-08-01 23:59:00' where borrowernumber=51 and itemnumber=1;    CHOOSE ACCORDINGLY (It was due 2012-09-01)

Now I looked at My Summary for Joe, and his checked out book is OVERDUE and
with a red background.

Since the overdue_notice.pl script joins across categories, borrowers, issues
and it must be an exact match if -t trigger method,
I used without -t so the range for the overdue is between 1 and 90 days from
the date_due

I ran my test accordingly:

Before patch: ---------------------------BROKEN
root at biblio:/home/koha/kohaclone/misc/cronjobs# ./overdue_notices.pl -n
DBD::mysql::st execute failed: Unknown column '$date' in 'where clause' at
./overdue_notices.pl line 467.
DBD::mysql::st fetchrow failed: fetch() without execute() at
./overdue_notices.pl line 470.

git am -i -u -3 <pathToPatch>

After patch: ----------------------------FIXED
root at biblio:/home/koha/kohaclone/misc/cronjobs# ./overdue_notices.pl -n
Use of uninitialized value in pattern match (m//) at ./overdue_notices.pl line
672.
Use of uninitialized value in pattern match (m//) at ./overdue_notices.pl line
683.
Dear Joe Cool,

According to our current records, you have items that are overdue.Your library
does not charge late fines, but please return or renew them at the branch below
as soon as possible.

Midway
372 Forest Street

Phone:
Fax:
Email:

If you have registered a password with the library, and you have a renewal
available, you may renew online. If an item becomes more than 30 days overdue,
you will be unable to use your library card until the item is returned.

The following item(s) is/are currently overdue:

"Paul and his theology " by , 227/.06, Barcode: 111 Fine: GBP

Thank-you for your prompt attention to this matter.

Midway Staff

-----------------------------------------

I did not persue other "rules" defaults, since this is a complex rule engine to
test and is out of scope for this fix.
Note: The uninitialized warnings.
Note: Fine: GBP  (when its 0 or not defined)

wajasu

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list