Ignore:
Timestamp:
Jun 1, 2009, 11:07:05 AM (16 years ago)
Author:
george
Message:
  • Opraveno: Stav účtu u měsíčních plateb byl posunut o poslední platbu.
  • Upraveno: Zobrazovat stav účtu ve výpisu uživatele nahoře.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/finance/user_state.php

    r207 r227  
    4242    $Output = '<table width="100%" border="0" cellspacing="0" cellpadding="3"><tr><td valign="top">';
    4343
     44    $UserOperationTableQuery = '((SELECT Text, Time, Value AS Value, Bill FROM FinanceOperation WHERE (Subject='.$Subject['Id'].')) UNION ALL '.
     45      '(SELECT Text, TimeCreation as Time, -Value as Value, Bill FROM FinanceClaimsLiabilities WHERE (Subject='.$Subject['Id'].')) ORDER BY Time DESC) AS T1';
     46    $DbResult = $this->Database->query('SELECT SUM(T1.Value) AS Total FROM '.$UserOperationTableQuery);
     47    $DbRow = $DbResult->fetch_array();
     48    $Total = $DbRow['Total'];
     49    $Output .= 'Stav účtu: <strong>'.$Total.' Kč</strong<br /><br />';
     50
    4451    // Tabulka operaci
    45     $Output .= 'Výpis operací pro subjekt '.$Subject['Name'].':<br>';
     52    $Output .= 'Výpis operací pro subjekt '.$Subject['Name'].':<br />';
    4653    $Output .= '<table style="font-size: smaller;" class="WideTable"><tr><th>Datum</th><th>Popis</th><th>Částka</th><th>Doklad</th></tr>';
    4754    $Operations = array();
    48     $UserOperationTableQuery = '((SELECT Text, Time, Value AS Value, Bill FROM FinanceOperation WHERE (Subject='.$Subject['Id'].')) UNION ALL '.
    49       '(SELECT Text, TimeCreation as Time, -Value as Value, Bill FROM FinanceClaimsLiabilities WHERE (Subject='.$Subject['Id'].')) ORDER BY Time DESC) AS T1';
    5055    $DbResult = $this->Database->query('SELECT T1.* FROM '.$UserOperationTableQuery);
    5156    while($DbRow = $DbResult->fetch_array())
     
    6065    //echo('<tr><td>&nbsp;</td><td>-'.$Row2['network_device'].'</td><td>Proměnná cena za zařízení</td></tr>
    6166    $Output .= '</table>';
    62     $DbResult = $this->Database->query('SELECT SUM(T1.Value) AS Total FROM '.$UserOperationTableQuery);
    63     $DbRow = $DbResult->fetch_array();
    64     $Total = $DbRow['Total'];
    65     $Output .= '<h3><strong>Stav účtu: </strong>'.$Total.' Kč</h3><br>';
    6667    $Output .= '</td><td valign="top">';
    6768
Note: See TracChangeset for help on using the changeset viewer.