Ignore:
Timestamp:
May 11, 2022, 9:51:06 PM (3 years ago)
Author:
chronos
Message:
  • Added: Show real income in finance year.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Finance/Finance.php

    r916 r933  
    3636  function DoStart(): void
    3737  {
     38    $this->Finance->MainSubject = $this->System->Config['Finance']['MainSubjectId'];
     39    $this->Finance->DirectoryId = $this->System->Config['Finance']['DirectoryId'];
     40
    3841    $this->System->RegisterPage(['finance', 'sprava'], 'PageFinanceManage');
    3942    $this->System->RegisterPage(['finance', 'platby'], 'PageFinanceUserState');
     
    453456        'Id' => array('Type' => 'TFinanceYear', 'Caption' => 'Rok', 'Default' => '',
    454457          'ReadOnly' => true),
    455         'Income' => array('Type' => 'Integer', 'Caption' => 'Příjmy', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true,
     458        'Income' => array('Type' => 'Integer', 'Caption' => 'Evidenční příjmy', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true,
    456459          'SQL' => '(SELECT ROUND(SUM(`FinanceOperation`.`Value`)) FROM `FinanceOperation` '.
    457460          'LEFT JOIN `FinanceOperationGroup` ON `FinanceOperationGroup`.`Id`=`FinanceOperation`.`Group` '.
    458461          'WHERE (`FinanceOperation`.`Time` <= `DateEnd`) '.
    459462          'AND (`FinanceOperation`.`Time` >= `DateStart`) AND (`FinanceOperationGroup`.`ValueSign` = 1))'),
    460         'Spending' => array('Type' => 'Integer', 'Caption' => 'Výdaje', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true,
     463        'Spending' => array('Type' => 'Integer', 'Caption' => 'Evidenční výdaje', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true,
    461464          'SQL' => '(SELECT -ROUND(SUM(`FinanceOperation`.`Value`)) FROM `FinanceOperation` '.
    462465          'LEFT JOIN `FinanceOperationGroup` ON `FinanceOperationGroup`.`Id`=`FinanceOperation`.`Group` '.
    463466          'WHERE (`FinanceOperation`.`Time` <= `DateEnd`) '.
    464467          'AND (`FinanceOperation`.`Time` >= `DateStart`) AND (`FinanceOperationGroup`.`ValueSign` = -1))'),
    465         'OperationBalance' => array('Type' => 'Integer', 'Caption' => 'Zisk', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true,
     468        'OperationBalance' => array('Type' => 'Integer', 'Caption' => 'Evidenční zisk', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true,
    466469          'SQL' => '(SELECT ROUND(SUM(`FinanceOperation`.`Value`)) FROM `FinanceOperation` '.
    467470          'WHERE (`FinanceOperation`.`Time` <= `DateEnd`) '.
     471          'AND (`FinanceOperation`.`Time` >= `DateStart`))'),
     472        'RealIncome' => array('Type' => 'Integer', 'Caption' => 'Skutečné příjmy', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true,
     473          'SQL' => '(SELECT ROUND(SUM(`FinanceOperation`.`Value`)) FROM `FinanceOperation` '.
     474          'LEFT JOIN `FinanceOperationGroup` ON `FinanceOperationGroup`.`Id`=`FinanceOperation`.`Group` '.
     475          'WHERE (`FinanceOperation`.`Time` <= `DateEnd`) AND (`FinanceOperation`.`Subject` != '.$this->Finance->MainSubject.')'.
     476          'AND (`FinanceOperation`.`Time` >= `DateStart`) AND (`FinanceOperationGroup`.`ValueSign` = 1))'),
     477        'RealSpending' => array('Type' => 'Integer', 'Caption' => 'Skutečné výdaje', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true,
     478          'SQL' => '(SELECT -ROUND(SUM(`FinanceOperation`.`Value`)) FROM `FinanceOperation` '.
     479          'LEFT JOIN `FinanceOperationGroup` ON `FinanceOperationGroup`.`Id`=`FinanceOperation`.`Group` '.
     480          'WHERE (`FinanceOperation`.`Time` <= `DateEnd`) AND (`FinanceOperation`.`Subject` != '.$this->Finance->MainSubject.')'.
     481          'AND (`FinanceOperation`.`Time` >= `DateStart`) AND (`FinanceOperationGroup`.`ValueSign` = -1))'),
     482        'RealOperationBalance' => array('Type' => 'Integer', 'Caption' => 'Skutečný zisk', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true,
     483          'SQL' => '(SELECT ROUND(SUM(`FinanceOperation`.`Value`)) FROM `FinanceOperation` '.
     484          'WHERE (`FinanceOperation`.`Time` <= `DateEnd`) AND (`FinanceOperation`.`Subject` != '.$this->Finance->MainSubject.')'.
    468485          'AND (`FinanceOperation`.`Time` >= `DateStart`))'),
    469486        'TaxIncome' => array('Type' => 'Integer', 'Caption' => 'Daňové příjmy', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true,
     
    566583    ));
    567584
    568     $this->Finance->MainSubject = $this->System->Config['Finance']['MainSubjectId'];
    569     $this->Finance->DirectoryId = $this->System->Config['Finance']['DirectoryId'];
    570 
    571585    ModuleIS::Cast($this->System->GetModule('IS'))->RegisterDashboardItem('Finance', array($this, 'ShowDashboardItem'));
    572586  }
Note: See TracChangeset for help on using the changeset viewer.