https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35612

--- Comment #41 from Martin Renvoize (ashimema) 
<[email protected]> ---
Created attachment 192518
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192518&action=edit
Bug 35612: Add tests for chargelostitem branch context

Adds test coverage for C4::Accounts::chargelostitem to verify that
LOST and PROCESSING fee debits correctly record branchcode based on
LostChargesControl and HomeOrHoldingBranch system preferences.

Tests verify all scenarios:

1. LostChargesControl behavior:
   - PatronLibrary: Uses patron's home branch
   - ItemHomeLibrary + homebranch: Uses item's home library
   - ItemHomeLibrary + holdingbranch: Uses item's holding library
2. Explicit library_id override:
   - When library_id is passed in options, it takes precedence
3. Deduplication logic:
   - Prevents duplicate LOST charges for same itemnumber+issue_id
   - Regression test for item_id column name bug
4. Issue_id handling:
   - Correctly looks up issue_id when not provided
   - Handles bundled items (looks up host item's checkout)
5. Processing fees:
   - Honors the same branch logic as LOST fees
   - Correctly applies lost_item_processing_fee circulation rule
     using the appropriate branch context

This test subtest was added to the existing "C4::Accounts::chargelostitem
tests"
section and increases the test plan from 4 to 5 subtests.

Signed-off-by: Trevor Diamond <[email protected]>
Signed-off-by: Martin Renvoize <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to