Ignore:
Timestamp:
Mar 6, 2016, 10:37:04 AM (9 years ago)
Author:
chronos
Message:
  • Added: Min amount of products needed permanently avaialble on stock.
File:
1 edited

Legend:

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

    r803 r807  
    3232        'Supplier' => array('Type' => 'TSubject', 'Caption' => 'Dodavatel', 'Default' => '', 'Null' => true),
    3333        'UnitOfMeasure' => array('Type' => 'TUnitOfMeasure', 'Caption' => 'Měrná jednotka', 'Default' => '', 'Null' => true),
    34         'StockSerialNumbers' => array('Type' => 'TStockSerialNumberListProduct', 'Caption' => 'Položky na skladě', 'Default' => '', 'Suffix' => 'ks'),
    35         'StockState' => array('Type' => 'Integer', 'Caption' => 'Síťová zařízení', 'Default' => '', 'ReadOnly' => true,
    36           'SQL' => 'SELECT SUM(`Amount`) FROM `StockMoveItem` WHERE `StockMoveItem`.`Product`=#Id'),
     34        'StockSerialNumbers' => array('Type' => 'TStockSerialNumberListProduct', 'Caption' => 'Položky na skladě', 'Default' => ''),
     35        'StockState' => array('Type' => 'Integer', 'Caption' => 'Počet na skladě', 'Default' => '', 'ReadOnly' => true,
     36          'SQL' => 'SELECT IFNULL(SUM(`Amount`), 0) FROM `StockMoveItem` WHERE `StockMoveItem`.`Product`=#Id'),
     37        'StockMinCount' => array('Type' => 'Integer', 'Caption' => 'Skladové minimum', 'Default' => '0'),
    3738        'StockMoves' => array('Type' => 'TStockMoveItemListProduct', 'Caption' => 'Pohyby na skladě', 'Default' => ''),
    3839        'NetworkDevices' => array('Type' => 'TNetworkDeviceListProduct', 'Caption' => 'Síťová zařízení', 'Default' => ''),
    39       ),
    40     ));
     40        'StockShortage' => array('Type' => 'TStockState', 'Caption' => 'Stav skladu', 'Default' => '', 'ReadOnly' => true,
     41          'SQL' => 'SELECT (IFNULL(SUM(`Amount`), 0) >= `StockMinCount`) FROM `StockMoveItem` WHERE `StockMoveItem`.`Product`=#Id'),
     42      ),
     43    ));
     44
    4145    $this->System->FormManager->RegisterClass('StockSerialNumber', array(
    4246      'Title' => 'Skladové položky',
     
    234238      'Filter' => '1',
    235239    ));
     240
     241    $this->System->FormManager->RegisterFormType('TStockState', array(
     242      'Type' => 'Enumeration',
     243      'States' => array('<span style="color:red;">Nedostatek</span>',
     244        '<span style="color:green;">Dostatek</span>'),
     245    ));
    236246  }
    237247
Note: See TracChangeset for help on using the changeset viewer.