Termine la venta + como siempre, mas cosas .w.
This commit is contained in:
@@ -89,8 +89,10 @@ import xyz.danielcortes.controllers.trabajador.usuario.UsuarioUpdateController;
|
||||
import xyz.danielcortes.controllers.trabajador.usuario.UsuarioViewController;
|
||||
import xyz.danielcortes.controllers.vender.VenderSearchController;
|
||||
import xyz.danielcortes.controllers.vender.VenderVenderController;
|
||||
import xyz.danielcortes.controllers.vender.VenderVerController;
|
||||
import xyz.danielcortes.framework.BaseController;
|
||||
import xyz.danielcortes.framework.PanelName;
|
||||
import xyz.danielcortes.models.Trabajador;
|
||||
import xyz.danielcortes.models.Usuario;
|
||||
import xyz.danielcortes.views.LaunchFrame;
|
||||
import xyz.danielcortes.views.autor.AutorCreatePanel;
|
||||
@@ -152,6 +154,7 @@ import xyz.danielcortes.views.usuario.UsuarioUpdatePanel;
|
||||
import xyz.danielcortes.views.usuario.UsuarioViewPanel;
|
||||
import xyz.danielcortes.views.vender.VenderSearchPanel;
|
||||
import xyz.danielcortes.views.vender.VenderVenderPanel;
|
||||
import xyz.danielcortes.views.vender.VenderVerPanel;
|
||||
|
||||
/**
|
||||
* Controlador principal de la aplicacion
|
||||
@@ -311,6 +314,7 @@ public class LaunchController {
|
||||
|
||||
this.controllers.put(PanelName.VENDER_SEARCH, new VenderSearchController(new VenderSearchPanel(), this));
|
||||
this.controllers.put(PanelName.VENDER_VENDER, new VenderVenderController(new VenderVenderPanel(), this));
|
||||
this.controllers.put(PanelName.VENDER_VER, new VenderVerController(new VenderVerPanel(), this));
|
||||
|
||||
for (Entry<PanelName, BaseController> entry : this.controllers.entrySet()) {
|
||||
this.frame.addCard(entry.getValue().getView().getContentPane(), entry.getKey());
|
||||
@@ -405,4 +409,8 @@ public class LaunchController {
|
||||
this.controllers.get(name).show();
|
||||
}
|
||||
|
||||
public Trabajador getTrabajador() {
|
||||
return this.user.getTrabajador();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -112,13 +112,11 @@ public class OrdenCompraAceptarController extends BaseController {
|
||||
factura.setPrecioNeto(Integer.parseInt(precioNeto));
|
||||
this.facturaRepository.save(factura);
|
||||
|
||||
for (Ejemplar ejemplar : ejemplares) {
|
||||
this.ejemplarRepository.save(ejemplar);
|
||||
}
|
||||
this.ejemplarRepository.save(ejemplares);
|
||||
|
||||
Compra compra = new Compra();
|
||||
compra.setDistribuidor(this.ordenCompra.getDistribuidor());
|
||||
compra.getEjemplares().addAll(ejemplares);
|
||||
compra.setEjemplares(ejemplares);
|
||||
compra.setFactura(factura);
|
||||
this.compraRepository.save(compra);
|
||||
|
||||
|
||||
@@ -114,10 +114,10 @@ public class OrdenCompraSearchController extends BaseController {
|
||||
JOptionPane.ERROR_MESSAGE
|
||||
);
|
||||
return;
|
||||
} else if (ordenCompra.getEstado().equals("Aceptada")) {
|
||||
} else if (ordenCompra.getEstado().equals("Recibida")) {
|
||||
JOptionPane.showMessageDialog(
|
||||
null,
|
||||
"La orden ya fue aceptada",
|
||||
"La orden ya fue recibida",
|
||||
"Error",
|
||||
JOptionPane.ERROR_MESSAGE
|
||||
);
|
||||
|
||||
@@ -1,23 +1,24 @@
|
||||
package xyz.danielcortes.controllers.vender;
|
||||
|
||||
import java.util.List;
|
||||
import javax.swing.JOptionPane;
|
||||
import xyz.danielcortes.controllers.LaunchController;
|
||||
import xyz.danielcortes.framework.BaseController;
|
||||
import xyz.danielcortes.framework.BasePanel;
|
||||
import xyz.danielcortes.framework.PanelName;
|
||||
import xyz.danielcortes.models.Venta;
|
||||
import xyz.danielcortes.repository.VenderRepository;
|
||||
import xyz.danielcortes.repository.VentaRepository;
|
||||
import xyz.danielcortes.views.vender.VenderSearchPanel;
|
||||
|
||||
public class VenderSearchController extends BaseController {
|
||||
|
||||
private VenderSearchPanel view;
|
||||
private VenderRepository repository;
|
||||
private VentaRepository repository;
|
||||
|
||||
public VenderSearchController(VenderSearchPanel view, LaunchController parent) {
|
||||
super(parent);
|
||||
this.view = view;
|
||||
this.repository = new VenderRepository();
|
||||
this.repository = new VentaRepository();
|
||||
this.setupListeners();
|
||||
}
|
||||
|
||||
@@ -29,6 +30,9 @@ public class VenderSearchController extends BaseController {
|
||||
}
|
||||
|
||||
private void search() {
|
||||
String term = this.view.getBuscarField().getText();
|
||||
List<Venta> ventas = this.repository.search(term);
|
||||
this.loadTable(ventas);
|
||||
}
|
||||
|
||||
private void vender() {
|
||||
@@ -36,6 +40,32 @@ public class VenderSearchController extends BaseController {
|
||||
}
|
||||
|
||||
private void ver() {
|
||||
Venta venta = this.getSelectedVenta();
|
||||
if (venta == null)
|
||||
return;
|
||||
|
||||
VenderVerController controller = (VenderVerController) this.parentController.getCard(PanelName.VENDER_VER);
|
||||
controller.setVenta(venta);
|
||||
this.parentController.showCard(PanelName.VENDER_VER);
|
||||
}
|
||||
|
||||
private void loadTable(List<Venta> ventas) {
|
||||
this.view.getVentaTableModel().setRows(ventas);
|
||||
}
|
||||
|
||||
private Venta getSelectedVenta() {
|
||||
int selectedRow = this.view.getVentasTable().getSelectedRow();
|
||||
if (selectedRow == -1) {
|
||||
JOptionPane.showMessageDialog(
|
||||
null,
|
||||
"No hay ninguna venta seleccionada",
|
||||
"Error",
|
||||
JOptionPane.ERROR_MESSAGE
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
||||
return this.view.getVentaTableModel().getRow(selectedRow);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -47,7 +77,7 @@ public class VenderSearchController extends BaseController {
|
||||
|
||||
private void loadTable() {
|
||||
List<Venta> ventas = this.repository.getAll();
|
||||
this.view.getVentaTableModel().setRows(ventas);
|
||||
this.loadTable(ventas);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,38 +1,171 @@
|
||||
package xyz.danielcortes.controllers.vender;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import javax.swing.JOptionPane;
|
||||
import xyz.danielcortes.controllers.LaunchController;
|
||||
import xyz.danielcortes.framework.BaseController;
|
||||
import xyz.danielcortes.framework.BasePanel;
|
||||
import xyz.danielcortes.framework.PanelName;
|
||||
import xyz.danielcortes.framework.ValidationResult;
|
||||
import xyz.danielcortes.models.Boleta;
|
||||
import xyz.danielcortes.models.Cliente;
|
||||
import xyz.danielcortes.models.Ejemplar;
|
||||
import xyz.danielcortes.models.Estado;
|
||||
import xyz.danielcortes.models.Trabajador;
|
||||
import xyz.danielcortes.models.Venta;
|
||||
import xyz.danielcortes.repository.BoletaRepository;
|
||||
import xyz.danielcortes.repository.ClienteRepository;
|
||||
import xyz.danielcortes.repository.EjemplarRepository;
|
||||
import xyz.danielcortes.repository.VenderRepository;
|
||||
import xyz.danielcortes.repository.EstadoRepository;
|
||||
import xyz.danielcortes.repository.VentaRepository;
|
||||
import xyz.danielcortes.validator.VentaValidator;
|
||||
import xyz.danielcortes.views.vender.VenderVenderPanel;
|
||||
|
||||
public class VenderVenderController extends BaseController {
|
||||
|
||||
private VenderVenderPanel view;
|
||||
private VenderRepository venderRepository;
|
||||
private VentaRepository ventaRepository;
|
||||
private VentaValidator ventaValidator;
|
||||
private ClienteRepository clienteRepository;
|
||||
private EjemplarRepository ejemplarRepository;
|
||||
private EstadoRepository estadoRepository;
|
||||
private BoletaRepository boletaRepository;
|
||||
|
||||
private float precioNeto;
|
||||
|
||||
public VenderVenderController(VenderVenderPanel view, LaunchController parentController) {
|
||||
super(parentController);
|
||||
this.view = view;
|
||||
this.venderRepository = new VenderRepository();
|
||||
this.ventaRepository = new VentaRepository();
|
||||
this.ventaValidator = new VentaValidator();
|
||||
this.clienteRepository = new ClienteRepository();
|
||||
this.ejemplarRepository = new EjemplarRepository();
|
||||
this.estadoRepository = new EstadoRepository();
|
||||
this.boletaRepository = new BoletaRepository();
|
||||
this.setupListeners();
|
||||
}
|
||||
|
||||
private void setupListeners() {
|
||||
this.view.getAgregarButton().addActionListener(e -> this.agregar());
|
||||
this.view.getRemoverButton().addActionListener(e -> this.remover());
|
||||
this.view.getCancelarButton().addActionListener(e -> this.parentController.showCard(PanelName.VENDER_SEARCH));
|
||||
this.view.getVenderButton().addActionListener(e -> this.vender());
|
||||
}
|
||||
|
||||
private void agregar() {
|
||||
if (this.view.getEjemplaresComboModel().getSize() == 0) {
|
||||
JOptionPane.showMessageDialog(
|
||||
null,
|
||||
"No hay ningun ejemplar que agregar",
|
||||
"Error",
|
||||
JOptionPane.ERROR_MESSAGE
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
Ejemplar ejemplar = (Ejemplar) this.view.getEjemplaresCombo().getSelectedItem();
|
||||
if (ejemplar == null) {
|
||||
JOptionPane.showMessageDialog(
|
||||
null,
|
||||
"El ejemplar seleccionado es nulo, NO DEBERIA PASAR!!",
|
||||
"Error",
|
||||
JOptionPane.ERROR_MESSAGE
|
||||
);
|
||||
return;
|
||||
}
|
||||
this.view.getEjemplaresCombo().removeItem(ejemplar);
|
||||
this.view.getEjemplaresTableModel().addRow(ejemplar);
|
||||
this.updatePrice();
|
||||
}
|
||||
|
||||
private void remover() {
|
||||
if (this.view.getEjemplaresTableModel().getRowCount() == 0) {
|
||||
JOptionPane.showMessageDialog(
|
||||
null,
|
||||
"No hay ningun ejemplar que remover",
|
||||
"Error",
|
||||
JOptionPane.ERROR_MESSAGE
|
||||
);
|
||||
return;
|
||||
}
|
||||
Ejemplar ejemplar = this.getSelectedEjemplar();
|
||||
if (ejemplar == null)
|
||||
return;
|
||||
|
||||
this.view.getEjemplaresCombo().addItem(ejemplar);
|
||||
this.view.getEjemplaresTableModel().removeRow(ejemplar);
|
||||
this.updatePrice();
|
||||
}
|
||||
|
||||
private void vender() {
|
||||
Cliente cliente = (Cliente) this.view.getClienteCombo().getSelectedItem();
|
||||
ValidationResult clienteValidation = this.ventaValidator.validateCliente(cliente);
|
||||
if (clienteValidation.hasError()) {
|
||||
clienteValidation.showErrorDialog();
|
||||
return;
|
||||
}
|
||||
|
||||
Trabajador trabajador = this.getParentController().getTrabajador();
|
||||
ValidationResult trabajadorValidation = this.ventaValidator.validateTrabajador(trabajador);
|
||||
if (trabajadorValidation.hasError()) {
|
||||
clienteValidation.showErrorDialog();
|
||||
return;
|
||||
}
|
||||
|
||||
List<Ejemplar> ejemplares = this.view.getEjemplaresTableModel().getRows();
|
||||
ValidationResult ejemplaresValidation = this.ventaValidator.validateEjemplares(ejemplares);
|
||||
if (ejemplaresValidation.hasError()) {
|
||||
ejemplaresValidation.showErrorDialog();
|
||||
return;
|
||||
}
|
||||
|
||||
Boleta boleta = new Boleta();
|
||||
boleta.setFolio(UUID.randomUUID().toString());
|
||||
boleta.setPrecioNeto((int) this.precioNeto);
|
||||
boleta.setFechaEmision(LocalDate.now());
|
||||
this.boletaRepository.save(boleta);
|
||||
|
||||
Venta venta = new Venta();
|
||||
venta.setCliente(cliente);
|
||||
venta.setEjemplares(ejemplares);
|
||||
venta.setTrabajador(trabajador);
|
||||
venta.setBoleta(boleta);
|
||||
this.ventaRepository.save(venta);
|
||||
|
||||
Estado vendido = this.estadoRepository.getByNombre("Vendido");
|
||||
ejemplares.forEach(ejemplar -> ejemplar.setEstado(vendido));
|
||||
this.ejemplarRepository.update(ejemplares);
|
||||
|
||||
this.parentController.showCard(PanelName.VENDER_SEARCH);
|
||||
}
|
||||
|
||||
private void updatePrice() {
|
||||
this.precioNeto = (float) this.view.getEjemplaresTableModel().getRows().stream()
|
||||
.mapToInt(ejemplar -> ejemplar.getLibro().getPrecioReferencia())
|
||||
.reduce((i, j) -> i + j).orElse(0);
|
||||
float iva = this.precioNeto * .19f;
|
||||
float precioBruto = this.precioNeto + iva;
|
||||
|
||||
this.view.getPrecioNetoField().setText(String.valueOf(this.precioNeto));
|
||||
this.view.getIvaField().setText(String.valueOf(iva));
|
||||
this.view.getPrecioBrutoField().setText(String.valueOf(precioBruto));
|
||||
}
|
||||
|
||||
private Ejemplar getSelectedEjemplar() {
|
||||
int selectedRow = this.view.getEjemplaresTable().getSelectedRow();
|
||||
if (selectedRow == -1) {
|
||||
JOptionPane.showMessageDialog(
|
||||
null,
|
||||
"No hay ningun ejemplar seleccionado",
|
||||
"Error",
|
||||
JOptionPane.ERROR_MESSAGE
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
||||
return this.view.getEjemplaresTableModel().getRow(selectedRow);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -40,18 +173,25 @@ public class VenderVenderController extends BaseController {
|
||||
this.fillCliente();
|
||||
this.fillEjemplares();
|
||||
this.view.getEjemplaresTableModel().removeRows();
|
||||
this.view.getPrecioNetoField().setText("0");
|
||||
this.view.getIvaField().setText("0");
|
||||
this.view.getPrecioBrutoField().setText("0");
|
||||
this.precioNeto = 0;
|
||||
}
|
||||
|
||||
private void fillCliente() {
|
||||
List<Cliente> cliente = this.clienteRepository.getAll();
|
||||
this.view.getClienteComboModel().removeAllElements();
|
||||
this.view.getClienteComboModel().addAll(cliente);
|
||||
this.view.getClienteCombo().setSelectedIndex(0);
|
||||
}
|
||||
|
||||
private void fillEjemplares() {
|
||||
List<Ejemplar> ejemplares = this.ejemplarRepository.getAll();
|
||||
Estado disponible = this.estadoRepository.getByNombre("Disponible");
|
||||
List<Ejemplar> ejemplares = this.ejemplarRepository.getByEstado(disponible);
|
||||
this.view.getEjemplaresComboModel().removeAllElements();
|
||||
this.view.getEjemplaresComboModel().addAll(ejemplares);
|
||||
this.view.getEjemplaresCombo().setSelectedIndex(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -3,21 +3,49 @@ package xyz.danielcortes.controllers.vender;
|
||||
import xyz.danielcortes.controllers.LaunchController;
|
||||
import xyz.danielcortes.framework.BaseController;
|
||||
import xyz.danielcortes.framework.BasePanel;
|
||||
import xyz.danielcortes.framework.PanelName;
|
||||
import xyz.danielcortes.models.Venta;
|
||||
import xyz.danielcortes.views.vender.VenderVerPanel;
|
||||
|
||||
public class VenderVerController extends BaseController {
|
||||
|
||||
private VenderVerPanel view;
|
||||
private Venta venta;
|
||||
|
||||
public VenderVerController(LaunchController parentController) {
|
||||
public VenderVerController(VenderVerPanel view, LaunchController parentController) {
|
||||
super(parentController);
|
||||
this.view = view;
|
||||
this.setupListener();
|
||||
}
|
||||
|
||||
private void setupListener() {
|
||||
this.view.getVolverButton().addActionListener(e -> this.parentController.showCard(PanelName.VENDER_SEARCH));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void show() {
|
||||
if (this.venta != null) {
|
||||
this.view.getEjemplaresTableModel().setRows(this.venta.getEjemplares());
|
||||
this.view.getClienteField().setText(this.venta.getCliente().getRut());
|
||||
this.view.getTrabajadorField().setText(this.venta.getTrabajador().getRut());
|
||||
this.view.getFolioField().setText(this.venta.getBoleta().getFolio());
|
||||
|
||||
float precioNeto = this.venta.getBoleta().getPrecioNeto();
|
||||
float iva = precioNeto * .19f;
|
||||
float precioTotal = precioNeto + iva;
|
||||
|
||||
this.view.getPrecioNetoField().setText(String.valueOf(precioNeto));
|
||||
this.view.getIvaField().setText(String.valueOf(precioNeto));
|
||||
this.view.getPrecioTotalField().setText(String.valueOf(precioTotal));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public BasePanel getView() {
|
||||
return null;
|
||||
return this.view;
|
||||
}
|
||||
|
||||
public void setVenta(Venta venta) {
|
||||
this.venta = venta;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,19 @@ public abstract class BaseRepository<E> {
|
||||
this.em.getTransaction().commit();
|
||||
}
|
||||
|
||||
public void save(List<E> entities) {
|
||||
this.em.getTransaction().begin();
|
||||
|
||||
try {
|
||||
entities.forEach(entity -> this.em.persist(entity));
|
||||
} catch (PersistenceException e) {
|
||||
e.printStackTrace();
|
||||
this.em.getTransaction().rollback();
|
||||
}
|
||||
|
||||
this.em.getTransaction().commit();
|
||||
}
|
||||
|
||||
public void update(E entity) {
|
||||
this.em.getTransaction().begin();
|
||||
|
||||
@@ -48,6 +61,19 @@ public abstract class BaseRepository<E> {
|
||||
this.em.getTransaction().commit();
|
||||
}
|
||||
|
||||
public void update(List<E> entities) {
|
||||
this.em.getTransaction().begin();
|
||||
|
||||
try {
|
||||
entities.forEach(entity -> this.em.merge(entity));
|
||||
} catch (PersistenceException e) {
|
||||
e.printStackTrace();
|
||||
this.em.getTransaction().rollback();
|
||||
}
|
||||
|
||||
this.em.getTransaction().commit();
|
||||
}
|
||||
|
||||
public void delete(E entity) {
|
||||
this.em.getTransaction().begin();
|
||||
|
||||
@@ -61,6 +87,19 @@ public abstract class BaseRepository<E> {
|
||||
this.em.getTransaction().commit();
|
||||
}
|
||||
|
||||
public void delete(List<E> entities) {
|
||||
this.em.getTransaction().begin();
|
||||
|
||||
try {
|
||||
entities.forEach(entity -> this.em.remove(entity));
|
||||
} catch (PersistenceException e) {
|
||||
e.printStackTrace();
|
||||
this.em.getTransaction().rollback();
|
||||
}
|
||||
|
||||
this.em.getTransaction().commit();
|
||||
}
|
||||
|
||||
public void delete(Collection<E> entities) {
|
||||
this.em.getTransaction().begin();
|
||||
|
||||
|
||||
@@ -68,13 +68,14 @@ public class BaseTableModel<T> extends AbstractTableModel {
|
||||
|
||||
public void removeRow(T t) {
|
||||
int removed = this.rows.indexOf(t);
|
||||
this.rows.remove(removed);
|
||||
this.fireTableRowsDeleted(removed, removed);
|
||||
|
||||
if (removed != -1) {
|
||||
this.rows.remove(removed);
|
||||
this.fireTableRowsDeleted(removed, removed);
|
||||
}
|
||||
}
|
||||
|
||||
public T getRow(int row) {
|
||||
if (row > -1 || row < this.getRowCount()) {
|
||||
if (row > -1 && row < this.getRowCount()) {
|
||||
return this.rows.get(row);
|
||||
} else {
|
||||
return null;
|
||||
|
||||
@@ -106,6 +106,7 @@ public enum PanelName {
|
||||
|
||||
VENDER_SEARCH,
|
||||
VENDER_VENDER,
|
||||
VENDER_VER,
|
||||
|
||||
ARRENDAR_SEARCH,
|
||||
ARRENDAR_ARRENDAR,
|
||||
|
||||
@@ -135,4 +135,13 @@ public class Cliente {
|
||||
public void setVentas(List<Venta> ventas) {
|
||||
this.ventas = ventas;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.rut + " - " + this.getNombreCompleto();
|
||||
}
|
||||
|
||||
public String getNombreCompleto() {
|
||||
return this.nombre + " " + this.apellidoPaterno + " " + this.apellidoMaterno;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,6 +106,6 @@ public class Ejemplar {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.serie + " " + this.estado.getNombre();
|
||||
return this.serie + " " + this.libro.getIsbn() + " " + this.libro.getTitulo();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package xyz.danielcortes.repository;
|
||||
|
||||
import xyz.danielcortes.framework.BaseRepository;
|
||||
import xyz.danielcortes.models.Boleta;
|
||||
|
||||
public class BoletaRepository extends BaseRepository<Boleta> {
|
||||
|
||||
public BoletaRepository() {
|
||||
super(Boleta.class);
|
||||
}
|
||||
}
|
||||
@@ -2,11 +2,13 @@ package xyz.danielcortes.repository;
|
||||
|
||||
import java.util.List;
|
||||
import javax.persistence.Query;
|
||||
import javax.persistence.TypedQuery;
|
||||
import javax.persistence.criteria.CriteriaBuilder;
|
||||
import javax.persistence.criteria.CriteriaQuery;
|
||||
import javax.persistence.criteria.Root;
|
||||
import xyz.danielcortes.framework.BaseRepository;
|
||||
import xyz.danielcortes.models.Ejemplar;
|
||||
import xyz.danielcortes.models.Estado;
|
||||
|
||||
public class EjemplarRepository extends BaseRepository<Ejemplar> {
|
||||
|
||||
@@ -33,4 +35,10 @@ public class EjemplarRepository extends BaseRepository<Ejemplar> {
|
||||
query.setParameter("libro_id", libroId);
|
||||
return (Long) query.getResultList().get(0) == 1;
|
||||
}
|
||||
|
||||
public List<Ejemplar> getByEstado(Estado estado) {
|
||||
TypedQuery<Ejemplar> query = this.em.createQuery("SELECT e FROM Ejemplar e WHERE e.estado.id = :estado_id", Ejemplar.class);
|
||||
query.setParameter("estado_id", estado.getId());
|
||||
return query.getResultList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
package xyz.danielcortes.repository;
|
||||
|
||||
import xyz.danielcortes.framework.BaseRepository;
|
||||
import xyz.danielcortes.models.Venta;
|
||||
|
||||
public class VenderRepository extends BaseRepository<Venta> {
|
||||
|
||||
public VenderRepository() {
|
||||
super(Venta.class);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package xyz.danielcortes.repository;
|
||||
|
||||
import java.util.List;
|
||||
import javax.persistence.TypedQuery;
|
||||
import xyz.danielcortes.framework.BaseRepository;
|
||||
import xyz.danielcortes.models.Venta;
|
||||
|
||||
public class VentaRepository extends BaseRepository<Venta> {
|
||||
|
||||
public VentaRepository() {
|
||||
super(Venta.class);
|
||||
}
|
||||
|
||||
public List<Venta> search(String term) {
|
||||
TypedQuery<Venta> query = this.em.createQuery(
|
||||
"SELECT o FROM Venta o WHERE"
|
||||
+ " CONCAT(o.boleta.fechaEmision, '') LIKE :term OR"
|
||||
+ " LOWER(o.boleta.folio) LIKE :term OR "
|
||||
+ " CONCAT(o.ejemplares.size, '') LIKE :term OR "
|
||||
+ " LOWER(o.trabajador.rut) LIKE :term OR "
|
||||
+ " LOWER(o.cliente.rut) LIKE :term",
|
||||
Venta.class);
|
||||
query.setParameter("term", "%" + term.toLowerCase() + "%");
|
||||
return query.getResultList();
|
||||
}
|
||||
}
|
||||
40
src/main/java/xyz/danielcortes/validator/VentaValidator.java
Normal file
40
src/main/java/xyz/danielcortes/validator/VentaValidator.java
Normal file
@@ -0,0 +1,40 @@
|
||||
package xyz.danielcortes.validator;
|
||||
|
||||
import java.util.List;
|
||||
import xyz.danielcortes.framework.ValidationResult;
|
||||
import xyz.danielcortes.models.Cliente;
|
||||
import xyz.danielcortes.models.Ejemplar;
|
||||
import xyz.danielcortes.models.Trabajador;
|
||||
|
||||
public class VentaValidator {
|
||||
|
||||
public ValidationResult validateCliente(Cliente cliente) {
|
||||
if (cliente == null) {
|
||||
return new ValidationResult("No hay cliente");
|
||||
}
|
||||
|
||||
return ValidationResult.NON_ERROR;
|
||||
}
|
||||
|
||||
public ValidationResult validateTrabajador(Trabajador trabajador) {
|
||||
if (trabajador == null) {
|
||||
return new ValidationResult("No hay trabajador, no deberia pasar!!!");
|
||||
}
|
||||
|
||||
return ValidationResult.NON_ERROR;
|
||||
}
|
||||
|
||||
public ValidationResult validateEjemplares(List<Ejemplar> ejemplares) {
|
||||
if (ejemplares == null) {
|
||||
return new ValidationResult("No hay ejemplares, no deberia pasar!!!");
|
||||
}
|
||||
if (ejemplares.size() == 0) {
|
||||
return new ValidationResult("No hay ejemplares");
|
||||
}
|
||||
if (ejemplares.stream().anyMatch(ejemplar -> !ejemplar.getEstado().getNombre().equals("Disponible"))) {
|
||||
return new ValidationResult("Por alguna razon hay un ejemplar no disponible, NO DEBERIA PASAR TAMPOCO!");
|
||||
}
|
||||
|
||||
return ValidationResult.NON_ERROR;
|
||||
}
|
||||
}
|
||||
@@ -139,7 +139,7 @@ public class LibroSearchPanel extends BasePanel {
|
||||
case 0: return rows.get(rowIndex).getIsbn();
|
||||
case 1: return rows.get(rowIndex).getTitulo();
|
||||
case 2: return rows.get(rowIndex).getPrecioReferencia();
|
||||
case 3: return rows.get(rowIndex).getEjemplares().size();
|
||||
case 3: return rows.get(rowIndex).getEjemplares().stream().filter(ejemplar -> ejemplar.getEstado().getNombre().equals("Disponible")).count();
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.vender.VenderVenderPanel">
|
||||
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="14" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="12" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="20" left="20" bottom="20" right="20"/>
|
||||
<constraints>
|
||||
<xy x="20" y="20" width="490" height="536"/>
|
||||
@@ -11,7 +11,7 @@
|
||||
<grid id="11a46" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="12" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
<grid row="10" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
@@ -40,17 +40,17 @@
|
||||
</grid>
|
||||
<vspacer id="83ea6">
|
||||
<constraints>
|
||||
<grid row="13" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||
<grid row="11" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</vspacer>
|
||||
<hspacer id="832a4">
|
||||
<constraints>
|
||||
<grid row="13" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
<grid row="11" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</hspacer>
|
||||
<hspacer id="7d130">
|
||||
<constraints>
|
||||
<grid row="13" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
<grid row="11" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</hspacer>
|
||||
<component id="10dc0" class="javax.swing.JLabel">
|
||||
@@ -74,7 +74,7 @@
|
||||
</component>
|
||||
</children>
|
||||
</scrollpane>
|
||||
<grid id="58392" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<grid id="58392" layout-manager="GridLayoutManager" row-count="2" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
@@ -106,6 +106,16 @@
|
||||
<text value="+"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="49afa" class="javax.swing.JButton" binding="removerButton">
|
||||
<constraints>
|
||||
<grid row="1" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="30" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="-"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
<component id="350ea" class="javax.swing.JComboBox" binding="clienteCombo" custom-create="true">
|
||||
@@ -117,50 +127,14 @@
|
||||
<properties/>
|
||||
</component>
|
||||
<component id="184ff" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="10" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Precio Total:"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="441d9" class="javax.swing.JTextField" binding="precioTotalField">
|
||||
<constraints>
|
||||
<grid row="11" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="400" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<editable value="false"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="c72e8" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="8" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="IVA:"/>
|
||||
<text value="Precio Bruto:"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="195f" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="6" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Precio Neto:"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="89a07" class="javax.swing.JTextField" binding="precioNetoField">
|
||||
<constraints>
|
||||
<grid row="7" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="400" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<editable value="false"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="1d61e" class="javax.swing.JTextField" binding="ivaField">
|
||||
<component id="441d9" class="javax.swing.JTextField" binding="precioBrutoField">
|
||||
<constraints>
|
||||
<grid row="9" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="400" height="-1"/>
|
||||
@@ -170,15 +144,23 @@
|
||||
<editable value="false"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="89829" class="javax.swing.JLabel">
|
||||
<component id="c72e8" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="6" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="IVA:"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="195f" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Folio:"/>
|
||||
<text value="Precio Neto:"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="f03bc" class="javax.swing.JTextField" binding="folioField">
|
||||
<component id="89a07" class="javax.swing.JTextField" binding="precioNetoField">
|
||||
<constraints>
|
||||
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="400" height="-1"/>
|
||||
@@ -188,6 +170,16 @@
|
||||
<editable value="false"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="1d61e" class="javax.swing.JTextField" binding="ivaField">
|
||||
<constraints>
|
||||
<grid row="7" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="400" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<editable value="false"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
</form>
|
||||
|
||||
@@ -32,10 +32,10 @@ public class VenderVenderPanel extends BasePanel {
|
||||
private JComboBox<Ejemplar> ejemplaresCombo;
|
||||
private DefaultComboBoxModel<Ejemplar> ejemplaresComboModel;
|
||||
private JButton agregarButton;
|
||||
private JTextField precioTotalField;
|
||||
private JTextField precioBrutoField;
|
||||
private JTextField precioNetoField;
|
||||
private JTextField ivaField;
|
||||
private JTextField folioField;
|
||||
private JButton removerButton;
|
||||
|
||||
{
|
||||
// GUI initializer generated by IntelliJ IDEA GUI Designer
|
||||
@@ -61,11 +61,11 @@ public class VenderVenderPanel extends BasePanel {
|
||||
return this.ejemplaresTable;
|
||||
}
|
||||
|
||||
public JComboBox getClienteCombo() {
|
||||
public JComboBox<Cliente> getClienteCombo() {
|
||||
return this.clienteCombo;
|
||||
}
|
||||
|
||||
public JComboBox getEjemplaresCombo() {
|
||||
public JComboBox<Ejemplar> getEjemplaresCombo() {
|
||||
return this.ejemplaresCombo;
|
||||
}
|
||||
|
||||
@@ -73,8 +73,8 @@ public class VenderVenderPanel extends BasePanel {
|
||||
return this.agregarButton;
|
||||
}
|
||||
|
||||
public JTextField getPrecioTotalField() {
|
||||
return this.precioTotalField;
|
||||
public JTextField getPrecioBrutoField() {
|
||||
return this.precioBrutoField;
|
||||
}
|
||||
|
||||
public JTextField getPrecioNetoField() {
|
||||
@@ -85,8 +85,8 @@ public class VenderVenderPanel extends BasePanel {
|
||||
return this.ivaField;
|
||||
}
|
||||
|
||||
public JTextField getFolioField() {
|
||||
return this.folioField;
|
||||
public JButton getRemoverButton() {
|
||||
return this.removerButton;
|
||||
}
|
||||
|
||||
public BaseTableModel<Ejemplar> getEjemplaresTableModel() {
|
||||
@@ -109,10 +109,10 @@ public class VenderVenderPanel extends BasePanel {
|
||||
private void $$$setupUI$$$() {
|
||||
createUIComponents();
|
||||
contentPane = new JPanel();
|
||||
contentPane.setLayout(new GridLayoutManager(14, 3, new Insets(20, 20, 20, 20), -1, -1));
|
||||
contentPane.setLayout(new GridLayoutManager(12, 3, new Insets(20, 20, 20, 20), -1, -1));
|
||||
final JPanel panel1 = new JPanel();
|
||||
panel1.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1));
|
||||
contentPane.add(panel1, new GridConstraints(12, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
|
||||
contentPane.add(panel1, new GridConstraints(10, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
|
||||
venderButton = new JButton();
|
||||
@@ -127,15 +127,15 @@ public class VenderVenderPanel extends BasePanel {
|
||||
null, 0, false));
|
||||
final Spacer spacer1 = new Spacer();
|
||||
contentPane.add(spacer1,
|
||||
new GridConstraints(13, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null,
|
||||
new GridConstraints(11, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null,
|
||||
null, null, 0, false));
|
||||
final Spacer spacer2 = new Spacer();
|
||||
contentPane.add(spacer2,
|
||||
new GridConstraints(13, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1,
|
||||
new GridConstraints(11, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1,
|
||||
null, null, null, 0, false));
|
||||
final Spacer spacer3 = new Spacer();
|
||||
contentPane.add(spacer3,
|
||||
new GridConstraints(13, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1,
|
||||
new GridConstraints(11, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1,
|
||||
null, null, null, 0, false));
|
||||
final JLabel label1 = new JLabel();
|
||||
label1.setText("Cliente:");
|
||||
@@ -147,7 +147,7 @@ public class VenderVenderPanel extends BasePanel {
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
|
||||
scrollPane1.setViewportView(ejemplaresTable);
|
||||
final JPanel panel2 = new JPanel();
|
||||
panel2.setLayout(new GridLayoutManager(2, 2, new Insets(0, 0, 0, 0), -1, -1));
|
||||
panel2.setLayout(new GridLayoutManager(2, 3, new Insets(0, 0, 0, 0), -1, -1));
|
||||
contentPane.add(panel2, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
|
||||
@@ -163,44 +163,40 @@ public class VenderVenderPanel extends BasePanel {
|
||||
panel2.add(agregarButton, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(30, -1),
|
||||
null, 0, false));
|
||||
removerButton = new JButton();
|
||||
removerButton.setText("-");
|
||||
panel2.add(removerButton, new GridConstraints(1, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(30, -1),
|
||||
null, 0, false));
|
||||
contentPane.add(clienteCombo,
|
||||
new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||
final JLabel label3 = new JLabel();
|
||||
label3.setText("Precio Total:");
|
||||
contentPane.add(label3, new GridConstraints(10, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||
label3.setText("Precio Bruto:");
|
||||
contentPane.add(label3, new GridConstraints(8, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
precioTotalField = new JTextField();
|
||||
precioTotalField.setEditable(false);
|
||||
contentPane.add(precioTotalField,
|
||||
new GridConstraints(11, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||
precioBrutoField = new JTextField();
|
||||
precioBrutoField.setEditable(false);
|
||||
contentPane.add(precioBrutoField,
|
||||
new GridConstraints(9, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||
final JLabel label4 = new JLabel();
|
||||
label4.setText("IVA:");
|
||||
contentPane.add(label4, new GridConstraints(8, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||
contentPane.add(label4, new GridConstraints(6, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
final JLabel label5 = new JLabel();
|
||||
label5.setText("Precio Neto:");
|
||||
contentPane.add(label5, new GridConstraints(6, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||
contentPane.add(label5, new GridConstraints(4, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
precioNetoField = new JTextField();
|
||||
precioNetoField.setEditable(false);
|
||||
contentPane.add(precioNetoField,
|
||||
new GridConstraints(7, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||
new GridConstraints(5, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||
ivaField = new JTextField();
|
||||
ivaField.setEditable(false);
|
||||
contentPane.add(ivaField,
|
||||
new GridConstraints(9, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||
final JLabel label6 = new JLabel();
|
||||
label6.setText("Folio:");
|
||||
contentPane.add(label6, new GridConstraints(4, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
folioField = new JTextField();
|
||||
folioField.setEditable(false);
|
||||
contentPane.add(folioField,
|
||||
new GridConstraints(5, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||
new GridConstraints(7, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||
}
|
||||
|
||||
@@ -213,12 +209,13 @@ public class VenderVenderPanel extends BasePanel {
|
||||
|
||||
// @formatter:off
|
||||
this.ejemplaresTableModel = new BaseTableModel<>(
|
||||
new String[]{"ISBN", "Serie", "Titulo"},
|
||||
new String[]{"ISBN", "Serie", "Titulo", "Precio"},
|
||||
(row, rowIndex, colIndex) -> {
|
||||
switch (colIndex) {
|
||||
case 0: return row.get(rowIndex).getLibro().getIsbn();
|
||||
case 1: return row.get(rowIndex).getSerie();
|
||||
case 2: return row.get(rowIndex).getLibro().getTitulo();
|
||||
case 3: return row.get(rowIndex).getLibro().getPrecioReferencia();
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.vender.VenderVerPanel">
|
||||
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="14" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="16" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="20" left="20" bottom="20" right="20"/>
|
||||
<constraints>
|
||||
<xy x="20" y="20" width="490" height="536"/>
|
||||
@@ -11,7 +11,7 @@
|
||||
<grid id="11a46" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="12" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
<grid row="14" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
@@ -30,17 +30,17 @@
|
||||
</grid>
|
||||
<vspacer id="83ea6">
|
||||
<constraints>
|
||||
<grid row="13" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||
<grid row="15" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</vspacer>
|
||||
<hspacer id="832a4">
|
||||
<constraints>
|
||||
<grid row="13" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
<grid row="15" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</hspacer>
|
||||
<hspacer id="7d130">
|
||||
<constraints>
|
||||
<grid row="13" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
<grid row="15" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</hspacer>
|
||||
<component id="10dc0" class="javax.swing.JLabel">
|
||||
@@ -53,7 +53,7 @@
|
||||
</component>
|
||||
<scrollpane id="40e17">
|
||||
<constraints>
|
||||
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
@@ -66,7 +66,7 @@
|
||||
</scrollpane>
|
||||
<component id="184ff" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="10" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
<grid row="12" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Precio Total:"/>
|
||||
@@ -74,7 +74,7 @@
|
||||
</component>
|
||||
<component id="441d9" class="javax.swing.JTextField" binding="precioTotalField">
|
||||
<constraints>
|
||||
<grid row="11" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<grid row="13" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="400" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
@@ -84,7 +84,7 @@
|
||||
</component>
|
||||
<component id="c72e8" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="8" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
<grid row="10" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="IVA:"/>
|
||||
@@ -92,23 +92,13 @@
|
||||
</component>
|
||||
<component id="195f" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="6" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
<grid row="8" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Precio Neto:"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="89a07" class="javax.swing.JTextField" binding="precioNetoField">
|
||||
<constraints>
|
||||
<grid row="7" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="400" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<editable value="false"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="1d61e" class="javax.swing.JTextField" binding="ivaField">
|
||||
<constraints>
|
||||
<grid row="9" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="400" height="-1"/>
|
||||
@@ -118,9 +108,19 @@
|
||||
<editable value="false"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="1d61e" class="javax.swing.JTextField" binding="ivaField">
|
||||
<constraints>
|
||||
<grid row="11" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="400" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<editable value="false"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="89829" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
<grid row="6" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Folio:"/>
|
||||
@@ -128,7 +128,7 @@
|
||||
</component>
|
||||
<component id="f03bc" class="javax.swing.JTextField" binding="folioField">
|
||||
<constraints>
|
||||
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<grid row="7" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="400" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
@@ -138,7 +138,7 @@
|
||||
</component>
|
||||
<component id="92e07" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Ejemplares:"/>
|
||||
@@ -152,6 +152,24 @@
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
<component id="f12bb" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Trabajador:"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="ab6e7" class="javax.swing.JTextField" binding="trabajadorField">
|
||||
<constraints>
|
||||
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="150" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<editable value="false"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
</form>
|
||||
|
||||
@@ -20,16 +20,15 @@ import xyz.danielcortes.models.Ejemplar;
|
||||
public class VenderVerPanel extends BasePanel {
|
||||
|
||||
private JPanel contentPane;
|
||||
private JButton venderButton;
|
||||
private JButton volverButton;
|
||||
private JTable ejemplaresTable;
|
||||
private BaseTableModel<Ejemplar> ejemplaresTableModel;
|
||||
private JButton agregarButton;
|
||||
private JTextField precioTotalField;
|
||||
private JTextField precioNetoField;
|
||||
private JTextField ivaField;
|
||||
private JTextField folioField;
|
||||
private JTextField clienteField;
|
||||
private JTextField trabajadorField;
|
||||
|
||||
{
|
||||
// GUI initializer generated by IntelliJ IDEA GUI Designer
|
||||
@@ -43,10 +42,6 @@ public class VenderVerPanel extends BasePanel {
|
||||
return this.contentPane;
|
||||
}
|
||||
|
||||
public JButton getVenderButton() {
|
||||
return this.venderButton;
|
||||
}
|
||||
|
||||
public JButton getVolverButton() {
|
||||
return this.volverButton;
|
||||
}
|
||||
@@ -55,8 +50,8 @@ public class VenderVerPanel extends BasePanel {
|
||||
return this.ejemplaresTable;
|
||||
}
|
||||
|
||||
public JButton getAgregarButton() {
|
||||
return this.agregarButton;
|
||||
public BaseTableModel<Ejemplar> getEjemplaresTableModel() {
|
||||
return this.ejemplaresTableModel;
|
||||
}
|
||||
|
||||
public JTextField getPrecioTotalField() {
|
||||
@@ -79,6 +74,10 @@ public class VenderVerPanel extends BasePanel {
|
||||
return this.clienteField;
|
||||
}
|
||||
|
||||
public JTextField getTrabajadorField() {
|
||||
return this.trabajadorField;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method generated by IntelliJ IDEA GUI Designer >>> IMPORTANT!! <<< DO NOT edit this method OR call it in your code!
|
||||
*
|
||||
@@ -87,10 +86,10 @@ public class VenderVerPanel extends BasePanel {
|
||||
private void $$$setupUI$$$() {
|
||||
createUIComponents();
|
||||
contentPane = new JPanel();
|
||||
contentPane.setLayout(new GridLayoutManager(14, 3, new Insets(20, 20, 20, 20), -1, -1));
|
||||
contentPane.setLayout(new GridLayoutManager(16, 3, new Insets(20, 20, 20, 20), -1, -1));
|
||||
final JPanel panel1 = new JPanel();
|
||||
panel1.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
|
||||
contentPane.add(panel1, new GridConstraints(12, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
|
||||
contentPane.add(panel1, new GridConstraints(14, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
|
||||
volverButton = new JButton();
|
||||
@@ -100,69 +99,78 @@ public class VenderVerPanel extends BasePanel {
|
||||
null, 0, false));
|
||||
final Spacer spacer1 = new Spacer();
|
||||
contentPane.add(spacer1,
|
||||
new GridConstraints(13, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null,
|
||||
new GridConstraints(15, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null,
|
||||
null, null, 0, false));
|
||||
final Spacer spacer2 = new Spacer();
|
||||
contentPane.add(spacer2,
|
||||
new GridConstraints(13, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1,
|
||||
new GridConstraints(15, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1,
|
||||
null, null, null, 0, false));
|
||||
final Spacer spacer3 = new Spacer();
|
||||
contentPane.add(spacer3,
|
||||
new GridConstraints(13, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1,
|
||||
new GridConstraints(15, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1,
|
||||
null, null, null, 0, false));
|
||||
final JLabel label1 = new JLabel();
|
||||
label1.setText("Cliente:");
|
||||
contentPane.add(label1, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
final JScrollPane scrollPane1 = new JScrollPane();
|
||||
contentPane.add(scrollPane1, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
|
||||
contentPane.add(scrollPane1, new GridConstraints(5, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
|
||||
scrollPane1.setViewportView(ejemplaresTable);
|
||||
final JLabel label2 = new JLabel();
|
||||
label2.setText("Precio Total:");
|
||||
contentPane.add(label2, new GridConstraints(10, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||
contentPane.add(label2, new GridConstraints(12, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
precioTotalField = new JTextField();
|
||||
precioTotalField.setEditable(false);
|
||||
contentPane.add(precioTotalField,
|
||||
new GridConstraints(11, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||
new GridConstraints(13, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||
final JLabel label3 = new JLabel();
|
||||
label3.setText("IVA:");
|
||||
contentPane.add(label3, new GridConstraints(8, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||
contentPane.add(label3, new GridConstraints(10, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
final JLabel label4 = new JLabel();
|
||||
label4.setText("Precio Neto:");
|
||||
contentPane.add(label4, new GridConstraints(6, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||
contentPane.add(label4, new GridConstraints(8, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
precioNetoField = new JTextField();
|
||||
precioNetoField.setEditable(false);
|
||||
contentPane.add(precioNetoField,
|
||||
new GridConstraints(7, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||
new GridConstraints(9, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||
ivaField = new JTextField();
|
||||
ivaField.setEditable(false);
|
||||
contentPane.add(ivaField,
|
||||
new GridConstraints(9, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||
new GridConstraints(11, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||
final JLabel label5 = new JLabel();
|
||||
label5.setText("Folio:");
|
||||
contentPane.add(label5, new GridConstraints(4, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||
contentPane.add(label5, new GridConstraints(6, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
folioField = new JTextField();
|
||||
folioField.setEditable(false);
|
||||
contentPane.add(folioField,
|
||||
new GridConstraints(5, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||
new GridConstraints(7, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||
final JLabel label6 = new JLabel();
|
||||
label6.setText("Ejemplares:");
|
||||
contentPane.add(label6, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||
contentPane.add(label6, new GridConstraints(4, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
clienteField = new JTextField();
|
||||
contentPane.add(clienteField,
|
||||
new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||
final JLabel label7 = new JLabel();
|
||||
label7.setText("Trabajador:");
|
||||
contentPane.add(label7, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||
trabajadorField = new JTextField();
|
||||
trabajadorField.setEditable(false);
|
||||
contentPane.add(trabajadorField,
|
||||
new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
|
||||
}
|
||||
|
||||
private void createUIComponents() {
|
||||
|
||||
Reference in New Issue
Block a user