public void llenar() { Tabla tab_valor = utilitario.consultar( "select sum(dcc.valor_cndcc*sc.signo_cnscu) as valor,dpc.ide_cndpc,dpc.nombre_cndpc " + "from con_cab_comp_cont ccc " + "inner join con_det_comp_cont dcc on ccc.ide_cnccc=dcc.ide_cnccc " + "inner join con_det_plan_cuen dpc on dpc.ide_cndpc = dcc.ide_cndpc " + "inner join con_tipo_cuenta tc on dpc.ide_cntcu=tc.ide_cntcu " + "inner join con_signo_cuenta sc on tc.ide_cntcu=sc.ide_cntcu and dcc.ide_cnlap=sc.ide_cnlap " + "WHERE (ccc.fecha_trans_cnccc BETWEEN '2011-01-01' and '2012-12-31') " + "and ccc.ide_cneco in (0,2,3) and ccc.ide_sucu=0 and dpc.ide_cntcu in (0,3,4) and " + "dcc.ide_cndpc in (SELECT ide_cndpc from con_det_plan_cuen where con_ide_cndpc in " + "(select ide_cndpc from con_det_plan_cuen where con_ide_cndpc=136)) " + "and dpc.ide_cndpc>201 " + "and dpc.ide_cndpc!= 143 " + "GROUP BY dpc.ide_cndpc,codig_recur_cndpc, nombre_cndpc,con_ide_cndpc " + "HAVING (sum(dcc.valor_cndcc*sc.signo_cnscu) <>0) ORDER BY codig_recur_cndpc"); int j = 0; for (int i = 0; i < tab_tabla1.getTotalFilas(); i++) { System.out.println("ide cabecera " + tab_tabla1.getValor(i, "ide_ccctr")); if (Double.parseDouble(tab_tabla1.getValor(i, "ide_ccctr")) > 17) { tab_tabla2.insertar(); System.out.println("valor " + tab_valor.getValor(j, "valor")); tab_tabla2.setValor("ide_ccctr", tab_tabla1.getValor(i, "ide_ccctr")); tab_tabla2.setValor("valor_ccdtr", tab_valor.getValor(j, "valor")); j = j + 1; } } tab_tabla2.guardar(); utilitario.getConexion().guardarPantalla(); }
@Override public void guardar() { tab_tabla1.guardar(); tab_tabla2.guardar(); utilitario.getConexion().guardarPantalla(); }