Bug 4831

Summary: Actual Price being ignored after receive
Product: Koha Reporter: Nicole C. Engard <nengard>
Component: AcquisitionsAssignee: Srdjan Jankovic <srdjan>
Status: CLOSED FIXED QA Contact: Bugs List <koha-bugs>
Severity: critical    
Priority: PATCH-Sent (DO NOT USE) CC: chris, koha.sekjal
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: Sponsored Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on:    
Bug Blocks: 959    
Attachments: actual price receipt
amount encumbered on main acq page doesn't match
patch
bug_4831: Use unitprice (actual cost) when totalling spent amounts for "All available funds", as in "Already received"

Description Nicole C. Engard 2010-05-27 16:56:59 UTC
Created attachment 2180 [details]
actual price receipt

See attached.  I changed the actual price to very high numbers and saved.  When I see the receipt of my payments it shows the right actual price, but when I look at the amount encumbered on the main acq page it is not showing the right amount.
Comment 1 Nicole C. Engard 2010-05-27 16:57:19 UTC
Created attachment 2181 [details]
amount encumbered on main acq page doesn't match
Comment 2 Nicole C. Engard 2011-08-02 21:33:37 UTC
How is it that no one else finds this a problem? Reported over a year ago and still no comments ... anyone have any ideas??
Comment 3 Katrin Fischer 2011-08-02 21:40:22 UTC
Hi Nicole, 
I agree with you this is an evil bug. It's on my personal list of things I would really love to see fixed.
Comment 4 Nicole C. Engard 2011-08-02 23:43:25 UTC
A bit of testing has found that 'budgeted cost' is what's used - but actual cost is shown on the list of 'already received' items.  If that helps solve the problem at all.
Comment 5 Srdjan Jankovic 2011-09-07 04:06:23 UTC Comment hidden (obsolete)
Comment 6 Nicole C. Engard 2011-09-13 11:48:47 UTC
*** Bug 5796 has been marked as a duplicate of this bug. ***
Comment 7 Katrin Fischer 2011-09-18 20:29:46 UTC
Created attachment 5453 [details] [review]
bug_4831: Use unitprice (actual cost) when totalling spent amounts for "All available funds", as in "Already received"

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>

To test:
- add new fund for an active budget
- order item, price 8.00
- check funds page and acq home: committed amount should be 8.00
- receive item, enter actual price 10.00
- check funds page and acq home: spent amount should be 10.00
Comment 8 Ian Walls 2011-09-22 01:59:52 UTC
Modifies SQL query to take the first non-NULL value of (unitprice, ecost); if unitprice is NULL, then proceed as before.  However, if unitprice is set, use that value instead.

Easy to read, marking as Passed QA.
Comment 9 Chris Cormack 2011-09-22 15:49:44 UTC
Pushed, please test
Comment 10 Katrin Fischer 2011-10-26 15:45:44 UTC
Tested on 3.6/current master.

The actual price given when receiving an item is now correctly used for calculation of the spent values for budgets on the acquisition start page and funds page.