- ABONOS - GENERAR PAGO MULTIPLE
This commit is contained in:
parent
97d6613040
commit
b14b202c69
File diff suppressed because it is too large
Load Diff
@ -8,13 +8,19 @@ import com.arrebol.taxiservicios.controller.connection.ConnectionManager;
|
||||
import com.arrebol.taxiservicios.controller.util.HibernateUtil;
|
||||
import com.arrebol.taxiservicios.model.catalog.Location;
|
||||
import com.arrebol.taxiservicios.model.core.User;
|
||||
import com.arrebol.taxiservicios.model.enums.EstatusPagoMultiple;
|
||||
import com.arrebol.taxiservicios.model.enums.GenericEnumType;
|
||||
import com.arrebol.taxiservicios.model.enums.MetodoPago;
|
||||
import com.arrebol.taxiservicios.model.enums.PolizaEstatus;
|
||||
import com.crov.prase.model.prase.DetellePagoPoliza;
|
||||
import com.crov.prase.model.prase.HistorialAbonoMultiple;
|
||||
import com.crov.prase.model.prase.PagosPoliza;
|
||||
import com.crov.prase.model.prase.Poliza;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.ZoneId;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@ -110,8 +116,8 @@ public class PagosPolizaController extends ConnectionManager implements Serializ
|
||||
return resultList;
|
||||
}
|
||||
|
||||
public PagosPoliza fillFoliosByPagos(String abreviacionFolio) {
|
||||
PagosPoliza result = null;
|
||||
public DetellePagoPoliza fillFoliosByPagos(String abreviacionFolio) {
|
||||
DetellePagoPoliza result = null;
|
||||
Transaction transaction = null;
|
||||
try {
|
||||
logger.info("Search last generated folio..");
|
||||
@ -119,13 +125,13 @@ public class PagosPolizaController extends ConnectionManager implements Serializ
|
||||
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
|
||||
transaction = session.beginTransaction();
|
||||
|
||||
String query = "SELECT tap FROM PagosPoliza tap "
|
||||
String query = "SELECT tap FROM DetellePagoPoliza tap "
|
||||
+ "WHERE tap.folio LIKE '" + abreviacionFolio + "%' "
|
||||
+ "ORDER BY "
|
||||
+ "SUBSTRING_INDEX(tap.folio, '-', 1) DESC, "
|
||||
+ "SUBSTRING_INDEX(SUBSTRING_INDEX(tap.folio, '-', -2), '-', -6) DESC ";
|
||||
|
||||
result = (PagosPoliza) session.createQuery(query).setMaxResults(1).uniqueResult();
|
||||
result = (DetellePagoPoliza) session.createQuery(query).setMaxResults(1).uniqueResult();
|
||||
transaction.commit();
|
||||
} catch (HibernateException e) {
|
||||
logger.error("Search for the last generated folio " + e);
|
||||
@ -278,6 +284,229 @@ public class PagosPolizaController extends ConnectionManager implements Serializ
|
||||
return resultList;
|
||||
}
|
||||
|
||||
public String procesarPagoMultiple(Poliza polizaActual, Double montoTotal, String metodoPago, String comentario, User user) {
|
||||
Session session = null;
|
||||
Transaction transaction = null;
|
||||
Date fechaActual = correcciónDeHr(new Date(), -7);
|
||||
List<String> foliosGenerados = new ArrayList<>();
|
||||
List<String> detallesPagos = new ArrayList<>();
|
||||
try {
|
||||
session = HibernateUtil.getSessionFactory().getCurrentSession();
|
||||
transaction = session.beginTransaction();
|
||||
|
||||
// 1. Obtener pagos validos
|
||||
CriteriaBuilder builder = session.getCriteriaBuilder();
|
||||
CriteriaQuery<PagosPoliza> criteria = builder.createQuery(PagosPoliza.class);
|
||||
Root<PagosPoliza> root = criteria.from(PagosPoliza.class);
|
||||
|
||||
Predicate[] predicates = new Predicate[]{
|
||||
builder.equal(root.get("poliza"), polizaActual),
|
||||
builder.equal(root.get("estatusActivo"), GenericEnumType.ENABLED),
|
||||
root.get("pagoEstatus").in(GenericEnumType.DISABLED, GenericEnumType.INCOMPLETE)
|
||||
};
|
||||
criteria.where(predicates).orderBy(builder.asc(root.get("fechaAPagar")));
|
||||
|
||||
List<PagosPoliza> pagos = session.createQuery(criteria).getResultList();
|
||||
|
||||
if (pagos.isEmpty()) {
|
||||
return "No existen pagos pendientes";
|
||||
}
|
||||
|
||||
// 2. Deuda total
|
||||
BigDecimal deudaTotal = pagos.stream().map(p -> BigDecimal.valueOf(p.getPago()).subtract(BigDecimal.valueOf(p.getCantidadPagada()))).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
BigDecimal montoPagadoBD = BigDecimal.valueOf(montoTotal);
|
||||
BigDecimal tolerancia = new BigDecimal("0.10");
|
||||
if (montoPagadoBD.subtract(deudaTotal).compareTo(tolerancia) > 0) {
|
||||
return "Monto excede tolerancia permitida";
|
||||
}
|
||||
|
||||
// 3. Procesar pagos
|
||||
double montoRestante = montoTotal;
|
||||
|
||||
// 5. Generar folio
|
||||
// 5.1. Obtener el último consecutivo
|
||||
Integer ultimoConsecutivo = obtenerUltimoConsecutivo("A-PRASE");
|
||||
if (ultimoConsecutivo == null) {
|
||||
return "Error al generar los folios";
|
||||
}
|
||||
// 5.2. Modificar el ciclo para usar incremento local
|
||||
int currentConsecutivo = ultimoConsecutivo + 1;
|
||||
|
||||
//4. Crear historial
|
||||
HistorialAbonoMultiple historial = new HistorialAbonoMultiple();
|
||||
historial.setId(UUID.randomUUID().toString());
|
||||
historial.setLocation(polizaActual.getLocation());
|
||||
historial.setEstatus(EstatusPagoMultiple.PROCESANDO);
|
||||
historial.setPoliza(polizaActual);
|
||||
historial.setCobro(user);
|
||||
historial.setFechaPago(fechaActual);
|
||||
historial.setMetodoPago(MetodoPago.valueOf(metodoPago));
|
||||
historial.setTotalPago(montoTotal);
|
||||
historial.setCometario(comentario);
|
||||
historial.setCreatedOn(fechaActual);
|
||||
historial.setCreatedBy(user);
|
||||
session.save(historial);
|
||||
|
||||
for (PagosPoliza pago : pagos) {
|
||||
if (montoRestante <= 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
double saldoPendiente = pago.getPago() - pago.getCantidadPagada();
|
||||
if (saldoPendiente <= 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
double montoAplicar = Math.min(saldoPendiente, montoRestante);
|
||||
|
||||
// 5.3 Generar folio con incremento local
|
||||
String folio = obtenerFolio("A-PRASE", currentConsecutivo);
|
||||
currentConsecutivo++;
|
||||
|
||||
// 6. Crear detalle de pago
|
||||
DetellePagoPoliza detalle = new DetellePagoPoliza();
|
||||
detalle.setId(UUID.randomUUID().toString());
|
||||
detalle.setPagoPoliza(pago);
|
||||
detalle.setEstatusActivo(GenericEnumType.ENABLED);
|
||||
detalle.setFechaPago(fechaActual);
|
||||
detalle.setCantidadPagada(montoAplicar);
|
||||
detalle.setCobro(user);
|
||||
detalle.setFolio(folio);
|
||||
detalle.setMetodoPago(MetodoPago.valueOf(metodoPago));
|
||||
detalle.setCreatedOn(fechaActual);
|
||||
detalle.setCreatedBy(user);
|
||||
detalle.setHistorialAbonoMultiple(historial);
|
||||
session.save(detalle);
|
||||
|
||||
// 7. Actualizar pago
|
||||
pago.setCantidadPagada(pago.getCantidadPagada() + montoAplicar);
|
||||
pago.setDiferenciaPago(pago.getPago() - pago.getCantidadPagada());
|
||||
if (pago.getDiferenciaPago() < 0.01) {
|
||||
pago.setPagoEstatus(GenericEnumType.ENABLED);
|
||||
pago.setCantidadPagada(pago.getPago());
|
||||
} else {
|
||||
pago.setPagoEstatus(GenericEnumType.INCOMPLETE);
|
||||
}
|
||||
pago.setLastUpdatedOn(fechaActual);
|
||||
pago.setLastUpdatedBy(user);
|
||||
session.update(pago);
|
||||
|
||||
// 8. Actualizar la cantidad pagada de la poliza
|
||||
polizaActual.setCantidadPagada(polizaActual.getCantidadPagada() + montoAplicar);
|
||||
montoRestante -= montoAplicar;
|
||||
|
||||
// 9. Se agrega el folio a la lista
|
||||
foliosGenerados.add(folio);
|
||||
|
||||
// 10. Se crear el detalle del folio
|
||||
String detallePago = String.format(
|
||||
"%s | ",
|
||||
folio
|
||||
);
|
||||
detallesPagos.add(detallePago);
|
||||
}
|
||||
|
||||
// 11. Validar liquidación completa de la poliza
|
||||
if (Math.abs(polizaActual.getAmount() - polizaActual.getCantidadPagada()) < 0.10) {
|
||||
polizaActual.setEstatus(PolizaEstatus.LIQUIDADO);
|
||||
}
|
||||
polizaActual.setLastUpdatedOn(fechaActual);
|
||||
polizaActual.setLastUpdatedBy(user);
|
||||
session.update(polizaActual);
|
||||
|
||||
// 12. Se actualizar historial con los folios
|
||||
historial.setFolios(String.join(", ", foliosGenerados));
|
||||
historial.setDetalle(String.join("\n", detallesPagos));
|
||||
historial.setEstatus(EstatusPagoMultiple.PAGADO);
|
||||
session.update(historial);
|
||||
|
||||
transaction.commit();
|
||||
return historial.getId();
|
||||
} catch (Exception e) {
|
||||
if (transaction != null) {
|
||||
transaction.rollback();
|
||||
}
|
||||
return "Error interno: " + e.getMessage();
|
||||
} finally {
|
||||
if (session != null) {
|
||||
session.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Integer obtenerUltimoConsecutivo(String ab) {
|
||||
Session session = null;
|
||||
try {
|
||||
session = HibernateUtil.getSessionFactory().openSession();
|
||||
|
||||
String query = "SELECT tap FROM DetellePagoPoliza tap "
|
||||
+ "WHERE tap.folio LIKE '" + ab + "%' "
|
||||
+ "ORDER BY "
|
||||
+ "SUBSTRING_INDEX(tap.folio, '-', 1) DESC, "
|
||||
+ "SUBSTRING_INDEX(SUBSTRING_INDEX(tap.folio, '-', -2), '-', -6) DESC ";
|
||||
|
||||
DetellePagoPoliza ultimoFolio = (DetellePagoPoliza) session.createQuery(query).setMaxResults(1).uniqueResult();
|
||||
|
||||
if (ultimoFolio == null || ultimoFolio.getFolio() == null) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
String[] partes = ultimoFolio.getFolio().split("-");
|
||||
if (partes.length < 4) {
|
||||
throw new IllegalStateException("Formato inválido. Se esperaba: ABREV-CONSECUTIVO-AÑO");
|
||||
}
|
||||
|
||||
try {
|
||||
return Integer.valueOf(partes[2]);
|
||||
} catch (NumberFormatException e) {
|
||||
throw new IllegalStateException("Consecutivo no numérico: " + partes[2]);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("Error obteniendo consecutivo: ", e);
|
||||
return null;
|
||||
} finally {
|
||||
if (session != null) {
|
||||
session.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String obtenerFolio(String ab, int consecutivo) {
|
||||
try {
|
||||
String numeroFormateado = String.format("%06d", consecutivo);
|
||||
Calendar calendario = Calendar.getInstance();
|
||||
int ano = calendario.get(Calendar.YEAR);
|
||||
return ab + "-" + numeroFormateado + "-" + ano;
|
||||
} catch (Exception e) {
|
||||
logger.error("Error generando folio", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public HistorialAbonoMultiple getHistorialAbonoMultipleById(String userId) {
|
||||
logger.info("getHistorialAbonoMultipleById");
|
||||
|
||||
HistorialAbonoMultiple general = null;
|
||||
Transaction transaction = null;
|
||||
try {
|
||||
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
|
||||
transaction = session.beginTransaction();
|
||||
|
||||
general = session.get(HistorialAbonoMultiple.class, userId);
|
||||
|
||||
transaction.commit();
|
||||
logger.info("HistorialAbonoMultiple " + general);
|
||||
} catch (HibernateException e) {
|
||||
logger.error("HistorialAbonoMultiple cannot be loaded " + userId, e);
|
||||
rollback(transaction);
|
||||
} catch (Exception e) {
|
||||
logger.error("Method getHistorialAbonoMultipleById(" + userId + ") ", e);
|
||||
rollback(transaction);
|
||||
}
|
||||
return general;
|
||||
}
|
||||
|
||||
private Date correcciónDeHr(Date fecha, int horas) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(fecha);
|
||||
|
@ -1,8 +1,8 @@
|
||||
/*
|
||||
* Arrebol Consultancy copyright.
|
||||
*
|
||||
*
|
||||
* This code belongs to Arrebol Consultancy
|
||||
* its use, redistribution or modification are prohibited
|
||||
* its use, redistribution or modification are prohibited
|
||||
* without written authorization from Arrebol Consultancy.
|
||||
*/
|
||||
package com.crov.prase.controller.prase;
|
||||
@ -12,7 +12,7 @@ import com.arrebol.taxiservicios.controller.util.HibernateUtil;
|
||||
import com.arrebol.taxiservicios.model.catalog.Location;
|
||||
import com.arrebol.taxiservicios.model.core.Address;
|
||||
import com.arrebol.taxiservicios.model.core.User;
|
||||
import com.crov.prase.model.prase.Incidence;
|
||||
import com.crov.prase.model.prase.DetellePagoPoliza;
|
||||
import com.crov.prase.model.prase.PagosPoliza;
|
||||
import com.crov.prase.model.prase.Poliza;
|
||||
import java.io.Serializable;
|
||||
@ -39,370 +39,387 @@ import org.hibernate.Transaction;
|
||||
*/
|
||||
public class PolizaController extends ConnectionManager implements Serializable {
|
||||
|
||||
public PolizaController() {
|
||||
}
|
||||
public PolizaController() {
|
||||
}
|
||||
|
||||
public Poliza findPoliza(String idPoliza) {
|
||||
logger.info("findPoliza");
|
||||
Poliza results = null;
|
||||
Transaction transaction = null;
|
||||
try {
|
||||
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
|
||||
transaction = session.beginTransaction();
|
||||
CriteriaBuilder builder = session.getCriteriaBuilder();
|
||||
public Poliza findPoliza(String idPoliza) {
|
||||
logger.info("findPoliza");
|
||||
Poliza results = null;
|
||||
Transaction transaction = null;
|
||||
try {
|
||||
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
|
||||
transaction = session.beginTransaction();
|
||||
CriteriaBuilder builder = session.getCriteriaBuilder();
|
||||
|
||||
CriteriaQuery<Poliza> query = builder.createQuery(Poliza.class);
|
||||
Root<Poliza> root = query.from(Poliza.class);
|
||||
CriteriaQuery<Poliza> query = builder.createQuery(Poliza.class);
|
||||
Root<Poliza> root = query.from(Poliza.class);
|
||||
|
||||
Predicate id = builder.equal(root.get("id"), idPoliza);
|
||||
query.where(builder.and(id));
|
||||
results = session.createQuery(query).getSingleResult();
|
||||
transaction.commit();
|
||||
Predicate id = builder.equal(root.get("id"), idPoliza);
|
||||
query.where(builder.and(id));
|
||||
results = session.createQuery(query).getSingleResult();
|
||||
transaction.commit();
|
||||
|
||||
logger.info("Poliza" + results.getId());
|
||||
} catch (HibernateException e) {
|
||||
logger.error("Can not load Poliza", e);
|
||||
rollback(transaction);
|
||||
} catch (Exception e) {
|
||||
logger.error("Method findPoliza() ", e);
|
||||
rollback(transaction);
|
||||
}
|
||||
return results;
|
||||
}
|
||||
logger.info("Poliza" + results.getId());
|
||||
} catch (HibernateException e) {
|
||||
logger.error("Can not load Poliza", e);
|
||||
rollback(transaction);
|
||||
} catch (Exception e) {
|
||||
logger.error("Method findPoliza() ", e);
|
||||
rollback(transaction);
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
public Address findAddress(String idPerson) {
|
||||
logger.info("findAddress");
|
||||
Address results = null;
|
||||
Transaction transaction = null;
|
||||
try {
|
||||
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
|
||||
transaction = session.beginTransaction();
|
||||
CriteriaBuilder builder = session.getCriteriaBuilder();
|
||||
public Address findAddress(String idPerson) {
|
||||
logger.info("findAddress");
|
||||
Address results = null;
|
||||
Transaction transaction = null;
|
||||
try {
|
||||
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
|
||||
transaction = session.beginTransaction();
|
||||
CriteriaBuilder builder = session.getCriteriaBuilder();
|
||||
|
||||
CriteriaQuery<Address> query = builder.createQuery(Address.class);
|
||||
Root<Address> root = query.from(Address.class);
|
||||
CriteriaQuery<Address> query = builder.createQuery(Address.class);
|
||||
Root<Address> root = query.from(Address.class);
|
||||
|
||||
Predicate id = builder.equal(root.get("person").get("id"), idPerson);
|
||||
query.where(builder.and(id));
|
||||
results = session.createQuery(query).getSingleResult();
|
||||
transaction.commit();
|
||||
Predicate id = builder.equal(root.get("person").get("id"), idPerson);
|
||||
query.where(builder.and(id));
|
||||
results = session.createQuery(query).getSingleResult();
|
||||
transaction.commit();
|
||||
|
||||
logger.info("Address" + results.getId());
|
||||
} catch (NoResultException e) {
|
||||
transaction.rollback();
|
||||
logger.error("No se encontro el address: ");
|
||||
} catch (HibernateException e) {
|
||||
rollback(transaction);
|
||||
logger.error("Error al encontrar el address: ", e);
|
||||
} catch (Exception e) {
|
||||
rollback(transaction);
|
||||
logger.error("Método findAddress: ", e);
|
||||
}
|
||||
return results;
|
||||
}
|
||||
logger.info("Address" + results.getId());
|
||||
} catch (NoResultException e) {
|
||||
transaction.rollback();
|
||||
logger.error("No se encontro el address: ");
|
||||
} catch (HibernateException e) {
|
||||
rollback(transaction);
|
||||
logger.error("Error al encontrar el address: ", e);
|
||||
} catch (Exception e) {
|
||||
rollback(transaction);
|
||||
logger.error("Método findAddress: ", e);
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param location
|
||||
* @return List of all Poliza.
|
||||
*/
|
||||
public List<Poliza> findActive(Location location) {
|
||||
logger.info("findActive");
|
||||
List<Poliza> results = new ArrayList<>();
|
||||
/**
|
||||
* @param location
|
||||
* @return List of all Poliza.
|
||||
*/
|
||||
public List<Poliza> findActive(Location location) {
|
||||
logger.info("findActive");
|
||||
List<Poliza> results = new ArrayList<>();
|
||||
|
||||
Transaction transaction = null;
|
||||
Transaction transaction = null;
|
||||
|
||||
try {
|
||||
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
|
||||
transaction = session.beginTransaction();
|
||||
CriteriaBuilder builder = session.getCriteriaBuilder();
|
||||
CriteriaQuery<Poliza> query = builder.createQuery(Poliza.class);
|
||||
Root<Poliza> root = query.from(Poliza.class);
|
||||
try {
|
||||
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
|
||||
transaction = session.beginTransaction();
|
||||
CriteriaBuilder builder = session.getCriteriaBuilder();
|
||||
CriteriaQuery<Poliza> query = builder.createQuery(Poliza.class);
|
||||
Root<Poliza> root = query.from(Poliza.class);
|
||||
|
||||
Predicate policyActives = builder.equal(root.get("active"), Boolean.TRUE);
|
||||
Predicate locations = builder.equal(root.get("location"), location);
|
||||
Predicate policyActives = builder.equal(root.get("active"), Boolean.TRUE);
|
||||
Predicate locations = builder.equal(root.get("location"), location);
|
||||
|
||||
query.where(builder.and(
|
||||
policyActives, locations
|
||||
));
|
||||
query.orderBy(builder.asc(root.get("createdOn")));
|
||||
query.where(builder.and(
|
||||
policyActives, locations
|
||||
));
|
||||
query.orderBy(builder.asc(root.get("createdOn")));
|
||||
|
||||
results = session.createQuery(query).getResultList();
|
||||
results = session.createQuery(query).getResultList();
|
||||
|
||||
transaction.commit();
|
||||
transaction.commit();
|
||||
|
||||
logger.info("Poliza's list " + results.size());
|
||||
} catch (HibernateException e) {
|
||||
logger.error("Can not load Poliza list ", e);
|
||||
rollback(transaction);
|
||||
} catch (Exception e) {
|
||||
logger.error("Method findActive() ", e);
|
||||
rollback(transaction);
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
public List<Poliza> findDisable(Location location) {
|
||||
logger.info("findDisable");
|
||||
List<Poliza> results = new ArrayList<>();
|
||||
logger.info("Poliza's list " + results.size());
|
||||
} catch (HibernateException e) {
|
||||
logger.error("Can not load Poliza list ", e);
|
||||
rollback(transaction);
|
||||
} catch (Exception e) {
|
||||
logger.error("Method findActive() ", e);
|
||||
rollback(transaction);
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
Transaction transaction = null;
|
||||
public List<Poliza> findDisable(Location location) {
|
||||
logger.info("findDisable");
|
||||
List<Poliza> results = new ArrayList<>();
|
||||
|
||||
try {
|
||||
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
|
||||
transaction = session.beginTransaction();
|
||||
CriteriaBuilder builder = session.getCriteriaBuilder();
|
||||
CriteriaQuery<Poliza> query = builder.createQuery(Poliza.class);
|
||||
Root<Poliza> root = query.from(Poliza.class);
|
||||
Transaction transaction = null;
|
||||
|
||||
Predicate policyDisables = builder.equal(root.get("active"), Boolean.FALSE);
|
||||
Predicate locations = builder.equal(root.get("location"), location);
|
||||
try {
|
||||
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
|
||||
transaction = session.beginTransaction();
|
||||
CriteriaBuilder builder = session.getCriteriaBuilder();
|
||||
CriteriaQuery<Poliza> query = builder.createQuery(Poliza.class);
|
||||
Root<Poliza> root = query.from(Poliza.class);
|
||||
|
||||
query.where(builder.and(
|
||||
policyDisables, locations
|
||||
));
|
||||
query.orderBy(builder.asc(root.get("createdOn")));
|
||||
Predicate policyDisables = builder.equal(root.get("active"), Boolean.FALSE);
|
||||
Predicate locations = builder.equal(root.get("location"), location);
|
||||
|
||||
results = session.createQuery(query).getResultList();
|
||||
query.where(builder.and(
|
||||
policyDisables, locations
|
||||
));
|
||||
query.orderBy(builder.asc(root.get("createdOn")));
|
||||
|
||||
transaction.commit();
|
||||
results = session.createQuery(query).getResultList();
|
||||
|
||||
logger.info("Poliza's list " + results.size());
|
||||
} catch (HibernateException e) {
|
||||
logger.error("Can not load Poliza list ", e);
|
||||
rollback(transaction);
|
||||
} catch (Exception e) {
|
||||
logger.error("Method findDisable() ", e);
|
||||
rollback(transaction);
|
||||
}
|
||||
return results;
|
||||
}
|
||||
transaction.commit();
|
||||
|
||||
/**
|
||||
* Update active status (ENEBLED/DISABLED) of Expense company ID.
|
||||
*
|
||||
* @param id
|
||||
* @param lastUpdatedBy
|
||||
* @param comentario
|
||||
* @return
|
||||
*/
|
||||
public boolean delete(String id, User lastUpdatedBy, String comentario) {
|
||||
logger.info("delete");
|
||||
logger.info("Poliza's list " + results.size());
|
||||
} catch (HibernateException e) {
|
||||
logger.error("Can not load Poliza list ", e);
|
||||
rollback(transaction);
|
||||
} catch (Exception e) {
|
||||
logger.error("Method findDisable() ", e);
|
||||
rollback(transaction);
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
boolean success = false;
|
||||
Transaction transaction = null;
|
||||
|
||||
/**
|
||||
* Update active status (ENEBLED/DISABLED) of Expense company ID.
|
||||
*
|
||||
* @param id
|
||||
* @param lastUpdatedBy
|
||||
* @param comentario
|
||||
* @return
|
||||
*/
|
||||
public boolean delete(String id, User lastUpdatedBy, String comentario) {
|
||||
logger.info("delete");
|
||||
|
||||
try {
|
||||
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
|
||||
transaction = session.beginTransaction();
|
||||
CriteriaBuilder builder = session.getCriteriaBuilder();
|
||||
CriteriaUpdate<Poliza> query = builder.createCriteriaUpdate(Poliza.class);
|
||||
Root<Poliza> root = query.from(Poliza.class);
|
||||
|
||||
boolean success = false;
|
||||
Transaction transaction = null;
|
||||
|
||||
query.set(root.get("comentarios"), comentario);
|
||||
query.set(root.get("active"), false);
|
||||
query.set(root.get("lastUpdatedBy"), lastUpdatedBy);
|
||||
query.set(root.get("lastUpdatedOn"), new Date());
|
||||
try {
|
||||
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
|
||||
transaction = session.beginTransaction();
|
||||
CriteriaBuilder builder = session.getCriteriaBuilder();
|
||||
CriteriaUpdate<Poliza> query = builder.createCriteriaUpdate(Poliza.class);
|
||||
Root<Poliza> root = query.from(Poliza.class);
|
||||
|
||||
query.where(builder.equal(root.get("id"), id));
|
||||
query.set(root.get("comentarios"), comentario);
|
||||
query.set(root.get("active"), false);
|
||||
query.set(root.get("lastUpdatedBy"), lastUpdatedBy);
|
||||
query.set(root.get("lastUpdatedOn"), new Date());
|
||||
|
||||
int total = session.createQuery(query).executeUpdate();
|
||||
query.where(builder.equal(root.get("id"), id));
|
||||
|
||||
if (1 == total) {
|
||||
transaction.commit();
|
||||
success = true;
|
||||
logger.info("update Poliza status to disable");
|
||||
} else {
|
||||
logger.info("CAN NOT update Poliza status");
|
||||
rollback(transaction);
|
||||
}
|
||||
} catch (HibernateException e) {
|
||||
logger.error("Can not update Poliza status", e);
|
||||
rollback(transaction);
|
||||
} catch (Exception e) {
|
||||
logger.error("Method delete() ", e);
|
||||
rollback(transaction);
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save a new poliza entry.
|
||||
*
|
||||
* @param poliza
|
||||
* @return
|
||||
*/
|
||||
public boolean save(Poliza poliza) {
|
||||
logger.info("saveHospitales");
|
||||
|
||||
boolean success = false;
|
||||
Transaction transaction = null;
|
||||
|
||||
try {
|
||||
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
|
||||
transaction = session.beginTransaction();
|
||||
|
||||
session.save(poliza);
|
||||
int total = session.createQuery(query).executeUpdate();
|
||||
|
||||
if (1 == total) {
|
||||
transaction.commit();
|
||||
success = true;
|
||||
} catch (HibernateException e) {
|
||||
logger.error("Can not save poliza entry", e);
|
||||
logger.info("update Poliza status to disable");
|
||||
} else {
|
||||
logger.info("CAN NOT update Poliza status");
|
||||
rollback(transaction);
|
||||
} catch (Exception e) {
|
||||
logger.error("Method save()", e);
|
||||
rollback(transaction);
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
public boolean save(PagosPoliza pagoPoliza) {
|
||||
logger.info("saveHospitales");
|
||||
}
|
||||
} catch (HibernateException e) {
|
||||
logger.error("Can not update Poliza status", e);
|
||||
rollback(transaction);
|
||||
} catch (Exception e) {
|
||||
logger.error("Method delete() ", e);
|
||||
rollback(transaction);
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
boolean success = false;
|
||||
Transaction transaction = null;
|
||||
/**
|
||||
* Save a new poliza entry.
|
||||
*
|
||||
* @param poliza
|
||||
* @return
|
||||
*/
|
||||
public boolean save(Poliza poliza) {
|
||||
logger.info("saveHospitales");
|
||||
|
||||
try {
|
||||
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
|
||||
transaction = session.beginTransaction();
|
||||
boolean success = false;
|
||||
Transaction transaction = null;
|
||||
|
||||
session.save(pagoPoliza);
|
||||
try {
|
||||
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
|
||||
transaction = session.beginTransaction();
|
||||
|
||||
transaction.commit();
|
||||
success = true;
|
||||
} catch (HibernateException e) {
|
||||
logger.error("Can not save poliza entry", e);
|
||||
rollback(transaction);
|
||||
} catch (Exception e) {
|
||||
logger.error("Method save()", e);
|
||||
rollback(transaction);
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
session.save(poliza);
|
||||
|
||||
public Poliza fillFoliosByPolizas(String abreviacionFolio) {
|
||||
Poliza result = null;
|
||||
Transaction transaction = null;
|
||||
try {
|
||||
logger.info("Search last generated folio..");
|
||||
transaction.commit();
|
||||
success = true;
|
||||
} catch (HibernateException e) {
|
||||
logger.error("Can not save poliza entry", e);
|
||||
rollback(transaction);
|
||||
} catch (Exception e) {
|
||||
logger.error("Method save()", e);
|
||||
rollback(transaction);
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
|
||||
transaction = session.beginTransaction();
|
||||
public boolean save(PagosPoliza pagoPoliza) {
|
||||
logger.info("saveHospitales");
|
||||
|
||||
String query = "SELECT tap FROM Poliza tap "
|
||||
+ "WHERE tap.folio LIKE '" + abreviacionFolio + "%' "
|
||||
+ "ORDER BY "
|
||||
+ "SUBSTRING_INDEX(tap.folio, '-', 1) DESC, "
|
||||
+ "SUBSTRING_INDEX(SUBSTRING_INDEX(tap.folio, '-', -1), '-', -6) DESC ";
|
||||
boolean success = false;
|
||||
Transaction transaction = null;
|
||||
|
||||
result = (Poliza) session.createQuery(query)
|
||||
.setMaxResults(1)
|
||||
.uniqueResult();
|
||||
try {
|
||||
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
|
||||
transaction = session.beginTransaction();
|
||||
|
||||
transaction.commit();
|
||||
} catch (HibernateException e) {
|
||||
logger.error("Search for the last generated folio " + e);
|
||||
rollback(transaction);
|
||||
} catch (Exception e) {
|
||||
logger.error("Method fillFoliosByPagos() " + e);
|
||||
rollback(transaction);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public Poliza fillFoliosByPolizas2(String abreviacionFolio) {
|
||||
Poliza result = null;
|
||||
Transaction transaction = null;
|
||||
try {
|
||||
logger.info("Search last generated folio..");
|
||||
session.save(pagoPoliza);
|
||||
|
||||
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
|
||||
transaction = session.beginTransaction();
|
||||
transaction.commit();
|
||||
success = true;
|
||||
} catch (HibernateException e) {
|
||||
logger.error("Can not save poliza entry", e);
|
||||
rollback(transaction);
|
||||
} catch (Exception e) {
|
||||
logger.error("Method save()", e);
|
||||
rollback(transaction);
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
String query = "SELECT tap FROM Poliza tap "
|
||||
+ "ORDER BY "
|
||||
+ "SUBSTRING_INDEX(SUBSTRING_INDEX(tap.folio, '-', -1), '-', -6) DESC ";
|
||||
public boolean save(DetellePagoPoliza detallePagoPoliza) {
|
||||
logger.info("saveHospitales");
|
||||
boolean success = false;
|
||||
Transaction transaction = null;
|
||||
try {
|
||||
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
|
||||
transaction = session.beginTransaction();
|
||||
session.save(detallePagoPoliza);
|
||||
transaction.commit();
|
||||
success = true;
|
||||
} catch (HibernateException e) {
|
||||
logger.error("Can not save poliza entry", e);
|
||||
rollback(transaction);
|
||||
} catch (Exception e) {
|
||||
logger.error("Method save()", e);
|
||||
rollback(transaction);
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
result = (Poliza) session.createQuery(query)
|
||||
.setMaxResults(1)
|
||||
.uniqueResult();
|
||||
public Poliza fillFoliosByPolizas(String abreviacionFolio) {
|
||||
Poliza result = null;
|
||||
Transaction transaction = null;
|
||||
try {
|
||||
logger.info("Search last generated folio..");
|
||||
|
||||
transaction.commit();
|
||||
} catch (HibernateException e) {
|
||||
logger.error("Search for the last generated folio " + e);
|
||||
rollback(transaction);
|
||||
} catch (Exception e) {
|
||||
logger.error("Method fillFoliosByPagos() " + e);
|
||||
rollback(transaction);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
|
||||
transaction = session.beginTransaction();
|
||||
|
||||
public List<Poliza> findPolizasByLocationAndEndDate(Location location, Date startDate, Date endDate) {
|
||||
logger.info("findActive");
|
||||
List<Poliza> results = new ArrayList<>();
|
||||
String query = "SELECT tap FROM Poliza tap "
|
||||
+ "WHERE tap.folio LIKE '" + abreviacionFolio + "%' "
|
||||
+ "ORDER BY "
|
||||
+ "SUBSTRING_INDEX(tap.folio, '-', 1) DESC, "
|
||||
+ "SUBSTRING_INDEX(SUBSTRING_INDEX(tap.folio, '-', -1), '-', -6) DESC ";
|
||||
|
||||
Transaction transaction = null;
|
||||
result = (Poliza) session.createQuery(query)
|
||||
.setMaxResults(1)
|
||||
.uniqueResult();
|
||||
|
||||
try {
|
||||
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
|
||||
transaction = session.beginTransaction();
|
||||
CriteriaBuilder builder = session.getCriteriaBuilder();
|
||||
CriteriaQuery<Poliza> query = builder.createQuery(Poliza.class);
|
||||
Root<Poliza> root = query.from(Poliza.class);
|
||||
transaction.commit();
|
||||
} catch (HibernateException e) {
|
||||
logger.error("Search for the last generated folio " + e);
|
||||
rollback(transaction);
|
||||
} catch (Exception e) {
|
||||
logger.error("Method fillFoliosByPagos() " + e);
|
||||
rollback(transaction);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
LocalDate localStartDate = startDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||
LocalDate localEndDate = endDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||
public Poliza fillFoliosByPolizas2(String abreviacionFolio) {
|
||||
Poliza result = null;
|
||||
Transaction transaction = null;
|
||||
try {
|
||||
logger.info("Search last generated folio..");
|
||||
|
||||
Predicate criterio = builder.equal(root.get("active"), Boolean.TRUE);
|
||||
Predicate criterio2 = builder.equal(root.get("location"), location);
|
||||
Predicate startDatePredicate = builder.greaterThanOrEqualTo(root.get("endDate").as(LocalDate.class), localStartDate);
|
||||
Predicate endDatePredicate = builder.lessThanOrEqualTo(root.get("endDate").as(LocalDate.class), localEndDate);
|
||||
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
|
||||
transaction = session.beginTransaction();
|
||||
|
||||
query.where(builder.and(criterio, criterio2, startDatePredicate, endDatePredicate));
|
||||
query.orderBy(builder.asc(root.get("createdOn")));
|
||||
String query = "SELECT tap FROM Poliza tap "
|
||||
+ "ORDER BY "
|
||||
+ "SUBSTRING_INDEX(SUBSTRING_INDEX(tap.folio, '-', -1), '-', -6) DESC ";
|
||||
|
||||
results = session.createQuery(query).getResultList();
|
||||
result = (Poliza) session.createQuery(query)
|
||||
.setMaxResults(1)
|
||||
.uniqueResult();
|
||||
|
||||
transaction.commit();
|
||||
transaction.commit();
|
||||
} catch (HibernateException e) {
|
||||
logger.error("Search for the last generated folio " + e);
|
||||
rollback(transaction);
|
||||
} catch (Exception e) {
|
||||
logger.error("Method fillFoliosByPagos() " + e);
|
||||
rollback(transaction);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
logger.info("Poliza's list " + results.size());
|
||||
} catch (HibernateException e) {
|
||||
logger.error("Can not load Poliza list ", e);
|
||||
rollback(transaction);
|
||||
} catch (Exception e) {
|
||||
logger.error("Method findActive() ", e);
|
||||
rollback(transaction);
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
public boolean update(Poliza poliza) {
|
||||
logger.info("saveHospitales");
|
||||
public List<Poliza> findPolizasByLocationAndEndDate(Location location, Date startDate, Date endDate) {
|
||||
logger.info("findActive");
|
||||
List<Poliza> results = new ArrayList<>();
|
||||
|
||||
boolean success = false;
|
||||
Transaction transaction = null;
|
||||
Transaction transaction = null;
|
||||
|
||||
try {
|
||||
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
|
||||
transaction = session.beginTransaction();
|
||||
try {
|
||||
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
|
||||
transaction = session.beginTransaction();
|
||||
CriteriaBuilder builder = session.getCriteriaBuilder();
|
||||
CriteriaQuery<Poliza> query = builder.createQuery(Poliza.class);
|
||||
Root<Poliza> root = query.from(Poliza.class);
|
||||
|
||||
session.update(poliza);
|
||||
LocalDate localStartDate = startDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||
LocalDate localEndDate = endDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||
|
||||
transaction.commit();
|
||||
success = true;
|
||||
} catch (HibernateException e) {
|
||||
logger.error("Can not save poliza entry", e);
|
||||
rollback(transaction);
|
||||
} catch (Exception e) {
|
||||
logger.error("Method save()", e);
|
||||
rollback(transaction);
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
private static final long serialVersionUID = -8772793021819350069L;
|
||||
final Logger logger = LogManager.getLogger(PolizaController.class);
|
||||
Predicate criterio = builder.equal(root.get("active"), Boolean.TRUE);
|
||||
Predicate criterio2 = builder.equal(root.get("location"), location);
|
||||
Predicate startDatePredicate = builder.greaterThanOrEqualTo(root.get("endDate").as(LocalDate.class), localStartDate);
|
||||
Predicate endDatePredicate = builder.lessThanOrEqualTo(root.get("endDate").as(LocalDate.class), localEndDate);
|
||||
|
||||
query.where(builder.and(criterio, criterio2, startDatePredicate, endDatePredicate));
|
||||
query.orderBy(builder.asc(root.get("createdOn")));
|
||||
|
||||
results = session.createQuery(query).getResultList();
|
||||
|
||||
transaction.commit();
|
||||
|
||||
logger.info("Poliza's list " + results.size());
|
||||
} catch (HibernateException e) {
|
||||
logger.error("Can not load Poliza list ", e);
|
||||
rollback(transaction);
|
||||
} catch (Exception e) {
|
||||
logger.error("Method findActive() ", e);
|
||||
rollback(transaction);
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
public boolean update(Poliza poliza) {
|
||||
logger.info("saveHospitales");
|
||||
|
||||
boolean success = false;
|
||||
Transaction transaction = null;
|
||||
|
||||
try {
|
||||
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
|
||||
transaction = session.beginTransaction();
|
||||
|
||||
session.update(poliza);
|
||||
|
||||
transaction.commit();
|
||||
success = true;
|
||||
} catch (HibernateException e) {
|
||||
logger.error("Can not save poliza entry", e);
|
||||
rollback(transaction);
|
||||
} catch (Exception e) {
|
||||
logger.error("Method save()", e);
|
||||
rollback(transaction);
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
private static final long serialVersionUID = -8772793021819350069L;
|
||||
final Logger logger = LogManager.getLogger(PolizaController.class);
|
||||
}
|
||||
|
@ -9,31 +9,42 @@ package com.arrebol.taxiservicios.model.enums;
|
||||
* @author Crov
|
||||
*/
|
||||
public enum EstatusPagoMultiple {
|
||||
PAGADO ("Pagado"){
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Pagado";
|
||||
}
|
||||
}, CANCELADO ("Cancelado"){
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Cancelado";
|
||||
}
|
||||
},
|
||||
DEVUELTO ("Devuelto"){
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Devuelto";
|
||||
}
|
||||
};
|
||||
|
||||
private final String type;
|
||||
PROCESANDO("PROCESANDO") {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PROCESANDO";
|
||||
}
|
||||
}, PAGADO("PAGADO") {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PAGADO";
|
||||
}
|
||||
}, CANCELADO("CANCELADO") {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CANCELADO";
|
||||
}
|
||||
},
|
||||
DEVUELTO("DEVUELTO") {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DEVUELTO";
|
||||
}
|
||||
},
|
||||
FALLIDO("FALLIDO") {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "FALLIDO";
|
||||
}
|
||||
};
|
||||
|
||||
private EstatusPagoMultiple(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
private final String type;
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
private EstatusPagoMultiple(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
|
@ -73,6 +73,14 @@ public class DetellePagoPoliza implements Serializable {
|
||||
@Column(name = "metodo_pago", nullable = true)
|
||||
private MetodoPago metodoPago;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY, optional = true)
|
||||
@JoinColumn(
|
||||
name = "id_abono_multiple",
|
||||
referencedColumnName = "id",
|
||||
nullable = true
|
||||
)
|
||||
private HistorialAbonoMultiple historialAbonoMultiple;
|
||||
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
@Column(name = "created_on")
|
||||
private Date createdOn;
|
||||
@ -200,4 +208,12 @@ public class DetellePagoPoliza implements Serializable {
|
||||
this.cobro = cobro;
|
||||
}
|
||||
|
||||
public HistorialAbonoMultiple getHistorialAbonoMultiple() {
|
||||
return historialAbonoMultiple;
|
||||
}
|
||||
|
||||
public void setHistorialAbonoMultiple(HistorialAbonoMultiple historialAbonoMultiple) {
|
||||
this.historialAbonoMultiple = historialAbonoMultiple;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,242 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
||||
*/
|
||||
package com.crov.prase.model.prase;
|
||||
|
||||
import com.arrebol.taxiservicios.model.catalog.Location;
|
||||
import com.arrebol.taxiservicios.model.core.User;
|
||||
import com.arrebol.taxiservicios.model.enums.EstatusPagoMultiple;
|
||||
import com.arrebol.taxiservicios.model.enums.MetodoPago;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.EnumType;
|
||||
import javax.persistence.Enumerated;
|
||||
import javax.persistence.FetchType;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Crov
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "historial_abono_multiple")
|
||||
public class HistorialAbonoMultiple implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -6653037938225719593L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(generator = "uuid")
|
||||
@GenericGenerator(name = "uuid", strategy = "uuid2")
|
||||
@Column(name = "id", length = 36)
|
||||
private String id;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY, optional = false)
|
||||
@JoinColumn(
|
||||
name = "id_location",
|
||||
referencedColumnName = "id",
|
||||
nullable = false
|
||||
)
|
||||
private Location location;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
@Column(name = "estatus", nullable = false)
|
||||
private EstatusPagoMultiple estatus;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY, optional = false)
|
||||
@JoinColumn(
|
||||
name = "id_poliza",
|
||||
referencedColumnName = "id",
|
||||
nullable = false
|
||||
)
|
||||
private Poliza poliza;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY, optional = true)
|
||||
@JoinColumn(
|
||||
name = "cobro",
|
||||
referencedColumnName = "id",
|
||||
nullable = true
|
||||
)
|
||||
private User cobro;
|
||||
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
@Column(name = "fecha_pago")
|
||||
private Date fechaPago;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
@Column(name = "metodo_pago", nullable = true)
|
||||
private MetodoPago metodoPago;
|
||||
|
||||
@Column(name = "total_pago", nullable = true)
|
||||
private Double totalPago;
|
||||
|
||||
@Column(name = "folios", nullable = true)
|
||||
private String folios;
|
||||
|
||||
@Column(name = "detalle", nullable = true)
|
||||
private String detalle;
|
||||
|
||||
@Column(name = "cometario", nullable = true)
|
||||
private String cometario;
|
||||
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
@Column(name = "created_on")
|
||||
private Date createdOn;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY, optional = false)
|
||||
@JoinColumn(
|
||||
name = "created_by",
|
||||
referencedColumnName = "id",
|
||||
nullable = false
|
||||
)
|
||||
private User createdBy;
|
||||
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
@Column(name = "last_updated_on")
|
||||
private Date lastUpdatedOn;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY, optional = true)
|
||||
@JoinColumn(
|
||||
name = "last_updated_by",
|
||||
referencedColumnName = "id",
|
||||
nullable = true
|
||||
)
|
||||
private User lastUpdatedBy;
|
||||
|
||||
public HistorialAbonoMultiple() {
|
||||
}
|
||||
|
||||
public HistorialAbonoMultiple(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Location getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setLocation(Location location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
public Poliza getPoliza() {
|
||||
return poliza;
|
||||
}
|
||||
|
||||
public void setPoliza(Poliza poliza) {
|
||||
this.poliza = poliza;
|
||||
}
|
||||
|
||||
public User getCobro() {
|
||||
return cobro;
|
||||
}
|
||||
|
||||
public void setCobro(User cobro) {
|
||||
this.cobro = cobro;
|
||||
}
|
||||
|
||||
public Double getTotalPago() {
|
||||
return totalPago;
|
||||
}
|
||||
|
||||
public void setTotalPago(Double totalPago) {
|
||||
this.totalPago = totalPago;
|
||||
}
|
||||
|
||||
public String getFolios() {
|
||||
return folios;
|
||||
}
|
||||
|
||||
public void setFolios(String folios) {
|
||||
this.folios = folios;
|
||||
}
|
||||
|
||||
public String getDetalle() {
|
||||
return detalle;
|
||||
}
|
||||
|
||||
public void setDetalle(String detalle) {
|
||||
this.detalle = detalle;
|
||||
}
|
||||
|
||||
public String getCometario() {
|
||||
return cometario;
|
||||
}
|
||||
|
||||
public void setCometario(String cometario) {
|
||||
this.cometario = cometario;
|
||||
}
|
||||
|
||||
public EstatusPagoMultiple getEstatus() {
|
||||
return estatus;
|
||||
}
|
||||
|
||||
public void setEstatus(EstatusPagoMultiple estatus) {
|
||||
this.estatus = estatus;
|
||||
}
|
||||
|
||||
public Date getFechaPago() {
|
||||
return fechaPago;
|
||||
}
|
||||
|
||||
public void setFechaPago(Date fechaPago) {
|
||||
this.fechaPago = fechaPago;
|
||||
}
|
||||
|
||||
public Date getCreatedOn() {
|
||||
return createdOn;
|
||||
}
|
||||
|
||||
public void setCreatedOn(Date createdOn) {
|
||||
this.createdOn = createdOn;
|
||||
}
|
||||
|
||||
public User getCreatedBy() {
|
||||
return createdBy;
|
||||
}
|
||||
|
||||
public void setCreatedBy(User createdBy) {
|
||||
this.createdBy = createdBy;
|
||||
}
|
||||
|
||||
public Date getLastUpdatedOn() {
|
||||
return lastUpdatedOn;
|
||||
}
|
||||
|
||||
public void setLastUpdatedOn(Date lastUpdatedOn) {
|
||||
this.lastUpdatedOn = lastUpdatedOn;
|
||||
}
|
||||
|
||||
public User getLastUpdatedBy() {
|
||||
return lastUpdatedBy;
|
||||
}
|
||||
|
||||
public void setLastUpdatedBy(User lastUpdatedBy) {
|
||||
this.lastUpdatedBy = lastUpdatedBy;
|
||||
}
|
||||
|
||||
public MetodoPago getMetodoPago() {
|
||||
return metodoPago;
|
||||
}
|
||||
|
||||
public void setMetodoPago(MetodoPago metodoPago) {
|
||||
this.metodoPago = metodoPago;
|
||||
}
|
||||
|
||||
}
|
@ -79,6 +79,7 @@
|
||||
<mapping class="com.crov.prase.model.catalog.Despacho"/>
|
||||
<mapping class="com.crov.prase.model.prase.Poliza"/>
|
||||
<mapping class="com.crov.prase.model.prase.PagosPoliza"/>
|
||||
<mapping class="com.crov.prase.model.prase.HistorialAbonoMultiple"/>
|
||||
<mapping class="com.crov.prase.model.prase.DetellePagoPoliza"/>
|
||||
<mapping class="com.arrebol.taxiservicios.model.catalog.UserLocation"/>
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -12,12 +12,14 @@ import com.arrebol.taxiservicios.model.enums.PolizaEstatus;
|
||||
import com.crov.prase.controller.prase.PagosPolizaController;
|
||||
import com.crov.prase.controller.prase.PolizaController;
|
||||
import com.crov.prase.model.prase.DetellePagoPoliza;
|
||||
import com.crov.prase.model.prase.HistorialAbonoMultiple;
|
||||
import com.crov.prase.model.prase.PagosPoliza;
|
||||
import com.crov.prase.model.prase.Poliza;
|
||||
import java.io.Serializable;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.faces.application.FacesMessage;
|
||||
import javax.faces.view.ViewScoped;
|
||||
@ -48,9 +50,11 @@ public class PagosPolizasBean extends TaxiGenericBean implements Serializable {
|
||||
private DetellePagoPoliza selectedDetellePago;
|
||||
private String pagoSiguiente;
|
||||
private Double cantidadAPagar;
|
||||
private String comentario;
|
||||
private Boolean pagoExitoso;
|
||||
private String imagen;
|
||||
private String metodoPago;
|
||||
private HistorialAbonoMultiple selectedHistorialAbonoMultiple;
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
@ -92,6 +96,42 @@ public class PagosPolizasBean extends TaxiGenericBean implements Serializable {
|
||||
|
||||
public void cargarPago() {
|
||||
setCantidadAPagar(getSelectedPago().getDiferenciaPago());
|
||||
setSelectedDetellePago(null);
|
||||
setMetodoPago("");
|
||||
}
|
||||
|
||||
public void pagarMultiple() {
|
||||
logger.info("pagarMultiple()");
|
||||
setPagoExitoso(false);
|
||||
|
||||
if (getGenericController().existClosingDayByCreatedOn(new Date(), getLoggedUser())) {
|
||||
showMessage(FacesMessage.SEVERITY_WARN, "Error", "No se puede hacer ninguna acción si existe un corte del día");
|
||||
return;
|
||||
}
|
||||
|
||||
if (getGenericController().existStableGeneralBoxByCurdate(getLoggedUser())) {
|
||||
showMessage(FacesMessage.SEVERITY_WARN, "Dia cerrado", "No se puede hacer ninguna acción porque ya existe un cuadre de caja chica del día");
|
||||
return;
|
||||
}
|
||||
|
||||
if (getCantidadAPagar() <= 0.0) {
|
||||
showMessage(FacesMessage.SEVERITY_WARN, "Error", "El monto a pagar debe de ser mayor a 0");
|
||||
return;
|
||||
}
|
||||
|
||||
// se actuliza el pago
|
||||
String estatusPagoMultiple = getPagosPolizaController().procesarPagoMultiple(getSelectedPoliza(), getCantidadAPagar(), getMetodoPago(), getComentario(), getLoggedUser());
|
||||
if (esUUIDValido(estatusPagoMultiple)) {
|
||||
setImagen("images/prase_logo.jpeg");
|
||||
setSelectedHistorialAbonoMultiple(getPagosPolizaController().getHistorialAbonoMultipleById(estatusPagoMultiple));
|
||||
setPagoExitoso(true);
|
||||
cargarPolizas();
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Pago realizado", "El pago multiple se a realizado correctamente");
|
||||
} else {
|
||||
setPagoExitoso(false);
|
||||
setSelectedHistorialAbonoMultiple(null);
|
||||
showMessage(FacesMessage.SEVERITY_ERROR, "Error", estatusPagoMultiple);
|
||||
}
|
||||
}
|
||||
|
||||
public void pagar() {
|
||||
@ -131,7 +171,6 @@ public class PagosPolizasBean extends TaxiGenericBean implements Serializable {
|
||||
} else {
|
||||
showMessage(FacesMessage.SEVERITY_WARN, "Error", "Solo puede pagar el pago consecutivo");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private boolean actualizarAbono(PagosPoliza pagoA, Double montoPagado, String metodoDePago) {
|
||||
@ -191,6 +230,16 @@ public class PagosPolizasBean extends TaxiGenericBean implements Serializable {
|
||||
public void limpiarDetallePago() {
|
||||
setSelectedDetellePago(null);
|
||||
setPagoExitoso(false);
|
||||
setCantidadAPagar(0.0);
|
||||
setMetodoPago("");
|
||||
}
|
||||
|
||||
public void limpiarDetallePagoMultiple() {
|
||||
setSelectedHistorialAbonoMultiple(null);
|
||||
setPagoExitoso(false);
|
||||
setCantidadAPagar(0.0);
|
||||
setMetodoPago("");
|
||||
setComentario(null);
|
||||
}
|
||||
|
||||
private String obtenerFolio(String ab) {
|
||||
@ -198,7 +247,7 @@ public class PagosPolizasBean extends TaxiGenericBean implements Serializable {
|
||||
try {
|
||||
// Se cargan los abonos para validar el folio
|
||||
String abreviacion = ab;
|
||||
PagosPoliza ultimoFolio = getPagosPolizaController().fillFoliosByPagos(abreviacion);
|
||||
DetellePagoPoliza ultimoFolio = getPagosPolizaController().fillFoliosByPagos(abreviacion);
|
||||
// Se valida si ya existen folios registrados para el proyecto y se le asigna el último encontrado
|
||||
int consecutivo = 0;
|
||||
if (ultimoFolio != null) {
|
||||
@ -249,6 +298,18 @@ public class PagosPolizasBean extends TaxiGenericBean implements Serializable {
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean esUUIDValido(String valor) {
|
||||
if (valor == null) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
UUID uuid = UUID.fromString(valor);
|
||||
return valor.equals(uuid.toString());
|
||||
} catch (IllegalArgumentException ex) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private Date correcciónDeHr(Date fecha, int horas) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(fecha);
|
||||
@ -378,4 +439,20 @@ public class PagosPolizasBean extends TaxiGenericBean implements Serializable {
|
||||
this.listDetallePagosPolizas = listDetallePagosPolizas;
|
||||
}
|
||||
|
||||
public String getComentario() {
|
||||
return comentario;
|
||||
}
|
||||
|
||||
public void setComentario(String comentario) {
|
||||
this.comentario = comentario;
|
||||
}
|
||||
|
||||
public HistorialAbonoMultiple getSelectedHistorialAbonoMultiple() {
|
||||
return selectedHistorialAbonoMultiple;
|
||||
}
|
||||
|
||||
public void setSelectedHistorialAbonoMultiple(HistorialAbonoMultiple selectedHistorialAbonoMultiple) {
|
||||
this.selectedHistorialAbonoMultiple = selectedHistorialAbonoMultiple;
|
||||
}
|
||||
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -105,7 +105,7 @@
|
||||
<h:outputText value="#{data.createdBy.person.firstName} #{data.createdBy.person.secondName} #{data.createdBy.person.lastName} #{data.createdBy.person.middleName}" />
|
||||
</p:column>
|
||||
|
||||
<p:column headerText="Acciones">
|
||||
<p:column headerText="Acciones" style="width: 9em">
|
||||
<p:commandButton
|
||||
process="@this"
|
||||
value="Pagos"
|
||||
@ -116,6 +116,17 @@
|
||||
action="#{pagosPolizasBean.cargarPagosPoliza()}" >
|
||||
<f:setPropertyActionListener value="#{data}" target="#{pagosPolizasBean.selectedPoliza}"/>
|
||||
</p:commandButton>
|
||||
|
||||
<p:commandButton
|
||||
process="@this"
|
||||
value="Pago multiple"
|
||||
title="Pago multiple"
|
||||
style="background-color: #4D9190; margin-top: 0.5em"
|
||||
update="pagarMultipleForm"
|
||||
oncomplete="PF('pagarMultipleDialog').show()"
|
||||
action="#{pagosPolizasBean.limpiarDetallePago()}" >
|
||||
<f:setPropertyActionListener value="#{data}" target="#{pagosPolizasBean.selectedPoliza}"/>
|
||||
</p:commandButton>
|
||||
</p:column>
|
||||
|
||||
</p:dataTable>
|
||||
@ -193,7 +204,7 @@
|
||||
|
||||
|
||||
<p:commandButton
|
||||
process="@this"
|
||||
process="@this"
|
||||
value="Detalles"
|
||||
title="Detalles"
|
||||
oncomplete="PF('detallePagosDialog').show()"
|
||||
@ -278,13 +289,13 @@
|
||||
<p:outputPanel style="margin-top: 1em" >
|
||||
|
||||
<h:panelGroup id="panel" style="margin-top: 2em; margin-bottom: 2em">
|
||||
|
||||
<h:panelGroup styleClass="md-inputfield" >
|
||||
<p:inputNumber id="canridadPagada" value="#{pagosPolizasBean.cantidadAPagar}" minValue="0" decimalPlaces="2" autocomplete="off" required="true" requiredMessage="El nomero de pagos es obligatorio" style="width: 100%;" />
|
||||
<label>Cantidad a pagar</label>
|
||||
<p:message for="canridadPagada" display="text"/>
|
||||
</h:panelGroup>
|
||||
|
||||
|
||||
<h:panelGroup styleClass="md-inputfield" >
|
||||
<p:inputNumber id="canridadPagada" value="#{pagosPolizasBean.cantidadAPagar}" minValue="0" decimalPlaces="3" autocomplete="off" required="true" requiredMessage="El monto a pagar es obligatorio" style="width: 100%;" />
|
||||
<label>Cantidad a pagar</label>
|
||||
<p:message for="canridadPagada" display="text"/>
|
||||
</h:panelGroup>
|
||||
|
||||
</h:panelGroup>
|
||||
|
||||
<h:panelGroup styleClass="md-inputfield" style="margin-top: 2em; margin-bottom: 2em" >
|
||||
@ -309,6 +320,47 @@
|
||||
</p:dialog>
|
||||
</h:form>
|
||||
|
||||
<h:form id="pagarMultipleForm">
|
||||
<p:dialog widgetVar="pagarMultipleDialog" height="30%" width="30%" id="pagarMultipleDialog" header="Abono multiple" modal="true">
|
||||
<p:ajax event="close" update="pagarMultipleDialog" />
|
||||
<p:outputPanel style="margin-top: 1em" >
|
||||
|
||||
<h:panelGroup id="panel" style="margin-top: 2em; margin-bottom: 2em">
|
||||
<h:panelGroup styleClass="md-inputfield" >
|
||||
<p:inputNumber id="canridadPagada" value="#{pagosPolizasBean.cantidadAPagar}" minValue="0" decimalPlaces="2" autocomplete="off" required="true" requiredMessage="El monto a pagar es obligatorio" style="width: 100%;" />
|
||||
<label>Cantidad a pagar</label>
|
||||
<p:message for="canridadPagada" display="text"/>
|
||||
</h:panelGroup>
|
||||
</h:panelGroup>
|
||||
|
||||
<h:panelGroup styleClass="md-inputfield" style="margin-top: 2em; margin-bottom: 2em" >
|
||||
<p:selectOneMenu
|
||||
id="metodoPagoSlct"
|
||||
style="width:100%"
|
||||
value="#{pagosPolizasBean.metodoPago}"
|
||||
required="true"
|
||||
requiredMessage="El método de pago es obligatorio en las pólizas marcadas como liquidadas" >
|
||||
<f:selectItem itemLabel="Selecione el método de pago" itemValue="" />
|
||||
<f:selectItem itemLabel="Efectivo" itemValue="EFECTIVO" />
|
||||
<f:selectItem itemLabel="Tarjeta" itemValue="TARJETA" />
|
||||
<f:selectItem itemLabel="Deposito" itemValue="DEPOSITO" />
|
||||
<f:selectItem itemLabel="Trasferencia" itemValue="TRASFERENCIA" />
|
||||
</p:selectOneMenu>
|
||||
<p:message for="metodoPagoSlct" display="text"/>
|
||||
</h:panelGroup>
|
||||
|
||||
<h:panelGroup styleClass="md-inputfield" >
|
||||
<p:inputText id="comentario" value="#{pagosPolizasBean.comentario}" style="width: 100%;" />
|
||||
<label>Comentario</label>
|
||||
<p:message for="comentario" display="text"/>
|
||||
</h:panelGroup>
|
||||
|
||||
<p:commandButton id="addButton1" value="Pagar" actionListener="#{pagosPolizasBean.pagarMultiple()}" update="form, pagosForm:dtPagos, pagarMultipleForm, formTicketMultiple" oncomplete="PF('printerMultiple').show()" />
|
||||
|
||||
</p:outputPanel>
|
||||
</p:dialog>
|
||||
</h:form>
|
||||
|
||||
<h:form id="formTicket">
|
||||
<p:dialog header="Vista previa del ticket" widgetVar="printer" minHeight="40" width="350" showEffect="fade" id="printer">
|
||||
<p:ajax event="close" update="printer" listener="#{pagosPolizasBean.limpiarDetallePago()}" />
|
||||
@ -355,7 +407,52 @@
|
||||
</h:panelGroup>
|
||||
</f:facet>
|
||||
</p:dialog>
|
||||
</h:form>
|
||||
|
||||
<h:form id="formTicketMultiple">
|
||||
<p:dialog header="Vista previa del ticket de pago multiple" widgetVar="printerMultiple" minHeight="40" width="350" showEffect="fade" id="printerMultiple">
|
||||
<p:ajax event="close" update="printerMultiple" listener="#{pagosPolizasBean.limpiarDetallePagoMultiple()}" />
|
||||
<p:outputPanel id="pnlPrint" class="no-page-break scrollable-panel" rendered="#{pagosPolizasBean.pagoExitoso}">
|
||||
<p:graphicImage name="#{pagosPolizasBean.imagen}" style="width: 110px; height: 100px; display: block; margin-left: auto; margin-right: auto;" library="serenity-layout"/>
|
||||
<div class="details">
|
||||
<p><strong>Poliza: </strong>
|
||||
<h:outputText value="#{pagosPolizasBean.selectedHistorialAbonoMultiple.poliza.folio}" style="margin-right: 5em" />
|
||||
</p>
|
||||
<p><strong>Fecha: </strong>
|
||||
<h:outputText value="#{pagosPolizasBean.selectedHistorialAbonoMultiple.fechaPago}" style="margin-right: 5em">
|
||||
<f:convertDateTime type="date" locale="es" timeZone="GMT-6" pattern="dd - MMMM - yyyy"/>
|
||||
</h:outputText>
|
||||
</p>
|
||||
<p><strong><h:outputText value="CLIENTE: " /></strong> <h:outputText value="#{pagosPolizasBean.selectedHistorialAbonoMultiple.poliza.customer.firstName} #{pagosPolizasBean.selectedHistorialAbonoMultiple.poliza.customer.secondName} #{pagosPolizasBean.selectedHistorialAbonoMultiple.poliza.customer.lastName}" /></p>
|
||||
<p><strong><h:outputText value="PAGO: " /></strong> <h:outputText value="#{pagosPolizasBean.selectedHistorialAbonoMultiple.totalPago}" ><f:convertNumber currencySymbol="$" groupingUsed="true" maxFractionDigits="2" type="currency" locale="en" /></h:outputText></p>
|
||||
<p><strong><h:outputText value="PAGO RESTANTE: " /></strong> <h:outputText value="#{pagosPolizasBean.selectedHistorialAbonoMultiple.poliza.amount - pagosPolizasBean.selectedHistorialAbonoMultiple.poliza.cantidadPagada}" ><f:convertNumber currencySymbol="$" groupingUsed="true" maxFractionDigits="2" type="currency" locale="en" /></h:outputText></p>
|
||||
<p><strong><h:outputText value="COBRO: " /></strong> <h:outputText value="#{pagosPolizasBean.selectedHistorialAbonoMultiple.cobro.person.firstName} #{pagosPolizasBean.selectedHistorialAbonoMultiple.cobro.person.secondName} #{pagosPolizasBean.selectedHistorialAbonoMultiple.cobro.person.lastName} #{pagosPolizasBean.selectedHistorialAbonoMultiple.cobro.person.middleName}"/></p>
|
||||
<p><strong><h:outputText value="MÉTODO DE PAGO: " /></strong> <h:outputText value="#{pagosPolizasBean.selectedHistorialAbonoMultiple.metodoPago.type}" ></h:outputText></p>
|
||||
<p><strong><h:outputText value="PAGOS REALIZADOS: " /></strong> <h:outputText value="#{pagosPolizasBean.selectedHistorialAbonoMultiple.detalle}" ></h:outputText></p>
|
||||
</div>
|
||||
<p><center><strong><h:outputText value="#{pagosPolizasBean.loggedUser.location.businessName}" /><br/> AGRADECE SU PREFERENCIA </strong></center></p>
|
||||
<p>
|
||||
<h:outputText value="#{pagosPolizasBean.loggedUser.location.completeAddress}, " />
|
||||
<h:outputText value="#{pagosPolizasBean.loggedUser.location.municipality}, " />
|
||||
<h:outputText value="#{pagosPolizasBean.loggedUser.location.state}, " />
|
||||
<h:outputText value="#{pagosPolizasBean.loggedUser.location.postalCode}" />
|
||||
</p>
|
||||
<p><strong><h:outputText value="RFC: " /> </strong> <h:outputText value="#{pagosPolizasBean.loggedUser.location.rfc}" /> </p>
|
||||
<p><strong><h:outputText value="TEL: " /> </strong> <h:outputText value="#{pagosPolizasBean.loggedUser.location.phone}" /> </p>
|
||||
</p:outputPanel>
|
||||
|
||||
<p:outputPanel id="pnlPrint2" class="no-page-break" rendered="#{!pagosPolizasBean.pagoExitoso}">
|
||||
<h3>ERROR AL GENERAR EL PAGO </h3>
|
||||
</p:outputPanel>
|
||||
|
||||
<f:facet name="footer">
|
||||
<h:panelGroup >
|
||||
<p:commandButton value="Imprimir" title="Imprimir" icon="ui-icon-print">
|
||||
<p:printer target="pnlPrint" />
|
||||
</p:commandButton>
|
||||
</h:panelGroup>
|
||||
</f:facet>
|
||||
</p:dialog>
|
||||
</h:form>
|
||||
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user