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

(-)a/Koha/Recalls.pm (-1 / +2 lines)
Lines 142-148 sub add_recall { Link Here
142
        });
142
        });
143
        my $due_interval = defined $recall_due_date_interval ? $recall_due_date_interval->rule_value : 5;
143
        my $due_interval = defined $recall_due_date_interval ? $recall_due_date_interval->rule_value : 5;
144
        my $timestamp = dt_from_string( $recall->timestamp );
144
        my $timestamp = dt_from_string( $recall->timestamp );
145
        my $due_date = $timestamp->add( days => $due_interval );
145
        my $checkout_timestamp = dt_from_string( $checkout->date_due );
146
        my $due_date = $timestamp->set({ hour => $checkout_timestamp->hour, minute => $checkout_timestamp->minute, second => $checkout_timestamp->second })->add( days => $due_interval );
146
        $checkout->update({ date_due => $due_date });
147
        $checkout->update({ date_due => $due_date });
147
148
148
        # get itemnumber of most relevant checkout if a biblio-level recall
149
        # get itemnumber of most relevant checkout if a biblio-level recall
(-)a/t/db_dependent/Koha/Recalls.t (-2 / +2 lines)
Lines 136-142 is( $due_interval, 3, "Recall due date interval is based on circulation rules" ) Link Here
136
});
136
});
137
is( $recall->item_level, 0, "No item provided so recall not flagged as item-level" );
137
is( $recall->item_level, 0, "No item provided so recall not flagged as item-level" );
138
138
139
my $expected_due_date = dt_from_string->add( days => 3 );
139
my $checkout_timestamp = dt_from_string( $recall->checkout->date_due );
140
my $expected_due_date = dt_from_string->set({ hour => $checkout_timestamp->hour, minute => $checkout_timestamp->minute, second => $checkout_timestamp->second })->add( days => 3 );
140
is( t::lib::Dates::compare( $recall->checkout->date_due, $expected_due_date ), 0, "Checkout due date has correctly been extended by recall_due_date_interval days" );
141
is( t::lib::Dates::compare( $recall->checkout->date_due, $expected_due_date ), 0, "Checkout due date has correctly been extended by recall_due_date_interval days" );
141
is( t::lib::Dates::compare( $due_date, $expected_due_date ), 0, "Due date correctly returned" );
142
is( t::lib::Dates::compare( $due_date, $expected_due_date ), 0, "Due date correctly returned" );
142
143
143
- 

Return to bug 31147