[OPEN-ILS-DEV] Respecting max fine when not a multiple of recurring fine

Jeff Davis jdavis at sitka.bclibraries.ca
Tue Apr 14 14:56:14 EDT 2009


Hi all,

Fine amounts in Evergreen can exceed the value of max_fine if that value
is not a multiple of recuring_fine.  For example, one of the sites in
the Sitka consortium has items with a $0.30/day recurring fine and a
maximum fine of $5.00; in this situation, fines stop at $5.10 rather
than $5.00.

The attached patch fixes the problem by reducing the amount billed when
the total fines on an item hit the threshold.  In the example above,
when the item is at $4.80 in fines, the subsequent and final billing
would be for $0.20 rather than $0.30 so as not to exceed the max fine
amount.

Is this fix suitable for other contexts?  It alters existing behavior
and I haven't made it a configurable setting.

Also, I haven't submitted a patch before, so please let me know if I
screwed it up. :)
--
Jeff Davis
Sitka Implementation Team

-------------- next part --------------
A non-text attachment was scrubbed...
Name: action.pm.patch
Type: text/x-diff
Size: 762 bytes
Desc: not available
Url : http://libmail.georgialibraries.org/pipermail/open-ils-dev/attachments/20090414/535bf55a/attachment.patch 
-------------- next part --------------

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

Signed-off-by: 
Jeff Davis
jdavis at sitka.bclibraries.ca



More information about the Open-ils-dev mailing list