Beispiel #1
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 #3
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());
    }
  }
 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();
 }
  /**
   * 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) {
      }
    }
  }
Beispiel #8
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) {
    }
  }