Ignore:
Timestamp:
Oct 24, 2012, 10:42:58 PM (12 years ago)
Author:
chronos
Message:
  • Upraveno: Korekce tabulek Product a StockItem.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/finance/index.php

    r438 r451  
    5757    $TotalGain = 0;
    5858    $TotalExpense = 0;
    59     $DbResult = $this->Database->query('SELECT SUM(Consumption) FROM Product WHERE Used=1');
     59    $DbResult = $this->Database->query('SELECT SUM(Product.Consumption) * StockItem.Amount FROM StockItem '.
     60      'JOIN Product ON Product.Id=StockItem.Product WHERE (StockItem.TimeElimination IS NULL)');
    6061    $Row = $DbResult->fetch_array();
    6162    $TotalConsumption = $this->System->Modules['Finance']->W2Kc($Row[0]);
Note: See TracChangeset for help on using the changeset viewer.