Ignore:
Timestamp:
May 1, 2009, 12:13:50 PM (15 years ago)
Author:
george
Message:
  • Upraveno: Tabulka finance_tariffs přejmenována na FinanceTariff a přepracována její struktura podle aktuálních potřeb. Do tabulky uloženy průběžné výpočty jako sloupec MemberCount či dynamicky přepočítavaný sloupce SpeedMin. Zrušeno přepočítávání ceny a rychlosti dle cenových jednotek a rychlostních jednotek.
  • Přidáno: Sloupec Hire v tabulce Member sloužící pro záznam placení nájmu členům.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/finance/user_state.php

    r179 r204  
    3838    $DbResult = $this->Database->query('SELECT * FROM Member LEFT JOIN MemberPayment ON MemberPayment.Member=Member.Id WHERE Member.Subject='.$Subject['Id']);
    3939    $Member = $DbResult->fetch_assoc();
    40     $TarifName = $Finance->Tarify[$Member['InternetTariffCurrentMonth']]['name'];
    41           $TarifPrice = $Finance->Tarify[$Member['InternetTariffCurrentMonth']]['price'];
     40    $TarifName = $Finance->Tariffs[$Member['InternetTariffCurrentMonth']]['Name'];
     41          $TarifPrice = $Finance->Tariffs[$Member['InternetTariffCurrentMonth']]['Price'];
    4242    $Output = '<table width="100%" border="0" cellspacing="0" cellpadding="3"><tr><td valign="top">';
    4343
     
    6868    $Output .= 'Variabilní symbol pro platby: <strong>'.$Subject['Id'].'</strong><br><br>';
    6969
    70         $Total = 0;
     70          $Total = 0;
    7171    $Output .= 'Rozpis měsíčního poplatku:<br><table class="WideTable">'.
    7272      '<tr><th>Část</th><th>Cena [Kč]</th></tr>'.
    7373      '<tr><td>Internet - tarif '.$TarifName.'</td><td>'.$TarifPrice.'</td></tr>';
    74         $Total += $TarifPrice;
    75         if($Member['MonthlyPlus'] != 0)
    76       $Output .= '<tr><td>Příjem za spotřebu</td><td>'.(-$Member['MonthlyPlus'])  .'</td></tr>';
    77         $Total += -$Member['MonthlyPlus'];
     74    $Total += $TarifPrice;
     75          if($Member['Hire'] != 0)
     76    {
     77      $Output .= '<tr><td>Nájem</td><td>'.(-$Member['Hire']).'</td></tr>';
     78            $Total -= $Member['Hire'];
     79    }
     80          if($Member['MonthlyPlus'] != 0)
     81    {
     82      $Output .= '<tr><td>Příjem za spotřebu</td><td>'.(-$Member['MonthlyPlus']).'</td></tr>';
     83            $Total -= $Member['MonthlyPlus'];
     84    }
    7885    $Output .= '<tr><td><strong>Celkem</strong></td><td><strong>'.$Total.'</strong></td></tr></table>';
    7986    //echo('Tarif pro příští měsíc: '.$Tarify[$Row2['inet_tarif_next']]['name'].'<br><br>');
     
    8289    if($Member['MonthlyPlus'] != 0)
    8390    {
    84           $Output .= 'Měsíční příjem za spotřebu zařízení umístěných u uživatele:<br>';
     91      $Output .= 'Měsíční příjem za spotřebu zařízení umístěných u uživatele:<br>';
    8592      $Output .= '<table class="WideTable"><tr><th>Název zařízení</th><th>Spotřeba [W]</th><th>Příjem [Kč]</th></tr>';
    8693      $DbResult = $this->Database->query('SELECT * FROM network_devices WHERE user='.$Member['Id'].' AND used=1');
Note: See TracChangeset for help on using the changeset viewer.