Bugzilla – Attachment 13213 Details for
Bug 9004
Talking Tech doesn't account for holidays when calculating a holds last pickup date
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9004 - Talking Tech doesn't account for holidays when calculating a holds last pickup date - Add holidays check
Bug-9004---Talking-Tech-doesnt-account-for-holiday.patch (text/plain), 2.37 KB, created by
Kyle M Hall (khall)
on 2012-11-02 12:31:23 UTC
(
hide
)
Description:
Bug 9004 - Talking Tech doesn't account for holidays when calculating a holds last pickup date - Add holidays check
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2012-11-02 12:31:23 UTC
Size:
2.37 KB
patch
obsolete
>From d6e5f30fa1dab5aa21261f008da83dc421bb765f Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 2 Nov 2012 08:30:46 -0400 >Subject: [PATCH] Bug 9004 - Talking Tech doesn't account for holidays when calculating a holds last pickup date - Add holidays check >Content-Type: text/plain; charset="utf-8" > >--- > .../thirdparty/TalkingTech_itiva_outbound.pl | 16 +++++++++++----- > 1 files changed, 11 insertions(+), 5 deletions(-) > >diff --git a/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl b/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl >index eb35290..f698cc3 100755 >--- a/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl >+++ b/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl >@@ -287,14 +287,20 @@ sub GetWaitingHolds { > $sth->execute(); > my @results; > while ( my $issue = $sth->fetchrow_hashref() ) { >- my @waitingdate = split( /-/, $issue->{'waitingdate'} ); >- my @date_due = Add_Delta_Days( $waitingdate[0], $waitingdate[1], $waitingdate[2], $pickupdelay ); >- $issue->{'date_due'} = sprintf( "%04d-%02d-%02d", $date_due[0], $date_due[1], $date_due[2] ); >+ my $calendar = C4::Calendar->new( branchcode => $issue->{'site'} ); >+ >+ my ( $waiting_year, $waiting_month, $waiting_day ) = split( /-/, $issue->{'waitingdate'} ); >+ my ( $pickup_year, $pickup_month, $pickup_day ) = Add_Delta_Days( $waiting_year, $waiting_month, $waiting_day, $pickupdelay ); >+ >+ while ( $calendar->isHoliday( $pickup_day, $pickup_month, $pickup_year ) ) { >+ ( $pickup_year, $pickup_month, $pickup_day ) = Add_Delta_Days( $pickup_year, $pickup_month, $pickup_day, 1 ); >+ } >+ >+ $issue->{'date_due'} = sprintf( "%04d-%02d-%02d", $pickup_year, $pickup_month, $pickup_day ); > $issue->{'level'} = 1; # only one level for Hold Waiting notifications > > my $days_to_subtract = 0; >- my $calendar = C4::Calendar->new( branchcode => $issue->{'site'} ); >- while ( $calendar->isHoliday( reverse( Add_Delta_Days( $waitingdate[0], $waitingdate[1], $waitingdate[2], $days_to_subtract ) ) ) ) { >+ while ( $calendar->isHoliday( reverse( Add_Delta_Days( $waiting_year, $waiting_month, $waiting_day, $days_to_subtract ) ) ) ) { > $days_to_subtract++; > } > $issue->{'days_since_waiting'} = $issue->{'days_since_waiting'} - $days_to_subtract; >-- >1.7.2.5
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 9004
:
13176
|
13212
|
13213
|
50042
|
50043
|
50082
|
50085
|
50086
|
50111
|
50112
|
50113
|
50114