Ignore:
Timestamp:
Dec 7, 2021, 11:08:42 PM (3 years ago)
Author:
chronos
Message:
  • Added: Allow to switch Mail class into test mode.
  • Modified: Type checking related changes.
  • Modified: Replace global $Config references with $this->System->Config is possible.
File:
1 edited

Legend:

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

    r910 r916  
    3636  function DoStart(): void
    3737  {
    38     global $Config;
    39 
    4038    $this->System->RegisterPage(['finance', 'sprava'], 'PageFinanceManage');
    4139    $this->System->RegisterPage(['finance', 'platby'], 'PageFinanceUserState');
     
    162160        'Value' => array('Type' => 'Integer', 'Caption' => 'Částka absolutní', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true),
    163161        'ValueUser' => array('Type' => 'Integer', 'Caption' => 'Částka', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true,
    164           'SQL' => 'SELECT ROUND(SUM(`Price`*`Quantity`), '.$Config['Finance']['Rounding'].') FROM `FinanceInvoiceItem` WHERE `FinanceInvoiceItem`.`FinanceInvoice`=#Id'),
     162          'SQL' => 'SELECT ROUND(SUM(`Price`*`Quantity`), '.$this->System->Config['Finance']['Rounding'].') FROM `FinanceInvoiceItem` WHERE `FinanceInvoiceItem`.`FinanceInvoice`=#Id'),
    165163        'File' => array('Type' => 'TFile', 'Caption' => 'Doklad', 'Default' => '', 'Null' => true),
    166164        'Generate' => array('Type' => 'Boolean', 'Caption' => 'Generovat', 'Default' => ''),
     
    244242        'VAT' => array('Type' => 'Integer', 'Caption' => 'Daň', 'Default' => '21', 'Suffix' => '%'),
    245243        'Total' => array('Type' => 'Integer', 'Caption' => 'Celkem', 'Default' => '', 'Suffix' => 'Kč',
    246           'ReadOnly' => true, 'SQL' => 'ROUND(`Price` * `Quantity`, '.$Config['Finance']['Rounding'].')'),
     244          'ReadOnly' => true, 'SQL' => 'ROUND(`Price` * `Quantity`, '.$this->System->Config['Finance']['Rounding'].')'),
    247245      ),
    248246      'AfterInsert' => array($this, 'AfterInsertFinanceInvoiceItem'),
     
    259257        'State' => array('Type' => 'Float', 'Caption' => 'Stav', 'Default' => '',
    260258          'ReadOnly' => true, 'Suffix' => 'Kč', 'SQL' => 'IFNULL(ROUND((SELECT SUM(`FinanceOperation`.`Value`) FROM `FinanceOperation` '.
    261           'WHERE `FinanceOperation`.`Treasury`=#Id), '.$Config['Finance']['Rounding'].'), 0)'),
     259          'WHERE `FinanceOperation`.`Treasury`=#Id), '.$this->System->Config['Finance']['Rounding'].'), 0)'),
    262260        'Operations' => array('Type' => 'TFinanceOperationListTreasury', 'Caption' => 'Operace', 'Default' => ''),
    263261        'Check' => array('Type' => 'TFinanceTreasuryCheckListTreasury', 'Caption' => 'Kontrola', 'Default' => ''),
     
    568566    ));
    569567
    570     $this->Finance->MainSubject = $Config['Finance']['MainSubjectId'];
    571     $this->Finance->DirectoryId = $Config['Finance']['DirectoryId'];
     568    $this->Finance->MainSubject = $this->System->Config['Finance']['MainSubjectId'];
     569    $this->Finance->DirectoryId = $this->System->Config['Finance']['DirectoryId'];
    572570
    573571    ModuleIS::Cast($this->System->GetModule('IS'))->RegisterDashboardItem('Finance', array($this, 'ShowDashboardItem'));
Note: See TracChangeset for help on using the changeset viewer.