Tiempo aproximado de lectura 00:03:00 min
Duda
Ejemplo de ejecución automática
Entorno
Cross Segmentos - TOTVS BackOffice (Línea Protheus) - MI - Financiero (SIGAFIN) - Todas las versiones
Solución#INCLUDE "PROTHEUS.CH"
#INCLUDE "TBICONN.CH"User Function ctGetFil() //Se utiliza para envío de cartas de cobranza a partir de una sucursal centralizadora Local aFiliais As Array aFiliais := {} If FwIsInCallStack("FINA811") aFiliais := FWAllFilial(NIL, NIL, cEmpAnt, .F.) EndIfReturn aFiliaisUser Function EXEC811() Local a811Param As Array Local cFiltro As Character Private lMsErroAuto := .F. Private lAutoErrNoFile := .F. PREPARE ENVIRONMENT EMPRESA "T1" FILIAL "D MG 01 "
cFiltro := "E1_TIPO = 'BOL' " a811Param := {} aSize(a811Param, 17) a811Param[01] := " " //De Código del cliente (tipo carácter)
a811Param[02] := " " //De Tienda del cliente (tipo carácter)
a811Param[03] := "ZZ" //A Código del cliente (tipo carácter)
a811Param[04] := "ZZZZZZ" //A Tienda del cliente (tipo carácter)
a811Param[05] := cToD("01/12/2022") //De Fecha de emisión (tipo fecha) a811Param[06] := cToD("01/12/2022") //A Fecha de emisión (tipo fecha) a811Param[07] := cToD("01/12/2022") //Fecha de referencia (tipo fecha) a811Param[08] := 0 //Valor de (tipo numérico)
a811Param[09] := 9999999 //A Valor (tipo numérico)
a811Param[10] := "1" //(tipo carácter) - IMPORTANTE: SIEMPRE 2 PARA NO PRESENTAR PANTALLA DE SELECCIÓN DE SUCURSALES
a811Param[11] := "1" //Títulos por vencer (tipo carácter donde "1" = Sí o "2" = No)
a811Param[12] := "1" //Considera valor (tipo carácter donde "1" = Total o "2" = Saldo)
a811Param[13] := "2" //(tipo carácter) - IMPORTANTE: SIEMPRE 2 PARA NO PRESENTAR PANTALLA DE SELECCIÓN DE SITUACIÓN DE COBRANZA
a811Param[14] := {} //(tipo array) - IMPORTANTE: ENVIAR ARRAY VACÍO a811Param[15] := "" //(tipo caracter) - IMPORTANTE: SIEMPRE VACÍO
a811Param[16] := "CTE001" //Código del layout de la carta que se utilizará (tipo carácter)
a811Param[17] := "1" //Considera clientes bloqueados (A1_MSBLQL) en el filtro. Se espera contenido "1" para considerar clientes bloqueados o "2" para considerar solamente clientes activos
MSExecAuto({|a,b,c,d| FINA811(a,b,c,d)}, 0, a811Param, NIL, cFiltro) If (lMsErroAuto) MostraErro() ConOut(Repl("-", 80)) ConOut(PadC("FINA460 automatic routine ended with error", 80)) ConOut(PadC("Ends at: " + Time(), 80))
ConOut(Repl("-", 80)) Else ConOut(Repl("-", 80)) ConOut(PadC("FINA460 automatic routine successfully ended", 80)) ConOut(PadC("Ends at: " + Time(), 80))
ConOut(Repl("-", 80)) EndIf RESET ENVIRONMENTReturn
0 Comentarios