Bug 39816: (QA follow-up) Rename 'late_since_days' to 'days_late'

Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
This commit is contained in:
Tomás Cohen Arazi 2025-10-06 16:05:44 -03:00 committed by Laura Escamilla
parent 940459a172
commit ad5fcfc0fc
No known key found for this signature in database
GPG Key ID: B5DEB5FD2FCDA5D8
6 changed files with 15 additions and 15 deletions

View File

@ -165,17 +165,16 @@ sub estimated_delivery_date {
return dt_from_string( $self->closedate )->add( days => $self->bookseller->deliverytime );
}
=head3 late_since_days
=head3 days_late
my $number_of_days_late = $basket->late_since_days;
my $number_of_days_late = $basket->days_late;
Return the number of days the basket is late.
Return implicit undef if the basket is not closed.
Returns the number of days the basket is late. I<undef> is returned if
the basket is not closed.
=cut
sub late_since_days {
sub days_late {
my ($self) = @_;
return unless $self->closedate;
return dt_from_string->delta_days( dt_from_string( $self->closedate ) )->delta_days();

View File

@ -84,7 +84,7 @@ properties:
- null
description: "When items should be created for orders in this basket (Options:
'ordering', 'receiving', 'cataloguing'. Null means system wide config)"
late_since_days:
days_late:
type:
- integer
- "null"

View File

@ -24,7 +24,7 @@
enum:
- basket_group
- creator
- late_since_days
- days_late
collectionFormat: csv
produces:
- application/json

View File

@ -53,7 +53,7 @@
- basket
- basket.basket_group
- basket.creator
- basket.late_since_days
- basket.days_late
- biblio
- biblio.uncancelled_orders+count
- biblio.holds+count
@ -181,7 +181,7 @@
- basket
- basket.basket_group
- basket.creator
- basket.late_since_days
- basket.days_late
- biblio
- biblio.uncancelled_orders+count
- biblio.holds+count

View File

@ -107,7 +107,7 @@
<input type="checkbox" value="[% lateorder.ordernumber | html %]" data-booksellerid="[% lateorder.basket.booksellerid | html %]" name="ordernumber" />
</td>
<td> [% lateorder.ordernumber | $raw %] </td>
<td data-order="[% lateorder.basket.closedate | html %]"> [% lateorder.basket.closedate | $KohaDates %] ([% lateorder.basket.late_since_days | html %] days) </td>
<td data-order="[% lateorder.basket.closedate | html %]"> [% lateorder.basket.closedate | $KohaDates %] ([% lateorder.basket.days_late | html %] days) </td>
[% IF lateorder.get_column('estimated_delivery_date') %]
[% SET estimated_delivery_date = lateorder.get_column('estimated_delivery_date') %]
[% ELSIF lateorder.get_column('calculated_estimated_delivery_date') %]

View File

@ -239,7 +239,8 @@ subtest 'estimated_delivery_date' => sub {
$schema->storage->txn_rollback;
};
subtest 'late_since_days' => sub {
subtest 'days_late() tests' => sub {
plan tests => 3;
$schema->storage->txn_begin;
@ -251,13 +252,13 @@ subtest 'late_since_days' => sub {
my $now = dt_from_string;
$basket->closedate(undef)->store; # Basket is open
is( $basket->late_since_days, undef, 'return undef if basket is still open' );
is( $basket->days_late, undef, 'return undef if basket is still open' );
$basket->closedate($now)->store; #Closing the basket today
is( $basket->late_since_days, 0, 'return 0 if basket has been closed on today' );
is( $basket->days_late, 0, 'return 0 if basket has been closed on today' );
$basket->closedate( $now->clone->subtract( days => 2 ) )->store;
is( $basket->late_since_days, 2, 'return 2 if basket has been closed 2 days ago' );
is( $basket->days_late, 2, 'return 2 if basket has been closed 2 days ago' );
$schema->storage->txn_rollback;
};