Changeset 710 for trunk/Modules/Stock/Stock.php
- Timestamp:
- Dec 29, 2014, 12:09:46 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Stock/Stock.php
r679 r710 30 30 'Code' => array('Type' => 'String', 'Caption' => 'Kód', 'Default' => ''), 31 31 'UnitOfMeasure' => array('Type' => 'TUnitOfMeasure', 'Caption' => 'Měrná jednotka', 'Default' => '', 'Null' => true), 32 'Stock Items' => array('Type' => 'TStockItemListProduct', 'Caption' => 'Položky na skladě', 'Default' => '', 'Suffix' => 'ks'),32 'StockSerialNumbers' => array('Type' => 'TStockSerialNumberListProduct', 'Caption' => 'Položky na skladě', 'Default' => '', 'Suffix' => 'ks'), 33 33 'NetworkDevices' => array('Type' => 'TNetworkDeviceListProduct', 'Caption' => 'Síťová zařízení', 'Default' => ''), 34 34 ), 35 35 )); 36 $this->System->FormManager->RegisterClass('Stock Item', array(36 $this->System->FormManager->RegisterClass('StockSerialNumber', array( 37 37 'Title' => 'Skladové položky', 38 'Table' => 'Stock Item',38 'Table' => 'StockSerialNumber', 39 39 'DefaultSortColumn' => 'Id', 40 40 'Items' => array( … … 51 51 'Segment' => array('Type' => 'TNetworkSegment', 'Caption' => 'Úsek sítě', 'Default' => '', 'Null' => true), 52 52 'Info' => array('Type' => 'Text', 'Caption' => 'Informace', 'Default' => ''), 53 'Esemble' => array('Type' => 'TStock Item', 'Caption' => 'Celek', 'Default' => ''),54 'Parts' => array('Type' => 'TStock ItemListStockItem', 'Caption' => 'Části', 'Default' => ''),53 'Esemble' => array('Type' => 'TStockSerialNumber', 'Caption' => 'Celek', 'Default' => ''), 54 'Parts' => array('Type' => 'TStockSerialNumberListStockSerialNumber', 'Caption' => 'Části', 'Default' => ''), 55 55 ), 56 56 )); … … 62 62 'Name' => array('Type' => 'String', 'Caption' => 'Jméno', 'Default' => ''), 63 63 'Location' => array('Type' => 'TMember', 'Caption' => 'Umístění', 'Default' => '', 'Null' => true), 64 'Items' => array('Type' => 'TStock ItemListStock', 'Caption' => 'Položky', 'Default' => ''),64 'Items' => array('Type' => 'TStockSerialNumberListStock', 'Caption' => 'Položky', 'Default' => ''), 65 65 'ItemsCount' => array('Type' => 'Integer', 'Caption' => 'Položek', 'Default' => '', 66 'ReadOnly' => true, 'SQL' => '(SELECT COUNT(*) FROM `Stock Item` WHERE '.67 '(`Stock Item`.`Stock`=#Id) AND (`StockItem`.`TimeElimination` IS NULL))'),66 'ReadOnly' => true, 'SQL' => '(SELECT COUNT(*) FROM `StockSerialNumber` WHERE '. 67 '(`StockSerialNumber`.`Stock`=#Id) AND (`StockSerialNumber`.`TimeElimination` IS NULL))'), 68 68 'TotalPrice' => array('Type' => 'Integer', 'Caption' => 'Celková cena', 'Default' => '', 69 'ReadOnly' => true, 'SQL' => '(SELECT SUM(`SellPrice`) FROM `Stock Item` WHERE '.70 '(`Stock Item`.`Stock`=#Id) AND (`StockItem`.`TimeElimination` IS NULL))', 'Suffix' => 'Kč'),69 'ReadOnly' => true, 'SQL' => '(SELECT SUM(`SellPrice`) FROM `StockSerialNumber` WHERE '. 70 '(`StockSerialNumber`.`Stock`=#Id) AND (`StockSerialNumber`.`TimeElimination` IS NULL))', 'Suffix' => 'Kč'), 71 71 ), 72 72 )); 73 $this->System->FormManager->RegisterClass('StockMove', array( 74 'Title' => 'Skladový pohyb', 75 'Table' => 'StockMove', 76 'DefaultSortColumn' => 'Time', 77 'Items' => array( 78 'DocumentLine' => array('Type' => 'TDocumentLine', 'Caption' => 'Dokladová řada', 'Default' => ''), 79 '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), 83 'File' => array('Type' => 'TFile', 'Caption' => 'Doklad', 'Default' => '', 'Null' => true), 84 'Price' => array('Type' => 'Float', 'Caption' => 'Cena', 'Default' => '', 85 '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('StockMoveItem', array( 92 'Title' => 'Položka skladového pohybu', 93 'Table' => 'StockMoveItem', 94 'DefaultSortColumn' => 'Text', 95 'Items' => array( 96 'StockMove' => array('Type' => 'TStockMove', 'Caption' => 'Skladový pohyb', 'Default' => ''), 97 'Product' => array('Type' => 'TProduct', 'Caption' => 'Produkt', 'Default' => ''), 98 'Amount' => array('Type' => 'Integer', 'Caption' => 'Množství', 'Default' => '1'), 99 'Text' => array('Type' => 'String', 'Caption' => 'Text', 'Default' => ''), 100 'UnitPrice' => array('Type' => 'Integer', 'Caption' => 'Jednotková cena', 'Default' => '0', 'Suffix' => 'Kč'), 101 ), 102 )); 103 $this->System->FormManager->RegisterFormType('TStockMoveItemListStockMove', array( 104 'Type' => 'ManyToOne', 105 'Table' => 'StockMoveItem', 106 'Id' => 'Id', 107 'Ref' => 'StockMove', 108 'Filter' => '1', 109 )); 110 $this->System->FormManager->RegisterFormType('TStockMove', array( 111 'Type' => 'Reference', 112 'Table' => 'StockMove', 113 'Id' => 'Id', 114 'Name' => 'BillCode', 115 'Filter' => '1', 116 )); 117 } 118 119 function BeforeInsertStockMove($Form) 120 { 121 if(array_key_exists('Time', $Form->Values)) $Year = date("Y", $Form->Values['Time']); 122 else $Year = date("Y", $Form->Values['ValidFrom']); 123 $DocumentLine = $Form->Values['DocumentLine']; 124 $Form->Values['BillCode'] = $this->System->Modules['Finance']->GetNextDocumentLineNumber($DocumentLine, $Year); 125 return($Form->Values); 73 126 } 74 127 }
Note:
See TracChangeset
for help on using the changeset viewer.