lp1905028 lost items and price versus acq cost
authorJason Etheridge <jason@EquinoxOLI.org>
Fri, 28 May 2021 20:25:22 +0000 (16:25 -0400)
committerGarry Collum <gcollum@gmail.com>
Wed, 7 Jul 2021 19:06:50 +0000 (15:06 -0400)
commita6a3b26d948f44c01d9ef90a0b9e90df00cddcb8
treefb4507deec2ef5289757800c64aaff9d53f4dba3
parenta7d44eb8c4ce0e33dcd5901c30a080e3f593c928
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>
Signed-off-by: Garry Collum <gcollum@gmail.com>
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]