lp1905028 lost items and price versus acq cost
authorJason Etheridge <jason@EquinoxOLI.org>
Fri, 28 May 2021 20:25:22 +0000 (16:25 -0400)
committerJason Etheridge <jason@EquinoxOLI.org>
Tue, 29 Jun 2021 19:00:55 +0000 (15:00 -0400)
commit023ef553797702a714e50d54e13140894c7fca67
tree5725bf25062ecdecb3ce5913d020528dd41bbfcc
parent0eca6018296b4b73590382c8387a607dddcd8619
lp1905028 lost items and price versus acq cost

This feature adds two new library settings:

    Use Item Price or Cost as Primary Item Value
    Use Item Price or Cost as Backup Item Value

which intersect the behavior of these existing settings:

    Charge lost on zero
    Default Item Price
    Minimum Item Price
    Maximum Item Price

Each of these settings affect how item price is used in
various contexts and is not limited to "lost" items, but
can affect notices, fine rules, and billings for long
overdue and damaged items (as well as lost items).

By default, the price field on items is the only field
considered by these various uses, but if we set, for
example, "Use Item Price or Cost as Primary Item Value" to
"cost", then we'll use the cost field instead of the price
field.

Alternately, if we set the "Backup Item Value" to "cost"
and either leave the "Primary Item Value" setting unset or
set to "price", then we'll consider the price field first,
and if it is either unset/null or equal to 0 (and
"Charge lost on zero" is true), then it'll fall-through to
the cost field.  We can also flip the behavior with these
settings and consider cost first and then price second.

Signed-off-by: Jason Etheridge <jason@EquinoxOLI.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm
Open-ILS/src/perlmods/lib/OpenILS/Const.pm
Open-ILS/src/perlmods/live_t/33-lp1905028-price-vs-cost.t [new file with mode: 0644]
Open-ILS/src/sql/Pg/950.data.seed-values.sql
docs/RELEASE_NOTES_NEXT/Circulation/acq_price.adoc [new file with mode: 0644]