Ignore:
Timestamp:
Mar 6, 2016, 5:06:42 PM (9 years ago)
Author:
chronos
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Application/UpdateTrace.php

    r807 r808  
    19081908{
    19091909  $Manager->Execute('ALTER TABLE `Product` ADD `StockMinCount` INT NOT NULL AFTER `UnitOfMeasure`;');
     1910}
     1911
     1912function UpdateTo808($Manager)
     1913{
     1914  $Manager->Execute('CREATE TABLE IF NOT EXISTS `FinanceTreasuryCheck` (
     1915    `Id` int(11) NOT NULL AUTO_INCREMENT,
     1916    `Treasury` int(11) NOT NULL,
     1917    `Time` datetime NOT NULL,
     1918    `Value1` int(11) NOT NULL,
     1919    `Value2` int(11) NOT NULL,
     1920    `Value5` int(11) NOT NULL,
     1921    `Value10` int(11) NOT NULL,
     1922    `Value20` int(11) NOT NULL,
     1923    `Value50` int(11) NOT NULL,
     1924    `Value100` int(11) NOT NULL,
     1925    `Value200` int(11) NOT NULL,
     1926    `Value500` int(11) NOT NULL,
     1927    `Value1000` int(11) NOT NULL,
     1928    `Value2000` int(11) NOT NULL,
     1929    `Value5000` int(11) NOT NULL,
     1930    PRIMARY KEY (`Id`),
     1931    KEY `Treasury` (`Treasury`)
     1932    ) ENGINE=InnoDB DEFAULT CHARSET=utf8;');
     1933  $Manager->Execute('ALTER TABLE `FinanceTreasuryCheck`
     1934    ADD CONSTRAINT `FinanceTreasuryCheck_ibfk_1` FOREIGN KEY (`Treasury`) REFERENCES `FinanceTreasury` (`Id`);');
     1935
     1936  // IS menu item
     1937  $Manager->Execute('INSERT INTO `Action` (`Id` ,`Name` ,`Title` ,`Type` ,`URL` ,
     1938`Group` ,`Icon` ,`PermissionOperation` ,`Enable`) VALUES (
     1939NULL , "", "Kontrola pokladen", "1", "/is/?t=FinanceTreasuryCheck&a=list", NULL , NULL , NULL , "1");');
     1940  $ActionId = $Manager->Database->insert_id;
     1941  $DbResult = $Manager->Execute('SELECT `Id` FROM `MenuItem` WHERE `Name`="Pokladny"');
     1942  if($DbResult->num_rows > 0)
     1943  {
     1944    $DbRow = $DbResult->fetch_assoc();
     1945    $Manager->Execute("INSERT INTO `MenuItem` (`Id` ,`Name` ,`Parent` ,`Action` ,`Menu`) ".
     1946        "VALUES (NULL , 'Kontrola pokladen', ".$DbRow['Id'].", '".$ActionId."', '1');");
     1947  }
     1948
    19101949}
    19111950
     
    19972036      802 => array('Revision' => 803, 'Function' => 'UpdateTo803'),
    19982037      803 => array('Revision' => 807, 'Function' => 'UpdateTo807'),
     2038      807 => array('Revision' => 808, 'Function' => 'UpdateTo808'),
    19992039    ));
    20002040  }
Note: See TracChangeset for help on using the changeset viewer.