return $enrolment_fee || 0;
}
-=head3 get_checkouts
+=head3 checkouts
-my $issues = $patron->get_checkouts
+my $issues = $patron->checkouts
=cut
-sub get_checkouts {
+sub checkouts {
my ($self) = @_;
my $issues = $self->_result->issues;
return Koha::Checkouts->_new_from_dbic( $issues );
sub get_overdues {
my ($self) = @_;
my $dtf = Koha::Database->new->schema->storage->datetime_parser;
- return $self->get_checkouts->search(
+ return $self->checkouts->search(
{
'me.date_due' => { '<' => $dtf->format_datetime(dt_from_string) },
},
$patron->delete;
};
-subtest 'get_checkouts + get_overdues' => sub {
+subtest 'checkouts + get_overdues' => sub {
plan tests => 8;
my $library = $builder->build( { source => 'Branch' } );
);
$patron = Koha::Patrons->find( $patron->{borrowernumber} );
- my $checkouts = $patron->get_checkouts;
- is( $checkouts->count, 0, 'get_checkouts should not return any issues for that patron' );
- is( ref($checkouts), 'Koha::Checkouts', 'get_checkouts should return a Koha::Checkouts object' );
+ my $checkouts = $patron->checkouts;
+ is( $checkouts->count, 0, 'checkouts should not return any issues for that patron' );
+ is( ref($checkouts), 'Koha::Checkouts', 'checkouts should return a Koha::Checkouts object' );
# Not sure how this is useful, but AddIssue pass this variable to different other subroutines
$patron = GetMember( borrowernumber => $patron->borrowernumber );
AddIssue( $patron, $item_3->{barcode} );
$patron = Koha::Patrons->find( $patron->{borrowernumber} );
- $checkouts = $patron->get_checkouts;
- is( $checkouts->count, 3, 'get_checkouts should return 3 issues for that patron' );
- is( ref($checkouts), 'Koha::Checkouts', 'get_checkouts should return a Koha::Checkouts object' );
+ $checkouts = $patron->checkouts;
+ is( $checkouts->count, 3, 'checkouts should return 3 issues for that patron' );
+ is( ref($checkouts), 'Koha::Checkouts', 'checkouts should return a Koha::Checkouts object' );
my $overdues = $patron->get_overdues;
is( $overdues->count, 2, 'Patron should have 2 overdues');