Ignore:
Timestamp:
Jan 16, 2016, 4:58:06 PM (9 years ago)
Author:
chronos
Message:
  • Fixed: Error during insertion of new contracts.
File:
1 edited

Legend:

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

    r786 r789  
    540540        'File' => array('Type' => 'TFile', 'Caption' => 'Soubor', 'Default' => '', 'Null' => true),
    541541      ),
    542       'BeforeInsert' => array($this, 'BeforeInsertFinanceOperation'),
     542      'BeforeInsert' => array($this, 'BeforeInsertContract'),
    543543    ));
    544544    $this->System->FormManager->RegisterFormType('TContract', array(
     
    668668    return($Form->Values);
    669669  }
     670
     671  function BeforeInsertContract($Form)
     672  {
     673    if(array_key_exists('Time', $Form->Values)) $Year = date("Y", $Form->Values['Time']);
     674      else $Year = date("Y", $Form->Values['ValidFrom']);
     675    $Form->Values['BillCode'] = $this->System->Modules['Finance']->GetNextDocumentLineNumberId($Form->Values['DocumentLine'], $Year);
     676    return($Form->Values);
     677  }
    670678}
Note: See TracChangeset for help on using the changeset viewer.