Páginas filhas
  • Advances - Financial - P12

01. OVERVIEW

Advances (FINA667) are the amounts credited to employees to cover the costs of a trip, such as food, transportation, communication, etc.

These values are calculated through the configuration of the company's travel policy, which can be:

  1. Fixed Amount: This is the fixed amount granted, usually for the transfer fee.
  2. Amount with or without Overnight Stay: When the trip has a period within the same day, the amount of the advance without an overnight stay is calculated; if it exceeds a daily rate, it will be calculated with the amount with overnight stay.
  3. Other currencies: Amounts in other currencies are usually granted by credit on traveler checks or currency purchase. For this case, Protheus does not make the calculation, but the credit amount of this advance must be informed. The conversion rates for the purchase of this currency into strong currency can be informed before or after the generation of the bill by configuring it in the Configuration Wizard.

In the Travel routine (FINA665), it is still possible to request advance complements. If an employee needs more money on a trip, this request can be made by selecting the trip and the option Individual Advance Payment. In this case, an additional advance linked to the trip is generated.

The bill generation rules, such as Prefix, Class, Due Date for regular and urgent advances (those requested outside the advance policy rule) are in the Configuration Wizard.

Advances requested either via Reserve, Travel Request or individually are not approved together with the trip and generate a pending issue for the superior of the traveler, if configured.

Example:

If the superior's approval and financial evaluation is necessary, we have:

Or, we will have the following scenarios if a step can be performed automatically:

Tip

The advance is accounted for by the standard entry of a bill.

For cases in which the advance is in another currency and the rate informed after the bill is generated, it must be accounted for offline.

Attention

This process is not mandatory.

02. EXAMPLE OF USE

The advance can be generated from the travel request (FINA666) by selecting this option on the Advances tab:


image2019-7-8_15-12-37.png


Or after the Trip has already been sent to the travel department (FINA665) by clicking on the "Request Advance” and selecting the participants that will received the advance:



Then, through the routine FINA667, the advance can be viewed, and follow its flow of actions:


03. AUTOMATIC ROUTINE

To execute the automatic routine, we illustrate the request for the advance after the trip is completed (MyFA667A), in the following example:

Example of automatic routine execution
#INCLUDE "PROTHEUS.CH"
#INCLUDE "FWMVCDEF.CH"

//---------- Travel advance request ----------//
User Function MyFA667A()

Local aKeyFLC := {}
Local aUser := {}
Local oModel := Nil
Local oModelFLC := Nil
Local oModelFLD := Nil
Local cViagem := "0000000001"
Local cPartic := "000002"

RpcSetEnv("T1","D MG 01 ","claudio.ribeiro","1") // Starts environment with requesting user

dbSelectArea("FL5")
dbSetOrder(1)
dbSeek(xFilial("FL5")+cViagem) // Travel already requested

// Load data model with travel request positioned
oModel := FWLoadModel("FINA667A")
oModelFLC := oModel:GetModel("FLCDETAIL") // Participants
oModelFLD := oModel:GetModel("FLDDETAIL") // Advances
// Participant search key within the travel
aKeyFLC := { {"FLC_FILIAL",xFilial("FLC")},{"FLC_VIAGEM",cViagem},{"FLC_PARTIC",cPartic} }

oModel:SetOperation(MODEL_OPERATION_UPDATE)
oModel:Activate()
If FINXUser(RetCodUsr(),aUser,.T.)
     // Participant that will receive the advance
     If oModelFLC:SeekLine(aKeyFLC)
          oModelFLC:SetValue("OK",.T.)
          oModelFLD:LoadValue("FLD_DTSOLI",dDatabase)
          oModelFLD:LoadValue("FLD_DTPREV",DataValida(dDatabase+3))
          oModelFLD:LoadValue("FLD_SOLIC" ,aUser[1])
          oModelFLD:LoadValue("FLD_NOMESO",PadR(aUser[2],TamSx3("FLD_NOMESO")[1]))
          oModelFLD:SetValue("FLD_VALOR",400)
          oModelFLD:SetValue("FLD_MOEDA","1")
          oModelFLD:SetValue("FLD_JUSTIF","Advance for traveller")
          // Validation and recording of data, if consistent
          If oModel:VldData()
               oModel:CommitData()
               Conout("Advance requested successfully.")
          Else 
               VarInfo("",oModel:GetErrorMessage())
               Conout("Validation error, advance not requested.")
         EndIf
     Else
          Conout("Traveler not found in this trip.")
     EndIf
EndIf

oModel:DeActivate()
oModel:Destroy()
RpcClearEnv()

Return



04. TABLES USED

  • FL5 - Travel
  • FLC - Passengers
  • FLD - Advances