Bugzilla – Attachment 182701 Details for
Bug 38477
Regression: new overdue fine applied incorrectly when using "Refund lost item charge and charge new overdue fine" option in circ rules
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38477: UNit test
Bug-38477-UNit-test.patch (text/plain), 2.64 KB, created by
Nick Clemens (kidclamp)
on 2025-05-21 19:21:17 UTC
(
hide
)
Description:
Bug 38477: UNit test
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2025-05-21 19:21:17 UTC
Size:
2.64 KB
patch
obsolete
>From 0a09c31f9292eb36f5e0502a250fea4e3a254b73 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 21 May 2025 19:20:55 +0000 >Subject: [PATCH] Bug 38477: UNit test > >--- > t/db_dependent/Circulation.t | 40 +++++++++++++++++++++++++++++++++++- > 1 file changed, 39 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index 6fee6e1fe9d..e10f7a01c9c 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -4590,7 +4590,7 @@ subtest 'AddReturn | is_overdue' => sub { > }; > > subtest 'lostreturn | charge' => sub { >- plan tests => 16; >+ plan tests => 18; > > t::lib::Mocks::mock_userenv( { patron => $manager, branchcode => $branchcode_charge } ); > >@@ -4715,6 +4715,44 @@ subtest 'AddReturn | is_overdue' => sub { > 5, > 'The new OVERDUE amountoutstanding is correct for the backdated return' > ); >+ >+ my $patron_2 = $builder->build_object( >+ { >+ class => 'Koha::Patrons', >+ value => { categorycode => $patron_category->{categorycode} } >+ } >+ ); >+ $issue = C4::Circulation::AddIssue( $patron_2, $item->barcode, $five_days_ago ); >+ >+ # Do nothing >+ my $four_days_ago = $now->clone->subtract( days => 4 ); >+ ( undef, $message ) = AddReturn( $item->barcode, $branchcode_charge, undef, $four_days_ago ); >+ my $overdue_fees_2 = Koha::Account::Lines->search( >+ { >+ borrowernumber => $patron_2->id, >+ itemnumber => $item->itemnumber, >+ debit_type_code => 'OVERDUE' >+ } >+ ); >+ is( $overdue_fees_2->count, 1, 'Normal overdue generated when item returned late' ); >+ >+ # Simulate item marked as lost >+ $item->itemlost(2)->store; >+ $item->discard_changes(); >+ >+ #C4::Circulation::LostItem( $item->itemnumber, 1 ); >+ ( undef, $message ) = AddReturn( $item->barcode, $branchcode_charge, undef ); >+ $overdue_fees_2 = Koha::Account::Lines->search( >+ { >+ borrowernumber => $patron_2->id, >+ itemnumber => $item->itemnumber, >+ debit_type_code => 'OVERDUE' >+ } >+ ); >+ is( >+ $overdue_fees_2->count, 1, >+ 'No overdue generated when an item previously lost by a patron is lost after another patron has borrwed it' >+ ); > }; > }; > }; >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 38477
:
182701
|
182726
|
182727
|
182745
|
182827
|
182828
|
182916
|
182937