Changeset 627 for trunk/Modules/Finance/Finance.php
- Timestamp:
- Jan 2, 2014, 12:42:49 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Finance/Finance.php
r605 r627 164 164 // Get latest year 165 165 $DbResult = $this->Database->select('FinanceYear', '*', '1 ORDER BY `Year` DESC LIMIT 1'); 166 } else $DbResult = $this->Database->select('FinanceYear', '*', 'Id='.$FinanceYear); 166 } else $DbResult = $this->Database->select('FinanceYear', '*', '`Year`='.$FinanceYear); 167 echo('rok:'.$FinanceYear.' '.$DbResult->num_rows); 168 if($DbResult->num_rows == 0) throw new Exception('Rok '.$FinanceYear.' nenalezen'); 167 169 $FinanceYear = $DbResult->fetch_assoc(); 170 if($FinanceYear['Closed'] == 1) throw new Exception('Rok '.$FinanceYear['Year'].' je již uzavřen. Nelze do něj přidávat položky.'); 168 171 169 172 $DbResult = $this->Database->query('SELECT `Shortcut`, `Id` FROM `DocumentLine` WHERE `Id`='.$Id); … … 349 352 'Title' => 'Faktury', 350 353 'Table' => 'FinanceInvoice', 351 'DefaultSortColumn' => 'Time Creation',354 'DefaultSortColumn' => 'Time', 352 355 'Items' => array( 353 356 'DocumentLine' => array('Type' => 'TDocumentLine', 'Caption' => 'Dokladová řada', 'Default' => ''), 354 357 'BillCode' => array('Type' => 'String', 'Caption' => 'Označení', 'Default' => ''), 355 358 'Subject' => array('Type' => 'TSubject', 'Caption' => 'Subjekt', 'Default' => ''), 356 'Time Creation' => array('Type' => 'Date', 'Caption' => 'Čas vytvoření', 'Default' => ''),359 'Time' => array('Type' => 'Date', 'Caption' => 'Čas vytvoření', 'Default' => ''), 357 360 'TimeDue' => array('Type' => 'Date', 'Caption' => 'Čas splatnosti', 'Default' => ''), 358 361 'TimePayment' => array('Type' => 'Date', 'Caption' => 'Čas zaplacení', 'Default' => '', 'Null' => true), … … 462 465 function BeforeInsertFinanceOperation($Form) 463 466 { 467 $Year = date("Y", $Form->Values['Time']); 464 468 $DocumentLine = $Form->Values['DocumentLine']; 465 $Form->Values['BillCode'] = $this->System->Modules['Finance']->GetNextDocumentLineNumber($DocumentLine );469 $Form->Values['BillCode'] = $this->System->Modules['Finance']->GetNextDocumentLineNumber($DocumentLine, $Year); 466 470 return($Form->Values); 467 471 }
Note:
See TracChangeset
for help on using the changeset viewer.