Changeset 887 for trunk/Modules/FinanceBankAPI/FinanceBankAPI.php
- Timestamp:
- Nov 20, 2020, 12:08:12 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/FinanceBankAPI/FinanceBankAPI.php
r874 r887 8 8 class ModuleFinanceBankAPI extends AppModule 9 9 { 10 function __construct( $System)10 function __construct(System $System) 11 11 { 12 12 parent::__construct($System); … … 16 16 $this->License = 'GNU/GPLv3'; 17 17 $this->Description = 'Communication through API to various banks, manual file import'; 18 $this->Dependencies = array('Finance', 'Scheduler' );18 $this->Dependencies = array('Finance', 'Scheduler', 'IS'); 19 19 } 20 20 21 function DoInstall() 21 function DoInstall(): void 22 22 { 23 23 } 24 24 25 function DoUninstall() 25 function DoUninstall(): void 26 26 { 27 27 } 28 28 29 function DoStart() 29 function DoStart(): void 30 30 { 31 31 $this->System->FormManager->RegisterClass('ImportBankFile', array( … … 60 60 )); 61 61 62 $this->System->RegisterPage( array('finance', 'import-api'), 'PageImportAPI');63 $this->System->RegisterPage( array('finance', 'import-soubor'), 'PageImportFile');62 $this->System->RegisterPage(['finance', 'import-api'], 'PageImportAPI'); 63 $this->System->RegisterPage(['finance', 'import-soubor'], 'PageImportFile'); 64 64 65 $this->System->ModuleManager->Modules['IS']->RegisterDashboardItem('FinanceBankAPI',66 array( 'ModuleFinanceBankAPI', 'ShowDashboardItem'));65 ModuleIS::Cast($this->System->GetModule('IS'))->RegisterDashboardItem('FinanceBankAPI', 66 array($this, 'ShowDashboardItem')); 67 67 } 68 68 69 function DoStop() 69 function DoStop(): void 70 70 { 71 71 } 72 72 73 function ShowDashboardItem() 73 function ShowDashboardItem(): string 74 74 { 75 75 $DbResult = $this->Database->select('FinanceBankImport', 'COUNT(*)', '`FinanceOperation` IS NULL'); … … 79 79 } 80 80 81 function PresetItem( $Item)81 function PresetItem(array $Item): array 82 82 { 83 83 $Preset = array(); 84 84 if ($Item['Value'] < 0) $OperationGroupId = OPERATION_GROUP_ACCOUNT_OUT; 85 85 else $OperationGroupId = OPERATION_GROUP_ACCOUNT_IN; 86 $FinanceGroup = $this->System->Modules['Finance']->GetFinanceGroupById($OperationGroupId, 'FinanceOperationGroup');86 $FinanceGroup = ModuleFinance::Cast($this->System->GetModule('Finance'))->Finance->GetFinanceGroupById($OperationGroupId, 'FinanceOperationGroup'); 87 87 88 88 $Preset = array( … … 100 100 class ScheduleBankImport extends SchedulerTask 101 101 { 102 function Execute() 102 function Execute(): string 103 103 { 104 104 $Output = '';
Note:
See TracChangeset
for help on using the changeset viewer.