Bugzilla – Attachment 192190 Details for
Bug 36506
Processing Fee should be configurable by branch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36506: (QA follow-up) Add test for missing circulation rule
d467c1d.patch (text/plain), 3.05 KB, created by
Martin Renvoize (ashimema)
on 2026-01-29 18:21:23 UTC
(
hide
)
Description:
Bug 36506: (QA follow-up) Add test for missing circulation rule
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2026-01-29 18:21:23 UTC
Size:
3.05 KB
patch
obsolete
>From d467c1d4bd2977e61e502a0a778fbf141c0c26fd Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@openfifth.co.uk> >Date: Thu, 29 Jan 2026 18:17:08 +0000 >Subject: [PATCH] Bug 36506: (QA follow-up) Add test for missing circulation > rule > >This adds a test case to verify that when no lost_item_processing_fee >circulation rule exists for a branch/itemtype combination, the system >correctly defaults to 0 (no processing fee charged). > >The test confirms: >- No PROCESSING account line is created when the rule is missing >- The LOST fee is still created normally (only processing fee affected) >- The // 0 fallback in C4::Accounts::chargelostitem works correctly > >Test plan: >1. prove t/db_dependent/Accounts.t >2. Verify all tests pass, including the new "missing circulation rule" > test case > >Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> >--- > t/db_dependent/Accounts.t | 30 +++++++++++++++++++++++++++++- > 1 file changed, 29 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Accounts.t b/t/db_dependent/Accounts.t >index 7d0d9c67492..2e0f0587ffd 100755 >--- a/t/db_dependent/Accounts.t >+++ b/t/db_dependent/Accounts.t >@@ -889,7 +889,7 @@ subtest "C4::Accounts::chargelostitem tests" => sub { > }; > > subtest "further processing fee application tests" => sub { >- plan tests => 8; >+ plan tests => 10; > > my $branch_1 = $builder->build_object( { class => 'Koha::Libraries' } ); > my $branch_2 = $builder->build_object( { class => 'Koha::Libraries' } ); >@@ -999,6 +999,34 @@ subtest "C4::Accounts::chargelostitem tests" => sub { > ok( $procfee, "Processing fee created" ); > is( $procfee->amount + 0, 4, "Processing fee chosen correctly" ); > >+ # Test missing rule defaults to 0 (no processing fee) >+ diag("Test missing circulation rule defaults to 0"); >+ my $branch_no_rule = $builder->build_object( { class => 'Koha::Libraries' } ); >+ $borrower = $builder->build_object( >+ { class => 'Koha::Patrons', value => { branchcode => $branch_no_rule->branchcode } } ); >+ $item = $builder->build_sample_item( { homebranch => $branch_no_rule->branchcode } ); >+ >+ t::lib::Mocks::mock_preference( 'LostChargesControl', 'PatronLibrary' ); >+ C4::Accounts::chargelostitem( $borrower->borrowernumber, $item->itemnumber, '1', "No rule test" ); >+ >+ $procfee = Koha::Account::Lines->find( >+ { >+ borrowernumber => $borrower->borrowernumber, >+ itemnumber => $item->itemnumber, >+ debit_type_code => 'PROCESSING' >+ } >+ ); >+ ok( !$procfee, "No processing fee created when circulation rule is missing" ); >+ >+ my $lostfee = Koha::Account::Lines->find( >+ { >+ borrowernumber => $borrower->borrowernumber, >+ itemnumber => $item->itemnumber, >+ debit_type_code => 'LOST' >+ } >+ ); >+ ok( $lostfee, "Lost fee still created even when processing fee rule is missing" ); >+ > }; > > subtest "basic fields tests" => sub { >-- >2.52.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 36506
:
187411
|
187412
|
187413
|
187414
|
187415
|
187416
|
187417
|
187418
|
187573
|
187574
|
187575
|
187576
|
187577
|
187578
|
187579
|
187580
|
192182
|
192183
|
192184
|
192185
|
192186
|
192187
|
192188
|
192189
| 192190