Bugzilla – Attachment 142693 Details for
Bug 23012
Possibility to mark processing fee by default refund when item is found
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23012: (follow-up) Fix t/db_dependent/Koha/Items.t
Bug-23012-follow-up-Fix-tdbdependentKohaItemst.patch (text/plain), 3.37 KB, created by
Aleisha Amohia
on 2022-10-27 01:15:12 UTC
(
hide
)
Description:
Bug 23012: (follow-up) Fix t/db_dependent/Koha/Items.t
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2022-10-27 01:15:12 UTC
Size:
3.37 KB
patch
obsolete
>From 6dcb184e0fb5a3978e220d3aba3f2677c61dc2b5 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Thu, 27 Oct 2022 01:13:08 +0000 >Subject: [PATCH] Bug 23012: (follow-up) Fix t/db_dependent/Koha/Items.t > >--- > Koha/Item.pm | 2 +- > t/db_dependent/Koha/Items.t | 33 ++++++++++++++++++++++++++++++--- > 2 files changed, 31 insertions(+), 4 deletions(-) > >diff --git a/Koha/Item.pm b/Koha/Item.pm >index 25b4e54dc39..3ef1e04194b 100644 >--- a/Koha/Item.pm >+++ b/Koha/Item.pm >@@ -1325,7 +1325,7 @@ sub _set_found_trigger { > } > } > >- my $processingreturn_policy = $lost_proc_return_policy->{lostreturn}; >+ my $processingreturn_policy = $lost_proc_return_policy->{processingreturn}; > > if ( $processingreturn_policy ) { > >diff --git a/t/db_dependent/Koha/Items.t b/t/db_dependent/Koha/Items.t >index 6c1ebc3aac5..0c424f98dbd 100755 >--- a/t/db_dependent/Koha/Items.t >+++ b/t/db_dependent/Koha/Items.t >@@ -368,7 +368,7 @@ subtest 'store' => sub { > > subtest 'Full payment tests' => sub { > >- plan tests => 14; >+ plan tests => 16; > > my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); > >@@ -455,6 +455,18 @@ subtest 'store' => sub { > 'The account line of type LOST_FOUND has an amountoutstanding of -99' > ); > >+ my $processing_return = Koha::Account::Lines->search( >+ { >+ itemnumber => $item->itemnumber, >+ credit_type_code => 'PROCESSING_FOUND' >+ }, >+ { rows => 1 } >+ )->single; >+ ok( $processing_return, 'An account line of type PROCESSING_FOUND is added' ); >+ is( $processing_return->amount + 0, >+ -20.00, >+ 'The account line of type PROCESSING_FOUND has an amount of -20' ); >+ > $lost_fee_line->discard_changes; > is( $lost_fee_line->amountoutstanding + 0, > 0, 'Lost fee has no outstanding amount' ); >@@ -463,8 +475,8 @@ subtest 'store' => sub { > is( $lost_fee_line->status, 'FOUND', > "Lost fee now has account status of FOUND" ); > >- is( $patron->account->balance, -99, >-'The patron balance is -99, a credit that equals the lost fee payment' >+ is( $patron->account->balance, -119, >+'The patron balance is -119, a credit that equals the lost fee payment and the processing fee' > ); > }; > >@@ -523,6 +535,21 @@ subtest 'store' => sub { > $replacement_amount, > 'The right LOST amountountstanding is generated' ); > >+ # Set processingreturn_policy to '0' so processing fee is retained >+ # these tests are just for lostreturn >+ my $processingreturn_rule = $builder->build( >+ { >+ source => 'CirculationRule', >+ value => { >+ branchcode => undef, >+ categorycode => undef, >+ itemtype => undef, >+ rule_name => 'processingreturn', >+ rule_value => '0' >+ } >+ } >+ ); >+ > # Simulate item marked as found > $item->itemlost(0)->store; > is( scalar ( grep { $_->message eq 'lost_refunded' } @{$item->object_messages} ), 1, 'Refund triggered' ); >-- >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 23012
:
141627
|
141628
|
141629
|
141630
|
142046
|
142047
|
142048
|
142049
|
142113
|
142123
|
142124
|
142125
|
142126
|
142481
|
142482
|
142483
|
142484
|
142485
|
142486
|
142487
|
142575
|
142652
|
142693
|
142736
|
142737