Bug 27950 - Add a script to automatically deprecate replacement costs based on age
Summary: Add a script to automatically deprecate replacement costs based on age
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-12 15:06 UTC by Andrew Fuerste-Henry
Modified: 2021-03-12 17:01 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.