Changeset 160


Ignore:
Timestamp:
Feb 18, 2009, 12:16:11 PM (15 years ago)
Author:
george
Message:
  • Přidáno: Částečná podpora pro dokladové řady.
  • Přidáno: Zobrazování měsíčních investic v přehledu.
Location:
devel/www
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • devel/www/finance/include.php

    r87 r160  
    6666        break;
    6767      case 3:
    68         $Tarify[$Index]['price'] = 0;
     68        $Tarify[$Index]['price'] = $BaseTariffPrice + round($TopTariffPrice * $Tarif['price_units']);
    6969        $Tarify[$Index]['min_speed'] = $Tarify[$Index]['min_speed'] * 1024;
    7070        $Tarify[$Index]['max_speed'] = $Tarify[$Index]['max_speed'] * 1024;
     
    120120}
    121121
     122function GetNextDocumentLineNumber($Id)
     123{
     124  global $Database;
     125
     126  $DbResult = $Database->query('SELECT Shortcut, NextNumber FROM DocumentLine WHERE Id='.$Id);
     127  $DbRow = $DbResult->fetch_assoc();
     128  $Result = $DbRow['Shortcut'].$DbRow['NextNumber'];
     129  $Database->query('UPDATE DocumentLine SET NextNumber = NextNumber + 1 WHERE Id='.$Id);
     130  return($Result);
     131}
     132
     133
    122134?>
  • devel/www/finance/index.php

    r107 r160  
    1515
    1616    $Output .= '<table><tr><td width="30%">';
     17        if(GetMemberByIP(GetRemoteAddress()) > 0) $Output .= '<a href="user_state.php">Vaše finanční operace</a><br /><br /><br />';
     18       
     19    $Output .= '<a href="monthly_overall.php">Měsíční přehledy</a><br />';
     20    $Output .= '<a href="tarify.php">Tarify</a><br />';
    1721    $Output .= '<a href="zarizeni.php">Výpis zařízení</a><br />';
    1822    if($this->System->Modules['User']->CheckPermission('Finance', 'SubjectList')) $Output .= '<a href="clenove.php">Seznam členů</a><br />';
    1923    $Output .= '<a href="spotreba.php">Spotřeba energie</a><br />';
    2024    $Output .= '<a href="'.$Config['Web']['RootFolder'].'/aktuality/index.php?category=9">Investice v síti</a><br />';
    21     $Output .= '<a href="monthly_overall.php">Měsíční přehledy</a><br />';
    22     $Output .= '<a href="faktury/">Faktury za internet</a><br />';
    23     $Output .= '<a href="tarify.php">Tarify</a><br />';
    24     $Output .= '<a href="inventory.php">Výpis skladových zásob</a><br />';
     25    //$Output .= '<a href="faktury/">Faktury za internet</a><br />';
     26    //$Output .= '<a href="inventory.php">Výpis skladových zásob</a><br />';
    2527    $Output .= '</td><td width="50%">';
    2628
     
    3133    $DbResult = $this->Database->query("SELECT * FROM finance_monthly_overall ORDER BY date DESC LIMIT 0,1");
    3234    $Row = $DbResult->fetch_array();
    33     $Output .= 'Aktuální měsíční poplatek za společný internet ('.$RealMaxSpeed.'/'.$RealMaxSpeed.' kbit/s): <strong>'.$Internet.' Kč</strong><br />';
     35    $Output .= 'Platba za internetovou linku ('.$RealMaxSpeed.'/'.$RealMaxSpeed.' kbit/s): <strong>'.$Internet.' Kč</strong><br />';
    3436
    3537    $DbResult = $this->Database->query("SELECT COUNT(*) FROM users WHERE role=2");
    3638    $Row2 = $DbResult->fetch_array();
    37     $Output .= 'Počet členů (s internetem): <strong>'.$Row2[0].' ('.$InternetUsers.')</strong><br />';
     39    $Output .= 'Počet účastníků: <strong>'.$Row2[0].'</strong><br />';
    3840
    3941    $DbResult = $this->Database->query("SELECT SUM(price) FROM network_devices WHERE used=1");
     
    5052    $TotalFamily = 600;
    5153    $Output .= 'V připojených domácnostech celkem <strong>'.$Row5[0].'</strong> občanů ze všech <strong>'.$TotalFamily.'</strong> ('.round($Row5[0] / $TotalFamily * 100).' %)<br />';
    52     $Output .= 'IČO: <strong>75904535</strong><br />'.
     54    $Output .= 'IČ: <strong>75904535</strong><br />'.
    5355    'DIČ: <strong>CZ8303255884</strong><br />'.
    5456    'Bankovní účet: <strong>218098370 / 0300</strong><br />'.
  • devel/www/finance/manage.php

    r132 r160  
    357357    while($Bill = $DbResult->fetch_array())
    358358    {
    359       file_put_contents('doklady/faktura_'.$Bill['id'].'.pdf', $Bill['pdf']);
     359      file_put_contents('doklady/doklad_'.$Bill['id'].'.pdf', $Bill['pdf']);
    360360      echo($Bill['id'].',');
     361    }
     362  }
     363
     364  function CheckPDFFiles()
     365  {
     366    global $Database, $InvoiceGenerator;
     367
     368    $DbResult = $this->Database->query('SELECT * FROM finance_bills');
     369    while($Bill = $DbResult->fetch_array())
     370    {
     371      file_put_contents('doklady2/doklad-'.$Bill['id'].'.pdf', file_get_contents('doklady/doklad-'.$Bill['id'].'.pdf'));
     372      //echo($InvoiceGenerator->HasPDFFile($Bill['id']).',');
    361373    }
    362374  }
  • devel/www/finance/monthly_overall.php

    r87 r160  
    1212    global $MonthNames;
    1313
    14     $Output = '<table cellspacing="0" cellpadding="2" border="1"><tr><th>Rok</th><th>Měsíc</th><th>Internet [Kč]</th><th>Účastníků</th><th>Správa [Kč/účastníka]</th><th>Správa [Kč]</th><th>Spotřeba [Kč/kWh]</th><th>Spotřeba [Kč]</th><th>Obrat [Kč]</th><th>Průměrná cena [Kč/účastníka]</th></tr>';
     14    $Output = '<table cellspacing="0" cellpadding="2" border="1"><tr><th>Rok</th><th>Měsíc</th><th>Internet [Kč]</th><th>Účastníků</th><th>Správa [Kč/účastníka]</th><th>Správa [Kč]</th><th>Spotřeba [Kč/kWh]</th><th>Spotřeba [Kč]</th><th>Obrat [Kč]</th><th>Průměrná cena [Kč/účastníka]</th><td align="center">'.$Month['investment'].'</td></tr>';
    1515    $Total = array('money' => 0, 'administration_total' => 0, 'consumption_total' => 0, 'total_paid' => 0);
    1616    $DbResult = $this->Database->select('finance_monthly_overall', '*', '1 ORDER BY date DESC');
     
    2424      $Total['consumption_total'] += $Month['consumption_total'];
    2525      $Total['total_paid'] += $Month['total_paid'];
     26          $Total['investment'] += $Month['investment'];
    2627      //if($DateParts[1] == '01') echo('<tr><td style="font-size: 4;" colspan="10">&nbsp;</td></tr>');
    2728    }
Note: See TracChangeset for help on using the changeset viewer.