Ejemplo n.º 1
0
            <th>% от план.</th>
            <th>% от факт.</th>
            <th>наценка план</th>
            <th>наценка факт</th>
            <th>отклон (+,-)</th>
            <!-- <th>тренд ср.стат.</th>-->
        </tr>
        </thead>
        <tbody>
        <?php 
foreach ($model as $val) {
    //$beforeDates = date('Y-m-d',strtotime($dates)-86400);
    $costPrice = $expense->getDepCost($val['department_id'], $dates);
    $realized = $depRealize->getDepRealizesSumm($dates, $val['department_id']);
    $inRealized = $depRealize->getDepInRealizesSumm($dates, $val['department_id']);
    $inexp = $depRealize->getDepInExp($dates, $val['department_id']);
    $price = $expense->getDepIncome($val['department_id'], $dates);
    $tempBalance = $balance->getDepBalanceSumm($dates, $val['department_id']);
    //$beforeTempBalance = $balance->getDepBalanceSumm($beforeDates,$val['department_id']);
    //$beforeCostPrice = $expense->getDepCost($val['department_id'],$beforeDates);
    //$beforePrice = $expense->getDepIncome($val['department_id'],$beforeDates);
    $sumCostPrice = $sumCostPrice + $costPrice;
    $sumPrice = $sumPrice + $price;
    $startCount = $startCount + $tempBalance[0];
    $endCount = $endCount + $tempBalance[1];
    $curEndCount = $curEndCount + $tempBalance[2];
    $sumRealized = $sumRealized + $realized;
    $sumInRealized = $sumInRealized + $inRealized;
    $sumInExp = $sumInExp + $inexp;
    //$beforeSumCostPrice = $beforeSumCostPrice + $beforeCostPrice;
    //$beforeSumPrice = $beforeSumPrice + $beforePrice;