Changeset 646 for trunk/Modules/Finance/Finance.php
- Timestamp:
- Mar 25, 2014, 12:35:46 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Finance/Finance.php
r645 r646 489 489 ), 490 490 )); 491 $this->System->FormManager->RegisterClass('Contract', array( 492 'Title' => 'Smlouvy', 493 'Table' => 'Contract', 494 'Items' => array( 495 'DocumentLine' => array('Type' => 'TDocumentLine', 'Caption' => 'Dokladová řada', 'Default' => ''), 496 'BillCode' => array('Type' => 'String', 'Caption' => 'Kód', 'Default' => ''), 497 'Subject' => array('Type' => 'TSubject', 'Caption' => 'Subjekt', 'Default' => ''), 498 'ValidFrom' => array('Type' => 'Date', 'Caption' => 'Platnost od', 'Default' => ''), 499 'ValidTo' => array('Type' => 'Date', 'Caption' => 'Platnost do', 'Default' => '', 'Null' => true), 500 'File' => array('Type' => 'TFile', 'Caption' => 'Soubor', 'Default' => '', 'Null' => true), 501 ), 502 'BeforeInsert' => array($this, 'BeforeInsertFinanceOperation'), 503 )); 491 504 492 505 $this->System->AddModule(new Bill($this->System)); … … 502 515 function BeforeInsertFinanceOperation($Form) 503 516 { 504 $Year = date("Y", $Form->Values['Time']); 517 if(array_key_exists('Time', $Form->Values)) $Year = date("Y", $Form->Values['Time']); 518 else $Year = date("Y", $Form->Values['ValidFrom']); 505 519 $DocumentLine = $Form->Values['DocumentLine']; 506 520 $Form->Values['BillCode'] = $this->System->Modules['Finance']->GetNextDocumentLineNumber($DocumentLine, $Year);
Note:
See TracChangeset
for help on using the changeset viewer.