Bugzilla – Attachment 59378 Details for
Bug 17952
Lost items not skipped by overdue_notices.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17952 - Lost items not skipped by overdue_notices.pl
Bug-17952---Lost-items-not-skipped-by-overduenotic.patch (text/plain), 3.28 KB, created by
Kyle M Hall (khall)
on 2017-01-20 14:44:01 UTC
(
hide
)
Description:
Bug 17952 - Lost items not skipped by overdue_notices.pl
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2017-01-20 14:44:01 UTC
Size:
3.28 KB
patch
obsolete
>From 73f1e1b03f393de66c9c5a8bb2100b7519aac756 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 20 Jan 2017 14:43:24 +0000 >Subject: [PATCH] Bug 17952 - Lost items not skipped by overdue_notices.pl > >If a library does not use --mark-returned when running longoverdue.pl, >all those lost item checkouts are selected by overdue_notices.pl. >This causes much unnecessary overhead. In addition Koha::Calendar is >instantiated many times for each branchcode which is not necessary. > >Test Plan: >1) Run overdue_notices.pl, note output >2) Apply this patch >3) Run overdue_notices.pl again, note output is the same >--- > misc/cronjobs/overdue_notices.pl | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > >diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl >index 0aaf22a..cb95ee5 100755 >--- a/misc/cronjobs/overdue_notices.pl >+++ b/misc/cronjobs/overdue_notices.pl >@@ -443,8 +443,9 @@ elsif ( defined $text_filename ) { > } > > foreach my $branchcode (@branches) { >+ my $calendar; > if ( C4::Context->preference('OverdueNoticeCalendar') ) { >- my $calendar = Koha::Calendar->new( branchcode => $branchcode ); >+ $calendar = Koha::Calendar->new( branchcode => $branchcode ); > if ( $calendar->is_holiday($date_to_run) ) { > next; > } >@@ -466,7 +467,8 @@ SELECT biblio.*, items.*, issues.*, biblioitems.itemtype, branchname > AND biblio.biblionumber = biblioitems.biblionumber > AND issues.borrowernumber = ? > AND issues.branchcode = ? >- AND TO_DAYS($date)-TO_DAYS(issues.date_due) >= 0 >+ AND items.itemlost = 0 >+/ AND TO_DAYS($date)-TO_DAYS(issues.date_due) >= 0 > END_SQL > > my $query = "SELECT * FROM overduerules WHERE delay1 IS NOT NULL AND branchcode = ? "; >@@ -514,9 +516,11 @@ END_SQL > > my $borrower_sql = <<"END_SQL"; > SELECT issues.borrowernumber, firstname, surname, address, address2, city, zipcode, country, email, emailpro, B_email, smsalertnumber, phone, cardnumber, date_due >-FROM issues,borrowers,categories >+FROM issues,borrowers,categories,items > WHERE issues.borrowernumber=borrowers.borrowernumber > AND borrowers.categorycode=categories.categorycode >+AND issues.itemnumber = items.itemnumber >+AND items.itemlost = 0 > AND TO_DAYS($date)-TO_DAYS(issues.date_due) >= 0 > END_SQL > my @borrower_parameters; >@@ -542,8 +546,6 @@ END_SQL > my $days_between; > if ( C4::Context->preference('OverdueNoticeCalendar') ) > { >- my $calendar = >- Koha::Calendar->new( branchcode => $branchcode ); > $days_between = > $calendar->days_between( dt_from_string($data->{date_due}), > $date_to_run ); >@@ -626,8 +628,6 @@ END_SQL > my $exceededPrintNoticesMaxLines = 0; > while ( my $item_info = $sth2->fetchrow_hashref() ) { > if ( C4::Context->preference('OverdueNoticeCalendar') ) { >- my $calendar = >- Koha::Calendar->new( branchcode => $branchcode ); > $days_between = > $calendar->days_between( > dt_from_string( $item_info->{date_due} ), $date_to_run ); >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 17952
:
59378
|
59551
|
62928
|
62984