Bug 28156: Rename Koha::Account::Line->renewal with is_renewal

It's a boolean, it must be named is_*

Test plan:
Confirm that
  prove t/db_dependent/Koha/Account/Line.t
is still returning green

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2021-04-16 12:12:41 +02:00
parent f35571410b
commit 491147896d
3 changed files with 11 additions and 11 deletions

View file

@ -128,7 +128,7 @@ sub pay {
# Attempt to renew the item associated with this debit if
# appropriate
if ($fine->renewable) {
if ($fine->is_renewable) {
# We're ignoring the definition of $interface above, by all
# accounts we can't rely on C4::Context::interface, so here
# we're only using what we've been explicitly passed
@ -203,7 +203,7 @@ sub pay {
# If we need to make a note of the item associated with this line,
# in order that we can potentially renew it, do so.
my $amt = $old_amountoutstanding - $amount_to_pay;
if ( $fine->renewable ) {
if ( $fine->is_renewable ) {
my $outcome = $fine->renew_item({ interface => $interface });
push @{$renew_outcomes}, $outcome if $outcome;
}

View file

@ -596,7 +596,7 @@ sub apply {
# Attempt to renew the item associated with this debit if
# appropriate
if ( $self->credit_type_code ne 'FORGIVEN' && $debit->renewable ) {
if ( $self->credit_type_code ne 'FORGIVEN' && $debit->is_renewable ) {
$debit->renew_item( { interface => $params->{interface} } );
}
@ -887,13 +887,13 @@ sub to_api_mapping {
}
=head3 renewable
=head3 is_renewable
my $bool = $line->renewable;
my $bool = $line->is_renewable;
=cut
sub renewable {
sub is_renewable {
my ($self) = @_;
return (
@ -913,7 +913,7 @@ sub renewable {
Conditionally attempt to renew an item and return the outcome. This is
as a consequence of the fine on an item being fully paid off.
Caller must call renewable before.
Caller must call is_renewable before.
=cut

View file

@ -441,15 +441,15 @@ subtest 'Renewal related tests' => sub {
interface => 'commandline',
})->store;
is( $line->renewable, 1, "Item is returned as renewable when it meets the conditions" );
is( $line->is_renewable, 1, "Item is returned as renewable when it meets the conditions" );
$line->amountoutstanding(5);
is( $line->renewable, 0, "Item is returned as unrenewable when it has outstanding fine" );
is( $line->is_renewable, 0, "Item is returned as unrenewable when it has outstanding fine" );
$line->amountoutstanding(0);
$line->debit_type_code("VOID");
is( $line->renewable, 0, "Item is returned as unrenewable when it has the wrong account type" );
is( $line->is_renewable, 0, "Item is returned as unrenewable when it has the wrong account type" );
$line->debit_type_code("OVERDUE");
$line->status("RETURNED");
is( $line->renewable, 0, "Item is returned as unrenewable when it has the wrong account status" );
is( $line->is_renewable, 0, "Item is returned as unrenewable when it has the wrong account status" );
t::lib::Mocks::mock_preference( 'RenewAccruingItemWhenPaid', 0 );