Changeset 724


Ignore:
Timestamp:
Jan 3, 2015, 8:40:52 PM (10 years ago)
Author:
chronos
Message:
  • Removed: Do not need preload tariffs anymore. They were replaced by more generalized services.
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Application/Version.php

    r722 r724  
    11<?php
    22
    3 $Revision = 722; // Subversion revision
     3$Revision = 724; // Subversion revision
    44$DatabaseRevision = 722; // SQL structure revision
    55$ReleaseTime = strtotime('2015-01-03');
  • trunk/Modules/Finance/Finance.php

    r722 r724  
    77include_once(dirname(__FILE__).'/Zivnost.php');
    88
     9// TODO: Move constants to Finance module configuration
    910define('TARIFF_FREE', 7);
    1011define('INVOICE_DUE_DAYS', 15);
     
    3435  var $TotalPaid;
    3536  var $TotalInternetPaid;
    36   var $Tariffs;
    3737  var $MainSubject;
    3838  var $BillingPeriods;
    3939  var $DirectoryId;
    40 
    41   function LoadTariffs()
    42   {
    43     $this->Tariffs = array();
    44     $DbResult = $this->Database->select('Service', '*', '`ReplaceId` IS NULL ORDER BY `Name`, `InternetSpeedMax`');
    45     while($Tariff = $DbResult->fetch_array())
    46     {
    47       $Tariff['InternetSpeedMin'] = $Tariff['InternetSpeedMin'] * 1000;
    48       $Tariff['InternetSpeedMax'] = $Tariff['InternetSpeedMax'] * 1000;
    49       $this->Tariffs[$Tariff['Id']] = $Tariff;
    50     }
    51   }
    5240
    5341  function LoadMonthParameters($Period = 1) // 0 - now, 1 - next month
     
    8573    $this->TotalInternetPaid = $Row['MonthlyInternet'];
    8674    $this->TotalPaid = $Row['MonthlyTotal'];
    87 
    88     $this->LoadTariffs($Period);
    8975  }
    9076
  • trunk/Modules/Finance/Manage.php

    r720 r724  
    238238    $MonthCurrent = date('m') + 0;
    239239
    240     $Output .= $Finance->LoadTariffs();
    241240    $Output .= $Finance->RecalculateMemberPayment();
    242241
  • trunk/Modules/Finance/UserState.php

    r721 r724  
    6868    $Finance = &$this->System->Modules['Finance'];
    6969    $Finance->LoadMonthParameters(0);
    70     $this->System->Modules['Finance']->LoadTariffs(1);
    7170
    7271    // Determine which customer should be displayed
  • trunk/Modules/Finance/Zivnost.php

    r720 r724  
    5555  {
    5656    if(!$this->System->User->CheckPermission('Finance', 'TradingStatus')) return('Nemáte oprávnění');
    57     $this->System->Modules['Finance']->LoadTariffs(1);
    58     //TransformFinance();
    5957
    6058    $Output = '';
  • trunk/Modules/NetworkConfigRouterOS/Generators/Queue.php

    r625 r724  
    4949$InInterface = 'ifb0';
    5050$InetInterface = $Config['MainRouter']['InetInterface'];
    51 $FreeInetSpeed = $Finance->Tariffs[TARIFF_FREE]['InternetSpeedMax'];
     51
     52$DbResult = $System->Database->select('Service', '*', '(`ReplaceId` IS NULL) AND (`Id`='.TARIFF_FREE.')');
     53if($DbResult->num_rows == 1)
     54{
     55        $Service = $DbResult->fetch_array();
     56  $FreeInetSpeed = $Service['InternetSpeedMax'] * 1000;
     57} else $FreeInetSpeed = 0;
    5258
    5359$ItemsQueue = array();
Note: See TracChangeset for help on using the changeset viewer.