[OPEN-ILS-GENERAL] [RFC] Price (or percent thereof) as max fine amount.

Geoff Sinclair geoffs at eclibrary.ca
Mon Jul 28 11:34:46 EDT 2008


This is great. We do a lot of tweaking of fines, and it would be great 
to define system rules to take care of this.

One more tweak: if the price is below a certain threshold, we might want 
to use a minimum. For example, a $5.00 paperback is going to cost more 
to replace than $2.50. So, if you set a threshold at $10.00, that would 
be used as a maximum until the percentage rule kicks in. This would also 
take care of strange, but still possible, values such as $0.01.

Geoff

Mike Rylander wrote:
> We've had requests in the past for the ability to use an item's price
> as the max fine amount on a circulation, instead of a predefined
> amount.  Because of how rules are defined and chosen in Evergreen
> today, the solution to this request had not presented itself in a
> clear and consistent manner.  However, John Craig of Alpha-G
> Consulting (another firm getting into the  Evergreen support and
> migration biz) was wondering about a specialization of this idea and
> how it might be implemented.  He has had a request to be able to use a
> percentage of the item price as the max fine amount -- and this, it
> turns out, is the twist that finally made the solution stand out,
> bright as day as if it had always been right there, as a consistent
> and general extension of the existing framework.
>
> John and I went to our separate corners and dummied up a plan for
> this, and it turns out that we both saw the same solution.  Here
> attached is an implementation of that solution, which works thusly:
>
> * The config.rule_max_fine table gets a new boolean column called
> is_percent which defaults to false
> * The IDL (and, for good measure, the storage server's ancient
> equivelant) is taught about this new field
> * OpenILS::Circ::Circulate::build_checkout_circ_object inspects this
> field on the chosen rule for truthiness, and finding a positive
> result:
>   - gets the item price from the copy and
>   - if that's null (not allowed yet, but will be in 1.4) attempts to
> find an org_unit-appropriate default item price (also used for LOST
> fee)
>   - or, if price == 0 and the "charge default on 0-price" org unit
> setting is true, attempts to find an org_unit-appropriate default item
> price (also used for LOST fee)
>   - and now, having found an appropriate full price for the item,
> interprets the max fine amount as a percentage value, scaling the full
> price as specified
>   - and finally, uses that amount as the max fine amount, instead of a
> specific value
>
> As an example, say you have an item being checked out and the max fine
> rule chosen for this circulation looks like this:
>
>   name = up_to_half_of_price
>   amount = 50.00
>   is_percent = true
>
> and the item price is 20.00.  The max fine for that circ would be set
> to 10.00 ...
>
> Another example with the same rule, but the copy has a null (in 1.4)
> price or a price of 0.00 and "charge default on 0-price" org unit
> setting is in effect, and that default price is 25.00.  The max fine
> would be set to 12.50.
>
> And, finally, if the max fine amount is 100.00, the full price of the
> copy or the default price (the original request) would be used.  We
> have come full circle.
>
> Thoughts?
>
>   



More information about the Open-ils-general mailing list