Bugzilla – Attachment 111273 Details for
Bug 22750
Partial writeoff of lost fee causes item to be returned
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22750: (24474: Add tests)
Bug-22750-24474-Add-tests.patch (text/plain), 2.76 KB, created by
Martin Renvoize (ashimema)
on 2020-10-06 09:53:42 UTC
(
hide
)
Description:
Bug 22750: (24474: Add tests)
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-10-06 09:53:42 UTC
Size:
2.76 KB
patch
obsolete
>From 53d2db200cace321f65be7582511879539fdff77 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 4 Feb 2020 15:13:47 +0100 >Subject: [PATCH] Bug 22750: (24474: Add tests) > >This does the following using the interface: >- Unselect all the options from MarkLostItemsAsReturned except for > 'onpayment' >- Check an item out >- Create a manual invoice LOST for the checked in item >- Renew the item >- Check that the item was not returned > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > t/db_dependent/Circulation.t | 42 ++++++++++++++++++++++++++++++++++++ > 1 file changed, 42 insertions(+) > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index 01d9b09041..90d852d3bb 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -3538,6 +3538,48 @@ subtest 'Filling a hold should cancel existing transfer' => sub { > is( Koha::Item::Transfers->search({ itemnumber => $item->itemnumber, datearrived => undef })->count, 0, "No outstanding transfers when hold is waiting"); > }; > >+subtest 'Do not return on renewal (LOST charge)' => sub { >+ plan tests => 1; >+ >+ t::lib::Mocks::mock_preference('MarkLostItemsAsReturned', 'onpayment'); >+ my $library = $builder->build_object( { class => "Koha::Libraries" } ); >+ my $manager = $builder->build_object( { class => "Koha::Patrons" } ); >+ t::lib::Mocks::mock_userenv({ patron => $manager,branchcode => $manager->branchcode }); >+ >+ my $biblio = $builder->build_sample_biblio; >+ >+ my $item = $builder->build_sample_item( >+ { >+ biblionumber => $biblio->biblionumber, >+ library => $library->branchcode, >+ replacementprice => 99.00, >+ itype => $itemtype, >+ } >+ ); >+ >+ my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); >+ AddIssue( $patron->unblessed, $item->barcode ); >+ >+ my $accountline = Koha::Account::Line->new( >+ { >+ borrowernumber => $patron->borrowernumber, >+ debit_type_code => 'LOST', >+ status => undef, >+ itemnumber => $item->itemnumber, >+ amount => 12, >+ amountoutstanding => 12, >+ interface => 'something', >+ } >+ )->store(); >+ >+ # AddRenewal doesn't call _FixAccountForLostAndFound >+ AddIssue( $patron->unblessed, $item->barcode ); >+ >+ is( $patron->checkouts->count, 1, >+ 'Renewal should not return the item even if a LOST payment has been made earlier' >+ ); >+}; >+ > $schema->storage->txn_rollback; > C4::Context->clear_syspref_cache(); > $cache->clear_from_cache('single_holidays'); >-- >2.20.1
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 22750
:
111271
|
111272
|
111273
|
111274
|
111275
|
111276
|
111277
|
111278
|
111738
|
111739
|
111740
|
111741
|
111742
|
111743
|
111744
|
111745