Ignore:
Timestamp:
Apr 14, 2015, 10:20:16 PM (10 years ago)
Author:
chronos
Message:
  • Removed: Spaces on end of line.
  • Modified: Tabs converted to spaces.
File:
1 edited

Legend:

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

    r736 r738  
    6868          'ReadOnly' => true, 'SQL' => '(SELECT SUM(`SellPrice`) FROM `StockSerialNumber` WHERE '.
    6969          '(`StockSerialNumber`.`Stock`=#Id) AND (`StockSerialNumber`.`TimeElimination` IS NULL))', 'Suffix' => 'Kč'),
    70         'Moves' => array('Type' => 'TStockMoveStock', 'Caption' => 'Pohyby', 'Default' => ''),
     70        'Moves' => array('Type' => 'TStockMoveStock', 'Caption' => 'Pohyby', 'Default' => ''),
    7171      ),
    7272    ));
     
    7878        'DocumentLine' => array('Type' => 'TDocumentLine', 'Caption' => 'Dokladová řada', 'Default' => ''),
    7979        'BillCode' => array('Type' => 'String', 'Caption' => 'Označení', 'Default' => ''),
    80         'Time' => array('Type' => 'DateTime', 'Caption' => 'Čas', 'Default' => ''),
    81         'StockFrom' => array('Type' => 'TStock', 'Caption' => 'Zdrojový sklad', 'Default' => '', 'Null' => true),
    82         'StockTo' => array('Type' => 'TStock', 'Caption' => 'Cílový sklad', 'Default' => '', 'Null' => true),
     80        'Time' => array('Type' => 'DateTime', 'Caption' => 'Čas', 'Default' => ''),
     81        'StockFrom' => array('Type' => 'TStock', 'Caption' => 'Zdrojový sklad', 'Default' => '', 'Null' => true),
     82        'StockTo' => array('Type' => 'TStock', 'Caption' => 'Cílový sklad', 'Default' => '', 'Null' => true),
    8383        'File' => array('Type' => 'TFile', 'Caption' => 'Doklad', 'Default' => '', 'Null' => true),
    8484        'Price' => array('Type' => 'Float', 'Caption' => 'Cena', 'Default' => '',
    8585          'ReadOnly' => true, 'Suffix' => 'Kč', 'SQL' => '(SELECT SUM(`StockMoveItem`.`UnitPrice` * `StockMoveItem`.`Amount`) FROM `StockMoveItem` '.
    8686          'WHERE `StockMoveItem`.`StockMove`=#Id)'),
    87         'Items' => array('Type' => 'TStockMoveItemListStockMove', 'Caption' => 'Položky', 'Default' => ''),
    88       ),       
     87        'Items' => array('Type' => 'TStockMoveItemListStockMove', 'Caption' => 'Položky', 'Default' => ''),
     88      ),
    8989      'BeforeInsert' => array($this, 'BeforeInsertStockMove'),
    9090    ));
     
    9393      'BaseTable' => 'StockMove',
    9494      'DefaultSortColumn' => 'Time',
    95         'SQL' => '(SELECT *, -1 AS `Direction`, `StockFrom` AS `Stock`, `StockTo` AS `StockOther` FROM `StockMove`) '.
    96                 'UNION (SELECT *, 1 AS `Direction`, `StockTo` AS `Stock`, `StockFrom` AS `StockOther` FROM `StockMove`)',
     95      'SQL' => '(SELECT *, -1 AS `Direction`, `StockFrom` AS `Stock`, `StockTo` AS `StockOther` FROM `StockMove`) '.
     96        'UNION (SELECT *, 1 AS `Direction`, `StockTo` AS `Stock`, `StockFrom` AS `StockOther` FROM `StockMove`)',
    9797      'Items' => array(
    9898        'DocumentLine' => array('Type' => 'TDocumentLine', 'Caption' => 'Dokladová řada', 'Default' => ''),
    9999        'BillCode' => array('Type' => 'String', 'Caption' => 'Označení', 'Default' => ''),
    100         'Time' => array('Type' => 'DateTime', 'Caption' => 'Čas', 'Default' => ''),
    101         'Stock' => array('Type' => 'TStock', 'Caption' => 'První sklad', 'Default' => '', 'Null' => true),
    102         'StockOther' => array('Type' => 'TStock', 'Caption' => 'Druhý sklad', 'Default' => '', 'Null' => true),
     100        'Time' => array('Type' => 'DateTime', 'Caption' => 'Čas', 'Default' => ''),
     101        'Stock' => array('Type' => 'TStock', 'Caption' => 'První sklad', 'Default' => '', 'Null' => true),
     102        'StockOther' => array('Type' => 'TStock', 'Caption' => 'Druhý sklad', 'Default' => '', 'Null' => true),
    103103        'File' => array('Type' => 'TFile', 'Caption' => 'Doklad', 'Default' => '', 'Null' => true),
    104104        'Price' => array('Type' => 'Float', 'Caption' => 'Cena', 'Default' => '',
    105105          'ReadOnly' => true, 'Suffix' => 'Kč', 'SQL' => '(SELECT `TX`.`Direction` * SUM(`StockMoveItem`.`UnitPrice` * `StockMoveItem`.`Amount`) FROM `StockMoveItem` '.
    106106          'WHERE `StockMoveItem`.`StockMove`=#Id)'),
    107         'Items' => array('Type' => 'TStockMoveItemListStockMove', 'Caption' => 'Položky', 'Default' => ''),
    108       ),       
     107        'Items' => array('Type' => 'TStockMoveItemListStockMove', 'Caption' => 'Položky', 'Default' => ''),
     108      ),
    109109      'BeforeInsert' => array($this, 'BeforeInsertStockMove'),
    110110    ));
     
    116116        'StockMove' => array('Type' => 'TStockMove', 'Caption' => 'Skladový pohyb', 'Default' => ''),
    117117        'Product' => array('Type' => 'TProduct', 'Caption' => 'Produkt', 'Default' => ''),
    118         'Amount' => array('Type' => 'Integer', 'Caption' => 'Množství', 'Default' => '1'),
    119         'Text' => array('Type' => 'String', 'Caption' => 'Text', 'Default' => ''),
     118        'Amount' => array('Type' => 'Integer', 'Caption' => 'Množství', 'Default' => '1'),
     119        'Text' => array('Type' => 'String', 'Caption' => 'Text', 'Default' => ''),
    120120        'UnitPrice' => array('Type' => 'Integer', 'Caption' => 'Jednotková cena', 'Default' => '0', 'Suffix' => 'Kč'),
    121       ),       
     121      ),
    122122    ));
    123123    $this->System->FormManager->RegisterFormType('TStockMoveItemListStockMove', array(
     
    127127      'Ref' => 'StockMove',
    128128      'Filter' => '1',
    129     )); 
     129    ));
    130130    $this->System->FormManager->RegisterFormType('TStockMoveStock', array(
    131131      'Type' => 'ManyToOne',
     
    134134      'Ref' => 'Stock',
    135135      'Filter' => '1',
    136     ));     
     136    ));
    137137    $this->System->FormManager->RegisterFormType('TStockMove', array(
    138138      'Type' => 'Reference',
     
    167167  function BeforeInsertStockMove($Form)
    168168  {
    169         if(array_key_exists('Time', $Form->Values)) $Year = date("Y", $Form->Values['Time']);
    170           else $Year = date("Y", $Form->Values['ValidFrom']);
     169    if(array_key_exists('Time', $Form->Values)) $Year = date("Y", $Form->Values['Time']);
     170      else $Year = date("Y", $Form->Values['ValidFrom']);
    171171    $DocumentLine = $Form->Values['DocumentLine'];
    172172    $Form->Values['BillCode'] = $this->System->Modules['Finance']->GetNextDocumentLineNumber($DocumentLine, $Year);
Note: See TracChangeset for help on using the changeset viewer.