Ignore:
Timestamp:
Mar 5, 2009, 10:16:12 PM (16 years ago)
Author:
george
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • www/finance/user_state.php

    r163 r165  
    3939    $User = $DbResult->fetch_assoc();
    4040    $Output .= 'Výpis operací pro účastníka '.$User['Name'].':<br>';
    41     $Output .= '<table style="font-size: smaller;" border="1" cellspacing="0" cellpadding="3"><tr><th>Datum</th><th>Popis</th><th>Částka</th><th>Doklad</th></tr>';
     41    $Output .= '<table style="font-size: smaller;" class="WideTable"><tr><th>Datum</th><th>Popis</th><th>Částka</th><th>Doklad</th></tr>';
    4242    $Operations = array();
    43     $DbResult = $this->Database->query('(SELECT Time, Value, Text, Bill FROM FinanceCashFlow WHERE Subject='.$Subject['Id'].') UNION ALL '.
    44       '(SELECT TimeCreation as Time, -Value as Value, Text, Bill FROM FinanceClaimsLiabilities WHERE Subject='.$Subject['Id'].') ORDER BY Time DESC');
     43    $DbResult = $this->Database->query('(SELECT Time, Value, Text, Bill FROM FinanceOperation WHERE (DestinationSubject='.$Subject['Id'].') AND (SourceSubject = '.$Finance->ExternalSubject.')) UNION ALL '.
     44      '(SELECT Time, -Value as Value, Text, Bill FROM FinanceOperation WHERE (SourceSubject='.$Subject['Id'].') AND (DestinationSubject='.$Finance->MainSubject.')) UNION ALL '.
     45          '(SELECT Time, -Value as Value, Text, Bill FROM FinanceOperation WHERE (SourceSubject='.$Subject['Id'].') AND (DestinationSubject='.$Finance->ExternalSubject.')) UNION ALL '.
     46          '(SELECT Time, Value, Text, Bill FROM FinanceOperation WHERE (DestinationSubject='.$Subject['Id'].') AND (SourceSubject = '.$Finance->MainSubject.')) '.
     47          'ORDER BY Time DESC');
    4548    while($DbRow = $DbResult->fetch_array())
    4649      $Operations[] = $DbRow;
     
    5053      if($Row['Value'] > 0) $Row['Value'] = '+'.$Row['Value'];
    5154      if($Row['Bill'] > 0) $Invoice = '<a href="bill.php?Id='.$Row['Bill'].'">PDF</a>'; else $Invoice = '&nbsp;';
    52       $Output .= '<tr><td align="right">'.HumanDate($Row['Time']).'</td><td>'.$Row['Text'].'</td><td style="text-align: right;">'.$Row['Value'].'</td><td style="text-align: center;">'.$Invoice.'</td></tr>';
     55      $Output .= '<tr><td style="text-align: right;">'.HumanDate($Row['Time']).'</td><td style="text-align: left;">'.$Row['Text'].'</td><td style="text-align: right;">'.$Row['Value'].'</td><td style="text-align: center;">'.$Invoice.'</td></tr>';
    5356    }
    5457    //echo('<tr><td>&nbsp;</td><td>-'.$Row2['network_device'].'</td><td>Proměnná cena za zařízení</td></tr>
    5558    $Output .= '</table>';
    56     $DbResult = $this->Database->query('SELECT ((SELECT COALESCE(SUM(Value), 0) FROM FinanceCashFlow WHERE Subject='.$Subject['Id'].') + '.
    57       '(SELECT COALESCE(SUM(-Value), 0) FROM FinanceClaimsLiabilities WHERE Subject='.$Subject['Id'].')) as Total');
     59    $DbResult = $this->Database->query('SELECT ('.
     60          '(SELECT COALESCE(SUM(Value), 0) FROM FinanceOperation WHERE (DestinationSubject='.$Subject['Id'].') AND (SourceSubject = '.$Finance->ExternalSubject.')) - '.
     61      '(SELECT COALESCE(SUM(Value), 0) FROM FinanceOperation WHERE (SourceSubject='.$Subject['Id'].') AND (DestinationSubject='.$Finance->MainSubject.')) - '.
     62          '(SELECT COALESCE(SUM(Value), 0) FROM FinanceOperation WHERE (SourceSubject='.$Subject['Id'].') AND (DestinationSubject = '.$Finance->ExternalSubject.')) + '.
     63      '(SELECT COALESCE(SUM(Value), 0) FROM FinanceOperation WHERE (DestinationSubject='.$Subject['Id'].') AND (SourceSubject='.$Finance->MainSubject.'))) as Total');
    5864    $DbRow = $DbResult->fetch_array();
    5965    $Total = $DbRow['Total'];
     
    6470
    6571        $Total = 0;
    66     $Output .= 'Rozpis měsíčního poplatku:<br><table border="1" cellspacing="0" cellpadding="3">'.
     72    $Output .= 'Rozpis měsíčního poplatku:<br><table class="WideTable">'.
    6773      '<tr><th>Část</th><th>Cena [Kč]</th></tr>'.
    6874      '<tr><td>Internet - tarif '.$TarifName.'</td><td>'.$TarifPrice.'</td></tr>';
     
    7884    {
    7985          $Output .= 'Měsíční příjem za spotřebu zařízení umístěných u uživatele:<br>';
    80       $Output .= '<table border="1" cellspacing="0" cellpadding="3"><tr><th>Název zařízení</th><th>Spotřeba [W]</th><th>Příjem [Kč]</th></tr>';
     86      $Output .= '<table class="WideTable"><tr><th>Název zařízení</th><th>Spotřeba [W]</th><th>Příjem [Kč]</th></tr>';
    8187      $DbResult = $this->Database->query('SELECT * FROM network_devices WHERE user='.$UserId.' AND used=1');
    8288      $TotalW = 0;
Note: See TracChangeset for help on using the changeset viewer.