Ignore:
Timestamp:
Jan 5, 2021, 10:30:31 PM (4 years ago)
Author:
chronos
Message:
  • Modified: Further improved models initialization system.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Application/FormClasses.php

    r891 r894  
    55function RegisterFormClasses(FormManager $FormManager): void
    66{
    7   $FormManager->Classes = array(
    8   'UserCustomerRel' => array(
    9     'Title' => 'Vztahy uživatel - zákazník',
    10     'Table' => 'UserCustomerRel',
    11     'Items' => array(
    12       'User' => array('Type' => 'TUser', 'Caption' => 'Uživatel', 'Default' => ''),
    13       'Customer' => array('Type' => 'TMember', 'Caption' => 'Zákazník', 'Default' => ''),
    14     ),
    15   ),
    16   'FinanceInvoiceOperationRel' => array(
    17     'Title' => 'Zaplacení faktůr',
    18     'Table' => 'FinanceInvoiceOperationRel',
    19     'Items' => array(
    20       'Invoice' => array('Type' => 'TFinanceInvoice', 'Caption' => 'Faktura', 'Default' => ''),
    21       'Operation' => array('Type' => 'TFinanceOperation', 'Caption' => 'Platba', 'Default' => ''),
    22     ),
    23   ),
    24   'FinanceYearReport' => array(
    25     'Title' => 'Roční výkaz',
    26     'Table' => 'FinanceYearReport',
    27     'SQL' => 'SELECT Id, DateEnd, DateStart FROM FinanceYear',
    28     'DefaultSortColumn' => 'Id',
    29     'Items' => array(
    30       'Id' => array('Type' => 'TFinanceYear', 'Caption' => 'Rok', 'Default' => '',
    31         'ReadOnly' => true),
    32       'Income' => array('Type' => 'Integer', 'Caption' => 'Příjmy', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true,
    33         'SQL' => '(SELECT ROUND(SUM(`FinanceOperation`.`Value`)) FROM `FinanceOperation` '.
    34         'LEFT JOIN `FinanceOperationGroup` ON `FinanceOperationGroup`.`Id`=`FinanceOperation`.`Group` '.
    35         'WHERE (`FinanceOperation`.`Time` <= `DateEnd`) '.
    36         'AND (`FinanceOperation`.`Time` >= `DateStart`) AND (`FinanceOperationGroup`.`ValueSign` = 1))'),
    37       'Spending' => array('Type' => 'Integer', 'Caption' => 'Výdaje', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true,
    38         'SQL' => '(SELECT -ROUND(SUM(`FinanceOperation`.`Value`)) FROM `FinanceOperation` '.
    39         'LEFT JOIN `FinanceOperationGroup` ON `FinanceOperationGroup`.`Id`=`FinanceOperation`.`Group` '.
    40         'WHERE (`FinanceOperation`.`Time` <= `DateEnd`) '.
    41         'AND (`FinanceOperation`.`Time` >= `DateStart`) AND (`FinanceOperationGroup`.`ValueSign` = -1))'),
    42       'OperationBalance' => array('Type' => 'Integer', 'Caption' => 'Zisk', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true,
    43         'SQL' => '(SELECT ROUND(SUM(`FinanceOperation`.`Value`)) FROM `FinanceOperation` '.
    44         'WHERE (`FinanceOperation`.`Time` <= `DateEnd`) '.
    45         'AND (`FinanceOperation`.`Time` >= `DateStart`))'),
    46       'TaxIncome' => array('Type' => 'Integer', 'Caption' => 'Daňové příjmy', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true,
    47         'SQL' => '(SELECT ROUND(SUM(`FinanceOperation`.`Value`)) FROM `FinanceOperation` '.
    48         'LEFT JOIN `FinanceOperationGroup` ON `FinanceOperationGroup`.`Id`=`FinanceOperation`.`Group` '.
    49         'WHERE (`FinanceOperation`.`Time` <= `DateEnd`) '.
    50         'AND (`FinanceOperation`.`Time` >= `DateStart`) AND (`FinanceOperation`.`Taxable` = 1) AND (`FinanceOperationGroup`.`ValueSign` = 1))'),
    51       'TaxSpending' => array('Type' => 'Integer', 'Caption' => 'Daňové výdaje', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true,
    52         'SQL' => '(SELECT -ROUND(SUM(`FinanceOperation`.`Value`)) FROM `FinanceOperation` '.
    53         'LEFT JOIN `FinanceOperationGroup` ON `FinanceOperationGroup`.`Id`=`FinanceOperation`.`Group` '.
    54         'WHERE (`FinanceOperation`.`Time` <= `DateEnd`) '.
    55         'AND (`FinanceOperation`.`Time` >= `DateStart`) AND (`FinanceOperation`.`Taxable` = 1) AND (`FinanceOperationGroup`.`ValueSign` = -1))'),
    56       'TaxBase' => array('Type' => 'Integer', 'Caption' => 'Základ daně', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true,
    57         'SQL' => '(SELECT ROUND(SUM(`FinanceOperation`.`Value`)) FROM `FinanceOperation` '.
    58         'WHERE (`FinanceOperation`.`Time` <= `DateEnd`) '.
    59         'AND (`FinanceOperation`.`Time` >= `DateStart`) AND (`FinanceOperation`.`Taxable` = 1))'),
    60       'Claims' => array('Type' => 'Integer', 'Caption' => 'Pohledávky', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true,
    61         'SQL' => '(SELECT ROUND(SUM(`FinanceInvoice`.`Value`)) FROM `FinanceInvoice` '.
    62         'LEFT JOIN `FinanceInvoiceGroup` ON `FinanceInvoiceGroup`.`Id`=`FinanceInvoice`.`Group` '.
    63         'WHERE (`FinanceInvoice`.`Time` <= `DateEnd`) '.
    64         'AND (`FinanceInvoice`.`Time` >= `DateStart`) AND (`FinanceInvoiceGroup`.`ValueSign` = 1))'),
    65       'Liabilities' => array('Type' => 'Integer', 'Caption' => 'Závazky', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true,
    66         'SQL' => '(SELECT -ROUND(SUM(`FinanceInvoice`.`Value`)) FROM `FinanceInvoice` '.
    67         'LEFT JOIN `FinanceInvoiceGroup` ON `FinanceInvoiceGroup`.`Id`=`FinanceInvoice`.`Group` '.
    68         'WHERE (`FinanceInvoice`.`Time` <= `DateEnd`) '.
    69         'AND (`FinanceInvoice`.`Time` >= `DateStart`) AND (`FinanceInvoiceGroup`.`ValueSign` = -1))'),
    70       'InvoiceBalance' => array('Type' => 'Integer', 'Caption' => 'Fakturační rozdíl', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true,
    71         'SQL' => '(SELECT ROUND(SUM(`FinanceInvoice`.`Value`)) FROM `FinanceInvoice` WHERE (`FinanceInvoice`.`Time` <= `DateEnd`) '.
    72         'AND (`FinanceInvoice`.`Time` >= `DateStart`))'),
    73     ),
    74     //'AfterInsert' => array($this, 'AfterInsertFinanceYear'),
    75   ),
    76   'FinanceBillingPeriod' => array(
    77     'Title' => 'Platební období',
    78     'Table' => 'FinanceBillingPeriod',
    79     'DefaultSortColumn' => 'Name',
    80     'Items' => array(
    81       'Name' => array('Type' => 'String', 'Caption' => 'Jméno', 'Default' => ''),
    82       'MonthCount' => array('Type' => 'Integer', 'Caption' => 'Počet měsíců', 'Default' => '0', 'Suffix' => 'měsíců'),
    83       'Customers' => array('Type' => 'TCustomerListBillingPeriod', 'Caption' => 'Zákazníci', 'Default' => ''),
    84     ),
    85   ),
    86 );
    877
    888$FormManager->FormTypes = array
Note: See TracChangeset for help on using the changeset viewer.