211 lines
5.7 KiB
Plaintext
211 lines
5.7 KiB
Plaintext
{
|
|
---------------------------------------------------------------------------
|
|
PROGRAMA : NOPRMT026
|
|
OBJETIVO : PROCESO PARA EL PAGO DE LA TESORERIA DE LA SEGURIDAD SOCIAL
|
|
PROGRAMADOR : Ing. JUAN SOTO
|
|
FECHA REALIZACION : MAYO 31, 2005
|
|
---------------------------------------------------------------------------
|
|
}
|
|
GLOBALS
|
|
DEFINE file,rcol,arch_pc,fila_excel,prog STRING,
|
|
p_res INT,cuenta,xi SMALLINT
|
|
END GLOBALS
|
|
MAIN
|
|
DEFER INTERRUPT
|
|
CALL pago_tss()
|
|
END MAIN
|
|
|
|
FUNCTION pago_tss()
|
|
|
|
DEFINE ptss RECORD
|
|
ficha INTEGER,
|
|
nom1 VARCHAR,
|
|
apell1 VARCHAR,
|
|
apell2 VARCHAR,
|
|
sexo VARCHAR,
|
|
cedula CHAR(11),
|
|
fecha_n DATE,
|
|
valor_tss DEC(12,2),
|
|
valor_isr DEC(12,2)
|
|
END RECORD,
|
|
fecha_inicial,fecha_final DATE,
|
|
kano,kmes, cnt,numero_msg SMALLINT,
|
|
cels CHAR(40),
|
|
filename,sysos CHAR(200),
|
|
archivo1 CHAR(125),
|
|
periodo CHAR(6),
|
|
valor_boni DEC(12,2)
|
|
|
|
|
|
|
|
OPTIONS
|
|
FORM LINE 9,
|
|
ERROR LINE 24
|
|
|
|
OPEN FORM nofmmt026 FROM "nofmmt026"
|
|
DISPLAY FORM nofmmt026
|
|
|
|
INPUT BY NAME kano,kmes
|
|
|
|
|
|
IF int_flag THEN
|
|
LET numero_msg = 2
|
|
CALL msg(numero_msg)
|
|
LET int_flag = FALSE
|
|
RETURN
|
|
END IF
|
|
LET periodo = kmes USING "&&",kano USING "&&&&"
|
|
|
|
|
|
LET prog = "EXCEL"
|
|
|
|
CALL ui.Interface.frontCall("standard","getenv", ["USTSS"], [file] )
|
|
|
|
|
|
LET arch_pc='"',file,'"' -- le agrega las comillas por si hay blancos (solo se necesita para shellexec)
|
|
|
|
CALL ui.Interface.frontCall("standard","shellexec", [arch_pc], [p_res] )
|
|
CALL chqDdeError(p_res,"shellexec "||arch_pc)
|
|
|
|
CALL ui.Interface.frontCall("WINDDE","DDEConnect", [prog,file], [p_res] )
|
|
CALL chqDdeError(p_res,"DDEConnect "||file)
|
|
|
|
CALL ui.Interface.refresh()
|
|
LET periodo ='032010'
|
|
LET rcol = "C4"
|
|
LET xi = 8
|
|
CALL pru_new_dde(periodo,rcol,xi)
|
|
|
|
LET cnt = 14
|
|
|
|
LET rcol = "C2"
|
|
LET xi = cnt
|
|
CALL pru_new_dde("001",rcol,xi)
|
|
|
|
LET rcol = "C3"
|
|
LET xi = cnt
|
|
CALL pru_new_dde("C",rcol,xi)
|
|
|
|
LET ptss.cedula = '00104581939'
|
|
LET rcol = "C4"
|
|
LET xi = cnt
|
|
CALL pru_new_dde(ptss.cedula,rcol,xi)
|
|
|
|
LET ptss.nom1 = 'JUAN'
|
|
LET rcol = "C5"
|
|
LET xi = cnt
|
|
CALL pru_new_dde(ptss.nom1,rcol,xi)
|
|
|
|
LET ptss.apell1 = 'SOTO'
|
|
LET rcol = "C6"
|
|
LET xi = cnt
|
|
CALL pru_new_dde(ptss.apell1,rcol,xi)
|
|
|
|
LET ptss.apell2 = 'CONCEPCION'
|
|
LET rcol = "C7"
|
|
LET xi = cnt
|
|
CALL pru_new_dde(ptss.apell2,rcol,xi)
|
|
|
|
LET ptss.sexo = 'M'
|
|
LET rcol = "C8"
|
|
LET xi = cnt
|
|
CALL pru_new_dde(ptss.sexo,rcol,xi)
|
|
|
|
LET ptss.fecha_n = '04/01/1993'
|
|
LET rcol = "C9"
|
|
LET xi = cnt
|
|
CALL pru_new_dde(ptss.fecha_n,rcol,xi)
|
|
|
|
LET ptss.valor_tss = 2000
|
|
LET rcol = "C10"
|
|
LET xi = cnt
|
|
CALL pru_new_dde(ptss.valor_tss,rcol,xi)
|
|
|
|
|
|
LET ptss.valor_isr = 1000
|
|
LET rcol = "C12"
|
|
LET xi = cnt
|
|
CALL pru_new_dde(ptss.valor_isr,rcol,xi)
|
|
|
|
|
|
LET valor_boni = 6000
|
|
LET rcol = "C13"
|
|
LET xi = cnt
|
|
CALL pru_new_dde(valor_boni,rcol,xi)
|
|
|
|
LET cnt = cnt + 1
|
|
|
|
CALL ui.Interface.frontCall("WINDDE","DDEFinish", [prog,file], [p_res] )
|
|
CALL chqDdeError(p_res,"DDEFinish")
|
|
|
|
CALL ui.Interface.frontCall("WINDDE","DDEFinishAll", [], [p_res] )
|
|
CALL chqDdeError(p_res,"DDEFinishAll")
|
|
|
|
|
|
END FUNCTION
|
|
|
|
FUNCTION pru_new_dde(xval,xcol,i)
|
|
|
|
DEFINE celda,rval,p_cmd,arch_pc,xval,xcol STRING
|
|
DEFINE i INTEGER
|
|
|
|
|
|
|
|
LET fila_excel = "F"
|
|
LET celda = fila_excel,i USING "<<<<&",xcol CLIPPED
|
|
LET rval = xval
|
|
# CALL fgl_winmessage("PROGRAMA",prog,"stop")
|
|
# CALL fgl_winmessage("FILE",file,"stop")
|
|
CALL fgl_winmessage("CELDA",celda,"stop")
|
|
# CALL fgl_winmessage("rVAL",rval,"stop")
|
|
# CALL fgl_winmessage("P_RES",p_res,"stop")
|
|
CALL ui.Interface.frontCall("WINDDE","DDEPoke", [prog,file,celda,rval], [p_res] )
|
|
CALL chqDdeError(p_res,"DDEPoke "||celda)
|
|
|
|
{
|
|
MESSAGE "Salvando la planilla ",file CLIPPED," !"
|
|
CALL ui.Interface.refresh()
|
|
|
|
LET p_cmd="[save()]"
|
|
CALL ui.Interface.frontCall("WINDDE","DDEExecute", [prog,file,p_cmd], [p_res] )
|
|
IF p_res THEN
|
|
CALL fgl_winmessage("Planilla salvada", "Nombre = "||file, "information")
|
|
ELSE
|
|
CALL chqDdeError(p_res,"DDEExecute save")
|
|
END IF
|
|
|
|
CAL ui.Interface.frontCall("WINDDE","DDEFinish", [prog,file], [p_res] )
|
|
CALL chqDdeError(p_res,"DDEFinish")
|
|
|
|
CALL ui.Interface.frontCall("WINDDE","DDEFinishAll", [], [p_res] )
|
|
CALL chqDdeError(p_res,"DDEFinishAll")
|
|
}
|
|
END FUNCTION
|
|
|
|
|
|
FUNCTION chqDdeError(p_res,p_msg)
|
|
|
|
DEFINE p_res INTEGER,
|
|
p_msg STRING,
|
|
m_err STRING,
|
|
m_log STRING
|
|
|
|
IF p_res THEN
|
|
RETURN
|
|
END IF
|
|
|
|
CALL ui.Interface.frontCall("WINDDE","DDEError",[],[m_err])
|
|
CALL ui.Interface.frontCall("WINDDE","DDEFinishAll", [], [p_res] )
|
|
|
|
LET m_log="DDE Error: ",m_err CLIPPED," (",p_msg,")"
|
|
|
|
CALL errorlog(m_log)
|
|
|
|
LET m_log="Se ha producido un Error en '",p_msg CLIPPED,"'. Para mas detalle revise el LOG de errores."
|
|
|
|
CALL fgl_winmessage("DDE Error", m_log, "stop")
|
|
|
|
EXIT PROGRAM
|
|
|
|
END FUNCTION
|