Lines 42-47
holds_reminder.pl
Link Here
|
42 |
-lettercode <notice to send> |
42 |
-lettercode <notice to send> |
43 |
[ -c ][ -v ][ -library <branchcode> ][ -library <branchcode> ... ] |
43 |
[ -c ][ -v ][ -library <branchcode> ][ -library <branchcode> ... ] |
44 |
[ -days <number of days> ][ -mtt <transport type> ... ][ -holidays ] |
44 |
[ -days <number of days> ][ -mtt <transport type> ... ][ -holidays ] |
|
|
45 |
[ -date <YYYY-MM-DD> ] |
45 |
|
46 |
|
46 |
Options: |
47 |
Options: |
47 |
-help brief help message |
48 |
-help brief help message |
Lines 188-194
GetOptions(
Link Here
|
188 |
'library=s' => \@branchcodes, |
189 |
'library=s' => \@branchcodes, |
189 |
'date=s' => \$date_input, |
190 |
'date=s' => \$date_input, |
190 |
'holidays' => \$use_calendar, |
191 |
'holidays' => \$use_calendar, |
191 |
'mtt=s' => \@mtts, |
192 |
'mtt=s' => \@mtts |
192 |
); |
193 |
); |
193 |
pod2usage(1) if $help; |
194 |
pod2usage(1) if $help; |
194 |
pod2usage( -verbose => 2 ) if $man; |
195 |
pod2usage( -verbose => 2 ) if $man; |
Lines 241-251
foreach my $branchcode (@branchcodes) { #BEGIN BRANCH LOOP
Link Here
|
241 |
# If respecting calendar get the correct waiting since date |
242 |
# If respecting calendar get the correct waiting since date |
242 |
my $waiting_date; |
243 |
my $waiting_date; |
243 |
if ($use_calendar) { |
244 |
if ($use_calendar) { |
244 |
my $today = $date_to_run; |
|
|
245 |
my $calendar = Koha::Calendar->new( branchcode => $branchcode, days_mode => 'Calendar' ); |
245 |
my $calendar = Koha::Calendar->new( branchcode => $branchcode, days_mode => 'Calendar' ); |
246 |
|
246 |
|
247 |
#if today is a holiday skip sending the message |
247 |
#if today is a holiday skip sending the message |
248 |
next if $calendar->is_holiday($today); |
248 |
next if $calendar->is_holiday($date_to_run); |
249 |
{ |
249 |
{ |
250 |
my $duration = DateTime::Duration->new( days => -$days ); |
250 |
my $duration = DateTime::Duration->new( days => -$days ); |
251 |
$waiting_date = $calendar->addDays( $date_to_run, $duration ); #Add negative of days |
251 |
$waiting_date = $calendar->addDays( $date_to_run, $duration ); #Add negative of days |
252 |
- |
|
|