Ignore:
Timestamp:
Oct 25, 2015, 9:51:51 PM (9 years ago)
Author:
chronos
Message:
  • Modified: Now IS Dashboard is not dependent on other modules. They need to register their view to IS dashboard.
  • Fixed: Wrong sign of created finance operations from bank import.
  • Added: Storno invoices now have special groups in FinanceInvoiceGroup table.

Both Storno and previous storned documents should be linked together using new table FinanceInvoiceStorno.
Also they should be marked as not visible to user.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Common/Setup/Updates.php

    r754 r755  
    15231523    'VALUES (NULL, "Kontrola změn stavů", "SchedulerNotifyCheck");');
    15241524
    1525   $this->Database->query('
     1525  $Manager->Database->query('
    15261526  CREATE TABLE IF NOT EXISTS `NotifyUser` (
    15271527  `Id` int(11) NOT NULL AUTO_INCREMENT,
     
    15331533  KEY `Contact` (`Contact`)
    15341534    ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;');
    1535   $this->Database->query('ALTER TABLE `NotifyUser`
     1535  $Manager->Database->query('ALTER TABLE `NotifyUser`
    15361536ADD CONSTRAINT `NotifyUser_ibfk_1` FOREIGN KEY (`User`) REFERENCES `User` (`Id`),
    15371537ADD CONSTRAINT `NotifyUser_ibfk_2` FOREIGN KEY (`Contact`) REFERENCES `Contact` (`Id`);');
    15381538
    1539   $this->Database->query('CREATE TABLE IF NOT EXISTS `NotifyCategory` (
     1539  $Manager->Database->query('CREATE TABLE IF NOT EXISTS `NotifyCategory` (
    15401540      `Id` int(11) NOT NULL AUTO_INCREMENT,
    15411541      `Name` varchar(255) NOT NULL,
     
    15441544    ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;');
    15451545
    1546   $this->Database->query("INSERT INTO `NotifyCategory` (`Id`, `Name`, `SysName`) VALUES
     1546  $Manager->Database->query("INSERT INTO `NotifyCategory` (`Id`, `Name`, `SysName`) VALUES
    15471547    (1, 'Dostupnost zařízení (ping)', 'NetworkReachability'),
    15481548    (2, 'Dostupnost URL', 'URL'),
     
    15531553}
    15541554
     1555function UpdateTo755($Manager)
     1556{
     1557  $Manager->Execute("INSERT INTO `FinanceInvoiceGroup` (`Id`, `Name`, `DocumentLine`, `ValueSign`, `Direction`) '.
     1558    'VALUES (NULL, 'Přijaté faktury - storno', '5', '1', '0'), (NULL, 'Vydané faktury - storno', '6', '-1', '1')");
     1559  $Manager->Execute("ALTER TABLE `FinanceInvoice` ADD `VisibleToUser` INT NOT NULL DEFAULT '1' AFTER `Generate`;ALTER TABLE `FinanceInvoice` ADD `VisibleToUser` INT NOT NULL DEFAULT '1' AFTER `Generate`;");
     1560
     1561  $Manager->Execute("CREATE TABLE IF NOT EXISTS `FinanceInvoiceStorno` (
     1562    `Id` int(11) NOT NULL AUTO_INCREMENT,
     1563    `StornoBy` int(11) NOT NULL,
     1564    `StornoOf` int(11) NOT NULL,
     1565    PRIMARY KEY (`Id`),
     1566    KEY `StornoBy` (`StornoBy`),
     1567    KEY `StornoOf` (`StornoOf`)
     1568  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
     1569
     1570  $Manager->Execute("ALTER TABLE `FinanceInvoiceStorno`
     1571  ADD CONSTRAINT `FinanceInvoiceStorno_ibfk_1` FOREIGN KEY (`StornoBy`) REFERENCES `FinanceInvoice` (`Id`),
     1572  ADD CONSTRAINT `FinanceInvoiceStorno_ibfk_2` FOREIGN KEY (`StornoOf`) REFERENCES `FinanceInvoice` (`Id`);
     1573  ");
     1574}
    15551575
    15561576class Updates
     
    16271647      747 => array('Revision' => 748, 'Function' => 'UpdateTo748'),
    16281648      748 => array('Revision' => 752, 'Function' => 'UpdateTo752'),
     1649      752 => array('Revision' => 755, 'Function' => 'UpdateTo755'),
    16291650    ));
    16301651  }
Note: See TracChangeset for help on using the changeset viewer.