Bug 23638

Summary: Database cannot store an acquisitions discount of 100%
Product: Koha Reporter: Andrew Fuerste-Henry <andrew>
Component: AcquisitionsAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: azucena.aguayo, nick
Version: 19.05   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13520
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Andrew Fuerste-Henry 2019-09-18 21:14:19 UTC
The Koha database cannot store a discount of 100%. When setting up a vendor, if you enter a 100% default discount it will be stored in aqbooksellers as 99.9999%. When entering an order, if you enter a 100% discount it gets stored in aqorders as 99.9999%.

This is because the discount field is set up as a FLOAT 6,4 value.
Comment 1 Katrin Fischer 2019-09-22 10:59:46 UTC
So 100%  would be used to set the rental to 0, right?

Maybe we should consider fixing bug 13520 instead. The whole idea of discounting makes it a bit of a math puzzle right now. :(
Comment 2 Katrin Fischer 2019-09-22 21:33:32 UTC
Oh, acq! Could you explain the use case a bit?
Comment 3 Andrew Fuerste-Henry 2019-09-22 21:36:28 UTC
Actually, this is the discount in acquisitions, not the rental charge discount in circ. 
The values I'm looking at are stored in aqbooksellers.discount and aqorders.discount.
I've changed the bug name to make this more clear.
Comment 4 Andrew Fuerste-Henry 2019-09-22 21:39:44 UTC
The library in question is using acq discounts of 100% to track donations and the cost thereof without showing any actual spending. As donations are received, they are entered in acquisitions with their suggested retail price in Vendor Price but with a discount of 100%, charged to a Donations fund of $0. 

Except they were really ending up with a 99.9999% discount, which eventually led to a grand total of $0.01 spend against the Donations fund, which produced an over-budget error.