Changeset 789


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

Legend:

Unmodified
Added
Removed
  • trunk/Application/Version.php

    r788 r789  
    11<?php
    22
    3 $Revision = 788; // Subversion revision
     3$Revision = 789; // Subversion revision
    44$DatabaseRevision = 785; // SQL structure revision
    55$ReleaseTime = strtotime('2016-01-15');
  • 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.