Changeset 413


Ignore:
Timestamp:
Oct 7, 2012, 4:35:04 PM (12 years ago)
Author:
chronos
Message:
  • Upraveno: Zobrazení čísla účtu a variabilního symbolu v emailu.\n* Upraveno: Odesílání emailů pomocí třídy Mail.
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/finance/manage.php

    r409 r413  
    105105    if(array_key_exists('generate', $_GET))
    106106    {
    107       $Output .= $this->System->Modules['Bill']->CreateBill(1, array(array('Description' => 'Poplatek za připojení k síti', 'Price' => 1000, 'Quantity' => 1)), time(), time());
     107      $Output .= $this->System->Modules['Bill']->CreateBill(1, array(array('Description' => 'Poplatek za připojení k Internetu', 'Price' => 1000, 'Quantity' => 1)), time(), time());
    108108    } else
    109109    {
     
    352352          $Output .= $TimePeriodText.': '.$Member['MonthlyTotal'].' * '.$Period['MonthCount'].' = '.$PayPerPeriod.'<br />';
    353353          $BillCode = $Finance->GetNextDocumentLineNumber(6); // Faktury vydané
    354           $BillId = $this->System->Modules['Bill']->CreateBill($Member['Subject'], array(array('Description' => 'Připojení k síti', 'Price' => $PayPerPeriod, 'Quantity' => 1)), time(), time() + 3600 * 24 * 15, $BillCode);
    355           $this->Database->insert('FinanceClaimsLiabilities', array('Value' => $PayPerPeriod, 'Subject' => $Member['Subject'], 'TimeCreation' => 'NOW()', 'TimeDue' => 'DATE_ADD(NOW(), INTERVAL 15 DAY)', 'Text' => 'Připojení k síti za období '.$TimePeriodText, 'Bill' => $BillId, 'BillCode' => $BillCode));
     354          $BillId = $this->System->Modules['Bill']->CreateBill($Member['Subject'], array(array('Description' => 'Připojení k Internetu', 'Price' => $PayPerPeriod, 'Quantity' => 1)), time(), time() + 3600 * 24 * 15, $BillCode);
     355          $this->Database->insert('FinanceClaimsLiabilities', array('Value' => $PayPerPeriod, 'Subject' => $Member['Subject'], 'TimeCreation' => 'NOW()', 'TimeDue' => 'DATE_ADD(NOW(), INTERVAL 15 DAY)', 'Text' => 'Připojení k Internetu za období '.$TimePeriodText, 'Bill' => $BillId, 'BillCode' => $BillCode));
    356356          $Output .= $this->SendPaymentEmail($Member['Id']);
    357357          $this->Database->update('Member', 'Id='.$Member['Id'], array('BillingPeriodLastDate' => TimeToMysqlDateTime($Period['To'])));
     
    415415        'Vaše platební období: <strong>'.$this->System->Modules['Finance']->BillingPeriods[$Member['BillingPeriod']]['Name'].'</strong><br />'."\n".
    416416        'Pravidelná platba za období: <strong>'.$MemberPayment['MonthlyTotal'].' Kč</strong><br />'."\n".
     417        'Bankovní účet: <strong>2600134781 / 2010</strong> (EUR Slovensko 2600134781 / 8330, Fio banka)<br/>'."\n".
     418        'Variabilní symbol: <strong>'.$Member['Subject'].'</strong><br/>'."\n".
    417419        'Stav vašeho účtu: <strong>'.($MemberPayment['Cash'] - $MemberPayment['MonthlyTotal']).' Kč</strong><br /><br />'."\n";
    418420      $Content .= 'Nové finanční operace:<br/>'.
     
    440442  {
    441443    // FinanceClaimsLiablities
    442     $DbResult = $this->Database->query('SELECT * FROM FinanceClaimsLiabilities WHERE (BillCode <> "") AND (Value >= 0) AND (Bill = 0)');
     444    $DbResult = $this->Database->query('SELECT * FROM FinanceClaimsLiabilities WHERE (BillCode <> "") AND (Value != 0) AND (Bill = 0)');
    443445    while($Row = $DbResult->fetch_assoc())
    444446    {
  • trunk/finance/user_state.php

    r410 r413  
    5959   
    6060    // Account state   
    61     $UserOperationTableQuery = '((SELECT Text, Time, Value AS Value, Bill FROM FinanceOperation WHERE (Subject='.$Subject['Id'].')) UNION ALL '.
    62       '(SELECT Text, TimeCreation as Time, -Value as Value, Bill FROM FinanceClaimsLiabilities WHERE (Subject='.$Subject['Id'].')) ORDER BY Time DESC) AS T1';
     61    $UserOperationTableQuery = '((SELECT Text, Time, Value AS Value, Bill, BillCode FROM FinanceOperation WHERE (Subject='.$Subject['Id'].')) UNION ALL '.
     62      '(SELECT Text, TimeCreation as Time, -Value as Value, Bill, BillCode FROM FinanceClaimsLiabilities WHERE (Subject='.$Subject['Id'].')) ORDER BY Time DESC) AS T1';
    6363    $DbResult = $this->Database->query('SELECT SUM(T1.Value) AS Total FROM '.$UserOperationTableQuery);
    6464    $DbRow = $DbResult->fetch_array();
    6565    $Total = $DbRow['Total'];
    66     $Output .= 'Stav účtu: <strong>'.$Total.' Kč</strong<br /><br />';
     66    $Output .= 'Stav účtu: <strong>'.$Total.' Kč</strong<br /><br /><br/>';
    6767
    6868   
     
    7979      if($Row['Value'] == -0) $Row['Value'] = 0;
    8080      if($Row['Value'] > 0) $Row['Value'] = '+'.$Row['Value'];
    81       if($Row['Bill'] > 0) $Invoice = '<a href="bill.php?Id='.$Row['Bill'].'">PDF</a>'; else $Invoice = '&nbsp;';
     81      if($Row['BillCode'] == '') $Row['BillCode'] = 'PDF';
     82      if($Row['Bill'] > 0) $Invoice = '<a href="bill.php?Id='.$Row['Bill'].'">'.$Row['BillCode'].'</a>'; else $Invoice = '&nbsp;';
    8283      $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>';
    8384      $SumValue = $SumValue + $Row['Value'];
  • trunk/finance/zivnost.php

    r409 r413  
    160160        $DbResult = $this->Database->select('FinanceYear', '*', 'Id='.$_GET['year']);
    161161        $Year = $DbResult->fetch_assoc();
    162        
     162
     163        $Total = 0;
     164        $TotalTax = array(0, 0);
     165        $TotalCash = array(0, 0);
    163166        $Output .= '<strong>Příjmy za rok '.$Year['Year'].'</strong>';
    164167        $Output .= '<table style="font-size: smaller;" class="WideTable">';
     
    170173          $Row['Time'] = explode(' ', $Row['Time']);
    171174          $Row['Time'] = $Row['Time'][0];
    172           $Output .= '<tr><td>'.$Row['Time'].'</td><td>'.$Row['BillCode'].'</td><td>'.$Row['Name'].'</td><td>'.$Row['Text'].'</td><td>'.$Row['Value'].'</td><td>'.$Table[$Row['Taxable']].'</td><td>'.$Table[$Row['Cash']].'</td></tr>';
    173         }
    174         $Output .= '</table>';
     175          $Output .= '<tr><td>'.HumanDate($Row['Time']).'</td><td>'.$Row['BillCode'].'</td><td>'.$Row['Name'].'</td><td>'.$Row['Text'].'</td><td>'.$Row['Value'].'</td><td>'.$Table[$Row['Taxable']].'</td><td>'.$Table[$Row['Cash']].'</td></tr>';
     176          $Total += $Row['Value'];
     177          $TotalTax[$Row['Taxable']] += $Row['Value'];
     178          $TotalCash[$Row['Cash']] += $Row['Value'];
     179        }
     180        $Output .= '</table><br/>';
     181        $Output .= '<strong>Souhrn</strong><br/>';
     182        $Output .= 'Celkem: '.$Total.' Kč<br/>';
     183        $Output .= '  Daňové: '.$TotalTax[1].' Kč<br/>';
     184        $Output .= '  Nedaňové: '.$TotalTax[0].' Kč<br/>';
     185        $Output .= '  Hotovostní: '.$TotalCash[1].' Kč<br/>';
     186        $Output .= '  Bezhotovostní: '.$TotalCash[0].' Kč<br/>';
    175187        break;
    176188      case 'Expenses':
     
    178190        $DbResult = $this->Database->select('FinanceYear', '*', 'Id='.$_GET['year']);
    179191        $Year = $DbResult->fetch_assoc();
    180        
     192
     193        $Total = 0;
     194        $TotalTax = array(0, 0);
     195        $TotalCash = array(0, 0);
    181196        $Output .= '<strong>Výdaje za rok '.$Year['Year'].'</strong>';
    182197        $Output .= '<table style="font-size: smaller;" class="WideTable">';
     
    188203          $Row['Time'] = explode(' ', $Row['Time']);
    189204          $Row['Time'] = $Row['Time'][0];
    190           $Output .= '<tr><td>'.$Row['Time'].'</td><td>'.$Row['BillCode'].'</td><td>'.$Row['Name'].'</td><td>'.$Row['Text'].'</td><td>'.$Row['Value'].'</td><td>'.$Table[$Row['Taxable']].'</td><td>'.$Table[$Row['Cash']].'</td></tr>';
    191         }
    192         $Output .= '</table>';
     205          $Row['Value'] = $Row['Value'] * -1;
     206          $Output .= '<tr><td>'.HumanDate($Row['Time']).'</td><td>'.$Row['BillCode'].'</td><td>'.$Row['Name'].'</td><td>'.$Row['Text'].'</td><td>'.$Row['Value'].'</td><td>'.$Table[$Row['Taxable']].'</td><td>'.$Table[$Row['Cash']].'</td></tr>';
     207          $Total += $Row['Value'];
     208          $TotalTax[$Row['Taxable']] += $Row['Value'];
     209          $TotalCash[$Row['Cash']] += $Row['Value'];
     210        }
     211        $Output .= '</table><br/>';
     212        $Output .= '<strong>Souhrn</strong><br/>';
     213        $Output .= 'Celkem: '.$Total.' Kč<br/>';
     214        $Output .= '  Daňové: '.$TotalTax[1].' Kč<br/>';
     215        $Output .= '  Nedaňové: '.$TotalTax[0].' Kč<br/>';
     216        $Output .= '  Hotovostní: '.$TotalCash[1].' Kč<br/>';
     217        $Output .= '  Bezhotovostní: '.$TotalCash[0].' Kč<br/>';
    193218        break;
    194219      case 'Claims':
     
    197222        $Year = $DbResult->fetch_assoc();
    198223       
     224        $Total = 0;
    199225        $Output .= '<strong>Pohledávky za rok '.$Year['Year'].'</strong>';
    200226        $Output .= '<table style="font-size: smaller;" class="WideTable">';
    201         $Output .= '<tr><th>Kód</th><th>Subjekt</th><th>Text</th><th>Hodnota [Kč]</th><th>Čas vystavení</th><th>Čas splatnosti</th><th>Čas uhrazení</th></tr>';
     227        $Output .= '<tr><th>Čas vystavení</th><th>Kód</th><th>Subjekt</th><th>Text</th><th>Hodnota [Kč]</th></tr>';
    202228        $DbResult = $this->Database->query('SELECT * FROM FinanceClaimsLiabilities JOIN Subject ON Subject.Id = FinanceClaimsLiabilities.Subject '.
    203229          'WHERE (Value > 0) AND (FinanceClaimsLiabilities.TimeCreation >= "'.$Year['DateStart'].'") AND (FinanceClaimsLiabilities.TimeCreation <= "'.$Year['DateEnd'].'") ORDER BY TimeCreation');
     
    205231        {
    206232          if($Row['TimePayment'] == '0000-00-00 00:00:00') $Row['TimePayment'] = '&nbsp;';
    207           $Output .= '<tr><td>'.$Row['BillCode'].'</td><td>'.$Row['Name'].'</td><td>'.$Row['Text'].'</td><td>'.$Row['Value'].'</td><td>'.$Row['TimeCreation'].'</td><td>'.$Row['TimeDue'].'</td><td>'.$Row['TimePayment'].'</td></tr>';
    208         }
    209         $Output .= '</table>';
     233          $Output .= '<tr><td>'.HumanDate($Row['TimeCreation']).'</td><td>'.$Row['BillCode'].'</td><td>'.$Row['Name'].'</td><td>'.$Row['Text'].'</td><td>'.$Row['Value'].'</td></tr>';
     234          $Total += $Row['Value'];
     235        }
     236        $Output .= '</table><br/>';
     237        $Output .= 'Celkem: '.$Total.' Kč<br/>';
    210238        break;
    211239     case 'Liabilities':
     
    214242        $Year = $DbResult->fetch_assoc();
    215243
     244        $Total = 0;
    216245        $Output .= '<strong>Závazky za rok '.$Year['Year'].'</strong>';
    217246        $Output .= '<table style="font-size: smaller;" class="WideTable">';
    218         $Output .= '<tr><th>Kód</th><th>Subjekt</th><th>Text</th><th>Hodnota [Kč]</th><th>Čas vystavení</th><th>Čas splatnosti</th><th>Čas uhrazení</th></tr>';
     247        $Output .= '<tr><th>Čas vystavení</th><th>Kód</th><th>Subjekt</th><th>Text</th><th>Hodnota [Kč]</th></tr>';
    219248        $DbResult = $this->Database->query('SELECT * FROM FinanceClaimsLiabilities JOIN Subject ON Subject.Id = FinanceClaimsLiabilities.Subject '.
    220249          'WHERE (Value < 0) AND (FinanceClaimsLiabilities.TimeCreation >= "'.$Year['DateStart'].'") AND (FinanceClaimsLiabilities.TimeCreation <= "'.$Year['DateEnd'].'") ORDER BY TimeCreation');
     
    222251        {
    223252          if($Row['TimePayment'] == '0000-00-00 00:00:00') $Row['TimePayment'] = '&nbsp;';
    224           $Output .= '<tr><td>'.$Row['BillCode'].'</td><td>'.$Row['Name'].'</td><td>'.$Row['Text'].'</td><td>'.$Row['Value'].'</td><td>'.$Row['TimeCreation'].'</td><td>'.$Row['TimeDue'].'</td><td>'.$Row['TimePayment'].'</td></tr>';
    225         }
    226         $Output .= '</table>';
     253          $Row['Value'] = $Row['Value'] * -1;
     254          $Output .= '<tr><td>'.HumanDate($Row['TimeCreation']).'</td><td>'.$Row['BillCode'].'</td><td>'.$Row['Name'].'</td><td>'.$Row['Text'].'</td><td>'.$Row['Value'].'</td></tr>';         
     255          $Total += $Row['Value'];
     256        }
     257        $Output .= '</table><br/>';
     258        $Output .= 'Celkem: '.$Total.' Kč<br/>';
    227259        break;
    228260      case 'SubjectList':
  • trunk/form_classes.php

    r409 r413  
    1212      'Cash' => array('Type' => 'Boolean', 'Caption' => 'Hotovost', 'Default' => '0'),
    1313      'Taxable' => array('Type' => 'Boolean', 'Caption' => 'Ovlivňující daňový základ', 'Default' => '1'),
     14      //'BankAccount' => array('Type' => 'TBankAccount', 'Caption' => 'Bankovní účet', 'Default' => '1'),
    1415    ),
    1516  ),
     
    196197    'Filter' => '1',
    197198  ),
     199  'TBankAccount' => array(
     200    'Type' => 'Reference',
     201    'Table' => 'FinanceBankAccount',
     202    'Id' => 'Id',
     203    'Name' => 'Comment',
     204    'Filter' => '1',
     205  ),
    198206  'TNetworkDevice' => array(
    199207    'Type' => 'Reference',
  • trunk/system/generators/dhcp.php

    r334 r413  
    1111$Routerboard->Debug = true;
    1212
    13 $DbResult = $Database->query('SELECT * FROM `NetworkSubnet`'); // WHERE `Member` = 0');
     13$DbResult = $Database->query('SELECT * FROM `NetworkSubnet` WHERE `Configure`=1');
    1414while($Subnet = $DbResult->fetch_assoc())
    1515{
  • trunk/webcam/webcam.php

    r329 r413  
    99    global $Config;
    1010 //   return('<a href="'.$this->System->Config['Web']['RootFolder'].'/webcam/"><img alt="Webkamera školní hřiště" width="140" height="105" src="'.$this->System->Config['Web']['RootFolder'].'/webcam/'.$this->ImageFileName.'" /></a>');
    11     return('<a href="http://www.zdechov.net/kamery/?id=1"><img alt="Webkamera školní hřiště" width="140" height="105" src="http://www.zdechov.net/images/webcam/webcam.jpg" /></a>');
     11    $Output = '<a href="http://www.zdechov.net/kamery/?id=1"><img alt="Webkamera školní hřiště" width="140" height="105" src="http://www.zdechov.net/images/webcam/webcam.jpg" /></a>';
     12    $Output .= '<a href="http://www.zdechov.net/kamery/?id=2"><img alt="Webkamera střed obce obloha" width="140" height="105" src="http://www.zdechov.net/images/webcam/webcam2.jpg" /></a>';
     13    $Output .= '<a href="http://www.zdechov.net/kamery/?id=3"><img alt="Skiareál, motokrosová grapa" width="140" height="79" src="http://www.zdechov.net/images/webcam/webcam3.jpg" /></a>';
     14    $Output .= '<a href="http://www.zdechov.net/kamery/?id=4"><img alt="Fotbalové hřiště" width="140" height="79" src="http://www.zdechov.net/images/webcam/webcam4.jpg" /></a>';
     15    return($Output);
    1216  }
    1317}
Note: See TracChangeset for help on using the changeset viewer.