Ignore:
Timestamp:
Jan 20, 2012, 3:05:24 PM (13 years ago)
Author:
chronos
Message:
  • Upraveno: Testována instalace čisté databáze na základě definic modulů a jejich modelů.
  • Opraveno: Doplněny definice modelů pro FinanceMonthlyOverall a FinanceCharge.
  • Přidáno: Podpora pro nastavitelnost NULL hodnoty u vlastností modelů.
  • Opraveno: Řešení správného kaskádového načítání závislostí modulů.
File:
1 edited

Legend:

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

    r373 r377  
    8383}
    8484
     85class FinanceBillingPeriod extends Model
     86{
     87  function __construct($Database, $System)
     88  {
     89    parent::__construct($Database, $System);
     90    $this->Name = 'FinanceBillingPeriod';
     91    $this->AddPropertyString('Name');
     92    $this->AddPropertyInteger('MonthCount');
     93  }
     94}
     95
    8596class FinanceTariff extends Model
    8697{
     
    127138    $this->AddPropertyString('BillCode');
    128139    $this->AddPropertyOneToMany('Subject', 'Subject');
    129     $this->AddPropertyDateTime('TimeCreate');
     140    $this->AddPropertyDateTime('TimeCreation');
    130141    $this->AddPropertyDateTime('TimeDue');
    131142    $this->AddPropertyDateTime('TimePayment');
     
    163174    $this->AddPropertyFloat('Price');
    164175    $this->AddPropertyFloat('Quantity');
     176  }
     177}
     178
     179class FinanceCharge extends Model
     180{
     181  function __construct($Database, $System)
     182  {
     183    parent::__construct($Database, $System);
     184    $this->Name = 'FinanceCharge';
     185    $this->AddPropertyInteger('Period');
     186    $this->AddPropertyInteger('Internet');
     187    $this->AddPropertyInteger('InternetSpeed');
     188    $this->AddPropertyInteger('InternetSpeedReserve');
     189    $this->AddPropertyInteger('AdministrationPerUser');
     190    $this->AddPropertyInteger('kWh');
     191    $this->AddPropertyInteger('BaseSpeedElement');
     192    $this->AddPropertyInteger('BaseTariffPrice');
     193    $this->AddPropertyInteger('TopTariffPrice');
     194  }
     195}
     196
     197class FinanceMonthlyOverall extends Model
     198{
     199  function __construct($Database, $System)
     200  {
     201    parent::__construct($Database, $System);
     202    $this->Name = 'FinanceMonthlyOverall';
     203    $this->AddPropertyInteger('Money');
     204    $this->AddPropertyDate('Date');
     205    $this->AddPropertyInteger('Administration');
     206    $this->AddPropertyInteger('kWh');
     207    $this->AddPropertyInteger('AdministrationTotal');
     208    $this->AddPropertyInteger('ConsumptionTotal');
     209    $this->AddPropertyInteger('TotalPaid');
     210    $this->AddPropertyInteger('BaseTariffPrice');
     211    $this->AddPropertyInteger('TopTariffPrice');
     212    $this->AddPropertyInteger('MemberCount');
     213    $this->AddPropertyInteger('Investment');
    165214  }
    166215}
     
    237286    $this->License = 'GNU/GPL';
    238287    $this->Description = 'Accounting processing';
    239     $this->Dependencies = array('User');
     288    $this->Dependencies = array('User', 'Subject');
    240289    $this->Models = array('FinanceYear', 'DocumentLine', 'DocumentLineSequence',
    241290      'FinanceTariff', 'FinanceOperation', 'FinanceClaimsLiabilities',
    242       'FinanceBills', 'FinanceBillsItems');
     291      'FinanceBills', 'FinanceBillsItems', 'FinanceBillingPeriod', 'FinanceCharge',
     292      'FinanceMonthlyOverall');
    243293    $this->Views = array('FinanceOperation', 'FinanceClaimsLiabilities');
    244294  }
     
    331381      $this->BillingPeriods[$BillingPeriod['Id']] = $BillingPeriod;
    332382   
    333     $DbResult = $this->Database->query('SELECT * FROM finance_charge WHERE period='.$Period);
     383    $DbResult = $this->Database->query('SELECT * FROM FinanceCharge WHERE period='.$Period);
    334384    $Row = $DbResult->fetch_array();
    335385    $this->kWh = $Row['kWh'];
    336     $this->Internet = $Row['internet'];
    337     $this->Sprava = $Row['administration_per_user'];
    338     $this->RealMaxSpeed = $Row['internet_speed'];
    339     $this->SpeedReserve = $Row['internet_speed_reserve'];
    340     $this->BaseSpeedElement = $Row['base_speed_element'];
     386    $this->Internet = $Row['Internet'];
     387    $this->Sprava = $Row['AdministrationPerUser'];
     388    $this->RealMaxSpeed = $Row['InternetSpeed'];
     389    $this->SpeedReserve = $Row['InternetSpeedReserve'];
     390    $this->BaseSpeedElement = $Row['BaseSpeedElement'];
    341391    $this->MaxSpeed = $this->RealMaxSpeed - $this->SpeedReserve;
    342392    $this->TopTariffPrice = $Row['TopTariffPrice'];
     
    348398   
    349399    $this->SpravaUsers = $this->InternetUsers;
    350     $DbResult = $this->Database->query('SELECT SUM(`consumption`) FROM `network_segments`');
     400    $DbResult = $this->Database->query('SELECT SUM(`Consumption`) FROM `network_segments`');
    351401    $TotalConsumption = $DbResult->fetch_array();
    352402    $this->TotalConsumption = $TotalConsumption[0];
Note: See TracChangeset for help on using the changeset viewer.