Lines 560-573
sub GetBudgetHierarchy {
Link Here
|
560 |
SUM( COALESCE(unitprice_tax_included, ecost_tax_included) * quantity ) AS budget_spent |
560 |
SUM( COALESCE(unitprice_tax_included, ecost_tax_included) * quantity ) AS budget_spent |
561 |
FROM aqorders JOIN aqbudgets USING (budget_id) |
561 |
FROM aqorders JOIN aqbudgets USING (budget_id) |
562 |
WHERE quantityreceived > 0 AND datecancellationprinted IS NULL |
562 |
WHERE quantityreceived > 0 AND datecancellationprinted IS NULL |
563 |
GROUP BY budget_id |
563 |
GROUP BY budget_id, budget_parent_id |
564 |
|, 'budget_id'); |
564 |
|, 'budget_id'); |
565 |
my $hr_budget_ordered = $dbh->selectall_hashref(q| |
565 |
my $hr_budget_ordered = $dbh->selectall_hashref(q| |
566 |
SELECT aqorders.budget_id, aqbudgets.budget_parent_id, |
566 |
SELECT aqorders.budget_id, aqbudgets.budget_parent_id, |
567 |
SUM(ecost_tax_included * quantity) AS budget_ordered |
567 |
SUM(ecost_tax_included * quantity) AS budget_ordered |
568 |
FROM aqorders JOIN aqbudgets USING (budget_id) |
568 |
FROM aqorders JOIN aqbudgets USING (budget_id) |
569 |
WHERE quantityreceived = 0 AND datecancellationprinted IS NULL |
569 |
WHERE quantityreceived = 0 AND datecancellationprinted IS NULL |
570 |
GROUP BY budget_id |
570 |
GROUP BY budget_id, budget_parent_id |
571 |
|, 'budget_id'); |
571 |
|, 'budget_id'); |
572 |
my $hr_budget_spent_shipment = $dbh->selectall_hashref(q| |
572 |
my $hr_budget_spent_shipment = $dbh->selectall_hashref(q| |
573 |
SELECT shipmentcost_budgetid as budget_id, |
573 |
SELECT shipmentcost_budgetid as budget_id, |
574 |
- |
|
|