Diferencia entre revisiones de «Generar Archivo de Liquidación /X (Otras Liquidaciones)»
De Wiki
(→CÓDIGO) |
|||
Línea 13: | Línea 13: | ||
===Programa "separo_otrasliq.prg"=== | ===Programa "separo_otrasliq.prg"=== | ||
+ | |||
+ | ***** | ||
+ | parameters nro_liq | ||
+ | close table all | ||
+ | set date to french | ||
+ | set talk off | ||
+ | set safe off | ||
+ | set delete on | ||
+ | SET TALK OFF | ||
+ | SET SAFETY OFF | ||
+ | SET EXCLU ON | ||
+ | SET DATE TO DMY | ||
+ | SET CENT ON | ||
+ | SET DELETED ON | ||
+ | *------------------------------------------- | ||
+ | *public v_campo,v_id,legajo,total,vm_importe | ||
+ | public vm_periodo,barra | ||
+ | *--------------armo fecha del mes | ||
+ | |||
+ | |||
+ | tabla =vm_bases_informes+"dh22" | ||
+ | if used ("dh22") | ||
+ | sele dh22 | ||
+ | use | ||
+ | endif | ||
+ | sele sele(1) | ||
+ | use &tabla excl | ||
+ | index on nro_liqui tag nro_liqui | ||
+ | |||
+ | sele per_limes,per_liano,desc_liqui from dh22 where val(nro_liq)=dh22.nro_liqui into cursor "dh22_mes" | ||
+ | sele dh22_mes | ||
+ | vm_periodo=padl(alltrim(str(per_limes)),2,"0")+right(alltrim(str(per_liano)),2) | ||
+ | barra= right(alltrim(desc_liqui),1) | ||
+ | *--------------------------------------------------------------------- | ||
+ | |||
+ | ************** | ||
+ | ***cambio la vista por el archivo debido al cambio de fuentes | ||
+ | *----abro la vista del dh21 con el | ||
+ | cadena1= "select *"; | ||
+ | + " from dh21 where nro_liqui = "+nro_liq | ||
+ | |||
+ | nom1=sys(3) | ||
+ | create sql view &nom1; | ||
+ | connection ""; | ||
+ | as &cadena1 | ||
+ | **la paso a una tabla | ||
+ | sele sele (1) | ||
+ | use &nom1 alias v_21 | ||
+ | |||
+ | |||
+ | tabla =vm_bases_informes+"dh21" | ||
+ | sele * from v_21 into table &tabla | ||
+ | |||
+ | if used ("dh21") | ||
+ | sele dh21 | ||
+ | use | ||
+ | endif | ||
+ | sele sele(1) | ||
+ | use &tabla excl | ||
+ | index on nro_legaj tag lega | ||
+ | sele v_21 | ||
+ | use | ||
+ | drop view &nom1 | ||
+ | *!* *------------------------------------------------------------------------------------ | ||
+ | |||
+ | |||
+ | *-------------------- | ||
+ | sele distinc nro_legaj,nro_cargo from dh21 into table vm_bases_informes+"cargos_liq" | ||
+ | *------------------------------------------------------------------------------------- | ||
+ | cadena2= "select * from dh03" | ||
+ | |||
+ | nom2=sys(3) | ||
+ | create sql view &nom2; | ||
+ | connection ""; | ||
+ | as &cadena2 | ||
+ | **la paso a una tabla | ||
+ | sele sele (1) | ||
+ | use &nom2 alias v_dh03 | ||
+ | tabla =vm_bases_informes+"dh03_"+barra+vm_periodo | ||
+ | nom_base="dh03_"+barra+vm_periodo | ||
+ | sele * from v_dh03 into table &tabla | ||
+ | |||
+ | |||
+ | |||
+ | *!* ************armo archivo de liq******* | ||
+ | select * from cargos_liq as c,&nom_base as d3 where c.nro_cargo=d3.nro_cargo ; | ||
+ | into table vm_bases_informes+"dh03_liq"+barra+vm_periodo | ||
+ | |||
+ | nom_base_d3d8="dh03_liq"+barra+vm_periodo | ||
+ | select d21.*,codc_categ,codc_carac,fec_alta,fec_baja,hs_dedic," " as barra from &nom_base_d3d8; | ||
+ | as c,dh21 as d21 where c.nro_cargo_=d21.nro_cargo ; | ||
+ | into table vm_bases_informes+"dh21_"+barra+vm_periodo | ||
+ | *!* ******************cruzo con dh03 | ||
+ | *--copio a transacciones el archivo de contratos | ||
+ | nom_base_dh21="dh21_P"+vm_periodo | ||
+ | sele &nom_base_dh21 | ||
+ | repla all barra with "P" | ||
+ | *copy to "t:\liquidaciones\"+vm_periodo+"\"+nom_base_dh21 | ||
+ | *copy to "t:\liquidaciones\"+vm_periodo+"\"+"dh03_liq"+barra+vm_periodo | ||
+ | |||
+ | copy to "t:\liquidaciones\"+"1211"+"\"+nom_base_dh21 | ||
+ | copy to "t:\liquidaciones\"+"1211"+"\"+"dh03_liq"+barra+vm_periodo | ||
+ | |||
+ | *-- | ||
+ | |||
+ | *---------------------------------- | ||
+ | |||
===Botón "Aceptar" (cmd_aceptar)=== | ===Botón "Aceptar" (cmd_aceptar)=== | ||
+ | if thisform.lvwliq.selecteditem.index <> 0 | ||
+ | v_fila= thisform.lvwliq.selecteditem.index | ||
+ | messagebox(str(v_fila)) | ||
+ | nro_liq=thisform.lvwliq.listitems(v_fila).text | ||
+ | nom_liq=thisform.lvwliq.listitems(v_fila).SUBITEMS(1) | ||
+ | messagebox(nro_liq + " " + NOM_LIQ ) | ||
+ | endif | ||
+ | programa=vm_programas + "separo_otrasliq.prg" | ||
+ | do &programa with nro_liq | ||
===Botón "Salir" (Salir)=== | ===Botón "Salir" (Salir)=== | ||
− | + | set filter to | |
+ | close tables all | ||
+ | thisform.release | ||
==MANUAL DEL USUARIO== | ==MANUAL DEL USUARIO== |
Revisión del 13:54 13 feb 2012
Contenido
FORMULARIO
frm_separo_otrasliq.scx
INFORME
Esta aplicación no genera Reportes.
CÓDIGO
Programa "separo_otrasliq.prg"
***** parameters nro_liq close table all set date to french set talk off set safe off set delete on SET TALK OFF SET SAFETY OFF SET EXCLU ON SET DATE TO DMY SET CENT ON SET DELETED ON *------------------------------------------- *public v_campo,v_id,legajo,total,vm_importe public vm_periodo,barra *--------------armo fecha del mes tabla =vm_bases_informes+"dh22" if used ("dh22") sele dh22 use endif sele sele(1) use &tabla excl index on nro_liqui tag nro_liqui sele per_limes,per_liano,desc_liqui from dh22 where val(nro_liq)=dh22.nro_liqui into cursor "dh22_mes" sele dh22_mes vm_periodo=padl(alltrim(str(per_limes)),2,"0")+right(alltrim(str(per_liano)),2) barra= right(alltrim(desc_liqui),1) *--------------------------------------------------------------------- ************** ***cambio la vista por el archivo debido al cambio de fuentes *----abro la vista del dh21 con el cadena1= "select *"; + " from dh21 where nro_liqui = "+nro_liq nom1=sys(3) create sql view &nom1; connection ""; as &cadena1 **la paso a una tabla sele sele (1) use &nom1 alias v_21 tabla =vm_bases_informes+"dh21" sele * from v_21 into table &tabla if used ("dh21") sele dh21 use endif sele sele(1) use &tabla excl index on nro_legaj tag lega sele v_21 use drop view &nom1 *!* *------------------------------------------------------------------------------------ *-------------------- sele distinc nro_legaj,nro_cargo from dh21 into table vm_bases_informes+"cargos_liq" *------------------------------------------------------------------------------------- cadena2= "select * from dh03" nom2=sys(3) create sql view &nom2; connection ""; as &cadena2 **la paso a una tabla sele sele (1) use &nom2 alias v_dh03 tabla =vm_bases_informes+"dh03_"+barra+vm_periodo nom_base="dh03_"+barra+vm_periodo sele * from v_dh03 into table &tabla *!* ************armo archivo de liq******* select * from cargos_liq as c,&nom_base as d3 where c.nro_cargo=d3.nro_cargo ; into table vm_bases_informes+"dh03_liq"+barra+vm_periodo nom_base_d3d8="dh03_liq"+barra+vm_periodo select d21.*,codc_categ,codc_carac,fec_alta,fec_baja,hs_dedic," " as barra from &nom_base_d3d8; as c,dh21 as d21 where c.nro_cargo_=d21.nro_cargo ; into table vm_bases_informes+"dh21_"+barra+vm_periodo *!* ******************cruzo con dh03 *--copio a transacciones el archivo de contratos nom_base_dh21="dh21_P"+vm_periodo sele &nom_base_dh21 repla all barra with "P" *copy to "t:\liquidaciones\"+vm_periodo+"\"+nom_base_dh21 *copy to "t:\liquidaciones\"+vm_periodo+"\"+"dh03_liq"+barra+vm_periodo copy to "t:\liquidaciones\"+"1211"+"\"+nom_base_dh21 copy to "t:\liquidaciones\"+"1211"+"\"+"dh03_liq"+barra+vm_periodo *-- *----------------------------------
Botón "Aceptar" (cmd_aceptar)
if thisform.lvwliq.selecteditem.index <> 0 v_fila= thisform.lvwliq.selecteditem.index messagebox(str(v_fila)) nro_liq=thisform.lvwliq.listitems(v_fila).text nom_liq=thisform.lvwliq.listitems(v_fila).SUBITEMS(1) messagebox(nro_liq + " " + NOM_LIQ ) endif programa=vm_programas + "separo_otrasliq.prg" do &programa with nro_liq
Botón "Salir" (Salir)
set filter to close tables all thisform.release
MANUAL DEL USUARIO
Procedimiento no disponible
Procedimiento de Uso
Procedimiento no disponible