#INCLUDE "Protheus.ch"
User Function MyATF036()
Local aArea := GetArea()
Local cBase := "0000000005"
Local cItem := "0001"
Local cTipo := "01"
Local cTpSaldo := "1"
Local cBaixa := "0"
Local nQtdAtu := 1
Local nQtdBaixa := 1
Local cMotivo := "08"
Local cMetDepr := GetMV('MV_ATFDPBX')
Local cNumNF := ""
Local cSerieNF := ""
Local nValNF := 0
Local aCab := {}
Local aAtivo := {}
Local aParam := {}
Private lMsErroAuto := .F.
Private lMsHelpAuto := .T.
aCab := { {"FN6_FILIAL" ,XFilial("FN6") ,NIL},;
{"FN6_CBASE" ,cBase ,NIL},;
{"FN6_CITEM" ,cItem ,NIL},;
{"FN6_MOTIVO" ,cMotivo ,NIL},;
{"FN6_BAIXA" ,100 ,NIL},;
{"FN6_QTDBX" ,nQtdBaixa ,NIL},;
{"FN6_DTBAIX" ,dDatabase ,NIL},;
{"FN6_DEPREC" ,cMetDepr ,NIL}}
aAtivo := {{"N3_FILIAL" ,XFilial("SN3") ,NIL},;
{"N3_CBASE" ,cBase ,NIL},;
{"N3_ITEM" ,cItem ,NIL},;
{"N3_TIPO" ,cTipo ,NIL},;
{"N3_BAIXA" ,cBaixa ,NIL},;
{"N3_TPSALDO" ,cTpSaldo ,NIL}}
//Array containing F12 parameters
aAdd( aParam, {"MV_PAR01", 1} ) //Question 01 - Display Accounting Entry? 1 = Yes ; 2 = No
aAdd( aParam, {"MV_PAR02", 2} ) //Questioin 02 - Group Accounting Entry? 1 = Yes ; 2 = No
aAdd( aParam, {"MV_PAR03", 1} ) //Question 03 - Online Booking? 1 = Yes ; 2 = No
aAdd( aParam, {"MV_PAR04", 2} ) //Question 04 - Viewing? 2 = Asset Types // requires use of number 2
Begin Transaction
MsExecAuto({|a,b,c,d,e,f|ATFA036(a,b,c,d,e,f)},aCab,aAtivo,3,,.T./*lBaixaTodos*/,aParam)
If lMsErroAuto
MostraErro()
DisarmTransaction()
EndIf
End Transaction
RestArea(aArea)
Return