[Koha-bugs] [Bug 34279] overduefinescap of 0 is ignored, but overduefinescap of 0.00 is enforced

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Jul 19 15:07:28 CEST 2023


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34279

Martin Renvoize <martin.renvoize at ptfs-europe.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #153485|0                           |1
        is obsolete|                            |

--- Comment #13 from Martin Renvoize <martin.renvoize at ptfs-europe.com> ---
Created attachment 153649
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153649&action=edit
Bug 34279: Don't enforce overduefinescap unless it is greater than 0

When creating a circ rule, we can set overduefinescap to blank or 0 and no cap
is enforced. If we edit that rule, the blank/0 is converted to "0.00" which
perl considers true, thus zero-ing out any calculated fine.

Considering we've always ignored an overdue fines cap of 0, we should also
ignore 0.00. However, perl is evaluating it as a string which makes it true
instead of false as 0 is.

Test Plan:
1) Apply the first patch ( unit tests )
2) prove t/db_dependent/Circulation/CalcFine.t
3) Note the test fails
4) Apply the second patch as well
5) prove t/db_dependent/Circulation/CalcFine.t
6) Note the test passes

Test Plan 2:
1) Create an all/all/all rule with an overduefinescap of 0.00, with a
   daily fine. Enable CalculateFinesOnReturn
2) Backdate a checkout so it is overdue
3) Return this item, note the lack of a fine
4) Apply this patch set
5) Backdate a checkout and return it again
6) Note the fine is generated!

Signed-off-by: Katrin Fischer <katrin.fischer at bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list