- Timestamp:
- Mar 6, 2024, 11:47:49 PM (10 months ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/UpdateTrace.php
r957 r967 619 619 $Manager->Execute('ALTER TABLE `EmployeeSalary` ADD `Contract` INT NULL , 620 620 ADD INDEX ( `Contract` ) ;'); 621 $Manager->Execute('ALTER TABLE `EmployeeSalary` ADD FOREIGN KEY ( `Contract` ) REFERENCES `Contract` (621 $Manager->Execute('ALTER TABLE `EmployeeSalary` ADD FOREIGN KEY ( `Contract` ) REFERENCES `Contract` ( 622 622 `Id`) ON DELETE RESTRICT ON UPDATE RESTRICT ;'); 623 623 $Manager->Execute("INSERT INTO `Action` ( … … 2242 2242 { 2243 2243 $Manager->Execute('ALTER TABLE `Log` ADD `URL` VARCHAR(255) NOT NULL AFTER `IPAddress`;'); 2244 } 2245 2246 function UpdateTo967(UpdateManager $Manager): void 2247 { 2248 $DbResult = $Manager->Execute('SELECT `Id` FROM `MenuItem` WHERE `Name`="Roční výkazy"'); 2249 if ($DbResult->num_rows > 0) 2250 { 2251 $DbRow = $DbResult->fetch_assoc(); 2252 2253 $Manager->Execute("INSERT INTO `Action` ( 2254 `Id` ,`Name` ,`Title` ,`Type` ,`URL` ,`Group` ,`Icon` ,`PermissionOperation` , 2255 `Enable`) VALUES (NULL , '', 'Měsíční přehled', '1', '/is/?t=FinanceMonthReport&a=list', NULL , NULL , NULL , '1' 2256 );"); 2257 $ActionId = $Manager->Database->insert_id; 2258 $Manager->Execute("INSERT INTO `MenuItem` (`Id` ,`Name` ,`Parent` ,`Action` ,`Menu`) ". 2259 "VALUES (NULL , 'Měsíční přehled', '".$DbRow['Id']."', '".$ActionId."', '1');"); 2260 } 2244 2261 } 2245 2262 … … 2357 2374 948 => array('Revision' => 953, 'Function' => 'UpdateTo953'), 2358 2375 953 => array('Revision' => 957, 'Function' => 'UpdateTo957'), 2376 957 => array('Revision' => 967, 'Function' => 'UpdateTo967'), 2359 2377 ); 2360 2378 } -
trunk/Application/Version.php
r964 r967 1 1 <?php 2 2 3 $Revision = 96 4; // Subversion revision4 $DatabaseRevision = 9 57; // SQL structure revision5 $ReleaseTime = strtotime('2024-0 2-03');3 $Revision = 967; // Subversion revision 4 $DatabaseRevision = 967; // SQL structure revision 5 $ReleaseTime = strtotime('2024-03-06'); -
trunk/Common/Form/Types/String.php
r920 r967 25 25 function OnLoad(array $Item): ?string 26 26 { 27 return $_POST[$Item['Name']]; 27 if (array_key_exists($Item['Name'], $_POST)) 28 return $_POST[$Item['Name']]; 29 else return ''; 28 30 } 29 31 -
trunk/Modules/Finance/Finance.php
r966 r967 548 548 //'AfterInsert' => array($this, 'AfterInsertFinanceYear'), 549 549 )); 550 $this->System->FormManager->RegisterClass('FinanceMonthReport', array( 551 'Title' => 'Měsíční výkaz', 552 'Table' => 'FinanceMonthReport', 553 'SQL' => 'SELECT 0 AS `Id`, m1 AS `DateStart`, LAST_DAY(m1) AS `DateEnd` FROM '. 554 '(SELECT ((SELECT MIN(`DateStart`) FROM `FinanceYear`) - INTERVAL DAYOFMONTH((SELECT MIN(`DateStart`) FROM `FinanceYear`)) - 1 DAY) '. 555 '+ INTERVAL m MONTH AS m1 FROM ('. 556 'SELECT @rownum := @rownum + 1 AS m FROM '. 557 '(SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4) t1,'. 558 '(SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4) t2,'. 559 '(SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4) t3,'. 560 '(SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4) t4,'. 561 '(SELECT @rownum := -1) t0'. 562 ') d1'. 563 ') d2 '. 564 'WHERE m1 <= (SELECT MAX(`DateEnd`) FROM `FinanceYear`)', 565 'DefaultSortColumn' => 'DateStart', 566 'DefaultSortOrder' => 1, 567 'Items' => array( 568 'DateStart' => array('Type' => 'Date', 'Caption' => 'Měsíc', 'Default' => '', 'ReadOnly' => true), 569 'Income' => array('Type' => 'Integer', 'Caption' => 'Evidenční příjmy', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true, 570 'SQL' => '(SELECT ROUND(SUM(`FinanceOperation`.`Value`)) FROM `FinanceOperation` '. 571 'LEFT JOIN `FinanceOperationGroup` ON `FinanceOperationGroup`.`Id`=`FinanceOperation`.`Group` '. 572 'WHERE (`FinanceOperation`.`Time` <= `DateEnd`) '. 573 'AND (`FinanceOperation`.`Time` >= `DateStart`) AND (`FinanceOperationGroup`.`ValueSign` = 1))'), 574 'Spending' => array('Type' => 'Integer', 'Caption' => 'Evidenční výdaje', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true, 575 'SQL' => '(SELECT -ROUND(SUM(`FinanceOperation`.`Value`)) FROM `FinanceOperation` '. 576 'LEFT JOIN `FinanceOperationGroup` ON `FinanceOperationGroup`.`Id`=`FinanceOperation`.`Group` '. 577 'WHERE (`FinanceOperation`.`Time` <= `DateEnd`) '. 578 'AND (`FinanceOperation`.`Time` >= `DateStart`) AND (`FinanceOperationGroup`.`ValueSign` = -1))'), 579 'OperationBalance' => array('Type' => 'Integer', 'Caption' => 'Evidenční zisk', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true, 580 'SQL' => '(SELECT ROUND(SUM(`FinanceOperation`.`Value`)) FROM `FinanceOperation` '. 581 'WHERE (`FinanceOperation`.`Time` <= `DateEnd`) '. 582 'AND (`FinanceOperation`.`Time` >= `DateStart`))'), 583 'RealIncome' => array('Type' => 'Integer', 'Caption' => 'Skutečné příjmy', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true, 584 'SQL' => '(SELECT ROUND(SUM(`FinanceOperation`.`Value`)) FROM `FinanceOperation` '. 585 'LEFT JOIN `FinanceOperationGroup` ON `FinanceOperationGroup`.`Id`=`FinanceOperation`.`Group` '. 586 'WHERE (`FinanceOperation`.`Time` <= `DateEnd`) AND (`FinanceOperation`.`Subject` != '.$this->Finance->MainSubject.')'. 587 'AND (`FinanceOperation`.`Time` >= `DateStart`) AND (`FinanceOperationGroup`.`ValueSign` = 1))'), 588 'RealSpending' => array('Type' => 'Integer', 'Caption' => 'Skutečné výdaje', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true, 589 'SQL' => '(SELECT -ROUND(SUM(`FinanceOperation`.`Value`)) FROM `FinanceOperation` '. 590 'LEFT JOIN `FinanceOperationGroup` ON `FinanceOperationGroup`.`Id`=`FinanceOperation`.`Group` '. 591 'WHERE (`FinanceOperation`.`Time` <= `DateEnd`) AND (`FinanceOperation`.`Subject` != '.$this->Finance->MainSubject.')'. 592 'AND (`FinanceOperation`.`Time` >= `DateStart`) AND (`FinanceOperationGroup`.`ValueSign` = -1))'), 593 'RealOperationBalance' => array('Type' => 'Integer', 'Caption' => 'Skutečný zisk', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true, 594 'SQL' => '(SELECT ROUND(SUM(`FinanceOperation`.`Value`)) FROM `FinanceOperation` '. 595 'WHERE (`FinanceOperation`.`Time` <= `DateEnd`) AND (`FinanceOperation`.`Subject` != '.$this->Finance->MainSubject.')'. 596 'AND (`FinanceOperation`.`Time` >= `DateStart`))'), 597 'TaxIncome' => array('Type' => 'Integer', 'Caption' => 'Daňové příjmy', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true, 598 'SQL' => '(SELECT ROUND(SUM(`FinanceOperation`.`Value`)) FROM `FinanceOperation` '. 599 'LEFT JOIN `FinanceOperationGroup` ON `FinanceOperationGroup`.`Id`=`FinanceOperation`.`Group` '. 600 'WHERE (`FinanceOperation`.`Time` <= `DateEnd`) '. 601 'AND (`FinanceOperation`.`Time` >= `DateStart`) AND (`FinanceOperation`.`Taxable` = 1) AND (`FinanceOperationGroup`.`ValueSign` = 1))'), 602 'TaxSpending' => array('Type' => 'Integer', 'Caption' => 'Daňové výdaje', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true, 603 'SQL' => '(SELECT -ROUND(SUM(`FinanceOperation`.`Value`)) FROM `FinanceOperation` '. 604 'LEFT JOIN `FinanceOperationGroup` ON `FinanceOperationGroup`.`Id`=`FinanceOperation`.`Group` '. 605 'WHERE (`FinanceOperation`.`Time` <= `DateEnd`) '. 606 'AND (`FinanceOperation`.`Time` >= `DateStart`) AND (`FinanceOperation`.`Taxable` = 1) AND (`FinanceOperationGroup`.`ValueSign` = -1))'), 607 'TaxBase' => array('Type' => 'Integer', 'Caption' => 'Základ daně', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true, 608 'SQL' => '(SELECT ROUND(SUM(`FinanceOperation`.`Value`)) FROM `FinanceOperation` '. 609 'WHERE (`FinanceOperation`.`Time` <= `DateEnd`) '. 610 'AND (`FinanceOperation`.`Time` >= `DateStart`) AND (`FinanceOperation`.`Taxable` = 1))'), 611 'Claims' => array('Type' => 'Integer', 'Caption' => 'Pohledávky', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true, 612 'SQL' => '(SELECT ROUND(SUM(`FinanceInvoice`.`Value`)) FROM `FinanceInvoice` '. 613 'LEFT JOIN `FinanceInvoiceGroup` ON `FinanceInvoiceGroup`.`Id`=`FinanceInvoice`.`Group` '. 614 'WHERE (`FinanceInvoice`.`Time` <= `DateEnd`) '. 615 'AND (`FinanceInvoice`.`Time` >= `DateStart`) AND (`FinanceInvoiceGroup`.`ValueSign` = 1))'), 616 'Liabilities' => array('Type' => 'Integer', 'Caption' => 'Závazky', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true, 617 'SQL' => '(SELECT -ROUND(SUM(`FinanceInvoice`.`Value`)) FROM `FinanceInvoice` '. 618 'LEFT JOIN `FinanceInvoiceGroup` ON `FinanceInvoiceGroup`.`Id`=`FinanceInvoice`.`Group` '. 619 'WHERE (`FinanceInvoice`.`Time` <= `DateEnd`) '. 620 'AND (`FinanceInvoice`.`Time` >= `DateStart`) AND (`FinanceInvoiceGroup`.`ValueSign` = -1))'), 621 'InvoiceBalance' => array('Type' => 'Integer', 'Caption' => 'Fakturační rozdíl', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true, 622 'SQL' => '(SELECT ROUND(SUM(`FinanceInvoice`.`Value`)) FROM `FinanceInvoice` WHERE (`FinanceInvoice`.`Time` <= `DateEnd`) '. 623 'AND (`FinanceInvoice`.`Time` >= `DateStart`))'), 624 'IncomeList' => array('Type' => 'TIncomeList', 'Caption' => 'Příjmy', 'Default' => '0'), 625 'SpendingList' => array('Type' => 'TSpendingList', 'Caption' => 'Výdaje', 'Default' => '0'), 626 'TaxIncomeList' => array('Type' => 'TTaxIncomeList', 'Caption' => 'Daňové příjmy', 'Default' => '0'), 627 'TaxSpendingList' => array('Type' => 'TTaxSpendingList', 'Caption' => 'Daňové výdaje', 'Default' => '0'), 628 'ClaimsList' => array('Type' => 'TClaimsList', 'Caption' => 'Pohledávky', 'Default' => '0'), 629 'LiabilitiesList' => array('Type' => 'TLiabilitiesList', 'Caption' => 'Závazky', 'Default' => '0'), 630 ), 631 //'AfterInsert' => array($this, 'AfterInsertFinanceYear'), 632 )); 550 633 $this->System->FormManager->RegisterFormType('TClaimsList', array( 551 634 'Type' => 'ManyToOne',
Note:
See TracChangeset
for help on using the changeset viewer.