Índice | ||||||||
---|---|---|---|---|---|---|---|---|
|
Informações | ||
---|---|---|
| ||
This routine was adjusted to comply with the General Personal Data Protection Law (LGPD law No. 13.70), so that some fields containing data regarded as sensitive and/or personal are blurred, becoming illegible. |
...
Bloco de código | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
#INCLUDE "Protheus.ch" #INCLUDE "RWMAKE.CH" #INCLUDE "TBICONN.CH" Static __COMPAUT := Nil User Function CMPAUTOMA() Local lRet := .F. Local cQry := "" Local aTipos := {"NF ", "PA ", "NDF"} Local cTblTmp := "" Local aNF := {} Local aPA_NDF := {} Local aContabil := {} Local bBlock := Nil Local aEstorno := {} Local nSldComp := 0 Local nTaxaPA := 0 Local nTaxaNF := 0 Local nHdl := 0 Local nOperacao := 0 If __COMPAUT == Nil cQry := "SELECT E2_TIPO TIPO, R_E_C_N_O_ R_E_C_N_O FROM " + RetSqlName("SE2") + " " cQry += "WHERE E2_SALDO > 0 AND E2_TIPO IN (?) " cQry += "ORDER BY E2_TIPO" cQry := ChangeQuery(cQry) __COMPAUT := FWPreparedStatement():New(cQry) EndIf __COMPAUT:SetIn(1, aTipos) cQry := __COMPAUT:GetFixQuery() cTblTmp := MpSysOpenQuery(cQry) While (cTblTmp)->(!Eof()) If (cTblTmp)->TIPO $ MVPAGANT+"|"+MV_CPNEG Aadd(aPA_NDF, (cTblTmp)->R_E_C_N_O) Else Aadd(aNF, (cTblTmp)->R_E_C_N_O) EndIf (cTblTmp)->(DbSkip()) lRet := .T. EndDo (cTblTmp)->(DbCloseArea()) cTblTmp := "" If lRet Pergunte("AFI340", .F.) lContabiliza := MV_PAR11 == 1 lAglutina := MV_PAR08 == 1 lDigita := MV_PAR09 == 1 lRet := FinCmpAut(aNF, aPA_NDF, aContabil, bBlock, aEstorno, nSldComp, dDatabase, nTaxaPA ,nTaxaNF, nHdl, nOperacao) If lRet Alert("Compensation successful") Else Alert("An error occurred in the compensation process") EndIf EndIf Return |
Informações | ||
---|---|---|
| ||
To use the Automatic Accounts Payable Clearing process, call the function: FinCmpAut. Clearing can be carried out from N to N: N advances/returns (PA or NDF) for N bills (NF, DP, etc.) or vice versa. |
Use this operation to clear bills payable:
- Clearing bills from a supplier/store with advances from the same supplier/store
- Clearing bills from a given supplier with advances from the same supplier regardless of the bill receivable store
- Clear a bill from a given supplier with advances from several suppliers, in which case a supplier range or all suppliers can be established. Then, the bill can be cleared with any advance bill from the same supplier pending in the bill file, irrespective of the supplier for this bill.
...
Deck of Cards | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The booking of processes applied to an accounts payable clearing via Financials module is done through the standard entries below:
...
SE
...
Taxable Event
...
ON
...
OFF (CTBAFIN)
...
589
...
Cancellation of clearing of accounts payable bills
...
X
...
X
...
597
...
Clearing of accounts payable
...
X
...
X
Options to set parameters MV_PABRUTO, MV_BP10925, MV_PAPRIMEWhen parameter MV_PABRUTO, is equal to 2 (Net), when you generate bills of type PA (advance payment), the generation with net value is maintained, in which the tax values that can be withheld at addition are deducted. For example, when you clear a bill of type INVOICE with a PA, given that both withhold taxes at posting, for coherent values you should set the parameters below as follows:
When parameter MV_PABRUTO is equal to 1 (Gross), when you generate bills of type PA, it is generated with gross value, not deducting the tax values that can be withheld at addition. Then you must clear an Invoice with a PA by the gross value, setting parameters as follows:
|
The booking of processes applied to an accounts payable clearing via Financials module is done through the standard entries below:
SE | Taxable Event | ON | OFF (CTBAFIN) |
---|---|---|---|
589 | Cancellation of clearing of accounts payable bills | X | X |
597 | Clearing of accounts payable | X | X |
Card documentos | ||||
---|---|---|---|---|
|
Totvs custom tabs box | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||
|
Card documentos | ||||
---|---|---|---|---|
|
Informações | ||
---|---|---|
| ||
Booking of DIC type The booking of DIC type generated by clearing can be done by LP 510 - Addition of Bill Payable, because it is generated through the FINA050 (Accounts Payable) automatic routine. Booking of taxes generated when clearing. LP 597 - Clearing Payable itself can book taxes generated by clearing, through variables: NPIS340, NCOF340, NCSL340, NIRF340, NISS340. In the other cases, the booking remains unchanged, as documented below: Booking Variables FINA340NIRF340, NISS340. |
See Also:
...
Deck of Cards | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Informações | ||
---|---|---|
| ||
Upon opening the wizard NOTITSEL in reversal of clearing, validate field E5_FILORIG in clearing records and also check fields of key (Prefix+number+installment+type+supplier+store) of tables SE2 and SE5. Fields must have corresponding sizes in both tables. |
Deck of Cards | |||||||||
---|---|---|---|---|---|---|---|---|---|
| |||||||||
|