Ignore:
Timestamp:
Feb 17, 2021, 9:27:32 PM (3 years ago)
Author:
chronos
Message:
  • Added: Documents section accessible from users panel.
  • Added: Contract model moved to separate module Contract.
  • Added: New action to generate PDF from Contract.
  • Fixed: Allow users to download files only by hash instead of direct id.
  • Added: Support for SHA1 as allowed mysql function.
File:
1 edited

Legend:

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

    r888 r901  
    11<?php
    22
    3 class Bill extends Model
     3class Bill extends Pdf
    44{
    55  public int $SpecificSymbol = 1; // computer network number
    6   public bool $Checked = false;
    7 
    8   function GenerateHTML(): string
    9   {
    10     return '';
    11   }
    12 
    13   function SaveToFile(string $FileName): void
    14   {
    15     $PdfData = $this->HtmlToPdf($this->GenerateHTML());
    16     file_put_contents($FileName, $PdfData);
    17   }
    18 
    19   function HtmlToPdf(string $HtmlCode): string
    20   {
    21     $Encoding = new Encoding();
    22     if ($this->Checked == false) {
    23       if (CommandExist('htmldoc')) {
    24         $this->Checked = true;
    25       } else throw new Exception('htmldoc is not installed.');
    26     }
    27     $Output = shell_exec('echo "'.addslashes($Encoding->FromUTF8($HtmlCode)).
    28       '"|htmldoc --no-numbered --webpage --no-embedfonts --charset 8859-2 -t pdf -');
    29     return $Output;
    30   }
    316}
    327
Note: See TracChangeset for help on using the changeset viewer.