private void limpiar() {
   if (jftfFechaHasta.getValue() == null || jftfFechaDesde.getValue() == null) {
     this.jftfFechaDesde.setValue(validaciones.Validacion.fechaSistema("dd-MM-yyyy"));
     this.jftfFechaHasta.setValue(validaciones.Validacion.fechaSistema("dd-MM-yyyy"));
   }
   this.jtfProveedor.setText("");
   this.jtfBuscar.setText("");
   llenarAtributos();
   proveedorId = "¬";
   try {
     llenarjTable();
   } catch (java.rmi.RemoteException re) {
     javax.swing.JOptionPane.showMessageDialog(
         null, "Se perdio la conexion. Contacte con el administrador...");
   } catch (javax.ejb.EJBException eje) {
     javax.swing.JOptionPane.showMessageDialog(
         null, "Se perdio la conexion. Contacte con el administrador...");
   } catch (javax.naming.NameNotFoundException nnfe) {
     javax.swing.JOptionPane.showMessageDialog(
         null, "El programa servidor no esta listo. Intente mas tarde...");
   } catch (Exception e) {
     shrimp.helper.Excepciones.guardarExcepcionesAC(
         e, getClass().getName(), mDIShrimp.getSisInfoTO());
   }
   proveedorId = null;
 }
Beispiel #2
0
  private void insertarFechaOriginal(String fechaDesde, String fechaHasta) {
    if (fechaDesde.trim().isEmpty()) {
      jftfDesde.setValue(null);
    } else {
      jftfDesde.setValue(
          validaciones.Validacion.fecha(
              fechaHasta.split("-")[0] + "-" + "01-01", "yyyy-MM-dd", "dd-MM-yyyy"));
    }

    if (fechaHasta.trim().isEmpty()) {
      jftfHasta.setValue(null);
    } else {
      jftfHasta.setValue(validaciones.Validacion.fecha(fechaHasta, "yyyy-MM-dd", "dd-MM-yyyy"));
    }
  }
  private void buscar() {
    try {
      fechaDesde =
          validaciones.Validacion.fecha(
              jftfFechaDesde.getText().trim(), "dd-MM-yyyy", "yyyy-MM-dd");
      fechaHasta =
          validaciones.Validacion.fecha(
              jftfFechaHasta.getText().trim(), "dd-MM-yyyy", "yyyy-MM-dd");
      codigoCuentaDesde = jtfCuentaDesde.getText().trim();
      codigoCuentaHasta = jtfCuentaHasta.getText().trim();

      guardarParametroAux();
      llenarjTBalanceComprobacion();

      sorter = new javax.swing.table.TableRowSorter(jtable.getModel());
      if (jtable.getRowCount() > 0) {
        jtable.requestFocus();
        jtable.changeSelection(0, 0, false, false);
      } else {
        javax.swing.JOptionPane.showMessageDialog(this, "No hay resultados que mostrar...");
        this.jftfFechaDesde.requestFocus();
      }
    } catch (java.rmi.RemoteException re) {
      javax.swing.JOptionPane.showMessageDialog(
          null, "Se perdio la conexion. Contacte con el administrador o intentelo más tarde...");
      jtable.requestFocus();
      if (jtable.getRowCount() > 0) {
        jtable.changeSelection(0, 0, false, false);
      }
    } catch (javax.ejb.EJBException eje) {
      javax.swing.JOptionPane.showMessageDialog(
          null, "Se perdio la conexion. Contacte con el administrador o intentelo más tarde...");
      jtable.requestFocus();
      if (jtable.getRowCount() > 0) {
        jtable.changeSelection(0, 0, false, false);
      }
    } catch (javax.naming.NameNotFoundException nnfe) {
      javax.swing.JOptionPane.showMessageDialog(
          null, "El programa servidor no esta listo. Intente mas tarde...");
      jtable.requestFocus();
      if (jtable.getRowCount() > 0) {
        jtable.changeSelection(0, 0, false, false);
      }
    } catch (Exception e) {
      shrimp.helper.Excepciones.guardarExcepcionesAC(
          e, getClass().getName(), mDIShrimp.getSisInfoTO());
    }
  }
Beispiel #4
0
  private void jbtnReconstruirActualizarActionPerformed(java.awt.event.ActionEvent evt) {
    // TODO add your handling code here:
    try {
      eventoKeyPressPadre();
      this.accion = "AMBOS";
      manejoControlesBotones(false);
      desde =
          jftfDesde.getValue() == null
              ? null
              : "'"
                  + validaciones.Validacion.fecha(jftfDesde.getText(), "dd-MM-yyyy", "yyyy-MM-dd")
                  + "'";
      hasta =
          jftfHasta.getValue() == null
              ? null
              : "'"
                  + validaciones.Validacion.fecha(jftfHasta.getText(), "dd-MM-yyyy", "yyyy-MM-dd")
                  + "'";
      this.jbtnActualizar.setEnabled(false);
      // hilo.init(this, bbResumenCorrida1, empresa, codigoSector, desde, hasta, tipoResumen);
      // hilo.start();
      Long tiempoInicio = System.currentTimeMillis();
      bbResumenCorrida1.setPrdListaResumenCorridaTO(
          ProduccionDelegate.getInstance()
              .getListaResumenCorridaTO(empresa, codigoSector, desde, hasta, tipoResumen));
      llenarjTable();
      long tiempoTotal = System.currentTimeMillis() - tiempoInicio;
      lbTimeEjecucion.setText(
          "Filas: "
              + jtable.getRowCount()
              + "  Tiempo: "
              + FormatoNumero.redondear(((double) tiempoTotal / 1000), 2)
              + " s");
      if (jtable.getRowCount() > 0) {
        jtable.requestFocus();
        jtable.changeSelection(0, 0, false, false);
        barraEstado(true);
        manejoControlesBotones(false);
      } else {
        javax.swing.JOptionPane.showMessageDialog(this, "No hay resultados que mostrar...");
      }

    } catch (Exception ex) {
      shrimp.helper.Excepciones.guardarExcepcionesAC(
          ex, getClass().getName(), mDIShrimp.getSisInfoTO());
    }
  }
 // funcion para cargar los datos temporalmete
 private void guardarParametroAux() {
   fechaReporte = validaciones.Validacion.fechaSistema();
   fechaDesdeAux = jftfFechaDesde.getText().trim();
   fechaHastaAux = jftfFechaHasta.getText().trim();
   codigoCuentaDesdeAux = jtfCuentaDesde.getText().trim();
   codigoCuentaHastaAux = jtfCuentaHasta.getText().trim();
   codigoSectorAux = codigoSector;
 }
  private void aceptar() {
    contabilidad.TO.ConMayorAuxiliarTO conMayorAuxiliarTO = null;
    if (jtable.getModel().getRowCount() > 0) {
      conMayorAuxiliarTO =
          this.contabilidadBBMayorAuxiliar1
              .getListaConMayorAuxiliarTO()
              .get(this.jtable.convertRowIndexToModel(this.jtable.getSelectedRow()));
      java.util.List<String> comprobante =
          validaciones.Validacion.separarComprobante(conMayorAuxiliarTO.getMaContable());
      String periodo = comprobante.get(0);
      String motivo = comprobante.get(1);
      String numero = comprobante.get(2);

      JIFAdministrarContable administrarContable =
          new JIFAdministrarContable(
              this.mDIShrimp,
              motivo,
              periodo,
              numero,
              "CONSULTAR",
              "Consulta de Comprobante Contable");
      try {
        administrarContable.setSelected(true);
      } catch (Exception e) {
        shrimp.helper.Excepciones.guardarExcepcionesAC(
            e, getClass().getName(), mDIShrimp.getSisInfoTO());
        this.requestFocus();
      }
      administrarContable.setVisible(true);
    }
    try {
      llenarjTBalanceComprobacion();
      conMayorAuxiliarTO = null;
      jtfBuscar.setText("");
    } catch (java.rmi.RemoteException re) {
      javax.swing.JOptionPane.showMessageDialog(
          null, "Se perdio la conexion. Contacte con el administrador...");
      requestFocus();
    } catch (javax.ejb.EJBException eje) {
      javax.swing.JOptionPane.showMessageDialog(
          null, "Se perdio la conexion. Contacte con el administrador...");
      requestFocus();
    } catch (javax.naming.NameNotFoundException nnfe) {
      javax.swing.JOptionPane.showMessageDialog(
          null, "El programa servidor no esta listo. Intente mas tarde...");
      requestFocus();
    } catch (Exception e) {
      shrimp.helper.Excepciones.guardarExcepcionesAC(
          e, getClass().getName(), mDIShrimp.getSisInfoTO());
      requestFocus();
    }
  }
 private void cancelar() throws Exception {
   this.accion = "CANCELAR";
   jtfBuscar.setText("");
   // manejoControlesBotones(true);
   barraEstado(false);
   jcboCP.requestFocus();
   String var_temporal = codigoSector;
   // codigoSector= "'¬'";
   try {
     fechaDesde =
         validaciones.Validacion.fecha(
             jftfFechaDesde.getText().trim(), "dd-MM-yyyy", "yyyy-MM-dd");
     fechaHasta =
         validaciones.Validacion.fecha(
             jftfFechaHasta.getText().trim(), "dd-MM-yyyy", "yyyy-MM-dd");
     codigoCuentaDesde = jtfCuentaDesde.getText().trim();
     codigoCuentaHasta = jtfCuentaHasta.getText().trim();
     llenarjTBalanceComprobacion();
     codigoSector = var_temporal;
   } catch (java.rmi.RemoteException re) {
     javax.swing.JOptionPane.showMessageDialog(
         null, "Se perdio la conexion. Contacte con el administrador...");
   }
 }
 private void llenarAtributos() {
   fechaDesde =
       jftfFechaDesde.getText().equals("  -  -    ")
           ? null
           : validaciones.Validacion.fecha(jftfFechaDesde.getText(), "dd-MM-yyyy", "yyyy-MM-dd");
   fechaHasta =
       jftfFechaHasta.getText().equals("  -  -    ")
           ? null
           : validaciones.Validacion.fecha(jftfFechaHasta.getText(), "dd-MM-yyyy", "yyyy-MM-dd");
   periodo =
       (jcboPeriodo.getSelectedItem() == null)
           ? null
           : rRHHBBFunciones
               .getRhComboUtilidadesPeriodoTO()
               .get(jcboPeriodo.getSelectedIndex())
               .getUtiDescripcion();
   sector =
       (jcboSector.getSelectedItem() == null)
           ? null
           : bbProduccionSector1
               .getListaPrdListaSectorTO()
               .get(jcboSector.getSelectedIndex())
               .getSecCodigo();
 }
 private void formularioJIFPago(String contable) {
   java.util.List<String> comprobantes = validaciones.Validacion.separar(contable, "|");
   String periodo = comprobantes.get(0);
   String numero = comprobantes.get(2);
   shrimp.cartera.formularios.JIFCarConsultaPagos administrarPagos =
       new shrimp.cartera.formularios.JIFCarConsultaPagos(
           this.mDIShrimp, "Consulta de Pagos", "CONSULTAR", periodo, numero);
   try {
     administrarPagos.setSelected(true);
   } catch (Exception e) {
     shrimp.helper.Excepciones.guardarExcepcionesAC(
         e, getClass().getName(), mDIShrimp.getSisInfoTO());
     requestFocus();
   }
   administrarPagos.setVisible(true);
 }
  /**
   * This method is called from within the constructor to initialize the form. WARNING: Do NOT
   * modify this code. The content of this method is always regenerated by the Form Editor.
   */
  @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    jPanel3 = new javax.swing.JPanel();
    jLabel1 = new javax.swing.JLabel();
    jcboCP = new javax.swing.JComboBox();
    jLabel4 = new javax.swing.JLabel();
    jtfCuentaDesde = new javax.swing.JTextField();
    jLabel8 = new javax.swing.JLabel();
    jftfFechaDesde = new shrimp.validaciones.JFormattedTextFieldDate(false);
    jftfFechaHasta = new shrimp.validaciones.JFormattedTextFieldDate(false);
    jLabel9 = new javax.swing.JLabel();
    jlblNombreCuentaDesde = new javax.swing.JLabel();
    jLabel5 = new javax.swing.JLabel();
    jtfCuentaHasta = new javax.swing.JTextField();
    jlblNombreCuentaHasta = new javax.swing.JLabel();

    jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Filtrado"));
    jPanel3.setLayout(null);

    jLabel1.setFont(new java.awt.Font("DejaVu Sans", 0, 12)); // NOI18N
    jLabel1.setText("<html>Centro de Producción</html>");
    jPanel3.add(jLabel1);
    jLabel1.setBounds(10, 20, 140, 15);

    jcboCP.setFont(new java.awt.Font("Ubuntu", 0, 12)); // NOI18N
    jPanel3.add(jcboCP);
    jcboCP.setBounds(10, 34, 140, 20);

    jLabel4.setFont(new java.awt.Font("DejaVu Sans", 0, 12)); // NOI18N
    jLabel4.setText("Cuenta Desde");
    jPanel3.add(jLabel4);
    jLabel4.setBounds(250, 20, 100, 15);

    jtfCuentaDesde.setFont(new java.awt.Font("DejaVu Sans", 0, 12)); // NOI18N
    jPanel3.add(jtfCuentaDesde);
    jtfCuentaDesde.setBounds(250, 34, 110, 20);

    jLabel8.setFont(new java.awt.Font("DejaVu Sans", 0, 12)); // NOI18N
    jLabel8.setText("Desde");
    jPanel3.add(jLabel8);
    jLabel8.setBounds(160, 20, 80, 15);

    jftfFechaDesde.setValue(validaciones.Validacion.fechaSistema("dd-MM-yyyy"));
    jftfFechaDesde.setValue(
        validaciones.Validacion.fecha(
            validaciones.Validacion.getPrimerDiaDelMes(jftfFechaDesde.getText(), "dd-MM-yyyy"),
            "dd-MM-yyyy"));
    jftfFechaDesde.setFont(new java.awt.Font("DejaVu Sans", 0, 10)); // NOI18N
    jPanel3.add(jftfFechaDesde);
    jftfFechaDesde.setBounds(160, 34, 80, 20);

    jftfFechaHasta.setValue(validaciones.Validacion.fechaSistema("dd-MM-yyyy"));
    jftfFechaHasta.setValue(
        validaciones.Validacion.fecha(
            validaciones.Validacion.getUltimoDiaDelMes(jftfFechaHasta.getText(), "dd-MM-yyyy"),
            "dd-MM-yyyy"));
    jftfFechaHasta.setFont(new java.awt.Font("DejaVu Sans", 0, 10)); // NOI18N
    jPanel3.add(jftfFechaHasta);
    jftfFechaHasta.setBounds(160, 75, 80, 20);

    jLabel9.setFont(new java.awt.Font("DejaVu Sans", 0, 12)); // NOI18N
    jLabel9.setText("Hasta");
    jPanel3.add(jLabel9);
    jLabel9.setBounds(160, 60, 80, 15);

    jlblNombreCuentaDesde.setFont(new java.awt.Font("DejaVu Sans", 0, 12)); // NOI18N
    jlblNombreCuentaDesde.setBorder(
        new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED));
    jPanel3.add(jlblNombreCuentaDesde);
    jlblNombreCuentaDesde.setBounds(360, 34, 150, 20);

    jLabel5.setFont(new java.awt.Font("DejaVu Sans", 0, 12)); // NOI18N
    jLabel5.setText("Cuenta Hasta");
    jPanel3.add(jLabel5);
    jLabel5.setBounds(250, 60, 100, 15);

    jtfCuentaHasta.setFont(new java.awt.Font("DejaVu Sans", 0, 12)); // NOI18N
    jPanel3.add(jtfCuentaHasta);
    jtfCuentaHasta.setBounds(250, 75, 110, 20);

    jlblNombreCuentaHasta.setFont(new java.awt.Font("DejaVu Sans", 0, 12)); // NOI18N
    jlblNombreCuentaHasta.setBorder(
        new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED));
    jPanel3.add(jlblNombreCuentaHasta);
    jlblNombreCuentaHasta.setBounds(360, 75, 150, 20);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addComponent(
                        jPanel3,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        520,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(307, Short.MAX_VALUE)));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addComponent(
                        jPanel3,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        109,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 361, Short.MAX_VALUE)));

    pack();
  } // </editor-fold>//GEN-END:initComponents
  /** Creates new form JIFReporteBalanceGeneral */
  public JIFReporteMayorAuxiliarMultiple(
      shrimp.componentes.GUI.MDIShrimp mDIShrimp,
      String titulo,
      String cuenta,
      String desde,
      String hasta) {
    initComponents();
    this.setVisible(true);
    mDIShrimp.desktopPane.add(this);
    super.inicializar();
    this.setTitle(titulo);
    jPanel3.setBounds(0, 0, 520, 110);
    jPanelDatos.add(jPanel3, jlblNombreCuentaDesde);
    this.cuenta = cuenta;
    ////////////////////////////////////////////////////////
    mDIShrimp.jTabbedPane.setVisible(false);
    this.mDIShrimp = mDIShrimp;
    this.sisUsuarioEmpresaTO = mDIShrimp.getSisUsuarioEmpresaTO();
    guardarParametroAux();
    initCombos();
    tabulacion();
    eventosKeyFormulario();
    eventoKeyPress();
    teclasBotonesCalientes();
    barraEstado(false);
    // guardarParametroAux();
    if (cuenta != null) {
      try {
        this.contabilidadBBCuentas1 = new shrimp.contabilidad.beanbinding.ContabilidadBBCuentas();
        this.contabilidadBBCuentas1.setListaConCuentasTO(
            shrimp.contabilidad.delegate.ContabilidadDelegate.getInstance()
                .getListaBuscarConCuentas(sisUsuarioEmpresaTO.getEmpCodigo(), cuenta, null));

        listaConCuentasTO = contabilidadBBCuentas1.getListaConCuentasTO();

        for (contabilidad.TO.ConCuentasTO conCuentasTO : listaConCuentasTO) {
          if (conCuentasTO.getCuentaCodigo().equals(cuenta)) {

            jlblNombreCuentaDesde.setText(conCuentasTO.getCuentaDetalle().trim());
            break;
          }
        }
      } catch (Exception e) {
        shrimp.helper.Excepciones.guardarExcepcionesAC(
            e, getClass().getName(), mDIShrimp.getSisInfoTO());
      }
    }

    jtable.addMouseListener(
        new java.awt.event.MouseAdapter() {

          public void mouseClicked(java.awt.event.MouseEvent evt) {
            jtblMayorMouseClicked(evt);
          }
        });

    try {
      eventoKeyPressPadre();
      contabilidadBBMayorAuxiliar1 =
          new shrimp.contabilidad.beanbinding.ContabilidadBBMayorAuxiliar();

      obtenerEstructura();
      this.estGrupo1 = listaEstructuraTO.get(0).getEstGrupo1();
      this.estGrupo2 = listaEstructuraTO.get(0).getEstGrupo2();
      this.estGrupo3 = listaEstructuraTO.get(0).getEstGrupo3();
      this.estGrupo4 = listaEstructuraTO.get(0).getEstGrupo4();
      this.estGrupo5 = listaEstructuraTO.get(0).getEstGrupo5();
      this.estGrupo6 = listaEstructuraTO.get(0).getEstGrupo6();
      largoCuenta =
          listaEstructuraTO.get(0).getEstGrupo1()
              + listaEstructuraTO.get(0).getEstGrupo2()
              + listaEstructuraTO.get(0).getEstGrupo3()
              + listaEstructuraTO.get(0).getEstGrupo4()
              + listaEstructuraTO.get(0).getEstGrupo5()
              + listaEstructuraTO.get(0).getEstGrupo6();
      obtenerRangoCuentas();
      llenarCombo();
      if (cuenta != null || desde != null || hasta != null) {
        jtfCuentaDesde.setText(cuenta);
        jftfFechaDesde.setValue(validaciones.Validacion.fecha(desde, "yyyy-MM-dd", "dd-MM-yyyy"));
        jftfFechaHasta.setValue(validaciones.Validacion.fecha(hasta, "yyyy-MM-dd", "dd-MM-yyyy"));
        buscar();
      }
      sisGrupoTO =
          shrimp.sistema.delegate.SistemaDelegate.getInstance()
              .sisGrupoUsuariosTO(mDIShrimp.getSisInfoTO());

    } catch (java.rmi.RemoteException re) {
      javax.swing.JOptionPane.showMessageDialog(
          null, "Se perdio la conexion. Contacte con el administrador o intentelo más tarde...");
      jtable.requestFocus();
      if (jtable.getRowCount() > 0) {
        jtable.changeSelection(0, 0, false, false);
      }
    } catch (javax.ejb.EJBException eje) {
      javax.swing.JOptionPane.showMessageDialog(
          null, "Se perdio la conexion. Contacte con el administrador o intentelo más tarde...");
      jtable.requestFocus();
      if (jtable.getRowCount() > 0) {
        jtable.changeSelection(0, 0, false, false);
      }
    } catch (javax.naming.NameNotFoundException nnfe) {
      javax.swing.JOptionPane.showMessageDialog(
          null, "El programa servidor no esta listo. Intente mas tarde...");
      jtable.requestFocus();
      if (jtable.getRowCount() > 0) {
        jtable.changeSelection(0, 0, false, false);
      }
    } catch (Exception e) {
      shrimp.helper.Excepciones.guardarExcepcionesAC(
          e, getClass().getName(), mDIShrimp.getSisInfoTO());
    }

    jbtnActualizar.addActionListener(
        new java.awt.event.ActionListener() {

          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jbtnActualizarActionPerformed(evt);
          }
        });

    jbtnExportar.addActionListener(
        new java.awt.event.ActionListener() {

          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jbtnExportarActionPerformed(evt);
          }
        });

    jbtnImprimir.addActionListener(
        new java.awt.event.ActionListener() {

          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jbtnImprimirActionPerformed(evt);
          }
        });

    if (cuenta != null) {
      jbtnActualizarActionPerformed(null);
    } else {
      try {
        robot = new Robot();
        robot.keyPress(KeyEvent.VK_ESCAPE);
        robot.keyRelease(KeyEvent.VK_ESCAPE);
      } catch (Exception ex) {
      }
    }
  }
  private void obtenerValoresDescuentoPorcentaje(java.math.BigDecimal valorPorcentaje) {

    java.math.BigDecimal porcentaje =
        new java.math.BigDecimal(
            valorPorcentaje == null ? "0.00" : valorPorcentaje.toString().trim());
    boolean obtenerBoleanoDeTabla = false;

    java.math.BigDecimal subTotalBaseImponibleInicial = new java.math.BigDecimal("0.00");
    java.math.BigDecimal descuentoBaseImponible = new java.math.BigDecimal("0.00");
    java.math.BigDecimal subTotalBaseCeroInicial = new java.math.BigDecimal("0.00");
    java.math.BigDecimal descuentoBaseCero = new java.math.BigDecimal("0.00");
    for (int j = 0; j < tabla.getRowCount(); j++) {
      obtenerBoleanoDeTabla =
          Boolean.valueOf(tabla.getValueAt(j, buscarColumna("IVA?", tabla)).toString());
      //                if (obtenerBoleanoDeTabla)
      //                    iva12 = iva12.add(new java.math.BigDecimal(table.getValueAt(i,
      // buscarColumna("Subtotal"))==null || table.getValueAt(i,
      // buscarColumna("Subtotal")).toString().trim().isEmpty() ? "0.00" : table.getValueAt(i,
      // buscarColumna("Subtotal")).toString().trim()));
      //                else
      //                    iva0 = iva0.add(new java.math.BigDecimal(table.getValueAt(i,
      // buscarColumna("Subtotal"))==null || table.getValueAt(i,
      // buscarColumna("Subtotal")).toString().trim().isEmpty() ? "0.00" : table.getValueAt(i,
      // buscarColumna("Subtotal")).toString().trim()));
      if (obtenerBoleanoDeTabla) {
        subTotalBaseImponibleInicial =
            subTotalBaseImponibleInicial.add(
                new java.math.BigDecimal(
                    tabla.getValueAt(j, buscarColumna("Parcial", tabla)) == null
                            || tabla
                                .getValueAt(j, buscarColumna("Parcial", tabla))
                                .toString()
                                .trim()
                                .isEmpty()
                        ? "0.00"
                        : tabla.getValueAt(j, buscarColumna("Parcial", tabla)).toString().trim()));

        descuentoBaseImponible =
            descuentoBaseImponible.add(
                new java.math.BigDecimal(
                    tabla.getValueAt(j, buscarColumna("Descuento", tabla)) == null
                            || tabla
                                .getValueAt(j, buscarColumna("Descuento", tabla))
                                .toString()
                                .trim()
                                .isEmpty()
                        ? "0.00"
                        : tabla
                            .getValueAt(j, buscarColumna("Descuento", tabla))
                            .toString()
                            .trim()));
      } else {
        subTotalBaseCeroInicial =
            subTotalBaseCeroInicial.add(
                new java.math.BigDecimal(
                    tabla.getValueAt(j, buscarColumna("Parcial", tabla)) == null
                            || tabla
                                .getValueAt(j, buscarColumna("Parcial", tabla))
                                .toString()
                                .trim()
                                .isEmpty()
                        ? "0.00"
                        : tabla.getValueAt(j, buscarColumna("Parcial", tabla)).toString().trim()));
        descuentoBaseCero =
            descuentoBaseCero.add(
                new java.math.BigDecimal(
                    tabla.getValueAt(j, buscarColumna("Descuento", tabla)) == null
                            || tabla
                                .getValueAt(j, buscarColumna("Descuento", tabla))
                                .toString()
                                .trim()
                                .isEmpty()
                        ? "0.00"
                        : tabla
                            .getValueAt(j, buscarColumna("Descuento", tabla))
                            .toString()
                            .trim()));
      }
    }
    totalDescuento = descuentoBaseCero.add(descuentoBaseImponible);

    java.math.BigDecimal ivaVigente =
        jIFProformas != null
            ? new java.math.BigDecimal(jIFProformas.ivaVigente.toString())
            : new java.math.BigDecimal(jIFProformasModificar.ivaVigente.toString());

    try {
      if (jIFProformas != null) {
        //// PARA CALCULAR LOS TOTALES
        /** ************************************************************************* */
        jIFProformas.descuentoBaseCero = descuentoBaseCero;
        jIFProformas.descuentoBaseImponible = descuentoBaseImponible;
        //
        //
        // if(subTotalBaseCeroInicial.subtract(descuentoBaseCero).add(subTotalBaseImponibleInicial.subtract(descuentoBaseImponible)).compareTo(jIFProformas.mDIShrimp.getCero()) != 0){
        //                    jIFProformas.descuentoGeneralCero =
        // jIFProformas.descuentoGeneral.divide(subTotalBaseCeroInicial.subtract(descuentoBaseCero).
        //
        // add(subTotalBaseImponibleInicial.subtract(descuentoBaseImponible)), 17,
        // java.math.RoundingMode.HALF_EVEN).multiply(subTotalBaseCeroInicial.subtract(descuentoBaseCero), new java.math.MathContext(17, java.math.RoundingMode.HALF_EVEN));
        //
        //                    jIFProformas.descuentoGeneralImponible =
        // jIFProformas.descuentoGeneral.divide(subTotalBaseCeroInicial.subtract(descuentoBaseCero).
        //
        // add(subTotalBaseImponibleInicial.subtract(descuentoBaseImponible)), 17,
        // java.math.RoundingMode.HALF_EVEN).multiply(subTotalBaseImponibleInicial.subtract(descuentoBaseImponible), new java.math.MathContext(17, java.math.RoundingMode.HALF_EVEN));
        //                } else {
        //                    jIFProformas.descuentoGeneralCero = jIFProformas.mDIShrimp.getCero();
        //                    jIFProformas.descuentoGeneralImponible =
        // jIFProformas.mDIShrimp.getCero();
        //                }

        jIFProformas.subtotalBaseCero =
            validaciones.Validacion.redondeoDecimalBigDecimal(
                    subTotalBaseCeroInicial.subtract(jIFProformas.descuentoBaseCero),
                    2,
                    java.math.RoundingMode.UP)
                .add(jIFProformas.mDIShrimp.getCero());

        jIFProformas.subtotalBaseImponible =
            validaciones.Validacion.redondeoDecimalBigDecimal(
                    subTotalBaseImponibleInicial.subtract(jIFProformas.descuentoBaseImponible),
                    2,
                    java.math.RoundingMode.UP)
                .add(jIFProformas.mDIShrimp.getCero());

        /** ************************************************************************* */

        /** ************************************************************************* */
        //// PARA PONER LOS TOTALES EN EL FORMULARIO

        java.math.BigDecimal iva =
            jIFProformas
                .subtotalBaseImponible
                .multiply(ivaVigente)
                .divide(new java.math.BigDecimal("100.00"), java.math.RoundingMode.HALF_EVEN);
        java.math.BigDecimal totalFinal =
            jIFProformas.subtotalBaseCero.add(jIFProformas.subtotalBaseImponible).add(iva);

        jIFProformas.jtfParcialCero.setText(
            validaciones.Validacion.redondeoDecimalBigDecimal(
                    subTotalBaseCeroInicial, 2, java.math.RoundingMode.UP)
                .add(jIFProformas.mDIShrimp.getCero())
                .toString());

        jIFProformas.jtfParcialImponible.setText(
            validaciones.Validacion.redondeoDecimalBigDecimal(
                    subTotalBaseImponibleInicial, 2, java.math.RoundingMode.UP)
                .add(jIFProformas.mDIShrimp.getCero())
                .toString());

        jIFProformas.jtfDescuentoCero.setText(
            validaciones.Validacion.redondeoDecimalBigDecimal(
                    jIFProformas.descuentoBaseCero, 2, java.math.RoundingMode.UP)
                .add(jIFProformas.mDIShrimp.getCero())
                .toString());

        jIFProformas.jtfDescuentoImponible.setText(
            validaciones.Validacion.redondeoDecimalBigDecimal(
                    jIFProformas.descuentoBaseImponible, 2, java.math.RoundingMode.UP)
                .add(jIFProformas.mDIShrimp.getCero())
                .toString());

        jIFProformas.jtfSubtotalCero.setText(
            validaciones.Validacion.redondeoDecimalBigDecimal(
                    jIFProformas.subtotalBaseCero, 2, java.math.RoundingMode.UP)
                .add(jIFProformas.mDIShrimp.getCero())
                .toString());

        jIFProformas.jtfSubtotalImponible.setText(
            validaciones.Validacion.redondeoDecimalBigDecimal(
                    jIFProformas.subtotalBaseImponible, 2, java.math.RoundingMode.UP)
                .add(jIFProformas.mDIShrimp.getCero())
                .toString());

        jIFProformas.jtfIva.setText(
            validaciones.Validacion.redondeoDecimalBigDecimal(iva, 2, java.math.RoundingMode.UP)
                .add(jIFProformas.mDIShrimp.getCero())
                .toString());

        jIFProformas.jtfTotal.setText(
            validaciones.Validacion.redondeoDecimalBigDecimal(
                    totalFinal, 2, java.math.RoundingMode.UP)
                .add(jIFProformas.mDIShrimp.getCero())
                .toString());

      } else {
        //// PARA CALCULAR LOS TOTALES
        /** ************************************************************************* */
        jIFProformasModificar.descuentoBaseCero = descuentoBaseCero;
        jIFProformasModificar.descuentoBaseImponible = descuentoBaseImponible;
        //
        //
        // if(subTotalBaseCeroInicial.subtract(descuentoBaseCero).add(subTotalBaseImponibleInicial.subtract(descuentoBaseImponible)).compareTo(jIFProformasModificar.mDIShrimp.getCero()) != 0){
        //                    jIFProformasModificar.descuentoGeneralCero =
        // jIFProformasModificar.descuentoGeneral.divide(subTotalBaseCeroInicial.subtract(descuentoBaseCero).
        //
        // add(subTotalBaseImponibleInicial.subtract(descuentoBaseImponible)), 17,
        // java.math.RoundingMode.HALF_EVEN).multiply(subTotalBaseCeroInicial.subtract(descuentoBaseCero), new java.math.MathContext(17, java.math.RoundingMode.HALF_EVEN));
        //
        //                    jIFProformasModificar.descuentoGeneralImponible =
        // jIFProformasModificar.descuentoGeneral.divide(subTotalBaseCeroInicial.subtract(descuentoBaseCero).
        //
        // add(subTotalBaseImponibleInicial.subtract(descuentoBaseImponible)), 17,
        // java.math.RoundingMode.HALF_EVEN).multiply(subTotalBaseImponibleInicial.subtract(descuentoBaseImponible), new java.math.MathContext(17, java.math.RoundingMode.HALF_EVEN));
        //                } else {
        //                    jIFProformasModificar.descuentoGeneralCero =
        // jIFProformasModificar.mDIShrimp.getCero();
        //                    jIFProformasModificar.descuentoGeneralImponible =
        // jIFProformasModificar.mDIShrimp.getCero();
        //                }

        jIFProformasModificar.subtotalBaseCero =
            validaciones.Validacion.redondeoDecimalBigDecimal(
                    subTotalBaseCeroInicial.subtract(jIFProformasModificar.descuentoBaseCero),
                    2,
                    java.math.RoundingMode.UP)
                .add(jIFProformasModificar.mDIShrimp.getCero());

        jIFProformasModificar.subtotalBaseImponible =
            validaciones.Validacion.redondeoDecimalBigDecimal(
                    subTotalBaseImponibleInicial.subtract(
                        jIFProformasModificar.descuentoBaseImponible),
                    2,
                    java.math.RoundingMode.UP)
                .add(jIFProformasModificar.mDIShrimp.getCero());

        /** ************************************************************************* */

        /** ************************************************************************* */
        //// PARA PONER LOS TOTALES EN EL FORMULARIO

        java.math.BigDecimal iva =
            jIFProformasModificar
                .subtotalBaseImponible
                .multiply(ivaVigente)
                .divide(new java.math.BigDecimal("100.00"), java.math.RoundingMode.HALF_EVEN);
        java.math.BigDecimal totalFinal =
            jIFProformasModificar
                .subtotalBaseCero
                .add(jIFProformasModificar.subtotalBaseImponible)
                .add(iva);

        jIFProformasModificar.jtfParcialCero.setText(
            validaciones.Validacion.redondeoDecimalBigDecimal(
                    subTotalBaseCeroInicial, 2, java.math.RoundingMode.UP)
                .add(jIFProformasModificar.mDIShrimp.getCero())
                .toString());

        jIFProformasModificar.jtfParcialImponible.setText(
            validaciones.Validacion.redondeoDecimalBigDecimal(
                    subTotalBaseImponibleInicial, 2, java.math.RoundingMode.UP)
                .add(jIFProformasModificar.mDIShrimp.getCero())
                .toString());

        jIFProformasModificar.jtfDescuentoCero.setText(
            validaciones.Validacion.redondeoDecimalBigDecimal(
                    jIFProformasModificar.descuentoBaseCero, 2, java.math.RoundingMode.UP)
                .add(jIFProformasModificar.mDIShrimp.getCero())
                .toString());

        jIFProformasModificar.jtfDescuentoImponible.setText(
            validaciones.Validacion.redondeoDecimalBigDecimal(
                    jIFProformasModificar.descuentoBaseImponible, 2, java.math.RoundingMode.UP)
                .add(jIFProformasModificar.mDIShrimp.getCero())
                .toString());

        jIFProformasModificar.jtfSubtotalCero.setText(
            validaciones.Validacion.redondeoDecimalBigDecimal(
                    jIFProformasModificar.subtotalBaseCero, 2, java.math.RoundingMode.UP)
                .add(jIFProformasModificar.mDIShrimp.getCero())
                .toString());

        jIFProformasModificar.jtfSubtotalImponible.setText(
            validaciones.Validacion.redondeoDecimalBigDecimal(
                    jIFProformasModificar.subtotalBaseImponible, 2, java.math.RoundingMode.UP)
                .add(jIFProformasModificar.mDIShrimp.getCero())
                .toString());

        jIFProformasModificar.jtfIva.setText(
            validaciones.Validacion.redondeoDecimalBigDecimal(iva, 2, java.math.RoundingMode.UP)
                .add(jIFProformasModificar.mDIShrimp.getCero())
                .toString());

        jIFProformasModificar.jtfTotal.setText(
            validaciones.Validacion.redondeoDecimalBigDecimal(
                    totalFinal, 2, java.math.RoundingMode.UP)
                .add(jIFProformasModificar.mDIShrimp.getCero())
                .toString());
      }
    } catch (Exception e) {
      shrimp.helper.JDVentanaMensajes.showMessageDialog(
          new javax.swing.JFrame(),
          "Ha ocurrido un error inesperado en el formulario",
          javax.swing.JOptionPane.ERROR_MESSAGE,
          javax.swing.JOptionPane.DEFAULT_OPTION,
          e,
          null);
      e.printStackTrace();
    }
  }
Beispiel #13
0
  private void guardarExcel() throws Exception {
    java.util.List<String> listaCabecera = new java.util.ArrayList();
    java.util.List<String> listaCuerpo = new java.util.ArrayList();

    java.math.BigDecimal cero = new java.math.BigDecimal("0.00");
    desde = jftfDesde.getValue() == null ? "" : jftfDesde.getText();
    hasta = jftfHasta.getValue() == null ? "" : jftfHasta.getText();

    listaCabecera.add("S" + sisUsuarioEmpresaTO.getEmpRazonSocial());
    listaCabecera.add("SReporte de Pesca");
    listaCabecera.add("SDesde: " + desde + " Hasta: " + hasta);
    listaCabecera.add("S");

    listaCuerpo.add(
        "SSect."
            + "¬"
            + "SPisc."
            + "¬"
            + "SHas."
            + "¬"
            + "SCor."
            + "¬"
            + "SSiembra"
            + "¬"
            + "SPesca"
            + "¬"
            + "SDías"
            + "¬"
            + "SN.Larvas"
            + "¬"
            + "SDensidad."
            + "¬"
            + "SLab."
            + "¬"
            + "SNauplio."
            + "¬"
            + "SBalanceado"
            + "¬"
            + "SBiomasa Proy."
            + "¬"
            + "SBiomasa Real"
            + "¬"
            + "SLibrasxHas."
            + "¬"
            + "SConv. Al."
            + "¬"
            + "SGra. Prom."
            + "¬"
            + "SGra. Ideal"
            + "¬"
            + "SSobrev."
            + "¬"
            + "SCosto"
            + "¬"
            + "SVenta"
            + "¬"
            + "SResul."
            + "¬"
            + "SCostoxHas."
            + "¬"
            + "SVentaxHas."
            + "¬"
            + "SResultxHas."
            + "¬"
            + "SCostoxLb."
            + "¬"
            + "SVentaxLb."
            + "¬"
            + "SResultxLb."
            + "¬"
            + "SResultDia");
    for (produccion.TO.PrdResumenCorridaTO prdResumenCorridaTO :
        bbResumenCorrida1.getListaPrdListaResumenCorridaTO()) {

      listaCuerpo.add(
          (prdResumenCorridaTO.getSecCodigo() == null
                  ? "S"
                  : "S" + prdResumenCorridaTO.getSecCodigo())
              + "¬"
              + (prdResumenCorridaTO.getPisNumero() == null
                  ? "S"
                  : "S" + prdResumenCorridaTO.getPisNumero())
              + "¬"
              + (prdResumenCorridaTO.getRcHectareaje() == null
                  ? "D"
                  : "D" + prdResumenCorridaTO.getRcHectareaje().toString())
              + "¬"
              + (prdResumenCorridaTO.getRcCorridaNumero() == null
                  ? "S"
                  : "S" + prdResumenCorridaTO.getRcCorridaNumero().toString())
              + "¬"
              + (prdResumenCorridaTO.getRcFechaSiembra() == null
                  ? "S"
                  : "S" + prdResumenCorridaTO.getRcFechaSiembra().toString())
              + "¬"
              + (prdResumenCorridaTO.getRcFechaPesca() == null
                  ? "S"
                  : "S" + prdResumenCorridaTO.getRcFechaPesca().toString())
              + "¬"
              + (prdResumenCorridaTO.getRcEdad() == null
                  ? "C"
                  : "C" + prdResumenCorridaTO.getRcEdad().toString())
              + "¬"
              + (prdResumenCorridaTO.getRcNumeroLarvas() == null
                  ? "C"
                  : "C" + prdResumenCorridaTO.getRcNumeroLarvas().toString())
              + "¬"
              + (prdResumenCorridaTO.getRcDensidad() == null
                  ? "C"
                  : "C" + prdResumenCorridaTO.getRcDensidad().toString())
              + "¬"
              + (prdResumenCorridaTO.getRcLaboratorio() == null
                  ? "S"
                  : "S" + prdResumenCorridaTO.getRcLaboratorio().toString())
              + "¬"
              + (prdResumenCorridaTO.getRcNauplio() == null
                  ? "S"
                  : "S" + prdResumenCorridaTO.getRcNauplio().toString())
              + "¬"
              + (prdResumenCorridaTO.getRcLibrasBalanceados() == null
                  ? "C"
                  : "C" + prdResumenCorridaTO.getRcLibrasBalanceados().toString())
              + "¬"
              + (prdResumenCorridaTO.getRcBiomasa() == null
                  ? "C"
                  : "C" + prdResumenCorridaTO.getRcBiomasa().toString())
              + "¬"
              + (prdResumenCorridaTO.getRcBiomasaReal() == null
                  ? "C"
                  : "C" + prdResumenCorridaTO.getRcBiomasaReal().toString())
              + "¬"
              + (prdResumenCorridaTO.getRcBiomasaReal() == null
                      || prdResumenCorridaTO.getRcHectareaje() == null
                      || prdResumenCorridaTO.getRcHectareaje().compareTo(cero) == 0
                  ? "C"
                  : "C"
                      + String.valueOf(
                          prdResumenCorridaTO
                              .getRcBiomasaReal()
                              .divide(
                                  prdResumenCorridaTO.getRcHectareaje(),
                                  2,
                                  java.math.RoundingMode.HALF_UP)
                              .intValue()))
              + "¬"
              + (prdResumenCorridaTO.getRcConversion() == null
                  ? "D"
                  : "D" + prdResumenCorridaTO.getRcConversion().toString())
              + "¬"
              + (prdResumenCorridaTO.getRcTPromedio() == null
                  ? "D"
                  : "D" + prdResumenCorridaTO.getRcTPromedio().toString())
              + "¬"
              + (prdResumenCorridaTO.getRcPesoIdeal() == null
                  ? "D"
                  : "D" + prdResumenCorridaTO.getRcPesoIdeal().toString())
              + "¬"
              + (prdResumenCorridaTO.getRcSobrevivencia() == null
                  ? "S"
                  : "S" + prdResumenCorridaTO.getRcSobrevivencia().toString())
              + "¬"
              + (prdResumenCorridaTO.getRcCosto() == null
                  ? "D"
                  : "D" + prdResumenCorridaTO.getRcCosto().toString())
              + "¬"
              + (prdResumenCorridaTO.getRcValorVenta() == null
                  ? "D"
                  : "D" + prdResumenCorridaTO.getRcValorVenta().toString())
              + "¬"
              + (prdResumenCorridaTO.getRcResultado() == null
                  ? "D"
                  : "D" + prdResumenCorridaTO.getRcResultado().toString())
              + "¬"
              + (prdResumenCorridaTO.getRcCostoHectarea() == null
                  ? "D"
                  : "D" + prdResumenCorridaTO.getRcCostoHectarea().toString())
              + "¬"
              + (prdResumenCorridaTO.getRcVentaHectarea() == null
                  ? "D"
                  : "D" + prdResumenCorridaTO.getRcVentaHectarea().toString())
              + "¬"
              + (prdResumenCorridaTO.getRcResultadoHectarea() == null
                  ? "D"
                  : "D" + prdResumenCorridaTO.getRcResultadoHectarea().toString())
              + "¬"
              + (prdResumenCorridaTO.getRcCostoLibra() == null
                  ? "D"
                  : "D" + prdResumenCorridaTO.getRcCostoLibra().toString())
              + "¬"
              + (prdResumenCorridaTO.getRcVentaLibra() == null
                  ? "D"
                  : "D" + prdResumenCorridaTO.getRcVentaLibra().toString())
              + "¬"
              + (prdResumenCorridaTO.getRcResultadoLibra() == null
                  ? "D"
                  : "D" + prdResumenCorridaTO.getRcResultadoLibra().toString())
              + "¬"
              + (prdResumenCorridaTO.getRcResultadoLibra() == null
                      || prdResumenCorridaTO.getRcEdad() == null
                      || prdResumenCorridaTO.getRcEdad().compareTo(cero) == 0
                  ? "D"
                  : "D"
                      + validaciones.Validacion.redondeoDecimalBigDecimal(
                              prdResumenCorridaTO
                                  .getRcResultadoHectarea()
                                  .divide(
                                      prdResumenCorridaTO.getRcEdad(),
                                      2,
                                      java.math.RoundingMode.HALF_UP))
                          .toString())
              + "¬");
    }
    long nombreFichero =
        java.util.Calendar.getInstance(java.util.TimeZone.getTimeZone("America/Guayaquil"))
            .getTime()
            .getTime();
    shrimp.validaciones.GenerarExcel.crearExcel(
        listaCabecera, listaCuerpo, "TODOCOMPU", "tmp/" + nombreFichero + ".xls");
    shrimp.validaciones.Fichero.abrirFichero("tmp/" + nombreFichero + ".xls");
  }
Beispiel #14
0
  /** Creates new form JIFResumenPesca */
  public JIFResumenPesca(shrimp.componentes.GUI.MDIShrimp mDIShrimp, String titulo) {

    mDIShrimp.jTabbedPane.setVisible(false);
    this.mDIShrimp = mDIShrimp;
    this.sisUsuarioEmpresaTO = mDIShrimp.getSisUsuarioEmpresaTO();
    empresa = this.sisUsuarioEmpresaTO.getEmpCodigo();
    try {
      eventoKeyPressPadre();
      initComponents();
      super.inicializar();
      this.setTitle(titulo);
      initCombos();
      jPanel1.setBounds(0, 0, 350, 110);
      jPanelDatos.add(jPanel1);
      teclasBotonesCalientes();
      eventosKeyFormulario();
      tabulacion();
      eventoKeyPress();
      barraEstado(false);
      manejoControlesBotones(true);

      desde = null;
      hasta = null;
      empresa = "¬";

      llenarBindingGroup();
      empresa = sisUsuarioEmpresaTO.getEmpCodigo();
      llenarCombo();

      fechaServidor = ProduccionDelegate.getInstance().consultarFechaMaxMin(empresa, tipoResumen);
      if (!fechaServidor.trim().isEmpty()) {
        desdeOriginal = fechaServidor.substring(0, fechaServidor.indexOf(",") - 1);
        hastaOriginal = fechaServidor.substring(fechaServidor.indexOf(",") + 1);
        jftfDesde.setValue(
            validaciones.Validacion.fecha(desdeOriginal, "yyyy-MM-dd", "dd-MM-yyyy"));
        jftfHasta.setValue(
            validaciones.Validacion.fecha(hastaOriginal, "yyyy-MM-dd", "dd-MM-yyyy"));
        this.setVisible(true);
        mDIShrimp.desktopPane.add(this);
      } else {
        JOptionPane.showMessageDialog(null, "No existen datos en corrida");
      }
      jbtnActualizar.addActionListener(
          new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
              jbtnReconstruirActualizarActionPerformed(evt);
            }
          });
      jbtnImprimir.addActionListener(
          new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
              jbtnImprimirActionPerformed(evt);
            }
          });
      jbtnExportar.addActionListener(
          new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
              jbtnExportarActionPerformed(evt);
            }
          });

      try {
        String aux = codigoSector;
        this.codigoSector = "'@'";
        llenarjTable();
        this.codigoSector = aux;
      } catch (Exception ex) {
        shrimp.helper.Excepciones.guardarExcepcionesAC(
            ex, getClass().getName(), mDIShrimp.getSisInfoTO());
      }
    } catch (java.rmi.RemoteException re) {
      JOptionPane.showMessageDialog(
          null, "Se perdio la conexion. Contacte con el administrador...");
    } catch (javax.ejb.EJBException eje) {
      JOptionPane.showMessageDialog(
          null, "Se perdio la conexion. Contacte con el administrador...");
    } catch (NameNotFoundException nnfe) {
      JOptionPane.showMessageDialog(
          null, "El programa servidor no esta listo. Intente mas tarde...");
    } catch (Exception e) {
      shrimp.helper.Excepciones.guardarExcepcionesAC(
          e, getClass().getName(), mDIShrimp.getSisInfoTO());
    }

    try {
      robot = new Robot();
      robot.keyPress(KeyEvent.VK_ESCAPE);
      robot.keyRelease(KeyEvent.VK_ESCAPE);
    } catch (Exception ex) {
    }
  }