TTQHG1_DT_AF380VLIN_Valida_linha_acerto_VLR_RECUPERAVEL

TTQHG1_DT_AF380VLIN_Valida_linha_acerto_VLR_RECUPERAVEL

Requirement Characteristics 

Product Line:

Microsiga Protheus

Industry:

Services

Module:

Fixed Asset

Routine:

Routine

Technical Name

ATFA380.PRW

Recoverable Value Adjustment

Entry Point:

AF380VLIN

Related Tickets

TTQHG1

Countries:

All

Database:

All

Tables Used:

SNI/SNJ

Operating Systems:

All

Versions/Release:

12.1.6

Description

The entry point AF380VLIN validates the grid row in the recoverable value adjustment routine.

Entry Point

Description:

The entry point AF380VLIN validates the grid row in the recoverable value adjustment routine.

Events:

AF380VLIN

Source Program:

ATFA380.PRW

Function:

Af380GrvWz()

Return:

Name

Type

Description

lRet

 L

 Returns .T. or .F.

Parameter:

Name

Type

Description

Mandatory

 aHeader

 A

 Grid Header

 

 aCols

 A

 Grid Rows

 

 nLin

 N

 Row position

 

nOpcAux

N

3-Add
4-Edit
5-Delete
6-Export
7-Import

 

lEfetiva

L

.T. - Activate
.F.- Simulate

 

Example:

#Include '[<span style="color: #0000ee"><span style="text-decoration: underline; ">Protheus.ch</span></span>|http://protheus.ch/]'
//Example entry point to validate row in export or import
User Function AF380VLIN()
Local aHeader__ := ParamIXB\[1\]Local aCols__ := ParamIXB\[2\]Local nLinAt__ := ParamIXB\[3\]Local nOpcAux__ := ParamIXB\[4\]Local lEfetiva_ := ParamIXB\[5\]Local lRet := .T.Local cQuery := ""Local aArea := GetArea() Local cAliasQry := CriaTrab(,.F.)Local nPosBem := aScan( aHeader__, \{|x| Upper( AllTrim( x\[2\] ) ) == "NJ_BEM" \} )
Local nPosItBem := aScan( aHeader__, \{|x| Upper( AllTrim( x\[2\] ) ) == "NJ_ITBEM" \} )
If nOpcAux__ == 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 += RetSqlName("SNI")+" SNI, "+RetSqlName("SNJ")+" SNJ "cQuery += " WHERE "cQuery += " NI_FILIAL = '"+xFilial("SNI")+"' "cQuery += " AND 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 NJ_BEM = '"+aCols__\[nLinAt__, nPosBem\]+"'"cQuery += " AND NJ_ITBEM = '"+aCols__\[nLinAt__, nPosItBem\]+"'"cQuery += " AND SNJ.D_E_L_E_T_ = ' ' "
dbUseArea(.T., "TOPCONN", TcGenQry(,, cQuery ), cAliasQry, .T.,.F. )
If (cAliasQry)->( !Eof() ) //if found, returns .F. to the caller    (cAliasQry)->( DbCloseArea() )   MsgInfo("Asset : "+aCols__\[nLinAt__, nPosBem\]+"/"+aCols__\[nLinAt__, nPosItBem\]+" - found in a different simulation, file cannot be imported.")   lRet := .F.EndIfEndIf
RestArea(aArea)
Return(lRet)
!worddavaf485e25f57cd86bb5b0fc63f3f1b1cc.png|height=32,width=32!