public void aceptarImpuesto() { System.out.println("entra a metodo aceptar impues"); if (set_impuesto.isVisible()) { if (set_impuesto.getValorSeleccionado() != null) { tab_detalle_retencion.insertar(); if (set_impuesto.getValorSeleccionado().equals(par_impuesto_iva)) { tab_detalle_retencion.setValor( "base_imponible_teder", tab_adq_factura.getValor("valor_iva_adfac")); } else if (set_impuesto.getValorSeleccionado().equals(par_impuesto_renta)) { tab_detalle_retencion.setValor( "base_imponible_teder", tab_adq_factura.getValor("subtotal_adfac")); } str_seleccionado = set_impuesto.getValorSeleccionado(); System.out.println("probando que valor me llega" + str_seleccionado); set_retencion .getTab_seleccion() .setSql(ser_Tesoreria.getImpuesto("true", "0", str_seleccionado)); set_retencion.getTab_seleccion().ejecutarSql(); set_retencion.dibujar(); set_impuesto.cerrar(); } else { utilitario.agregarMensajeInfo("SELECCIONE OPCION", "Seleccione un registro"); } } else if (set_retencion.isVisible()) { str_seleccionado = set_retencion.getValorSeleccionado(); TablaGenerica tab_rentas = utilitario.consultar(ser_Tesoreria.getImpuestoCalculo(str_seleccionado)); double dou_valor_impuesto = 0; double dou_porcentaje_calculo = 0; double dou_valor_resultado = 0; dou_porcentaje_calculo = Double.parseDouble(tab_rentas.getValor("porcentaje_teimp")); dou_valor_impuesto = Double.parseDouble(tab_detalle_retencion.getValor("base_imponible_teder")); dou_valor_resultado = (dou_porcentaje_calculo * dou_valor_impuesto) / 100; if (set_retencion.getValorSeleccionado() != null) { tab_detalle_retencion.setValor("ide_teimp", str_seleccionado); tab_detalle_retencion.setValor("valor_retenido_teder", dou_valor_resultado + ""); String valorx = tab_detalle_retencion.getSumaColumna("valor_retenido_teder") + ""; tab_retencion.setValor("total_ret_teret", valorx); } set_retencion.cerrar(); utilitario.addUpdateTabla( tab_detalle_retencion, "valor_retenido_teder,base_imponible_teder,ide_teimp", ""); utilitario.addUpdateTabla(tab_retencion, "total_ret_teret", ""); calcularValorPago(); utilitario.addUpdateTabla(tab_comprobante, "valor_pago_tecpo,", ""); } }
public pre_adq_factura_retencion() { // parametros par_impuesto_iva = utilitario.getVariable("p_tes_impuesto_iva"); par_impuesto_renta = utilitario.getVariable("p_tes_impuesto_renta"); par_iva = Double.parseDouble(utilitario.getVariable("p_valor_iva")); /// tabuladores Tabulador tab_tabulador = new Tabulador(); tab_tabulador.setId("tab_tabulador"); // tabla factura tab_adq_factura.setId("tab_adq_factura"); tab_adq_factura.setHeader("ADQUISICIÓN FACTURA"); tab_adq_factura.setTabla("adq_factura", "ide_adfac", 1); tab_adq_factura.setCampoOrden("ide_adfac desc"); tab_adq_factura.getColumna("IDE_ADSOC").setCombo(ser_Adquisicion.getSolicitudCompra("true")); tab_adq_factura.getColumna("IDE_ADSOC").setAutoCompletar(); tab_adq_factura.getColumna("IDE_ADSOC").setLectura(true); tab_adq_factura.getColumna("subtotal_adfac").setLectura(true); tab_adq_factura.getColumna("valor_iva_adfac").setLectura(true); tab_adq_factura.setTipoFormulario(true); tab_adq_factura.getGrid().setColumns(4); tab_adq_factura.agregarRelacion(tab_retencion); tab_adq_factura.dibujar(); PanelTabla pat_factura = new PanelTabla(); pat_factura.setPanelTabla(tab_adq_factura); /// RETENCION tab_retencion.setId("tab_retencion"); tab_retencion.setIdCompleto("tab_tabulador:tab_retencion"); // tab_retencion.setHeader("RETENCION"); tab_retencion.setTabla("tes_retencion", "ide_teret", 2); tab_retencion.getColumna("total_ret_teret").setEtiqueta(); tab_retencion .getColumna("total_ret_teret") .setEstilo("font-size:15px;font-weight: bold;text-decoration: underline;color:red"); tab_retencion.getColumna("total_ret_teret").setValorDefecto("0.00"); tab_retencion.getColumna("activo_teret").setValorDefecto("true"); tab_retencion.getColumna("activo_teret").setLectura(true); tab_retencion.getColumna("fecha_teret").setValorDefecto(utilitario.getFechaActual()); tab_retencion.setTipoFormulario(true); tab_retencion.getGrid().setColumns(4); tab_retencion.agregarRelacion(tab_detalle_retencion); tab_retencion.dibujar(); PanelTabla pat_retencion = new PanelTabla(); pat_retencion.setPanelTabla(tab_retencion); ///// etiqueta Etiqueta eti_retencion = new Etiqueta(); eti_retencion.setValue("RETENCION"); eti_retencion.setStyle("font-size: 13px;color: red;font-weight: bold"); pat_retencion.setHeader(eti_retencion); /// DETALLE RETENCION tab_detalle_retencion.setId("tab_detalle_retencion"); tab_detalle_retencion.setIdCompleto("tab_tabulador:tab_detalle_retencion"); // tab_detalle_retencion.setHeader("DETALLE RETENCION"); tab_detalle_retencion.setTabla("tes_detalle_retencion", "ide_teder", 3); tab_detalle_retencion .getColumna("ide_teimp") .setCombo("tes_impuesto", "ide_teimp", "codigo_teimp,porcentaje_teimp,detalle_teimp", ""); tab_detalle_retencion.getColumna("ide_teimp").setLectura(true); tab_detalle_retencion.getColumna("ide_teimp").setAutoCompletar(); tab_detalle_retencion.getColumna("valor_retenido_teder").setEtiqueta(); tab_detalle_retencion .getColumna("valor_retenido_teder") .setEstilo( "font-size:15px;font-weight: bold;text-decoration: underline;color:red"); // Estilo tab_detalle_retencion.getColumna("valor_retenido_teder").setValorDefecto("0.00"); tab_detalle_retencion.getColumna("activo_teder").setValorDefecto("true"); tab_detalle_retencion.getColumna("activo_teder").setLectura(true); tab_detalle_retencion.setTipoFormulario(true); tab_detalle_retencion.getGrid().setColumns(2); tab_detalle_retencion.dibujar(); PanelTabla pat_detalle_retencion = new PanelTabla(); pat_detalle_retencion.setPanelTabla(tab_detalle_retencion); //// para obteber las dos ventanas retencion y detalla retención Etiqueta eti_detalle_retencion = new Etiqueta(); eti_detalle_retencion.setValue("DETALLE RETENCION"); eti_detalle_retencion.setStyle("font-size: 13px;color: red;font-weight: bold"); pat_detalle_retencion.setHeader(eti_detalle_retencion); Grid gri = new Grid(); gri.setColumns(2); gri.getChildren().add(pat_retencion); gri.getChildren().add(pat_detalle_retencion); // tab_tabulador.agregarTab("DETALLE MOVIMIENTO", pat_detalle_movimiento);//intancia los // tabuladores tab_tabulador.agregarTab("RETENCION", gri); Division div_division = new Division(); div_division.dividir2(pat_factura, tab_tabulador, "50%", "H"); agregarComponente(div_division); /// boton tipo impuesto Boton bot_impuesto = new Boton(); bot_impuesto.setIcon("ui-icon-person"); bot_impuesto.setValue("Generar Retencion"); bot_impuesto.setMetodo("importarImpuesto"); bar_botones.agregarBoton(bot_impuesto); set_impuesto.setId("set_impuesto"); set_impuesto.setSeleccionTabla("tes_tipo_impuesto", "ide_tetii", "detalle_tetii"); set_impuesto.setTitle("SELECCIONE UN IMPUESTO"); set_impuesto.getBot_aceptar().setMetodo("aceptarImpuesto"); set_impuesto.setRadio(); agregarComponente(set_impuesto); // retencion set_retencion.setId("set_retencion"); set_retencion.setSeleccionTabla(ser_Tesoreria.getImpuesto("true", "1", "0"), "ide_teimp"); set_retencion.setTitle("SELECCIONE UNA RETENCIÓN"); set_retencion.getBot_aceptar().setMetodo("aceptarImpuesto"); set_retencion.getTab_seleccion().getColumna("CODIGO_TEIMP").setFiltro(true); set_retencion.getTab_seleccion().getColumna("DETALLE_TEIMP").setFiltro(true); set_retencion.setRadio(); agregarComponente(set_retencion); }