You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
(5) |
May
(4) |
Jun
(12) |
Jul
|
Aug
|
Sep
(16) |
Oct
(4) |
Nov
|
Dec
|
---|
From: <the...@us...> - 2007-10-21 15:43:27
|
Revision: 52 http://opaloerp.svn.sourceforge.net/opaloerp/?rev=52&view=rev Author: thegenius03 Date: 2007-10-21 08:43:30 -0700 (Sun, 21 Oct 2007) Log Message: ----------- - Funcionalidades agregadas - Campo agregado a las clases Direccion y Contacto: borrado. - Borrado de Direcciones. - Borrado de Contactos. - Modulo de Proveedores FINALIZADO. Modified Paths: -------------- OpaloERP/src/frontend/proveedor/DgCrearProveedor.java OpaloERP/src/frontend/proveedor/IAdministrarProveedor.java OpaloERP/src/mensaje_objetos/cliente/Contacto.java OpaloERP/src/mensaje_objetos/cliente/Direccion.java OpaloERP/src/modelo_objetos/productos/ModeloProductosDelProveedor.java Modified: OpaloERP/src/frontend/proveedor/DgCrearProveedor.java =================================================================== --- OpaloERP/src/frontend/proveedor/DgCrearProveedor.java 2007-10-20 04:21:14 UTC (rev 51) +++ OpaloERP/src/frontend/proveedor/DgCrearProveedor.java 2007-10-21 15:43:30 UTC (rev 52) @@ -493,7 +493,7 @@ txtTelefono2.setEnabled(ena); } - public void execute() + public boolean execute() { Proveedor p = this.proveedorSeleccionado; this.setDireccionPrincipal(p); @@ -509,7 +509,10 @@ { modeloProveedor.updateProveedor(p); } - } + return true; + } + + return false; } public boolean validarCampos() @@ -1953,15 +1956,19 @@ JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); if(respuesta == JOptionPane.OK_OPTION) { - modeloProductoProv.removeProducto(productoprovSeleccionado); + productoprovSeleccionado.setBorrado(true); + modeloProductoProv.updateProducto(productoprovSeleccionado); + + productoTable.remove(productoprovSeleccionado); + productoprovSeleccionado = null; this.inicializarTablaProductos(); } } else { - JOptionPane.showMessageDialog(this,"Debes elegir una direccion" + - " para realizar esta operaci\u00f3n", "Seleccione una direccion", JOptionPane.WARNING_MESSAGE); + JOptionPane.showMessageDialog(this,"Debes elegir un producto" + + " para realizar esta operaci\u00f3n", "Seleccione un producto", JOptionPane.WARNING_MESSAGE); } }//GEN-LAST:event_btnRemoverProductoActionPerformed @@ -1984,15 +1991,27 @@ contactoSeleccionado = getSelectedContacto(); if(contactoSeleccionado != null) { + if(contactoSeleccionado != contactoTable.get(0)) + { int respuesta = JOptionPane.showConfirmDialog(this, "\u00bfEst\u00e1 seguro de que desea" + " eliminar este contacto", "Confirmar borrado de contacto", JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); if(respuesta == JOptionPane.OK_OPTION) { - modeloContacto.removeContacto(contactoSeleccionado); + contactoSeleccionado.setBorrado(true); + modeloContacto.updateContacto(contactoSeleccionado); + + contactoTable.remove(contactoSeleccionado); + contactoSeleccionado = null; this.inicializarTablaContacto(); } + } + else + { + JOptionPane.showMessageDialog(this,"El contacto principal no puede ser modificado de esta manera" + , "Seleccione un contacto", JOptionPane.WARNING_MESSAGE); + } } else { @@ -2006,15 +2025,27 @@ direccionSeleccionada = getSelectedDireccion(); if(direccionSeleccionada != null) { + if(direccionSeleccionada != direccionTable.get(0)) + { int respuesta = JOptionPane.showConfirmDialog(this, "Esta seguro de que desea" + " eliminar esta direccion", "Confirmar borrado de direccion", JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); if(respuesta == JOptionPane.OK_OPTION) { - modeloDireccion.removeDireccion(direccionSeleccionada); + direccionSeleccionada.setBorrado(true); + modeloDireccion.updateDireccion(direccionSeleccionada); + + direccionTable.remove(direccionSeleccionada); + direccionSeleccionada = null; this.inicializarTablaDireccion(); } + } + else + { + JOptionPane.showMessageDialog(this,"La direccion principal no puede ser modificada de esta manera" + , "Seleccione una direccion", JOptionPane.WARNING_MESSAGE); + } } else { @@ -2030,7 +2061,7 @@ private void btnSalvarCerrarActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnSalvarCerrarActionPerformed {//GEN-HEADEREND:event_btnSalvarCerrarActionPerformed - execute(); + if(execute()) dispose(); }//GEN-LAST:event_btnSalvarCerrarActionPerformed Modified: OpaloERP/src/frontend/proveedor/IAdministrarProveedor.java =================================================================== --- OpaloERP/src/frontend/proveedor/IAdministrarProveedor.java 2007-10-20 04:21:14 UTC (rev 51) +++ OpaloERP/src/frontend/proveedor/IAdministrarProveedor.java 2007-10-21 15:43:30 UTC (rev 52) @@ -70,44 +70,38 @@ Proveedor proveedor=proveedorTable.get(rowIndex); if(proveedor!=null) { - if(!proveedor.getBorrado()) + if(columnIndex==0) { - if(columnIndex==0) - { - return proveedor.getCodigo(); - } - if(columnIndex==1) - { - return proveedor.getNombre(); - } - if(columnIndex==2) - { - return proveedor.getRnc(); - } - if(columnIndex==3) - { - return proveedor.getCedula(); - } - if(columnIndex==4) - { - return proveedor.getTipoDePago(); - } - if(columnIndex==5) - { - return proveedor.getLimiteDeCredito(); - } - if(columnIndex==6) - { - return proveedor.getLimiteDias(); - } - if(columnIndex==7) - { - return proveedor.getPorcMora(); - } + return proveedor.getCodigo(); } - else + if(columnIndex==1) { + return proveedor.getNombre(); } + if(columnIndex==2) + { + return proveedor.getRnc(); + } + if(columnIndex==3) + { + return proveedor.getCedula(); + } + if(columnIndex==4) + { + return proveedor.getTipoDePago(); + } + if(columnIndex==5) + { + return proveedor.getLimiteDeCredito(); + } + if(columnIndex==6) + { + return proveedor.getLimiteDias(); + } + if(columnIndex==7) + { + return proveedor.getPorcMora(); + } } return ""; } Modified: OpaloERP/src/mensaje_objetos/cliente/Contacto.java =================================================================== --- OpaloERP/src/mensaje_objetos/cliente/Contacto.java 2007-10-20 04:21:14 UTC (rev 51) +++ OpaloERP/src/mensaje_objetos/cliente/Contacto.java 2007-10-21 15:43:30 UTC (rev 52) @@ -42,6 +42,7 @@ private String fax; private Cliente cliente; private String cargo; + private boolean borrado = false; @Id @GeneratedValue(generator="SEQ",strategy=GenerationType.AUTO) @@ -105,16 +106,20 @@ public void setCargo(String cargo) { this.cargo = cargo; } + + + public boolean isBorrado() + { + return borrado; + } + + public void setBorrado(boolean borrado) { + this.borrado = borrado; + } // @ManyToOne(fetch=FetchType.EAGER) // public Proveedor getContactos() { // return contactos; // } - public void setContactos(Proveedor contactos) { - this.contactos = contactos; - } - - - } Modified: OpaloERP/src/mensaje_objetos/cliente/Direccion.java =================================================================== --- OpaloERP/src/mensaje_objetos/cliente/Direccion.java 2007-10-20 04:21:14 UTC (rev 51) +++ OpaloERP/src/mensaje_objetos/cliente/Direccion.java 2007-10-21 15:43:30 UTC (rev 52) @@ -25,6 +25,7 @@ private Provincia provincia; private Pais pais; private Region region; + private boolean borrado = false; @Id @@ -84,6 +85,16 @@ public void setRegion(Region region) { this.region = region; } + + public boolean isBorrado() + { + return borrado; + } + + public void setBorrado(boolean borrado) + { + this.borrado = borrado; + } } Modified: OpaloERP/src/modelo_objetos/productos/ModeloProductosDelProveedor.java =================================================================== --- OpaloERP/src/modelo_objetos/productos/ModeloProductosDelProveedor.java 2007-10-20 04:21:14 UTC (rev 51) +++ OpaloERP/src/modelo_objetos/productos/ModeloProductosDelProveedor.java 2007-10-21 15:43:30 UTC (rev 52) @@ -38,7 +38,8 @@ /** Creates a new instance of ModeloProductosDelProveedor */ - private ModeloProductosDelProveedor() { + private ModeloProductosDelProveedor() + { conn=Conexion.getConexion(); subjectAdd=new SubjectHelper(); @@ -49,52 +50,64 @@ } - public static SubjectHelper getSubjectAdd() { + public static SubjectHelper getSubjectAdd() + { return subjectAdd; } - public static SubjectHelper getSubjectRemove() { + public static SubjectHelper getSubjectRemove() + { return subjectRemove; } - public static SubjectHelper getSubjectUpdate() { + public static SubjectHelper getSubjectUpdate() + { return subjectUpdate; } - public static SubjectHelper getSubjectSaveOrUpdate() { + public static SubjectHelper getSubjectSaveOrUpdate() + { return subjectSaveOrUpdate; } /** *Intancia de la clase. */ - public static ModeloProductosDelProveedor getInstance() { - if(modelo==null) { + public static ModeloProductosDelProveedor getInstance() + { + if(modelo==null) + { modelo=new ModeloProductosDelProveedor(); } return modelo; } - public static SubjectHelper getSubjectMensaje() { + public static SubjectHelper getSubjectMensaje() + { return subjectMensaje; } /**Metodo para insertar un producto*/ - public void addProducto(ProductosDelProveedor producto){ - if(!existProducto(producto)){ + public void addProducto(ProductosDelProveedor producto) + { + if(!existProducto(producto)) + { Session sl=conn.getSession(); Transaction tx=sl.beginTransaction(); sl.save(producto); tx.commit(); getSubjectAdd().notify(ModeloProductosDelProveedor.class,producto,"addProductoDelProveedor"); sl.close(); - } else { + } + else + { getSubjectMensaje().notify(ModeloProductosDelProveedor.class,"Existe un producto con este codigo","mensaje"); } } /**Metodo para borrar un producto*/ - public void removeProducto(ProductosDelProveedor producto) { + public void removeProducto(ProductosDelProveedor producto) + { Session sl=conn.getSession(); Transaction tx=sl.beginTransaction(); sl.delete(producto); @@ -104,23 +117,28 @@ } /**Metodo para saber si un producto esta registrado*/ - private boolean existProducto(ProductosDelProveedor producto) { + private boolean existProducto(ProductosDelProveedor producto) + { Session ss=conn.getSession(); String hql="From ProductosDelProveedor P WHERE P.codigo=?"; Query q=ss.createQuery(hql); q.setString(0,producto.getCodigo()); List<ProductosDelProveedor> lista=q.list(); ss.close(); - if(lista.size()==0) { + if(lista.size()==0) + { return false; - } else { + } + else + { return true; } } /**Metodo para actualizar un productos*/ - public void updateProducto(ProductosDelProveedor producto) { + public void updateProducto(ProductosDelProveedor producto) + { Session ss=Conexion.getSession(); Transaction tx=ss.beginTransaction(); ss.merge(producto); @@ -132,7 +150,8 @@ /**Metodo para actualizar o insertar*/ - public void saveOrUpdate(ProductosDelProveedor producto) { + public void saveOrUpdate(ProductosDelProveedor producto) + { Session ss=conn.getSession(); Transaction tx=ss.beginTransaction(); ss.saveOrUpdate(producto); @@ -142,12 +161,14 @@ } /**Metodo para consultar todos los productos*/ - public List<ProductosDelProveedor> getAllProductosDelProveedor() { + public List<ProductosDelProveedor> getAllProductosDelProveedor() + { List<ProductosDelProveedor> productos=new ArrayList(); String hql="FROM ProductosDelProveedor P"; Session ss=conn.getSession(); Query query=ss.createQuery(hql); - if(query!=null){ + if(query!=null) + { productos=query.list(); } @@ -159,31 +180,39 @@ /**Metodo para consultar productos por codigo*/ - public List<ProductosDelProveedor> getProductosDelProveedorPorCodigo(List<ProductosDelProveedor> lista,String patronCodigo) { + public List<ProductosDelProveedor> getProductosDelProveedorPorCodigo(List<ProductosDelProveedor> lista,String patronCodigo) + { List<ProductosDelProveedor> productos=new ArrayList(); - for(ProductosDelProveedor k:lista) { + for(ProductosDelProveedor k:lista) + { String codigo=k.getCodigo()+""; - if(!codigo.equals("") && patronCodigo.length()<=codigo.length()) { + if(!codigo.equals("") && patronCodigo.length()<=codigo.length()) + { String codigoGrupo=codigo.substring(0,patronCodigo.length()); - if(codigoGrupo.equalsIgnoreCase(patronCodigo)) { + if(codigoGrupo.equalsIgnoreCase(patronCodigo)) + { productos.add(k); } } } return productos; } - + /**Metodo para consultar productos por nombre*/ - public List<ProductosDelProveedor> getProductosDelProveedorPorNombre(List<ProductosDelProveedor> lista,String patronNombre) { + public List<ProductosDelProveedor> getProductosDelProveedorPorNombre(List<ProductosDelProveedor> lista,String patronNombre) + { List<ProductosDelProveedor> productos=new ArrayList(); - for(ProductosDelProveedor k:lista) { + for(ProductosDelProveedor k:lista) + { String nombre=k.getNombre()+""; - if(!nombre.equals("") && patronNombre.length()<=nombre.length()) { + if(!nombre.equals("") && patronNombre.length()<=nombre.length()) + { String nombreGrupo=nombre.substring(0,patronNombre.length()); - if(nombreGrupo.equalsIgnoreCase(patronNombre)) { + if(nombreGrupo.equalsIgnoreCase(patronNombre)) + { productos.add(k); } } @@ -192,21 +221,25 @@ } /**Metodo para consultar productos por Fecha de Precio*/ - public List<ProductosDelProveedor> getProductosDelProveedorPorFecha(List<ProductosDelProveedor> lista,String patronNombre) { + public List<ProductosDelProveedor> getProductosDelProveedorPorFecha(List<ProductosDelProveedor> lista,String patronNombre) + { List<ProductosDelProveedor> productos=new ArrayList(); - for(ProductosDelProveedor k:lista) { + for(ProductosDelProveedor k:lista) + { String nombre=k.getFecha()+""; - if(!nombre.equals("") && patronNombre.length()<=nombre.length()) { + if(!nombre.equals("") && patronNombre.length()<=nombre.length()) + { String nombreGrupo=nombre.substring(0,patronNombre.length()); - if(nombreGrupo.equalsIgnoreCase(patronNombre)) { + if(nombreGrupo.equalsIgnoreCase(patronNombre)) + { productos.add(k); } } } return productos; } - + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2007-10-20 04:21:11
|
Revision: 51 http://opaloerp.svn.sourceforge.net/opaloerp/?rev=51&view=rev Author: thegenius03 Date: 2007-10-19 21:21:14 -0700 (Fri, 19 Oct 2007) Log Message: ----------- - Funcionalidades Agregadas - Se agrego a la base de datos, en algunas tablas, la columna que marca si esta borrado o no. - DgCrearProveedor.java: Parcial validacion de telefono1 y telefono2. - ModeloProveedor.java: Metodo para obtener los proveedor que no hayan sido borrados. - DgCrearProveedor.java: Borrar proveedores, aprovechando el nuevo campo. - Agregar Producto al Proveedor. Funcionalidades Pendientes: - Borrado de Direcciones, Contactos, Productos. Modified Paths: -------------- OpaloERP/src/frontend/proveedor/DgCrearProveedor.form OpaloERP/src/frontend/proveedor/DgCrearProveedor.java OpaloERP/src/frontend/proveedor/IAdministrarProveedor.form OpaloERP/src/frontend/proveedor/IAdministrarProveedor.java OpaloERP/src/mensaje_objetos/almacen/ProductosDelProveedor.java OpaloERP/src/mensaje_objetos/orden_de_compra/OrdenDeCompra.java OpaloERP/src/mensaje_objetos/proveedor/Proveedor.java OpaloERP/src/modelo_objetos/proveedor/ModeloProveedor.java Modified: OpaloERP/src/frontend/proveedor/DgCrearProveedor.form =================================================================== --- OpaloERP/src/frontend/proveedor/DgCrearProveedor.form 2007-10-19 02:49:27 UTC (rev 50) +++ OpaloERP/src/frontend/proveedor/DgCrearProveedor.form 2007-10-20 04:21:14 UTC (rev 51) @@ -285,7 +285,7 @@ <Component id="jLabel7" linkSize="2" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="txtMora" alignment="3" min="-2" pref="21" max="-2" attributes="0"/> </Group> - <EmptySpace pref="42" max="32767" attributes="0"/> + <EmptySpace pref="43" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -437,7 +437,7 @@ </Group> <EmptySpace max="-2" attributes="0"/> <Component id="btnInsertarDireccion" min="-2" max="-2" attributes="0"/> - <EmptySpace pref="59" max="32767" attributes="0"/> + <EmptySpace pref="60" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -675,16 +675,22 @@ </Component> <Component class="javax.swing.JTextField" name="txtNombreContacto"> </Component> - <Component class="javax.swing.JTextField" name="txtTelefono1"> - </Component> - <Component class="javax.swing.JTextField" name="txtTelefono2"> - </Component> <Component class="javax.swing.JTextField" name="txtFax"> </Component> <Component class="javax.swing.JTextField" name="txtEmail"> </Component> <Component class="javax.swing.JTextField" name="txtCargo"> </Component> + <Component class="javax.swing.JFormattedTextField" name="txtTelefono1"> + <AuxValues> + <AuxValue name="JavaCodeGenerator_CreateCodePost" type="java.lang.String" value="txtTelefono1.setValue(0); txtTelefono1.setFocusLostBehavior(JFormattedTextField.PERSIST);"/> + </AuxValues> + </Component> + <Component class="javax.swing.JFormattedTextField" name="txtTelefono2"> + <AuxValues> + <AuxValue name="JavaCodeGenerator_CreateCodePost" type="java.lang.String" value="txtTelefono2.setValue(0); txtTelefono2.setFocusLostBehavior(JFormattedTextField.PERSIST);"/> + </AuxValues> + </Component> </SubComponents> </Container> </SubComponents> @@ -1182,7 +1188,7 @@ </Component> <Component class="javax.swing.JFormattedTextField" name="txtPrecio"> <AuxValues> - <AuxValue name="JavaCodeGenerator_CreateCodePost" type="java.lang.String" value="txtPrecio.setValue(0.00); txtLimitCred.setFocusLostBehavior(JFormattedTextField.PERSIST);"/> + <AuxValue name="JavaCodeGenerator_CreateCodePost" type="java.lang.String" value="txtPrecio.setValue(0.00); txtPrecio.setFocusLostBehavior(JFormattedTextField.PERSIST);"/> </AuxValues> </Component> </SubComponents> Modified: OpaloERP/src/frontend/proveedor/DgCrearProveedor.java =================================================================== --- OpaloERP/src/frontend/proveedor/DgCrearProveedor.java 2007-10-19 02:49:27 UTC (rev 50) +++ OpaloERP/src/frontend/proveedor/DgCrearProveedor.java 2007-10-20 04:21:14 UTC (rev 51) @@ -526,26 +526,50 @@ mensaje += "El campo del nombre del contacto est\u00e1 vac\u00edo\n"; validacion = false; } - if(txtTelefono1.getText().length() == 0) + if (txtTelefono1.getText().length() > 12) { - mensaje += "El campo del telefono1 del contacto est\u00e1 vac\u00edo\n"; + mensaje += "El campo del telefono1 del contacto contiene un tel\u00e9fono invalido\n"; validacion = false; } - else if (txtTelefono1.getText().length() > 12) + else if (txtTelefono1.getText().length() < 10) { mensaje += "El campo del telefono1 del contacto contiene un tel\u00e9fono invalido\n"; - validacion = false; + validacion = false; } - if(txtTelefono2.getText().length() == 0) + else { - mensaje += "El campo del telefono2 del contacto est\u00e1 vac\u00edo\n"; + try + { + txtTelefono1.commitEdit(); + } + catch(ParseException pe) + { + mensaje += "El campo del telefono1 del contacto est\u00e1 vac\u00edo o en un formato incorrecto\n"; + validacion = false; + } + } + if (txtTelefono2.getText().length() > 12) + { + mensaje += "El campo del telefono2 del contacto contiene un tel\u00e9fono invalido\n"; validacion = false; } - else if (txtTelefono2.getText().length() > 12) + else if (txtTelefono2.getText().length() < 10) { mensaje += "El campo del telefono2 del contacto contiene un tel\u00e9fono invalido\n"; - validacion = false; + validacion = false; } + else + { + try + { + txtTelefono1.commitEdit(); + } + catch(ParseException pe) + { + mensaje += "El campo del telefono1 del contacto est\u00e1 vac\u00edo o en un formato incorrecto\n"; + validacion = false; + } + } if(txtCargo.getText().length() == 0) { mensaje += "El campo de cargo del contacto est\u00e1 vac\u00edo\n"; @@ -884,7 +908,7 @@ } if(!validacion) JOptionPane.showMessageDialog(this,mensaje, "Llene los campos correctamente", JOptionPane.WARNING_MESSAGE); - + return validacion; } /** This method is called from within the constructor to @@ -945,11 +969,13 @@ jLabel17 = new javax.swing.JLabel(); jLabel18 = new javax.swing.JLabel(); txtNombreContacto = new javax.swing.JTextField(); - txtTelefono1 = new javax.swing.JTextField(); - txtTelefono2 = new javax.swing.JTextField(); txtFax = new javax.swing.JTextField(); txtEmail = new javax.swing.JTextField(); txtCargo = new javax.swing.JTextField(); + txtTelefono1 = new javax.swing.JFormattedTextField(); + txtTelefono1.setValue(0); txtTelefono1.setFocusLostBehavior(JFormattedTextField.PERSIST); + txtTelefono2 = new javax.swing.JFormattedTextField(); + txtTelefono2.setValue(0); txtTelefono2.setFocusLostBehavior(JFormattedTextField.PERSIST); jPanel10 = new javax.swing.JPanel(); jToolBar1 = new javax.swing.JToolBar(); btnNuevoDireccion = new javax.swing.JButton(); @@ -993,7 +1019,7 @@ jLabel28 = new javax.swing.JLabel(); txtCodigoProducto = new javax.swing.JTextField(); txtPrecio = new javax.swing.JFormattedTextField(); - txtPrecio.setValue(0.00); txtLimitCred.setFocusLostBehavior(JFormattedTextField.PERSIST); + txtPrecio.setValue(0.00); txtPrecio.setFocusLostBehavior(JFormattedTextField.PERSIST); btnCerrar = new javax.swing.JButton(); btnSalvarCerrar = new javax.swing.JButton(); btnSalvar = new javax.swing.JButton(); @@ -1096,7 +1122,7 @@ .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel7) .addComponent(txtMora, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addContainerGap(42, Short.MAX_VALUE)) + .addContainerGap(43, Short.MAX_VALUE)) ); jPanel4Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jLabel4, jLabel5, jLabel6, jLabel7}); @@ -1202,7 +1228,7 @@ .addComponent(lblProvincia)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnInsertarDireccion) - .addContainerGap(59, Short.MAX_VALUE)) + .addContainerGap(60, Short.MAX_VALUE)) ); jpanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {lblCiudad, lblPais, lblProvincia, lblRegion}); @@ -2172,8 +2198,8 @@ private javax.swing.JTextField txtNombreContacto; private javax.swing.JFormattedTextField txtPrecio; private javax.swing.JTextField txtProductoSeleccionado; - private javax.swing.JTextField txtTelefono1; - private javax.swing.JTextField txtTelefono2; + private javax.swing.JFormattedTextField txtTelefono1; + private javax.swing.JFormattedTextField txtTelefono2; // End of variables declaration//GEN-END:variables } Modified: OpaloERP/src/frontend/proveedor/IAdministrarProveedor.form =================================================================== --- OpaloERP/src/frontend/proveedor/IAdministrarProveedor.form 2007-10-19 02:49:27 UTC (rev 50) +++ OpaloERP/src/frontend/proveedor/IAdministrarProveedor.form 2007-10-20 04:21:14 UTC (rev 51) @@ -32,7 +32,7 @@ <EmptySpace max="-2" attributes="0"/> <Component id="jLabel2" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> - <Component id="cmbTipoBusqueda" pref="151" max="32767" attributes="0"/> + <Component id="cmbTipoBusqueda" pref="152" max="32767" attributes="0"/> </Group> </Group> <EmptySpace max="-2" attributes="0"/> Modified: OpaloERP/src/frontend/proveedor/IAdministrarProveedor.java =================================================================== --- OpaloERP/src/frontend/proveedor/IAdministrarProveedor.java 2007-10-19 02:49:27 UTC (rev 50) +++ OpaloERP/src/frontend/proveedor/IAdministrarProveedor.java 2007-10-20 04:21:14 UTC (rev 51) @@ -53,7 +53,7 @@ { listaProveedorTotal=modeloProveedor.getAllProveedores(); - proveedorTable=modeloProveedor.getAllProveedores(); + proveedorTable=modeloProveedor.getProveedoresNoBorrados(listaProveedorTotal); tableModel=new AbstractTableModel() { @@ -70,38 +70,44 @@ Proveedor proveedor=proveedorTable.get(rowIndex); if(proveedor!=null) { - if(columnIndex==0) + if(!proveedor.getBorrado()) { - return proveedor.getCodigo(); + if(columnIndex==0) + { + return proveedor.getCodigo(); + } + if(columnIndex==1) + { + return proveedor.getNombre(); + } + if(columnIndex==2) + { + return proveedor.getRnc(); + } + if(columnIndex==3) + { + return proveedor.getCedula(); + } + if(columnIndex==4) + { + return proveedor.getTipoDePago(); + } + if(columnIndex==5) + { + return proveedor.getLimiteDeCredito(); + } + if(columnIndex==6) + { + return proveedor.getLimiteDias(); + } + if(columnIndex==7) + { + return proveedor.getPorcMora(); + } } - if(columnIndex==1) + else { - return proveedor.getNombre(); } - if(columnIndex==2) - { - return proveedor.getRnc(); - } - if(columnIndex==3) - { - return proveedor.getCedula(); - } - if(columnIndex==4) - { - return proveedor.getTipoDePago(); - } - if(columnIndex==5) - { - return proveedor.getLimiteDeCredito(); - } - if(columnIndex==6) - { - return proveedor.getLimiteDias(); - } - if(columnIndex==7) - { - return proveedor.getPorcMora(); - } } return ""; } @@ -146,6 +152,18 @@ return proveedor; } + private int getCantidadBorrados(List<Proveedor> tabla) + { + int counter = 0; + + for(int i = 0; i < tabla.size(); i++) + { + if(tabla.get(i).getBorrado()) + counter++; + } + + return counter; + } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is @@ -372,7 +390,8 @@ JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); if(respuesta == JOptionPane.OK_OPTION) { - modeloProveedor.removeProveedor(proveedorSeleccionado); + proveedorSeleccionado.setBorrado(true); + modeloProveedor.updateProveedor(proveedorSeleccionado); proveedorSeleccionado = null; this.inicializarTable(); } Modified: OpaloERP/src/mensaje_objetos/almacen/ProductosDelProveedor.java =================================================================== --- OpaloERP/src/mensaje_objetos/almacen/ProductosDelProveedor.java 2007-10-19 02:49:27 UTC (rev 50) +++ OpaloERP/src/mensaje_objetos/almacen/ProductosDelProveedor.java 2007-10-20 04:21:14 UTC (rev 51) @@ -1,7 +1,7 @@ /* * ProductosDelProveedor.java * - * Created on 22 de septiembre de 2007, 19:00 + * Created on 19 de octubre de 2007, 21:52 * * To change this template, choose Tools | Template Manager * and open the template in the editor. @@ -13,8 +13,6 @@ import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; @@ -35,7 +33,8 @@ @NamedQuery(name = "ProductosDelProveedor.findByDescripcion", query = "SELECT p FROM ProductosDelProveedor p WHERE p.descripcion = :descripcion"), @NamedQuery(name = "ProductosDelProveedor.findByFecha", query = "SELECT p FROM ProductosDelProveedor p WHERE p.fecha = :fecha"), @NamedQuery(name = "ProductosDelProveedor.findByPrecio", query = "SELECT p FROM ProductosDelProveedor p WHERE p.precio = :precio"), - @NamedQuery(name = "ProductosDelProveedor.findByNombre", query = "SELECT p FROM ProductosDelProveedor p WHERE p.nombre = :nombre") + @NamedQuery(name = "ProductosDelProveedor.findByNombre", query = "SELECT p FROM ProductosDelProveedor p WHERE p.nombre = :nombre"), + @NamedQuery(name = "ProductosDelProveedor.findByBorrado", query = "SELECT p FROM ProductosDelProveedor p WHERE p.borrado = :borrado") }) public class ProductosDelProveedor implements Serializable { @@ -56,6 +55,9 @@ @Column(name = "nombre") private String nombre; + + @Column(name = "borrado") + private Boolean borrado; /** Creates a new instance of ProductosDelProveedor */ public ProductosDelProveedor() @@ -68,7 +70,7 @@ */ public ProductosDelProveedor(String codigo) { - this.setCodigo(codigo); + this.codigo = codigo; } /** @@ -162,6 +164,24 @@ } /** + * Gets the borrado of this ProductosDelProveedor. + * @return the borrado + */ + public Boolean getBorrado() + { + return this.borrado; + } + + /** + * Sets the borrado of this ProductosDelProveedor to the specified value. + * @param borrado the new borrado + */ + public void setBorrado(Boolean borrado) + { + this.borrado = borrado; + } + + /** * Returns a hash code value for the object. This implementation computes * a hash code value based on the id fields in this object. * @return a hash code value for this object. @@ -170,7 +190,7 @@ public int hashCode() { int hash = 0; - hash += (this.getCodigo() != null ? this.getCodigo().hashCode() : 0); + hash += (this.codigo != null ? this.codigo.hashCode() : 0); return hash; } @@ -190,7 +210,7 @@ return false; } ProductosDelProveedor other = (ProductosDelProveedor)object; - if (this.getCodigo() != other.getCodigo() && (this.getCodigo() == null || !this.getCodigo().equals(other.getCodigo()))) return false; + if (this.codigo != other.codigo && (this.codigo == null || !this.codigo.equals(other.codigo))) return false; return true; } @@ -202,7 +222,7 @@ @Override public String toString() { - return "mensaje_objetos.almacen.ProductosDelProveedor[codigo=" + getCodigo() + "]"; + return "mensaje_objetos.almacen.ProductosDelProveedor[codigo=" + codigo + "]"; } - + } Modified: OpaloERP/src/mensaje_objetos/orden_de_compra/OrdenDeCompra.java =================================================================== --- OpaloERP/src/mensaje_objetos/orden_de_compra/OrdenDeCompra.java 2007-10-19 02:49:27 UTC (rev 50) +++ OpaloERP/src/mensaje_objetos/orden_de_compra/OrdenDeCompra.java 2007-10-20 04:21:14 UTC (rev 51) @@ -1,7 +1,7 @@ /* * OrdenDeCompra.java * - * Created on September 27, 2007, 2:35 AM + * Created on 19 de octubre de 2007, 22:05 * * To change this template, choose Tools | Template Manager * and open the template in the editor. @@ -11,7 +11,6 @@ import java.io.Serializable; import java.util.Date; -import java.util.List; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -29,7 +28,7 @@ /** * Entity class OrdenDeCompra * - * @author raymi + * @author gonzalez */ @Entity @Table(name = "orden_de_compra") @@ -38,7 +37,8 @@ @NamedQuery(name = "OrdenDeCompra.findByCodigo", query = "SELECT o FROM OrdenDeCompra o WHERE o.codigo = :codigo"), @NamedQuery(name = "OrdenDeCompra.findByFecha", query = "SELECT o FROM OrdenDeCompra o WHERE o.fecha = :fecha"), @NamedQuery(name = "OrdenDeCompra.findByMonto", query = "SELECT o FROM OrdenDeCompra o WHERE o.monto = :monto"), - @NamedQuery(name = "OrdenDeCompra.findByTipoDePago", query = "SELECT o FROM OrdenDeCompra o WHERE o.tipoDePago = :tipoDePago") + @NamedQuery(name = "OrdenDeCompra.findByTipoDePago", query = "SELECT o FROM OrdenDeCompra o WHERE o.tipoDePago = :tipoDePago"), + @NamedQuery(name = "OrdenDeCompra.findByBorrado", query = "SELECT o FROM OrdenDeCompra o WHERE o.borrado = :borrado") }) public class OrdenDeCompra implements Serializable { @@ -56,13 +56,15 @@ @Column(name = "tipo_de_pago") private String tipoDePago; - + + @Column(name = "borrado") + private Boolean borrado; + @OneToOne(cascade=CascadeType.PERSIST) @JoinTable(name="orden_compra_proveedor",joinColumns={@JoinColumn(name="codigo_orden")}, inverseJoinColumns={@JoinColumn(name="codigo_proveedor")}) private Proveedor proveedor; - /** Creates a new instance of OrdenDeCompra */ public OrdenDeCompra() { @@ -74,7 +76,7 @@ */ public OrdenDeCompra(String codigo) { - this.setCodigo(codigo); + this.codigo = codigo; } /** @@ -150,6 +152,24 @@ } /** + * Gets the borrado of this OrdenDeCompra. + * @return the borrado + */ + public Boolean getBorrado() + { + return this.borrado; + } + + /** + * Sets the borrado of this OrdenDeCompra to the specified value. + * @param borrado the new borrado + */ + public void setBorrado(Boolean borrado) + { + this.borrado = borrado; + } + + /** * Returns a hash code value for the object. This implementation computes * a hash code value based on the id fields in this object. * @return a hash code value for this object. @@ -158,7 +178,7 @@ public int hashCode() { int hash = 0; - hash += (this.getCodigo() != null ? this.getCodigo().hashCode() : 0); + hash += (this.codigo != null ? this.codigo.hashCode() : 0); return hash; } @@ -178,7 +198,7 @@ return false; } OrdenDeCompra other = (OrdenDeCompra)object; - if (this.getCodigo() != other.getCodigo() && (this.getCodigo() == null || !this.getCodigo().equals(other.getCodigo()))) return false; + if (this.codigo != other.codigo && (this.codigo == null || !this.codigo.equals(other.codigo))) return false; return true; } @@ -190,17 +210,7 @@ @Override public String toString() { - return "modelo_objetos.orden_de_compra.OrdenDeCompra[codigo=" + getCodigo() + "]"; + return "mensaje_objetos.orden_de_compra.OrdenDeCompra[codigo=" + codigo + "]"; } - - public Proveedor getProveedor() - { - return proveedor; - } - - public void setProveedor(Proveedor proveedor) - { - this.proveedor = proveedor; - } } Modified: OpaloERP/src/mensaje_objetos/proveedor/Proveedor.java =================================================================== --- OpaloERP/src/mensaje_objetos/proveedor/Proveedor.java 2007-10-19 02:49:27 UTC (rev 50) +++ OpaloERP/src/mensaje_objetos/proveedor/Proveedor.java 2007-10-20 04:21:14 UTC (rev 51) @@ -1,7 +1,7 @@ /* * Proveedor.java * - * Created on September 11, 2007, 2:37 PM + * Created on 19 de octubre de 2007, 21:54 * * To change this template, choose Tools | Template Manager * and open the template in the editor. @@ -22,7 +22,6 @@ import javax.persistence.NamedQuery; import javax.persistence.OneToMany; import javax.persistence.Table; -import mensaje_objetos.almacen.Producto; import mensaje_objetos.almacen.ProductosDelProveedor; import mensaje_objetos.cliente.Contacto; import mensaje_objetos.cliente.Direccion; @@ -30,7 +29,7 @@ /** * Entity class Proveedor * - * @author raymi + * @author gonzalez */ @Entity @Table(name = "proveedor") @@ -43,7 +42,8 @@ @NamedQuery(name = "Proveedor.findByPorcMora", query = "SELECT p FROM Proveedor p WHERE p.porcMora = :porcMora"), @NamedQuery(name = "Proveedor.findByLimiteDias", query = "SELECT p FROM Proveedor p WHERE p.limiteDias = :limiteDias"), @NamedQuery(name = "Proveedor.findByCodigo", query = "SELECT p FROM Proveedor p WHERE p.codigo = :codigo"), - @NamedQuery(name = "Proveedor.findByTipoDePago", query = "SELECT p FROM Proveedor p WHERE p.tipoDePago = :tipoDePago") + @NamedQuery(name = "Proveedor.findByTipoDePago", query = "SELECT p FROM Proveedor p WHERE p.tipoDePago = :tipoDePago"), + @NamedQuery(name = "Proveedor.findByBorrado", query = "SELECT p FROM Proveedor p WHERE p.borrado = :borrado") }) public class Proveedor implements Serializable { @@ -72,6 +72,9 @@ @Column(name = "tipo_de_pago") private String tipoDePago; + + @Column(name = "borrado") + private Boolean borrado = false; @OneToMany(cascade=CascadeType.ALL) @JoinTable(name="proveedor_contacto",joinColumns={@JoinColumn(name="codigo_proveedor")}, @@ -99,7 +102,7 @@ */ public Proveedor(String codigo) { - this.codigo = codigo; + this.setCodigo(codigo); } /** @@ -109,8 +112,8 @@ */ public Proveedor(String codigo, String nombre) { - this.codigo = codigo; - this.nombre = nombre; + this.setCodigo(codigo); + this.setNombre(nombre); } /** @@ -258,6 +261,24 @@ } /** + * Gets the borrado of this Proveedor. + * @return the borrado + */ + public Boolean getBorrado() + { + return this.borrado; + } + + /** + * Sets the borrado of this Proveedor to the specified value. + * @param borrado the new borrado + */ + public void setBorrado(Boolean borrado) + { + this.borrado = borrado; + } + + /** * Returns a hash code value for the object. This implementation computes * a hash code value based on the id fields in this object. * @return a hash code value for this object. @@ -266,7 +287,7 @@ public int hashCode() { int hash = 0; - hash += (this.codigo != null ? this.codigo.hashCode() : 0); + hash += (this.getCodigo() != null ? this.getCodigo().hashCode() : 0); return hash; } @@ -286,7 +307,7 @@ return false; } Proveedor other = (Proveedor)object; - if (this.codigo != other.codigo && (this.codigo == null || !this.codigo.equals(other.codigo))) return false; + if (this.getCodigo() != other.getCodigo() && (this.getCodigo() == null || !this.getCodigo().equals(other.getCodigo()))) return false; return true; } @@ -298,7 +319,7 @@ @Override public String toString() { - return "mensaje_objetos.proveedor.Proveedor[codigo=" + codigo + "]"; + return "mensaje_objetos.proveedor.Proveedor[codigo=" + getCodigo() + "]"; } public List<Contacto> getContactos() Modified: OpaloERP/src/modelo_objetos/proveedor/ModeloProveedor.java =================================================================== --- OpaloERP/src/modelo_objetos/proveedor/ModeloProveedor.java 2007-10-19 02:49:27 UTC (rev 50) +++ OpaloERP/src/modelo_objetos/proveedor/ModeloProveedor.java 2007-10-20 04:21:14 UTC (rev 51) @@ -286,5 +286,20 @@ return proveedors; } + public List<Proveedor> getProveedoresNoBorrados(List<Proveedor> lista) + { + List<Proveedor> proveedors = new ArrayList(); + + for(Proveedor k:lista) + { + if(!k.getBorrado()) + { + proveedors.add(k); + } + } + + return proveedors; + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2007-10-19 02:49:25
|
Revision: 50 http://opaloerp.svn.sourceforge.net/opaloerp/?rev=50&view=rev Author: thegenius03 Date: 2007-10-18 19:49:27 -0700 (Thu, 18 Oct 2007) Log Message: ----------- - Funcionalidades agregadas - Validar el campo de la cedula (11 numeros sin guion) si esta marcado el tipo de documento como cedula. - Validar el campo del porcentaje de mora (un numero menor que 100). Solo estas peque?\195?\177as modificaciones Modified Paths: -------------- OpaloERP/src/frontend/proveedor/DgCrearProveedor.form OpaloERP/src/frontend/proveedor/DgCrearProveedor.java OpaloERP/src/modelo_objetos/proveedor/ModeloProveedor.java Modified: OpaloERP/src/frontend/proveedor/DgCrearProveedor.form =================================================================== --- OpaloERP/src/frontend/proveedor/DgCrearProveedor.form 2007-10-10 03:51:37 UTC (rev 49) +++ OpaloERP/src/frontend/proveedor/DgCrearProveedor.form 2007-10-19 02:49:27 UTC (rev 50) @@ -24,7 +24,7 @@ </NonVisualComponents> <Properties> <Property name="defaultCloseOperation" type="int" value="2"/> - <Property name="title" type="java.lang.String" value="áéíóúñ"/> + <Property name="title" type="java.lang.String" value="Crear Proveedor"/> </Properties> <SyntheticProperties> <SyntheticProperty name="formSizePolicy" type="int" value="1"/> @@ -285,7 +285,7 @@ <Component id="jLabel7" linkSize="2" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="txtMora" alignment="3" min="-2" pref="21" max="-2" attributes="0"/> </Group> - <EmptySpace pref="41" max="32767" attributes="0"/> + <EmptySpace pref="42" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -437,7 +437,7 @@ </Group> <EmptySpace max="-2" attributes="0"/> <Component id="btnInsertarDireccion" min="-2" max="-2" attributes="0"/> - <EmptySpace pref="58" max="32767" attributes="0"/> + <EmptySpace pref="59" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -997,7 +997,7 @@ <Group type="102" alignment="0" attributes="0"> <Component id="jLabel26" linkSize="13" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> - <Component id="txtPrecio" linkSize="14" min="-2" pref="51" max="-2" attributes="0"/> + <Component id="txtPrecio" linkSize="14" min="-2" pref="417" max="-2" attributes="0"/> </Group> <Group type="102" alignment="0" attributes="0"> <Component id="jLabel25" min="-2" max="-2" attributes="0"/> @@ -1166,8 +1166,6 @@ <Property name="text" type="java.lang.String" value="Precio:"/> </Properties> </Component> - <Component class="javax.swing.JTextField" name="txtPrecio"> - </Component> <Component class="javax.swing.JLabel" name="jLabel27"> <Properties> <Property name="text" type="java.lang.String" value="Fecha de precio:"/> @@ -1182,6 +1180,11 @@ </Component> <Component class="javax.swing.JTextField" name="txtCodigoProducto"> </Component> + <Component class="javax.swing.JFormattedTextField" name="txtPrecio"> + <AuxValues> + <AuxValue name="JavaCodeGenerator_CreateCodePost" type="java.lang.String" value="txtPrecio.setValue(0.00); txtLimitCred.setFocusLostBehavior(JFormattedTextField.PERSIST);"/> + </AuxValues> + </Component> </SubComponents> </Container> </SubComponents> Modified: OpaloERP/src/frontend/proveedor/DgCrearProveedor.java =================================================================== --- OpaloERP/src/frontend/proveedor/DgCrearProveedor.java 2007-10-10 03:51:37 UTC (rev 49) +++ OpaloERP/src/frontend/proveedor/DgCrearProveedor.java 2007-10-19 02:49:27 UTC (rev 50) @@ -52,6 +52,7 @@ private Direccion dirPrincipal; private Contacto conPrincipal; private boolean direccionPrincipal; + private boolean boolBtnInsertar = false; private List<Direccion> listaDirecciones; private List<Contacto> listaContactos; @@ -494,7 +495,7 @@ public void execute() { - Proveedor p = this.proveedorSeleccionado; + Proveedor p = this.proveedorSeleccionado; this.setDireccionPrincipal(p); this.setContactoPrincipal(p); if(validarCampos()) @@ -530,11 +531,21 @@ mensaje += "El campo del telefono1 del contacto est\u00e1 vac\u00edo\n"; validacion = false; } + else if (txtTelefono1.getText().length() > 12) + { + mensaje += "El campo del telefono1 del contacto contiene un tel\u00e9fono invalido\n"; + validacion = false; + } if(txtTelefono2.getText().length() == 0) { mensaje += "El campo del telefono2 del contacto est\u00e1 vac\u00edo\n"; validacion = false; } + else if (txtTelefono2.getText().length() > 12) + { + mensaje += "El campo del telefono2 del contacto contiene un tel\u00e9fono invalido\n"; + validacion = false; + } if(txtCargo.getText().length() == 0) { mensaje += "El campo de cargo del contacto est\u00e1 vac\u00edo\n"; @@ -560,6 +571,24 @@ mensaje += "El campo del fax del contacto est\u00e1 vac\u00edo\n"; validacion = false; } + else if(rbtnCedula.isSelected() && txtDocumento.getText().length() > 11) + { + mensaje += "El campo de c\u00e9dula tiene m\u00e1s de 11 caracteres, asegure que sean 11 numeros sin gui\u00f3n\n"; + validacion = false; + + } + else if(rbtnCedula.isSelected() && txtDocumento.getText().length() == 11) + { + try + { + Long.parseLong(txtDocumento.getText()); + } + catch(NumberFormatException nfe) + { + mensaje += "El campo de c\u00e9dula tiene caracteres incorrectos, asegure que sean 11 numeros sin gui\u00f3n\n"; + validacion = false; + } + } try { txtLimitCred.commitEdit(); @@ -580,6 +609,7 @@ "est\u00e1 vac\u00edo o con un formato incorrecto\n"; validacion = false; } + boolean catched = false; try { txtMora.commitEdit(); @@ -588,8 +618,17 @@ { mensaje += "El campo de mora del proveedor " + "est\u00e1 vac\u00edo o con un formato incorrecto\n"; + catched = true; validacion = false; } + if (!catched && txtMora.getText() != null && !txtMora.getText().equals("")) + { + if(Float.parseFloat(txtMora.getText()) > 100) + { + mensaje += "El valor de porcentaje de mora es inv\u00e1lido, debe ser menor que 100\n"; + validacion = false; + } + } if(dirPrincipal == null) { @@ -602,8 +641,9 @@ mensaje += "No se ha seleccionado un contacto principal v\u00e1lido\n"; validacion = false; } + if(!validacion) - JOptionPane.showMessageDialog(this,mensaje, "LLene los campos correctamente", JOptionPane.WARNING_MESSAGE); + JOptionPane.showMessageDialog(this,mensaje, "Llene los campos correctamente", JOptionPane.WARNING_MESSAGE); return validacion; } @@ -792,10 +832,61 @@ public void fireProducto(ProductoEvent producto) { - productoSeleccionado = producto.getProducto(); - txtProductoSeleccionado.setText(productoSeleccionado.getNombre()); + if(boolBtnInsertar) + { + List<ProductosDelProveedor> productos = productoTable; + proveedorSeleccionado.setProductos(productos); + } + else + { + productoSeleccionado = producto.getProducto(); + txtProductoSeleccionado.setText(productoSeleccionado.getNombre()); + } } + private void insertarProducto() + { + if(validarCamposProducto()) + { + ProductosDelProveedor product = new ProductosDelProveedor(); + product.setCodigo(txtCodigoProducto.getText()); + product.setDescripcion(txtDescripcion.getText()); + product.setNombre(txtProductoSeleccionado.getText()); + product.setFecha(dateFecha.getDate()); + product.setPrecio(Double.parseDouble(txtPrecio.getText())); + productoTable.add(product); + boolBtnInsertar = true; + ProductoEvent pv = new ProductoEvent(); + pv.setId(ProductoEvent.NUEVO); + this.fireProducto(pv); + this.inicializarTablaProductos(); + } + } + + private boolean validarCamposProducto() + { + boolean validacion = true; + String mensaje = ""; + if(productoSeleccionado == null || txtCodigoProducto.getText().length() == 0) + { + mensaje += "Debe insertar el c\u00f3digo del producto\n"; + validacion = false; + } + try + { + txtPrecio.commitEdit(); + } + catch (ParseException ex) + { + mensaje += "El campo del precio de producto del proveedor " + + "est\u00e1 vac\u00edo o con un formato incorrecto\n"; + validacion = false; + } + if(!validacion) + JOptionPane.showMessageDialog(this,mensaje, "Llene los campos correctamente", JOptionPane.WARNING_MESSAGE); + + return validacion; + } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is @@ -897,11 +988,12 @@ jScrollPane4 = new javax.swing.JScrollPane(); jtbProductos = new org.jdesktop.swingx.JXTable(); jLabel26 = new javax.swing.JLabel(); - txtPrecio = new javax.swing.JTextField(); jLabel27 = new javax.swing.JLabel(); dateFecha = new org.jdesktop.swingx.JXDatePicker(); jLabel28 = new javax.swing.JLabel(); txtCodigoProducto = new javax.swing.JTextField(); + txtPrecio = new javax.swing.JFormattedTextField(); + txtPrecio.setValue(0.00); txtLimitCred.setFocusLostBehavior(JFormattedTextField.PERSIST); btnCerrar = new javax.swing.JButton(); btnSalvarCerrar = new javax.swing.JButton(); btnSalvar = new javax.swing.JButton(); @@ -919,7 +1011,7 @@ ); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); - setTitle("\u00e1\u00e9\u00ed\u00f3\u00fa\u00f1"); + setTitle("Crear Proveedor"); jLabel1.setText("Codigo:"); jLabel2.setText("Nombre"); @@ -1004,7 +1096,7 @@ .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel7) .addComponent(txtMora, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addContainerGap(41, Short.MAX_VALUE)) + .addContainerGap(42, Short.MAX_VALUE)) ); jPanel4Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jLabel4, jLabel5, jLabel6, jLabel7}); @@ -1110,7 +1202,7 @@ .addComponent(lblProvincia)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnInsertarDireccion) - .addContainerGap(58, Short.MAX_VALUE)) + .addContainerGap(59, Short.MAX_VALUE)) ); jpanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {lblCiudad, lblPais, lblProvincia, lblRegion}); @@ -1568,7 +1660,7 @@ .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel3Layout.createSequentialGroup() .addComponent(jLabel26) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(txtPrecio, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(txtPrecio, javax.swing.GroupLayout.PREFERRED_SIZE, 417, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel3Layout.createSequentialGroup() .addComponent(jLabel25) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) @@ -1849,14 +1941,7 @@ private void btnInsertarProductoActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnInsertarProductoActionPerformed {//GEN-HEADEREND:event_btnInsertarProductoActionPerformed - ProductosDelProveedor product = new ProductosDelProveedor(); - product.setCodigo(txtCodigoProducto.getText()); - product.setDescripcion(txtDescripcion.getText()); - product.setNombre(txtProductoSeleccionado.getText()); - product.setFecha(dateFecha.getDate()); - product.setPrecio(Double.parseDouble(txtPrecio.getText())); - productoTable.add(product); - this.inicializarTablaProductos(); + this.insertarProducto(); }//GEN-LAST:event_btnInsertarProductoActionPerformed private void btnBuscarProductoActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnBuscarProductoActionPerformed @@ -2085,7 +2170,7 @@ private javax.swing.JFormattedTextField txtMora; private javax.swing.JTextField txtNombre; private javax.swing.JTextField txtNombreContacto; - private javax.swing.JTextField txtPrecio; + private javax.swing.JFormattedTextField txtPrecio; private javax.swing.JTextField txtProductoSeleccionado; private javax.swing.JTextField txtTelefono1; private javax.swing.JTextField txtTelefono2; Modified: OpaloERP/src/modelo_objetos/proveedor/ModeloProveedor.java =================================================================== --- OpaloERP/src/modelo_objetos/proveedor/ModeloProveedor.java 2007-10-10 03:51:37 UTC (rev 49) +++ OpaloERP/src/modelo_objetos/proveedor/ModeloProveedor.java 2007-10-19 02:49:27 UTC (rev 50) @@ -36,7 +36,7 @@ /** Creates a new instance of ModeloProveedor */ - public ModeloProveedor() { + private ModeloProveedor() { conn=Conexion.getConexion(); subjectAdd=new SubjectHelper(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <va...@us...> - 2007-10-10 03:51:33
|
Revision: 49 http://opaloerp.svn.sourceforge.net/opaloerp/?rev=49&view=rev Author: vacax Date: 2007-10-09 20:51:37 -0700 (Tue, 09 Oct 2007) Log Message: ----------- Cambios realizados minimos Modified Paths: -------------- OpaloERP/src/modelo_objetos/orden_de_compra/ModeloOrdenDeCompra.java OpaloERP/src/modelo_objetos/productos/ModeloProductosDelProveedor.java Modified: OpaloERP/src/modelo_objetos/orden_de_compra/ModeloOrdenDeCompra.java =================================================================== --- OpaloERP/src/modelo_objetos/orden_de_compra/ModeloOrdenDeCompra.java 2007-09-28 22:14:10 UTC (rev 48) +++ OpaloERP/src/modelo_objetos/orden_de_compra/ModeloOrdenDeCompra.java 2007-10-10 03:51:37 UTC (rev 49) @@ -34,7 +34,7 @@ private Conexion conn; /** Creates a new instance of ModeloOrdenDeCompra */ - public ModeloOrdenDeCompra() + private ModeloOrdenDeCompra() { conn=Conexion.getConexion(); Modified: OpaloERP/src/modelo_objetos/productos/ModeloProductosDelProveedor.java =================================================================== --- OpaloERP/src/modelo_objetos/productos/ModeloProductosDelProveedor.java 2007-09-28 22:14:10 UTC (rev 48) +++ OpaloERP/src/modelo_objetos/productos/ModeloProductosDelProveedor.java 2007-10-10 03:51:37 UTC (rev 49) @@ -38,7 +38,7 @@ /** Creates a new instance of ModeloProductosDelProveedor */ - public ModeloProductosDelProveedor() { + private ModeloProductosDelProveedor() { conn=Conexion.getConexion(); subjectAdd=new SubjectHelper(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jos...@us...> - 2007-09-28 22:14:13
|
Revision: 48 http://opaloerp.svn.sourceforge.net/opaloerp/?rev=48&view=rev Author: jose_cruz64 Date: 2007-09-28 15:14:10 -0700 (Fri, 28 Sep 2007) Log Message: ----------- Funcionalidades Agregadas Modificaciones en la clase DgCrearOrden. Errores encontrados: 77795 [AWT-EventQueue-0] WARN util.JDBCExceptionReporter - SQL Error: 0, SQLState: null 77795 [AWT-EventQueue-0] ERROR util.JDBCExceptionReporter - Batch entry 0 insert into contacto (cargo, email, fax, nombre, telefono1, telefono2, seccontacto) values (iugsdiug, ghfasuhg, 9869676, isdhifd, 9786976, 9869696, 61) was aborted. Call getNextException to see the cause. 77795 [AWT-EventQueue-0] WARN util.JDBCExceptionReporter - SQL Error: 0, SQLState: 23505 77795 [AWT-EventQueue-0] ERROR util.JDBCExceptionReporter - ERROR: duplicate key violates unique constraint "contactos_pkey" Funcionalidades Removidas: Ninguna Modified Paths: -------------- OpaloERP/src/frontend/cxp/DgCrearOrden.form OpaloERP/src/frontend/cxp/DgCrearOrden.java OpaloERP/src/frontend/proveedor/DgCrearProveedor.java OpaloERP/src/frontend/proveedor/DgInsertarProducto.java Modified: OpaloERP/src/frontend/cxp/DgCrearOrden.form =================================================================== --- OpaloERP/src/frontend/cxp/DgCrearOrden.form 2007-09-28 20:44:22 UTC (rev 47) +++ OpaloERP/src/frontend/cxp/DgCrearOrden.form 2007-09-28 22:14:10 UTC (rev 48) @@ -47,7 +47,7 @@ <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" alignment="1" attributes="0"> <EmptySpace max="-2" attributes="0"/> - <Component id="jTabbedPane1" pref="417" max="32767" attributes="0"/> + <Component id="jTabbedPane1" pref="432" max="32767" attributes="0"/> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> <Component id="btnCerrar" alignment="3" min="-2" max="-2" attributes="0"/> @@ -77,19 +77,18 @@ <Layout> <DimensionLayout dim="0"> <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> + <Group type="102" attributes="0"> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jPanel3" alignment="0" max="32767" attributes="0"/> + <Component id="btnBuscarProveedor" alignment="0" min="-2" pref="116" max="-2" attributes="0"/> <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="12" pref="12" max="12" attributes="0"/> <Component id="jLabel3" linkSize="1" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="79" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="86" max="-2" attributes="0"/> <Component id="jRadioButton1" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> <Component id="jRadioButton2" min="-2" max="-2" attributes="0"/> </Group> - <Component id="btnBuscarProveedor" alignment="0" min="-2" pref="116" max="-2" attributes="0"/> - <Component id="jPanel3" alignment="0" max="32767" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> </Group> @@ -100,20 +99,65 @@ <Group type="102" alignment="0" attributes="0"> <EmptySpace min="-2" pref="27" max="-2" attributes="0"/> <Component id="btnBuscarProveedor" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="28" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> <Component id="jPanel3" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="14" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="jRadioButton1" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="jRadioButton2" alignment="3" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace pref="16" max="32767" attributes="0"/> + <EmptySpace min="-2" pref="73" max="-2" attributes="0"/> </Group> </Group> </DimensionLayout> </Layout> <SubComponents> + <Component class="javax.swing.JButton" name="btnBuscarProveedor"> + <Properties> + <Property name="text" type="java.lang.String" value="Buscar"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnBuscarProveedorActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabel3"> + <Properties> + <Property name="text" type="java.lang.String" value="Tipo de pago:"/> + </Properties> + </Component> + <Component class="javax.swing.JRadioButton" name="jRadioButton1"> + <Properties> + <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor"> + <ComponentRef name="buttonGroup1"/> + </Property> + <Property name="text" type="java.lang.String" value="Credito"/> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo"> + <EmptyBorder bottom="0" left="0" right="0" top="0"/> + </Border> + </Property> + <Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor"> + <Insets value="[0, 0, 0, 0]"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JRadioButton" name="jRadioButton2"> + <Properties> + <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor"> + <ComponentRef name="buttonGroup1"/> + </Property> + <Property name="text" type="java.lang.String" value="Contado"/> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo"> + <EmptyBorder bottom="0" left="0" right="0" top="0"/> + </Border> + </Property> + <Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor"> + <Insets value="[0, 0, 0, 0]"/> + </Property> + </Properties> + </Component> <Container class="javax.swing.JPanel" name="jPanel3"> <Properties> <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> @@ -128,68 +172,68 @@ <Layout> <DimensionLayout dim="0"> <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" attributes="0"> - <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="32767" attributes="0"/> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> <Group type="102" alignment="0" attributes="0"> - <Component id="jLabel1" linkSize="1" min="-2" max="-2" attributes="0"/> + <Component id="jLabel1" linkSize="10" min="-2" pref="65" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> - <Component id="lblNombre" linkSize="2" min="-2" pref="369" max="-2" attributes="0"/> + <Component id="lblNombre" linkSize="12" min="-2" pref="400" max="-2" attributes="0"/> </Group> <Group type="102" alignment="0" attributes="0"> - <Component id="jLabel2" linkSize="1" min="-2" max="-2" attributes="0"/> + <Component id="jLabel2" linkSize="10" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> - <Component id="lblRncCedula" linkSize="2" min="-2" max="-2" attributes="0"/> + <Component id="lblRncCedula" linkSize="12" min="-2" max="-2" attributes="0"/> </Group> <Group type="102" alignment="0" attributes="0"> - <Component id="jLabel5" linkSize="1" min="-2" max="-2" attributes="0"/> + <Component id="jLabel4" linkSize="10" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> - <Component id="lblLimiteDeDias" linkSize="2" min="-2" max="-2" attributes="0"/> + <Component id="lblLimiteDeCredito" linkSize="12" min="-2" max="-2" attributes="0"/> </Group> <Group type="102" alignment="0" attributes="0"> - <Component id="jLabel6" linkSize="1" min="-2" pref="152" max="-2" attributes="0"/> + <Component id="jLabel5" linkSize="10" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> - <Component id="lblPorcMora" linkSize="2" min="-2" max="-2" attributes="0"/> + <Component id="lblLimiteDeDias" linkSize="12" min="-2" max="-2" attributes="0"/> </Group> <Group type="102" alignment="0" attributes="0"> - <Component id="jLabel4" linkSize="1" min="-2" max="-2" attributes="0"/> - <EmptySpace max="32767" attributes="0"/> - <Component id="lblLimiteDeCredito" linkSize="2" min="-2" max="-2" attributes="0"/> + <Component id="jLabel6" linkSize="10" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="lblPorcMora" linkSize="12" min="-2" max="-2" attributes="0"/> </Group> </Group> - <EmptySpace max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> </Group> </Group> </DimensionLayout> <DimensionLayout dim="1"> <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0"> - <EmptySpace max="-2" attributes="0"/> + <EmptySpace min="-2" pref="39" max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> - <Component id="jLabel1" linkSize="9" alignment="3" min="-2" pref="34" max="-2" attributes="0"/> - <Component id="lblNombre" linkSize="3" alignment="3" min="-2" pref="29" max="-2" attributes="0"/> + <Component id="jLabel1" linkSize="11" alignment="3" min="-2" pref="29" max="-2" attributes="0"/> + <Component id="lblNombre" linkSize="11" alignment="3" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> - <Component id="jLabel2" linkSize="9" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="lblRncCedula" linkSize="3" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel2" linkSize="11" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="lblRncCedula" linkSize="11" alignment="3" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jLabel4" linkSize="9" min="-2" max="-2" attributes="0"/> - <Component id="lblLimiteDeCredito" linkSize="3" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="6" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel4" linkSize="11" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="lblLimiteDeCredito" linkSize="11" alignment="3" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jLabel5" linkSize="9" min="-2" max="-2" attributes="0"/> - <Component id="lblLimiteDeDias" linkSize="3" min="-2" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel5" linkSize="11" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="lblLimiteDeDias" linkSize="11" alignment="3" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="1" attributes="0"> - <Component id="jLabel6" linkSize="9" min="-2" max="-2" attributes="0"/> - <Component id="lblPorcMora" linkSize="3" min="-2" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel6" linkSize="11" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="lblPorcMora" linkSize="11" alignment="3" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace pref="35" max="32767" attributes="0"/> + <EmptySpace pref="53" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -287,51 +331,6 @@ </Component> </SubComponents> </Container> - <Component class="javax.swing.JButton" name="btnBuscarProveedor"> - <Properties> - <Property name="text" type="java.lang.String" value="Buscar"/> - </Properties> - <Events> - <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnBuscarProveedorActionPerformed"/> - </Events> - </Component> - <Component class="javax.swing.JLabel" name="jLabel3"> - <Properties> - <Property name="text" type="java.lang.String" value="Tipo de pago:"/> - </Properties> - </Component> - <Component class="javax.swing.JRadioButton" name="jRadioButton1"> - <Properties> - <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor"> - <ComponentRef name="buttonGroup1"/> - </Property> - <Property name="text" type="java.lang.String" value="Credito"/> - <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> - <Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo"> - <EmptyBorder bottom="0" left="0" right="0" top="0"/> - </Border> - </Property> - <Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor"> - <Insets value="[0, 0, 0, 0]"/> - </Property> - </Properties> - </Component> - <Component class="javax.swing.JRadioButton" name="jRadioButton2"> - <Properties> - <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor"> - <ComponentRef name="buttonGroup1"/> - </Property> - <Property name="text" type="java.lang.String" value="Contado"/> - <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> - <Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo"> - <EmptyBorder bottom="0" left="0" right="0" top="0"/> - </Border> - </Property> - <Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor"> - <Insets value="[0, 0, 0, 0]"/> - </Property> - </Properties> - </Component> </SubComponents> </Container> <Container class="javax.swing.JPanel" name="jPanel2"> @@ -348,7 +347,6 @@ <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" attributes="0"> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jLabel18" min="-2" max="-2" attributes="0"/> <Group type="102" alignment="0" attributes="0"> <EmptySpace max="-2" attributes="0"/> <Component id="jLabel19" min="-2" pref="129" max="-2" attributes="0"/> @@ -374,8 +372,7 @@ <DimensionLayout dim="1"> <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" attributes="0"> - <Component id="jLabel18" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> + <EmptySpace min="-2" pref="44" max="-2" attributes="0"/> <Component id="btnBuscarProducto" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> <Component id="jPanel4" min="-2" max="-2" attributes="0"/> @@ -456,7 +453,7 @@ <Component id="jLabel15" linkSize="8" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="lblPrecio" linkSize="6" alignment="3" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace pref="18" max="32767" attributes="0"/> + <EmptySpace pref="29" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -518,19 +515,6 @@ </Component> </SubComponents> </Container> - <Component class="javax.swing.JLabel" name="jLabel18"> - <Properties> - <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> - <Color blue="e5" green="cf" id="Button.shadow" palette="3" red="b8" type="palette"/> - </Property> - <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> - <Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo"> - <LineBorder/> - </Border> - </Property> - <Property name="opaque" type="boolean" value="true"/> - </Properties> - </Component> <Component class="javax.swing.JLabel" name="jLabel19"> <Properties> <Property name="text" type="java.lang.String" value="Cantidad:"/> @@ -542,6 +526,9 @@ <Properties> <Property name="text" type="java.lang.String" value="Insertar"/> </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnInsertarProductoActionPerformed"/> + </Events> </Component> <Container class="javax.swing.JScrollPane" name="jScrollPane"> Modified: OpaloERP/src/frontend/cxp/DgCrearOrden.java =================================================================== --- OpaloERP/src/frontend/cxp/DgCrearOrden.java 2007-09-28 20:44:22 UTC (rev 47) +++ OpaloERP/src/frontend/cxp/DgCrearOrden.java 2007-09-28 22:14:10 UTC (rev 48) @@ -13,7 +13,11 @@ import eventos.ProductoEvent; import eventos.ProveedorEvent; import frontend.proveedor.DgInsertarProducto; +import java.util.ArrayList; +import java.util.List; import javax.swing.JFrame; +import javax.swing.table.AbstractTableModel; +import mensaje_objetos.almacen.Producto; import mensaje_objetos.almacen.ProductosDelProveedor; import mensaje_objetos.proveedor.Proveedor; @@ -29,7 +33,13 @@ private Proveedor proveedorSeleccionado; private ProductosDelProveedor productoSeleccionado; - + private Producto producto; + private boolean buttonInsertar; + private AbstractTableModel modeloTablaProducto; + private String[] headers={"Producto","Descripcion","Precio","Cantidad"}; + private int accion; + private List<ProductosDelProveedor> productoTable; + private List<ProductosDelProveedor> listaProductos; /** Creates new form DgCrearOrden */ public DgCrearOrden(java.awt.Frame parent, boolean modal) { @@ -38,14 +48,158 @@ inicializarComponentes(); } - private void inicializarComponentes() + public void inicializarComponentes() { dgInsertarProducto = new DgInsertarProducto(new JFrame(), true); dgInsertarProducto.addProductoListener(this); dgInsertarProveedor = new DgInsertarProveedor(new JFrame(), true); dgInsertarProveedor.addProveedorListener(this); + inicializarTabla(); } + private void inicializarTabla() + { + modeloTablaProducto=new AbstractTableModel() + { + public int getColumnCount() + { + return headers.length; + } + public int getRowCount() + { + return productoTable.size(); + } + public Object getValueAt(int rowIndex, int columnIndex) + { + if(productoTable.size()>0) + { + ProductosDelProveedor producto=productoTable.get(rowIndex); + if(producto!=null) + { + if(columnIndex==0) + { + return producto.getNombre(); + } + if(columnIndex==1) + { + return producto.getDescripcion(); + } + if(columnIndex==2) + { + return producto.getPrecio(); + } + if(columnIndex==3) + { + // return producto.getCantidad(); + } + } + } + return ""; + } + public String getColumnName(int col) + { + return headers[col]; + } + }; + } + + public void fireOrdenDeCompra(OrdenCompraEvent ov) + { + if(ov!=null) + { + accion=ov.getId(); + if(ov.getId()==OrdenCompraEvent.NUEVO) + { + + limpiarCamposProveedor(); + limpiarCamposProducto(); + inicializarTabla(); + + listaProductos=new ArrayList<ProductosDelProveedor>(); + + productoTable=new ArrayList<ProductosDelProveedor>(); + } + + } + } + + public void limpiarCamposProveedor() + { + lblNombre.setText(""); + lblPorcMora.setText(""); + lblLimiteDeCredito.setText(""); + lblLimiteDeDias.setText(""); + lblRncCedula.setText(""); + } + public void limpiarCamposProducto() + { + lblProducto.setText(""); + lblDescripcion.setText(""); + lblPrecio.setText(""); + txtCantidad.setText(""); + } + + public void fireProducto(ProductoEvent producto) + { + this.producto=producto.getProducto(); + productoSeleccionado = getSelectedProducto(); + if(productoSeleccionado!=null) + { + if(producto!=null) + { + if(!buttonInsertar) + { + if(productoSeleccionado.getNombre()!=null) + { + lblNombre.setText(productoSeleccionado.getNombre()); + } + + if(productoSeleccionado.getDescripcion()!=null) + { + lblDescripcion.setText(productoSeleccionado.getDescripcion()); + } + + if(productoSeleccionado.getPrecio()!=null) + { + lblPrecio.setText(""+productoSeleccionado.getPrecio()); + } + } + else + { + List<ProductosDelProveedor> productos = proveedorSeleccionado.getProductos(); + if(productos == null) + { + productos = new ArrayList<ProductosDelProveedor>(); + proveedorSeleccionado.setProductos(productos); + } + + if(!productos.contains(productoSeleccionado)) productos.add(productoSeleccionado); + else productos.set(productos.indexOf(productoSeleccionado), productoSeleccionado); + + + inicializarTabla(); + limpiarCamposProducto(); + } + } + } + } + + public ProductosDelProveedor getSelectedProducto() + { + ProductosDelProveedor producto=null; + int arow=tableProductosSeleccionados.getSelectedRow(); + if(arow!=-1) + { + int row=tableProductosSeleccionados.convertRowIndexToModel(arow); + producto = productoTable.get(row); + } + return producto; + + } + /** + * @param args the command line arguments + */ + /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is @@ -57,6 +211,10 @@ buttonGroup1 = new javax.swing.ButtonGroup(); jTabbedPane1 = new javax.swing.JTabbedPane(); jPanel1 = new javax.swing.JPanel(); + btnBuscarProveedor = new javax.swing.JButton(); + jLabel3 = new javax.swing.JLabel(); + jRadioButton1 = new javax.swing.JRadioButton(); + jRadioButton2 = new javax.swing.JRadioButton(); jPanel3 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); @@ -68,10 +226,6 @@ lblLimiteDeCredito = new javax.swing.JLabel(); lblLimiteDeDias = new javax.swing.JLabel(); lblPorcMora = new javax.swing.JLabel(); - btnBuscarProveedor = new javax.swing.JButton(); - jLabel3 = new javax.swing.JLabel(); - jRadioButton1 = new javax.swing.JRadioButton(); - jRadioButton2 = new javax.swing.JRadioButton(); jPanel2 = new javax.swing.JPanel(); btnBuscarProducto = new javax.swing.JButton(); jPanel4 = new javax.swing.JPanel(); @@ -81,7 +235,6 @@ lblProducto = new javax.swing.JLabel(); lblDescripcion = new javax.swing.JLabel(); lblPrecio = new javax.swing.JLabel(); - jLabel18 = new javax.swing.JLabel(); jLabel19 = new javax.swing.JLabel(); txtCantidad = new javax.swing.JTextField(); btnInsertarProducto = new javax.swing.JButton(); @@ -93,6 +246,27 @@ btnNuevo = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + btnBuscarProveedor.setText("Buscar"); + btnBuscarProveedor.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { + btnBuscarProveedorActionPerformed(evt); + } + }); + + jLabel3.setText("Tipo de pago:"); + + buttonGroup1.add(jRadioButton1); + jRadioButton1.setText("Credito"); + jRadioButton1.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); + jRadioButton1.setMargin(new java.awt.Insets(0, 0, 0, 0)); + + buttonGroup1.add(jRadioButton2); + jRadioButton2.setText("Contado"); + jRadioButton2.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); + jRadioButton2.setMargin(new java.awt.Insets(0, 0, 0, 0)); + jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Datos principales", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 11), new java.awt.Color(102, 153, 255))); jLabel1.setText("Nombre:"); @@ -128,30 +302,30 @@ jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel3Layout.createSequentialGroup() - .addContainerGap() - .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(jPanel3Layout.createSequentialGroup() - .addComponent(jLabel1) + .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(lblNombre, javax.swing.GroupLayout.PREFERRED_SIZE, 369, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(lblNombre, javax.swing.GroupLayout.PREFERRED_SIZE, 400, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel3Layout.createSequentialGroup() .addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(lblRncCedula)) .addGroup(jPanel3Layout.createSequentialGroup() + .addComponent(jLabel4) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(lblLimiteDeCredito)) + .addGroup(jPanel3Layout.createSequentialGroup() .addComponent(jLabel5) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(lblLimiteDeDias)) .addGroup(jPanel3Layout.createSequentialGroup() - .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 152, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel6) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(lblPorcMora)) - .addGroup(jPanel3Layout.createSequentialGroup() - .addComponent(jLabel4) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(lblLimiteDeCredito))) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addComponent(lblPorcMora))) + .addContainerGap()) ); jPanel3Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel1, jLabel2, jLabel4, jLabel5, jLabel6}); @@ -161,54 +335,31 @@ jPanel3Layout.setVerticalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup() - .addContainerGap() + .addGap(39, 39, 39) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(lblNombre, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(lblNombre)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2) .addComponent(lblRncCedula)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(6, 6, 6) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel4) .addComponent(lblLimiteDeCredito)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel5) .addComponent(lblLimiteDeDias)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel6) .addComponent(lblPorcMora)) - .addContainerGap(35, Short.MAX_VALUE)) + .addContainerGap(53, Short.MAX_VALUE)) ); - jPanel3Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {lblLimiteDeCredito, lblLimiteDeDias, lblNombre, lblPorcMora, lblRncCedula}); + jPanel3Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jLabel1, jLabel2, jLabel4, jLabel5, jLabel6, lblLimiteDeCredito, lblLimiteDeDias, lblNombre, lblPorcMora, lblRncCedula}); - jPanel3Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jLabel1, jLabel2, jLabel4, jLabel5, jLabel6}); - - btnBuscarProveedor.setText("Buscar"); - btnBuscarProveedor.addActionListener(new java.awt.event.ActionListener() - { - public void actionPerformed(java.awt.event.ActionEvent evt) - { - btnBuscarProveedorActionPerformed(evt); - } - }); - - jLabel3.setText("Tipo de pago:"); - - buttonGroup1.add(jRadioButton1); - jRadioButton1.setText("Credito"); - jRadioButton1.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); - jRadioButton1.setMargin(new java.awt.Insets(0, 0, 0, 0)); - - buttonGroup1.add(jRadioButton2); - jRadioButton2.setText("Contado"); - jRadioButton2.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); - jRadioButton2.setMargin(new java.awt.Insets(0, 0, 0, 0)); - javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( @@ -216,15 +367,14 @@ .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(btnBuscarProveedor, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(12, 12, 12) .addComponent(jLabel3) - .addGap(79, 79, 79) + .addGap(86, 86, 86) .addComponent(jRadioButton1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jRadioButton2)) - .addComponent(btnBuscarProveedor, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addComponent(jRadioButton2))) .addContainerGap()) ); jPanel1Layout.setVerticalGroup( @@ -232,14 +382,14 @@ .addGroup(jPanel1Layout.createSequentialGroup() .addGap(27, 27, 27) .addComponent(btnBuscarProveedor) - .addGap(28, 28, 28) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(14, 14, 14) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel3) .addComponent(jRadioButton1) .addComponent(jRadioButton2)) - .addContainerGap(16, Short.MAX_VALUE)) + .addGap(73, 73, 73)) ); jTabbedPane1.addTab("Proveedor", jPanel1); @@ -311,20 +461,23 @@ .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel15) .addComponent(lblPrecio)) - .addContainerGap(18, Short.MAX_VALUE)) + .addContainerGap(29, Short.MAX_VALUE)) ); jPanel4Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {lblDescripcion, lblPrecio, lblProducto}); jPanel4Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jLabel13, jLabel14, jLabel15}); - jLabel18.setBackground(javax.swing.UIManager.getDefaults().getColor("Button.shadow")); - jLabel18.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); - jLabel18.setOpaque(true); - jLabel19.setText("Cantidad:"); btnInsertarProducto.setText("Insertar"); + btnInsertarProducto.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { + btnInsertarProductoActionPerformed(evt); + } + }); tableProductosSeleccionados.setModel(new javax.swing.table.DefaultTableModel( new Object [][] @@ -355,7 +508,6 @@ jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jLabel18) .addGroup(jPanel2Layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel19, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE) @@ -375,8 +527,7 @@ jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() - .addComponent(jLabel18) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGap(44, 44, 44) .addComponent(btnBuscarProducto) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) @@ -430,7 +581,7 @@ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap() - .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 417, Short.MAX_VALUE) + .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 432, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(btnCerrar) @@ -447,26 +598,39 @@ dispose(); }//GEN-LAST:event_btnCerrarActionPerformed - private void btnBuscarProveedorActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnBuscarProveedorActionPerformed - {//GEN-HEADEREND:event_btnBuscarProveedorActionPerformed - ProveedorEvent pv = new ProveedorEvent(); - pv.setId(ProveedorEvent.NUEVO); - dgInsertarProveedor.fireProveedor(pv); - dgInsertarProveedor.setVisible(true); - }//GEN-LAST:event_btnBuscarProveedorActionPerformed - + + private void btnInsertarProductoActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnInsertarProductoActionPerformed + {//GEN-HEADEREND:event_btnInsertarProductoActionPerformed + if(producto!=null) + { + buttonInsertar=true; + ProductoEvent pv=new ProductoEvent(); + pv.setId(ProductoEvent.NUEVO); + pv.setProducto(producto); + fireProducto(pv); + } + }//GEN-LAST:event_btnInsertarProductoActionPerformed + private void btnBuscarProductoActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnBuscarProductoActionPerformed {//GEN-HEADEREND:event_btnBuscarProductoActionPerformed + buttonInsertar=false; ProductoEvent pv = new ProductoEvent(); pv.setId(ProductoEvent.PROVEEDOR); pv.setProveedor(proveedorSeleccionado); dgInsertarProducto.fireProducto(pv); dgInsertarProducto.setVisible(true); + //dgInsertarProducto=new DgInsertarProducto(new JFrame(),true); + //dgInsertarProducto.addProductoListener(this); }//GEN-LAST:event_btnBuscarProductoActionPerformed - /** - * @param args the command line arguments - */ + private void btnBuscarProveedorActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnBuscarProveedorActionPerformed + {//GEN-HEADEREND:event_btnBuscarProveedorActionPerformed + ProveedorEvent pv = new ProveedorEvent(); + pv.setId(ProveedorEvent.NUEVO); + dgInsertarProveedor.fireProveedor(pv); + dgInsertarProveedor.setVisible(true); + }//GEN-LAST:event_btnBuscarProveedorActionPerformed + public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() @@ -478,18 +642,6 @@ }); } - public void fireProducto(ProductoEvent producto) - { - productoSeleccionado = producto.getProductoDelProveedor(); - lblProducto.setText(productoSeleccionado.getNombre()); - lblDescripcion.setText(productoSeleccionado.getDescripcion()); - lblPrecio.setText(""+productoSeleccionado.getPrecio()); - } - - public void fireOrdenDeCompra(OrdenCompraEvent orden) - { - } - public void fireProveedor(ProveedorEvent proveedor) { proveedorSeleccionado = proveedor.getProveedor(); @@ -515,7 +667,6 @@ private javax.swing.JLabel jLabel13; private javax.swing.JLabel jLabel14; private javax.swing.JLabel jLabel15; - private javax.swing.JLabel jLabel18; private javax.swing.JLabel jLabel19; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; Modified: OpaloERP/src/frontend/proveedor/DgCrearProveedor.java =================================================================== --- OpaloERP/src/frontend/proveedor/DgCrearProveedor.java 2007-09-28 20:44:22 UTC (rev 47) +++ OpaloERP/src/frontend/proveedor/DgCrearProveedor.java 2007-09-28 22:14:10 UTC (rev 48) @@ -371,6 +371,10 @@ lblRegion.setText(""); txtTelefono1.setText(""); txtTelefono2.setText(""); + txtProductoSeleccionado.setText(""); + txtCodigoProducto.setText(""); + txtDescripcion.setText(""); + } @@ -1851,7 +1855,7 @@ product.setNombre(txtProductoSeleccionado.getText()); product.setFecha(dateFecha.getDate()); product.setPrecio(Double.parseDouble(txtPrecio.getText())); - listaProductos.add(product); + productoTable.add(product); this.inicializarTablaProductos(); }//GEN-LAST:event_btnInsertarProductoActionPerformed Modified: OpaloERP/src/frontend/proveedor/DgInsertarProducto.java =================================================================== --- OpaloERP/src/frontend/proveedor/DgInsertarProducto.java 2007-09-28 20:44:22 UTC (rev 47) +++ OpaloERP/src/frontend/proveedor/DgInsertarProducto.java 2007-09-28 22:14:10 UTC (rev 48) @@ -375,6 +375,7 @@ { listaProductosProveedor = producto.getProveedor().getProductos(); productosProvTable = producto.getProveedor().getProductos(); + this.inicializarTabla(); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ang...@us...> - 2007-09-28 20:44:20
|
Revision: 47 http://opaloerp.svn.sourceforge.net/opaloerp/?rev=47&view=rev Author: angelblanco Date: 2007-09-28 13:44:22 -0700 (Fri, 28 Sep 2007) Log Message: ----------- -Funcionalidades agregadas -Valaidaci?\195?\179n de los datos del proveedor hasta donde es posible -Funcionalidades removidas o editadas -Ninguna Modified Paths: -------------- OpaloERP/nbproject/genfiles.properties OpaloERP/nbproject/project.properties OpaloERP/src/frontend/proveedor/DgCrearProveedor.form OpaloERP/src/frontend/proveedor/DgCrearProveedor.java Modified: OpaloERP/nbproject/genfiles.properties =================================================================== --- OpaloERP/nbproject/genfiles.properties 2007-09-28 13:21:50 UTC (rev 46) +++ OpaloERP/nbproject/genfiles.properties 2007-09-28 20:44:22 UTC (rev 47) @@ -5,4 +5,4 @@ # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=628e4a6e nbproject/build-impl.xml.script.CRC32=84be6d16 -nbproject/build-impl.xml.stylesheet.CRC32=65d7ca21 +nbproject/build-impl.xml.stylesheet.CRC32=20b9345e Modified: OpaloERP/nbproject/project.properties =================================================================== --- OpaloERP/nbproject/project.properties 2007-09-28 13:21:50 UTC (rev 46) +++ OpaloERP/nbproject/project.properties 2007-09-28 20:44:22 UTC (rev 47) @@ -16,6 +16,8 @@ dist.dir=dist dist.jar=${dist.dir}/OpaloERP.jar dist.javadoc.dir=${dist.dir}/javadoc +excludes= +includes=** jar.compress=false javac.classpath=\ ${libs.absolutelayout.classpath}:\ Modified: OpaloERP/src/frontend/proveedor/DgCrearProveedor.form =================================================================== --- OpaloERP/src/frontend/proveedor/DgCrearProveedor.form 2007-09-28 13:21:50 UTC (rev 46) +++ OpaloERP/src/frontend/proveedor/DgCrearProveedor.form 2007-09-28 20:44:22 UTC (rev 47) @@ -24,6 +24,7 @@ </NonVisualComponents> <Properties> <Property name="defaultCloseOperation" type="int" value="2"/> + <Property name="title" type="java.lang.String" value="áéíóúñ"/> </Properties> <SyntheticProperties> <SyntheticProperty name="formSizePolicy" type="int" value="1"/> @@ -246,16 +247,18 @@ </Group> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="txtMora" linkSize="4" alignment="0" pref="142" max="32767" attributes="0"/> - <Component id="txtLimitDias" linkSize="4" alignment="0" pref="142" max="32767" attributes="0"/> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace max="-2" attributes="0"/> - <Component id="txtLimitCred" linkSize="4" pref="198" max="32767" attributes="0"/> + <Component id="txtMora" min="-2" pref="142" max="-2" attributes="0"/> + <Group type="103" alignment="0" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Component id="txtLimitCred" pref="142" max="32767" attributes="0"/> + <EmptySpace min="-2" pref="56" max="-2" attributes="0"/> + </Group> + <Component id="txtLimitDias" min="-2" pref="142" max="-2" attributes="0"/> </Group> </Group> </Group> </Group> - <EmptySpace pref="30" max="32767" attributes="0"/> + <EmptySpace min="-2" pref="30" max="-2" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -275,14 +278,14 @@ <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> <Component id="jLabel6" linkSize="2" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="txtLimitDias" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtLimitDias" alignment="3" min="-2" pref="21" max="-2" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jLabel7" linkSize="2" min="-2" max="-2" attributes="0"/> - <Component id="txtMora" min="-2" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel7" linkSize="2" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtMora" alignment="3" min="-2" pref="21" max="-2" attributes="0"/> </Group> - <EmptySpace pref="36" max="32767" attributes="0"/> + <EmptySpace pref="41" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -341,11 +344,20 @@ </Property> </Properties> </Component> - <Component class="javax.swing.JTextField" name="txtLimitCred"> + <Component class="javax.swing.JFormattedTextField" name="txtLimitCred"> + <AuxValues> + <AuxValue name="JavaCodeGenerator_CreateCodePost" type="java.lang.String" value="txtLimitCred.setValue(0.00);
txtLimitCred.setFocusLostBehavior(JFormattedTextField.PERSIST);"/> + </AuxValues> </Component> - <Component class="javax.swing.JTextField" name="txtLimitDias"> + <Component class="javax.swing.JFormattedTextField" name="txtLimitDias"> + <AuxValues> + <AuxValue name="JavaCodeGenerator_CreateCodePost" type="java.lang.String" value="txtLimitDias.setValue(0);
txtLimitDias.setFocusLostBehavior(JFormattedTextField.PERSIST);"/> + </AuxValues> </Component> - <Component class="javax.swing.JTextField" name="txtMora"> + <Component class="javax.swing.JFormattedTextField" name="txtMora"> + <AuxValues> + <AuxValue name="JavaCodeGenerator_CreateCodePost" type="java.lang.String" value="txtMora.setValue(0.00);
txtMora.setFocusLostBehavior(JFormattedTextField.PERSIST);"/> + </AuxValues> </Component> </SubComponents> </Container> @@ -425,7 +437,7 @@ </Group> <EmptySpace max="-2" attributes="0"/> <Component id="btnInsertarDireccion" min="-2" max="-2" attributes="0"/> - <EmptySpace pref="53" max="32767" attributes="0"/> + <EmptySpace pref="58" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> Modified: OpaloERP/src/frontend/proveedor/DgCrearProveedor.java =================================================================== --- OpaloERP/src/frontend/proveedor/DgCrearProveedor.java 2007-09-28 13:21:50 UTC (rev 46) +++ OpaloERP/src/frontend/proveedor/DgCrearProveedor.java 2007-09-28 20:44:22 UTC (rev 47) @@ -17,8 +17,10 @@ import frontend.cliente.DgCrearContacto; import frontend.cliente.DgDireccionCliente; import java.math.BigInteger; +import java.text.ParseException; import java.util.ArrayList; import java.util.List; +import javax.swing.JFormattedTextField; import javax.swing.JFrame; import javax.swing.JOptionPane; import javax.swing.table.AbstractTableModel; @@ -357,9 +359,9 @@ txtDocumento.setText(""); txtEmail.setText(""); txtFax.setText(""); - txtLimitCred.setText(""); - txtLimitDias.setText(""); - txtMora.setText(""); + txtLimitCred.setValue(0.00); + txtLimitDias.setValue(0); + txtMora.setValue(0.00); txtNombre.setText(""); txtNombreContacto.setText(""); lblPais.setText(""); @@ -488,22 +490,118 @@ public void execute() { - if(accion == ProveedorEvent.NUEVO) + Proveedor p = this.proveedorSeleccionado; + this.setDireccionPrincipal(p); + this.setContactoPrincipal(p); + if(validarCampos()) { - Proveedor p = this.proveedorSeleccionado; this.setProveedorData(p); - this.setDireccionPrincipal(p); - this.setContactoPrincipal(p); - modeloProveedor.addProveedor(p); + if(accion == ProveedorEvent.NUEVO) + { + modeloProveedor.addProveedor(p); + } + else if(accion == ProveedorEvent.EDITAR) + { + modeloProveedor.updateProveedor(p); + } } - else if(accion == ProveedorEvent.EDITAR) + } + + public boolean validarCampos() + { + boolean validacion = true; + String mensaje = new String(); + if(txtNombre.getText().length() == 0) { - Proveedor p = this.proveedorSeleccionado; - this.setProveedorData(p); - this.setDireccionPrincipal(p); - this.setContactoPrincipal(p); - modeloProveedor.updateProveedor(p); + mensaje += "El campo del nombre del proveedor est\u00e1 vac\u00edo\n"; + validacion = false; } + if(txtNombreContacto.getText().length() == 0) + { + mensaje += "El campo del nombre del contacto est\u00e1 vac\u00edo\n"; + validacion = false; + } + if(txtTelefono1.getText().length() == 0) + { + mensaje += "El campo del telefono1 del contacto est\u00e1 vac\u00edo\n"; + validacion = false; + } + if(txtTelefono2.getText().length() == 0) + { + mensaje += "El campo del telefono2 del contacto est\u00e1 vac\u00edo\n"; + validacion = false; + } + if(txtCargo.getText().length() == 0) + { + mensaje += "El campo de cargo del contacto est\u00e1 vac\u00edo\n"; + validacion = false; + } + if(txtCodigo.getText().length() == 0) + { + mensaje += "El campo del c\u00f3digo del proveedor est\u00e1 vac\u00edo\n"; + validacion = false; + } + if(txtDocumento.getText().length() == 0) + { + mensaje += "El campo del documento del proveedor est\u00e1 vac\u00edo\n"; + validacion = false; + } + if(txtEmail.getText().length() == 0) + { + mensaje += "El campo del e-mail del contacto est\u00e1 vac\u00edo\n"; + validacion = false; + } + if(txtFax.getText().length() == 0) + { + mensaje += "El campo del fax del contacto est\u00e1 vac\u00edo\n"; + validacion = false; + } + try + { + txtLimitCred.commitEdit(); + } + catch (ParseException ex) + { + mensaje += "El campo del l\u00edmite de cr\u00e9dito del proveedor " + + "est\u00e1 vac\u00edo o con un formato incorrecto\n"; + validacion = false; + } + try + { + txtLimitDias.commitEdit(); + } + catch (ParseException ex) + { + mensaje += "El campo del l\u00edmite de d\u00edas del proveedor " + + "est\u00e1 vac\u00edo o con un formato incorrecto\n"; + validacion = false; + } + try + { + txtMora.commitEdit(); + } + catch (ParseException ex) + { + mensaje += "El campo de mora del proveedor " + + "est\u00e1 vac\u00edo o con un formato incorrecto\n"; + validacion = false; + } + + if(dirPrincipal == null) + { + mensaje += "No se ha seleccionado una direcci\u00f3n principal v\u00e1lida\n"; + validacion = false; + } + + if(conPrincipal == null) + { + mensaje += "No se ha seleccionado un contacto principal v\u00e1lido\n"; + validacion = false; + } + if(!validacion) + JOptionPane.showMessageDialog(this,mensaje, "LLene los campos correctamente", JOptionPane.WARNING_MESSAGE); + + return validacion; } private void setProveedorData(Proveedor p) @@ -583,9 +681,12 @@ } else { - if(direcciones.isEmpty()){ + if(direcciones.isEmpty()) + { direcciones.add(dirPrincipal); - }else{ + } + else + { direcciones.set(0, dirPrincipal); } @@ -609,10 +710,14 @@ p.setContactos(contactos); contactos.add(0, conPrincipal); } - else{ - if(contactos.isEmpty()){ + else + { + if(contactos.isEmpty()) + { contactos.add(conPrincipal); - }else{ + } + else + { contactos.set(0, conPrincipal); } } @@ -680,7 +785,7 @@ else contactos.set(contactos.indexOf(con), con); this.inicializarTablaContacto(); } - + public void fireProducto(ProductoEvent producto) { productoSeleccionado = producto.getProducto(); @@ -715,9 +820,15 @@ jLabel7 = new javax.swing.JLabel(); rbtnCredito = new javax.swing.JRadioButton(); rbtnContado = new javax.swing.JRadioButton(); - txtLimitCred = new javax.swing.JTextField(); - txtLimitDias = new javax.swing.JTextField(); - txtMora = new javax.swing.JTextField(); + txtLimitCred = new javax.swing.JFormattedTextField(); + txtLimitCred.setValue(0.00); + txtLimitCred.setFocusLostBehavior(JFormattedTextField.PERSIST); + txtLimitDias = new javax.swing.JFormattedTextField(); + txtLimitDias.setValue(0); + txtLimitDias.setFocusLostBehavior(JFormattedTextField.PERSIST); + txtMora = new javax.swing.JFormattedTextField(); + txtMora.setValue(0.00); + txtMora.setFocusLostBehavior(JFormattedTextField.PERSIST); jpanel1 = new javax.swing.JPanel(); jLabel8 = new javax.swing.JLabel(); jScrollPane1 = new javax.swing.JScrollPane(); @@ -804,6 +915,7 @@ ); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + setTitle("\u00e1\u00e9\u00ed\u00f3\u00fa\u00f1"); jLabel1.setText("Codigo:"); jLabel2.setText("Nombre"); @@ -861,16 +973,14 @@ .addComponent(jLabel6)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(txtMora, javax.swing.GroupLayout.DEFAULT_SIZE, 142, Short.MAX_VALUE) - .addComponent(txtLimitDias, javax.swing.GroupLayout.DEFAULT_SIZE, 142, Short.MAX_VALUE) - .addGroup(jPanel4Layout.createSequentialGroup() - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(txtLimitCred, javax.swing.GroupLayout.DEFAULT_SIZE, 198, Short.MAX_VALUE))))) - .addContainerGap(30, Short.MAX_VALUE)) + .addComponent(txtMora, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel4Layout.createSequentialGroup() + .addComponent(txtLimitCred, javax.swing.GroupLayout.DEFAULT_SIZE, 142, Short.MAX_VALUE) + .addGap(56, 56, 56)) + .addComponent(txtLimitDias, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE))))) + .addGap(30, 30, 30)) ); - - jPanel4Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {txtLimitCred, txtLimitDias, txtMora}); - jPanel4Layout.setVerticalGroup( jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup() @@ -885,12 +995,12 @@ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel6) - .addComponent(txtLimitDias, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(txtLimitDias, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel7) - .addComponent(txtMora, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addContainerGap(36, Short.MAX_VALUE)) + .addComponent(txtMora, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addContainerGap(41, Short.MAX_VALUE)) ); jPanel4Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jLabel4, jLabel5, jLabel6, jLabel7}); @@ -996,7 +1106,7 @@ .addComponent(lblProvincia)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnInsertarDireccion) - .addContainerGap(53, Short.MAX_VALUE)) + .addContainerGap(58, Short.MAX_VALUE)) ); jpanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {lblCiudad, lblPais, lblProvincia, lblRegion}); @@ -1619,7 +1729,7 @@ ); pack(); }// </editor-fold>//GEN-END:initComponents - + private void txtBuscarContactoActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_txtBuscarContactoActionPerformed {//GEN-HEADEREND:event_txtBuscarContactoActionPerformed String patron=txtBuscarDireccion.getText(); @@ -1646,7 +1756,7 @@ modeloTablaDireccion.fireTableDataChanged(); } }//GEN-LAST:event_txtBuscarContactoActionPerformed - + private void txtBuscarDireccionActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_txtBuscarDireccionActionPerformed {//GEN-HEADEREND:event_txtBuscarDireccionActionPerformed String patron=txtBuscarDireccion.getText(); @@ -1676,35 +1786,41 @@ { direccionTable=modeloDireccion.getDireccionPorPais(listaDirecciones,patron.trim()); modeloTablaDireccion.fireTableDataChanged(); - } + } }//GEN-LAST:event_txtBuscarDireccionActionPerformed - + private void cmbTipoBusquedaDireccionesItemStateChanged(java.awt.event.ItemEvent evt)//GEN-FIRST:event_cmbTipoBusquedaDireccionesItemStateChanged {//GEN-HEADEREND:event_cmbTipoBusquedaDireccionesItemStateChanged - String itemSelected=(String)cmbTipoBusquedaDirecciones.getSelectedItem(); - if(itemSelected.equals("Seleccionar")){ - direccionTable.clear(); - modeloTablaDireccion.fireTableDataChanged(); - txtBuscarDireccion.setEnabled(false); - }else{ + String itemSelected=(String)cmbTipoBusquedaDirecciones.getSelectedItem(); + if(itemSelected.equals("Seleccionar")) + { + direccionTable.clear(); + modeloTablaDireccion.fireTableDataChanged(); + txtBuscarDireccion.setEnabled(false); + } + else + { txtBuscarDireccion.setEnabled(true); txtBuscarDireccion.requestFocus(); } }//GEN-LAST:event_cmbTipoBusquedaDireccionesItemStateChanged - + private void cmbTipoBusquedaContactosItemStateChanged(java.awt.event.ItemEvent evt)//GEN-FIRST:event_cmbTipoBusquedaContactosItemStateChanged {//GEN-HEADEREND:event_cmbTipoBusquedaContactosItemStateChanged - String itemSelected=(String)cmbTipoBusquedaContactos.getSelectedItem(); - if(itemSelected.equals("Seleccionar")){ - contactoTable.clear(); - modeloTablaContacto.fireTableDataChanged(); - txtBuscarContacto.setEnabled(false); - }else{ + String itemSelected=(String)cmbTipoBusquedaContactos.getSelectedItem(); + if(itemSelected.equals("Seleccionar")) + { + contactoTable.clear(); + modeloTablaContacto.fireTableDataChanged(); + txtBuscarContacto.setEnabled(false); + } + else + { txtBuscarContacto.setEnabled(true); txtBuscarContacto.requestFocus(); } }//GEN-LAST:event_cmbTipoBusquedaContactosItemStateChanged - + private void btnRemoverProductoActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnRemoverProductoActionPerformed {//GEN-HEADEREND:event_btnRemoverProductoActionPerformed productoprovSeleccionado = getSelectedProducto(); @@ -1726,7 +1842,7 @@ " para realizar esta operaci\u00f3n", "Seleccione una direccion", JOptionPane.WARNING_MESSAGE); } }//GEN-LAST:event_btnRemoverProductoActionPerformed - + private void btnInsertarProductoActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnInsertarProductoActionPerformed {//GEN-HEADEREND:event_btnInsertarProductoActionPerformed ProductosDelProveedor product = new ProductosDelProveedor(); @@ -1801,6 +1917,7 @@ {//GEN-HEADEREND:event_btnSalvarCerrarActionPerformed execute(); dispose(); + }//GEN-LAST:event_btnSalvarCerrarActionPerformed private void btnInsertarDireccionActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnInsertarDireccionActionPerformed @@ -1816,6 +1933,7 @@ private void btnSalvarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalvarActionPerformed execute(); + }//GEN-LAST:event_btnSalvarActionPerformed private void btnVisualizarContactoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnVisualizarContactoActionPerformed @@ -1958,9 +2076,9 @@ private javax.swing.JTextField txtDocumento; private javax.swing.JTextField txtEmail; private javax.swing.JTextField txtFax; - private javax.swing.JTextField txtLimitCred; - private javax.swing.JTextField txtLimitDias; - private javax.swing.JTextField txtMora; + private javax.swing.JFormattedTextField txtLimitCred; + private javax.swing.JFormattedTextField txtLimitDias; + private javax.swing.JFormattedTextField txtMora; private javax.swing.JTextField txtNombre; private javax.swing.JTextField txtNombreContacto; private javax.swing.JTextField txtPrecio; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2007-09-28 13:22:06
|
Revision: 46 http://opaloerp.svn.sourceforge.net/opaloerp/?rev=46&view=rev Author: thegenius03 Date: 2007-09-28 06:21:50 -0700 (Fri, 28 Sep 2007) Log Message: ----------- - Funcionalidades Agregadas - Crear Nueva Orden de Compra - Insertar Proveedor para la Orden - Funcionalidades pendientes (no terminadas) - Insertar Productos para la Orden - Guardar la Orden de Compra Modified Paths: -------------- OpaloERP/src/eventos/ProductoEvent.java OpaloERP/src/frontend/FRModuloPrincipal.form OpaloERP/src/frontend/FRModuloPrincipal.java OpaloERP/src/frontend/cxp/DgCrearOrden.form OpaloERP/src/frontend/cxp/DgCrearOrden.java OpaloERP/src/frontend/cxp/IOrdenDeCompra.java OpaloERP/src/frontend/proveedor/DgInsertarProducto.java Added Paths: ----------- OpaloERP/src/eventos/IOrdenCompraListener.java OpaloERP/src/eventos/OrdenCompraEvent.java OpaloERP/src/frontend/almacen/IEntradaProductosAlmacen.form OpaloERP/src/frontend/almacen/IEntradaProductosAlmacen.java OpaloERP/src/frontend/cxp/DgInsertarProveedor.form OpaloERP/src/frontend/cxp/DgInsertarProveedor.java Added: OpaloERP/src/eventos/IOrdenCompraListener.java =================================================================== --- OpaloERP/src/eventos/IOrdenCompraListener.java (rev 0) +++ OpaloERP/src/eventos/IOrdenCompraListener.java 2007-09-28 13:21:50 UTC (rev 46) @@ -0,0 +1,19 @@ +/* + * IOrdenCompraListener.java + * + * Created on 28 de septiembre de 2007, 7:51 + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package eventos; + +/** + * + * @author gonzalez + */ +public interface IOrdenCompraListener +{ + void fireOrdenDeCompra(OrdenCompraEvent orden); +} Added: OpaloERP/src/eventos/OrdenCompraEvent.java =================================================================== --- OpaloERP/src/eventos/OrdenCompraEvent.java (rev 0) +++ OpaloERP/src/eventos/OrdenCompraEvent.java 2007-09-28 13:21:50 UTC (rev 46) @@ -0,0 +1,48 @@ +/* + * OrdenCompraEvent.java + * + * Created on 28 de septiembre de 2007, 7:53 + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package eventos; + +import mensaje_objetos.orden_de_compra.OrdenDeCompra; + +/** + * + * @author gonzalez + */ +public class OrdenCompraEvent +{ + public static final int NUEVO=0; + public static final int EDITAR=1; + public static final int VISUALIZAR=2; + public static final int SELECCIONAR_ORDEN=3; + + private OrdenDeCompra ordenDeCompra; + private int Id; + + public OrdenDeCompra getOrdenDeCompra() + { + return ordenDeCompra; + } + + public void setOrdenDeCompra(OrdenDeCompra ordenDeCompra) + { + this.ordenDeCompra = ordenDeCompra; + } + + public int getId() + { + return Id; + } + + public void setId(int Id) + { + this.Id = Id; + } + +} Modified: OpaloERP/src/eventos/ProductoEvent.java =================================================================== --- OpaloERP/src/eventos/ProductoEvent.java 2007-09-28 00:43:51 UTC (rev 45) +++ OpaloERP/src/eventos/ProductoEvent.java 2007-09-28 13:21:50 UTC (rev 46) @@ -10,8 +10,8 @@ package eventos; import mensaje_objetos.almacen.Producto; -import mensaje_objetos.cliente.GrupoCliente; -import mensaje_objetos.cliente.Pais; +import mensaje_objetos.almacen.ProductosDelProveedor; +import mensaje_objetos.proveedor.Proveedor; /** * @@ -22,9 +22,12 @@ public static final int EDITAR=1; public static final int VISUALIZAR=2; public static final int SELECCIONAR_PRODUCTO=3; + public static final int PROVEEDOR=4; private Producto producto; + private Proveedor proveedor; + private ProductosDelProveedor productoDelProveedor; private int Id; public Producto getProducto() { @@ -42,6 +45,26 @@ public void setId(int Id) { this.Id = Id; } + + public Proveedor getProveedor() + { + return proveedor; + } + + public void setProveedor(Proveedor proveedor) + { + this.proveedor = proveedor; + } + + public ProductosDelProveedor getProductoDelProveedor() + { + return productoDelProveedor; + } + + public void setProductoDelProveedor(ProductosDelProveedor productoDelProveedor) + { + this.productoDelProveedor = productoDelProveedor; + } } Modified: OpaloERP/src/frontend/FRModuloPrincipal.form =================================================================== --- OpaloERP/src/frontend/FRModuloPrincipal.form 2007-09-28 00:43:51 UTC (rev 45) +++ OpaloERP/src/frontend/FRModuloPrincipal.form 2007-09-28 13:21:50 UTC (rev 46) @@ -66,6 +66,14 @@ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="itemProveedorActionPerformed"/> </Events> </MenuItem> + <MenuItem class="javax.swing.JMenuItem" name="itemOrdenCompra"> + <Properties> + <Property name="text" type="java.lang.String" value="Ordenes de Compra"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="itemOrdenCompraActionPerformed"/> + </Events> + </MenuItem> <MenuItem class="javax.swing.JSeparator" name="jSeparator1"> </MenuItem> <MenuItem class="javax.swing.JMenuItem" name="itemEmpresa"> Modified: OpaloERP/src/frontend/FRModuloPrincipal.java =================================================================== --- OpaloERP/src/frontend/FRModuloPrincipal.java 2007-09-28 00:43:51 UTC (rev 45) +++ OpaloERP/src/frontend/FRModuloPrincipal.java 2007-09-28 13:21:50 UTC (rev 46) @@ -14,6 +14,7 @@ import frontend.cliente.IAdministrarDescuento; import frontend.cliente.IAdministrarFormaVenta; import frontend.cliente.IAdministrarGrupoCliente; +import frontend.cxp.IOrdenDeCompra; import frontend.empresa.AdministracionEmpresa; import frontend.facturacion.IFacturarProducto; import frontend.facturacion.ISolicitarProducto; @@ -43,6 +44,7 @@ private IFacturarProducto iAdmFactura; private IAlmacen iAdmAlmacen; private IAdministrarProveedor iAdmProveedor; + private IOrdenDeCompra iOrdenDeCompra; //representa la ventana de regulacion de stock. private IFRegulacionStock iadmRegulacion; //para centrar la pantalla. @@ -73,6 +75,7 @@ iAdmAlmacen=new IAlmacen(); iadmRegulacion=new IFRegulacionStock(); iAdmProveedor = new IAdministrarProveedor(); + iOrdenDeCompra = new IOrdenDeCompra(); //insertando las imagenes. insertarImagenes(); //centrando la pantalla. @@ -118,6 +121,7 @@ itemDescuento = new javax.swing.JMenuItem(); itemVendedor = new javax.swing.JMenuItem(); itemProveedor = new javax.swing.JMenuItem(); + itemOrdenCompra = new javax.swing.JMenuItem(); jSeparator1 = new javax.swing.JSeparator(); itemEmpresa = new javax.swing.JMenuItem(); itemFiscalidad = new javax.swing.JMenu(); @@ -271,6 +275,17 @@ itemPrincipal.add(itemProveedor); + itemOrdenCompra.setText("Ordenes de Compra"); + itemOrdenCompra.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { + itemOrdenCompraActionPerformed(evt); + } + }); + + itemPrincipal.add(itemOrdenCompra); + itemPrincipal.add(jSeparator1); itemEmpresa.setText("Empresa"); @@ -382,6 +397,12 @@ pack(); }// </editor-fold>//GEN-END:initComponents + private void itemOrdenCompraActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_itemOrdenCompraActionPerformed + {//GEN-HEADEREND:event_itemOrdenCompraActionPerformed + desktop.add(iOrdenDeCompra); + iOrdenDeCompra.setVisible(true); + }//GEN-LAST:event_itemOrdenCompraActionPerformed + private void mitemProductoActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_mitemProductoActionPerformed {//GEN-HEADEREND:event_mitemProductoActionPerformed desktop.add(insertarArticulo); @@ -558,6 +579,7 @@ private javax.swing.JMenu itemFiscalidad; private javax.swing.JMenuItem itemFormaVenta; private javax.swing.JMenuItem itemGrupoCliente; + private javax.swing.JMenuItem itemOrdenCompra; private javax.swing.JMenu itemPrincipal; private javax.swing.JMenuItem itemProveedor; private javax.swing.JMenuItem itemRecibo; Added: OpaloERP/src/frontend/almacen/IEntradaProductosAlmacen.form =================================================================== --- OpaloERP/src/frontend/almacen/IEntradaProductosAlmacen.form (rev 0) +++ OpaloERP/src/frontend/almacen/IEntradaProductosAlmacen.form 2007-09-28 13:21:50 UTC (rev 46) @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.3" type="org.netbeans.modules.form.forminfo.JInternalFrameFormInfo"> + <SyntheticProperties> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + </SyntheticProperties> + <AuxValues> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + </AuxValues> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <EmptySpace min="0" pref="394" max="32767" attributes="0"/> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <EmptySpace min="0" pref="274" max="32767" attributes="0"/> + </Group> + </DimensionLayout> + </Layout> +</Form> Added: OpaloERP/src/frontend/almacen/IEntradaProductosAlmacen.java =================================================================== --- OpaloERP/src/frontend/almacen/IEntradaProductosAlmacen.java (rev 0) +++ OpaloERP/src/frontend/almacen/IEntradaProductosAlmacen.java 2007-09-28 13:21:50 UTC (rev 46) @@ -0,0 +1,48 @@ +/* + * IEntradaProductosAlmacen.java + * + * Created on 25 de septiembre de 2007, 13:01 + */ + +package frontend.almacen; + +/** + * + * @author gonzalez + */ +public class IEntradaProductosAlmacen extends javax.swing.JInternalFrame +{ + + /** Creates new form IEntradaProductosAlmacen */ + public IEntradaProductosAlmacen() + { + initComponents(); + } + + /** 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. + */ + // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents + private void initComponents() + { + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 394, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 274, Short.MAX_VALUE) + ); + pack(); + }// </editor-fold>//GEN-END:initComponents + + + // Variables declaration - do not modify//GEN-BEGIN:variables + // End of variables declaration//GEN-END:variables + +} Modified: OpaloERP/src/frontend/cxp/DgCrearOrden.form =================================================================== --- OpaloERP/src/frontend/cxp/DgCrearOrden.form 2007-09-28 00:43:51 UTC (rev 45) +++ OpaloERP/src/frontend/cxp/DgCrearOrden.form 2007-09-28 13:21:50 UTC (rev 46) @@ -1,6 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <Form version="1.3" type="org.netbeans.modules.form.forminfo.JDialogFormInfo"> + <NonVisualComponents> + <Component class="javax.swing.ButtonGroup" name="buttonGroup1"> + </Component> + </NonVisualComponents> <Properties> <Property name="defaultCloseOperation" type="int" value="2"/> </Properties> @@ -43,7 +47,7 @@ <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" alignment="1" attributes="0"> <EmptySpace max="-2" attributes="0"/> - <Component id="jTabbedPane1" pref="416" max="32767" attributes="0"/> + <Component id="jTabbedPane1" pref="417" max="32767" attributes="0"/> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> <Component id="btnCerrar" alignment="3" min="-2" max="-2" attributes="0"/> @@ -62,9 +66,6 @@ <Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/> <SubComponents> <Container class="javax.swing.JPanel" name="jPanel1"> - <Properties> - <Property name="name" type="java.lang.String" value="null"/> - </Properties> <Constraints> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription"> <JTabbedPaneConstraints tabName="Proveedor"> @@ -79,6 +80,14 @@ <Group type="102" alignment="0" attributes="0"> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="12" pref="12" max="12" attributes="0"/> + <Component id="jLabel3" linkSize="1" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="79" max="-2" attributes="0"/> + <Component id="jRadioButton1" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jRadioButton2" min="-2" max="-2" attributes="0"/> + </Group> <Component id="btnBuscarProveedor" alignment="0" min="-2" pref="116" max="-2" attributes="0"/> <Component id="jPanel3" alignment="0" max="32767" attributes="0"/> </Group> @@ -93,7 +102,13 @@ <Component id="btnBuscarProveedor" min="-2" max="-2" attributes="0"/> <EmptySpace min="-2" pref="28" max="-2" attributes="0"/> <Component id="jPanel3" min="-2" max="-2" attributes="0"/> - <EmptySpace pref="74" max="32767" attributes="0"/> + <EmptySpace min="-2" pref="14" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jRadioButton1" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jRadioButton2" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace pref="16" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -113,9 +128,9 @@ <Layout> <DimensionLayout dim="0"> <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" max="-2" attributes="0"> + <Group type="102" attributes="0"> <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0"> <Component id="jLabel1" linkSize="1" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> @@ -127,16 +142,6 @@ <Component id="lblRncCedula" linkSize="2" min="-2" max="-2" attributes="0"/> </Group> <Group type="102" alignment="0" attributes="0"> - <Component id="jLabel3" linkSize="1" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="lblTipodePago" linkSize="2" min="-2" max="-2" attributes="0"/> - </Group> - <Group type="102" alignment="0" attributes="0"> - <Component id="jLabel4" linkSize="1" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="lblLimiteDeCredito" linkSize="2" min="-2" max="-2" attributes="0"/> - </Group> - <Group type="102" alignment="0" attributes="0"> <Component id="jLabel5" linkSize="1" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> <Component id="lblLimiteDeDias" linkSize="2" min="-2" max="-2" attributes="0"/> @@ -146,8 +151,13 @@ <EmptySpace max="-2" attributes="0"/> <Component id="lblPorcMora" linkSize="2" min="-2" max="-2" attributes="0"/> </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel4" linkSize="1" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Component id="lblLimiteDeCredito" linkSize="2" min="-2" max="-2" attributes="0"/> + </Group> </Group> - <EmptySpace max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -156,35 +166,30 @@ <Group type="102" alignment="0" attributes="0"> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> - <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="lblNombre" linkSize="3" alignment="3" min="-2" pref="23" max="-2" attributes="0"/> + <Component id="jLabel1" linkSize="9" alignment="3" min="-2" pref="34" max="-2" attributes="0"/> + <Component id="lblNombre" linkSize="3" alignment="3" min="-2" pref="29" max="-2" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> - <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel2" linkSize="9" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="lblRncCedula" linkSize="3" alignment="3" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="lblTipodePago" linkSize="3" alignment="3" min="-2" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel4" linkSize="9" min="-2" max="-2" attributes="0"/> + <Component id="lblLimiteDeCredito" linkSize="3" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="lblLimiteDeCredito" linkSize="3" alignment="3" min="-2" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel5" linkSize="9" min="-2" max="-2" attributes="0"/> + <Component id="lblLimiteDeDias" linkSize="3" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="lblLimiteDeDias" linkSize="3" alignment="3" min="-2" max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="jLabel6" linkSize="9" min="-2" max="-2" attributes="0"/> + <Component id="lblPorcMora" linkSize="3" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="lblPorcMora" linkSize="3" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace pref="31" max="32767" attributes="0"/> + <EmptySpace pref="35" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -200,11 +205,6 @@ <Property name="text" type="java.lang.String" value="Rnc/Cedula:"/> </Properties> </Component> - <Component class="javax.swing.JLabel" name="jLabel3"> - <Properties> - <Property name="text" type="java.lang.String" value="Tipo de pago:"/> - </Properties> - </Component> <Component class="javax.swing.JLabel" name="jLabel4"> <Properties> <Property name="text" type="java.lang.String" value="Limite de Credito:"/> @@ -246,19 +246,6 @@ <Property name="opaque" type="boolean" value="true"/> </Properties> </Component> - <Component class="javax.swing.JLabel" name="lblTipodePago"> - <Properties> - <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> - <Color blue="e5" green="cf" id="Button.shadow" palette="3" red="b8" type="palette"/> - </Property> - <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> - <Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo"> - <LineBorder/> - </Border> - </Property> - <Property name="opaque" type="boolean" value="true"/> - </Properties> - </Component> <Component class="javax.swing.JLabel" name="lblLimiteDeCredito"> <Properties> <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> @@ -304,7 +291,47 @@ <Properties> <Property name="text" type="java.lang.String" value="Buscar"/> </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnBuscarProveedorActionPerformed"/> + </Events> </Component> + <Component class="javax.swing.JLabel" name="jLabel3"> + <Properties> + <Property name="text" type="java.lang.String" value="Tipo de pago:"/> + </Properties> + </Component> + <Component class="javax.swing.JRadioButton" name="jRadioButton1"> + <Properties> + <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor"> + <ComponentRef name="buttonGroup1"/> + </Property> + <Property name="text" type="java.lang.String" value="Credito"/> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo"> + <EmptyBorder bottom="0" left="0" right="0" top="0"/> + </Border> + </Property> + <Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor"> + <Insets value="[0, 0, 0, 0]"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JRadioButton" name="jRadioButton2"> + <Properties> + <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor"> + <ComponentRef name="buttonGroup1"/> + </Property> + <Property name="text" type="java.lang.String" value="Contado"/> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo"> + <EmptyBorder bottom="0" left="0" right="0" top="0"/> + </Border> + </Property> + <Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor"> + <Insets value="[0, 0, 0, 0]"/> + </Property> + </Properties> + </Component> </SubComponents> </Container> <Container class="javax.swing.JPanel" name="jPanel2"> @@ -359,7 +386,7 @@ <Component id="btnInsertarProducto" alignment="3" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> - <Component id="jScrollPane" pref="180" max="32767" attributes="0"/> + <Component id="jScrollPane" pref="177" max="32767" attributes="0"/> <EmptySpace max="-2" attributes="0"/> </Group> </Group> @@ -370,6 +397,9 @@ <Properties> <Property name="text" type="java.lang.String" value="Buscar"/> </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnBuscarProductoActionPerformed"/> + </Events> </Component> <Container class="javax.swing.JPanel" name="jPanel4"> <Properties> @@ -426,7 +456,7 @@ <Component id="jLabel15" linkSize="8" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="lblPrecio" linkSize="6" alignment="3" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace pref="14" max="32767" attributes="0"/> + <EmptySpace pref="18" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -539,6 +569,9 @@ <Properties> <Property name="text" type="java.lang.String" value="Cerrar"/> </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCerrarActionPerformed"/> + </Events> </Component> <Component class="javax.swing.JButton" name="btnSalvarCerrar"> <Properties> Modified: OpaloERP/src/frontend/cxp/DgCrearOrden.java =================================================================== --- OpaloERP/src/frontend/cxp/DgCrearOrden.java 2007-09-28 00:43:51 UTC (rev 45) +++ OpaloERP/src/frontend/cxp/DgCrearOrden.java 2007-09-28 13:21:50 UTC (rev 46) @@ -6,20 +6,46 @@ package frontend.cxp; +import eventos.IOrdenCompraListener; +import eventos.IProductoListener; +import eventos.IProveedorListener; +import eventos.OrdenCompraEvent; +import eventos.ProductoEvent; +import eventos.ProveedorEvent; +import frontend.proveedor.DgInsertarProducto; +import javax.swing.JFrame; +import mensaje_objetos.almacen.ProductosDelProveedor; +import mensaje_objetos.proveedor.Proveedor; + /** * * @author raymi */ -public class DgCrearOrden extends javax.swing.JDialog +public class DgCrearOrden extends javax.swing.JDialog implements IOrdenCompraListener, + IProveedorListener, IProductoListener { + private DgInsertarProducto dgInsertarProducto; + private DgInsertarProveedor dgInsertarProveedor; + private Proveedor proveedorSeleccionado; + private ProductosDelProveedor productoSeleccionado; + /** Creates new form DgCrearOrden */ public DgCrearOrden(java.awt.Frame parent, boolean modal) { super(parent, modal); initComponents(); + inicializarComponentes(); } + private void inicializarComponentes() + { + dgInsertarProducto = new DgInsertarProducto(new JFrame(), true); + dgInsertarProducto.addProductoListener(this); + dgInsertarProveedor = new DgInsertarProveedor(new JFrame(), true); + dgInsertarProveedor.addProveedorListener(this); + } + /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is @@ -28,22 +54,24 @@ // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents private void initComponents() { + buttonGroup1 = new javax.swing.ButtonGroup(); jTabbedPane1 = new javax.swing.JTabbedPane(); jPanel1 = new javax.swing.JPanel(); jPanel3 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); - jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); lblNombre = new javax.swing.JLabel(); lblRncCedula = new javax.swing.JLabel(); - lblTipodePago = new javax.swing.JLabel(); lblLimiteDeCredito = new javax.swing.JLabel(); lblLimiteDeDias = new javax.swing.JLabel(); lblPorcMora = new javax.swing.JLabel(); btnBuscarProveedor = new javax.swing.JButton(); + jLabel3 = new javax.swing.JLabel(); + jRadioButton1 = new javax.swing.JRadioButton(); + jRadioButton2 = new javax.swing.JRadioButton(); jPanel2 = new javax.swing.JPanel(); btnBuscarProducto = new javax.swing.JButton(); jPanel4 = new javax.swing.JPanel(); @@ -65,14 +93,11 @@ btnNuevo = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); - jPanel1.setName("null"); jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Datos principales", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 11), new java.awt.Color(102, 153, 255))); jLabel1.setText("Nombre:"); jLabel2.setText("Rnc/Cedula:"); - jLabel3.setText("Tipo de pago:"); - jLabel4.setText("Limite de Credito:"); jLabel5.setText("Limite de Dias:"); @@ -87,10 +112,6 @@ lblRncCedula.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); lblRncCedula.setOpaque(true); - lblTipodePago.setBackground(javax.swing.UIManager.getDefaults().getColor("Button.shadow")); - lblTipodePago.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); - lblTipodePago.setOpaque(true); - lblLimiteDeCredito.setBackground(javax.swing.UIManager.getDefaults().getColor("Button.shadow")); lblLimiteDeCredito.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); lblLimiteDeCredito.setOpaque(true); @@ -109,7 +130,7 @@ jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup() .addContainerGap() - .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup() .addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) @@ -119,62 +140,75 @@ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(lblRncCedula)) .addGroup(jPanel3Layout.createSequentialGroup() - .addComponent(jLabel3) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(lblTipodePago)) - .addGroup(jPanel3Layout.createSequentialGroup() - .addComponent(jLabel4) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(lblLimiteDeCredito)) - .addGroup(jPanel3Layout.createSequentialGroup() .addComponent(jLabel5) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(lblLimiteDeDias)) .addGroup(jPanel3Layout.createSequentialGroup() .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 152, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(lblPorcMora))) - .addContainerGap()) + .addComponent(lblPorcMora)) + .addGroup(jPanel3Layout.createSequentialGroup() + .addComponent(jLabel4) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(lblLimiteDeCredito))) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); - jPanel3Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel1, jLabel2, jLabel3, jLabel4, jLabel5, jLabel6}); + jPanel3Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel1, jLabel2, jLabel4, jLabel5, jLabel6}); - jPanel3Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {lblLimiteDeCredito, lblLimiteDeDias, lblNombre, lblPorcMora, lblRncCedula, lblTipodePago}); + jPanel3Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {lblLimiteDeCredito, lblLimiteDeDias, lblNombre, lblPorcMora, lblRncCedula}); jPanel3Layout.setVerticalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel1) - .addComponent(lblNombre, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(lblNombre, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2) .addComponent(lblRncCedula)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel3) - .addComponent(lblTipodePago)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel4) .addComponent(lblLimiteDeCredito)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel5) .addComponent(lblLimiteDeDias)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(lblPorcMora) - .addComponent(jLabel6)) - .addContainerGap(31, Short.MAX_VALUE)) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jLabel6) + .addComponent(lblPorcMora)) + .addContainerGap(35, Short.MAX_VALUE)) ); - jPanel3Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {lblLimiteDeCredito, lblLimiteDeDias, lblNombre, lblPorcMora, lblRncCedula, lblTipodePago}); + jPanel3Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {lblLimiteDeCredito, lblLimiteDeDias, lblNombre, lblPorcMora, lblRncCedula}); + jPanel3Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jLabel1, jLabel2, jLabel4, jLabel5, jLabel6}); + btnBuscarProveedor.setText("Buscar"); + btnBuscarProveedor.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { + btnBuscarProveedorActionPerformed(evt); + } + }); + jLabel3.setText("Tipo de pago:"); + + buttonGroup1.add(jRadioButton1); + jRadioButton1.setText("Credito"); + jRadioButton1.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); + jRadioButton1.setMargin(new java.awt.Insets(0, 0, 0, 0)); + + buttonGroup1.add(jRadioButton2); + jRadioButton2.setText("Contado"); + jRadioButton2.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); + jRadioButton2.setMargin(new java.awt.Insets(0, 0, 0, 0)); + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( @@ -182,6 +216,13 @@ .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(12, 12, 12) + .addComponent(jLabel3) + .addGap(79, 79, 79) + .addComponent(jRadioButton1) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jRadioButton2)) .addComponent(btnBuscarProveedor, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap()) @@ -193,11 +234,23 @@ .addComponent(btnBuscarProveedor) .addGap(28, 28, 28) .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(74, Short.MAX_VALUE)) + .addGap(14, 14, 14) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel3) + .addComponent(jRadioButton1) + .addComponent(jRadioButton2)) + .addContainerGap(16, Short.MAX_VALUE)) ); jTabbedPane1.addTab("Proveedor", jPanel1); btnBuscarProducto.setText("Buscar"); + btnBuscarProducto.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { + btnBuscarProductoActionPerformed(evt); + } + }); jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Datos principales", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 11), new java.awt.Color(102, 102, 255))); jLabel13.setText("Producto: "); @@ -258,7 +311,7 @@ .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel15) .addComponent(lblPrecio)) - .addContainerGap(14, Short.MAX_VALUE)) + .addContainerGap(18, Short.MAX_VALUE)) ); jPanel4Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {lblDescripcion, lblPrecio, lblProducto}); @@ -333,12 +386,19 @@ .addComponent(txtCantidad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(btnInsertarProducto)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 180, Short.MAX_VALUE) + .addComponent(jScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 177, Short.MAX_VALUE) .addContainerGap()) ); jTabbedPane1.addTab("Productos", jPanel2); btnCerrar.setText("Cerrar"); + btnCerrar.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { + btnCerrarActionPerformed(evt); + } + }); btnSalvarCerrar.setText("Salvar ->"); @@ -370,7 +430,7 @@ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap() - .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 416, Short.MAX_VALUE) + .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 417, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(btnCerrar) @@ -381,6 +441,28 @@ ); pack(); }// </editor-fold>//GEN-END:initComponents + + private void btnCerrarActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnCerrarActionPerformed + {//GEN-HEADEREND:event_btnCerrarActionPerformed + dispose(); + }//GEN-LAST:event_btnCerrarActionPerformed + + private void btnBuscarProveedorActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnBuscarProveedorActionPerformed + {//GEN-HEADEREND:event_btnBuscarProveedorActionPerformed + ProveedorEvent pv = new ProveedorEvent(); + pv.setId(ProveedorEvent.NUEVO); + dgInsertarProveedor.fireProveedor(pv); + dgInsertarProveedor.setVisible(true); + }//GEN-LAST:event_btnBuscarProveedorActionPerformed + + private void btnBuscarProductoActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnBuscarProductoActionPerformed + {//GEN-HEADEREND:event_btnBuscarProductoActionPerformed + ProductoEvent pv = new ProductoEvent(); + pv.setId(ProductoEvent.PROVEEDOR); + pv.setProveedor(proveedorSeleccionado); + dgInsertarProducto.fireProducto(pv); + dgInsertarProducto.setVisible(true); + }//GEN-LAST:event_btnBuscarProductoActionPerformed /** * @param args the command line arguments @@ -395,7 +477,31 @@ } }); } - + + public void fireProducto(ProductoEvent producto) + { + productoSeleccionado = producto.getProductoDelProveedor(); + lblProducto.setText(productoSeleccionado.getNombre()); + lblDescripcion.setText(productoSeleccionado.getDescripcion()); + lblPrecio.setText(""+productoSeleccionado.getPrecio()); + } + + public void fireOrdenDeCompra(OrdenCompraEvent orden) + { + } + + public void fireProveedor(ProveedorEvent proveedor) + { + proveedorSeleccionado = proveedor.getProveedor(); + lblNombre.setText(proveedorSeleccionado.getNombre()); + if(proveedorSeleccionado.getRnc()!=null && !proveedorSeleccionado.getRnc().equals("")) + lblRncCedula.setText(proveedorSeleccionado.getRnc()); + else lblRncCedula.setText(proveedorSeleccionado.getCedula()); + lblLimiteDeCredito.setText(""+proveedorSeleccionado.getLimiteDeCredito()); + lblLimiteDeDias.setText(""+proveedorSeleccionado.getLimiteDias()); + lblPorcMora.setText(""+proveedorSeleccionado.getPorcMora()); + } + // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton btnBuscarProducto; private javax.swing.JButton btnBuscarProveedor; @@ -404,6 +510,7 @@ private javax.swing.JButton btnNuevo; private javax.swing.JButton btnSalvar; private javax.swing.JButton btnSalvarCerrar; + private javax.swing.ButtonGroup buttonGroup1; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel13; private javax.swing.JLabel jLabel14; @@ -419,6 +526,8 @@ private javax.swing.JPanel jPanel2; private javax.swing.JPanel jPanel3; private javax.swing.JPanel jPanel4; + private javax.swing.JRadioButton jRadioButton1; + private javax.swing.JRadioButton jRadioButton2; private javax.swing.JScrollPane jScrollPane; private javax.swing.JTabbedPane jTabbedPane1; private javax.swing.JLabel lblDescripcion; @@ -429,7 +538,6 @@ private javax.swing.JLabel lblPrecio; private javax.swing.JLabel lblProducto; private javax.swing.JLabel lblRncCedula; - private javax.swing.JLabel lblTipodePago; private org.jdesktop.swingx.JXTable tableProductosSeleccionados; private javax.swing.JTextField txtCantidad; // End of variables declaration//GEN-END:variables Added: OpaloERP/src/frontend/cxp/DgInsertarProveedor.form =================================================================== --- OpaloERP/src/frontend/cxp/DgInsertarProveedor.form (rev 0) +++ OpaloERP/src/frontend/cxp/DgInsertarProveedor.form 2007-09-28 13:21:50 UTC (rev 46) @@ -0,0 +1,136 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.3" type="org.netbeans.modules.form.forminfo.JDialogFormInfo"> + <Properties> + <Property name="defaultCloseOperation" type="int" value="2"/> + <Property name="title" type="java.lang.String" value="Insertar Producto"/> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + </SyntheticProperties> + <AuxValues> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + </AuxValues> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <Component id="btnSeleccionar" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="btnCerrar" min="-2" max="-2" attributes="0"/> + </Group> + <Component id="jScrollPane1" alignment="0" pref="448" max="32767" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel1" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtBuscar" pref="140" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jLabel2" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="cmbTipoBusqueda" min="-2" pref="113" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="cmbTipoBusqueda" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtBuscar" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace pref="19" max="32767" attributes="0"/> + <Component id="jScrollPane1" min="-2" pref="245" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="btnSeleccionar" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnCerrar" alignment="3" min="-2" pref="25" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JButton" name="btnSeleccionar"> + <Properties> + <Property name="text" type="java.lang.String" value="Seleccionar"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnSeleccionarActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btnCerrar"> + <Properties> + <Property name="text" type="java.lang.String" value="Cerrar"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCerrarActionPerformed"/> + </Events> + </Component> + <Container class="javax.swing.JScrollPane" name="jScrollPane1"> + + <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> + <SubComponents> + <Component class="org.jdesktop.swingx.JXTable" name="jtbProveedores"> + <Properties> + <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> + <Table columnCount="3" rowCount="0"> + <Column editable="false" title="Nombre" type="java.lang.Object"/> + <Column editable="false" title="RNC" type="java.lang.Object"/> + <Column editable="false" title="Cedula" type="java.lang.Object"/> + </Table> + </Property> + </Properties> + </Component> + </SubComponents> + </Container> + <Component class="javax.swing.JTextField" name="txtBuscar"> + <Properties> + <Property name="enabled" type="boolean" value="false"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtBuscarActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabel1"> + <Properties> + <Property name="text" type="java.lang.String" value="Buscar:"/> + </Properties> + </Component> + <Component class="javax.swing.JComboBox" name="cmbTipoBusqueda"> + <Properties> + <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> + <StringArray count="5"> + <StringItem index="0" value="Seleccionar"/> + <StringItem index="1" value="Nombre"/> + <StringItem index="2" value="RNC"/> + <StringItem index="3" value="Cedula"/> + <StringItem index="4" value="Telefono"/> + </StringArray> + </Property> + </Properties> + <Events> + <EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="cmbTipoBusquedaItemStateChanged"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabel2"> + <Properties> + <Property name="text" type="java.lang.String" value="Tipo de Busqueda:"/> + </Properties> + </Component> + </SubComponents> +</Form> Added: OpaloERP/src/frontend/cxp/DgInsertarProveedor.java =================================================================== --- OpaloERP/src/frontend/cxp/DgInsertarProveedor.java (rev 0) +++ OpaloERP/src/frontend/cxp/DgInsertarProveedor.java 2007-09-28 13:21:50 UTC (rev 46) @@ -0,0 +1,321 @@ +/* + * DgInsertarProveedor.java + * + * Created on 22 de septiembre de 2007, 19:33 + */ + +package frontend.cxp; + +import eventos.IProveedorListener; +import eventos.ProveedorEvent; +import java.util.List; +import javax.swing.table.AbstractTableModel; +import mensaje_objetos.proveedor.Proveedor; +import modelo_objetos.proveedor.ModeloProveedor; + +/** + * + * @author gonzalez + */ +public class DgInsertarProveedor extends javax.swing.JDialog implements IProveedorListener +{ + private Proveedor proveedorSeleccionado; + private ModeloProveedor modelo; + private IProveedorListener listener; + + private String[] headers={"Nombre", "RNC","Cedula"}; + private AbstractTableModel tableModel; + + private List<Proveedor> listaProveedores, proveedorTable; + private int accion = ProveedorEvent.NUEVO; + + /** + * Creates new form DgInsertarProveedor + */ + public DgInsertarProveedor(java.awt.Frame parent, boolean modal) + { + super(parent, modal); + initComponents(); + inicializarComponentes(); + inicializarTabla(); + } + + private void inicializarComponentes() + { + modelo = ModeloProveedor.getInstance(); + } + + private void inicializarTabla() + { + listaProveedores=modelo.getAllProveedores(); + proveedorTable=modelo.getAllProveedores(); + + tableModel=new AbstractTableModel() + { + public int getColumnCount() + { + return headers.length; + } + public int getRowCount() + { + return proveedorTable.size(); + } + public Object getValueAt(int rowIndex, int columnIndex) + { + Proveedor proveedor =proveedorTable.get(rowIndex); + if(proveedor!=null) + { + if(columnIndex==0) + { + return proveedor.getNombre(); + } + if(columnIndex==1) + { + return proveedor.getRnc(); + } + if(columnIndex==2) + { + return proveedor.getCedula(); + } + } + return ""; + } + public String getColumnName(int col) + { + return headers[col]; + } + }; + + jtbProveedores.setModel(tableModel); + tableModel.fireTableDataChanged(); + } + + public void addProveedorListener(IProveedorListener listener) + { + this.listener = listener; + } + + private Proveedor getSelectedProveedor() + { + Proveedor proveedor=null; + int arow=jtbProveedores.getSelectedRow(); + if(arow!=-1) + { + int row=jtb... [truncated message content] |
From: <jos...@us...> - 2007-09-28 00:43:47
|
Revision: 45 http://opaloerp.svn.sourceforge.net/opaloerp/?rev=45&view=rev Author: jose_cruz64 Date: 2007-09-27 17:43:51 -0700 (Thu, 27 Sep 2007) Log Message: ----------- -Funcionalidades y clases agregadas - FrontEnds respectivos a Orden de Compra. - Entidad OrdenDeCompra.java - ModeloOrdenDeCompra.java - Funcionalidades removidas : Ninguna Modified Paths: -------------- OpaloERP/src/hibernate.cfg.xml Added Paths: ----------- OpaloERP/src/frontend/cxp/ OpaloERP/src/frontend/cxp/DgCrearOrden.form OpaloERP/src/frontend/cxp/DgCrearOrden.java OpaloERP/src/frontend/cxp/IOrdenDeCompra.form OpaloERP/src/frontend/cxp/IOrdenDeCompra.java OpaloERP/src/mensaje_objetos/orden_de_compra/ OpaloERP/src/mensaje_objetos/orden_de_compra/OrdenDeCompra.java OpaloERP/src/modelo_objetos/cxp/ OpaloERP/src/modelo_objetos/cxp/Cxp.java OpaloERP/src/modelo_objetos/orden_de_compra/ OpaloERP/src/modelo_objetos/orden_de_compra/ModeloOrdenDeCompra.java Added: OpaloERP/src/frontend/cxp/DgCrearOrden.form =================================================================== --- OpaloERP/src/frontend/cxp/DgCrearOrden.form (rev 0) +++ OpaloERP/src/frontend/cxp/DgCrearOrden.form 2007-09-28 00:43:51 UTC (rev 45) @@ -0,0 +1,559 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.3" type="org.netbeans.modules.form.forminfo.JDialogFormInfo"> + <Properties> + <Property name="defaultCloseOperation" type="int" value="2"/> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + </SyntheticProperties> + <AuxValues> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + </AuxValues> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <Component id="btnNuevo" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="btnSalvar" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="btnSalvarCerrar" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="btnCerrar" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="jTabbedPane1" pref="590" max="32767" attributes="0"/> + <EmptySpace min="12" pref="12" max="12" attributes="0"/> + </Group> + </Group> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jTabbedPane1" pref="416" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="btnCerrar" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnSalvarCerrar" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnSalvar" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnNuevo" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JTabbedPane" name="jTabbedPane1"> + + <Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/> + <SubComponents> + <Container class="javax.swing.JPanel" name="jPanel1"> + <Properties> + <Property name="name" type="java.lang.String" value="null"/> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription"> + <JTabbedPaneConstraints tabName="Proveedor"> + <Property name="tabTitle" type="java.lang.String" value="Proveedor"/> + </JTabbedPaneConstraints> + </Constraint> + </Constraints> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="btnBuscarProveedor" alignment="0" min="-2" pref="116" max="-2" attributes="0"/> + <Component id="jPanel3" alignment="0" max="32767" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="27" max="-2" attributes="0"/> + <Component id="btnBuscarProveedor" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="28" max="-2" attributes="0"/> + <Component id="jPanel3" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="74" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JPanel" name="jPanel3"> + <Properties> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo"> + <TitledBorder title="Datos principales"> + <Color PropertyName="color" blue="ff" green="99" red="66" type="rgb"/> + </TitledBorder> + </Border> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" max="-2" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel1" linkSize="1" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="lblNombre" linkSize="2" min="-2" pref="369" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel2" linkSize="1" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="lblRncCedula" linkSize="2" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel3" linkSize="1" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="lblTipodePago" linkSize="2" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel4" linkSize="1" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="lblLimiteDeCredito" linkSize="2" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel5" linkSize="1" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="lblLimiteDeDias" linkSize="2" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel6" linkSize="1" min="-2" pref="152" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="lblPorcMora" linkSize="2" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="lblNombre" linkSize="3" alignment="3" min="-2" pref="23" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="lblRncCedula" linkSize="3" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="lblTipodePago" linkSize="3" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="lblLimiteDeCredito" linkSize="3" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="lblLimiteDeDias" linkSize="3" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="lblPorcMora" linkSize="3" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace pref="31" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel1"> + <Properties> + <Property name="text" type="java.lang.String" value="Nombre:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel2"> + <Properties> + <Property name="text" type="java.lang.String" value="Rnc/Cedula:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel3"> + <Properties> + <Property name="text" type="java.lang.String" value="Tipo de pago:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel4"> + <Properties> + <Property name="text" type="java.lang.String" value="Limite de Credito:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel5"> + <Properties> + <Property name="text" type="java.lang.String" value="Limite de Dias:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel6"> + <Properties> + <Property name="text" type="java.lang.String" value="Porcentaje de Mora:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblNombre"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="e5" green="cf" id="Button.shadow" palette="3" red="b8" type="palette"/> + </Property> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo"> + <LineBorder/> + </Border> + </Property> + <Property name="opaque" type="boolean" value="true"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblRncCedula"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="e5" green="cf" id="Button.shadow" palette="3" red="b8" type="palette"/> + </Property> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo"> + <LineBorder/> + </Border> + </Property> + <Property name="opaque" type="boolean" value="true"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblTipodePago"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="e5" green="cf" id="Button.shadow" palette="3" red="b8" type="palette"/> + </Property> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo"> + <LineBorder/> + </Border> + </Property> + <Property name="opaque" type="boolean" value="true"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblLimiteDeCredito"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="e5" green="cf" id="Button.shadow" palette="3" red="b8" type="palette"/> + </Property> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo"> + <LineBorder/> + </Border> + </Property> + <Property name="opaque" type="boolean" value="true"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblLimiteDeDias"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="e5" green="cf" id="Button.shadow" palette="3" red="b8" type="palette"/> + </Property> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo"> + <LineBorder/> + </Border> + </Property> + <Property name="opaque" type="boolean" value="true"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblPorcMora"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="e5" green="cf" id="Button.shadow" palette="3" red="b8" type="palette"/> + </Property> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo"> + <LineBorder/> + </Border> + </Property> + <Property name="opaque" type="boolean" value="true"/> + </Properties> + </Component> + </SubComponents> + </Container> + <Component class="javax.swing.JButton" name="btnBuscarProveedor"> + <Properties> + <Property name="text" type="java.lang.String" value="Buscar"/> + </Properties> + </Component> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="jPanel2"> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription"> + <JTabbedPaneConstraints tabName="Productos"> + <Property name="tabTitle" type="java.lang.String" value="Productos"/> + </JTabbedPaneConstraints> + </Constraint> + </Constraints> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel18" min="-2" max="-2" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jLabel19" min="-2" pref="129" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtCantidad" min="-2" pref="243" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="btnInsertarProducto" pref="171" max="32767" attributes="0"/> + </Group> + <Component id="jPanel4" alignment="0" max="32767" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jScrollPane" pref="561" max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="btnBuscarProducto" min="-2" pref="121" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Component id="jLabel18" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="btnBuscarProducto" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jPanel4" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel19" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtCantidad" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnInsertarProducto" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Component id="jScrollPane" pref="180" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JButton" name="btnBuscarProducto"> + <Properties> + <Property name="text" type="java.lang.String" value="Buscar"/> + </Properties> + </Component> + <Container class="javax.swing.JPanel" name="jPanel4"> + <Properties> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo"> + <TitledBorder title="Datos principales"> + <Color PropertyName="color" blue="ff" green="66" red="66" type="rgb"/> + </TitledBorder> + </Border> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Group type="102" alignment="0" max="-2" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel14" linkSize="7" min="-2" max="-2" attributes="1"/> + <Component id="jLabel13" linkSize="7" min="-2" pref="129" max="-2" attributes="1"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="lblDescripcion" linkSize="5" min="-2" max="-2" attributes="0"/> + <Component id="lblProducto" linkSize="5" pref="404" max="32767" attributes="0"/> + </Group> + </Group> + <Group type="102" alignment="0" attributes="1"> + <Component id="jLabel15" linkSize="7" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="lblPrecio" linkSize="5" max="32767" attributes="0"/> + </Group> + </Group> + <EmptySpace max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel13" linkSize="8" min="-2" max="-2" attributes="0"/> + <Component id="lblProducto" linkSize="6" min="-2" pref="23" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel14" linkSize="8" min="-2" max="-2" attributes="0"/> + <Component id="lblDescripcion" linkSize="6" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="8" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel15" linkSize="8" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="lblPrecio" linkSize="6" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace pref="14" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel13"> + <Properties> + <Property name="text" type="java.lang.String" value="Producto: "/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel14"> + <Properties> + <Property name="text" type="java.lang.String" value="Descripcion:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel15"> + <Properties> + <Property name="text" type="java.lang.String" value="Precio:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblProducto"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="e5" green="cf" id="Button.shadow" palette="3" red="b8" type="palette"/> + </Property> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo"> + <LineBorder/> + </Border> + </Property> + <Property name="opaque" type="boolean" value="true"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblDescripcion"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="e5" green="cf" id="Button.shadow" palette="3" red="b8" type="palette"/> + </Property> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo"> + <LineBorder/> + </Border> + </Property> + <Property name="opaque" type="boolean" value="true"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblPrecio"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="e5" green="cf" id="Button.shadow" palette="3" red="b8" type="palette"/> + </Property> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo"> + <LineBorder/> + </Border> + </Property> + <Property name="opaque" type="boolean" value="true"/> + </Properties> + </Component> + </SubComponents> + </Container> + <Component class="javax.swing.JLabel" name="jLabel18"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="e5" green="cf" id="Button.shadow" palette="3" red="b8" type="palette"/> + </Property> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo"> + <LineBorder/> + </Border> + </Property> + <Property name="opaque" type="boolean" value="true"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel19"> + <Properties> + <Property name="text" type="java.lang.String" value="Cantidad:"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtCantidad"> + </Component> + <Component class="javax.swing.JButton" name="btnInsertarProducto"> + <Properties> + <Property name="text" type="java.lang.String" value="Insertar"/> + </Properties> + </Component> + <Container class="javax.swing.JScrollPane" name="jScrollPane"> + + <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> + <SubComponents> + <Component class="org.jdesktop.swingx.JXTable" name="tableProductosSeleccionados"> + <Properties> + <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> + <Table columnCount="4" rowCount="0"> + <Column editable="false" title="Producto" type="java.lang.Object"/> + <Column editable="false" title="Descripcion" type="java.lang.Object"/> + <Column editable="false" title="Precio" type="java.lang.Object"/> + <Column editable="false" title="Cantidad" type="java.lang.Object"/> + </Table> + </Property> + </Properties> + </Component> + </SubComponents> + </Container> + </SubComponents> + </Container> + </SubComponents> + </Container> + <Component class="javax.swing.JButton" name="btnCerrar"> + <Properties> + <Property name="text" type="java.lang.String" value="Cerrar"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="btnSalvarCerrar"> + <Properties> + <Property name="text" type="java.lang.String" value="Salvar ->"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="btnSalvar"> + <Properties> + <Property name="text" type="java.lang.String" value="Salvar"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="btnNuevo"> + <Properties> + <Property name="text" type="java.lang.String" value="Nuevo"/> + </Properties> + </Component> + </SubComponents> +</Form> Added: OpaloERP/src/frontend/cxp/DgCrearOrden.java =================================================================== --- OpaloERP/src/frontend/cxp/DgCrearOrden.java (rev 0) +++ OpaloERP/src/frontend/cxp/DgCrearOrden.java 2007-09-28 00:43:51 UTC (rev 45) @@ -0,0 +1,437 @@ +/* + * DgCrearOrden.java + * + * Created on September 27, 2007, 3:46 AM + */ + +package frontend.cxp; + +/** + * + * @author raymi + */ +public class DgCrearOrden extends javax.swing.JDialog +{ + + /** Creates new form DgCrearOrden */ + public DgCrearOrden(java.awt.Frame parent, boolean modal) + { + super(parent, modal); + initComponents(); + } + + /** 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. + */ + // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents + private void initComponents() + { + jTabbedPane1 = new javax.swing.JTabbedPane(); + jPanel1 = new javax.swing.JPanel(); + jPanel3 = new javax.swing.JPanel(); + jLabel1 = new javax.swing.JLabel(); + jLabel2 = new javax.swing.JLabel(); + jLabel3 = new javax.swing.JLabel(); + jLabel4 = new javax.swing.JLabel(); + jLabel5 = new javax.swing.JLabel(); + jLabel6 = new javax.swing.JLabel(); + lblNombre = new javax.swing.JLabel(); + lblRncCedula = new javax.swing.JLabel(); + lblTipodePago = new javax.swing.JLabel(); + lblLimiteDeCredito = new javax.swing.JLabel(); + lblLimiteDeDias = new javax.swing.JLabel(); + lblPorcMora = new javax.swing.JLabel(); + btnBuscarProveedor = new javax.swing.JButton(); + jPanel2 = new javax.swing.JPanel(); + btnBuscarProducto = new javax.swing.JButton(); + jPanel4 = new javax.swing.JPanel(); + jLabel13 = new javax.swing.JLabel(); + jLabel14 = new javax.swing.JLabel(); + jLabel15 = new javax.swing.JLabel(); + lblProducto = new javax.swing.JLabel(); + lblDescripcion = new javax.swing.JLabel(); + lblPrecio = new javax.swing.JLabel(); + jLabel18 = new javax.swing.JLabel(); + jLabel19 = new javax.swing.JLabel(); + txtCantidad = new javax.swing.JTextField(); + btnInsertarProducto = new javax.swing.JButton(); + jScrollPane = new javax.swing.JScrollPane(); + tableProductosSeleccionados = new org.jdesktop.swingx.JXTable(); + btnCerrar = new javax.swing.JButton(); + btnSalvarCerrar = new javax.swing.JButton(); + btnSalvar = new javax.swing.JButton(); + btnNuevo = new javax.swing.JButton(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + jPanel1.setName("null"); + jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Datos principales", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 11), new java.awt.Color(102, 153, 255))); + jLabel1.setText("Nombre:"); + + jLabel2.setText("Rnc/Cedula:"); + + jLabel3.setText("Tipo de pago:"); + + jLabel4.setText("Limite de Credito:"); + + jLabel5.setText("Limite de Dias:"); + + jLabel6.setText("Porcentaje de Mora:"); + + lblNombre.setBackground(javax.swing.UIManager.getDefaults().getColor("Button.shadow")); + lblNombre.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); + lblNombre.setOpaque(true); + + lblRncCedula.setBackground(javax.swing.UIManager.getDefaults().getColor("Button.shadow")); + lblRncCedula.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); + lblRncCedula.setOpaque(true); + + lblTipodePago.setBackground(javax.swing.UIManager.getDefaults().getColor("Button.shadow")); + lblTipodePago.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); + lblTipodePago.setOpaque(true); + + lblLimiteDeCredito.setBackground(javax.swing.UIManager.getDefaults().getColor("Button.shadow")); + lblLimiteDeCredito.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); + lblLimiteDeCredito.setOpaque(true); + + lblLimiteDeDias.setBackground(javax.swing.UIManager.getDefaults().getColor("Button.shadow")); + lblLimiteDeDias.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); + lblLimiteDeDias.setOpaque(true); + + lblPorcMora.setBackground(javax.swing.UIManager.getDefaults().getColor("Button.shadow")); + lblPorcMora.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); + lblPorcMora.setOpaque(true); + + javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); + jPanel3.setLayout(jPanel3Layout); + jPanel3Layout.setHorizontalGroup( + jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(jPanel3Layout.createSequentialGroup() + .addComponent(jLabel1) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(lblNombre, javax.swing.GroupLayout.PREFERRED_SIZE, 369, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel3Layout.createSequentialGroup() + .addComponent(jLabel2) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(lblRncCedula)) + .addGroup(jPanel3Layout.createSequentialGroup() + .addComponent(jLabel3) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(lblTipodePago)) + .addGroup(jPanel3Layout.createSequentialGroup() + .addComponent(jLabel4) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(lblLimiteDeCredito)) + .addGroup(jPanel3Layout.createSequentialGroup() + .addComponent(jLabel5) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(lblLimiteDeDias)) + .addGroup(jPanel3Layout.createSequentialGroup() + .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 152, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(lblPorcMora))) + .addContainerGap()) + ); + + jPanel3Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel1, jLabel2, jLabel3, jLabel4, jLabel5, jLabel6}); + + jPanel3Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {lblLimiteDeCredito, lblLimiteDeDias, lblNombre, lblPorcMora, lblRncCedula, lblTipodePago}); + + jPanel3Layout.setVerticalGroup( + jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel1) + .addComponent(lblNombre, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel2) + .addComponent(lblRncCedula)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel3) + .addComponent(lblTipodePago)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel4) + .addComponent(lblLimiteDeCredito)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel5) + .addComponent(lblLimiteDeDias)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(lblPorcMora) + .addComponent(jLabel6)) + .addContainerGap(31, Short.MAX_VALUE)) + ); + + jPanel3Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {lblLimiteDeCredito, lblLimiteDeDias, lblNombre, lblPorcMora, lblRncCedula, lblTipodePago}); + + btnBuscarProveedor.setText("Buscar"); + + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(btnBuscarProveedor, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addContainerGap()) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(27, 27, 27) + .addComponent(btnBuscarProveedor) + .addGap(28, 28, 28) + .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(74, Short.MAX_VALUE)) + ); + jTabbedPane1.addTab("Proveedor", jPanel1); + + btnBuscarProducto.setText("Buscar"); + + jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Datos principales", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 11), new java.awt.Color(102, 102, 255))); + jLabel13.setText("Producto: "); + + jLabel14.setText("Descripcion:"); + + jLabel15.setText("Precio:"); + + lblProducto.setBackground(javax.swing.UIManager.getDefaults().getColor("Button.shadow")); + lblProducto.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); + lblProducto.setOpaque(true); + + lblDescripcion.setBackground(javax.swing.UIManager.getDefaults().getColor("Button.shadow")); + lblDescripcion.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); + lblDescripcion.setOpaque(true); + + lblPrecio.setBackground(javax.swing.UIManager.getDefaults().getColor("Button.shadow")); + lblPrecio.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); + lblPrecio.setOpaque(true); + + javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); + jPanel4.setLayout(jPanel4Layout); + jPanel4Layout.setHorizontalGroup( + jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel4Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(jPanel4Layout.createSequentialGroup() + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel14) + .addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(lblDescripcion) + .addComponent(lblProducto, javax.swing.GroupLayout.DEFAULT_SIZE, 404, Short.MAX_VALUE))) + .addGroup(jPanel4Layout.createSequentialGroup() + .addComponent(jLabel15) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(lblPrecio, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + + jPanel4Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {lblDescripcion, lblPrecio, lblProducto}); + + jPanel4Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel13, jLabel14, jLabel15}); + + jPanel4Layout.setVerticalGroup( + jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel4Layout.createSequentialGroup() + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel13) + .addComponent(lblProducto, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel14) + .addComponent(lblDescripcion)) + .addGap(8, 8, 8) + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel15) + .addComponent(lblPrecio)) + .addContainerGap(14, Short.MAX_VALUE)) + ); + + jPanel4Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {lblDescripcion, lblPrecio, lblProducto}); + + jPanel4Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jLabel13, jLabel14, jLabel15}); + + jLabel18.setBackground(javax.swing.UIManager.getDefaults().getColor("Button.shadow")); + jLabel18.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); + jLabel18.setOpaque(true); + + jLabel19.setText("Cantidad:"); + + btnInsertarProducto.setText("Insertar"); + + tableProductosSeleccionados.setModel(new javax.swing.table.DefaultTableModel( + new Object [][] + { + + }, + new String [] + { + "Producto", "Descripcion", "Precio", "Cantidad" + } + ) + { + boolean[] canEdit = new boolean [] + { + false, false, false, false + }; + + public boolean isCellEditable(int rowIndex, int columnIndex) + { + return canEdit [columnIndex]; + } + }); + jScrollPane.setViewportView(tableProductosSeleccionados); + + javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); + jPanel2.setLayout(jPanel2Layout); + jPanel2Layout.setHorizontalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel18) + .addGroup(jPanel2Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel19, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtCantidad, javax.swing.GroupLayout.PREFERRED_SIZE, 243, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(btnInsertarProducto, javax.swing.GroupLayout.DEFAULT_SIZE, 171, Short.MAX_VALUE)) + .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(jPanel2Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 561, Short.MAX_VALUE)) + .addGroup(jPanel2Layout.createSequentialGroup() + .addContainerGap() + .addComponent(btnBuscarProducto, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addContainerGap()) + ); + jPanel2Layout.setVerticalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addComponent(jLabel18) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(btnBuscarProducto) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel19) + .addComponent(txtCantidad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(btnInsertarProducto)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 180, Short.MAX_VALUE) + .addContainerGap()) + ); + jTabbedPane1.addTab("Productos", jPanel2); + + btnCerrar.setText("Cerrar"); + + btnSalvarCerrar.setText("Salvar ->"); + + btnSalvar.setText("Salvar"); + + btnNuevo.setText("Nuevo"); + + 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() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addComponent(btnNuevo) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(btnSalvar) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(btnSalvarCerrar) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(btnCerrar) + .addContainerGap()) + .addGroup(layout.createSequentialGroup() + .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 590, Short.MAX_VALUE) + .addGap(12, 12, 12)))) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addContainerGap() + .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 416, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btnCerrar) + .addComponent(btnSalvarCerrar) + .addComponent(btnSalvar) + .addComponent(btnNuevo)) + .addContainerGap()) + ); + pack(); + }// </editor-fold>//GEN-END:initComponents + + /** + * @param args the command line arguments + */ + public static void main(String args[]) + { + java.awt.EventQueue.invokeLater(new Runnable() + { + public void run() + { + new DgCrearOrden(new javax.swing.JFrame(), true).setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton btnBuscarProducto; + private javax.swing.JButton btnBuscarProveedor; + private javax.swing.JButton btnCerrar; + private javax.swing.JButton btnInsertarProducto; + private javax.swing.JButton btnNuevo; + private javax.swing.JButton btnSalvar; + private javax.swing.JButton btnSalvarCerrar; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel13; + private javax.swing.JLabel jLabel14; + private javax.swing.JLabel jLabel15; + private javax.swing.JLabel jLabel18; + private javax.swing.JLabel jLabel19; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel3; + private javax.swing.JLabel jLabel4; + private javax.swing.JLabel jLabel5; + private javax.swing.JLabel jLabel6; + private javax.swing.JPanel jPanel1; + private javax.swing.JPanel jPanel2; + private javax.swing.JPanel jPanel3; + private javax.swing.JPanel jPanel4; + private javax.swing.JScrollPane jScrollPane; + private javax.swing.JTabbedPane jTabbedPane1; + private javax.swing.JLabel lblDescripcion; + private javax.swing.JLabel lblLimiteDeCredito; + private javax.swing.JLabel lblLimiteDeDias; + private javax.swing.JLabel lblNombre; + private javax.swing.JLabel lblPorcMora; + private javax.swing.JLabel lblPrecio; + private javax.swing.JLabel lblProducto; + private javax.swing.JLabel lblRncCedula; + private javax.swing.JLabel lblTipodePago; + private org.jdesktop.swingx.JXTable tableProductosSeleccionados; + private javax.swing.JTextField txtCantidad; + // End of variables declaration//GEN-END:variables + +} Added: OpaloERP/src/frontend/cxp/IOrdenDeCompra.form =================================================================== --- OpaloERP/src/frontend/cxp/IOrdenDeCompra.form (rev 0) +++ OpaloERP/src/frontend/cxp/IOrdenDeCompra.form 2007-09-28 00:43:51 UTC (rev 45) @@ -0,0 +1,160 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.3" type="org.netbeans.modules.form.forminfo.JInternalFrameFormInfo"> + <Properties> + <Property name="title" type="java.lang.String" value="Administrar Ordenes de Compras"/> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + </SyntheticProperties> + <AuxValues> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + </AuxValues> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + ... [truncated message content] |
From: <the...@us...> - 2007-09-25 00:28:11
|
Revision: 44 http://opaloerp.svn.sourceforge.net/opaloerp/?rev=44&view=rev Author: thegenius03 Date: 2007-09-24 17:28:12 -0700 (Mon, 24 Sep 2007) Log Message: ----------- - Funcionalidades agregadas - A los modelos de Direccion y Contacto fueron agregados los metodos necesarios para ser recolectados por un campo especificado. - Buscar Direccion por algun campo especificado (tipo de busqueda). - Buscar Contacto por algun campo especificado (tipo de busqueda). - Limpiar campos en el dialogo DgDireccionCliente cuando se trate de una direccion nueva (el metodo limpiarCampos() estaba hecho, mas no estaba siendo utilizado). - Limpiar campos en el dialogo DgCrearContacto cuando se trate de un contacto nuevo (el metodo limpiarCampos() estaba hecho, mas no estaba siendo utilizado). Nota: Favor de revisar el error que se genera al tratar de remover un contacto y/o producto y luego salvar un proveedor. Modified Paths: -------------- OpaloERP/src/frontend/cliente/DgCrearContacto.form OpaloERP/src/frontend/cliente/DgCrearContacto.java OpaloERP/src/frontend/cliente/DgDireccionCliente.java OpaloERP/src/frontend/proveedor/DgCrearProveedor.form OpaloERP/src/frontend/proveedor/DgCrearProveedor.java OpaloERP/src/modelo_objetos/cliente/ModeloContacto.java OpaloERP/src/modelo_objetos/cliente/ModeloDireccion.java Modified: OpaloERP/src/frontend/cliente/DgCrearContacto.form =================================================================== --- OpaloERP/src/frontend/cliente/DgCrearContacto.form 2007-09-24 16:26:28 UTC (rev 43) +++ OpaloERP/src/frontend/cliente/DgCrearContacto.form 2007-09-25 00:28:12 UTC (rev 44) @@ -34,21 +34,21 @@ </Group> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="txtCargo" pref="289" max="32767" attributes="0"/> - <Component id="txtNombre" alignment="0" pref="289" max="32767" attributes="0"/> + <Component id="txtCargo" pref="294" max="32767" attributes="0"/> + <Component id="txtNombre" alignment="0" pref="294" max="32767" attributes="0"/> </Group> </Group> <Group type="102" alignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jLabel3" alignment="0" pref="75" max="32767" attributes="1"/> - <Component id="jLabel5" alignment="0" pref="75" max="32767" attributes="1"/> - <Component id="jLabel4" alignment="0" pref="75" max="32767" attributes="1"/> + <Component id="jLabel3" alignment="0" pref="78" max="32767" attributes="1"/> + <Component id="jLabel5" alignment="0" pref="78" max="32767" attributes="1"/> + <Component id="jLabel4" alignment="0" pref="78" max="32767" attributes="1"/> </Group> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="txtFax" pref="289" max="32767" attributes="0"/> - <Component id="txtTelefono2" alignment="0" pref="289" max="32767" attributes="0"/> - <Component id="txtEmail" alignment="1" pref="289" max="32767" attributes="0"/> + <Component id="txtFax" pref="291" max="32767" attributes="0"/> + <Component id="txtTelefono2" alignment="0" pref="291" max="32767" attributes="0"/> + <Component id="txtEmail" alignment="1" pref="291" max="32767" attributes="0"/> </Group> </Group> <Group type="102" alignment="0" attributes="0"> @@ -107,51 +107,26 @@ <SubComponents> <Component class="javax.swing.JLabel" name="jLabel1"> <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor"> - <FontInfo relative="false"> - <Font name="Dialog" size="12" style="0"/> - </FontInfo> - </Property> <Property name="text" type="java.lang.String" value="Nombre"/> </Properties> </Component> <Component class="javax.swing.JLabel" name="jLabel2"> <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor"> - <FontInfo relative="false"> - <Font name="Dialog" size="12" style="0"/> - </FontInfo> - </Property> <Property name="text" type="java.lang.String" value="Telefono 1"/> </Properties> </Component> <Component class="javax.swing.JLabel" name="jLabel3"> <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor"> - <FontInfo relative="false"> - <Font name="Dialog" size="12" style="0"/> - </FontInfo> - </Property> <Property name="text" type="java.lang.String" value="Telefono 2"/> </Properties> </Component> <Component class="javax.swing.JLabel" name="jLabel4"> <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor"> - <FontInfo relative="false"> - <Font name="Dialog" size="12" style="0"/> - </FontInfo> - </Property> <Property name="text" type="java.lang.String" value="Fax"/> </Properties> </Component> <Component class="javax.swing.JLabel" name="jLabel5"> <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor"> - <FontInfo relative="false"> - <Font name="Dialog" size="12" style="0"/> - </FontInfo> - </Property> <Property name="text" type="java.lang.String" value="Email"/> </Properties> </Component> @@ -167,11 +142,6 @@ </Component> <Component class="javax.swing.JButton" name="btnCerrar"> <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor"> - <FontInfo relative="false"> - <Font name="Dialog" size="12" style="0"/> - </FontInfo> - </Property> <Property name="mnemonic" type="int" value="67"/> <Property name="text" type="java.lang.String" value="Cerrar"/> </Properties> @@ -181,11 +151,6 @@ </Component> <Component class="javax.swing.JButton" name="btnSeleccionar"> <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor"> - <FontInfo relative="false"> - <Font name="Dialog" size="12" style="0"/> - </FontInfo> - </Property> <Property name="mnemonic" type="int" value="83"/> <Property name="text" type="java.lang.String" value="Seleccionar"/> </Properties> @@ -195,11 +160,6 @@ </Component> <Component class="javax.swing.JLabel" name="jLabel6"> <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor"> - <FontInfo relative="false"> - <Font name="Dialog" size="12" style="0"/> - </FontInfo> - </Property> <Property name="text" type="java.lang.String" value="Cargo"/> </Properties> </Component> Modified: OpaloERP/src/frontend/cliente/DgCrearContacto.java =================================================================== --- OpaloERP/src/frontend/cliente/DgCrearContacto.java 2007-09-24 16:26:28 UTC (rev 43) +++ OpaloERP/src/frontend/cliente/DgCrearContacto.java 2007-09-25 00:28:12 UTC (rev 44) @@ -330,6 +330,7 @@ contactoNuevo=new Contacto(); setEnabled(true); + limpiarCampos(); txtNombre.requestFocus(); } Modified: OpaloERP/src/frontend/cliente/DgDireccionCliente.java =================================================================== --- OpaloERP/src/frontend/cliente/DgDireccionCliente.java 2007-09-24 16:26:28 UTC (rev 43) +++ OpaloERP/src/frontend/cliente/DgDireccionCliente.java 2007-09-25 00:28:12 UTC (rev 44) @@ -37,7 +37,8 @@ * * @author carlos */ -public class DgDireccionCliente extends javax.swing.JDialog implements IPaisListener,ICiudadListener,IProvinciaListener,IDireccionListener,IRegionListener { +public class DgDireccionCliente extends javax.swing.JDialog implements IPaisListener,ICiudadListener,IProvinciaListener,IDireccionListener,IRegionListener +{ //Modelo private Pais paisSeleccionado; @@ -56,7 +57,8 @@ /** Creates new form DgCrearDireccion */ - public DgDireccionCliente(java.awt.Frame parent, boolean modal) { + public DgDireccionCliente(java.awt.Frame parent, boolean modal) + { super(parent, modal); modelo=ModeloDireccion.getInstance(); dgCiudad=new DgAdministrarCiudad(new JFrame(),true); @@ -69,15 +71,18 @@ initComponents(); } - public void addDireccionListener(IDireccionListener listener){ + public void addDireccionListener(IDireccionListener listener) + { this.listener=listener; } - private void limpiarCampos(){ + private void limpiarCampos() + { txtCiudad.setText(""); txtDireccion.setText(""); txtPais.setText(""); - txtProvincia.setText(""); + txtProvincia.setText(""); + txtRegion.setText(""); } @@ -252,44 +257,45 @@ ); pack(); }// </editor-fold>//GEN-END:initComponents - + private void btnBuscarCiudadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBuscarCiudadActionPerformed - dgCiudad.addCiudadListener(this); - dgCiudad.getBtnSeleccionar().setVisible(true); - dgCiudad.setVisible(true); + dgCiudad.addCiudadListener(this); + dgCiudad.getBtnSeleccionar().setVisible(true); + dgCiudad.setVisible(true); }//GEN-LAST:event_btnBuscarCiudadActionPerformed - + private void btnBuscarRegionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBuscarRegionActionPerformed - dgRegion.addRegionListener(this); - dgRegion.getBtnSeleccionar().setVisible(true); - dgRegion.getBtnSeleccionar().setEnabled(true); - - dgRegion.setVisible(true); + dgRegion.addRegionListener(this); + dgRegion.getBtnSeleccionar().setVisible(true); + dgRegion.getBtnSeleccionar().setEnabled(true); + + dgRegion.setVisible(true); }//GEN-LAST:event_btnBuscarRegionActionPerformed - + private void btnBuscarPaisActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBuscarPaisActionPerformed - dgPais.addPaisListener(this); - dgPais.getBtnSeleccionar().setVisible(true); - dgPais.getBtnSeleccionar().setEnabled(true); - - dgPais.setVisible(true); + dgPais.addPaisListener(this); + dgPais.getBtnSeleccionar().setVisible(true); + dgPais.getBtnSeleccionar().setEnabled(true); + + dgPais.setVisible(true); }//GEN-LAST:event_btnBuscarPaisActionPerformed - + private void btnBuscarProvinciaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBuscarProvinciaActionPerformed - dgProvincia.addProvinciaListener(this); - dgProvincia.getBtnSeleccionar().setVisible(true); - dgProvincia.getBtnSeleccionar().setEnabled(true); - - dgProvincia.setVisible(true); + dgProvincia.addProvinciaListener(this); + dgProvincia.getBtnSeleccionar().setVisible(true); + dgProvincia.getBtnSeleccionar().setEnabled(true); + + dgProvincia.setVisible(true); }//GEN-LAST:event_btnBuscarProvinciaActionPerformed - + private void btnCerrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCerrarActionPerformed - dispose(); + dispose(); }//GEN-LAST:event_btnCerrarActionPerformed - + private void btnSeleccionarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSeleccionarActionPerformed - DireccionEvent ev=null; - if(accion==DireccionEvent.NUEVO){ + DireccionEvent ev=null; + if(accion==DireccionEvent.NUEVO) + { Direccion direccion=new Direccion(); direccion.setDescripcion(txtDireccion.getText()); direccion.setPais(paisSeleccionado); @@ -299,52 +305,61 @@ ev=new DireccionEvent(); ev.setDireccion(direccion); ev.setId(accion); - } - if(accion==DireccionEvent.EDITAR){ - direccionSeleccionada.setDescripcion(txtDireccion.getText()); - direccionSeleccionada.setPais(paisSeleccionado); - direccionSeleccionada.setProvincia(provinciaSeleccionada); - direccionSeleccionada.setCiudad(ciudadSeleccionada); - direccionSeleccionada.setRegion(regionSeleccionada); - Ciudad ciudad=new Ciudad(); - ciudad.setNombre(txtCiudad.getText()); - direccionSeleccionada.setCiudad(ciudad); - ev=new DireccionEvent(); - ev.setDireccion(direccionSeleccionada); - ev.setId(accion); - } - - - if(listener!=null){ - listener.fireDireccion(ev); - - dispose(); - } - + } + if(accion==DireccionEvent.EDITAR) + { + direccionSeleccionada.setDescripcion(txtDireccion.getText()); + direccionSeleccionada.setPais(paisSeleccionado); + direccionSeleccionada.setProvincia(provinciaSeleccionada); + direccionSeleccionada.setCiudad(ciudadSeleccionada); + direccionSeleccionada.setRegion(regionSeleccionada); + Ciudad ciudad=new Ciudad(); + ciudad.setNombre(txtCiudad.getText()); + direccionSeleccionada.setCiudad(ciudad); + ev=new DireccionEvent(); + ev.setDireccion(direccionSeleccionada); + ev.setId(accion); + } + + + if(listener!=null) + { + listener.fireDireccion(ev); - + dispose(); + } + + + }//GEN-LAST:event_btnSeleccionarActionPerformed /** * @param args the command line arguments */ - public static void main(String args[]) { - java.awt.EventQueue.invokeLater(new Runnable() { - public void run() { + public static void main(String args[]) + { + java.awt.EventQueue.invokeLater(new Runnable() + { + public void run() + { new DgDireccionCliente(new javax.swing.JFrame(), true).setVisible(true); } }); } - - public void firePais(PaisEvent pais) { - if(pais!=null){ + + public void firePais(PaisEvent pais) + { + if(pais!=null) + { paisSeleccionado=pais.getPais(); txtPais.setText(paisSeleccionado.getNombre()); } } - - public void fireProvincia(ProvinciaEvent provincia) { - if(provincia!=null){ + + public void fireProvincia(ProvinciaEvent provincia) + { + if(provincia!=null) + { provinciaSeleccionada=provincia.getProvincia(); txtProvincia.setText(provinciaSeleccionada.getNombre()); @@ -355,30 +370,45 @@ txtPais.setText(paisSeleccionado.getNombre()); } } - - public void fireDireccion(DireccionEvent direccion) { - direccionSeleccionada=direccion.getDireccion(); - Direccion direccion1=direccion.getDireccion(); - accion=direccion.getId(); - if(direccion1!=null){ - txtDireccion.setText(direccion1.getDescripcion()); - if(direccion1.getCiudad()!=null){ - txtCiudad.setText(direccion1.getCiudad().getNombre()); + + public void fireDireccion(DireccionEvent direccion) + { + if(direccion.getId() == DireccionEvent.NUEVO) + { + limpiarCampos(); + } + else + { + direccionSeleccionada=direccion.getDireccion(); + Direccion direccion1=direccion.getDireccion(); + accion=direccion.getId(); + if(direccion1!=null) + { + txtDireccion.setText(direccion1.getDescripcion()); + if(direccion1.getCiudad()!=null) + { + txtCiudad.setText(direccion1.getCiudad().getNombre()); + } + if(direccion1.getRegion()!=null) + { + txtRegion.setText(direccion1.getRegion().getDescripcion()); + } + if(direccion1.getPais()!=null) + { + txtPais.setText(direccion1.getPais().getNombre()); + } + if(direccion1.getProvincia()!=null) + { + txtProvincia.setText(direccion1.getProvincia().getNombre()); + } } - if(direccion1.getRegion()!=null){ - txtRegion.setText(direccion1.getRegion().getDescripcion()); - } - if(direccion1.getPais()!=null){ - txtPais.setText(direccion1.getPais().getNombre()); - } - if(direccion1.getProvincia()!=null){ - txtProvincia.setText(direccion1.getProvincia().getNombre()); - } } } - - public void fireRegion(RegionEvent region) { - if(region!=null){ + + public void fireRegion(RegionEvent region) + { + if(region!=null) + { regionSeleccionada=region.getRegion(); txtRegion.setText(regionSeleccionada.getDescripcion()); @@ -386,9 +416,11 @@ txtPais.setText(paisSeleccionado.getNombre()); } } - - public void fireCiudad(CiudadEvent ciudad) { - if(ciudad!=null){ + + public void fireCiudad(CiudadEvent ciudad) + { + if(ciudad!=null) + { ciudadSeleccionada=ciudad.getCiudad(); txtCiudad.setText(ciudadSeleccionada.getNombre()); Modified: OpaloERP/src/frontend/proveedor/DgCrearProveedor.form =================================================================== --- OpaloERP/src/frontend/proveedor/DgCrearProveedor.form 2007-09-24 16:26:28 UTC (rev 43) +++ OpaloERP/src/frontend/proveedor/DgCrearProveedor.form 2007-09-25 00:28:12 UTC (rev 44) @@ -789,7 +789,7 @@ <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> <StringArray count="6"> <StringItem index="0" value="Seleccionar"/> - <StringItem index="1" value="Direccion"/> + <StringItem index="1" value="Descripcion"/> <StringItem index="2" value="Ciudad"/> <StringItem index="3" value="Provincia"/> <StringItem index="4" value="Region"/> @@ -932,13 +932,12 @@ <Component class="javax.swing.JComboBox" name="cmbTipoBusquedaContactos"> <Properties> <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> - <StringArray count="6"> + <StringArray count="5"> <StringItem index="0" value="Seleccionar"/> - <StringItem index="1" value="Contacto"/> - <StringItem index="2" value="Telefono 1"/> - <StringItem index="3" value="Telefono 2"/> - <StringItem index="4" value="Fax"/> - <StringItem index="5" value="Email"/> + <StringItem index="1" value="Nombre"/> + <StringItem index="2" value="Telefono"/> + <StringItem index="3" value="Fax"/> + <StringItem index="4" value="Email"/> </StringArray> </Property> </Properties> Modified: OpaloERP/src/frontend/proveedor/DgCrearProveedor.java =================================================================== --- OpaloERP/src/frontend/proveedor/DgCrearProveedor.java 2007-09-24 16:26:28 UTC (rev 43) +++ OpaloERP/src/frontend/proveedor/DgCrearProveedor.java 2007-09-25 00:28:12 UTC (rev 44) @@ -1186,7 +1186,7 @@ jLabel20.setText("Tipo de Busqueda:"); - cmbTipoBusquedaDirecciones.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Seleccionar", "Direccion", "Ciudad", "Provincia", "Region", "Pais" })); + cmbTipoBusquedaDirecciones.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Seleccionar", "Descripcion", "Ciudad", "Provincia", "Region", "Pais" })); cmbTipoBusquedaDirecciones.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) @@ -1311,7 +1311,7 @@ jLabel22.setText("Tipo de Busqueda:"); - cmbTipoBusquedaContactos.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Seleccionar", "Contacto", "Telefono 1", "Telefono 2", "Fax", "Email" })); + cmbTipoBusquedaContactos.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Seleccionar", "Nombre", "Telefono", "Fax", "Email" })); cmbTipoBusquedaContactos.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) @@ -1622,12 +1622,61 @@ private void txtBuscarContactoActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_txtBuscarContactoActionPerformed {//GEN-HEADEREND:event_txtBuscarContactoActionPerformed -// TODO add your handling code here: + String patron=txtBuscarDireccion.getText(); + + String itemSelected=(String)cmbTipoBusquedaContactos.getSelectedItem(); + if(itemSelected.equals("Nombre")) + { + contactoTable=modeloContacto.getContactoPorNombre(listaContactos,patron.trim()); + modeloTablaDireccion.fireTableDataChanged(); + } + if(itemSelected.equals("Telefono")) + { + contactoTable=modeloContacto.getContactoPorTelefono(listaContactos,patron.trim()); + modeloTablaDireccion.fireTableDataChanged(); + } + if(itemSelected.equals("Fax")) + { + contactoTable=modeloContacto.getContactoPorFax(listaContactos,patron.trim()); + modeloTablaDireccion.fireTableDataChanged(); + } + if(itemSelected.equals("Email")) + { + contactoTable=modeloContacto.getContactoPorEmail(listaContactos,patron.trim()); + modeloTablaDireccion.fireTableDataChanged(); + } }//GEN-LAST:event_txtBuscarContactoActionPerformed private void txtBuscarDireccionActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_txtBuscarDireccionActionPerformed {//GEN-HEADEREND:event_txtBuscarDireccionActionPerformed -// TODO add your handling code here: + String patron=txtBuscarDireccion.getText(); + + String itemSelected=(String)cmbTipoBusquedaDirecciones.getSelectedItem(); + if(itemSelected.equals("Descripcion")) + { + direccionTable=modeloDireccion.getDireccionPorDescripcion(listaDirecciones,patron.trim()); + modeloTablaDireccion.fireTableDataChanged(); + } + if(itemSelected.equals("Ciudad")) + { + direccionTable=modeloDireccion.getDireccionPorCiudad(listaDirecciones,patron.trim()); + modeloTablaDireccion.fireTableDataChanged(); + } + if(itemSelected.equals("Provincia")) + { + direccionTable=modeloDireccion.getDireccionPorProvincia(listaDirecciones,patron.trim()); + modeloTablaDireccion.fireTableDataChanged(); + } + if(itemSelected.equals("Region")) + { + direccionTable=modeloDireccion.getDireccionPorRegion(listaDirecciones,patron.trim()); + modeloTablaDireccion.fireTableDataChanged(); + } + if(itemSelected.equals("Pais")) + { + direccionTable=modeloDireccion.getDireccionPorPais(listaDirecciones,patron.trim()); + modeloTablaDireccion.fireTableDataChanged(); + } }//GEN-LAST:event_txtBuscarDireccionActionPerformed private void cmbTipoBusquedaDireccionesItemStateChanged(java.awt.event.ItemEvent evt)//GEN-FIRST:event_cmbTipoBusquedaDireccionesItemStateChanged Modified: OpaloERP/src/modelo_objetos/cliente/ModeloContacto.java =================================================================== --- OpaloERP/src/modelo_objetos/cliente/ModeloContacto.java 2007-09-24 16:26:28 UTC (rev 43) +++ OpaloERP/src/modelo_objetos/cliente/ModeloContacto.java 2007-09-25 00:28:12 UTC (rev 44) @@ -9,6 +9,7 @@ package modelo_objetos.cliente; +import java.util.ArrayList; import java.util.List; import mensaje_objetos.cliente.Contacto; import modelo_objetos.acceso_datos.Conexion; @@ -90,7 +91,7 @@ } - /**Metodo para actualizar un cliente*/ + /**Metodo para actualizar un contacto*/ public void updateContacto(Contacto contacto){ ss=Conexion.getSession(); Transaction tx=ss.beginTransaction(); @@ -119,7 +120,7 @@ ss.close(); } - /**Metodo para consultar todos los clientes*/ + /**Metodo para consultar todos los contactos*/ public List getAllContactos(){ ss=Conexion.getSession(); List contactos=null; @@ -130,10 +131,79 @@ return contactos; } + public List<Contacto> getContactoPorNombre(List<Contacto> lista,String patronNombre) { + List<Contacto> contactos=new ArrayList(); + + for(Contacto k:lista) { + String nombre=k.getNombre()+""; + + + if(!nombre.equals("") && patronNombre.length()<=nombre.length()) { + String nombreGrupo=nombre.substring(0,patronNombre.length()); + if(nombreGrupo.equalsIgnoreCase(patronNombre)) { + contactos.add(k); + } + } + } + return contactos; + } + + public List<Contacto> getContactoPorTelefono(List<Contacto> lista,String patronNombre) { + List<Contacto> contactos=new ArrayList(); + + for(Contacto k:lista) { + String nombre=k.getTelefono1()+""; + String nombre2=k.getTelefono2()+""; + + + if(!nombre.equals("") && patronNombre.length()<=nombre.length()) { + String nombreGrupo=nombre.substring(0,patronNombre.length()); + if(nombreGrupo.equalsIgnoreCase(patronNombre)) { + contactos.add(k); + } + } + if(!nombre2.equals("") && patronNombre.length()<=nombre2.length()) { + String nombreGrupo=nombre.substring(0,patronNombre.length()); + if(nombreGrupo.equalsIgnoreCase(patronNombre) && !contactos.contains(k)) { + contactos.add(k); + } + } + } + return contactos; + } + + public List<Contacto> getContactoPorFax(List<Contacto> lista,String patronNombre) { + List<Contacto> contactos=new ArrayList(); + + for(Contacto k:lista) { + String nombre=k.getFax()+""; + + + if(!nombre.equals("") && patronNombre.length()<=nombre.length()) { + String nombreGrupo=nombre.substring(0,patronNombre.length()); + if(nombreGrupo.equalsIgnoreCase(patronNombre)) { + contactos.add(k); + } + } + } + return contactos; + } - - - - - + public List<Contacto> getContactoPorEmail(List<Contacto> lista,String patronNombre) { + List<Contacto> contactos=new ArrayList(); + + for(Contacto k:lista) { + String nombre=k.getEmail()+""; + + + if(!nombre.equals("") && patronNombre.length()<=nombre.length()) { + String nombreGrupo=nombre.substring(0,patronNombre.length()); + if(nombreGrupo.equalsIgnoreCase(patronNombre)) { + contactos.add(k); + } + } + } + return contactos; + } + } Modified: OpaloERP/src/modelo_objetos/cliente/ModeloDireccion.java =================================================================== --- OpaloERP/src/modelo_objetos/cliente/ModeloDireccion.java 2007-09-24 16:26:28 UTC (rev 43) +++ OpaloERP/src/modelo_objetos/cliente/ModeloDireccion.java 2007-09-25 00:28:12 UTC (rev 44) @@ -10,9 +10,9 @@ package modelo_objetos.cliente; +import java.util.ArrayList; import java.util.List; import mensaje_objetos.cliente.Direccion; -import mensaje_objetos.comunes.Secuencia; import modelo_objetos.acceso_datos.Conexion; import org.hibernate.Query; import org.hibernate.Session; @@ -98,7 +98,7 @@ } - /**Metodo para actualizar un cliente*/ + /**Metodo para actualizar una direccion*/ public void updateDireccion(Direccion Direccion){ Session ss=con.getSession(); Transaction tx=ss.beginTransaction(); @@ -118,7 +118,7 @@ subjectUpdate.notify(ModeloDireccion.class,Direccion,"saveOrUpdateCliente"); } - /**Metodo para consultar todos los clientes*/ + /**Metodo para consultar todas las direcciones*/ public List getAllDireccions(){ Session ss=con.getSession(); List Direccions=null; @@ -129,8 +129,89 @@ return Direccions; } + public List<Direccion> getDireccionPorDescripcion(List<Direccion> lista,String patronNombre) { + List<Direccion> direccions=new ArrayList(); + + for(Direccion k:lista) { + String nombre=k.getDescripcion()+""; + + + if(!nombre.equals("") && patronNombre.length()<=nombre.length()) { + String nombreGrupo=nombre.substring(0,patronNombre.length()); + if(nombreGrupo.equalsIgnoreCase(patronNombre)) { + direccions.add(k); + } + } + } + return direccions; + } + public List<Direccion> getDireccionPorCiudad(List<Direccion> lista,String patronNombre) { + List<Direccion> direccions=new ArrayList(); + + for(Direccion k:lista) { + String nombre=k.getCiudad().getNombre()+""; + + + if(!nombre.equals("") && patronNombre.length()<=nombre.length()) { + String nombreGrupo=nombre.substring(0,patronNombre.length()); + if(nombreGrupo.equalsIgnoreCase(patronNombre)) { + direccions.add(k); + } + } + } + return direccions; + } + public List<Direccion> getDireccionPorProvincia(List<Direccion> lista,String patronNombre) { + List<Direccion> direccions=new ArrayList(); + + for(Direccion k:lista) { + String nombre=k.getProvincia().getNombre()+""; + + + if(!nombre.equals("") && patronNombre.length()<=nombre.length()) { + String nombreGrupo=nombre.substring(0,patronNombre.length()); + if(nombreGrupo.equalsIgnoreCase(patronNombre)) { + direccions.add(k); + } + } + } + return direccions; + } + public List<Direccion> getDireccionPorRegion(List<Direccion> lista,String patronNombre) { + List<Direccion> direccions=new ArrayList(); + + for(Direccion k:lista) { + String nombre=k.getRegion().getDescripcion()+""; + + + if(!nombre.equals("") && patronNombre.length()<=nombre.length()) { + String nombreGrupo=nombre.substring(0,patronNombre.length()); + if(nombreGrupo.equalsIgnoreCase(patronNombre)) { + direccions.add(k); + } + } + } + return direccions; + } + public List<Direccion> getDireccionPorPais(List<Direccion> lista,String patronNombre) { + List<Direccion> direccions=new ArrayList(); + + for(Direccion k:lista) { + String nombre=k.getPais().getNombre()+""; + + + if(!nombre.equals("") && patronNombre.length()<=nombre.length()) { + String nombreGrupo=nombre.substring(0,patronNombre.length()); + if(nombreGrupo.equalsIgnoreCase(patronNombre)) { + direccions.add(k); + } + } + } + return direccions; + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2007-09-24 16:26:27
|
Revision: 43 http://opaloerp.svn.sourceforge.net/opaloerp/?rev=43&view=rev Author: thegenius03 Date: 2007-09-24 09:26:28 -0700 (Mon, 24 Sep 2007) Log Message: ----------- - Funcionalidades Agregadas: - Buscar Proveedor por Codigo, Nombre, etc. (Buscar por campo en especifico) - Buscar Producto por Codigo, Nombre o Descripcion - Pendiente - Buscar Direccion y Contacto por el campo especificado. Nota: - El modelo de Direccion y el modelo de Contacto, no tienen los metodos necesarios para buscar por algun campo en especifico, por lo que para alguna de las proximas revisiones, les seran agregados esos metodos. Modified Paths: -------------- OpaloERP/src/frontend/proveedor/DgCrearProveedor.form OpaloERP/src/frontend/proveedor/DgCrearProveedor.java OpaloERP/src/frontend/proveedor/DgInsertarProducto.form OpaloERP/src/frontend/proveedor/DgInsertarProducto.java OpaloERP/src/frontend/proveedor/IAdministrarProveedor.form OpaloERP/src/frontend/proveedor/IAdministrarProveedor.java Modified: OpaloERP/src/frontend/proveedor/DgCrearProveedor.form =================================================================== --- OpaloERP/src/frontend/proveedor/DgCrearProveedor.form 2007-09-23 02:34:38 UTC (rev 42) +++ OpaloERP/src/frontend/proveedor/DgCrearProveedor.form 2007-09-24 16:26:28 UTC (rev 43) @@ -772,6 +772,12 @@ </Properties> </Component> <Component class="javax.swing.JTextField" name="txtBuscarDireccion"> + <Properties> + <Property name="enabled" type="boolean" value="false"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtBuscarDireccionActionPerformed"/> + </Events> </Component> <Component class="javax.swing.JLabel" name="jLabel20"> <Properties> @@ -781,9 +787,19 @@ <Component class="javax.swing.JComboBox" name="cmbTipoBusquedaDirecciones"> <Properties> <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> - <StringArray count="0"/> + <StringArray count="6"> + <StringItem index="0" value="Seleccionar"/> + <StringItem index="1" value="Direccion"/> + <StringItem index="2" value="Ciudad"/> + <StringItem index="3" value="Provincia"/> + <StringItem index="4" value="Region"/> + <StringItem index="5" value="Pais"/> + </StringArray> </Property> </Properties> + <Events> + <EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="cmbTipoBusquedaDireccionesItemStateChanged"/> + </Events> </Component> <Container class="javax.swing.JScrollPane" name="jScrollPane2"> @@ -901,6 +917,12 @@ </Properties> </Component> <Component class="javax.swing.JTextField" name="txtBuscarContacto"> + <Properties> + <Property name="enabled" type="boolean" value="false"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtBuscarContactoActionPerformed"/> + </Events> </Component> <Component class="javax.swing.JLabel" name="jLabel22"> <Properties> @@ -910,9 +932,19 @@ <Component class="javax.swing.JComboBox" name="cmbTipoBusquedaContactos"> <Properties> <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> - <StringArray count="0"/> + <StringArray count="6"> + <StringItem index="0" value="Seleccionar"/> + <StringItem index="1" value="Contacto"/> + <StringItem index="2" value="Telefono 1"/> + <StringItem index="3" value="Telefono 2"/> + <StringItem index="4" value="Fax"/> + <StringItem index="5" value="Email"/> + </StringArray> </Property> </Properties> + <Events> + <EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="cmbTipoBusquedaContactosItemStateChanged"/> + </Events> </Component> <Container class="javax.swing.JScrollPane" name="jScrollPane3"> Modified: OpaloERP/src/frontend/proveedor/DgCrearProveedor.java =================================================================== --- OpaloERP/src/frontend/proveedor/DgCrearProveedor.java 2007-09-23 02:34:38 UTC (rev 42) +++ OpaloERP/src/frontend/proveedor/DgCrearProveedor.java 2007-09-24 16:26:28 UTC (rev 43) @@ -377,7 +377,7 @@ limpiarCampos(); txtCodigo.setText(proveedorSeleccionado.getCodigo()); - if(proveedorSeleccionado.getRnc()!="") + if(proveedorSeleccionado.getRnc().length() > 0) { rbtnRNC.setSelected(true); txtDocumento.setText(proveedorSeleccionado.getRnc()); @@ -1175,8 +1175,26 @@ jLabel19.setText("Buscar:"); + txtBuscarDireccion.setEnabled(false); + txtBuscarDireccion.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { + txtBuscarDireccionActionPerformed(evt); + } + }); + jLabel20.setText("Tipo de Busqueda:"); + cmbTipoBusquedaDirecciones.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Seleccionar", "Direccion", "Ciudad", "Provincia", "Region", "Pais" })); + cmbTipoBusquedaDirecciones.addItemListener(new java.awt.event.ItemListener() + { + public void itemStateChanged(java.awt.event.ItemEvent evt) + { + cmbTipoBusquedaDireccionesItemStateChanged(evt); + } + }); + jtbTablaDireccion.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { @@ -1282,8 +1300,26 @@ jLabel21.setText("Buscar:"); + txtBuscarContacto.setEnabled(false); + txtBuscarContacto.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { + txtBuscarContactoActionPerformed(evt); + } + }); + jLabel22.setText("Tipo de Busqueda:"); + cmbTipoBusquedaContactos.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Seleccionar", "Contacto", "Telefono 1", "Telefono 2", "Fax", "Email" })); + cmbTipoBusquedaContactos.addItemListener(new java.awt.event.ItemListener() + { + public void itemStateChanged(java.awt.event.ItemEvent evt) + { + cmbTipoBusquedaContactosItemStateChanged(evt); + } + }); + jtbContacto.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { @@ -1584,6 +1620,42 @@ pack(); }// </editor-fold>//GEN-END:initComponents + private void txtBuscarContactoActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_txtBuscarContactoActionPerformed + {//GEN-HEADEREND:event_txtBuscarContactoActionPerformed +// TODO add your handling code here: + }//GEN-LAST:event_txtBuscarContactoActionPerformed + + private void txtBuscarDireccionActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_txtBuscarDireccionActionPerformed + {//GEN-HEADEREND:event_txtBuscarDireccionActionPerformed +// TODO add your handling code here: + }//GEN-LAST:event_txtBuscarDireccionActionPerformed + + private void cmbTipoBusquedaDireccionesItemStateChanged(java.awt.event.ItemEvent evt)//GEN-FIRST:event_cmbTipoBusquedaDireccionesItemStateChanged + {//GEN-HEADEREND:event_cmbTipoBusquedaDireccionesItemStateChanged + String itemSelected=(String)cmbTipoBusquedaDirecciones.getSelectedItem(); + if(itemSelected.equals("Seleccionar")){ + direccionTable.clear(); + modeloTablaDireccion.fireTableDataChanged(); + txtBuscarDireccion.setEnabled(false); + }else{ + txtBuscarDireccion.setEnabled(true); + txtBuscarDireccion.requestFocus(); + } + }//GEN-LAST:event_cmbTipoBusquedaDireccionesItemStateChanged + + private void cmbTipoBusquedaContactosItemStateChanged(java.awt.event.ItemEvent evt)//GEN-FIRST:event_cmbTipoBusquedaContactosItemStateChanged + {//GEN-HEADEREND:event_cmbTipoBusquedaContactosItemStateChanged + String itemSelected=(String)cmbTipoBusquedaContactos.getSelectedItem(); + if(itemSelected.equals("Seleccionar")){ + contactoTable.clear(); + modeloTablaContacto.fireTableDataChanged(); + txtBuscarContacto.setEnabled(false); + }else{ + txtBuscarContacto.setEnabled(true); + txtBuscarContacto.requestFocus(); + } + }//GEN-LAST:event_cmbTipoBusquedaContactosItemStateChanged + private void btnRemoverProductoActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnRemoverProductoActionPerformed {//GEN-HEADEREND:event_btnRemoverProductoActionPerformed productoprovSeleccionado = getSelectedProducto(); Modified: OpaloERP/src/frontend/proveedor/DgInsertarProducto.form =================================================================== --- OpaloERP/src/frontend/proveedor/DgInsertarProducto.form 2007-09-23 02:34:38 UTC (rev 42) +++ OpaloERP/src/frontend/proveedor/DgInsertarProducto.form 2007-09-24 16:26:28 UTC (rev 43) @@ -27,7 +27,16 @@ <EmptySpace max="-2" attributes="0"/> <Component id="btnCerrar" min="-2" max="-2" attributes="0"/> </Group> - <Component id="jScrollPane1" alignment="0" pref="376" max="32767" attributes="0"/> + <Component id="jScrollPane1" alignment="0" pref="448" max="32767" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel1" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtBuscar" pref="140" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jLabel2" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="cmbTipoBusqueda" min="-2" pref="113" max="-2" attributes="0"/> + </Group> </Group> <EmptySpace max="-2" attributes="0"/> </Group> @@ -35,15 +44,22 @@ </DimensionLayout> <DimensionLayout dim="1"> <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" attributes="0"> + <Group type="102" alignment="1" attributes="0"> <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="cmbTipoBusqueda" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtBuscar" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace pref="19" max="32767" attributes="0"/> <Component id="jScrollPane1" min="-2" pref="245" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> + <Component id="btnSeleccionar" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="btnCerrar" alignment="3" min="-2" pref="25" max="-2" attributes="0"/> - <Component id="btnSeleccionar" alignment="3" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -72,7 +88,8 @@ <Component class="org.jdesktop.swingx.JXTable" name="jtbProductos"> <Properties> <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> - <Table columnCount="2" rowCount="0"> + <Table columnCount="3" rowCount="0"> + <Column editable="false" title="Codigo" type="java.lang.Object"/> <Column editable="false" title="Nombre" type="java.lang.Object"/> <Column editable="false" title="Descripcion" type="java.lang.Object"/> </Table> @@ -81,5 +98,38 @@ </Component> </SubComponents> </Container> + <Component class="javax.swing.JTextField" name="txtBuscar"> + <Properties> + <Property name="enabled" type="boolean" value="false"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtBuscarActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabel1"> + <Properties> + <Property name="text" type="java.lang.String" value="Buscar:"/> + </Properties> + </Component> + <Component class="javax.swing.JComboBox" name="cmbTipoBusqueda"> + <Properties> + <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> + <StringArray count="4"> + <StringItem index="0" value="Seleccionar"/> + <StringItem index="1" value="Codigo"/> + <StringItem index="2" value="Nombre"/> + <StringItem index="3" value="Descripcion"/> + </StringArray> + </Property> + </Properties> + <Events> + <EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="cmbTipoBusquedaItemStateChanged"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabel2"> + <Properties> + <Property name="text" type="java.lang.String" value="Tipo de Busqueda:"/> + </Properties> + </Component> </SubComponents> </Form> Modified: OpaloERP/src/frontend/proveedor/DgInsertarProducto.java =================================================================== --- OpaloERP/src/frontend/proveedor/DgInsertarProducto.java 2007-09-23 02:34:38 UTC (rev 42) +++ OpaloERP/src/frontend/proveedor/DgInsertarProducto.java 2007-09-24 16:26:28 UTC (rev 43) @@ -23,7 +23,7 @@ private ModeloProducto modelo; private IProductoListener listener; - private String[] headers={"Nombre","Descripcion"}; + private String[] headers={"Codigo", "Nombre","Descripcion"}; private AbstractTableModel tableModel; private List<Producto> listaProductos, productoTable; @@ -61,9 +61,12 @@ Producto producto =productoTable.get(rowIndex); if(producto!=null){ if(columnIndex==0){ + return producto.getCodigo(); + } + if(columnIndex==1){ return producto.getNombre(); } - if(columnIndex==1){ + if(columnIndex==2){ return producto.getDescripcion(); } } @@ -104,6 +107,10 @@ btnCerrar = new javax.swing.JButton(); jScrollPane1 = new javax.swing.JScrollPane(); jtbProductos = new org.jdesktop.swingx.JXTable(); + txtBuscar = new javax.swing.JTextField(); + jLabel1 = new javax.swing.JLabel(); + cmbTipoBusqueda = new javax.swing.JComboBox(); + jLabel2 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("Insertar Producto"); @@ -132,13 +139,13 @@ }, new String [] { - "Nombre", "Descripcion" + "Codigo", "Nombre", "Descripcion" } ) { boolean[] canEdit = new boolean [] { - false, false + false, false, false }; public boolean isCellEditable(int rowIndex, int columnIndex) @@ -148,6 +155,28 @@ }); jScrollPane1.setViewportView(jtbProductos); + txtBuscar.setEnabled(false); + txtBuscar.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { + txtBuscarActionPerformed(evt); + } + }); + + jLabel1.setText("Buscar:"); + + cmbTipoBusqueda.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Seleccionar", "Codigo", "Nombre", "Descripcion" })); + cmbTipoBusqueda.addItemListener(new java.awt.event.ItemListener() + { + public void itemStateChanged(java.awt.event.ItemEvent evt) + { + cmbTipoBusquedaItemStateChanged(evt); + } + }); + + jLabel2.setText("Tipo de Busqueda:"); + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( @@ -159,23 +188,72 @@ .addComponent(btnSeleccionar) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnCerrar)) - .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 376, Short.MAX_VALUE)) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 448, Short.MAX_VALUE) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel1) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtBuscar, javax.swing.GroupLayout.DEFAULT_SIZE, 140, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel2) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(cmbTipoBusqueda, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel1) + .addComponent(cmbTipoBusqueda, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel2) + .addComponent(txtBuscar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 19, Short.MAX_VALUE) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 245, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(btnCerrar, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(btnSeleccionar)) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addComponent(btnSeleccionar) + .addComponent(btnCerrar, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addContainerGap()) ); pack(); }// </editor-fold>//GEN-END:initComponents + private void txtBuscarActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_txtBuscarActionPerformed + {//GEN-HEADEREND:event_txtBuscarActionPerformed + String patron=txtBuscar.getText(); + + String itemSelected=(String)cmbTipoBusqueda.getSelectedItem(); + if(itemSelected.equals("Codigo")) + { + productoTable=modelo.getProductoPorCodigo(listaProductos,patron.trim()); + tableModel.fireTableDataChanged(); + } + if(itemSelected.equals("Nombre")) + { + productoTable=modelo.getProductoPorNombre(listaProductos,patron.trim()); + tableModel.fireTableDataChanged(); + } + if(itemSelected.equals("Descripcion")) + { + productoTable=modelo.getProductoPorDescripcion(listaProductos,patron.trim()); + tableModel.fireTableDataChanged(); + } + }//GEN-LAST:event_txtBuscarActionPerformed + + private void cmbTipoBusquedaItemStateChanged(java.awt.event.ItemEvent evt)//GEN-FIRST:event_cmbTipoBusquedaItemStateChanged + {//GEN-HEADEREND:event_cmbTipoBusquedaItemStateChanged + String itemSelected=(String)cmbTipoBusqueda.getSelectedItem(); + if(itemSelected.equals("Seleccionar")){ + productoTable.clear(); + tableModel.fireTableDataChanged(); + txtBuscar.setEnabled(false); + }else{ + txtBuscar.setEnabled(true); + txtBuscar.requestFocus(); + } + }//GEN-LAST:event_cmbTipoBusquedaItemStateChanged + private void btnCerrarActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnCerrarActionPerformed {//GEN-HEADEREND:event_btnCerrarActionPerformed dispose(); @@ -215,8 +293,12 @@ // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton btnCerrar; private javax.swing.JButton btnSeleccionar; + private javax.swing.JComboBox cmbTipoBusqueda; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; private javax.swing.JScrollPane jScrollPane1; private org.jdesktop.swingx.JXTable jtbProductos; + private javax.swing.JTextField txtBuscar; // End of variables declaration//GEN-END:variables } Modified: OpaloERP/src/frontend/proveedor/IAdministrarProveedor.form =================================================================== --- OpaloERP/src/frontend/proveedor/IAdministrarProveedor.form 2007-09-23 02:34:38 UTC (rev 42) +++ OpaloERP/src/frontend/proveedor/IAdministrarProveedor.form 2007-09-24 16:26:28 UTC (rev 43) @@ -32,7 +32,7 @@ <EmptySpace max="-2" attributes="0"/> <Component id="jLabel2" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> - <Component id="cmbTipoBusqueda" pref="147" max="32767" attributes="0"/> + <Component id="cmbTipoBusqueda" pref="151" max="32767" attributes="0"/> </Group> </Group> <EmptySpace max="-2" attributes="0"/> @@ -115,6 +115,12 @@ </Properties> </Component> <Component class="javax.swing.JTextField" name="txtBuscar"> + <Properties> + <Property name="enabled" type="boolean" value="false"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtBuscarActionPerformed"/> + </Events> </Component> <Component class="org.jdesktop.swingx.JXDatePicker" name="dateFechaIngreso"> </Component> @@ -126,9 +132,21 @@ <Component class="javax.swing.JComboBox" name="cmbTipoBusqueda"> <Properties> <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> - <StringArray count="0"/> + <StringArray count="8"> + <StringItem index="0" value="Seleccionar"/> + <StringItem index="1" value="Codigo"/> + <StringItem index="2" value="Nombre"/> + <StringItem index="3" value="RNC"/> + <StringItem index="4" value="Cedula"/> + <StringItem index="5" value="Limite de Credito"/> + <StringItem index="6" value="Limite de Dias"/> + <StringItem index="7" value="% Mora"/> + </StringArray> </Property> </Properties> + <Events> + <EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="cmbTipoBusquedaItemStateChanged"/> + </Events> </Component> <Container class="javax.swing.JScrollPane" name="jScrollPane1"> Modified: OpaloERP/src/frontend/proveedor/IAdministrarProveedor.java =================================================================== --- OpaloERP/src/frontend/proveedor/IAdministrarProveedor.java 2007-09-23 02:34:38 UTC (rev 42) +++ OpaloERP/src/frontend/proveedor/IAdministrarProveedor.java 2007-09-24 16:26:28 UTC (rev 43) @@ -53,7 +53,7 @@ { listaProveedorTotal=modeloProveedor.getAllProveedores(); - proveedorTable=listaProveedorTotal; + proveedorTable=modeloProveedor.getAllProveedores(); tableModel=new AbstractTableModel() { @@ -214,8 +214,26 @@ jLabel1.setText("Buscar"); + txtBuscar.setEnabled(false); + txtBuscar.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { + txtBuscarActionPerformed(evt); + } + }); + jLabel2.setText("Tipo de Busqueda"); + cmbTipoBusqueda.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Seleccionar", "Codigo", "Nombre", "RNC", "Cedula", "Limite de Credito", "Limite de Dias", "% Mora" })); + cmbTipoBusqueda.addItemListener(new java.awt.event.ItemListener() + { + public void itemStateChanged(java.awt.event.ItemEvent evt) + { + cmbTipoBusquedaItemStateChanged(evt); + } + }); + tableProveedor.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { @@ -257,7 +275,7 @@ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(cmbTipoBusqueda, 0, 147, Short.MAX_VALUE))) + .addComponent(cmbTipoBusqueda, 0, 151, Short.MAX_VALUE))) .addContainerGap()) ); layout.setVerticalGroup( @@ -285,6 +303,64 @@ pack(); }// </editor-fold>//GEN-END:initComponents + private void txtBuscarActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_txtBuscarActionPerformed + {//GEN-HEADEREND:event_txtBuscarActionPerformed + String patron=txtBuscar.getText(); + + String itemSelected=(String)cmbTipoBusqueda.getSelectedItem(); + if(itemSelected.equals("Codigo")) + { + proveedorTable=modeloProveedor.getProveedorPorCodigo(listaProveedorTotal,patron.trim()); + tableModel.fireTableDataChanged(); + } + if(itemSelected.equals("Nombre")) + { + proveedorTable=modeloProveedor.getProveedorPorNombre(listaProveedorTotal,patron.trim()); + tableModel.fireTableDataChanged(); + } + if(itemSelected.equals("RNC")) + { + proveedorTable=modeloProveedor.getProveedorPorRnc(listaProveedorTotal,patron.trim()); + tableModel.fireTableDataChanged(); + } + if(itemSelected.equals("Cedula")) + { + proveedorTable=modeloProveedor.getProveedorPorCedula(listaProveedorTotal,patron.trim()); + tableModel.fireTableDataChanged(); + } + if(itemSelected.equals("Limite de Credito")) + { + proveedorTable=modeloProveedor.getProveedorPorLimiteDeCredito(listaProveedorTotal,patron.trim()); + tableModel.fireTableDataChanged(); + } + if(itemSelected.equals("Limite de Dias")) + { + proveedorTable=modeloProveedor.getProveedorPorLimiteDeDias(listaProveedorTotal,patron.trim()); + tableModel.fireTableDataChanged(); + } + if(itemSelected.equals("% Mora")) + { + proveedorTable=modeloProveedor.getProveedorPorPorcentajeDeMora(listaProveedorTotal,patron.trim()); + tableModel.fireTableDataChanged(); + } + }//GEN-LAST:event_txtBuscarActionPerformed + + private void cmbTipoBusquedaItemStateChanged(java.awt.event.ItemEvent evt)//GEN-FIRST:event_cmbTipoBusquedaItemStateChanged + {//GEN-HEADEREND:event_cmbTipoBusquedaItemStateChanged + String itemSelected=(String)cmbTipoBusqueda.getSelectedItem(); + if(itemSelected.equals("Seleccionar")) + { + proveedorTable.clear(); + tableModel.fireTableDataChanged(); + txtBuscar.setEnabled(false); + } + else + { + txtBuscar.setEnabled(true); + txtBuscar.requestFocus(); + } + }//GEN-LAST:event_cmbTipoBusquedaItemStateChanged + private void btnBorrarActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnBorrarActionPerformed {//GEN-HEADEREND:event_btnBorrarActionPerformed ProveedorEvent pv=new ProveedorEvent(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2007-09-23 02:34:35
|
Revision: 42 http://opaloerp.svn.sourceforge.net/opaloerp/?rev=42&view=rev Author: thegenius03 Date: 2007-09-22 19:34:38 -0700 (Sat, 22 Sep 2007) Log Message: ----------- - Nuevas clases y paquetes - Paquete modelo_objetos.productos - ModeloProductosdelProveedor en el paquete anterior - DgInsertarProducto - Funcionalidades agregadas - Buscar en la tabla de productos, los que seran agregados al proveedor. - Insertar Productos al Proveedor, con su precio, descripcion y fecha. - Al elegir una ubicacion (Direccion) todos los campos de jerarquia mayor se llenan automaticamente (arreglado). - Excepciones: ERROR transaccion abortada, las consultas seran ignoradas hasta el fin de bloque de transaccion Modified Paths: -------------- OpaloERP/src/frontend/FRModuloPrincipal.form OpaloERP/src/frontend/FRModuloPrincipal.java OpaloERP/src/frontend/cliente/DgDireccionCliente.java OpaloERP/src/frontend/proveedor/DgCrearProveedor.form OpaloERP/src/frontend/proveedor/DgCrearProveedor.java OpaloERP/src/frontend/proveedor/IAdministrarProveedor.form OpaloERP/src/frontend/proveedor/IAdministrarProveedor.java OpaloERP/src/hibernate.cfg.xml OpaloERP/src/mensaje_objetos/proveedor/Proveedor.java Added Paths: ----------- OpaloERP/src/frontend/proveedor/DgInsertarProducto.form OpaloERP/src/frontend/proveedor/DgInsertarProducto.java OpaloERP/src/mensaje_objetos/almacen/ProductosDelProveedor.java OpaloERP/src/modelo_objetos/productos/ OpaloERP/src/modelo_objetos/productos/ModeloProductosDelProveedor.java Modified: OpaloERP/src/frontend/FRModuloPrincipal.form =================================================================== --- OpaloERP/src/frontend/FRModuloPrincipal.form 2007-09-21 01:58:18 UTC (rev 41) +++ OpaloERP/src/frontend/FRModuloPrincipal.form 2007-09-23 02:34:38 UTC (rev 42) @@ -107,6 +107,9 @@ <Property name="mnemonic" type="int" value="80"/> <Property name="text" type="java.lang.String" value="Productos"/> </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="mitemProductoActionPerformed"/> + </Events> </MenuItem> <MenuItem class="javax.swing.JMenuItem" name="mitemGrupoProducto"> <Properties> Modified: OpaloERP/src/frontend/FRModuloPrincipal.java =================================================================== --- OpaloERP/src/frontend/FRModuloPrincipal.java 2007-09-21 01:58:18 UTC (rev 41) +++ OpaloERP/src/frontend/FRModuloPrincipal.java 2007-09-23 02:34:38 UTC (rev 42) @@ -305,6 +305,14 @@ jMenu1.setFont(new java.awt.Font("Dialog", 0, 12)); mitemProducto.setMnemonic('P'); mitemProducto.setText("Productos"); + mitemProducto.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { + mitemProductoActionPerformed(evt); + } + }); + jMenu1.add(mitemProducto); mitemGrupoProducto.setMnemonic('G'); @@ -374,10 +382,15 @@ pack(); }// </editor-fold>//GEN-END:initComponents + private void mitemProductoActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_mitemProductoActionPerformed + {//GEN-HEADEREND:event_mitemProductoActionPerformed + desktop.add(insertarArticulo); + insertarArticulo.setVisible(true); + }//GEN-LAST:event_mitemProductoActionPerformed + private void itemProveedorActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_itemProveedorActionPerformed {//GEN-HEADEREND:event_itemProveedorActionPerformed desktop.add(iAdmProveedor); - iAdmProveedor.setTitle("Administrar Proveedores"); iAdmProveedor.setVisible(true); }//GEN-LAST:event_itemProveedorActionPerformed Modified: OpaloERP/src/frontend/cliente/DgDireccionCliente.java =================================================================== --- OpaloERP/src/frontend/cliente/DgDireccionCliente.java 2007-09-21 01:58:18 UTC (rev 41) +++ OpaloERP/src/frontend/cliente/DgDireccionCliente.java 2007-09-23 02:34:38 UTC (rev 42) @@ -398,7 +398,7 @@ regionSeleccionada=provinciaSeleccionada.getRegion(); txtRegion.setText(regionSeleccionada.getDescripcion()); - paisSeleccionado=ciudadSeleccionada.getPais(); + paisSeleccionado=regionSeleccionada.getPais(); txtPais.setText(paisSeleccionado.getNombre()); } } Modified: OpaloERP/src/frontend/proveedor/DgCrearProveedor.form =================================================================== --- OpaloERP/src/frontend/proveedor/DgCrearProveedor.form 2007-09-21 01:58:18 UTC (rev 41) +++ OpaloERP/src/frontend/proveedor/DgCrearProveedor.form 2007-09-23 02:34:38 UTC (rev 42) @@ -282,7 +282,7 @@ <Component id="jLabel7" linkSize="2" min="-2" max="-2" attributes="0"/> <Component id="txtMora" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace pref="32" max="32767" attributes="0"/> + <EmptySpace pref="36" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -425,7 +425,7 @@ </Group> <EmptySpace max="-2" attributes="0"/> <Component id="btnInsertarDireccion" min="-2" max="-2" attributes="0"/> - <EmptySpace pref="49" max="32767" attributes="0"/> + <EmptySpace pref="53" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -947,18 +947,16 @@ <Layout> <DimensionLayout dim="0"> <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> + <Group type="103" groupAlignment="1" attributes="0"> <Component id="jScrollPane4" alignment="0" pref="756" max="32767" attributes="0"/> - <Component id="btnBuscarProducto" alignment="0" min="-2" max="-2" attributes="0"/> <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel26" linkSize="13" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> - <Component id="btnInsertarProducto" linkSize="12" min="-2" pref="100" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="btnRemoverProducto" linkSize="12" min="-2" max="-2" attributes="0"/> + <Component id="txtPrecio" linkSize="14" min="-2" pref="51" max="-2" attributes="0"/> </Group> - <Group type="102" alignment="0" attributes="1"> + <Group type="102" alignment="0" attributes="0"> <Component id="jLabel25" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> <Component id="txtBuscarProducto" min="-2" pref="354" max="-2" attributes="0"/> @@ -966,14 +964,30 @@ <Component id="cmbTipoBusquedaProducto" pref="340" max="32767" attributes="0"/> </Group> <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel27" linkSize="13" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="dateFecha" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="btnInsertarProducto" linkSize="12" min="-2" pref="100" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="btnRemoverProducto" linkSize="12" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0"> <Component id="jLabel24" linkSize="13" min="-2" max="-2" attributes="0"/> <Component id="jLabel23" linkSize="13" min="-2" pref="213" max="-2" attributes="0"/> + <Component id="btnBuscarProducto" alignment="0" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> <Component id="txtProductoSeleccionado" linkSize="14" pref="531" max="32767" attributes="1"/> - <Component id="txtPrecio" linkSize="14" alignment="0" min="-2" max="-2" attributes="1"/> + <Component id="txtDescripcion" linkSize="14" alignment="0" min="-2" max="-2" attributes="1"/> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel28" linkSize="13" min="-2" pref="116" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtCodigoProducto" pref="306" max="32767" attributes="0"/> + </Group> </Group> </Group> </Group> @@ -983,9 +997,13 @@ </DimensionLayout> <DimensionLayout dim="1"> <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> + <Group type="102" attributes="0"> <EmptySpace max="-2" attributes="0"/> - <Component id="btnBuscarProducto" min="-2" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="btnBuscarProducto" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel28" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtCodigoProducto" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> <EmptySpace min="-2" pref="14" max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> <Component id="jLabel23" alignment="3" min="-2" max="-2" attributes="0"/> @@ -994,21 +1012,33 @@ <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> <Component id="jLabel24" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="txtPrecio" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtDescripcion" alignment="3" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> - <Component id="btnRemoverProducto" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="btnInsertarProducto" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel26" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtPrecio" alignment="3" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace min="-2" pref="36" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Component id="jLabel27" linkSize="21" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="btnInsertarProducto" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnRemoverProducto" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <Component id="dateFecha" linkSize="21" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> <Component id="jLabel25" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="txtBuscarProducto" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="cmbTipoBusquedaProducto" alignment="3" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> - <Component id="jScrollPane4" pref="215" max="32767" attributes="0"/> + <Component id="jScrollPane4" pref="191" max="32767" attributes="0"/> <EmptySpace max="-2" attributes="0"/> </Group> </Group> @@ -1035,20 +1065,26 @@ </Component> <Component class="javax.swing.JLabel" name="jLabel24"> <Properties> - <Property name="text" type="java.lang.String" value="Precio:"/> + <Property name="text" type="java.lang.String" value="Descripcion:"/> </Properties> </Component> - <Component class="javax.swing.JTextField" name="txtPrecio"> + <Component class="javax.swing.JTextField" name="txtDescripcion"> </Component> <Component class="javax.swing.JButton" name="btnRemoverProducto"> <Properties> <Property name="text" type="java.lang.String" value="Remover"/> </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnRemoverProductoActionPerformed"/> + </Events> </Component> <Component class="javax.swing.JButton" name="btnInsertarProducto"> <Properties> <Property name="text" type="java.lang.String" value="Insertar"/> </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnInsertarProductoActionPerformed"/> + </Events> </Component> <Component class="javax.swing.JLabel" name="jLabel25"> <Properties> @@ -1071,15 +1107,38 @@ <Component class="org.jdesktop.swingx.JXTable" name="jtbProductos"> <Properties> <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> - <Table columnCount="2" rowCount="0"> - <Column editable="true" title="Producto" type="java.lang.Object"/> - <Column editable="true" title="Precio" type="java.lang.Object"/> + <Table columnCount="4" rowCount="0"> + <Column editable="false" title="Producto" type="java.lang.Object"/> + <Column editable="false" title="Descripcion" type="java.lang.Object"/> + <Column editable="false" title="Precio" type="java.lang.Object"/> + <Column editable="false" title="Fecha" type="java.lang.Object"/> </Table> </Property> </Properties> </Component> </SubComponents> </Container> + <Component class="javax.swing.JLabel" name="jLabel26"> + <Properties> + <Property name="text" type="java.lang.String" value="Precio:"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtPrecio"> + </Component> + <Component class="javax.swing.JLabel" name="jLabel27"> + <Properties> + <Property name="text" type="java.lang.String" value="Fecha de precio:"/> + </Properties> + </Component> + <Component class="org.jdesktop.swingx.JXDatePicker" name="dateFecha"> + </Component> + <Component class="javax.swing.JLabel" name="jLabel28"> + <Properties> + <Property name="text" type="java.lang.String" value="Codigo:"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtCodigoProducto"> + </Component> </SubComponents> </Container> </SubComponents> Modified: OpaloERP/src/frontend/proveedor/DgCrearProveedor.java =================================================================== --- OpaloERP/src/frontend/proveedor/DgCrearProveedor.java 2007-09-21 01:58:18 UTC (rev 41) +++ OpaloERP/src/frontend/proveedor/DgCrearProveedor.java 2007-09-23 02:34:38 UTC (rev 42) @@ -10,7 +10,9 @@ import eventos.DireccionEvent; import eventos.IContactoListener; import eventos.IDireccionListener; +import eventos.IProductoListener; import eventos.IProveedorListener; +import eventos.ProductoEvent; import eventos.ProveedorEvent; import frontend.cliente.DgCrearContacto; import frontend.cliente.DgDireccionCliente; @@ -21,47 +23,53 @@ import javax.swing.JOptionPane; import javax.swing.table.AbstractTableModel; import mensaje_objetos.almacen.Producto; +import mensaje_objetos.almacen.ProductosDelProveedor; import mensaje_objetos.cliente.Contacto; import mensaje_objetos.cliente.Direccion; import mensaje_objetos.proveedor.Proveedor; import modelo_objetos.cliente.ModeloContacto; import modelo_objetos.cliente.ModeloDireccion; +import modelo_objetos.productos.ModeloProductosDelProveedor; import modelo_objetos.proveedor.ModeloProveedor; -import org.eclipse.jdt.internal.compiler.ast.ThisReference; /** * * @author raymi */ public class DgCrearProveedor extends javax.swing.JDialog implements IProveedorListener, IDireccionListener, - IContactoListener + IContactoListener, IProductoListener { private Proveedor proveedorSeleccionado; private Direccion direccionSeleccionada; private Contacto contactoSeleccionado; + private Producto productoSeleccionado; + private ProductosDelProveedor productoprovSeleccionado; private DgDireccionCliente dgDireccionProveedor; private DgCrearContacto dgCrearContacto; + private DgInsertarProducto dgInsertarProducto; private Direccion dirPrincipal; private Contacto conPrincipal; private boolean direccionPrincipal; private List<Direccion> listaDirecciones; private List<Contacto> listaContactos; - private List<Producto> listaProductos; + private List<ProductosDelProveedor> listaProductos; private List<Direccion> direccionTable = new ArrayList<Direccion>(); private List<Contacto> contactoTable = new ArrayList<Contacto>(); - private List<Producto> productoTable = new ArrayList<Producto>(); + private List<ProductosDelProveedor> productoTable = new ArrayList<ProductosDelProveedor>(); private ModeloProveedor modeloProveedor; private ModeloDireccion modeloDireccion; private ModeloContacto modeloContacto; + private ModeloProductosDelProveedor modeloProductoProv; private AbstractTableModel modeloTablaDireccion; private AbstractTableModel modeloTablaContacto; private AbstractTableModel modeloTablaProducto; private static final String [] headersDireccion = {"Direccion", "Ciudad", "Provincia","Region", "Pais"}; private static final String [] headersContacto = {"Contacto","Telefono1","Telefono2","Fax","Email"}; + private static final String [] headersProducto = {"Producto", "Descripcion", "Precio", "Fecha"}; //private DgArticulo dgArticulo; private int accion; @@ -73,6 +81,7 @@ inicializarComponentes(); inicializarTablaDireccion(); inicializarTablaContacto(); + inicializarTablaProductos(); } private void inicializarTablaContacto() @@ -199,15 +208,67 @@ } + private void inicializarTablaProductos() + { + modeloTablaProducto=new AbstractTableModel() + { + public int getColumnCount() + { + return headersProducto.length; + } + public int getRowCount() + { + return productoTable.size(); + } + public Object getValueAt(int rowIndex, int columnIndex) + { + if(productoTable.size()>0) + { + ProductosDelProveedor producto=productoTable.get(rowIndex); + if(producto!=null) + { + if(columnIndex==0) + { + return producto.getNombre(); + } + if(columnIndex==1) + { + return producto.getDescripcion(); + } + if(columnIndex==2) + { + return producto.getPrecio(); + } + if(columnIndex==3) + { + return producto.getFecha(); + } + } + } + return ""; + } + public String getColumnName(int col) + { + return headersProducto[col]; + } + }; + jtbProductos.setModel(modeloTablaProducto); + modeloTablaProducto.fireTableDataChanged(); + + } + private void inicializarComponentes() { dgDireccionProveedor = new DgDireccionCliente(new JFrame(), true); dgDireccionProveedor.addDireccionListener(this); dgCrearContacto = new DgCrearContacto(new JFrame(), true); dgCrearContacto.addContactoListener(this); + dgInsertarProducto = new DgInsertarProducto(new JFrame(), true); + dgInsertarProducto.addProductoListener(this); modeloProveedor = ModeloProveedor.getInstance(); modeloDireccion = ModeloDireccion.getInstance(); modeloContacto = ModeloContacto.getInstance(); + modeloProductoProv = ModeloProductosDelProveedor.getInstance(); //dgArticulo = new DgArticulo(new JFrame(), true); } @@ -232,7 +293,7 @@ modeloTablaDireccion.fireTableDataChanged(); modeloTablaContacto.fireTableDataChanged(); - //modeloTablaProducto.fireTableDataChanged(); + modeloTablaProducto.fireTableDataChanged(); setProveedor(); @@ -256,10 +317,9 @@ direccionTable=proveedorSeleccionado.getDirecciones(); -/* modeloTablaContacto.fireTableDataChanged(); - modeloTablaSucursal.fireTableDataChanged(); + modeloTablaContacto.fireTableDataChanged(); + modeloTablaProducto.fireTableDataChanged(); modeloTablaDireccion.fireTableDataChanged(); - modeloTablaDocumento.fireTableDataChanged();*/ setProveedor(); } setEnable(false); @@ -272,11 +332,11 @@ this.inicializarTablaContacto(); listaContactos= new ArrayList<Contacto>(); - listaProductos=new ArrayList<Producto>(); + listaProductos=new ArrayList<ProductosDelProveedor>(); listaDirecciones=new ArrayList<Direccion>(); contactoTable=new ArrayList<Contacto>(); - productoTable=new ArrayList<Producto>(); + productoTable=new ArrayList<ProductosDelProveedor>(); direccionTable=new ArrayList<Direccion>(); setEnable(true); @@ -317,7 +377,7 @@ limpiarCampos(); txtCodigo.setText(proveedorSeleccionado.getCodigo()); - if(proveedorSeleccionado.getRnc()!=null) + if(proveedorSeleccionado.getRnc()!="") { rbtnRNC.setSelected(true); txtDocumento.setText(proveedorSeleccionado.getRnc()); @@ -499,6 +559,19 @@ return direccion; } + public ProductosDelProveedor getSelectedProducto() + { + ProductosDelProveedor producto=null; + int arow=jtbProductos.getSelectedRow(); + if(arow!=-1) + { + int row=jtbTablaDireccion.convertRowIndexToModel(arow); + producto = productoTable.get(row); + } + return producto; + + } + private void setDireccionPrincipal(Proveedor p) { List<Direccion> direcciones = p.getDirecciones(); @@ -607,6 +680,12 @@ else contactos.set(contactos.indexOf(con), con); this.inicializarTablaContacto(); } + + public void fireProducto(ProductoEvent producto) + { + productoSeleccionado = producto.getProducto(); + txtProductoSeleccionado.setText(productoSeleccionado.getNombre()); + } /** This method is called from within the constructor to * initialize the form. @@ -694,7 +773,7 @@ jLabel23 = new javax.swing.JLabel(); txtProductoSeleccionado = new javax.swing.JTextField(); jLabel24 = new javax.swing.JLabel(); - txtPrecio = new javax.swing.JTextField(); + txtDescripcion = new javax.swing.JTextField(); btnRemoverProducto = new javax.swing.JButton(); btnInsertarProducto = new javax.swing.JButton(); jLabel25 = new javax.swing.JLabel(); @@ -702,6 +781,12 @@ cmbTipoBusquedaProducto = new javax.swing.JComboBox(); jScrollPane4 = new javax.swing.JScrollPane(); jtbProductos = new org.jdesktop.swingx.JXTable(); + jLabel26 = new javax.swing.JLabel(); + txtPrecio = new javax.swing.JTextField(); + jLabel27 = new javax.swing.JLabel(); + dateFecha = new org.jdesktop.swingx.JXDatePicker(); + jLabel28 = new javax.swing.JLabel(); + txtCodigoProducto = new javax.swing.JTextField(); btnCerrar = new javax.swing.JButton(); btnSalvarCerrar = new javax.swing.JButton(); btnSalvar = new javax.swing.JButton(); @@ -805,7 +890,7 @@ .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel7) .addComponent(txtMora, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addContainerGap(32, Short.MAX_VALUE)) + .addContainerGap(36, Short.MAX_VALUE)) ); jPanel4Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jLabel4, jLabel5, jLabel6, jLabel7}); @@ -911,7 +996,7 @@ .addComponent(lblProvincia)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnInsertarDireccion) - .addContainerGap(49, Short.MAX_VALUE)) + .addContainerGap(53, Short.MAX_VALUE)) ); jpanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {lblCiudad, lblPais, lblProvincia, lblRegion}); @@ -1271,11 +1356,25 @@ txtProductoSeleccionado.setEditable(false); - jLabel24.setText("Precio:"); + jLabel24.setText("Descripcion:"); btnRemoverProducto.setText("Remover"); + btnRemoverProducto.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { + btnRemoverProductoActionPerformed(evt); + } + }); btnInsertarProducto.setText("Insertar"); + btnInsertarProducto.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { + btnInsertarProductoActionPerformed(evt); + } + }); jLabel25.setText("Buscar:"); @@ -1286,53 +1385,84 @@ }, new String [] { - "Producto", "Precio" + "Producto", "Descripcion", "Precio", "Fecha" } - )); + ) + { + boolean[] canEdit = new boolean [] + { + false, false, false, false + }; + + public boolean isCellEditable(int rowIndex, int columnIndex) + { + return canEdit [columnIndex]; + } + }); jScrollPane4.setViewportView(jtbProductos); + jLabel26.setText("Precio:"); + + jLabel27.setText("Fecha de precio:"); + + jLabel28.setText("Codigo:"); + javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel3Layout.createSequentialGroup() + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() .addContainerGap() - .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 756, Short.MAX_VALUE) - .addComponent(btnBuscarProducto) - .addGroup(jPanel3Layout.createSequentialGroup() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jScrollPane4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 756, Short.MAX_VALUE) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel3Layout.createSequentialGroup() + .addComponent(jLabel26) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(btnInsertarProducto, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(btnRemoverProducto)) - .addGroup(jPanel3Layout.createSequentialGroup() + .addComponent(txtPrecio, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel3Layout.createSequentialGroup() .addComponent(jLabel25) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(txtBuscarProducto, javax.swing.GroupLayout.PREFERRED_SIZE, 354, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(cmbTipoBusquedaProducto, 0, 340, Short.MAX_VALUE)) - .addGroup(jPanel3Layout.createSequentialGroup() + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel3Layout.createSequentialGroup() + .addComponent(jLabel27) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(dateFecha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel3Layout.createSequentialGroup() + .addComponent(btnInsertarProducto, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(btnRemoverProducto)) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel3Layout.createSequentialGroup() .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel24) - .addComponent(jLabel23, javax.swing.GroupLayout.PREFERRED_SIZE, 213, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(jLabel23, javax.swing.GroupLayout.PREFERRED_SIZE, 213, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(btnBuscarProducto)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(txtProductoSeleccionado, javax.swing.GroupLayout.DEFAULT_SIZE, 531, Short.MAX_VALUE) - .addComponent(txtPrecio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addComponent(txtDescripcion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(jPanel3Layout.createSequentialGroup() + .addComponent(jLabel28, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtCodigoProducto, javax.swing.GroupLayout.DEFAULT_SIZE, 306, Short.MAX_VALUE))))) .addContainerGap()) ); jPanel3Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {btnInsertarProducto, btnRemoverProducto}); - jPanel3Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel23, jLabel24}); + jPanel3Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel23, jLabel24, jLabel26, jLabel27, jLabel28}); - jPanel3Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {txtPrecio, txtProductoSeleccionado}); + jPanel3Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {txtDescripcion, txtPrecio, txtProductoSeleccionado}); jPanel3Layout.setVerticalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup() .addContainerGap() - .addComponent(btnBuscarProducto) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btnBuscarProducto) + .addComponent(jLabel28) + .addComponent(txtCodigoProducto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(14, 14, 14) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel23) @@ -1340,20 +1470,32 @@ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel24) + .addComponent(txtDescripcion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel26) .addComponent(txtPrecio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addComponent(jLabel27) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btnInsertarProducto) + .addComponent(btnRemoverProducto))) + .addComponent(dateFecha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(btnRemoverProducto) - .addComponent(btnInsertarProducto)) - .addGap(36, 36, 36) - .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel25) .addComponent(txtBuscarProducto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(cmbTipoBusquedaProducto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 215, Short.MAX_VALUE) + .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 191, Short.MAX_VALUE) .addContainerGap()) ); + + jPanel3Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {dateFecha, jLabel27}); + jTabbedPane1.addTab("Productos", jPanel3); btnCerrar.setText("Cerrar"); @@ -1441,10 +1583,47 @@ ); pack(); }// </editor-fold>//GEN-END:initComponents + + private void btnRemoverProductoActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnRemoverProductoActionPerformed + {//GEN-HEADEREND:event_btnRemoverProductoActionPerformed + productoprovSeleccionado = getSelectedProducto(); + if(productoprovSeleccionado != null) + { + int respuesta = JOptionPane.showConfirmDialog(this, "Esta seguro de que desea" + + " eliminar este producto", "Confirmar borrado de producto", + JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); + if(respuesta == JOptionPane.OK_OPTION) + { + modeloProductoProv.removeProducto(productoprovSeleccionado); + productoprovSeleccionado = null; + this.inicializarTablaProductos(); + } + } + else + { + JOptionPane.showMessageDialog(this,"Debes elegir una direccion" + + " para realizar esta operaci\u00f3n", "Seleccione una direccion", JOptionPane.WARNING_MESSAGE); + } + }//GEN-LAST:event_btnRemoverProductoActionPerformed + + private void btnInsertarProductoActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnInsertarProductoActionPerformed + {//GEN-HEADEREND:event_btnInsertarProductoActionPerformed + ProductosDelProveedor product = new ProductosDelProveedor(); + product.setCodigo(txtCodigoProducto.getText()); + product.setDescripcion(txtDescripcion.getText()); + product.setNombre(txtProductoSeleccionado.getText()); + product.setFecha(dateFecha.getDate()); + product.setPrecio(Double.parseDouble(txtPrecio.getText())); + listaProductos.add(product); + this.inicializarTablaProductos(); + }//GEN-LAST:event_btnInsertarProductoActionPerformed private void btnBuscarProductoActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnBuscarProductoActionPerformed {//GEN-HEADEREND:event_btnBuscarProductoActionPerformed -// TODO add your handling code here: + ProductoEvent pv = new ProductoEvent(); + pv.setId(ProductoEvent.NUEVO); + dgInsertarProducto.fireProducto(pv); + dgInsertarProducto.setVisible(true); }//GEN-LAST:event_btnBuscarProductoActionPerformed private void btnBorrarContactoActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnBorrarContactoActionPerformed @@ -1591,6 +1770,7 @@ private javax.swing.JComboBox cmbTipoBusquedaContactos; private javax.swing.JComboBox cmbTipoBusquedaDirecciones; private javax.swing.JComboBox cmbTipoBusquedaProducto; + private org.jdesktop.swingx.JXDatePicker dateFecha; private javax.swing.ButtonGroup grpTipoDoc; private javax.swing.ButtonGroup grpTipoPago; private javax.swing.JLabel jLabel1; @@ -1611,6 +1791,9 @@ private javax.swing.JLabel jLabel23; private javax.swing.JLabel jLabel24; private javax.swing.JLabel jLabel25; + private javax.swing.JLabel jLabel26; + private javax.swing.JLabel jLabel27; + private javax.swing.JLabel jLabel28; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; @@ -1649,6 +1832,8 @@ private javax.swing.JTextField txtBuscarProducto; private javax.swing.JTextField txtCargo; private javax.swing.JTextField txtCodigo; + private javax.swing.JTextField txtCodigoProducto; + private javax.swing.JTextField txtDescripcion; private javax.swing.JTextField txtDocumento; private javax.swing.JTextField txtEmail; private javax.swing.JTextField txtFax; Added: OpaloERP/src/frontend/proveedor/DgInsertarProducto.form =================================================================== --- OpaloERP/src/frontend/proveedor/DgInsertarProducto.form (rev 0) +++ OpaloERP/src/frontend/proveedor/DgInsertarProducto.form 2007-09-23 02:34:38 UTC (rev 42) @@ -0,0 +1,85 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.3" type="org.netbeans.modules.form.forminfo.JDialogFormInfo"> + <Properties> + <Property name="defaultCloseOperation" type="int" value="2"/> + <Property name="title" type="java.lang.String" value="Insertar Producto"/> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + </SyntheticProperties> + <AuxValues> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + </AuxValues> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <Component id="btnSeleccionar" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="btnCerrar" min="-2" max="-2" attributes="0"/> + </Group> + <Component id="jScrollPane1" alignment="0" pref="376" max="32767" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jScrollPane1" min="-2" pref="245" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="btnCerrar" alignment="3" min="-2" pref="25" max="-2" attributes="0"/> + <Component id="btnSeleccionar" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JButton" name="btnSeleccionar"> + <Properties> + <Property name="text" type="java.lang.String" value="Seleccionar"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnSeleccionarActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btnCerrar"> + <Properties> + <Property name="text" type="java.lang.String" value="Cerrar"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCerrarActionPerformed"/> + </Events> + </Component> + <Container class="javax.swing.JScrollPane" name="jScrollPane1"> + + <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> + <SubComponents> + <Component class="org.jdesktop.swingx.JXTable" name="jtbProductos"> + <Properties> + <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> + <Table columnCount="2" rowCount="0"> + <Column editable="false" title="Nombre" type="java.lang.Object"/> + <Column editable="false" title="Descripcion" type="java.lang.Object"/> + </Table> + </Property> + </Properties> + </Component> + </SubComponents> + </Container> + </SubComponents> +</Form> Added: OpaloERP/src/frontend/proveedor/DgInsertarProducto.java =================================================================== --- OpaloERP/src/frontend/proveedor/DgInsertarProducto.java (rev 0) +++ OpaloERP/src/frontend/proveedor/DgInsertarProducto.java 2007-09-23 02:34:38 UTC (rev 42) @@ -0,0 +1,222 @@ +/* + * DgInsertarProducto.java + * + * Created on 22 de septiembre de 2007, 19:33 + */ + +package frontend.proveedor; + +import eventos.IProductoListener; +import eventos.ProductoEvent; +import java.util.List; +import javax.swing.table.AbstractTableModel; +import mensaje_objetos.almacen.Producto; +import modelo_objetos.almacen.ModeloProducto; + +/** + * + * @author gonzalez + */ +public class DgInsertarProducto extends javax.swing.JDialog implements IProductoListener +{ + private Producto productoSeleccionado; + private ModeloProducto modelo; + private IProductoListener listener; + + private String[] headers={"Nombre","Descripcion"}; + private AbstractTableModel tableModel; + + private List<Producto> listaProductos, productoTable; + private int accion; + + /** + * Creates new form DgInsertarProducto + */ + public DgInsertarProducto(java.awt.Frame parent, boolean modal) + { + super(parent, modal); + initComponents(); + inicializarComponentes(); + inicializarTabla(); + } + + private void inicializarComponentes() + { + modelo = ModeloProducto.getInstance(); + } + + private void inicializarTabla() + { + listaProductos=modelo.getAllProductos(); + productoTable=modelo.getAllProductos(); + + tableModel=new AbstractTableModel() { + public int getColumnCount() { + return headers.length; + } + public int getRowCount() { + return productoTable.size(); + } + public Object getValueAt(int rowIndex, int columnIndex) { + Producto producto =productoTable.get(rowIndex); + if(producto!=null){ + if(columnIndex==0){ + return producto.getNombre(); + } + if(columnIndex==1){ + return producto.getDescripcion(); + } + } + return ""; + } + public String getColumnName(int col){ + return headers[col]; + } + }; + jtbProductos.setModel(tableModel); + tableModel.fireTableDataChanged(); + } + + public void addProductoListener(IProductoListener listener) + { + this.listener = listener; + } + + private Producto getSelectedProducto() + { + Producto producto=null; + int arow=jtbProductos.getSelectedRow(); + if(arow!=-1){ + int row=jtbProductos.convertRowIndexToModel(arow); + producto=productoTable.get(row); + } + return producto; + } + /** 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. + */ + // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents + private void initComponents() + { + btnSeleccionar = new javax.swing.JButton(); + btnCerrar = new javax.swing.JButton(); + jScrollPane1 = new javax.swing.JScrollPane(); + jtbProductos = new org.jdesktop.swingx.JXTable(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + setTitle("Insertar Producto"); + btnSeleccionar.setText("Seleccionar"); + btnSeleccionar.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { + btnSeleccionarActionPerformed(evt); + } + }); + + btnCerrar.setText("Cerrar"); + btnCerrar.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { + btnCerrarActionPerformed(evt); + } + }); + + jtbProductos.setModel(new javax.swing.table.DefaultTableModel( + new Object [][] + { + + }, + new String [] + { + "Nombre", "Descripcion" + } + ) + { + boolean[] canEdit = new boolean [] + { + false, false + }; + + public boolean isCellEditable(int rowIndex, int columnIndex) + { + return canEdit [columnIndex]; + } + }); + jScrollPane1.setViewportView(jtbProductos); + + 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() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addComponent(btnSeleccionar) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(btnCerrar)) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 376, Short.MAX_VALUE)) + .addContainerGap()) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 245, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btnCerrar, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(btnSeleccionar)) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + pack(); + }// </editor-fold>//GEN-END:initComponents + + private void btnCerrarActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnCerrarActionPerformed + {//GEN-HEADEREND:event_btnCerrarActionPerformed + dispose(); + }//GEN-LAST:event_btnCerrarActionPerformed + + private void btnSeleccionarActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnSeleccionarActionPerformed + {//GEN-HEADEREND:event_btnSeleccionarActionPerformed + productoSeleccionado = this.getSelectedProducto(); + ProductoEvent pv = new ProductoEvent(); + pv.setProducto(productoSeleccionado); + if(listener!=null) + { + listener.fireProducto(pv); + dispose(); + } + }//GEN-LAST:event_btnSeleccionarActionPerformed + + /** + * @param args the command line arguments + */ + public static void main(String args[]) + { + java.awt.EventQueue.invokeLater(new Runnable() + { + public void run() + { + new DgInsertarProducto(new javax.swing.JFrame(), true).setVisible(true); + } + }); + } + + public void fireProducto(ProductoEvent producto) + { + accion = producto.getId(); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton btnCerrar; + private javax.swing.JButton btnSeleccionar; + private javax.swing.JScrollPane jScrollPane1; + private org.jdesktop.swingx.JXTable jtbProductos; + // End of variables declaration//GEN-END:variables + +} Modified: OpaloERP/src/frontend/proveedor/IAdministrarProveedor.form =================================================================== --- OpaloERP/src/frontend/proveedor/IAdministrarProveedor.form 2007-09-21 01:58:18 UTC (rev 41) +++ OpaloERP/src/frontend/proveedor/IAdministrarProveedor.form 2007-09-23 02:34:38 UTC (rev 42) @@ -1,6 +1,9 @@ <?xml version="1.0" encoding="UTF-8" ?> <Form version="1.3" type="org.netbeans.modules.form.forminfo.JInternalFrameFormInfo"> + <Properties> + <Property name="title" type="java.lang.String" value="Administrar Proveedores"/> + </Properties> <SyntheticProperties> <SyntheticProperty name="formSizePolicy" type="int" value="1"/> </SyntheticProperties> @@ -29,7 +32,7 @@ <EmptySpace max="-2" attributes="0"/> <Component id="jLabel2" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> - <Component id="cmbTipoBusqueda" pref="144" max="32767" attributes="0"/> + <Component id="cmbTipoBusqueda" pref="147" max="32767" attributes="0"/> </Group> </Group> <EmptySpace max="-2" attributes="0"/> Modified: OpaloERP/src/frontend/proveedor/IAdministrarProveedor.java =================================================================== --- OpaloERP/src/frontend/proveedor/IAdministrarProveedor.java 2007-09-21 01:58:18 UTC (rev 41) +++ OpaloERP/src/frontend/proveedor/IAdministrarProveedor.java 2007-09-23 02:34:38 UTC (rev 42) @@ -167,6 +167,7 @@ jScrollPane1 = new javax.swing.JScrollPane(); tableProveedor = new org.jdesktop.swingx.JXTable(); + setTitle("Administrar Proveedores"); btnNuevo.setText("Nuevo"); btnNuevo.addActionListener(new java.awt.event.ActionListener() { @@ -245,8 +246,8 @@ .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 766, Short.MAX_VALUE) - .addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE, 766, Short.MAX_VALUE) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 773, Short.MAX_VALUE) + .addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE, 773, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() .addComponent(jLabel1) .addGap(32, 32, 32) @@ -256,7 +257,7 @@ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(cmbTipoBusqueda, 0, 135, Short.MAX_VALUE))) + .addComponent(cmbTipoBusqueda, 0, 147, Short.MAX_VALUE))) .addContainerGap()) ); layout.setVerticalGroup( Modified: OpaloERP/src/hibernate.cfg.xml =================================================================== --- OpaloERP/src/hibernate.cfg.xml 2007-09-21 01:58:18 UTC (rev 41) +++ OpaloERP/src/hibernate.cfg.xml 2007-09-23 02:34:38 UTC (rev 42) @@ -59,6 +59,7 @@ <mapping class="mensaje_objetos.usuario.Role" /> <mapping class="mensaje_objetos.proveedor.Proveedor" /> <mapping class="mensaje_objetos.al... [truncated message content] |
From: <va...@us...> - 2007-09-21 01:58:16
|
Revision: 41 http://opaloerp.svn.sourceforge.net/opaloerp/?rev=41&view=rev Author: vacax Date: 2007-09-20 18:58:18 -0700 (Thu, 20 Sep 2007) Log Message: ----------- Cambios realizados por ustedes ayer. PAX Modified Paths: -------------- OpaloERP/nbproject/genfiles.properties OpaloERP/src/frontend/cliente/DgCrearPais.java OpaloERP/src/frontend/proveedor/DgCrearProveedor.java OpaloERP/src/mensaje_objetos/cliente/Direccion.java OpaloERP/src/modelo_objetos/cliente/ModeloCiudad.java OpaloERP/src/modelo_objetos/cliente/ModeloProvincia.java Modified: OpaloERP/nbproject/genfiles.properties =================================================================== --- OpaloERP/nbproject/genfiles.properties 2007-09-18 20:46:23 UTC (rev 40) +++ OpaloERP/nbproject/genfiles.properties 2007-09-21 01:58:18 UTC (rev 41) @@ -5,4 +5,4 @@ # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=628e4a6e nbproject/build-impl.xml.script.CRC32=84be6d16 -nbproject/build-impl.xml.stylesheet.CRC32=20b9345e +nbproject/build-impl.xml.stylesheet.CRC32=65d7ca21 Modified: OpaloERP/src/frontend/cliente/DgCrearPais.java =================================================================== --- OpaloERP/src/frontend/cliente/DgCrearPais.java 2007-09-18 20:46:23 UTC (rev 40) +++ OpaloERP/src/frontend/cliente/DgCrearPais.java 2007-09-21 01:58:18 UTC (rev 41) @@ -263,7 +263,7 @@ if(clase==ModeloPais.class){ if(mensaje.equals("addPais")){ limpiarCampos(); - Secuencia sec=modelo.getSecuencia(); + //Secuencia sec=modelo.getSecuencia(); paisNuevo=new Pais(); txtCodigo.requestFocus(); @@ -293,7 +293,7 @@ accion=PaisEvent.NUEVO; paisNuevo=new Pais(); setEnabled(true); - Secuencia sec=modelo.getSecuencia(); + // Secuencia sec=modelo.getSecuencia(); txtCodigo.requestFocus(); } Modified: OpaloERP/src/frontend/proveedor/DgCrearProveedor.java =================================================================== --- OpaloERP/src/frontend/proveedor/DgCrearProveedor.java 2007-09-18 20:46:23 UTC (rev 40) +++ OpaloERP/src/frontend/proveedor/DgCrearProveedor.java 2007-09-21 01:58:18 UTC (rev 41) @@ -510,7 +510,12 @@ } else { - direcciones.set(0, dirPrincipal); + if(direcciones.isEmpty()){ + direcciones.add(dirPrincipal); + }else{ + direcciones.set(0, dirPrincipal); + } + } } @@ -531,8 +536,13 @@ p.setContactos(contactos); contactos.add(0, conPrincipal); } - else - contactos.set(0, conPrincipal); + else{ + if(contactos.isEmpty()){ + contactos.add(conPrincipal); + }else{ + contactos.set(0, conPrincipal); + } + } } public void fireDireccion(DireccionEvent direccion) Modified: OpaloERP/src/mensaje_objetos/cliente/Direccion.java =================================================================== --- OpaloERP/src/mensaje_objetos/cliente/Direccion.java 2007-09-18 20:46:23 UTC (rev 40) +++ OpaloERP/src/mensaje_objetos/cliente/Direccion.java 2007-09-21 01:58:18 UTC (rev 41) @@ -45,7 +45,7 @@ this.descripcion = descripcion; } - @OneToOne() + @OneToOne(cascade=CascadeType.PERSIST) @JoinColumn(name="codigo_ciudad") public Ciudad getCiudad() { return ciudad; @@ -55,7 +55,7 @@ this.ciudad = ciudad; } - @OneToOne() + @OneToOne(cascade=CascadeType.PERSIST) @JoinColumn(name="codigo_provincia") public Provincia getProvincia() { return provincia; @@ -65,7 +65,7 @@ this.provincia = provincia; } - @OneToOne() + @OneToOne(cascade=CascadeType.PERSIST) @JoinColumn(name="codigo_pais") public Pais getPais() { return pais; @@ -75,7 +75,7 @@ this.pais = pais; } - @OneToOne() + @OneToOne(cascade=CascadeType.PERSIST) @JoinColumn(name="codigo_region") public Region getRegion() { return region; Modified: OpaloERP/src/modelo_objetos/cliente/ModeloCiudad.java =================================================================== --- OpaloERP/src/modelo_objetos/cliente/ModeloCiudad.java 2007-09-18 20:46:23 UTC (rev 40) +++ OpaloERP/src/modelo_objetos/cliente/ModeloCiudad.java 2007-09-21 01:58:18 UTC (rev 41) @@ -87,7 +87,7 @@ public void addCiudad(Ciudad ciudad){ Session sl=conn.getSession(); Transaction tx=sl.beginTransaction(); - if(!existCiudad(ciudad)){ + if(!existCiudadSession(ciudad,sl)){ sl.save(ciudad); tx.commit(); getSubjectAdd().notify(ModeloCiudad.class,ciudad,"addCiudad"); @@ -107,6 +107,21 @@ } /**Metodo para saber si un grupo esta registrado*/ + private boolean existCiudadSession(Ciudad ciudad,Session ss){ + + String hql="From Ciudad P WHERE P.codigo=?"; + Query q=ss.createQuery(hql); + q.setString(0,ciudad.getCodigo()); + List<Ciudad> lista=q.list(); + if(lista.size()==0){ + return false; + }else{ + return true; + } + + } + + /**Metodo para saber si un grupo esta registrado*/ private boolean existCiudad(Ciudad ciudad){ Session ss=conn.getSession(); String hql="From Ciudad P WHERE P.codigo=?"; Modified: OpaloERP/src/modelo_objetos/cliente/ModeloProvincia.java =================================================================== --- OpaloERP/src/modelo_objetos/cliente/ModeloProvincia.java 2007-09-18 20:46:23 UTC (rev 40) +++ OpaloERP/src/modelo_objetos/cliente/ModeloProvincia.java 2007-09-21 01:58:18 UTC (rev 41) @@ -82,7 +82,7 @@ public void addProvincia(Provincia provincia){ Session sl=conn.getSession(); Transaction tx=sl.beginTransaction(); - if(!existProvincia(provincia)){ + if(!existProvinciaSession(provincia,sl)){ sl.save(provincia); tx.commit(); sl.close(); @@ -117,6 +117,21 @@ } + /**Metodo para saber si un grupo esta registrado*/ + private boolean existProvinciaSession(Provincia provincia,Session ss){ + + String hql="From Provincia P WHERE P.codigo=?"; + Query q=ss.createQuery(hql); + q.setString(0,provincia.getCodigo()); + List<Provincia> lista=q.list(); + if(lista.size()==0){ + return false; + }else{ + return true; + } + + } + /**Metodo para actualizar un grupo*/ public void updateProvincia(Provincia provincia){ Session ss=conn.getSession(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jos...@us...> - 2007-09-18 20:46:20
|
Revision: 40 http://opaloerp.svn.sourceforge.net/opaloerp/?rev=40&view=rev Author: jose_cruz64 Date: 2007-09-18 13:46:23 -0700 (Tue, 18 Sep 2007) Log Message: ----------- "" Added Paths: ----------- OpaloERP/src/mensaje_objetos/almacen/Producto.java Added: OpaloERP/src/mensaje_objetos/almacen/Producto.java =================================================================== --- OpaloERP/src/mensaje_objetos/almacen/Producto.java (rev 0) +++ OpaloERP/src/mensaje_objetos/almacen/Producto.java 2007-09-18 20:46:23 UTC (rev 40) @@ -0,0 +1,312 @@ +/* + * Producto.java + * + * Created on November 22, 2006, 9:49 AM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package mensaje_objetos.almacen; + +import java.io.File; +import java.math.BigDecimal; +import java.util.List; +import javax.persistence.*; +import mensaje_objetos.facturacion.Itbis; + +/** + * + * @author carlos + */ + +@Entity() +@Table(name="producto") +public class Producto { + + private String codigo; + private String nombre; + private String descripcion; + private BigDecimal precio; + private BigDecimal precioItbis; + private BigDecimal cantidadExistente; + private BigDecimal cantidadEntrada; + private BigDecimal cantidadSalida; + private BigDecimal descuento; + private BigDecimal descuentoPor; + + private BigDecimal subTotal; + private BigDecimal total; + private BigDecimal itbisP; + + private BigDecimal stockFisico; + private BigDecimal stockMinimo; + private BigDecimal stockMaximo; + + private boolean ventaSinStock=true; + + private GrupoProducto grupo; + private Itbis itbis; + private List<PrecioCliente> listaPrecioCliente; + private List<PrecioCiudad> listaPrecioCiudad; + private List<PrecioProvincia> listaPrecioProvincia; + private List<PrecioRegion> listaPrecioRegion; + private File imagen; + private List<ProductoStock> listaStockProducto; + + @Id + public String getCodigo() { + return codigo; + } + + public void setCodigo(String codigo) { + this.codigo = codigo; + } + + public String getNombre() { + return nombre; + } + + public void setNombre(String nombre) { + this.nombre = nombre; + } + + public String getDescripcion() { + return descripcion; + } + + public void setDescripcion(String descripcion) { + this.descripcion = descripcion; + } + + public BigDecimal getPrecio() { + return precio; + } + + public void setPrecio(BigDecimal precio) { + this.precio = precio; + } + + @Column(name="cantidad_existente") + public BigDecimal getCantidadExistente() { + return cantidadExistente; + } + + public void setCantidadExistente(BigDecimal cantidadExistente) { + this.cantidadExistente = cantidadExistente; + } + + @Column(name="cantidad_entrada") + public BigDecimal getCantidadEntrada() { + return cantidadEntrada; + } + + public void setCantidadEntrada(BigDecimal cantidadEntrada) { + this.cantidadEntrada = cantidadEntrada; + } + + @Column(name="cantidad_salida") + public BigDecimal getCantidadSalida() { + return cantidadSalida; + } + + public void setCantidadSalida(BigDecimal cantidadSalida) { + this.cantidadSalida = cantidadSalida; + } + + + @OneToOne() + @JoinColumn(name="codigo_grupo") + public GrupoProducto getGrupo() { + return grupo; + } + + public void setGrupo(GrupoProducto grupo) { + this.grupo = grupo; + } + + + + @OneToOne() + @JoinColumn(name="codigo_itbis") + public Itbis getItbis() { + return itbis; + } + + public void setItbis(Itbis itbis) { + this.itbis = itbis; + } + + /** + *Permite clonar el objeto, a mi entener debe ser en vivo. + */ + public Producto clone(){ + Producto producto=new Producto(); + producto.setCantidadEntrada(getCantidadEntrada()); + producto.setCantidadExistente(getCantidadExistente()); + producto.setCantidadSalida(getCantidadSalida()); + producto.setCodigo(getCodigo()); + producto.setDescripcion(getDescripcion()); + producto.setGrupo(getGrupo()); + producto.setItbis(getItbis()); +// producto.setPreciosCiudad(listaPrecioCiudad); +// producto.setPreciosCliente(listaPrecioCliente); +// producto.setPreciosProvincia(listaPrecioProvincia); +// producto.setPreciosRegion(listaPrecioRegion); + producto.setNombre(getNombre()); + producto.setPrecio(getPrecio()); + + return producto; + } + + @Transient + public List<PrecioCliente> getPreciosCliente() { + return listaPrecioCliente; + } + + public void setPreciosCliente(List<PrecioCliente> listaPrecioCliente) { + this.listaPrecioCliente = listaPrecioCliente; + } + + @Transient + public List<PrecioCiudad> getPreciosCiudad() { + return listaPrecioCiudad; + } + + public void setPreciosCiudad(List<PrecioCiudad> listaPrecioCiudad) { + this.listaPrecioCiudad = listaPrecioCiudad; + } + + @Transient + public List<PrecioProvincia> getPreciosProvincia() { + return listaPrecioProvincia; + } + + public void setPreciosProvincia(List<PrecioProvincia> listaPrecioProvincia) { + this.listaPrecioProvincia=listaPrecioProvincia; + } + @Transient + public List<PrecioRegion> getPreciosRegion() { + return listaPrecioRegion; + } + + public void setPreciosRegion(List<PrecioRegion> listaPrecioRegion) { + this.listaPrecioRegion=listaPrecioRegion; + } + + @Transient + public File getImagen() { + return imagen; + } + + public void setImagen(File imagen) { + this.imagen = imagen; + } + + @Column(name="precio_itbis") + public BigDecimal getPrecioItbis() { + return precioItbis; + } + + public void setPrecioItbis(BigDecimal precioItbis) { + this.precioItbis = precioItbis; + } + + + @Transient + public BigDecimal getDescuento() { + return descuento; + } + + public void setDescuento(BigDecimal descuento) { + this.descuento = descuento; + } + + @Transient + public BigDecimal getDescuentoPor() { + return descuentoPor; + } + + public void setDescuentoPor(BigDecimal descuentoPor) { + this.descuentoPor = descuentoPor; + } + + @Transient + public BigDecimal getSubTotal() { + return subTotal; + } + + public void setSubTotal(BigDecimal subTotal) { + this.subTotal = subTotal; + } + + @Transient + public BigDecimal getTotal() { + return total; + } + + public void setTotal(BigDecimal total) { + this.total = total; + } + + + + + @Transient + public BigDecimal getItbisP(){ + return itbisP; + + } + public void setItbisP(BigDecimal it){ + itbisP=it; + } + + @Column(name="stock_fisico") + public BigDecimal getStockFisico() { + return stockFisico; + } + + public void setStockFisico(BigDecimal stockFisico) { + this.stockFisico = stockFisico; + } + + @Column(name="stock_min") + public BigDecimal getStockMinimo() { + return stockMinimo; + } + + public void setStockMinimo(BigDecimal stockMinimo) { + this.stockMinimo = stockMinimo; + } + + @Column(name="stock_max") + public BigDecimal getStockMaximo() { + return stockMaximo; + } + + public void setStockMaximo(BigDecimal stockMaximo) { + this.stockMaximo = stockMaximo; + } + + @Column(name="sin_stock") + public boolean isVentaSinStock() { + return ventaSinStock; + } + + public void setVentaSinStock(boolean ventaSinStock) { + this.ventaSinStock = ventaSinStock; + } + + /** + *Representa la lista de los stock que tiene un producto en particular. + */ + @OneToMany(mappedBy="producto",cascade=CascadeType.ALL) + public List<ProductoStock> getListaStockProducto() { + return listaStockProducto; + } + + public void setListaStockProducto(List<ProductoStock> listaStockProducto) { + this.listaStockProducto = listaStockProducto; + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jos...@us...> - 2007-09-18 20:44:35
|
Revision: 39 http://opaloerp.svn.sourceforge.net/opaloerp/?rev=39&view=rev Author: jose_cruz64 Date: 2007-09-18 13:44:30 -0700 (Tue, 18 Sep 2007) Log Message: ----------- -Agregar nuevos proveedores -Correcciones contactos secundarios -Correcciones direcciones secundarias -Editar proveedores -Editar las direcciones secundarias -Borrar las direcciones secundarias -Borrar direcciones y contactos en forma individual dentro de un proveedor -Modificaciones a: -ModeloContacto -En cada metodo que realiza una transaccion, se obtiene la sesion actual y se cierra luego de la transaccion, contrario a abrir la sesion unicamente en el constructor y no cerrarla. -mensaje_objetos.Direccion -Se elimino CascadeType.ALL en los campos de esta entidad. -DgCrearDireccion -Al elegir una ubicacion, todas las de jerarquia mayor se seleccionan automaticamente. Funcionalidades removidas: -Ninguna en esta revision Funcionalidades pendientes para las proximas revisiones: -Agregar nuevos proveedores -Asignar productos para el proveedor -Editar proveedores -Editar, y remover productos para el proveedor Modified Paths: -------------- OpaloERP/src/frontend/almacen/DgInsertarProductoAlmacen.form OpaloERP/src/frontend/almacen/DgInsertarProductoAlmacen.java OpaloERP/src/frontend/cliente/DgDireccionCliente.java OpaloERP/src/frontend/proveedor/DgCrearProveedor.form OpaloERP/src/frontend/proveedor/DgCrearProveedor.java OpaloERP/src/frontend/proveedor/IAdministrarProveedor.form OpaloERP/src/frontend/proveedor/IAdministrarProveedor.java OpaloERP/src/mensaje_objetos/almacen/PrecioCiudad.java OpaloERP/src/mensaje_objetos/almacen/PrecioCliente.java OpaloERP/src/mensaje_objetos/almacen/PrecioProvincia.java OpaloERP/src/mensaje_objetos/almacen/PrecioRegion.java OpaloERP/src/mensaje_objetos/almacen/ProductoStock.java OpaloERP/src/mensaje_objetos/cliente/Direccion.java OpaloERP/src/modelo_objetos/cliente/ModeloContacto.java OpaloERP/src/modelo_objetos/proveedor/ModeloProveedor.java Removed Paths: ------------- OpaloERP/src/mensaje_objetos/almacen/Producto.java Modified: OpaloERP/src/frontend/almacen/DgInsertarProductoAlmacen.form =================================================================== --- OpaloERP/src/frontend/almacen/DgInsertarProductoAlmacen.form 2007-09-16 23:50:57 UTC (rev 38) +++ OpaloERP/src/frontend/almacen/DgInsertarProductoAlmacen.form 2007-09-18 20:44:30 UTC (rev 39) @@ -71,8 +71,8 @@ <Group type="103" groupAlignment="3" attributes="0"> <Component id="cerrar" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="salvarNuevo" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="nuevo" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="salvar" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="nuevo" alignment="3" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> </Group> Modified: OpaloERP/src/frontend/almacen/DgInsertarProductoAlmacen.java =================================================================== --- OpaloERP/src/frontend/almacen/DgInsertarProductoAlmacen.java 2007-09-16 23:50:57 UTC (rev 38) +++ OpaloERP/src/frontend/almacen/DgInsertarProductoAlmacen.java 2007-09-18 20:44:30 UTC (rev 39) @@ -165,7 +165,8 @@ * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents - private void initComponents() { + private void initComponents() + { buscarAlmacen = new javax.swing.JButton(); nombre_almacen = new javax.swing.JTextField(); jLabel1 = new javax.swing.JLabel(); @@ -181,8 +182,10 @@ setModal(true); buscarAlmacen.setFont(new java.awt.Font("Dialog", 0, 12)); buscarAlmacen.setText("Almacen"); - buscarAlmacen.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + buscarAlmacen.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { buscarAlmacenActionPerformed(evt); } }); @@ -195,32 +198,40 @@ cerrar.setFont(new java.awt.Font("Dialog", 0, 12)); cerrar.setText("Cerrar"); - cerrar.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + cerrar.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { cerrarActionPerformed(evt); } }); salvarNuevo.setFont(new java.awt.Font("Dialog", 0, 12)); salvarNuevo.setText("Salvar ->"); - salvarNuevo.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + salvarNuevo.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { salvarNuevoActionPerformed(evt); } }); salvar.setFont(new java.awt.Font("Dialog", 0, 12)); salvar.setText("Salvar"); - salvar.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + salvar.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { salvarActionPerformed(evt); } }); nuevo.setFont(new java.awt.Font("Dialog", 0, 12)); nuevo.setText("Nuevo"); - nuevo.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + nuevo.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { nuevoActionPerformed(evt); } }); @@ -269,8 +280,8 @@ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(cerrar) .add(salvarNuevo) - .add(salvar) - .add(nuevo)) + .add(nuevo) + .add(salvar)) .addContainerGap()))) ); pack(); Modified: OpaloERP/src/frontend/cliente/DgDireccionCliente.java =================================================================== --- OpaloERP/src/frontend/cliente/DgDireccionCliente.java 2007-09-16 23:50:57 UTC (rev 38) +++ OpaloERP/src/frontend/cliente/DgDireccionCliente.java 2007-09-18 20:44:30 UTC (rev 39) @@ -347,6 +347,12 @@ if(provincia!=null){ provinciaSeleccionada=provincia.getProvincia(); txtProvincia.setText(provinciaSeleccionada.getNombre()); + + regionSeleccionada=provinciaSeleccionada.getRegion(); + txtRegion.setText(regionSeleccionada.getDescripcion()); + + paisSeleccionado=regionSeleccionada.getPais(); + txtPais.setText(paisSeleccionado.getNombre()); } } @@ -359,6 +365,9 @@ if(direccion1.getCiudad()!=null){ txtCiudad.setText(direccion1.getCiudad().getNombre()); } + if(direccion1.getRegion()!=null){ + txtRegion.setText(direccion1.getRegion().getDescripcion()); + } if(direccion1.getPais()!=null){ txtPais.setText(direccion1.getPais().getNombre()); } @@ -372,6 +381,9 @@ if(region!=null){ regionSeleccionada=region.getRegion(); txtRegion.setText(regionSeleccionada.getDescripcion()); + + paisSeleccionado=regionSeleccionada.getPais(); + txtPais.setText(paisSeleccionado.getNombre()); } } @@ -379,6 +391,15 @@ if(ciudad!=null){ ciudadSeleccionada=ciudad.getCiudad(); txtCiudad.setText(ciudadSeleccionada.getNombre()); + + provinciaSeleccionada=ciudadSeleccionada.getProvincia(); + txtProvincia.setText(provinciaSeleccionada.getNombre()); + + regionSeleccionada=provinciaSeleccionada.getRegion(); + txtRegion.setText(regionSeleccionada.getDescripcion()); + + paisSeleccionado=ciudadSeleccionada.getPais(); + txtPais.setText(paisSeleccionado.getNombre()); } } Modified: OpaloERP/src/frontend/proveedor/DgCrearProveedor.form =================================================================== --- OpaloERP/src/frontend/proveedor/DgCrearProveedor.form 2007-09-16 23:50:57 UTC (rev 38) +++ OpaloERP/src/frontend/proveedor/DgCrearProveedor.form 2007-09-18 20:44:30 UTC (rev 39) @@ -42,7 +42,6 @@ <Group type="102" alignment="1" attributes="0"> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="1" attributes="0"> - <Component id="jTabbedPane1" alignment="0" pref="785" max="32767" attributes="0"/> <Group type="102" alignment="1" attributes="0"> <Component id="jLabel1" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> @@ -64,6 +63,10 @@ </Group> <EmptySpace max="-2" attributes="0"/> </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="jTabbedPane1" pref="785" max="32767" attributes="0"/> + <EmptySpace min="-2" pref="24" max="-2" attributes="0"/> + </Group> </Group> </DimensionLayout> <DimensionLayout dim="1"> @@ -123,16 +126,18 @@ <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" attributes="0"> <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" max="-2" attributes="0"> - <Component id="txtDocumento" alignment="0" max="32767" attributes="1"/> - <Group type="102" alignment="0" attributes="0"> - <Component id="jLabel3" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="rbtnRNC" linkSize="1" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="rbtnCedula" linkSize="1" min="-2" pref="97" max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="jpanel1" max="32767" attributes="1"/> + <Group type="103" alignment="1" groupAlignment="0" max="-2" attributes="0"> + <Component id="txtDocumento" alignment="0" max="32767" attributes="1"/> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel3" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="rbtnRNC" linkSize="1" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="rbtnCedula" linkSize="1" min="-2" pref="97" max="-2" attributes="0"/> + </Group> </Group> - <Component id="jpanel1" alignment="1" max="32767" attributes="1"/> </Group> <EmptySpace min="-2" pref="9" max="-2" attributes="0"/> <Group type="103" groupAlignment="1" max="-2" attributes="0"> @@ -1014,6 +1019,9 @@ <Properties> <Property name="text" type="java.lang.String" value="Buscar Producto"/> </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnBuscarProductoActionPerformed"/> + </Events> </Component> <Component class="javax.swing.JLabel" name="jLabel23"> <Properties> Modified: OpaloERP/src/frontend/proveedor/DgCrearProveedor.java =================================================================== --- OpaloERP/src/frontend/proveedor/DgCrearProveedor.java 2007-09-16 23:50:57 UTC (rev 38) +++ OpaloERP/src/frontend/proveedor/DgCrearProveedor.java 2007-09-18 20:44:30 UTC (rev 39) @@ -27,6 +27,7 @@ import modelo_objetos.cliente.ModeloContacto; import modelo_objetos.cliente.ModeloDireccion; import modelo_objetos.proveedor.ModeloProveedor; +import org.eclipse.jdt.internal.compiler.ast.ThisReference; /** * @@ -38,7 +39,6 @@ private Proveedor proveedorSeleccionado; private Direccion direccionSeleccionada; private Contacto contactoSeleccionado; - private Proveedor proveedorNuevo; private DgDireccionCliente dgDireccionProveedor; private DgCrearContacto dgCrearContacto; private Direccion dirPrincipal; @@ -268,6 +268,16 @@ { limpiarCampos(); + this.inicializarTablaDireccion(); + this.inicializarTablaContacto(); + + listaContactos= new ArrayList<Contacto>(); + listaProductos=new ArrayList<Producto>(); + listaDirecciones=new ArrayList<Direccion>(); + + contactoTable=new ArrayList<Contacto>(); + productoTable=new ArrayList<Producto>(); + direccionTable=new ArrayList<Direccion>(); setEnable(true); } @@ -417,10 +427,10 @@ } public void execute() - { + { if(accion == ProveedorEvent.NUEVO) { - Proveedor p = new Proveedor(); + Proveedor p = this.proveedorSeleccionado; this.setProveedorData(p); this.setDireccionPrincipal(p); this.setContactoPrincipal(p); @@ -492,7 +502,16 @@ private void setDireccionPrincipal(Proveedor p) { List<Direccion> direcciones = p.getDirecciones(); - direcciones.set(0, dirPrincipal); + if(direcciones == null) + { + direcciones = new ArrayList<Direccion>(); + p.setDirecciones(direcciones); + direcciones.add(0, dirPrincipal); + } + else + { + direcciones.set(0, dirPrincipal); + } } private void setContactoPrincipal(Proveedor p) @@ -506,35 +525,74 @@ conPrincipal.setNombre(txtNombreContacto.getText()); conPrincipal.setTelefono1(txtTelefono1.getText()); conPrincipal.setTelefono2(txtTelefono2.getText()); - contactos.set(0, conPrincipal); + if(contactos == null) + { + contactos = new ArrayList<Contacto>(); + p.setContactos(contactos); + contactos.add(0, conPrincipal); + } + else + contactos.set(0, conPrincipal); } public void fireDireccion(DireccionEvent direccion) { - Direccion dir = direccion.getDireccion(); - if(direccionPrincipal) + if(direccion!=null) { - dirPrincipal = dir; - areaDireccion.setText(dir.getDescripcion()); - lblCiudad.setText(dir.getCiudad().getNombre()); - lblPais.setText(dir.getPais().getNombre()); - lblProvincia.setText(dir.getProvincia().getNombre()); - lblRegion.setText(dir.getRegion().getDescripcion()); - } - else - { - List<Direccion> direcciones = proveedorSeleccionado.getDirecciones(); - if(!direcciones.contains(dir)) direcciones.add(dir); - else direcciones.set(direcciones.indexOf(dir), dir); + Direccion dir = direccion.getDireccion(); + if(direccionPrincipal) + { + dirPrincipal = dir; + areaDireccion.setText(dir.getDescripcion()); + + if(dir.getCiudad()!=null) + { + lblCiudad.setText(dir.getCiudad().getNombre()); + } + + if(dir.getPais()!=null) + { + lblPais.setText(dir.getPais().getNombre()); + } + + if(dir.getProvincia()!=null) + { + lblProvincia.setText(dir.getProvincia().getNombre()); + } + + if(dir.getRegion()!=null) + { + lblRegion.setText(dir.getRegion().getDescripcion()); + } + + } + else + { + List<Direccion> direcciones = proveedorSeleccionado.getDirecciones(); + if(direcciones == null) + { + direcciones = new ArrayList<Direccion>(); + proveedorSeleccionado.setDirecciones(direcciones); + } + if(!direcciones.contains(dir)) direcciones.add(dir); + else direcciones.set(direcciones.indexOf(dir), dir); + + } + + this.inicializarTablaDireccion(); } - this.inicializarTablaDireccion(); } public void fireContacto(ContactoEvent contacto) { List<Contacto> contactos = proveedorSeleccionado.getContactos(); Contacto con = contacto.getContacto(); + if(contactos == null) + { + contactos = new ArrayList<Contacto>(); + proveedorSeleccionado.setContactos(contactos); + } if(!contactos.contains(con)) contactos.add(con); else contactos.set(contactos.indexOf(con), con); this.inicializarTablaContacto(); @@ -936,15 +994,16 @@ jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addComponent(txtDocumento) - .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(jLabel3) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(rbtnRNC) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(rbtnCedula, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addComponent(jpanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jpanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(txtDocumento) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(jLabel3) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(rbtnRNC) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(rbtnCedula, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addGap(9, 9, 9) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) @@ -1190,6 +1249,13 @@ jTabbedPane1.addTab("Contactos", jPanel11); btnBuscarProducto.setText("Buscar Producto"); + btnBuscarProducto.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { + btnBuscarProductoActionPerformed(evt); + } + }); jLabel23.setText("Producto Seleccionado:"); @@ -1323,7 +1389,6 @@ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(jTabbedPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 785, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() .addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) @@ -1341,6 +1406,9 @@ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnCerrar))) .addContainerGap()) + .addGroup(layout.createSequentialGroup() + .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 785, Short.MAX_VALUE) + .addGap(24, 24, 24)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -1363,13 +1431,19 @@ ); pack(); }// </editor-fold>//GEN-END:initComponents - + + private void btnBuscarProductoActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnBuscarProductoActionPerformed + {//GEN-HEADEREND:event_btnBuscarProductoActionPerformed +// TODO add your handling code here: + }//GEN-LAST:event_btnBuscarProductoActionPerformed + private void btnBorrarContactoActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnBorrarContactoActionPerformed {//GEN-HEADEREND:event_btnBorrarContactoActionPerformed + DireccionEvent dv = new DireccionEvent(); contactoSeleccionado = getSelectedContacto(); if(contactoSeleccionado != null) { - int respuesta = JOptionPane.showInternalConfirmDialog(this, "\u00bfEst\u00e1 seguro de que desea" + + int respuesta = JOptionPane.showConfirmDialog(this, "\u00bfEst\u00e1 seguro de que desea" + " eliminar este contacto", "Confirmar borrado de contacto", JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); if(respuesta == JOptionPane.OK_OPTION) @@ -1381,17 +1455,17 @@ } else { - JOptionPane.showInternalMessageDialog(this,"Debes elegir un contacto" + + JOptionPane.showMessageDialog(this,"Debes elegir un contacto" + " para realizar esta operaci\u00f3n", "Seleccione un contacto", JOptionPane.WARNING_MESSAGE); } }//GEN-LAST:event_btnBorrarContactoActionPerformed - + private void btnBorrarDireccionActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnBorrarDireccionActionPerformed {//GEN-HEADEREND:event_btnBorrarDireccionActionPerformed direccionSeleccionada = getSelectedDireccion(); if(direccionSeleccionada != null) { - int respuesta = JOptionPane.showInternalConfirmDialog(this, "\u00bfEst\u00e1 seguro de que desea" + + int respuesta = JOptionPane.showConfirmDialog(this, "Esta seguro de que desea" + " eliminar esta direccion", "Confirmar borrado de direccion", JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); if(respuesta == JOptionPane.OK_OPTION) @@ -1403,8 +1477,8 @@ } else { - JOptionPane.showInternalMessageDialog(this,"Debes elegir un direccion" + - " para realizar esta operaci\u00f3n", "Seleccione un direccion", JOptionPane.WARNING_MESSAGE); + JOptionPane.showMessageDialog(this,"Debes elegir una direccion" + + " para realizar esta operaci\u00f3n", "Seleccione una direccion", JOptionPane.WARNING_MESSAGE); } }//GEN-LAST:event_btnBorrarDireccionActionPerformed @@ -1422,7 +1496,8 @@ private void btnInsertarDireccionActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnInsertarDireccionActionPerformed {//GEN-HEADEREND:event_btnInsertarDireccionActionPerformed direccionPrincipal=true; - dgDireccionProveedor=new DgDireccionCliente(new JFrame(),true); + dgDireccionProveedor = new DgDireccionCliente(new JFrame(), true); + dgDireccionProveedor.addDireccionListener(this); DireccionEvent dv = new DireccionEvent(); dv.setId(DireccionEvent.NUEVO); dgDireccionProveedor.fireDireccion(dv); Modified: OpaloERP/src/frontend/proveedor/IAdministrarProveedor.form =================================================================== --- OpaloERP/src/frontend/proveedor/IAdministrarProveedor.form 2007-09-16 23:50:57 UTC (rev 38) +++ OpaloERP/src/frontend/proveedor/IAdministrarProveedor.form 2007-09-18 20:44:30 UTC (rev 39) @@ -18,8 +18,8 @@ <Group type="102" alignment="0" attributes="0"> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jScrollPane1" alignment="0" pref="766" max="32767" attributes="0"/> - <Component id="jToolBar1" alignment="0" pref="766" max="32767" attributes="0"/> + <Component id="jScrollPane1" alignment="0" pref="773" max="32767" attributes="0"/> + <Component id="jToolBar1" alignment="0" pref="773" max="32767" attributes="0"/> <Group type="102" alignment="0" attributes="0"> <Component id="jLabel1" min="-2" max="-2" attributes="0"/> <EmptySpace min="-2" pref="32" max="-2" attributes="0"/> Modified: OpaloERP/src/frontend/proveedor/IAdministrarProveedor.java =================================================================== --- OpaloERP/src/frontend/proveedor/IAdministrarProveedor.java 2007-09-16 23:50:57 UTC (rev 38) +++ OpaloERP/src/frontend/proveedor/IAdministrarProveedor.java 2007-09-18 20:44:30 UTC (rev 39) @@ -309,28 +309,43 @@ }//GEN-LAST:event_btnBorrarActionPerformed private void btnVisualizarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnVisualizarActionPerformed - ProveedorEvent pv=new ProveedorEvent(); - pv.setId(ProveedorEvent.VISUALIZAR); proveedorSeleccionado = getSelectedProveedor(); - pv.setProveedor(proveedorSeleccionado); - dgCrearProveedor.fireProveedor(pv); - dgCrearProveedor.setVisible(true); - this.inicializarTable(); + if(proveedorSeleccionado != null) + { + ProveedorEvent pv=new ProveedorEvent(); + pv.setId(ProveedorEvent.VISUALIZAR); + pv.setProveedor(proveedorSeleccionado); + dgCrearProveedor.fireProveedor(pv); + dgCrearProveedor.setVisible(true); + this.inicializarTable(); + } + else + JOptionPane.showInternalMessageDialog(this,"Debes elegir un proveedor" + + " para realizar esta operaci\u00f3n", "Seleccione un proveedor", JOptionPane.WARNING_MESSAGE); }//GEN-LAST:event_btnVisualizarActionPerformed private void btnEditarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEditarActionPerformed - ProveedorEvent pv=new ProveedorEvent(); - pv.setId(ProveedorEvent.EDITAR); proveedorSeleccionado = getSelectedProveedor(); - pv.setProveedor(proveedorSeleccionado); - dgCrearProveedor.fireProveedor(pv); - dgCrearProveedor.setVisible(true); - this.inicializarTable(); + if(proveedorSeleccionado != null) + { + ProveedorEvent pv=new ProveedorEvent(); + pv.setId(ProveedorEvent.EDITAR); + + pv.setProveedor(proveedorSeleccionado); + dgCrearProveedor.fireProveedor(pv); + dgCrearProveedor.setVisible(true); + this.inicializarTable(); + } + else + JOptionPane.showInternalMessageDialog(this,"Debes elegir un proveedor" + + " para realizar esta operaci\u00f3n", "Seleccione un proveedor", JOptionPane.WARNING_MESSAGE); + }//GEN-LAST:event_btnEditarActionPerformed private void btnNuevoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNuevoActionPerformed ProveedorEvent pv=new ProveedorEvent(); pv.setId(ProveedorEvent.NUEVO); + pv.setProveedor(new Proveedor()); dgCrearProveedor.fireProveedor(pv); dgCrearProveedor.setVisible(true); this.inicializarTable(); Modified: OpaloERP/src/mensaje_objetos/almacen/PrecioCiudad.java =================================================================== --- OpaloERP/src/mensaje_objetos/almacen/PrecioCiudad.java 2007-09-16 23:50:57 UTC (rev 38) +++ OpaloERP/src/mensaje_objetos/almacen/PrecioCiudad.java 2007-09-18 20:44:30 UTC (rev 39) @@ -12,6 +12,7 @@ import java.math.BigDecimal; import javax.persistence.*; import mensaje_objetos.cliente.Ciudad; +import mensaje_objetos.almacen.Producto; /** * Modified: OpaloERP/src/mensaje_objetos/almacen/PrecioCliente.java =================================================================== --- OpaloERP/src/mensaje_objetos/almacen/PrecioCliente.java 2007-09-16 23:50:57 UTC (rev 38) +++ OpaloERP/src/mensaje_objetos/almacen/PrecioCliente.java 2007-09-18 20:44:30 UTC (rev 39) @@ -12,6 +12,7 @@ import java.math.BigDecimal; import javax.persistence.*; import mensaje_objetos.cliente.Cliente; +import mensaje_objetos.almacen.Producto; /** * Modified: OpaloERP/src/mensaje_objetos/almacen/PrecioProvincia.java =================================================================== --- OpaloERP/src/mensaje_objetos/almacen/PrecioProvincia.java 2007-09-16 23:50:57 UTC (rev 38) +++ OpaloERP/src/mensaje_objetos/almacen/PrecioProvincia.java 2007-09-18 20:44:30 UTC (rev 39) @@ -12,6 +12,7 @@ import java.math.BigDecimal; import javax.persistence.*; import mensaje_objetos.cliente.Provincia; +import mensaje_objetos.almacen.Producto; /** * Modified: OpaloERP/src/mensaje_objetos/almacen/PrecioRegion.java =================================================================== --- OpaloERP/src/mensaje_objetos/almacen/PrecioRegion.java 2007-09-16 23:50:57 UTC (rev 38) +++ OpaloERP/src/mensaje_objetos/almacen/PrecioRegion.java 2007-09-18 20:44:30 UTC (rev 39) @@ -12,6 +12,7 @@ import java.math.BigDecimal; import javax.persistence.*; import mensaje_objetos.cliente.Region; +import mensaje_objetos.almacen.Producto; /** * Deleted: OpaloERP/src/mensaje_objetos/almacen/Producto.java =================================================================== --- OpaloERP/src/mensaje_objetos/almacen/Producto.java 2007-09-16 23:50:57 UTC (rev 38) +++ OpaloERP/src/mensaje_objetos/almacen/Producto.java 2007-09-18 20:44:30 UTC (rev 39) @@ -1,312 +0,0 @@ -/* - * Producto.java - * - * Created on November 22, 2006, 9:49 AM - * - * To change this template, choose Tools | Template Manager - * and open the template in the editor. - */ - -package mensaje_objetos.almacen; - -import java.io.File; -import java.math.BigDecimal; -import java.util.List; -import javax.persistence.*; -import mensaje_objetos.facturacion.Itbis; - -/** - * - * @author carlos - */ - -@Entity() -@Table(name="producto") -public class Producto { - - private String codigo; - private String nombre; - private String descripcion; - private BigDecimal precio; - private BigDecimal precioItbis; - private BigDecimal cantidadExistente; - private BigDecimal cantidadEntrada; - private BigDecimal cantidadSalida; - private BigDecimal descuento; - private BigDecimal descuentoPor; - - private BigDecimal subTotal; - private BigDecimal total; - private BigDecimal itbisP; - - private BigDecimal stockFisico; - private BigDecimal stockMinimo; - private BigDecimal stockMaximo; - - private boolean ventaSinStock=true; - - private GrupoProducto grupo; - private Itbis itbis; - private List<PrecioCliente> listaPrecioCliente; - private List<PrecioCiudad> listaPrecioCiudad; - private List<PrecioProvincia> listaPrecioProvincia; - private List<PrecioRegion> listaPrecioRegion; - private File imagen; - private List<ProductoStock> listaStockProducto; - - @Id - public String getCodigo() { - return codigo; - } - - public void setCodigo(String codigo) { - this.codigo = codigo; - } - - public String getNombre() { - return nombre; - } - - public void setNombre(String nombre) { - this.nombre = nombre; - } - - public String getDescripcion() { - return descripcion; - } - - public void setDescripcion(String descripcion) { - this.descripcion = descripcion; - } - - public BigDecimal getPrecio() { - return precio; - } - - public void setPrecio(BigDecimal precio) { - this.precio = precio; - } - - @Column(name="cantidad_existente") - public BigDecimal getCantidadExistente() { - return cantidadExistente; - } - - public void setCantidadExistente(BigDecimal cantidadExistente) { - this.cantidadExistente = cantidadExistente; - } - - @Column(name="cantidad_entrada") - public BigDecimal getCantidadEntrada() { - return cantidadEntrada; - } - - public void setCantidadEntrada(BigDecimal cantidadEntrada) { - this.cantidadEntrada = cantidadEntrada; - } - - @Column(name="cantidad_salida") - public BigDecimal getCantidadSalida() { - return cantidadSalida; - } - - public void setCantidadSalida(BigDecimal cantidadSalida) { - this.cantidadSalida = cantidadSalida; - } - - - @OneToOne() - @JoinColumn(name="codigo_grupo") - public GrupoProducto getGrupo() { - return grupo; - } - - public void setGrupo(GrupoProducto grupo) { - this.grupo = grupo; - } - - - - @OneToOne() - @JoinColumn(name="codigo_itbis") - public Itbis getItbis() { - return itbis; - } - - public void setItbis(Itbis itbis) { - this.itbis = itbis; - } - - /** - *Permite clonar el objeto, a mi entener debe ser en vivo. - */ - public Producto clone(){ - Producto producto=new Producto(); - producto.setCantidadEntrada(getCantidadEntrada()); - producto.setCantidadExistente(getCantidadExistente()); - producto.setCantidadSalida(getCantidadSalida()); - producto.setCodigo(getCodigo()); - producto.setDescripcion(getDescripcion()); - producto.setGrupo(getGrupo()); - producto.setItbis(getItbis()); -// producto.setPreciosCiudad(listaPrecioCiudad); -// producto.setPreciosCliente(listaPrecioCliente); -// producto.setPreciosProvincia(listaPrecioProvincia); -// producto.setPreciosRegion(listaPrecioRegion); - producto.setNombre(getNombre()); - producto.setPrecio(getPrecio()); - - return producto; - } - - @Transient - public List<PrecioCliente> getPreciosCliente() { - return listaPrecioCliente; - } - - public void setPreciosCliente(List<PrecioCliente> listaPrecioCliente) { - this.listaPrecioCliente = listaPrecioCliente; - } - - @Transient - public List<PrecioCiudad> getPreciosCiudad() { - return listaPrecioCiudad; - } - - public void setPreciosCiudad(List<PrecioCiudad> listaPrecioCiudad) { - this.listaPrecioCiudad = listaPrecioCiudad; - } - - @Transient - public List<PrecioProvincia> getPreciosProvincia() { - return listaPrecioProvincia; - } - - public void setPreciosProvincia(List<PrecioProvincia> listaPrecioProvincia) { - this.listaPrecioProvincia=listaPrecioProvincia; - } - @Transient - public List<PrecioRegion> getPreciosRegion() { - return listaPrecioRegion; - } - - public void setPreciosRegion(List<PrecioRegion> listaPrecioRegion) { - this.listaPrecioRegion=listaPrecioRegion; - } - - @Transient - public File getImagen() { - return imagen; - } - - public void setImagen(File imagen) { - this.imagen = imagen; - } - - @Column(name="precio_itbis") - public BigDecimal getPrecioItbis() { - return precioItbis; - } - - public void setPrecioItbis(BigDecimal precioItbis) { - this.precioItbis = precioItbis; - } - - - @Transient - public BigDecimal getDescuento() { - return descuento; - } - - public void setDescuento(BigDecimal descuento) { - this.descuento = descuento; - } - - @Transient - public BigDecimal getDescuentoPor() { - return descuentoPor; - } - - public void setDescuentoPor(BigDecimal descuentoPor) { - this.descuentoPor = descuentoPor; - } - - @Transient - public BigDecimal getSubTotal() { - return subTotal; - } - - public void setSubTotal(BigDecimal subTotal) { - this.subTotal = subTotal; - } - - @Transient - public BigDecimal getTotal() { - return total; - } - - public void setTotal(BigDecimal total) { - this.total = total; - } - - - - - @Transient - public BigDecimal getItbisP(){ - return itbisP; - - } - public void setItbisP(BigDecimal it){ - itbisP=it; - } - - @Column(name="stock_fisico") - public BigDecimal getStockFisico() { - return stockFisico; - } - - public void setStockFisico(BigDecimal stockFisico) { - this.stockFisico = stockFisico; - } - - @Column(name="stock_min") - public BigDecimal getStockMinimo() { - return stockMinimo; - } - - public void setStockMinimo(BigDecimal stockMinimo) { - this.stockMinimo = stockMinimo; - } - - @Column(name="stock_max") - public BigDecimal getStockMaximo() { - return stockMaximo; - } - - public void setStockMaximo(BigDecimal stockMaximo) { - this.stockMaximo = stockMaximo; - } - - @Column(name="sin_stock") - public boolean isVentaSinStock() { - return ventaSinStock; - } - - public void setVentaSinStock(boolean ventaSinStock) { - this.ventaSinStock = ventaSinStock; - } - - /** - *Representa la lista de los stock que tiene un producto en particular. - */ - @OneToMany(mappedBy="producto",cascade=CascadeType.ALL) - public List<ProductoStock> getListaStockProducto() { - return listaStockProducto; - } - - public void setListaStockProducto(List<ProductoStock> listaStockProducto) { - this.listaStockProducto = listaStockProducto; - } - -} Modified: OpaloERP/src/mensaje_objetos/almacen/ProductoStock.java =================================================================== --- OpaloERP/src/mensaje_objetos/almacen/ProductoStock.java 2007-09-16 23:50:57 UTC (rev 38) +++ OpaloERP/src/mensaje_objetos/almacen/ProductoStock.java 2007-09-18 20:44:30 UTC (rev 39) @@ -19,6 +19,7 @@ import javax.persistence.OneToOne; import javax.persistence.SequenceGenerator; import javax.persistence.Table; +import mensaje_objetos.almacen.Producto; import org.hibernate.annotations.GenericGenerator; /** Modified: OpaloERP/src/mensaje_objetos/cliente/Direccion.java =================================================================== --- OpaloERP/src/mensaje_objetos/cliente/Direccion.java 2007-09-16 23:50:57 UTC (rev 38) +++ OpaloERP/src/mensaje_objetos/cliente/Direccion.java 2007-09-18 20:44:30 UTC (rev 39) @@ -45,7 +45,7 @@ this.descripcion = descripcion; } - @OneToOne(cascade=CascadeType.ALL) + @OneToOne() @JoinColumn(name="codigo_ciudad") public Ciudad getCiudad() { return ciudad; @@ -55,7 +55,7 @@ this.ciudad = ciudad; } - @OneToOne(cascade=CascadeType.ALL) + @OneToOne() @JoinColumn(name="codigo_provincia") public Provincia getProvincia() { return provincia; @@ -65,7 +65,7 @@ this.provincia = provincia; } - @OneToOne(cascade=CascadeType.ALL) + @OneToOne() @JoinColumn(name="codigo_pais") public Pais getPais() { return pais; Modified: OpaloERP/src/modelo_objetos/cliente/ModeloContacto.java =================================================================== --- OpaloERP/src/modelo_objetos/cliente/ModeloContacto.java 2007-09-16 23:50:57 UTC (rev 38) +++ OpaloERP/src/modelo_objetos/cliente/ModeloContacto.java 2007-09-18 20:44:30 UTC (rev 39) @@ -30,14 +30,11 @@ private static SubjectHelper subjectUpdate; private static SubjectHelper subjectSaveOrUpdate; - public ModeloContacto(){ - Conexion conn=Conexion.getConexion(); + public ModeloContacto(){ subjectAdd=new SubjectHelper(); subjectRemove=new SubjectHelper(); subjectUpdate=new SubjectHelper(); - subjectSaveOrUpdate=new SubjectHelper(); - ss=conn.getSession(); - + subjectSaveOrUpdate=new SubjectHelper(); } public static SubjectHelper getSubjectAdd(){ @@ -59,6 +56,7 @@ } public void addContacto(Contacto contacto){ + ss=Conexion.getSession(); Transaction tx=null; try { tx=ss.beginTransaction(); @@ -68,10 +66,14 @@ } catch (Exception e) { e.printStackTrace(); } - + finally + { + ss.close(); + } } public void removeContacto(Contacto contacto){ + ss=Conexion.getSession(); Transaction tx=null; try { tx=ss.beginTransaction(); @@ -81,38 +83,50 @@ } catch (Exception e) { e.printStackTrace(); } + finally + { + ss.close(); + } } /**Metodo para actualizar un cliente*/ public void updateContacto(Contacto contacto){ + ss=Conexion.getSession(); Transaction tx=ss.beginTransaction(); ss.saveOrUpdate(contacto); tx.commit(); subjectUpdate.notify(ModeloContacto.class,contacto,"updateContacto"); + ss.close(); } /**Metodo para actualizar o insertar*/ public void saveOrUpdate(Contacto contacto){ + ss=Conexion.getSession(); Transaction tx=ss.beginTransaction(); ss.saveOrUpdate(contacto); tx.commit(); - subjectUpdate.notify(ModeloContacto.class,contacto,"saveOrUpdateCliente"); + subjectUpdate.notify(ModeloContacto.class,contacto,"saveOrUpdateCliente"); + ss.close(); } /**Metodo para actualizar o insertar*/ public void save(Contacto contacto){ + ss=Conexion.getSession(); Transaction tx=ss.beginTransaction(); ss.save(contacto); tx.commit(); - subjectUpdate.notify(ModeloContacto.class,contacto,"saveOrUpdateCliente"); + subjectUpdate.notify(ModeloContacto.class,contacto,"saveOrUpdateCliente"); + ss.close(); } /**Metodo para consultar todos los clientes*/ public List getAllContactos(){ + ss=Conexion.getSession(); List contactos=null; String hql="FROM Contacto C"; Query query=ss.createQuery(hql); contactos=query.list(); + ss.close(); return contactos; } Modified: OpaloERP/src/modelo_objetos/proveedor/ModeloProveedor.java =================================================================== --- OpaloERP/src/modelo_objetos/proveedor/ModeloProveedor.java 2007-09-16 23:50:57 UTC (rev 38) +++ OpaloERP/src/modelo_objetos/proveedor/ModeloProveedor.java 2007-09-18 20:44:30 UTC (rev 39) @@ -119,7 +119,7 @@ /**Metodo para actualizar un proveedor*/ public void updateProveedor(Proveedor proveedor) { - Session ss=conn.getSession(); + Session ss=Conexion.getSession(); Transaction tx=ss.beginTransaction(); ss.merge(proveedor); tx.commit(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jos...@us...> - 2007-09-16 23:50:53
|
Revision: 38 http://opaloerp.svn.sourceforge.net/opaloerp/?rev=38&view=rev Author: jose_cruz64 Date: 2007-09-16 16:50:57 -0700 (Sun, 16 Sep 2007) Log Message: ----------- Funcionalidades agregadas: -Agregar nuevos proveedores -Agregar detalles generales al proveedor -Agregar direccion principal -Agrgar contacto principal -Agregar contactos secundarios -Agregar direcciones secundarias -Editar proveedores -Editar los datos generales del proveedor -Editar la direccion principal -Editar el contacto principal -Borrar proveedores -Borra en cascada todo lo relacionado al proveedor -Visualizar proveedores -Perite visualizar todo lo relacionado al proveedor seleccionada Funcionalidades removidas: -Ninguna en esta revision Funcionalidades pendientes para las proximas revisiones: -Agregar nuevos proveedores -Editar las direcciones secundarias -Borrar las direcciones secundarias -Asignar, editar, y remover productos para el proveedor -Editar proveedores -Editar las direcciones secundarias -Borrar las direcciones secundarias -Borrar direcciones y contactos en forma individual dentro de un proveedor -Asignar, editar, y remover productos para el proveedor Modified Paths: -------------- OpaloERP/src/frontend/cliente/DgDireccionCliente.form OpaloERP/src/frontend/cliente/DgDireccionCliente.java OpaloERP/src/frontend/proveedor/DgCrearProveedor.form OpaloERP/src/frontend/proveedor/DgCrearProveedor.java OpaloERP/src/frontend/proveedor/IAdministrarProveedor.form OpaloERP/src/mensaje_objetos/proveedor/Proveedor.java OpaloERP/src/modelo_objetos/proveedor/ModeloProveedor.java Modified: OpaloERP/src/frontend/cliente/DgDireccionCliente.form =================================================================== --- OpaloERP/src/frontend/cliente/DgDireccionCliente.form 2007-09-16 18:38:42 UTC (rev 37) +++ OpaloERP/src/frontend/cliente/DgDireccionCliente.form 2007-09-16 23:50:57 UTC (rev 38) @@ -3,7 +3,7 @@ <Form version="1.3" type="org.netbeans.modules.form.forminfo.JDialogFormInfo"> <Properties> <Property name="defaultCloseOperation" type="int" value="2"/> - <Property name="title" type="java.lang.String" value="Seleccionar Direccion Cliente"/> + <Property name="title" type="java.lang.String" value="Seleccionar Direccion"/> </Properties> <SyntheticProperties> <SyntheticProperty name="formSizePolicy" type="int" value="1"/> Modified: OpaloERP/src/frontend/cliente/DgDireccionCliente.java =================================================================== --- OpaloERP/src/frontend/cliente/DgDireccionCliente.java 2007-09-16 18:38:42 UTC (rev 37) +++ OpaloERP/src/frontend/cliente/DgDireccionCliente.java 2007-09-16 23:50:57 UTC (rev 38) @@ -87,7 +87,8 @@ * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents - private void initComponents() { + private void initComponents() + { jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); @@ -106,7 +107,7 @@ btnBuscarCiudad = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); - setTitle("Seleccionar Direccion Cliente"); + setTitle("Seleccionar Direccion"); jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); jLabel1.setText("Direccion"); @@ -121,8 +122,10 @@ btnCerrar.setMnemonic('C'); btnCerrar.setText("Cerrar"); - btnCerrar.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + btnCerrar.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { btnCerrarActionPerformed(evt); } }); @@ -130,23 +133,29 @@ btnSeleccionar.setFont(new java.awt.Font("Dialog", 0, 12)); btnSeleccionar.setMnemonic('S'); btnSeleccionar.setText("Seleccionar"); - btnSeleccionar.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + btnSeleccionar.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { btnSeleccionarActionPerformed(evt); } }); btnBuscarPais.setMnemonic('B'); btnBuscarPais.setText("Buscar..."); - btnBuscarPais.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + btnBuscarPais.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { btnBuscarPaisActionPerformed(evt); } }); btnBuscarProvincia.setText("Buscar..."); - btnBuscarProvincia.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + btnBuscarProvincia.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { btnBuscarProvinciaActionPerformed(evt); } }); @@ -154,15 +163,19 @@ jLabel5.setText("Region"); btnBuscarRegion.setText("Buscar..."); - btnBuscarRegion.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + btnBuscarRegion.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { btnBuscarRegionActionPerformed(evt); } }); btnBuscarCiudad.setText("Buscar..."); - btnBuscarCiudad.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + btnBuscarCiudad.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { btnBuscarCiudadActionPerformed(evt); } }); Modified: OpaloERP/src/frontend/proveedor/DgCrearProveedor.form =================================================================== --- OpaloERP/src/frontend/proveedor/DgCrearProveedor.form 2007-09-16 18:38:42 UTC (rev 37) +++ OpaloERP/src/frontend/proveedor/DgCrearProveedor.form 2007-09-16 23:50:57 UTC (rev 38) @@ -420,7 +420,7 @@ </Group> <EmptySpace max="-2" attributes="0"/> <Component id="btnInsertarDireccion" min="-2" max="-2" attributes="0"/> - <EmptySpace pref="51" max="32767" attributes="0"/> + <EmptySpace pref="49" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -440,8 +440,16 @@ <SubComponents> <Component class="javax.swing.JTextArea" name="areaDireccion"> <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="e5" green="cf" id="Button.shadow" palette="3" red="b8" type="palette"/> + </Property> <Property name="columns" type="int" value="20"/> <Property name="rows" type="int" value="5"/> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo"> + <LineBorder/> + </Border> + </Property> </Properties> </Component> </SubComponents> @@ -739,6 +747,9 @@ <Properties> <Property name="text" type="java.lang.String" value="Borrar"/> </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnBorrarDireccionActionPerformed"/> + </Events> </Component> <Component class="javax.swing.JButton" name="btnVisualizarDireccion"> <Properties> @@ -814,7 +825,7 @@ <EmptySpace max="-2" attributes="0"/> <Component id="jLabel22" min="-2" pref="137" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> - <Component id="cmbTipoBusquedaDirecciones1" pref="219" max="32767" attributes="0"/> + <Component id="cmbTipoBusquedaContactos" pref="219" max="32767" attributes="0"/> </Group> </Group> <EmptySpace max="-2" attributes="0"/> @@ -830,7 +841,7 @@ <Group type="103" groupAlignment="3" attributes="0"> <Component id="jLabel21" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="txtBuscarContacto" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="cmbTipoBusquedaDirecciones1" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="cmbTipoBusquedaContactos" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="jLabel22" alignment="3" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> @@ -865,6 +876,9 @@ <Properties> <Property name="text" type="java.lang.String" value="Borrar"/> </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnBorrarContactoActionPerformed"/> + </Events> </Component> <Component class="javax.swing.JButton" name="btnVisualizarContacto"> <Properties> @@ -888,7 +902,7 @@ <Property name="text" type="java.lang.String" value="Tipo de Busqueda:"/> </Properties> </Component> - <Component class="javax.swing.JComboBox" name="cmbTipoBusquedaDirecciones1"> + <Component class="javax.swing.JComboBox" name="cmbTipoBusquedaContactos"> <Properties> <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> <StringArray count="0"/> @@ -899,7 +913,7 @@ <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> <SubComponents> - <Component class="org.jdesktop.swingx.JXTable" name="jtbDireccion1"> + <Component class="org.jdesktop.swingx.JXTable" name="jtbContacto"> <Properties> <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> <Table columnCount="5" rowCount="0"> @@ -1074,6 +1088,9 @@ <Properties> <Property name="text" type="java.lang.String" value="Salvar->"/> </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnSalvarCerrarActionPerformed"/> + </Events> </Component> <Component class="javax.swing.JButton" name="btnSalvar"> <Properties> @@ -1087,6 +1104,9 @@ <Properties> <Property name="text" type="java.lang.String" value="Nuevo"/> </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnNuevoActionPerformed"/> + </Events> </Component> </SubComponents> </Form> Modified: OpaloERP/src/frontend/proveedor/DgCrearProveedor.java =================================================================== --- OpaloERP/src/frontend/proveedor/DgCrearProveedor.java 2007-09-16 18:38:42 UTC (rev 37) +++ OpaloERP/src/frontend/proveedor/DgCrearProveedor.java 2007-09-16 23:50:57 UTC (rev 38) @@ -8,6 +8,7 @@ import eventos.ContactoEvent; import eventos.DireccionEvent; +import eventos.IContactoListener; import eventos.IDireccionListener; import eventos.IProveedorListener; import eventos.ProveedorEvent; @@ -17,23 +18,32 @@ import java.util.ArrayList; import java.util.List; import javax.swing.JFrame; +import javax.swing.JOptionPane; import javax.swing.table.AbstractTableModel; import mensaje_objetos.almacen.Producto; import mensaje_objetos.cliente.Contacto; import mensaje_objetos.cliente.Direccion; import mensaje_objetos.proveedor.Proveedor; +import modelo_objetos.cliente.ModeloContacto; +import modelo_objetos.cliente.ModeloDireccion; import modelo_objetos.proveedor.ModeloProveedor; /** * * @author raymi */ -public class DgCrearProveedor extends javax.swing.JDialog implements IProveedorListener +public class DgCrearProveedor extends javax.swing.JDialog implements IProveedorListener, IDireccionListener, + IContactoListener { private Proveedor proveedorSeleccionado; + private Direccion direccionSeleccionada; + private Contacto contactoSeleccionado; private Proveedor proveedorNuevo; private DgDireccionCliente dgDireccionProveedor; private DgCrearContacto dgCrearContacto; + private Direccion dirPrincipal; + private Contacto conPrincipal; + private boolean direccionPrincipal; private List<Direccion> listaDirecciones; private List<Contacto> listaContactos; @@ -43,6 +53,16 @@ private List<Contacto> contactoTable = new ArrayList<Contacto>(); private List<Producto> productoTable = new ArrayList<Producto>(); + private ModeloProveedor modeloProveedor; + private ModeloDireccion modeloDireccion; + private ModeloContacto modeloContacto; + private AbstractTableModel modeloTablaDireccion; + private AbstractTableModel modeloTablaContacto; + private AbstractTableModel modeloTablaProducto; + + private static final String [] headersDireccion = {"Direccion", "Ciudad", "Provincia","Region", "Pais"}; + private static final String [] headersContacto = {"Contacto","Telefono1","Telefono2","Fax","Email"}; + //private DgArticulo dgArticulo; private int accion; /** Creates new form DgCrearProveedor */ @@ -51,12 +71,143 @@ super(parent, modal); initComponents(); inicializarComponentes(); + inicializarTablaDireccion(); + inicializarTablaContacto(); } + private void inicializarTablaContacto() + { + modeloTablaContacto=new AbstractTableModel() + { + public int getColumnCount() + { + return headersContacto.length; + } + public int getRowCount() + { + return contactoTable.size(); + } + public Object getValueAt(int rowIndex, int columnIndex) + { + if(contactoTable.size()>0) + { + Contacto contacto=contactoTable.get(rowIndex); + if(contacto!=null) + { + if(columnIndex==0) + { + return contacto.getNombre(); + } + if(columnIndex==1) + { + return contacto.getTelefono1(); + } + if(columnIndex==2) + { + return contacto.getTelefono2(); + } + if(columnIndex==3) + { + return contacto.getFax(); + } + if(columnIndex==4) + { + return contacto.getEmail(); + } + } + } + return ""; + } + public String getColumnName(int col) + { + return headersContacto[col]; + } + }; + jtbContacto.setModel(modeloTablaContacto); + modeloTablaContacto.fireTableDataChanged(); + + + } + + private void inicializarTablaDireccion() + { + modeloTablaDireccion=new AbstractTableModel() + { + public int getColumnCount() + { + return headersDireccion.length; + } + public int getRowCount() + { + return direccionTable.size(); + } + public Object getValueAt(int rowIndex, int columnIndex) + { + if(direccionTable.size()>0) + { + Direccion direccion=direccionTable.get(rowIndex); + if(direccion!=null) + { + if(columnIndex==0) + { + return direccion.getDescripcion(); + } + if(columnIndex==1) + { + if(direccion.getCiudad()!=null) + { + return direccion.getCiudad().getNombre(); + } + return ""; + } + if(columnIndex==2) + { + if(direccion.getProvincia()!=null) + { + return direccion.getProvincia().getNombre(); + } + return ""; + } + if(columnIndex==3) + { + if(direccion.getRegion()!=null) + { + return direccion.getRegion().getDescripcion(); + } + return ""; + } + if(columnIndex==4) + { + if(direccion.getPais()!=null) + { + return direccion.getPais().getNombre(); + } + return ""; + } + } + } + return ""; + } + public String getColumnName(int col) + { + return headersDireccion[col]; + } + }; + jtbTablaDireccion.setModel(modeloTablaDireccion); + modeloTablaDireccion.fireTableDataChanged(); + + + } + private void inicializarComponentes() { dgDireccionProveedor = new DgDireccionCliente(new JFrame(), true); + dgDireccionProveedor.addDireccionListener(this); dgCrearContacto = new DgCrearContacto(new JFrame(), true); + dgCrearContacto.addContactoListener(this); + modeloProveedor = ModeloProveedor.getInstance(); + modeloDireccion = ModeloDireccion.getInstance(); + modeloContacto = ModeloContacto.getInstance(); //dgArticulo = new DgArticulo(new JFrame(), true); } @@ -77,16 +228,18 @@ contactoTable=proveedorSeleccionado.getContactos(); productoTable=proveedorSeleccionado.getProductos(); - direccionTable=proveedorSeleccionado.getDirecciones(); - /** modeloTablaContacto.fireTableDataChanged(); - * modeloTablaSucursal.fireTableDataChanged(); - * modeloTablaDireccion.fireTableDataChanged(); - * modeloTablaDocumento.fireTableDataChanged();*/ + direccionTable=proveedorSeleccionado.getDirecciones(); + + modeloTablaDireccion.fireTableDataChanged(); + modeloTablaContacto.fireTableDataChanged(); + //modeloTablaProducto.fireTableDataChanged(); + setProveedor(); } setEnable(true); + btnNuevo.setEnabled(false); txtCodigo.setEnabled(false); } @@ -124,6 +277,7 @@ private void limpiarCampos() { + areaDireccion.setText(""); txtBuscarDireccion.setText(""); txtBuscarContacto.setText(""); txtBuscarProducto.setText(""); @@ -150,7 +304,7 @@ private void setProveedor() { - + limpiarCampos(); txtCodigo.setText(proveedorSeleccionado.getCodigo()); if(proveedorSeleccionado.getRnc()!=null) @@ -198,25 +352,25 @@ { if(proveedorSeleccionado.getDirecciones().size()>0) { - Direccion dir=proveedorSeleccionado.getDirecciones().get(0); - if(dir!=null) + dirPrincipal = proveedorSeleccionado.getDirecciones().get(0); + if(dirPrincipal!=null) { - if(dir.getCiudad()!=null) + if(dirPrincipal.getCiudad()!=null) { - lblCiudad.setText(dir.getCiudad().getNombre()); + lblCiudad.setText(dirPrincipal.getCiudad().getNombre()); } - areaDireccion.setText(dir.getDescripcion()); - if(dir.getPais()!=null) + areaDireccion.setText(dirPrincipal.getDescripcion()); + if(dirPrincipal.getPais()!=null) { - lblPais.setText(dir.getPais().getNombre()); + lblPais.setText(dirPrincipal.getPais().getNombre()); } - if(dir.getProvincia()!=null) + if(dirPrincipal.getProvincia()!=null) { - lblProvincia.setText(dir.getProvincia().getNombre()); + lblProvincia.setText(dirPrincipal.getProvincia().getNombre()); } - if(dir.getRegion()!=null) + if(dirPrincipal.getRegion()!=null) { - lblRegion.setText(dir.getRegion().getDescripcion()); + lblRegion.setText(dirPrincipal.getRegion().getDescripcion()); } } } @@ -245,7 +399,7 @@ rbtnContado.setEnabled(ena); rbtnCredito.setEnabled(ena); rbtnRNC.setEnabled(ena); - areaDireccion.setEditable(ena); + areaDireccion.setEditable(false); txtCargo.setEnabled(ena); txtCodigo.setEnabled(ena); txtDocumento.setEnabled(ena); @@ -263,68 +417,129 @@ } public void execute() - { - ModeloProveedor modeloProveedor = ModeloProveedor.getInstance(); + { if(accion == ProveedorEvent.NUEVO) { Proveedor p = new Proveedor(); - if(rbtnCedula.isSelected()) - { - p.setCedula(txtDocumento.getText()); - p.setRnc(""); - } - else - { - p.setRnc(txtDocumento.getText()); - p.setCedula(""); - } - p.setCodigo(txtCodigo.getText()); - p.setLimiteDeCredito(Double.parseDouble(txtLimitCred.getText())); - p.setLimiteDias(BigInteger.valueOf(Long.parseLong(txtLimitDias.getText()))); - p.setNombre(txtNombre.getText()); - p.setPorcMora(new Float(txtMora.getText())); - if(rbtnContado.isSelected()) - { - p.setTipoDePago("Contado"); - } - else - { - p.setTipoDePago("Credito"); - } - - Direccion dir = new Direccion(); + this.setProveedorData(p); + this.setDireccionPrincipal(p); + this.setContactoPrincipal(p); modeloProveedor.addProveedor(p); } else if(accion == ProveedorEvent.EDITAR) { Proveedor p = this.proveedorSeleccionado; - if(rbtnCedula.isSelected()) - { - p.setCedula(txtDocumento.getText()); - p.setRnc(""); - } - else - { - p.setRnc(txtDocumento.getText()); - p.setCedula(""); - } - p.setCodigo(txtCodigo.getText()); - p.setLimiteDeCredito(Double.parseDouble(txtLimitCred.getText())); - p.setLimiteDias(BigInteger.valueOf(Long.parseLong(txtLimitDias.getText()))); - p.setNombre(txtNombre.getText()); - p.setPorcMora(new Float(txtMora.getText())); - if(rbtnContado.isSelected()) - { - p.setTipoDePago("Contado"); - } - else - { - p.setTipoDePago("Credito"); - } + this.setProveedorData(p); + this.setDireccionPrincipal(p); + this.setContactoPrincipal(p); modeloProveedor.updateProveedor(p); } - } - + } + + private void setProveedorData(Proveedor p) + { + + if(rbtnCedula.isSelected()) + { + p.setCedula(txtDocumento.getText()); + p.setRnc(""); + } + else + { + p.setRnc(txtDocumento.getText()); + p.setCedula(""); + } + p.setCodigo(txtCodigo.getText()); + p.setLimiteDeCredito(Double.parseDouble(txtLimitCred.getText())); + p.setLimiteDias(BigInteger.valueOf(Long.parseLong(txtLimitDias.getText()))); + p.setNombre(txtNombre.getText()); + p.setPorcMora(new Float(txtMora.getText())); + if(rbtnContado.isSelected()) + { + p.setTipoDePago("Contado"); + } + else + { + p.setTipoDePago("Credito"); + } + + } + + public Contacto getSelectedContacto() + { + Contacto contacto=null; + int arow=jtbContacto.getSelectedRow(); + if(arow!=-1) + { + int row=jtbContacto.convertRowIndexToModel(arow); + contacto = contactoTable.get(row); + } + return contacto; + } + + public Direccion getSelectedDireccion() + { + Direccion direccion=null; + int arow=jtbTablaDireccion.getSelectedRow(); + if(arow!=-1) + { + int row=jtbTablaDireccion.convertRowIndexToModel(arow); + direccion = direccionTable.get(row); + } + return direccion; + } + + private void setDireccionPrincipal(Proveedor p) + { + List<Direccion> direcciones = p.getDirecciones(); + direcciones.set(0, dirPrincipal); + } + + private void setContactoPrincipal(Proveedor p) + { + List<Contacto> contactos = p.getContactos(); + + conPrincipal = new Contacto(); + conPrincipal.setCargo(txtCargo.getText()); + conPrincipal.setEmail(txtEmail.getText()); + conPrincipal.setFax(txtFax.getText()); + conPrincipal.setNombre(txtNombreContacto.getText()); + conPrincipal.setTelefono1(txtTelefono1.getText()); + conPrincipal.setTelefono2(txtTelefono2.getText()); + contactos.set(0, conPrincipal); + } + + public void fireDireccion(DireccionEvent direccion) + { + Direccion dir = direccion.getDireccion(); + if(direccionPrincipal) + { + dirPrincipal = dir; + areaDireccion.setText(dir.getDescripcion()); + lblCiudad.setText(dir.getCiudad().getNombre()); + lblPais.setText(dir.getPais().getNombre()); + lblProvincia.setText(dir.getProvincia().getNombre()); + lblRegion.setText(dir.getRegion().getDescripcion()); + } + else + { + List<Direccion> direcciones = proveedorSeleccionado.getDirecciones(); + if(!direcciones.contains(dir)) direcciones.add(dir); + else direcciones.set(direcciones.indexOf(dir), dir); + + } + this.inicializarTablaDireccion(); + } + + public void fireContacto(ContactoEvent contacto) + { + List<Contacto> contactos = proveedorSeleccionado.getContactos(); + Contacto con = contacto.getContacto(); + if(!contactos.contains(con)) contactos.add(con); + else contactos.set(contactos.indexOf(con), con); + this.inicializarTablaContacto(); + } + /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is @@ -403,9 +618,9 @@ jLabel21 = new javax.swing.JLabel(); txtBuscarContacto = new javax.swing.JTextField(); jLabel22 = new javax.swing.JLabel(); - cmbTipoBusquedaDirecciones1 = new javax.swing.JComboBox(); + cmbTipoBusquedaContactos = new javax.swing.JComboBox(); jScrollPane3 = new javax.swing.JScrollPane(); - jtbDireccion1 = new org.jdesktop.swingx.JXTable(); + jtbContacto = new org.jdesktop.swingx.JXTable(); jPanel3 = new javax.swing.JPanel(); btnBuscarProducto = new javax.swing.JButton(); jLabel23 = new javax.swing.JLabel(); @@ -530,8 +745,10 @@ jpanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Direccion Principal", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 11), new java.awt.Color(51, 102, 255))); jLabel8.setText("Direccion:"); + areaDireccion.setBackground(javax.swing.UIManager.getDefaults().getColor("Button.shadow")); areaDireccion.setColumns(20); areaDireccion.setRows(5); + areaDireccion.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); jScrollPane1.setViewportView(areaDireccion); jLabel9.setText("Ciudad:"); @@ -626,7 +843,7 @@ .addComponent(lblProvincia)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnInsertarDireccion) - .addContainerGap(51, Short.MAX_VALUE)) + .addContainerGap(49, Short.MAX_VALUE)) ); jpanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {lblCiudad, lblPais, lblProvincia, lblRegion}); @@ -781,6 +998,14 @@ jToolBar1.add(btnEditDireccion); btnBorrarDireccion.setText("Borrar"); + btnBorrarDireccion.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { + btnBorrarDireccionActionPerformed(evt); + } + }); + jToolBar1.add(btnBorrarDireccion); btnVisualizarDireccion.setText("Visualizar"); @@ -880,6 +1105,14 @@ jToolBar2.add(btnEditContacto); btnBorrarContacto.setText("Borrar"); + btnBorrarContacto.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { + btnBorrarContactoActionPerformed(evt); + } + }); + jToolBar2.add(btnBorrarContacto); btnVisualizarContacto.setText("Visualizar"); @@ -897,7 +1130,7 @@ jLabel22.setText("Tipo de Busqueda:"); - jtbDireccion1.setModel(new javax.swing.table.DefaultTableModel( + jtbContacto.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { @@ -918,7 +1151,7 @@ return canEdit [columnIndex]; } }); - jScrollPane3.setViewportView(jtbDireccion1); + jScrollPane3.setViewportView(jtbContacto); javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11); jPanel11.setLayout(jPanel11Layout); @@ -936,7 +1169,7 @@ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel22, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(cmbTipoBusquedaDirecciones1, 0, 219, Short.MAX_VALUE))) + .addComponent(cmbTipoBusquedaContactos, 0, 219, Short.MAX_VALUE))) .addContainerGap()) ); jPanel11Layout.setVerticalGroup( @@ -948,7 +1181,7 @@ .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel21) .addComponent(txtBuscarContacto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(cmbTipoBusquedaDirecciones1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(cmbTipoBusquedaContactos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel22)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 334, Short.MAX_VALUE) @@ -1057,6 +1290,13 @@ }); btnSalvarCerrar.setText("Salvar->"); + btnSalvarCerrar.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { + btnSalvarCerrarActionPerformed(evt); + } + }); btnSalvar.setText("Salvar"); btnSalvar.addActionListener(new java.awt.event.ActionListener() @@ -1068,6 +1308,13 @@ }); btnNuevo.setText("Nuevo"); + btnNuevo.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { + btnNuevoActionPerformed(evt); + } + }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); @@ -1116,19 +1363,80 @@ ); pack(); }// </editor-fold>//GEN-END:initComponents + + private void btnBorrarContactoActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnBorrarContactoActionPerformed + {//GEN-HEADEREND:event_btnBorrarContactoActionPerformed + contactoSeleccionado = getSelectedContacto(); + if(contactoSeleccionado != null) + { + int respuesta = JOptionPane.showInternalConfirmDialog(this, "\u00bfEst\u00e1 seguro de que desea" + + " eliminar este contacto", "Confirmar borrado de contacto", + JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); + if(respuesta == JOptionPane.OK_OPTION) + { + modeloContacto.removeContacto(contactoSeleccionado); + contactoSeleccionado = null; + this.inicializarTablaContacto(); + } + } + else + { + JOptionPane.showInternalMessageDialog(this,"Debes elegir un contacto" + + " para realizar esta operaci\u00f3n", "Seleccione un contacto", JOptionPane.WARNING_MESSAGE); + } + }//GEN-LAST:event_btnBorrarContactoActionPerformed + + private void btnBorrarDireccionActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnBorrarDireccionActionPerformed + {//GEN-HEADEREND:event_btnBorrarDireccionActionPerformed + direccionSeleccionada = getSelectedDireccion(); + if(direccionSeleccionada != null) + { + int respuesta = JOptionPane.showInternalConfirmDialog(this, "\u00bfEst\u00e1 seguro de que desea" + + " eliminar esta direccion", "Confirmar borrado de direccion", + JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); + if(respuesta == JOptionPane.OK_OPTION) + { + modeloDireccion.removeDireccion(direccionSeleccionada); + direccionSeleccionada = null; + this.inicializarTablaDireccion(); + } + } + else + { + JOptionPane.showInternalMessageDialog(this,"Debes elegir un direccion" + + " para realizar esta operaci\u00f3n", "Seleccione un direccion", JOptionPane.WARNING_MESSAGE); + } + }//GEN-LAST:event_btnBorrarDireccionActionPerformed + private void btnNuevoActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnNuevoActionPerformed + {//GEN-HEADEREND:event_btnNuevoActionPerformed + limpiarCampos(); + }//GEN-LAST:event_btnNuevoActionPerformed + + private void btnSalvarCerrarActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnSalvarCerrarActionPerformed + {//GEN-HEADEREND:event_btnSalvarCerrarActionPerformed + execute(); + dispose(); + }//GEN-LAST:event_btnSalvarCerrarActionPerformed + private void btnInsertarDireccionActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnInsertarDireccionActionPerformed {//GEN-HEADEREND:event_btnInsertarDireccionActionPerformed - + direccionPrincipal=true; + dgDireccionProveedor=new DgDireccionCliente(new JFrame(),true); + DireccionEvent dv = new DireccionEvent(); + dv.setId(DireccionEvent.NUEVO); + dgDireccionProveedor.fireDireccion(dv); + dgDireccionProveedor.setVisible(true); }//GEN-LAST:event_btnInsertarDireccionActionPerformed private void btnSalvarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalvarActionPerformed - this.execute(); + execute(); }//GEN-LAST:event_btnSalvarActionPerformed private void btnVisualizarContactoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnVisualizarContactoActionPerformed ContactoEvent cv = new ContactoEvent(); cv.setId(ContactoEvent.VISUALIZAR); + cv.setContacto(getSelectedContacto()); dgCrearContacto.fireContacto(cv); dgCrearContacto.setVisible(true); }//GEN-LAST:event_btnVisualizarContactoActionPerformed @@ -1136,6 +1444,7 @@ private void btnEditContactoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEditContactoActionPerformed ContactoEvent cv = new ContactoEvent(); cv.setId(ContactoEvent.EDITAR); + cv.setContacto(getSelectedContacto()); dgCrearContacto.fireContacto(cv); dgCrearContacto.setVisible(true); }//GEN-LAST:event_btnEditContactoActionPerformed @@ -1143,6 +1452,7 @@ private void btnVisualizarDireccionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnVisualizarDireccionActionPerformed DireccionEvent dv = new DireccionEvent(); dv.setId(DireccionEvent.VISUALIZAR); + dv.setDireccion(getSelectedDireccion()); dgDireccionProveedor.fireDireccion(dv); dgDireccionProveedor.setVisible(true); }//GEN-LAST:event_btnVisualizarDireccionActionPerformed @@ -1150,6 +1460,7 @@ private void btnEditDireccionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEditDireccionActionPerformed DireccionEvent dv = new DireccionEvent(); dv.setId(DireccionEvent.EDITAR); + dv.setDireccion(getSelectedDireccion()); dgDireccionProveedor.fireDireccion(dv); dgDireccionProveedor.setVisible(true); }//GEN-LAST:event_btnEditDireccionActionPerformed @@ -1162,6 +1473,7 @@ }//GEN-LAST:event_btnNuevoContactoActionPerformed private void btnNuevoDireccionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNuevoDireccionActionPerformed + direccionPrincipal = false; DireccionEvent dv = new DireccionEvent(); dv.setId(DireccionEvent.NUEVO); dgDireccionProveedor.fireDireccion(dv); @@ -1169,7 +1481,7 @@ }//GEN-LAST:event_btnNuevoDireccionActionPerformed private void btnCerrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCerrarActionPerformed - this.dispose(); + dispose(); }//GEN-LAST:event_btnCerrarActionPerformed @@ -1191,8 +1503,8 @@ private javax.swing.JButton btnSalvarCerrar; private javax.swing.JButton btnVisualizarContacto; private javax.swing.JButton btnVisualizarDireccion; + private javax.swing.JComboBox cmbTipoBusquedaContactos; private javax.swing.JComboBox cmbTipoBusquedaDirecciones; - private javax.swing.JComboBox cmbTipoBusquedaDirecciones1; private javax.swing.JComboBox cmbTipoBusquedaProducto; private javax.swing.ButtonGroup grpTipoDoc; private javax.swing.ButtonGroup grpTipoPago; @@ -1236,7 +1548,7 @@ private javax.swing.JToolBar jToolBar1; private javax.swing.JToolBar jToolBar2; private javax.swing.JPanel jpanel1; - private org.jdesktop.swingx.JXTable jtbDireccion1; + private org.jdesktop.swingx.JXTable jtbContacto; private org.jdesktop.swingx.JXTable jtbProductos; private org.jdesktop.swingx.JXTable jtbTablaDireccion; private javax.swing.JLabel lblCiudad; Modified: OpaloERP/src/frontend/proveedor/IAdministrarProveedor.form =================================================================== --- OpaloERP/src/frontend/proveedor/IAdministrarProveedor.form 2007-09-16 18:38:42 UTC (rev 37) +++ OpaloERP/src/frontend/proveedor/IAdministrarProveedor.form 2007-09-16 23:50:57 UTC (rev 38) @@ -29,7 +29,7 @@ <EmptySpace max="-2" attributes="0"/> <Component id="jLabel2" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> - <Component id="cmbTipoBusqueda" pref="135" max="32767" attributes="0"/> + <Component id="cmbTipoBusqueda" pref="144" max="32767" attributes="0"/> </Group> </Group> <EmptySpace max="-2" attributes="0"/> Modified: OpaloERP/src/mensaje_objetos/proveedor/Proveedor.java =================================================================== --- OpaloERP/src/mensaje_objetos/proveedor/Proveedor.java 2007-09-16 18:38:42 UTC (rev 37) +++ OpaloERP/src/mensaje_objetos/proveedor/Proveedor.java 2007-09-16 23:50:57 UTC (rev 38) @@ -12,9 +12,9 @@ import java.io.Serializable; import java.math.BigInteger; import java.util.List; +import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; -import javax.persistence.FetchType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.JoinTable; @@ -72,12 +72,12 @@ @Column(name = "tipo_de_pago") private String tipoDePago; - @OneToMany() + @OneToMany(cascade=CascadeType.ALL) @JoinTable(name="proveedor_contacto",joinColumns={@JoinColumn(name="codigo_proveedor")}, inverseJoinColumns={@JoinColumn(name="codigo_contacto")}) private List<Contacto> contactos; - @OneToMany() + @OneToMany(cascade=CascadeType.ALL) @JoinTable(name="proveedor_direccion",joinColumns={@JoinColumn(name="codigo_proveedor")}, inverseJoinColumns={@JoinColumn(name="codigo_direccion")}) private List<Direccion> direcciones; Modified: OpaloERP/src/modelo_objetos/proveedor/ModeloProveedor.java =================================================================== --- OpaloERP/src/modelo_objetos/proveedor/ModeloProveedor.java 2007-09-16 18:38:42 UTC (rev 37) +++ OpaloERP/src/modelo_objetos/proveedor/ModeloProveedor.java 2007-09-16 23:50:57 UTC (rev 38) @@ -11,7 +11,6 @@ import java.util.ArrayList; import java.util.List; -import mensaje_objetos.comunes.Secuencia; import mensaje_objetos.proveedor.Proveedor; import modelo_objetos.acceso_datos.Conexion; import org.hibernate.Query; @@ -78,7 +77,7 @@ return subjectMensaje; } - /**Metodo para insertar un Grupo*/ + /**Metodo para insertar un Proveedor*/ public void addProveedor(Proveedor proveedor){ if(!existProveedor(proveedor)){ Session sl=conn.getSession(); @@ -92,7 +91,7 @@ } } - /**Metodo para borrar un grupo*/ + /**Metodo para borrar un proveedor*/ public void removeProveedor(Proveedor proveedor) { Session sl=conn.getSession(); Transaction tx=sl.beginTransaction(); @@ -102,7 +101,7 @@ getSubjectRemove().notify(ModeloProveedor.class,proveedor,"removeProveedor"); } - /**Metodo para saber si un grupo esta registrado*/ + /**Metodo para saber si un proveedor esta registrado*/ private boolean existProveedor(Proveedor proveedor) { Session ss=conn.getSession(); String hql="From Proveedor P WHERE P.codigo=?"; @@ -118,11 +117,10 @@ } - /**Metodo para actualizar un grupo*/ + /**Metodo para actualizar un proveedor*/ public void updateProveedor(Proveedor proveedor) { Session ss=conn.getSession(); Transaction tx=ss.beginTransaction(); - //sn.update(grupo); ss.merge(proveedor); tx.commit(); ss.close(); @@ -141,7 +139,7 @@ getSubjectUpdate().notify(ModeloProveedor.class,proveedor,"saveOrUpdateProveedor"); } - /**Metodo para consultar todos los clientes*/ + /**Metodo para consultar todos los proveedores*/ public List<Proveedor> getAllProveedores() { List<Proveedor> proveedors=new ArrayList(); String hql="FROM Proveedor P"; @@ -165,7 +163,7 @@ - /**Metodo para consultar cliente por codigo*/ + /**Metodo para consultar proveedor por codigo*/ public List<Proveedor> getProveedorPorCodigo(List<Proveedor> lista,String patronCodigo) { List<Proveedor> proveedors=new ArrayList(); for(Proveedor k:lista) { @@ -179,6 +177,8 @@ } return proveedors; } + + /**Metodo para consultar proveedor por nombre*/ public List<Proveedor> getProveedorPorNombre(List<Proveedor> lista,String patronNombre) { List<Proveedor> proveedors=new ArrayList(); @@ -196,6 +196,7 @@ return proveedors; } + /**Metodo para consultar proveedor por Rnc*/ public List<Proveedor> getProveedorPorRnc(List<Proveedor> lista,String patronNombre) { List<Proveedor> proveedors=new ArrayList(); @@ -213,6 +214,7 @@ return proveedors; } + /**Metodo para consultar proveedor por Cedula*/ public List<Proveedor> getProveedorPorCedula(List<Proveedor> lista,String patronNombre) { List<Proveedor> proveedors=new ArrayList(); @@ -230,7 +232,8 @@ return proveedors; } - public List<Proveedor> getProveedorPorLimiteDeCredito(List<Proveedor> lista,String patronNombre) { + /**Metodo para consultar proveedor por Limite de credito*/ + public List<Proveedor> getProveedorPorLimiteDeCredito(List<Proveedor> lista,String patronNombre) { List<Proveedor> proveedors=new ArrayList(); for(Proveedor k:lista) { @@ -247,6 +250,7 @@ return proveedors; } + /**Metodo para consultar proveedor por Limite de dias*/ public List<Proveedor> getProveedorPorLimiteDeDias(List<Proveedor> lista,String patronNombre) { List<Proveedor> proveedors=new ArrayList(); @@ -264,6 +268,7 @@ return proveedors; } + /**Metodo para consultar proveedor por porcentaje de mora*/ public List<Proveedor> getProveedorPorPorcentajeDeMora(List<Proveedor> lista,String patronNombre) { List<Proveedor> proveedors=new ArrayList(); @@ -281,28 +286,5 @@ return proveedors; } - public Secuencia getSecuencia() { - Session ss=conn.getSession(); - Transaction tx=ss.beginTransaction(); - String hql="From Secuencia S where S.tabla=?"; - Query que=ss.createQuery(hql); - que.setString(0,"Proveedor"); - List<Secuencia> secs=que.list(); - Secuencia sec0=secs.get(0); - ss.close(); - return sec0; - } - public void updateSecuencia(int valor) { - Session ss=conn.getSession(); - Transaction tx=ss.beginTransaction(); - Secuencia sec0=new Secuencia(); - sec0.setSecuencia(valor); - sec0.setTabla("Proveedor"); - ss.update(sec0); - tx.commit(); - ss.close(); - } - - } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ang...@us...> - 2007-09-16 18:38:44
|
Revision: 37 http://opaloerp.svn.sourceforge.net/opaloerp/?rev=37&view=rev Author: angelblanco Date: 2007-09-16 11:38:42 -0700 (Sun, 16 Sep 2007) Log Message: ----------- "" Modified Paths: -------------- OpaloERP/src/frontend/proveedor/DgCrearProveedor.form OpaloERP/src/frontend/proveedor/DgCrearProveedor.java OpaloERP/src/frontend/proveedor/IAdministrarProveedor.form OpaloERP/src/frontend/proveedor/IAdministrarProveedor.java Modified: OpaloERP/src/frontend/proveedor/DgCrearProveedor.form =================================================================== --- OpaloERP/src/frontend/proveedor/DgCrearProveedor.form 2007-09-15 20:10:41 UTC (rev 36) +++ OpaloERP/src/frontend/proveedor/DgCrearProveedor.form 2007-09-16 18:38:42 UTC (rev 37) @@ -522,6 +522,9 @@ <Properties> <Property name="text" type="java.lang.String" value="Insertar+"/> </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnInsertarDireccionActionPerformed"/> + </Events> </Component> </SubComponents> </Container> @@ -770,7 +773,7 @@ <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> <SubComponents> - <Component class="org.jdesktop.swingx.JXTable" name="jtbDireccion"> + <Component class="org.jdesktop.swingx.JXTable" name="jtbTablaDireccion"> <Properties> <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> <Table columnCount="5" rowCount="0"> Modified: OpaloERP/src/frontend/proveedor/DgCrearProveedor.java =================================================================== --- OpaloERP/src/frontend/proveedor/DgCrearProveedor.java 2007-09-15 20:10:41 UTC (rev 36) +++ OpaloERP/src/frontend/proveedor/DgCrearProveedor.java 2007-09-16 18:38:42 UTC (rev 37) @@ -8,6 +8,7 @@ import eventos.ContactoEvent; import eventos.DireccionEvent; +import eventos.IDireccionListener; import eventos.IProveedorListener; import eventos.ProveedorEvent; import frontend.cliente.DgCrearContacto; @@ -16,20 +17,19 @@ import java.util.ArrayList; import java.util.List; import javax.swing.JFrame; +import javax.swing.table.AbstractTableModel; import mensaje_objetos.almacen.Producto; import mensaje_objetos.cliente.Contacto; import mensaje_objetos.cliente.Direccion; import mensaje_objetos.proveedor.Proveedor; -import modelo_objetos.acceso_datos.Conexion; import modelo_objetos.proveedor.ModeloProveedor; -import org.hibernate.Session; /** * * @author raymi */ -public class DgCrearProveedor extends javax.swing.JDialog implements IProveedorListener { - +public class DgCrearProveedor extends javax.swing.JDialog implements IProveedorListener +{ private Proveedor proveedorSeleccionado; private Proveedor proveedorNuevo; private DgDireccionCliente dgDireccionProveedor; @@ -46,33 +46,38 @@ //private DgArticulo dgArticulo; private int accion; /** Creates new form DgCrearProveedor */ - public DgCrearProveedor(java.awt.Frame parent, boolean modal) { + public DgCrearProveedor(java.awt.Frame parent, boolean modal) + { super(parent, modal); initComponents(); inicializarComponentes(); } - private void inicializarComponentes() { + private void inicializarComponentes() + { dgDireccionProveedor = new DgDireccionCliente(new JFrame(), true); dgCrearContacto = new DgCrearContacto(new JFrame(), true); //dgArticulo = new DgArticulo(new JFrame(), true); } - public void fireProveedor(ProveedorEvent pv) { + public void fireProveedor(ProveedorEvent pv) + { proveedorSeleccionado=pv.getProveedor(); - if(pv!=null) { + if(pv!=null) + { accion=pv.getId(); - if(pv.getId()==ProveedorEvent.EDITAR) { + if(pv.getId()==ProveedorEvent.EDITAR) + { - if(proveedorSeleccionado!=null) { + if(proveedorSeleccionado!=null) + { listaContactos=proveedorSeleccionado.getContactos(); listaProductos=proveedorSeleccionado.getProductos(); listaDirecciones=proveedorSeleccionado.getDirecciones(); contactoTable=proveedorSeleccionado.getContactos(); productoTable=proveedorSeleccionado.getProductos(); - direccionTable=proveedorSeleccionado.getDirecciones(); - + direccionTable=proveedorSeleccionado.getDirecciones(); /** modeloTablaContacto.fireTableDataChanged(); * modeloTablaSucursal.fireTableDataChanged(); * modeloTablaDireccion.fireTableDataChanged(); @@ -82,9 +87,13 @@ } setEnable(true); + txtCodigo.setEnabled(false); + } - if(pv.getId()==ProveedorEvent.VISUALIZAR) { - if(proveedorSeleccionado!=null) { + if(pv.getId()==ProveedorEvent.VISUALIZAR) + { + if(proveedorSeleccionado!=null) + { listaContactos=proveedorSeleccionado.getContactos(); listaProductos=proveedorSeleccionado.getProductos(); listaDirecciones=proveedorSeleccionado.getDirecciones(); @@ -102,7 +111,8 @@ } setEnable(false); } - if(pv.getId()==ProveedorEvent.NUEVO) { + if(pv.getId()==ProveedorEvent.NUEVO) + { limpiarCampos(); setEnable(true); @@ -112,7 +122,8 @@ } } - private void limpiarCampos() { + private void limpiarCampos() + { txtBuscarDireccion.setText(""); txtBuscarContacto.setText(""); txtBuscarProducto.setText(""); @@ -137,19 +148,24 @@ } - private void setProveedor() { + private void setProveedor() + { txtCodigo.setText(proveedorSeleccionado.getCodigo()); - if(proveedorSeleccionado.getRnc()!=null) { + if(proveedorSeleccionado.getRnc()!=null) + { rbtnRNC.setSelected(true); txtDocumento.setText(proveedorSeleccionado.getRnc()); - } else { + } + else + { rbtnCedula.setSelected(true); txtDocumento.setText(proveedorSeleccionado.getCedula()); } - if(proveedorSeleccionado.getTipoDePago()!= null) { + if(proveedorSeleccionado.getTipoDePago()!= null) + { if(proveedorSeleccionado.getTipoDePago().equals("Credito")) rbtnCredito.setSelected(true); else @@ -161,10 +177,13 @@ txtMora.setText("" + proveedorSeleccionado.getPorcMora()); txtNombre.setText(proveedorSeleccionado.getNombre()); - if(proveedorSeleccionado.getContactos()!=null) { - if(proveedorSeleccionado.getContactos().size()>0) { + if(proveedorSeleccionado.getContactos()!=null) + { + if(proveedorSeleccionado.getContactos().size()>0) + { Contacto cont=proveedorSeleccionado.getContactos().get(0); - if(cont!=null) { + if(cont!=null) + { txtNombreContacto.setText(cont.getNombre()); txtTelefono1.setText(cont.getTelefono1()); txtTelefono2.setText(cont.getTelefono2()); @@ -175,21 +194,28 @@ } } - if(proveedorSeleccionado.getDirecciones()!=null) { - if(proveedorSeleccionado.getDirecciones().size()>0) { + if(proveedorSeleccionado.getDirecciones()!=null) + { + if(proveedorSeleccionado.getDirecciones().size()>0) + { Direccion dir=proveedorSeleccionado.getDirecciones().get(0); - if(dir!=null) { - if(dir.getCiudad()!=null) { + if(dir!=null) + { + if(dir.getCiudad()!=null) + { lblCiudad.setText(dir.getCiudad().getNombre()); } areaDireccion.setText(dir.getDescripcion()); - if(dir.getPais()!=null) { + if(dir.getPais()!=null) + { lblPais.setText(dir.getPais().getNombre()); } - if(dir.getProvincia()!=null) { + if(dir.getProvincia()!=null) + { lblProvincia.setText(dir.getProvincia().getNombre()); } - if(dir.getRegion()!=null) { + if(dir.getRegion()!=null) + { lblRegion.setText(dir.getRegion().getDescripcion()); } } @@ -201,7 +227,8 @@ } - private void setEnable(boolean ena) { + private void setEnable(boolean ena) + { btnBorrarContacto.setEnabled(ena); btnBorrarDireccion.setEnabled(ena); btnBuscarProducto.setEnabled(ena); @@ -219,30 +246,85 @@ rbtnCredito.setEnabled(ena); rbtnRNC.setEnabled(ena); areaDireccion.setEditable(ena); + txtCargo.setEnabled(ena); + txtCodigo.setEnabled(ena); + txtDocumento.setEnabled(ena); + txtEmail.setEnabled(ena); + txtFax.setEnabled(ena); + txtLimitCred.setEnabled(ena); + txtLimitDias.setEnabled(ena); + txtMora.setEnabled(ena); + txtNombre.setEnabled(ena); + txtNombreContacto.setEnabled(ena); + txtPrecio.setEnabled(ena); + txtProductoSeleccionado.setEnabled(ena); + txtTelefono1.setEnabled(ena); + txtTelefono2.setEnabled(ena); } - public void execute() { - ModeloProveedor modelo = ModeloProveedor.getInstance(); - if(accion == ProveedorEvent.NUEVO) { + public void execute() + { + ModeloProveedor modeloProveedor = ModeloProveedor.getInstance(); + if(accion == ProveedorEvent.NUEVO) + { Proveedor p = new Proveedor(); - if(rbtnCedula.isSelected()) { + if(rbtnCedula.isSelected()) + { p.setCedula(txtDocumento.getText()); - } else { + p.setRnc(""); + } + else + { p.setRnc(txtDocumento.getText()); + p.setCedula(""); } p.setCodigo(txtCodigo.getText()); p.setLimiteDeCredito(Double.parseDouble(txtLimitCred.getText())); p.setLimiteDias(BigInteger.valueOf(Long.parseLong(txtLimitDias.getText()))); p.setNombre(txtNombre.getText()); p.setPorcMora(new Float(txtMora.getText())); - if(rbtnContado.isSelected()) { + if(rbtnContado.isSelected()) + { p.setTipoDePago("Contado"); - } else { + } + else + { p.setTipoDePago("Credito"); } - modelo.addProveedor(p); + + Direccion dir = new Direccion(); + modeloProveedor.addProveedor(p); } - } + else if(accion == ProveedorEvent.EDITAR) + { + Proveedor p = this.proveedorSeleccionado; + if(rbtnCedula.isSelected()) + { + p.setCedula(txtDocumento.getText()); + p.setRnc(""); + } + else + { + p.setRnc(txtDocumento.getText()); + p.setCedula(""); + } + p.setCodigo(txtCodigo.getText()); + p.setLimiteDeCredito(Double.parseDouble(txtLimitCred.getText())); + p.setLimiteDias(BigInteger.valueOf(Long.parseLong(txtLimitDias.getText()))); + p.setNombre(txtNombre.getText()); + p.setPorcMora(new Float(txtMora.getText())); + if(rbtnContado.isSelected()) + { + p.setTipoDePago("Contado"); + } + else + { + p.setTipoDePago("Credito"); + } + modeloProveedor.updateProveedor(p); + } + } + /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is @@ -311,7 +393,7 @@ jLabel20 = new javax.swing.JLabel(); cmbTipoBusquedaDirecciones = new javax.swing.JComboBox(); jScrollPane2 = new javax.swing.JScrollPane(); - jtbDireccion = new org.jdesktop.swingx.JXTable(); + jtbTablaDireccion = new org.jdesktop.swingx.JXTable(); jPanel11 = new javax.swing.JPanel(); jToolBar2 = new javax.swing.JToolBar(); btnNuevoContacto = new javax.swing.JButton(); @@ -477,6 +559,13 @@ lblPais.setOpaque(true); btnInsertarDireccion.setText("Insertar+"); + btnInsertarDireccion.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { + btnInsertarDireccionActionPerformed(evt); + } + }); javax.swing.GroupLayout jpanel1Layout = new javax.swing.GroupLayout(jpanel1); jpanel1.setLayout(jpanel1Layout); @@ -709,7 +798,7 @@ jLabel20.setText("Tipo de Busqueda:"); - jtbDireccion.setModel(new javax.swing.table.DefaultTableModel( + jtbTablaDireccion.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { @@ -730,7 +819,7 @@ return canEdit [columnIndex]; } }); - jScrollPane2.setViewportView(jtbDireccion); + jScrollPane2.setViewportView(jtbTablaDireccion); javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10); jPanel10.setLayout(jPanel10Layout); @@ -1028,6 +1117,11 @@ pack(); }// </editor-fold>//GEN-END:initComponents + private void btnInsertarDireccionActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnInsertarDireccionActionPerformed + {//GEN-HEADEREND:event_btnInsertarDireccionActionPerformed + + }//GEN-LAST:event_btnInsertarDireccionActionPerformed + private void btnSalvarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalvarActionPerformed this.execute(); }//GEN-LAST:event_btnSalvarActionPerformed @@ -1142,9 +1236,9 @@ private javax.swing.JToolBar jToolBar1; private javax.swing.JToolBar jToolBar2; private javax.swing.JPanel jpanel1; - private org.jdesktop.swingx.JXTable jtbDireccion; private org.jdesktop.swingx.JXTable jtbDireccion1; private org.jdesktop.swingx.JXTable jtbProductos; + private org.jdesktop.swingx.JXTable jtbTablaDireccion; private javax.swing.JLabel lblCiudad; private javax.swing.JLabel lblPais; private javax.swing.JLabel lblProvincia; Modified: OpaloERP/src/frontend/proveedor/IAdministrarProveedor.form =================================================================== --- OpaloERP/src/frontend/proveedor/IAdministrarProveedor.form 2007-09-15 20:10:41 UTC (rev 36) +++ OpaloERP/src/frontend/proveedor/IAdministrarProveedor.form 2007-09-16 18:38:42 UTC (rev 37) @@ -18,8 +18,8 @@ <Group type="102" alignment="0" attributes="0"> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jScrollPane1" alignment="0" pref="762" max="32767" attributes="0"/> - <Component id="jToolBar1" alignment="0" pref="762" max="32767" attributes="0"/> + <Component id="jScrollPane1" alignment="0" pref="766" max="32767" attributes="0"/> + <Component id="jToolBar1" alignment="0" pref="766" max="32767" attributes="0"/> <Group type="102" alignment="0" attributes="0"> <Component id="jLabel1" min="-2" max="-2" attributes="0"/> <EmptySpace min="-2" pref="32" max="-2" attributes="0"/> @@ -92,6 +92,9 @@ <Properties> <Property name="text" type="java.lang.String" value="Borrar"/> </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnBorrarActionPerformed"/> + </Events> </Component> <Component class="javax.swing.JButton" name="btnVisualizar"> <Properties> Modified: OpaloERP/src/frontend/proveedor/IAdministrarProveedor.java =================================================================== --- OpaloERP/src/frontend/proveedor/IAdministrarProveedor.java 2007-09-15 20:10:41 UTC (rev 36) +++ OpaloERP/src/frontend/proveedor/IAdministrarProveedor.java 2007-09-16 18:38:42 UTC (rev 37) @@ -10,6 +10,7 @@ import java.util.ArrayList; import java.util.List; import javax.swing.JFrame; +import javax.swing.JOptionPane; import javax.swing.table.AbstractTableModel; import mensaje_objetos.proveedor.Proveedor; import modelo_objetos.proveedor.ModeloProveedor; @@ -22,7 +23,7 @@ { private DgCrearProveedor dgCrearProveedor; - private ModeloProveedor modelo; + private ModeloProveedor modeloProveedor; private List<Proveedor> listaProveedorTotal = new ArrayList(); private AbstractTableModel tableModel; private List<Proveedor> proveedorTable = new ArrayList(); @@ -39,7 +40,7 @@ private void inicializarComponentes() { dgCrearProveedor=new DgCrearProveedor(new JFrame(), true); - modelo=ModeloProveedor.getInstance(); + modeloProveedor=ModeloProveedor.getInstance(); inicializarTable(); inicializarCombo(); @@ -51,7 +52,7 @@ private void inicializarTable() { - listaProveedorTotal=modelo.getAllProveedores(); + listaProveedorTotal=modeloProveedor.getAllProveedores(); proveedorTable=listaProveedorTotal; tableModel=new AbstractTableModel() @@ -151,7 +152,8 @@ * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents - private void initComponents() { + private void initComponents() + { jToolBar1 = new javax.swing.JToolBar(); btnNuevo = new javax.swing.JButton(); btnEditar = new javax.swing.JButton(); @@ -166,8 +168,10 @@ tableProveedor = new org.jdesktop.swingx.JXTable(); btnNuevo.setText("Nuevo"); - btnNuevo.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + btnNuevo.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { btnNuevoActionPerformed(evt); } }); @@ -175,8 +179,10 @@ jToolBar1.add(btnNuevo); btnEditar.setText("Editar"); - btnEditar.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + btnEditar.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { btnEditarActionPerformed(evt); } }); @@ -184,11 +190,21 @@ jToolBar1.add(btnEditar); btnBorrar.setText("Borrar"); + btnBorrar.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { + btnBorrarActionPerformed(evt); + } + }); + jToolBar1.add(btnBorrar); btnVisualizar.setText("Visualizar"); - btnVisualizar.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + btnVisualizar.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { btnVisualizarActionPerformed(evt); } }); @@ -200,18 +216,23 @@ jLabel2.setText("Tipo de Busqueda"); tableProveedor.setModel(new javax.swing.table.DefaultTableModel( - new Object [][] { + new Object [][] + { }, - new String [] { + new String [] + { "Codigo", "Nombre", "RNC", "Cedula", "Tipo de Pago", "Limite de Credito", "Limite de Dias", "% Mora" } - ) { - boolean[] canEdit = new boolean [] { + ) + { + boolean[] canEdit = new boolean [] + { false, false, false, false, false, false, false, false }; - public boolean isCellEditable(int rowIndex, int columnIndex) { + public boolean isCellEditable(int rowIndex, int columnIndex) + { return canEdit [columnIndex]; } }); @@ -224,8 +245,8 @@ .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 761, Short.MAX_VALUE) - .addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE, 761, Short.MAX_VALUE) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 766, Short.MAX_VALUE) + .addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE, 766, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() .addComponent(jLabel1) .addGap(32, 32, 32) @@ -263,6 +284,30 @@ pack(); }// </editor-fold>//GEN-END:initComponents + private void btnBorrarActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnBorrarActionPerformed + {//GEN-HEADEREND:event_btnBorrarActionPerformed + ProveedorEvent pv=new ProveedorEvent(); + proveedorSeleccionado = getSelectedProveedor(); + if(proveedorSeleccionado != null) + { + int respuesta = JOptionPane.showInternalConfirmDialog(this, "\u00bfEst\u00e1 seguro de que desea" + + " eliminar este proveedor", "Confirmar borrado de proveedor", + JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); + if(respuesta == JOptionPane.OK_OPTION) + { + modeloProveedor.removeProveedor(proveedorSeleccionado); + proveedorSeleccionado = null; + this.inicializarTable(); + } + } + else + { + JOptionPane.showInternalMessageDialog(this,"Debes elegir un proveedor" + + " para realizar esta operaci\u00f3n", "Seleccione un proveedor", JOptionPane.WARNING_MESSAGE); + } + + }//GEN-LAST:event_btnBorrarActionPerformed + private void btnVisualizarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnVisualizarActionPerformed ProveedorEvent pv=new ProveedorEvent(); pv.setId(ProveedorEvent.VISUALIZAR); @@ -270,6 +315,7 @@ pv.setProveedor(proveedorSeleccionado); dgCrearProveedor.fireProveedor(pv); dgCrearProveedor.setVisible(true); + this.inicializarTable(); }//GEN-LAST:event_btnVisualizarActionPerformed private void btnEditarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEditarActionPerformed @@ -279,6 +325,7 @@ pv.setProveedor(proveedorSeleccionado); dgCrearProveedor.fireProveedor(pv); dgCrearProveedor.setVisible(true); + this.inicializarTable(); }//GEN-LAST:event_btnEditarActionPerformed private void btnNuevoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNuevoActionPerformed @@ -286,6 +333,7 @@ pv.setId(ProveedorEvent.NUEVO); dgCrearProveedor.fireProveedor(pv); dgCrearProveedor.setVisible(true); + this.inicializarTable(); }//GEN-LAST:event_btnNuevoActionPerformed This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <va...@us...> - 2007-09-15 20:10:41
|
Revision: 36 http://opaloerp.svn.sourceforge.net/opaloerp/?rev=36&view=rev Author: vacax Date: 2007-09-15 13:10:41 -0700 (Sat, 15 Sep 2007) Log Message: ----------- Problema de cierre de session resuelto..... Modified Paths: -------------- OpaloERP/src/modelo_objetos/proveedor/ModeloProveedor.java Modified: OpaloERP/src/modelo_objetos/proveedor/ModeloProveedor.java =================================================================== --- OpaloERP/src/modelo_objetos/proveedor/ModeloProveedor.java 2007-09-15 19:52:00 UTC (rev 35) +++ OpaloERP/src/modelo_objetos/proveedor/ModeloProveedor.java 2007-09-15 20:10:41 UTC (rev 36) @@ -23,8 +23,7 @@ * * @author carlos */ -public class ModeloProveedor -{ +public class ModeloProveedor { private static ModeloProveedor modelo; @@ -38,8 +37,7 @@ /** Creates a new instance of ModeloProveedor */ - public ModeloProveedor() - { + public ModeloProveedor() { conn=Conexion.getConexion(); subjectAdd=new SubjectHelper(); @@ -50,63 +48,52 @@ } - public static SubjectHelper getSubjectAdd() - { + public static SubjectHelper getSubjectAdd() { return subjectAdd; } - public static SubjectHelper getSubjectRemove() - { + public static SubjectHelper getSubjectRemove() { return subjectRemove; } - public static SubjectHelper getSubjectUpdate() - { + public static SubjectHelper getSubjectUpdate() { return subjectUpdate; } - public static SubjectHelper getSubjectSaveOrUpdate() - { + public static SubjectHelper getSubjectSaveOrUpdate() { return subjectSaveOrUpdate; } /** *Intancia de la clase. */ - public static ModeloProveedor getInstance() - { - if(modelo==null) - { + public static ModeloProveedor getInstance() { + if(modelo==null) { modelo=new ModeloProveedor(); } return modelo; } - public static SubjectHelper getSubjectMensaje() - { + public static SubjectHelper getSubjectMensaje() { return subjectMensaje; } /**Metodo para insertar un Grupo*/ - public void addProveedor(Proveedor proveedor) - { - Session sl=conn.getSession(); - Transaction tx=sl.beginTransaction(); - if(!existProveedor(proveedor)) - { + public void addProveedor(Proveedor proveedor){ + if(!existProveedor(proveedor)){ + Session sl=conn.getSession(); + Transaction tx=sl.beginTransaction(); sl.save(proveedor); tx.commit(); getSubjectAdd().notify(ModeloProveedor.class,proveedor,"addProveedor"); sl.close(); - } - else - { + } else { getSubjectMensaje().notify(ModeloProveedor.class,"Existe un proveedor con este codigo","mensaje"); } } + /**Metodo para borrar un grupo*/ - public void removeProveedor(Proveedor proveedor) - { + public void removeProveedor(Proveedor proveedor) { Session sl=conn.getSession(); Transaction tx=sl.beginTransaction(); sl.delete(proveedor); @@ -116,28 +103,23 @@ } /**Metodo para saber si un grupo esta registrado*/ - private boolean existProveedor(Proveedor proveedor) - { + private boolean existProveedor(Proveedor proveedor) { Session ss=conn.getSession(); String hql="From Proveedor P WHERE P.codigo=?"; Query q=ss.createQuery(hql); q.setString(0,proveedor.getCodigo()); List<Proveedor> lista=q.list(); ss.close(); - if(lista.size()==0) - { + if(lista.size()==0) { return false; - } - else - { + } else { return true; } } /**Metodo para actualizar un grupo*/ - public void updateProveedor(Proveedor proveedor) - { + public void updateProveedor(Proveedor proveedor) { Session ss=conn.getSession(); Transaction tx=ss.beginTransaction(); //sn.update(grupo); @@ -150,8 +132,7 @@ /**Metodo para actualizar o insertar*/ - public void saveOrUpdate(Proveedor proveedor) - { + public void saveOrUpdate(Proveedor proveedor) { Session ss=conn.getSession(); Transaction tx=ss.beginTransaction(); ss.saveOrUpdate(proveedor); @@ -161,18 +142,17 @@ } /**Metodo para consultar todos los clientes*/ - public List<Proveedor> getAllProveedores() - { + public List<Proveedor> getAllProveedores() { List<Proveedor> proveedors=new ArrayList(); String hql="FROM Proveedor P"; Session ss=conn.getSession(); Query query=ss.createQuery(hql); if(query!=null){ - proveedors=query.list(); + proveedors=query.list(); } //force para resolver el problema.... if(!proveedors.isEmpty()){ - for(Proveedor p : proveedors){ + for(Proveedor p : proveedors){ p.getContactos().size(); p.getDirecciones().size(); p.getProductos().size(); @@ -186,37 +166,29 @@ /**Metodo para consultar cliente por codigo*/ - public List<Proveedor> getProveedorPorCodigo(List<Proveedor> lista,String patronCodigo) - { + public List<Proveedor> getProveedorPorCodigo(List<Proveedor> lista,String patronCodigo) { List<Proveedor> proveedors=new ArrayList(); - for(Proveedor k:lista) - { + for(Proveedor k:lista) { String codigo=k.getCodigo()+""; - if(!codigo.equals("") && patronCodigo.length()<=codigo.length()) - { + if(!codigo.equals("") && patronCodigo.length()<=codigo.length()) { String codigoGrupo=codigo.substring(0,patronCodigo.length()); - if(codigoGrupo.equalsIgnoreCase(patronCodigo)) - { + if(codigoGrupo.equalsIgnoreCase(patronCodigo)) { proveedors.add(k); } } } return proveedors; } - public List<Proveedor> getProveedorPorNombre(List<Proveedor> lista,String patronNombre) - { + public List<Proveedor> getProveedorPorNombre(List<Proveedor> lista,String patronNombre) { List<Proveedor> proveedors=new ArrayList(); - for(Proveedor k:lista) - { + for(Proveedor k:lista) { String nombre=k.getNombre()+""; - if(!nombre.equals("") && patronNombre.length()<=nombre.length()) - { + if(!nombre.equals("") && patronNombre.length()<=nombre.length()) { String nombreGrupo=nombre.substring(0,patronNombre.length()); - if(nombreGrupo.equalsIgnoreCase(patronNombre)) - { + if(nombreGrupo.equalsIgnoreCase(patronNombre)) { proveedors.add(k); } } @@ -224,20 +196,16 @@ return proveedors; } - public List<Proveedor> getProveedorPorRnc(List<Proveedor> lista,String patronNombre) - { + public List<Proveedor> getProveedorPorRnc(List<Proveedor> lista,String patronNombre) { List<Proveedor> proveedors=new ArrayList(); - for(Proveedor k:lista) - { + for(Proveedor k:lista) { String nombre=k.getRnc()+""; - if(!nombre.equals("") && patronNombre.length()<=nombre.length()) - { + if(!nombre.equals("") && patronNombre.length()<=nombre.length()) { String nombreGrupo=nombre.substring(0,patronNombre.length()); - if(nombreGrupo.equalsIgnoreCase(patronNombre)) - { + if(nombreGrupo.equalsIgnoreCase(patronNombre)) { proveedors.add(k); } } @@ -245,20 +213,16 @@ return proveedors; } - public List<Proveedor> getProveedorPorCedula(List<Proveedor> lista,String patronNombre) - { + public List<Proveedor> getProveedorPorCedula(List<Proveedor> lista,String patronNombre) { List<Proveedor> proveedors=new ArrayList(); - for(Proveedor k:lista) - { + for(Proveedor k:lista) { String nombre=k.getCedula()+""; - if(!nombre.equals("") && patronNombre.length()<=nombre.length()) - { + if(!nombre.equals("") && patronNombre.length()<=nombre.length()) { String nombreGrupo=nombre.substring(0,patronNombre.length()); - if(nombreGrupo.equalsIgnoreCase(patronNombre)) - { + if(nombreGrupo.equalsIgnoreCase(patronNombre)) { proveedors.add(k); } } @@ -266,20 +230,16 @@ return proveedors; } - public List<Proveedor> getProveedorPorLimiteDeCredito(List<Proveedor> lista,String patronNombre) - { + public List<Proveedor> getProveedorPorLimiteDeCredito(List<Proveedor> lista,String patronNombre) { List<Proveedor> proveedors=new ArrayList(); - for(Proveedor k:lista) - { + for(Proveedor k:lista) { String nombre=k.getLimiteDeCredito()+""; - if(!nombre.equals("") && patronNombre.length()<=nombre.length()) - { + if(!nombre.equals("") && patronNombre.length()<=nombre.length()) { String nombreGrupo=nombre.substring(0,patronNombre.length()); - if(nombreGrupo.equalsIgnoreCase(patronNombre)) - { + if(nombreGrupo.equalsIgnoreCase(patronNombre)) { proveedors.add(k); } } @@ -287,20 +247,16 @@ return proveedors; } - public List<Proveedor> getProveedorPorLimiteDeDias(List<Proveedor> lista,String patronNombre) - { + public List<Proveedor> getProveedorPorLimiteDeDias(List<Proveedor> lista,String patronNombre) { List<Proveedor> proveedors=new ArrayList(); - for(Proveedor k:lista) - { + for(Proveedor k:lista) { String nombre=k.getLimiteDias()+""; - if(!nombre.equals("") && patronNombre.length()<=nombre.length()) - { + if(!nombre.equals("") && patronNombre.length()<=nombre.length()) { String nombreGrupo=nombre.substring(0,patronNombre.length()); - if(nombreGrupo.equalsIgnoreCase(patronNombre)) - { + if(nombreGrupo.equalsIgnoreCase(patronNombre)) { proveedors.add(k); } } @@ -308,20 +264,16 @@ return proveedors; } - public List<Proveedor> getProveedorPorPorcentajeDeMora(List<Proveedor> lista,String patronNombre) - { + public List<Proveedor> getProveedorPorPorcentajeDeMora(List<Proveedor> lista,String patronNombre) { List<Proveedor> proveedors=new ArrayList(); - for(Proveedor k:lista) - { + for(Proveedor k:lista) { String nombre=k.getPorcMora()+""; - if(!nombre.equals("") && patronNombre.length()<=nombre.length()) - { + if(!nombre.equals("") && patronNombre.length()<=nombre.length()) { String nombreGrupo=nombre.substring(0,patronNombre.length()); - if(nombreGrupo.equalsIgnoreCase(patronNombre)) - { + if(nombreGrupo.equalsIgnoreCase(patronNombre)) { proveedors.add(k); } } @@ -329,8 +281,7 @@ return proveedors; } - public Secuencia getSecuencia() - { + public Secuencia getSecuencia() { Session ss=conn.getSession(); Transaction tx=ss.beginTransaction(); String hql="From Secuencia S where S.tabla=?"; @@ -342,8 +293,7 @@ return sec0; } - public void updateSecuencia(int valor) - { + public void updateSecuencia(int valor) { Session ss=conn.getSession(); Transaction tx=ss.beginTransaction(); Secuencia sec0=new Secuencia(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <va...@us...> - 2007-09-15 19:51:58
|
Revision: 35 http://opaloerp.svn.sourceforge.net/opaloerp/?rev=35&view=rev Author: vacax Date: 2007-09-15 12:52:00 -0700 (Sat, 15 Sep 2007) Log Message: ----------- Resolviendo el problema de la visualizacion por el layz, forzo la la carga de los elementos. Modified Paths: -------------- OpaloERP/src/frontend/bancos/PnAdministrarBancos.java OpaloERP/src/frontend/bancos/PnBanco.form OpaloERP/src/frontend/bancos/PnBanco.java OpaloERP/src/frontend/bancos/PnCuentas.java OpaloERP/src/frontend/bank/PnBanco.java OpaloERP/src/frontend/bank/PnCuentas.java OpaloERP/src/frontend/proveedor/DgCrearProveedor.java OpaloERP/src/frontend/proveedor/IAdministrarProveedor.java OpaloERP/src/hibernate.cfg.xml OpaloERP/src/mensaje_objetos/banco/Cuenta.java OpaloERP/src/mensaje_objetos/banco/Transaccion.java OpaloERP/src/mensaje_objetos/cliente/Contacto.java OpaloERP/src/mensaje_objetos/proveedor/Proveedor.java OpaloERP/src/modelo_objetos/almacen/ModeloGrupoProducto.java OpaloERP/src/modelo_objetos/proveedor/ModeloProveedor.java Added Paths: ----------- OpaloERP/src/frontend/usuarioM/ OpaloERP/src/mensaje_objetos/usuarioM/ OpaloERP/src/mensaje_objetos/usuarioM/Funciones.java OpaloERP/src/mensaje_objetos/usuarioM/Perfil.java OpaloERP/src/mensaje_objetos/usuarioM/Permisos.java OpaloERP/src/mensaje_objetos/usuarioM/Usuario.java OpaloERP/src/reportes/datasource/ OpaloERP/src/reportes/jasper/ OpaloERP/src/utilidades/PnTemplatePanelAdmin.form OpaloERP/src/utilidades/PnTemplatePanelAdmin.java Modified: OpaloERP/src/frontend/bancos/PnAdministrarBancos.java =================================================================== --- OpaloERP/src/frontend/bancos/PnAdministrarBancos.java 2007-09-13 19:14:09 UTC (rev 34) +++ OpaloERP/src/frontend/bancos/PnAdministrarBancos.java 2007-09-15 19:52:00 UTC (rev 35) @@ -14,8 +14,10 @@ * @author VMonsantoA */ public class PnAdministrarBancos extends javax.swing.JPanel { + private DgBanco dgb; private int accion; + /** Creates new form PnAdministrarBancos */ public PnAdministrarBancos() { initComponents(); Modified: OpaloERP/src/frontend/bancos/PnBanco.form =================================================================== --- OpaloERP/src/frontend/bancos/PnBanco.form 2007-09-13 19:14:09 UTC (rev 34) +++ OpaloERP/src/frontend/bancos/PnBanco.form 2007-09-15 19:52:00 UTC (rev 35) @@ -15,7 +15,7 @@ <Group type="102" attributes="0"> <EmptySpace min="-2" max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jTabbedPane1" alignment="0" pref="735" max="32767" attributes="0"/> + <Component id="jTabbedPane1" alignment="0" pref="783" max="32767" attributes="0"/> <Group type="102" alignment="0" attributes="0"> <Component id="jLabel1" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> @@ -103,8 +103,8 @@ </Group> <EmptySpace min="-2" max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jTrsocial" pref="637" max="32767" attributes="2"/> - <Component id="jTrnc" alignment="0" pref="637" max="32767" attributes="2"/> + <Component id="jTrsocial" pref="655" max="32767" attributes="2"/> + <Component id="jTrnc" alignment="0" pref="655" max="32767" attributes="2"/> </Group> </Group> </Group> @@ -165,14 +165,14 @@ <Group type="102" attributes="0"> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jScrollPane1" alignment="0" pref="326" max="32767" attributes="0"/> + <Component id="jScrollPane1" alignment="0" pref="348" max="32767" attributes="0"/> <Component id="jLabel5" alignment="0" min="-2" max="-2" attributes="0"/> <Group type="102" alignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0"> <Component id="jLabel7" max="32767" attributes="1"/> - <Component id="jLabel9" alignment="0" pref="53" max="32767" attributes="1"/> - <Component id="jLabel8" alignment="0" pref="53" max="32767" attributes="1"/> - <Component id="jLabel6" alignment="0" pref="53" max="32767" attributes="1"/> + <Component id="jLabel9" alignment="0" pref="67" max="32767" attributes="1"/> + <Component id="jLabel8" alignment="0" pref="67" max="32767" attributes="1"/> + <Component id="jLabel6" alignment="0" pref="67" max="32767" attributes="1"/> </Group> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> @@ -297,12 +297,12 @@ </Group> <EmptySpace min="-2" max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="txtContacto" alignment="0" pref="244" max="32767" attributes="0"/> - <Component id="txtTelefono1" alignment="0" pref="244" max="32767" attributes="0"/> - <Component id="txtTelefono2" alignment="0" pref="244" max="32767" attributes="0"/> - <Component id="txtFax" alignment="0" pref="244" max="32767" attributes="0"/> - <Component id="txtEmail" alignment="1" pref="244" max="32767" attributes="0"/> - <Component id="txtCargo" alignment="1" pref="244" max="32767" attributes="0"/> + <Component id="txtContacto" alignment="0" pref="248" max="32767" attributes="0"/> + <Component id="txtTelefono1" alignment="0" pref="248" max="32767" attributes="0"/> + <Component id="txtTelefono2" alignment="0" pref="248" max="32767" attributes="0"/> + <Component id="txtFax" alignment="0" pref="248" max="32767" attributes="0"/> + <Component id="txtEmail" alignment="1" pref="248" max="32767" attributes="0"/> + <Component id="txtCargo" alignment="1" pref="248" max="32767" attributes="0"/> </Group> <EmptySpace min="-2" max="-2" attributes="0"/> </Group> @@ -341,7 +341,7 @@ <Component id="txtCargo" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="jLabel15" alignment="3" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace pref="175" max="32767" attributes="0"/> + <EmptySpace pref="180" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -542,7 +542,7 @@ <Group type="102" alignment="1" attributes="0"> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="1" attributes="0"> - <Component id="jScrollPane3" alignment="0" pref="710" max="32767" attributes="0"/> + <Component id="jScrollPane3" alignment="0" pref="754" max="32767" attributes="0"/> <Group type="102" alignment="0" attributes="0"> <Component id="jLabel16" min="-2" pref="45" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> @@ -550,9 +550,9 @@ <EmptySpace max="-2" attributes="0"/> <Component id="jLabel17" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> - <Component id="jComboBox1" pref="228" max="32767" attributes="0"/> + <Component id="jComboBox1" pref="221" max="32767" attributes="0"/> </Group> - <Component id="jToolBar1" alignment="0" pref="710" max="32767" attributes="0"/> + <Component id="jToolBar1" alignment="0" pref="754" max="32767" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> </Group> @@ -571,7 +571,7 @@ <Component id="jComboBox1" alignment="3" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> - <Component id="jScrollPane3" pref="355" max="32767" attributes="0"/> + <Component id="jScrollPane3" pref="352" max="32767" attributes="0"/> <EmptySpace max="-2" attributes="0"/> </Group> </Group> @@ -669,10 +669,10 @@ <Group type="102" alignment="1" attributes="0"> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="1" attributes="0"> - <Component id="jScrollPane4" alignment="0" pref="710" max="32767" attributes="0"/> - <Component id="jToolBar3" alignment="1" pref="710" max="32767" attributes="0"/> + <Component id="jScrollPane4" alignment="0" pref="757" max="32767" attributes="0"/> + <Component id="jToolBar3" alignment="1" pref="757" max="32767" attributes="0"/> <Group type="102" alignment="1" attributes="0"> - <Component id="jLabel20" pref="45" max="32767" attributes="0"/> + <Component id="jLabel20" max="32767" attributes="0"/> <EmptySpace max="-2" attributes="0"/> <Component id="jTextField17" min="-2" pref="334" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> @@ -698,7 +698,7 @@ </Group> <EmptySpace max="-2" attributes="0"/> <Component id="jScrollPane4" min="-2" max="-2" attributes="0"/> - <EmptySpace max="32767" attributes="0"/> + <EmptySpace pref="19" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> Modified: OpaloERP/src/frontend/bancos/PnBanco.java =================================================================== --- OpaloERP/src/frontend/bancos/PnBanco.java 2007-09-13 19:14:09 UTC (rev 34) +++ OpaloERP/src/frontend/bancos/PnBanco.java 2007-09-15 19:52:00 UTC (rev 35) @@ -789,7 +789,7 @@ Cuenta cuenta=listaCuentas.get(rowIndex); if(cuenta!=null){ if(columnIndex==0){ - return cuenta.getNcuenta(); + return cuenta.getNumeroCuenta(); } if(columnIndex==1){ return cuenta.getDescripcion(); Modified: OpaloERP/src/frontend/bancos/PnCuentas.java =================================================================== --- OpaloERP/src/frontend/bancos/PnCuentas.java 2007-09-13 19:14:09 UTC (rev 34) +++ OpaloERP/src/frontend/bancos/PnCuentas.java 2007-09-15 19:52:00 UTC (rev 35) @@ -625,7 +625,7 @@ } private Cuenta tomarCampos(Cuenta cuenta) { - cuenta.setNcuenta(jTncuenta.getText()); + cuenta.setNumeroCuenta(jTncuenta.getText()); cuenta.setDescripcion(jTncuenta.getText()); return cuenta; } Modified: OpaloERP/src/frontend/bank/PnBanco.java =================================================================== --- OpaloERP/src/frontend/bank/PnBanco.java 2007-09-13 19:14:09 UTC (rev 34) +++ OpaloERP/src/frontend/bank/PnBanco.java 2007-09-15 19:52:00 UTC (rev 35) @@ -789,7 +789,7 @@ Cuenta cuenta=listaCuentas.get(rowIndex); if(cuenta!=null){ if(columnIndex==0){ - return cuenta.getNcuenta(); + return cuenta.getNumeroCuenta(); } if(columnIndex==1){ return cuenta.getDescripcion(); Modified: OpaloERP/src/frontend/bank/PnCuentas.java =================================================================== --- OpaloERP/src/frontend/bank/PnCuentas.java 2007-09-13 19:14:09 UTC (rev 34) +++ OpaloERP/src/frontend/bank/PnCuentas.java 2007-09-15 19:52:00 UTC (rev 35) @@ -625,7 +625,7 @@ } private Cuenta tomarCampos(Cuenta cuenta) { - cuenta.setNcuenta(jTncuenta.getText()); + cuenta.setNumeroCuenta(jTncuenta.getText()); cuenta.setDescripcion(jTncuenta.getText()); return cuenta; } Modified: OpaloERP/src/frontend/proveedor/DgCrearProveedor.java =================================================================== --- OpaloERP/src/frontend/proveedor/DgCrearProveedor.java 2007-09-13 19:14:09 UTC (rev 34) +++ OpaloERP/src/frontend/proveedor/DgCrearProveedor.java 2007-09-15 19:52:00 UTC (rev 35) @@ -28,8 +28,7 @@ * * @author raymi */ -public class DgCrearProveedor extends javax.swing.JDialog implements IProveedorListener -{ +public class DgCrearProveedor extends javax.swing.JDialog implements IProveedorListener { private Proveedor proveedorSeleccionado; private Proveedor proveedorNuevo; @@ -47,31 +46,25 @@ //private DgArticulo dgArticulo; private int accion; /** Creates new form DgCrearProveedor */ - public DgCrearProveedor(java.awt.Frame parent, boolean modal) - { + public DgCrearProveedor(java.awt.Frame parent, boolean modal) { super(parent, modal); initComponents(); inicializarComponentes(); } - private void inicializarComponentes() - { + private void inicializarComponentes() { dgDireccionProveedor = new DgDireccionCliente(new JFrame(), true); dgCrearContacto = new DgCrearContacto(new JFrame(), true); //dgArticulo = new DgArticulo(new JFrame(), true); } - public void fireProveedor(ProveedorEvent pv) - { + public void fireProveedor(ProveedorEvent pv) { proveedorSeleccionado=pv.getProveedor(); - if(pv!=null) - { + if(pv!=null) { accion=pv.getId(); - if(pv.getId()==ProveedorEvent.EDITAR) - { + if(pv.getId()==ProveedorEvent.EDITAR) { - if(proveedorSeleccionado!=null) - { + if(proveedorSeleccionado!=null) { listaContactos=proveedorSeleccionado.getContactos(); listaProductos=proveedorSeleccionado.getProductos(); listaDirecciones=proveedorSeleccionado.getDirecciones(); @@ -90,10 +83,8 @@ } setEnable(true); } - if(pv.getId()==ProveedorEvent.VISUALIZAR) - { - if(proveedorSeleccionado!=null) - { + if(pv.getId()==ProveedorEvent.VISUALIZAR) { + if(proveedorSeleccionado!=null) { listaContactos=proveedorSeleccionado.getContactos(); listaProductos=proveedorSeleccionado.getProductos(); listaDirecciones=proveedorSeleccionado.getDirecciones(); @@ -111,8 +102,7 @@ } setEnable(false); } - if(pv.getId()==ProveedorEvent.NUEVO) - { + if(pv.getId()==ProveedorEvent.NUEVO) { limpiarCampos(); setEnable(true); @@ -122,8 +112,7 @@ } } - private void limpiarCampos() - { + private void limpiarCampos() { txtBuscarDireccion.setText(""); txtBuscarContacto.setText(""); txtBuscarProducto.setText(""); @@ -147,43 +136,35 @@ txtTelefono2.setText(""); } - private void setProveedor() - { - Conexion con=Conexion.getConexion(); - Session sl = con.getSession(); + + private void setProveedor() { + txtCodigo.setText(proveedorSeleccionado.getCodigo()); - if(proveedorSeleccionado.getRnc()!=null) - { + if(proveedorSeleccionado.getRnc()!=null) { rbtnRNC.setSelected(true); txtDocumento.setText(proveedorSeleccionado.getRnc()); - } - else - { + } else { rbtnCedula.setSelected(true); txtDocumento.setText(proveedorSeleccionado.getCedula()); } - if(proveedorSeleccionado.getTipoDePago()!= null) - { + if(proveedorSeleccionado.getTipoDePago()!= null) { if(proveedorSeleccionado.getTipoDePago().equals("Credito")) rbtnCredito.setSelected(true); else rbtnContado.setSelected(true); } - + txtLimitCred.setText("" + proveedorSeleccionado.getLimiteDeCredito()); txtLimitDias.setText("" + proveedorSeleccionado.getLimiteDias()); txtMora.setText("" + proveedorSeleccionado.getPorcMora()); txtNombre.setText(proveedorSeleccionado.getNombre()); - - if(proveedorSeleccionado.getContactos()!=null) - { - if(proveedorSeleccionado.getContactos().size()>0) - { + + if(proveedorSeleccionado.getContactos()!=null) { + if(proveedorSeleccionado.getContactos().size()>0) { Contacto cont=proveedorSeleccionado.getContactos().get(0); - if(cont!=null) - { + if(cont!=null) { txtNombreContacto.setText(cont.getNombre()); txtTelefono1.setText(cont.getTelefono1()); txtTelefono2.setText(cont.getTelefono2()); @@ -194,28 +175,21 @@ } } - if(proveedorSeleccionado.getDirecciones()!=null) - { - if(proveedorSeleccionado.getDirecciones().size()>0) - { + if(proveedorSeleccionado.getDirecciones()!=null) { + if(proveedorSeleccionado.getDirecciones().size()>0) { Direccion dir=proveedorSeleccionado.getDirecciones().get(0); - if(dir!=null) - { - if(dir.getCiudad()!=null) - { + if(dir!=null) { + if(dir.getCiudad()!=null) { lblCiudad.setText(dir.getCiudad().getNombre()); } areaDireccion.setText(dir.getDescripcion()); - if(dir.getPais()!=null) - { + if(dir.getPais()!=null) { lblPais.setText(dir.getPais().getNombre()); } - if(dir.getProvincia()!=null) - { + if(dir.getProvincia()!=null) { lblProvincia.setText(dir.getProvincia().getNombre()); } - if(dir.getRegion()!=null) - { + if(dir.getRegion()!=null) { lblRegion.setText(dir.getRegion().getDescripcion()); } } @@ -223,12 +197,11 @@ } txtPrecio.setText(""); txtProductoSeleccionado.setText(""); - sl.close(); + } - private void setEnable(boolean ena) - { + private void setEnable(boolean ena) { btnBorrarContacto.setEnabled(ena); btnBorrarDireccion.setEnabled(ena); btnBuscarProducto.setEnabled(ena); @@ -248,18 +221,13 @@ areaDireccion.setEditable(ena); } - public void execute() - { + public void execute() { ModeloProveedor modelo = ModeloProveedor.getInstance(); - if(accion == ProveedorEvent.NUEVO) - { + if(accion == ProveedorEvent.NUEVO) { Proveedor p = new Proveedor(); - if(rbtnCedula.isSelected()) - { + if(rbtnCedula.isSelected()) { p.setCedula(txtDocumento.getText()); - } - else - { + } else { p.setRnc(txtDocumento.getText()); } p.setCodigo(txtCodigo.getText()); @@ -267,12 +235,9 @@ p.setLimiteDias(BigInteger.valueOf(Long.parseLong(txtLimitDias.getText()))); p.setNombre(txtNombre.getText()); p.setPorcMora(new Float(txtMora.getText())); - if(rbtnContado.isSelected()) - { + if(rbtnContado.isSelected()) { p.setTipoDePago("Contado"); - } - else - { + } else { p.setTipoDePago("Credito"); } modelo.addProveedor(p); Modified: OpaloERP/src/frontend/proveedor/IAdministrarProveedor.java =================================================================== --- OpaloERP/src/frontend/proveedor/IAdministrarProveedor.java 2007-09-13 19:14:09 UTC (rev 34) +++ OpaloERP/src/frontend/proveedor/IAdministrarProveedor.java 2007-09-15 19:52:00 UTC (rev 35) @@ -52,7 +52,7 @@ { listaProveedorTotal=modelo.getAllProveedores(); - proveedorTable=modelo.getAllProveedores(); + proveedorTable=listaProveedorTotal; tableModel=new AbstractTableModel() { Modified: OpaloERP/src/hibernate.cfg.xml =================================================================== --- OpaloERP/src/hibernate.cfg.xml 2007-09-13 19:14:09 UTC (rev 34) +++ OpaloERP/src/hibernate.cfg.xml 2007-09-15 19:52:00 UTC (rev 35) @@ -57,12 +57,15 @@ <mapping class="mensaje_objetos.usuario.Usuario" /> <mapping class="mensaje_objetos.usuario.Permiso" /> <mapping class="mensaje_objetos.usuario.Role" /> - <mapping class="mensaje_objetos.proveedor.Proveedor" /> - <!--<mapping class="mensaje_objetos.banco.Banco" /> + <mapping class="mensaje_objetos.proveedor.Proveedor" /> + <mapping class="mensaje_objetos.almacen.RegulacionStock" /> + + <!-- <mapping class="mensaje_objetos.banco.Banco" /> + <mapping class="mensaje_objetos.banco.Banco" /> <mapping class="mensaje_objetos.banco.Cuenta" /> - <mapping class="mensaje_objetos.banco.Transaccion" /> - <mapping class="mensaje_objetos.banco.Cheque" /> - <mapping class="mensaje_objetos.almacen.RegulacionStock" />--> + <mapping class="mensaje_objetos.banco.Transaccion" /> + <mapping class="mensaje_objetos.banco.Cheque" /> --> + </session-factory> </hibernate-configuration> \ No newline at end of file Modified: OpaloERP/src/mensaje_objetos/banco/Cuenta.java =================================================================== --- OpaloERP/src/mensaje_objetos/banco/Cuenta.java 2007-09-13 19:14:09 UTC (rev 34) +++ OpaloERP/src/mensaje_objetos/banco/Cuenta.java 2007-09-15 19:52:00 UTC (rev 35) @@ -28,8 +28,9 @@ private int codigo; private String descripcion; - private String ncuenta; + private String numeroCuenta; private Banco banco; + @Id @GeneratedValue(generator="SEQ",strategy=GenerationType.AUTO) @Column(name="codigo") @@ -49,13 +50,7 @@ this.descripcion = descripcion; } - public String getNcuenta() { - return ncuenta; - } - - public void setNcuenta(String ncuenta) { - this.ncuenta = ncuenta; - } + @ManyToOne() @JoinColumn(name="codigo_banco") public Banco getBanco() { @@ -66,7 +61,8 @@ this.banco = banco; } - @OneToMany(mappedBy = "cuenta") + //@OneToMany(mappedBy = "cuenta") + @Transient public List<Cheque> getCheques() { return cheques; } @@ -75,7 +71,8 @@ this.cheques = cheques; } - @OneToMany(mappedBy = "cuenta") + // @OneToMany(mappedBy = "cuenta") + @Transient public List<Transaccion> getTransaccions() { return transaccions; } @@ -83,5 +80,14 @@ public void setTransaccions(List<Transaccion> transaccions) { this.transaccions = transaccions; } + + @Column(name="numero_cuenta") + public String getNumeroCuenta() { + return numeroCuenta; + } + + public void setNumeroCuenta(String numeroCuenta) { + this.numeroCuenta = numeroCuenta; + } } Modified: OpaloERP/src/mensaje_objetos/banco/Transaccion.java =================================================================== --- OpaloERP/src/mensaje_objetos/banco/Transaccion.java 2007-09-13 19:14:09 UTC (rev 34) +++ OpaloERP/src/mensaje_objetos/banco/Transaccion.java 2007-09-15 19:52:00 UTC (rev 35) @@ -85,7 +85,8 @@ } - @ManyToOne + @ManyToOne() + @JoinColumn(name="codigo_cuenta") public Cuenta getCuenta() { return cuenta; } Modified: OpaloERP/src/mensaje_objetos/cliente/Contacto.java =================================================================== --- OpaloERP/src/mensaje_objetos/cliente/Contacto.java 2007-09-13 19:14:09 UTC (rev 34) +++ OpaloERP/src/mensaje_objetos/cliente/Contacto.java 2007-09-15 19:52:00 UTC (rev 35) @@ -12,6 +12,7 @@ import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; +import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; @@ -32,8 +33,7 @@ @javax.persistence.SequenceGenerator(name="SEQ",sequenceName="contacto_seq") public class Contacto { - private Proveedor contactos; - + private Proveedor contactos; private int codigo; private String nombre; private String telefono1; @@ -106,10 +106,10 @@ this.cargo = cargo; } - @ManyToOne - public Proveedor getContactos() { - return contactos; - } +// @ManyToOne(fetch=FetchType.EAGER) +// public Proveedor getContactos() { +// return contactos; +// } public void setContactos(Proveedor contactos) { this.contactos = contactos; Modified: OpaloERP/src/mensaje_objetos/proveedor/Proveedor.java =================================================================== --- OpaloERP/src/mensaje_objetos/proveedor/Proveedor.java 2007-09-13 19:14:09 UTC (rev 34) +++ OpaloERP/src/mensaje_objetos/proveedor/Proveedor.java 2007-09-15 19:52:00 UTC (rev 35) @@ -14,6 +14,7 @@ import java.util.List; import javax.persistence.Column; import javax.persistence.Entity; +import javax.persistence.FetchType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.JoinTable; Added: OpaloERP/src/mensaje_objetos/usuarioM/Funciones.java =================================================================== --- OpaloERP/src/mensaje_objetos/usuarioM/Funciones.java (rev 0) +++ OpaloERP/src/mensaje_objetos/usuarioM/Funciones.java 2007-09-15 19:52:00 UTC (rev 35) @@ -0,0 +1,27 @@ +/* + * Funciones.java + * + * Created on 1 de julio de 2007, 05:13 PM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package mensaje_objetos.usuarioM; + +/** + *Clase que obtiene la relacion de los usuario. + * @author vacax + */ +public class Funciones { + + /** + *Propieades + */ + + /** Creates a new instance of Funciones */ + public Funciones() { + + } + +} Added: OpaloERP/src/mensaje_objetos/usuarioM/Perfil.java =================================================================== --- OpaloERP/src/mensaje_objetos/usuarioM/Perfil.java (rev 0) +++ OpaloERP/src/mensaje_objetos/usuarioM/Perfil.java 2007-09-15 19:52:00 UTC (rev 35) @@ -0,0 +1,29 @@ +/* + * Perfil.java + * + * Created on 1 de julio de 2007, 05:13 PM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package mensaje_objetos.usuarioM; + +/** + * Clase que encapsula la informacion de los perfiles el cual estan relacionado con el usuario. + * @author vacax + */ +public class Perfil { + + /** + *Propieades + */ + + /** Creates a new instance of Perfil */ + public Perfil() { + + } + + + +} Added: OpaloERP/src/mensaje_objetos/usuarioM/Permisos.java =================================================================== --- OpaloERP/src/mensaje_objetos/usuarioM/Permisos.java (rev 0) +++ OpaloERP/src/mensaje_objetos/usuarioM/Permisos.java 2007-09-15 19:52:00 UTC (rev 35) @@ -0,0 +1,23 @@ +/* + * Permisos.java + * + * Created on 1 de julio de 2007, 05:13 PM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package mensaje_objetos.usuarioM; + +/** + * Clase que contiene la informacion de los permisos obtenidos de un cliente. + * @author vacax + */ +public class Permisos { + + /** Creates a new instance of Permisos */ + public Permisos() { + + } + +} Added: OpaloERP/src/mensaje_objetos/usuarioM/Usuario.java =================================================================== --- OpaloERP/src/mensaje_objetos/usuarioM/Usuario.java (rev 0) +++ OpaloERP/src/mensaje_objetos/usuarioM/Usuario.java 2007-09-15 19:52:00 UTC (rev 35) @@ -0,0 +1,29 @@ +/* + * Usuario.java + * + * Created on 1 de julio de 2007, 05:12 PM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package mensaje_objetos.usuarioM; + +/** + * Clase que contiene la informacion concerniente a los usuarios del sistema. + * @author vacax + */ +public class Usuario { + + /** + *Propieades + */ + + /** Creates a new instance of Usuario */ + public Usuario() { + + } + + + +} Modified: OpaloERP/src/modelo_objetos/almacen/ModeloGrupoProducto.java =================================================================== --- OpaloERP/src/modelo_objetos/almacen/ModeloGrupoProducto.java 2007-09-13 19:14:09 UTC (rev 34) +++ OpaloERP/src/modelo_objetos/almacen/ModeloGrupoProducto.java 2007-09-15 19:52:00 UTC (rev 35) @@ -29,20 +29,19 @@ */ public class ModeloGrupoProducto { - private static ModeloGrupoProducto modelo=new ModeloGrupoProducto(); + private static ModeloGrupoProducto modelo; //private Session ss private Conexion con; private static SubjectHelper subjectAdd; private static SubjectHelper subjectRemove; private static SubjectHelper subjectUpdate; private static SubjectHelper subjectSaveOrUpdate; - private static SubjectHelper subjectMensaje; + private static SubjectHelper subjectMensaje; - private SessionFactory sf; /** Creates a new instance of ModeloGrupoProducto */ - public ModeloGrupoProducto() { + private ModeloGrupoProducto() { con=Conexion.getConexion(); //obteniendo los subjecthelper. subjectAdd=new SubjectHelper(); @@ -68,6 +67,9 @@ return subjectSaveOrUpdate; } public static ModeloGrupoProducto getInstance(){ + if(modelo==null){ + modelo=new ModeloGrupoProducto(); + } return modelo; } Modified: OpaloERP/src/modelo_objetos/proveedor/ModeloProveedor.java =================================================================== --- OpaloERP/src/modelo_objetos/proveedor/ModeloProveedor.java 2007-09-13 19:14:09 UTC (rev 34) +++ OpaloERP/src/modelo_objetos/proveedor/ModeloProveedor.java 2007-09-15 19:52:00 UTC (rev 35) @@ -167,10 +167,17 @@ String hql="FROM Proveedor P"; Session ss=conn.getSession(); Query query=ss.createQuery(hql); - if(query!=null) - { - proveedors=query.list(); + if(query!=null){ + proveedors=query.list(); } + //force para resolver el problema.... + if(!proveedors.isEmpty()){ + for(Proveedor p : proveedors){ + p.getContactos().size(); + p.getDirecciones().size(); + p.getProductos().size(); + } + } ss.close(); return proveedors; Added: OpaloERP/src/utilidades/PnTemplatePanelAdmin.form =================================================================== --- OpaloERP/src/utilidades/PnTemplatePanelAdmin.form (rev 0) +++ OpaloERP/src/utilidades/PnTemplatePanelAdmin.form 2007-09-15 19:52:00 UTC (rev 35) @@ -0,0 +1,112 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.3" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> + <AuxValues> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + </AuxValues> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jToolBar1" alignment="0" pref="541" max="32767" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jLabel1" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jTextField1" min="-2" pref="263" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jLabel2" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jComboBox1" pref="106" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jScrollPane1" pref="517" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="jToolBar1" min="-2" pref="25" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jTextField1" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jComboBox1" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Component id="jScrollPane1" min="-2" pref="156" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JToolBar" name="jToolBar1"> + <Properties> + <Property name="floatable" type="boolean" value="false"/> + </Properties> + + <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBoxLayout"/> + <SubComponents> + <Component class="javax.swing.JButton" name="jButton1"> + <Properties> + <Property name="text" type="java.lang.String" value="Nuevo"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="jButton2"> + <Properties> + <Property name="text" type="java.lang.String" value="Visualizar"/> + </Properties> + </Component> + </SubComponents> + </Container> + <Component class="javax.swing.JLabel" name="jLabel1"> + <Properties> + <Property name="text" type="java.lang.String" value="Buscar:"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="jTextField1"> + </Component> + <Component class="javax.swing.JLabel" name="jLabel2"> + <Properties> + <Property name="text" type="java.lang.String" value="Buscar Por:"/> + </Properties> + </Component> + <Component class="javax.swing.JComboBox" name="jComboBox1"> + <Properties> + <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> + <StringArray count="1"> + <StringItem index="0" value="( Criterio )"/> + </StringArray> + </Property> + </Properties> + </Component> + <Container class="javax.swing.JScrollPane" name="jScrollPane1"> + + <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> + <SubComponents> + <Component class="org.jdesktop.swingx.JXTable" name="jXTable1"> + <Properties> + <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> + <Table columnCount="4" rowCount="4"> + <Column editable="true" title="Title 1" type="java.lang.Object"/> + <Column editable="true" title="Title 2" type="java.lang.Object"/> + <Column editable="true" title="Title 3" type="java.lang.Object"/> + <Column editable="true" title="Title 4" type="java.lang.Object"/> + </Table> + </Property> + </Properties> + </Component> + </SubComponents> + </Container> + </SubComponents> +</Form> Added: OpaloERP/src/utilidades/PnTemplatePanelAdmin.java =================================================================== --- OpaloERP/src/utilidades/PnTemplatePanelAdmin.java (rev 0) +++ OpaloERP/src/utilidades/PnTemplatePanelAdmin.java 2007-09-15 19:52:00 UTC (rev 35) @@ -0,0 +1,114 @@ +/* + * PnTemplatePanelAdmin.java + * + * Created on 1 de julio de 2007, 05:38 PM + */ + +package utilidades; + +/** + * Clase como cascaron para realizar las ventanas. + * @author vacax + */ +public class PnTemplatePanelAdmin extends javax.swing.JPanel { + + /** + * Creates new form PnTemplatePanelAdmin + */ + public PnTemplatePanelAdmin() { + initComponents(); + } + + /** 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. + */ + // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents + private void initComponents() { + jToolBar1 = new javax.swing.JToolBar(); + jButton1 = new javax.swing.JButton(); + jButton2 = new javax.swing.JButton(); + jLabel1 = new javax.swing.JLabel(); + jTextField1 = new javax.swing.JTextField(); + jLabel2 = new javax.swing.JLabel(); + jComboBox1 = new javax.swing.JComboBox(); + jScrollPane1 = new javax.swing.JScrollPane(); + jXTable1 = new org.jdesktop.swingx.JXTable(); + + jToolBar1.setFloatable(false); + jButton1.setText("Nuevo"); + jToolBar1.add(jButton1); + + jButton2.setText("Visualizar"); + jToolBar1.add(jButton2); + + jLabel1.setText("Buscar:"); + + jLabel2.setText("Buscar Por:"); + + jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "( Criterio )" })); + + jXTable1.setModel(new javax.swing.table.DefaultTableModel( + new Object [][] { + {null, null, null, null}, + {null, null, null, null}, + {null, null, null, null}, + {null, null, null, null} + }, + new String [] { + "Title 1", "Title 2", "Title 3", "Title 4" + } + )); + jScrollPane1.setViewportView(jXTable1); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE, 541, Short.MAX_VALUE) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel1) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 263, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel2) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jComboBox1, 0, 106, Short.MAX_VALUE) + .addContainerGap()) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 517, Short.MAX_VALUE) + .addContainerGap()) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel1) + .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel2) + .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 156, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + }// </editor-fold>//GEN-END:initComponents + + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton jButton1; + private javax.swing.JButton jButton2; + private javax.swing.JComboBox jComboBox1; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JTextField jTextField1; + private javax.swing.JToolBar jToolBar1; + private org.jdesktop.swingx.JXTable jXTable1; + // End of variables declaration//GEN-END:variables + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jos...@us...> - 2007-09-13 19:14:06
|
Revision: 34 http://opaloerp.svn.sourceforge.net/opaloerp/?rev=34&view=rev Author: jose_cruz64 Date: 2007-09-13 12:14:09 -0700 (Thu, 13 Sep 2007) Log Message: ----------- "" Modified Paths: -------------- OpaloERP/src/frontend/cliente/IInsertarCliente.form OpaloERP/src/frontend/cliente/IInsertarCliente.java OpaloERP/src/frontend/proveedor/DgCrearProveedor.java OpaloERP/src/modelo_objetos/acceso_datos/Conexion.java OpaloERP/src/modelo_objetos/proveedor/ModeloProveedor.java Modified: OpaloERP/src/frontend/cliente/IInsertarCliente.form =================================================================== --- OpaloERP/src/frontend/cliente/IInsertarCliente.form 2007-09-11 20:22:34 UTC (rev 33) +++ OpaloERP/src/frontend/cliente/IInsertarCliente.form 2007-09-13 19:14:09 UTC (rev 34) @@ -93,11 +93,7 @@ <Group type="102" alignment="0" attributes="0"> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <Component id="jLabel22" min="-2" pref="77" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="txtNota" pref="408" max="32767" attributes="0"/> - </Group> + <Component id="jLabel22" alignment="0" min="-2" pref="77" max="-2" attributes="0"/> <Group type="102" attributes="0"> <Group type="103" groupAlignment="1" max="-2" attributes="0"> <Component id="jLabel8" alignment="0" max="32767" attributes="1"/> @@ -107,31 +103,34 @@ </Group> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="txtRNC" pref="374" max="32767" attributes="0"/> + <Component id="txtRNC" pref="348" max="32767" attributes="0"/> <Group type="102" alignment="0" attributes="0"> <Component id="btnInsertarGrupo" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> - <Component id="lblVerGrupos" pref="270" max="32767" attributes="0"/> + <Component id="lblVerGrupos" pref="244" max="32767" attributes="0"/> </Group> <Group type="102" alignment="1" attributes="0"> - <Component id="txtGrupo" pref="281" max="32767" attributes="0"/> + <Component id="txtGrupo" pref="255" max="32767" attributes="0"/> <EmptySpace max="-2" attributes="0"/> <Component id="btnGrupo" min="-2" pref="87" max="-2" attributes="0"/> </Group> - <Component id="txtCedula" alignment="0" pref="374" max="32767" attributes="1"/> - <Component id="txtRazonSocial" alignment="0" pref="374" max="32767" attributes="1"/> + <Component id="txtCedula" alignment="0" pref="348" max="32767" attributes="1"/> + <Component id="txtRazonSocial" alignment="0" pref="348" max="32767" attributes="1"/> </Group> </Group> <Component id="jPanel9" max="32767" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="1" attributes="0"> - <Group type="102" attributes="0"> - <Component id="jLabel3" min="-2" pref="97" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="dateFechaIngreso" min="-2" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="103" groupAlignment="1" attributes="0"> + <Group type="102" attributes="0"> + <Component id="jLabel3" min="-2" pref="97" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="dateFechaIngreso" min="-2" max="-2" attributes="0"/> + </Group> + <Component id="jPanel7" min="-2" max="-2" attributes="0"/> </Group> - <Component id="jPanel7" min="-2" max="-2" attributes="0"/> + <Component id="txtNota" alignment="0" pref="382" max="32767" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> </Group> @@ -392,9 +391,9 @@ </Group> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="lblCiudad" pref="399" max="32767" attributes="0"/> - <Component id="lblDireccion" pref="399" max="32767" attributes="0"/> - <Component id="lblProvincia" pref="399" max="32767" attributes="0"/> + <Component id="lblCiudad" pref="373" max="32767" attributes="0"/> + <Component id="lblDireccion" pref="373" max="32767" attributes="0"/> + <Component id="lblProvincia" pref="373" max="32767" attributes="0"/> </Group> </Group> <Component id="btnInsertarDireccion" alignment="0" min="-2" max="-2" attributes="0"/> @@ -405,8 +404,8 @@ </Group> <EmptySpace min="-2" pref="21" max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="lblRegion" pref="399" max="32767" attributes="0"/> - <Component id="lblPais" alignment="0" pref="399" max="32767" attributes="0"/> + <Component id="lblRegion" pref="373" max="32767" attributes="0"/> + <Component id="lblPais" alignment="0" pref="373" max="32767" attributes="0"/> </Group> </Group> </Group> Modified: OpaloERP/src/frontend/cliente/IInsertarCliente.java =================================================================== --- OpaloERP/src/frontend/cliente/IInsertarCliente.java 2007-09-11 20:22:34 UTC (rev 33) +++ OpaloERP/src/frontend/cliente/IInsertarCliente.java 2007-09-13 19:14:09 UTC (rev 34) @@ -694,9 +694,9 @@ .add(org.jdesktop.layout.GroupLayout.LEADING, jLabel14, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel9Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(lblCiudad, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 399, Short.MAX_VALUE) - .add(lblDireccion, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 399, Short.MAX_VALUE) - .add(lblProvincia, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 399, Short.MAX_VALUE))) + .add(lblCiudad, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 373, Short.MAX_VALUE) + .add(lblDireccion, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 373, Short.MAX_VALUE) + .add(lblProvincia, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 373, Short.MAX_VALUE))) .add(btnInsertarDireccion) .add(jPanel9Layout.createSequentialGroup() .add(jPanel9Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) @@ -704,8 +704,8 @@ .add(jLabel32)) .add(21, 21, 21) .add(jPanel9Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(lblRegion, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 399, Short.MAX_VALUE) - .add(lblPais, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 399, Short.MAX_VALUE)))) + .add(lblRegion, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 373, Short.MAX_VALUE) + .add(lblPais, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 373, Short.MAX_VALUE)))) .addContainerGap()) ); jPanel9Layout.setVerticalGroup( @@ -753,11 +753,8 @@ .add(jPanel1Layout.createSequentialGroup() .addContainerGap() .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(jLabel22, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 77, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jPanel1Layout.createSequentialGroup() - .add(jLabel22, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 77, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(txtNota, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 408, Short.MAX_VALUE)) - .add(jPanel1Layout.createSequentialGroup() .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false) .add(org.jdesktop.layout.GroupLayout.LEADING, jLabel8, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(org.jdesktop.layout.GroupLayout.LEADING, jLabel5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) @@ -765,25 +762,27 @@ .add(org.jdesktop.layout.GroupLayout.LEADING, jLabel6, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 111, Short.MAX_VALUE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(txtRNC, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 374, Short.MAX_VALUE) + .add(txtRNC, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 348, Short.MAX_VALUE) .add(jPanel1Layout.createSequentialGroup() .add(btnInsertarGrupo) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(lblVerGrupos, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 270, Short.MAX_VALUE)) + .add(lblVerGrupos, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 244, Short.MAX_VALUE)) .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1Layout.createSequentialGroup() - .add(txtGrupo, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 281, Short.MAX_VALUE) + .add(txtGrupo, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 255, Short.MAX_VALUE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(btnGrupo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 87, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) - .add(txtCedula, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 374, Short.MAX_VALUE) - .add(txtRazonSocial, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 374, Short.MAX_VALUE))) + .add(txtCedula, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 348, Short.MAX_VALUE) + .add(txtRazonSocial, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 348, Short.MAX_VALUE))) .add(jPanel9, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) - .add(jPanel1Layout.createSequentialGroup() - .add(jLabel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 97, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(dateFechaIngreso, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) - .add(jPanel7, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) + .add(jPanel1Layout.createSequentialGroup() + .add(jLabel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 97, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(dateFechaIngreso, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .add(jPanel7, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .add(txtNota, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 382, Short.MAX_VALUE)) .addContainerGap()) ); jPanel1Layout.setVerticalGroup( Modified: OpaloERP/src/frontend/proveedor/DgCrearProveedor.java =================================================================== --- OpaloERP/src/frontend/proveedor/DgCrearProveedor.java 2007-09-11 20:22:34 UTC (rev 33) +++ OpaloERP/src/frontend/proveedor/DgCrearProveedor.java 2007-09-13 19:14:09 UTC (rev 34) @@ -6,13 +6,13 @@ package frontend.proveedor; -import eventos.ClienteEvent; import eventos.ContactoEvent; import eventos.DireccionEvent; import eventos.IProveedorListener; import eventos.ProveedorEvent; import frontend.cliente.DgCrearContacto; import frontend.cliente.DgDireccionCliente; +import java.math.BigInteger; import java.util.ArrayList; import java.util.List; import javax.swing.JFrame; @@ -20,6 +20,9 @@ import mensaje_objetos.cliente.Contacto; import mensaje_objetos.cliente.Direccion; import mensaje_objetos.proveedor.Proveedor; +import modelo_objetos.acceso_datos.Conexion; +import modelo_objetos.proveedor.ModeloProveedor; +import org.hibernate.Session; /** * @@ -60,12 +63,12 @@ public void fireProveedor(ProveedorEvent pv) { + proveedorSeleccionado=pv.getProveedor(); if(pv!=null) { - //accion=ev.getId(); + accion=pv.getId(); if(pv.getId()==ProveedorEvent.EDITAR) { - proveedorSeleccionado=pv.getProveedor(); if(proveedorSeleccionado!=null) { @@ -78,18 +81,17 @@ direccionTable=proveedorSeleccionado.getDirecciones(); /** modeloTablaContacto.fireTableDataChanged(); - modeloTablaSucursal.fireTableDataChanged(); - modeloTablaDireccion.fireTableDataChanged(); - modeloTablaDocumento.fireTableDataChanged();*/ + * modeloTablaSucursal.fireTableDataChanged(); + * modeloTablaDireccion.fireTableDataChanged(); + * modeloTablaDocumento.fireTableDataChanged();*/ setProveedor(); } setEnable(true); } - if(pv.getId()==ClienteEvent.VISUALIZAR) + if(pv.getId()==ProveedorEvent.VISUALIZAR) { - proveedorSeleccionado=pv.getProveedor(); if(proveedorSeleccionado!=null) { listaContactos=proveedorSeleccionado.getContactos(); @@ -100,6 +102,7 @@ productoTable=proveedorSeleccionado.getProductos(); direccionTable=proveedorSeleccionado.getDirecciones(); + /* modeloTablaContacto.fireTableDataChanged(); modeloTablaSucursal.fireTableDataChanged(); modeloTablaDireccion.fireTableDataChanged(); @@ -146,8 +149,10 @@ private void setProveedor() { + Conexion con=Conexion.getConexion(); + Session sl = con.getSession(); txtCodigo.setText(proveedorSeleccionado.getCodigo()); - + if(proveedorSeleccionado.getRnc()!=null) { rbtnRNC.setSelected(true); @@ -159,20 +164,20 @@ txtDocumento.setText(proveedorSeleccionado.getCedula()); } - /* if(proveedorSeleccionado.getTipoDePago()!= null) + if(proveedorSeleccionado.getTipoDePago()!= null) { if(proveedorSeleccionado.getTipoDePago().equals("Credito")) rbtnCredito.setSelected(true); else rbtnContado.setSelected(true); - }*/ - + } + txtLimitCred.setText("" + proveedorSeleccionado.getLimiteDeCredito()); txtLimitDias.setText("" + proveedorSeleccionado.getLimiteDias()); txtMora.setText("" + proveedorSeleccionado.getPorcMora()); txtNombre.setText(proveedorSeleccionado.getNombre()); - - /**if(proveedorSeleccionado.getContactos()!=null) + + if(proveedorSeleccionado.getContactos()!=null) { if(proveedorSeleccionado.getContactos().size()>0) { @@ -216,10 +221,10 @@ } } } - txtPrecio.setText(""); txtProductoSeleccionado.setText(""); - */ + sl.close(); + } private void setEnable(boolean ena) @@ -242,6 +247,37 @@ rbtnRNC.setEnabled(ena); areaDireccion.setEditable(ena); } + + public void execute() + { + ModeloProveedor modelo = ModeloProveedor.getInstance(); + if(accion == ProveedorEvent.NUEVO) + { + Proveedor p = new Proveedor(); + if(rbtnCedula.isSelected()) + { + p.setCedula(txtDocumento.getText()); + } + else + { + p.setRnc(txtDocumento.getText()); + } + p.setCodigo(txtCodigo.getText()); + p.setLimiteDeCredito(Double.parseDouble(txtLimitCred.getText())); + p.setLimiteDias(BigInteger.valueOf(Long.parseLong(txtLimitDias.getText()))); + p.setNombre(txtNombre.getText()); + p.setPorcMora(new Float(txtMora.getText())); + if(rbtnContado.isSelected()) + { + p.setTipoDePago("Contado"); + } + else + { + p.setTipoDePago("Credito"); + } + modelo.addProveedor(p); + } + } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is @@ -1028,9 +1064,9 @@ }// </editor-fold>//GEN-END:initComponents private void btnSalvarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalvarActionPerformed - + this.execute(); }//GEN-LAST:event_btnSalvarActionPerformed - + private void btnVisualizarContactoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnVisualizarContactoActionPerformed ContactoEvent cv = new ContactoEvent(); cv.setId(ContactoEvent.VISUALIZAR); Modified: OpaloERP/src/modelo_objetos/acceso_datos/Conexion.java =================================================================== --- OpaloERP/src/modelo_objetos/acceso_datos/Conexion.java 2007-09-11 20:22:34 UTC (rev 33) +++ OpaloERP/src/modelo_objetos/acceso_datos/Conexion.java 2007-09-13 19:14:09 UTC (rev 34) @@ -37,16 +37,15 @@ AnnotationConfiguration conf=new AnnotationConfiguration(); conf.configure("hibernate.cfg.xml"); setSf(conf.buildSessionFactory()); - setSession(getSf().openSession()); - + setSession(getSf().openSession()); } /** *Metodo para obtener la session. */ public static Session getSession() { - if(!session.isOpen()){ - session=sf.openSession(); + if(!(session.isOpen())){ + session=getSf().openSession(); } return session; } Modified: OpaloERP/src/modelo_objetos/proveedor/ModeloProveedor.java =================================================================== --- OpaloERP/src/modelo_objetos/proveedor/ModeloProveedor.java 2007-09-11 20:22:34 UTC (rev 33) +++ OpaloERP/src/modelo_objetos/proveedor/ModeloProveedor.java 2007-09-13 19:14:09 UTC (rev 34) @@ -23,7 +23,8 @@ * * @author carlos */ -public class ModeloProveedor { +public class ModeloProveedor +{ private static ModeloProveedor modelo; @@ -37,7 +38,8 @@ /** Creates a new instance of ModeloProveedor */ - public ModeloProveedor() { + public ModeloProveedor() + { conn=Conexion.getConexion(); subjectAdd=new SubjectHelper(); @@ -48,77 +50,94 @@ } - public static SubjectHelper getSubjectAdd() { + public static SubjectHelper getSubjectAdd() + { return subjectAdd; } - public static SubjectHelper getSubjectRemove() { + public static SubjectHelper getSubjectRemove() + { return subjectRemove; } - public static SubjectHelper getSubjectUpdate() { + public static SubjectHelper getSubjectUpdate() + { return subjectUpdate; } - public static SubjectHelper getSubjectSaveOrUpdate() { + public static SubjectHelper getSubjectSaveOrUpdate() + { return subjectSaveOrUpdate; } /** *Intancia de la clase. */ - public static ModeloProveedor getInstance(){ - if(modelo==null){ + public static ModeloProveedor getInstance() + { + if(modelo==null) + { modelo=new ModeloProveedor(); } return modelo; } - public static SubjectHelper getSubjectMensaje() { + public static SubjectHelper getSubjectMensaje() + { return subjectMensaje; } /**Metodo para insertar un Grupo*/ - public void addProveedor(Proveedor proveedor){ + public void addProveedor(Proveedor proveedor) + { Session sl=conn.getSession(); Transaction tx=sl.beginTransaction(); - if(!existProveedor(proveedor)){ + if(!existProveedor(proveedor)) + { sl.save(proveedor); tx.commit(); getSubjectAdd().notify(ModeloProveedor.class,proveedor,"addProveedor"); sl.close(); - }else{ + } + else + { getSubjectMensaje().notify(ModeloProveedor.class,"Existe un proveedor con este codigo","mensaje"); - } + } } /**Metodo para borrar un grupo*/ - public void removeProveedor(Proveedor proveedor){ + public void removeProveedor(Proveedor proveedor) + { Session sl=conn.getSession(); Transaction tx=sl.beginTransaction(); sl.delete(proveedor); tx.commit(); sl.close(); - getSubjectRemove().notify(ModeloProveedor.class,proveedor,"removeProveedor"); + getSubjectRemove().notify(ModeloProveedor.class,proveedor,"removeProveedor"); } /**Metodo para saber si un grupo esta registrado*/ - private boolean existProveedor(Proveedor proveedor){ + private boolean existProveedor(Proveedor proveedor) + { Session ss=conn.getSession(); String hql="From Proveedor P WHERE P.codigo=?"; Query q=ss.createQuery(hql); q.setString(0,proveedor.getCodigo()); List<Proveedor> lista=q.list(); ss.close(); - if(lista.size()==0){ + if(lista.size()==0) + { return false; - }else{ + } + else + { return true; - } + } } /**Metodo para actualizar un grupo*/ - public void updateProveedor(Proveedor proveedor){ + public void updateProveedor(Proveedor proveedor) + { Session ss=conn.getSession(); Transaction tx=ss.beginTransaction(); //sn.update(grupo); @@ -131,7 +150,8 @@ /**Metodo para actualizar o insertar*/ - public void saveOrUpdate(Proveedor proveedor){ + public void saveOrUpdate(Proveedor proveedor) + { Session ss=conn.getSession(); Transaction tx=ss.beginTransaction(); ss.saveOrUpdate(proveedor); @@ -141,12 +161,14 @@ } /**Metodo para consultar todos los clientes*/ - public List<Proveedor> getAllProveedores(){ + public List<Proveedor> getAllProveedores() + { List<Proveedor> proveedors=new ArrayList(); String hql="FROM Proveedor P"; Session ss=conn.getSession(); Query query=ss.createQuery(hql); - if(query!=null){ + if(query!=null) + { proveedors=query.list(); } ss.close(); @@ -157,29 +179,37 @@ /**Metodo para consultar cliente por codigo*/ - public List<Proveedor> getProveedorPorCodigo(List<Proveedor> lista,String patronCodigo){ + public List<Proveedor> getProveedorPorCodigo(List<Proveedor> lista,String patronCodigo) + { List<Proveedor> proveedors=new ArrayList(); - for(Proveedor k:lista){ + for(Proveedor k:lista) + { String codigo=k.getCodigo()+""; - if(!codigo.equals("") && patronCodigo.length()<=codigo.length()){ + if(!codigo.equals("") && patronCodigo.length()<=codigo.length()) + { String codigoGrupo=codigo.substring(0,patronCodigo.length()); - if(codigoGrupo.equalsIgnoreCase(patronCodigo)){ + if(codigoGrupo.equalsIgnoreCase(patronCodigo)) + { proveedors.add(k); } } } return proveedors; } - public List<Proveedor> getProveedorPorNombre(List<Proveedor> lista,String patronNombre){ + public List<Proveedor> getProveedorPorNombre(List<Proveedor> lista,String patronNombre) + { List<Proveedor> proveedors=new ArrayList(); - for(Proveedor k:lista){ + for(Proveedor k:lista) + { String nombre=k.getNombre()+""; - if(!nombre.equals("") && patronNombre.length()<=nombre.length()){ + if(!nombre.equals("") && patronNombre.length()<=nombre.length()) + { String nombreGrupo=nombre.substring(0,patronNombre.length()); - if(nombreGrupo.equalsIgnoreCase(patronNombre)){ + if(nombreGrupo.equalsIgnoreCase(patronNombre)) + { proveedors.add(k); } } @@ -187,16 +217,20 @@ return proveedors; } - public List<Proveedor> getProveedorPorRnc(List<Proveedor> lista,String patronNombre){ + public List<Proveedor> getProveedorPorRnc(List<Proveedor> lista,String patronNombre) + { List<Proveedor> proveedors=new ArrayList(); - for(Proveedor k:lista){ + for(Proveedor k:lista) + { String nombre=k.getRnc()+""; - if(!nombre.equals("") && patronNombre.length()<=nombre.length()){ + if(!nombre.equals("") && patronNombre.length()<=nombre.length()) + { String nombreGrupo=nombre.substring(0,patronNombre.length()); - if(nombreGrupo.equalsIgnoreCase(patronNombre)){ + if(nombreGrupo.equalsIgnoreCase(patronNombre)) + { proveedors.add(k); } } @@ -204,16 +238,20 @@ return proveedors; } - public List<Proveedor> getProveedorPorCedula(List<Proveedor> lista,String patronNombre){ + public List<Proveedor> getProveedorPorCedula(List<Proveedor> lista,String patronNombre) + { List<Proveedor> proveedors=new ArrayList(); - for(Proveedor k:lista){ + for(Proveedor k:lista) + { String nombre=k.getCedula()+""; - if(!nombre.equals("") && patronNombre.length()<=nombre.length()){ + if(!nombre.equals("") && patronNombre.length()<=nombre.length()) + { String nombreGrupo=nombre.substring(0,patronNombre.length()); - if(nombreGrupo.equalsIgnoreCase(patronNombre)){ + if(nombreGrupo.equalsIgnoreCase(patronNombre)) + { proveedors.add(k); } } @@ -221,76 +259,90 @@ return proveedors; } - public List<Proveedor> getProveedorPorLimiteDeCredito(List<Proveedor> lista,String patronNombre){ + public List<Proveedor> getProveedorPorLimiteDeCredito(List<Proveedor> lista,String patronNombre) + { List<Proveedor> proveedors=new ArrayList(); - for(Proveedor k:lista){ + for(Proveedor k:lista) + { String nombre=k.getLimiteDeCredito()+""; - if(!nombre.equals("") && patronNombre.length()<=nombre.length()){ + if(!nombre.equals("") && patronNombre.length()<=nombre.length()) + { String nombreGrupo=nombre.substring(0,patronNombre.length()); - if(nombreGrupo.equalsIgnoreCase(patronNombre)){ + if(nombreGrupo.equalsIgnoreCase(patronNombre)) + { proveedors.add(k); } } } return proveedors; } - - public List<Proveedor> getProveedorPorLimiteDeDias(List<Proveedor> lista,String patronNombre){ + + public List<Proveedor> getProveedorPorLimiteDeDias(List<Proveedor> lista,String patronNombre) + { List<Proveedor> proveedors=new ArrayList(); - for(Proveedor k:lista){ + for(Proveedor k:lista) + { String nombre=k.getLimiteDias()+""; - if(!nombre.equals("") && patronNombre.length()<=nombre.length()){ + if(!nombre.equals("") && patronNombre.length()<=nombre.length()) + { String nombreGrupo=nombre.substring(0,patronNombre.length()); - if(nombreGrupo.equalsIgnoreCase(patronNombre)){ + if(nombreGrupo.equalsIgnoreCase(patronNombre)) + { proveedors.add(k); } } } return proveedors; } - - public List<Proveedor> getProveedorPorPorcentajeDeMora(List<Proveedor> lista,String patronNombre){ + + public List<Proveedor> getProveedorPorPorcentajeDeMora(List<Proveedor> lista,String patronNombre) + { List<Proveedor> proveedors=new ArrayList(); - for(Proveedor k:lista){ + for(Proveedor k:lista) + { String nombre=k.getPorcMora()+""; - if(!nombre.equals("") && patronNombre.length()<=nombre.length()){ + if(!nombre.equals("") && patronNombre.length()<=nombre.length()) + { String nombreGrupo=nombre.substring(0,patronNombre.length()); - if(nombreGrupo.equalsIgnoreCase(patronNombre)){ + if(nombreGrupo.equalsIgnoreCase(patronNombre)) + { proveedors.add(k); } } } return proveedors; } - - public Secuencia getSecuencia(){ + + public Secuencia getSecuencia() + { Session ss=conn.getSession(); - Transaction tx=ss.beginTransaction(); + Transaction tx=ss.beginTransaction(); String hql="From Secuencia S where S.tabla=?"; Query que=ss.createQuery(hql); que.setString(0,"Proveedor"); - List<Secuencia> secs=que.list(); + List<Secuencia> secs=que.list(); Secuencia sec0=secs.get(0); ss.close(); return sec0; } - public void updateSecuencia(int valor){ + public void updateSecuencia(int valor) + { Session ss=conn.getSession(); Transaction tx=ss.beginTransaction(); Secuencia sec0=new Secuencia(); sec0.setSecuencia(valor); sec0.setTabla("Proveedor"); - ss.update(sec0); + ss.update(sec0); tx.commit(); ss.close(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jos...@us...> - 2007-09-11 20:22:30
|
Revision: 33 http://opaloerp.svn.sourceforge.net/opaloerp/?rev=33&view=rev Author: jose_cruz64 Date: 2007-09-11 13:22:34 -0700 (Tue, 11 Sep 2007) Log Message: ----------- Trabajo Parcial Modulo-Proveedor: ultima accion permite visualizar proveedores en la tabla. Tablas Creadas: proveedor, proveedor_contacto, proveedor_direccion, proveedor_producto Modified Paths: -------------- OpaloERP/nbproject/genfiles.properties OpaloERP/src/frontend/FRModuloPrincipal.form OpaloERP/src/frontend/FRModuloPrincipal.java OpaloERP/src/frontend/bancos/PnAdministrarBancos.form OpaloERP/src/frontend/bancos/PnAdministrarBancos.java OpaloERP/src/frontend/bank/PnAdministrarBancos.java OpaloERP/src/frontend/cliente/IAdministrarCliente.form OpaloERP/src/frontend/cliente/IAdministrarCliente.java OpaloERP/src/frontend/cliente/IInsertarCliente.form OpaloERP/src/frontend/cliente/IInsertarCliente.java OpaloERP/src/hibernate.cfg.xml OpaloERP/src/mensaje_objetos/cliente/Contacto.java Added Paths: ----------- OpaloERP/src/META-INF/ OpaloERP/src/META-INF/public_OpaloERP.dbschema OpaloERP/src/eventos/IProveedorListener.java OpaloERP/src/eventos/ProveedorEvent.java OpaloERP/src/frontend/proveedor/ OpaloERP/src/frontend/proveedor/DgCrearProveedor.form OpaloERP/src/frontend/proveedor/DgCrearProveedor.java OpaloERP/src/frontend/proveedor/IAdministrarProveedor.form OpaloERP/src/frontend/proveedor/IAdministrarProveedor.java OpaloERP/src/mensaje_objetos/proveedor/ OpaloERP/src/mensaje_objetos/proveedor/Proveedor.java OpaloERP/src/modelo_objetos/proveedor/ OpaloERP/src/modelo_objetos/proveedor/ModeloProveedor.java Modified: OpaloERP/nbproject/genfiles.properties =================================================================== --- OpaloERP/nbproject/genfiles.properties 2007-06-28 01:17:03 UTC (rev 32) +++ OpaloERP/nbproject/genfiles.properties 2007-09-11 20:22:34 UTC (rev 33) @@ -5,4 +5,4 @@ # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=628e4a6e nbproject/build-impl.xml.script.CRC32=84be6d16 -nbproject/build-impl.xml.stylesheet.CRC32=65d7ca21 +nbproject/build-impl.xml.stylesheet.CRC32=20b9345e Added: OpaloERP/src/META-INF/public_OpaloERP.dbschema =================================================================== (Binary files differ) Property changes on: OpaloERP/src/META-INF/public_OpaloERP.dbschema ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: OpaloERP/src/eventos/IProveedorListener.java =================================================================== --- OpaloERP/src/eventos/IProveedorListener.java (rev 0) +++ OpaloERP/src/eventos/IProveedorListener.java 2007-09-11 20:22:34 UTC (rev 33) @@ -0,0 +1,20 @@ +/* + * IGrupoListener.java + * + * Created on November 2, 2006, 3:46 PM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package eventos; + +/** + * + * @author carlos + */ +public interface IProveedorListener { + + + public void fireProveedor(ProveedorEvent proveedor); +} Added: OpaloERP/src/eventos/ProveedorEvent.java =================================================================== --- OpaloERP/src/eventos/ProveedorEvent.java (rev 0) +++ OpaloERP/src/eventos/ProveedorEvent.java 2007-09-11 20:22:34 UTC (rev 33) @@ -0,0 +1,45 @@ +/* + * ProveedorEvent.java + * + * Created on September 8, 2007, 12:33 PM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package eventos; + +import mensaje_objetos.proveedor.Proveedor; + +/** + * + * @author raymi + */ +public class ProveedorEvent { + + public static final int NUEVO=0; + public static final int EDITAR=1; + public static final int VISUALIZAR=2; + public static final int SELECCIONAR_PROVEEDOR=3; + + private Proveedor proveedor; + private int Id; + + public Proveedor getProveedor() { + return proveedor; + } + + public void setProveedor(Proveedor proveedor) { + this.proveedor=proveedor; + } + + public int getId() { + return Id; + } + + public void setId(int Id) { + this.Id = Id; + } + + +} Modified: OpaloERP/src/frontend/FRModuloPrincipal.form =================================================================== --- OpaloERP/src/frontend/FRModuloPrincipal.form 2007-06-28 01:17:03 UTC (rev 32) +++ OpaloERP/src/frontend/FRModuloPrincipal.form 2007-09-11 20:22:34 UTC (rev 33) @@ -58,6 +58,14 @@ <Property name="text" type="java.lang.String" value="Vendedores"/> </Properties> </MenuItem> + <MenuItem class="javax.swing.JMenuItem" name="itemProveedor"> + <Properties> + <Property name="label" type="java.lang.String" value="Proveedores"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="itemProveedorActionPerformed"/> + </Events> + </MenuItem> <MenuItem class="javax.swing.JSeparator" name="jSeparator1"> </MenuItem> <MenuItem class="javax.swing.JMenuItem" name="itemEmpresa"> Modified: OpaloERP/src/frontend/FRModuloPrincipal.java =================================================================== --- OpaloERP/src/frontend/FRModuloPrincipal.java 2007-06-28 01:17:03 UTC (rev 32) +++ OpaloERP/src/frontend/FRModuloPrincipal.java 2007-09-11 20:22:34 UTC (rev 33) @@ -17,9 +17,9 @@ import frontend.empresa.AdministracionEmpresa; import frontend.facturacion.IFacturarProducto; import frontend.facturacion.ISolicitarProducto; +import frontend.proveedor.IAdministrarProveedor; import frontend.recibodecaja.IAdministrarReciboCaja; import frontend.serie.DgCrearSerieDocumento; -import java.net.URL; import javax.swing.ImageIcon; import javax.swing.JLabel; import utilidades.Screen; @@ -42,6 +42,7 @@ private DgCrearSerieDocumento iAdmSerie; private IFacturarProducto iAdmFactura; private IAlmacen iAdmAlmacen; + private IAdministrarProveedor iAdmProveedor; //representa la ventana de regulacion de stock. private IFRegulacionStock iadmRegulacion; //para centrar la pantalla. @@ -71,6 +72,7 @@ iAdmFactura=new IFacturarProducto(); iAdmAlmacen=new IAlmacen(); iadmRegulacion=new IFRegulacionStock(); + iAdmProveedor = new IAdministrarProveedor(); //insertando las imagenes. insertarImagenes(); //centrando la pantalla. @@ -98,7 +100,8 @@ * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents - private void initComponents() { + private void initComponents() + { jToolBar1 = new javax.swing.JToolBar(); btnArticulo = new javax.swing.JButton(); btnGrupo = new javax.swing.JButton(); @@ -114,6 +117,7 @@ itemFormaVenta = new javax.swing.JMenuItem(); itemDescuento = new javax.swing.JMenuItem(); itemVendedor = new javax.swing.JMenuItem(); + itemProveedor = new javax.swing.JMenuItem(); jSeparator1 = new javax.swing.JSeparator(); itemEmpresa = new javax.swing.JMenuItem(); itemFiscalidad = new javax.swing.JMenu(); @@ -135,8 +139,10 @@ btnArticulo.setMnemonic('A'); btnArticulo.setText("Articulos"); btnArticulo.setBorderPainted(false); - btnArticulo.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + btnArticulo.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { btnArticuloActionPerformed(evt); } }); @@ -147,8 +153,10 @@ btnGrupo.setMnemonic('G'); btnGrupo.setText("Grupos"); btnGrupo.setBorderPainted(false); - btnGrupo.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + btnGrupo.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { btnGrupoActionPerformed(evt); } }); @@ -159,8 +167,10 @@ btnAlmacen.setMnemonic('A'); btnAlmacen.setText("Almacenes"); btnAlmacen.setBorderPainted(false); - btnAlmacen.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + btnAlmacen.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { btnAlmacenActionPerformed(evt); } }); @@ -171,8 +181,10 @@ btnAyuda.setMnemonic('y'); btnAyuda.setText("Ayuda"); btnAyuda.setBorderPainted(false); - btnAyuda.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + btnAyuda.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { btnAyudaActionPerformed(evt); } }); @@ -182,8 +194,10 @@ btnRegulacionStock.setFont(new java.awt.Font("Dialog", 0, 12)); btnRegulacionStock.setText("Regulacion"); btnRegulacionStock.setBorderPainted(false); - btnRegulacionStock.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + btnRegulacionStock.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { btnRegulacionStockActionPerformed(evt); } }); @@ -198,8 +212,10 @@ itemClientes.setText("Clientes"); itemCliente.setMnemonic('C'); itemCliente.setText("Clientes"); - itemCliente.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + itemCliente.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { itemClienteActionPerformed(evt); } }); @@ -207,8 +223,10 @@ itemClientes.add(itemCliente); itemGrupoCliente.setText("Grupos"); - itemGrupoCliente.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + itemGrupoCliente.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { itemGrupoClienteActionPerformed(evt); } }); @@ -216,8 +234,10 @@ itemClientes.add(itemGrupoCliente); itemFormaVenta.setText("Forma Venta"); - itemFormaVenta.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + itemFormaVenta.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { itemFormaVentaActionPerformed(evt); } }); @@ -225,8 +245,10 @@ itemClientes.add(itemFormaVenta); itemDescuento.setText("Descuentos"); - itemDescuento.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + itemDescuento.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { itemDescuentoActionPerformed(evt); } }); @@ -238,11 +260,24 @@ itemVendedor.setText("Vendedores"); itemPrincipal.add(itemVendedor); + itemProveedor.setLabel("Proveedores"); + itemProveedor.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { + itemProveedorActionPerformed(evt); + } + }); + + itemPrincipal.add(itemProveedor); + itemPrincipal.add(jSeparator1); itemEmpresa.setText("Empresa"); - itemEmpresa.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + itemEmpresa.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { itemEmpresaActionPerformed(evt); } }); @@ -251,8 +286,10 @@ itemFiscalidad.setText("Fiscalidad"); itemSeries.setText("Series Documentos"); - itemSeries.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + itemSeries.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { itemSeriesActionPerformed(evt); } }); @@ -284,8 +321,10 @@ itemVenta.setText("Ventas"); itemVenta.setFont(new java.awt.Font("Dialog", 0, 12)); itemSolcitud.setText("Solicitud"); - itemSolcitud.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + itemSolcitud.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { itemSolcitudActionPerformed(evt); } }); @@ -293,8 +332,10 @@ itemVenta.add(itemSolcitud); itemFactura.setText("Factura"); - itemFactura.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + itemFactura.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { itemFacturaActionPerformed(evt); } }); @@ -302,8 +343,10 @@ itemVenta.add(itemFactura); itemRecibo.setText("Recibos de Caja"); - itemRecibo.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + itemRecibo.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { itemReciboActionPerformed(evt); } }); @@ -331,6 +374,13 @@ pack(); }// </editor-fold>//GEN-END:initComponents + private void itemProveedorActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_itemProveedorActionPerformed + {//GEN-HEADEREND:event_itemProveedorActionPerformed + desktop.add(iAdmProveedor); + iAdmProveedor.setTitle("Administrar Proveedores"); + iAdmProveedor.setVisible(true); + }//GEN-LAST:event_itemProveedorActionPerformed + private void btnRegulacionStockActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRegulacionStockActionPerformed //instanciando la ventana de almacenes. desktop.add(iadmRegulacion); @@ -496,6 +546,7 @@ private javax.swing.JMenuItem itemFormaVenta; private javax.swing.JMenuItem itemGrupoCliente; private javax.swing.JMenu itemPrincipal; + private javax.swing.JMenuItem itemProveedor; private javax.swing.JMenuItem itemRecibo; private javax.swing.JMenuItem itemSeries; private javax.swing.JMenuItem itemSolcitud; Modified: OpaloERP/src/frontend/bancos/PnAdministrarBancos.form =================================================================== --- OpaloERP/src/frontend/bancos/PnAdministrarBancos.form 2007-06-28 01:17:03 UTC (rev 32) +++ OpaloERP/src/frontend/bancos/PnAdministrarBancos.form 2007-09-11 20:22:34 UTC (rev 33) @@ -25,10 +25,10 @@ <Component id="jComboBox1" pref="167" max="32767" attributes="0"/> <EmptySpace max="-2" attributes="0"/> </Group> - <Component id="jToolBar1" alignment="1" pref="737" max="32767" attributes="0"/> + <Component id="jToolBar1" alignment="1" pref="815" max="32767" attributes="0"/> <Group type="102" alignment="0" attributes="0"> <EmptySpace max="-2" attributes="0"/> - <Component id="jScrollPane1" pref="717" max="32767" attributes="0"/> + <Component id="jScrollPane1" pref="791" max="32767" attributes="0"/> <EmptySpace max="-2" attributes="0"/> </Group> </Group> Modified: OpaloERP/src/frontend/bancos/PnAdministrarBancos.java =================================================================== --- OpaloERP/src/frontend/bancos/PnAdministrarBancos.java 2007-06-28 01:17:03 UTC (rev 32) +++ OpaloERP/src/frontend/bancos/PnAdministrarBancos.java 2007-09-11 20:22:34 UTC (rev 33) @@ -127,7 +127,7 @@ private void nuevo() { BancoEvent ev = new BancoEvent(); ev.setId(BancoEvent.NUEVO); - dgb.fireAlmacen(ev); + dgb.fireBanco(ev); dgb.setVisible(true); } Modified: OpaloERP/src/frontend/bank/PnAdministrarBancos.java =================================================================== --- OpaloERP/src/frontend/bank/PnAdministrarBancos.java 2007-06-28 01:17:03 UTC (rev 32) +++ OpaloERP/src/frontend/bank/PnAdministrarBancos.java 2007-09-11 20:22:34 UTC (rev 33) @@ -127,7 +127,7 @@ private void nuevo() { BancoEvent ev = new BancoEvent(); ev.setId(BancoEvent.NUEVO); - dgb.fireAlmacen(ev); + dgb.fireBanco(ev); dgb.setVisible(true); } Modified: OpaloERP/src/frontend/cliente/IAdministrarCliente.form =================================================================== --- OpaloERP/src/frontend/cliente/IAdministrarCliente.form 2007-06-28 01:17:03 UTC (rev 32) +++ OpaloERP/src/frontend/cliente/IAdministrarCliente.form 2007-09-11 20:22:34 UTC (rev 33) @@ -28,7 +28,7 @@ <Component id="jLabel1" min="-2" pref="61" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> <Component id="txtBuscar" min="-2" pref="306" max="-2" attributes="0"/> - <EmptySpace max="32767" attributes="0"/> + <EmptySpace pref="8" max="32767" attributes="0"/> <Component id="dateFechaIngreso" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> <Component id="jLabel2" min="-2" pref="125" max="-2" attributes="0"/> @@ -74,11 +74,6 @@ <SubComponents> <Component class="javax.swing.JButton" name="btnNuevo"> <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor"> - <FontInfo relative="false"> - <Font name="Dialog" size="12" style="0"/> - </FontInfo> - </Property> <Property name="mnemonic" type="int" value="78"/> <Property name="text" type="java.lang.String" value="Nuevo"/> <Property name="borderPainted" type="boolean" value="false"/> @@ -89,11 +84,6 @@ </Component> <Component class="javax.swing.JButton" name="btnEditar"> <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor"> - <FontInfo relative="false"> - <Font name="Dialog" size="12" style="0"/> - </FontInfo> - </Property> <Property name="mnemonic" type="int" value="69"/> <Property name="text" type="java.lang.String" value="Editar"/> <Property name="borderPainted" type="boolean" value="false"/> @@ -104,11 +94,6 @@ </Component> <Component class="javax.swing.JButton" name="btnBorrar"> <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor"> - <FontInfo relative="false"> - <Font name="Dialog" size="12" style="0"/> - </FontInfo> - </Property> <Property name="mnemonic" type="int" value="66"/> <Property name="text" type="java.lang.String" value="Borrar"/> <Property name="borderPainted" type="boolean" value="false"/> @@ -119,11 +104,6 @@ </Component> <Component class="javax.swing.JButton" name="btnVisualizar"> <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor"> - <FontInfo relative="false"> - <Font name="Dialog" size="12" style="0"/> - </FontInfo> - </Property> <Property name="mnemonic" type="int" value="86"/> <Property name="text" type="java.lang.String" value="Visualizar"/> <Property name="borderPainted" type="boolean" value="false"/> @@ -136,11 +116,6 @@ </Container> <Component class="javax.swing.JLabel" name="jLabel1"> <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor"> - <FontInfo relative="false"> - <Font name="Dialog" size="12" style="0"/> - </FontInfo> - </Property> <Property name="text" type="java.lang.String" value="Buscar"/> </Properties> </Component> @@ -151,21 +126,11 @@ </Component> <Component class="javax.swing.JLabel" name="jLabel2"> <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor"> - <FontInfo relative="false"> - <Font name="Dialog" size="12" style="0"/> - </FontInfo> - </Property> <Property name="text" type="java.lang.String" value="Tipo de busqueda"/> </Properties> </Component> <Component class="javax.swing.JComboBox" name="cmbTipoBusqueda"> <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor"> - <FontInfo relative="false"> - <Font name="Dialog" size="12" style="0"/> - </FontInfo> - </Property> <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> <StringArray count="0"/> </Property> Modified: OpaloERP/src/frontend/cliente/IAdministrarCliente.java =================================================================== --- OpaloERP/src/frontend/cliente/IAdministrarCliente.java 2007-06-28 01:17:03 UTC (rev 32) +++ OpaloERP/src/frontend/cliente/IAdministrarCliente.java 2007-09-11 20:22:34 UTC (rev 33) @@ -264,7 +264,6 @@ setTitle("Administrar Clientes"); jToolBar1.setFloatable(false); jToolBar1.setBorderPainted(false); - btnNuevo.setFont(new java.awt.Font("Dialog", 0, 12)); btnNuevo.setMnemonic('N'); btnNuevo.setText("Nuevo"); btnNuevo.setBorderPainted(false); @@ -276,7 +275,6 @@ jToolBar1.add(btnNuevo); - btnEditar.setFont(new java.awt.Font("Dialog", 0, 12)); btnEditar.setMnemonic('E'); btnEditar.setText("Editar"); btnEditar.setBorderPainted(false); @@ -288,7 +286,6 @@ jToolBar1.add(btnEditar); - btnBorrar.setFont(new java.awt.Font("Dialog", 0, 12)); btnBorrar.setMnemonic('B'); btnBorrar.setText("Borrar"); btnBorrar.setBorderPainted(false); @@ -300,7 +297,6 @@ jToolBar1.add(btnBorrar); - btnVisualizar.setFont(new java.awt.Font("Dialog", 0, 12)); btnVisualizar.setMnemonic('V'); btnVisualizar.setText("Visualizar"); btnVisualizar.setBorderPainted(false); @@ -312,7 +308,6 @@ jToolBar1.add(btnVisualizar); - jLabel1.setFont(new java.awt.Font("Dialog", 0, 12)); jLabel1.setText("Buscar"); txtBuscar.addActionListener(new java.awt.event.ActionListener() { @@ -321,11 +316,8 @@ } }); - jLabel2.setFont(new java.awt.Font("Dialog", 0, 12)); jLabel2.setText("Tipo de busqueda"); - cmbTipoBusqueda.setFont(new java.awt.Font("Dialog", 0, 12)); - tableCliente.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null, null, null, null, null, null, null, null, null, null}, @@ -353,7 +345,7 @@ .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 61, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(txtBuscar, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 306, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 8, Short.MAX_VALUE) .add(dateFechaIngreso, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jLabel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 125, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) Modified: OpaloERP/src/frontend/cliente/IInsertarCliente.form =================================================================== --- OpaloERP/src/frontend/cliente/IInsertarCliente.form 2007-06-28 01:17:03 UTC (rev 32) +++ OpaloERP/src/frontend/cliente/IInsertarCliente.form 2007-09-11 20:22:34 UTC (rev 33) @@ -22,7 +22,7 @@ <Group type="102" alignment="1" attributes="0"> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="1" attributes="0"> - <Component id="jTabbedPane1" alignment="0" pref="858" max="32767" attributes="0"/> + <Component id="jTabbedPane1" alignment="0" pref="894" max="32767" attributes="0"/> <Group type="102" alignment="1" attributes="0"> <Component id="btnNuevo" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> @@ -96,7 +96,7 @@ <Group type="102" alignment="0" attributes="0"> <Component id="jLabel22" min="-2" pref="77" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> - <Component id="txtNota" pref="388" max="32767" attributes="0"/> + <Component id="txtNota" pref="408" max="32767" attributes="0"/> </Group> <Group type="102" attributes="0"> <Group type="103" groupAlignment="1" max="-2" attributes="0"> @@ -107,19 +107,19 @@ </Group> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="txtRNC" pref="354" max="32767" attributes="0"/> + <Component id="txtRNC" pref="374" max="32767" attributes="0"/> <Group type="102" alignment="0" attributes="0"> <Component id="btnInsertarGrupo" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> - <Component id="lblVerGrupos" pref="271" max="32767" attributes="0"/> + <Component id="lblVerGrupos" pref="270" max="32767" attributes="0"/> </Group> <Group type="102" alignment="1" attributes="0"> - <Component id="txtGrupo" pref="261" max="32767" attributes="0"/> + <Component id="txtGrupo" pref="281" max="32767" attributes="0"/> <EmptySpace max="-2" attributes="0"/> <Component id="btnGrupo" min="-2" pref="87" max="-2" attributes="0"/> </Group> - <Component id="txtCedula" alignment="0" pref="354" max="32767" attributes="1"/> - <Component id="txtRazonSocial" alignment="0" pref="354" max="32767" attributes="1"/> + <Component id="txtCedula" alignment="0" pref="374" max="32767" attributes="1"/> + <Component id="txtRazonSocial" alignment="0" pref="374" max="32767" attributes="1"/> </Group> </Group> <Component id="jPanel9" max="32767" attributes="0"/> @@ -392,9 +392,9 @@ </Group> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="lblCiudad" pref="384" max="32767" attributes="0"/> - <Component id="lblDireccion" pref="384" max="32767" attributes="0"/> - <Component id="lblProvincia" pref="384" max="32767" attributes="0"/> + <Component id="lblCiudad" pref="399" max="32767" attributes="0"/> + <Component id="lblDireccion" pref="399" max="32767" attributes="0"/> + <Component id="lblProvincia" pref="399" max="32767" attributes="0"/> </Group> </Group> <Component id="btnInsertarDireccion" alignment="0" min="-2" max="-2" attributes="0"/> @@ -405,8 +405,8 @@ </Group> <EmptySpace min="-2" pref="21" max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="lblRegion" pref="379" max="32767" attributes="0"/> - <Component id="lblPais" alignment="0" pref="379" max="32767" attributes="0"/> + <Component id="lblRegion" pref="399" max="32767" attributes="0"/> + <Component id="lblPais" alignment="0" pref="399" max="32767" attributes="0"/> </Group> </Group> </Group> @@ -538,7 +538,7 @@ <Component class="javax.swing.JLabel" name="lblRegion"> <Properties> <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> - <Color blue="cc" green="b8" id="CheckBox.focus" palette="3" red="a3" type="palette"/> + <Color blue="e5" green="cf" id="Button.shadow" palette="3" red="b8" type="palette"/> </Property> <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> <Font name="Dialog" size="12" style="0"/> @@ -596,19 +596,19 @@ </Group> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="1" attributes="0"> - <Component id="txtComision" alignment="1" pref="244" max="32767" attributes="1"/> - <Component id="txtDivisa" alignment="1" pref="244" max="32767" attributes="1"/> - <Component id="txtLimiteCredito" alignment="0" pref="244" max="32767" attributes="1"/> - <Component id="txtVendedor" alignment="1" pref="244" max="32767" attributes="1"/> - <Component id="txtFormaVenta" alignment="1" pref="244" max="32767" attributes="1"/> + <Component id="txtComision" alignment="1" pref="253" max="32767" attributes="1"/> + <Component id="txtDivisa" alignment="1" pref="253" max="32767" attributes="1"/> + <Component id="txtLimiteCredito" alignment="0" pref="253" max="32767" attributes="1"/> + <Component id="txtVendedor" alignment="1" pref="253" max="32767" attributes="1"/> + <Component id="txtFormaVenta" alignment="1" pref="253" max="32767" attributes="1"/> </Group> </Group> </Group> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="btnInsertarDivisa" alignment="1" pref="90" max="32767" attributes="0"/> - <Component id="btnInsertarVendedor" pref="90" max="32767" attributes="0"/> - <Component id="btnInsertarFormaVenta" alignment="0" pref="90" max="32767" attributes="1"/> + <Component id="btnInsertarDivisa" alignment="1" pref="99" max="32767" attributes="0"/> + <Component id="btnInsertarVendedor" pref="99" max="32767" attributes="0"/> + <Component id="btnInsertarFormaVenta" alignment="0" pref="99" max="32767" attributes="1"/> </Group> <EmptySpace min="399" pref="399" max="-2" attributes="0"/> </Group> @@ -773,7 +773,7 @@ <Component id="checkActivo" alignment="0" min="-2" max="-2" attributes="0"/> <Component id="checkCredito" alignment="0" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace pref="261" max="32767" attributes="0"/> + <EmptySpace pref="280" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -864,12 +864,12 @@ <Group type="102" alignment="0" attributes="0"> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jToolBar1" alignment="0" pref="797" max="32767" attributes="0"/> - <Component id="jScrollPane1" alignment="0" pref="797" max="32767" attributes="0"/> + <Component id="jToolBar1" alignment="0" pref="831" max="32767" attributes="0"/> + <Component id="jScrollPane1" alignment="0" pref="831" max="32767" attributes="0"/> <Group type="102" alignment="0" attributes="0"> <Component id="jLabel26" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> - <Component id="txtBuscarDireccion" pref="484" max="32767" attributes="0"/> + <Component id="txtBuscarDireccion" pref="485" max="32767" attributes="0"/> <EmptySpace max="-2" attributes="0"/> <Component id="jLabel27" min="-2" pref="111" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> @@ -1023,7 +1023,7 @@ <Group type="102" alignment="0" attributes="0"> <EmptySpace max="-2" attributes="0"/> <Component id="jPanel11" min="-2" max="-2" attributes="0"/> - <EmptySpace pref="81" max="32767" attributes="0"/> + <EmptySpace pref="86" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -1044,8 +1044,8 @@ <Group type="102" alignment="1" attributes="0"> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="1" attributes="0"> - <Component id="jToolBar2" alignment="0" pref="797" max="32767" attributes="0"/> - <Component id="jScrollPane2" alignment="0" pref="797" max="32767" attributes="0"/> + <Component id="jToolBar2" alignment="0" pref="831" max="32767" attributes="0"/> + <Component id="jScrollPane2" alignment="0" pref="831" max="32767" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> </Group> @@ -1176,7 +1176,7 @@ </Group> <EmptySpace max="-2" attributes="0"/> <Component id="btnBuscar" min="-2" max="-2" attributes="0"/> - <EmptySpace pref="423" max="32767" attributes="0"/> + <EmptySpace pref="450" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -1210,7 +1210,7 @@ <Component id="checkDescuentoProductos" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> <Component id="checkDescuentoFormaVenta" min="-2" max="-2" attributes="0"/> - <EmptySpace pref="224" max="32767" attributes="0"/> + <EmptySpace pref="219" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -1376,7 +1376,7 @@ <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0"> <EmptySpace max="-2" attributes="0"/> - <Component id="jPanel13" pref="416" max="32767" attributes="0"/> + <Component id="jPanel13" pref="415" max="32767" attributes="0"/> <EmptySpace max="-2" attributes="0"/> </Group> </Group> @@ -1398,12 +1398,12 @@ <Group type="102" alignment="0" attributes="0"> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jToolBar4" alignment="0" pref="797" max="32767" attributes="0"/> - <Component id="jScrollPane4" alignment="0" pref="797" max="32767" attributes="0"/> + <Component id="jToolBar4" alignment="0" pref="831" max="32767" attributes="0"/> + <Component id="jScrollPane4" alignment="0" pref="831" max="32767" attributes="0"/> <Group type="102" alignment="0" attributes="0"> <Component id="jLabel31" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> - <Component id="txtBuscarDocumento" pref="453" max="32767" attributes="0"/> + <Component id="txtBuscarDocumento" pref="454" max="32767" attributes="0"/> <EmptySpace max="-2" attributes="0"/> <Component id="jLabel28" min="-2" pref="133" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> @@ -1553,7 +1553,7 @@ <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0"> <EmptySpace max="-2" attributes="0"/> - <Component id="jPanel14" pref="416" max="32767" attributes="0"/> + <Component id="jPanel14" pref="415" max="32767" attributes="0"/> <EmptySpace max="-2" attributes="0"/> </Group> </Group> @@ -1575,12 +1575,12 @@ <Group type="102" alignment="0" attributes="0"> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jToolBar5" alignment="0" pref="797" max="32767" attributes="0"/> - <Component id="jScrollPane5" alignment="0" pref="797" max="32767" attributes="0"/> + <Component id="jToolBar5" alignment="0" pref="831" max="32767" attributes="0"/> + <Component id="jScrollPane5" alignment="0" pref="831" max="32767" attributes="0"/> <Group type="102" alignment="0" attributes="0"> <Component id="jLabel29" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> - <Component id="txtbuscarSucursal" pref="386" max="32767" attributes="0"/> + <Component id="txtbuscarSucursal" pref="387" max="32767" attributes="0"/> <EmptySpace max="-2" attributes="0"/> <Component id="jLabel30" min="-2" pref="143" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> @@ -1721,7 +1721,7 @@ <EmptySpace max="-2" attributes="0"/> <Component id="jScrollPane6" min="-2" pref="140" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> - <Component id="lblDocumentoCliente" pref="689" max="32767" attributes="0"/> + <Component id="lblDocumentoCliente" pref="713" max="32767" attributes="0"/> <EmptySpace max="-2" attributes="0"/> </Group> </Group> @@ -1732,7 +1732,7 @@ <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> <Component id="lblDocumentoCliente" alignment="0" min="-2" pref="29" max="-2" attributes="0"/> - <Component id="jScrollPane6" alignment="0" pref="416" max="32767" attributes="0"/> + <Component id="jScrollPane6" alignment="0" pref="415" max="32767" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> </Group> Modified: OpaloERP/src/frontend/cliente/IInsertarCliente.java =================================================================== --- OpaloERP/src/frontend/cliente/IInsertarCliente.java 2007-06-28 01:17:03 UTC (rev 32) +++ OpaloERP/src/frontend/cliente/IInsertarCliente.java 2007-09-11 20:22:34 UTC (rev 33) @@ -55,7 +55,8 @@ * @author carlos */ public class IInsertarCliente extends javax.swing.JDialog implements IObserver,IClienteListener,IDireccionListener,IGrupoClienteListener, - IFormaVentaListener,IContactoListener,IDescuentoListener,IDocumentoListener,ISucursalListener,IItbisListener { + IFormaVentaListener,IContactoListener,IDescuentoListener,IDocumentoListener,ISucursalListener,IItbisListener +{ //MODELOS private ModeloCliente modeloCliente; @@ -115,7 +116,8 @@ private AbstractTableModel modeloTablaDireccion; /** Creates new form IInsertarCliente */ - public IInsertarCliente() { + public IInsertarCliente() + { initComponents(); Screen sc=new Screen(this); sc.centrarPantalla(); @@ -141,7 +143,8 @@ } - private void addListener(){ + private void addListener() + { SubjectHelper subAdd=modeloCliente.getSubjectAdd(); subAdd.addObserver(this); @@ -152,39 +155,52 @@ } - private void inicializarTableContacto(){ + private void inicializarTableContacto() + { - modeloTablaContacto=new AbstractTableModel() { - public int getColumnCount() { + modeloTablaContacto=new AbstractTableModel() + { + public int getColumnCount() + { return headersContacto.length; } - public int getRowCount() { + public int getRowCount() + { return contactoTable.size(); } - public Object getValueAt(int rowIndex, int columnIndex) { - if(contactoTable.size()>0){ + public Object getValueAt(int rowIndex, int columnIndex) + { + if(contactoTable.size()>0) + { Contacto contacto=contactoTable.get(rowIndex); - if(contacto!=null){ - if(columnIndex==0){ + if(contacto!=null) + { + if(columnIndex==0) + { return contacto.getNombre(); } - if(columnIndex==1){ + if(columnIndex==1) + { return contacto.getTelefono1(); } - if(columnIndex==2){ + if(columnIndex==2) + { return contacto.getTelefono2(); } - if(columnIndex==3){ + if(columnIndex==3) + { return contacto.getFax(); } - if(columnIndex==4){ + if(columnIndex==4) + { return contacto.getEmail(); } } } return ""; } - public String getColumnName(int col){ + public String getColumnName(int col) + { return headersContacto[col]; } }; @@ -193,36 +209,49 @@ } - private void inicializarTableDocumento(){ + private void inicializarTableDocumento() + { - modeloTablaDocumento=new AbstractTableModel() { - public int getColumnCount() { + modeloTablaDocumento=new AbstractTableModel() + { + public int getColumnCount() + { return headersDocumento.length; } - public int getRowCount() { + public int getRowCount() + { return documentoTable.size(); } - public Object getValueAt(int rowIndex, int columnIndex) { - if(documentoTable.size()>0){ + public Object getValueAt(int rowIndex, int columnIndex) + { + if(documentoTable.size()>0) + { Documento doc=documentoTable.get(rowIndex); - if(doc!=null){ + if(doc!=null) + { - if(columnIndex==0){ + if(columnIndex==0) + { return doc.getDescripcion(); } - if(columnIndex==1){ + if(columnIndex==1) + { return doc.getTipo(); } - if(columnIndex==2){ + if(columnIndex==2) + { File f=doc.getDocumentoAnexado(); - if(f!=null){ + if(f!=null) + { return f.getName(); } return ""; } - if(columnIndex==3){ + if(columnIndex==3) + { SimpleDateFormat format=new SimpleDateFormat("dd-MM-yyyy"); - if(doc.getFechaVencimiento()!=null){ + if(doc.getFechaVencimiento()!=null) + { return format.format(doc.getFechaVencimiento()); } } @@ -230,7 +259,8 @@ } return ""; } - public String getColumnName(int col){ + public String getColumnName(int col) + { return headersDocumento[col]; } }; @@ -239,31 +269,43 @@ } - private void inicializarTableSucursal(){ + private void inicializarTableSucursal() + { - modeloTablaSucursal=new AbstractTableModel() { - public int getColumnCount() { + modeloTablaSucursal=new AbstractTableModel() + { + public int getColumnCount() + { return headersSucursal.length; } - public int getRowCount() { + public int getRowCount() + { return sucursalTable.size(); } - public Object getValueAt(int rowIndex, int columnIndex) { - if(sucursalTable.size()>0){ + public Object getValueAt(int rowIndex, int columnIndex) + { + if(sucursalTable.size()>0) + { Sucursal sucursal=sucursalTable.get(rowIndex); - if(sucursal!=null){ + if(sucursal!=null) + { - if(columnIndex==0){ + if(columnIndex==0) + { return sucursal.getDescripcion(); } - if(columnIndex==1){ - if(sucursal.getDireccion()!=null){ + if(columnIndex==1) + { + if(sucursal.getDireccion()!=null) + { return sucursal.getDireccion().getDescripcion(); } return ""; } - if(columnIndex==2){ - if(sucursal.getContactoPrincipal()!=null){ + if(columnIndex==2) + { + if(sucursal.getContactoPrincipal()!=null) + { return sucursal.getContactoPrincipal().getNombre(); } return ""; @@ -273,7 +315,8 @@ } return ""; } - public String getColumnName(int col){ + public String getColumnName(int col) + { return headersSucursal[col]; } }; @@ -282,36 +325,50 @@ } - private void inicializarTableDireccion(){ + private void inicializarTableDireccion() + { - modeloTablaDireccion=new AbstractTableModel() { - public int getColumnCount() { + modeloTablaDireccion=new AbstractTableModel() + { + public int getColumnCount() + { return headersDireccion.length; } - public int getRowCount() { + public int getRowCount() + { return direccionTable.size(); } - public Object getValueAt(int rowIndex, int columnIndex) { - if(direccionTable.size()>0){ + public Object getValueAt(int rowIndex, int columnIndex) + { + if(direccionTable.size()>0) + { Direccion direccion=direccionTable.get(rowIndex); - if(direccion!=null){ - if(columnIndex==0){ + if(direccion!=null) + { + if(columnIndex==0) + { return direccion.getDescripcion(); } - if(columnIndex==1){ - if(direccion.getCiudad()!=null){ + if(columnIndex==1) + { + if(direccion.getCiudad()!=null) + { return direccion.getCiudad().getNombre(); } return ""; } - if(columnIndex==2){ - if(direccion.getProvincia()!=null){ + if(columnIndex==2) + { + if(direccion.getProvincia()!=null) + { return direccion.getProvincia().getNombre(); } return ""; } - if(columnIndex==3){ - if(direccion.getPais()!=null){ + if(columnIndex==3) + { + if(direccion.getPais()!=null) + { return direccion.getPais().getNombre(); } return ""; @@ -320,7 +377,8 @@ } return ""; } - public String getColumnName(int col){ + public String getColumnName(int col) + { return headersDireccion[col]; } }; @@ -338,7 +396,8 @@ * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents - private void initComponents() { + private void initComponents() + { jTabbedPane1 = new javax.swing.JTabbedPane(); jPanel1 = new javax.swing.JPanel(); dateFechaIngreso = new org.jdesktop.swingx.JXDatePicker(); @@ -481,23 +540,29 @@ jLabel5.setText("Cedula"); btnGrupo.setText("Grupo Procedencia"); - btnGrupo.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + btnGrupo.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { btnGrupoActionPerformed(evt); } }); jLabel6.setText("Grupos "); - txtGrupo.addMouseListener(new java.awt.event.MouseAdapter() { - public void mouseClicked(java.awt.event.MouseEvent evt) { + txtGrupo.addMouseListener(new java.awt.event.MouseAdapter() + { + public void mouseClicked(java.awt.event.MouseEvent evt) + { txtGrupoMouseClicked(evt); } }); btnInsertarGrupo.setText("Insertar+"); - btnInsertarGrupo.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + btnInsertarGrupo.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { btnInsertarGrupoActionPerformed(evt); } }); @@ -600,15 +665,17 @@ btnInsertarDireccion.setMnemonic('n'); btnInsertarDireccion.setText("Insertar +"); - btnInsertarDireccion.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + btnInsertarDireccion.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { btnInsertarDireccionActionPerformed(evt); } }); jLabel32.setText("Region"); - lblRegion.setBackground(javax.swing.UIManager.getDefaults().getColor("CheckBox.focus")); + lblRegion.setBackground(javax.swing.UIManager.getDefaults().getColor("Button.shadow")); lblRegion.setFont(new java.awt.Font("Dialog", 0, 12)); lblRegion.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); lblRegion.setOpaque(true); @@ -627,9 +694,9 @@ .add(org.jdesktop.layout.GroupLayout.LEADING, jLabel14, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel9Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(lblCiudad, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 363, Short.MAX_VALUE) - .add(lblDireccion, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 363, Short.MAX_VALUE) - .add(lblProvincia, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 363, Short.MAX_VALUE))) + .add(lblCiudad, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 399, Short.MAX_VALUE) + .add(lblDireccion, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 399, Short.MAX_VALUE) + .add(lblProvincia, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 399, Short.MAX_VALUE))) .add(btnInsertarDireccion) .add(jPanel9Layout.createSequentialGroup() .add(jPanel9Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) @@ -637,8 +704,8 @@ .add(jLabel32)) .add(21, 21, 21) .add(jPanel9Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(lblRegion, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 363, Short.MAX_VALUE) - .add(lblPais, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 363, Short.MAX_VALUE))... [truncated message content] |
From: <va...@us...> - 2007-06-28 01:17:07
|
Revision: 32 http://opaloerp.svn.sourceforge.net/opaloerp/?rev=32&view=rev Author: vacax Date: 2007-06-27 18:17:03 -0700 (Wed, 27 Jun 2007) Log Message: ----------- Cambios en el script de base de datos Modified Paths: -------------- OpaloERP/nbproject/genfiles.properties OpaloERP/nbproject/project.properties OpaloERP/src/back.txt Modified: OpaloERP/nbproject/genfiles.properties =================================================================== --- OpaloERP/nbproject/genfiles.properties 2007-06-28 01:03:25 UTC (rev 31) +++ OpaloERP/nbproject/genfiles.properties 2007-06-28 01:17:03 UTC (rev 32) @@ -1,8 +1,8 @@ -build.xml.data.CRC32=628e4a6e -build.xml.script.CRC32=38c503c3 -build.xml.stylesheet.CRC32=240b97a2 -# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. -# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. -nbproject/build-impl.xml.data.CRC32=628e4a6e -nbproject/build-impl.xml.script.CRC32=84be6d16 -nbproject/build-impl.xml.stylesheet.CRC32=20b9345e +build.xml.data.CRC32=628e4a6e +build.xml.script.CRC32=38c503c3 +build.xml.stylesheet.CRC32=240b97a2 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=628e4a6e +nbproject/build-impl.xml.script.CRC32=84be6d16 +nbproject/build-impl.xml.stylesheet.CRC32=65d7ca21 Modified: OpaloERP/nbproject/project.properties =================================================================== --- OpaloERP/nbproject/project.properties 2007-06-28 01:03:25 UTC (rev 31) +++ OpaloERP/nbproject/project.properties 2007-06-28 01:17:03 UTC (rev 32) @@ -1,116 +1,64 @@ -application.args= -build.classes.dir=${build.dir}/classes -build.classes.excludes=**/*.java,**/*.form -# This directory is removed when the project is cleaned: -build.dir=build -build.generated.dir=${build.dir}/generated -# Only compile against the classpath explicitly listed here: -build.sysclasspath=ignore -build.test.classes.dir=${build.dir}/test/classes -build.test.results.dir=${build.dir}/test/results -debug.classpath=\ - ${run.classpath} -debug.test.classpath=\ - ${run.test.classpath} -# This directory is removed when the project is cleaned: -dist.dir=dist -dist.jar=${dist.dir}/OpaloERP.jar -dist.javadoc.dir=${dist.dir}/javadoc -file.reference.antlr-2.7.6.jar=../../../Desarollo/librerias/opaloerp/antlr-2.7.6.jar -file.reference.asm-attrs.jar=../../../Desarollo/librerias/opaloerp/asm-attrs.jar -file.reference.asm.jar=../../../Desarollo/librerias/opaloerp/asm.jar -file.reference.cglib-2.1.3.jar=../../../Desarollo/librerias/opaloerp/cglib-2.1.3.jar -file.reference.commons-beanutils-1.7.jar=../../../Desarollo/librerias/opaloerp/commons-beanutils-1.7.jar -file.reference.commons-collections-2.1.jar=../../../Desarollo/librerias/opaloerp/commons-collections-2.1.jar -file.reference.commons-dbcp-1.2.1.jar=../../../Desarollo/librerias/opaloerp/commons-dbcp-1.2.1.jar -file.reference.commons-digester-1.7.jar=../../../Desarollo/librerias/opaloerp/commons-digester-1.7.jar -file.reference.commons-el-1.0.jar=../../../Desarollo/librerias/opaloerp/commons-el-1.0.jar -file.reference.commons-fileupload-1.2.jar=../../../Desarollo/librerias/opaloerp/commons-fileupload-1.2.jar -file.reference.commons-io-1.1.jar=../../../Desarollo/librerias/opaloerp/commons-io-1.1.jar -file.reference.commons-io-1.3.1.jar=../../../Desarollo/librerias/opaloerp/commons-io-1.3.1.jar -file.reference.commons-javaflow-20060411.jar=../../../Desarollo/librerias/opaloerp/commons-javaflow-20060411.jar -file.reference.commons-lang-2.1.jar=../../../Desarollo/librerias/opaloerp/commons-lang-2.1.jar -file.reference.commons-logging-1.0.2.jar=../../../Desarollo/librerias/opaloerp/commons-logging-1.0.2.jar -file.reference.commons-pool-1.3.jar=../../../Desarollo/librerias/opaloerp/commons-pool-1.3.jar -file.reference.dom4j-1.6.1.jar=../../../Desarollo/librerias/opaloerp/dom4j-1.6.1.jar -file.reference.ejb3-persistence.jar=../../../Desarollo/librerias/opaloerp/ejb3-persistence.jar -file.reference.hibernate-annotations.jar=../../../Desarollo/librerias/opaloerp/hibernate-annotations.jar -file.reference.hibernate-commons-annotations.jar=../../../Desarollo/librerias/opaloerp/hibernate-commons-annotations.jar -file.reference.hibernate3.jar=../../../Desarollo/librerias/opaloerp/hibernate3.jar -file.reference.itext-1.3.1.jar=../../../Desarollo/librerias/opaloerp/itext-1.3.1.jar -file.reference.jasperreports-1.3.0.jar=../../../Desarollo/librerias/opaloerp/jasperreports-1.3.0.jar -file.reference.jcommon-1.0.0.jar=../../../Desarollo/librerias/opaloerp/jcommon-1.0.0.jar -file.reference.jdt-compiler-3.1.1.jar=../../../Desarollo/librerias/opaloerp/jdt-compiler-3.1.1.jar -file.reference.jta.jar=../../../Desarollo/librerias/opaloerp/jta.jar -file.reference.log4j-1.2.11.jar=../../../Desarollo/librerias/opaloerp/log4j-1.2.11.jar -file.reference.postgresql-8.1-407.jdbc3.jar=../../../Desarollo/librerias/opaloerp/postgresql-8.1-407.jdbc3.jar -file.reference.swing-layout-1.0.jar=../../../Desarollo/librerias/opaloerp/swing-layout-1.0.jar -file.reference.swinglabs-0.8.0.jar=../../../Desarollo/librerias/opaloerp/swinglabs-0.8.0.jar -jar.compress=false -javac.classpath=\ - ${file.reference.antlr-2.7.6.jar}:\ - ${file.reference.asm-attrs.jar}:\ - ${file.reference.asm.jar}:\ - ${file.reference.cglib-2.1.3.jar}:\ - ${file.reference.commons-beanutils-1.7.jar}:\ - ${file.reference.commons-collections-2.1.jar}:\ - ${file.reference.commons-dbcp-1.2.1.jar}:\ - ${file.reference.commons-digester-1.7.jar}:\ - ${file.reference.commons-el-1.0.jar}:\ - ${file.reference.commons-fileupload-1.2.jar}:\ - ${file.reference.commons-io-1.1.jar}:\ - ${file.reference.commons-io-1.3.1.jar}:\ - ${file.reference.commons-javaflow-20060411.jar}:\ - ${file.reference.commons-lang-2.1.jar}:\ - ${file.reference.commons-logging-1.0.2.jar}:\ - ${file.reference.commons-pool-1.3.jar}:\ - ${file.reference.dom4j-1.6.1.jar}:\ - ${file.reference.ejb3-persistence.jar}:\ - ${file.reference.hibernate-annotations.jar}:\ - ${file.reference.hibernate-commons-annotations.jar}:\ - ${file.reference.hibernate3.jar}:\ - ${file.reference.itext-1.3.1.jar}:\ - ${file.reference.jasperreports-1.3.0.jar}:\ - ${file.reference.jcommon-1.0.0.jar}:\ - ${file.reference.jdt-compiler-3.1.1.jar}:\ - ${file.reference.jta.jar}:\ - ${file.reference.log4j-1.2.11.jar}:\ - ${file.reference.postgresql-8.1-407.jdbc3.jar}:\ - ${file.reference.swinglabs-0.8.0.jar}:\ - ${file.reference.swing-layout-1.0.jar} -# Space-separated list of extra javac options -javac.compilerargs= -javac.deprecation=false -javac.source=1.5 -javac.target=1.5 -javac.test.classpath=\ - ${javac.classpath}:\ - ${build.classes.dir}:\ - ${libs.junit.classpath} -javadoc.additionalparam= -javadoc.author=false -javadoc.encoding= -javadoc.noindex=false -javadoc.nonavbar=false -javadoc.notree=false -javadoc.private=false -javadoc.splitindex=true -javadoc.use=true -javadoc.version=false -javadoc.windowtitle= -main.class=frontend.FRModuloPrincipal -manifest.file=manifest.mf -meta.inf.dir=${src.dir}/META-INF -platform.active=default_platform -run.classpath=\ - ${javac.classpath}:\ - ${build.classes.dir} -# Space-separated list of JVM arguments used when running the project -# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value -# or test-sys-prop.name=value to set system properties for unit tests): -run.jvmargs= -run.test.classpath=\ - ${javac.test.classpath}:\ - ${build.test.classes.dir} -src.dir=src -test.src.dir=test +application.args= +build.classes.dir=${build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +# This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${build.dir}/generated +# Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +debug.classpath=\ + ${run.classpath} +debug.test.classpath=\ + ${run.test.classpath} +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/OpaloERP.jar +dist.javadoc.dir=${dist.dir}/javadoc +jar.compress=false +javac.classpath=\ + ${libs.absolutelayout.classpath}:\ + ${libs.ApacheLibrerias.classpath}:\ + ${libs.Hibernate-3.2.3.classpath}:\ + ${libs.HibiernateAnotacion-3.3.0.classpath}:\ + ${libs.JasperReport1.3.classpath}:\ + ${libs.Postgresql.classpath}:\ + ${libs.swing-layout.classpath}:\ + ${libs.SwingLabs-viejo.classpath} +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.source=1.5 +javac.target=1.5 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir}:\ + ${libs.junit.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding= +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +main.class=frontend.FRModuloPrincipal +manifest.file=manifest.mf +meta.inf.dir=${src.dir}/META-INF +platform.active=default_platform +run.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +# Space-separated list of JVM arguments used when running the project +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value +# or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs= +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +src.dir=src +test.src.dir=test Modified: OpaloERP/src/back.txt =================================================================== --- OpaloERP/src/back.txt 2007-06-28 01:03:25 UTC (rev 31) +++ OpaloERP/src/back.txt 2007-06-28 01:17:03 UTC (rev 32) @@ -1,3 +1,16 @@ + +CREATE TABLE bancos +( + codigo serial NOT NULL, + nombre character varying(100), + ref character varying(12), + rnc character varying(15), + CONSTRAINT bancos_pkey PRIMARY KEY (codigo) +) +WITHOUT OIDS; +ALTER TABLE bancos OWNER TO postgres; + + CREATE TABLE banco_cuenta ( codigo_banco bigint NOT NULL, @@ -49,34 +62,6 @@ -CREATE TABLE bancos -( - codigo serial NOT NULL, - nombre character varying(100), - ref character varying(12), - rnc character varying(15), - CONSTRAINT bancos_pkey PRIMARY KEY (codigo) -) -WITHOUT OIDS; -ALTER TABLE bancos OWNER TO postgres; - - - - -CREATE TABLE bancos -( - codigo serial NOT NULL, - nombre character varying(100), - ref character varying(12), - rnc character varying(15), - CONSTRAINT bancos_pkey PRIMARY KEY (codigo) -) -WITHOUT OIDS; -ALTER TABLE bancos OWNER TO postgres; - - - - CREATE TABLE cuentab ( codigo bigint NOT NULL, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vmo...@us...> - 2007-06-28 01:03:23
|
Revision: 31 http://opaloerp.svn.sourceforge.net/opaloerp/?rev=31&view=rev Author: vmonsanto Date: 2007-06-27 18:03:25 -0700 (Wed, 27 Jun 2007) Log Message: ----------- Added Paths: ----------- OpaloERP/src/back.txt Added: OpaloERP/src/back.txt =================================================================== --- OpaloERP/src/back.txt (rev 0) +++ OpaloERP/src/back.txt 2007-06-28 01:03:25 UTC (rev 31) @@ -0,0 +1,128 @@ +CREATE TABLE banco_cuenta +( + codigo_banco bigint NOT NULL, + codigo_cuenta bigint NOT NULL, + CONSTRAINT banco_cuenta_pkey PRIMARY KEY (codigo_banco, codigo_cuenta), + CONSTRAINT banco_cuenta_codigo_banco_fkey FOREIGN KEY (codigo_banco) + REFERENCES bancos (codigo) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION, + CONSTRAINT banco_cuenta_codigo_cuenta_fkey FOREIGN KEY (codigo_cuenta) + REFERENCES cuenta (codigo) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION +) +WITHOUT OIDS; +ALTER TABLE banco_cuenta OWNER TO postgres; + +CREATE TABLE banco_contacto +( + codigo_banco bigint NOT NULL, + codigo_contacto bigint NOT NULL, + CONSTRAINT pk_banco_contacto PRIMARY KEY (codigo_banco, codigo_contacto), + CONSTRAINT ba_banco FOREIGN KEY (codigo_banco) + REFERENCES bancos (codigo) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION, + CONSTRAINT bc_contacto FOREIGN KEY (codigo_contacto) + REFERENCES contacto (seccontacto) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION +) +WITHOUT OIDS; +ALTER TABLE banco_contacto OWNER TO postgres; + + + + +CREATE TABLE banco_direccion +( + codigo_banco bigint NOT NULL, + codigo_direccion bigint NOT NULL, + CONSTRAINT pk_banco_direccion PRIMARY KEY (codigo_banco, codigo_direccion), + CONSTRAINT banco_d_banco FOREIGN KEY (codigo_banco) + REFERENCES bancos (codigo) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION, + CONSTRAINT banco_d_direccion FOREIGN KEY (codigo_direccion) + REFERENCES direccion (codigo) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION +) +WITHOUT OIDS; +ALTER TABLE banco_direccion OWNER TO postgres; + + + + +CREATE TABLE bancos +( + codigo serial NOT NULL, + nombre character varying(100), + ref character varying(12), + rnc character varying(15), + CONSTRAINT bancos_pkey PRIMARY KEY (codigo) +) +WITHOUT OIDS; +ALTER TABLE bancos OWNER TO postgres; + + + + +CREATE TABLE bancos +( + codigo serial NOT NULL, + nombre character varying(100), + ref character varying(12), + rnc character varying(15), + CONSTRAINT bancos_pkey PRIMARY KEY (codigo) +) +WITHOUT OIDS; +ALTER TABLE bancos OWNER TO postgres; + + + + +CREATE TABLE cuentab +( + codigo bigint NOT NULL, + descripcion character varying(100), + codigo_banco bigint, + ncuenta character varying(20) NOT NULL, + CONSTRAINT cuentab_pkey PRIMARY KEY (ncuenta, codigo), + CONSTRAINT cuenta_codigo_banco_fkey1 FOREIGN KEY (codigo_banco) + REFERENCES bancos (codigo) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION +) +WITHOUT OIDS; +ALTER TABLE cuentab OWNER TO postgres; + + + + +CREATE TABLE transaccion +( + num_trasaccion bigint NOT NULL, + tipo integer NOT NULL, + f_trans date DEFAULT ('now'::text)::date, + num_cuenta character varying(20), + cantidad numeric(15,4) DEFAULT 0.0000, + concepto character varying(155) +) +WITHOUT OIDS; +ALTER TABLE transaccion OWNER TO postgres; + +CREATE TABLE cheques +( + n_cheque bigint NOT NULL, + f_emision date, + f_cobro date, + cantidad numeric(15,4) DEFAULT 0.0000, + concepto character varying(255) NOT NULL, + para character varying(100), + cantidad_letra character varying(150), + ncuenta character varying(20) NOT NULL, + codigo_cuenta bigint NOT NULL, + CONSTRAINT cheques_pkey PRIMARY KEY (n_cheque), + CONSTRAINT cheques_codigo_cuenta_fkey FOREIGN KEY (codigo_cuenta, ncuenta) + REFERENCES cuentab (codigo, ncuenta) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION +) +WITHOUT OIDS; +ALTER TABLE cheques OWNER TO postgres; + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vmo...@us...> - 2007-06-28 00:59:33
|
Revision: 30 http://opaloerp.svn.sourceforge.net/opaloerp/?rev=30&view=rev Author: vmonsanto Date: 2007-06-27 17:59:35 -0700 (Wed, 27 Jun 2007) Log Message: ----------- Added Paths: ----------- OpaloERP/src/frontend/bank/ OpaloERP/src/frontend/bank/DgAdministrarBanco.form OpaloERP/src/frontend/bank/DgAdministrarBanco.java OpaloERP/src/frontend/bank/DgBanco.form OpaloERP/src/frontend/bank/DgBanco.java OpaloERP/src/frontend/bank/DgCuenta.form OpaloERP/src/frontend/bank/DgCuenta.java OpaloERP/src/frontend/bank/PnAdministrarBancos.form OpaloERP/src/frontend/bank/PnAdministrarBancos.java OpaloERP/src/frontend/bank/PnAdministrarCuentas.form OpaloERP/src/frontend/bank/PnAdministrarCuentas.java OpaloERP/src/frontend/bank/PnBanco.form OpaloERP/src/frontend/bank/PnBanco.java OpaloERP/src/frontend/bank/PnCheque.form OpaloERP/src/frontend/bank/PnCheque.java OpaloERP/src/frontend/bank/PnCuentas.form OpaloERP/src/frontend/bank/PnCuentas.java OpaloERP/src/frontend/bank/PnTransaccion.form OpaloERP/src/frontend/bank/PnTransaccion.java Added: OpaloERP/src/frontend/bank/DgAdministrarBanco.form =================================================================== --- OpaloERP/src/frontend/bank/DgAdministrarBanco.form (rev 0) +++ OpaloERP/src/frontend/bank/DgAdministrarBanco.form 2007-06-28 00:59:35 UTC (rev 30) @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.3" type="org.netbeans.modules.form.forminfo.JDialogFormInfo"> + <Properties> + <Property name="defaultCloseOperation" type="int" value="2"/> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + </SyntheticProperties> + <AuxValues> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + </AuxValues> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="pnAdministrarBancos1" min="-2" max="-2" attributes="0"/> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="pnAdministrarBancos1" min="-2" max="-2" attributes="0"/> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="frontend.bancos.PnAdministrarBancos" name="pnAdministrarBancos1"> + </Component> + </SubComponents> +</Form> Added: OpaloERP/src/frontend/bank/DgAdministrarBanco.java =================================================================== --- OpaloERP/src/frontend/bank/DgAdministrarBanco.java (rev 0) +++ OpaloERP/src/frontend/bank/DgAdministrarBanco.java 2007-06-28 00:59:35 UTC (rev 30) @@ -0,0 +1,60 @@ +/* + * DgAdministrarBanco.java + * + * Created on 13 de junio de 2007, 08:45 PM + */ + +package frontend.bank; + +/** + * + * @author VMonsantoA + */ +public class DgAdministrarBanco extends javax.swing.JDialog { + + /** Creates new form DgAdministrarBanco */ + public DgAdministrarBanco(java.awt.Frame parent, boolean modal) { + super(parent, modal); + initComponents(); + } + + /** 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. + */ + // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents + private void initComponents() { + pnAdministrarBancos1 = new frontend.bancos.PnAdministrarBancos(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + + org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(pnAdministrarBancos1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(pnAdministrarBancos1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + ); + pack(); + }// </editor-fold>//GEN-END:initComponents + + /** + * @param args the command line arguments + */ + public static void main(String args[]) { + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new DgAdministrarBanco(new javax.swing.JFrame(), true).setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private frontend.bancos.PnAdministrarBancos pnAdministrarBancos1; + // End of variables declaration//GEN-END:variables + +} Added: OpaloERP/src/frontend/bank/DgBanco.form =================================================================== --- OpaloERP/src/frontend/bank/DgBanco.form (rev 0) +++ OpaloERP/src/frontend/bank/DgBanco.form 2007-06-28 00:59:35 UTC (rev 30) @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.3" type="org.netbeans.modules.form.forminfo.JDialogFormInfo"> + <Properties> + <Property name="defaultCloseOperation" type="int" value="2"/> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + </SyntheticProperties> + <AuxValues> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + </AuxValues> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="pnBanco1" alignment="0" pref="823" max="32767" attributes="0"/> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="pnBanco1" alignment="1" pref="571" max="32767" attributes="0"/> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="frontend.bancos.PnBanco" name="pnBanco1"> + </Component> + </SubComponents> +</Form> Added: OpaloERP/src/frontend/bank/DgBanco.java =================================================================== --- OpaloERP/src/frontend/bank/DgBanco.java (rev 0) +++ OpaloERP/src/frontend/bank/DgBanco.java 2007-06-28 00:59:35 UTC (rev 30) @@ -0,0 +1,67 @@ +/* + * DgBanco.java + * + * Created on 13 de junio de 2007, 08:44 PM + */ + +package frontend.bank; + +import eventos.BancoEvent; +import eventos.IBanco; + +/** + * + * @author VMonsantoA + */ +public class DgBanco extends javax.swing.JDialog implements IBanco{ + + /** Creates new form DgBanco */ + public DgBanco(java.awt.Frame parent, boolean modal) { + super(parent, modal); + initComponents(); + } + + /** 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. + */ + // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents + private void initComponents() { + pnBanco1 = new frontend.bancos.PnBanco(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + + org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(pnBanco1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 823, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(org.jdesktop.layout.GroupLayout.TRAILING, pnBanco1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 571, Short.MAX_VALUE) + ); + pack(); + }// </editor-fold>//GEN-END:initComponents + + /** + * @param args the command line arguments + */ + public static void main(String args[]) { + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new DgBanco(new javax.swing.JFrame(), true).setVisible(true); + } + }); + } + + public void fireBanco(BancoEvent Banco) { + pnBanco1.fireBanco(Banco); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private frontend.bancos.PnBanco pnBanco1; + // End of variables declaration//GEN-END:variables + +} Added: OpaloERP/src/frontend/bank/DgCuenta.form =================================================================== --- OpaloERP/src/frontend/bank/DgCuenta.form (rev 0) +++ OpaloERP/src/frontend/bank/DgCuenta.form 2007-06-28 00:59:35 UTC (rev 30) @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.3" type="org.netbeans.modules.form.forminfo.JDialogFormInfo"> + <Properties> + <Property name="defaultCloseOperation" type="int" value="2"/> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + </SyntheticProperties> + <AuxValues> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + </AuxValues> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="pnCuentas1" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="pnCuentas1" min="-2" max="-2" attributes="0"/> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="frontend.bancos.PnCuentas" name="pnCuentas1"> + </Component> + </SubComponents> +</Form> Added: OpaloERP/src/frontend/bank/DgCuenta.java =================================================================== --- OpaloERP/src/frontend/bank/DgCuenta.java (rev 0) +++ OpaloERP/src/frontend/bank/DgCuenta.java 2007-06-28 00:59:35 UTC (rev 30) @@ -0,0 +1,72 @@ +/* + * DgCuenta.java + * + * Created on 22 de junio de 2007, 12:58 AM + */ + +package frontend.bank; + +import eventos.CuentaEvent; +import eventos.ICuentaListener; + +/** + * + * @author VMonsantoA + */ +public class DgCuenta extends javax.swing.JDialog implements ICuentaListener{ + + /** Creates new form DgCuenta */ + public DgCuenta(java.awt.Frame parent, boolean modal) { + super(parent, modal); + initComponents(); + } + + /** 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. + */ + // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents + private void initComponents() { + pnCuentas1 = new frontend.bancos.PnCuentas(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + + org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(layout.createSequentialGroup() + .add(pnCuentas1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + layout.setVerticalGroup( + layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(pnCuentas1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + ); + pack(); + }// </editor-fold>//GEN-END:initComponents + + /** + * @param args the command line arguments + */ + public static void main(String args[]) { + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new DgCuenta(new javax.swing.JFrame(), true).setVisible(true); + } + }); + } + + public void fireCuenta(CuentaEvent ev) { + pnCuentas1.fireCuenta(ev); + } + public void addListener(ICuentaListener listenre){ + pnCuentas1.addListener(listenre); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private frontend.bancos.PnCuentas pnCuentas1; + // End of variables declaration//GEN-END:variables + +} Added: OpaloERP/src/frontend/bank/PnAdministrarBancos.form =================================================================== --- OpaloERP/src/frontend/bank/PnAdministrarBancos.form (rev 0) +++ OpaloERP/src/frontend/bank/PnAdministrarBancos.form 2007-06-28 00:59:35 UTC (rev 30) @@ -0,0 +1,137 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.3" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> + <AuxValues> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + </AuxValues> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jLabel1" min="-2" pref="48" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jTextField1" min="-2" pref="272" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jXDatePicker1" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jLabel2" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jComboBox1" pref="167" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + <Component id="jToolBar1" alignment="1" pref="737" max="32767" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jScrollPane1" pref="717" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="jToolBar1" min="-2" pref="25" max="-2" attributes="0"/> + <EmptySpace min="-2" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Group type="103" alignment="0" groupAlignment="3" attributes="0"> + <Component id="jTextField1" alignment="3" min="-2" pref="24" max="-2" attributes="0"/> + <Component id="jLabel1" alignment="3" min="-2" pref="20" max="-2" attributes="0"/> + </Group> + <Component id="jXDatePicker1" alignment="0" max="32767" attributes="1"/> + <Group type="103" alignment="0" groupAlignment="3" attributes="0"> + <Component id="jLabel2" alignment="3" max="32767" attributes="1"/> + <Component id="jComboBox1" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace min="-2" max="-2" attributes="0"/> + <Component id="jScrollPane1" pref="275" max="32767" attributes="0"/> + <EmptySpace min="-2" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JToolBar" name="jToolBar1"> + + <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBoxLayout"/> + <SubComponents> + <Component class="javax.swing.JButton" name="jButton1"> + <Properties> + <Property name="text" type="java.lang.String" value="Nuevo"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="jButton2"> + <Properties> + <Property name="text" type="java.lang.String" value="Editar"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="jButton3"> + <Properties> + <Property name="text" type="java.lang.String" value="Borrar"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="jButton4"> + <Properties> + <Property name="text" type="java.lang.String" value="Visualizar"/> + </Properties> + </Component> + </SubComponents> + </Container> + <Component class="javax.swing.JLabel" name="jLabel1"> + <Properties> + <Property name="text" type="java.lang.String" value="Buscar :"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="jTextField1"> + </Component> + <Component class="org.jdesktop.swingx.JXDatePicker" name="jXDatePicker1"> + </Component> + <Component class="javax.swing.JLabel" name="jLabel2"> + <Properties> + <Property name="text" type="java.lang.String" value="Tipo Busqueda :"/> + </Properties> + </Component> + <Component class="javax.swing.JComboBox" name="jComboBox1"> + <Properties> + <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> + <StringArray count="4"> + <StringItem index="0" value="Item 1"/> + <StringItem index="1" value="Item 2"/> + <StringItem index="2" value="Item 3"/> + <StringItem index="3" value="Item 4"/> + </StringArray> + </Property> + </Properties> + </Component> + <Container class="javax.swing.JScrollPane" name="jScrollPane1"> + <AuxValues> + <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> + </AuxValues> + + <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> + <SubComponents> + <Component class="org.jdesktop.swingx.JXTable" name="jXTable1"> + <Properties> + <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> + <Table columnCount="4" rowCount="4"> + <Column editable="true" title="Title 1" type="java.lang.Object"/> + <Column editable="true" title="Title 2" type="java.lang.Object"/> + <Column editable="true" title="Title 3" type="java.lang.Object"/> + <Column editable="true" title="Title 4" type="java.lang.Object"/> + </Table> + </Property> + </Properties> + </Component> + </SubComponents> + </Container> + </SubComponents> +</Form> Added: OpaloERP/src/frontend/bank/PnAdministrarBancos.java =================================================================== --- OpaloERP/src/frontend/bank/PnAdministrarBancos.java (rev 0) +++ OpaloERP/src/frontend/bank/PnAdministrarBancos.java 2007-06-28 00:59:35 UTC (rev 30) @@ -0,0 +1,154 @@ +/* + * PnAdministrarBancos.java + * + * Created on June 10, 2007, 12:36 PM + */ + +package frontend.bank; + +import eventos.BancoEvent; +import javax.swing.JFrame; + +/** + * + * @author VMonsantoA + */ +public class PnAdministrarBancos extends javax.swing.JPanel { + private DgBanco dgb; + private int accion; + /** Creates new form PnAdministrarBancos */ + public PnAdministrarBancos() { + initComponents(); + initObject(); + } + + /** 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. + */ + // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents + private void initComponents() { + jToolBar1 = new javax.swing.JToolBar(); + jButton1 = new javax.swing.JButton(); + jButton2 = new javax.swing.JButton(); + jButton3 = new javax.swing.JButton(); + jButton4 = new javax.swing.JButton(); + jLabel1 = new javax.swing.JLabel(); + jTextField1 = new javax.swing.JTextField(); + jXDatePicker1 = new org.jdesktop.swingx.JXDatePicker(); + jLabel2 = new javax.swing.JLabel(); + jComboBox1 = new javax.swing.JComboBox(); + jScrollPane1 = new javax.swing.JScrollPane(); + jXTable1 = new org.jdesktop.swingx.JXTable(); + + jButton1.setText("Nuevo"); + jButton1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton1ActionPerformed(evt); + } + }); + + jToolBar1.add(jButton1); + + jButton2.setText("Editar"); + jToolBar1.add(jButton2); + + jButton3.setText("Borrar"); + jToolBar1.add(jButton3); + + jButton4.setText("Visualizar"); + jToolBar1.add(jButton4); + + jLabel1.setText("Buscar :"); + + jLabel2.setText("Tipo Busqueda :"); + + jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); + + jXTable1.setModel(new javax.swing.table.DefaultTableModel( + new Object [][] { + {null, null, null, null}, + {null, null, null, null}, + {null, null, null, null}, + {null, null, null, null} + }, + new String [] { + "Title 1", "Title 2", "Title 3", "Title 4" + } + )); + jScrollPane1.setViewportView(jXTable1); + + org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(layout.createSequentialGroup() + .addContainerGap() + .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 48, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(jTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 272, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(jXDatePicker1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(jLabel2) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(jComboBox1, 0, 167, Short.MAX_VALUE) + .addContainerGap()) + .add(org.jdesktop.layout.GroupLayout.TRAILING, jToolBar1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 737, Short.MAX_VALUE) + .add(layout.createSequentialGroup() + .addContainerGap() + .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 717, Short.MAX_VALUE) + .addContainerGap()) + ); + layout.setVerticalGroup( + layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(layout.createSequentialGroup() + .add(jToolBar1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) + .add(jTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 24, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 20, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .add(jXDatePicker1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) + .add(jLabel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .add(jComboBox1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 275, Short.MAX_VALUE) + .addContainerGap()) + ); + }// </editor-fold>//GEN-END:initComponents + + private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed + nuevo(); + }//GEN-LAST:event_jButton1ActionPerformed + + private void nuevo() { + BancoEvent ev = new BancoEvent(); + ev.setId(BancoEvent.NUEVO); + dgb.fireAlmacen(ev); + dgb.setVisible(true); + } + + private void initObject() { + dgb = new DgBanco(new JFrame(),false); + } + + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton jButton1; + private javax.swing.JButton jButton2; + private javax.swing.JButton jButton3; + private javax.swing.JButton jButton4; + private javax.swing.JComboBox jComboBox1; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JTextField jTextField1; + private javax.swing.JToolBar jToolBar1; + private org.jdesktop.swingx.JXDatePicker jXDatePicker1; + private org.jdesktop.swingx.JXTable jXTable1; + // End of variables declaration//GEN-END:variables + +} Added: OpaloERP/src/frontend/bank/PnAdministrarCuentas.form =================================================================== --- OpaloERP/src/frontend/bank/PnAdministrarCuentas.form (rev 0) +++ OpaloERP/src/frontend/bank/PnAdministrarCuentas.form 2007-06-28 00:59:35 UTC (rev 30) @@ -0,0 +1,132 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.3" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> + <AuxValues> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + </AuxValues> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" max="-2" attributes="0"/> + <Component id="jLabel16" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" max="-2" attributes="0"/> + <Component id="jTextField15" pref="339" max="32767" attributes="0"/> + <EmptySpace min="-2" max="-2" attributes="0"/> + <Component id="jLabel17" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" max="-2" attributes="0"/> + <Component id="jComboBox1" min="-2" pref="228" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jScrollPane1" pref="710" max="32767" attributes="0"/> + </Group> + </Group> + <EmptySpace min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jToolBar1" pref="700" max="32767" attributes="0"/> + <EmptySpace min="-2" pref="20" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Component id="jToolBar1" min="-2" pref="25" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel16" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jTextField15" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel17" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jComboBox1" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" max="-2" attributes="0"/> + <Component id="jScrollPane1" pref="275" max="32767" attributes="0"/> + <EmptySpace min="-2" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JToolBar" name="jToolBar1"> + + <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBoxLayout"/> + <SubComponents> + <Component class="javax.swing.JButton" name="jButton1"> + <Properties> + <Property name="text" type="java.lang.String" value="Nueva"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="jButton2"> + <Properties> + <Property name="text" type="java.lang.String" value="Editar"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="jButton3"> + <Properties> + <Property name="text" type="java.lang.String" value="Borrar"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="jButton4"> + <Properties> + <Property name="text" type="java.lang.String" value="Visualizar"/> + </Properties> + </Component> + </SubComponents> + </Container> + <Component class="javax.swing.JLabel" name="jLabel16"> + <Properties> + <Property name="text" type="java.lang.String" value="Buscar :"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="jTextField15"> + </Component> + <Component class="javax.swing.JLabel" name="jLabel17"> + <Properties> + <Property name="text" type="java.lang.String" value="Tipo de Busqueda :"/> + </Properties> + </Component> + <Component class="javax.swing.JComboBox" name="jComboBox1"> + <Properties> + <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> + <StringArray count="4"> + <StringItem index="0" value="Item 1"/> + <StringItem index="1" value="Item 2"/> + <StringItem index="2" value="Item 3"/> + <StringItem index="3" value="Item 4"/> + </StringArray> + </Property> + </Properties> + </Component> + <Container class="javax.swing.JScrollPane" name="jScrollPane1"> + <AuxValues> + <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> + </AuxValues> + + <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> + <SubComponents> + <Component class="org.jdesktop.swingx.JXTable" name="jXTable1"> + <Properties> + <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> + <Table columnCount="4" rowCount="4"> + <Column editable="true" title="Title 1" type="java.lang.Object"/> + <Column editable="true" title="Title 2" type="java.lang.Object"/> + <Column editable="true" title="Title 3" type="java.lang.Object"/> + <Column editable="true" title="Title 4" type="java.lang.Object"/> + </Table> + </Property> + </Properties> + </Component> + </SubComponents> + </Container> + </SubComponents> +</Form> Added: OpaloERP/src/frontend/bank/PnAdministrarCuentas.java =================================================================== --- OpaloERP/src/frontend/bank/PnAdministrarCuentas.java (rev 0) +++ OpaloERP/src/frontend/bank/PnAdministrarCuentas.java 2007-06-28 00:59:35 UTC (rev 30) @@ -0,0 +1,125 @@ +/* + * PnAdministrarCuentas.java + * + * Created on June 10, 2007, 4:32 PM + */ + +package frontend.bank; + +/** + * + * @author VMonsantoA + */ +public class PnAdministrarCuentas extends javax.swing.JPanel { + + /** Creates new form PnAdministrarCuentas */ + public PnAdministrarCuentas() { + initComponents(); + } + + /** 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. + */ + // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents + private void initComponents() { + jToolBar1 = new javax.swing.JToolBar(); + jButton1 = new javax.swing.JButton(); + jButton2 = new javax.swing.JButton(); + jButton3 = new javax.swing.JButton(); + jButton4 = new javax.swing.JButton(); + jLabel16 = new javax.swing.JLabel(); + jTextField15 = new javax.swing.JTextField(); + jLabel17 = new javax.swing.JLabel(); + jComboBox1 = new javax.swing.JComboBox(); + jScrollPane1 = new javax.swing.JScrollPane(); + jXTable1 = new org.jdesktop.swingx.JXTable(); + + jButton1.setText("Nueva"); + jToolBar1.add(jButton1); + + jButton2.setText("Editar"); + jToolBar1.add(jButton2); + + jButton3.setText("Borrar"); + jToolBar1.add(jButton3); + + jButton4.setText("Visualizar"); + jToolBar1.add(jButton4); + + jLabel16.setText("Buscar :"); + + jLabel17.setText("Tipo de Busqueda :"); + + jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); + + jXTable1.setModel(new javax.swing.table.DefaultTableModel( + new Object [][] { + {null, null, null, null}, + {null, null, null, null}, + {null, null, null, null}, + {null, null, null, null} + }, + new String [] { + "Title 1", "Title 2", "Title 3", "Title 4" + } + )); + jScrollPane1.setViewportView(jXTable1); + + org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(layout.createSequentialGroup() + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(layout.createSequentialGroup() + .addContainerGap() + .add(jLabel16) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(jTextField15, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 339, Short.MAX_VALUE) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(jLabel17) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(jComboBox1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 228, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .add(layout.createSequentialGroup() + .addContainerGap() + .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 710, Short.MAX_VALUE))) + .addContainerGap()) + .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() + .addContainerGap() + .add(jToolBar1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 700, Short.MAX_VALUE) + .add(20, 20, 20)) + ); + layout.setVerticalGroup( + layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(layout.createSequentialGroup() + .add(jToolBar1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) + .add(jLabel16) + .add(jTextField15, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(jLabel17) + .add(jComboBox1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 275, Short.MAX_VALUE) + .addContainerGap()) + ); + }// </editor-fold>//GEN-END:initComponents + + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton jButton1; + private javax.swing.JButton jButton2; + private javax.swing.JButton jButton3; + private javax.swing.JButton jButton4; + private javax.swing.JComboBox jComboBox1; + private javax.swing.JLabel jLabel16; + private javax.swing.JLabel jLabel17; + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JTextField jTextField15; + private javax.swing.JToolBar jToolBar1; + private org.jdesktop.swingx.JXTable jXTable1; + // End of variables declaration//GEN-END:variables + +} Added: OpaloERP/src/frontend/bank/PnBanco.form =================================================================== --- OpaloERP/src/frontend/bank/PnBanco.form (rev 0) +++ OpaloERP/src/frontend/bank/PnBanco.form 2007-06-28 00:59:35 UTC (rev 30) @@ -0,0 +1,816 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.3" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> + <AuxValues> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + </AuxValues> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="-2" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jTabbedPane1" alignment="0" pref="735" max="32767" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel1" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jTref" min="-2" pref="155" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jLabel2" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jTnombre" pref="484" max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <Component id="jButton12" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jButton11" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jButton10" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jButton9" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace min="-2" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jTref" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jTnombre" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" max="-2" attributes="0"/> + <Component id="jTabbedPane1" pref="464" max="32767" attributes="0"/> + <EmptySpace min="-2" pref="17" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jButton9" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jButton10" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jButton11" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jButton12" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel1"> + <Properties> + <Property name="text" type="java.lang.String" value="Codigo :"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="jTref"> + </Component> + <Container class="javax.swing.JTabbedPane" name="jTabbedPane1"> + + <Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/> + <SubComponents> + <Container class="javax.swing.JPanel" name="jPanel1"> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription"> + <JTabbedPaneConstraints tabName="Datos Generales"> + <Property name="tabTitle" type="java.lang.String" value="Datos Generales"/> + </JTabbedPaneConstraints> + </Constraint> + </Constraints> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="jPanel5" min="-2" max="-2" attributes="2"/> + <EmptySpace min="-2" max="-2" attributes="0"/> + <Component id="jPanel6" max="32767" attributes="0"/> + <EmptySpace min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="1" max="-2" attributes="0"> + <Component id="jLabel4" alignment="0" max="32767" attributes="1"/> + <Component id="jLabel3" alignment="0" max="32767" attributes="1"/> + </Group> + <EmptySpace min="-2" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jTrsocial" pref="637" max="32767" attributes="2"/> + <Component id="jTrnc" alignment="0" pref="637" max="32767" attributes="2"/> + </Group> + </Group> + </Group> + <EmptySpace min="-2" pref="10" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jTrsocial" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jTrnc" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="jPanel6" max="32767" attributes="2"/> + <Component id="jPanel5" alignment="0" min="-2" max="-2" attributes="2"/> + </Group> + <EmptySpace min="-2" pref="15" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel3"> + <Properties> + <Property name="text" type="java.lang.String" value="Razon Socilal: "/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="jTrsocial"> + </Component> + <Component class="javax.swing.JLabel" name="jLabel4"> + <Properties> + <Property name="text" type="java.lang.String" value="RNC"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="jTrnc"> + </Component> + <Container class="javax.swing.JPanel" name="jPanel5"> + <Properties> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo"> + <TitledBorder title="Direccion Principal"/> + </Border> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jScrollPane1" alignment="0" pref="326" max="32767" attributes="0"/> + <Component id="jLabel5" alignment="0" min="-2" max="-2" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel7" max="32767" attributes="1"/> + <Component id="jLabel9" alignment="0" pref="53" max="32767" attributes="1"/> + <Component id="jLabel8" alignment="0" pref="53" max="32767" attributes="1"/> + <Component id="jLabel6" alignment="0" pref="53" max="32767" attributes="1"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jTextField8" min="-2" pref="269" max="-2" attributes="0"/> + <Component id="jTextField7" min="-2" pref="269" max="-2" attributes="0"/> + <Component id="jTextField5" alignment="1" pref="269" max="32767" attributes="0"/> + <Component id="jTextField6" alignment="1" min="-2" pref="269" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel5" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="11" max="-2" attributes="0"/> + <Component id="jScrollPane1" min="-2" pref="80" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jTextField5" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jTextField6" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel7" alignment="3" min="-2" pref="16" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel8" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jTextField7" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel9" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jTextField8" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace pref="125" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JScrollPane" name="jScrollPane1"> + <AuxValues> + <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> + </AuxValues> + + <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> + <SubComponents> + <Component class="javax.swing.JTextArea" name="jTextArea1"> + <Properties> + <Property name="columns" type="int" value="20"/> + <Property name="rows" type="int" value="5"/> + </Properties> + </Component> + </SubComponents> + </Container> + <Component class="javax.swing.JLabel" name="jLabel5"> + <Properties> + <Property name="text" type="java.lang.String" value="Direcion :"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel6"> + <Properties> + <Property name="horizontalAlignment" type="int" value="4"/> + <Property name="text" type="java.lang.String" value="Ciudad :"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel7"> + <Properties> + <Property name="horizontalAlignment" type="int" value="4"/> + <Property name="text" type="java.lang.String" value="Provincia : "/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel8"> + <Properties> + <Property name="horizontalAlignment" type="int" value="4"/> + <Property name="text" type="java.lang.String" value="Region :"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel9"> + <Properties> + <Property name="horizontalAlignment" type="int" value="4"/> + <Property name="text" type="java.lang.String" value="Pais :"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="jTextField5"> + </Component> + <Component class="javax.swing.JTextField" name="jTextField6"> + </Component> + <Component class="javax.swing.JTextField" name="jTextField7"> + </Component> + <Component class="javax.swing.JTextField" name="jTextField8"> + </Component> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="jPanel6"> + <Properties> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo"> + <TitledBorder title="Contacto Principal"/> + </Border> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="-2" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Component id="jLabel15" alignment="1" max="32767" attributes="1"/> + <Component id="jLabel14" alignment="0" max="32767" attributes="1"/> + <Component id="jLabel11" alignment="0" max="32767" attributes="1"/> + <Component id="jLabel12" alignment="0" max="32767" attributes="1"/> + <Component id="jLabel13" alignment="0" max="32767" attributes="1"/> + <Component id="jLabel10" alignment="0" max="32767" attributes="1"/> + </Group> + <EmptySpace min="-2" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="txtContacto" alignment="0" pref="244" max="32767" attributes="0"/> + <Component id="txtTelefono1" alignment="0" pref="244" max="32767" attributes="0"/> + <Component id="txtTelefono2" alignment="0" pref="244" max="32767" attributes="0"/> + ... [truncated message content] |
From: <vmo...@us...> - 2007-06-28 00:22:11
|
Revision: 29 http://opaloerp.svn.sourceforge.net/opaloerp/?rev=29&view=rev Author: vmonsanto Date: 2007-06-27 17:22:13 -0700 (Wed, 27 Jun 2007) Log Message: ----------- commit vladimir modulo banco, problema el hibernate. Modified Paths: -------------- OpaloERP/nbproject/genfiles.properties OpaloERP/nbproject/project.properties OpaloERP/src/eventos/IBanco.java OpaloERP/src/frontend/almacen/DgEditarRegulacionStock.java OpaloERP/src/frontend/almacen/DgInsertarRegulacionStock.java OpaloERP/src/frontend/bancos/PnAdministrarBancos.form OpaloERP/src/frontend/bancos/PnAdministrarBancos.java OpaloERP/src/frontend/bancos/PnBanco.form OpaloERP/src/frontend/bancos/PnBanco.java OpaloERP/src/frontend/bancos/PnCuentas.form OpaloERP/src/frontend/bancos/PnCuentas.java OpaloERP/src/frontend/bancos/PnTransaccion.form OpaloERP/src/frontend/bancos/PnTransaccion.java OpaloERP/src/frontend/cliente/IInsertarCliente.form OpaloERP/src/frontend/cliente/IInsertarCliente.java OpaloERP/src/hibernate.cfg.xml OpaloERP/src/mensaje_objetos/banco/Banco.java Added Paths: ----------- OpaloERP/src/eventos/ChequeEvent.java OpaloERP/src/eventos/CuentaEvent.java OpaloERP/src/eventos/IChequeListener.java OpaloERP/src/eventos/ICuentaListener.java OpaloERP/src/eventos/ITransaccionListener.java OpaloERP/src/eventos/TransaccionEvent.java OpaloERP/src/frontend/bancos/DgAdministrarBanco.form OpaloERP/src/frontend/bancos/DgAdministrarBanco.java OpaloERP/src/frontend/bancos/DgBanco.form OpaloERP/src/frontend/bancos/DgBanco.java OpaloERP/src/frontend/bancos/DgCuenta.form OpaloERP/src/frontend/bancos/DgCuenta.java OpaloERP/src/frontend/bancos/PnCheque.form OpaloERP/src/frontend/bancos/PnCheque.java OpaloERP/src/mensaje_objetos/banco/Cheque.java OpaloERP/src/mensaje_objetos/banco/Cuenta.java OpaloERP/src/mensaje_objetos/banco/Transaccion.java OpaloERP/src/modelo_objetos/banco/ OpaloERP/src/modelo_objetos/banco/ModeloBanco.java Modified: OpaloERP/nbproject/genfiles.properties =================================================================== --- OpaloERP/nbproject/genfiles.properties 2007-06-23 21:52:15 UTC (rev 28) +++ OpaloERP/nbproject/genfiles.properties 2007-06-28 00:22:13 UTC (rev 29) @@ -1,8 +1,8 @@ -build.xml.data.CRC32=628e4a6e -build.xml.script.CRC32=38c503c3 -build.xml.stylesheet.CRC32=240b97a2 -# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. -# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. -nbproject/build-impl.xml.data.CRC32=628e4a6e -nbproject/build-impl.xml.script.CRC32=84be6d16 -nbproject/build-impl.xml.stylesheet.CRC32=65d7ca21 +build.xml.data.CRC32=628e4a6e +build.xml.script.CRC32=38c503c3 +build.xml.stylesheet.CRC32=240b97a2 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=628e4a6e +nbproject/build-impl.xml.script.CRC32=84be6d16 +nbproject/build-impl.xml.stylesheet.CRC32=20b9345e Modified: OpaloERP/nbproject/project.properties =================================================================== --- OpaloERP/nbproject/project.properties 2007-06-23 21:52:15 UTC (rev 28) +++ OpaloERP/nbproject/project.properties 2007-06-28 00:22:13 UTC (rev 29) @@ -1,63 +1,116 @@ -application.args= -build.classes.dir=${build.dir}/classes -build.classes.excludes=**/*.java,**/*.form -# This directory is removed when the project is cleaned: -build.dir=build -build.generated.dir=${build.dir}/generated -# Only compile against the classpath explicitly listed here: -build.sysclasspath=ignore -build.test.classes.dir=${build.dir}/test/classes -build.test.results.dir=${build.dir}/test/results -debug.classpath=\ - ${run.classpath} -debug.test.classpath=\ - ${run.test.classpath} -# This directory is removed when the project is cleaned: -dist.dir=dist -dist.jar=${dist.dir}/OpaloERP.jar -dist.javadoc.dir=${dist.dir}/javadoc -jar.compress=false -javac.classpath=\ - ${libs.swing-layout.classpath}:\ - ${libs.ApacheLibrerias.classpath}:\ - ${libs.Hibernate-3.2.3.classpath}:\ - ${libs.HibiernateAnotacion-3.3.0.classpath}:\ - ${libs.JasperReport1.3.classpath}:\ - ${libs.Postgresql.classpath}:\ - ${libs.SwingLabs-viejo.classpath} -# Space-separated list of extra javac options -javac.compilerargs= -javac.deprecation=false -javac.source=1.5 -javac.target=1.5 -javac.test.classpath=\ - ${javac.classpath}:\ - ${build.classes.dir}:\ - ${libs.junit.classpath} -javadoc.additionalparam= -javadoc.author=false -javadoc.encoding= -javadoc.noindex=false -javadoc.nonavbar=false -javadoc.notree=false -javadoc.private=false -javadoc.splitindex=true -javadoc.use=true -javadoc.version=false -javadoc.windowtitle= -main.class=frontend.FRModuloPrincipal -manifest.file=manifest.mf -meta.inf.dir=${src.dir}/META-INF -platform.active=default_platform -run.classpath=\ - ${javac.classpath}:\ - ${build.classes.dir} -# Space-separated list of JVM arguments used when running the project -# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value -# or test-sys-prop.name=value to set system properties for unit tests): -run.jvmargs= -run.test.classpath=\ - ${javac.test.classpath}:\ - ${build.test.classes.dir} -src.dir=src -test.src.dir=test +application.args= +build.classes.dir=${build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +# This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${build.dir}/generated +# Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +debug.classpath=\ + ${run.classpath} +debug.test.classpath=\ + ${run.test.classpath} +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/OpaloERP.jar +dist.javadoc.dir=${dist.dir}/javadoc +file.reference.antlr-2.7.6.jar=../../../Desarollo/librerias/opaloerp/antlr-2.7.6.jar +file.reference.asm-attrs.jar=../../../Desarollo/librerias/opaloerp/asm-attrs.jar +file.reference.asm.jar=../../../Desarollo/librerias/opaloerp/asm.jar +file.reference.cglib-2.1.3.jar=../../../Desarollo/librerias/opaloerp/cglib-2.1.3.jar +file.reference.commons-beanutils-1.7.jar=../../../Desarollo/librerias/opaloerp/commons-beanutils-1.7.jar +file.reference.commons-collections-2.1.jar=../../../Desarollo/librerias/opaloerp/commons-collections-2.1.jar +file.reference.commons-dbcp-1.2.1.jar=../../../Desarollo/librerias/opaloerp/commons-dbcp-1.2.1.jar +file.reference.commons-digester-1.7.jar=../../../Desarollo/librerias/opaloerp/commons-digester-1.7.jar +file.reference.commons-el-1.0.jar=../../../Desarollo/librerias/opaloerp/commons-el-1.0.jar +file.reference.commons-fileupload-1.2.jar=../../../Desarollo/librerias/opaloerp/commons-fileupload-1.2.jar +file.reference.commons-io-1.1.jar=../../../Desarollo/librerias/opaloerp/commons-io-1.1.jar +file.reference.commons-io-1.3.1.jar=../../../Desarollo/librerias/opaloerp/commons-io-1.3.1.jar +file.reference.commons-javaflow-20060411.jar=../../../Desarollo/librerias/opaloerp/commons-javaflow-20060411.jar +file.reference.commons-lang-2.1.jar=../../../Desarollo/librerias/opaloerp/commons-lang-2.1.jar +file.reference.commons-logging-1.0.2.jar=../../../Desarollo/librerias/opaloerp/commons-logging-1.0.2.jar +file.reference.commons-pool-1.3.jar=../../../Desarollo/librerias/opaloerp/commons-pool-1.3.jar +file.reference.dom4j-1.6.1.jar=../../../Desarollo/librerias/opaloerp/dom4j-1.6.1.jar +file.reference.ejb3-persistence.jar=../../../Desarollo/librerias/opaloerp/ejb3-persistence.jar +file.reference.hibernate-annotations.jar=../../../Desarollo/librerias/opaloerp/hibernate-annotations.jar +file.reference.hibernate-commons-annotations.jar=../../../Desarollo/librerias/opaloerp/hibernate-commons-annotations.jar +file.reference.hibernate3.jar=../../../Desarollo/librerias/opaloerp/hibernate3.jar +file.reference.itext-1.3.1.jar=../../../Desarollo/librerias/opaloerp/itext-1.3.1.jar +file.reference.jasperreports-1.3.0.jar=../../../Desarollo/librerias/opaloerp/jasperreports-1.3.0.jar +file.reference.jcommon-1.0.0.jar=../../../Desarollo/librerias/opaloerp/jcommon-1.0.0.jar +file.reference.jdt-compiler-3.1.1.jar=../../../Desarollo/librerias/opaloerp/jdt-compiler-3.1.1.jar +file.reference.jta.jar=../../../Desarollo/librerias/opaloerp/jta.jar +file.reference.log4j-1.2.11.jar=../../../Desarollo/librerias/opaloerp/log4j-1.2.11.jar +file.reference.postgresql-8.1-407.jdbc3.jar=../../../Desarollo/librerias/opaloerp/postgresql-8.1-407.jdbc3.jar +file.reference.swing-layout-1.0.jar=../../../Desarollo/librerias/opaloerp/swing-layout-1.0.jar +file.reference.swinglabs-0.8.0.jar=../../../Desarollo/librerias/opaloerp/swinglabs-0.8.0.jar +jar.compress=false +javac.classpath=\ + ${file.reference.antlr-2.7.6.jar}:\ + ${file.reference.asm-attrs.jar}:\ + ${file.reference.asm.jar}:\ + ${file.reference.cglib-2.1.3.jar}:\ + ${file.reference.commons-beanutils-1.7.jar}:\ + ${file.reference.commons-collections-2.1.jar}:\ + ${file.reference.commons-dbcp-1.2.1.jar}:\ + ${file.reference.commons-digester-1.7.jar}:\ + ${file.reference.commons-el-1.0.jar}:\ + ${file.reference.commons-fileupload-1.2.jar}:\ + ${file.reference.commons-io-1.1.jar}:\ + ${file.reference.commons-io-1.3.1.jar}:\ + ${file.reference.commons-javaflow-20060411.jar}:\ + ${file.reference.commons-lang-2.1.jar}:\ + ${file.reference.commons-logging-1.0.2.jar}:\ + ${file.reference.commons-pool-1.3.jar}:\ + ${file.reference.dom4j-1.6.1.jar}:\ + ${file.reference.ejb3-persistence.jar}:\ + ${file.reference.hibernate-annotations.jar}:\ + ${file.reference.hibernate-commons-annotations.jar}:\ + ${file.reference.hibernate3.jar}:\ + ${file.reference.itext-1.3.1.jar}:\ + ${file.reference.jasperreports-1.3.0.jar}:\ + ${file.reference.jcommon-1.0.0.jar}:\ + ${file.reference.jdt-compiler-3.1.1.jar}:\ + ${file.reference.jta.jar}:\ + ${file.reference.log4j-1.2.11.jar}:\ + ${file.reference.postgresql-8.1-407.jdbc3.jar}:\ + ${file.reference.swinglabs-0.8.0.jar}:\ + ${file.reference.swing-layout-1.0.jar} +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.source=1.5 +javac.target=1.5 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir}:\ + ${libs.junit.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding= +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +main.class=frontend.FRModuloPrincipal +manifest.file=manifest.mf +meta.inf.dir=${src.dir}/META-INF +platform.active=default_platform +run.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +# Space-separated list of JVM arguments used when running the project +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value +# or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs= +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +src.dir=src +test.src.dir=test Added: OpaloERP/src/eventos/ChequeEvent.java =================================================================== --- OpaloERP/src/eventos/ChequeEvent.java (rev 0) +++ OpaloERP/src/eventos/ChequeEvent.java 2007-06-28 00:22:13 UTC (rev 29) @@ -0,0 +1,48 @@ +/* + * BancoEvent.java + * + * Created on 13 de junio de 2007, 12:27 AM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package eventos; + + +import mensaje_objetos.banco.Cheque; + +/** + * + * @author VMonsantoA + */ +public class ChequeEvent { + public static final int NUEVO=0; + public static final int EDITAR=1; + public static final int VISUALIZAR=2; + public static final int SELECCIONAR_CHEQUE=3; + private Cheque cheque; + private int id; + /** Creates a new instance of BancoEvent */ + public ChequeEvent() { + } + + + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public Cheque getCheque() { + return cheque; + } + + public void setCheque(Cheque cheque) { + this.cheque = cheque; + } + +} Added: OpaloERP/src/eventos/CuentaEvent.java =================================================================== --- OpaloERP/src/eventos/CuentaEvent.java (rev 0) +++ OpaloERP/src/eventos/CuentaEvent.java 2007-06-28 00:22:13 UTC (rev 29) @@ -0,0 +1,46 @@ +/* + * BancoEvent.java + * + * Created on 13 de junio de 2007, 12:27 AM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package eventos; + +import mensaje_objetos.banco.Banco; +import mensaje_objetos.banco.Cuenta; + +/** + * + * @author VMonsantoA + */ +public class CuentaEvent { + public static final int NUEVO=0; + public static final int EDITAR=1; + public static final int VISUALIZAR=2; + public static final int SELECCIONAR_CUENTA=3; + private Cuenta cuenta; + private int id; + /** Creates a new instance of BancoEvent */ + public CuentaEvent() { + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public Cuenta getCuenta() { + return cuenta; + } + + public void setCuenta(Cuenta cuenta) { + this.cuenta = cuenta; + } + +} Modified: OpaloERP/src/eventos/IBanco.java =================================================================== --- OpaloERP/src/eventos/IBanco.java 2007-06-23 21:52:15 UTC (rev 28) +++ OpaloERP/src/eventos/IBanco.java 2007-06-28 00:22:13 UTC (rev 29) @@ -15,6 +15,6 @@ */ public interface IBanco { - void fireAlmacen(BancoEvent Banco); + void fireBanco(BancoEvent Banco); } Added: OpaloERP/src/eventos/IChequeListener.java =================================================================== --- OpaloERP/src/eventos/IChequeListener.java (rev 0) +++ OpaloERP/src/eventos/IChequeListener.java 2007-06-28 00:22:13 UTC (rev 29) @@ -0,0 +1,20 @@ +/* + * IBanco.java + * + * Created on 13 de junio de 2007, 12:45 AM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package eventos; + +/** + * + * @author VMonsantoA + */ +public interface IChequeListener { + + void fireCheque(ChequeEvent ev); + +} Added: OpaloERP/src/eventos/ICuentaListener.java =================================================================== --- OpaloERP/src/eventos/ICuentaListener.java (rev 0) +++ OpaloERP/src/eventos/ICuentaListener.java 2007-06-28 00:22:13 UTC (rev 29) @@ -0,0 +1,20 @@ +/* + * IGrupoListener.java + * + * Created on November 2, 2006, 3:46 PM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package eventos; + +/** + * + * @author vladimir + */ +public interface ICuentaListener { + + + void fireCuenta(CuentaEvent ev); +} Added: OpaloERP/src/eventos/ITransaccionListener.java =================================================================== --- OpaloERP/src/eventos/ITransaccionListener.java (rev 0) +++ OpaloERP/src/eventos/ITransaccionListener.java 2007-06-28 00:22:13 UTC (rev 29) @@ -0,0 +1,23 @@ +/* + * IGrupoListener.java + * + * Created on November 2, 2006, 3:46 PM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package eventos; + +import mensaje_objetos.banco.Transaccion; + +/** + * + * @author vladimir + */ +public interface ITransaccionListener { + + + void fireTransaccion(TransaccionEvent ev); + + } Added: OpaloERP/src/eventos/TransaccionEvent.java =================================================================== --- OpaloERP/src/eventos/TransaccionEvent.java (rev 0) +++ OpaloERP/src/eventos/TransaccionEvent.java 2007-06-28 00:22:13 UTC (rev 29) @@ -0,0 +1,45 @@ +/* + * TransaccionEvent.java + * + * Created on 22 de junio de 2007, 04:52 PM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package eventos; + +import mensaje_objetos.banco.Transaccion; + +/** + * + * @author VMonsantoA + */ +public class TransaccionEvent { + public static final int NUEVO=0; + public static final int EDITAR=1; + public static final int VISUALIZAR=2; + public static final int SELECCIONAR_CUENTA=3; + private Transaccion transaccion;; + private int id; + /** Creates a new instance of TransaccionEvent */ + public TransaccionEvent() { + } + + public Transaccion getTransaccion() { + return transaccion; + } + + public void setTransaccion(Transaccion transaccion) { + this.transaccion = transaccion; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + +} Modified: OpaloERP/src/frontend/almacen/DgEditarRegulacionStock.java =================================================================== --- OpaloERP/src/frontend/almacen/DgEditarRegulacionStock.java 2007-06-23 21:52:15 UTC (rev 28) +++ OpaloERP/src/frontend/almacen/DgEditarRegulacionStock.java 2007-06-28 00:22:13 UTC (rev 29) @@ -9,6 +9,7 @@ import eventos.IRegulacionStock; import eventos.RegulacionStockEvent; + /** * * @author vacax Modified: OpaloERP/src/frontend/almacen/DgInsertarRegulacionStock.java =================================================================== --- OpaloERP/src/frontend/almacen/DgInsertarRegulacionStock.java 2007-06-23 21:52:15 UTC (rev 28) +++ OpaloERP/src/frontend/almacen/DgInsertarRegulacionStock.java 2007-06-28 00:22:13 UTC (rev 29) @@ -8,9 +8,7 @@ import eventos.IRegulacionStock; import eventos.RegulacionStockEvent; -import mensaje_objetos.almacen.ProductoStock; import mensaje_objetos.almacen.RegulacionStock; -import modelo_objetos.almacen.ModeloProductoStock; import modelo_objetos.almacen.ModeloRegulacionStock; /** Added: OpaloERP/src/frontend/bancos/DgAdministrarBanco.form =================================================================== --- OpaloERP/src/frontend/bancos/DgAdministrarBanco.form (rev 0) +++ OpaloERP/src/frontend/bancos/DgAdministrarBanco.form 2007-06-28 00:22:13 UTC (rev 29) @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.3" type="org.netbeans.modules.form.forminfo.JDialogFormInfo"> + <Properties> + <Property name="defaultCloseOperation" type="int" value="2"/> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + </SyntheticProperties> + <AuxValues> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + </AuxValues> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="pnAdministrarBancos1" min="-2" max="-2" attributes="0"/> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="pnAdministrarBancos1" min="-2" max="-2" attributes="0"/> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="frontend.bancos.PnAdministrarBancos" name="pnAdministrarBancos1"> + </Component> + </SubComponents> +</Form> Added: OpaloERP/src/frontend/bancos/DgAdministrarBanco.java =================================================================== --- OpaloERP/src/frontend/bancos/DgAdministrarBanco.java (rev 0) +++ OpaloERP/src/frontend/bancos/DgAdministrarBanco.java 2007-06-28 00:22:13 UTC (rev 29) @@ -0,0 +1,60 @@ +/* + * DgAdministrarBanco.java + * + * Created on 13 de junio de 2007, 08:45 PM + */ + +package frontend.bancos; + +/** + * + * @author VMonsantoA + */ +public class DgAdministrarBanco extends javax.swing.JDialog { + + /** Creates new form DgAdministrarBanco */ + public DgAdministrarBanco(java.awt.Frame parent, boolean modal) { + super(parent, modal); + initComponents(); + } + + /** 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. + */ + // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents + private void initComponents() { + pnAdministrarBancos1 = new frontend.bancos.PnAdministrarBancos(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + + org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(pnAdministrarBancos1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(pnAdministrarBancos1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + ); + pack(); + }// </editor-fold>//GEN-END:initComponents + + /** + * @param args the command line arguments + */ + public static void main(String args[]) { + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new DgAdministrarBanco(new javax.swing.JFrame(), true).setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private frontend.bancos.PnAdministrarBancos pnAdministrarBancos1; + // End of variables declaration//GEN-END:variables + +} Added: OpaloERP/src/frontend/bancos/DgBanco.form =================================================================== --- OpaloERP/src/frontend/bancos/DgBanco.form (rev 0) +++ OpaloERP/src/frontend/bancos/DgBanco.form 2007-06-28 00:22:13 UTC (rev 29) @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.3" type="org.netbeans.modules.form.forminfo.JDialogFormInfo"> + <Properties> + <Property name="defaultCloseOperation" type="int" value="2"/> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + </SyntheticProperties> + <AuxValues> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + </AuxValues> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="pnBanco1" alignment="0" pref="823" max="32767" attributes="0"/> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="pnBanco1" alignment="1" pref="571" max="32767" attributes="0"/> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="frontend.bancos.PnBanco" name="pnBanco1"> + </Component> + </SubComponents> +</Form> Added: OpaloERP/src/frontend/bancos/DgBanco.java =================================================================== --- OpaloERP/src/frontend/bancos/DgBanco.java (rev 0) +++ OpaloERP/src/frontend/bancos/DgBanco.java 2007-06-28 00:22:13 UTC (rev 29) @@ -0,0 +1,67 @@ +/* + * DgBanco.java + * + * Created on 13 de junio de 2007, 08:44 PM + */ + +package frontend.bancos; + +import eventos.BancoEvent; +import eventos.IBanco; + +/** + * + * @author VMonsantoA + */ +public class DgBanco extends javax.swing.JDialog implements IBanco{ + + /** Creates new form DgBanco */ + public DgBanco(java.awt.Frame parent, boolean modal) { + super(parent, modal); + initComponents(); + } + + /** 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. + */ + // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents + private void initComponents() { + pnBanco1 = new frontend.bancos.PnBanco(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + + org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(pnBanco1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 823, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(org.jdesktop.layout.GroupLayout.TRAILING, pnBanco1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 571, Short.MAX_VALUE) + ); + pack(); + }// </editor-fold>//GEN-END:initComponents + + /** + * @param args the command line arguments + */ + public static void main(String args[]) { + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new DgBanco(new javax.swing.JFrame(), true).setVisible(true); + } + }); + } + + public void fireBanco(BancoEvent Banco) { + pnBanco1.fireBanco(Banco); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private frontend.bancos.PnBanco pnBanco1; + // End of variables declaration//GEN-END:variables + +} Added: OpaloERP/src/frontend/bancos/DgCuenta.form =================================================================== --- OpaloERP/src/frontend/bancos/DgCuenta.form (rev 0) +++ OpaloERP/src/frontend/bancos/DgCuenta.form 2007-06-28 00:22:13 UTC (rev 29) @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.3" type="org.netbeans.modules.form.forminfo.JDialogFormInfo"> + <Properties> + <Property name="defaultCloseOperation" type="int" value="2"/> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + </SyntheticProperties> + <AuxValues> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + </AuxValues> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="pnCuentas1" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="pnCuentas1" min="-2" max="-2" attributes="0"/> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="frontend.bancos.PnCuentas" name="pnCuentas1"> + </Component> + </SubComponents> +</Form> Added: OpaloERP/src/frontend/bancos/DgCuenta.java =================================================================== --- OpaloERP/src/frontend/bancos/DgCuenta.java (rev 0) +++ OpaloERP/src/frontend/bancos/DgCuenta.java 2007-06-28 00:22:13 UTC (rev 29) @@ -0,0 +1,72 @@ +/* + * DgCuenta.java + * + * Created on 22 de junio de 2007, 12:58 AM + */ + +package frontend.bancos; + +import eventos.CuentaEvent; +import eventos.ICuentaListener; + +/** + * + * @author VMonsantoA + */ +public class DgCuenta extends javax.swing.JDialog implements ICuentaListener{ + + /** Creates new form DgCuenta */ + public DgCuenta(java.awt.Frame parent, boolean modal) { + super(parent, modal); + initComponents(); + } + + /** 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. + */ + // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents + private void initComponents() { + pnCuentas1 = new frontend.bancos.PnCuentas(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + + org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(layout.createSequentialGroup() + .add(pnCuentas1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + layout.setVerticalGroup( + layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(pnCuentas1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + ); + pack(); + }// </editor-fold>//GEN-END:initComponents + + /** + * @param args the command line arguments + */ + public static void main(String args[]) { + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new DgCuenta(new javax.swing.JFrame(), true).setVisible(true); + } + }); + } + + public void fireCuenta(CuentaEvent ev) { + pnCuentas1.fireCuenta(ev); + } + public void addListener(ICuentaListener listenre){ + pnCuentas1.addListener(listenre); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private frontend.bancos.PnCuentas pnCuentas1; + // End of variables declaration//GEN-END:variables + +} Modified: OpaloERP/src/frontend/bancos/PnAdministrarBancos.form =================================================================== --- OpaloERP/src/frontend/bancos/PnAdministrarBancos.form 2007-06-23 21:52:15 UTC (rev 28) +++ OpaloERP/src/frontend/bancos/PnAdministrarBancos.form 2007-06-28 00:22:13 UTC (rev 29) @@ -22,7 +22,7 @@ <EmptySpace max="-2" attributes="0"/> <Component id="jLabel2" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> - <Component id="jComboBox1" pref="166" max="32767" attributes="0"/> + <Component id="jComboBox1" pref="167" max="32767" attributes="0"/> <EmptySpace max="-2" attributes="0"/> </Group> <Component id="jToolBar1" alignment="1" pref="737" max="32767" attributes="0"/> @@ -65,6 +65,9 @@ <Properties> <Property name="text" type="java.lang.String" value="Nuevo"/> </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/> + </Events> </Component> <Component class="javax.swing.JButton" name="jButton2"> <Properties> Modified: OpaloERP/src/frontend/bancos/PnAdministrarBancos.java =================================================================== --- OpaloERP/src/frontend/bancos/PnAdministrarBancos.java 2007-06-23 21:52:15 UTC (rev 28) +++ OpaloERP/src/frontend/bancos/PnAdministrarBancos.java 2007-06-28 00:22:13 UTC (rev 29) @@ -6,15 +6,20 @@ package frontend.bancos; +import eventos.BancoEvent; +import javax.swing.JFrame; + /** * * @author VMonsantoA */ public class PnAdministrarBancos extends javax.swing.JPanel { - + private DgBanco dgb; + private int accion; /** Creates new form PnAdministrarBancos */ public PnAdministrarBancos() { initComponents(); + initObject(); } /** This method is called from within the constructor to @@ -38,6 +43,12 @@ jXTable1 = new org.jdesktop.swingx.JXTable(); jButton1.setText("Nuevo"); + jButton1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton1ActionPerformed(evt); + } + }); + jToolBar1.add(jButton1); jButton2.setText("Editar"); @@ -82,7 +93,7 @@ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jLabel2) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(jComboBox1, 0, 166, Short.MAX_VALUE) + .add(jComboBox1, 0, 167, Short.MAX_VALUE) .addContainerGap()) .add(org.jdesktop.layout.GroupLayout.TRAILING, jToolBar1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 737, Short.MAX_VALUE) .add(layout.createSequentialGroup() @@ -108,6 +119,21 @@ .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents + + private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed + nuevo(); + }//GEN-LAST:event_jButton1ActionPerformed + + private void nuevo() { + BancoEvent ev = new BancoEvent(); + ev.setId(BancoEvent.NUEVO); + dgb.fireAlmacen(ev); + dgb.setVisible(true); + } + + private void initObject() { + dgb = new DgBanco(new JFrame(),false); + } // Variables declaration - do not modify//GEN-BEGIN:variables Modified: OpaloERP/src/frontend/bancos/PnBanco.form =================================================================== --- OpaloERP/src/frontend/bancos/PnBanco.form 2007-06-23 21:52:15 UTC (rev 28) +++ OpaloERP/src/frontend/bancos/PnBanco.form 2007-06-28 00:22:13 UTC (rev 29) @@ -12,37 +12,53 @@ <Layout> <DimensionLayout dim="0"> <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace max="-2" attributes="0"/> + <Group type="102" attributes="0"> + <EmptySpace min="-2" max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jTabbedPane1" alignment="0" min="-2" pref="735" max="-2" attributes="0"/> + <Component id="jTabbedPane1" alignment="0" pref="735" max="32767" attributes="0"/> <Group type="102" alignment="0" attributes="0"> <Component id="jLabel1" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> - <Component id="jTextField1" min="-2" pref="155" max="-2" attributes="0"/> + <Component id="jTref" min="-2" pref="155" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> <Component id="jLabel2" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> - <Component id="jTextField2" pref="484" max="32767" attributes="0"/> + <Component id="jTnombre" pref="484" max="32767" attributes="0"/> </Group> + <Group type="102" alignment="1" attributes="0"> + <Component id="jButton12" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jButton11" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jButton10" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jButton9" min="-2" max="-2" attributes="0"/> + </Group> </Group> - <EmptySpace max="-2" attributes="0"/> + <EmptySpace min="-2" max="-2" attributes="0"/> </Group> </Group> </DimensionLayout> <DimensionLayout dim="1"> <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0"> - <EmptySpace max="-2" attributes="0"/> + <EmptySpace min="-2" max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jTextField1" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jTref" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jTextField2" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jTnombre" alignment="3" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace max="-2" attributes="0"/> - <Component id="jTabbedPane1" pref="483" max="32767" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> + <EmptySpace min="-2" max="-2" attributes="0"/> + <Component id="jTabbedPane1" pref="464" max="32767" attributes="0"/> + <EmptySpace min="-2" pref="17" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jButton9" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jButton10" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jButton11" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jButton12" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" max="-2" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -53,7 +69,7 @@ <Property name="text" type="java.lang.String" value="Codigo :"/> </Properties> </Component> - <Component class="javax.swing.JTextField" name="jTextField1"> + <Component class="javax.swing.JTextField" name="jTref"> </Component> <Container class="javax.swing.JTabbedPane" name="jTabbedPane1"> @@ -72,49 +88,49 @@ <DimensionLayout dim="0"> <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0"> - <EmptySpace max="-2" attributes="0"/> + <EmptySpace min="-2" max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0"> - <Component id="jPanel5" min="-2" max="-2" attributes="1"/> - <EmptySpace max="-2" attributes="0"/> + <Component id="jPanel5" min="-2" max="-2" attributes="2"/> + <EmptySpace min="-2" max="-2" attributes="0"/> <Component id="jPanel6" max="32767" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> + <EmptySpace min="-2" max="-2" attributes="0"/> </Group> <Group type="102" alignment="0" attributes="0"> <Group type="103" groupAlignment="1" max="-2" attributes="0"> <Component id="jLabel4" alignment="0" max="32767" attributes="1"/> <Component id="jLabel3" alignment="0" max="32767" attributes="1"/> </Group> - <EmptySpace max="-2" attributes="0"/> + <EmptySpace min="-2" max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jTextField3" pref="637" max="32767" attributes="1"/> - <Component id="jTextField4" alignment="0" pref="637" max="32767" attributes="1"/> + <Component id="jTrsocial" pref="637" max="32767" attributes="2"/> + <Component id="jTrnc" alignment="0" pref="637" max="32767" attributes="2"/> </Group> </Group> </Group> - <EmptySpace min="-2" pref="83" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="10" max="-2" attributes="0"/> </Group> </Group> </DimensionLayout> <DimensionLayout dim="1"> <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0"> - <EmptySpace max="-2" attributes="0"/> + <EmptySpace min="-2" max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jTextField3" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jTrsocial" alignment="3" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace max="-2" attributes="0"/> + <EmptySpace min="-2" max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> <Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jTextField4" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jTrnc" alignment="3" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace max="-2" attributes="0"/> + <EmptySpace min="-2" max="-2" attributes="0"/> <Group type="103" groupAlignment="1" attributes="0"> - <Component id="jPanel6" max="32767" attributes="1"/> - <Component id="jPanel5" alignment="0" min="-2" max="-2" attributes="1"/> + <Component id="jPanel6" max="32767" attributes="2"/> + <Component id="jPanel5" alignment="0" min="-2" max="-2" attributes="2"/> </Group> - <EmptySpace pref="34" max="32767" attributes="0"/> + <EmptySpace min="-2" pref="15" max="-2" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -125,14 +141,14 @@ <Property name="text" type="java.lang.String" value="Razon Socilal: "/> </Properties> </Component> - <Component class="javax.swing.JTextField" name="jTextField3"> + <Component class="javax.swing.JTextField" name="jTrsocial"> </Component> <Component class="javax.swing.JLabel" name="jLabel4"> <Properties> <Property name="text" type="java.lang.String" value="RNC"/> </Properties> </Component> - <Component class="javax.swing.JTextField" name="jTextField4"> + <Component class="javax.swing.JTextField" name="jTrnc"> </Component> <Container class="javax.swing.JPanel" name="jPanel5"> <Properties> @@ -270,7 +286,7 @@ <DimensionLayout dim="0"> <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" attributes="0"> - <EmptySpace max="-2" attributes="0"/> + <EmptySpace min="-2" max="-2" attributes="0"/> <Group type="103" groupAlignment="0" max="-2" attributes="0"> <Component id="jLabel15" alignment="1" max="32767" attributes="1"/> <Component id="jLabel14" alignment="0" max="32767" attributes="1"/> @@ -279,16 +295,16 @@ <Component id="jLabel13" alignment="0" max="32767" attributes="1"/> <Component id="jLabel10" alignment="0" max="32767" attributes="1"/> </Group> - <EmptySpace max="-2" attributes="0"/> + <EmptySpace min="-2" max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jTextField10" alignment="0" pref="244" max="32767" attributes="0"/> - <Component id="jTextField9" alignment="0" pref="244" max="32767" attributes="0"/> - <Component id="jTextField11" alignment="0" pref="244" max="32767" attributes="0"/> - <Component id="jTextField12" alignment="0" pref="244" max="32767" attributes="0"/> - <Component id="jTextField13" alignment="1" min="-2" pref="244" max="-2" attributes="0"/> - <Component id="jTextField14" alignment="1" min="-2" pref="244" max="-2" attributes="0"/> + <Component id="txtContacto" alignment="0" pref="244" max="32767" attributes="0"/> + <Component id="txtTelefono1" alignment="0" pref="244" max="32767" attributes="0"/> + <Component id="txtTelefono2" alignment="0" pref="244" max="32767" attributes="0"/> + <Component id="txtFax" alignment="0" pref="244" max="32767" attributes="0"/> + <Component id="txtEmail" alignment="1" pref="244" max="32767" attributes="0"/> + <Component id="txtCargo" alignment="1" pref="244" max="32767" attributes="0"/> </Group> - <EmptySpace max="-2" attributes="0"/> + <EmptySpace min="-2" max="-2" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -298,31 +314,31 @@ <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="1" attributes="0"> <Component id="jLabel10" min="-2" max="-2" attributes="0"/> - <Component id="jTextField10" min="-2" max="-2" attributes="0"/> + <Component id="txtContacto" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> <Component id="jLabel11" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jTextField9" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtTelefono1" alignment="3" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> <Component id="jLabel12" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jTextField11" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtTelefono2" alignment="3" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> <Component id="jLabel13" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jTextField12" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtFax" alignment="3" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> <Component id="jLabel14" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jTextField13" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtEmail" alignment="3" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> - <Component id="jTextField14" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtCargo" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="jLabel15" alignment="3" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace pref="175" max="32767" attributes="0"/> @@ -361,55 +377,22 @@ <Property name="text" type="java.lang.String" value="Cargo :"/> </Properties> </Component> - <Component class="javax.swing.JTextField" name="jTextField9"> + <Component class="javax.swing.JTextField" name="txtTelefono1"> </Component> - <Component class="javax.swing.JTextField" name="jTextField10"> + <Component class="javax.swing.JTextField" name="txtContacto"> </Component> - <Component class="javax.swing.JTextField" name="jTextField11"> + <Component class="javax.swing.JTextField" name="txtTelefono2"> </Component> - <Component class="javax.swing.JTextField" name="jTextField12"> + <Component class="javax.swing.JTextField" name="txtFax"> </Component> - <Component class="javax.swing.JTextField" name="jTextField13"> + <Component class="javax.swing.JTextField" name="txtEmail"> </Component> - <Component class="javax.swing.JTextField" name="jTextField14"> + <Component class="javax.swing.JTextField" name="txtCargo"> </Component> </SubComponents> </Container> </SubComponents> </Container> - <Container class="javax.swing.JPanel" name="jPanel2"> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription"> - <JTabbedPaneConstraints tabName="Cuentas"> - <Property name="tabTitle" type="java.lang.String" value="Cuentas"/> - </JTabbedPaneConstraints> - </Constraint> - </Constraints> - - <Layout> - <DimensionLayout dim="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <Component id="pnAdministrarCuentas1" min="-2" max="-2" attributes="0"/> - <EmptySpace max="32767" attributes="0"/> - </Group> - </Group> - </DimensionLayout> - <DimensionLayout dim="1"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace max="-2" attributes="0"/> - <Component id="pnAdministrarCuentas1" pref="433" max="32767" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - </Group> - </Group> - </DimensionLayout> - </Layout> - <SubComponents> - <Component class="frontend.bancos.PnAdministrarCuentas" name="pnAdministrarCuentas1"> - </Component> - </SubComponents> - </Container> <Container class="javax.swing.JPanel" name="jPanel4"> <Constraints> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription"> @@ -476,6 +459,9 @@ <Properties> <Property name="text" type="java.lang.String" value="Nuevo"/> </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton5ActionPerformed"/> + </Events> </Component> <Component class="javax.swing.JButton" name="jButton6"> <Properties> @@ -501,7 +487,7 @@ <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> <SubComponents> - <Component class="org.jdesktop.swingx.JXTable" name="jXTable1"> + <Component class="org.jdesktop.swingx.JXTable" name="jXTDirecciones"> <Properties> <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> <Table columnCount="4" rowCount="4"> @@ -585,7 +571,7 @@ <Component id="jComboBox1" alignment="3" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> - <Component id="jScrollPane3" pref="374" max="32767" attributes="0"/> + <Component id="jScrollPane3" pref="355" max="32767" attributes="0"/> <EmptySpace max="-2" attributes="0"/> </Group> </Group> @@ -600,6 +586,9 @@ <Properties> <Property name="text" type="java.lang.String" value="Nuevo"/> </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/> + </Events> </Component> <Component class="javax.swing.JButton" name="jButton2"> <Properties> @@ -649,7 +638,7 @@ <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> <SubComponents> - <Component class="org.jdesktop.swingx.JXTable" name="jXTable2"> + <Component class="org.jdesktop.swingx.JXTable" name="tableContacto"> <Properties> <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> <Table columnCount="4" rowCount="4"> @@ -665,6 +654,132 @@ </Container> </SubComponents> </Container> + <Container class="javax.swing.JPanel" name="jPanel2"> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription"> + <JTabbedPaneConstraints tabName="Cuentas"> + <Property name="tabTitle" type="java.lang.String" value="Cuentas"/> + </JTabbedPaneConstraints> + </Constraint> + </Constraints> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="jScrollPane4" alignment="0" pref="710" max="32767" attributes="0"/> + <Component id="jToolBar3" alignment="1" pref="710" max="32767" attributes="0"/> + <Group type="102" alignment="1" attributes="0"> + <Component id="jLabel20" pref="45" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jTextField17" min="-2" pref="334" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jLabel21" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jComboBox3" min="-2" pref="227" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Component id="jToolBar3" min="-2" pref="25" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jComboBox3" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel21" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jTextField17" alignment="3" min="-2" max="-2" attributes="... [truncated message content] |
From: <va...@us...> - 2007-06-23 21:52:14
|
Revision: 28 http://opaloerp.svn.sourceforge.net/opaloerp/?rev=28&view=rev Author: vacax Date: 2007-06-23 14:52:15 -0700 (Sat, 23 Jun 2007) Log Message: ----------- Soportanto mas o menos la regulacion de stock. falta la pulida. PAX Modified Paths: -------------- OpaloERP/src/frontend/almacen/DgArticulo.java OpaloERP/src/frontend/almacen/DgInsertarRegulacionStock.java OpaloERP/src/frontend/almacen/IInsertarArticulos.java OpaloERP/src/frontend/almacen/PnEditarRegulacionStock.form OpaloERP/src/frontend/almacen/PnEditarRegulacionStock.java OpaloERP/src/modelo_objetos/almacen/ModeloProductoStock.java OpaloERP/src/modelo_objetos/almacen/ModeloRegulacionStock.java Modified: OpaloERP/src/frontend/almacen/DgArticulo.java =================================================================== --- OpaloERP/src/frontend/almacen/DgArticulo.java 2007-06-23 02:16:54 UTC (rev 27) +++ OpaloERP/src/frontend/almacen/DgArticulo.java 2007-06-23 21:52:15 UTC (rev 28) @@ -345,6 +345,7 @@ JOptionPane.showMessageDialog(this,msg,"Aviso",JOptionPane.WARNING_MESSAGE); } + /** *metodo para limpiar la informacion. */ Modified: OpaloERP/src/frontend/almacen/DgInsertarRegulacionStock.java =================================================================== --- OpaloERP/src/frontend/almacen/DgInsertarRegulacionStock.java 2007-06-23 02:16:54 UTC (rev 27) +++ OpaloERP/src/frontend/almacen/DgInsertarRegulacionStock.java 2007-06-23 21:52:15 UTC (rev 28) @@ -8,7 +8,9 @@ import eventos.IRegulacionStock; import eventos.RegulacionStockEvent; +import mensaje_objetos.almacen.ProductoStock; import mensaje_objetos.almacen.RegulacionStock; +import modelo_objetos.almacen.ModeloProductoStock; import modelo_objetos.almacen.ModeloRegulacionStock; /** @@ -67,7 +69,7 @@ tmp.setCantidadInicial(Double.parseDouble(txtCantidadActual.getText())); tmp.setCantidadFinal(Double.parseDouble(txtCantidadNueva.getText())); tmp.setMotivo(txtMotivo.getText()); - + tmp.setStock(regulacion.getStock()); return tmp; } @@ -252,6 +254,7 @@ //buscando. if(tipoAccion==RegulacionStockEvent.NUEVO || tipoAccion==RegulacionStockEvent.VISUALIZAR){ //insertando la informacion. + regulacion=e.getProductoStock(); insertarDatos(e.getProductoStock()); } } Modified: OpaloERP/src/frontend/almacen/IInsertarArticulos.java =================================================================== --- OpaloERP/src/frontend/almacen/IInsertarArticulos.java 2007-06-23 02:16:54 UTC (rev 27) +++ OpaloERP/src/frontend/almacen/IInsertarArticulos.java 2007-06-23 21:52:15 UTC (rev 28) @@ -417,7 +417,8 @@ private void btnVisualizarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnVisualizarActionPerformed if(productoSeleccionado!=null){ ProductoEvent ev=new ProductoEvent(); - ev.setProducto(productoSeleccionado); + Producto p=modelo.getProductoPorId(productoSeleccionado); + ev.setProducto(p); ev.setId(ProductoEvent.VISUALIZAR); dgArticulo.fireProducto(ev); dgArticulo.setVisible(true); @@ -435,7 +436,8 @@ private void btnEditarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEditarActionPerformed if(productoSeleccionado!=null){ ProductoEvent ev=new ProductoEvent(); - ev.setProducto(productoSeleccionado); //kite el clone + Producto p=modelo.getProductoPorId(productoSeleccionado); + ev.setProducto(p); ev.setId(ProductoEvent.EDITAR); dgArticulo.fireProducto(ev); dgArticulo.setVisible(true); Modified: OpaloERP/src/frontend/almacen/PnEditarRegulacionStock.form =================================================================== --- OpaloERP/src/frontend/almacen/PnEditarRegulacionStock.form 2007-06-23 02:16:54 UTC (rev 27) +++ OpaloERP/src/frontend/almacen/PnEditarRegulacionStock.form 2007-06-23 21:52:15 UTC (rev 28) @@ -16,11 +16,11 @@ <Component id="jPanel2" alignment="0" max="32767" attributes="0"/> <Group type="102" alignment="1" attributes="0"> <EmptySpace pref="328" max="32767" attributes="0"/> - <Component id="jButton3" min="-2" max="-2" attributes="0"/> + <Component id="salvar" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> - <Component id="jButton2" min="-2" max="-2" attributes="0"/> + <Component id="salvarCerrar" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> - <Component id="jButton1" min="-2" max="-2" attributes="0"/> + <Component id="cerrar" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> </Group> </Group> @@ -33,9 +33,9 @@ <Component id="jPanel2" min="-2" max="-2" attributes="0"/> <EmptySpace max="32767" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> - <Component id="jButton1" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jButton2" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jButton3" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="cerrar" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="salvarCerrar" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="salvar" alignment="3" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> </Group> @@ -287,7 +287,7 @@ </Component> </SubComponents> </Container> - <Component class="javax.swing.JButton" name="jButton1"> + <Component class="javax.swing.JButton" name="cerrar"> <Properties> <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> <Font name="Dialog" size="12" style="0"/> @@ -295,15 +295,18 @@ <Property name="text" type="java.lang.String" value="Cerrar"/> </Properties> </Component> - <Component class="javax.swing.JButton" name="jButton2"> + <Component class="javax.swing.JButton" name="salvarCerrar"> <Properties> <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> <Font name="Dialog" size="12" style="0"/> </Property> <Property name="text" type="java.lang.String" value="Salvar->"/> </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="salvarCerrarActionPerformed"/> + </Events> </Component> - <Component class="javax.swing.JButton" name="jButton3"> + <Component class="javax.swing.JButton" name="salvar"> <Properties> <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> <Font name="Dialog" size="12" style="0"/> Modified: OpaloERP/src/frontend/almacen/PnEditarRegulacionStock.java =================================================================== --- OpaloERP/src/frontend/almacen/PnEditarRegulacionStock.java 2007-06-23 02:16:54 UTC (rev 27) +++ OpaloERP/src/frontend/almacen/PnEditarRegulacionStock.java 2007-06-23 21:52:15 UTC (rev 28) @@ -8,10 +8,13 @@ import eventos.IRegulacionStock; import eventos.RegulacionStockEvent; +import java.math.BigDecimal; +import java.text.SimpleDateFormat; import java.util.List; import javax.swing.table.AbstractTableModel; import mensaje_objetos.almacen.ProductoStock; import mensaje_objetos.almacen.RegulacionStock; +import modelo_objetos.almacen.ModeloProductoStock; import modelo_objetos.almacen.ModeloRegulacionStock; /** @@ -32,8 +35,11 @@ private String[] columnas={"Fecha","Cantidad Inicial","Cantidad Final", "Motivo"}; private AbstractTableModel modeloTabla; private ModeloRegulacionStock modelo; + private ModeloProductoStock modeloStock; //objeto que representa la ventana de insertar las regulacion. private DgInsertarRegulacionStock dgInsertarRegulacion; + //objeto para la fecha. + private SimpleDateFormat formato; /** Creates new form PnEditarRegulacionStock */ @@ -48,6 +54,7 @@ public void instanciarObjetos(){ //buscando la informacion. modelo=ModeloRegulacionStock.getInstancia(); + modeloStock=ModeloProductoStock.getInstancia(); dgInsertarRegulacion=new DgInsertarRegulacionStock(null,true); //un pequeno force para no tener la misma interface de referencia. dgInsertarRegulacion.addObservador(new IRegulacionStock() { @@ -58,6 +65,8 @@ } } }); + //creando el simpledate. + formato=new SimpleDateFormat("dd-MM-yyyy"); } /** @@ -66,6 +75,10 @@ private void agregarElementoTabla(RegulacionStock re){ //buscando la informacion. listaTotal.add(re); + //disminuyendo la cantidad en stock. + regulacion.getStock().setCantidad(re.getCantidadFinal()); + //visualizar la informacion. + visualizarInformacion(); //cargando mostrando la tabla. recargarTabla(); } @@ -99,7 +112,7 @@ RegulacionStock tmp=listaTemporal.get(rowIndex); if(tmp!=null){ if(col==0){ - return tmp.getFecha(); + return formato.format(tmp.getFecha()); }else if(col==1){ return tmp.getCantidadInicial(); }else if(col==2){ @@ -126,6 +139,16 @@ */ private void cargarInformacion(RegulacionStock regulacionT){ regulacion=regulacionT; + visualizarInformacion(); + //cargando la informacion de la tabla. + cargarInformacionTabla(regulacion); + } + + + /** + *Metodo para visualizar la informacion de la regulacion stock. + */ + private void visualizarInformacion() { //insertando la informacion. stockSeleccionado=regulacion.getStock(); //mostrando la informacion. @@ -133,8 +156,6 @@ txtcodigoAlmacen.setText(""+stockSeleccionado.getAlmacen().getCodigo()); txtdescripcion.setText(stockSeleccionado.getProducto().getDescripcion()); txtcantidad.setText(""+stockSeleccionado.getCantidad()); - //cargando la informacion de la tabla. - cargarInformacionTabla(regulacion); } /** @@ -150,6 +171,16 @@ dgInsertarRegulacion.setVisible(true); } + /** + *Metodo para salvar la informacion. + */ + private void salvar(){ + //validando la informacion. + modelo.agregarRegulacionesStock(listaTotal); + //cambiando la cantidad para dicho almacen y el producto. + modelo.cambiandoStockFisicoDeRegulacion(regulacion); + } + /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is @@ -177,9 +208,9 @@ txtbuscar = new javax.swing.JTextField(); jLabel4 = new javax.swing.JLabel(); cmbbuscar = new javax.swing.JComboBox(); - jButton1 = new javax.swing.JButton(); - jButton2 = new javax.swing.JButton(); - jButton3 = new javax.swing.JButton(); + cerrar = new javax.swing.JButton(); + salvarCerrar = new javax.swing.JButton(); + salvar = new javax.swing.JButton(); jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(102, 204, 255))); btnproducto.setFont(new java.awt.Font("Dialog", 0, 12)); @@ -320,14 +351,19 @@ .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 183, javax.swing.GroupLayout.PREFERRED_SIZE)) ); - jButton1.setFont(new java.awt.Font("Dialog", 0, 12)); - jButton1.setText("Cerrar"); + cerrar.setFont(new java.awt.Font("Dialog", 0, 12)); + cerrar.setText("Cerrar"); - jButton2.setFont(new java.awt.Font("Dialog", 0, 12)); - jButton2.setText("Salvar->"); + salvarCerrar.setFont(new java.awt.Font("Dialog", 0, 12)); + salvarCerrar.setText("Salvar->"); + salvarCerrar.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + salvarCerrarActionPerformed(evt); + } + }); - jButton3.setFont(new java.awt.Font("Dialog", 0, 12)); - jButton3.setText("Salvar"); + salvar.setFont(new java.awt.Font("Dialog", 0, 12)); + salvar.setText("Salvar"); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); @@ -337,11 +373,11 @@ .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap(328, Short.MAX_VALUE) - .addComponent(jButton3) + .addComponent(salvar) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jButton2) + .addComponent(salvarCerrar) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jButton1) + .addComponent(cerrar) .addContainerGap()) ); layout.setVerticalGroup( @@ -352,13 +388,18 @@ .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jButton1) - .addComponent(jButton2) - .addComponent(jButton3)) + .addComponent(cerrar) + .addComponent(salvarCerrar) + .addComponent(salvar)) .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents + private void salvarCerrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_salvarCerrarActionPerformed + salvar(); + //indicando que estoy cerrando. + }//GEN-LAST:event_salvarCerrarActionPerformed + private void btnVisualizarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnVisualizarActionPerformed }//GEN-LAST:event_btnVisualizarActionPerformed @@ -386,10 +427,8 @@ private javax.swing.JButton btnVisualizar; private javax.swing.JButton btnalmacen; private javax.swing.JButton btnproducto; + private javax.swing.JButton cerrar; private javax.swing.JComboBox cmbbuscar; - private javax.swing.JButton jButton1; - private javax.swing.JButton jButton2; - private javax.swing.JButton jButton3; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; @@ -399,6 +438,8 @@ private javax.swing.JScrollPane jScrollPane1; private javax.swing.JScrollPane jScrollPane2; private javax.swing.JToolBar jToolBar1; + private javax.swing.JButton salvar; + private javax.swing.JButton salvarCerrar; private org.jdesktop.swingx.JXTable tabla; private javax.swing.JTextField txtbuscar; private javax.swing.JTextField txtcantidad; Modified: OpaloERP/src/modelo_objetos/almacen/ModeloProductoStock.java =================================================================== --- OpaloERP/src/modelo_objetos/almacen/ModeloProductoStock.java 2007-06-23 02:16:54 UTC (rev 27) +++ OpaloERP/src/modelo_objetos/almacen/ModeloProductoStock.java 2007-06-23 21:52:15 UTC (rev 28) @@ -197,4 +197,23 @@ return tmp; } + /** + *Metodo para conocer la cantidad existente de una producto por su existente en stock. + */ + public double getCantidadExistenteProducto(Producto producto){ + double cantidadFisico=0; + Session session=con.getSession(); + List<ProductoStock> tmp=new ArrayList(); + String hql="FROM ProductoStock p where p.producto.codigo=:codigo"; + Query query=session.createQuery(hql); + query.setString("codigo",producto.getCodigo()); + if(query!=null){ + tmp=query.list(); + for(ProductoStock p : tmp){ + cantidadFisico+=p.getCantidad(); + } + } + session.close(); + return cantidadFisico; + } } Modified: OpaloERP/src/modelo_objetos/almacen/ModeloRegulacionStock.java =================================================================== --- OpaloERP/src/modelo_objetos/almacen/ModeloRegulacionStock.java 2007-06-23 02:16:54 UTC (rev 27) +++ OpaloERP/src/modelo_objetos/almacen/ModeloRegulacionStock.java 2007-06-23 21:52:15 UTC (rev 28) @@ -9,6 +9,7 @@ package modelo_objetos.almacen; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import mensaje_objetos.almacen.Producto; @@ -30,7 +31,7 @@ /** *Propiedades */ - + private static ModeloRegulacionStock modelo; private Conexion con=null; private SessionFactory sf; @@ -51,7 +52,7 @@ getSubjectUpdate(); } - /** + /** *Metodo para obtener la instancia a este objeto. */ public static ModeloRegulacionStock getInstancia(){ @@ -145,8 +146,52 @@ } + /** + *Metodo para insertar las regulaciones de stock en el almacen, asi como cambiar + *el registro en almacen_stock y la cantidad de stock fisico del producto. + */ + public void agregarRegulacionesStock(List<RegulacionStock> lista){ + Session session=con.getSession(); + //abriendo la transaccion. + Transaction tx=session.beginTransaction(); + for(RegulacionStock tmp : lista){ + //salvando la informacion. + session.saveOrUpdate(tmp); + } + //realizando el commit. + tx.commit(); + session.close(); + //informando a todos los eventos. + subjectSaveOrUpdate.notify(ModeloAlmacen.class,lista,"update_productostock"); + } + public void cambiandoStockFisicoDeRegulacion(RegulacionStock regulacion){ + + Session session=con.getSession(); + //abriendo la transaccion. + Transaction tx=session.beginTransaction(); + //salvando la informacion. + session.saveOrUpdate(regulacion.getStock()); + //realizando el commit. + tx.commit(); + session.close(); + //cambiando el stock fisico del producto. + Producto p=regulacion.getStock().getProducto(); + double cantidadNueva=ModeloProductoStock.getInstancia().getCantidadExistenteProducto(p); + System.out.println("La cantidad nueva es "+cantidadNueva); + p.setStockFisico(new BigDecimal(cantidadNueva)); + session=con.getSession(); + tx=session.beginTransaction(); + session.saveOrUpdate(p); + //realizando el commit. + tx.commit(); + session.close(); + //informando a todos los eventos. + subjectSaveOrUpdate.notify(ModeloAlmacen.class,regulacion,"update_productostock"); + } + + /** *Metodo para obtener todos los almacenes. */ @@ -177,6 +222,6 @@ } session.close(); return tmp; - } + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |