Ignore:
Timestamp:
Apr 1, 2013, 7:14:59 PM (12 years ago)
Author:
chronos
Message:
  • Opraveno: Generování nastavení sítě. Generování front Queue nyní pracuje s přiřazením služeb k zařízením a podsítím.
  • Opraveno: Zjišťování adresáře souborů na disku dle id adresáře.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/finance/manage.php

    r505 r507  
    381381      }
    382382      $Period = $this->GetBillingPeriod($Member['BillingPeriod']);
    383       if(($Period['From'] > $Member['UNIX_TIMESTAMP(Member.BillingPeriodLastDate)']) and
    384           ($Member['Blocked'] == 0))
     383      if(($Period['MonthCount'] > 0) and ($Member['Blocked'] == 0) and
     384        ($Period['From'] > $Member['UNIX_TIMESTAMP(Member.BillingPeriodLastDate)']))
    385385      {
    386386        $InvoiceItems = array();
     
    398398          $MonthlyTotal += $Service['Price'];
    399399        }
    400         if($Member['Hire'] != 0)
    401         {
    402           $Output .= '<tr><td>Nájem</td><td>'.(-$Member['Hire']).'</td></tr>';
    403           $MonthlyTotal -= $Member['Hire'];
    404         }
    405400        if($Member['MonthlyPlus'] != 0)
    406401        {
     402          $InvoiceItems[] = array('Description' => 'Spotřeba energie', 'Price' => -$Member['MonthlyPlus'],
     403            'Quantity' => $Period['MonthCount'], 'VAT' => 2);
    407404          $MonthlyTotal -= $Member['MonthlyPlus'];
    408405        }
     
    610607    while($Row = $DbResult->fetch_assoc())
    611608    {
    612       $DbResult2 = $this->Database->insert('File', array('Name' => '', 'Size' => 0));
     609      $DbResult2 = $this->Database->insert('File', array('Name' => '', 'Size' => 0,
     610        'Directory' => $this->System->Modules['Finance']->DirectoryId, 'Time' => 'NOW()'));
    613611      $FileId = $this->Database->insert_id;
    614612      $FileName = 'doklad-'.$FileId.'.pdf';
     
    617615      $Bill->System = &$this->System;
    618616      $Bill->InvoiceId = $Row['Id'];
    619       $FullFileName = $this->System->Modules['File']->FilesDir.$FileName;
     617      $FullFileName = $this->System->Modules['File']->GetDir($this->System->Modules['Finance']->DirectoryId).$FileName;
    620618      $Bill->SaveToFile($FullFileName);
    621       $this->Database->update('File', 'Id='.$FileId, array('Name' => $FileName, 'Size' => filesize($FullFileName)));
    622       $this->Database->update('FinanceInvoice', 'Id='.$Row['Id'], array('File' => $FileId));
    623       $Output .= '.';
     619      if(file_exists($FullFileName))
     620      {
     621        $this->Database->update('File', 'Id='.$FileId, array('Name' => $FileName, 'Size' => filesize($FullFileName)));
     622        $this->Database->update('FinanceInvoice', 'Id='.$Row['Id'], array('File' => $FileId));
     623        $Output .= '.';
     624      } else $Output .= 'Soubor "'.$FullFileName.'" se nepodařilo uložit.';
    624625    }
    625626
Note: See TracChangeset for help on using the changeset viewer.