Bugzilla – Attachment 30403 Details for
Bug 8687
Improvements in overdue_notices.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8687 - Improvements in overdue_notices.pl
Bug-8687---Improvements-in-overduenoticespl.patch (text/plain), 4.54 KB, created by
simith.doliveira
on 2014-07-31 13:42:40 UTC
(
hide
)
Description:
Bug 8687 - Improvements in overdue_notices.pl
Filename:
MIME Type:
Creator:
simith.doliveira
Created:
2014-07-31 13:42:40 UTC
Size:
4.54 KB
patch
obsolete
>From 50543ec8010480e7631976dee947e3177a494780 Mon Sep 17 00:00:00 2001 >From: simith <simith@inlibro.com> >Date: Thu, 31 Jul 2014 09:29:17 -0400 >Subject: [PATCH] Bug 8687 - Improvements in overdue_notices.pl > >Improvements in the overdue_notices.pl script >--- > misc/cronjobs/overdue_notices.pl | 19 +++++++++++++------ > 1 file changed, 13 insertions(+), 6 deletions(-) > >diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl >index 943c486..8c7d809 100755 >--- a/misc/cronjobs/overdue_notices.pl >+++ b/misc/cronjobs/overdue_notices.pl >@@ -378,7 +378,7 @@ if ( defined $csvfilename ) { > } else { > open $csv_fh, ">", $csvfilename or die "unable to open $csvfilename: $!"; > } >- if ( $csv->combine(qw(name surname address1 address2 zipcode city country email itemcount itemsinfo)) ) { >+ if ( $csv->combine(qw(name surname address1 address2 zipcode city country email phone cardnumber itemcount itemsinfo branchname letternumber)) ) { > print $csv_fh $csv->string, "\n"; > } else { > $verbose and warn 'combine failed on argument: ' . $csv->error_input; >@@ -392,11 +392,12 @@ if ( defined $htmlfilename ) { > $fh = *STDOUT; > } else { > my $today = DateTime->now(time_zone => C4::Context->tz ); >- open $fh, ">",File::Spec->catdir ($htmlfilename,"notices-".$today->ymd().".html"); >+ open $fh, ">:encoding(UTF-8)",File::Spec->catdir ($htmlfilename,"notices-".$today->ymd().".html"); > } > > print $fh "<html>\n"; > print $fh "<head>\n"; >+ print $fh "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n"; > print $fh "<style type='text/css'>\n"; > print $fh "pre {page-break-after: always;}\n"; > print $fh "pre {white-space: pre-wrap;}\n"; >@@ -425,10 +426,11 @@ foreach my $branchcode (@branches) { > $verbose and warn sprintf "branchcode : '%s' using %s\n", $branchcode, $admin_email_address; > > my $sth2 = $dbh->prepare( <<"END_SQL" ); >-SELECT biblio.*, items.*, issues.*, biblioitems.itemtype, TO_DAYS($date)-TO_DAYS(date_due) AS days_overdue >- FROM issues,items,biblio, biblioitems >+SELECT biblio.*, items.*, issues.*, biblioitems.itemtype, TO_DAYS($date)-TO_DAYS(date_due) AS days_overdue, branchname >+ FROM issues,items,biblio, biblioitems, branches b > WHERE items.itemnumber=issues.itemnumber > AND biblio.biblionumber = items.biblionumber >+ AND b.branchcode = items.homebranch > AND biblio.biblionumber = biblioitems.biblionumber > AND issues.borrowernumber = ? > AND TO_DAYS($date)-TO_DAYS(date_due) BETWEEN ? and ? >@@ -474,7 +476,7 @@ END_SQL > # <date> <itemcount> <firstname> <lastname> <address1> <address2> <address3> <city> <postcode> <country> > > my $borrower_sql = <<'END_SQL'; >-SELECT distinct(issues.borrowernumber), firstname, surname, address, address2, city, zipcode, country, email, emailpro, B_email, smsalertnumber >+SELECT distinct(issues.borrowernumber), firstname, surname, address, address2, city, zipcode, country, email, emailpro, B_email, smsalertnumber, phone, cardnumber > FROM issues,borrowers,categories > WHERE issues.borrowernumber=borrowers.borrowernumber > AND borrowers.categorycode=categories.categorycode >@@ -616,6 +618,10 @@ END_SQL > address1 => $data->{'address'}, > address2 => $data->{'address2'}, > city => $data->{'city'}, >+ phone => $data->{'phone'}, >+ cardnumber => $data->{'cardnumber'}, >+ branchname => $branch_details->{'branchname'}, >+ letternumber => $i, > postcode => $data->{'zipcode'}, > country => $data->{'country'}, > email => $notice_email, >@@ -813,7 +819,8 @@ sub prepare_letter_for_printing { > if ( exists $params->{'outputformat'} && $params->{'outputformat'} eq 'csv' ) { > if ($csv->combine( > $params->{'firstname'}, $params->{'lastname'}, $params->{'address1'}, $params->{'address2'}, $params->{'postcode'}, >- $params->{'city'}, $params->{'country'}, $params->{'email'}, $params->{'itemcount'}, $params->{'titles'} >+ $params->{'city'}, $params->{'country'}, $params->{'email'}, $params->{'phone'}, $params->{'cardnumber'}, >+ $params->{'itemcount'}, $params->{'titles'}, $params->{'branchname'}, $params->{'letternumber'} > ) > ) { > return $csv->string, "\n"; >-- >1.9.1
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 8687
:
11826
|
11829
|
12404
|
12711
|
12712
|
12713
|
17601
|
17941
|
23150
|
23229
|
30403
|
30451
|
30530
|
30538
|
30873
|
30874
|
30875