Linha de Produto: | Microsiga Protheus | ||||||||
Segmento: | Manufatura | ||||||||
Módulo: | SIGAMNT - Manutenção de Ativos e Gestão de Frotas | ||||||||
Rotina: |
| ||||||||
País(es): | Todos | ||||||||
Banco(s) de Dados: | Todos | ||||||||
Sistema(s) Operacional(is): | Todos |
Descrição: | Ponto de entrada executado na rotina de Árvore (MNTA902) que valida a inclusão de um novo bem | ||||||||
Programa Fonte: | MNTA902.prx | ||||||||
| Localização: | SIGAMNT: Atualizações/Controle de Oficina/Árvore/Árvore | ||||||||
Função: | MNTA9023() | ||||||||
Retorno: |
|
#Include 'Protheus.ch'
User Function MNTA9023()
Local lFOUND := .F., cPAI := ""
Local lCatBem := NGCADICBASE('T9_CATBEM','A','ST9',.f.)
Local lRet := .T.
LECONTEDO := .F.
cPAI := Alltrim(cPAI)
Private cItem := cCodBem
ST9->(Dbseek(xFILIAL('ST9')+cPAI))
dDTIMPL := ST9->T9_DTCOMPR
M->T9_CATBEM := If(lCatBem,ST9->T9_CATBEM,Space(1))
If !lFOUND
Dbselectarea("STC")
Dbsetorder(3)
lFOUND := Dbseek(xFILIAL('STC')+cITEM)
Dbsetorder(1)
EndIf
If !lFOUND
xx := cPAI
Dbselectarea("STC")
Dbsetorder(2)
While .T.
If Dbseek(xFILIAL('STC')+xx)
If STC->TC_CODBEM == cITEM
lFOUND := .T.
Exit
Endif
Else
Exit
Endif
If XX == STC->TC_COMPONE
Exit
Endif
xx := STC->TC_COMPONE
End
Dbsetorder(1)
Endif
If lFOUND .And. STC->TC_CODBEM <> cITEM
MsgInfo("Bem está vinculado no cadastro de estrutura de bens ao TAG "+Alltrim(STC->TC_CODBEM)+" , portanto, não poderá"+;
" ser inserido diretamente na árvore.Caso queira que este bem seja apresentado na árvore, será necessario que seja"+;
" incluído o TAG ao qual o bem pertence.","ATENÇÃO")
lRet := .F.
Endif
Return lRet |