Bug 33653: Never consider received orders as late

We should not list received orders on the late orders page.

Test plan:
* Create a basket
* Create a normal order (not from a subscription, no standing order)
* Leave estimated delivery date empty
* Close the basket
* Create a new invoice and receive the order line
* Go to acq > late orders
* Verify the order is not in the list
* Set filter for 'To' date into the future, i.e. 01/01/2025
=> Without this patch the order shows up
=> With this patch applied the received order does not show up

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Jonathan Druart 2023-05-03 15:18:13 +02:00 committed by Tomas Cohen Arazi
parent f7b1c85f73
commit 64c4f115cd
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F
2 changed files with 17 additions and 1 deletions

View file

@ -132,7 +132,7 @@ sub filter_by_lates {
: ()
),
( orderstatus => { '!=' => 'cancelled' } ),
( orderstatus => { '-not_in' => ['cancelled', 'complete'] } ),
},
{

View file

@ -416,6 +416,7 @@ subtest 'filter_by_late' => sub {
datereceived => undef,
datecancellationprinted => undef,
estimated_delivery_date => undef,
orderstatus => 'ordered',
}
}
);
@ -436,6 +437,7 @@ subtest 'filter_by_late' => sub {
datereceived => undef,
datecancellationprinted => undef,
estimated_delivery_date => undef,
orderstatus => 'ordered',
}
}
);
@ -456,6 +458,7 @@ subtest 'filter_by_late' => sub {
datereceived => undef,
datecancellationprinted => undef,
estimated_delivery_date => undef,
orderstatus => 'ordered',
}
}
);
@ -476,6 +479,19 @@ subtest 'filter_by_late' => sub {
datereceived => undef,
datecancellationprinted => undef,
estimated_delivery_date => undef,
orderstatus => 'ordered',
}
}
);
my $order_42 = $builder->build_object(
{
class => 'Koha::Acquisition::Orders',
value => {
basketno => $basket_4->basketno,
datereceived => undef,
datecancellationprinted => undef,
estimated_delivery_date => undef,
orderstatus => 'complete',
}
}
);