Product: | TOTVS Backoffice |
Product Line: | Protheus Line |
Industry: | Services |
Module: | TOTVS Backoffice (Protheus Line) - Fixed Assets (SIGAATF) |
Function: | ATFA380 |
Country: | Brazil |
Ticket: | Internal |
Requisite/Story/Issue | DSERCTR1-46748 |
Entry point AF380VLIN is used for validating each grid row in the Recoverable Value Adjustment routine. It allows the application of specific business rules to check and control the data entered or adjusted on the grid.
This entry point is essential to scenarios in which the data adjusted in the Recoverable Value Adjustment routine demand validations that are rigorous or customized before confirmation.
Handling of EP in the system
lRet := ExecBlock( "AF380VLIN", .F., .F.,{oGetD:aHeader,oGetD:aCols,nInc,nOpc,lEfetiva } ) |
#Include 'Protheus.ch'
//Example entry point to validate row in export or import
User Function AF380VLIN()
Local aHeaVLin := ParamIXB[1]
Local aColsVLin := ParamIXB[2]
Local nLinAt := ParamIXB[3]
Local nOpc := ParamIXB[4]
Local lEfetiva_ := ParamIXB[5]
Local lRet := .T.
Local cQuery := ""
Local aArea := GetArea()
Local cAliasQry := CriaTrab(,.F.)
Local nPosBem := aScan( aHeaVLin, {|x| Upper( AllTrim( x[2] ) ) == "NJ_BEM" } )
Local nPosItBem := aScan( aHeaVLin, {|x| Upper( AllTrim( x[2] ) ) == "NJ_ITBEM" } )
If nOpc == 7 .And. lEfetiva_ .And. nPosBem > 0 .And. nPosItBem > 0
//import with activation has to validate if the asset is not already in another simulation
cQuery := " SELECT NI_STATUS FROM "
cQuery += " SNI000 SNI, SNJ000 SNJ "
cQuery += " WHERE "
cQuery += " NI_STATUS = '1' "
cQuery += " AND SNI.D_E_L_E_T_ = ' ' "
cQuery += " AND NI_FILIAL = NJ_FILIAL "
cQuery += " AND NI_PROC = NJ_PROC "
cQuery += " AND SNJ.D_E_L_E_T_ = ' ' "
dbUseArea(.T., "TOPCONN", TcGenQry(,, cQuery ), cAliasQry, .T.,.F. )
If (cAliasQry)->( !Eof() ) //if found it returns .F. to caller
(cAliasQry)->( DbCloseArea() )
//MsgInfo("Asset : "+aColsVLin[nLinAt, nPosBem]+"/"+aColsVLin[nLinAt, nPosItBem]+" - found in another simulation, File cannot be imported.")
lRet := .F.
EndIf
EndIf
RestArea(aArea)
Return(lRet) |
|