Páginas filhas
  • Bank Transactions - FINA100 - Financial - P12


Notification


This routine was adjusted to comply with the Data Protection General Regulation (Law No. 13.70), so that some fields containing data regarded as sensitive and/or personal are blurred, becoming illegible.


01. OVERVIEW

Through its routines and processes, Protheus controls the banking account inflows and outflows. It is possible to add transactions and to transfer values among banks.
The first stage of implementing bank transactions is in the registration of bank information where your company transacts. Several banks can be registered.

02. EXECUTION 

  • Manually

Procedure manually performed through the Bank Transactions routine (FINA100), with the display of the screens involved in the process - actions/commands from the user are required

  • Automatically

Procedure automatically performed in the Bank Transactions routine (FINA100) without the display of screen - no interaction from the user required.
Used in customizations in which the process does not require user's interactions (MSEXECAUTO).

Documentation: Inclusion of Automatic Bank Transactions - FINA100



Important

As this is internal control, the field "Type of Transaction" (E5_TIPODOC) has these features:

  • In the manual execution, you cannot put it to use;
  • In the automatic execution, even if this field is sent, the system will not consider it.

From 11/04/2020, this field began to be recorded as "DH".




Example of automatic routine  
#INCLUDE "Protheus.ch"

User Function TST100()
Local nOpc     := 0
Local aFINA100 := {}

Private lMsErroAuto := .F.

While .T.

    nOpc := 0
    nOpc := Aviso("TESTE EXECAUTO DO FINA100", "Choose the menu option of the FINA100 routine to be executed via EXECAUTO",{"PAY","RECEIVE","DELETE","CANCEL","TRANSF.","ST. TRANSF."})
    
    If nOpc == 1   
        aFINA100 := {    {"E5_DATA"        ,dDataBase                    ,Nil},;
                            {"E5_MOEDA"        ,"M1"                            ,Nil},;
                            {"E5_VALOR"         ,500                            ,Nil},;
                            {"E5_NATUREZ"    ,"001"                    ,Nil},;
                            {"E5_BANCO"        ,"001"                        ,Nil},;
                            {"E5_AGENCIA"    ,"001"                        ,Nil},;
                            {"E5_CONTA"        ,"001"                        ,Nil},;
                            {"E5_BENEF"        ,"TESTE AUTO - BENEF"    ,Nil},;
                            {"E5_HISTOR"    ,"TESTE AUTO - AUTO"        ,Nil},;
                            {"NCTBONLINE"       ,1                    ,Nil}} //1=Sim;2=Não
    
        MSExecAuto({|x,y,z| FinA100(x,y,z)},0,aFINA100,3)
    
        If lMsErroAuto
            MostraErro()
        Else
            MsgAlert("Bank Transfer Pay successfully added !!!")
        EndIf       
        
    ElseIf nOpc == 2
        aFINA100 := {    {"E5_DATA"        ,dDataBase                    ,Nil},;
                            {"E5_MOEDA"        ,"M1"                            ,Nil},;
                            {"E5_VALOR"         ,1500                            ,Nil},;
                            {"E5_NATUREZ"    ,"001"                        ,Nil},;
                            {"E5_BANCO"        ,"001"                        ,Nil},;
                            {"E5_AGENCIA"    ,"001"                        ,Nil},;
                            {"E5_CONTA"        ,"001"                        ,Nil},;
                            {"E5_HISTOR"    ,"TESTE AUTO - AUTO"        ,Nil},}
							{"NCTBONLINE"       ,1                    ,Nil}} //1=Sim;2=Não
    
        MSExecAuto({|x,y,z| FinA100(x,y,z)},0,aFINA100,4)
    
        If lMsErroAuto
            MostraErro()
        Else
            MsgAlert("Bank Transfer Receive successfully added !!!")
        EndIf       
    
    ElseIf nOpc == 3
        dbSelectArea("SE5")
        SE5->(dbSetOrder(1))
        SE5->(dbSeek(xFilial("SE5")+DToS(dDataBase) ))
        aFINA100 := {    {"E5_DATA"             ,SE5->E5_DATA            ,Nil},;
                            {"E5_MOEDA"             ,SE5->E5_MOEDA            ,Nil},;
                            {"E5_VALOR"             ,SE5->E5_VALOR            ,Nil},;
                            {"E5_NATUREZ"        ,SE5->E5_NATUREZ        ,Nil},;
                            {"E5_BANCO"            ,SE5->E5_BANCO            ,Nil},;
                            {"E5_AGENCIA"         ,SE5->E5_AGENCIA        ,Nil},;
                            {"E5_CONTA"         ,SE5->E5_CONTA            ,Nil},;
                            {"E5_HISTOR"        ,SE5->E5_HISTOR        ,Nil},;
                            {"E5_TIPOLAN"        ,SE5->E5_TIPOLAN        ,Nil} }
    
        MSExecAuto({|x,y,z| FinA100(x,y,z)},0,aFINA100,5)
    
        If lMsErroAuto
            MostraErro()
        Else
            MsgAlert("Deletion successfully executed !!!")
        EndIf       

    ElseIf nOpc == 4
        dbSelectArea("SE5")
        SE5->(dbSetOrder(1))
        SE5->(dbSeek(xFilial("SE5")+DToS(dDataBase) ))
        dbSkip() //added only for this tests sequence
        aFINA100 := {    {"E5_DATA"             ,SE5->E5_DATA            ,Nil},;
                            {"E5_MOEDA"             ,SE5->E5_MOEDA            ,Nil},;
                            {"E5_VALOR"             ,SE5->E5_VALOR            ,Nil},;
                            {"E5_NATUREZ"        ,SE5->E5_NATUREZ        ,Nil},;
                            {"E5_BANCO"            ,SE5->E5_BANCO            ,Nil},;
                            {"E5_AGENCIA"         ,SE5->E5_AGENCIA        ,Nil},;
                            {"E5_CONTA"         ,SE5->E5_CONTA            ,Nil},;
                            {"E5_HISTOR"        ,SE5->E5_HISTOR        ,Nil},;
                            {"E5_TIPOLAN"        ,SE5->E5_TIPOLAN        ,Nil} }
    
        MSExecAuto({|x,y,z| FinA100(x,y,z)},0,aFINA100,6)
    
        If lMsErroAuto
            MostraErro()
        Else
            MsgAlert("Cancellation successfully executed !!!")
        EndIf       

    
    ElseIf nOpc == 5
        aFINA100 := {    {"CBCOORIG"             ,"001"                            ,Nil},;
                            {"CAGENORIG"        ,"001"                            ,Nil},;
                            {"CCTAORIG"             ,"001"                            ,Nil},;
                            {"CNATURORI"         ,"001"                            ,Nil},;
                            {"CBCODEST"            ,"002"                            ,Nil},;
                            {"CAGENDEST"         ,"002"                            ,Nil},;
                            {"CCTADEST"         ,"002"                            ,Nil},;
                            {"CNATURDES"        ,"002"                            ,Nil},;
                            {"CTIPOTRAN"        ,"CH"                                ,Nil},;
                            {"CDOCTRAN"            ,"123456"                        ,Nil},;
                            {"NVALORTRAN"        ,2500                                ,Nil},;
                            {"CHIST100"            ,"TESTE TRF VIA EXECAUTO"    ,Nil},;
                            {"CBENEF100"        ,"TESTE TRF VIA EXECAUTO"    ,Nil},;
                            {"NAGLUTINA"        ,2                    ,Nil},; //1=Sim;2=Não
                            {"NCTBONLINE"       ,1                    ,Nil}; //1=Sim;2=Não
                    }
    
        MSExecAuto({|x,y,z| FinA100(x,y,z)},0,aFINA100,7)
    
        If lMsErroAuto
            MostraErro()
        Else
            MsgAlert("Transfer successful !!!")
        EndIf       
                    
    //Transfer Reversal
    ElseIf nOpc == 6
        aFINA100 := {    {"AUTNRODOC"         ,"123456"                ,Nil},;
                            {"AUTDTMOV"            ,dDataBase                ,Nil},;
                            {"AUTBANCO"             ,"001"                    ,Nil},;
                            {"AUTAGENCIA"     ,"001"                    ,Nil},;
                            {"AUTCONTA"            ,"001"                    ,Nil} }
                    
        MSExecAuto({|x,y,z| FinA100(x,y,z)},0,aFINA100,8)
    
        If lMsErroAuto
            MostraErro()
        Else
            MsgAlert("Transfer successfully canceled !!!")
        EndIf       
    EndIf
    If nOpc == 0
        Exit
    Endif
Enddo
    
Return(Nil)


03. OPERATIONS

  • Pay

This option allows adding an amount payable to the bank transactions.

  • Receive 

This option allows adding amounts receivable to the bank transaction.

  • View

This option allows viewing the bank transaction registered, both payable or receivable.

  • Accounting tracker 

It displays the query with the transaction accounting entry if this has been accounted for.

  • Caption 

It displays the caption chart and meanings related to the transaction status


  • Delete

This operation allows deleting the bank transaction both payable and receivable, deleting the database record

  • Cancel

This operation performs the counterpart of the transaction, which means reversing the value paid or received.

  • View Apportionments

This operation allows viewing the accounting apportionment applied to the bank transaction. 

  • Locate 

Research the transaction in the bank transactions file, resulting in the transaction placed and highlighted in the browser.

  • Transfer between Checking Accounts

It executes two bank transactions in a single operation: outflow from the source account and inflow into the target account.

  • Transfer reversal between Checking Accounts

It reverses the transfer executed, returning the values to the source accounts

  • Classification

This option allows the accounting of a bank transaction.

04. PARAMETERS

List of parameters applied to FINA100 and its processing



    Question

    Description

    Group Entries?

    Enter option "YES" so the accounting entries generated through the transactions are grouped in a single entry 

    Display Acc.Entry?

    Enter option "YES" so the accounting entries generated through the transactions are displayed on screen or "NO", otherwise 

    Accounts online?

    Enter "YES" if an accounting of entries related to transactions online, or "NO", otherwise. 

    Inf. Cc. in the Apportion?

    Select option "Yes" so the accounts related to the apportionments are informed, or "No", otherwise.




    Parameters (SX6)

    Question

    Description

    Default

    MV_FINLMCH



    MV_CTBFLAG

    Indicates if the accounting flags of the offline routines are selected through the accounting entry transaction - SIGACTB.  

    .F.

    MV_EXDTDSP

    It allows changing the availability date in the integration via automatic routine (FINA100).  

    .F.

    MV_DTMOVRE

    It allows the use of a retroactive date from the system database to add bank transactions.  

    .F.

    MV_USEFRE

    It controls the Checkbooks (not found in the BRA environment) 

    .F.

    MV_NUMLIQ

    Settlements sequence number. The maximum quantity allowed is of 6 characters.  

    000001

    MV_LIBCHEQ

    Option to release bank balance when checks are generated before posting.  

    S

    MV_CLIPAD

    Standard customer for pre-dated checks

    000001

    MV_ESTADO

    Acronym of the system user company to calculate the ICMS (7, 12 or 18%).  

    SP

    MV_FORPAD

    Standard supplier for pre-dated checks.

    999999

    MV_DTMOVDR

    Number of continuous days the user may have in relation to the base date when adding the bank transaction  

    30

    MV_DIASCRD

    It determines the number of days to be added to the system base date to determine the credit date of a bank transfer (FINA100)  

    0

    MV_MOEDA



    MV_SIMB

    It configures the symbol used by the currency 1 of the system (not found in the BRA environment) 

    BRL

    MV_FATOUT

    Time out to select user record (in seconds). If the user takes longer, the screen is closed.  

    900

    MV_MCONTAB

    Accounting module used by the Advanced CTB = SIGACTB (Managerial Accounting)  CON = SIGACON (Accounting)  

    CTB

    MV_CXFIN

    Finance General Cash

    CX1/00001/0000000001

    MV_CARTEIR

    Codes of banks in the portfolio.


    MV_CMC7FIN

    Indicates the use of CMC7 reader in the Financial Content . S = Use CMC7 N = Do not use CMC7

    N

    MV_BXDTFIN

    It does not allow posting payment date earlier than the date in the parameter MV_DATAFIN (1=Allow, 2=Do not Allow)  

    2

    MV_DATAFIN

    Deadline for financial operations

    19800101




    05. FINANCIAL RULE

    The Bank Transaction is used to perform entries between accounts by feeding the balance in the SE8 - Bank Balances table, and by registering the transactions in the SE5 = Bank Transaction table. This basic characteristic does not generate revenues and expenses for the company, only controlling inflows and outflows of values between accounts.

    06. MAIN PROCESSES


      Procedures

      To add transaction payable:

      1. In the Bank Transactions browser, press (F12) to configure the routine parameters.
      2. Configure the parameters and confirm them.
      3. Click Pay, a screen for addition is opened.
      4. Enter data according to the field help instructions (To access the field help instructions, press key (F1)
      5. Check and confirm data.
      6. A record is generated in the SE5 - Bank Transaction and FK5 Bank Transaction tables

      Tip

      a. In case of manual bank transaction, and the value is wrong, execute the opposite entry, which means executing a bank transaction receivable. All transactions in the “Bank Transaction” are registered without being deleted, for information security.

      b. For any option chosen in the Cash (E5_MOEDA) field, there will be a bank transaction, updating the SE8 (Bank Balances), SE5 (Bank Transaction), FK5 (Bank Transactions), and FKA (Transactions Tracking) tables. 


      Procedures

      To add transaction receivable:

      1. In the Bank Transactions browser, press (F12) to configure the routine parameters.
      2. Configure the parameters and confirm them.
      3. Click Receive, a screen for addition is opened.
      4. Enter data according to the field help instructions (To access the field help instructions, press key (F1)
      5. Check and confirm data.
      6. A record is generated in the SE5 - Bank Transaction and FK5 Bank Transaction tables

      Tip

      a. In case of manual bank transaction, and the value is wrong, execute the opposite entry, which means executing a bank transaction payable. All transactions in the “Bank Transaction” are registered without being deleted, for information security.

      b. For any option chosen in the Cash (E5_MOEDA) field, there will be a bank transaction, updating the SE8 (Bank Balances), SE5 (Bank Transaction), FK5 (Bank Transactions), and FKA (Transactions Tracking) tables. 


      Procedures

      To add transaction payable/receivable

      1. In the Bank Transactions browser, press (F12) to configure the routine parameters.
      2. Configure the parameters and confirm them.
      3. Click Delete, a deletion screen is opened.
      4. Check the data and confirm.
      5. The record of the SE5 - Bank Transaction table will have E%_SITUACA = ‘C’ field, which means this transaction will be used by the system any longer, as if has been deleted. 


      IMPORTANT!

      If parameter MV_DATAFIN is set wit a date later than the transaction that is deleted, the system will not allow the deletion, as it would be manipulating a record in the closing period, once the option Delete does not generate a counterpart transaction.

      Procedures

      To cancel a transaction payable/receivable

      1. In the Bank Transactions browser, press (F12) to configure the routine parameters.
      2. Configure the parameters and confirm them.
      3. Then, click Cancel, a cancellation screen will be opened.
      4. Check the data and confirm.
      5. A record is generated in the SE5 - Bank Transaction table, the field will be E5_SITUACA = ‘E’, which means a source transaction counterpart reversal. 

      IMPORTANT!

      If parameter MV_DATAFIN is set with data later than the transaction that will be canceled, the system will allow it, as long as the reversal is after the blocking date, as a new counterpart transaction is generated out of the blocking date.

      Procedures

      For transfers:

      1. In the Bank Transactions browser, press (F12) to configure the routine parameters.
      2. Configure the parameters and confirm them.
      3. Then, click Transfer between checking accounts, a screen is opened to enter transfer data.
      4. Fill in the source and target information, according to the field help instructions.
      5. Enter identification data.
      6. Check and confirm data.


      Tip

      a. In case of a Bank Transfer, and the value is wrong, enter an opposite entry. All of the transfers in “Bank Transfer” are registered for information safety.

      b. For any option chosen in the Tp.Trans. (Type of Transfer) there will be a bank transaction, updating the SE5 (Bank Balance), SE5 (Bank Transaction), FK5 (Bank Transactions), and FKA (Transactions Tracking) tables. 

      c. Characteristics of bank transfer transactions between Checking Account:


      Type of Transaction

      Number Check (E5_NUMCHEQ)

      Document (E5_DOCUMEN)

      Origin/Outflow

      Even if the bank transaction if not executed in check (CH type, for example), this field is filled out with the document number displayed on the screen. This is the legacy manner to check the outflow process, but there will not be the generation of a check in the SEF table, even if the transaction is in cash ($ type) or bank transfer (TB type).

      Not completed.

      Target/Inflow

      Not filled out.

      Even if the bank transaction if not executed in check (CH type, for example), this field is filled out with the document number displayed on the screen. This is the legacy manner to check the inflow process, but there will not be the generation of a check in the SEF table, as the transaction comes from another checking account.


      d. Only the use of an asterisk ( * ) is allowed when typing the document number for “Trans Type” equal to “TB” or "CH". 

      For example: 

      • Number = '*' is allowed.
      • Number = '*DOC01' is not allowed.


      e. You cannot transfer with credit dates on non-business days (holidays or weekends - see MV_SABFERI), with the exception of transfers between cash, where the accounts must have at least one of these rules:

      • The registered bank (A6_COD) has 2 first two digits with "CX";
      • The bank is configured to operate in portfolio (parameter MV_CARTEIR. Example of content: "CX1/CX2/CX3");
      • The bank is configured as general financial cash (parameter MV_CXFIN. Example of content "CX1/00001/0000000001");
      • In case the parameter MV_CXLJFIN is enabled (indicates the SIGALOJA cash is also financial cash) and the bank is set in Table 23 (Managerial Tables - SX5);


      f. Even with the start of PIX, which enables transactions on weekends and/or holidays, BACEN has not changed the accounting rules. Therefore. the accounting date of the transaction remains the business day following the transaction (E5_DTDISPO).


      g. To meet the Decree CAF-G nº 27, dated 10.20.2017 - DOE SP dated 10.04.2017, which determines a bank transfer to be credited on the next business day (d+1), the parameter MV_DIASCRD was created to determine in how many days, and the system database, the values of the target account are available (E5_DTDISPO). For transfers between cash, this parameter has no effect.

      Procedures

      To reverse transfers:

      1. In the bank transactions browser, click Transfer Reversal. 
      2. The system displays the parameters screen. 
      3. Fill in the parameters requested according to the help description and confirm it.
      4. The bill requests are reversed from the system, returning the value to the source bank account.


      07. ACCOUNTING

      LP

      Generator Fact

      On

      Off (CTBAFIN)

      516

      Addition of bank transaction payable with apportionment 

      X

      X

      517

      Addition of bank transaction receivable with apportionment 

      X

      X

      557

      Cancellation of bank transaction payable with apportionment

      X

      X

      558

      Cancellation of bank transaction receivable with apportionment 

      X

      X

      560

      Bank transfer - source bank outflow 

      X

      X

      561

      Financial transfer - source bank inflow 

      X

      X

      562

      Bank transaction payable 

      X

      X

      563

      Bank transaction receivable

      X

      X

      564

      Cancellation bank transaction payable 

      X

      X

      565

      Cancellation bank transaction receivable

      X

      X

      Configuration of standard entries for this routine


      08. ENTRY POINTS

      Entry point

      Description 

      F100BROW

      The entry point is executed before the bank transaction browser.
      Document: F100BROW - Bank Transaction – 11684

      FA100PAG

      The entry point will be used after the recording of the accounting data of accounts payable in the bank transaction.
      Document: http://tdn.totvs.com.br/display/public/mp/FA100PAG+-+Grava+dados+--+11930

      FA100REC

      The entry point is used after the recording of data and the accounting of the accounts receivable in the bank transaction.
      Document: http://tdn.totvs.com.br/display/public/mp/FA100REC+-+Grava+dados+--+11931

      FINATROC

      Executed after the recording of all transactions receivable and accounting data. Used only by the SIGALOJA environment. Document: FINATROC - Recording of transaction receivable data – 12069

      FA100VLD

      Allows the user to create validations in relation to access to deletion and cancellation of bank transaction.
      Document: FA100VLD - Validation of deletion and cancellation – 24109

      FA100CA2

      executed after the confirmation of Deletion of Bank Transaction, before the deletion and accounting.
      Document: FA100CA2 - Cancel bank transaction – 11924

      FA100CAN

      The entry point will be used after the deletion of bank transactions before the accounting.
      Document: FA100CAN - Cancel bank transaction – 11925

      FA100Get

      allows the customer to fill out the bank transfer screen data automatically.
      Document: FA100GET - Completion of bank transfer screen – 109531

      FA100TRF

      executed before the transfer and returns .T. to record the transfer or .F. otherwise.
      Document: FA100TRF - Record transfer

      F100DOC

      used to edit the check number during the transfer between banks and bank branches.
      Document: F100DOC - Change of the check number – 11685

      A100BL01

      executed after the recording of bank transfer data.
      Document: A100BL01 - Recording of data – 11548

      FA100DOC

      Is used to manipulate the variable cDocTran. Return: value that must be in cDocTran Parameters: cBcoOrig, cAgenOrig,cCtaOrig,cTipoTran
      Document: FA100DOC - Manipulate variable – 11926

      A100TR01

      used in the recording of bank transaction transfer.
      Document: http://tdn.totvs.com.br/display/public/mp/A100TR01+-+Transferencia+de+movimento+bancario+--+11549

      A100TRA

      A100TRA entry point complements the A100TR01 entry point. This entry points receives a parameters array with this content: lEstorno, cBcoOrig, cBcoDest, cAgenOrig, cAgenDest, cCtaOrig, cCtaDest, cNaturOri, centuries, cDocTran,cHist100.
      Document: A100TRA - Bank Transaction – 11552

      A100TR02

      used during the recording of bank transfer data
      Document: A100TR02 - Recording of bank transfer data – 11550

      A100TRB

      A100TRB entry point complements the A100TR02 entry point.This entry point receives a parameters array with this content: lEstorno, cBcoOrig,cBcoDest, cAgenOrig, cAgenDest,cCtaOrig,cCtaDest,cNaturOri,cNaturDes,cDocTran, cHist100.
      Document: A100TRB - Recording of transfer – 11553

      A100TR03

      executed after the recording of the bank transfer data. After recording the SE5 of Source/Target banks after the accounting.
      Document: A100TR03 - Recording of bank transfer data – 11551

      A100TRC

      A100TRC entry point complements the A100TR03 entry point.This entry point receives a parameters array with this content: lEstorno, cBcoOrig, cBcoDest, cAgenOrig, cAgenDest, cCtaOrig, cCtaDest, cNaturOri, cNaturDes, cDocTran, cHist100.
      Document: A100TRC - Record of Transfer – 11554

      F100TOK

      Validates the bank transaction data.
      Document: F100TOK - Validate bank transaction data – 11688

      FA100TRF

      The entry point FA100TFR is executed before the transfer and returns .T. To record the transfer or .F. otherwise.
      Document: FA100TRF - Record Transfer – 11932

      FA100ROT

      Allows the addition of customized buttons in theEnchoiceBar of the Bank Transaction routine.
      Document:  FA100ROT - Addition of customized buttons in the EnchoiceBar – 30104

      FA100OKP

      Used to block the addition of transactions payable in the Bank Transactions routine. If it returns true, the transaction is regularly performed, otherwise, there will not be addition of transaction. Logic return.
      Document: FA100OKP - Block transaction addition – 11928

      FA100OKR

      Used to block the addition of transactions payable in the Bank Transactions routine. In case the return is true, the transaction is regularly executed, otherwise, the transaction will not be added. Logic return.
      Document: FA100OKR -Block addition of transactions – 11929

      A85CHPDT

      Allows the user to perform the own treatment to select the third party checks that may be used in the type of payment entered in the option differentiated payment.
      Document: A85CHPDT - Selection of third party checks – 11564

      F100FBRW

      The entry point is executed before the bank transaction browser.
      Document: F100FBRW - Allows to filter bank transactions


      09. TABLES

      • SE5 – Bank Transaction 
      • SE1 - Accounts receivable 
      • SE2 - Accounts payable 
      • SE3 - Sales Commissions
      • SEF - Checks 
      • SI1 - Chart of Accounts. 
      • SI2 - Accounting Entries
      • SI5 - Standardized Entries.
      • SI6 - Totals Batches 
      • SM2 - Currencies
      • FJU - Saves bills deleted  
      • FK1 - Posting Payment receivable
      • FK2 - Posting Payment Payable
      • FK3 - Calculated taxes
      • FK4 - Withheld taxes 
      • SE5 – Bank Transaction
      • FK6 - Accessory values
      • FK8 - Accounting Data
      • FK9 - Transaction complement
      • FKA - Transaction tracking