Páginas filhas
  • Automatic Routine ATFA030 - Assets Posting


Function: Automatic Routine ATFA030 - Assets Posting


Scope:

Microsiga Protheus 11, Protheus 10

Versions:

Protheus 10

Compatible Countries:

All

Operating Systems:

All

Compatible with the following Databases:

All

Access Level:

Level 1 (Customer Access)

Languages:

Brazilian Portuguese, European Portuguese, Spanish, English


Description:

This routine enables the automatic posting of Assets.

Source Program:

atfa030.prw

Syntax:

MSExecAuto({|x, y, z | AtfA030(x, y, z )},aDadosAuto, nOpc , aParamAuto)


Parameters:

NameTypeDescription
aDadosAutoArrayArray containing header fields (SN3).
nOpcArray

4- Posting

5- Cancellation

aParamAutoArrayArray containing answers to Question (SX1) of routine


Examples

User Function  MyATFA030()

Local aDadosAuto := {}        // Array with data to be sent by MsExecAuto() for automatic recording

Local aParamAuto := {}

Private lMsHelpAuto := .f.    // Determine whether help messages must be directed to log file

Private lMsErroAuto := .f.    // Determine whether any inconsistency occurred when running routine in relation to entered parameters


aDadosAuto:= {    {'N3_CBASE'   , "0000000070"    , Nil},;    // Base code of asset.

{'N3_ITEM'    , "0001"            , Nil},;    // Sequential item of base code of asset.

{'AUTDTBX' , CTOD("30/11/11"), Nil},;    // Enter actual date of Asset posting.

{'AUTMOTBX' , "01", Nil},;    // Enter reason for posting. You can edit the reasons table in routine Table in module Configurator (table 16).

{'AUTNOTA' , "Nota 10", Nil},;    // Invoice Number. You must enter it if asset sale.

{'AUTSERIE' , "3 Serie C", Nil},;    // Invoice Series.

{'AUTQUANT' , 1, Nil},;    // Posting quantity. If the posting is by value, you must enter 0(zero).If by quantity, the value is    proportioned by the quantity posted.

{'AUTPERCBX' , 100, Nil},;    // Percentage of asset to be posted.

{'AUTBXFILHOS' , .F., Nil},;    // Indicates whether the children must be posted

{'AUTVLRVENDA' , 1, Nil}}    // If a sale of an asset, enter the value of its sale.


// Parameters of questions of routine atfa030

aAdd( aParamAuto, {"MV_PAR01", 2} ) //Question 01 - Mostra Lanc.Contab ? 1 = Sim   ; 2 = Não

aAdd( aParamAuto, {"MV_PAR02", 1} ) //Pergunta 02 - Aglutina Lançamento Contabil ? 1 = Sim   ; 2 = Não


MSExecAuto({|x, y, z | AtfA030(x, y, z )},aDadosAuto, 4 , aParamAuto)


If lMsErroAuto

    lRetorno := .F.

    MostraErro()

Else

    lRetorno:=.T.

EndIf

Return