Ignore:
Timestamp:
Dec 29, 2014, 12:09:46 AM (10 years ago)
Author:
chronos
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Finance/Finance.php

    r709 r710  
    203203      $Cash = $Cash[0];
    204204
    205       $DbResult2 = $this->Database->query('SELECT SUM(`Product`.`Consumption`) * `StockItem`.`Amount` '.
    206           'FROM `StockItem` JOIN `Product` ON `Product`.`Id` = `StockItem`.`Product` '.
    207           'WHERE (`StockItem`.`Location` = '.$Member['Id'].') AND (`StockItem`.`TimeElimination` IS NULL)');
     205      $DbResult2 = $this->Database->query('SELECT SUM(`Product`.`Consumption`) * `StockSerialNumber`.`Amount` '.
     206          'FROM `StockSerialNumber` JOIN `Product` ON `Product`.`Id` = `StockSerialNumber`.`Product` '.
     207          'WHERE (`StockSerialNumber`.`Location` = '.$Member['Id'].') AND (`StockSerialNumber`.`TimeElimination` IS NULL)');
    208208      $ConsumptionPlus = $DbResult2->fetch_row();
    209209      $ConsumptionPlus = $ConsumptionPlus[0];
     
    265265      $RowP2 = $DbResult2->fetch_array();
    266266
    267       $DbResult2 = $this->Database->query('SELECT SUM(`Product`.`BuyPrice`) * `StockItem`.`Amount` AS `Price`, '.
    268           'SUM(`Product`.`Consumption`) * `StockItem`.`Amount` AS `Consumption` '.
    269           'FROM `StockItem` JOIN `Product` ON `Product`.`Id` = `StockItem`.`Product` '.
    270           'WHERE (`StockItem`.`Segment`='.$NetworkSegment['Id'].') AND (`StockItem`.`TimeElimination` IS NULL)');
     267      $DbResult2 = $this->Database->query('SELECT SUM(`Product`.`BuyPrice`) * `StockSerialNumber`.`Amount` AS `Price`, '.
     268          'SUM(`Product`.`Consumption`) * `StockSerialNumber`.`Amount` AS `Consumption` '.
     269          'FROM `StockSerialNumber` JOIN `Product` ON `Product`.`Id` = `StockSerialNumber`.`Product` '.
     270          'WHERE (`StockSerialNumber`.`Segment`='.$NetworkSegment['Id'].') AND (`StockSerialNumber`.`TimeElimination` IS NULL)');
    271271      $Row2 = $DbResult2->fetch_array();
    272272      $DbResult2 = $this->Database->query('SELECT COUNT(*) FROM Member WHERE NetworkSegment='.$NetworkSegment['Id']);
Note: See TracChangeset for help on using the changeset viewer.