Changeset 742
- Timestamp:
- Jul 7, 2015, 12:12:12 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/FormClasses.php
r740 r742 30 30 'Shortcut' => array('Type' => 'String', 'Caption' => 'Kód', 'Default' => ''), 31 31 'Sequence' => array('Type' => 'TDocumentLineSequenceListLine', 'Caption' => 'Čísleníky', 'Default' => ''), 32 'Codes' => array('Type' => 'TDocumentLineCodeList', 'Caption' => 'Kódy', 'Default' => ''), 32 33 ), 33 34 ), … … 43 44 'Operations' => array('Type' => 'TFinanceOperationListDocumentLine', 'Caption' => 'Finanční operace', 'Default' => ''), 44 45 'Invoices' => array('Type' => 'TFinanceInvoiceListDocumentLine', 'Caption' => 'Faktury', 'Default' => ''), 46 ), 47 ), 48 'DocumentLineCode' => array( 49 'Title' => 'Kód dokladových řad', 50 'Table' => 'DocumentLineCode', 51 'DefaultSortColumn' => 'Name', 52 'Items' => array( 53 'DocumentLine' => array('Type' => 'TDocumentLine', 'Caption' => 'Dokladová řada', 'Default' => ''), 54 'Name' => array('Type' => 'String', 'Caption' => 'Název', 'Default' => ''), 45 55 ), 46 56 ), … … 164 174 'Filter' => '1', 165 175 ), 166 'TStockSerialNumberListStock' => array( 176 'TDocumentLineCode' => array( 177 'Type' => 'Reference', 178 'Table' => 'DocumentLineCode', 179 'Id' => 'Id', 180 'Name' => 'Name', 181 'Filter' => '1', 182 ), 183 'TStockSerialNumberListStock' => array( 167 184 'Type' => 'ManyToOne', 168 185 'Table' => 'StockSerialNumber', … … 210 227 'Table' => 'FinanceInvoice', 211 228 'Id' => 'Id', 212 'Name' => ' BillCode',229 'Name' => '(SELECT `DocumentLineCode`.`Name` FROM `DocumentLineCode` WHERE `Id`=`FinanceInvoice`.`BillCode`)', 213 230 'Filter' => '1', 214 231 ), … … 217 234 'Table' => 'FinanceOperation', 218 235 'Id' => 'Id', 219 'Name' => ' BillCode',236 'Name' => '(SELECT `DocumentLineCode`.`Name` FROM `DocumentLineCode` WHERE `Id`=`FinanceOperation`.`BillCode`)', 220 237 'Filter' => '1', 221 238 ), … … 241 258 'Filter' => '1', 242 259 ), 243 'TUserCustomerRelListUser' => array( 260 'TDocumentLineCodeList' => array( 261 'Type' => 'ManyToOne', 262 'Table' => 'DocumentLineCode', 263 'Id' => 'Id', 264 'Ref' => 'DocumentLine', 265 'Filter' => '1', 266 ), 267 'TUserCustomerRelListUser' => array( 244 268 'Type' => 'ManyToOne', 245 269 'Table' => 'UserCustomerRel', -
trunk/Application/Version.php
r741 r742 1 1 <?php 2 2 3 $Revision = 74 1; // Subversion revision4 $DatabaseRevision = 74 1; // SQL structure revision3 $Revision = 742; // Subversion revision 4 $DatabaseRevision = 742; // SQL structure revision 5 5 $ReleaseTime = strtotime('2015-07-05'); -
trunk/Common/Setup/Updates.php
r741 r742 1435 1435 $Manager->Execute('UPDATE `FinanceInvoice` SET `Direction` = 1 WHERE ValueSign=1'); 1436 1436 } 1437 1438 function UpdateTo742($Manager) 1439 { 1440 $Manager->Execute('CREATE TABLE IF NOT EXISTS `DocumentLineCode` ( 1441 `Id` int(11) NOT NULL AUTO_INCREMENT, 1442 `DocumentLine` int(11) NULL, 1443 `Name` varchar(255) NOT NULL, 1444 PRIMARY KEY (`Id`), 1445 UNIQUE KEY `Name` (`Name`), 1446 KEY `DocumentLine` (`DocumentLine`) 1447 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;'); 1448 $Manager->Execute('ALTER TABLE `DocumentLineCode` 1449 ADD CONSTRAINT `DocumentLineCode_ibfk_1` FOREIGN KEY (`DocumentLine`) REFERENCES `DocumentLine` (`Id`);'); 1450 1451 // Transform finance operations 1452 $Manager->Execute('ALTER TABLE `FinanceOperation` CHANGE `BillCode` `BillCodeText` VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL'); 1453 $Manager->Execute('ALTER TABLE `FinanceOperation` ADD `BillCode` INT NULL AFTER `BillCodeText`, ADD INDEX (`BillCode`)'); 1454 $Manager->Execute('ALTER TABLE `FinanceOperation` ADD FOREIGN KEY (`BillCode`) REFERENCES `DocumentLineCode`(`Id`) ON DELETE RESTRICT ON UPDATE RESTRICT;'); 1455 $DbResult = $Manager->Execute('SELECT `FinanceOperation`.`Id`, `FinanceOperation`.`BillCodeText`, `FinanceOperationGroup`.`DocumentLine` '. 1456 'FROM `FinanceInvoice` '. 1457 'LEFT JOIN `FinanceOperationGroup` ON `FinanceOperationGroup`.`Id` = `FinanceOperation`.`Group` '. 1458 'WHERE `FinanceOperation`.`BillCodeText`!=""'); 1459 while($DbRow = $DbResult->fetch_assoc()) 1460 { 1461 if($DbRow['DocumentLine'] == '') $DbRow['DocumentLine'] = 'NULL'; 1462 $Manager->Execute('INSERT INTO `DocumentLineCode` (`Id` ,`DocumentLine` ,`Name`) '. 1463 'VALUES (NULL , '.$DbRow['DocumentLine'].', "'.$DbRow['BillCodeText'].'");'); 1464 $CodeId = $Manager->Database->insert_id; 1465 $Manager->Execute('UPDATE `FinanceOperation` SET `BillCode`='.$CodeId.' WHERE `Id`='.$DbRow['Id']); 1466 } 1467 $Manager->Execute('ALTER TABLE `FinanceOperation` DROP `BillCodeText`;'); 1468 1469 // Transform invoices 1470 $Manager->Execute('ALTER TABLE `FinanceInvoice` CHANGE `BillCode` `BillCodeText` VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL'); 1471 $Manager->Execute('ALTER TABLE `FinanceInvoice` ADD `BillCode` INT NULL AFTER `BillCodeText`, ADD INDEX (`BillCode`)'); 1472 $Manager->Execute('ALTER TABLE `FinanceInvoice` ADD FOREIGN KEY (`BillCode`) REFERENCES `DocumentLineCode`(`Id`) ON DELETE RESTRICT ON UPDATE RESTRICT;'); 1473 $DbResult = $Manager->Execute('SELECT `FinanceInvoice`.`Id`, `FinanceInvoice`.`BillCodeText`, `FinanceInvoiceGroup`.`DocumentLine` '. 1474 'FROM `FinanceInvoice` '. 1475 'LEFT JOIN `FinanceInvoiceGroup` ON `FinanceInvoiceGroup`.`Id` = `FinanceInvoice`.`Group` '. 1476 'WHERE `FinanceInvoice`.`BillCodeText`!=""'); 1477 while($DbRow = $DbResult->fetch_assoc()) 1478 { 1479 if($DbRow['DocumentLine'] == '') $DbRow['DocumentLine'] = 'NULL'; 1480 $Manager->Execute('INSERT INTO `DocumentLineCode` (`Id` ,`DocumentLine` ,`Name`) '. 1481 'VALUES (NULL , '.$DbRow['DocumentLine'].', "'.$DbRow['BillCodeText'].'");'); 1482 $CodeId = $Manager->Database->insert_id; 1483 $Manager->Execute('UPDATE `FinanceInvoice` SET `BillCode`='.$CodeId.' WHERE `Id`='.$DbRow['Id']); 1484 } 1485 $Manager->Execute('ALTER TABLE `FinanceInvoice` DROP `BillCodeText`;'); 1486 1487 //$Manager->Execute('RENAME TABLE `FinanceOperationGroup` TO `FinanceOperationTemplate`'); 1488 //$Manager->Execute('RENAME TABLE `FinanceInvoiceGroup` TO `FinanceInvoiceTemplate`'); 1489 } 1490 1437 1491 1438 1492 class Updates … … 1503 1557 735 => array('Revision' => 736, 'Function' => 'UpdateTo736'), 1504 1558 736 => array('Revision' => 739, 'Function' => 'UpdateTo739'), 1505 739 => array('Revision' => 740, 'Function' => 'UpdateTo740'), 1506 740 => array('Revision' => 741, 'Function' => 'UpdateTo741'), 1559 739 => array('Revision' => 740, 'Function' => 'UpdateTo740'), 1560 740 => array('Revision' => 741, 'Function' => 'UpdateTo741'), 1561 741 => array('Revision' => 742, 'Function' => 'UpdateTo742'), 1507 1562 )); 1508 1563 } -
trunk/Modules/Finance/Finance.php
r741 r742 215 215 'Items' => array( 216 216 'Group' => array('Type' => 'TFinanceOperationGroup', 'Caption' => 'Skupina', 'Default' => ''), 217 'BillCode' => array('Type' => ' String', 'Caption' => 'Označení', 'Default' => '', 'ReadOnly' => true),217 'BillCode' => array('Type' => 'TDocumentLineCode', 'Caption' => 'Označení', 'Default' => '', 'ReadOnly' => true), 218 218 'Subject' => array('Type' => 'TSubject', 'Caption' => 'Subjekt', 'Default' => ''), 219 219 'Time' => array('Type' => 'Date', 'Caption' => 'Čas realizace', 'Default' => ''), … … 306 306 'Items' => array( 307 307 'Group' => array('Type' => 'TFinanceInvoiceGroup', 'Caption' => 'Skupina', 'Default' => ''), 308 'BillCode' => array('Type' => ' String', 'Caption' => 'Označení', 'Default' => '', 'ReadOnly' => true),308 'BillCode' => array('Type' => 'TDocumentLineCode', 'Caption' => 'Označení', 'Default' => '', 'ReadOnly' => true), 309 309 'Subject' => array('Type' => 'TSubject', 'Caption' => 'Subjekt', 'Default' => ''), 310 310 'Time' => array('Type' => 'Date', 'Caption' => 'Čas vytvoření', 'Default' => ''),
Note:
See TracChangeset
for help on using the changeset viewer.