View | Details | Raw Unified | Return to bug 35700
Collapse All | Expand All

(-)a/misc/cronjobs/holds/holds_reminder.pl (-6 / +9 lines)
Lines 42-48 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> ]
46
45
47
 Options:
46
 Options:
48
   -help                          brief help message
47
   -help                          brief help message
Lines 120-126 If omitted the patron's messaging preferences for Hold notices will be used. Link Here
120
If supplied the notice types will be force sent even if patron has not selected hold notices
119
If supplied the notice types will be force sent even if patron has not selected hold notices
121
Email and SMS will fall back to print if there is no valid info in the patron's account
120
Email and SMS will fall back to print if there is no valid info in the patron's account
122
121
123
124
=back
122
=back
125
123
126
=head1 DESCRIPTION
124
=head1 DESCRIPTION
Lines 190-196 GetOptions( Link Here
190
    'library=s'    => \@branchcodes,
188
    'library=s'    => \@branchcodes,
191
    'date=s'       => \$date_input,
189
    'date=s'       => \$date_input,
192
    'holidays'     => \$use_calendar,
190
    'holidays'     => \$use_calendar,
193
    'mtt=s'        => \@mtts
191
    'mtt=s'        => \@mtts,
194
);
192
);
195
pod2usage(1)               if $help;
193
pod2usage(1)               if $help;
196
pod2usage( -verbose => 2 ) if $man;
194
pod2usage( -verbose => 2 ) if $man;
Lines 243-251 foreach my $branchcode (@branchcodes) { #BEGIN BRANCH LOOP Link Here
243
    # If respecting calendar get the correct waiting since date
241
    # If respecting calendar get the correct waiting since date
244
    my $waiting_date;
242
    my $waiting_date;
245
    if ($use_calendar) {
243
    if ($use_calendar) {
244
        my $today    = $date_to_run;
246
        my $calendar = Koha::Calendar->new( branchcode => $branchcode, days_mode => 'Calendar' );
245
        my $calendar = Koha::Calendar->new( branchcode => $branchcode, days_mode => 'Calendar' );
247
        my $duration = DateTime::Duration->new( days => -$days );
246
248
        $waiting_date = $calendar->addDays( $date_to_run, $duration );    #Add negative of days
247
        #if today is a holiday skip sending the message
248
        next if $calendar->is_holiday($today);
249
        {
250
            my $duration = DateTime::Duration->new( days => -$days );
251
            $waiting_date = $calendar->addDays( $date_to_run, $duration );    #Add negative of days
252
        }
249
    } else {
253
    } else {
250
        $waiting_date = $waiting_date_static;
254
        $waiting_date = $waiting_date_static;
251
    }
255
    }
252
- 

Return to bug 35700