Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.

...

Totvs custom tabs box
tabsClear,Clear Rate Contracted x Rate Contracted,Clear without rate contracted,Rates used and order of priority,Commission in clearing with NCC/RA
idsPasso1,Passo2,Passo3,Passo4,Passo5
Totvs custom tabs box items
defaultyes
referenciaPasso1

To perform the clearing process, you need to select the main bill that you want to be cleared.  

Choose the parameters to execute the process: 


Branches button: Used to select the branches that will be considered for clearing.

With the data from the bill to be cleared, we can choose the amount to be cleared as the clearing limit, and also the date of the posting. 

The "Selected Bills" flag can facilitate the process by already selecting the bills according to the balance composition until the balance of the main bill is reached. 

Note: in some situations, due to the way the tax calculation is configured, the initial suggestion ("Selected Bills") is not performed by the system, leaving it up to the operator to select manually so that the tax calculation can be made at runtime. For further information on tax configuration, visit: http://tdn.totvs.com/x/tA2qC


After the screen is displayed, the following options are available: 

  • Individual selection of each bill, and this consists of the balance of the bill to confirm or not the selection of the record. Using this option, the system automatically suggests how much the selected bill can be posted according to the balance of the main bill.



Informações
titleImportant!

Values will be shown in the PIS, COFINS, CSLL, and Income Tax columns only when the corresponding withholding configuration is in the posting. 



Totvs custom tabs box items
defaultno
referenciaPasso2

Clearing with Contracted Rate 

Parameters involved:

MV_CMTXCON =Indicates that monetary correction will be generated for bills with contracted rate in CP clearing.  T = Generate / F = Do not generate

For the process of clearing with Contracted Rate, the parameter must be configured as follows:


MV_CMTXCON = T (True)

The monetary correction will start from the selected document:

If the advance payment (RA) bill is selected, the invoice bills will suffer monetary correction based on the rate of the selected RA bill.

If the invoice bill is selected, the advance payment (RA's) bills will suffer monetary correction based on the rate of the selected invoice bill.

MV_CMTXCON = F (False)

No monetary correction will be generated and clearing with different contracted rates will not be allowed.


Aviso
titleImportant

For the rate entered at the moment of clearing to be considered, when bills with contracted rates exist, the parameter MV_CMTXCON must have its content equal to .T. (True)


Example:

Invoice:

Value: 1,000.00

Currency: 2

Rate: 2

Converted Value: 2,000.00


Advance:

Value: 1,000.00

Currency: 2

Rate: 2.5

Converted Value: 2,500.00


Performing the clearing from the Invoice, we will have the following recordings in table SE5:

E5_TIPO

E5_VALOR

E5_VLMOED2

E5_TXMOEDA

E5_TIPODOC

Invoice

1000

2000

2

CP

RA

1000

2000

2

BA

RA

-500

-250

2

CM


Performing the clearing from the Advance Payment, we will have the following recordings in table SE5:

E5_TIPO

E5_VALOR

E5_VLMOED2

E5_TXMOEDA

E5_TIPODOC

RA

1000

2500

2.5

BA

Invoice

1000

2500

2.5

CP

Invoice

500

200

2.5

CM


Example of automatic clearing using the rates above:


Bloco de código
languagejava
themeMidnight
titleAutomatic Clearing Contracted Rate
collapsetrue
#INCLUDE "TOTVS.ch"
#Include "PROTHEUS.ch"    
#Include "PRTOPDEF.CH"
#INCLUDE "TBICONN.CH" 

User FUNCTION COMPCR()

    Local lRetOK := .T.
    Local aArea := GetArea()
    Local nTaxaCM := 0
    Local aTxMoeda := {}
    Local cCliente := "001   "
    Local cLoja := "01"
    Local cPrefixo := "TIT"
    Local cNumDoc := '00001    '
    Local cParcela := " "
    Local cTipoDoc := "RA "
    Private nRecnoNDF
    Private nRecnoE1

    dbSelectArea("SE1")
    dbSetOrder(2) // E1_FILIAL, E1_CLIENTE, E1_LOJA, E1_PREFIXO, E1_NUM, E1_PARCELA, E1_TIPO, R_E_C_N_O_, D_E_L_E_T_

    IF dbSeek(XFILIAL("SE1") + cCliente + cLoja + cPrefixo + cNumDoc + cParcela + cTipoDoc)
        nRecnoRA := RECNO() 

        cTipoDoc := "NF"
        IF dbSeek(XFILIAL("SE1") + cCliente + cLoja + cPrefixo + cNumDoc + cParcela + cTipoDoc)
            nRecnoE1 := RECNO()
            
            PERGUNTE("AFI340",.F.)
            lContabiliza := .F.
            lAglutina := .F.
            lDigita := .F.

            SE1->(dbSetOrder(1)) //E1_FILIAL+E1_PREFIXO+E1_NUM+E1_PARCELA+E1_TIPO+E1_FORNECE+E1_LOJA
            aRecRA := { nRecnoRA }
            aRecSE1 := { nRecnoE1 }

            nSaldoComp := 2000 // Clearing value in strong currency

            nTaxaCM := 2 // Rate considered in the clearing

            aAdd(aTxMoeda, {SE1->E1_MOEDA, nTaxaCM} ) // Rates of the currencies used

            If !MaIntBxCR(3, aRecSE1,,aRecRA,,{lContabiliza,lAglutina,lDigita,.F.,.F.,.F.},,,,,nSaldoComp,,,, nTaxaCM, aTxMoeda)
                Help("XAFCMPAD",1,"HELP","XAFCMPAD","Could not perform clearing "+CRLF+" of the advance bill",1,0)
                lRetOK := .F.
            Else
                Alert("Clearing performed.")
            ENDIF
        ENDIF
   ENDIF

   RestArea(aArea)

Return lRetOK
  
Totvs custom tabs box items
defaultno
referenciaPasso3

The MV_RATXMOV parameter was created to define the rate to be considered for advance payments without contracted rate in the clearing.

The parameter has been incorporated into Protheus release 12.1.27 and made available in the continuous shipments for the previous releases in effect. 


MV_RATXMOV = .T.

When set to true .T., the rate of its inclusion transaction will be considered.

When clearing comes from the advance payment, this rate will be used for listed bills of the same currency.

When clearing comes from the bill, the bill will use the rate of the day or the rate entered at the time of clearing, and listed advances will use their transaction rate.


MV_RATXMOV = .F.

When set to false .F., the rate of the day of clearing or that used at the time of clearing for all the bills involved will be considered.


Specification of parameter:

Parameter name:

MV_RATXMOV

Type:

Logical

Description:

Defines whether the advance payment should use the rate of its transaction for clearing.

.T. Use the transaction / .F. Use the clearing) 

Default Value:

.T.

Totvs custom tabs box items
defaultno
referenciaPasso4

Rates used and order of priority

Rate of the day (Table SM2): Once the rate of the day has been set for foreign currency bills, this rate will be considered at the time of clearing.

Bill rate (contracted): The rate set at the time of inclusion of the bills (E1_TXMOEDA) is respected in the clearing. When this contracted rate is entered, clearing uses it, even if a currency rate has been configured for the dates involved (Table SM2);

Rate on clearing: This rate can be set by the option Currency Rates, before selecting the bills for clearing.  Even if the bill has a rate of the day (Table SM2) for the currency in question, or a contracted rate (E1_TXMOEDA), the rate defined at the moment of clearing is considered, if entered;


The criterion for rate conversion is the order of rate configuration, being:

1 - Rate on clearing

2 - Bill rate (contracted)

3 - Rate of the day (Table SM2)


Totvs custom tabs box
tabsRate of the day (SM2),Contracted rate,Rate entered on clearing
idsTaxa1,Taxa2,Taxa3
Totvs custom tabs box items
defaultyes
referenciaTaxa1

Clearing of RA in Dollars with an invoice in Reais.

Day rate of 2.0000 for currency 2 (Dollar) - Inclusion.


RA bill in foreign currency (Dollar):

Invoice bill in strong currency (Reais):


Performing the clearing on a different day than the inclusion:

Rate of the day: 3.0000 for currency 2 (Dollar) - Clearing.


The system considered the rate of the clearing day for the RA. This behavior can be parameterized through the MV_RATXMOV (In this example, the parameter is set to .F.).

SE5 transaction:

The rate of the day of the clearing was used for the transactions, and a monetary correction was generated in relation to the rate used in the inclusion of the RA.

RA cleared value: $ 5,000.00 (Dollar) x Rate of the inclusion (2.0000) = BRL 10,000.00 (Reais)

RA cleared value: $ 5,000.00 (Dollar) x Clearing Rate (3.0000) = BRL 15,000.00 (Reais)

Monetary adjustment: 15,000.00 - 10,000.00 = 5,000.00 (Reais) converting 1,666.67 (Dollar)

Totvs custom tabs box items
defaultno
referenciaTaxa2

Example using contracted rate (E1_TXMOEDA)

Clearing of RA in Dollars with an invoice in Reais.

Rate of the day: 2.0000 for currency 2 (Dollar).

Bill with a contracted rate of 2.5000.


RA bill in foreign currency (Dollar):

Invoice bill in strong currency (Reais):


Performing the clearing on a different day than the inclusion:

Rate of the day: 3.0000 for currency 2 (Dollar) - Clearing.


The system considered the contracted rate for the RA. When the bill has a contracted rate, the clearing uses this, even if a currency rate has been set for the dates involved.

SE5 transaction:

The contracted rate was used in the transactions, in which case no monetary correction is generated because the RA had no variation in its rate.

Totvs custom tabs box items
defaultno
referenciaTaxa3

Example using rate entered on clearing

Clearing of RA in Dollars with an invoice in Reais.

Rate of the day: 2.0000 for currency 2 (Dollar).

Bill with a contracted rate of 2.5000.


RA bill in foreign currency (Dollar):

Invoice bill in strong currency (Reais):


Performing the clearing on a different day than the inclusion:

Rate of the day: 3.0000 for currency 2 (Dollar) - Clearing.

Entering a rate of 3.2000 at the clearing time.


The system considered the rate entered for the RA. When you enter a rate at the time of clearing, the system will use it, even if the bill has a contracted rate (E1_TXMOEDA), or if you have set a currency rate for the dates involved.

SE5 transaction:

The rate entered in the clearing was used for the transactions, and a monetary correction was generated in relation to the rate informed in the clearing and the contracted rate of the bill.

RA cleared value: $ 4687.5 (Dollar) x Contracted Rate (2.5000) = BRL 11,718.75 (Reais)

RA cleared value: $ 4687.5 (Dollar) x Clearing Rate (3.2000) = BRL 15,000.00 (Reais)

Monetary adjustment: 15,000.00 - 11,718.75 = 3,281.25 (Reais) converting 1,025.39 (Dollar)

The commission on CR clearing can be calculated as long as the financial bill (Invoice) is correctly configured with sales representative and percentage, and the questions below are configured with Yes according to the type of bill that will be cleared - NCC or RA.

Totvs custom tabs box items
defaultno
referenciaPasso5

Calc comiss w/o NCC?

Enter whether the System should calculate commission in compensations with NCC-type bills.

Question = YES - The system calculates commission.

Question = NO - The system does not calculate commission.


Calc comiss w/o RA?

Enter whether the System should calculate commission in compensations with RA-type bills.

Question = YES - The system calculates commission.

Question = NO - The system does not calculate commission.


Parameters

MV_COMISCR -Indicator that allows calculation of commission for sales representative in the CR clearing.  

"S" - calculate it or "N" - do not calculate it.


TABLE FOR POSTING REASONS

In the reasons for posting table (Miscellaneous -> Files), enter the CMP reason and enable the commission calculation in the reason for posting. Example:
Acronym: CMP
Description: Clearing
Portfolio: A (Both)
 Bank Trans.: N
Commission: S
Check: N


Note: In this process, the Sales Representative and Commission Percentage data of the credit instruments (NCC/RA) will not be considered, only of the financial bill (Invoice, RC etc.)


...