TO MUCH THINGS
Pero ya esta casi casi, estoy haciendo la eliminacion de cosas de las tarjetas de credito, luego empiezo a utilizar la linea de sobregiro y esta done done <3
This commit is contained in:
@@ -35,7 +35,7 @@ public class ClienteFacade extends AbstractFacade<Cliente> implements ClienteFac
|
||||
|
||||
@Override
|
||||
public Cliente findByRut(String rut) {
|
||||
TypedQuery<Cliente> query = em.createNamedQuery("Cliente.findByRut", Cliente.class);
|
||||
TypedQuery<Cliente> query = em.createQuery("SELECT c FROM Cliente c WHERE c.rut = :rut ", Cliente.class);
|
||||
query.setParameter("rut", rut);
|
||||
try {
|
||||
return query.getSingleResult();
|
||||
|
||||
@@ -34,7 +34,7 @@ public class UsuarioFacade extends AbstractFacade<Usuario> implements UsuarioFac
|
||||
|
||||
@Override
|
||||
public Usuario findByNombre(String name) {
|
||||
TypedQuery<Usuario> query = em.createNamedQuery("Usuario.findByNombre", Usuario.class);
|
||||
TypedQuery<Usuario> query = em.createQuery("SELECT u FROM Usuario u WHERE u.nombre = :nombre", Usuario.class);
|
||||
query.setParameter("nombre", name);
|
||||
try{
|
||||
return query.getSingleResult();
|
||||
|
||||
@@ -1,88 +1,59 @@
|
||||
package entities;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.CascadeType;
|
||||
import java.time.LocalDateTime;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.NamedQueries;
|
||||
import javax.persistence.NamedQuery;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.OneToOne;
|
||||
import javax.persistence.PrePersist;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlTransient;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author ryuuji
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "cliente")
|
||||
@XmlRootElement
|
||||
@NamedQueries({
|
||||
@NamedQuery(name = "Cliente.findAll", query = "SELECT c FROM Cliente c")
|
||||
, @NamedQuery(name = "Cliente.findById", query = "SELECT c FROM Cliente c WHERE c.id = :id")
|
||||
, @NamedQuery(name = "Cliente.findByRut", query = "SELECT c FROM Cliente c WHERE c.rut = :rut")
|
||||
, @NamedQuery(name = "Cliente.findByNombre", query = "SELECT c FROM Cliente c WHERE c.nombre = :nombre")
|
||||
, @NamedQuery(name = "Cliente.findByCiudad", query = "SELECT c FROM Cliente c WHERE c.ciudad = :ciudad")
|
||||
, @NamedQuery(name = "Cliente.findByInsertedAt", query = "SELECT c FROM Cliente c WHERE c.insertedAt = :insertedAt")})
|
||||
public class Cliente implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Basic(optional = false)
|
||||
@Column(name = "id")
|
||||
private Integer id;
|
||||
@Basic(optional = false)
|
||||
|
||||
@Column(name = "rut")
|
||||
private String rut;
|
||||
@Basic(optional = false)
|
||||
|
||||
@Column(name = "nombre")
|
||||
private String nombre;
|
||||
@Basic(optional = false)
|
||||
|
||||
@Column(name = "ciudad")
|
||||
private String ciudad;
|
||||
@Basic(optional = false)
|
||||
|
||||
@Column(name = "inserted_at")
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date insertedAt;
|
||||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "cliente")
|
||||
private List<CuentaCorriente> cuentaCorrienteList;
|
||||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "cliente")
|
||||
private List<TarjetaDebito> tarjetaDebitoList;
|
||||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "cliente")
|
||||
private List<TarjetaCredito> tarjetaCreditoList;
|
||||
@JoinColumn(name = "linea_sobregiro", referencedColumnName = "id")
|
||||
@OneToOne(optional = true)
|
||||
private LineaSobregiro lineaSobregiro;
|
||||
@JoinColumn(name = "usuario", referencedColumnName = "id")
|
||||
@OneToOne(optional = false)
|
||||
private LocalDateTime insertedAt;
|
||||
|
||||
@OneToOne
|
||||
@JoinColumn(name = "cuenta_corriente")
|
||||
private CuentaCorriente cuentaCorriente;
|
||||
|
||||
@OneToOne
|
||||
@JoinColumn(name = "tarjeta_debito")
|
||||
private TarjetaDebito tarjetaDebito;
|
||||
|
||||
@OneToOne
|
||||
@JoinColumn(name = "tarjeta_credito")
|
||||
private TarjetaCredito tarjetaCredito;
|
||||
|
||||
@OneToOne
|
||||
@JoinColumn(name = "usuario")
|
||||
private Usuario usuario;
|
||||
|
||||
public Cliente() {
|
||||
}
|
||||
|
||||
public Cliente(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Cliente(Integer id, String rut, String nombre, String ciudad, Date insertedAt) {
|
||||
this.id = id;
|
||||
this.rut = rut;
|
||||
this.nombre = nombre;
|
||||
this.ciudad = ciudad;
|
||||
this.insertedAt = insertedAt;
|
||||
|
||||
@PrePersist
|
||||
public void onPersist() {
|
||||
this.insertedAt = LocalDateTime.now();
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
@@ -117,53 +88,42 @@ public class Cliente implements Serializable {
|
||||
this.ciudad = ciudad;
|
||||
}
|
||||
|
||||
public Date getInsertedAt() {
|
||||
public LocalDateTime getInsertedAt() {
|
||||
return insertedAt;
|
||||
}
|
||||
|
||||
public void setInsertedAt(Date insertedAt) {
|
||||
public void setInsertedAt(LocalDateTime insertedAt) {
|
||||
this.insertedAt = insertedAt;
|
||||
}
|
||||
|
||||
@XmlTransient
|
||||
public List<CuentaCorriente> getCuentaCorrienteList() {
|
||||
if (cuentaCorrienteList == null)
|
||||
cuentaCorrienteList = new ArrayList<>();
|
||||
return cuentaCorrienteList;
|
||||
public CuentaCorriente getCuentaCorriente() {
|
||||
return cuentaCorriente;
|
||||
}
|
||||
|
||||
public void setCuentaCorrienteList(List<CuentaCorriente> cuentaCorrienteList) {
|
||||
this.cuentaCorrienteList = cuentaCorrienteList;
|
||||
public void setCuentaCorriente(CuentaCorriente cuentaCorriente) {
|
||||
this.cuentaCorriente = cuentaCorriente;
|
||||
if(this.cuentaCorriente.getCliente() != this)
|
||||
this.cuentaCorriente.setCliente(this);
|
||||
}
|
||||
|
||||
@XmlTransient
|
||||
public List<TarjetaDebito> getTarjetaDebitoList() {
|
||||
return tarjetaDebitoList;
|
||||
public TarjetaDebito getTarjetaDebito() {
|
||||
return tarjetaDebito;
|
||||
}
|
||||
|
||||
public void setTarjetaDebitoList(List<TarjetaDebito> tarjetaDebitoList) {
|
||||
if (tarjetaDebitoList == null)
|
||||
tarjetaDebitoList = new ArrayList<>();
|
||||
this.tarjetaDebitoList = tarjetaDebitoList;
|
||||
public void setTarjetaDebito(TarjetaDebito tarjetaDebito) {
|
||||
this.tarjetaDebito = tarjetaDebito;
|
||||
if(this.tarjetaDebito.getCliente() != this)
|
||||
this.tarjetaDebito.setCliente(this);
|
||||
}
|
||||
|
||||
@XmlTransient
|
||||
public List<TarjetaCredito> getTarjetaCreditoList() {
|
||||
return tarjetaCreditoList;
|
||||
public TarjetaCredito getTarjetaCredito() {
|
||||
return tarjetaCredito;
|
||||
}
|
||||
|
||||
public void setTarjetaCreditoList(List<TarjetaCredito> tarjetaCreditoList) {
|
||||
if (tarjetaCreditoList == null)
|
||||
tarjetaCreditoList = new ArrayList<>();
|
||||
this.tarjetaCreditoList = tarjetaCreditoList;
|
||||
}
|
||||
|
||||
public LineaSobregiro getLineaSobregiro() {
|
||||
return lineaSobregiro;
|
||||
}
|
||||
|
||||
public void setLineaSobregiro(LineaSobregiro lineaSobregiro) {
|
||||
this.lineaSobregiro = lineaSobregiro;
|
||||
public void setTarjetaCredito(TarjetaCredito tarjetaCredito) {
|
||||
this.tarjetaCredito = tarjetaCredito;
|
||||
if(this.tarjetaCredito.getCliente() != this)
|
||||
this.tarjetaCredito.setCliente(this);
|
||||
}
|
||||
|
||||
public Usuario getUsuario() {
|
||||
@@ -172,6 +132,8 @@ public class Cliente implements Serializable {
|
||||
|
||||
public void setUsuario(Usuario usuario) {
|
||||
this.usuario = usuario;
|
||||
if(this.usuario.getCliente() != this)
|
||||
this.usuario.setCliente(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -188,14 +150,11 @@ public class Cliente implements Serializable {
|
||||
return false;
|
||||
}
|
||||
Cliente other = (Cliente) object;
|
||||
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)))
|
||||
return false;
|
||||
return true;
|
||||
return !((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "entities.Cliente[ id=" + id + " ]";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,13 +1,7 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package entities;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import javax.persistence.Basic;
|
||||
import java.time.LocalDateTime;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
@@ -15,58 +9,39 @@ import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.NamedQueries;
|
||||
import javax.persistence.NamedQuery;
|
||||
import javax.persistence.PrePersist;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author ryuuji
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "compra_tarjeta_credito")
|
||||
@XmlRootElement
|
||||
@NamedQueries({
|
||||
@NamedQuery(name = "CompraTarjetaCredito.findAll", query = "SELECT c FROM CompraTarjetaCredito c")
|
||||
, @NamedQuery(name = "CompraTarjetaCredito.findById", query = "SELECT c FROM CompraTarjetaCredito c WHERE c.id = :id")
|
||||
, @NamedQuery(name = "CompraTarjetaCredito.findByMonto", query = "SELECT c FROM CompraTarjetaCredito c WHERE c.monto = :monto")
|
||||
, @NamedQuery(name = "CompraTarjetaCredito.findByComentario", query = "SELECT c FROM CompraTarjetaCredito c WHERE c.comentario = :comentario")
|
||||
, @NamedQuery(name = "CompraTarjetaCredito.findByInsertedAt", query = "SELECT c FROM CompraTarjetaCredito c WHERE c.insertedAt = :insertedAt")})
|
||||
public class CompraTarjetaCredito implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Basic(optional = false)
|
||||
@Column(name = "id")
|
||||
private Integer id;
|
||||
@Basic(optional = false)
|
||||
|
||||
@Column(name = "monto")
|
||||
private int monto;
|
||||
|
||||
@Column(name = "comentario")
|
||||
private String comentario;
|
||||
@Basic(optional = false)
|
||||
|
||||
@Column(name = "tipo")
|
||||
private String tipo;
|
||||
|
||||
@Column(name = "inserted_at")
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date insertedAt;
|
||||
@JoinColumn(name = "tarjeta_credito", referencedColumnName = "id")
|
||||
private LocalDateTime insertedAt;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "tarjeta_credito")
|
||||
private TarjetaCredito tarjetaCredito;
|
||||
|
||||
public CompraTarjetaCredito() {
|
||||
}
|
||||
|
||||
public CompraTarjetaCredito(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public CompraTarjetaCredito(Integer id, int monto, Date insertedAt) {
|
||||
this.id = id;
|
||||
this.monto = monto;
|
||||
this.insertedAt = insertedAt;
|
||||
@PrePersist
|
||||
public void onPersist() {
|
||||
this.insertedAt = LocalDateTime.now();
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
@@ -93,11 +68,20 @@ public class CompraTarjetaCredito implements Serializable {
|
||||
this.comentario = comentario;
|
||||
}
|
||||
|
||||
public Date getInsertedAt() {
|
||||
public String getTipo() {
|
||||
return tipo;
|
||||
}
|
||||
|
||||
public void setTipo(String tipo) {
|
||||
this.tipo = tipo;
|
||||
}
|
||||
|
||||
|
||||
public LocalDateTime getInsertedAt() {
|
||||
return insertedAt;
|
||||
}
|
||||
|
||||
public void setInsertedAt(Date insertedAt) {
|
||||
public void setInsertedAt(LocalDateTime insertedAt) {
|
||||
this.insertedAt = insertedAt;
|
||||
}
|
||||
|
||||
@@ -107,6 +91,8 @@ public class CompraTarjetaCredito implements Serializable {
|
||||
|
||||
public void setTarjetaCredito(TarjetaCredito tarjetaCredito) {
|
||||
this.tarjetaCredito = tarjetaCredito;
|
||||
if(!this.tarjetaCredito.getCompraList().contains(this))
|
||||
this.tarjetaCredito.getCompraList().add(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -123,9 +109,7 @@ public class CompraTarjetaCredito implements Serializable {
|
||||
return false;
|
||||
}
|
||||
CompraTarjetaCredito other = (CompraTarjetaCredito) object;
|
||||
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)))
|
||||
return false;
|
||||
return true;
|
||||
return !((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package entities;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.Column;
|
||||
@@ -17,56 +13,38 @@ import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.NamedQueries;
|
||||
import javax.persistence.NamedQuery;
|
||||
import javax.persistence.PrePersist;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author ryuuji
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "compra_tarjeta_debito")
|
||||
@XmlRootElement
|
||||
@NamedQueries({
|
||||
@NamedQuery(name = "CompraTarjetaDebito.findAll", query = "SELECT c FROM CompraTarjetaDebito c")
|
||||
, @NamedQuery(name = "CompraTarjetaDebito.findById", query = "SELECT c FROM CompraTarjetaDebito c WHERE c.id = :id")
|
||||
, @NamedQuery(name = "CompraTarjetaDebito.findByMonto", query = "SELECT c FROM CompraTarjetaDebito c WHERE c.monto = :monto")
|
||||
, @NamedQuery(name = "CompraTarjetaDebito.findByComentario", query = "SELECT c FROM CompraTarjetaDebito c WHERE c.comentario = :comentario")
|
||||
, @NamedQuery(name = "CompraTarjetaDebito.findByInsertedAt", query = "SELECT c FROM CompraTarjetaDebito c WHERE c.insertedAt = :insertedAt")})
|
||||
public class CompraTarjetaDebito implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Basic(optional = false)
|
||||
@Column(name = "id")
|
||||
private Integer id;
|
||||
@Basic(optional = false)
|
||||
|
||||
@Column(name = "monto")
|
||||
private int monto;
|
||||
|
||||
@Column(name = "comentario")
|
||||
private String comentario;
|
||||
@Basic(optional = false)
|
||||
|
||||
@Column(name = "inserted_at")
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date insertedAt;
|
||||
@JoinColumn(name = "tarjeta_debito", referencedColumnName = "id")
|
||||
@ManyToOne(optional = false)
|
||||
private LocalDateTime insertedAt;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "tarjeta_debito")
|
||||
private TarjetaDebito tarjetaDebito;
|
||||
|
||||
public CompraTarjetaDebito() {
|
||||
}
|
||||
|
||||
public CompraTarjetaDebito(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public CompraTarjetaDebito(Integer id, int monto, Date insertedAt) {
|
||||
this.id = id;
|
||||
this.monto = monto;
|
||||
this.insertedAt = insertedAt;
|
||||
@PrePersist
|
||||
public void onPersist() {
|
||||
this.insertedAt = LocalDateTime.now();
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
@@ -93,11 +71,11 @@ public class CompraTarjetaDebito implements Serializable {
|
||||
this.comentario = comentario;
|
||||
}
|
||||
|
||||
public Date getInsertedAt() {
|
||||
public LocalDateTime getInsertedAt() {
|
||||
return insertedAt;
|
||||
}
|
||||
|
||||
public void setInsertedAt(Date insertedAt) {
|
||||
public void setInsertedAt(LocalDateTime insertedAt) {
|
||||
this.insertedAt = insertedAt;
|
||||
}
|
||||
|
||||
@@ -107,6 +85,8 @@ public class CompraTarjetaDebito implements Serializable {
|
||||
|
||||
public void setTarjetaDebito(TarjetaDebito tarjetaDebito) {
|
||||
this.tarjetaDebito = tarjetaDebito;
|
||||
if(!this.tarjetaDebito.getCompraList().contains(this))
|
||||
this.tarjetaDebito.getCompraList().add(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -123,9 +103,7 @@ public class CompraTarjetaDebito implements Serializable {
|
||||
return false;
|
||||
}
|
||||
CompraTarjetaDebito other = (CompraTarjetaDebito) object;
|
||||
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)))
|
||||
return false;
|
||||
return true;
|
||||
return !((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,80 +1,60 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package entities;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.NamedQueries;
|
||||
import javax.persistence.NamedQuery;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.OneToOne;
|
||||
import javax.persistence.PrePersist;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlTransient;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author ryuuji
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "cuenta_corriente")
|
||||
@XmlRootElement
|
||||
@NamedQueries({
|
||||
@NamedQuery(name = "CuentaCorriente.findAll", query = "SELECT c FROM CuentaCorriente c")
|
||||
, @NamedQuery(name = "CuentaCorriente.findById", query = "SELECT c FROM CuentaCorriente c WHERE c.id = :id")
|
||||
, @NamedQuery(name = "CuentaCorriente.findBySaldo", query = "SELECT c FROM CuentaCorriente c WHERE c.saldo = :saldo")
|
||||
, @NamedQuery(name = "CuentaCorriente.findByInsertedAt", query = "SELECT c FROM CuentaCorriente c WHERE c.insertedAt = :insertedAt")})
|
||||
public class CuentaCorriente implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Basic(optional = false)
|
||||
@Column(name = "id")
|
||||
private Integer id;
|
||||
@Basic(optional = false)
|
||||
|
||||
@Column(name = "saldo")
|
||||
private int saldo;
|
||||
@Basic(optional = false)
|
||||
|
||||
@Column(name = "inserted_at")
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date insertedAt;
|
||||
@JoinColumn(name = "cliente", referencedColumnName = "id")
|
||||
@ManyToOne(optional = false)
|
||||
private LocalDateTime insertedAt;
|
||||
|
||||
@OneToOne
|
||||
@JoinColumn(name = "linea_sobregiro")
|
||||
private LineaSobregiro lineaSobregiro;
|
||||
|
||||
@OneToOne(mappedBy = "cuentaCorriente")
|
||||
private Cliente cliente;
|
||||
|
||||
@OneToMany(mappedBy = "cuentaCorriente")
|
||||
private List<DepositoCuentaCorriente> depositoList;
|
||||
|
||||
@OneToMany(mappedBy = "cuentaCorrienteFrom")
|
||||
private List<TransferenciaCuentaCorriente> transferenciaFromList;
|
||||
|
||||
@OneToMany(mappedBy = "cuentaCorrienteTo")
|
||||
private List<TransferenciaCuentaCorriente> transferenciaToList;
|
||||
|
||||
@OneToMany(mappedBy = "cuentaCorriente")
|
||||
private List<GiroCuentaCorriente> giroList;
|
||||
|
||||
public CuentaCorriente() {
|
||||
}
|
||||
|
||||
public CuentaCorriente(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public CuentaCorriente(Integer id, int saldo, Date insertedAt) {
|
||||
this.id = id;
|
||||
this.saldo = saldo;
|
||||
this.insertedAt = insertedAt;
|
||||
@PrePersist
|
||||
public void onPersist() {
|
||||
this.insertedAt = LocalDateTime.now();
|
||||
this.saldo = 0;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
@@ -93,20 +73,32 @@ public class CuentaCorriente implements Serializable {
|
||||
this.saldo = saldo;
|
||||
}
|
||||
|
||||
public Date getInsertedAt() {
|
||||
public LocalDateTime getInsertedAt() {
|
||||
return insertedAt;
|
||||
}
|
||||
|
||||
public void setInsertedAt(Date insertedAt) {
|
||||
public void setInsertedAt(LocalDateTime insertedAt) {
|
||||
this.insertedAt = insertedAt;
|
||||
}
|
||||
|
||||
public LineaSobregiro getLineaSobregiro() {
|
||||
return lineaSobregiro;
|
||||
}
|
||||
|
||||
public void setLineaSobregiro(LineaSobregiro lineaSobregiro) {
|
||||
this.lineaSobregiro = lineaSobregiro;
|
||||
if (!this.lineaSobregiro.getCuentaCorrienteList().contains(this))
|
||||
this.lineaSobregiro.getCuentaCorrienteList().add(this);
|
||||
}
|
||||
|
||||
public Cliente getCliente() {
|
||||
return cliente;
|
||||
}
|
||||
|
||||
public void setCliente(Cliente cliente) {
|
||||
this.cliente = cliente;
|
||||
if(this.cliente.getCuentaCorriente() != this)
|
||||
this.cliente.setCuentaCorriente(this);
|
||||
}
|
||||
|
||||
@XmlTransient
|
||||
@@ -118,6 +110,12 @@ public class CuentaCorriente implements Serializable {
|
||||
this.depositoList = depositoList;
|
||||
}
|
||||
|
||||
public void addDeposito(DepositoCuentaCorriente deposito) {
|
||||
this.depositoList.add(deposito);
|
||||
if (deposito.getCuentaCorriente() != this)
|
||||
deposito.setCuentaCorriente(this);
|
||||
}
|
||||
|
||||
@XmlTransient
|
||||
public List<TransferenciaCuentaCorriente> getTransferenciaFromList() {
|
||||
return transferenciaFromList;
|
||||
@@ -127,6 +125,12 @@ public class CuentaCorriente implements Serializable {
|
||||
this.transferenciaFromList = transferenciaFromList;
|
||||
}
|
||||
|
||||
public void addTransferenciaFrom(TransferenciaCuentaCorriente transferenciaFrom) {
|
||||
this.transferenciaFromList.add(transferenciaFrom);
|
||||
if (transferenciaFrom.getCuentaCorrienteFrom() != this)
|
||||
transferenciaFrom.setCuentaCorrienteFrom(this);
|
||||
}
|
||||
|
||||
@XmlTransient
|
||||
public List<TransferenciaCuentaCorriente> getTransferenciaToList() {
|
||||
return transferenciaToList;
|
||||
@@ -136,6 +140,12 @@ public class CuentaCorriente implements Serializable {
|
||||
this.transferenciaToList = transferenciaToList;
|
||||
}
|
||||
|
||||
public void addTransferenciaTo(TransferenciaCuentaCorriente transferenciaTo) {
|
||||
this.transferenciaFromList.add(transferenciaTo);
|
||||
if (transferenciaTo.getCuentaCorrienteTo() != this)
|
||||
transferenciaTo.setCuentaCorrienteTo(this);
|
||||
}
|
||||
|
||||
@XmlTransient
|
||||
public List<GiroCuentaCorriente> getGiroList() {
|
||||
return giroList;
|
||||
@@ -145,6 +155,12 @@ public class CuentaCorriente implements Serializable {
|
||||
this.giroList = giroList;
|
||||
}
|
||||
|
||||
public void addGiro(GiroCuentaCorriente giro) {
|
||||
this.giroList.add(giro);
|
||||
if (giro.getCuentaCorriente() != this)
|
||||
giro.setCuentaCorriente(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 0;
|
||||
@@ -168,5 +184,5 @@ public class CuentaCorriente implements Serializable {
|
||||
public String toString() {
|
||||
return "entities.CuentaCorriente[ id=" + id + " ]";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package entities;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.Column;
|
||||
@@ -17,59 +13,42 @@ import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.NamedQueries;
|
||||
import javax.persistence.NamedQuery;
|
||||
import javax.persistence.PrePersist;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author ryuuji
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "deposito_cuenta_corriente")
|
||||
@XmlRootElement
|
||||
@NamedQueries({
|
||||
@NamedQuery(name = "DepositoCuentaCorriente.findAll", query = "SELECT d FROM DepositoCuentaCorriente d")
|
||||
, @NamedQuery(name = "DepositoCuentaCorriente.findById", query = "SELECT d FROM DepositoCuentaCorriente d WHERE d.id = :id")
|
||||
, @NamedQuery(name = "DepositoCuentaCorriente.findByMonto", query = "SELECT d FROM DepositoCuentaCorriente d WHERE d.monto = :monto")
|
||||
, @NamedQuery(name = "DepositoCuentaCorriente.findByComentario", query = "SELECT d FROM DepositoCuentaCorriente d WHERE d.comentario = :comentario")
|
||||
, @NamedQuery(name = "DepositoCuentaCorriente.findByInsertedAt", query = "SELECT d FROM DepositoCuentaCorriente d WHERE d.insertedAt = :insertedAt")})
|
||||
public class DepositoCuentaCorriente implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Basic(optional = false)
|
||||
@Column(name = "id")
|
||||
private Integer id;
|
||||
@Basic(optional = false)
|
||||
|
||||
@Column(name = "monto")
|
||||
private int monto;
|
||||
|
||||
@Column(name = "comentario")
|
||||
private String comentario;
|
||||
@Basic(optional = false)
|
||||
|
||||
@Column(name = "inserted_at")
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date insertedAt;
|
||||
@JoinColumn(name = "metodo", referencedColumnName = "id")
|
||||
private LocalDateTime insertedAt;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "metodo")
|
||||
private Metodo metodo;
|
||||
@JoinColumn(name = "cuenta_corriente", referencedColumnName = "id")
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "cuenta_corriente")
|
||||
private CuentaCorriente cuentaCorriente;
|
||||
|
||||
public DepositoCuentaCorriente() {
|
||||
}
|
||||
|
||||
public DepositoCuentaCorriente(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public DepositoCuentaCorriente(Integer id, int monto, Date insertedAt) {
|
||||
this.id = id;
|
||||
this.monto = monto;
|
||||
this.insertedAt = insertedAt;
|
||||
@PrePersist
|
||||
public void onPersist() {
|
||||
this.insertedAt = LocalDateTime.now();
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
@@ -96,11 +75,11 @@ public class DepositoCuentaCorriente implements Serializable {
|
||||
this.comentario = comentario;
|
||||
}
|
||||
|
||||
public Date getInsertedAt() {
|
||||
public LocalDateTime getInsertedAt() {
|
||||
return insertedAt;
|
||||
}
|
||||
|
||||
public void setInsertedAt(Date insertedAt) {
|
||||
public void setInsertedAt(LocalDateTime insertedAt) {
|
||||
this.insertedAt = insertedAt;
|
||||
}
|
||||
|
||||
@@ -110,6 +89,8 @@ public class DepositoCuentaCorriente implements Serializable {
|
||||
|
||||
public void setMetodo(Metodo metodo) {
|
||||
this.metodo = metodo;
|
||||
if(!metodo.getDepositoCuentaCorrienteList().contains(this))
|
||||
metodo.getDepositoCuentaCorrienteList().add(this);
|
||||
}
|
||||
|
||||
public CuentaCorriente getCuentaCorriente() {
|
||||
@@ -118,6 +99,8 @@ public class DepositoCuentaCorriente implements Serializable {
|
||||
|
||||
public void setCuentaCorriente(CuentaCorriente cuentaCorriente) {
|
||||
this.cuentaCorriente = cuentaCorriente;
|
||||
if(!this.cuentaCorriente.getDepositoList().contains(this))
|
||||
this.cuentaCorriente.getDepositoList().add(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -134,14 +117,12 @@ public class DepositoCuentaCorriente implements Serializable {
|
||||
return false;
|
||||
}
|
||||
DepositoCuentaCorriente other = (DepositoCuentaCorriente) object;
|
||||
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)))
|
||||
return false;
|
||||
return true;
|
||||
return !((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "entities.DepositoCuentaCorriente[ id=" + id + " ]";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,13 +1,7 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package entities;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import javax.persistence.Basic;
|
||||
import java.time.LocalDateTime;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
@@ -15,63 +9,42 @@ import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.NamedQueries;
|
||||
import javax.persistence.NamedQuery;
|
||||
import javax.persistence.PrePersist;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author ryuuji
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "deposito_tarjeta_debito")
|
||||
@XmlRootElement
|
||||
@NamedQueries({
|
||||
@NamedQuery(name = "DepositoTarjetaDebito.findAll", query = "SELECT d FROM DepositoTarjetaDebito d")
|
||||
, @NamedQuery(name = "DepositoTarjetaDebito.findById", query = "SELECT d FROM DepositoTarjetaDebito d WHERE d.id = :id")
|
||||
, @NamedQuery(name = "DepositoTarjetaDebito.findByMonto", query = "SELECT d FROM DepositoTarjetaDebito d WHERE d.monto = :monto")
|
||||
, @NamedQuery(name = "DepositoTarjetaDebito.findByComentario", query = "SELECT d FROM DepositoTarjetaDebito d WHERE d.comentario = :comentario")
|
||||
, @NamedQuery(name = "DepositoTarjetaDebito.findByInsertedAt", query = "SELECT d FROM DepositoTarjetaDebito d WHERE d.insertedAt = :insertedAt")})
|
||||
public class DepositoTarjetaDebito implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Basic(optional = false)
|
||||
@Column(name = "id")
|
||||
private Integer id;
|
||||
@Basic(optional = false)
|
||||
|
||||
@Column(name = "monto")
|
||||
private int monto;
|
||||
|
||||
@Column(name = "comentario")
|
||||
private String comentario;
|
||||
@Basic(optional = false)
|
||||
|
||||
@Column(name = "inserted_at")
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date insertedAt;
|
||||
@JoinColumn(name = "metodo", referencedColumnName = "id")
|
||||
private LocalDateTime insertedAt;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "metodo")
|
||||
private Metodo metodo;
|
||||
@JoinColumn(name = "tarjeta_debito", referencedColumnName = "id")
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "tarjeta_debito")
|
||||
private TarjetaDebito tarjetaDebito;
|
||||
|
||||
public DepositoTarjetaDebito() {
|
||||
@PrePersist
|
||||
public void onPersist() {
|
||||
this.insertedAt = LocalDateTime.now();
|
||||
}
|
||||
|
||||
public DepositoTarjetaDebito(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public DepositoTarjetaDebito(Integer id, int monto, Date insertedAt) {
|
||||
this.id = id;
|
||||
this.monto = monto;
|
||||
this.insertedAt = insertedAt;
|
||||
}
|
||||
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -96,11 +69,11 @@ public class DepositoTarjetaDebito implements Serializable {
|
||||
this.comentario = comentario;
|
||||
}
|
||||
|
||||
public Date getInsertedAt() {
|
||||
public LocalDateTime getInsertedAt() {
|
||||
return insertedAt;
|
||||
}
|
||||
|
||||
public void setInsertedAt(Date insertedAt) {
|
||||
public void setInsertedAt(LocalDateTime insertedAt) {
|
||||
this.insertedAt = insertedAt;
|
||||
}
|
||||
|
||||
@@ -110,6 +83,8 @@ public class DepositoTarjetaDebito implements Serializable {
|
||||
|
||||
public void setMetodo(Metodo metodo) {
|
||||
this.metodo = metodo;
|
||||
if(!this.metodo.getDepositoTarjetaDebitoList().contains(this))
|
||||
this.metodo.getDepositoTarjetaDebitoList().add(this);
|
||||
}
|
||||
|
||||
public TarjetaDebito getTarjetaDebito() {
|
||||
@@ -118,6 +93,8 @@ public class DepositoTarjetaDebito implements Serializable {
|
||||
|
||||
public void setTarjetaDebito(TarjetaDebito tarjetaDebito) {
|
||||
this.tarjetaDebito = tarjetaDebito;
|
||||
if(!this.tarjetaDebito.getDepositoList().contains(this))
|
||||
this.tarjetaDebito.getDepositoList().add(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -143,5 +120,5 @@ public class DepositoTarjetaDebito implements Serializable {
|
||||
public String toString() {
|
||||
return "entities.DepositoTarjetaDebito[ id=" + id + " ]";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,13 +1,7 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package entities;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import javax.persistence.Basic;
|
||||
import java.time.LocalDateTime;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
@@ -15,63 +9,42 @@ import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.NamedQueries;
|
||||
import javax.persistence.NamedQuery;
|
||||
import javax.persistence.PrePersist;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author ryuuji
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "giro_cuenta_corriente")
|
||||
@XmlRootElement
|
||||
@NamedQueries({
|
||||
@NamedQuery(name = "GiroCuentaCorriente.findAll", query = "SELECT g FROM GiroCuentaCorriente g")
|
||||
, @NamedQuery(name = "GiroCuentaCorriente.findById", query = "SELECT g FROM GiroCuentaCorriente g WHERE g.id = :id")
|
||||
, @NamedQuery(name = "GiroCuentaCorriente.findByMonto", query = "SELECT g FROM GiroCuentaCorriente g WHERE g.monto = :monto")
|
||||
, @NamedQuery(name = "GiroCuentaCorriente.findByComentario", query = "SELECT g FROM GiroCuentaCorriente g WHERE g.comentario = :comentario")
|
||||
, @NamedQuery(name = "GiroCuentaCorriente.findByInsertedAt", query = "SELECT g FROM GiroCuentaCorriente g WHERE g.insertedAt = :insertedAt")})
|
||||
public class GiroCuentaCorriente implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Basic(optional = false)
|
||||
@Column(name = "id")
|
||||
private Integer id;
|
||||
@Basic(optional = false)
|
||||
|
||||
@Column(name = "monto")
|
||||
private int monto;
|
||||
|
||||
@Column(name = "comentario")
|
||||
private String comentario;
|
||||
@Basic(optional = false)
|
||||
|
||||
@Column(name = "inserted_at")
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date insertedAt;
|
||||
@JoinColumn(name = "metodo", referencedColumnName = "id")
|
||||
private LocalDateTime insertedAt;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "metodo")
|
||||
private Metodo metodo;
|
||||
@JoinColumn(name = "cuenta_corriente", referencedColumnName = "id")
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "cuenta_corriente")
|
||||
private CuentaCorriente cuentaCorriente;
|
||||
|
||||
public GiroCuentaCorriente() {
|
||||
@PrePersist
|
||||
public void onPersist() {
|
||||
this.insertedAt = LocalDateTime.now();
|
||||
}
|
||||
|
||||
public GiroCuentaCorriente(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public GiroCuentaCorriente(Integer id, int monto, Date insertedAt) {
|
||||
this.id = id;
|
||||
this.monto = monto;
|
||||
this.insertedAt = insertedAt;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -96,11 +69,11 @@ public class GiroCuentaCorriente implements Serializable {
|
||||
this.comentario = comentario;
|
||||
}
|
||||
|
||||
public Date getInsertedAt() {
|
||||
public LocalDateTime getInsertedAt() {
|
||||
return insertedAt;
|
||||
}
|
||||
|
||||
public void setInsertedAt(Date insertedAt) {
|
||||
public void setInsertedAt(LocalDateTime insertedAt) {
|
||||
this.insertedAt = insertedAt;
|
||||
}
|
||||
|
||||
@@ -110,6 +83,8 @@ public class GiroCuentaCorriente implements Serializable {
|
||||
|
||||
public void setMetodo(Metodo metodo) {
|
||||
this.metodo = metodo;
|
||||
if(!this.metodo.getGiroCuentaCorrienteList().contains(this))
|
||||
this.metodo.getGiroCuentaCorrienteList().add(this);
|
||||
}
|
||||
|
||||
public CuentaCorriente getCuentaCorriente() {
|
||||
@@ -118,6 +93,8 @@ public class GiroCuentaCorriente implements Serializable {
|
||||
|
||||
public void setCuentaCorriente(CuentaCorriente cuentaCorriente) {
|
||||
this.cuentaCorriente = cuentaCorriente;
|
||||
if(!this.cuentaCorriente.getGiroList().contains(this))
|
||||
this.cuentaCorriente.getGiroList().add(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -134,9 +111,7 @@ public class GiroCuentaCorriente implements Serializable {
|
||||
return false;
|
||||
}
|
||||
GiroCuentaCorriente other = (GiroCuentaCorriente) object;
|
||||
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)))
|
||||
return false;
|
||||
return true;
|
||||
return !((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package entities;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.Column;
|
||||
@@ -17,61 +13,43 @@ import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.NamedQueries;
|
||||
import javax.persistence.NamedQuery;
|
||||
import javax.persistence.PrePersist;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author ryuuji
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "giro_tarjeta_debito")
|
||||
@XmlRootElement
|
||||
@NamedQueries({
|
||||
@NamedQuery(name = "GiroTarjetaDebito.findAll", query = "SELECT g FROM GiroTarjetaDebito g")
|
||||
, @NamedQuery(name = "GiroTarjetaDebito.findById", query = "SELECT g FROM GiroTarjetaDebito g WHERE g.id = :id")
|
||||
, @NamedQuery(name = "GiroTarjetaDebito.findByMonto", query = "SELECT g FROM GiroTarjetaDebito g WHERE g.monto = :monto")
|
||||
, @NamedQuery(name = "GiroTarjetaDebito.findByComentario", query = "SELECT g FROM GiroTarjetaDebito g WHERE g.comentario = :comentario")
|
||||
, @NamedQuery(name = "GiroTarjetaDebito.findByInsertedAt", query = "SELECT g FROM GiroTarjetaDebito g WHERE g.insertedAt = :insertedAt")})
|
||||
public class GiroTarjetaDebito implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Basic(optional = false)
|
||||
@Column(name = "id")
|
||||
private Integer id;
|
||||
@Basic(optional = false)
|
||||
|
||||
@Column(name = "monto")
|
||||
private int monto;
|
||||
|
||||
@Column(name = "comentario")
|
||||
private String comentario;
|
||||
@Basic(optional = false)
|
||||
|
||||
@Column(name = "inserted_at")
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date insertedAt;
|
||||
@JoinColumn(name = "tarjeta_debito", referencedColumnName = "id")
|
||||
private LocalDateTime insertedAt;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "tarjeta_debito")
|
||||
private TarjetaDebito tarjetaDebito;
|
||||
@JoinColumn(name = "metodo", referencedColumnName = "id")
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "metodo")
|
||||
private Metodo metodo;
|
||||
|
||||
public GiroTarjetaDebito() {
|
||||
@PrePersist
|
||||
public void onPersis() {
|
||||
this.insertedAt = LocalDateTime.now();
|
||||
}
|
||||
|
||||
public GiroTarjetaDebito(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public GiroTarjetaDebito(Integer id, int monto, Date insertedAt) {
|
||||
this.id = id;
|
||||
this.monto = monto;
|
||||
this.insertedAt = insertedAt;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -96,20 +74,22 @@ public class GiroTarjetaDebito implements Serializable {
|
||||
this.comentario = comentario;
|
||||
}
|
||||
|
||||
public Date getInsertedAt() {
|
||||
public LocalDateTime getInsertedAt() {
|
||||
return insertedAt;
|
||||
}
|
||||
|
||||
public void setInsertedAt(Date insertedAt) {
|
||||
public void setInsertedAt(LocalDateTime insertedAt) {
|
||||
this.insertedAt = insertedAt;
|
||||
}
|
||||
|
||||
|
||||
public TarjetaDebito getTarjetaDebito() {
|
||||
return tarjetaDebito;
|
||||
}
|
||||
|
||||
public void setTarjetaDebito(TarjetaDebito tarjetaDebito) {
|
||||
this.tarjetaDebito = tarjetaDebito;
|
||||
if(!this.tarjetaDebito.getGiroList().contains(this))
|
||||
this.tarjetaDebito.getGiroList().add(this);
|
||||
}
|
||||
|
||||
public Metodo getMetodo() {
|
||||
@@ -118,6 +98,8 @@ public class GiroTarjetaDebito implements Serializable {
|
||||
|
||||
public void setMetodo(Metodo metodo) {
|
||||
this.metodo = metodo;
|
||||
if(!this.metodo.getGiroTarjetaDebitoList().contains(this))
|
||||
this.metodo.getGiroTarjetaDebitoList().add(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -134,14 +116,12 @@ public class GiroTarjetaDebito implements Serializable {
|
||||
return false;
|
||||
}
|
||||
GiroTarjetaDebito other = (GiroTarjetaDebito) object;
|
||||
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)))
|
||||
return false;
|
||||
return true;
|
||||
return !((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "entities.GiroTarjetaDebito[ id=" + id + " ]";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,73 +1,48 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package entities;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.CascadeType;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
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;
|
||||
import javax.persistence.OneToOne;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.PrePersist;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author ryuuji
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "linea_sobregiro")
|
||||
@XmlRootElement
|
||||
@NamedQueries({
|
||||
@NamedQuery(name = "LineaSobregiro.findAll", query = "SELECT l FROM LineaSobregiro l")
|
||||
, @NamedQuery(name = "LineaSobregiro.findById", query = "SELECT l FROM LineaSobregiro l WHERE l.id = :id")
|
||||
, @NamedQuery(name = "LineaSobregiro.findBySobregiro", query = "SELECT l FROM LineaSobregiro l WHERE l.sobregiro = :sobregiro")
|
||||
, @NamedQuery(name = "LineaSobregiro.findByLimite", query = "SELECT l FROM LineaSobregiro l WHERE l.limite = :limite")
|
||||
, @NamedQuery(name = "LineaSobregiro.findByInsertedAt", query = "SELECT l FROM LineaSobregiro l WHERE l.insertedAt = :insertedAt")})
|
||||
public class LineaSobregiro implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Basic(optional = false)
|
||||
@Column(name = "id")
|
||||
private Integer id;
|
||||
@Basic(optional = false)
|
||||
@Column(name = "sobregiro")
|
||||
|
||||
@Column(name = "sobregiro", nullable = false)
|
||||
private int sobregiro;
|
||||
@Basic(optional = false)
|
||||
@Column(name = "limite")
|
||||
|
||||
@Column(name = "limite", nullable = false)
|
||||
private int limite;
|
||||
@Basic(optional = false)
|
||||
@Column(name = "inserted_at")
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date insertedAt;
|
||||
@OneToOne(cascade = CascadeType.ALL, mappedBy = "lineaSobregiro")
|
||||
private Cliente cliente;
|
||||
|
||||
public LineaSobregiro() {
|
||||
}
|
||||
@Column(name = "inserted_at", nullable = false)
|
||||
private LocalDateTime insertedAt;
|
||||
|
||||
public LineaSobregiro(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
@OneToMany(mappedBy = "lineaSobregiro")
|
||||
private List<CuentaCorriente> cuentaCorrienteList;
|
||||
|
||||
public LineaSobregiro(Integer id, int sobregiro, int limite, Date insertedAt) {
|
||||
this.id = id;
|
||||
this.sobregiro = sobregiro;
|
||||
this.limite = limite;
|
||||
this.insertedAt = insertedAt;
|
||||
@OneToMany(mappedBy = "lineaSobregiro")
|
||||
private List<TarjetaCredito> tarjetaCreditoList;
|
||||
|
||||
@PrePersist
|
||||
public void onPersist() {
|
||||
this.insertedAt = LocalDateTime.now();
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
@@ -94,22 +69,42 @@ public class LineaSobregiro implements Serializable {
|
||||
this.limite = limite;
|
||||
}
|
||||
|
||||
public Date getInsertedAt() {
|
||||
public List<CuentaCorriente> getCuentaCorrienteList() {
|
||||
return cuentaCorrienteList;
|
||||
}
|
||||
|
||||
public void setCuentaCorrienteList(List<CuentaCorriente> cuentaCorrienteList) {
|
||||
this.cuentaCorrienteList = cuentaCorrienteList;
|
||||
}
|
||||
|
||||
public void addCuentaCorriente(CuentaCorriente cuentaCorriente){
|
||||
this.cuentaCorrienteList.add(cuentaCorriente);
|
||||
if(cuentaCorriente.getLineaSobregiro() != this)
|
||||
cuentaCorriente.setLineaSobregiro(this);
|
||||
}
|
||||
|
||||
public List<TarjetaCredito> getTarjetaCreditoList() {
|
||||
return tarjetaCreditoList;
|
||||
}
|
||||
|
||||
public void setTarjetaCreditoList(List<TarjetaCredito> tarjetaCreditoList) {
|
||||
this.tarjetaCreditoList = tarjetaCreditoList;
|
||||
}
|
||||
|
||||
public void addTarjetaCredito(TarjetaCredito tarjetaCredito){
|
||||
this.tarjetaCreditoList.add(tarjetaCredito);
|
||||
if(tarjetaCredito.getLineaSobregiro() != this)
|
||||
tarjetaCredito.setLineaSobregiro(this);
|
||||
}
|
||||
|
||||
public LocalDateTime getInsertedAt() {
|
||||
return insertedAt;
|
||||
}
|
||||
|
||||
public void setInsertedAt(Date insertedAt) {
|
||||
public void setInsertedAt(LocalDateTime insertedAt) {
|
||||
this.insertedAt = insertedAt;
|
||||
}
|
||||
|
||||
public Cliente getCliente() {
|
||||
return cliente;
|
||||
}
|
||||
|
||||
public void setCliente(Cliente cliente) {
|
||||
this.cliente = cliente;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 0;
|
||||
@@ -119,19 +114,16 @@ public class LineaSobregiro implements Serializable {
|
||||
|
||||
@Override
|
||||
public boolean equals(Object object) {
|
||||
// TODO: Warning - this method won't work in the case the id fields are not set
|
||||
if (!(object instanceof LineaSobregiro)) {
|
||||
return false;
|
||||
}
|
||||
LineaSobregiro other = (LineaSobregiro) object;
|
||||
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)))
|
||||
return false;
|
||||
return true;
|
||||
return !((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "entities.LineaSobregiro[ id=" + id + " ]";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,75 +1,51 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package entities;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import javax.persistence.Basic;
|
||||
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;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.PrePersist;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlTransient;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author ryuuji
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "metodo")
|
||||
@XmlRootElement
|
||||
@NamedQueries({
|
||||
@NamedQuery(name = "Metodo.findAll", query = "SELECT m FROM Metodo m")
|
||||
, @NamedQuery(name = "Metodo.findById", query = "SELECT m FROM Metodo m WHERE m.id = :id")
|
||||
, @NamedQuery(name = "Metodo.findByNombre", query = "SELECT m FROM Metodo m WHERE m.nombre = :nombre")
|
||||
, @NamedQuery(name = "Metodo.findByInsertedAt", query = "SELECT m FROM Metodo m WHERE m.insertedAt = :insertedAt")})
|
||||
public class Metodo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Basic(optional = false)
|
||||
@Column(name = "id")
|
||||
private Integer id;
|
||||
@Basic(optional = false)
|
||||
|
||||
@Column(name = "nombre")
|
||||
private String nombre;
|
||||
@Basic(optional = false)
|
||||
|
||||
@Column(name = "inserted_at")
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date insertedAt;
|
||||
@OneToMany(mappedBy = "metodo")
|
||||
private List<DepositoCuentaCorriente> depositoCuentaCorrienteList;
|
||||
@OneToMany(mappedBy = "metodo")
|
||||
private List<DepositoTarjetaDebito> depositoTarjetaDebitoList;
|
||||
@OneToMany(mappedBy = "metodo")
|
||||
private List<GiroTarjetaDebito> giroTarjetaDebitoList;
|
||||
private LocalDateTime insertedAt;
|
||||
|
||||
@OneToMany(mappedBy = "metodo")
|
||||
private List<GiroCuentaCorriente> giroCuentaCorrienteList;
|
||||
|
||||
public Metodo() {
|
||||
}
|
||||
@OneToMany(mappedBy = "metodo")
|
||||
private List<DepositoCuentaCorriente> depositoCuentaCorrienteList;
|
||||
|
||||
public Metodo(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
@OneToMany(mappedBy = "metodo")
|
||||
private List<DepositoTarjetaDebito> depositoTarjetaDebitoList;
|
||||
|
||||
public Metodo(Integer id, String nombre, Date insertedAt) {
|
||||
this.id = id;
|
||||
this.nombre = nombre;
|
||||
this.insertedAt = insertedAt;
|
||||
@OneToMany(mappedBy = "metodo")
|
||||
private List<GiroTarjetaDebito> giroTarjetaDebitoList;
|
||||
|
||||
@PrePersist
|
||||
public void onPersist() {
|
||||
this.insertedAt = LocalDateTime.now();
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
@@ -88,11 +64,11 @@ public class Metodo implements Serializable {
|
||||
this.nombre = nombre;
|
||||
}
|
||||
|
||||
public Date getInsertedAt() {
|
||||
public LocalDateTime getInsertedAt() {
|
||||
return insertedAt;
|
||||
}
|
||||
|
||||
public void setInsertedAt(Date insertedAt) {
|
||||
public void setInsertedAt(LocalDateTime insertedAt) {
|
||||
this.insertedAt = insertedAt;
|
||||
}
|
||||
|
||||
@@ -105,6 +81,12 @@ public class Metodo implements Serializable {
|
||||
this.depositoCuentaCorrienteList = depositoCuentaCorrienteList;
|
||||
}
|
||||
|
||||
public void addDepositoCuentaCorriente(DepositoCuentaCorriente depositoCuentaCorriente) {
|
||||
this.depositoCuentaCorrienteList.add(depositoCuentaCorriente);
|
||||
if (depositoCuentaCorriente.getMetodo() != this)
|
||||
depositoCuentaCorriente.setMetodo(this);
|
||||
}
|
||||
|
||||
@XmlTransient
|
||||
public List<DepositoTarjetaDebito> getDepositoTarjetaDebitoList() {
|
||||
return depositoTarjetaDebitoList;
|
||||
@@ -114,6 +96,13 @@ public class Metodo implements Serializable {
|
||||
this.depositoTarjetaDebitoList = depositoTarjetaDebitoList;
|
||||
}
|
||||
|
||||
public void addDepositoTarjetaDebito(DepositoTarjetaDebito depositoTarjetaDebito) {
|
||||
this.depositoTarjetaDebitoList.add(depositoTarjetaDebito);
|
||||
if (depositoTarjetaDebito.getMetodo() != this) {
|
||||
depositoTarjetaDebito.setMetodo(this);
|
||||
}
|
||||
}
|
||||
|
||||
@XmlTransient
|
||||
public List<GiroTarjetaDebito> getGiroTarjetaDebitoList() {
|
||||
return giroTarjetaDebitoList;
|
||||
@@ -123,6 +112,12 @@ public class Metodo implements Serializable {
|
||||
this.giroTarjetaDebitoList = giroTarjetaDebitoList;
|
||||
}
|
||||
|
||||
public void addGiroTarjetaDebito(GiroTarjetaDebito giroTarjetaDebito) {
|
||||
this.giroTarjetaDebitoList.add(giroTarjetaDebito);
|
||||
if (giroTarjetaDebito.getMetodo() != this)
|
||||
giroTarjetaDebito.setMetodo(this);
|
||||
}
|
||||
|
||||
@XmlTransient
|
||||
public List<GiroCuentaCorriente> getGiroCuentaCorrienteList() {
|
||||
return giroCuentaCorrienteList;
|
||||
@@ -132,6 +127,13 @@ public class Metodo implements Serializable {
|
||||
this.giroCuentaCorrienteList = giroCuentaCorrienteList;
|
||||
}
|
||||
|
||||
public void addGiroCuentaCorriente(GiroCuentaCorriente giroCuentaCorriente) {
|
||||
this.giroCuentaCorrienteList.add(giroCuentaCorriente);
|
||||
if (giroCuentaCorriente.getMetodo() != this) {
|
||||
giroCuentaCorriente.setMetodo(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 0;
|
||||
@@ -146,14 +148,12 @@ public class Metodo implements Serializable {
|
||||
return false;
|
||||
}
|
||||
Metodo other = (Metodo) object;
|
||||
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)))
|
||||
return false;
|
||||
return true;
|
||||
return !((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "entities.Metodo[ id=" + id + " ]";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package entities;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
@@ -15,58 +10,39 @@ import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.NamedQueries;
|
||||
import javax.persistence.NamedQuery;
|
||||
import javax.persistence.PrePersist;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author ryuuji
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "pago_tarjeta_credito")
|
||||
@XmlRootElement
|
||||
@NamedQueries({
|
||||
@NamedQuery(name = "PagoTarjetaCredito.findAll", query = "SELECT p FROM PagoTarjetaCredito p")
|
||||
, @NamedQuery(name = "PagoTarjetaCredito.findById", query = "SELECT p FROM PagoTarjetaCredito p WHERE p.id = :id")
|
||||
, @NamedQuery(name = "PagoTarjetaCredito.findByMonto", query = "SELECT p FROM PagoTarjetaCredito p WHERE p.monto = :monto")
|
||||
, @NamedQuery(name = "PagoTarjetaCredito.findByComentario", query = "SELECT p FROM PagoTarjetaCredito p WHERE p.comentario = :comentario")
|
||||
, @NamedQuery(name = "PagoTarjetaCredito.findByInsertedAt", query = "SELECT p FROM PagoTarjetaCredito p WHERE p.insertedAt = :insertedAt")})
|
||||
public class PagoTarjetaCredito implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Basic(optional = false)
|
||||
@Column(name = "id")
|
||||
private Integer id;
|
||||
@Basic(optional = false)
|
||||
|
||||
@Column(name = "monto")
|
||||
private int monto;
|
||||
|
||||
@Column(name = "comentario")
|
||||
private String comentario;
|
||||
@Basic(optional = false)
|
||||
|
||||
@Column(name = "tipo")
|
||||
private String tipo;
|
||||
|
||||
@Column(name = "inserted_at")
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date insertedAt;
|
||||
@JoinColumn(name = "tarjeta_credito", referencedColumnName = "id")
|
||||
private LocalDateTime insertedAt;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "tarjeta_credito", referencedColumnName = "id")
|
||||
private TarjetaCredito tarjetaCredito;
|
||||
|
||||
public PagoTarjetaCredito() {
|
||||
}
|
||||
|
||||
public PagoTarjetaCredito(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public PagoTarjetaCredito(Integer id, int monto, Date insertedAt) {
|
||||
this.id = id;
|
||||
this.monto = monto;
|
||||
this.insertedAt = insertedAt;
|
||||
@PrePersist
|
||||
public void onPersist() {
|
||||
this.insertedAt = LocalDateTime.now();
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
@@ -93,20 +69,32 @@ public class PagoTarjetaCredito implements Serializable {
|
||||
this.comentario = comentario;
|
||||
}
|
||||
|
||||
public Date getInsertedAt() {
|
||||
public String getTipo() {
|
||||
return tipo;
|
||||
}
|
||||
|
||||
public void setTipo(String tipo) {
|
||||
this.tipo = tipo;
|
||||
}
|
||||
|
||||
|
||||
public LocalDateTime getInsertedAt() {
|
||||
return insertedAt;
|
||||
}
|
||||
|
||||
public void setInsertedAt(Date insertedAt) {
|
||||
public void setInsertedAt(LocalDateTime insertedAt) {
|
||||
this.insertedAt = insertedAt;
|
||||
}
|
||||
|
||||
|
||||
public TarjetaCredito getTarjetaCredito() {
|
||||
return tarjetaCredito;
|
||||
}
|
||||
|
||||
public void setTarjetaCredito(TarjetaCredito tarjetaCredito) {
|
||||
this.tarjetaCredito = tarjetaCredito;
|
||||
if(!this.tarjetaCredito.getPagoList().contains(this))
|
||||
this.tarjetaCredito.getPagoList().add(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -123,9 +111,7 @@ public class PagoTarjetaCredito implements Serializable {
|
||||
return false;
|
||||
}
|
||||
PagoTarjetaCredito other = (PagoTarjetaCredito) object;
|
||||
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)))
|
||||
return false;
|
||||
return true;
|
||||
return !((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package entities;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
@@ -16,72 +10,56 @@ import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.NamedQueries;
|
||||
import javax.persistence.NamedQuery;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.OneToOne;
|
||||
import javax.persistence.PrePersist;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlTransient;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author ryuuji
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "tarjeta_credito")
|
||||
@XmlRootElement
|
||||
@NamedQueries({
|
||||
@NamedQuery(name = "TarjetaCredito.findAll", query = "SELECT t FROM TarjetaCredito t")
|
||||
, @NamedQuery(name = "TarjetaCredito.findById", query = "SELECT t FROM TarjetaCredito t WHERE t.id = :id")
|
||||
, @NamedQuery(name = "TarjetaCredito.findByLimiteNacional", query = "SELECT t FROM TarjetaCredito t WHERE t.limiteNacional = :limiteNacional")
|
||||
, @NamedQuery(name = "TarjetaCredito.findByLimiteInternacional", query = "SELECT t FROM TarjetaCredito t WHERE t.limiteInternacional = :limiteInternacional")
|
||||
, @NamedQuery(name = "TarjetaCredito.findByInsertedAt", query = "SELECT t FROM TarjetaCredito t WHERE t.insertedAt = :insertedAt")})
|
||||
public class TarjetaCredito implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Basic(optional = false)
|
||||
@Column(name = "id")
|
||||
private Integer id;
|
||||
@Basic(optional = false)
|
||||
@Column(name = "limite_nacional")
|
||||
|
||||
@Column(name = "limite_nacional", nullable = false)
|
||||
private int limiteNacional;
|
||||
@Basic(optional = false)
|
||||
@Column(name = "limite_internacional")
|
||||
|
||||
@Column(name = "limite_internacional", nullable = false)
|
||||
private int limiteInternacional;
|
||||
@Basic(optional = false)
|
||||
|
||||
@Column(name = "deuda_nacional")
|
||||
private int deudaNacional;
|
||||
@Basic(optional = false)
|
||||
|
||||
@Column(name = "deuda_internacional")
|
||||
private int deudaInternacional;
|
||||
@Basic(optional = false)
|
||||
|
||||
@Column(name = "inserted_at")
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date insertedAt;
|
||||
@JoinColumn(name = "cliente", referencedColumnName = "id")
|
||||
@ManyToOne(optional = false)
|
||||
private LocalDateTime insertedAt;
|
||||
|
||||
@OneToOne
|
||||
@JoinColumn(name = "linea_sobregiro")
|
||||
private LineaSobregiro lineaSobregiro;
|
||||
|
||||
@OneToOne(mappedBy = "tarjetaCredito")
|
||||
private Cliente cliente;
|
||||
|
||||
@OneToMany(mappedBy = "tarjetaCredito")
|
||||
private List<PagoTarjetaCredito> pagoList;
|
||||
|
||||
@OneToMany(mappedBy = "tarjetaCredito")
|
||||
private List<CompraTarjetaCredito> compraList;
|
||||
|
||||
public TarjetaCredito() {
|
||||
}
|
||||
|
||||
public TarjetaCredito(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public TarjetaCredito(Integer id, int limiteNacional, int limiteInternacional, Date insertedAt) {
|
||||
this.id = id;
|
||||
this.limiteNacional = limiteNacional;
|
||||
this.limiteInternacional = limiteInternacional;
|
||||
this.insertedAt = insertedAt;
|
||||
@PrePersist
|
||||
public void onPersist() {
|
||||
this.insertedAt = LocalDateTime.now();
|
||||
this.deudaNacional = 0;
|
||||
this.deudaInternacional = 0;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
@@ -116,11 +94,11 @@ public class TarjetaCredito implements Serializable {
|
||||
return deudaInternacional;
|
||||
}
|
||||
|
||||
public Date getInsertedAt() {
|
||||
public LocalDateTime getInsertedAt() {
|
||||
return insertedAt;
|
||||
}
|
||||
|
||||
public void setInsertedAt(Date insertedAt) {
|
||||
public void setInsertedAt(LocalDateTime insertedAt) {
|
||||
this.insertedAt = insertedAt;
|
||||
}
|
||||
|
||||
@@ -130,6 +108,8 @@ public class TarjetaCredito implements Serializable {
|
||||
|
||||
public void setCliente(Cliente cliente) {
|
||||
this.cliente = cliente;
|
||||
if(this.cliente.getTarjetaCredito() != this)
|
||||
this.cliente.setTarjetaCredito(this);
|
||||
}
|
||||
|
||||
@XmlTransient
|
||||
@@ -140,6 +120,12 @@ public class TarjetaCredito implements Serializable {
|
||||
public void setPagoList(List<PagoTarjetaCredito> pagoList) {
|
||||
this.pagoList = pagoList;
|
||||
}
|
||||
|
||||
public void addPago(PagoTarjetaCredito pago) {
|
||||
this.pagoList.add(pago);
|
||||
if(pago.getTarjetaCredito() != this)
|
||||
pago.setTarjetaCredito(this);
|
||||
}
|
||||
|
||||
@XmlTransient
|
||||
public List<CompraTarjetaCredito> getCompraList() {
|
||||
@@ -149,6 +135,12 @@ public class TarjetaCredito implements Serializable {
|
||||
public void setCompraList(List<CompraTarjetaCredito> compraList) {
|
||||
this.compraList = compraList;
|
||||
}
|
||||
|
||||
public void addCompra(CompraTarjetaCredito compra) {
|
||||
this.compraList.add(compra);
|
||||
if(compra.getTarjetaCredito() != this)
|
||||
compra.setTarjetaCredito(this);
|
||||
}
|
||||
|
||||
public void setDeudaNacional(int deudaNacional) {
|
||||
this.deudaNacional = deudaNacional;
|
||||
@@ -158,7 +150,16 @@ public class TarjetaCredito implements Serializable {
|
||||
this.deudaInternacional = deudaInternacional;
|
||||
}
|
||||
|
||||
|
||||
public LineaSobregiro getLineaSobregiro() {
|
||||
return lineaSobregiro;
|
||||
}
|
||||
|
||||
public void setLineaSobregiro(LineaSobregiro lineaSobregiro) {
|
||||
this.lineaSobregiro = lineaSobregiro;
|
||||
if(!lineaSobregiro.getTarjetaCreditoList().contains(this))
|
||||
lineaSobregiro.getTarjetaCreditoList().add(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 0;
|
||||
@@ -173,14 +174,12 @@ public class TarjetaCredito implements Serializable {
|
||||
return false;
|
||||
}
|
||||
TarjetaCredito other = (TarjetaCredito) object;
|
||||
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)))
|
||||
return false;
|
||||
return true;
|
||||
return !((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "entities.TarjetaCredito[ id=" + id + " ]";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,15 +1,8 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package entities;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
@@ -17,68 +10,51 @@ import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.NamedQueries;
|
||||
import javax.persistence.NamedQuery;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.OneToOne;
|
||||
import javax.persistence.PrePersist;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlTransient;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author ryuuji
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "tarjeta_debito")
|
||||
@XmlRootElement
|
||||
@NamedQueries({
|
||||
@NamedQuery(name = "TarjetaDebito.findAll", query = "SELECT t FROM TarjetaDebito t")
|
||||
, @NamedQuery(name = "TarjetaDebito.findById", query = "SELECT t FROM TarjetaDebito t WHERE t.id = :id")
|
||||
, @NamedQuery(name = "TarjetaDebito.findBySaldo", query = "SELECT t FROM TarjetaDebito t WHERE t.saldo = :saldo")
|
||||
, @NamedQuery(name = "TarjetaDebito.findByInsertedAt", query = "SELECT t FROM TarjetaDebito t WHERE t.insertedAt = :insertedAt")})
|
||||
public class TarjetaDebito implements Serializable {
|
||||
|
||||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "tarjetaDebito")
|
||||
private List<CompraTarjetaDebito> compraList;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Basic(optional = false)
|
||||
@Column(name = "id")
|
||||
private Integer id;
|
||||
@Basic(optional = false)
|
||||
|
||||
@Column(name = "saldo")
|
||||
private int saldo;
|
||||
@Basic(optional = false)
|
||||
|
||||
@Column(name = "inserted_at")
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date insertedAt;
|
||||
@JoinColumn(name = "cliente", referencedColumnName = "id")
|
||||
@ManyToOne(optional = false)
|
||||
private LocalDateTime insertedAt;
|
||||
|
||||
@OneToOne(mappedBy = "tarjetaDebito")
|
||||
private Cliente cliente;
|
||||
|
||||
@OneToMany(mappedBy = "tarjetaDebitoFrom")
|
||||
private List<TransferenciaTarjetaDebito> transferenciaFromList;
|
||||
|
||||
@OneToMany(mappedBy = "tarjetaDebitoTo")
|
||||
private List<TransferenciaTarjetaDebito> transferenciaToList;
|
||||
|
||||
@OneToMany(mappedBy = "tarjetaDebito")
|
||||
private List<DepositoTarjetaDebito> depositoList;
|
||||
|
||||
@OneToMany(mappedBy = "tarjetaDebito")
|
||||
private List<GiroTarjetaDebito> giroList;
|
||||
|
||||
public TarjetaDebito() {
|
||||
}
|
||||
@OneToMany(mappedBy = "tarjetaDebito")
|
||||
private List<CompraTarjetaDebito> compraList;
|
||||
|
||||
public TarjetaDebito(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public TarjetaDebito(Integer id, int saldo, Date insertedAt) {
|
||||
this.id = id;
|
||||
this.saldo = saldo;
|
||||
this.insertedAt = insertedAt;
|
||||
@PrePersist
|
||||
public void onPersist() {
|
||||
this.insertedAt = LocalDateTime.now();
|
||||
this.saldo = 0;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
@@ -97,11 +73,11 @@ public class TarjetaDebito implements Serializable {
|
||||
this.saldo = saldo;
|
||||
}
|
||||
|
||||
public Date getInsertedAt() {
|
||||
public LocalDateTime getInsertedAt() {
|
||||
return insertedAt;
|
||||
}
|
||||
|
||||
public void setInsertedAt(Date insertedAt) {
|
||||
public void setInsertedAt(LocalDateTime insertedAt) {
|
||||
this.insertedAt = insertedAt;
|
||||
}
|
||||
|
||||
@@ -111,24 +87,8 @@ public class TarjetaDebito implements Serializable {
|
||||
|
||||
public void setCliente(Cliente cliente) {
|
||||
this.cliente = cliente;
|
||||
}
|
||||
|
||||
@XmlTransient
|
||||
public List<TransferenciaTarjetaDebito> getTransferenciaFromList() {
|
||||
return transferenciaFromList;
|
||||
}
|
||||
|
||||
public void setTransferenciaFromList(List<TransferenciaTarjetaDebito> transferenciaFromList) {
|
||||
this.transferenciaFromList = transferenciaFromList;
|
||||
}
|
||||
|
||||
@XmlTransient
|
||||
public List<TransferenciaTarjetaDebito> getTransferenciaToList() {
|
||||
return transferenciaToList;
|
||||
}
|
||||
|
||||
public void setTransferenciaToList(List<TransferenciaTarjetaDebito> transferenciaToList) {
|
||||
this.transferenciaToList = transferenciaToList;
|
||||
if(this.cliente.getTarjetaDebito() != this)
|
||||
this.cliente.setTarjetaDebito(this);
|
||||
}
|
||||
|
||||
@XmlTransient
|
||||
@@ -140,6 +100,42 @@ public class TarjetaDebito implements Serializable {
|
||||
this.depositoList = depositoList;
|
||||
}
|
||||
|
||||
public void addDeposito(DepositoTarjetaDebito deposito) {
|
||||
this.depositoList.add(deposito);
|
||||
if (deposito.getTarjetaDebito()!= this)
|
||||
deposito.setTarjetaDebito(this);
|
||||
}
|
||||
|
||||
@XmlTransient
|
||||
public List<TransferenciaTarjetaDebito> getTransferenciaFromList() {
|
||||
return transferenciaFromList;
|
||||
}
|
||||
|
||||
public void setTransferenciaFromList(List<TransferenciaTarjetaDebito> transferenciaFromList) {
|
||||
this.transferenciaFromList = transferenciaFromList;
|
||||
}
|
||||
|
||||
public void addTransferenciaFrom(TransferenciaTarjetaDebito transferenciaFrom) {
|
||||
this.transferenciaFromList.add(transferenciaFrom);
|
||||
if (transferenciaFrom.getTarjetaDebitoFrom()!= this)
|
||||
transferenciaFrom.setTarjetaDebitoFrom(this);
|
||||
}
|
||||
|
||||
@XmlTransient
|
||||
public List<TransferenciaTarjetaDebito> getTransferenciaToList() {
|
||||
return transferenciaToList;
|
||||
}
|
||||
|
||||
public void setTransferenciaToList(List<TransferenciaTarjetaDebito> transferenciaToList) {
|
||||
this.transferenciaToList = transferenciaToList;
|
||||
}
|
||||
|
||||
public void addTransferenciaTo(TransferenciaTarjetaDebito transferenciaTo) {
|
||||
this.transferenciaFromList.add(transferenciaTo);
|
||||
if (transferenciaTo.getTarjetaDebitoTo() != this)
|
||||
transferenciaTo.setTarjetaDebitoTo(this);
|
||||
}
|
||||
|
||||
@XmlTransient
|
||||
public List<GiroTarjetaDebito> getGiroList() {
|
||||
return giroList;
|
||||
@@ -149,6 +145,27 @@ public class TarjetaDebito implements Serializable {
|
||||
this.giroList = giroList;
|
||||
}
|
||||
|
||||
public void addGiro(GiroTarjetaDebito giro) {
|
||||
this.giroList.add(giro);
|
||||
if (giro.getTarjetaDebito()!= this)
|
||||
giro.setTarjetaDebito(this);
|
||||
}
|
||||
|
||||
@XmlTransient
|
||||
public List<CompraTarjetaDebito> getCompraList() {
|
||||
return compraList;
|
||||
}
|
||||
|
||||
public void setCompraList(List<CompraTarjetaDebito> compraList) {
|
||||
this.compraList = compraList;
|
||||
}
|
||||
|
||||
public void addCompra(CompraTarjetaDebito compra) {
|
||||
this.compraList.add(compra);
|
||||
if(compra.getTarjetaDebito() != this)
|
||||
compra.setTarjetaDebito(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 0;
|
||||
@@ -163,23 +180,11 @@ public class TarjetaDebito implements Serializable {
|
||||
return false;
|
||||
}
|
||||
TarjetaDebito other = (TarjetaDebito) object;
|
||||
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)))
|
||||
return false;
|
||||
return true;
|
||||
return !((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "entities.TarjetaDebito[ id=" + id + " ]";
|
||||
}
|
||||
|
||||
@XmlTransient
|
||||
public List<CompraTarjetaDebito> getCompraList() {
|
||||
return compraList;
|
||||
}
|
||||
|
||||
public void setCompraList(List<CompraTarjetaDebito> compraList) {
|
||||
this.compraList = compraList;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package entities;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.Column;
|
||||
@@ -17,59 +13,42 @@ import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.NamedQueries;
|
||||
import javax.persistence.NamedQuery;
|
||||
import javax.persistence.PrePersist;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author ryuuji
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "transferencia_cuenta_corriente")
|
||||
@XmlRootElement
|
||||
@NamedQueries({
|
||||
@NamedQuery(name = "TransferenciaCuentaCorriente.findAll", query = "SELECT t FROM TransferenciaCuentaCorriente t")
|
||||
, @NamedQuery(name = "TransferenciaCuentaCorriente.findById", query = "SELECT t FROM TransferenciaCuentaCorriente t WHERE t.id = :id")
|
||||
, @NamedQuery(name = "TransferenciaCuentaCorriente.findByMonto", query = "SELECT t FROM TransferenciaCuentaCorriente t WHERE t.monto = :monto")
|
||||
, @NamedQuery(name = "TransferenciaCuentaCorriente.findByComentario", query = "SELECT t FROM TransferenciaCuentaCorriente t WHERE t.comentario = :comentario")
|
||||
, @NamedQuery(name = "TransferenciaCuentaCorriente.findByInsertedAt", query = "SELECT t FROM TransferenciaCuentaCorriente t WHERE t.insertedAt = :insertedAt")})
|
||||
public class TransferenciaCuentaCorriente implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Basic(optional = false)
|
||||
@Column(name = "id")
|
||||
private Integer id;
|
||||
@Basic(optional = false)
|
||||
|
||||
@Column(name = "monto")
|
||||
private int monto;
|
||||
|
||||
@Column(name = "comentario")
|
||||
private String comentario;
|
||||
@Basic(optional = false)
|
||||
|
||||
@Column(name = "inserted_at")
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date insertedAt;
|
||||
@JoinColumn(name = "cuenta_corriente_from", referencedColumnName = "id")
|
||||
private LocalDateTime insertedAt;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "cuenta_corriente_from")
|
||||
private CuentaCorriente cuentaCorrienteFrom;
|
||||
@JoinColumn(name = "cuenta_corriente_to", referencedColumnName = "id")
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "cuenta_corriente_to")
|
||||
private CuentaCorriente cuentaCorrienteTo;
|
||||
|
||||
public TransferenciaCuentaCorriente() {
|
||||
}
|
||||
|
||||
public TransferenciaCuentaCorriente(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public TransferenciaCuentaCorriente(Integer id, int monto, Date insertedAt) {
|
||||
this.id = id;
|
||||
this.monto = monto;
|
||||
this.insertedAt = insertedAt;
|
||||
@PrePersist
|
||||
public void onPersist() {
|
||||
this.insertedAt = LocalDateTime.now();
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
@@ -96,13 +75,14 @@ public class TransferenciaCuentaCorriente implements Serializable {
|
||||
this.comentario = comentario;
|
||||
}
|
||||
|
||||
public Date getInsertedAt() {
|
||||
public LocalDateTime getInsertedAt() {
|
||||
return insertedAt;
|
||||
}
|
||||
|
||||
public void setInsertedAt(Date insertedAt) {
|
||||
public void setInsertedAt(LocalDateTime insertedAt) {
|
||||
this.insertedAt = insertedAt;
|
||||
}
|
||||
|
||||
|
||||
public CuentaCorriente getCuentaCorrienteFrom() {
|
||||
return cuentaCorrienteFrom;
|
||||
@@ -110,6 +90,8 @@ public class TransferenciaCuentaCorriente implements Serializable {
|
||||
|
||||
public void setCuentaCorrienteFrom(CuentaCorriente cuentaCorrienteFrom) {
|
||||
this.cuentaCorrienteFrom = cuentaCorrienteFrom;
|
||||
if(!this.cuentaCorrienteFrom.getTransferenciaFromList().contains(this))
|
||||
this.cuentaCorrienteFrom.getTransferenciaFromList().add(this);
|
||||
}
|
||||
|
||||
public CuentaCorriente getCuentaCorrienteTo() {
|
||||
@@ -118,6 +100,8 @@ public class TransferenciaCuentaCorriente implements Serializable {
|
||||
|
||||
public void setCuentaCorrienteTo(CuentaCorriente cuentaCorrienteTo) {
|
||||
this.cuentaCorrienteTo = cuentaCorrienteTo;
|
||||
if(!this.cuentaCorrienteTo.getTransferenciaToList().contains(this))
|
||||
this.cuentaCorrienteTo.getTransferenciaToList().add(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -134,14 +118,12 @@ public class TransferenciaCuentaCorriente implements Serializable {
|
||||
return false;
|
||||
}
|
||||
TransferenciaCuentaCorriente other = (TransferenciaCuentaCorriente) object;
|
||||
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)))
|
||||
return false;
|
||||
return true;
|
||||
return !((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "entities.TransferenciaCuentaCorriente[ id=" + id + " ]";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package entities;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.Column;
|
||||
@@ -17,59 +13,42 @@ import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.NamedQueries;
|
||||
import javax.persistence.NamedQuery;
|
||||
import javax.persistence.PrePersist;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author ryuuji
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "transferencia_tarjeta_debito")
|
||||
@XmlRootElement
|
||||
@NamedQueries({
|
||||
@NamedQuery(name = "TransferenciaTarjetaDebito.findAll", query = "SELECT t FROM TransferenciaTarjetaDebito t")
|
||||
, @NamedQuery(name = "TransferenciaTarjetaDebito.findById", query = "SELECT t FROM TransferenciaTarjetaDebito t WHERE t.id = :id")
|
||||
, @NamedQuery(name = "TransferenciaTarjetaDebito.findByMonto", query = "SELECT t FROM TransferenciaTarjetaDebito t WHERE t.monto = :monto")
|
||||
, @NamedQuery(name = "TransferenciaTarjetaDebito.findByComentario", query = "SELECT t FROM TransferenciaTarjetaDebito t WHERE t.comentario = :comentario")
|
||||
, @NamedQuery(name = "TransferenciaTarjetaDebito.findByInsertedAt", query = "SELECT t FROM TransferenciaTarjetaDebito t WHERE t.insertedAt = :insertedAt")})
|
||||
public class TransferenciaTarjetaDebito implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Basic(optional = false)
|
||||
@Column(name = "id")
|
||||
private Integer id;
|
||||
@Basic(optional = false)
|
||||
|
||||
@Column(name = "monto")
|
||||
private int monto;
|
||||
|
||||
@Column(name = "comentario")
|
||||
private String comentario;
|
||||
@Basic(optional = false)
|
||||
|
||||
@Column(name = "inserted_at")
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date insertedAt;
|
||||
@JoinColumn(name = "tarjeta_debito_from", referencedColumnName = "id")
|
||||
private LocalDateTime insertedAt;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "tarjeta_debito_from")
|
||||
private TarjetaDebito tarjetaDebitoFrom;
|
||||
@JoinColumn(name = "tarjeta_debito_to", referencedColumnName = "id")
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "tarjeta_debito_to")
|
||||
private TarjetaDebito tarjetaDebitoTo;
|
||||
|
||||
public TransferenciaTarjetaDebito() {
|
||||
}
|
||||
|
||||
public TransferenciaTarjetaDebito(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public TransferenciaTarjetaDebito(Integer id, int monto, Date insertedAt) {
|
||||
this.id = id;
|
||||
this.monto = monto;
|
||||
this.insertedAt = insertedAt;
|
||||
@PrePersist
|
||||
public void onPersis() {
|
||||
this.insertedAt = LocalDateTime.now();
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
@@ -96,11 +75,11 @@ public class TransferenciaTarjetaDebito implements Serializable {
|
||||
this.comentario = comentario;
|
||||
}
|
||||
|
||||
public Date getInsertedAt() {
|
||||
public LocalDateTime getInsertedAt() {
|
||||
return insertedAt;
|
||||
}
|
||||
|
||||
public void setInsertedAt(Date insertedAt) {
|
||||
public void setInsertedAt(LocalDateTime insertedAt) {
|
||||
this.insertedAt = insertedAt;
|
||||
}
|
||||
|
||||
@@ -110,6 +89,8 @@ public class TransferenciaTarjetaDebito implements Serializable {
|
||||
|
||||
public void setTarjetaDebitoFrom(TarjetaDebito tarjetaDebitoFrom) {
|
||||
this.tarjetaDebitoFrom = tarjetaDebitoFrom;
|
||||
if (!this.tarjetaDebitoFrom.getTransferenciaFromList().contains(this))
|
||||
this.tarjetaDebitoFrom.getTransferenciaFromList().add(this);
|
||||
}
|
||||
|
||||
public TarjetaDebito getTarjetaDebitoTo() {
|
||||
@@ -118,6 +99,8 @@ public class TransferenciaTarjetaDebito implements Serializable {
|
||||
|
||||
public void setTarjetaDebitoTo(TarjetaDebito tarjetaDebitoTo) {
|
||||
this.tarjetaDebitoTo = tarjetaDebitoTo;
|
||||
if (!this.tarjetaDebitoTo.getTransferenciaToList().contains(this))
|
||||
this.tarjetaDebitoTo.getTransferenciaToList().add(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -134,14 +117,12 @@ public class TransferenciaTarjetaDebito implements Serializable {
|
||||
return false;
|
||||
}
|
||||
TransferenciaTarjetaDebito other = (TransferenciaTarjetaDebito) object;
|
||||
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)))
|
||||
return false;
|
||||
return true;
|
||||
return !((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "entities.TransferenciaTarjetaDebito[ id=" + id + " ]";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package entities;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.CascadeType;
|
||||
@@ -15,74 +11,49 @@ import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Lob;
|
||||
import javax.persistence.NamedQueries;
|
||||
import javax.persistence.NamedQuery;
|
||||
import javax.persistence.OneToOne;
|
||||
import javax.persistence.PrePersist;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import javax.persistence.Transient;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author ryuuji
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "usuario")
|
||||
@XmlRootElement
|
||||
@NamedQueries({
|
||||
@NamedQuery(name = "Usuario.findAll", query = "SELECT u FROM Usuario u")
|
||||
, @NamedQuery(name = "Usuario.findById", query = "SELECT u FROM Usuario u WHERE u.id = :id")
|
||||
, @NamedQuery(name = "Usuario.findByNombre", query = "SELECT u FROM Usuario u WHERE u.nombre = :nombre")
|
||||
, @NamedQuery(name = "Usuario.findByRole", query = "SELECT u FROM Usuario u WHERE u.role = :role")
|
||||
, @NamedQuery(name = "Usuario.findByInsertedAt", query = "SELECT u FROM Usuario u WHERE u.insertedAt = :insertedAt")})
|
||||
public class Usuario implements Serializable {
|
||||
|
||||
@Basic(optional = false)
|
||||
@Lob
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "id")
|
||||
private Integer id;
|
||||
|
||||
@Column(name = "nombre")
|
||||
private String nombre;
|
||||
|
||||
@Column(name = "password")
|
||||
private byte[] password;
|
||||
@Basic(optional = false)
|
||||
@Lob
|
||||
|
||||
@Column(name = "salt")
|
||||
private byte[] salt;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Basic(optional = false)
|
||||
@Column(name = "id")
|
||||
private Integer id;
|
||||
@Basic(optional = false)
|
||||
@Column(name = "nombre")
|
||||
private String nombre;
|
||||
@Basic(optional = false)
|
||||
@Column(name = "role")
|
||||
private String role;
|
||||
@Basic(optional = false)
|
||||
@Column(name = "inserted_at")
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date insertedAt;
|
||||
@OneToOne(cascade = CascadeType.ALL, mappedBy = "usuario")
|
||||
@Column(name = "rol")
|
||||
private String rol;
|
||||
|
||||
@OneToOne(mappedBy = "usuario")
|
||||
private Cliente cliente;
|
||||
|
||||
@Column(name = "inserted_at")
|
||||
private LocalDateTime insertedAt;
|
||||
|
||||
@Transient
|
||||
private String transientPassword;
|
||||
|
||||
public Usuario() {
|
||||
}
|
||||
|
||||
public Usuario(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Usuario(Integer id, String nombre, byte[] password, byte[] salt, String role, Date insertedAt) {
|
||||
this.id = id;
|
||||
this.nombre = nombre;
|
||||
this.password = password;
|
||||
this.salt = salt;
|
||||
this.role = role;
|
||||
this.insertedAt = insertedAt;
|
||||
@PrePersist
|
||||
public void onPersist() {
|
||||
this.insertedAt = LocalDateTime.now();
|
||||
this.rol = "Cliente";
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
@@ -101,20 +72,19 @@ public class Usuario implements Serializable {
|
||||
this.nombre = nombre;
|
||||
}
|
||||
|
||||
|
||||
public String getRole() {
|
||||
return role;
|
||||
public String getRol() {
|
||||
return rol;
|
||||
}
|
||||
|
||||
public void setRole(String role) {
|
||||
this.role = role;
|
||||
public void setRol(String rol) {
|
||||
this.rol = rol;
|
||||
}
|
||||
|
||||
public Date getInsertedAt() {
|
||||
public LocalDateTime getInsertedAt() {
|
||||
return insertedAt;
|
||||
}
|
||||
|
||||
public void setInsertedAt(Date insertedAt) {
|
||||
public void setInsertedAt(LocalDateTime insertedAt) {
|
||||
this.insertedAt = insertedAt;
|
||||
}
|
||||
|
||||
@@ -124,6 +94,24 @@ public class Usuario implements Serializable {
|
||||
|
||||
public void setCliente(Cliente cliente) {
|
||||
this.cliente = cliente;
|
||||
if(this.cliente.getUsuario() != this)
|
||||
this.cliente.setUsuario(this);
|
||||
}
|
||||
|
||||
public byte[] getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(byte[] password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public byte[] getSalt() {
|
||||
return salt;
|
||||
}
|
||||
|
||||
public void setSalt(byte[] salt) {
|
||||
this.salt = salt;
|
||||
}
|
||||
|
||||
public String getTransientPassword() {
|
||||
@@ -148,9 +136,7 @@ public class Usuario implements Serializable {
|
||||
return false;
|
||||
}
|
||||
Usuario other = (Usuario) object;
|
||||
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)))
|
||||
return false;
|
||||
return true;
|
||||
return !((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -158,20 +144,4 @@ public class Usuario implements Serializable {
|
||||
return "entities.Usuario[ id=" + id + " ]";
|
||||
}
|
||||
|
||||
public byte[] getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(byte[] password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public byte[] getSalt() {
|
||||
return salt;
|
||||
}
|
||||
|
||||
public void setSalt(byte[] salt) {
|
||||
this.salt = salt;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package bean;
|
||||
|
||||
import beans.ClienteFacadeLocal;
|
||||
import beans.CuentaCorrienteFacadeLocal;
|
||||
import beans.UsuarioFacadeLocal;
|
||||
import entities.Cliente;
|
||||
import entities.CuentaCorriente;
|
||||
@@ -24,6 +25,8 @@ public class ClienteBean implements Serializable {
|
||||
@EJB
|
||||
private ClienteFacadeLocal clienteFacade;
|
||||
@EJB
|
||||
private CuentaCorrienteFacadeLocal cuentaCorrienteFacade;
|
||||
@EJB
|
||||
private UsuarioFacadeLocal usuarioFacade;
|
||||
|
||||
private List<Cliente> clienteList;
|
||||
@@ -43,7 +46,7 @@ public class ClienteBean implements Serializable {
|
||||
}
|
||||
|
||||
public String gotoCreate() {
|
||||
this.resetInnerCliente();
|
||||
this.resetInput();
|
||||
return "admin_cliente_create";
|
||||
}
|
||||
|
||||
@@ -54,23 +57,19 @@ public class ClienteBean implements Serializable {
|
||||
usuario.setNombre(cliente.getRut());
|
||||
usuario.setPassword(hash);
|
||||
usuario.setSalt(salt);
|
||||
usuario.setRole("Cliente");
|
||||
|
||||
CuentaCorriente cc = new CuentaCorriente();
|
||||
cc.setSaldo(0);
|
||||
cc.setCliente(cliente);
|
||||
cc.setInsertedAt(new Date());
|
||||
|
||||
cliente.getCuentaCorrienteList().add(cc);
|
||||
|
||||
cliente.setUsuario(usuario);
|
||||
usuario.setCliente(cliente);
|
||||
|
||||
usuarioFacade.create(usuario);
|
||||
|
||||
CuentaCorriente cc = new CuentaCorriente();
|
||||
cuentaCorrienteFacade.create(cc);
|
||||
|
||||
cliente.setCuentaCorriente(cc);
|
||||
cliente.setUsuario(usuario);
|
||||
clienteFacade.create(cliente);
|
||||
|
||||
this.clienteList.add(cliente);
|
||||
|
||||
resetInnerCliente();
|
||||
resetInput();
|
||||
|
||||
return "admin_main";
|
||||
}
|
||||
@@ -94,7 +93,7 @@ public class ClienteBean implements Serializable {
|
||||
usuarioFacade.edit(usuario);
|
||||
clienteFacade.edit(cliente);
|
||||
|
||||
this.resetInnerCliente();
|
||||
this.resetInput();
|
||||
return "admin_main";
|
||||
}
|
||||
|
||||
@@ -108,7 +107,7 @@ public class ClienteBean implements Serializable {
|
||||
|
||||
usuarioFacade.remove(cliente.getUsuario());
|
||||
|
||||
this.resetInnerCliente();
|
||||
this.resetInput();
|
||||
|
||||
return "admin_main";
|
||||
}
|
||||
@@ -134,48 +133,56 @@ public class ClienteBean implements Serializable {
|
||||
return "admin_tarjeta_debito_contratar";
|
||||
}
|
||||
|
||||
public String gotoEditTarjetaCredito(TarjetaCredito tarjetaCredito) {
|
||||
public String gotoEditTarjetaCredito() {
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
TarjetaCreditoBean tcb = context.getApplication().evaluateExpressionGet(context, "#{tarjetaCreditoBean}", TarjetaCreditoBean.class);
|
||||
tcb.setCliente(cliente);
|
||||
tcb.setTarjetaCredito(tarjetaCredito);
|
||||
tcb.setTarjetaCredito(cliente.getTarjetaCredito());
|
||||
return "admin_tarjeta_credito_edit";
|
||||
}
|
||||
|
||||
public String gotoViewCuentaCorriente(CuentaCorriente cuentaCorriente) {
|
||||
public String gotoViewCuentaCorriente() {
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
CuentaCorrienteBean ccb = context.getApplication().evaluateExpressionGet(context, "#{cuentaCorrienteBean}", CuentaCorrienteBean.class);
|
||||
ccb.setCliente(cliente);
|
||||
ccb.setCuentaCorriente(cuentaCorriente);
|
||||
ccb.setCuentaCorriente(cliente.getCuentaCorriente());
|
||||
return "cliente_cuenta_corriente_view";
|
||||
}
|
||||
|
||||
public String gotoViewTarjetaDebito(TarjetaDebito tarjetaDebito) {
|
||||
public String gotoViewTarjetaDebito() {
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
TarjetaDebitoBean tdb = context.getApplication().evaluateExpressionGet(context, "#{tarjetaDebitoBean}", TarjetaDebitoBean.class);
|
||||
tdb.setCliente(cliente);
|
||||
tdb.setTarjetaDebito(tarjetaDebito);
|
||||
tdb.setTarjetaDebito(cliente.getTarjetaDebito());
|
||||
return "cliente_tarjeta_debito_view";
|
||||
}
|
||||
|
||||
public String gotoViewTarjetaCredito(TarjetaCredito tarjetaCredito) {
|
||||
public String gotoViewTarjetaCredito() {
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
TarjetaCreditoBean tcb = context.getApplication().evaluateExpressionGet(context, "#{tarjetaCreditoBean}", TarjetaCreditoBean.class);
|
||||
tcb.setCliente(cliente);
|
||||
tcb.setTarjetaCredito(tarjetaCredito);
|
||||
tcb.setTarjetaCredito(cliente.getTarjetaCredito());
|
||||
return "cliente_tarjeta_credito_view";
|
||||
}
|
||||
|
||||
public String gotoAdminViewCuentaCorriente(CuentaCorriente cuentaCorriente) {
|
||||
public String gotoAdminViewCuentaCorriente() {
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
CuentaCorrienteBean ccb = context.getApplication().evaluateExpressionGet(context, "#{cuentaCorrienteBean}", CuentaCorrienteBean.class);
|
||||
ccb.setCliente(cliente);
|
||||
ccb.setCuentaCorriente(cuentaCorriente);
|
||||
ccb.setCuentaCorriente(cliente.getCuentaCorriente());
|
||||
return "admin_cuenta_corriente_view";
|
||||
}
|
||||
|
||||
public String gotoAdminViewTarjetaDebito() {
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
TarjetaDebitoBean tdb = context.getApplication().evaluateExpressionGet(context, "#{tarjetaDebitoBean}", TarjetaDebitoBean.class);
|
||||
tdb.setCliente(cliente);
|
||||
tdb.setTarjetaDebito(cliente.getTarjetaDebito());
|
||||
return "admin_tarjeta_debito_view";
|
||||
}
|
||||
|
||||
|
||||
private void resetInnerCliente() {
|
||||
private void resetInput() {
|
||||
this.cliente = new Cliente();
|
||||
this.usuario = new Usuario();
|
||||
}
|
||||
|
||||
@@ -32,9 +32,12 @@ public class CompraBean implements Serializable {
|
||||
private TarjetaDebito tarjetaDebito;
|
||||
private TarjetaCredito tarjetaCredito;
|
||||
|
||||
private CompraTarjetaDebito compraTarjetaDebito;
|
||||
private CompraTarjetaCredito compraTarjetaCredito;
|
||||
|
||||
private int monto;
|
||||
private String comentario;
|
||||
private String clase;
|
||||
private String tipo;
|
||||
|
||||
public String comprar() {
|
||||
if (tarjetaDebito != null) {
|
||||
@@ -46,63 +49,92 @@ public class CompraBean implements Serializable {
|
||||
}
|
||||
|
||||
public String comprarTarjetaDebito() {
|
||||
CompraTarjetaDebito compra = new CompraTarjetaDebito();
|
||||
compra.setMonto(monto);
|
||||
compra.setComentario(comentario);
|
||||
compra.setInsertedAt(new Date());
|
||||
compra.setTarjetaDebito(tarjetaDebito);
|
||||
|
||||
if (tarjetaDebito.getSaldo() - monto < 0) {
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
context.addMessage(null, new FacesMessage("La compra sobrepasa el saldo de su tarjeta de debito"));
|
||||
context.validationFailed();
|
||||
return "cliente_tarjeta_debito_compra";
|
||||
}
|
||||
|
||||
CompraTarjetaDebito compra = new CompraTarjetaDebito();
|
||||
compra.setMonto(monto);
|
||||
compra.setComentario(comentario);
|
||||
compra.setTarjetaDebito(tarjetaDebito);
|
||||
|
||||
tarjetaDebito.setSaldo(tarjetaDebito.getSaldo() - monto);
|
||||
tarjetaDebito.getCompraList().add(compra);
|
||||
|
||||
compraTarjetaDebitoFacade.edit(compra);
|
||||
|
||||
compraTarjetaDebitoFacade.create(compra);
|
||||
tarjetaDebitoFacade.edit(tarjetaDebito);
|
||||
|
||||
|
||||
this.resetInput();
|
||||
return "cliente_tarjeta_debito_view";
|
||||
}
|
||||
|
||||
public String comprarTarjetaCredito() {
|
||||
CompraTarjetaCredito compra = new CompraTarjetaCredito();
|
||||
compra.setMonto(monto);
|
||||
compra.setComentario(comentario);
|
||||
compra.setInsertedAt(new Date());
|
||||
compra.setTarjetaCredito(tarjetaCredito);
|
||||
|
||||
if (clase.equals("Nacional")) {
|
||||
if (tipo.equals("Nacional")) {
|
||||
if (tarjetaCredito.getDeudaNacional() + monto > tarjetaCredito.getLimiteNacional()) {
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
context.addMessage(null, new FacesMessage("La compra sobrepasa el limite nacional de su cuenta"));
|
||||
context.validationFailed();
|
||||
return "cliente_tarjeta_credito_compra";
|
||||
}
|
||||
|
||||
tarjetaCredito.setDeudaNacional(tarjetaCredito.getDeudaNacional() + monto);
|
||||
} else if (clase.equals("Internacional")) {
|
||||
if (tarjetaCredito.getDeudaInternacional()+ monto > tarjetaCredito.getLimiteInternacional()) {
|
||||
} else if (tipo.equals("Internacional")) {
|
||||
if (tarjetaCredito.getDeudaInternacional() + monto > tarjetaCredito.getLimiteInternacional()) {
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
context.addMessage(null, new FacesMessage("La compra sobrepasa el limite internacional de su cuenta"));
|
||||
context.validationFailed();
|
||||
return "cliente_tarjeta_credito_compra";
|
||||
}
|
||||
tarjetaCredito.setDeudaInternacional(tarjetaCredito.getDeudaInternacional() + monto);
|
||||
}
|
||||
|
||||
tarjetaCredito.getCompraList().add(compra);
|
||||
|
||||
compraTarjetaCreditoFacade.edit(compra);
|
||||
CompraTarjetaCredito compra = new CompraTarjetaCredito();
|
||||
compra.setMonto(monto);
|
||||
compra.setComentario(comentario);
|
||||
compra.setTipo(tipo);
|
||||
compra.setTarjetaCredito(tarjetaCredito);
|
||||
|
||||
switch (tipo) {
|
||||
case "Nacional":
|
||||
tarjetaCredito.setDeudaNacional(tarjetaCredito.getDeudaNacional() + monto);
|
||||
break;
|
||||
case "Internacional":
|
||||
tarjetaCredito.setDeudaInternacional(tarjetaCredito.getDeudaInternacional() + monto);
|
||||
break;
|
||||
}
|
||||
|
||||
compraTarjetaCreditoFacade.create(compra);
|
||||
tarjetaCreditoFacade.edit(tarjetaCredito);
|
||||
|
||||
this.resetInput();
|
||||
|
||||
return "cliente_tarjeta_credito_view";
|
||||
}
|
||||
|
||||
public String deleteCompraTarjetaDebito() {
|
||||
tarjetaDebito.setSaldo(tarjetaDebito.getSaldo() + compraTarjetaDebito.getMonto());
|
||||
tarjetaDebito.getCompraList().remove(compraTarjetaDebito);
|
||||
compraTarjetaDebitoFacade.remove(compraTarjetaDebito);
|
||||
tarjetaDebitoFacade.edit(tarjetaDebito);
|
||||
return "admin_tarjeta_debito_view";
|
||||
}
|
||||
|
||||
public String deleteCompraTarjetaCredito() {
|
||||
switch (compraTarjetaCredito.getTipo()) {
|
||||
case "Nacional":
|
||||
tarjetaCredito.setDeudaNacional(tarjetaCredito.getDeudaNacional() + compraTarjetaCredito.getMonto());
|
||||
break;
|
||||
case "Internacional":
|
||||
tarjetaCredito.setDeudaInternacional(tarjetaCredito.getDeudaInternacional() + compraTarjetaCredito.getMonto());
|
||||
break;
|
||||
}
|
||||
|
||||
tarjetaCredito.getCompraList().remove(compraTarjetaCredito);
|
||||
compraTarjetaCreditoFacade.remove(compraTarjetaCredito);
|
||||
tarjetaCreditoFacade.edit(tarjetaCredito);
|
||||
|
||||
return "admin_tarjeta_credito_view";
|
||||
}
|
||||
|
||||
private void resetInput() {
|
||||
this.monto = 0;
|
||||
this.tarjetaCredito = null;
|
||||
@@ -142,14 +174,28 @@ public class CompraBean implements Serializable {
|
||||
this.comentario = comentario;
|
||||
}
|
||||
|
||||
public String getClase() {
|
||||
return clase;
|
||||
public String getTipo() {
|
||||
return tipo;
|
||||
}
|
||||
|
||||
public void setClase(String clase) {
|
||||
this.clase = clase;
|
||||
public void setTipo(String tipo) {
|
||||
this.tipo = tipo;
|
||||
}
|
||||
|
||||
public CompraTarjetaDebito getCompraTarjetaDebito() {
|
||||
return compraTarjetaDebito;
|
||||
}
|
||||
|
||||
public void setCompraTarjetaDebito(CompraTarjetaDebito compraTarjetaDebito) {
|
||||
this.compraTarjetaDebito = compraTarjetaDebito;
|
||||
}
|
||||
|
||||
public CompraTarjetaCredito getCompraTarjetaCredito() {
|
||||
return compraTarjetaCredito;
|
||||
}
|
||||
|
||||
public void setCompraTarjetaCredito(CompraTarjetaCredito compraTarjetaCredito) {
|
||||
this.compraTarjetaCredito = compraTarjetaCredito;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -5,8 +5,9 @@ import beans.CuentaCorrienteFacadeLocal;
|
||||
import entities.Cliente;
|
||||
import entities.CuentaCorriente;
|
||||
import entities.DepositoCuentaCorriente;
|
||||
import entities.GiroCuentaCorriente;
|
||||
import entities.TransferenciaCuentaCorriente;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import javax.ejb.EJB;
|
||||
import javax.enterprise.context.SessionScoped;
|
||||
import javax.faces.context.FacesContext;
|
||||
@@ -23,18 +24,6 @@ public class CuentaCorrienteBean implements Serializable{
|
||||
private CuentaCorriente cuentaCorriente;
|
||||
private Cliente cliente;
|
||||
|
||||
public String contratar() {
|
||||
CuentaCorriente cc = new CuentaCorriente();
|
||||
cc.setSaldo(0);
|
||||
cc.setCliente(cliente);
|
||||
cc.setInsertedAt(new Date());
|
||||
|
||||
cliente.getCuentaCorrienteList().add(cc);
|
||||
clienteFacade.edit(cliente);
|
||||
|
||||
return "admin_cliente_view";
|
||||
}
|
||||
|
||||
public String edit() {
|
||||
return "admin_cliente_view";
|
||||
}
|
||||
@@ -54,6 +43,7 @@ public class CuentaCorrienteBean implements Serializable{
|
||||
return "admin_cuenta_corriente_delete_deposito";
|
||||
}
|
||||
|
||||
|
||||
public String gotoGirar() {
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
GiroBean gb = context.getApplication().evaluateExpressionGet(context, "#{giroBean}", GiroBean.class);
|
||||
@@ -61,6 +51,13 @@ public class CuentaCorrienteBean implements Serializable{
|
||||
return "cliente_cuenta_corriente_girar";
|
||||
}
|
||||
|
||||
public String gotoDeleteGiro(GiroCuentaCorriente giro) {
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
GiroBean gb = context.getApplication().evaluateExpressionGet(context, "#{giroBean}", GiroBean.class);
|
||||
gb.setCuentaCorriente(cuentaCorriente);
|
||||
gb.setGiroCuentaCorriente(giro);
|
||||
return "admin_cuenta_corriente_delete_giro";
|
||||
}
|
||||
public String gotoTransferir() {
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
TransferenciaBean tb = context.getApplication().evaluateExpressionGet(context, "#{transferenciaBean}", TransferenciaBean.class);
|
||||
@@ -68,6 +65,13 @@ public class CuentaCorrienteBean implements Serializable{
|
||||
return "cliente_cuenta_corriente_transferir";
|
||||
}
|
||||
|
||||
public String gotoDeleteTransferencia(TransferenciaCuentaCorriente transferencia) {
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
TransferenciaBean tb = context.getApplication().evaluateExpressionGet(context, "#{transferenciaBean}", TransferenciaBean.class);
|
||||
tb.setCuentaCorriente(cuentaCorriente);
|
||||
tb.setTransferenciaCuentaCorriente(transferencia);
|
||||
return "admin_cuenta_corriente_delete_transferencia";
|
||||
}
|
||||
|
||||
public CuentaCorriente getCuentaCorriente() {
|
||||
return cuentaCorriente;
|
||||
|
||||
@@ -17,6 +17,8 @@ import java.util.List;
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.ejb.EJB;
|
||||
import javax.enterprise.context.SessionScoped;
|
||||
import javax.faces.application.FacesMessage;
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.inject.Named;
|
||||
|
||||
@Named(value = "depositoBean")
|
||||
@@ -62,10 +64,8 @@ public class DepositoBean implements Serializable {
|
||||
deposito.setComentario(comentario);
|
||||
deposito.setMonto(monto);
|
||||
deposito.setMetodo(metodo);
|
||||
deposito.setInsertedAt(new Date());
|
||||
deposito.setCuentaCorriente(cuentaCorriente);
|
||||
|
||||
cuentaCorriente.getDepositoList().add(deposito);
|
||||
cuentaCorriente.setSaldo(cuentaCorriente.getSaldo() + monto);
|
||||
|
||||
depositoCCFacade.create(deposito);
|
||||
@@ -80,10 +80,8 @@ public class DepositoBean implements Serializable {
|
||||
deposito.setComentario(comentario);
|
||||
deposito.setMonto(monto);
|
||||
deposito.setMetodo(metodo);
|
||||
deposito.setInsertedAt(new Date());
|
||||
deposito.setTarjetaDebito(tarjetaDebito);
|
||||
|
||||
tarjetaDebito.getDepositoList().add(deposito);
|
||||
tarjetaDebito.setSaldo(tarjetaDebito.getSaldo() + monto);
|
||||
|
||||
depositoTDFacade.create(deposito);
|
||||
@@ -93,21 +91,44 @@ public class DepositoBean implements Serializable {
|
||||
return "cliente_tarjeta_debito_view";
|
||||
}
|
||||
|
||||
public String delete() {
|
||||
if(cuentaCorriente != null) {
|
||||
return deleteDepositoCuentaCorriente();
|
||||
}else if (depositoTarjetaDebito != null) {
|
||||
return deleteDepositoTarjetaDebito();
|
||||
}
|
||||
return "error/505";
|
||||
}
|
||||
|
||||
public String deleteDepositoCuentaCorriente() {
|
||||
return "";
|
||||
int monto = depositoCuentaCorriente.getMonto();
|
||||
CuentaCorriente cuentaCorriente = depositoCuentaCorriente.getCuentaCorriente();
|
||||
|
||||
if(cuentaCorriente.getSaldo() - monto < 0){
|
||||
FacesContext facesContext = FacesContext.getCurrentInstance();
|
||||
facesContext.addMessage(null, new FacesMessage("Eliminar el deposito dejaria la cuenta en negativo"));
|
||||
facesContext.validationFailed();
|
||||
return "admin_cuenta_corriente_delete_deposito";
|
||||
}
|
||||
|
||||
cuentaCorriente.setSaldo(cuentaCorriente.getSaldo() - monto);
|
||||
cuentaCorriente.getDepositoList().remove(depositoCuentaCorriente);
|
||||
|
||||
depositoCCFacade.remove(depositoCuentaCorriente);
|
||||
cuentaCorrienteFacade.edit(cuentaCorriente);
|
||||
|
||||
return "admin_cuenta_corriente_view";
|
||||
}
|
||||
|
||||
public String deleteDepositoTarjetaDebito() {
|
||||
return "";
|
||||
int monto = depositoTarjetaDebito.getMonto();
|
||||
TarjetaDebito tarjetaDebito = depositoTarjetaDebito.getTarjetaDebito();
|
||||
|
||||
if(tarjetaDebito.getSaldo() - monto < 0){
|
||||
FacesContext facesContext = FacesContext.getCurrentInstance();
|
||||
facesContext.addMessage(null, new FacesMessage("Eliminar el deposito dejaria la cuenta en negativo"));
|
||||
facesContext.validationFailed();
|
||||
return "admin_tarjeta_debito_delete_deposito";
|
||||
}
|
||||
|
||||
tarjetaDebito.setSaldo(tarjetaDebito.getSaldo() - monto);
|
||||
tarjetaDebito.getDepositoList().remove(depositoTarjetaDebito);
|
||||
|
||||
depositoTDFacade.remove(depositoTarjetaDebito);
|
||||
tarjetaDebitoFacade.edit(tarjetaDebito);
|
||||
|
||||
return "admin_cuenta_corriente_view";
|
||||
}
|
||||
|
||||
private void resetInput() {
|
||||
@@ -181,4 +202,22 @@ public class DepositoBean implements Serializable {
|
||||
public void setDepositoTarjetaDebito(DepositoTarjetaDebito depositoTarjetaDebito) {
|
||||
this.depositoTarjetaDebito = depositoTarjetaDebito;
|
||||
}
|
||||
|
||||
public DepositoCuentaCorrienteFacadeLocal getDepositoCCFacade() {
|
||||
return depositoCCFacade;
|
||||
}
|
||||
|
||||
public void setDepositoCCFacade(DepositoCuentaCorrienteFacadeLocal depositoCCFacade) {
|
||||
this.depositoCCFacade = depositoCCFacade;
|
||||
}
|
||||
|
||||
public DepositoTarjetaDebitoFacadeLocal getDepositoTDFacade() {
|
||||
return depositoTDFacade;
|
||||
}
|
||||
|
||||
public void setDepositoTDFacade(DepositoTarjetaDebitoFacadeLocal depositoTDFacade) {
|
||||
this.depositoTDFacade = depositoTDFacade;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
|
||||
package bean;
|
||||
|
||||
import beans.CuentaCorrienteFacade;
|
||||
import beans.CuentaCorrienteFacadeLocal;
|
||||
import beans.GiroCuentaCorrienteFacade;
|
||||
import beans.GiroCuentaCorrienteFacadeLocal;
|
||||
import beans.GiroTarjetaDebitoFacadeLocal;
|
||||
import beans.MetodoFacadeLocal;
|
||||
@@ -25,9 +25,10 @@ import javax.inject.Named;
|
||||
@Named(value = "giroBean")
|
||||
@SessionScoped
|
||||
public class GiroBean implements Serializable {
|
||||
@EJB
|
||||
|
||||
@EJB
|
||||
private GiroCuentaCorrienteFacadeLocal giroCCFacade;
|
||||
@EJB
|
||||
@EJB
|
||||
private GiroTarjetaDebitoFacadeLocal giroTDFacade;
|
||||
@EJB
|
||||
private MetodoFacadeLocal metodoFacade;
|
||||
@@ -36,77 +37,90 @@ public class GiroBean implements Serializable {
|
||||
@EJB
|
||||
private TarjetaDebitoFacadeLocal tarjetaDebitoFacade;
|
||||
|
||||
private GiroCuentaCorriente giroCuentaCorriente;
|
||||
private GiroTarjetaDebito giroTarjetaDebito;
|
||||
private int monto;
|
||||
private String comentario;
|
||||
private Metodo metodo;
|
||||
private List<Metodo> metodoList;
|
||||
private CuentaCorriente cuentaCorriente;
|
||||
private TarjetaDebito tarjetaDebito;
|
||||
|
||||
|
||||
@PostConstruct
|
||||
private void init(){
|
||||
private void init() {
|
||||
this.metodoList = metodoFacade.findAll();
|
||||
}
|
||||
|
||||
|
||||
public String girar() {
|
||||
if(cuentaCorriente != null){
|
||||
if (cuentaCorriente != null) {
|
||||
return girarEnCuentaCorriente();
|
||||
}else if(tarjetaDebito != null){
|
||||
} else if (tarjetaDebito != null) {
|
||||
return girarEnTarjetaDebito();
|
||||
}else{
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public String girarEnCuentaCorriente() {
|
||||
if(cuentaCorriente.getSaldo() - monto < 0 ){
|
||||
if (cuentaCorriente.getSaldo() - monto < 0) {
|
||||
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("El monto sobrepasa el saldo de la cuenta corriente"));
|
||||
FacesContext.getCurrentInstance().validationFailed();
|
||||
return "cliente_cuenta_corriente_girar";
|
||||
}
|
||||
|
||||
|
||||
GiroCuentaCorriente giro = new GiroCuentaCorriente();
|
||||
giro.setComentario(comentario);
|
||||
giro.setMonto(monto);
|
||||
giro.setMetodo(metodo);
|
||||
giro.setInsertedAt(new Date());
|
||||
giro.setCuentaCorriente(cuentaCorriente);
|
||||
|
||||
cuentaCorriente.getGiroList().add(giro);
|
||||
|
||||
cuentaCorriente.setSaldo(cuentaCorriente.getSaldo() - monto);
|
||||
|
||||
|
||||
giroCCFacade.create(giro);
|
||||
cuentaCorrienteFacade.edit(cuentaCorriente);
|
||||
|
||||
|
||||
resetInput();
|
||||
return "cliente_cuenta_corriente_view";
|
||||
}
|
||||
|
||||
|
||||
public String girarEnTarjetaDebito() {
|
||||
if(tarjetaDebito.getSaldo() - monto < 0 ){
|
||||
if (tarjetaDebito.getSaldo() - monto < 0) {
|
||||
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("El monto sobrepasa el saldo de la tarjeta de debito"));
|
||||
FacesContext.getCurrentInstance().validationFailed();
|
||||
return "cliente_tarjeta_debito_girar";
|
||||
}
|
||||
|
||||
|
||||
GiroTarjetaDebito giro = new GiroTarjetaDebito();
|
||||
giro.setComentario(comentario);
|
||||
giro.setMonto(monto);
|
||||
giro.setMetodo(metodo);
|
||||
giro.setInsertedAt(new Date());
|
||||
giro.setTarjetaDebito(tarjetaDebito);
|
||||
|
||||
tarjetaDebito.getGiroList().add(giro);
|
||||
|
||||
tarjetaDebito.setSaldo(tarjetaDebito.getSaldo() - monto);
|
||||
|
||||
|
||||
giroTDFacade.create(giro);
|
||||
tarjetaDebitoFacade.edit(tarjetaDebito);
|
||||
|
||||
|
||||
resetInput();
|
||||
return "cliente_tarjeta_debito_view";
|
||||
}
|
||||
|
||||
public String deleteGiroEnCuentaCorriente() {
|
||||
cuentaCorriente.setSaldo(cuentaCorriente.getSaldo() + giroCuentaCorriente.getMonto());
|
||||
cuentaCorriente.getGiroList().remove(giroCuentaCorriente);
|
||||
giroCCFacade.remove(giroCuentaCorriente);
|
||||
cuentaCorrienteFacade.edit(cuentaCorriente);
|
||||
return "admin_cuenta_corriente_view";
|
||||
}
|
||||
|
||||
public String deleteGiroEnTarjetaDebito() {
|
||||
tarjetaDebito.setSaldo(tarjetaDebito.getSaldo() + giroTarjetaDebito.getMonto());
|
||||
tarjetaDebito.getGiroList().remove(giroTarjetaDebito);
|
||||
giroTDFacade.remove(giroTarjetaDebito);
|
||||
tarjetaDebitoFacade.edit(tarjetaDebito);
|
||||
return "admin_tarjeta_debito_view";
|
||||
}
|
||||
|
||||
private void resetInput() {
|
||||
this.cuentaCorriente = null;
|
||||
this.tarjetaDebito = null;
|
||||
@@ -162,4 +176,23 @@ public class GiroBean implements Serializable {
|
||||
public void setMetodoList(List<Metodo> metodoList) {
|
||||
this.metodoList = metodoList;
|
||||
}
|
||||
|
||||
public GiroCuentaCorriente getGiroCuentaCorriente() {
|
||||
return giroCuentaCorriente;
|
||||
}
|
||||
|
||||
public void setGiroCuentaCorriente(GiroCuentaCorriente giroCuentaCorriente) {
|
||||
this.giroCuentaCorriente = giroCuentaCorriente;
|
||||
}
|
||||
|
||||
public GiroTarjetaDebito getGiroTarjetaDebito() {
|
||||
return giroTarjetaDebito;
|
||||
}
|
||||
|
||||
public void setGiroTarjetaDebito(GiroTarjetaDebito giroTarjetaDebito) {
|
||||
this.giroTarjetaDebito = giroTarjetaDebito;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -24,10 +24,10 @@ public class PagoBean implements Serializable {
|
||||
|
||||
private int monto;
|
||||
private String comentario;
|
||||
private String clase;
|
||||
private String tipo;
|
||||
|
||||
public String pagar() {
|
||||
if (clase.equals("Nacional")) {
|
||||
if (tipo.equals("Nacional")) {
|
||||
if (tarjetaCredito.getDeudaNacional() == 0) {
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
context.addMessage(null, new FacesMessage("No hay ninguna deuda nacional que pagar"));
|
||||
@@ -40,21 +40,9 @@ public class PagoBean implements Serializable {
|
||||
context.validationFailed();
|
||||
return "cliente_tarjeta_credito_pagar";
|
||||
}
|
||||
|
||||
PagoTarjetaCredito pago = new PagoTarjetaCredito();
|
||||
pago.setComentario(comentario);
|
||||
pago.setMonto(monto);
|
||||
pago.setTarjetaCredito(tarjetaCredito);
|
||||
|
||||
tarjetaCredito.setDeudaNacional(tarjetaCredito.getDeudaNacional() - monto);
|
||||
tarjetaCreditoFacade.edit(tarjetaCredito);
|
||||
pagoTarjetaCreditoFacade.create(pago);
|
||||
|
||||
this.resetInput();
|
||||
return "cliente_tarjeta_credito_view";
|
||||
}
|
||||
|
||||
if (clase.equals("Internacional")) {
|
||||
if (tipo.equals("Internacional")) {
|
||||
if (tarjetaCredito.getDeudaInternacional() == 0) {
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
context.addMessage(null, new FacesMessage("No hay ninguna deuda internacional que pagar"));
|
||||
@@ -67,29 +55,34 @@ public class PagoBean implements Serializable {
|
||||
context.validationFailed();
|
||||
return "cliente_tarjeta_credito_pagar";
|
||||
}
|
||||
|
||||
PagoTarjetaCredito pago = new PagoTarjetaCredito();
|
||||
pago.setComentario(comentario);
|
||||
pago.setMonto(monto);
|
||||
pago.setTarjetaCredito(tarjetaCredito);
|
||||
|
||||
tarjetaCredito.setDeudaInternacional(tarjetaCredito.getDeudaInternacional() - monto);
|
||||
tarjetaCredito.getPagoList().add(pago);
|
||||
|
||||
tarjetaCreditoFacade.edit(tarjetaCredito);
|
||||
pagoTarjetaCreditoFacade.create(pago);
|
||||
|
||||
this.resetInput();
|
||||
return "cliente_tarjeta_credito_view";
|
||||
}
|
||||
|
||||
PagoTarjetaCredito pago = new PagoTarjetaCredito();
|
||||
pago.setComentario(comentario);
|
||||
pago.setMonto(monto);
|
||||
pago.setTipo(tipo);
|
||||
pago.setTarjetaCredito(tarjetaCredito);
|
||||
|
||||
switch(tipo){
|
||||
case "Nacional":
|
||||
tarjetaCredito.setDeudaNacional(tarjetaCredito.getDeudaNacional() - monto);
|
||||
break;
|
||||
case "Internacional":
|
||||
tarjetaCredito.setDeudaInternacional(tarjetaCredito.getDeudaInternacional()- monto);
|
||||
break;
|
||||
}
|
||||
|
||||
pagoTarjetaCreditoFacade.create(pago);
|
||||
tarjetaCreditoFacade.edit(tarjetaCredito);
|
||||
|
||||
this.resetInput();
|
||||
return "cliente_tarjeta_credito_view";
|
||||
}
|
||||
|
||||
|
||||
public void resetInput() {
|
||||
this.monto = 0;
|
||||
this.comentario = null;
|
||||
this.clase = null;
|
||||
this.tipo = null;
|
||||
}
|
||||
|
||||
public TarjetaCredito getTarjetaCredito() {
|
||||
@@ -116,12 +109,12 @@ public class PagoBean implements Serializable {
|
||||
this.comentario = comentario;
|
||||
}
|
||||
|
||||
public String getClase() {
|
||||
return clase;
|
||||
public String getTipo() {
|
||||
return tipo;
|
||||
}
|
||||
|
||||
public void setClase(String clase) {
|
||||
this.clase = clase;
|
||||
public void setTipo(String tipo) {
|
||||
this.tipo = tipo;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -32,9 +32,8 @@ public class TarjetaCreditoBean implements Serializable {
|
||||
|
||||
public String contratar() {
|
||||
tarjetaCredito.setCliente(cliente);
|
||||
tarjetaCredito.setInsertedAt(new Date());
|
||||
|
||||
cliente.getTarjetaCreditoList().add(tarjetaCredito);
|
||||
tarjetaCreditoFacade.create(tarjetaCredito);
|
||||
clienteFacade.edit(cliente);
|
||||
|
||||
this.resetClases();
|
||||
|
||||
@@ -3,7 +3,14 @@ package bean;
|
||||
import beans.ClienteFacadeLocal;
|
||||
import beans.TarjetaDebitoFacadeLocal;
|
||||
import entities.Cliente;
|
||||
import entities.CompraTarjetaDebito;
|
||||
import entities.DepositoCuentaCorriente;
|
||||
import entities.DepositoTarjetaDebito;
|
||||
import entities.GiroCuentaCorriente;
|
||||
import entities.GiroTarjetaDebito;
|
||||
import entities.TarjetaDebito;
|
||||
import entities.TransferenciaCuentaCorriente;
|
||||
import entities.TransferenciaTarjetaDebito;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import javax.annotation.PostConstruct;
|
||||
@@ -32,43 +39,73 @@ public class TarjetaDebitoBean implements Serializable {
|
||||
|
||||
public String contratar() {
|
||||
tarjetaDebito.setCliente(cliente);
|
||||
tarjetaDebito.setInsertedAt(new Date());
|
||||
|
||||
cliente.getTarjetaDebitoList().add(tarjetaDebito);
|
||||
tarjetaDebitoFacade.create(tarjetaDebito);
|
||||
clienteFacade.edit(cliente);
|
||||
|
||||
this.resetInput();
|
||||
return "admin_cliente_view";
|
||||
}
|
||||
|
||||
|
||||
public String gotoDepositar() {
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
DepositoBean db = context.getApplication().evaluateExpressionGet(context, "#{depositoBean}", DepositoBean.class);
|
||||
db.setTarjetaDebito(tarjetaDebito);
|
||||
return "cliente_tarjeta_debito_depositar";
|
||||
}
|
||||
|
||||
|
||||
public String gotoDeleteDeposito(DepositoTarjetaDebito deposito) {
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
DepositoBean db = context.getApplication().evaluateExpressionGet(context, "#{depositoBean}", DepositoBean.class);
|
||||
db.setTarjetaDebito(tarjetaDebito);
|
||||
db.setDepositoTarjetaDebito(deposito);
|
||||
return "admin_tarjeta_debito_delete_deposito";
|
||||
}
|
||||
|
||||
public String gotoGirar() {
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
GiroBean gb = context.getApplication().evaluateExpressionGet(context, "#{giroBean}", GiroBean.class);
|
||||
gb.setTarjetaDebito(tarjetaDebito);
|
||||
return "cliente_tarjeta_debito_girar";
|
||||
}
|
||||
|
||||
|
||||
public String gotoDeleteGiro(GiroTarjetaDebito giro) {
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
GiroBean gb = context.getApplication().evaluateExpressionGet(context, "#{giroBean}", GiroBean.class);
|
||||
gb.setTarjetaDebito(tarjetaDebito);
|
||||
gb.setGiroTarjetaDebito(giro);
|
||||
return "admin_tarjeta_debito_delete_giro";
|
||||
}
|
||||
|
||||
public String gotoTransferir() {
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
TransferenciaBean tb = context.getApplication().evaluateExpressionGet(context, "#{transferenciaBean}", TransferenciaBean.class);
|
||||
tb.setTarjetaDebito(tarjetaDebito);
|
||||
return "cliente_tarjeta_debito_transferir";
|
||||
}
|
||||
|
||||
|
||||
public String gotoDeleteTransferencia(TransferenciaTarjetaDebito transferencia) {
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
TransferenciaBean tb = context.getApplication().evaluateExpressionGet(context, "#{transferenciaBean}", TransferenciaBean.class);
|
||||
tb.setTarjetaDebito(tarjetaDebito);
|
||||
tb.setTransferenciaTarjetaDebito(transferencia);
|
||||
return "admin_tarjeta_debito_delete_transferencia";
|
||||
}
|
||||
|
||||
public String gotoComprar() {
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
CompraBean cb = context.getApplication().evaluateExpressionGet(context, "#{compraBean}", CompraBean.class);
|
||||
cb.setTarjetaDebito(tarjetaDebito);
|
||||
return "cliente_tarjeta_debito_comprar";
|
||||
}
|
||||
|
||||
|
||||
public String gotoDeleteCompra(CompraTarjetaDebito compra) {
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
CompraBean cb = context.getApplication().evaluateExpressionGet(context, "#{compraBean}", CompraBean.class);
|
||||
cb.setTarjetaDebito(tarjetaDebito);
|
||||
cb.setCompraTarjetaDebito(compra);
|
||||
return "admin_tarjeta_debito_delete_compra";
|
||||
}
|
||||
|
||||
private void resetInput() {
|
||||
this.cliente = new Cliente();
|
||||
|
||||
@@ -34,6 +34,8 @@ public class TransferenciaBean implements Serializable {
|
||||
private String comentario;
|
||||
private CuentaCorriente cuentaCorriente;
|
||||
private TarjetaDebito tarjetaDebito;
|
||||
private TransferenciaCuentaCorriente transferenciaCuentaCorriente;
|
||||
private TransferenciaTarjetaDebito transferenciaTarjetaDebito;
|
||||
|
||||
public String transferir() {
|
||||
if (cuentaCorriente != null) {
|
||||
@@ -46,12 +48,12 @@ public class TransferenciaBean implements Serializable {
|
||||
}
|
||||
|
||||
public String transferirEnCuentaCorriente() {
|
||||
if(this.destinatario_id == this.cuentaCorriente.getId()){
|
||||
if (this.destinatario_id == this.cuentaCorriente.getId()) {
|
||||
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("No se puede transferir hacia si mismo"));
|
||||
FacesContext.getCurrentInstance().validationFailed();
|
||||
return "cliente_cuenta_corriente_transferir";
|
||||
}
|
||||
|
||||
|
||||
CuentaCorriente destinatario = cuentaCorrienteFacade.find(this.destinatario_id);
|
||||
if (destinatario == null) {
|
||||
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("La cuenta corriente ingresada no existe"));
|
||||
@@ -68,16 +70,12 @@ public class TransferenciaBean implements Serializable {
|
||||
TransferenciaCuentaCorriente transferencia = new TransferenciaCuentaCorriente();
|
||||
transferencia.setComentario(comentario);
|
||||
transferencia.setMonto(monto);
|
||||
transferencia.setInsertedAt(new Date());
|
||||
transferencia.setCuentaCorrienteFrom(cuentaCorriente);
|
||||
transferencia.setCuentaCorrienteTo(destinatario);
|
||||
|
||||
cuentaCorriente.getTransferenciaFromList().add(transferencia);
|
||||
destinatario.getTransferenciaToList().add(transferencia);
|
||||
|
||||
cuentaCorriente.setSaldo(cuentaCorriente.getSaldo() - monto);
|
||||
destinatario.setSaldo(destinatario.getSaldo() + monto);
|
||||
|
||||
|
||||
transferenciaCCFacade.create(transferencia);
|
||||
cuentaCorrienteFacade.edit(cuentaCorriente);
|
||||
cuentaCorrienteFacade.edit(destinatario);
|
||||
@@ -87,12 +85,12 @@ public class TransferenciaBean implements Serializable {
|
||||
}
|
||||
|
||||
public String transferirEnTarjetaDebito() {
|
||||
if(this.destinatario_id == this.tarjetaDebito.getId()){
|
||||
if (this.destinatario_id == this.tarjetaDebito.getId()) {
|
||||
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("No se puede transferir hacia si mismo"));
|
||||
FacesContext.getCurrentInstance().validationFailed();
|
||||
return "cliente_tarjeta_debito_transferir";
|
||||
}
|
||||
|
||||
|
||||
TarjetaDebito destinatario = tarjetaDebitoFacade.find(this.destinatario_id);
|
||||
if (destinatario == null) {
|
||||
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("La tarjeta de debito ingresada no existe"));
|
||||
@@ -109,16 +107,12 @@ public class TransferenciaBean implements Serializable {
|
||||
TransferenciaTarjetaDebito transferencia = new TransferenciaTarjetaDebito();
|
||||
transferencia.setComentario(comentario);
|
||||
transferencia.setMonto(monto);
|
||||
transferencia.setInsertedAt(new Date());
|
||||
transferencia.setTarjetaDebitoFrom(tarjetaDebito);
|
||||
transferencia.setTarjetaDebitoTo(destinatario);
|
||||
|
||||
tarjetaDebito.getTransferenciaFromList().add(transferencia);
|
||||
destinatario.getTransferenciaToList().add(transferencia);
|
||||
|
||||
tarjetaDebito.setSaldo(tarjetaDebito.getSaldo() - monto);
|
||||
destinatario.setSaldo(destinatario.getSaldo() + monto);
|
||||
|
||||
|
||||
transferenciaTDFacade.create(transferencia);
|
||||
tarjetaDebitoFacade.edit(tarjetaDebito);
|
||||
tarjetaDebitoFacade.edit(destinatario);
|
||||
@@ -127,6 +121,55 @@ public class TransferenciaBean implements Serializable {
|
||||
return "cliente_tarjeta_debito_view";
|
||||
}
|
||||
|
||||
public String eliminarTransferenciaEnCuentaCorriente() {
|
||||
CuentaCorriente ccFrom = transferenciaCuentaCorriente.getCuentaCorrienteFrom();
|
||||
CuentaCorriente ccTo = transferenciaCuentaCorriente.getCuentaCorrienteTo();
|
||||
|
||||
if (ccTo.getSaldo() - transferenciaCuentaCorriente.getMonto() < 0) {
|
||||
FacesContext facesContext = FacesContext.getCurrentInstance();
|
||||
facesContext.addMessage(null, new FacesMessage("Eliminar la transferencia dejaria la cuenta del destinatario en negativo"));
|
||||
facesContext.validationFailed();
|
||||
return "admin_cuenta_corriente_delete_transferencia";
|
||||
}
|
||||
|
||||
ccFrom.setSaldo(ccFrom.getSaldo() + transferenciaCuentaCorriente.getMonto());
|
||||
ccTo.setSaldo(ccTo.getSaldo() - transferenciaCuentaCorriente.getMonto());
|
||||
|
||||
ccFrom.getTransferenciaFromList().remove(transferenciaCuentaCorriente);
|
||||
ccTo.getTransferenciaToList().remove(transferenciaCuentaCorriente);
|
||||
|
||||
transferenciaCCFacade.remove(transferenciaCuentaCorriente);
|
||||
cuentaCorrienteFacade.edit(ccFrom);
|
||||
cuentaCorrienteFacade.edit(ccTo);
|
||||
|
||||
return "admin_cuenta_corriente_view";
|
||||
}
|
||||
|
||||
|
||||
public String eliminarTransferenciaEnTarjetaDebito() {
|
||||
TarjetaDebito tdFrom = transferenciaTarjetaDebito.getTarjetaDebitoFrom();
|
||||
TarjetaDebito tdTo = transferenciaTarjetaDebito.getTarjetaDebitoTo();
|
||||
|
||||
if (tdTo.getSaldo() - transferenciaTarjetaDebito.getMonto() < 0) {
|
||||
FacesContext facesContext = FacesContext.getCurrentInstance();
|
||||
facesContext.addMessage(null, new FacesMessage("Eliminar la transferencia dejaria la cuenta del destinatario en negativo"));
|
||||
facesContext.validationFailed();
|
||||
return "admin_tarjeta_debito_delete_transferencia";
|
||||
}
|
||||
|
||||
tdFrom.setSaldo(tdFrom.getSaldo() + transferenciaTarjetaDebito.getMonto());
|
||||
tdTo.setSaldo(tdTo.getSaldo() - transferenciaTarjetaDebito.getMonto());
|
||||
|
||||
tdFrom.getTransferenciaFromList().remove(transferenciaTarjetaDebito);
|
||||
tdTo.getTransferenciaToList().remove(transferenciaTarjetaDebito);
|
||||
|
||||
transferenciaTDFacade.remove(transferenciaTarjetaDebito);
|
||||
tarjetaDebitoFacade.edit(tdFrom);
|
||||
tarjetaDebitoFacade.edit(tdTo);
|
||||
|
||||
return "admin_tarjeta_debito_view";
|
||||
}
|
||||
|
||||
private void resetInput() {
|
||||
this.cuentaCorriente = null;
|
||||
this.tarjetaDebito = null;
|
||||
@@ -174,6 +217,22 @@ public class TransferenciaBean implements Serializable {
|
||||
public void setDestinatario_id(int destinatario_id) {
|
||||
this.destinatario_id = destinatario_id;
|
||||
}
|
||||
|
||||
public TransferenciaCuentaCorriente getTransferenciaCuentaCorriente() {
|
||||
return transferenciaCuentaCorriente;
|
||||
}
|
||||
|
||||
public void setTransferenciaCuentaCorriente(TransferenciaCuentaCorriente transferenciaCuentaCorriente) {
|
||||
this.transferenciaCuentaCorriente = transferenciaCuentaCorriente;
|
||||
}
|
||||
|
||||
public TransferenciaTarjetaDebito getTransferenciaTarjetaDebito() {
|
||||
return transferenciaTarjetaDebito;
|
||||
}
|
||||
|
||||
public void setTransferenciaTarjetaDebito(TransferenciaTarjetaDebito transferenciaTarjetaDebito) {
|
||||
this.transferenciaTarjetaDebito = transferenciaTarjetaDebito;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ public class UsuarioBean implements Serializable {
|
||||
u.setNombre(nombre);
|
||||
u.setPassword(hash);
|
||||
u.setSalt(salt);
|
||||
u.setRole("Admin");
|
||||
u.setRol("Admin");
|
||||
|
||||
usuarioFacade.create(u);
|
||||
|
||||
@@ -76,11 +76,11 @@ public class UsuarioBean implements Serializable {
|
||||
}
|
||||
|
||||
public boolean isAdmin() {
|
||||
return this.getUsuario().getRole().equals("Admin");
|
||||
return this.getUsuario().getRol().equals("Admin");
|
||||
}
|
||||
|
||||
public boolean isClient() {
|
||||
return this.getUsuario().getRole().equals("Cliente");
|
||||
return this.getUsuario().getRol().equals("Cliente");
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -42,12 +42,12 @@
|
||||
</h:inputSecret>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 dib white bg-blue" action="#{clienteBean.create()}">
|
||||
<h:commandLink class="f5 tc link dim br2 ph3 pv2 mb2 dib white bg-blue" action="#{clienteBean.create()}" style="width: 200px">
|
||||
<li class="fas fa-plus-circle"></li> Crear
|
||||
</h:commandLink>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" immediate="true" action="admin_main">
|
||||
<h:commandLink class="f5 tc link dim br2 ph3 pv2 mb2 dib white bg-red" immediate="true" action="admin_main" style="width: 200px">
|
||||
<li class="fas fa-arrow-left"></li> Volver
|
||||
</h:commandLink>
|
||||
</div>
|
||||
|
||||
@@ -17,182 +17,177 @@
|
||||
</h:head>
|
||||
<body class="black-70 pa4">
|
||||
<h:form rendered="#{userBean.isLogged() and userBean.isAdmin()}">
|
||||
<div class="flex justify-between">
|
||||
<h1 class="f1">Cliente</h1>
|
||||
<h1 class="f1 tc">Cliente</h1>
|
||||
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-blue" immediate="true" action="admin_main" style="margin-top: auto; margin-bottom: auto">
|
||||
<div class="mv3 cf">
|
||||
<h:commandLink class="f5 fl tc link dim br2 ph3 pv2 mb2 dib white bg-red" immediate="true" action="#{userBean.logout()}" style="width: 200px">
|
||||
<li class="fas fa-sign-out-alt"></li> Cerrar sesion
|
||||
</h:commandLink>
|
||||
<h:commandLink class="f5 fr tc link dim br2 ph3 pv2 mb2 dib white bg-blue" immediate="true" action="admin_main" style="width: 200px">
|
||||
<li class="fas fa-arrow-left"></li> Volver
|
||||
</h:commandLink>
|
||||
</div>
|
||||
|
||||
<h:messages class="f4 w-40 list white bg-red pa4" />
|
||||
|
||||
<!--
|
||||
////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////Datos del cliente////////////////////////
|
||||
////////////////////////////////////////////////////////////////////
|
||||
-->
|
||||
<div class="mv3 pa2 fl w-33">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="rut" value="Rut:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 w-100" id="rut" value="#{clienteBean.cliente.rut}" readonly="true"/>
|
||||
<div class="mv3">
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db lh-copy f6" value="Rut:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" value="#{clienteBean.cliente.rut}" readonly="true"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db lh-copy f6" for="nombre" value="Nombre:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="nombre" value="#{clienteBean.cliente.nombre}" readonly="true"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db lh-copy f6" for="ciudad" value="Ciudad:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="ciudad" value="#{clienteBean.cliente.ciudad}" readonly="true"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mv3 pa2 fl w-33">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="nombre" value="Nombre:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 w-100" id="nombre" value="#{clienteBean.cliente.nombre}" readonly="true"/>
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="mv3 pa2 fl w-33">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="ciudad" value="Ciudad:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 w-100" id="ciudad" value="#{clienteBean.cliente.ciudad}" readonly="true"/>
|
||||
</div>
|
||||
|
||||
|
||||
<h2 class="f2">Servicios</h2>
|
||||
<h2 class="f2 tc">Productos</h2>
|
||||
|
||||
<!--
|
||||
////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////Cuentas Corrientes///////////////////////
|
||||
////////////////////////////////////////////////////////////////////
|
||||
-->
|
||||
|
||||
<div class="flex justify-between">
|
||||
<h3 class="f3 dib">Cuentas Corrientes</h3>
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-blue" immediate="true" action="#{clienteBean.gotoContratarCuentaCorriente()}" style="margin-top: auto; margin-bottom: auto">
|
||||
<h:panelGroup layout="block" class="mv3 w-100" rendered="#{clienteBean.cliente.cuentaCorriente != null}">
|
||||
<h3 class="f3 tc">Cuenta Corriente</h3>
|
||||
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db lh-copy f6" value="Id:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" value="#{clienteBean.cliente.cuentaCorriente.id}" readonly="true"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db lh-copy f6" value="Saldo:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" value="#{clienteBean.cliente.cuentaCorriente.saldo}" readonly="true"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db lh-copy f6" value="Fecha Creacion:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" value="#{clienteBean.cliente.cuentaCorriente.insertedAt}" readonly="true"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:commandLink class="f6 link dim br2 ph3 pv2 mb2 dib white bg-green tc" action="#{clienteBean.gotoAdminViewCuentaCorriente()}" style="width: 200px">
|
||||
<li class="fas fa-eye"></li> Ver
|
||||
</h:commandLink>
|
||||
</div>
|
||||
</h:panelGroup>
|
||||
|
||||
<h:panelGroup layout="block" rendered="#{clienteBean.cliente.cuentaCorriente == null}">
|
||||
<h3 class="f3 tc">Cuenta Corriente</h3>
|
||||
<p class="f6 tc">Sin contratar</p>
|
||||
|
||||
<div class="mt3 tc">
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-blue" immediate="true" action="#{clienteBean.gotoContratarCuentaCorriente()}" style="width: 200px">
|
||||
<li class="fas fa-wallet"></li> Contratar
|
||||
</h:commandLink>
|
||||
</div>
|
||||
</div>
|
||||
</h:panelGroup>
|
||||
|
||||
<hr/>
|
||||
|
||||
<h:dataTable class="w-100 pv3" headerClass="fw6 bb b--black-20 tl pb2 pr3" value="#{clienteBean.cliente.cuentaCorrienteList}" var="cuentaCorriente">
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Id"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{cuentaCorriente.id}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Saldo"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{cuentaCorriente.saldo}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Fecha creacion"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{cuentaCorriente.insertedAt}">
|
||||
<f:convertDateTime pattern="dd/MM/yyyy HH:mm"/>
|
||||
</h:outputLabel>
|
||||
</h:column>
|
||||
<h:column class="tr">
|
||||
<h:commandLink class="f6 link dim br2 ph3 pv2 mb2 dib white bg-green" action="#{clienteBean.gotoAdminViewCuentaCorriente(cuentaCorriente)}">
|
||||
<li class="fas fa-eye"></li>
|
||||
</h:commandLink>
|
||||
</h:column>
|
||||
</h:dataTable>
|
||||
|
||||
<!--
|
||||
////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////Tarjetas de Debito//////////////////////
|
||||
////////////////////////////////////////////////////////////////////
|
||||
-->
|
||||
|
||||
<div class="flex justify-between">
|
||||
<h3 class="f3 dib">Tarjetas de Debito</h3>
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-blue" immediate="true" action="#{clienteBean.gotoContratarTarjetaDebito()}" style="margin-top: auto; margin-bottom: auto">
|
||||
|
||||
<h:panelGroup layout="block" class="mv3 w-100" rendered="#{clienteBean.cliente.tarjetaDebito != null}">
|
||||
<h3 class="f3 tc">Tarjeta Debito</h3>
|
||||
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db lh-copy f6" value="Id:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" value="#{clienteBean.cliente.tarjetaDebito.id}" readonly="true"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" value="Saldo:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" value="#{clienteBean.cliente.tarjetaDebito.saldo}" readonly="true"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" value="Fecha Creacion:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" value="#{clienteBean.cliente.tarjetaDebito.insertedAt}" readonly="true"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-green" action="#{clienteBean.gotoAdminViewTarjetaDebito()}" style="margin-top: auto; margin-bottom: auto">
|
||||
<li class="fas fa-eye"></li> Ver
|
||||
</h:commandLink>
|
||||
</div>
|
||||
</h:panelGroup>
|
||||
|
||||
<h:panelGroup layout="block" rendered="#{clienteBean.cliente.tarjetaDebito == null}">
|
||||
<h3 class="f3 tc">Tarjeta Debito</h3>
|
||||
<p class="f6 tc">Sin contratar</p>
|
||||
|
||||
<div class="mt3 tc">
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-blue" immediate="true" action="#{clienteBean.gotoContratarTarjetaDebito()}" style="width: 200px">
|
||||
<li class="fas fa-money-check"></li> Contratar
|
||||
</h:commandLink>
|
||||
</div>
|
||||
</div>
|
||||
</h:panelGroup>
|
||||
|
||||
<hr/>
|
||||
|
||||
<h:dataTable class="w-100 pv3" headerClass="fw6 bb b--black-20 tl pb2 pr3" value="#{clienteBean.cliente.tarjetaDebitoList}" var="tarjetaDebito">
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Id"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{tarjetaDebito.id}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Saldo"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{tarjetaDebito.saldo}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Fecha creacion"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{tarjetaDebito.insertedAt}">
|
||||
<f:convertDateTime pattern="dd/MM/yyyy HH:mm"/>
|
||||
</h:outputLabel>
|
||||
</h:column>
|
||||
<h:column class="tr">
|
||||
<h:commandLink class="f6 link dim br2 ph3 pv2 dib white bg-green">
|
||||
<li class="fas fa-eye"></li>
|
||||
</h:commandLink>
|
||||
</h:column>
|
||||
</h:dataTable>
|
||||
|
||||
<!--
|
||||
////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////Tarjetas de Credito//////////////////////
|
||||
////////////////////////////////////////////////////////////////////
|
||||
-->
|
||||
|
||||
<div class="flex justify-between">
|
||||
<h3 class="f3 dib">Tarjetas de Credito</h3>
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-blue" immediate="true" action="#{clienteBean.gotoContratarTarjetaCredito()}" style="margin-top: auto; margin-bottom: auto">
|
||||
|
||||
<h:panelGroup layout="block" class="mv3 w-100" rendered="#{clienteBean.cliente.tarjetaCredito != null}">
|
||||
<h3 class="f3 tc">Tarjeta Credito</h3>
|
||||
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db lh-copy f6" value="Id:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" value="#{clienteBean.cliente.tarjetaCredito.id}" readonly="true"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db lh-copy f6" value="Limite Nacional:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" value="#{clienteBean.cliente.tarjetaCredito.limiteNacional}" readonly="true"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db lh-copy f6" value="Deuda Nacional:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" value="#{clienteBean.cliente.tarjetaCredito.deudaNacional}" readonly="true"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db lh-copy f6" value="Limite Internacional:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" value="#{clienteBean.cliente.tarjetaCredito.limiteInternacional}" readonly="true"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db lh-copy f6" value="Deuda Internacional:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" value="#{clienteBean.cliente.tarjetaCredito.deudaInternacional}" readonly="true"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db lh-copy f6" value="Fecha Creacion:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" value="#{clienteBean.cliente.tarjetaCredito.insertedAt}" readonly="true"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-green" action="#{clienteBean.gotoAdminViewCuentaCorriente()}" style="width: 200px">
|
||||
<li class="fas fa-eye"></li> Ver
|
||||
</h:commandLink>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-blue" action="#{clienteBean.gotoEditTarjetaCredito()}" style="width: 200px">
|
||||
<li class="fas fa-edit"></li> Editar
|
||||
</h:commandLink>
|
||||
</div>
|
||||
</h:panelGroup>
|
||||
|
||||
<h:panelGroup layout="block" rendered="#{clienteBean.cliente.tarjetaCredito == null}">
|
||||
<h3 class="f3 tc">Tarjeta Credito</h3>
|
||||
<p class="f6 tc">Sin contratar</p>
|
||||
|
||||
<div class="mt3 tc">
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-blue" immediate="true" action="#{clienteBean.gotoContratarTarjetaCredito()}" style="width: 200px">
|
||||
<li class="fas fa-credit-card"></li> Contratar
|
||||
</h:commandLink>
|
||||
</div>
|
||||
|
||||
<h:dataTable class="w-100 pv3" headerClass="fw6 bb b--black-20 tl pb2 pr3" value="#{clienteBean.cliente.tarjetaCreditoList}" var="tarjetaCredito">
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Id"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{tarjetaCredito.id}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Limite Nacional"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{tarjetaCredito.limiteNacional}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Deuda Nacional"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{tarjetaCredito.deudaNacional}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Limite Internacional"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{tarjetaCredito.limiteInternacional}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Deuda Internacional"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{tarjetaCredito.deudaInternacional}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Fecha creacion"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{tarjetaCredito.insertedAt}">
|
||||
<f:convertDateTime pattern="dd/MM/yyyy HH:mm"/>
|
||||
</h:outputLabel>
|
||||
</h:column>
|
||||
<h:column class="tr">
|
||||
<h:commandLink class="f6 link dim br2 ph3 pv2 dib white bg-green">
|
||||
<li class="fas fa-eye"></li>
|
||||
</h:commandLink>
|
||||
<h:commandLink class="f6 link dim br2 ph3 pv2 ml2 dib white bg-blue" action="#{clienteBean.gotoEditTarjetaCredito(tarjetaCredito)}">
|
||||
<li class="fas fa-edit"></li>
|
||||
</h:commandLink>
|
||||
</h:column>
|
||||
</h:dataTable>
|
||||
</div>
|
||||
</h:panelGroup>
|
||||
</h:form>
|
||||
|
||||
<h:form rendered="#{!userBean.isLogged()}">
|
||||
|
||||
58
bank-war/web/admin_cuenta_corriente_delete_deposito.xhtml
Normal file
58
bank-war/web/admin_cuenta_corriente_delete_deposito.xhtml
Normal file
@@ -0,0 +1,58 @@
|
||||
<?xml version='1.0' encoding='UTF-8' ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3c.org/1999/xhtml"
|
||||
xmlns:h="http://xmlns.jcp.org/jsf/html"
|
||||
xmlns:f="http://java.sun.com/jsf/core">
|
||||
<h:head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<link rel="stylesheet" href="https://unpkg.com/tachyons@4.10.0/css/tachyons.min.css"/>
|
||||
<link rel="stylesheet" href="https://unpkg.com/normalize.css@8.0.1/normalize.css"/>
|
||||
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"/>
|
||||
<h:outputStylesheet library="css" name="all.css"/>
|
||||
<style>
|
||||
body {
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
}
|
||||
</style>
|
||||
</h:head>
|
||||
<body class="black-70 pa4">
|
||||
<h:form rendered="#{userBean.isLogged() and userBean.isAdmin()}">
|
||||
<div class="flex justify-between">
|
||||
<h1 class="f1">Eliminar Deposito</h1>
|
||||
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-blue" immediate="true" action="admin_cuenta_corriente_view" style="margin-top: auto; margin-bottom: auto">
|
||||
<li class="fas fa-arrow-left"></li> Volver
|
||||
</h:commandLink>
|
||||
</div>
|
||||
|
||||
<h:messages class="f4 w-40 list tc center white bg-red pa4 "/>
|
||||
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="monto" value="Monto:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="monto" value="#{depositoBean.depositoCuentaCorriente.monto}" readonly="true" label="Monto"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="comentario" value="Comentario:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="comentario" value="#{depositoBean.depositoCuentaCorriente.comentario}" readonly="true" label="Comentario"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="metodo" value="Metodo:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="metodo" value="#{depositoBean.depositoCuentaCorriente.metodo.nombre}" readonly="true" label="Metodo"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" action="#{depositoBean.deleteDepositoCuentaCorriente()}" style="margin-top: auto; margin-bottom: auto">
|
||||
<li class="fas fa-trash"></li> Eliminar
|
||||
</h:commandLink>
|
||||
</div>
|
||||
</h:form>
|
||||
|
||||
<h:form rendered="#{!userBean.isLogged()}">
|
||||
<div class="tc">
|
||||
<h1 class="f1 tc">Acceso no autorizado</h1>
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" value="Ir al index" action="index"/>
|
||||
</div>
|
||||
</h:form>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
58
bank-war/web/admin_cuenta_corriente_delete_giro.xhtml
Normal file
58
bank-war/web/admin_cuenta_corriente_delete_giro.xhtml
Normal file
@@ -0,0 +1,58 @@
|
||||
<?xml version='1.0' encoding='UTF-8' ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3c.org/1999/xhtml"
|
||||
xmlns:h="http://xmlns.jcp.org/jsf/html"
|
||||
xmlns:f="http://java.sun.com/jsf/core">
|
||||
<h:head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<link rel="stylesheet" href="https://unpkg.com/tachyons@4.10.0/css/tachyons.min.css"/>
|
||||
<link rel="stylesheet" href="https://unpkg.com/normalize.css@8.0.1/normalize.css"/>
|
||||
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"/>
|
||||
<h:outputStylesheet library="css" name="all.css"/>
|
||||
<style>
|
||||
body {
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
}
|
||||
</style>
|
||||
</h:head>
|
||||
<body class="black-70 pa4">
|
||||
<h:form rendered="#{userBean.isLogged() and userBean.isAdmin()}">
|
||||
<div class="flex justify-between">
|
||||
<h1 class="f1">Eliminar Giro</h1>
|
||||
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-blue" immediate="true" action="admin_cuenta_corriente_view" style="margin-top: auto; margin-bottom: auto">
|
||||
<li class="fas fa-arrow-left"></li> Volver
|
||||
</h:commandLink>
|
||||
</div>
|
||||
|
||||
<h:messages class="f4 w-40 list tc center white bg-red pa4 "/>
|
||||
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="monto" value="Monto:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="monto" value="#{giroBean.giroCuentaCorriente.monto}" readonly="true" label="Monto"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="comentario" value="Comentario:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="comentario" value="#{giroBean.giroCuentaCorriente.comentario}" readonly="true" label="Comentario"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="metodo" value="Metodo:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="metodo" value="#{giroBean.giroCuentaCorriente.metodo.nombre}" readonly="true" label="Metodo"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" action="#{giroBean.deleteGiroEnCuentaCorriente()}" style="margin-top: auto; margin-bottom: auto">
|
||||
<li class="fas fa-trash"></li> Eliminar
|
||||
</h:commandLink>
|
||||
</div>
|
||||
</h:form>
|
||||
|
||||
<h:form rendered="#{!userBean.isLogged()}">
|
||||
<div class="tc">
|
||||
<h1 class="f1 tc">Acceso no autorizado</h1>
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" value="Ir al index" action="index"/>
|
||||
</div>
|
||||
</h:form>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
<?xml version='1.0' encoding='UTF-8' ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3c.org/1999/xhtml"
|
||||
xmlns:h="http://xmlns.jcp.org/jsf/html"
|
||||
xmlns:f="http://java.sun.com/jsf/core">
|
||||
<h:head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<link rel="stylesheet" href="https://unpkg.com/tachyons@4.10.0/css/tachyons.min.css"/>
|
||||
<link rel="stylesheet" href="https://unpkg.com/normalize.css@8.0.1/normalize.css"/>
|
||||
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"/>
|
||||
<h:outputStylesheet library="css" name="all.css"/>
|
||||
<style>
|
||||
body {
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
}
|
||||
</style>
|
||||
</h:head>
|
||||
<body class="black-70 pa4">
|
||||
<h:form rendered="#{userBean.isLogged() and userBean.isAdmin()}">
|
||||
<div class="flex justify-between">
|
||||
<h1 class="f1">Eliminar Transferencia</h1>
|
||||
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-blue" immediate="true" action="admin_cuenta_corriente_view" style="margin-top: auto; margin-bottom: auto">
|
||||
<li class="fas fa-arrow-left"></li> Volver
|
||||
</h:commandLink>
|
||||
</div>
|
||||
|
||||
<h:messages class="f4 w-40 list tc center white bg-red pa4 "/>
|
||||
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="monto" value="Monto:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="monto" value="#{transferenciaBean.transferenciaCuentaCorriente.monto}" readonly="true" label="Monto"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="comentario" value="Comentario:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="comentario" value="#{transferenciaBean.transferenciaCuentaCorriente.comentario}" readonly="true" label="Comentario"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="emisor" value="Cuenta Emisor:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="emisor" value="#{transferenciaBean.transferenciaCuentaCorriente.cuentaCorrienteFrom.id}" readonly="true" label="Cuenta Emisor"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="destinatario" value="Cuenta Destinatario:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="destinatario" value="#{transferenciaBean.transferenciaCuentaCorriente.cuentaCorrienteTo.id}" readonly="true" label="Cuenta Destinatario"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" action="#{transferenciaBean.eliminarTransferenciaEnCuentaCorriente()}" style="margin-top: auto; margin-bottom: auto">
|
||||
<li class="fas fa-trash"></li> Eliminar
|
||||
</h:commandLink>
|
||||
</div>
|
||||
</h:form>
|
||||
|
||||
<h:form rendered="#{!userBean.isLogged()}">
|
||||
<div class="tc">
|
||||
<h1 class="f1 tc">Acceso no autorizado</h1>
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" value="Ir al index" action="index"/>
|
||||
</div>
|
||||
</h:form>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<div class="flex justify-between">
|
||||
<h1 class="f1">Cuenta Corriente</h1>
|
||||
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-blue" immediate="true" action="admin_main" style="margin-top: auto; margin-bottom: auto">
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-blue" immediate="true" action="admin_cliente_view" style="margin-top: auto; margin-bottom: auto">
|
||||
<li class="fas fa-arrow-left"></li> Volver
|
||||
</h:commandLink>
|
||||
</div>
|
||||
@@ -35,9 +35,7 @@
|
||||
</div>
|
||||
<div class="mv4 ph2 fl w-33">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="fecha_creacion" value="Fecha Creacion:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100" id="fecha_creacion" value="#{cuentaCorrienteBean.cuentaCorriente.insertedAt}" readonly="true" label="Fecha Creacion:">
|
||||
<f:convertDateTime pattern="dd/MM/yyyy"/>
|
||||
</h:inputText>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100" id="fecha_creacion" value="#{cuentaCorrienteBean.cuentaCorriente.insertedAt}" readonly="true" label="Fecha Creacion:"/>
|
||||
</div>
|
||||
|
||||
<h1 class="f2 ">Depositos</h1>
|
||||
@@ -46,9 +44,7 @@
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Fecha"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{deposito.insertedAt}">
|
||||
<f:convertDateTime pattern="dd/MM/yyyy HH:mm"/>
|
||||
</h:outputLabel>
|
||||
<h:outputLabel value="#{deposito.insertedAt}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
@@ -62,6 +58,11 @@
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{deposito.monto}"/>
|
||||
</h:column>
|
||||
<h:column class="tr">
|
||||
<h:commandLink class="f6 link dim br2 ph3 pv2 mr2 dib white bg-red tc" action="#{cuentaCorrienteBean.gotoDeleteDeposito(deposito)}">
|
||||
<li class="fas fa-trash"></li>
|
||||
</h:commandLink>
|
||||
</h:column>
|
||||
</h:dataTable>
|
||||
|
||||
<h1 class="f2">Giros</h1>
|
||||
@@ -70,9 +71,7 @@
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Fecha"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{giro.insertedAt}">
|
||||
<f:convertDateTime pattern="dd/MM/yyyy HH:mm"/>
|
||||
</h:outputLabel>
|
||||
<h:outputLabel value="#{giro.insertedAt}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
@@ -86,6 +85,11 @@
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{giro.monto}"/>
|
||||
</h:column>
|
||||
<h:column class="tr">
|
||||
<h:commandLink class="f6 link dim br2 ph3 pv2 mr2 dib white bg-red tc" action="#{cuentaCorrienteBean.gotoDeleteGiro(giro)}">
|
||||
<li class="fas fa-trash"></li>
|
||||
</h:commandLink>
|
||||
</h:column>
|
||||
</h:dataTable>
|
||||
|
||||
<h1 class="f2">Transferencias Hechas</h1>
|
||||
@@ -94,9 +98,7 @@
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Fecha"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{transferencia.insertedAt}">
|
||||
<f:convertDateTime pattern="dd/MM/yyyy HH:mm"/>
|
||||
</h:outputLabel>
|
||||
<h:outputLabel value="#{transferencia.insertedAt}"/>
|
||||
</h:column><h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Destinatario"/>
|
||||
@@ -115,6 +117,11 @@
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{transferencia.monto}"/>
|
||||
</h:column>
|
||||
<h:column class="tr">
|
||||
<h:commandLink class="f6 link dim br2 ph3 pv2 mr2 dib white bg-red tc" action="#{cuentaCorrienteBean.gotoDeleteTransferencia(transferencia)}">
|
||||
<li class="fas fa-trash"></li>
|
||||
</h:commandLink>
|
||||
</h:column>
|
||||
</h:dataTable>
|
||||
|
||||
<h1 class="f2">Transferencias Recibidas</h1>
|
||||
@@ -123,9 +130,7 @@
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Fecha"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{transferencia.insertedAt}">
|
||||
<f:convertDateTime pattern="dd/MM/yyyy HH:mm"/>
|
||||
</h:outputLabel>
|
||||
<h:outputLabel value="#{transferencia.insertedAt}"/>
|
||||
</h:column><h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Emisor"/>
|
||||
@@ -144,6 +149,11 @@
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{transferencia.monto}"/>
|
||||
</h:column>
|
||||
<h:column class="tr">
|
||||
<h:commandLink class="f6 link dim br2 ph3 pv2 mr2 dib white bg-red tc" action="#{cuentaCorrienteBean.gotoDeleteTransferencia(transferencia)}">
|
||||
<li class="fas fa-trash"></li>
|
||||
</h:commandLink>
|
||||
</h:column>
|
||||
</h:dataTable>
|
||||
</h:form>
|
||||
|
||||
|
||||
@@ -17,12 +17,13 @@
|
||||
</h:head>
|
||||
<body class="black-70 pa4">
|
||||
<h:form rendered="#{userBean.isLogged() and userBean.isAdmin()}">
|
||||
<h1 class="f1 w-100 dib tc">Administracion</h1>
|
||||
<div>
|
||||
<h:commandLink class="f5 fr link dim br2 ph3 pv2 mb2 dib white bg-blue" action="#{clienteBean.gotoCreate()}">
|
||||
<h1 class="f1 tc">Administracion</h1>
|
||||
|
||||
<div class="mt3 cf">
|
||||
<h:commandLink class="f5 fr tc link dim br2 ph3 pv2 mb2 dib white bg-blue" action="#{clienteBean.gotoCreate()}" style="width: 200px">
|
||||
<li class="fas fa-plus-circle"></li> Crear Cliente
|
||||
</h:commandLink>
|
||||
<h:commandLink class="f5 fl link dim br2 ph3 pv2 mb2 dib white bg-red" immediate="true" action="#{userBean.logout()}">
|
||||
<h:commandLink class="f5 fl tc link dim br2 ph3 pv2 mb2 dib white bg-red" immediate="true" action="#{userBean.logout()}" style="width: 200px">
|
||||
<li class="fas fa-sign-out-alt"></li> Cerrar sesion
|
||||
</h:commandLink>
|
||||
</div>
|
||||
|
||||
54
bank-war/web/admin_tarjeta_debito_delete_compra.xhtml
Normal file
54
bank-war/web/admin_tarjeta_debito_delete_compra.xhtml
Normal file
@@ -0,0 +1,54 @@
|
||||
<?xml version='1.0' encoding='UTF-8' ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3c.org/1999/xhtml"
|
||||
xmlns:h="http://xmlns.jcp.org/jsf/html"
|
||||
xmlns:f="http://java.sun.com/jsf/core">
|
||||
<h:head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<link rel="stylesheet" href="https://unpkg.com/tachyons@4.10.0/css/tachyons.min.css"/>
|
||||
<link rel="stylesheet" href="https://unpkg.com/normalize.css@8.0.1/normalize.css"/>
|
||||
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"/>
|
||||
<h:outputStylesheet library="css" name="all.css"/>
|
||||
<style>
|
||||
body {
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
}
|
||||
</style>
|
||||
</h:head>
|
||||
<body class="black-70 pa4">
|
||||
<h:form rendered="#{userBean.isLogged() and userBean.isAdmin()}">
|
||||
<div class="flex justify-between">
|
||||
<h1 class="f1">Eliminar Compra</h1>
|
||||
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-blue" immediate="true" action="admin_tarjeta_debito_view" style="margin-top: auto; margin-bottom: auto">
|
||||
<li class="fas fa-arrow-left"></li> Volver
|
||||
</h:commandLink>
|
||||
</div>
|
||||
|
||||
<h:messages class="f4 w-40 list tc center white bg-red pa4 "/>
|
||||
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="monto" value="Monto:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="monto" value="#{compraBean.compraTarjetaDebito.monto}" readonly="true" label="Monto"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="comentario" value="Comentario:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="comentario" value="#{compraBean.compraTarjetaDebito.comentario}" readonly="true" label="Comentario"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" action="#{compraBean.deleteCompraTarjetaDebito()}" style="margin-top: auto; margin-bottom: auto">
|
||||
<li class="fas fa-trash"></li> Eliminar
|
||||
</h:commandLink>
|
||||
</div>
|
||||
</h:form>
|
||||
|
||||
<h:form rendered="#{!userBean.isLogged()}">
|
||||
<div class="tc">
|
||||
<h1 class="f1 tc">Acceso no autorizado</h1>
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" value="Ir al index" action="index"/>
|
||||
</div>
|
||||
</h:form>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
58
bank-war/web/admin_tarjeta_debito_delete_deposito.xhtml
Normal file
58
bank-war/web/admin_tarjeta_debito_delete_deposito.xhtml
Normal file
@@ -0,0 +1,58 @@
|
||||
<?xml version='1.0' encoding='UTF-8' ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3c.org/1999/xhtml"
|
||||
xmlns:h="http://xmlns.jcp.org/jsf/html"
|
||||
xmlns:f="http://java.sun.com/jsf/core">
|
||||
<h:head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<link rel="stylesheet" href="https://unpkg.com/tachyons@4.10.0/css/tachyons.min.css"/>
|
||||
<link rel="stylesheet" href="https://unpkg.com/normalize.css@8.0.1/normalize.css"/>
|
||||
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"/>
|
||||
<h:outputStylesheet library="css" name="all.css"/>
|
||||
<style>
|
||||
body {
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
}
|
||||
</style>
|
||||
</h:head>
|
||||
<body class="black-70 pa4">
|
||||
<h:form rendered="#{userBean.isLogged() and userBean.isAdmin()}">
|
||||
<div class="flex justify-between">
|
||||
<h1 class="f1">Eliminar Deposito</h1>
|
||||
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-blue" immediate="true" action="admin_tarjeta_debito_view" style="margin-top: auto; margin-bottom: auto">
|
||||
<li class="fas fa-arrow-left"></li> Volver
|
||||
</h:commandLink>
|
||||
</div>
|
||||
|
||||
<h:messages class="f4 w-40 list tc center white bg-red pa4 "/>
|
||||
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="monto" value="Monto:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="monto" value="#{depositoBean.depositoTarjetaDebito.monto}" readonly="true" label="Monto"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="comentario" value="Comentario:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="comentario" value="#{depositoBean.depositoTarjetaDebito.comentario}" readonly="true" label="Comentario"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="metodo" value="Metodo:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="metodo" value="#{depositoBean.depositoTarjetaDebito.metodo.nombre}" readonly="true" label="Metodo"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" action="#{depositoBean.deleteDepositoTarjetaDebito()}" style="margin-top: auto; margin-bottom: auto">
|
||||
<li class="fas fa-trash"></li> Eliminar
|
||||
</h:commandLink>
|
||||
</div>
|
||||
</h:form>
|
||||
|
||||
<h:form rendered="#{!userBean.isLogged()}">
|
||||
<div class="tc">
|
||||
<h1 class="f1 tc">Acceso no autorizado</h1>
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" value="Ir al index" action="index"/>
|
||||
</div>
|
||||
</h:form>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
58
bank-war/web/admin_tarjeta_debito_delete_giro.xhtml
Normal file
58
bank-war/web/admin_tarjeta_debito_delete_giro.xhtml
Normal file
@@ -0,0 +1,58 @@
|
||||
<?xml version='1.0' encoding='UTF-8' ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3c.org/1999/xhtml"
|
||||
xmlns:h="http://xmlns.jcp.org/jsf/html"
|
||||
xmlns:f="http://java.sun.com/jsf/core">
|
||||
<h:head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<link rel="stylesheet" href="https://unpkg.com/tachyons@4.10.0/css/tachyons.min.css"/>
|
||||
<link rel="stylesheet" href="https://unpkg.com/normalize.css@8.0.1/normalize.css"/>
|
||||
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"/>
|
||||
<h:outputStylesheet library="css" name="all.css"/>
|
||||
<style>
|
||||
body {
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
}
|
||||
</style>
|
||||
</h:head>
|
||||
<body class="black-70 pa4">
|
||||
<h:form rendered="#{userBean.isLogged() and userBean.isAdmin()}">
|
||||
<div class="flex justify-between">
|
||||
<h1 class="f1">Eliminar Giro</h1>
|
||||
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-blue" immediate="true" action="admin_tarjeta_debito_view" style="margin-top: auto; margin-bottom: auto">
|
||||
<li class="fas fa-arrow-left"></li> Volver
|
||||
</h:commandLink>
|
||||
</div>
|
||||
|
||||
<h:messages class="f4 w-40 list tc center white bg-red pa4 "/>
|
||||
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="monto" value="Monto:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="monto" value="#{giroBean.giroTarjetaDebito.monto}" readonly="true" label="Monto"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="comentario" value="Comentario:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="comentario" value="#{giroBean.giroTarjetaDebito.comentario}" readonly="true" label="Comentario"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="metodo" value="Metodo:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="metodo" value="#{giroBean.giroTarjetaDebito.metodo.nombre}" readonly="true" label="Metodo"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" action="#{giroBean.deleteGiroEnTarjetaDebito()}" style="margin-top: auto; margin-bottom: auto">
|
||||
<li class="fas fa-trash"></li> Eliminar
|
||||
</h:commandLink>
|
||||
</div>
|
||||
</h:form>
|
||||
|
||||
<h:form rendered="#{!userBean.isLogged()}">
|
||||
<div class="tc">
|
||||
<h1 class="f1 tc">Acceso no autorizado</h1>
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" value="Ir al index" action="index"/>
|
||||
</div>
|
||||
</h:form>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
62
bank-war/web/admin_tarjeta_debito_delete_transferencia.xhtml
Normal file
62
bank-war/web/admin_tarjeta_debito_delete_transferencia.xhtml
Normal file
@@ -0,0 +1,62 @@
|
||||
<?xml version='1.0' encoding='UTF-8' ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3c.org/1999/xhtml"
|
||||
xmlns:h="http://xmlns.jcp.org/jsf/html"
|
||||
xmlns:f="http://java.sun.com/jsf/core">
|
||||
<h:head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<link rel="stylesheet" href="https://unpkg.com/tachyons@4.10.0/css/tachyons.min.css"/>
|
||||
<link rel="stylesheet" href="https://unpkg.com/normalize.css@8.0.1/normalize.css"/>
|
||||
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"/>
|
||||
<h:outputStylesheet library="css" name="all.css"/>
|
||||
<style>
|
||||
body {
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
}
|
||||
</style>
|
||||
</h:head>
|
||||
<body class="black-70 pa4">
|
||||
<h:form rendered="#{userBean.isLogged() and userBean.isAdmin()}">
|
||||
<div class="flex justify-between">
|
||||
<h1 class="f1">Eliminar Transferencia</h1>
|
||||
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-blue" immediate="true" action="admin_tarjeta_debito_view" style="margin-top: auto; margin-bottom: auto">
|
||||
<li class="fas fa-arrow-left"></li> Volver
|
||||
</h:commandLink>
|
||||
</div>
|
||||
|
||||
<h:messages class="f4 w-40 list tc center white bg-red pa4 "/>
|
||||
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="monto" value="Monto:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="monto" value="#{transferenciaBean.transferenciaTarjetaDebito.monto}" readonly="true" label="Monto"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="comentario" value="Comentario:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="comentario" value="#{transferenciaBean.transferenciaTarjetaDebito.comentario}" readonly="true" label="Comentario"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="emisor" value="Cuenta Emisor:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="emisor" value="#{transferenciaBean.transferenciaTarjetaDebito.tarjetaDebitoFrom.id}" readonly="true" label="Cuenta Emisor"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="destinatario" value="Cuenta Destinatario:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="destinatario" value="#{transferenciaBean.transferenciaTarjetaDebito.tarjetaDebitoTo.id}" readonly="true" label="Cuenta Destinatario"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" action="#{transferenciaBean.eliminarTransferenciaEnTarjetaDebito()}" style="margin-top: auto; margin-bottom: auto">
|
||||
<li class="fas fa-trash"></li> Eliminar
|
||||
</h:commandLink>
|
||||
</div>
|
||||
</h:form>
|
||||
|
||||
<h:form rendered="#{!userBean.isLogged()}">
|
||||
<div class="tc">
|
||||
<h1 class="f1 tc">Acceso no autorizado</h1>
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" value="Ir al index" action="index"/>
|
||||
</div>
|
||||
</h:form>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
196
bank-war/web/admin_tarjeta_debito_view.xhtml
Normal file
196
bank-war/web/admin_tarjeta_debito_view.xhtml
Normal file
@@ -0,0 +1,196 @@
|
||||
<?xml version='1.0' encoding='UTF-8' ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3c.org/1999/xhtml"
|
||||
xmlns:h="http://xmlns.jcp.org/jsf/html"
|
||||
xmlns:f="http://java.sun.com/jsf/core">
|
||||
<h:head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<link rel="stylesheet" href="https://unpkg.com/tachyons@4.10.0/css/tachyons.min.css"/>
|
||||
<link rel="stylesheet" href="https://unpkg.com/normalize.css@8.0.1/normalize.css"/>
|
||||
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"/>
|
||||
<h:outputStylesheet library="css" name="all.css"/>
|
||||
<style>
|
||||
body {
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
}
|
||||
</style>
|
||||
</h:head>
|
||||
<body class="black-70 pa4">
|
||||
<h:form rendered="#{userBean.isLogged() and userBean.isAdmin()}">
|
||||
<div class="flex justify-between">
|
||||
<h1 class="f1">Tarjeta Debito</h1>
|
||||
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-blue" immediate="true" action="admin_cliente_view" style="margin-top: auto; margin-bottom: auto">
|
||||
<li class="fas fa-arrow-left"></li> Volver
|
||||
</h:commandLink>
|
||||
</div>
|
||||
|
||||
<div class="mv4 ph2 fl w-33">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="id" value="Id:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100" id="id" value="#{tarjetaDebitoBean.tarjetaDebito.id}" readonly="true" label="Id:"/>
|
||||
</div>
|
||||
<div class="mv4 ph2 fl w-33">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="saldo" value="Saldo:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100" id="saldo" value="#{tarjetaDebitoBean.tarjetaDebito.saldo}" readonly="true" label="Saldo:"/>
|
||||
</div>
|
||||
<div class="mv4 ph2 fl w-33">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="fecha_creacion" value="Fecha Creacion:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100" id="fecha_creacion" value="#{tarjetaDebitoBean.tarjetaDebito.insertedAt}" readonly="true" label="Fecha Creacion:"/>
|
||||
</div>
|
||||
|
||||
<h1 class="f2 ">Depositos</h1>
|
||||
<h:dataTable class="w-100 pv3" headerClass="fw6 bb b--black-20 tl pb2 pr3 bg-white" value="#{tarjetaDebitoBean.tarjetaDebito.depositoList}" var="deposito">
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Fecha"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{deposito.insertedAt}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Comentario"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{deposito.comentario}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Monto"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{deposito.monto}"/>
|
||||
</h:column>
|
||||
<h:column class="tr">
|
||||
<h:commandLink class="f6 link dim br2 ph3 pv2 mr2 dib white bg-red tc" action="#{tarjetaDebitoBean.gotoDeleteDeposito(deposito)}">
|
||||
<li class="fas fa-trash"></li>
|
||||
</h:commandLink>
|
||||
</h:column>
|
||||
</h:dataTable>
|
||||
|
||||
<h1 class="f2">Giros</h1>
|
||||
<h:dataTable class="w-100 pv3" headerClass="fw6 bb b--black-20 tl pb2 pr3 bg-white" value="#{tarjetaDebitoBean.tarjetaDebito.giroList}" var="giro">
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Fecha"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{giro.insertedAt}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Comentario"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{giro.comentario}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Monto"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{giro.monto}"/>
|
||||
</h:column>
|
||||
<h:column class="tr">
|
||||
<h:commandLink class="f6 link dim br2 ph3 pv2 mr2 dib white bg-red tc" action="#{tarjetaDebitoBean.gotoDeleteGiro(giro)}">
|
||||
<li class="fas fa-trash"></li>
|
||||
</h:commandLink>
|
||||
</h:column>
|
||||
</h:dataTable>
|
||||
|
||||
<h1 class="f2">Transferencias Hechas</h1>
|
||||
<h:dataTable class="w-100 pv3" headerClass="fw6 bb b--black-20 tl pb2 pr3 bg-white" value="#{tarjetaDebitoBean.tarjetaDebito.transferenciaFromList}" var="transferencia">
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Fecha"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{transferencia.insertedAt}"/>
|
||||
</h:column><h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Destinatario"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{transferencia.tarjetaDebitoTo.id}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Comentario"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{transferencia.comentario}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Monto"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{transferencia.monto}"/>
|
||||
</h:column>
|
||||
<h:column class="tr">
|
||||
<h:commandLink class="f6 link dim br2 ph3 pv2 mr2 dib white bg-red tc" action="#{tarjetaDebitoBean.gotoDeleteTransferencia(transferencia)}">
|
||||
<li class="fas fa-trash"></li>
|
||||
</h:commandLink>
|
||||
</h:column>
|
||||
</h:dataTable>
|
||||
|
||||
<h1 class="f2">Transferencias Recibidas</h1>
|
||||
<h:dataTable class="w-100 pv3" headerClass="fw6 bb b--black-20 tl pb2 pr3 bg-white" value="#{tarjetaDebitoBean.tarjetaDebito.transferenciaToList}" var="transferencia">
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Fecha"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{transferencia.insertedAt}"/>
|
||||
</h:column><h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Emisor"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{transferencia.tarjetaDebitoFrom.id}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Comentario"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{transferencia.comentario}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Monto"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{transferencia.monto}"/>
|
||||
</h:column>
|
||||
<h:column class="tr">
|
||||
<h:commandLink class="f6 link dim br2 ph3 pv2 mr2 dib white bg-red tc" action="#{tarjetaDebitoBean.gotoDeleteTransferencia(transferencia)}">
|
||||
<li class="fas fa-trash"></li>
|
||||
</h:commandLink>
|
||||
</h:column>
|
||||
</h:dataTable>
|
||||
<hr/>
|
||||
<h1 class="f2">Compras</h1>
|
||||
<h:dataTable class="w-100 pv3" headerClass="fw6 bb b--black-20 tl pb2 pr3 bg-white" value="#{tarjetaDebitoBean.tarjetaDebito.compraList}" var="compra">
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Fecha"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{compra.insertedAt}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Comentario"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{compra.comentario}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Monto"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{compra.monto}"/>
|
||||
</h:column>
|
||||
<h:column class="tr">
|
||||
<h:commandLink class="f6 link dim br2 ph3 pv2 mr2 dib white bg-red tc" action="#{tarjetaDebitoBean.gotoDeleteCompra(compra)}">
|
||||
<li class="fas fa-trash"></li>
|
||||
</h:commandLink>
|
||||
</h:column>
|
||||
</h:dataTable>
|
||||
</h:form>
|
||||
|
||||
<h:form rendered="#{!userBean.isLogged()}">
|
||||
<div class="tc">
|
||||
<h1 class="f1 tc">Acceso no autorizado</h1>
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" value="Ir al index" action="index"/>
|
||||
</div>
|
||||
</h:form>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<div class="flex justify-between">
|
||||
<h1 class="f1">Cuenta Corriente - Depositar</h1>
|
||||
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" immediate="true" action="cliente_main" style="margin-top: auto; margin-bottom: auto">
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" immediate="true" action="cliente_cuenta_corriente_view" style="margin-top: auto; margin-bottom: auto">
|
||||
<li class="fas fa-arrow-left"></li> Volver
|
||||
</h:commandLink>
|
||||
</div>
|
||||
|
||||
@@ -17,50 +17,50 @@
|
||||
</h:head>
|
||||
<body class="black-70 pa4">
|
||||
<h:form rendered="#{userBean.isLogged() and userBean.isClient()}">
|
||||
<div class="flex justify-between">
|
||||
<h1 class="f1">Cuenta Corriente</h1>
|
||||
<h1 class="f1 tc">Cuenta Corriente</h1>
|
||||
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-blue" immediate="true" action="cliente_main" style="margin-top: auto; margin-bottom: auto">
|
||||
<div class="mv3 cf">
|
||||
<h:commandLink class="f5 fl tc link dim br2 ph3 pv2 mb2 dib white bg-blue" immediate="true" action="cliente_main" style="width: 200px">
|
||||
<li class="fas fa-arrow-left"></li> Volver
|
||||
</h:commandLink>
|
||||
<h:commandLink class="f5 fr tc link dim br2 ph3 pv2 mb2 dib white bg-red" immediate="true" action="#{userBean.logout()}" style="width: 200px">
|
||||
<li class="fas fa-sign-out-alt"></li> Cerrar sesion
|
||||
</h:commandLink>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db lh-copy f6" for="id" value="Id:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="id" value="#{cuentaCorrienteBean.cuentaCorriente.id}" readonly="true" label="Id:"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db lh-copy f6" for="saldo" value="Saldo:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="saldo" value="#{cuentaCorrienteBean.cuentaCorriente.saldo}" readonly="true" label="Saldo:"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db lh-copy f6" for="fecha_creacion" value="Fecha Creacion:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="fecha_creacion" value="#{cuentaCorrienteBean.cuentaCorriente.insertedAt}" readonly="true" label="Fecha Creacion:"/>
|
||||
</div>
|
||||
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="id" value="Id:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-60" id="id" value="#{cuentaCorrienteBean.cuentaCorriente.id}" readonly="true" label="Id:"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="saldo" value="Saldo:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-60" id="saldo" value="#{cuentaCorrienteBean.cuentaCorriente.saldo}" readonly="true" label="Saldo:"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="fecha_creacion" value="Fecha Creacion:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-60" id="fecha_creacion" value="#{cuentaCorrienteBean.cuentaCorriente.insertedAt}" readonly="true" label="Fecha Creacion:">
|
||||
<f:convertDateTime pattern="dd/MM/yyyy"/>
|
||||
</h:inputText>
|
||||
</div>
|
||||
|
||||
<div class="flex mt3 justify-center">
|
||||
<h:commandLink class="f5 tc link dim br2 ph3 pv2 w-20 dib white bg-green" action="#{cuentaCorrienteBean.gotoDepositar()}">
|
||||
<h:commandLink class="f6 link dim br2 ph3 pv2 ma2 dib white bg-green tc" action="#{cuentaCorrienteBean.gotoDepositar()}" style="width: 200px">
|
||||
<li class="fas fa-piggy-bank"></li> Depositar
|
||||
</h:commandLink>
|
||||
<h:commandLink class="f5 tc link dim br2 ph3 pv2 ml2 w-20 dib white bg-red" action="#{cuentaCorrienteBean.gotoGirar()}">
|
||||
<h:commandLink class="f6 link dim br2 ph3 pv2 ma2 dib white bg-gold tc" action="#{cuentaCorrienteBean.gotoGirar()}" style="width: 200px">
|
||||
<li class="fas fa-hand-holding-usd"></li> Girar
|
||||
</h:commandLink>
|
||||
<h:commandLink class="f5 tc link dim br2 ph3 pv2 ml2 dib w-20 white bg-blue" action="#{cuentaCorrienteBean.gotoTransferir()}">
|
||||
<h:commandLink class="f6 link dim br2 ph3 pv2 ma2 dib white bg-blue tc" action="#{cuentaCorrienteBean.gotoTransferir()}" style="width: 200px">
|
||||
<li class="fas fa-comments-dollar"></li> Transferir
|
||||
</h:commandLink>
|
||||
</div>
|
||||
|
||||
<h1 class="f1">Depositos</h1>
|
||||
<h1 class="f3">Depositos</h1>
|
||||
<h:dataTable class="w-100 pv3" headerClass="fw6 bb b--black-20 tl pb2 pr3 bg-white" value="#{cuentaCorrienteBean.cuentaCorriente.depositoList}" var="deposito">
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Fecha"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{deposito.insertedAt}">
|
||||
<f:convertDateTime pattern="dd/MM/yyyy HH:mm"/>
|
||||
</h:outputLabel>
|
||||
<h:outputLabel value="#{deposito.insertedAt}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
@@ -68,6 +68,12 @@
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{deposito.comentario}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Metodo"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{deposito.metodo.nombre}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Monto"/>
|
||||
@@ -75,16 +81,15 @@
|
||||
<h:outputLabel value="#{deposito.monto}"/>
|
||||
</h:column>
|
||||
</h:dataTable>
|
||||
<hr/>
|
||||
|
||||
<h1 class="f1">Giros</h1>
|
||||
<h1 class="f3">Giros</h1>
|
||||
<h:dataTable class="w-100 pv3" headerClass="fw6 bb b--black-20 tl pb2 pr3 bg-white" value="#{cuentaCorrienteBean.cuentaCorriente.giroList}" var="giro">
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Fecha"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{giro.insertedAt}">
|
||||
<f:convertDateTime pattern="dd/MM/yyyy HH:mm"/>
|
||||
</h:outputLabel>
|
||||
<h:outputLabel value="#{giro.insertedAt}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
@@ -92,6 +97,12 @@
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{giro.comentario}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Metodo"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{giro.metodo.nombre}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Monto"/>
|
||||
@@ -99,16 +110,15 @@
|
||||
<h:outputLabel value="#{giro.monto}"/>
|
||||
</h:column>
|
||||
</h:dataTable>
|
||||
<hr/>
|
||||
|
||||
<h1 class="f1">Transferencias Hechas</h1>
|
||||
<h1 class="f3">Transferencias Hechas</h1>
|
||||
<h:dataTable class="w-100 pv3" headerClass="fw6 bb b--black-20 tl pb2 pr3 bg-white" value="#{cuentaCorrienteBean.cuentaCorriente.transferenciaFromList}" var="transferencia">
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Fecha"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{transferencia.insertedAt}">
|
||||
<f:convertDateTime pattern="dd/MM/yyyy HH:mm"/>
|
||||
</h:outputLabel>
|
||||
<h:outputLabel value="#{transferencia.insertedAt}"/>
|
||||
</h:column><h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Destinatario"/>
|
||||
@@ -128,17 +138,17 @@
|
||||
<h:outputLabel value="#{transferencia.monto}"/>
|
||||
</h:column>
|
||||
</h:dataTable>
|
||||
<hr/>
|
||||
|
||||
<h1 class="f1">Transferencias Recibidas</h1>
|
||||
<h1 class="f3">Transferencias Recibidas</h1>
|
||||
<h:dataTable class="w-100 pv3" headerClass="fw6 bb b--black-20 tl pb2 pr3 bg-white" value="#{cuentaCorrienteBean.cuentaCorriente.transferenciaToList}" var="transferencia">
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Fecha"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{transferencia.insertedAt}">
|
||||
<f:convertDateTime pattern="dd/MM/yyyy HH:mm"/>
|
||||
</h:outputLabel>
|
||||
</h:column><h:column>
|
||||
<h:outputLabel value="#{transferencia.insertedAt}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Emisor"/>
|
||||
</f:facet>
|
||||
|
||||
@@ -17,139 +17,127 @@
|
||||
</h:head>
|
||||
<body class="black-70 pa4">
|
||||
<h:form rendered="#{userBean.isLogged() and userBean.isClient()}">
|
||||
<h1 class="f1 tc">¡Bienvenido #{clienteBean.cliente.nombre}!</h1>
|
||||
|
||||
<div class="flex justify-between">
|
||||
<h1 class="f1 w-100 dib">¡Bienvenido #{clienteBean.cliente.nombre}!</h1>
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" immediate="true" action="#{userBean.logout()}" style="margin-top: auto; margin-bottom: auto">
|
||||
<div class="mv3 cf">
|
||||
<h:commandLink class="f5 fr tc link dim br2 ph3 pv2 mb2 dib white bg-red" immediate="true" action="#{userBean.logout()}" style="width: 200px">
|
||||
<li class="fas fa-sign-out-alt"></li> Cerrar sesion
|
||||
</h:commandLink>
|
||||
</div>
|
||||
|
||||
<h2 class="f2">Productos</h2>
|
||||
<h2 class="f2 tc">Productos</h2>
|
||||
|
||||
<!--
|
||||
////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////Cuentas Corrientes///////////////////////
|
||||
///////////////////////////Cuenta Corriente///////////////////////
|
||||
////////////////////////////////////////////////////////////////////
|
||||
-->
|
||||
<h3 class="f3">Cuentas Corrientes</h3>
|
||||
-->
|
||||
<h:panelGroup layout="block" class="mv3 w-100" rendered="#{clienteBean.cliente.cuentaCorriente != null}">
|
||||
<h3 class="f3 tc">Cuenta Corriente</h3>
|
||||
|
||||
<h:dataTable class="w-100 pv3" headerClass="fw6 bb b--black-20 tl pb2 pr3" value="#{clienteBean.cliente.cuentaCorrienteList}" var="cuentaCorriente">
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Id"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{cuentaCorriente.id}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Saldo"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{cuentaCorriente.saldo}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Fecha creacion"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{cuentaCorriente.insertedAt}">
|
||||
<f:convertDateTime pattern="dd/MM/yyyy HH:mm"/>
|
||||
</h:outputLabel>
|
||||
</h:column>
|
||||
<h:column class="tr">
|
||||
<h:commandLink class="f6 link dim br2 ph3 pv2 mb2 dib white bg-green tc" action="#{clienteBean.gotoViewCuentaCorriente(cuentaCorriente)}">
|
||||
<li class="fas fa-eye"></li>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db lh-copy f6" value="Id:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" value="#{clienteBean.cliente.cuentaCorriente.id}" readonly="true"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db lh-copy f6" value="Saldo:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" value="#{clienteBean.cliente.cuentaCorriente.saldo}" readonly="true"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db lh-copy f6" value="Fecha Creacion:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" value="#{clienteBean.cliente.cuentaCorriente.insertedAt}" readonly="true"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:commandLink class="f6 link dim br2 ph3 pv2 mb2 dib white bg-green tc" action="#{clienteBean.gotoViewCuentaCorriente()}" style="width: 200px">
|
||||
<li class="fas fa-eye"></li> Ver
|
||||
</h:commandLink>
|
||||
</h:column>
|
||||
</h:dataTable>
|
||||
|
||||
</div>
|
||||
</h:panelGroup>
|
||||
|
||||
<h:panelGroup layout="block" rendered="#{clienteBean.cliente.cuentaCorriente == null}">
|
||||
<h3 class="f3 tc">Cuenta Corriente</h3>
|
||||
<p class="f6 tc">Sin contratar</p>
|
||||
</h:panelGroup>
|
||||
|
||||
<hr/>
|
||||
<!--
|
||||
////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////Tarjetas de Debito///////////////////////
|
||||
////////////////////////////////////////////////////////////////////
|
||||
-->
|
||||
<h3 class="f3">Tarjetas de Debito</h3>
|
||||
|
||||
<h:dataTable class="w-100 pv3" headerClass="fw6 bb b--black-20 tl pb2 pr3" value="#{clienteBean.cliente.tarjetaDebitoList}" var="tarjetaDebito">
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Id"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{tarjetaDebito.id}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Saldo"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{tarjetaDebito.saldo}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Fecha creacion"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{tarjetaDebito.insertedAt}">
|
||||
<f:convertDateTime pattern="dd/MM/yyyy HH:mm"/>
|
||||
</h:outputLabel>
|
||||
</h:column>
|
||||
<h:column class="tr">
|
||||
<h:commandLink class="f6 link dim br2 ph3 pv2 mb2 dib white bg-green tc" action="#{clienteBean.gotoViewTarjetaDebito(tarjetaDebito)}">
|
||||
<li class="fas fa-eye"></li>
|
||||
<h:panelGroup layout="block" class="mv3 w-100" rendered="#{clienteBean.cliente.tarjetaDebito != null}">
|
||||
<h3 class="f3 tc">Tarjeta Debito</h3>
|
||||
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db lh-copy f6" value="Id:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" value="#{clienteBean.cliente.tarjetaDebito.id}" readonly="true"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" value="Saldo:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" value="#{clienteBean.cliente.tarjetaDebito.saldo}" readonly="true"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" value="Fecha Creacion:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" value="#{clienteBean.cliente.tarjetaDebito.insertedAt}" readonly="true"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-green" action="#{clienteBean.gotoViewTarjetaDebito()}" style="width: 200px">
|
||||
<li class="fas fa-eye"></li> Ver
|
||||
</h:commandLink>
|
||||
</h:column>
|
||||
</h:dataTable>
|
||||
</div>
|
||||
</h:panelGroup>
|
||||
|
||||
<h:panelGroup layout="block" rendered="#{clienteBean.cliente.tarjetaDebito == null}">
|
||||
<h3 class="f3 tc">Tarjeta Debito</h3>
|
||||
<p class="f6 tc">Sin contratar</p>
|
||||
</h:panelGroup>
|
||||
|
||||
<hr/>
|
||||
|
||||
<!--
|
||||
////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////Tarjetas de Credito//////////////////////
|
||||
////////////////////////////////////////////////////////////////////
|
||||
-->
|
||||
<h3 class="f3">Tarjetas de Credito</h3>
|
||||
|
||||
<h:panelGroup layout="block" class="mv3 w-100" rendered="#{clienteBean.cliente.tarjetaCredito != null}">
|
||||
<h3 class="f3 tc">Tarjeta Credito</h3>
|
||||
|
||||
<h:dataTable class="w-100 pv3" headerClass="fw6 bb b--black-20 tl pb2 pr3" value="#{clienteBean.cliente.tarjetaCreditoList}" var="tarjetaCredito">
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Id"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{tarjetaCredito.id}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Limite Nacional"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{tarjetaCredito.limiteNacional}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Deuda Nacional"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{tarjetaCredito.deudaNacional}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Limite Internacional"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{tarjetaCredito.limiteInternacional}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Deuda Internacional"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{tarjetaCredito.deudaInternacional}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Fecha creacion"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{tarjetaCredito.insertedAt}">
|
||||
<f:convertDateTime pattern="dd/MM/yyyy HH:mm"/>
|
||||
</h:outputLabel>
|
||||
</h:column>
|
||||
<h:column class="tr">
|
||||
<h:commandLink class="f6 link dim br2 ph3 pv2 mb2 dib white bg-green tc" action="#{clienteBean.gotoViewTarjetaCredito(tarjetaCredito)}">
|
||||
<li class="fas fa-eye"></li>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db lh-copy f6" value="Id:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" value="#{clienteBean.cliente.tarjetaCredito.id}" readonly="true"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db lh-copy f6" value="Limite Nacional:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" value="#{clienteBean.cliente.tarjetaCredito.limiteNacional}" readonly="true"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db lh-copy f6" value="Deuda Nacional:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" value="#{clienteBean.cliente.tarjetaCredito.deudaNacional}" readonly="true"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db lh-copy f6" value="Limite Internacional:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" value="#{clienteBean.cliente.tarjetaCredito.limiteInternacional}" readonly="true"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db lh-copy f6" value="Deuda Internacional:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" value="#{clienteBean.cliente.tarjetaCredito.deudaInternacional}" readonly="true"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db lh-copy f6" value="Fecha Creacion:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" value="#{clienteBean.cliente.tarjetaCredito.insertedAt}" readonly="true"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-green" action="#{clienteBean.gotoViewTarjetaCredito()}" style="width: 200px">
|
||||
<li class="fas fa-eye"></li> Ver
|
||||
</h:commandLink>
|
||||
</h:column>
|
||||
</h:dataTable>
|
||||
</div>
|
||||
</h:panelGroup>
|
||||
|
||||
<h:panelGroup layout="block" rendered="#{clienteBean.cliente.tarjetaCredito == null}">
|
||||
<h3 class="f3 tc">Tarjeta Credito</h3>
|
||||
<p class="f6 tc">Sin contratar</p>
|
||||
</h:panelGroup>
|
||||
</h:form>
|
||||
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="tipo" value="Tipo:"/>
|
||||
<h:selectOneMenu class="pa2 ba b--black-20 bg-transparent w-100 measure" id="tipo" value="#{compraBean.clase}" required="true" label="Tipo">
|
||||
<h:selectOneMenu class="pa2 ba b--black-20 bg-transparent w-100 measure" id="tipo" value="#{compraBean.tipo}" required="true" label="Tipo">
|
||||
<f:selectItem itemValue="Nacional"/>
|
||||
<f:selectItem itemValue="Internacional"/>
|
||||
</h:selectOneMenu>
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="tipo" value="Tipo:"/>
|
||||
<h:selectOneMenu class="pa2 ba b--black-20 bg-transparent w-100 measure" id="tipo" value="#{pagoBean.clase}" required="true" label="Tipo">
|
||||
<h:selectOneMenu class="pa2 ba b--black-20 bg-transparent w-100 measure" id="tipo" value="#{pagoBean.tipo}" required="true" label="Tipo">
|
||||
<f:selectItem itemValue="Nacional"/>
|
||||
<f:selectItem itemValue="Internacional"/>
|
||||
</h:selectOneMenu>
|
||||
|
||||
@@ -17,59 +17,57 @@
|
||||
</h:head>
|
||||
<body class="black-70 pa4">
|
||||
<h:form rendered="#{userBean.isLogged() and userBean.isClient()}">
|
||||
<div class="flex justify-between">
|
||||
<h1 class="f1">Tarjeta Credito</h1>
|
||||
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-blue" immediate="true" action="cliente_main" style="margin-top: auto; margin-bottom: auto">
|
||||
<h1 class="f1 tc">Tarjeta Credito</h1>
|
||||
<div class="mv3 cf">
|
||||
<h:commandLink class="f5 fl tc link dim br2 ph3 pv2 mb2 dib white bg-blue" immediate="true" action="cliente_main" style="width: 200px">
|
||||
<li class="fas fa-arrow-left"></li> Volver
|
||||
</h:commandLink>
|
||||
<h:commandLink class="f5 fr tc link dim br2 ph3 pv2 mb2 dib white bg-red" immediate="true" action="#{userBean.logout()}" style="width: 200px">
|
||||
<li class="fas fa-sign-out-alt"></li> Cerrar sesion
|
||||
</h:commandLink>
|
||||
</div>
|
||||
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="id" value="Id:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-60" id="id" value="#{tarjetaCreditoBean.tarjetaCredito.id}" readonly="true" label="Id:"/>
|
||||
<h:outputLabel class="db lh-copy f6" value="Id:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="id" value="#{tarjetaCreditoBean.tarjetaCredito.id}" readonly="true"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="limite_nacional" value="Limite Nacional: "/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-60" id="limite_nacional" value="#{tarjetaCreditoBean.tarjetaCredito.limiteNacional}" readonly="true" label="Limite Nacional:"/>
|
||||
<h:outputLabel class="db lh-copy f6" value="Limite Nacional: "/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="limite_nacional" value="#{tarjetaCreditoBean.tarjetaCredito.limiteNacional}" readonly="true"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="deuda_nacional" value="Deuda Nacional: "/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-60" id="deuda_nacional" value="#{tarjetaCreditoBean.tarjetaCredito.deudaNacional}" readonly="true" label="Deuda Nacional"/>
|
||||
<h:outputLabel class="db lh-copy f6" value="Deuda Nacional: "/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="deuda_nacional" value="#{tarjetaCreditoBean.tarjetaCredito.deudaNacional}" readonly="true"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="limite_internacional" value="Limite Internacional: "/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-60" id="limite_internacional" value="#{tarjetaCreditoBean.tarjetaCredito.limiteInternacional}" readonly="true" label="Limite Internacional: "/>
|
||||
<h:outputLabel class="db lh-copy f6" value="Limite Internacional: "/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="limite_internacional" value="#{tarjetaCreditoBean.tarjetaCredito.limiteInternacional}" readonly="true"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="deuda_internacional" value="Deuda Internacional"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-60" id="deuda_internacional" value="#{tarjetaCreditoBean.tarjetaCredito.deudaInternacional}" readonly="true" label="Deuda Internacional: "/>
|
||||
<h:outputLabel class="db lh-copy f6" value="Deuda Internacional"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="deuda_internacional" value="#{tarjetaCreditoBean.tarjetaCredito.deudaInternacional}" readonly="true"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="fecha_creacion" value="Fecha Creacion:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-60" id="fecha_creacion" value="#{tarjetaCreditoBean.tarjetaCredito.insertedAt}" readonly="true" label="Fecha Creacion:">
|
||||
<f:convertDateTime pattern="dd/MM/yyyy"/>
|
||||
</h:inputText>
|
||||
<h:outputLabel class="db lh-copy f6" value="Fecha Creacion:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="fecha_creacion" value="#{tarjetaCreditoBean.tarjetaCredito.insertedAt}" readonly="true"/>
|
||||
</div>
|
||||
|
||||
<div class="flex mt3 justify-center">
|
||||
<h:commandLink class="f5 tc link dim br2 ph3 pv2 w-30 dib white bg-green" action="#{tarjetaCreditoBean.gotoComprar()}">
|
||||
<div class="mt3 tc">
|
||||
<h:commandLink class="f5 tc link dim br2 ph3 pv2 ma2 dib white bg-green" action="#{tarjetaCreditoBean.gotoComprar()}" style="width: 200px">
|
||||
<li class="fas fa-shopping-basket"></li> Comprar
|
||||
</h:commandLink>
|
||||
<h:commandLink class="f5 tc link dim br2 ph3 pv2 ml2 w-30 dib white bg-red" action="#{tarjetaCreditoBean.gotoPagar()}">
|
||||
<h:commandLink class="f5 tc link dim br2 ph3 pv2 ma2 dib white bg-gold" action="#{tarjetaCreditoBean.gotoPagar()}" style="width: 200px">
|
||||
<li class="fas fa-money-bill"></li> Pagar
|
||||
</h:commandLink>
|
||||
</div>
|
||||
|
||||
<h1 class="f1">Compras</h1>
|
||||
<h1 class="f3">Compras</h1>
|
||||
<h:dataTable class="w-100 pv3" headerClass="fw6 bb b--black-20 tl pb2 pr3 bg-white" value="#{tarjetaCreditoBean.tarjetaCredito.compraList}" var="compra">
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Fecha"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{compra.insertedAt}">
|
||||
<f:convertDateTime pattern="dd/MM/yyyy HH:mm"/>
|
||||
</h:outputLabel>
|
||||
<h:outputLabel value="#{compra.insertedAt}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
@@ -77,6 +75,12 @@
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{compra.comentario}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Tipo de Compra"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{compra.tipo}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Monto"/>
|
||||
@@ -84,16 +88,15 @@
|
||||
<h:outputLabel value="#{compra.monto}"/>
|
||||
</h:column>
|
||||
</h:dataTable>
|
||||
<hr/>
|
||||
|
||||
<h1 class="f1">Pagos</h1>
|
||||
<h1 class="f3">Pagos</h1>
|
||||
<h:dataTable class="w-100 pv3" headerClass="fw6 bb b--black-20 tl pb2 pr3 bg-white" value="#{tarjetaCreditoBean.tarjetaCredito.pagoList}" var="pago">
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Fecha"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{pago.insertedAt}">
|
||||
<f:convertDateTime pattern="dd/MM/yyyy HH:mm"/>
|
||||
</h:outputLabel>
|
||||
<h:outputLabel value="#{pago.insertedAt}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
@@ -101,6 +104,12 @@
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{pago.comentario}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Tipo de Pago"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{pago.tipo}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Monto"/>
|
||||
|
||||
@@ -17,53 +17,53 @@
|
||||
</h:head>
|
||||
<body class="black-70 pa4">
|
||||
<h:form rendered="#{userBean.isLogged() and userBean.isClient()}">
|
||||
<div class="flex justify-between">
|
||||
<h1 class="f1">Tarjeta Debito</h1>
|
||||
<h1 class="f1 tc">Tarjeta Debito</h1>
|
||||
|
||||
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-blue" immediate="true" action="cliente_main" style="margin-top: auto; margin-bottom: auto">
|
||||
<div class="mv3 cf">
|
||||
<h:commandLink class="f5 fl tc link dim br2 ph3 pv2 mb2 dib white bg-blue" immediate="true" action="cliente_main" style="width: 200px">
|
||||
<li class="fas fa-arrow-left"></li> Volver
|
||||
</h:commandLink>
|
||||
<h:commandLink class="f5 fr tc link dim br2 ph3 pv2 mb2 dib white bg-red" immediate="true" action="#{userBean.logout()}" style="width: 200px">
|
||||
<li class="fas fa-sign-out-alt"></li> Cerrar sesion
|
||||
</h:commandLink>
|
||||
</div>
|
||||
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="id" value="Id:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-60" id="id" value="#{tarjetaDebitoBean.tarjetaDebito.id}" readonly="true" label="Id:"/>
|
||||
<h:outputLabel class="db lh-copy f6" for="id" value="Id:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="id" value="#{tarjetaDebitoBean.tarjetaDebito.id}" readonly="true" label="Id:"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="saldo" value="Saldo:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-60" id="saldo" value="#{tarjetaDebitoBean.tarjetaDebito.saldo}" readonly="true" label="Saldo:"/>
|
||||
<h:outputLabel class="db lh-copy f6" for="saldo" value="Saldo:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="saldo" value="#{tarjetaDebitoBean.tarjetaDebito.saldo}" readonly="true" label="Saldo:"/>
|
||||
</div>
|
||||
<div class="mt3 tc">
|
||||
<h:outputLabel class="db fw4 lh-copy f6" for="fecha_creacion" value="Fecha Creacion:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-60" id="fecha_creacion" value="#{tarjetaDebitoBean.tarjetaDebito.insertedAt}" readonly="true" label="Fecha Creacion:">
|
||||
<f:convertDateTime pattern="dd/MM/yyyy"/>
|
||||
</h:inputText>
|
||||
<h:outputLabel class="db lh-copy f6" for="fecha_creacion" value="Fecha Creacion:"/>
|
||||
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="fecha_creacion" value="#{tarjetaDebitoBean.tarjetaDebito.insertedAt}" readonly="true" label="Fecha Creacion:"/>
|
||||
</div>
|
||||
|
||||
<div class="flex mt3 justify-center">
|
||||
<h:commandLink class="f5 tc link dim br2 ph3 pv2 w-20 dib white bg-green" action="#{tarjetaDebitoBean.gotoDepositar()}">
|
||||
<h:commandLink class="f5 fr tc link dim br2 ph3 pv2 ma2 dib white bg-green" action="#{tarjetaDebitoBean.gotoDepositar()}" style="width: 200px">
|
||||
<li class="fas fa-piggy-bank"></li> Depositar
|
||||
</h:commandLink>
|
||||
<h:commandLink class="f5 tc link dim br2 ph3 pv2 ml2 w-20 dib white bg-red" action="#{tarjetaDebitoBean.gotoGirar()}">
|
||||
<h:commandLink class="f5 fr tc link dim br2 ph3 pv2 ma2 dib white bg-gold" action="#{tarjetaDebitoBean.gotoGirar()}" style="width: 200px">
|
||||
<li class="fas fa-hand-holding-usd"></li> Girar
|
||||
</h:commandLink>
|
||||
<h:commandLink class="f5 tc link dim br2 ph3 pv2 ml2 dib w-20 white bg-blue" action="#{tarjetaDebitoBean.gotoTransferir()}">
|
||||
<h:commandLink class="f5 fr tc link dim br2 ph3 pv2 ma2 dib white bg-blue" action="#{tarjetaDebitoBean.gotoTransferir()}" style="width: 200px">
|
||||
<li class="fas fa-comments-dollar"></li> Transferir
|
||||
</h:commandLink>
|
||||
<h:commandLink class="f5 tc link dim br2 ph3 pv2 ml2 dib w-20 white bg-purple" action="#{tarjetaDebitoBean.gotoComprar()}">
|
||||
<h:commandLink class="f5 fr tc link dim br2 ph3 pv2 ma2 dib white bg-purple" action="#{tarjetaDebitoBean.gotoComprar()}" style="width: 200px">
|
||||
<li class="fas fa-shopping-basket"></li> Comprar
|
||||
</h:commandLink>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h1 class="f1">Depositos</h1>
|
||||
|
||||
<h1 class="f3">Depositos</h1>
|
||||
<h:dataTable class="w-100 pv3" headerClass="fw6 bb b--black-20 tl pb2 pr3 bg-white" value="#{tarjetaDebitoBean.tarjetaDebito.depositoList}" var="deposito">
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Fecha"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{deposito.insertedAt}">
|
||||
<f:convertDateTime pattern="dd/MM/yyyy HH:mm"/>
|
||||
</h:outputLabel>
|
||||
<h:outputLabel value="#{deposito.insertedAt}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
@@ -71,6 +71,12 @@
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{deposito.comentario}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Metodo"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{deposito.metodo.nombre}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Monto"/>
|
||||
@@ -78,16 +84,15 @@
|
||||
<h:outputLabel value="#{deposito.monto}"/>
|
||||
</h:column>
|
||||
</h:dataTable>
|
||||
|
||||
<h1 class="f1">Giros</h1>
|
||||
<hr/>
|
||||
|
||||
<h1 class="f3">Giros</h1>
|
||||
<h:dataTable class="w-100 pv3" headerClass="fw6 bb b--black-20 tl pb2 pr3 bg-white" value="#{tarjetaDebitoBean.tarjetaDebito.giroList}" var="giro">
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Fecha"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{giro.insertedAt}">
|
||||
<f:convertDateTime pattern="dd/MM/yyyy HH:mm"/>
|
||||
</h:outputLabel>
|
||||
<h:outputLabel value="#{giro.insertedAt}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
@@ -95,6 +100,12 @@
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{giro.comentario}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Metodo"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{giro.metodo.nombre}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Monto"/>
|
||||
@@ -102,17 +113,18 @@
|
||||
<h:outputLabel value="#{giro.monto}"/>
|
||||
</h:column>
|
||||
</h:dataTable>
|
||||
|
||||
<hr/>
|
||||
|
||||
<h1 class="f1">Transferencias Hechas</h1>
|
||||
<h1 class="f3">Transferencias Hechas</h1>
|
||||
<h:dataTable class="w-100 pv3" headerClass="fw6 bb b--black-20 tl pb2 pr3 bg-white" value="#{tarjetaDebitoBean.tarjetaDebito.transferenciaFromList}" var="transferencia">
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Fecha"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{transferencia.insertedAt}">
|
||||
<f:convertDateTime pattern="dd/MM/yyyy HH:mm"/>
|
||||
</h:outputLabel>
|
||||
</h:column><h:column>
|
||||
<h:outputLabel value="#{transferencia.insertedAt}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Destinatario"/>
|
||||
</f:facet>
|
||||
@@ -132,16 +144,17 @@
|
||||
</h:column>
|
||||
</h:dataTable>
|
||||
|
||||
<h1 class="f1">Transferencias Recibidas</h1>
|
||||
<hr/>
|
||||
|
||||
<h1 class="f3">Transferencias Recibidas</h1>
|
||||
<h:dataTable class="w-100 pv3" headerClass="fw6 bb b--black-20 tl pb2 pr3 bg-white" value="#{tarjetaDebitoBean.tarjetaDebito.transferenciaToList}" var="transferencia">
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Fecha"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{transferencia.insertedAt}">
|
||||
<f:convertDateTime pattern="dd/MM/yyyy HH:mm"/>
|
||||
</h:outputLabel>
|
||||
</h:column><h:column>
|
||||
<h:outputLabel value="#{transferencia.insertedAt}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Emisor"/>
|
||||
</f:facet>
|
||||
@@ -162,15 +175,15 @@
|
||||
</h:dataTable>
|
||||
</h:form>
|
||||
|
||||
<h1 class="f1">Compras</h1>
|
||||
<hr/>
|
||||
|
||||
<h1 class="f3">Compras</h1>
|
||||
<h:dataTable class="w-100 pv3" headerClass="fw6 bb b--black-20 tl pb2 pr3 bg-white" value="#{tarjetaDebitoBean.tarjetaDebito.compraList}" var="compra">
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
<h:outputLabel value="Fecha"/>
|
||||
</f:facet>
|
||||
<h:outputLabel value="#{compra.insertedAt}">
|
||||
<f:convertDateTime pattern="dd/MM/yyyy HH:mm"/>
|
||||
</h:outputLabel>
|
||||
<h:outputLabel value="#{compra.insertedAt}"/>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">
|
||||
|
||||
308
bank.sql
308
bank.sql
@@ -2,147 +2,171 @@ DROP DATABASE bank;
|
||||
CREATE DATABASE bank;
|
||||
USE bank;
|
||||
|
||||
CREATE TABLE usuario (
|
||||
id int(10) NOT NULL AUTO_INCREMENT,
|
||||
nombre varchar(255) NOT NULL,
|
||||
password binary(32) NOT NULL,
|
||||
salt binary(16) NOT NULL,
|
||||
role varchar(255) DEFAULT 'Cliente' NOT NULL,
|
||||
inserted_at timestamp DEFAULT current_timestamp() NOT NULL,
|
||||
PRIMARY KEY (id)) CHARACTER SET UTF8;
|
||||
CREATE TABLE cliente (
|
||||
id int(10) NOT NULL AUTO_INCREMENT,
|
||||
rut varchar(255) NOT NULL,
|
||||
nombre varchar(255) NOT NULL,
|
||||
ciudad varchar(255) NOT NULL,
|
||||
inserted_at timestamp DEFAULT current_timestamp() NOT NULL,
|
||||
linea_sobregiro int(10) UNIQUE,
|
||||
usuario int(10) NOT NULL UNIQUE,
|
||||
PRIMARY KEY (id)) CHARACTER SET UTF8;
|
||||
CREATE TABLE linea_sobregiro (
|
||||
id int(10) NOT NULL AUTO_INCREMENT,
|
||||
sobregiro int(10) NOT NULL,
|
||||
limite int(10) NOT NULL,
|
||||
inserted_at timestamp DEFAULT current_timestamp() NOT NULL,
|
||||
PRIMARY KEY (id)) CHARACTER SET UTF8;
|
||||
CREATE TABLE tarjeta_credito (
|
||||
id int(10) NOT NULL AUTO_INCREMENT,
|
||||
limite_nacional int(10) NOT NULL,
|
||||
limite_internacional int(10) NOT NULL,
|
||||
deuda_nacional int(10) DEFAULT 0 NOT NULL,
|
||||
deuda_internacional int(10) DEFAULT 0 NOT NULL,
|
||||
inserted_at timestamp DEFAULT current_timestamp() NOT NULL,
|
||||
cliente int(10) NOT NULL,
|
||||
PRIMARY KEY (id)) CHARACTER SET UTF8;
|
||||
CREATE TABLE tarjeta_debito (
|
||||
id int(10) NOT NULL AUTO_INCREMENT,
|
||||
saldo int(10) DEFAULT 0 NOT NULL,
|
||||
inserted_at timestamp DEFAULT current_timestamp() NOT NULL,
|
||||
cliente int(10) NOT NULL,
|
||||
PRIMARY KEY (id)) CHARACTER SET UTF8;
|
||||
CREATE TABLE cuenta_corriente (
|
||||
id int(10) NOT NULL AUTO_INCREMENT,
|
||||
saldo int(10) DEFAULT 0 NOT NULL,
|
||||
inserted_at timestamp DEFAULT current_timestamp() NOT NULL,
|
||||
cliente int(10) NOT NULL,
|
||||
PRIMARY KEY (id)) CHARACTER SET UTF8;
|
||||
CREATE TABLE compra_tarjeta_credito (
|
||||
id int(10) NOT NULL AUTO_INCREMENT,
|
||||
monto int(10) NOT NULL,
|
||||
comentario varchar(255),
|
||||
inserted_at timestamp DEFAULT current_timestamp() NOT NULL,
|
||||
tarjeta_credito int(10),
|
||||
PRIMARY KEY (id)) CHARACTER SET UTF8;
|
||||
CREATE TABLE giro_cuenta_corriente (
|
||||
id int(10) NOT NULL AUTO_INCREMENT,
|
||||
monto int(10) NOT NULL,
|
||||
comentario varchar(255),
|
||||
metodo int(10),
|
||||
cuenta_corriente int(10),
|
||||
inserted_at timestamp DEFAULT current_timestamp() NOT NULL,
|
||||
PRIMARY KEY (id)) CHARACTER SET UTF8;
|
||||
CREATE TABLE deposito_cuenta_corriente (
|
||||
id int(10) NOT NULL AUTO_INCREMENT,
|
||||
monto int(10) NOT NULL,
|
||||
comentario varchar(255),
|
||||
metodo int(10),
|
||||
cuenta_corriente int(10),
|
||||
inserted_at timestamp DEFAULT current_timestamp() NOT NULL,
|
||||
PRIMARY KEY (id)) CHARACTER SET UTF8;
|
||||
CREATE TABLE transferencia_cuenta_corriente (
|
||||
id int(10) NOT NULL AUTO_INCREMENT,
|
||||
monto int(10) NOT NULL,
|
||||
comentario varchar(255),
|
||||
cuenta_corriente_to int(10),
|
||||
cuenta_corriente_from int(10),
|
||||
inserted_at timestamp DEFAULT current_timestamp() NOT NULL,
|
||||
PRIMARY KEY (id)) CHARACTER SET UTF8;
|
||||
CREATE TABLE metodo (
|
||||
id int(10) NOT NULL AUTO_INCREMENT,
|
||||
nombre varchar(255) NOT NULL,
|
||||
inserted_at timestamp DEFAULT current_timestamp() NOT NULL,
|
||||
PRIMARY KEY (id)) CHARACTER SET UTF8;
|
||||
CREATE TABLE transferencia_tarjeta_debito (
|
||||
id int(10) NOT NULL AUTO_INCREMENT,
|
||||
monto int(10) NOT NULL,
|
||||
comentario varchar(255),
|
||||
tarjeta_debito_to int(10),
|
||||
tarjeta_debito_from int(10),
|
||||
inserted_at timestamp DEFAULT current_timestamp() NOT NULL,
|
||||
PRIMARY KEY (id)) CHARACTER SET UTF8;
|
||||
CREATE TABLE deposito_tarjeta_debito (
|
||||
id int(10) NOT NULL AUTO_INCREMENT,
|
||||
monto int(10) NOT NULL,
|
||||
comentario varchar(255),
|
||||
metodo int(10),
|
||||
tarjeta_debito int(10),
|
||||
inserted_at timestamp DEFAULT current_timestamp() NOT NULL,
|
||||
PRIMARY KEY (id)) CHARACTER SET UTF8;
|
||||
CREATE TABLE giro_tarjeta_debito (
|
||||
id int(10) NOT NULL AUTO_INCREMENT,
|
||||
monto int(10) NOT NULL,
|
||||
comentario varchar(255),
|
||||
metodo int(10),
|
||||
tarjeta_debito int(10),
|
||||
inserted_at timestamp DEFAULT current_timestamp() NOT NULL,
|
||||
PRIMARY KEY (id)) CHARACTER SET UTF8;
|
||||
CREATE TABLE pago_tarjeta_credito (
|
||||
id int(10) NOT NULL AUTO_INCREMENT,
|
||||
monto int(10) NOT NULL,
|
||||
comentario varchar(255),
|
||||
inserted_at timestamp DEFAULT current_timestamp() NOT NULL,
|
||||
tarjeta_credito int(10),
|
||||
PRIMARY KEY (id)) CHARACTER SET UTF8;
|
||||
CREATE TABLE compra_tarjeta_debito (
|
||||
id int(10) NOT NULL AUTO_INCREMENT,
|
||||
monto int(10) NOT NULL,
|
||||
comentario varchar(255),
|
||||
tarjeta_debito int(10) NOT NULL,
|
||||
inserted_at timestamp DEFAULT current_timestamp() NOT NULL,
|
||||
PRIMARY KEY (id)) CHARACTER SET UTF8;
|
||||
ALTER TABLE cliente ADD CONSTRAINT FKcliente571606 FOREIGN KEY (linea_sobregiro) REFERENCES linea_sobregiro (id) ON DELETE Cascade;
|
||||
ALTER TABLE tarjeta_credito ADD CONSTRAINT FKtarjeta_cr81196 FOREIGN KEY (cliente) REFERENCES cliente (id) ON DELETE Cascade;
|
||||
ALTER TABLE cuenta_corriente ADD CONSTRAINT FKcuenta_cor278524 FOREIGN KEY (cliente) REFERENCES cliente (id) ON DELETE Cascade;
|
||||
ALTER TABLE tarjeta_debito ADD CONSTRAINT FKtarjeta_de160614 FOREIGN KEY (cliente) REFERENCES cliente (id) ON DELETE Cascade;
|
||||
ALTER TABLE cliente ADD CONSTRAINT FKcliente901955 FOREIGN KEY (usuario) REFERENCES usuario (id) ON DELETE Cascade;
|
||||
ALTER TABLE deposito_cuenta_corriente ADD CONSTRAINT FKdeposito_c403217 FOREIGN KEY (metodo) REFERENCES metodo (id);
|
||||
ALTER TABLE giro_cuenta_corriente ADD CONSTRAINT FKgiro_cuent832803 FOREIGN KEY (metodo) REFERENCES metodo (id);
|
||||
ALTER TABLE deposito_tarjeta_debito ADD CONSTRAINT FKdeposito_t164090 FOREIGN KEY (metodo) REFERENCES metodo (id);
|
||||
ALTER TABLE giro_tarjeta_debito ADD CONSTRAINT FKgiro_tarje519906 FOREIGN KEY (metodo) REFERENCES metodo (id);
|
||||
ALTER TABLE compra_tarjeta_credito ADD CONSTRAINT FKcompra_tar218956 FOREIGN KEY (tarjeta_credito) REFERENCES tarjeta_credito (id) ON DELETE Set null;
|
||||
ALTER TABLE pago_tarjeta_credito ADD CONSTRAINT FKpago_tarje245778 FOREIGN KEY (tarjeta_credito) REFERENCES tarjeta_credito (id) ON DELETE Set null;
|
||||
ALTER TABLE transferencia_cuenta_corriente ADD CONSTRAINT FKtransferen788163 FOREIGN KEY (cuenta_corriente_to) REFERENCES cuenta_corriente (id) ON DELETE Set null;
|
||||
ALTER TABLE deposito_cuenta_corriente ADD CONSTRAINT FKdeposito_c722018 FOREIGN KEY (cuenta_corriente) REFERENCES cuenta_corriente (id) ON DELETE Set null;
|
||||
ALTER TABLE giro_cuenta_corriente ADD CONSTRAINT FKgiro_cuent986448 FOREIGN KEY (cuenta_corriente) REFERENCES cuenta_corriente (id) ON DELETE Set null;
|
||||
ALTER TABLE transferencia_tarjeta_debito ADD CONSTRAINT FKtransferen939970 FOREIGN KEY (tarjeta_debito_to) REFERENCES tarjeta_debito (id) ON DELETE Set null;
|
||||
ALTER TABLE deposito_tarjeta_debito ADD CONSTRAINT FKdeposito_t747169 FOREIGN KEY (tarjeta_debito) REFERENCES tarjeta_debito (id) ON DELETE Set null;
|
||||
ALTER TABLE giro_tarjeta_debito ADD CONSTRAINT FKgiro_tarje431166 FOREIGN KEY (tarjeta_debito) REFERENCES tarjeta_debito (id) ON DELETE Set null;
|
||||
ALTER TABLE transferencia_cuenta_corriente ADD CONSTRAINT FKtransferen295143 FOREIGN KEY (cuenta_corriente_from) REFERENCES cuenta_corriente (id) ON DELETE Set null;
|
||||
ALTER TABLE transferencia_tarjeta_debito ADD CONSTRAINT FKtransferen713576 FOREIGN KEY (tarjeta_debito_from) REFERENCES tarjeta_debito (id) ON DELETE Set null;
|
||||
ALTER TABLE compra_tarjeta_debito ADD CONSTRAINT FKcompra_tar267191 FOREIGN KEY (tarjeta_debito) REFERENCES tarjeta_debito (id);
|
||||
INSERT INTO usuario(id, nombre, password, salt, role, inserted_at) VALUES (1, 'ryuuji', 0xEC65288218545FB29831D2025CEE99704C900B4B8E0B7DB35A610E2D1673BF35, 0x6260AD9369D01E48EC34F0315FAD3565, 'Admin', current_timestamp());
|
||||
INSERT INTO metodo(id, nombre) VALUES (1, 'Cheque');
|
||||
INSERT INTO metodo(id, nombre) VALUES (2, 'Vale Vista');
|
||||
INSERT INTO metodo(id, nombre) VALUES (3, 'Efectivo');
|
||||
INSERT INTO metodo(id, nombre) VALUES (4, 'Caja');
|
||||
id int(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
sobregiro int(10) NOT NULL,
|
||||
limite int(10) NOT NULL,
|
||||
inserted_at timestamp DEFAULT current_timestamp()
|
||||
);
|
||||
|
||||
CREATE TABLE tarjeta_credito (
|
||||
id int(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
limite_nacional int(10) NOT NULL,
|
||||
limite_internacional int(10) NOT NULL,
|
||||
deuda_nacional int(10) DEFAULT 0,
|
||||
deuda_internacional int(10) DEFAULT 0,
|
||||
linea_sobregiro int(10) UNIQUE,
|
||||
inserted_at timestamp DEFAULT current_timestamp(),
|
||||
foreign key (linea_sobregiro) references linea_sobregiro (id) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
CREATE TABLE cuenta_corriente (
|
||||
id int(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
saldo int(10) DEFAULT 0,
|
||||
linea_sobregiro int(10) UNIQUE,
|
||||
inserted_at timestamp DEFAULT current_timestamp(),
|
||||
foreign key (linea_sobregiro) references linea_sobregiro (id) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
CREATE TABLE tarjeta_debito (
|
||||
id int(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
saldo int(10) DEFAULT 0,
|
||||
inserted_at timestamp DEFAULT current_timestamp()
|
||||
);
|
||||
|
||||
CREATE TABLE usuario (
|
||||
id int(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
nombre varchar(255) NOT NULL,
|
||||
password binary(32) NOT NULL,
|
||||
salt binary(16) NOT NULL,
|
||||
rol varchar(255) DEFAULT 'Cliente',
|
||||
inserted_at timestamp DEFAULT current_timestamp()
|
||||
);
|
||||
|
||||
CREATE TABLE cliente (
|
||||
id int(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
rut varchar(255) NOT NULL,
|
||||
nombre varchar(255) NOT NULL,
|
||||
ciudad varchar(255) NOT NULL,
|
||||
cuenta_corriente int(10) UNIQUE,
|
||||
tarjeta_credito int(10) UNIQUE,
|
||||
tarjeta_debito int(10) UNIQUE,
|
||||
usuario int(10) NOT NULL UNIQUE,
|
||||
inserted_at timestamp DEFAULT current_timestamp(),
|
||||
foreign key (cuenta_corriente) references cuenta_corriente (id) ON DELETE CASCADE,
|
||||
foreign key (tarjeta_credito) references tarjeta_credito (id) ON DELETE CASCADE,
|
||||
foreign key (tarjeta_debito) references tarjeta_debito (id) ON DELETE CASCADE,
|
||||
foreign key (usuario) references usuario (id) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
CREATE TABLE metodo (
|
||||
id int(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
nombre varchar(255) NOT NULL,
|
||||
inserted_at timestamp DEFAULT current_timestamp()
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE compra_tarjeta_credito (
|
||||
id int(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
monto int(10) NOT NULL,
|
||||
comentario varchar(255),
|
||||
tipo varchar(255),
|
||||
tarjeta_credito int(10),
|
||||
inserted_at timestamp DEFAULT current_timestamp(),
|
||||
foreign key (tarjeta_credito) references tarjeta_credito (id) ON DELETE SET NULL
|
||||
);
|
||||
|
||||
CREATE TABLE pago_tarjeta_credito (
|
||||
id int(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
monto int(10) NOT NULL,
|
||||
comentario varchar(255),
|
||||
tipo varchar(255),
|
||||
tarjeta_credito int(10),
|
||||
inserted_at timestamp DEFAULT current_timestamp(),
|
||||
foreign key (tarjeta_credito) references tarjeta_credito (id) ON DELETE SET NULL
|
||||
);
|
||||
|
||||
CREATE TABLE giro_cuenta_corriente (
|
||||
id int(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
monto int(10) NOT NULL,
|
||||
comentario varchar(255),
|
||||
cuenta_corriente int(10),
|
||||
metodo int(10) NOT NULL,
|
||||
inserted_at timestamp DEFAULT current_timestamp(),
|
||||
foreign key (metodo) references metodo (id),
|
||||
foreign key (cuenta_corriente) references cuenta_corriente (id) ON DELETE SET NULL
|
||||
);
|
||||
|
||||
CREATE TABLE deposito_cuenta_corriente (
|
||||
id int(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
monto int(10) NOT NULL,
|
||||
comentario varchar(255),
|
||||
metodo int(10) NOT NULL,
|
||||
cuenta_corriente int(10),
|
||||
inserted_at timestamp DEFAULT current_timestamp(),
|
||||
foreign key (metodo) references metodo (id),
|
||||
foreign key (cuenta_corriente) references cuenta_corriente (id) ON DELETE SET NULL
|
||||
);
|
||||
|
||||
CREATE TABLE transferencia_cuenta_corriente (
|
||||
id int(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
monto int(10) NOT NULL,
|
||||
comentario varchar(255),
|
||||
cuenta_corriente_to int(10),
|
||||
cuenta_corriente_from int(10),
|
||||
inserted_at timestamp DEFAULT current_timestamp(),
|
||||
foreign key (cuenta_corriente_to) references cuenta_corriente (id) ON DELETE SET NULL,
|
||||
foreign key (cuenta_corriente_from) references cuenta_corriente (id) ON DELETE SET NULL
|
||||
);
|
||||
|
||||
CREATE TABLE deposito_tarjeta_debito (
|
||||
id int(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
monto int(10) NOT NULL,
|
||||
comentario varchar(255),
|
||||
metodo int(10) NOT NULL,
|
||||
tarjeta_debito int(10),
|
||||
inserted_at timestamp DEFAULT current_timestamp(),
|
||||
foreign key (metodo) references metodo (id),
|
||||
foreign key (tarjeta_debito) references tarjeta_debito (id) ON DELETE SET NULL
|
||||
);
|
||||
|
||||
CREATE TABLE giro_tarjeta_debito (
|
||||
id int(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
monto int(10) NOT NULL,
|
||||
comentario varchar(255),
|
||||
metodo int(10) NOT NULL,
|
||||
tarjeta_debito int(10),
|
||||
inserted_at timestamp DEFAULT current_timestamp(),
|
||||
foreign key (metodo) references metodo (id),
|
||||
foreign key (tarjeta_debito) references tarjeta_debito (id) ON DELETE SET NULL
|
||||
);
|
||||
|
||||
CREATE TABLE transferencia_tarjeta_debito (
|
||||
id int(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
monto int(10) NOT NULL,
|
||||
comentario varchar(255),
|
||||
tarjeta_debito_to int(10),
|
||||
tarjeta_debito_from int(10),
|
||||
inserted_at timestamp DEFAULT current_timestamp(),
|
||||
foreign key (tarjeta_debito_to) references tarjeta_debito (id) ON DELETE SET NULL,
|
||||
foreign key (tarjeta_debito_from) references tarjeta_debito (id) ON DELETE SET NULL
|
||||
);
|
||||
|
||||
CREATE TABLE compra_tarjeta_debito (
|
||||
id int(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
monto int(10) NOT NULL,
|
||||
comentario varchar(255),
|
||||
tarjeta_debito int(10),
|
||||
inserted_at timestamp DEFAULT current_timestamp(),
|
||||
foreign key (tarjeta_debito) references tarjeta_debito (id) ON DELETE SET NULL
|
||||
);
|
||||
|
||||
INSERT INTO usuario(id, nombre, password, salt, rol, inserted_at) VALUES
|
||||
(1, 'ryuuji', 0xEC65288218545FB29831D2025CEE99704C900B4B8E0B7DB35A610E2D1673BF35, 0x6260AD9369D01E48EC34F0315FAD3565, 'Admin', current_timestamp());
|
||||
|
||||
INSERT INTO metodo (id, nombre) VALUES
|
||||
(1, 'Cheque'),
|
||||
(2, 'Vale Vista'),
|
||||
(3, 'Efectivo'),
|
||||
(4, 'Caja');
|
||||
|
||||
|
||||
@@ -37,4 +37,5 @@ project.bank-war=bank-war
|
||||
reference.bank-ejb.dist-ear=${project.bank-ejb}/dist/bank-ejb.jar
|
||||
reference.bank-war.dist-ear=${project.bank-war}/dist/bank-war.war
|
||||
resource.dir=setup
|
||||
run.classpath=
|
||||
source.root=.
|
||||
|
||||
Reference in New Issue
Block a user