Punto de Entrada
Descripción: | Punto de Entrada para alteraciones antes de visualizar el Browse |
Ubicación: | |
Eventos: | Lanzamientos Contables Automaticos |
Programa Fuente: | CT102DLG |
Función: | CTBA102/CTBA105 |
Respuesta: | |
Ejemplo:
#Include "Protheus.ch"
User Function CT102DLG()
Local nCred := Iif(ValType(oCred:cText) == "N",oCred:cText,Val(oCred:cText))
Local nDeb := Iif(ValType(oDeb:cText) == "N",oDeb:cText,Val(oDeb:cText))
Local nDif := (nCred * -1) + nDeb
Local nX := 0
Local nLinea := oGetDb:nCount
For nX := 1 To ABS(nDif)
nLinea += 1
RecLock("TMP", .T.)
TMP->CT2_LINHA := StrZero(nLinea,Len(TMP->CT2_LINHA))
If nDif>0
nCred += 1
TMP->CT2_DC := "2"
TMP->CT2_CREDIT := "000002"
Else
nDeb += 1
TMP->CT2_DC := "1"
TMP->CT2_DEBITO := "000001"
EndIf
TMP->CT2_VALOR := 1
TMP->CT2_HIST := "AJUSTE PESOS"
TMP->CT2_TPSALD := "1"
MsUnlock()
Next nX
oGetDb:nCount := nLinea
oCred:cText := Iif(ValType(oCred:cText) == "N",nCred,AllTrim(STR(nCred)))
oDeb:cText := Iif(ValType(oDeb:cText) == "N",nDeb,AllTrim(STR(nDeb)))
oDig:cText := Iif(ValType(oDig:cText) == "N",nDeb + nCred,AllTrim(STR(nDeb + nCred)))
Return