Páginas filhas
  • Clearing Between Portfolios - FINA450 - Financials P12

Versões comparadas

Chave

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

Clearing Between Portfolios - FINA450 - Financials P12


Índice
maxLevel2
minLevel2
stylecircle

...

Note
This routine was adjusted to comply with the General Personal Data Protection Law (Statute No. 13.70)

...

so that some fields containing data regarded as sensitive and/or personal are blurred, becoming illegible.

01. OVERVIEW

Use this routine to execute clearances clearings of bills payable with bills receivable, thus offsetting accounts between supplier and customer.
This process takes the following bills into account:

  • Debit bills - for exampleNF (Tax Invoice), BOL (Bank Slip), etc.
  • Credit bills - for example: PA (Advance Payment), RA (Advance Receipt), and return bills (NDF and NCC).

02. EXECUTION

  • Manually

Procedure manually performed through the Clearance Clearing Between Portfolios (FINA450), with the display of the screens involved in the process - actions/commands from the user are required

...

Procedure automatically performed in the Clearance Clearing Between Portfolios routine (FINA450) without the display of screen - no interaction from the user required.
Used in customizations in which the process does not require user interactions (MSEXECAUTO).

...


Example of

...

automatic routine  Expandir origem
#include "rwmake.ch"

...


#include

...

'tbiconn.ch'

...


User

...

Function

...

Auto450()

...


Local

...

aAutoCab

...

:=

...

{}

...


Local

...

aArea

...

:=

...

GetArea()

...


Local

...

cTabSe1

...

:=

...

"TMPSE1A"

...


Local

...

cTabSe2

...

:=

...

"TMPSE2A"

...


Local aSE1450 :=

...

{}

...


Local

...

aSE2450

...

:=

...

{}

...


Local

...

aFilCmp

...

:=

...

{}

...


Private lMsHelpAuto :=

...

.F.

...


Private

...

lMsErroAuto

...

:=

...

.F.

...


BeginSql Alias cTabSe1
SELECT R_E_C_N_O_

...

as

...

RECNO
FROM %Table:SE1%

...

SE1
WHERE SE1.E1_FILIAL

...

=

...

'D

...

MG

...

01

...

'
AND SE1.E1_PREFIXO = 'CPT'
AND SE1.E1_NUM

...

=

...

'VT001'

...


AND SE1.E1_TIPO

...

=

...

'NF'

...


AND SE1.E1_CLIENTE

...

=

...

'FIN001'

...


AND SE1.E1_LOJA

...

=

...

'01'

...


AND SE1.%NotDel%
EndSql
While (cTabSe1)->(!EOF())

...


SE1->(DbGoto((cTabSe1)->RECNO))

...


AAdd(aSE1450,

...

{SE1->E1_FILIAL+SE1->E1_PREFIXO+SE1->E1_NUM+SE1->E1_PARCELA+SE1->E1_TIPO})

...


If ascan(aFilCmp,SE1->E1_FILIAL)

...

==

...

0
Aadd(aFilCmp,

...

SE1->E1_FILIAL)

...


EndIf
(cTabSe1)->(DbSkip())

...


Enddo
(cTabSe1)->(DbCloseArea())

...


BeginSql Alias cTabSe2
SELECT R_E_C_N_O_

...

as

...

RECNO
FROM %Table:SE2%

...

SE2
WHERE SE2.E2_FILIAL

...

=

...

'D

...

MG

...

02

...

'
AND SE2.E2_PREFIXO

...

=

...

'CPT'

...


AND SE2.E2_NUM

...

=

...

'VT001'

...


AND SE2.E2_TIPO

...

=

...

'NF'

...


AND SE2.E2_FORNECE

...

=

...

'FIN001'

...


AND SE2.E2_LOJA

...

=

...

'01'

...


AND SE2.%NotDel%
EndSql
While (cTabSe2)->(!EOF())

...


SE2->(DbGoto((cTabSe2)->RECNO))

...


AAdd(aSE2450,

...

{SE2->E2_FILIAL+SE2->E2_PREFIXO+SE2->E2_NUM+SE2->E2_PARCELA+SE2->E2_TIPO+SE2->E2_FORNECE+SE2->E2_LOJA})

...


If ascan(aFilCmp,SE2->E2_FILIAL)

...

==

...

0
Aadd(aFilCmp,

...

SE2->E2_FILIAL)

...


EndIf
(cTabSe2)->(DbSkip())

...


Enddo
(cTabSe2)->(DbCloseArea())

...


aAutoCab :={

...

{"AUTDVENINI450",

...

cTod('27/08/19')

...

,

...

nil},;

...


{"AUTDVENFIM450",

...

cTod('27/08/19')

...

,

...

nil},;

...


{"AUTNLIM450"

...

,8000,

...

nil},;

...


{"AUTCCLI450" , "FIN001"

...

,

...

nil},;

...


{"AUTCLJCLI"

...

,

...

"01"

...

,

...

nil},;

...


{"AUTCFOR450"

...

,

...

"FIN001"

...

,

...

nil},;

...


{"AUTCLJFOR"

...

,

...

"01"

...

,

...

nil},;

...


{"AUTCMOEDA450"

...

,

...

"01"

...

,

...

nil},;

...


{"AUTNDEBCRED" , 1 , nil},;
{"AUTLTITFUTURO",

...

.F.

...

,

...

nil},;

...


{"AUTARECCHAVE"

...

,aSE1450,

...

nil},;

...


{"AUTAPAGCHAVE"

...

,

...

aSE2450

...

,

...

nil},;

...


{"AUTAFILCOMP"

...

,

...

aFilCmp

...

,

...

nil}}

...

//

...

Parameter optional, only fill it out when a multi-branch clearing occurs
MSExecAuto({|x,y,z|

...

Fina450(x,y,z)},

...

nil

...

,

...

aAutoCab

...

,

...

3

...

)
If !lMsErroAuto
ConOut("

...

Included successfully

...

")

...

titleNote

...


confirmsx8()
Else
ConOut("Inclusion error")
rollbacksx8()
MostraErro()
EndIf
RestArea(aArea)
Return
Note
Important:

  • For the clearing to work between branches, use the parameter AUTAFILCOMP; otherwise, there is no need to set it.
  • If the Customer and Supplier stores are empty, the system will consider all stores with the same supplier and customer code.  (Available as of June 1st, 2023)

For further information, access the automatic routine documentation.
Automatic

...

Clearing Between Portfolios  

...

03 OPERATIONS

  • Clear

Operation for

...

clearing between portfolios payable/receivable. 

  • Cancel

Operation for canceling the transaction generated by the

...

clearing.

  • Reversal 

Operation for reversing the transaction generated by the

...

clearing.

  • Caption

It displays the caption chart and meanings related to the bill payable.

...

Image Added

  • Search

Search for the bill in the accounts payable file, having it placed and highlighted in the browser.

  • View

Operation for viewing the bill selected, so you can check its balance and value.

04. PARAMETERS APPLIED

List of parameters applied to FINA450 and its processing

Âncora
composition-deck

...

idParâmetros
effectTypefade

...

-Parâmetros
composition-deck-Parâmetros

Questions (F12)

...

Question

Description

Group Entries?

Enter "Yes" to group the accounting entries generated through the

...

clearing in a single entry 

Display Entries?

Enter "Yes" to display onscreen the accounting entries generated through

...

clearing, otherwise "No" 

Clear Transferred Bills?

Enter "Yes" to allow

...

the clearing of bills transferred to the bank (Bordereau), otherwise "No"

Select Branches? 

If "Yes" the branch selection screen is displayed for the multi-branch

...

clearing process

Parameters (SX6)

...

...

Question

Description 

Default

MV_BX10925

Define when

...

withholding of PIS COFINS and CSLL taxes are processed: 1 = At Posting or 2 = At Issue  

1

MV_BP10925

Define whether to consider the gross value of partial posting or the net value plus taxes. (1=Gross Val./2=Net Val.)

1

MV_CC10925

Configure the calculation and withholding of PCC in

...

Clearing Between Portfolios. 1. (Default) Do Not Calculate PCC,  2. Calculate PCC on payable, 3. Calculate PCC

...

payable and receivable

1

MV_NUMCOMP

Sequential numbering for

...

Clearing between portfolios.  

000000

MV_CTLIPAG

Control postings payable through filled-out release date. If .T., the system checks whether field E2_DATALIB is filled out, otherwise, it does not control them 

F

MV_VLMINPG

The minimum value to post the bill, even if field E2_DATALIB is not filled out and the content of parameter MV_CTLIPAG is .T.  

0

MV_JURTIPO

The

...

bills receivable interests can be

...

(S)imple, only (C)ompound

...

, or (M)ixed = Simple up to 30 days

...

of delay, and

...

later Compound.  

M

MV_LJINTFS

Indicate integration with Financial Services.

.F.

MV_JURXFIN

Enable integration between modules SIGAFIN - Financials and SIGAPFS - Legal. Disabled by default.  

.F.

MV_CTBFLAG

Indicate if the accounting flags of the offline routines are selected during the accounting entry transaction                    

.F.


05. MAIN PROCESSES

Âncora
composition-deck

...

-processos
composition-deck-

...

processos

...

id1
labelClear
effectTypefade


Clear
Procedures
To execute a

...

clearing between portfolios:

  1. Have a bill payable available for

...

  1. clearing.
  2. Have a bill receivable available for

...

  1. clearing.
  2. In the

...

  1. Clearing Between Portfolios browser, press (F12) to set routine parameters.
  2. Configure them and confirm.
  3. Then, click

...

  1. option Clear, and a parameter settings screen opens

...

Image Added
Note: in this screen, fill out data on bills from steps 1 and 2.

...

Then,

...

select the bills registered in

...

steps 1 and 2, then select the option Save in the right-hand corner of the screen.

...

Image Added  

...

Information

...

Clearing between portfolios uses a sequential numbering through parameter MV_NUMCOMP, controlled by field IDENTEE in tables SE1, SE2, and SE5, and field IDPROC in tables FK1 and FK2

...



Cancel

...

Procedures
To cancel a

...

clearing between portfolios:

  1. Have a

...

  1. clearing between portfolios.
  2. In the

...

  1. Clearing Between Portfolios browser, press (F12) to set routine parameters.
  2. Set and confirm routine parameters.
  3. Place the cursor on the bill cleared and select the option Cancel.

...

Image Added
5.

...

Press OK

...


Important
The operation to cancel the

...

clearing between portfolios is done based on tables FK1 and FK2, using field IDPROC to locate the records cleared

...

,

...

the integrity of these tables is crucial to this operation

...

id3
labelReverse
effectTypefade

Procedures

To execute a clearance between portfolios:

  1. Have a clearance between portfolios.
  2. In the Clearance Between Portfolios browser, press (F12) to set routine parameters.
  3. Set and confirm routine parameters.
  4. Place the cursor on the bill cleared and select option Reverse.

Image Removed

5. Press OK.

Aviso
titleImportant

The operation to reverse the clearance between portfolios is done based on tables FK1 and FK2, using field IDPROC to locate the records cleared.

The integrity of these tables is crucial to this operation.

...

id1
labelClearance with PCC withholding
effectTypefade

Important
The users without editing permission for records of other branches in the browser (Permission 115) cannot cancel or reverse records in which the source of the payment is different from the logged-in branch. That is, if the payment originated in a different branch, the posting records may not be found for reversal.
Reverse
Procedures
To execute a reversal between portfolios:

  1. Have a clearing between portfolios.
  2. In the Clearing Between Portfolios browser, press (F12) to set routine parameters.
  3. Set and confirm routine parameters.
  4. Place the cursor on the bill cleared and select option Reverse.

Image Added
5. Press OK
Important
The operation to reverse the clearing between portfolios is done based on tables FK1 and FK2, using field IDPROC to locate the records cleared. The integrity of these tables is crucial to this operation.
Important
The users without editing permission for records of other branches in the browser (Permission 115) cannot cancel or reverse records in which the source of the payment is different from the logged-in branch. That is, if the payment originated in a different branch, the posting records may not be found for reversal.
Clearance with PCC withholding
The Clearance Between Portfolios routine performs the withholding of PIS, Cofins, and CSLL when the company using Protheus withholds these taxes

...

because it is possible to control the withholding through the generation of 'TX' type bills.

...

Important
The Clearance between Portfolios routine will now withhold PIS, Cofins, and CSLL taxes for both accounts payable and accounts receivable, starting with sources with a version later than December 2021. 
To withhold PIS, COFINS, and CSLL taxes in routine

...

Clearing Between Portfolios, set parameters as shown below:

...

MV_BX10925 = 1 (PCC withholding on posting)

...

MV_BR10925 = 1 (PCC withholding on posting)

...

MV_CC10925 = 2 or 3 (enable PCC withholding on clearance between portfolios)

...

MV_BP10925 = 1 or 2 (Net or Gross)

...

MV_BQ10925 = 1 or 2 (Net or Gross)

...

For the correct withholding of PIS, COFINS, and CSLL taxes in the Clearance Between Portfolios, the parameters MV_BP10925 and MV_BQ10925 must have consistent content (Net or Gross for both). Otherwise, the system will display the following message:

...

Image Added
Another point regarding the configuration of parameters MV_BP10925 and MV_BQ10925

...

is that, on the screen for selecting bills that will be cleared, the bills will be presented with their net

...

value

...

regardless of their configuration. These parameters affect the calculations and saving that involve partial clearing.


Information

  • To withhold the PCC of Bills Payable in routine

...

  • Clearing Between Portfolios, set parameter MV_BX10925 = 1 (at posting).
  • This implementation includes only the withholding of PCC, not of IR and ISS.
  • If the value of bill receivable is lower than the net value of the bill payable, the PCC is calculated on the cleared value (value of bill receivable).

...

...

Clearance with Income Tax on Posting

...


The Clearance between Portfolios routine performs Income Tax withholding on posting for both bills payable and bills receivable.

...


...

Important
The routine of clearance between portfolios now performs the withholding income tax on the posting contemplating cumulatively for both accounts payable and accounts receivable, as of sources with a version later than December 2021. 

06. ACCOUNTING

The booking of processes applied to an accounts payable clearance clearing via the Financials module is done through the standard entries below:

SE

Taxable Event

ON

OFF (CTBAFIN)

535

Cancellation of Bills Payable/Receivable

Clearance

Clearing

X

 

594

Accounts Payable/Receivable - Clearance Between Portfolios

X

 



07.

...

TABLES

  • SE2 - Accounts Payable Register
  • SE1 - Accounts Receivable Register
  • SE5 - Bank Transaction
  • SED - Natures Register
  • SA1 – Customers Register
  • SA2 – Suppliers Register
  • FK2 - Postings Payable
  • FK1 - Postings Receivable
  • FK6 - Accessory Values
  • FK7 - Auxiliary Table
  • FKA - Transaction Tracing


08. ENTRY POINTS

Entry point

Note

F450BROW

Entry point that allows handling field contents, and which fields will compose the browser in the

clearance

clearing between portfolios routine.

Document: 

Documentation: {+}https://tdn.totvs.com/x/p6Rc+Image Added

lFA450BU

Entry point lFA450BU allows the customer to add a button.

Document

Documentation{+}https://tdn.totvs.com/x/E6Vc+Image Added

F450ValCon

Use entry point F450ValCon to validate the data related to selected bills and to control the

clearance

clearing confirmation process, in routine Portfolios

clearance

Clearing. Executed in function FA450CMP().

Document

Documentation{+}https://tdn.totvs.com/x/haVc+Image Added

F450SE5

Entry point F450SE5 is executed after all bills selected onscreen are cleared.

Document

Documentation{+}https://tdn.totvs.com/x/GqNc+Image Added

F450OWN

 Assemble filter expression of SE1 file in IndRegua. 

Document

Documentation{+}https://tdn.totvs.com/x/FqNc+Image Added

F450FIL

Customize IndRegua filter 

Document

Documentation{+}https://tdn.totvs.com/x/nwtRCg+Image Added

F450OWN1

Assemble filter expression of SE2 file in IndRegua. 

Document

Documentation{+}https://tdn.totvs.com/x/9GASCw+Image Added

F450FIL1

Customize IndRegua filter 

Document

Documentation{+}https://tdn.totvs.com/x/ogtRCg+Image Added

F450ORDEM

 

F450GRAVA

To handle the data of the temporary table responsible for

clearance

clearing.

Document

Documentation{+}https://tdn.totvs.com/x/k422C+Image Added

F450Conf

Entry point F450CONF validates the marking of bills for

clearance

clearing.

Document

Documentation{+}https://tdn.totvs.com/x/FaNc+Image Added

F450valid

Use this entry point to validate

clearance

clearing screen data.

Document

Documentation{+}https://tdn.totvs.com/x/iaVc+Image Added

F450CAES

Entry point F450CAES validates or executes a procedure after the user confirms the Cancellation/Reversal of

clearance

clearing between portfolios.

Document

Documentation{+}https://tdn.totvs.com/x/FKNc+Image Added

F450SE1C

Entry point F450SE1C makes complementary recordings in file SE1. It requires no return and does not go through any parameter.

Document

Documentation{+}https://tdn.totvs.com/x/GKNc+Image Added

F450SE2C

Entry point F450SE2C makes complementary recordings in file SE2. It requires no return and does not go through any parameter.

Document

Documentation{+}https://tdn.totvs.com/x/GaNc+Image Added

FA450BUT

Entry point FA450BUT adds toolbar options. Its return is the button array.

Document

Documentation{+}https://tdn.totvs.com/x/vaNc+Image Added

FILEMOT

Entry point to read the text file of accounts receivable posting reasons.

Document

Documentation{+}https://tdn.totvs.com/x/IF1NDQ+Image Added