Ignore:
Timestamp:
Jul 5, 2015, 6:24:33 PM (9 years ago)
Author:
chronos
Message:
  • Modified: Added Direction column to finance operations and invoices. This column will serve as real direction where ValueSign could be different for storno operations.
File:
1 edited

Legend:

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

    r740 r741  
    1717define('INVOICE_GROUP_OUT', 2);
    1818define('VAT_TYPE_BASE', 2);
    19 
     19define('FINANCE_DIRECTION_OUT', 0);
     20define('FINANCE_DIRECTION_IN', 1);
    2021
    2122class Finance extends Model
     
    219220        'Cash' => array('Type' => 'Boolean', 'Caption' => 'Hotově', 'Default' => ''),
    220221        'Taxable' => array('Type' => 'Boolean', 'Caption' => 'Zdanitelné', 'Default' => ''),
    221         'ValueSign' => array('Type' => 'TFinanceOperationValueSign', 'Caption' => 'Znaménko', 'Default' => '1'),
     222        'Direction' => array('Type' => 'TFinanceDirection', 'Caption' => 'Směr', 'Default' => '0'),
     223        'ValueSign' => array('Type' => 'TFinanceValueSign', 'Caption' => 'Znaménko', 'Default' => '1'),
    222224        'Value' => array('Type' => 'Integer', 'Caption' => 'Částka', 'Default' => '0', 'Suffix' => 'Kč'),
    223225        'File' => array('Type' => 'TFile', 'Caption' => 'Doklad', 'Default' => '', 'Null' => true),
     
    278280        'Name' => array('Type' => 'String', 'Caption' => 'Název', 'Default' => '0'),
    279281        'DocumentLine' => array('Type' => 'TDocumentLine', 'Caption' => 'Dokladová řada', 'Default' => '0'),
    280         'ValueSign' => array('Type' => 'TFinanceInvoiceValueSign', 'Caption' => 'Znaménko hodnoty', 'Default' => '0'),
     282        'ValueSign' => array('Type' => 'TFinanceValueSign', 'Caption' => 'Znaménko hodnoty', 'Default' => '0'),
     283        'Direction' => array('Type' => 'TFinanceDirection', 'Caption' => 'Směr', 'Default' => '0'),
    281284      ),
    282285    ));
     
    288291      'Filter' => '1',
    289292    ));
    290     $this->System->FormManager->RegisterFormType('TFinanceOperationValueSign', array(
     293    $this->System->FormManager->RegisterFormType('TFinanceValueSign', array(
    291294      'Type' => 'Enumeration',
    292295      'States' => array(-1 => 'Mínus', 1 => 'Plus'),
     296    ));
     297    $this->System->FormManager->RegisterFormType('TFinanceDirection', array(
     298      'Type' => 'Enumeration',
     299      'States' => array(0 => 'Příjem', 1 => 'Výdej'),
    293300    ));
    294301    $this->System->FormManager->RegisterClass('FinanceInvoice', array(
     
    304311        'TimeDue' => array('Type' => 'Date', 'Caption' => 'Čas splatnosti', 'Default' => ''),
    305312        'TimePayment' => array('Type' => 'Date', 'Caption' => 'Čas zaplacení', 'Default' => '', 'Null' => true),
    306         'ValueSign' => array('Type' => 'TFinanceInvoiceValueSign', 'Caption' => 'Znaménko', 'Default' => '1'),
     313        'Direction' => array('Type' => 'TFinanceDirection', 'Caption' => 'Směr', 'Default' => '0'),
     314        'ValueSign' => array('Type' => 'TFinanceValueSign', 'Caption' => 'Znaménko', 'Default' => '1'),
    307315        'Value' => array('Type' => 'Integer', 'Caption' => 'Částka', 'Default' => '0', 'Suffix' => 'Kč'),
    308316        'File' => array('Type' => 'TFile', 'Caption' => 'Doklad', 'Default' => '', 'Null' => true),
     
    331339    $this->System->FormManager->Classes['FinanceInvoiceOut']['Items']['Group']['Filter'] = true;
    332340
    333     $this->System->FormManager->RegisterFormType('TFinanceInvoiceValueSign', array(
    334         'Type' => 'Enumeration',
    335         'States' => array(-1 => 'Mínus', 1 => 'Plus'),
    336     ));
    337 
    338341    $this->System->FormManager->RegisterClass('FinanceInvoiceGroup', array(
    339342      'Title' => 'Skupina faktur',
     
    342345        'Name' => array('Type' => 'String', 'Caption' => 'Název', 'Default' => '0'),
    343346        'DocumentLine' => array('Type' => 'TDocumentLine', 'Caption' => 'Dokladová řada', 'Default' => '0'),
    344         'ValueSign' => array('Type' => 'TFinanceInvoiceValueSign', 'Caption' => 'Znaménko hodnoty', 'Default' => '0'),
     347        'ValueSign' => array('Type' => 'TFinanceValueSign', 'Caption' => 'Znaménko hodnoty', 'Default' => '0'),
     348        'Direction' => array('Type' => 'TFinanceDirection', 'Caption' => 'Směr', 'Default' => '0'),
    345349      ),
    346350    ));
Note: See TracChangeset for help on using the changeset viewer.