Bugzilla – Attachment 95728 Details for
Bug 24075
Backdating a return to the exact due date and time results in the fine not being refunded
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24075: Unit tests
Bug-24075-Unit-tests.patch (text/plain), 2.42 KB, created by
Tomás Cohen Arazi (tcohen)
on 2019-11-22 14:34:21 UTC
(
hide
)
Description:
Bug 24075: Unit tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2019-11-22 14:34:21 UTC
Size:
2.42 KB
patch
obsolete
>From ac5d4bebbdd0c49eb8f11eee6b7c99db7dd2dae0 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 21 Nov 2019 06:34:11 -0500 >Subject: [PATCH] Bug 24075: Unit tests > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/Circulation.t | 45 +++++++++++++++++++++++++++++++++++- > 1 file changed, 44 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index aff4ee918e..2cf83118b6 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -18,7 +18,7 @@ > use Modern::Perl; > use utf8; > >-use Test::More tests => 45; >+use Test::More tests => 46; > use Test::MockModule; > > use Data::Dumper; >@@ -3341,6 +3341,49 @@ subtest 'CanBookBeIssued & RentalFeesCheckoutConfirmation' => sub { > $itemtype->rentalcharge_daily('0')->store; > }; > >+subtest "Test Backdating of Returns" => sub { >+ plan tests => 2; >+ >+ my $branch = $library2->{branchcode}; >+ my $biblio = $builder->build_sample_biblio(); >+ my $item = $builder->build_sample_item( >+ { >+ biblionumber => $biblio->biblionumber, >+ library => $branch, >+ itype => $itemtype, >+ } >+ ); >+ >+ my %a_borrower_data = ( >+ firstname => 'Kyle', >+ surname => 'Hall', >+ categorycode => $patron_category->{categorycode}, >+ branchcode => $branch, >+ ); >+ my $borrowernumber = Koha::Patron->new(\%a_borrower_data)->store->borrowernumber; >+ my $borrower = Koha::Patrons->find( $borrowernumber )->unblessed; >+ >+ my $due_date = dt_from_string; >+ my $issue = AddIssue( $borrower, $item->barcode, $due_date ); >+ UpdateFine( >+ { >+ issue_id => $issue->id(), >+ itemnumber => $item->itemnumber, >+ borrowernumber => $borrowernumber, >+ amount => .25, >+ amountoutstanding => .25, >+ type => q{} >+ } >+ ); >+ >+ >+ my ( undef, $message ) = AddReturn( $item->barcode, $branch, undef, $due_date ); >+ >+ my $accountline = Koha::Account::Lines->find( { issue_id => $issue->id } ); >+ is( $accountline->amountoutstanding, '0.000000', 'Fee amount outstanding was reduced to 0' ); >+ is( $accountline->amount, '0.000000', 'Fee amount was reduced to 0' ); >+}; >+ > $schema->storage->txn_rollback; > C4::Context->clear_syspref_cache(); > $cache->clear_from_cache('single_holidays'); >-- >2.24.0
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 24075
:
95625
|
95626
|
95654
|
95655
|
95656
|
95706
|
95707
|
95719
|
95720
|
95723
|
95724
|
95727
| 95728