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

(-)a/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl (-8 / +3 lines)
Lines 308-314 sub GetWaitingHolds { Link Here
308
    my $query = "SELECT borrowers.borrowernumber, borrowers.cardnumber, borrowers.title as patron_title, borrowers.firstname, borrowers.surname, borrowers.categorycode,
308
    my $query = "SELECT borrowers.borrowernumber, borrowers.cardnumber, borrowers.title as patron_title, borrowers.firstname, borrowers.surname, borrowers.categorycode,
309
                borrowers.phone, borrowers.email, borrowers.branchcode, biblio.biblionumber, biblio.title, items.barcode, reserves.waitingdate,
309
                borrowers.phone, borrowers.email, borrowers.branchcode, biblio.biblionumber, biblio.title, items.barcode, reserves.waitingdate,
310
                reserves.branchcode AS site, branches.branchname AS site_name,
310
                reserves.branchcode AS site, branches.branchname AS site_name,
311
                TO_DAYS(NOW())-TO_DAYS(reserves.waitingdate) AS days_since_waiting
311
                TO_DAYS(NOW())-TO_DAYS(reserves.waitingdate) AS days_since_waiting,
312
                reserves.expirationdate
312
                FROM borrowers JOIN reserves USING (borrowernumber)
313
                FROM borrowers JOIN reserves USING (borrowernumber)
313
                JOIN items USING (itemnumber)
314
                JOIN items USING (itemnumber)
314
                JOIN biblio ON (biblio.biblionumber = items.biblionumber)
315
                JOIN biblio ON (biblio.biblionumber = items.biblionumber)
Lines 321-327 sub GetWaitingHolds { Link Here
321
                AND message_name = 'Hold_Filled'
322
                AND message_name = 'Hold_Filled'
322
                $patron_branchcode_filter
323
                $patron_branchcode_filter
323
                ";
324
                ";
324
    my $pickupdelay = C4::Context->preference("ReservesMaxPickUpDelay");
325
    my $sth         = $dbh->prepare($query);
325
    my $sth         = $dbh->prepare($query);
326
    $sth->execute();
326
    $sth->execute();
327
    my @results;
327
    my @results;
Lines 338-349 sub GetWaitingHolds { Link Here
338
        my $calendar = Koha::Calendar->new( branchcode => $issue->{'site'}, days_mode => $daysmode );
338
        my $calendar = Koha::Calendar->new( branchcode => $issue->{'site'}, days_mode => $daysmode );
339
339
340
        my $waiting_date = dt_from_string( $issue->{waitingdate}, 'sql' );
340
        my $waiting_date = dt_from_string( $issue->{waitingdate}, 'sql' );
341
        my $pickup_date = $waiting_date->clone->add( days => $pickupdelay );
342
        if ( $calendar->is_holiday($pickup_date) ) {
343
            $pickup_date = $calendar->next_open_days( $pickup_date, 1 );
344
        }
345
341
346
        $issue->{'date_due'} = output_pref({dt => $pickup_date, dateformat => 'iso' });
342
        $issue->{'date_due'} = output_pref({dt => dt_from_string($issue->{expirationdate}), dateformat => 'iso' });
347
        $issue->{'level'} = 1;    # only one level for Hold Waiting notifications
343
        $issue->{'level'} = 1;    # only one level for Hold Waiting notifications
348
344
349
        my $days_to_subtract = 0;
345
        my $days_to_subtract = 0;
350
- 

Return to bug 31356