Changeset 808


Ignore:
Timestamp:
Mar 6, 2016, 5:06:42 PM (9 years ago)
Author:
chronos
Message:
Location:
trunk
Files:
3 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  }
  • trunk/Application/Version.php

    r807 r808  
    11<?php
    22
    3 $Revision = 807; // Subversion revision
    4 $DatabaseRevision = 807; // SQL structure revision
     3$Revision = 808; // Subversion revision
     4$DatabaseRevision = 808; // SQL structure revision
    55$ReleaseTime = strtotime('2016-03-06');
  • trunk/Modules/Finance/Finance.php

    r802 r808  
    425425          'WHERE `FinanceOperation`.`Treasury`=#Id)'),
    426426        'Operations' => array('Type' => 'TFinanceOperationListTreasury', 'Caption' => 'Operace', 'Default' => ''),
    427       ),
     427        'Check' => array('Type' => 'TFinanceTreasuryCheckListTreasury', 'Caption' => 'Kontrola', 'Default' => ''),
     428      ),
     429    ));
     430    $this->System->FormManager->RegisterClass('FinanceTreasuryCheck', array(
     431      'Title' => 'Kontrola pokladen',
     432      'Table' => 'FinanceTreasuryCheck',
     433      'DefaultSortColumn' => 'Time',
     434      'Items' => array(
     435        'Treasury' => array('Type' => 'TFinanceTreasury', 'Caption' => 'Pokladna', 'Default' => ''),
     436        'Time' => array('Type' => 'DateTime', 'Caption' => 'Čas', 'Default' => ''),
     437        'Value1' => array('Type' => 'Integer', 'Caption' => 'Hodnota 1', 'Default' => '0', 'Suffix' => 'ks'),
     438        'Value2' => array('Type' => 'Integer', 'Caption' => 'Hodnota 2', 'Default' => '0', 'Suffix' => 'ks'),
     439        'Value5' => array('Type' => 'Integer', 'Caption' => 'Hodnota 5', 'Default' => '0', 'Suffix' => 'ks'),
     440        'Value10' => array('Type' => 'Integer', 'Caption' => 'Hodnota 10', 'Default' => '0', 'Suffix' => 'ks'),
     441        'Value20' => array('Type' => 'Integer', 'Caption' => 'Hodnota 20', 'Default' => '0', 'Suffix' => 'ks'),
     442        'Value50' => array('Type' => 'Integer', 'Caption' => 'Hodnota 50', 'Default' => '0', 'Suffix' => 'ks'),
     443        'Value100' => array('Type' => 'Integer', 'Caption' => 'Hodnota 100', 'Default' => '0', 'Suffix' => 'ks'),
     444        'Value200' => array('Type' => 'Integer', 'Caption' => 'Hodnota 200', 'Default' => '0', 'Suffix' => 'ks'),
     445        'Value500' => array('Type' => 'Integer', 'Caption' => 'Hodnota 500', 'Default' => '0', 'Suffix' => 'ks'),
     446        'Value1000' => array('Type' => 'Integer', 'Caption' => 'Hodnota 1000', 'Default' => '0', 'Suffix' => 'ks'),
     447        'Value2000' => array('Type' => 'Integer', 'Caption' => 'Hodnota 2000', 'Default' => '0', 'Suffix' => 'ks'),
     448        'Value5000' => array('Type' => 'Integer', 'Caption' => 'Hodnota 5000', 'Default' => '0', 'Suffix' => 'ks'),
     449        'Sum' => array('Type' => 'Integer', 'Caption' => 'Součet', 'Default' => '0', 'Suffix' => 'Kč',
     450          'SQL' => '(`Value1` * 1 + `Value2` * 2 + `Value5` * 5 + `Value10` * 10 + '.
     451          '`Value20` * 20 + `Value50` * 50 + `Value100` * 100 + `Value200` * 200 + '.
     452          '`Value500` * 500 + `Value1000` * 1000 + `Value2000` * 2000 + `Value5000` * 5000)'),
     453      ),
     454    ));
     455    $this->System->FormManager->RegisterFormType('TFinanceTreasuryCheckListTreasury', array(
     456      'Type' => 'ManyToOne',
     457      'Table' => 'FinanceTreasuryCheck',
     458      'Id' => 'Id',
     459      'Ref' => 'Treasury',
     460      'Filter' => '1',
    428461    ));
    429462    $this->System->FormManager->RegisterFormType('TFinanceTreasury', array(
Note: See TracChangeset for help on using the changeset viewer.