01. GENERAL DATA
Product: | TOTVS Backoffice |
Product Line: | Microsiga Protheus Line |
Industry: | Services |
Module: | Fixed Assets - SIGAATF |
Function: | _DeprecAtivo() - FisxAtf |
Country: | Brazil |
Ticket: | 13789163 |
Requirement/Story/Issue: | DSERCTR1-36362 |
02. STATUS/REQUISITION
The call of entry point F120CUST is not executed when record F120 is saved. It is only called when record F130 is saved, in the entry of the work file record used by the Tax Records routine to generate the output file.
03. SOLUTION
We have adjusted the source code and documentation of entry point F120CUST, so it is also called when adding/handling the work record file use by the Tax Records routine to generate the output file.
Important: This entry point replaces the default saving of records in the work table related to records F120 and F130. As it is a customization, the customer is fully responsible for the data saved in the output file.
04. OTHER OTHER INFORMATION
Informações |
---|
PE F120CUST The purpose of this entry point is to replace the default saving in the record entry of the work file used by Tax Records to generate the EFD Contributions file for records F120 and F130 in the output file. Important !! The examples used in this documentation are merely illustrative and have pedagogical purposes. The operation and goal of the Entry Point is of the customer's full responsibility.
Entry Point Parameters: Order (PARAMIXB) | Parameter | Type | Description | Required | Applies to Records | 1 | cReg | Character | Block to be generated (F120/F130) | Yes | F120/F130 | 2 | cAliasTmp | Character | Alias of temporary table containing the records to be saved in the files, which can be changed through the EP | Yes | F120/F130 | 3 | cCodBem | Character | Code of fixed asset | Yes | F120/F130 | 4 | cItem | Character | Item of fixed asset | Yes | F120/F130 | 5 | cDescr | Character | Description of fixed asset | No | F120/F130 | 6 | dData | Date | File creation date | Yes | F120/F130 | 7 | cDescExt | Character | Extended description of fixed asset | No | F120/F130 | 8 | cTabOri | Character | Source table of file creation | No | F120/F130 | 9 | cNumPro | Character | Number of referenced process related to the asset | Yes | F120/F130 | 10 | cIndPro | Character | Type of referenced process related to the asset | Yes | F120/F130 | 11 | nValue | Numeric | Value to be generated in block | Yes | F120/F130 | 12 | cAliasSN1 | Character | Temporary table of SN1 (Fixed Assets) | No | F120/F130 | 13 | nBase | Numeric | Base Value | Yes | F120 | 14 | cContaC | Character | Ledger Account | Yes | F120 | 15 | cCCusto | Character | Cost Center | Yes | F120 | 16 | cOrigCred | Character | Credit Source Ind. (0=Internal Market Acq;1=External Market Acq.) | Yes | F120 | 17 | cCSTPis | Character | Tax St Code PIS | Yes | F120 | 18 | nAliqPis | Numeric | PIS Rate | Yes | F120 | 19 | cCSTCofins | Character | Tax St Code Cofins | Yes | F120 | 20 | nAliqCofins | Numeric | Cofins Rate | Yes | F120 | 21 | cIndBem | Character | Asset Identification (Table 11 SN0) | Yes | F120 | 22 | cUtilBem | Character | Asset Utilization (Table 12 SN0) | Yes | F120 | 23 | cNatBCCrd | Character | Credit BCC Code | Yes | F120 | 24 | cNotaFis | Character | Invoice | Yes | F120 | 25 | cSerNF | Character | Invoice Series | Yes | F120 | 26 | cFornec | Character | Supplier Code | Yes | F120 | 27 | cLoja | Character | Supplier Store | Yes | F120 | 28 | nVlrExcl | Numeric | Value to be deleted | Yes | F120 |
Parameters 01-12 - Apply to records F120 and F130 Parameters 13-27 - Apply to record F120 only
What the entry point must return Return | Type | Description | Mandatory | NIL | NIL | Only populates the output file |
|
Example of use:
Bloco de código |
---|
language | c# |
---|
theme | RDark |
---|
title | Example of rule |
---|
|
|
...
in use | linenumbers | true |
---|
collapse | true |
---|
| #Include 'Protheus.ch' |
|
...
...
Local cReg := paramixb[1] |
|
...
Local cAliasTmp := paramixb[2] |
|
...
Local cCodBem := paramixb[3] |
|
...
Local cItem := paramixb[4] |
|
...
Local cDescr := paramixb[5] |
|
...
Local dData := paramixb[6] |
|
...
Local cDescExt := paramixb[7] |
|
...
Local cTabOri := paramixb[8] |
|
...
Local cNumPro := paramixb[9] |
|
...
Local cIndPro := paramixb[10] |
|
...
Local nValor := paramixb[11] |
|
...
Local cAliasSN1 := paramixb[12] |
|
...
//from paramixb[13] only applies to record F120 |
|
...
Local nBase := paramixb[13] |
|
...
...
...
...
...
...
...
...
...
...
...
...
...
Local nAliqCofins :=paramixb[20] |
|
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
Local nVlrExcl := paramixb[28] |
|
...
...
...
...
...
...
...
...
...
...
...
cContaC==Nil .And. cCCusto==Nil .And. cOrigCred==Nil .And. cCSTPis==Nil .And. nAliqPis==Nil .And.; |
|
...
...
nAliqCofins==Nil .And. cIndBem==Nil .And. cUtilBem==Nil |
|
...
...
registro F120
(cAliasTmp)->(dbSetOrder(1)) |
|
...
If !(cAliasTmp)->(dbSeek(cCodBem+cItem+dtos(dData))) |
|
...
...
//Processing of complementary description of asset SN2. |
|
...
...
cDescExt := U_Atf130DExt(cCodBem,cItem) |
|
...
cDescExt := If(Empty(cDescExt),cDescr,cDescExt) |
|
...
EndIf
...
EndIf
RecLock(cAliasTmp,.T.) |
|
...
...
...
(cAliasTmp)->ITEM := cItem |
|
...
...
...
...
...
If !lNils
...
dData
If !lNils
(cAliasTmp)- |
|
...
...
cNatBCCrd
(cAliasTmp)->INDBEMIMOB := |
|
...
cIndBem
(cAliasTmp)->INDORIGCRD := |
|
...
cOrigCred
(cAliasTmp)->INDUTILBEM := |
|
...
...
...
...
...
...
...
cCSTCofins
(cAliasTmp)->ALIQCOFINS := |
|
...
...
...
...
...
cCCusto
(cAliasTmp)->DESCBEMIMO := |
|
...
EndIf
Else
...
cDescExt
EndIf
Else
RecLock(cAliasTmp,.F.) |
|
...
Endif
...
Endif
(cAliasTmp)->BASE += nBase |
|
...
...
...
...
...
...
...
(cAliasTmp)->VRET - (cAliasTmp)->VLRBCEXC |
|
...
...
...
(cAliasTmp)->(VLRBCPIS*(ALIQPIS/100)) |
|
...
(cAliasTmp)->VLRBCCOFIN := |
|
...
(cAliasTmp)->VRET - (cAliasTmp)- |
|
...
...
...
(cAliasTmp)->(VLRBCCOFIN*(ALIQCOFINS/100)) |
|
...
//fields to be used by N3-FISCAL |
|
...
personnel
(cAliasTmp)->NOTAFISCAL |
|
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
registro F130
(cAliasTmp)->(dbSetOrder(1)) |
|
...
If !(cAliasTmp)->(dbSeek(cCodBem+cItem+dtos(dData))) |
|
...
...
(cAliasTmp)->REG := "F130" |
|
...
(cAliasTmp)->NAT_BC_CRE := "09" |
|
...
(cAliasTmp)->IDENT_BEM := 05 |
|
...
(cAliasTmp)->IND_ORIG_C := cIND_ORIG_C |
|
...
(cAliasTmp)->IND_UTIL_B := 2 |
|
...
(cAliasTmp)->MES_OPER_A := Int(Val(Subs(Dtos(dData),5,2)+Subs(Dtos(dData),1,4))) |
|
...
(cAliasTmp)->VL_OPER_AQ += nValor |
|
...
(cAliasTmp)->PARC_OPER += 0 |
|
...
(cAliasTmp)->VL_BC_CRED := (cAliasTmp)->(VL_OPER_AQ-PARC_OPER) |
|
...
(cAliasTmp)->IND_NR_PAR := 0 |
|
...
(cAliasTmp)->CST_PIS := nCST_PIS |
|
...
(cAliasTmp)->ALIQ_PIS := nALIQ_PIS |
|
...
(cAliasTmp)->VL_PIS := (cAliasTmp)->(VL_BC_PIS*ALIQ_PIS/100) |
|
...
(cAliasTmp)->CST_COFINS := nCST_COFINS |
|
...
(cAliasTmp)->ALIQ_COFIN := nALIQ_COFIN |
|
...
(cAliasTmp)->VL_COFINS := (cAliasTmp)->(VL_BC_COFI*ALIQ_COFIN/100) |
|
...
(cAliasTmp)->COD_CTA := '101010100' |
|
...
(cAliasTmp)->COD_CCUS := '01' |
|
...
(cAliasTmp)->NOTAFISCAL := '' |
|
...
...
(cAliasTmp)->FORNECEDOR := '' |
|
...
...
(cAliasTmp)->NUMPRO := cNumPro |
|
...
(cAliasTmp)->INDPRO := cIndPro |
|
...
EndIf
EndIf
Return
//user function for extended description
...
EndIf
EndIf
Return
//User function for extended description
User Function Atf130DExt(cCodBem,cItem) |
|
...
...
...
...
If dbSeek(xFilial("SN2")+cCodBem+cItem+"01") |
|
...
While SN2->(!Eof() .And. N2_FILIAL+N2_CBASE+N2_ITEM+N2_TIPO==xFilial("SN2")+cCodBem+cItem+"01") |
|
...
cString += Alltrim(SN2->N2_HISTOR)+Space(1) |
|
...
...
...
...
cString := Alltrim(StrTran(cString,CRLF,' ')) |
|
...
05. RELATED SUBJECTS