Bug 23323

Summary: Koha::RefundLostItemFeeRules->find() should require `branchcode`, `categorycode` and `itemtype`
Product: Koha Reporter: Martin Renvoize <martin.renvoize>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: katrin.fischer
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 18930, 18936    
Bug Blocks:    

Description Martin Renvoize 2019-07-16 12:59:01 UTC
We overload the find method in Koha::RefundLostItemFeeRules but we only test with branchcode calls and do not pupulate the database with sufficient test data to show that find would fail in a number of cases where a different rule may be present for distinct itemtypes or categorycodes per branch.
Comment 1 Jonathan Druart 2019-08-06 13:22:02 UTC
I think this is done on bug 18936:

Koha/CirculationRules.pm

 54 our $RULE_KINDS = {
 55     refund => {
 56         scope => [ 'branchcode' ],
 57         default_value => 1,
 58     },
Comment 2 Jonathan Druart 2019-08-06 13:25:05 UTC
Also this rule must not exist in the DB for different categories or itemtypes, you can only define it (via the interface) for different libraries.
Comment 3 Katrin Fischer 2020-03-30 21:53:00 UTC
Can this be closed with bug 18936 pushed?
Comment 4 Martin Renvoize 2020-03-31 06:44:07 UTC
Good call.. lets close it.