Bug 30420: Rename Koha::Patron->get_overdues with ->overdues

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Jonathan Druart 2022-04-27 13:33:09 +02:00 committed by Tomas Cohen Arazi
parent 123a55849a
commit 5e5b642067
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F
5 changed files with 11 additions and 13 deletions

View file

@ -1215,15 +1215,15 @@ sub old_checkouts {
return Koha::Old::Checkouts->_new_from_dbic( $old_checkouts );
}
=head3 get_overdues
=head3 overdues
my $overdue_items = $patron->get_overdues
my $overdue_items = $patron->overdues
Return the overdue items
=cut
sub get_overdues {
sub overdues {
my ($self) = @_;
my $dtf = Koha::Database->new->schema->storage->datetime_parser;
return $self->checkouts->search(
@ -1236,8 +1236,6 @@ sub get_overdues {
);
}
sub overdues { my $self = shift; return $self->get_overdues(@_); }
=head3 get_routing_lists
my $routinglists = $patron->get_routing_lists

View file

@ -240,7 +240,7 @@ if ($patron) {
$template->param( borrowernumber => $patron->borrowernumber );
output_and_exit_if_error( $query, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
my $overdues = $patron->get_overdues;
my $overdues = $patron->overdues;
my $issues = $patron->checkouts;
$balance = $patron->account->balance;

View file

@ -49,7 +49,7 @@ my $patron = Koha::Patrons->find( $borrowernumber );
output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
my $overdues = [
map { $_->unblessed_all_relateds } $patron->get_overdues->as_list
map { $_->unblessed_all_relateds } $patron->overdues->as_list
];
my $letter = parse_overdues_letter(

View file

@ -871,7 +871,7 @@ subtest 'unblessed_all_relateds' => sub {
);
my $issue = AddIssue( $patron->unblessed, $item->barcode, DateTime->now->subtract( days => 1 ) );
my $overdues = Koha::Patrons->find( $patron->id )->get_overdues; # Koha::Patron->get_overdue prefetches
my $overdues = Koha::Patrons->find( $patron->id )->overdues; # Koha::Patron->overdues prefetches
my $overdue = $overdues->next->unblessed_all_relateds;
is( $overdue->{issue_id}, $issue->issue_id, 'unblessed_all_relateds has field from the original table (issues)' );
is( $overdue->{title}, $biblio->title, 'unblessed_all_relateds has field from other tables (biblio)' );

View file

@ -558,7 +558,7 @@ subtest 'add_enrolment_fee_if_needed' => sub {
$patron->delete;
};
subtest 'checkouts + pending_checkouts + get_overdues + old_checkouts' => sub {
subtest 'checkouts + pending_checkouts + overdues + old_checkouts' => sub {
plan tests => 17;
my $library = $builder->build( { source => 'Branch' } );
@ -620,9 +620,9 @@ subtest 'checkouts + pending_checkouts + get_overdues + old_checkouts' => sub {
my $first_checkout = $pending_checkouts->next;
is( $first_checkout->unblessed_all_relateds->{biblionumber}, $item_3->biblionumber, 'pending_checkouts should prefetch values from other tables (here biblio)' );
my $overdues = $patron->get_overdues;
my $overdues = $patron->overdues;
is( $overdues->count, 2, 'Patron should have 2 overdues');
is( ref($overdues), 'Koha::Checkouts', 'Koha::Patron->get_overdues should return Koha::Checkouts' );
is( ref($overdues), 'Koha::Checkouts', 'Koha::Patron->overdues should return Koha::Checkouts' );
is( $overdues->next->itemnumber, $item_1->itemnumber, 'The issue should be returned in the same order as they have been done, first is correct' );
is( $overdues->next->itemnumber, $item_2->itemnumber, 'The issue should be returned in the same order as they have been done, second is correct' );
@ -1419,7 +1419,7 @@ subtest 'is_child | is_adult' => sub {
$patron_other->delete;
};
subtest 'get_overdues' => sub {
subtest 'overdues' => sub {
plan tests => 7;
my $library = $builder->build( { source => 'Branch' } );
@ -1456,7 +1456,7 @@ subtest 'get_overdues' => sub {
AddIssue( $patron, $item_3->barcode );
$patron = Koha::Patrons->find( $patron->{borrowernumber} );
my $overdues = $patron->get_overdues;
my $overdues = $patron->overdues;
is( $overdues->count, 2, 'Patron should have 2 overdues');
is( $overdues->next->itemnumber, $item_1->itemnumber, 'The issue should be returned in the same order as they have been done, first is correct' );
is( $overdues->next->itemnumber, $item_2->itemnumber, 'The issue should be returned in the same order as they have been done, second is correct' );