Changeset 720 for trunk/Common/Setup/Updates.php
- Timestamp:
- Jan 3, 2015, 5:55:34 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/Setup/Updates.php
r719 r720 1055 1055 $Manager->Execute('UPDATE `FinanceOperation` SET `Direction` = -1 WHERE `Value` < 0 ;'); 1056 1056 $Manager->Execute('UPDATE `FinanceOperation` SET `Value` = -`Value` WHERE `Value` < 0 ;'); 1057 1057 // Set missing FinanceOperation DocumentLine according BillCode 1058 $Manager->Execute('UPDATE `FinanceOperation` SET `DocumentLine` = 1 WHERE (`BillCode` LIKE "PP%") AND (`DocumentLine` IS NULL)'); 1059 $Manager->Execute('UPDATE `FinanceOperation` SET `DocumentLine` = 2 WHERE (`BillCode` LIKE "VP%") AND (`DocumentLine` IS NULL)'); 1060 $Manager->Execute('UPDATE `FinanceOperation` SET `DocumentLine` = 3 WHERE (`BillCode` LIKE "BV%") AND (`DocumentLine` IS NULL)'); 1061 $Manager->Execute('UPDATE `FinanceOperation` SET `DocumentLine` = 4 WHERE (`BillCode` LIKE "PR%") AND (`DocumentLine` IS NULL)'); 1062 1058 1063 // IS menu item 1059 1064 $DbResult = $Manager->Execute('SELECT `Id` FROM `MenuItem` WHERE `Name`="Příjmy a výdaje"'); … … 1086 1091 "VALUES (NULL , 'Výdej z účtu', ".$DbRow['Id'].", '".$ActionId."', '1');"); 1087 1092 } 1093 } 1094 1095 function UpdateTo720($Manager) 1096 { 1097 $Manager->Execute('ALTER TABLE `FinanceInvoice` ADD `Direction` INT NOT NULL AFTER `TimePayment`;'); 1098 $Manager->Execute('UPDATE `FinanceInvoice` SET `Direction` = 1 WHERE `Value` >= 0 ;'); 1099 $Manager->Execute('UPDATE `FinanceInvoice` SET `Direction` = -1 WHERE `Value` < 0 ;'); 1100 $Manager->Execute('UPDATE `FinanceInvoice` SET `Value` = -`Value` WHERE `Value` < 0 ;'); 1101 // Set missing FinanceInvoice DocumentLine according BillCode 1102 $Manager->Execute('UPDATE `FinanceInvoice` SET `DocumentLine` = 5 WHERE (`BillCode` LIKE "PF%") AND (`DocumentLine` IS NULL)'); 1103 $Manager->Execute('UPDATE `FinanceInvoice` SET `DocumentLine` = 6 WHERE (`BillCode` LIKE "VF%") AND (`DocumentLine` IS NULL)'); 1104 1105 // IS menu item 1106 $DbResult = $Manager->Execute('SELECT `Id` FROM `MenuItem` WHERE `Name`="Závazky a pohledávky"'); 1107 if($DbResult->num_rows > 0) 1108 { 1109 $DbRow = $DbResult->fetch_assoc(); 1110 $Manager->Execute('INSERT INTO `Action` (`Id` ,`Name` ,`Title` ,`Type` ,`URL` , 1111 `Group` ,`Icon` ,`PermissionOperation` ,`Enable`) VALUES ( 1112 NULL , "", "Příjaté", "1", "/is/?t=FinanceInvoiceIn&a=list", NULL , NULL , NULL , "1");'); 1113 $ActionId = $Manager->Database->insert_id; 1114 $Manager->Execute("INSERT INTO `MenuItem` (`Id` ,`Name` ,`Parent` ,`Action` ,`Menu`) ". 1115 "VALUES (NULL , 'Přijaté', ".$DbRow['Id'].", '".$ActionId."', '1');"); 1116 1117 $Manager->Execute('INSERT INTO `Action` (`Id` ,`Name` ,`Title` ,`Type` ,`URL` , 1118 `Group` ,`Icon` ,`PermissionOperation` ,`Enable`) VALUES ( 1119 NULL , "", "Vydané", "1", "/is/?t=FinanceInvoiceOut&a=list", NULL , NULL , NULL , "1");'); 1120 $ActionId = $Manager->Database->insert_id; 1121 $Manager->Execute("INSERT INTO `MenuItem` (`Id` ,`Name` ,`Parent` ,`Action` ,`Menu`) ". 1122 "VALUES (NULL , 'Vydané', ".$DbRow['Id'].", '".$ActionId."', '1');"); 1123 } 1088 1124 } 1089 1125 … … 1145 1181 715 => array('Revision' => 718, 'Function' => 'UpdateTo718'), 1146 1182 718 => array('Revision' => 719, 'Function' => 'UpdateTo719'), 1183 719 => array('Revision' => 720, 'Function' => 'UpdateTo720'), 1147 1184 )); 1148 1185 }
Note:
See TracChangeset
for help on using the changeset viewer.