Changeset 507 for trunk/finance/manage.php
- Timestamp:
- Apr 1, 2013, 7:14:59 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/finance/manage.php
r505 r507 381 381 } 382 382 $Period = $this->GetBillingPeriod($Member['BillingPeriod']); 383 if(($Period[' From'] > $Member['UNIX_TIMESTAMP(Member.BillingPeriodLastDate)']) and384 ($Member['Blocked'] == 0))383 if(($Period['MonthCount'] > 0) and ($Member['Blocked'] == 0) and 384 ($Period['From'] > $Member['UNIX_TIMESTAMP(Member.BillingPeriodLastDate)'])) 385 385 { 386 386 $InvoiceItems = array(); … … 398 398 $MonthlyTotal += $Service['Price']; 399 399 } 400 if($Member['Hire'] != 0)401 {402 $Output .= '<tr><td>Nájem</td><td>'.(-$Member['Hire']).'</td></tr>';403 $MonthlyTotal -= $Member['Hire'];404 }405 400 if($Member['MonthlyPlus'] != 0) 406 401 { 402 $InvoiceItems[] = array('Description' => 'Spotřeba energie', 'Price' => -$Member['MonthlyPlus'], 403 'Quantity' => $Period['MonthCount'], 'VAT' => 2); 407 404 $MonthlyTotal -= $Member['MonthlyPlus']; 408 405 } … … 610 607 while($Row = $DbResult->fetch_assoc()) 611 608 { 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()')); 613 611 $FileId = $this->Database->insert_id; 614 612 $FileName = 'doklad-'.$FileId.'.pdf'; … … 617 615 $Bill->System = &$this->System; 618 616 $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; 620 618 $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.'; 624 625 } 625 626
Note:
See TracChangeset
for help on using the changeset viewer.