Ignore:
Timestamp:
Mar 25, 2014, 12:35:46 PM (11 years ago)
Author:
chronos
Message:
  • Přidáno: Tabulka Smlouvy.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Finance/Finance.php

    r645 r646  
    489489      ),
    490490    ));
     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    ));
    491504
    492505    $this->System->AddModule(new Bill($this->System));
     
    502515  function BeforeInsertFinanceOperation($Form)
    503516  {
    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']);
    505519    $DocumentLine = $Form->Values['DocumentLine'];
    506520    $Form->Values['BillCode'] = $this->System->Modules['Finance']->GetNextDocumentLineNumber($DocumentLine, $Year);
Note: See TracChangeset for help on using the changeset viewer.