[Koha-bugs] [Bug 28774] Warnings from GetIssuingCharge when rental discount is not set

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Aug 30 20:56:12 CEST 2021


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

Joonas Kylmälä <joonas.kylmala at iki.fi> changed:

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

--- Comment #3 from Joonas Kylmälä <joonas.kylmala at iki.fi> ---
Created attachment 124253
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=124253&action=edit
Bug 28774: Don't store blank values for rental discount

This patch adds 'can_be_blank => 0' for the rentaldiscount rule to prevent
storing blank values in the database

Additionally, if there is no charge we do not need to check for a discount
and can simply return

To test:
1 - Set rental discount to "" to a rule in circulation rules
2 - Checkout an item that will follow this rule
3 - Check the intranet log:
    [WARN] Argument "" isn't numeric in subtraction (-) at
/kohadevbox/koha/C4/Circulation.pm line 3385.
4 - Apply patch and restart all
5 - Update database
6 - Set the rule to "" again
7 - Check the DB, no rule is stored
    SELECT * FROM circulation_rules WHERE rule_name = 'rentaldiscount';
8 - Checkout the item again
9 - No warns in log

Signed-off-by: David Nind <david at davidnind.com>

Signed-off-by: Joonas Kylmälä <joonas.kylmala at iki.fi>

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


More information about the Koha-bugs mailing list