Changeset 558 for trunk/Modules/Finance/Manage.php
- Timestamp:
- Jul 21, 2013, 10:55:49 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Finance/Manage.php
r553 r558 393 393 394 394 // FinanceOperations 395 $DbResult = $this->Database->query('SELECT * FROM `FinanceOperation` WHERE (`BillCode` <> "") '. 396 'AND (`Value` != 0) AND (`File` IS NULL) AND (`Generate` = 1)'); 397 while($Row = $DbResult->fetch_assoc()) 398 { 399 $DbResult2 = $this->Database->insert('File', array('Name' => '', 'Size' => 0, 400 'Directory' => $this->System->Modules['Finance']->DirectoryId, 'Time' => 'NOW()')); 401 $FileId = $this->Database->insert_id; 402 $FileName = 'doklad2-'.$FileId.'.pdf'; 403 $Bill = new BillOperation($this->System); 404 $Bill->Database = &$this->System->Database; 405 $Bill->System = &$this->System; 406 $Bill->OperationId = $Row['Id']; 407 $FullFileName = $this->System->Modules['File']->GetDir($this->System->Modules['Finance']->DirectoryId).$FileName; 408 $Bill->SaveToFile($FullFileName); 409 if(file_exists($FullFileName)) 410 { 411 $this->Database->update('File', 'Id='.$FileId, array('Name' => $FileName, 'Size' => filesize($FullFileName))); 412 $this->Database->update('FinanceOperation', 'Id='.$Row['Id'], array('File' => $FileId)); 413 $Output .= '.'; 414 } else $Output .= 'Soubor "'.$FullFileName.'" se nepodařilo uložit.'; 415 } 395 416 return($Output); 396 417 }
Note:
See TracChangeset
for help on using the changeset viewer.