Changeset 452 for trunk/finance/spotreba.php
- Timestamp:
- Oct 28, 2012, 10:20:32 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/finance/spotreba.php
r438 r452 16 16 $CelkovaSpotreba = 0; 17 17 $DbResult = $this->Database->query('SELECT * FROM NetworkSegment'); 18 while($Segment = $DbResult->fetch_a rray())18 while($Segment = $DbResult->fetch_assoc()) 19 19 { 20 $DbResult2 = $this->Database->query('SELECT SUM( Consumption) FROM Product WHERE Segment='.$Segment['Id'].' AND Used=1');21 $Row2 = $DbResult2->fetch_a rray();22 $CelkovaSpotreba = $CelkovaSpotreba + $Row2[ 0];23 $Output .= '<tr><td>'.$Segment['Name'].'</td><td align="right">'.$Row2[ 0].'</td><td align="right">'.$this->System->Modules['Finance']->W2Kc($Row2[0]).'</td></tr>';20 $DbResult2 = $this->Database->query('SELECT SUM(Product.Consumption) AS Consumption FROM StockItem JOIN Product ON Product.Id = StockItem.Product WHERE (StockItem.Segment='.$Segment['Id'].') AND (StockItem.TimeElimination IS NULL)'); 21 $Row2 = $DbResult2->fetch_assoc(); 22 $CelkovaSpotreba = $CelkovaSpotreba + $Row2['Consumption']; 23 $Output .= '<tr><td>'.$Segment['Name'].'</td><td align="right">'.$Row2['Consumption'].'</td><td align="right">'.$this->System->Modules['Finance']->W2Kc($Row2['Consumption']).'</td></tr>'; 24 24 } 25 25 $Output .= '<tr style="font-weight: Bold;"><td><strong>Celkem</strong></td><td align="right">'.$CelkovaSpotreba.'</td><td align="right">'.$this->System->Modules['Finance']->W2Kc($CelkovaSpotreba).'</td></tr>';
Note:
See TracChangeset
for help on using the changeset viewer.