Ignore:
Timestamp:
Feb 17, 2021, 12:30:23 PM (4 years ago)
Author:
chronos
Message:
File:
1 edited

Legend:

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

    r894 r899  
    88include_once(dirname(__FILE__).'/Trade.php');
    99
    10 class ModuleFinance extends AppModule
     10class ModuleFinance extends Module
    1111{
    1212  public Finance $Finance;
     
    2121    $this->License = 'GNU/GPLv3';
    2222    $this->Description = 'Base module for finance management';
    23     $this->Dependencies = array('File', 'EmailQueue', 'Subject', 'Document');
    24 
    25     $this->Bill = new Bill($this->System);
    26     $this->Finance = new Finance($this->System);
    27   }
    28 
    29   function GetModels(): array
    30   {
    31     return array(FinanceBillingPeriod::GetClassName(), FinanceVatType::GetClassName(), FinanceVat::GetClassName(),
     23    $this->Dependencies = array(ModuleFile::GetName(), ModuleEmailQueue::GetName(), ModuleSubject::GetName(), ModuleDocument::GetName());
     24    $this->Models = array(FinanceBillingPeriod::GetClassName(), FinanceVatType::GetClassName(), FinanceVat::GetClassName(),
    3225      FinanceGroup::GetClassName(), FinanceOperationGroup::GetClassName(), FinanceOperation::GetClassName(),
    3326      FinanceInvoiceGroup::GetClassName(), FinanceInvoice::GetClassName(), FinanceInvoiceItem::GetClassName(),
     
    3528      Currency::GetClassName(), FinanceBank::GetClassName(), FinanceBankAccount::GetClassName(), FinanceCharge::GetClassName(),
    3629      Contract::GetClassName(), FinanceInvoiceOperationRel::GetClassName());
     30
     31    $this->Bill = new Bill($this->System);
     32    $this->Finance = new Finance($this->System);
    3733  }
    3834
     
    632628  }
    633629
    634   static function Cast(AppModule $AppModule): ModuleFinance
    635   {
    636     if ($AppModule instanceof ModuleFinance)
     630  static function Cast(Module $Module): ModuleFinance
     631  {
     632    if ($Module instanceof ModuleFinance)
    637633    {
    638       return $AppModule;
     634      return $Module;
    639635    }
    640     throw new Exception('Expected ModuleFinance type but '.gettype($AppModule));
     636    throw new Exception('Expected ModuleFinance type but '.gettype($Module));
    641637  }
    642638}
Note: See TracChangeset for help on using the changeset viewer.