Changeset 756
- Timestamp:
- Oct 25, 2015, 10:37:29 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/Version.php
r755 r756 1 1 <?php 2 2 3 $Revision = 75 5; // Subversion revision3 $Revision = 756; // Subversion revision 4 4 $DatabaseRevision = 755; // SQL structure revision 5 5 $ReleaseTime = strtotime('2015-10-25'); -
trunk/Common/Setup/Updates.php
r755 r756 1505 1505 $Manager->Execute('UPDATE `FinanceInvoice` SET `Value`=`Value`*`ValueSign`'); 1506 1506 $Manager->Execute('ALTER TABLE `FinanceInvoice` DROP `Direction`, DROP `ValueSign`;'); 1507 // Check manual vs. calculated value from items 1508 // SELECT * FROM (SELECT `FinanceInvoice`.`Id`, ((SELECT SUM(CEIL(`Price` * `Quantity`)) FROM `FinanceInvoiceItem` WHERE `FinanceInvoiceItem`.`FinanceInvoice`=`FinanceInvoice`.`Id`) * `FinanceInvoiceGroup`.`ValueSign`) AS `Sum`,`FinanceInvoice`.`Value` FROM `FinanceInvoice` LEFT JOIN `FinanceInvoiceGroup` ON `FinanceInvoiceGroup`.`Id`=`FinanceInvoice`.`Group`) AS `T` WHERE `Sum` != `Value` 1507 1508 // Check rounding manual vs. calculated value from items 1509 // SELECT * FROM (SELECT `FinanceInvoice`.`Id`, ((SELECT ROUND(SUM(`Price` * `Quantity`)) FROM `FinanceInvoiceItem` WHERE `FinanceInvoiceItem`.`FinanceInvoice`=`FinanceInvoice`.`Id`) * `FinanceInvoiceGroup`.`ValueSign`) AS `Sum`, ((SELECT (SUM(`Price` * `Quantity`)) FROM `FinanceInvoiceItem` WHERE `FinanceInvoiceItem`.`FinanceInvoice`=`FinanceInvoice`.`Id`) * `FinanceInvoiceGroup`.`ValueSign`) AS `Sum2`, `FinanceInvoice`.`Value` FROM `FinanceInvoice` LEFT JOIN `FinanceInvoiceGroup` ON `FinanceInvoiceGroup`.`Id`=`FinanceInvoice`.`Group`) AS `T` WHERE `Sum` != `Value` 1510 // Check sign of manual vs. calculated value from items 1511 // SELECT * FROM (SELECT `FinanceInvoice`.`Id`, ((SELECT ROUND(SUM(`Price` * `Quantity`)) FROM `FinanceInvoiceItem` WHERE `FinanceInvoiceItem`.`FinanceInvoice`=`FinanceInvoice`.`Id`) * `FinanceInvoiceGroup`.`ValueSign`) AS `Sum`, ((SELECT (SUM(`Price` * `Quantity`)) FROM `FinanceInvoiceItem` WHERE `FinanceInvoiceItem`.`FinanceInvoice`=`FinanceInvoice`.`Id`) * `FinanceInvoiceGroup`.`ValueSign`) AS `Sum2`, `FinanceInvoice`.`Value` FROM `FinanceInvoice` LEFT JOIN `FinanceInvoiceGroup` ON `FinanceInvoiceGroup`.`Id`=`FinanceInvoice`.`Group`) AS `T` WHERE SIGN(`Sum`) != SIGN(`Value`) 1509 1512 } 1510 1513 … … 1555 1558 function UpdateTo755($Manager) 1556 1559 { 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 $Manager->Execute("INSERT INTO `FinanceInvoiceGroup` (`Id`, `Name`, `DocumentLine`, `ValueSign`, `Direction`) ". 1561 "VALUES (NULL, 'Přijaté faktury - storno', '5', '1', '0'), (NULL, 'Vydané faktury - storno', '6', '-1', '1')"); 1562 $Manager->Execute("ALTER TABLE `FinanceInvoice` ADD `VisibleToUser` INT NOT NULL DEFAULT '1' AFTER `Generate`;". 1563 "ALTER TABLE `FinanceInvoice` ADD `VisibleToUser` INT NOT NULL DEFAULT '1' AFTER `Generate`;"); 1560 1564 1561 1565 $Manager->Execute("CREATE TABLE IF NOT EXISTS `FinanceInvoiceStorno` ( -
trunk/Modules/Finance/UserState.php
r748 r756 17 17 '`Time`, -`Value`, `File`, `BillCode`, `PeriodFrom`, `PeriodTo`, `DocumentLineCode`.`Name` AS `BillName` FROM `FinanceInvoice` '. 18 18 'LEFT JOIN `DocumentLineCode` ON `DocumentLineCode`.`Id`=`FinanceInvoice`.`BillCode` '. 19 'WHERE (`Subject`='.$Subject['Id'].') ))';19 'WHERE (`Subject`='.$Subject['Id'].') AND (`VisibleToUser` = 1)))'; 20 20 21 21 $Output = '<div style="text-align:center">Výpis finančních operací</div>';
Note:
See TracChangeset
for help on using the changeset viewer.