[Koha-bugs] [Bug 22877] Returning a lost item not marked as returned can generate additional overdue fines

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon May 13 16:33:42 CEST 2019


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

--- Comment #18 from Jonathan Druart <jonathan.druart at bugs.koha-community.org> ---
(In reply to Martin Renvoize from comment #17)
> Created attachment 89527 [details] [review]
> Bug 22877: (QA follow-up) Clarify intent of tests and remove one.
> 
> This patch embelishes the existing comments slightly and removes a test
> which had a FIXME, but was in fact just a duplicate of the test directly
> above it.  I beleive it became a duplicate after the subroutine signature
> changed at some point recently.  I also move the bug 22877 specific test
> into a subtest.

The tests existed before the change of the signature
(bcfa31a8e37f88ab07c1e7ed954ab57684d0dcfa).

The last 3 tests were:

+    # specify return date 5 days later => overdue
+    AddIssue( $patron->unblessed, $item->{barcode}, $ten_days_ago ); # date
due was 10d ago
+    AddReturn( $item->{barcode}, $library->{branchcode}, undef, undef,
$five_days_ago );
+    is( int($patron->account->balance()), 5, 'AddReturn: pass return_date =>
overdue' );
+    Koha::Account::Lines->search({ borrowernumber => $patron->borrowernumber
})->delete;

+    # specify dropbox date 5 days before => no overdue
+    AddIssue( $patron->unblessed, $item->{barcode}, $five_days_ago ); # date
due was 5d ago
+    AddReturn( $item->{barcode}, $library->{branchcode}, undef, 1, undef,
$ten_days_ago );
+    is( int($patron->account->balance()), 0, 'AddReturn: pass return_date =>
no overdue' );
+    Koha::Account::Lines->search({ borrowernumber => $patron->borrowernumber
})->delete;

+    # specify dropbox date 5 days later => overdue, or... not
+    AddIssue( $patron->unblessed, $item->{barcode}, $ten_days_ago ); # date
due was 10d ago
+    AddReturn( $item->{barcode}, $library->{branchcode}, undef, 1, undef,
$five_days_ago );
+    is( int($patron->account->balance()), 0, 'AddReturn: pass return_date =>
no overdue in dropbox mode' ); # FIXME? This is weird, the FU fine is created (
_CalculateAndUpdateFine > C4::Overdues::UpdateFine ) then remove later (in
_FixOverduesOnReturn). Looks like it is a feature
+    Koha::Account::Lines->search({ borrowernumber => $patron->borrowernumber
})->delete;

There are all completely different, in short:
- due 10d ago, checked in 5d ago => overdue
- due 5d ago, checked in 10d ago => no overdue
- due 10d ago, checked in 5d ago (using the dropbox feature) => FIXME

Would be good to see if the FIXME is still needed or not, I'd no as we removed
the dropbox flag.

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


More information about the Koha-bugs mailing list