[Koha-bugs] [Bug 2696] Fine payments should show what was paid for

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Apr 23 20:28:39 CEST 2018


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=2696

--- Comment #43 from Kyle M Hall <kyle at bywatersolutions.com> ---
I have fixed everything except:

--
@@ +42,5 @@
> +
> +sub debit {
> +    my ( $self ) = @_;
> +    my $debit_rs = $self->_result->debit;
> +    return unless $debit_rs;

I do not think we should "return unless" here, we do not do that for other
methods. Is there a good reason?
--

which I believe to be incorrect. Please refer to Koha::Item::checkout for
precedence. What you write makes sense *if* the foreign key *must* exist ( such
as the case of items.biblionumber ). However, in this case, a checkout may not
exist for this item ). Without that line, you would return a perfectly value
but empty Koha::Checkout object. In that case code such as "if ( my $c =
$item->checkout )" would by true instead of false like everyone would expect it
to be. In fact, $item->checkout would *always* return true since the you'd get
a Koha::Checkout object every time, valid or not.


(In reply to Jonathan Druart from comment #39)

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list