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/Finance/Bill.php

    r874 r887  
    33class Bill extends Model
    44{
    5   var $SpecificSymbol = 1; // počítačová sít
    6   var $Checked;
     5  public int $SpecificSymbol = 1; // computer network number
     6  public bool $Checked = false;
    77
    88  function GenerateHTML()
     
    1111  }
    1212
    13   function SaveToFile($FileName)
    14   {
    15     global $Database;
    16 
     13  function SaveToFile(string $FileName)
     14  {
    1715    $PdfData = $this->HtmlToPdf($this->GenerateHTML());
    1816    file_put_contents($FileName, $PdfData);
    1917  }
    2018
    21   function HtmlToPdf($HtmlCode)
     19  function HtmlToPdf(string $HtmlCode): string
    2220  {
    2321    $Encoding = new Encoding();
     
    3533class BillInvoice extends Bill
    3634{
    37   var $InvoiceId;
    38 
    39   function ShowSubjectInfo($Subject)
     35  public string $InvoiceId;
     36
     37  function ShowSubjectInfo(array $Subject): string
    4038  {
    4139    $BooleanText = array('Ne', 'Ano');
     
    5048  }
    5149
    52   function GenerateHTML()
    53   {
    54     $Finance = &$this->System->Modules['Finance'];
     50  function GenerateHTML(): string
     51  {
     52    $Finance = &ModuleFinance::Cast($this->System->GetModule('Finance'))->Finance;
    5553    $Finance->LoadMonthParameters(0);
    5654
     
    152150class BillOperation extends Bill
    153151{
    154   var $OperationId;
    155 
    156   function GenerateHTML()
     152  public string $OperationId;
     153
     154  function GenerateHTML(): string
    157155  {
    158156    $DbResult = $this->Database->query('SELECT `FinanceOperation`.*, `FinanceOperationGroup`.`Direction`, `DocumentLineCode`.`Name` AS `BillName` FROM `FinanceOperation` '.
Note: See TracChangeset for help on using the changeset viewer.