Ignore:
Timestamp:
Apr 6, 2015, 11:08:10 PM (9 years ago)
Author:
chronos
Message:
File:
1 edited

Legend:

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

    r715 r736  
    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' => ''),
    7071      ),
    7172    ));
     
    8384        'Price' => array('Type' => 'Float', 'Caption' => 'Cena', 'Default' => '',
    8485          'ReadOnly' => true, 'Suffix' => 'Kč', 'SQL' => '(SELECT SUM(`StockMoveItem`.`UnitPrice` * `StockMoveItem`.`Amount`) FROM `StockMoveItem` '.
     86          'WHERE `StockMoveItem`.`StockMove`=#Id)'),
     87        'Items' => array('Type' => 'TStockMoveItemListStockMove', 'Caption' => 'Položky', 'Default' => ''),
     88      ),       
     89      'BeforeInsert' => array($this, 'BeforeInsertStockMove'),
     90    ));
     91    $this->System->FormManager->RegisterClass('StockMoveUnion', array(
     92      'Title' => 'Skladový pohyb',
     93      'BaseTable' => 'StockMove',
     94      '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`)',
     97      'Items' => array(
     98        'DocumentLine' => array('Type' => 'TDocumentLine', 'Caption' => 'Dokladová řada', 'Default' => ''),
     99        '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),
     103        'File' => array('Type' => 'TFile', 'Caption' => 'Doklad', 'Default' => '', 'Null' => true),
     104        'Price' => array('Type' => 'Float', 'Caption' => 'Cena', 'Default' => '',
     105          'ReadOnly' => true, 'Suffix' => 'Kč', 'SQL' => '(SELECT `TX`.`Direction` * SUM(`StockMoveItem`.`UnitPrice` * `StockMoveItem`.`Amount`) FROM `StockMoveItem` '.
    85106          'WHERE `StockMoveItem`.`StockMove`=#Id)'),
    86107        'Items' => array('Type' => 'TStockMoveItemListStockMove', 'Caption' => 'Položky', 'Default' => ''),
     
    107128      'Filter' => '1',
    108129    )); 
     130    $this->System->FormManager->RegisterFormType('TStockMoveStock', array(
     131      'Type' => 'ManyToOne',
     132      'Table' => 'StockMoveUnion',
     133      'Id' => 'Id',
     134      'Ref' => 'Stock',
     135      'Filter' => '1',
     136    ));     
    109137    $this->System->FormManager->RegisterFormType('TStockMove', array(
    110138      'Type' => 'Reference',
Note: See TracChangeset for help on using the changeset viewer.