Ignore:
Timestamp:
Nov 20, 2020, 12:08:12 AM (4 years ago)
Author:
chronos
Message:
  • Added: Static types added to almost all classes, methods and function. Supported by PHP 7.4.
  • Fixed: Various found code issues.
File:
1 edited

Legend:

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

    r874 r887  
    33class ModuleStock extends AppModule
    44{
    5   function __construct($System)
     5  function __construct(System $System)
    66  {
    77    parent::__construct($System);
     
    1414  }
    1515
    16   function DoStart()
     16  function DoStart(): void
    1717  {
    1818    global $Config;
     
    246246  }
    247247
    248   function BeforeInsertStockMove($Form)
     248  function BeforeInsertStockMove(Form $Form): array
    249249  {
     250    $Finance = &ModuleFinance::Cast($this->System->GetModule('Finance'))->Finance;
    250251    if (array_key_exists('Time', $Form->Values)) $Year = date("Y", $Form->Values['Time']);
    251252      else $Year = date("Y", $Form->Values['ValidFrom']);
    252     $Group = $this->System->Modules['Finance']->GetFinanceGroupById($Form->Values['Group'], 'StockMoveGroup');
    253     $Form->Values['BillCode'] = $this->System->Modules['Finance']->GetNextDocumentLineNumberId($Group['DocumentLine'], $Year);
     253    $Group = $Finance->GetFinanceGroupById($Form->Values['Group'], 'StockMoveGroup');
     254    $Form->Values['BillCode'] = $Finance->GetNextDocumentLineNumberId($Group['DocumentLine'], $Year);
    254255    return $Form->Values;
    255256  }
Note: See TracChangeset for help on using the changeset viewer.