Changeset 367


Ignore:
Timestamp:
Jan 19, 2012, 8:23:04 AM (13 years ago)
Author:
chronos
Message:
  • Přidáno: Definice některých modelů modulu Finance.
Location:
trunk/Modules
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Finance/Finance.php

    r366 r367  
    66include_once('spotreba.php');
    77include_once('inventory.php');
     8include_once('clenove.php');
    89include_once('monthly_overall.php');
    910include_once('manage.php');
    1011include_once('user_state.php');
     12include_once('import.php');
     13include_once('zivnost.php');
    1114
    1215class FinancePage extends Page
     
    2831        else if($this->System->PathItems[1] == 'clenove') $PageClass = 'FinanceUserList';
    2932        else if($this->System->PathItems[1] == 'sprava') $PageClass = 'FinanceManagePage';
     33        else if($this->System->PathItems[1] == 'import') $PageClass = 'FinanceImportPayment';
     34        else if($this->System->PathItems[1] == 'zivnost') $PageClass = 'FinanceTaxFilingPage';
    3035        else if($this->System->PathItems[1] == 'mesicni-prehled') $PageClass = 'FinanceMonthlyOverallPage';
    3136        else return(PAGE_NOT_FOUND);
     
    4247}
    4348
     49class DocumentLine extends Model
     50{
     51  function __construct($Database, $System)
     52  {
     53    parent::__construct($Database, $System);
     54    $this->Name = 'DocumentLine';
     55    $this->AddPropertyString('Name');
     56    $this->AddPropertyString('ShortCut');
     57  }
     58}
     59
     60class DocumentLineSequence extends Model
     61{
     62  function __construct($Database, $System)
     63  {
     64    parent::__construct($Database, $System);
     65    $this->Name = 'DocumentLineSequence';
     66    $this->AddPropertyOneToMany('DocumentLine', 'DocumentLine');
     67    $this->AddPropertyOneToMany('FinanceYear', 'FinanceYear');
     68    $this->AddPropertyInteger('NextNumber');
     69    $this->AddPropertyBoolean('YearPrefix');
     70  }
     71}
     72
     73class FinanceYear extends Model
     74{
     75  function __construct($Database, $System)
     76  {
     77    parent::__construct($Database, $System);
     78    $this->Name = 'FinanceYear';
     79    $this->AddPropertyInteger('Year');
     80    $this->AddPropertyDate('DateStart');
     81    $this->AddPropertyDate('DateEnd');
     82  }
     83}
     84
     85class FinanceTariff extends Model
     86{
     87  function __construct($Database, $System)
     88  {
     89    parent::__construct($Database, $System);
     90    $this->Name = 'FinanceTariff';
     91    $this->AddPropertyString('Name');
     92    $this->AddPropertyInteger('Group');
     93    $this->AddPropertyInteger('SpeedMin');
     94    $this->AddPropertyInteger('SpeedMax');
     95    $this->AddPropertyInteger('UploadAsymmetry');
     96    $this->AddPropertyInteger('Price');
     97    $this->AddPropertyInteger('MemberCount');
     98    $this->AddPropertyOneToMany('ReplaceId', 'FinanceTariff');
     99    $this->AddPropertyBoolean('Public');
     100  }
     101}
     102
     103class FinanceOperation extends Model
     104{
     105  function __construct($Database, $System)
     106  {
     107    parent::__construct($Database, $System);
     108    $this->Name = 'FinanceOperation';
     109    $this->AddPropertyDateTime('Time');
     110    $this->AddPropertyOneToMany('Subject', 'Subject');
     111    $this->AddPropertyBoolean('Cash');
     112    $this->AddPropertyFloat('Value');
     113    $this->AddPropertyString('BillCode');
     114    $this->AddPropertyBoolean('Taxable');
     115    $this->AddPropertyOneToMany('Bill', 'FinanceBills');
     116    $this->AddPropertyString('Text');
     117    $this->AddPropertyBoolean('Network');
     118  }
     119}
     120
     121class FinanceClaimsLiabilities extends Model
     122{
     123  function __construct($Database, $System)
     124  {
     125    parent::__construct($Database, $System);
     126    $this->Name = 'FinanceClaimsLiabilities';
     127    $this->AddPropertyString('BillCode');
     128    $this->AddPropertyOneToMany('Subject', 'Subject');
     129    $this->AddPropertyDateTime('TimeCreate');
     130    $this->AddPropertyDateTime('TimeDue');
     131    $this->AddPropertyDateTime('TimePayment');
     132    $this->AddPropertyFloat('Value');
     133    $this->AddPropertyOneToMany('Bill', 'FinanceBills');
     134    $this->AddPropertyString('Text');   
     135  }
     136}
     137
     138class FinanceBills extends Model
     139{
     140  function __construct($Database, $System)
     141  {
     142    parent::__construct($Database, $System);
     143    $this->Name = 'FinanceBills';
     144    $this->AddPropertyDateTime('TimeFrom');
     145    $this->AddPropertyOneToMany('Subject', 'Subject');
     146    $this->AddPropertyDateTime('TimeTo');
     147    $this->AddPropertyDateTime('TimeDue');
     148    $this->AddPropertyDateTime('TimeCreate');
     149    $this->AddPropertyString('BillCode');
     150    $this->AddPropertyString('Type');
     151    $this->AddPropertyBoolean('Cash');   
     152  }
     153}
     154
     155class FinanceBillsItems extends Model
     156{
     157  function __construct($Database, $System)
     158  {
     159    parent::__construct($Database, $System);
     160    $this->Name = 'FinanceBillsItems';
     161    $this->AddPropertyOneToMany('Bill', 'FinanceBills');
     162    $this->AddPropertyString('Description');
     163    $this->AddPropertyFloat('Price');
     164    $this->AddPropertyFloat('Quantity');
     165  }
     166}
    44167
    45168class ModuleFinance extends Module
     
    80203    $this->Description = 'Accounting processing';
    81204    $this->Dependencies = array('User');
    82     $this->Models = array();
     205    $this->Models = array('FinanceYear', 'DocumentLine', 'DocumentLineSequence',
     206      'FinanceTariff', 'FinanceOperation', 'FinanceClaimsLiabilities',
     207      'FinanceBills', 'FinanceBillsItems');
    83208  }
    84209 
  • trunk/Modules/Finance/import.php

    r343 r367  
    11<?php
    2 include('../global.php');
    32
    43class FinanceImportPayment extends Page
     
    145144}
    146145
    147 $System->AddModule(new FinanceImportPayment());
    148 $System->Modules['FinanceImportPayment']->GetOutput();
    149 
    150146?>
  • trunk/Modules/Finance/manage.php

    r366 r367  
    6666        $Output .= '<a href="?Operation=Recalculate">Přepočet financí</a><br />';
    6767        $Output .= '<a href="?Operation=MonthlyPayment">Měsíční vyúčtování</a><br />';
    68         $Output .= '<a href="clenove.php">Seznam členů</a><br />';
    69         $Output .= '<a href="zivnost.php">Živnost</a><br />';
     68        $Output .= '<a href="../clenove/">Seznam členů</a><br />';
     69        $Output .= '<a href="../zivnost/">Živnost</a><br />';
    7070        $Output .= '<a href="?Operation=GenerateBills">Generovat chybějící doklady</a><br />';
    71         $Output .= '<a href="import.php">Import plateb</a><br />';
     71        $Output .= '<a href="../import/">Import plateb</a><br />';
    7272    }
    7373    return($Output);
  • trunk/Modules/Finance/zivnost.php

    r343 r367  
    11<?php
    2 include_once('../global.php');
    32
    43class FinanceTaxFilingPage extends Page
     
    289288}
    290289
    291 $System->AddModule(new FinanceTaxFilingPage());
    292 $System->Modules['FinanceTaxFilingPage']->GetOutput();
    293 
    294290?>
  • trunk/Modules/User/User.php

    r364 r367  
    339339    $this->System->Models['User'] = new User($this->Database, $this->System);
    340340    $this->System->Pages['uzivatele'] = 'UserListPage';
     341    if(isset($_SERVER['REMOTE_ADDR'])) $this->System->Models['User']->Check();
    341342  }
    342343 
Note: See TracChangeset for help on using the changeset viewer.