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/Manage.php

    r887 r901  
    135135
    136136    $Year = date('Y', $TimeCreation);
    137     $BillCode = $Finance->GetNextDocumentLineNumberId($Group['DocumentLine'], $Year);
     137    $BillCode = ModuleDocument::Cast($this->System->GetModule('Document'))->GetNextDocumentLineNumberId($Group['DocumentLine'], $Year);
    138138    $SumValue = 0;
    139139    foreach ($Items as $Item) {
     
    377377      $Title = 'Pravidelné vyúčtování služeb';
    378378      $Content = 'Vyúčtovaní zákazníka <strong>'.$Subject['Name'].'</strong> zastoupeného uživatelem <strong>'.
    379         $User['Name'].'</strong> ke dni <strong>'.$this->System->HumanDate(time()).'</strong>.<br/><br/>'."\n".
     379        $User['Name'].'</strong> ke dni <strong>'.Core::Cast($this->System)->HumanDate(time()).'</strong>.<br/><br/>'."\n".
    380380        'Vaše aktuální služby: ';
    381381      $DbResult = $this->Database->query('SELECT GROUP_CONCAT(`Service`.`Name`) AS `Name` FROM `ServiceCustomerRel` LEFT JOIN `Service` '.
     
    441441      if (file_exists($FullFileName))
    442442      {
    443         $this->Database->update('File', 'Id='.$FileId, array('Name' => $FileName, 'Size' => filesize($FullFileName)));
     443        $this->Database->update('File', 'Id='.$FileId, array('Name' => $FileName, 'Size' => filesize($FullFileName), 'Hash' => 'SHA1(CONCAT(Id,Name,Size,Time))'));
    444444        $this->Database->update('FinanceInvoice', 'Id='.$Row['Id'], array('File' => $FileId));
    445445        $Output .= 'Faktura '.$Row['Id'].' vygenerována do souboru '.$FileName.'<br/>'."\n";
     
    472472      if (file_exists($FullFileName))
    473473      {
    474         $this->Database->update('File', 'Id='.$FileId, array('Name' => $FileName, 'Size' => filesize($FullFileName)));
     474        $this->Database->update('File', 'Id='.$FileId, array('Name' => $FileName, 'Size' => filesize($FullFileName), 'Hash' => 'SHA1(CONCAT(Id,Name,Size,Time))'));
    475475        $this->Database->update('FinanceOperation', 'Id='.$Row['Id'], array('File' => $FileId));
    476476        $Output .= 'Doklad pro platbu '.$Row['Id'].' vygenerován do souboru '.$FileName.'<br/>'."\n";
Note: See TracChangeset for help on using the changeset viewer.