Bug 23638 - Database cannot store an acquisitions discount of 100%
Summary: Database cannot store an acquisitions discount of 100%
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: 19.05
Hardware: All All
: P5 - low normal (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-18 21:14 UTC by Andrew Fuerste-Henry
Modified: 2019-09-22 21:39 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.