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

            Bug ID: 44165
           Summary: Use Koha::Item->effective_replacement_price for every
                    default replacement cost fallback
   Initiative type: ---
        Sponsorship ---
            status:
           Product: Koha
           Version: Main
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: Architecture, internals, and plumbing
          Assignee: [email protected]
          Reporter: [email protected]
        QA Contact: [email protected]
  Target Milestone: ---

The fallback to the default replacement cost of the item type exists in three
places that do not behave identically: Koha::Item->effective_replacement_price
(bug 43948), Koha::Account->add_lost_replacement_fee and
C4::Overdues::CalcFine. The comment in CalcFine already says "This must be
moved to Koha::Item".

Differences:
- An item type that cannot be resolved is skipped by CalcFine, makes
Koha::Account->add_lost_replacement_fee die (reported separately), and gives
the item price or 0 in the new method.
- An item type default of NULL leaves an undefined replacement price in
CalcFine, and gives 0 in the new method.
- CalcFine takes the item type from the item hash of its caller, the others use
the effective item type of the item.

Use Koha::Item->effective_replacement_price in the two others. Changing
CalcFine can change the fines it calculates, so it needs tests.

Test plan:
1. prove t/db_dependent/Koha/Item.t t/db_dependent/Koha/Account.t
t/db_dependent/Overdues.t t/db_dependent/Circulation/CalcFine.t
2. Check that an overdue item whose replacement price is empty and whose item
type has a default replacement cost is capped at that default when
useDefaultReplacementCost is on, and that a lost item is charged the same
amount
Expected: both use the same price whichever way the item type is resolved.

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to