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 Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com> Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
This commit is contained in:
parent
65e65d7c37
commit
4fb88deaa7
1 changed files with 1 additions and 1 deletions
|
@ -304,7 +304,7 @@ sub GetBudgetSpent {
|
|||
my ($budget_id) = @_;
|
||||
my $dbh = C4::Context->dbh;
|
||||
my $sth = $dbh->prepare(qq|
|
||||
SELECT SUM(ecost * quantity) AS sum FROM aqorders
|
||||
SELECT SUM( COALESCE(unitprice, ecost) * quantity ) AS sum FROM aqorders
|
||||
WHERE budget_id = ? AND
|
||||
quantityreceived > 0 AND
|
||||
datecancellationprinted IS NULL
|
||||
|
|
Loading…
Reference in a new issue