Changeset 899 for trunk/Modules/Finance


Ignore:
Timestamp:
Feb 17, 2021, 12:30:23 PM (4 years ago)
Author:
chronos
Message:
Location:
trunk/Modules/Finance
Files:
2 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}
  • trunk/Modules/Finance/FinanceModels.php

    r894 r899  
    217217class FinanceGroup extends Model
    218218{
    219   static function GetDesc(): ModelDesc
     219  static function GetModelDesc(): ModelDesc
    220220  {
    221221    $Desc = new ModelDesc(self::GetClassName());
     
    227227class FinanceOperation extends Model
    228228{
    229   static function GetDesc(): ModelDesc
     229  static function GetModelDesc(): ModelDesc
    230230  {
    231231    $Desc = new ModelDesc(self::GetClassName());
     
    250250class FinanceOperationGroup extends Model
    251251{
    252   static function GetDesc(): ModelDesc
     252  static function GetModelDesc(): ModelDesc
    253253  {
    254254    $Desc = new ModelDesc(self::GetClassName());
     
    263263class FinanceInvoice extends Model
    264264{
    265   static function GetDesc(): ModelDesc
     265  static function GetModelDesc(): ModelDesc
    266266  {
    267267    $Desc = new ModelDesc(self::GetClassName());
     
    285285class FinanceInvoiceGroup extends Model
    286286{
    287   static function GetDesc(): ModelDesc
     287  static function GetModelDesc(): ModelDesc
    288288  {
    289289    $Desc = new ModelDesc(self::GetClassName());
     
    298298class Company extends Model
    299299{
    300   static function GetDesc(): ModelDesc
     300  static function GetModelDesc(): ModelDesc
    301301  {
    302302    $Desc = new ModelDesc(self::GetClassName());
     
    309309class FinanceInvoiceItem extends Model
    310310{
    311   static function GetDesc(): ModelDesc
     311  static function GetModelDesc(): ModelDesc
    312312  {
    313313    $Desc = new ModelDesc(self::GetClassName());
     
    323323class FinanceTreasury extends Model
    324324{
    325   static function GetDesc(): ModelDesc
     325  static function GetModelDesc(): ModelDesc
    326326  {
    327327    $Desc = new ModelDesc(self::GetClassName());
     
    334334class FinanceTreasuryCheck extends Model
    335335{
    336   static function GetDesc(): ModelDesc
     336  static function GetModelDesc(): ModelDesc
    337337  {
    338338    $Desc = new ModelDesc(self::GetClassName());
     
    357357class FinanceBankAccount extends Model
    358358{
    359   static function GetDesc(): ModelDesc
     359  static function GetModelDesc(): ModelDesc
    360360  {
    361361    $Desc = new ModelDesc(self::GetClassName());
     
    379379class FinanceBank extends Model
    380380{
    381   static function GetDesc(): ModelDesc
     381  static function GetModelDesc(): ModelDesc
    382382  {
    383383    $Desc = new ModelDesc(self::GetClassName());
     
    392392class Currency extends Model
    393393{
    394   static function GetDesc(): ModelDesc
     394  static function GetModelDesc(): ModelDesc
    395395  {
    396396    $Desc = new ModelDesc(self::GetClassName());
     
    404404class FinanceCharge extends Model
    405405{
    406   static function GetDesc(): ModelDesc
     406  static function GetModelDesc(): ModelDesc
    407407  {
    408408    $Desc = new ModelDesc(self::GetClassName());
     
    422422class FinanceVat extends Model
    423423{
    424   static function GetDesc(): ModelDesc
     424  static function GetModelDesc(): ModelDesc
    425425  {
    426426    $Desc = new ModelDesc(self::GetClassName());
     
    435435class FinanceVatType extends Model
    436436{
    437   static function GetDesc(): ModelDesc
     437  static function GetModelDesc(): ModelDesc
    438438  {
    439439    $Desc = new ModelDesc(self::GetClassName());
     
    445445class Contract extends Model
    446446{
    447   static function GetDesc(): ModelDesc
     447  static function GetModelDesc(): ModelDesc
    448448  {
    449449    $Desc = new ModelDesc(self::GetClassName());
     
    460460class FinanceBillingPeriod extends Model
    461461{
    462   static function GetDesc(): ModelDesc
     462  static function GetModelDesc(): ModelDesc
    463463  {
    464464    $Desc = new ModelDesc(self::GetClassName());
     
    471471class FinanceInvoiceOperationRel extends Model
    472472{
    473   static function GetDesc(): ModelDesc
     473  static function GetModelDesc(): ModelDesc
    474474  {
    475475    $Desc = new ModelDesc(self::GetClassName());
Note: See TracChangeset for help on using the changeset viewer.