Bug 27950

Summary: Add a script to automatically deprecate replacement costs based on age
Product: Koha Reporter: Andrew Fuerste-Henry <andrew>
Component: Command-line UtilitiesAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: jzairo, robin
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:
Circulation function:

Description Andrew Fuerste-Henry 2021-03-12 15:06:30 UTC
It would be useful to have an automated process for adjusting items.replacement price based on age -- some libraries do not wish to charge the full purchase price for an item that's older.

At its simplest, this could be just

UPDATE items SET replacementprice=(replacementprice * X) WHERE replacementpricedate < date_sub(curdate(),interval Y day);

With X and Y set in flags on a cronjob.

We could go one better and add a syspref to allow those values to be set within the staff interface.

Or we could do better still and add a more complicated syspref to take some YAML defining different X and Y values per itemtype.