GLOBALS "ccprgb000.4gl" FUNCTION consulta_empleados() OPEN WINDOW busqueda2 AT 7,12 WITH FORM "vefmwd001" ATTRIBUTE (BORDER,FORM LINE FIRST + 2,COMMENT LINE LAST,MESSAGE LINE LAST) LET int_flag = false CONSTRUCT criterio ON a.nom1_emp FROM descrip6 LET selec2 = "SELECT num_emp,a.nom1_emp,a.apell1_emp ", "FROM adtb00003 a", "WHERE a.status_t is null AND ",criterio clipped," ORDER BY 1 " IF int_flag THEN LET numero_msg = 2 CALL msg(numero_msg) GO TO salir_consulta_e END IF PREPARE busca_empleados FROM selec2 IF status >= 0 THEN IF status = notfound THEN LET numero_msg = 3 CALL msg(numero_msg) END IF ELSE END IF DECLARE buscar_empleados CURSOR FOR busca_empleados LET idx = 1 FOREACH buscar_empleados INTO arr_empleados[idx].* IF status = NOTFOUND THEN EXIT FOREACH END IF IF int_flag THEN LET numero_msg = 2 CALL msg(numero_msg) EXIT FOREACH END IF LET empleados[idx].num_emp = arr_empleados[idx].num_emp LET empleados[idx].descrip6 = arr_empleados[idx].nom1_emp clipped," ",arr_empleados[idx].apell1_emp clipped LET idx = idx + 1 END FOREACH CALL set_count(idx-1) MESSAGE " Selecciona Empleado donde esta el cursor" DISPLAY ARRAY empleados TO s_empleados.* LET curr1 = arr_curr() LET transportista.sec_transp = empleados[curr1].num_emp LET descrip6 = empleados[curr1].descrip6 LABEL salir_consulta_e: CLOSE WINDOW busqueda2 END FUNCTION FUNCTION consulta_clientes() OPEN WINDOW busqueda AT 7,12 WITH FORM "vefmwd002_1" ATTRIBUTE (BORDER,FORM LINE FIRST + 2,COMMENT LINE LAST,MESSAGE LINE LAST) LET int_flag = false CONSTRUCT criterio ON a.nombre FROM nombre IF int_flag THEN LET numero_msg = 2 CALL msg(numero_msg) GO TO salir_consulta_c END IF LET selec2 = "SELECT a.tipo_cliente, a.sec_cliente, a.nombre ", "FROM vetb00004 a ", "WHERE a.status_t is null AND ",criterio clipped," ORDER BY 1,2 " PREPARE busca_clientes FROM selec2 DECLARE buscar_clientes CURSOR FOR busca_clientes LET idx = 1 FOREACH buscar_clientes INTO arr_clientes[idx].* IF int_flag THEN LET numero_msg = 2 CALL msg(numero_msg) EXIT FOREACH END IF LET idx = idx + 1 END FOREACH CALL set_count(idx-1) MESSAGE " Selecciona Cliente donde esta el cursor" DISPLAY ARRAY arr_clientes TO s_clientes.* LET curr1 = arr_curr() LET cliente_dir.tipo_cliente = arr_clientes[curr1].tipo_cliente LET cliente_dir.sec_cliente = arr_clientes[curr1].sec_cliente LET descrip1 = arr_clientes[curr1].nombre LABEL salir_consulta_c: CLOSE WINDOW busqueda END FUNCTION FUNCTION cventas() DEFINE kventas SMALLINT, dventas CHAR(30) #LET pventas = ui.combobox.forname("formonly.ventas") DECLARE bventas CURSOR FOR SELECT a.ventas,a.descripcion FROM vetb00061 a CALL pventas.clear() FOREACH bventas INTO kventas,dventas CALL pventas.additem(kventas,dventas) END FOREACH CALL pventas.additem(99,"TODAS") END FUNCTION { FUNCTION ctiposCliente() DEFINE ktipocliente SMALLINT, dclientes CHAR(30) #LET pventas = ui.combobox.forname("formonly.ventas") DECLARE btipos CURSOR FOR SELECT DISTINCT b.tipo_cliente,'('||CONVERT(CHAR(6),b.tipo_cliente)||')'||a.descripcion FROM vetb00061 a,vetb00060 b WHERE a.ventas = b.ventas CALL pventas.clear() FOREACH btipos INTO ktipocliente,dclientes CALL pventas.additem(ktipocliente,dclientes) END FOREACH CALL pventas.additem(99,"TODAS") END FUNCTION }