Changeset 377 for trunk/Modules/Finance/Finance.php
- Timestamp:
- Jan 20, 2012, 3:05:24 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Finance/Finance.php
r373 r377 83 83 } 84 84 85 class 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 85 96 class FinanceTariff extends Model 86 97 { … … 127 138 $this->AddPropertyString('BillCode'); 128 139 $this->AddPropertyOneToMany('Subject', 'Subject'); 129 $this->AddPropertyDateTime('TimeCreat e');140 $this->AddPropertyDateTime('TimeCreation'); 130 141 $this->AddPropertyDateTime('TimeDue'); 131 142 $this->AddPropertyDateTime('TimePayment'); … … 163 174 $this->AddPropertyFloat('Price'); 164 175 $this->AddPropertyFloat('Quantity'); 176 } 177 } 178 179 class 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 197 class 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'); 165 214 } 166 215 } … … 237 286 $this->License = 'GNU/GPL'; 238 287 $this->Description = 'Accounting processing'; 239 $this->Dependencies = array('User' );288 $this->Dependencies = array('User', 'Subject'); 240 289 $this->Models = array('FinanceYear', 'DocumentLine', 'DocumentLineSequence', 241 290 'FinanceTariff', 'FinanceOperation', 'FinanceClaimsLiabilities', 242 'FinanceBills', 'FinanceBillsItems'); 291 'FinanceBills', 'FinanceBillsItems', 'FinanceBillingPeriod', 'FinanceCharge', 292 'FinanceMonthlyOverall'); 243 293 $this->Views = array('FinanceOperation', 'FinanceClaimsLiabilities'); 244 294 } … … 331 381 $this->BillingPeriods[$BillingPeriod['Id']] = $BillingPeriod; 332 382 333 $DbResult = $this->Database->query('SELECT * FROM finance_charge WHERE period='.$Period);383 $DbResult = $this->Database->query('SELECT * FROM FinanceCharge WHERE period='.$Period); 334 384 $Row = $DbResult->fetch_array(); 335 385 $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']; 341 391 $this->MaxSpeed = $this->RealMaxSpeed - $this->SpeedReserve; 342 392 $this->TopTariffPrice = $Row['TopTariffPrice']; … … 348 398 349 399 $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`'); 351 401 $TotalConsumption = $DbResult->fetch_array(); 352 402 $this->TotalConsumption = $TotalConsumption[0];
Note:
See TracChangeset
for help on using the changeset viewer.