Ignore:
Timestamp:
Oct 25, 2015, 9:51:51 PM (9 years ago)
Author:
chronos
Message:
  • Modified: Now IS Dashboard is not dependent on other modules. They need to register their view to IS dashboard.
  • Fixed: Wrong sign of created finance operations from bank import.
  • Added: Storno invoices now have special groups in FinanceInvoiceGroup table.

Both Storno and previous storned documents should be linked together using new table FinanceInvoiceStorno.
Also they should be marked as not visible to user.

File:
1 edited

Legend:

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

    r750 r755  
    333333        'PeriodTo' => array('Type' => 'Date', 'Caption' => 'Období do', 'Default' => '', 'Null' => true),
    334334        'Cash' => array('Type' => 'Boolean', 'Caption' => 'Platit hotově', 'Default' => ''),
     335        'VisibleToUser' => array('Type' => 'Boolean', 'Caption' => 'Viditelné uživatelům', 'Default' => '1'),
    335336        'Items' => array('Type' => 'TFinanceInvoiceItemListInvoice', 'Caption' => 'Položky', 'Default' => ''),
     337        'StornoBy' => array('Type' => 'TFinanceInvoiceStornoListBy', 'Caption' => 'Storno doklady', 'Default' => ''),
     338        'StornoOf' => array('Type' => 'TFinanceInvoiceStornoListOf', 'Caption' => 'Původní doklady', 'Default' => ''),
    336339        'OperationRel' => array('Type' => 'TFinanceInvoiceOperationRelListInvoice', 'Caption' => 'Platba', 'Default' => ''),
    337340        'OperationRelCount' => array('Type' => 'Integer', 'Caption' => 'Plateb',
     
    365368        'ValueSign' => array('Type' => 'TFinanceValueSign', 'Caption' => 'Znaménko hodnoty', 'Default' => '0'),
    366369        'Direction' => array('Type' => 'TFinanceDirection', 'Caption' => 'Směr', 'Default' => '0'),
     370        'Items' => array('Type' => 'TFinanceInvoiceListGroup', 'Caption' => 'Faktury', 'Default' => ''),
     371      ),
     372    ));
     373
     374    $this->System->FormManager->RegisterClass('FinanceInvoiceStorno', array(
     375      'Title' => 'Storno faktur',
     376      'Table' => 'FinanceInvoiceStorno',
     377      'Items' => array(
     378        'StornoBy' => array('Type' => 'TFinanceInvoice', 'Caption' => 'Storno doklad', 'Default' => ''),
     379        'StornoOf' => array('Type' => 'TFinanceInvoice', 'Caption' => 'Původní doklad', 'Default' => ''),
    367380      ),
    368381    ));
     
    557570    ));
    558571
     572
    559573    $this->System->AddModule(new Bill($this->System));
    560574    $this->System->AddModule(new Finance($this->System));
    561575    $this->System->Modules['Finance']->MainSubject = $Config['Finance']['MainSubjectId'];
    562576    $this->System->Modules['Finance']->DirectoryId = $Config['Finance']['DirectoryId'];
     577
     578    $this->System->ModuleManager->Modules['IS']->RegisterDashboardItem('Finance',
     579      array('ModuleFinance', 'ShowDashboardItem'));
     580  }
     581
     582  function ShowDashboardItem()
     583  {
     584    $DbResult = $this->Database->select('FinanceOperation', 'ROUND(SUM(`Value`))', '1');
     585    $DbRow = $DbResult->fetch_row();
     586    $Output = 'Stav placení: '.$DbRow['0'].' Kč<br/>';
     587    return $Output;
    563588  }
    564589
Note: See TracChangeset for help on using the changeset viewer.