Last active
April 9, 2019 14:52
-
-
Save vitorebatista/6d77668748b6ef224f879e13428afeed to your computer and use it in GitHub Desktop.
MNTFE290
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Exemplo de ponto de entrada do SIGAMNT para cálculo de tempo com base nos insumos de MDO realizado | |
http://tdn.totvs.com/pages/releaseview.action?pageId=6793663 | |
*/ | |
User Function MNTFE290() | |
Local cTrb := GetNextAlias() | |
cQuery := "SELECT SUM(TL_QUANTID) AS TEMPO FROM STLXXX " | |
cQuery += " INNER JOIN TT7XXX ON TT7_SOLICI = " + ValToSql(TQB->TQB_TQB_SOLICI) | |
cQuery += " WHERE TL_ORDEM = TT7_ORDEM AND TL_PLANO = TT7_PLANO AND" | |
cQuery += " TL_TIPOREG = 'M' AND TL_SEQRELA > '0'" | |
cQuery := ChangeQuery(cQuery) | |
MPSysOpenQuery( cQuery , cTrb ) | |
//Verificar se valor é numérico ou string convertendo para ficar no padrão do campo TQB_TEMPO | |
cTempo := (cTrb)->TEMPO | |
(cTrb)->(dbCloseArea()) | |
RecLock("TQB",.F.) | |
TQB->TQB_TEMPO := cTempo | |
MsUnLock() | |
Return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment