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 realiza a adição de itens na Árvore Lógica | ||||||||||||
Programa Fonte: | MNTA902.prx | ||||||||||||
| Localização: | SIGAMNT: Atualizações/Controle de Oficina/Árvore/Árvore | ||||||||||||
Função: | MNTA9028() | ||||||||||||
| Parâmetros: |
| ||||||||||||
Retorno: | .T. |
#Include 'Protheus.ch'
User Function MNTA9028()
Local cCodItem := PARAMIXB[1]
Local cCargo := PARAMIXB[2]
Local aArea := GetArea()
Local cCodEst := "001"
Local nRecTRB := (cTRBSGA)->(Recno()), nIndTRB := (cTRBSGA)->(IndexOrd())dbSelectArea(cTRBSGA)dbSetOrder(2)
If dbSeek(cCodEst+cCodItem+cFilAnt)
If (cTRBSGA)->TIPO == "1"
dbSelectArea("ST9")
dbSetOrder(1)
If dbSeek(xFilial("ST9")+Trim((cTRBSGA)->CODTIPO)) .and. ST9->T9_CATBEM == "2"//Frota integrada ao TMS
dbSelectArea("DA3")
dbSetOrder(1)
If dbSeek(xFilial("DA3")+ST9->T9_CODTMS)
If !Empty(DA3->DA3_MOTORI)
cCodNiv := Soma1Old(AllTrim(cCodNiv))
DbSelectArea(cTRBSGA)
RecLock(cTRBSGA,.t.)
(cTRBSGA)->FILIAL := cFilAnt
(cTRBSGA)->CODEST := cCodEst
(cTRBSGA)->CODPRO := cCodNiv
(cTRBSGA)->DESCRI := DA3->DA3_MOTORI+" - "+NGSEEK("DA4",DA3->DA3_MOTORI,1,"DA4->DA4_NOME")
(cTRBSGA)->NIVSUP := cCodItem
(cTRBSGA)->TIPO := "M"
(cTRBSGA)->CODTIPO := DA3->DA3_MOTORI
(cTRBSGA)->MODMNT :="X"
(cTRBSGA)->ORDEM := cCodNiv
(cTRBSGA)->CARGO :="MOT"
MsUnlock(cTRBSGA)
//Atualiza Arvore Logica
oTree:AddItem((cTRBSGA)->DESCRI,cCodNiv+"MOT"+cFilAnt,"NG_FUNCIONARIO","NG_FUNCIONARIO",,, 2)
oTree:Refresh()
Endif
Endif
Endif
Endif
Endif
//Retorna item
oTree:TreeSeek(cCodItem+cCargo+cFilAnt)
If nRecTRB > 0
dbSelectArea(cTRBSGA)
dbSetOrder(nIndTRB)
dbGoTo(nRecTRB),
Endif
RestArea(aArea)
Return .T. |