Histórico da Página
Ponto de Entrada
Descrição: | Este ponto de entrada está localizado nas rotinas Orc. por Fases (OFIXA011) e Painel Orçamento (OFIXA018). Ele é executado no momento em que o usuário tenta incluir uma nova linha/item de peças. A finalidade deste ponto de entrada é realizar uma validação nas informações dos campos que compõem este item. |
Parâmetros: | N/A |
Eventos: | /* =============================================================================== ############################################################################### ##+----------+------------+-------+-----------------------+------+----------+## ##|Função |OX001LINPOK | Autor | Manoel | Data | 20/05/09 |## ##+----------+------------+-------+-----------------------+------+----------+## ##|Descrição | Verifica a linha das aCols de pecas |## ##+----------+--------------------------------------------------------------+## ############################################################################### =============================================================================== */ Function OX001LINPOK() Local nCntFor := 0 Local nValSeq := 0 Local lTudoBranco := .t. Local nLinDup
Local nVS3SEQUEN := FG_POSVAR("VS3_SEQUEN","aHeaderP") Local nVS3GRUITE := FG_POSVAR("VS3_GRUITE","aHeaderP") Local nVS3CODITE := FG_POSVAR("VS3_CODITE","aHeaderP") Local nVS3QTDPED := FG_POSVAR("VS3_QTDPED","aHeaderP") Local nVS3QTDINI := FG_POSVAR("VS3_QTDINI","aHeaderP") // If lPediVenda .and. VS1->(FieldPos("VS1_PEDREF")) > 0 .and. !Empty(M->VS1_PEDREF) .and. GetNewPar("MV_MIL0011","0") == "1" MsgAlert(STR0272,STR0025) return .f. Endif // if lOX001Auto AADD(oGetPecas:aCols,aCols[n]) // OX001RefNF() // for nCntFor := 1 to Len(aCols[n]) - 1 &("M->"+aHeaderP[nCntFor,2]):= aCols[Len(oGetPecas:aCols),nCntFor] __ReadVar := "M->"+aHeaderP[nCntFor,2] oGetPecas:nAt := Len(oGetPecas:aCols) n := Len(oGetPecas:aCols) OX001FPOK(,,.f.) next endif // ############################################################ // # Pula registros deletados # // ############################################################ If oGetPecas:aCols[oGetPecas:nAt,len(oGetPecas:aCols[oGetPecas:nAt])] Return .t. EndIf // ############################################################ // # Verifica se a peca realmente existe # // ############################################################ cPeca := oGetPecas:aCols[oGetPecas:nAt,nVS3CODITE] cGrupo := oGetPecas:aCols[oGetPecas:nAt,nVS3GRUITE] // if Empty(cPeca) .and. Empty(cGrupo) return .t. //<<--- Problema da linha vazia na acols de pecas endif // #################################################################### // Ponto de Entrada para validacao das linhas do acols dos itens pecas // #################################################################### If ( ExistBlock("OX001LKP") ) lRet := ExecBlock("OX001LKP",.F.,.F.,{lRet}) If !lRet return .f. EndIf EndIf // DBSelectArea("SB1") DBSetOrder(7) if !DBSeek(xFilial("SB1")+cGrupo+cPeca) if !lOX001Auto MsgInfo(STR0050,STR0025) endif return .f. endif |
Programa Fonte: | OFIXX001.PRW |
Função: | OX001LINPOK |
Retorno: | lRet - Booleano - Continua(.t.) ou Aborta(.f.) |
Exemplo:
User Function OX001LKP ()
lRet := MsgYesNo(“Deseja inserir uma nova peça?”,”Atenção!”)
Return lRet