Ignore:
Timestamp:
Jan 2, 2015, 11:16:56 PM (10 years ago)
Author:
chronos
Message:
  • Added: Support for Hidden items in form types values.
  • Added: Support for Filtered items in form types values.
  • Modified: FinanceOperation Value splitted to (Direction * Value). Direction can be +1 or -1 depends on if money goes out or in company.
  • Added: Menu "Incomes and spends" is now splitted to incomes/spends of bank account or treasury. Direction and document line is filled automatically.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Application/FormClasses.php

    r712 r719  
    22
    33// TODO: Split all form class definitions to modules
    4 
    5 /*
    6 Item definition:
    7 Type - identifikace typu z podporovaných
    8 Caption - popisek, titulek položky
    9 Default - výchozí hodnota
    10 Null - hodnota nemusí být zadána
    11 NoInList - sloupec viditelný v seznamu
    12 Suffix - text za hodnotou
    13 Description - popis významu položky
    14 ReadOnly - je položky pouze pro čtení
    15 Required - položka je vyžadována
    16 */
    174
    185function RegisterFormClasses($FormManager)
     
    9178        'ReadOnly' => true),
    9279      'Income' => array('Type' => 'Integer', 'Caption' => 'Příjmy', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true,
    93         'SQL' => '(SELECT ROUND(SUM(`FinanceOperation`.`Value`)) FROM `FinanceOperation` WHERE (`FinanceOperation`.`Time` <= `DateEnd`) '.
    94         'AND (`FinanceOperation`.`Time` >= `DateStart`) AND (`FinanceOperation`.`Value` > 0))'),
     80        'SQL' => '(SELECT ROUND(SUM(`FinanceOperation`.`Value` * `FinanceOperation`.`Direction`)) FROM `FinanceOperation` WHERE (`FinanceOperation`.`Time` <= `DateEnd`) '.
     81        'AND (`FinanceOperation`.`Time` >= `DateStart`) AND (`FinanceOperation`.`Direction` = 1))'),
    9582      'Spending' => array('Type' => 'Integer', 'Caption' => 'Výdaje', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true,
    96         'SQL' => '(SELECT -ROUND(SUM(`FinanceOperation`.`Value`)) FROM `FinanceOperation` WHERE (`FinanceOperation`.`Time` <= `DateEnd`) '.
    97         'AND (`FinanceOperation`.`Time` >= `DateStart`) AND (`FinanceOperation`.`Value` < 0))'),
     83        'SQL' => '(SELECT -ROUND(SUM(`FinanceOperation`.`Value` * `FinanceOperation`.`Direction`)) FROM `FinanceOperation` WHERE (`FinanceOperation`.`Time` <= `DateEnd`) '.
     84        'AND (`FinanceOperation`.`Time` >= `DateStart`) AND (`FinanceOperation`.`Direction` = -1))'),
    9885      'OperationBalance' => array('Type' => 'Integer', 'Caption' => 'Zisk', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true,
    99         'SQL' => '(SELECT ROUND(SUM(`FinanceOperation`.`Value`)) FROM `FinanceOperation` WHERE (`FinanceOperation`.`Time` <= `DateEnd`) '.
     86        'SQL' => '(SELECT ROUND(SUM(`FinanceOperation`.`Value` * `FinanceOperation`.`Direction`)) FROM `FinanceOperation` WHERE (`FinanceOperation`.`Time` <= `DateEnd`) '.
    10087        'AND (`FinanceOperation`.`Time` >= `DateStart`))'),
    10188      'TaxIncome' => array('Type' => 'Integer', 'Caption' => 'Daňové příjmy', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true,
    102         'SQL' => '(SELECT ROUND(SUM(`FinanceOperation`.`Value`)) FROM `FinanceOperation` WHERE (`FinanceOperation`.`Time` <= `DateEnd`) '.
    103         'AND (`FinanceOperation`.`Time` >= `DateStart`) AND (`FinanceOperation`.`Taxable` = 1) AND (`FinanceOperation`.`Value` > 0))'),
     89        'SQL' => '(SELECT ROUND(SUM(`FinanceOperation`.`Value` * `FinanceOperation`.`Direction`)) FROM `FinanceOperation` WHERE (`FinanceOperation`.`Time` <= `DateEnd`) '.
     90        'AND (`FinanceOperation`.`Time` >= `DateStart`) AND (`FinanceOperation`.`Taxable` = 1) AND (`FinanceOperation`.`Direction` = 1))'),
    10491      'TaxSpending' => array('Type' => 'Integer', 'Caption' => 'Daňové výdaje', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true,
    105         'SQL' => '(SELECT -ROUND(SUM(`FinanceOperation`.`Value`)) FROM `FinanceOperation` WHERE (`FinanceOperation`.`Time` <= `DateEnd`) '.
    106         'AND (`FinanceOperation`.`Time` >= `DateStart`) AND (`FinanceOperation`.`Taxable` = 1) AND (`FinanceOperation`.`Value` < 0))'),
     92        'SQL' => '(SELECT -ROUND(SUM(`FinanceOperation`.`Value` * `FinanceOperation`.`Direction`)) FROM `FinanceOperation` WHERE (`FinanceOperation`.`Time` <= `DateEnd`) '.
     93        'AND (`FinanceOperation`.`Time` >= `DateStart`) AND (`FinanceOperation`.`Taxable` = 1) AND (`FinanceOperation`.`Direction` = -1))'),
    10794      'TaxBase' => array('Type' => 'Integer', 'Caption' => 'Základ daně', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true,
    108         'SQL' => '(SELECT ROUND(SUM(`FinanceOperation`.`Value`)) FROM `FinanceOperation` WHERE (`FinanceOperation`.`Time` <= `DateEnd`) '.
     95        'SQL' => '(SELECT ROUND(SUM(`FinanceOperation`.`Value` * `FinanceOperation`.`Direction`)) FROM `FinanceOperation` WHERE (`FinanceOperation`.`Time` <= `DateEnd`) '.
    10996        'AND (`FinanceOperation`.`Time` >= `DateStart`) AND (`FinanceOperation`.`Taxable` = 1))'),
    11097      'Claims' => array('Type' => 'Integer', 'Caption' => 'Pohledávky', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true,
Note: See TracChangeset for help on using the changeset viewer.