Changeset 738 for trunk/Modules/Stock/Stock.php
- Timestamp:
- Apr 14, 2015, 10:20:16 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Stock/Stock.php
r736 r738 68 68 'ReadOnly' => true, 'SQL' => '(SELECT SUM(`SellPrice`) FROM `StockSerialNumber` WHERE '. 69 69 '(`StockSerialNumber`.`Stock`=#Id) AND (`StockSerialNumber`.`TimeElimination` IS NULL))', 'Suffix' => 'Kč'), 70 70 'Moves' => array('Type' => 'TStockMoveStock', 'Caption' => 'Pohyby', 'Default' => ''), 71 71 ), 72 72 )); … … 78 78 'DocumentLine' => array('Type' => 'TDocumentLine', 'Caption' => 'Dokladová řada', 'Default' => ''), 79 79 'BillCode' => array('Type' => 'String', 'Caption' => 'Označení', 'Default' => ''), 80 81 82 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), 83 83 'File' => array('Type' => 'TFile', 'Caption' => 'Doklad', 'Default' => '', 'Null' => true), 84 84 'Price' => array('Type' => 'Float', 'Caption' => 'Cena', 'Default' => '', 85 85 'ReadOnly' => true, 'Suffix' => 'Kč', 'SQL' => '(SELECT SUM(`StockMoveItem`.`UnitPrice` * `StockMoveItem`.`Amount`) FROM `StockMoveItem` '. 86 86 'WHERE `StockMoveItem`.`StockMove`=#Id)'), 87 88 ), 87 'Items' => array('Type' => 'TStockMoveItemListStockMove', 'Caption' => 'Položky', 'Default' => ''), 88 ), 89 89 'BeforeInsert' => array($this, 'BeforeInsertStockMove'), 90 90 )); … … 93 93 'BaseTable' => 'StockMove', 94 94 'DefaultSortColumn' => 'Time', 95 96 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 97 'Items' => array( 98 98 'DocumentLine' => array('Type' => 'TDocumentLine', 'Caption' => 'Dokladová řada', 'Default' => ''), 99 99 'BillCode' => array('Type' => 'String', 'Caption' => 'Označení', 'Default' => ''), 100 101 102 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 103 'File' => array('Type' => 'TFile', 'Caption' => 'Doklad', 'Default' => '', 'Null' => true), 104 104 'Price' => array('Type' => 'Float', 'Caption' => 'Cena', 'Default' => '', 105 105 'ReadOnly' => true, 'Suffix' => 'Kč', 'SQL' => '(SELECT `TX`.`Direction` * SUM(`StockMoveItem`.`UnitPrice` * `StockMoveItem`.`Amount`) FROM `StockMoveItem` '. 106 106 'WHERE `StockMoveItem`.`StockMove`=#Id)'), 107 108 ), 107 'Items' => array('Type' => 'TStockMoveItemListStockMove', 'Caption' => 'Položky', 'Default' => ''), 108 ), 109 109 'BeforeInsert' => array($this, 'BeforeInsertStockMove'), 110 110 )); … … 116 116 'StockMove' => array('Type' => 'TStockMove', 'Caption' => 'Skladový pohyb', 'Default' => ''), 117 117 'Product' => array('Type' => 'TProduct', 'Caption' => 'Produkt', 'Default' => ''), 118 119 118 'Amount' => array('Type' => 'Integer', 'Caption' => 'Množství', 'Default' => '1'), 119 'Text' => array('Type' => 'String', 'Caption' => 'Text', 'Default' => ''), 120 120 'UnitPrice' => array('Type' => 'Integer', 'Caption' => 'Jednotková cena', 'Default' => '0', 'Suffix' => 'Kč'), 121 ), 121 ), 122 122 )); 123 123 $this->System->FormManager->RegisterFormType('TStockMoveItemListStockMove', array( … … 127 127 'Ref' => 'StockMove', 128 128 'Filter' => '1', 129 )); 129 )); 130 130 $this->System->FormManager->RegisterFormType('TStockMoveStock', array( 131 131 'Type' => 'ManyToOne', … … 134 134 'Ref' => 'Stock', 135 135 'Filter' => '1', 136 )); 136 )); 137 137 $this->System->FormManager->RegisterFormType('TStockMove', array( 138 138 'Type' => 'Reference', … … 167 167 function BeforeInsertStockMove($Form) 168 168 { 169 170 169 if(array_key_exists('Time', $Form->Values)) $Year = date("Y", $Form->Values['Time']); 170 else $Year = date("Y", $Form->Values['ValidFrom']); 171 171 $DocumentLine = $Form->Values['DocumentLine']; 172 172 $Form->Values['BillCode'] = $this->System->Modules['Finance']->GetNextDocumentLineNumber($DocumentLine, $Year);
Note:
See TracChangeset
for help on using the changeset viewer.