Product: | TOTVS Backoffice |
Product Line: | Protheus Line |
Industry: | Services |
Module: | TOTVS Backoffice (Protheus Line) - Fixed Assets (SIGAFIS) |
Function: | ATFA251 |
Country: | Brazil |
Ticket: | Internal |
Requisite/Story/Issue | DSERCTR1-46030 |
Entry point AF251RIMP is called by routine AF251RatInf to allow adding new taxes to be used during the asset apportionment process. It receives the existing tax array and returns an array with new items or adjustments in taxes already calculated. This facilitates the adding of specific taxes, such as PIS and COFINS, which you may need for calculating apportionment values. The entry point validates the data types and hinders the duplication of records for the same tax type.
aRetImp := ExecBlock( 'AF251RIMP', .F., .F., aClone(aAF251Imp) ) If ValType( aRetImp ) == 'A' For nA := 1 To Len( aRetImp ) // Check whether all data types are correct and whether // the same line returned in array aAF251Imp does not exist If Len( aRetImp[nA] ) == 6 .and.; ValType(aRetImp[nA,1]) == 'C' .and.; ValType(aRetImp[nA,2]) == 'C' .and.; ValType(aRetImp[nA,3]) == 'N' .and.; ValType(aRetImp[nA,4]) == 'L' .and.; ValType(aRetImp[nA,5]) == 'N' .and.; ValType(aRetImp[nA,6]) == 'N' .and.; !('ICMS' $ Upper(aRetImp[nA,1]) ) nPosImp := aScan( aAF251Imp, {|Imp| Imp[1] == aRetImp[nA,1] .and. Imp[2] == aRetImp[nA,2] .and.; Imp[3] == aRetImp[nA,3] .and. Imp[4] == aRetImp[nA,4] } ) If nPosImp == 0 Aadd( aAF251Imp, aClone( aRetImp[nA] ) ) Else aAF251Imp[nPosImp][5] += aRetImp[nA][5] aAF251Imp[nPosImp][6] += aRetImp[nA][6] EndIF EndIf Next nA EndIf
User Function AF251RIMP() Local aAF251Imp := PARAMIXB[1] // Add a new tax item for PIS AAdd( aAF251Imp , {"PIS","1",201,.T.,500.00,0}) // Add a new tax item for COFINS AAdd( aAF251Imp , {"COFINS","1",202,.T.,1000.00,0}) Return aAF251Imp
Important !!