Changeset 807


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.
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Application/UpdateTrace.php

    r806 r807  
    19031903  $Manager->Execute('ALTER TABLE `StockMoveItemSerialRel` ADD FOREIGN KEY (`StockSerialNumber`) '.
    19041904    'REFERENCES `StockSerialNumber`(`Id`) ON DELETE RESTRICT ON UPDATE RESTRICT;');
     1905}
     1906
     1907function UpdateTo807($Manager)
     1908{
     1909  $Manager->Execute('ALTER TABLE `Product` ADD `StockMinCount` INT NOT NULL AFTER `UnitOfMeasure`;');
    19051910}
    19061911
     
    19911996      800 => array('Revision' => 802, 'Function' => 'UpdateTo802'),
    19921997      802 => array('Revision' => 803, 'Function' => 'UpdateTo803'),
     1998      803 => array('Revision' => 807, 'Function' => 'UpdateTo807'),
    19931999    ));
    19942000  }
  • trunk/Application/Version.php

    r803 r807  
    11<?php
    22
    3 $Revision = 803; // Subversion revision
    4 $DatabaseRevision = 803; // SQL structure revision
    5 $ReleaseTime = strtotime('2016-02-23');
     3$Revision = 807; // Subversion revision
     4$DatabaseRevision = 807; // SQL structure revision
     5$ReleaseTime = strtotime('2016-03-06');
  • 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.