Product: | TOTVS Backoffice |
Product Line: | Microsiga Protheus Line |
Industry: | Backoffice |
Module: | TOTVS Backoffice (Protheus Line) - Financials (SIGAFIN) |
Function: | NGFJOBF75 |
Entry point NGFJOBF75 is activated at the end of the recording of a bill in table F75 through job FINA711 for the performance of complementary recordings.
#INCLUDE "totvs.ch" /*/{Protheus.doc} NGFJOBF75 Entry point for complementary recordings in F75. Example with recording rule of currency rate for bills already posted in foreign currencies. With rule to keep the contracted rate if found in bill /*/ User Function NGFJOBF75() Local cAlias As Character Local cField As Character Local dDtBaixa As Date Local nTaxa As Numeric Local aArea As Array Local aAreaAlias As Array If F75->F75_SALDO = 0 .AND. F75->F75_MOEDA > 0 aArea := GetArea() // Check the portfolio to later place the cursor on the right table (SE1 or SE2) If F75->F75_RECPAG == "R" cAlias := "SE1" cChave := F75->F75_FILORI + F75->F75_PREFIX + F75->F75_NUM + F75->F75_PARCEL + F75->F75_TIPO cField := "E1_" Else cAlias := "SE2" cChave := F75->F75_FILORI + F75->F75_PREFIX + F75->F75_NUM + F75->F75_PARCEL + F75->F75_TIPO +F75->F75_CLIFOR + F75->F75_LOJA cField := "E2_" EndIf aAreaAlias := (cAlias)->(GetArea()) DbSelectArea(cAlias) (cAlias)->(DbSetOrder(1)) If (cAlias)->(MsSeek(cChave)) If (cAlias)->&(cField + "TXMOEDA") > 0 nTaxa := (cAlias)->&(cField + "TXMOEDA") Else dDtBaixa := (cAlias)->&(cField + "BAIXA") nTaxa := RecMoeda(dDtBaixa, F75->F75_MOEDA) EndIf EndIf // Change the currency rate in field F75_TXMOED. To know more about recording this field, check the documentation //https://tdn.totvs.com.br/pages/releaseview.action?pageId=622668231 If nTaxa > 0 RecLock("F75", .F.) F75->F75_TXMOED := nTaxa F75->(MSUnlock()) EndIf RestArea(aAreaAlias) RestArea(aArea) EndIf Return NIL