Changeset 451 for trunk/finance/finance.php
- Timestamp:
- Oct 24, 2012, 10:42:58 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/finance/finance.php
r444 r451 170 170 $Cash = $Cash[0]; 171 171 172 $DbResult2 = $this->Database->query('SELECT SUM(Consumption) FROM Product WHERE (User='.$Member['Id'].') AND (Used = 1)'); 172 $DbResult2 = $this->Database->query('SELECT SUM(`Product`.`Consumption`) * `StockItem`.`Amount` '. 173 'FROM `StockItem` JOIN `Product` ON `Product`.`Id` = `StockItem`.`Product` '. 174 'WHERE (`StockItem`.`Location` = '.$Member['Id'].') AND (`StockItem`.`TimeElimination` IS NULL)'); 173 175 $ConsumptionPlus = $DbResult2->fetch_row(); 174 176 $ConsumptionPlus = $ConsumptionPlus[0]; … … 232 234 $RowP2 = $DbResult2->fetch_array(); 233 235 234 $DbResult2 = $this->Database->query('SELECT SUM(Price) AS Price, SUM(Consumption) AS Consumption FROM Product WHERE Segment='.$NetworkSegment['Id'].' AND Used=1'); 236 $DbResult2 = $this->Database->query('SELECT SUM(`Product`.`BuyPrice`) * `StockItem`.`Amount` AS `Price`, '. 237 'SUM(`Product`.`Consumption`) * `StockItem`.`Amount` AS `Consumption` '. 238 'FROM `StockItem` JOIN `Product` ON `Product`.`Id` = `StockItem`.`Product` '. 239 'WHERE (`StockItem`.`Segment`='.$NetworkSegment['Id'].') AND (`StockItem`.`TimeElimination` IS NULL)'); 235 240 $Row2 = $DbResult2->fetch_array(); 236 241 $DbResult2 = $this->Database->query('SELECT COUNT(*) FROM Member WHERE NetworkSegment='.$NetworkSegment['Id']);
Note:
See TracChangeset
for help on using the changeset viewer.