720 lines
23 KiB
Plaintext
720 lines
23 KiB
Plaintext
{
|
|
-------------------------------------------------------------------------------
|
|
PROGRAMA : EDPRRP049
|
|
OBJETIVO : Listar las Entrada de Diario Pilas Vendidas
|
|
PROGRAMADOR : Tadeo A. Ferreras
|
|
FECHA REALIZACION : Julio 28, 1993
|
|
MODIFICACION : LA ENTRADA ESTA DIRECCIONADA HACIA EL DEPARTAMENTO
|
|
4102. PONER QUE SALGA LAS VENTAS DE RAYOVAC A 4101 Y
|
|
LAS VENTAS DE DISTRIBUIDORA 4102.
|
|
MOFICADO POR : JUAN F. SOTO
|
|
FECHA MODIFICACION : ABRIL 5, 1995
|
|
-------------------------------------------------------------------------------
|
|
}
|
|
DATABASE rayovac
|
|
GLOBALS
|
|
DEFINE arr_entrada ARRAY[8] OF RECORD
|
|
cuenta_no LIKE cgtb00001.cuenta_no,
|
|
depto LIKE cgtb00004.departamento,
|
|
debito LIKE cgtb00004.debito,
|
|
credito LIKE cgtb00004.credito
|
|
END RECORD
|
|
|
|
DEFINE primera,salir CHAR(1)
|
|
DEFINE select_ac,select_ant,select_p CHAR(1000)
|
|
DEFINE idx_ac,ano,idx_a,idx_c SMALLINT
|
|
DEFINE ano_act,c_ano CHAR(4)
|
|
DEFINE fecha_2 CHAR(8)
|
|
DEFINE fecha_ini_per CHAR(8)
|
|
|
|
DEFINE acumulado_a RECORD
|
|
cod_mov LIKE intb00005.cod_mov,
|
|
cod_n SMALLINT,
|
|
cod_grupo SMALLINT,
|
|
cod_Tipo SMALLINT,
|
|
cod_Sec SMALLINT,
|
|
consumo LIKE iptb00006.cantidad_2,
|
|
material LIKE iptb00004.material,
|
|
labor LIKE iptb00004.labor,
|
|
gasto_ind LIKE iptb00004.gasto_ind
|
|
END RECORD
|
|
|
|
DEFINE acumulado_ac RECORD
|
|
cod_mov LIKE intb00005.cod_mov,
|
|
cod_n SMALLINT,
|
|
cod_grupo SMALLINT,
|
|
cod_Tipo SMALLINT,
|
|
cod_Sec SMALLINT,
|
|
consumo INTEGER,
|
|
cantidad LIKE vetb00014.cantidad
|
|
END RECORD
|
|
|
|
DEFINE costos RECORD
|
|
ventas CHAR(1),
|
|
cod_n SMALLINT,
|
|
cod_grupo SMALLINT,
|
|
cod_Tipo SMALLINT,
|
|
cod_Sec SMALLINT,
|
|
mes CHAR(2)
|
|
END RECORD
|
|
|
|
|
|
###### Variables para busqueda de rango de fecha
|
|
DEFINE detalle CHAR(30)
|
|
DEFINE mes SMALLINT
|
|
DEFINE tasa DECIMAL(5,2)
|
|
DEFINE p_fecha,fecha1, fecha2 DATE
|
|
DEFINE nominas CHAR(1)
|
|
DEFINE entra CHAR(14)
|
|
DEFINE entra1 CHAR(5)
|
|
DEFINE tipo_papel SMALLINT
|
|
DEFINE afecta CHAR(1)
|
|
DEFINE mano_ob,material,material6,gasto_ind DECIMAL(12,2)
|
|
|
|
###### Variables para almacenar los datos selecionados
|
|
DEFINE selec5, selec6 CHAR(1500)
|
|
|
|
###### Variables que la almacenan la informacion enviada al reporte
|
|
DEFINE diario1 RECORD
|
|
cod_n SMALLINT,
|
|
cod_grupo SMALLINT,
|
|
cod_tipo SMALLINT,
|
|
cod_sec SMALLINT,
|
|
consumo LIKE iptb00006.cantidad_2,
|
|
material DECIMAL(12,2),
|
|
mano_ob DECIMAL(12,2),
|
|
gasto_ind DECIMAL(12,2)
|
|
END RECORD
|
|
|
|
DEFINE acumulado RECORD
|
|
cod_mov LIKE iptb00006.cod_mov,
|
|
# cod_cia LIKE iptb00006.cod_cia,
|
|
cod_n LIKE intb00001.cod_n,
|
|
cod_grupo LIKE intb00001.cod_grupo,
|
|
cod_tipo LIKE intb00001.cod_tipo,
|
|
cod_sec LIKE intb00001.cod_sec,
|
|
descrip_esp LIKE intb00001.descrip_esp,
|
|
unidad_med LIKE intb00001.unidad_med,
|
|
descrip_mov LIKE intb00005.descrip_mov,
|
|
consumo INTEGER,
|
|
material LIKE iptb00004.material,
|
|
labor LIKE iptb00004.labor,
|
|
gasto_ind LIKE iptb00004.gasto_ind
|
|
END RECORD
|
|
|
|
DEFINE diario2 RECORD
|
|
cod_n SMALLINT,
|
|
cod_grupo SMALLINT,
|
|
cod_tipo SMALLINT,
|
|
cod_sec SMALLINT,
|
|
costo DECIMAL(12,2)
|
|
END RECORD
|
|
DEFINE salir1 CHAR(1)
|
|
DEFINE idx INTEGER
|
|
END GLOBALS
|
|
|
|
MAIN
|
|
DEFER INTERRUPT
|
|
CALL edprrp049()
|
|
END MAIN
|
|
|
|
FUNCTION edprrp049()
|
|
|
|
# WHENEVER ERROR CONTINUE
|
|
|
|
OPTIONS
|
|
FORM LINE 8,
|
|
ERROR LINE 23,
|
|
COMMENT LINE 21
|
|
|
|
##### Abriendo y desplegando el formulario de captura de datos
|
|
|
|
OPEN FORM edfmrp049 FROM "edfmrp049"
|
|
DISPLAY FORM edfmrp049
|
|
CALL pantalla()
|
|
DISPLAY "edprrp049" AT 4,3
|
|
DISPLAY "Entrada de Diario Costo de Ventas" AT 6,22
|
|
|
|
LET tipo_papel = 1
|
|
CALL msgrp000(tipo_papel)
|
|
|
|
###### Aceptando los valores para el rango de fecha
|
|
|
|
INPUT BY NAME entra,fecha1,fecha2,afecta,detalle
|
|
|
|
AFTER FIELD entra
|
|
SELECT unique ref FROM cgtb00004
|
|
WHERE ref = entra
|
|
|
|
IF STATUS != NOTFOUND THEN
|
|
ERROR "(12) REGISTRO EXISTE"
|
|
# NEXT FIELD entra
|
|
END IF
|
|
|
|
LET entra1 = entra
|
|
|
|
BEFORE FIELD fecha1
|
|
SELECT MAX(fecha) INTO p_fecha FROM cgtb00004
|
|
WHERE ref[1,5] = entra1
|
|
LET fecha1 = p_fecha + 1
|
|
|
|
DISPLAY BY NAME fecha1
|
|
|
|
AFTER FIELD fecha1
|
|
IF fecha1 IS NULL THEN
|
|
ERROR "(16) CAMPO EN BLANCO"
|
|
NEXT FIELD fecha1
|
|
END IF
|
|
|
|
IF fecha1 <= p_fecha THEN
|
|
ERROR "(179) EXISTE ENTRADA DE DIARIO CON ESA FECHA"
|
|
# NEXT FIELD fecha1
|
|
END IF
|
|
|
|
AFTER FIELD fecha2
|
|
IF fecha2 is null THEN
|
|
ERROR "(16) CAMPO EN BLANCO"
|
|
NEXT FIELD fecha2
|
|
END IF
|
|
|
|
IF fecha1 > fecha2 THEN
|
|
ERROR "(149) FECHA NO PUEDE SER MAYOR QUE LA ANTERIOR"
|
|
# NEXT FIELD fecha1
|
|
END IF
|
|
|
|
###### Selecionando en rango de fecha de la tabla de periodo para el fecha2
|
|
|
|
SELECT UNIQUE ref FROM cgtb00004 where ref = entra
|
|
|
|
IF STATUS != NOTFOUND THEN
|
|
ERROR "(12) REGISTRO EXISTE"
|
|
# NEXT FIELD fecha2
|
|
END IF
|
|
|
|
END INPUT
|
|
##### Creando la facilidad para cancelar proceso con DELETE O SUPR
|
|
|
|
IF int_flag THEN
|
|
ERROR "(2) OPERACION CANCELADA"
|
|
LET int_flag = false
|
|
RETURN
|
|
END IF
|
|
|
|
# Busca la informacion requerida
|
|
|
|
DISPLAY "<< Buscando Informacion ... Espere Por Favor. >>" AT 19,14
|
|
ATTRIBUTE (REVERSE,BOLD)
|
|
|
|
LET select_ac =
|
|
"SELECT a.cod_mov,a.cod_n,a.cod_grupo,a.cod_tipo,a.cod_sec, ",
|
|
" c.descrip_esp,c.unidad_med,d.descrip_mov,SUM(a.cantidad_2) ",
|
|
"FROM iptb00006 a,intb00001 c,iptb00005 d ",
|
|
"WHERE a.fecha between ? and ? and a.status_t is NULL AND ",
|
|
" a.cod_mov IN (30,31) AND ",
|
|
" a.cod_n = c.cod_n AND a.cod_grupo = c.cod_grupo AND ",
|
|
" a.cod_tipo=c.cod_tipo AND a.cod_sec = c.cod_sec AND ",
|
|
" a.cod_mov = d.cod_mov AND a.cod_n IN (3,6) ",
|
|
"GROUP BY 1,2,3,4,5,6,7,8 ORDER BY 1,2,3,4,5 "
|
|
|
|
PREPARE busca_ant FROM select_ac
|
|
DECLARE actual SCROLL CURSOR FOR busca_ant
|
|
OPEN actual USING fecha1,fecha2
|
|
|
|
DISPLAY " "
|
|
AT 19,14
|
|
|
|
##### Loop para enviar informacion al reporte
|
|
LET primera = "S"
|
|
START REPORT opera TO PIPE "lp -dcentral"
|
|
|
|
DISPLAY "<< Reporte Generandose ... Por Favor Espere. >>"
|
|
AT 19,14 ATTRIBUTE (REVERSE)
|
|
|
|
WHILE status != notfound
|
|
FETCH actual INTO acumulado.*
|
|
IF STATUS = NOTFOUND THEN
|
|
EXIT WHILE
|
|
END IF
|
|
|
|
IF int_flag THEN
|
|
LET int_flag = false
|
|
RETURN
|
|
END IF
|
|
LET acumulado.material = 0
|
|
LET acumulado.labor = 0
|
|
LET acumulado.gasto_ind = 0
|
|
IF acumulado.cod_mov = 30 THEN
|
|
display acumulado.cod_n," ",acumulado.cod_grupo,
|
|
acumulado.cod_tipo,acumulado.cod_sec at 20,1
|
|
SELECT a.material,a.labor,a.gasto_ind ,max(a.mes_ini),max(a.mes_fin)
|
|
INTO acumulado.material,acumulado.labor,acumulado.gasto_ind
|
|
FROM iptb00004 a
|
|
WHERE a.cod_n = acumulado.cod_n and
|
|
a.cod_tipo = acumulado.cod_tipo and
|
|
a.cod_grupo = acumulado.cod_grupo and
|
|
a.cod_sec = acumulado.cod_sec and
|
|
a.ventas = "1" and
|
|
a.ano = YEAR(fecha1) AND
|
|
a.status_t is null
|
|
GROUP BY 1,2,3
|
|
END IF
|
|
|
|
IF acumulado.cod_mov = 31 THEN
|
|
display acumulado.cod_n," ",acumulado.cod_grupo,
|
|
acumulado.cod_tipo,acumulado.cod_sec at 20,1
|
|
SELECT a.material,@a.labor,a.gasto_ind ,max(a.mes_ini),max(a.mes_fin)
|
|
INTO acumulado.material,acumulado.labor,acumulado.gasto_ind
|
|
FROM iptb00004 a
|
|
WHERE a.cod_n = acumulado.cod_n and
|
|
a.cod_grupo = acumulado.cod_grupo and
|
|
a.cod_tipo = acumulado.cod_tipo and
|
|
a.cod_sec = acumulado.cod_sec and
|
|
a.ventas = "2" and
|
|
a.ano = YEAR(fecha1) AND
|
|
a.status_t is null
|
|
GROUP BY 1,2,3
|
|
END IF
|
|
|
|
OUTPUT TO REPORT opera(acumulado.*,fecha1,fecha2,entra,detalle)
|
|
END WHILE
|
|
|
|
FINISH REPORT opera
|
|
RUN "type C:\\archivo > %USPRINT%" END FUNCTION
|
|
|
|
#### Funcion para dar salida ordenada a la informacion requerida de
|
|
#### una entrada de diario de nominas local
|
|
|
|
|
|
FUNCTION msgrp000(tipo_papel)
|
|
DEFINE tipo_papel SMALLINT,
|
|
longitud CHAR(11),
|
|
linea_papel CHAR(50)
|
|
|
|
CASE
|
|
WHEN tipo_papel = 1
|
|
LET longitud = " 9 1/2 x 11"
|
|
WHEN tipo_papel = 2
|
|
LET longitud = "14 7/8 x 11"
|
|
END CASE
|
|
|
|
LET linea_papel = "Coloque papel ",longitud," en la impresora."
|
|
DISPLAY linea_papel
|
|
AT 15,14
|
|
DISPLAY "Asegurese de que la impresora este encendida."
|
|
AT 16,14
|
|
DISPLAY "<Esc> Ejecuta impresion <Supr> Cancela impresion"
|
|
AT 18,14
|
|
|
|
RUN "type C:\\archivo > %USPRINT%" END FUNCTION
|
|
|
|
FUNCTION pantalla()
|
|
DEFINE fecha CHAR(8),
|
|
hora char(5)
|
|
LET fecha = today USING "dd/mm/yy"
|
|
LET hora = time
|
|
DISPLAY "R A Y . O . V A C D O M I N I C A N A, S. A." AT 4,17
|
|
ATTRIBUTE (REVERSE,YELLOW)
|
|
DISPLAY fecha AT 4,70 ATTRIBUTE (YELLOW)
|
|
DISPLAY "Sistema de Contabilidad General" AT 5,24
|
|
DISPLAY hora AT 6,73 ATTRIBUTE(YELLOW)
|
|
|
|
CALL fgl_drawbox(5,79,3,1)
|
|
CALL fgl_drawbox(1,79,22,1)
|
|
RUN "type C:\\archivo > %USPRINT%" END FUNCTION
|
|
|
|
REPORT opera(x,fecha1,fecha2,entrada,detalle1)
|
|
DEFINE x RECORD
|
|
cod_mov LIKE iptb00006.cod_mov,
|
|
# cod_cia LIKE iptb00006.cod_cia,
|
|
cod_n LIKE intb00001.cod_n,
|
|
cod_grupo LIKE intb00001.cod_grupo,
|
|
cod_tipo LIKE intb00001.cod_tipo,
|
|
cod_sec LIKE intb00001.cod_sec,
|
|
descrip_esp LIKE intb00001.descrip_esp,
|
|
unidad_med LIKE intb00001.unidad_med,
|
|
descrip_mov LIKE intb00005.descrip_mov,
|
|
consumo INTEGER,
|
|
material LIKE iptb00004.material,
|
|
labor LIKE iptb00004.labor,
|
|
gasto_ind LIKE iptb00004.gasto_ind
|
|
END RECORD
|
|
|
|
DEFINE fecha1,fecha2 DATE
|
|
DEFINE l SMALLINT
|
|
DEFINE c_ano1 char(4)
|
|
DEFINE doble_on CHAR(3)
|
|
DEFINE doble_off CHAR(3)
|
|
DEFINE negrillas_on CHAR(6)
|
|
DEFINE negrillas_off CHAR(6)
|
|
DEFINE comp_on CHAR(3)
|
|
DEFINE comp_off CHAR(3)
|
|
DEFINE doce CHAR(3)
|
|
DEFINE normal CHAR(2)
|
|
DEFINE hora CHAR(5)
|
|
DEFINE total_p,total_m DECIMAL(12,2)
|
|
|
|
DEFINE total_material,total_labor,total_gasto_ind,t_t_total,t_t_t_total,
|
|
t_total_material,t_total_labor,t_total_gasto_ind,t_cantidad
|
|
DECIMAL (12,2)
|
|
|
|
DEFINE ttotal_material,ttotal_labor,ttotal_gasto_ind,tt_t_total,tt_t_t_total,
|
|
tt_total_material,tt_total_labor,tt_total_gasto_ind,tt_cantidad
|
|
DECIMAL (12,2)
|
|
DEFINE total1,material6,material1,mano_ob1,gasto1,debito,credito
|
|
DECIMAL(12,2)
|
|
DEFINE entrada CHAR(14),
|
|
i SMALLINT
|
|
DEFINE detalle4,detalle1 CHAR(30)
|
|
|
|
OUTPUT
|
|
TOP MARGIN 0
|
|
LEFT MARGIN 0
|
|
BOTTOM MARGIN 2
|
|
|
|
ORDER BY x.cod_mov,x.cod_n,x.cod_grupo,x.cod_tipo,x.cod_sec
|
|
|
|
FORMAT
|
|
|
|
PAGE HEADER
|
|
LET doble_on = ASCII 001
|
|
LET doble_off = ASCII 002
|
|
LET negrillas_on = ASCII 027, ASCII 098
|
|
LET negrillas_off = ASCII 027, ASCII 099
|
|
LET comp_on = ASCII 31
|
|
LET comp_off = ASCII 029
|
|
LET doce = ASCII 030
|
|
LET normal = ASCII 27, ASCII 80
|
|
LET hora = time
|
|
|
|
PRINT COLUMN 1, comp_off,"edprrp049",
|
|
COLUMN 23, "R A Y . O . V A C D O M I N I C A N A, S. A.",
|
|
COLUMN 75, "Pag. ",pageno using "###"
|
|
PRINT COLUMN 35, "Sistema de Contabilidad",
|
|
COLUMN 75, today using "dd/mm/yy"
|
|
|
|
PRINT COLUMN 29, "Entrada de Diario Costo de Ventas",
|
|
COLUMN 78, hora
|
|
|
|
PRINT COLUMN 34, "Del ",fecha1 USING "dd/mm/yy", " Al ",fecha2
|
|
USING "dd/mm/yy"
|
|
PRINT comp_on
|
|
|
|
SKIP 1 LINES
|
|
|
|
BEFORE GROUP OF x.cod_mov
|
|
|
|
PRINT COLUMN 1, "--------------------------------------------------",
|
|
"--------------------------------------------------",
|
|
"----------------------------------------"
|
|
|
|
PRINT COLUMN 109, "Gasto",
|
|
COLUMN 136, "Costo"
|
|
|
|
PRINT COLUMN 4, "Movimiento",
|
|
COLUMN 49, "Cantidad",
|
|
3 spaces, "Material",
|
|
4 spaces, "Total",
|
|
9 spaces, "Labor",
|
|
4 spaces, "Total",
|
|
6 spaces, "Indirecto",
|
|
4 spaces, "Total",
|
|
9 spaces, "Total"
|
|
|
|
PRINT COLUMN 1, "--------------------------------------------------",
|
|
"--------------------------------------------------",
|
|
"----------------------------------------"
|
|
LET t_cantidad = 0
|
|
LET t_t_t_total = 0
|
|
LET total_material = 0
|
|
LET total_labor = 0
|
|
LET total_gasto_ind = 0
|
|
LET t_total_material = 0
|
|
LET t_total_labor = 0
|
|
LET t_total_gasto_ind = 0
|
|
LET t_t_total = 0
|
|
|
|
PRINT COLUMN 1, x.cod_mov using "&&",
|
|
COLUMN 7, x.descrip_mov
|
|
SKIP 1 LINE
|
|
PRINT COLUMN 4, "Productos "
|
|
LET total_m = 0
|
|
|
|
BEFORE GROUP OF x.cod_n
|
|
SKIP 1 LINE
|
|
LET tt_cantidad = 0
|
|
LET tt_t_t_total = 0
|
|
LET ttotal_material = 0
|
|
LET ttotal_labor = 0
|
|
LET ttotal_gasto_ind = 0
|
|
LET tt_total_material = 0
|
|
LET tt_total_labor = 0
|
|
LET tt_total_gasto_ind = 0
|
|
LET tt_t_total = 0
|
|
|
|
|
|
ON EVERY ROW
|
|
|
|
IF x.consumo IS NOT NULL THEN
|
|
|
|
IF x.cod_mov = 31 THEN
|
|
LET x.gasto_ind = 0
|
|
END IF
|
|
|
|
LET t_cantidad = t_cantidad + x.consumo
|
|
LET total_material = x.material * x.consumo
|
|
LET total_labor = x.labor * x.consumo
|
|
LET total_gasto_ind = x.gasto_ind * x.consumo
|
|
LET t_t_total = total_material + total_labor + total_gasto_ind
|
|
LET t_t_t_total = t_t_total + t_t_t_total
|
|
|
|
LET tt_cantidad = tt_cantidad + x.consumo
|
|
LET ttotal_material = x.material * x.consumo
|
|
LET ttotal_labor = x.labor * x.consumo
|
|
LET ttotal_gasto_ind = x.gasto_ind * x.consumo
|
|
LET tt_t_total = ttotal_material + total_labor + total_gasto_ind
|
|
LET tt_t_t_total = tt_t_total + tt_t_t_total
|
|
|
|
LET t_total_material = t_total_material + total_material
|
|
LET t_total_labor = t_total_labor + total_labor
|
|
LET t_total_gasto_ind = t_total_gasto_ind + total_gasto_ind
|
|
|
|
LET tt_total_material = tt_total_material + ttotal_material
|
|
LET tt_total_labor = tt_total_labor + ttotal_labor
|
|
LET tt_total_gasto_ind = tt_total_gasto_ind + ttotal_gasto_ind
|
|
|
|
PRINT COLUMN 1, x.cod_n USING "&","-",
|
|
COLUMN 3, x.cod_grupo USING "&","-",
|
|
COLUMN 5, x.cod_tipo USING "&&","-",
|
|
COLUMN 8, x.cod_sec USING "&&&",
|
|
COLUMN 13, x.descrip_esp," ", 2 spaces,
|
|
COLUMN 42, x.consumo USING "##,###,###",
|
|
COLUMN 53, x.material USING "#,###.#####",
|
|
COLUMN 69, total_material using "##,###,###.##",
|
|
COLUMN 86, x.labor using "###.#####",
|
|
COLUMN 96, total_labor using "#,###,###.##",
|
|
COLUMN 109, x.gasto_ind using "###.#####",
|
|
COLUMN 116, total_gasto_ind using "#,###,###.##",
|
|
COLUMN 121, t_t_total using "##,###,###.##"
|
|
END IF
|
|
|
|
AFTER GROUP OF x.cod_n
|
|
|
|
PRINT COLUMN 42, "--------------",
|
|
COLUMN 69, "--------------",
|
|
COLUMN 96, "----------",
|
|
COLUMN 116, "-------------",
|
|
COLUMN 121, "-------------"
|
|
|
|
PRINT negrillas_on
|
|
PRINT COLUMN 3, "Total Compania---->",
|
|
COLUMN 42, tt_cantidad using "###,###,###.##",
|
|
COLUMN 69, tt_total_material USING "###,###,###.##",
|
|
COLUMN 96, tt_total_labor USING "###,###.##",
|
|
COLUMN 116, tt_total_gasto_ind USING "##,###,###.##",
|
|
COLUMN 121, tt_t_t_total using "##,###,###.##"
|
|
PRINT negrillas_off
|
|
|
|
IF primera = "S" THEN
|
|
LET primera = "N"
|
|
LET arr_entrada[1].debito = 0
|
|
LET arr_entrada[2].debito = 0
|
|
LET arr_entrada[3].debito = 0
|
|
LET arr_entrada[4].debito = 0
|
|
LET arr_entrada[5].debito = 0
|
|
|
|
LET arr_entrada[1].credito = 0
|
|
LET arr_entrada[2].credito = 0
|
|
LET arr_entrada[3].credito = 0
|
|
LET arr_entrada[4].credito = 0
|
|
LET arr_entrada[5].credito = 0
|
|
END IF
|
|
|
|
IF x.cod_mov = 30 THEN
|
|
CASE
|
|
WHEN x.cod_n = 3
|
|
|
|
LET arr_entrada[1].cuenta_no = "5110"
|
|
LET arr_entrada[1].depto = 4101
|
|
LET arr_entrada[1].debito = tt_total_material
|
|
LET arr_entrada[1].credito = 0
|
|
|
|
LET arr_entrada[3].cuenta_no = "5112"
|
|
LET arr_entrada[3].depto = 4101
|
|
LET arr_entrada[3].debito = tt_total_labor
|
|
LET arr_entrada[3].credito = 0
|
|
|
|
LET arr_entrada[5].cuenta_no = "5205"
|
|
LET arr_entrada[5].depto = 4101
|
|
LET arr_entrada[5].debito = tt_total_gasto_ind
|
|
LET arr_entrada[5].credito = 0
|
|
|
|
EXIT CASE
|
|
|
|
WHEN x.cod_n = 6
|
|
LET arr_entrada[6].cuenta_no = "5750"
|
|
LET arr_entrada[6].depto = 4103
|
|
LET arr_entrada[6].debito = tt_t_t_total
|
|
LET arr_entrada[6].credito = 0
|
|
|
|
LET arr_entrada[8].cuenta_no = "1136"
|
|
LET arr_entrada[8].depto = null
|
|
LET arr_entrada[8].debito = 0
|
|
LET arr_entrada[8].credito = tt_t_t_total
|
|
|
|
EXIT CASE
|
|
END CASE
|
|
END IF
|
|
IF x.cod_mov = 31 THEN
|
|
CASE
|
|
WHEN x.cod_n = 3
|
|
LET arr_entrada[2].cuenta_no = "5110"
|
|
LET arr_entrada[2].depto = 4102
|
|
LET arr_entrada[2].debito = tt_total_material
|
|
LET arr_entrada[2].credito = 0
|
|
|
|
LET arr_entrada[4].cuenta_no = "5112"
|
|
LET arr_entrada[4].depto = 4102
|
|
LET arr_entrada[4].debito = tt_total_labor
|
|
LET arr_entrada[4].credito = 0
|
|
|
|
EXIT CASE
|
|
END CASE
|
|
END IF
|
|
|
|
LET arr_entrada[7].cuenta_no = "1131"
|
|
LET arr_entrada[7].depto = null
|
|
LET arr_entrada[7].debito = 0
|
|
LET arr_entrada[7].credito = arr_entrada[1].debito +
|
|
arr_entrada[2].debito +
|
|
arr_entrada[3].debito +
|
|
arr_entrada[4].debito +
|
|
arr_entrada[5].debito
|
|
IF material6 IS NULL THEN
|
|
LET material6 = 0
|
|
END IF
|
|
|
|
IF material1 IS NULL THEN
|
|
LET material1 = 0
|
|
END IF
|
|
|
|
IF mano_ob1 IS NULL THEN
|
|
LET mano_ob1 = 0
|
|
END IF
|
|
|
|
IF gasto1 IS NULL THEN
|
|
LET gasto1 = 0
|
|
END IF
|
|
|
|
IF x.cod_n = 3 THEN
|
|
LET material1 = material1 + tt_total_material
|
|
LET mano_ob1 = mano_ob1 + tt_total_labor
|
|
LET gasto1 = gasto1 + tt_total_gasto_ind
|
|
END IF
|
|
IF x.cod_n = 6 THEN
|
|
LET material6 = material6 + tt_total_material
|
|
END IF
|
|
|
|
AFTER GROUP OF x.cod_mov
|
|
|
|
PRINT COLUMN 42, "--------------",
|
|
COLUMN 69, "--------------",
|
|
COLUMN 96, "----------",
|
|
COLUMN 116, "-------------",
|
|
COLUMN 121, "-------------"
|
|
|
|
PRINT negrillas_on
|
|
PRINT COLUMN 3, "Total ---->",
|
|
COLUMN 42, t_cantidad using "###,###,###.##",
|
|
COLUMN 69, t_total_material USING "###,###,###.##",
|
|
COLUMN 96, t_total_labor USING "###,###.##",
|
|
COLUMN 116, t_total_gasto_ind USING "##,###,###.##",
|
|
COLUMN 121, t_t_t_total using "##,###,###.##"
|
|
|
|
PRINT negrillas_off
|
|
|
|
PRINT COLUMN 42, "==============",
|
|
COLUMN 69, "==============",
|
|
COLUMN 96, "==========",
|
|
COLUMN 116, "=============",
|
|
COLUMN 121, "============="
|
|
|
|
LET t_cantidad = 0
|
|
LET t_total_material = 0
|
|
LET t_total_labor = 0
|
|
LET t_total_gasto_ind = 0
|
|
LET t_t_t_total = 0
|
|
LET debito = 0
|
|
LET credito = 0
|
|
PRINT comp_off
|
|
|
|
SKIP TO TOP OF PAGE
|
|
|
|
ON LAST ROW
|
|
|
|
SKIP TO TOP OF PAGE
|
|
PRINT comp_off
|
|
|
|
PRINT COLUMN 01,"Entrada de Diario No.",
|
|
doble_on,entrada,doble_off
|
|
|
|
PRINT COLUMN 1,"Observaciones: _____________________________________"
|
|
PRINT COLUMN 1," _____________________________________"
|
|
|
|
PRINT COLUMN 1,
|
|
"--------------------------------------------------",
|
|
"----------------------------------------",
|
|
negrillas_on
|
|
|
|
PRINT COLUMN 2, "Cuenta ",
|
|
COLUMN 11, "Dpto",
|
|
COLUMN 18, "Concepto",
|
|
COLUMN 60, "Debe",
|
|
COLUMN 75, "Haber",negrillas_off
|
|
|
|
PRINT COLUMN 1,
|
|
"--------------------------------------------------",
|
|
"----------------------------------------"
|
|
FOR i = 1 TO 8
|
|
SELECT descripcion INTO detalle4
|
|
FROM cgtb00001
|
|
WHERE cuenta_no = arr_entrada[i].cuenta_no
|
|
IF status != notfound THEN
|
|
|
|
PRINT COLUMN 2, arr_entrada[i].cuenta_no,
|
|
COLUMN 11, arr_entrada[i].depto using "####",
|
|
COLUMN 18, detalle4,
|
|
COLUMN 50, arr_entrada[i].debito using "###,###,##&.##",
|
|
COLUMN 65, arr_entrada[i].credito using "###,###,##&.##"
|
|
LET debito = debito + arr_entrada[i].debito
|
|
LET credito = credito + arr_entrada[i].credito
|
|
IF afecta = "S" THEN
|
|
IF arr_entrada[i].debito < 0 THEN
|
|
LET arr_entrada[i].debito = arr_entrada[i].debito * -1
|
|
END IF
|
|
IF arr_entrada[i].credito < 0 THEN
|
|
LET arr_entrada[i].credito = arr_entrada[i].credito * -1
|
|
END IF
|
|
|
|
INSERT INTO cgtb00004 VALUES
|
|
(fecha2,1,entrada,arr_entrada[i].cuenta_no,
|
|
arr_entrada[i].depto,null,null,null,null,
|
|
detalle1,null,arr_entrada[i].debito,arr_entrada[i].credito,
|
|
null,user,current,null,null)
|
|
END IF
|
|
END IF
|
|
END FOR
|
|
PRINT COLUMN 50, "--------------",
|
|
COLUMN 65, "--------------"
|
|
|
|
PRINT COLUMN 35,"Totales-->",
|
|
COLUMN 50, debito USING "###,###,##&.&&",
|
|
COLUMN 65, credito USING "###,###,##&.&&",negrillas_off
|
|
|
|
SKIP 2 LINE
|
|
PRINT COLUMN 1, detalle1
|
|
PRINT COLUMN 1,comp_off,negrillas_off
|
|
SKIP 4 LINE
|
|
|
|
END REPORT
|
|
|