- DEVOLUCION DE ABONOS
This commit is contained in:
parent
96575e133d
commit
deb3434d7d
@ -697,10 +697,11 @@ public class ClosingDayController extends ConnectionManager implements Serializa
|
|||||||
List<ClosingDayDetail> details = new ArrayList<>();
|
List<ClosingDayDetail> details = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
|
|
||||||
details.addAll(buildDetailsList(4, executeNativeSQLQuery(query_details_expenses, userID)));
|
details.addAll(buildDetailsList(1, executeNativeSQLQuery(query_details_expenses, userID)));
|
||||||
details.addAll(buildDetailsList(13, executeNativeSQLQuery(query_details_expenses_by_type, userID)));
|
details.addAll(buildDetailsList(2, executeNativeSQLQuery(query_details_expenses_by_type, userID)));
|
||||||
details.addAll(buildDetailsList(13, executeNativeSQLQuery(query_details_expenses_by_type_earning, userID)));
|
details.addAll(buildDetailsList(2, executeNativeSQLQuery(query_details_expenses_by_type_earning, userID)));
|
||||||
details.addAll(buildDetailsList(25, executeNativeSQLQuery(query_poliza_prase, userID)));
|
details.addAll(buildDetailsList(3, executeNativeSQLQuery(query_poliza_prase, userID)));
|
||||||
|
details.addAll(buildDetailsList(4, executeNativeSQLQuery(query_poliza_prase_devolcion, userID)));
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error(e);
|
logger.error(e);
|
||||||
@ -1030,13 +1031,34 @@ public class ClosingDayController extends ConnectionManager implements Serializa
|
|||||||
+ "UNION "
|
+ "UNION "
|
||||||
+ "SELECT e.payment, eic.name, e.driver_id, e.description, " + complete_name + ", e.id FROM expense e INNER JOIN expense_income_catalog eic ON e.id_expense_type = eic.id LEFT JOIN person p ON e.driver_id = p.id WHERE p.id IS NULL AND e.taxi_id is null AND DATE(e.created_on) > " + sub_query_to_find_previously_closing_day + " AND e.expense_status_type = 'AUTHORIZED' AND eic.type = 'EARNING' AND e.created_by = :userID ";
|
+ "SELECT e.payment, eic.name, e.driver_id, e.description, " + complete_name + ", e.id FROM expense e INNER JOIN expense_income_catalog eic ON e.id_expense_type = eic.id LEFT JOIN person p ON e.driver_id = p.id WHERE p.id IS NULL AND e.taxi_id is null AND DATE(e.created_on) > " + sub_query_to_find_previously_closing_day + " AND e.expense_status_type = 'AUTHORIZED' AND eic.type = 'EARNING' AND e.created_by = :userID ";
|
||||||
|
|
||||||
private final String query_poliza_prase = "SELECT e.cantidad_pagada, (CASE WHEN pa.tipo_pago = 'ABONO' THEN CONCAT('PAGO - ', e.metodo_pago) WHEN pa.tipo_pago = 'ANTICIPO' THEN CONCAT('ANTICIPO - ', e.metodo_pago) ELSE ' ' END) AS tipo_pago, p.id as person, CONCAT(e.folio, ' -> ', ve.folio), " + complete_name + ", e.id "
|
private final String query_poliza_prase = "SELECT e.cantidad_pagada, "
|
||||||
|
+ "(CASE "
|
||||||
|
+ "WHEN e.tipo_pago = 'ABONO' THEN CONCAT('PAGO - ', e.metodo_pago) "
|
||||||
|
+ "WHEN e.tipo_pago = 'DEVOLUCION' THEN CONCAT('DEVOLUCION - ', e.metodo_pago) ELSE ' ' END) AS tipo_pago, "
|
||||||
|
+ "p.id as person, CONCAT(e.folio, ' -> ', ve.folio), " + complete_name + ", e.id "
|
||||||
+ "FROM detelle_pago_poliza e "
|
+ "FROM detelle_pago_poliza e "
|
||||||
+ "INNER JOIN pagos_poliza pa ON e.id_pago_poliza = pa.id "
|
+ "INNER JOIN pagos_poliza pa ON e.id_pago_poliza = pa.id "
|
||||||
+ "INNER JOIN poliza_prase ve ON pa.id_poliza = ve.id "
|
+ "INNER JOIN poliza_prase ve ON pa.id_poliza = ve.id "
|
||||||
+ "INNER JOIN person p ON ve.id_customer = p.id "
|
+ "INNER JOIN person p ON ve.id_customer = p.id "
|
||||||
+ "WHERE DATE(e.fecha_pago) > " + sub_query_to_find_previously_closing_day
|
+ "WHERE DATE(e.fecha_pago) > " + sub_query_to_find_previously_closing_day
|
||||||
+ "AND e.estatus_activo = 'ENABLED' "
|
+ "AND e.estatus_activo = 'ENABLED' "
|
||||||
|
+ " AND (e.estatus_pago = 'ENABLED' OR e.estatus_pago = 'CANCELED') "
|
||||||
|
+ " AND e.tipo_pago = 'ABONO' "
|
||||||
|
+ "AND e.cobro = :userID ";
|
||||||
|
|
||||||
|
private final String query_poliza_prase_devolcion = "SELECT e.cantidad_pagada, "
|
||||||
|
+ "(CASE "
|
||||||
|
+ "WHEN e.tipo_pago = 'ABONO' THEN CONCAT('PAGO - ', e.metodo_pago) "
|
||||||
|
+ "WHEN e.tipo_pago = 'DEVOLUCION' THEN CONCAT('DEVOLUCION - ', e.metodo_pago) ELSE ' ' END) AS tipo_pago, "
|
||||||
|
+ "p.id as person, CONCAT(e.folio, ' -> ', ve.folio), " + complete_name + ", e.id "
|
||||||
|
+ "FROM detelle_pago_poliza e "
|
||||||
|
+ "INNER JOIN pagos_poliza pa ON e.id_pago_poliza = pa.id "
|
||||||
|
+ "INNER JOIN poliza_prase ve ON pa.id_poliza = ve.id "
|
||||||
|
+ "INNER JOIN person p ON ve.id_customer = p.id "
|
||||||
|
+ "WHERE DATE(e.fecha_pago) > " + sub_query_to_find_previously_closing_day
|
||||||
|
+ "AND e.estatus_activo = 'ENABLED' "
|
||||||
|
+ " AND e.estatus_pago = 'ENABLED' "
|
||||||
|
+ " AND e.tipo_pago = 'DEVOLUCION' "
|
||||||
+ "AND e.cobro = :userID ";
|
+ "AND e.cobro = :userID ";
|
||||||
|
|
||||||
final Logger logger = LogManager.getLogger(ClosingDayController.class);
|
final Logger logger = LogManager.getLogger(ClosingDayController.class);
|
||||||
|
@ -9,13 +9,16 @@ import com.arrebol.taxiservicios.controller.util.HibernateUtil;
|
|||||||
import com.arrebol.taxiservicios.model.catalog.Location;
|
import com.arrebol.taxiservicios.model.catalog.Location;
|
||||||
import com.arrebol.taxiservicios.model.core.User;
|
import com.arrebol.taxiservicios.model.core.User;
|
||||||
import com.arrebol.taxiservicios.model.enums.EstatusPagoMultiple;
|
import com.arrebol.taxiservicios.model.enums.EstatusPagoMultiple;
|
||||||
|
import com.arrebol.taxiservicios.model.enums.EstatusSolicitud;
|
||||||
import com.arrebol.taxiservicios.model.enums.GenericEnumType;
|
import com.arrebol.taxiservicios.model.enums.GenericEnumType;
|
||||||
import com.arrebol.taxiservicios.model.enums.MetodoPago;
|
import com.arrebol.taxiservicios.model.enums.MetodoPago;
|
||||||
import com.arrebol.taxiservicios.model.enums.PolizaEstatus;
|
import com.arrebol.taxiservicios.model.enums.PolizaEstatus;
|
||||||
|
import com.arrebol.taxiservicios.model.enums.TipoAbono;
|
||||||
import com.crov.prase.model.prase.DetellePagoPoliza;
|
import com.crov.prase.model.prase.DetellePagoPoliza;
|
||||||
import com.crov.prase.model.prase.HistorialAbonoMultiple;
|
import com.crov.prase.model.prase.HistorialAbonoMultiple;
|
||||||
import com.crov.prase.model.prase.PagosPoliza;
|
import com.crov.prase.model.prase.PagosPoliza;
|
||||||
import com.crov.prase.model.prase.Poliza;
|
import com.crov.prase.model.prase.Poliza;
|
||||||
|
import com.crov.prase.model.prase.SolicitudDevolucionDetellePagoPoliza;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
@ -371,6 +374,8 @@ public class PagosPolizaController extends ConnectionManager implements Serializ
|
|||||||
detalle.setId(UUID.randomUUID().toString());
|
detalle.setId(UUID.randomUUID().toString());
|
||||||
detalle.setPagoPoliza(pago);
|
detalle.setPagoPoliza(pago);
|
||||||
detalle.setEstatusActivo(GenericEnumType.ENABLED);
|
detalle.setEstatusActivo(GenericEnumType.ENABLED);
|
||||||
|
detalle.setEstatusPago(GenericEnumType.ENABLED);
|
||||||
|
detalle.setTipoPago(TipoAbono.ABONO);
|
||||||
detalle.setFechaPago(fechaActual);
|
detalle.setFechaPago(fechaActual);
|
||||||
detalle.setCantidadPagada(montoAplicar);
|
detalle.setCantidadPagada(montoAplicar);
|
||||||
detalle.setCobro(user);
|
detalle.setCobro(user);
|
||||||
@ -510,6 +515,203 @@ public class PagosPolizaController extends ConnectionManager implements Serializ
|
|||||||
return general;
|
return general;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean createSolicitudDevolucionDetellePagoPoliza(SolicitudDevolucionDetellePagoPoliza modelo, User user) {
|
||||||
|
logger.info("createDetellePago");
|
||||||
|
boolean success = false;
|
||||||
|
Transaction transaction = null;
|
||||||
|
try {
|
||||||
|
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
|
||||||
|
transaction = session.beginTransaction();
|
||||||
|
modelo.setId(UUID.randomUUID().toString());
|
||||||
|
modelo.setCreatedOn(correcciónDeHr(new Date(), -7));
|
||||||
|
modelo.setCreatedBy(user);
|
||||||
|
session.save(modelo);
|
||||||
|
transaction.commit();
|
||||||
|
success = true;
|
||||||
|
} catch (HibernateException e) {
|
||||||
|
logger.error("Detalle pago can not be added ", e);
|
||||||
|
rollback(transaction);
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("Method createDetellePago() ", e);
|
||||||
|
rollback(transaction);
|
||||||
|
}
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<SolicitudDevolucionDetellePagoPoliza> fillSolicitudDevolucionDetellePagoPolizaByLocation(String idLocation) {
|
||||||
|
logger.info("fillSolicitudDevolucionDetellePagoPolizaByLocation");
|
||||||
|
List<SolicitudDevolucionDetellePagoPoliza> resultList = null;
|
||||||
|
Transaction transaction = null;
|
||||||
|
try {
|
||||||
|
logger.info("Searching solicitudes..");
|
||||||
|
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
|
||||||
|
transaction = session.beginTransaction();
|
||||||
|
CriteriaBuilder builder = session.getCriteriaBuilder();
|
||||||
|
|
||||||
|
CriteriaQuery<SolicitudDevolucionDetellePagoPoliza> criteria = builder.createQuery(SolicitudDevolucionDetellePagoPoliza.class);
|
||||||
|
Root<SolicitudDevolucionDetellePagoPoliza> root = criteria.from(SolicitudDevolucionDetellePagoPoliza.class);
|
||||||
|
|
||||||
|
Predicate criterio1 = builder.equal(root.get("location").get("id"), idLocation);
|
||||||
|
Predicate criterio2 = builder.equal(root.get("estatusActivo"), GenericEnumType.ENABLED);
|
||||||
|
|
||||||
|
criteria.where(builder.and(criterio1, criterio2));
|
||||||
|
criteria.orderBy(builder.asc(root.get("createdOn")));
|
||||||
|
|
||||||
|
resultList = session.createQuery(criteria).getResultList();
|
||||||
|
|
||||||
|
logger.info("Total of solicitudes found: " + (null == resultList ? -1 : resultList.size()));
|
||||||
|
transaction.commit();
|
||||||
|
} catch (HibernateException e) {
|
||||||
|
logger.error("solicitudes cannot be loaded ");
|
||||||
|
rollback(transaction);
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("Method fillSolicitudDevolucionDetellePagoPolizaByLocation ", e);
|
||||||
|
rollback(transaction);
|
||||||
|
}
|
||||||
|
return resultList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<SolicitudDevolucionDetellePagoPoliza> fillSolicitudesPedientesByDetallePago(String idPago) {
|
||||||
|
logger.info("fillSolicitudesPedientesByDetallePago");
|
||||||
|
List<SolicitudDevolucionDetellePagoPoliza> resultList = null;
|
||||||
|
Transaction transaction = null;
|
||||||
|
try {
|
||||||
|
logger.info("Searching solicitudes..");
|
||||||
|
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
|
||||||
|
transaction = session.beginTransaction();
|
||||||
|
CriteriaBuilder builder = session.getCriteriaBuilder();
|
||||||
|
|
||||||
|
CriteriaQuery<SolicitudDevolucionDetellePagoPoliza> criteria = builder.createQuery(SolicitudDevolucionDetellePagoPoliza.class);
|
||||||
|
Root<SolicitudDevolucionDetellePagoPoliza> root = criteria.from(SolicitudDevolucionDetellePagoPoliza.class);
|
||||||
|
|
||||||
|
Predicate criterio1 = builder.equal(root.get("detallePagoSolicitud").get("id"), idPago);
|
||||||
|
Predicate criterio2 = builder.equal(root.get("estatusActivo"), GenericEnumType.ENABLED);
|
||||||
|
Predicate criterio3 = builder.equal(root.get("estatusSolicitud"), EstatusSolicitud.PENDIENTE);
|
||||||
|
|
||||||
|
criteria.where(builder.and(criterio1, criterio2));
|
||||||
|
criteria.orderBy(builder.asc(root.get("createdOn")));
|
||||||
|
|
||||||
|
resultList = session.createQuery(criteria).getResultList();
|
||||||
|
|
||||||
|
logger.info("Total of solicitudes found: " + (null == resultList ? -1 : resultList.size()));
|
||||||
|
transaction.commit();
|
||||||
|
} catch (HibernateException e) {
|
||||||
|
logger.error("solicitudes cannot be loaded ");
|
||||||
|
rollback(transaction);
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("Method fillSolicitudesPedientesByDetallePago ", e);
|
||||||
|
rollback(transaction);
|
||||||
|
}
|
||||||
|
return resultList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean rechazarSolicitudDevolucionDetellePagoPoliza(SolicitudDevolucionDetellePagoPoliza modelo, User user) {
|
||||||
|
logger.info("rechazarSolicitudDevolucionDetellePagoPoliza");
|
||||||
|
boolean success = false;
|
||||||
|
Transaction transaction = null;
|
||||||
|
try {
|
||||||
|
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
|
||||||
|
transaction = session.beginTransaction();
|
||||||
|
modelo.setEstatusSolicitud(EstatusSolicitud.CANCELADO);
|
||||||
|
modelo.setLastUpdatedOn(correcciónDeHr(new Date(), -7));
|
||||||
|
modelo.setLastUpdatedBy(user);
|
||||||
|
session.update(modelo);
|
||||||
|
transaction.commit();
|
||||||
|
success = true;
|
||||||
|
} catch (HibernateException e) {
|
||||||
|
logger.error("Solicitud Devolucion Detelle Pago Poliza can not be added: ", e);
|
||||||
|
rollback(transaction);
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("Method rechazarSolicitudDevolucionDetellePagoPoliza() ", e);
|
||||||
|
rollback(transaction);
|
||||||
|
}
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean aprobarSolicitudDevolucionDetellePagoPoliza(SolicitudDevolucionDetellePagoPoliza solicitud, User user) {
|
||||||
|
logger.info("aprobarSolicitudDevolucionDetellePagoPoliza()");
|
||||||
|
Session session = null;
|
||||||
|
Transaction transaction = null;
|
||||||
|
Date fechaActual = correcciónDeHr(new Date(), -7);
|
||||||
|
try {
|
||||||
|
session = HibernateUtil.getSessionFactory().getCurrentSession();
|
||||||
|
transaction = session.beginTransaction();
|
||||||
|
// 1.- se carga el detalle
|
||||||
|
DetellePagoPoliza detalleOriginal = solicitud.getDetallePagoSolicitud();
|
||||||
|
|
||||||
|
// 2. Actualizar detalle original
|
||||||
|
detalleOriginal.setEstatusPago(GenericEnumType.CANCELED);
|
||||||
|
detalleOriginal.setLastUpdatedOn(fechaActual);
|
||||||
|
detalleOriginal.setLastUpdatedBy(user);
|
||||||
|
session.update(detalleOriginal);
|
||||||
|
|
||||||
|
// 3. Crear detalle de devolución
|
||||||
|
DetellePagoPoliza detalleDevolucion = new DetellePagoPoliza();
|
||||||
|
detalleDevolucion.setId(UUID.randomUUID().toString());
|
||||||
|
detalleDevolucion.setPagoPoliza(solicitud.getDetallePagoSolicitud().getPagoPoliza());
|
||||||
|
detalleDevolucion.setEstatusActivo(GenericEnumType.ENABLED);
|
||||||
|
detalleDevolucion.setEstatusPago(GenericEnumType.ENABLED);
|
||||||
|
detalleDevolucion.setTipoPago(TipoAbono.DEVOLUCION);
|
||||||
|
detalleDevolucion.setFechaPago(fechaActual);
|
||||||
|
detalleDevolucion.setCantidadPagada(solicitud.getMontoDevolucion());
|
||||||
|
detalleDevolucion.setCobro(solicitud.getUsuarioCorte());
|
||||||
|
detalleDevolucion.setFolio("");
|
||||||
|
detalleDevolucion.setMetodoPago(MetodoPago.EFECTIVO);
|
||||||
|
detalleDevolucion.setCreatedOn(fechaActual);
|
||||||
|
detalleDevolucion.setCreatedBy(user);
|
||||||
|
detalleDevolucion.setHistorialAbonoMultiple(null);
|
||||||
|
session.save(detalleDevolucion);
|
||||||
|
|
||||||
|
// 4. Actualizar pago principal
|
||||||
|
PagosPoliza pagoPrincipal = detalleOriginal.getPagoPoliza();
|
||||||
|
pagoPrincipal.setCantidadPagada(pagoPrincipal.getCantidadPagada() - solicitud.getMontoDevolucion());
|
||||||
|
pagoPrincipal.setDiferenciaPago(pagoPrincipal.getPago() - pagoPrincipal.getCantidadPagada());
|
||||||
|
// 5. Validar estado del pago
|
||||||
|
double nuevaDiferencia = pagoPrincipal.getPago() - pagoPrincipal.getCantidadPagada();
|
||||||
|
if (Math.abs(nuevaDiferencia) > 0.01) {
|
||||||
|
pagoPrincipal.setPagoEstatus(GenericEnumType.INCOMPLETE);
|
||||||
|
} else {
|
||||||
|
pagoPrincipal.setPagoEstatus(GenericEnumType.DISABLED);
|
||||||
|
pagoPrincipal.setCantidadPagada(0.0);
|
||||||
|
}
|
||||||
|
pagoPrincipal.setLastUpdatedOn(fechaActual);
|
||||||
|
pagoPrincipal.setLastUpdatedBy(user);
|
||||||
|
session.update(pagoPrincipal);
|
||||||
|
|
||||||
|
// 6. Actualizar póliza
|
||||||
|
Poliza poliza = pagoPrincipal.getPoliza();
|
||||||
|
poliza.setCantidadPagada(poliza.getCantidadPagada() - solicitud.getMontoDevolucion());
|
||||||
|
// 7. Validar estado de la póliza
|
||||||
|
if (poliza.getEstatus() == PolizaEstatus.LIQUIDADO && (poliza.getAmount() - poliza.getCantidadPagada()) > 0.10) {
|
||||||
|
poliza.setEstatus(PolizaEstatus.PENDIENTE);
|
||||||
|
}
|
||||||
|
poliza.setLastUpdatedOn(fechaActual);
|
||||||
|
poliza.setLastUpdatedBy(user);
|
||||||
|
session.update(poliza);
|
||||||
|
|
||||||
|
// 8. Registrar solicitud de devolución
|
||||||
|
solicitud.setEstatusSolicitud(EstatusSolicitud.APROBADO);
|
||||||
|
solicitud.setDetallePagoDevolucion(detalleDevolucion);
|
||||||
|
solicitud.setLastUpdatedOn(fechaActual);
|
||||||
|
solicitud.setLastUpdatedBy(user);
|
||||||
|
session.update(solicitud);
|
||||||
|
|
||||||
|
transaction.commit();
|
||||||
|
return true;
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
if (transaction != null) {
|
||||||
|
transaction.rollback();
|
||||||
|
}
|
||||||
|
logger.error("aprobarSolicitudDevolucionDetellePagoPoliza(): ", e);
|
||||||
|
return false;
|
||||||
|
} finally {
|
||||||
|
if (session != null) {
|
||||||
|
session.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private Date correcciónDeHr(Date fecha, int horas) {
|
private Date correcciónDeHr(Date fecha, int horas) {
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
calendar.setTime(fecha);
|
calendar.setTime(fecha);
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* Arrebol Consultancy copyright.
|
* Arrebol Consultancy copyright.
|
||||||
*
|
*
|
||||||
* This code belongs to Arrebol Consultancy
|
* 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.
|
* without written authorization from Arrebol Consultancy.
|
||||||
*/
|
*/
|
||||||
package com.arrebol.taxiservicios.model.admin;
|
package com.arrebol.taxiservicios.model.admin;
|
||||||
@ -10,7 +10,6 @@ package com.arrebol.taxiservicios.model.admin;
|
|||||||
import com.arrebol.taxiservicios.model.core.Person;
|
import com.arrebol.taxiservicios.model.core.Person;
|
||||||
import com.arrebol.taxiservicios.model.core.User;
|
import com.arrebol.taxiservicios.model.core.User;
|
||||||
import com.arrebol.taxiservicios.model.enums.ExpenseType;
|
import com.arrebol.taxiservicios.model.enums.ExpenseType;
|
||||||
import com.arrebol.taxiservicios.model.enums.SanctionType;
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@ -21,296 +20,188 @@ import java.util.Date;
|
|||||||
*/
|
*/
|
||||||
public class ClosingDayDetail implements Serializable {
|
public class ClosingDayDetail implements Serializable {
|
||||||
|
|
||||||
private String id;
|
private String id;
|
||||||
private ClosingDay closingDay;
|
private ClosingDay closingDay;
|
||||||
private String type;
|
private String type;
|
||||||
private BigDecimal amount;
|
private BigDecimal amount;
|
||||||
private BigDecimal amountSaving;
|
private BigDecimal amountSaving;
|
||||||
private BigDecimal amountAccident;
|
private BigDecimal amountAccident;
|
||||||
private Person person;
|
private Person person;
|
||||||
private String comments;
|
private String comments;
|
||||||
private User createdBy;
|
private User createdBy;
|
||||||
private Date createdOn;
|
private Date createdOn;
|
||||||
private User lastUpdatedBy;
|
private User lastUpdatedBy;
|
||||||
private Date lastUpdatedOn;
|
private Date lastUpdatedOn;
|
||||||
|
|
||||||
private GeneralPublic general;
|
private GeneralPublic general;
|
||||||
|
|
||||||
public ClosingDayDetail() {
|
public ClosingDayDetail() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param type
|
* @param type
|
||||||
* @param amount
|
* @param amount
|
||||||
* @param amountSaving
|
* @param amountSaving
|
||||||
* @param amountAccident
|
* @param amountAccident
|
||||||
* @param person
|
* @param person
|
||||||
* @param comments
|
* @param comments
|
||||||
*/
|
*/
|
||||||
public ClosingDayDetail(String type, BigDecimal amount, BigDecimal amountSaving, BigDecimal amountAccident, Person person, String comments) {
|
public ClosingDayDetail(String type, BigDecimal amount, BigDecimal amountSaving, BigDecimal amountAccident, Person person, String comments) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.amount = amount;
|
this.amount = amount;
|
||||||
this.amountSaving = amountSaving;
|
this.amountSaving = amountSaving;
|
||||||
this.amountAccident = amountAccident;
|
this.amountAccident = amountAccident;
|
||||||
this.person = person;
|
this.person = person;
|
||||||
this.comments = comments;
|
this.comments = comments;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param queryNumber 1: query_details_sales, 2: query_details_sanctions_in,
|
* @param queryNumber 1: query_details_sales, 2: query_details_sanctions_in,
|
||||||
* 3: query_details_sanctions_out, 4: query_details_expenses, 5:
|
* 3: query_details_sanctions_out, 4: query_details_expenses, 5:
|
||||||
* query_details_invoices.
|
* query_details_invoices.
|
||||||
* @param array
|
* @param array
|
||||||
*/
|
*/
|
||||||
//Para poder añadir que se va a mostrar (supongo)
|
//Para poder añadir que se va a mostrar (supongo)
|
||||||
public ClosingDayDetail(int queryNumber, Object[] array) {
|
public ClosingDayDetail(int queryNumber, Object[] array) {
|
||||||
switch (queryNumber) {
|
switch (queryNumber) {
|
||||||
case 1:
|
|
||||||
if (((String) array[6]).equals("DISABLED")) {
|
|
||||||
this.type = "Venta diaria";
|
|
||||||
} else {
|
|
||||||
this.type = "Venta diaria - Depósito";
|
|
||||||
}
|
|
||||||
|
|
||||||
this.person = new Person((String) array[3], (String) array[5]);
|
case 1:
|
||||||
this.amount = new BigDecimal((Double) array[0]);
|
this.type = ExpenseType.valueOf(array[1].toString()).getType();
|
||||||
this.amountSaving = new BigDecimal((Double) array[1]);
|
this.person = new Person((String) array[2], (String) array[4]);
|
||||||
this.amountAccident = new BigDecimal((Double) array[2]);
|
this.amount = new BigDecimal((Double) array[0]);
|
||||||
this.comments = (String) array[4];
|
this.comments = (String) array[3];
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
this.type = SanctionType.valueOf(array[1].toString()).getType();
|
this.type = array[1].toString();
|
||||||
this.person = new Person((String) array[2], (String) array[4]);
|
this.person = new Person((String) array[2], (String) array[4]);
|
||||||
this.amount = new BigDecimal((Double) array[0]);
|
this.amount = new BigDecimal((Double) array[0]);
|
||||||
this.comments = (String) array[3];
|
this.comments = (String) array[3];
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
this.type = SanctionType.valueOf(array[1].toString()).getType();
|
this.type = array[1].toString();
|
||||||
this.person = new Person((String) array[2], (String) array[4]);
|
this.person = new Person((String) array[2], (String) array[4]);
|
||||||
this.amount = new BigDecimal((Double) array[0]);
|
this.amount = new BigDecimal((Double) array[0]);
|
||||||
this.comments = (String) array[3];
|
this.comments = "Folio del pago : " + array[3];
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
this.type = ExpenseType.valueOf(array[1].toString()).getType();
|
this.type = array[1].toString();
|
||||||
this.person = new Person((String) array[2], (String) array[4]);
|
this.person = new Person((String) array[2], (String) array[4]);
|
||||||
this.amount = new BigDecimal((Double) array[0]);
|
this.amount = new BigDecimal((Double) array[0] * -1);
|
||||||
this.comments = (String) array[3];
|
this.comments = "Devolución : " + array[3];
|
||||||
break;
|
break;
|
||||||
case 5:
|
}
|
||||||
this.type = "Compra";
|
|
||||||
this.person = new Person((String) array[1], (String) array[3]);
|
|
||||||
this.amount = new BigDecimal((Float) array[0]);
|
|
||||||
this.comments = (String) array[2];
|
|
||||||
break;
|
|
||||||
case 6:
|
|
||||||
this.type = "Transferencia enviada";
|
|
||||||
this.person = new Person((String) array[1], (String) array[3]);
|
|
||||||
this.amount = new BigDecimal((Double) array[0]);
|
|
||||||
this.comments = "Enviada a usuario: " + (String) array[3];
|
|
||||||
break;
|
|
||||||
case 7:
|
|
||||||
this.type = "Transferencia recibida";
|
|
||||||
this.person = new Person((String) array[1], (String) array[3]);
|
|
||||||
this.amount = new BigDecimal((Double) array[0]);
|
|
||||||
this.comments = "Recibida del usuario: " + (String) array[3];
|
|
||||||
break;
|
|
||||||
case 8:
|
|
||||||
this.type = "Pago cliente";
|
|
||||||
this.person = new Person((String) array[1], (String) array[3]);
|
|
||||||
this.amount = new BigDecimal((Double) array[0]);
|
|
||||||
this.comments = "";
|
|
||||||
break;
|
|
||||||
case 9:
|
|
||||||
this.type = "Venta público general";
|
|
||||||
this.person = null;
|
|
||||||
this.amount = new BigDecimal((Double) array[0]);
|
|
||||||
this.comments = "";
|
|
||||||
break;
|
|
||||||
case 10:
|
|
||||||
this.type = "Devolución de compra";
|
|
||||||
this.person = null;
|
|
||||||
this.amount = new BigDecimal((Double) array[0]);
|
|
||||||
this.comments = (String) array[2];
|
|
||||||
break;
|
|
||||||
case 11:
|
|
||||||
this.type = "Tiempo aire";
|
|
||||||
this.person = new Person((String) array[1], (String) array[3]);
|
|
||||||
this.amount = BigDecimal.valueOf(Double.parseDouble(array[0].toString()));
|
|
||||||
this.comments = "";
|
|
||||||
break;
|
|
||||||
case 12:
|
|
||||||
this.type = "Transferencia Mutual enviada";
|
|
||||||
this.person = new Person((String) array[1], (String) array[3]);
|
|
||||||
this.amount = new BigDecimal((Double) array[0]);
|
|
||||||
this.comments = "Enviada a usuario: " + (String) array[3];
|
|
||||||
break;
|
|
||||||
case 13:
|
|
||||||
this.type = array[1].toString();
|
|
||||||
this.person = new Person((String) array[2], (String) array[4]);
|
|
||||||
this.amount = new BigDecimal((Double) array[0]);
|
|
||||||
this.comments = (String) array[3];
|
|
||||||
break;
|
|
||||||
case 15:
|
|
||||||
this.type = array[1].toString() + " Proyecto";
|
|
||||||
this.person = new Person((String) array[2], (String) array[4]);
|
|
||||||
this.amount = new BigDecimal((Double) array[0]);
|
|
||||||
this.comments = "Abono al proyecto " + array[3];
|
|
||||||
break;
|
|
||||||
case 16:
|
|
||||||
this.type = "ABONO Urbanizacion";
|
|
||||||
this.person = new Person((String) array[2], (String) array[5]);
|
|
||||||
this.amount = new BigDecimal((Double) array[4]);
|
|
||||||
this.comments = "Abono a la urbanizacion " + array[3] + " :" + array[4];
|
|
||||||
break;
|
|
||||||
case 18:
|
|
||||||
this.type = array[1].toString();
|
|
||||||
this.person = new Person((String) array[2], (String) array[4]);
|
|
||||||
this.amount = new BigDecimal((Double) array[0]);
|
|
||||||
this.comments = "Devolución de abono a lote ENTRADA" + array[3];
|
|
||||||
break;
|
|
||||||
case 19:
|
|
||||||
this.type = array[1].toString();
|
|
||||||
this.person = new Person((String) array[2], (String) array[4]);
|
|
||||||
this.amount = new BigDecimal((Double) array[0] * -1);
|
|
||||||
this.comments = "Devolución de abono a lote SALIDA" + array[3];
|
|
||||||
break;
|
|
||||||
case 20:
|
|
||||||
this.type = array[1].toString();
|
|
||||||
this.person = new Person((String) array[2], (String) array[4]);
|
|
||||||
this.amount = new BigDecimal((Double) array[0] * -1);
|
|
||||||
this.comments = "Abono a rembolso por cancelacion " + array[3];
|
|
||||||
break;
|
|
||||||
case 23:
|
|
||||||
this.type = array[1].toString();
|
|
||||||
this.person = new Person((String) array[2], (String) array[4]);
|
|
||||||
this.amount = new BigDecimal((Double) array[0]);
|
|
||||||
this.comments = "Devolución de abono multiple a lote ENTRADA" + array[3];
|
|
||||||
break;
|
|
||||||
case 24:
|
|
||||||
this.type = array[1].toString();
|
|
||||||
this.person = new Person((String) array[2], (String) array[4]);
|
|
||||||
this.amount = new BigDecimal((Double) array[0] * -1);
|
|
||||||
this.comments = "Devolución de abono multiple a lote SALIDA" + array[3];
|
|
||||||
break;
|
|
||||||
case 25:
|
|
||||||
this.type = array[1].toString();
|
|
||||||
this.person = new Person((String) array[2], (String) array[4]);
|
|
||||||
this.amount = new BigDecimal((Double) array[0]);
|
|
||||||
this.comments = "Folio del pago: "+ array[3];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setId(String id) {
|
public void setId(String id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ClosingDay getClosingDay() {
|
public ClosingDay getClosingDay() {
|
||||||
return closingDay;
|
return closingDay;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setClosingDay(ClosingDay closingDay) {
|
public void setClosingDay(ClosingDay closingDay) {
|
||||||
this.closingDay = closingDay;
|
this.closingDay = closingDay;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getType() {
|
public String getType() {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setType(String type) {
|
public void setType(String type) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BigDecimal getAmount() {
|
public BigDecimal getAmount() {
|
||||||
return amount;
|
return amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAmount(BigDecimal amount) {
|
public void setAmount(BigDecimal amount) {
|
||||||
this.amount = amount;
|
this.amount = amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BigDecimal getAmountSaving() {
|
public BigDecimal getAmountSaving() {
|
||||||
return amountSaving;
|
return amountSaving;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAmountSaving(BigDecimal amountSaving) {
|
public void setAmountSaving(BigDecimal amountSaving) {
|
||||||
this.amountSaving = amountSaving;
|
this.amountSaving = amountSaving;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BigDecimal getAmountAccident() {
|
public BigDecimal getAmountAccident() {
|
||||||
return amountAccident;
|
return amountAccident;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAmountAccident(BigDecimal amountAccident) {
|
public void setAmountAccident(BigDecimal amountAccident) {
|
||||||
this.amountAccident = amountAccident;
|
this.amountAccident = amountAccident;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Person getPerson() {
|
public Person getPerson() {
|
||||||
return person;
|
return person;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPerson(Person person) {
|
public void setPerson(Person person) {
|
||||||
this.person = person;
|
this.person = person;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getComments() {
|
public String getComments() {
|
||||||
return comments;
|
return comments;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setComments(String comments) {
|
public void setComments(String comments) {
|
||||||
this.comments = comments;
|
this.comments = comments;
|
||||||
}
|
}
|
||||||
|
|
||||||
public User getCreatedBy() {
|
public User getCreatedBy() {
|
||||||
return createdBy;
|
return createdBy;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCreatedBy(User createdBy) {
|
public void setCreatedBy(User createdBy) {
|
||||||
this.createdBy = createdBy;
|
this.createdBy = createdBy;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Date getCreatedOn() {
|
public Date getCreatedOn() {
|
||||||
return createdOn;
|
return createdOn;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCreatedOn(Date createdOn) {
|
public void setCreatedOn(Date createdOn) {
|
||||||
this.createdOn = createdOn;
|
this.createdOn = createdOn;
|
||||||
}
|
}
|
||||||
|
|
||||||
public User getLastUpdatedBy() {
|
public User getLastUpdatedBy() {
|
||||||
return lastUpdatedBy;
|
return lastUpdatedBy;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLastUpdatedBy(User lastUpdatedBy) {
|
public void setLastUpdatedBy(User lastUpdatedBy) {
|
||||||
this.lastUpdatedBy = lastUpdatedBy;
|
this.lastUpdatedBy = lastUpdatedBy;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Date getLastUpdatedOn() {
|
public Date getLastUpdatedOn() {
|
||||||
return lastUpdatedOn;
|
return lastUpdatedOn;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLastUpdatedOn(Date lastUpdatedOn) {
|
public void setLastUpdatedOn(Date lastUpdatedOn) {
|
||||||
this.lastUpdatedOn = lastUpdatedOn;
|
this.lastUpdatedOn = lastUpdatedOn;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GeneralPublic getGeneral() {
|
public GeneralPublic getGeneral() {
|
||||||
return general;
|
return general;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setGeneral(GeneralPublic general) {
|
public void setGeneral(GeneralPublic general) {
|
||||||
this.general = general;
|
this.general = general;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "ClosingDayDetail{" + "closingDay=" + closingDay + ", type=" + type + ", comments=" + comments + '}';
|
return "ClosingDayDetail{" + "closingDay=" + closingDay + ", type=" + type + ", comments=" + comments + '}';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -9,46 +9,50 @@ package com.arrebol.taxiservicios.model.enums;
|
|||||||
* @author pc one
|
* @author pc one
|
||||||
*/
|
*/
|
||||||
public enum TipoAbono {
|
public enum TipoAbono {
|
||||||
ANTICIPO("Anticipo") {
|
ANTICIPO("ANTICIPO") {
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "Anticipo";
|
return "Anticipo";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
ABONO("Abono") {
|
ABONO("ABONO") {
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "Abono";
|
return "Abono";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
SUBABONO("Sub abono") {
|
SUBABONO("ABONO") {
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "Sub abono";
|
return "Sub abono";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
DEVOLUCION("DEVOLUCION") {
|
||||||
COMISION ("Comisión por apertura"){
|
@Override
|
||||||
@Override
|
public String toString() {
|
||||||
public String toString() {
|
return "Devolución";
|
||||||
return "COMISION";
|
}
|
||||||
}
|
},
|
||||||
},
|
COMISION("COMISION") {
|
||||||
|
@Override
|
||||||
AJUSTE("Ajuste") {
|
public String toString() {
|
||||||
@Override
|
return "Comisión por apertura";
|
||||||
public String toString() {
|
}
|
||||||
return "Ajuste";
|
},
|
||||||
}
|
AJUSTE("AJUSTE") {
|
||||||
};
|
@Override
|
||||||
|
public String toString() {
|
||||||
private final String type;
|
return "Ajuste";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
private TipoAbono(String type) {
|
private final String type;
|
||||||
this.type = type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getType() {
|
private TipoAbono(String type) {
|
||||||
return type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ package com.crov.prase.model.prase;
|
|||||||
import com.arrebol.taxiservicios.model.core.User;
|
import com.arrebol.taxiservicios.model.core.User;
|
||||||
import com.arrebol.taxiservicios.model.enums.GenericEnumType;
|
import com.arrebol.taxiservicios.model.enums.GenericEnumType;
|
||||||
import com.arrebol.taxiservicios.model.enums.MetodoPago;
|
import com.arrebol.taxiservicios.model.enums.MetodoPago;
|
||||||
|
import com.arrebol.taxiservicios.model.enums.TipoAbono;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
@ -51,6 +52,14 @@ public class DetellePagoPoliza implements Serializable {
|
|||||||
@Column(name = "estatus_activo", nullable = false)
|
@Column(name = "estatus_activo", nullable = false)
|
||||||
private GenericEnumType estatusActivo;
|
private GenericEnumType estatusActivo;
|
||||||
|
|
||||||
|
@Enumerated(EnumType.STRING)
|
||||||
|
@Column(name = "estatus_pago", nullable = false)
|
||||||
|
private GenericEnumType estatusPago;
|
||||||
|
|
||||||
|
@Enumerated(EnumType.STRING)
|
||||||
|
@Column(name = "tipo_pago", nullable = false)
|
||||||
|
private TipoAbono tipoPago;
|
||||||
|
|
||||||
@Temporal(TemporalType.TIMESTAMP)
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
@Column(name = "fecha_pago")
|
@Column(name = "fecha_pago")
|
||||||
private Date fechaPago;
|
private Date fechaPago;
|
||||||
@ -216,4 +225,20 @@ public class DetellePagoPoliza implements Serializable {
|
|||||||
this.historialAbonoMultiple = historialAbonoMultiple;
|
this.historialAbonoMultiple = historialAbonoMultiple;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public GenericEnumType getEstatusPago() {
|
||||||
|
return estatusPago;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEstatusPago(GenericEnumType estatusPago) {
|
||||||
|
this.estatusPago = estatusPago;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TipoAbono getTipoPago() {
|
||||||
|
return tipoPago;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTipoPago(TipoAbono tipoPago) {
|
||||||
|
this.tipoPago = tipoPago;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,240 @@
|
|||||||
|
/*
|
||||||
|
* 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.EstatusSolicitud;
|
||||||
|
import com.arrebol.taxiservicios.model.enums.GenericEnumType;
|
||||||
|
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 Oscar
|
||||||
|
*/
|
||||||
|
@Entity
|
||||||
|
@Table(name = "solicitud_devolucion_detelle_pago_poliza")
|
||||||
|
public class SolicitudDevolucionDetellePagoPoliza 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_activo", nullable = false)
|
||||||
|
private GenericEnumType estatusActivo;
|
||||||
|
|
||||||
|
@ManyToOne(fetch = FetchType.LAZY, optional = false)
|
||||||
|
@JoinColumn(
|
||||||
|
name = "id_detalle_pago_solicitud",
|
||||||
|
referencedColumnName = "id",
|
||||||
|
nullable = false
|
||||||
|
)
|
||||||
|
private DetellePagoPoliza detallePagoSolicitud;
|
||||||
|
|
||||||
|
@ManyToOne(fetch = FetchType.LAZY, optional = true)
|
||||||
|
@JoinColumn(
|
||||||
|
name = "id_detalle_pago_devolucion",
|
||||||
|
referencedColumnName = "id",
|
||||||
|
nullable = true
|
||||||
|
)
|
||||||
|
private DetellePagoPoliza detallePagoDevolucion;
|
||||||
|
|
||||||
|
@ManyToOne(fetch = FetchType.LAZY, optional = true)
|
||||||
|
@JoinColumn(
|
||||||
|
name = "id_usuario_solicito",
|
||||||
|
referencedColumnName = "id",
|
||||||
|
nullable = true
|
||||||
|
)
|
||||||
|
private User usuarioSolicito;
|
||||||
|
|
||||||
|
@ManyToOne(fetch = FetchType.LAZY, optional = true)
|
||||||
|
@JoinColumn(
|
||||||
|
name = "id_usuario_corte",
|
||||||
|
referencedColumnName = "id",
|
||||||
|
nullable = true
|
||||||
|
)
|
||||||
|
private User usuarioCorte;
|
||||||
|
|
||||||
|
@Enumerated(EnumType.STRING)
|
||||||
|
@Column(name = "estatus_solicitud", nullable = false)
|
||||||
|
private EstatusSolicitud estatusSolicitud;
|
||||||
|
|
||||||
|
@Column(name = "monto_devolucion")
|
||||||
|
private Double montoDevolucion;
|
||||||
|
|
||||||
|
@Column(name = "comentario")
|
||||||
|
private String comentario;
|
||||||
|
|
||||||
|
@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 SolicitudDevolucionDetellePagoPoliza() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public SolicitudDevolucionDetellePagoPoliza(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 GenericEnumType getEstatusActivo() {
|
||||||
|
return estatusActivo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEstatusActivo(GenericEnumType estatusActivo) {
|
||||||
|
this.estatusActivo = estatusActivo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DetellePagoPoliza getDetallePagoSolicitud() {
|
||||||
|
return detallePagoSolicitud;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDetallePagoSolicitud(DetellePagoPoliza detallePagoSolicitud) {
|
||||||
|
this.detallePagoSolicitud = detallePagoSolicitud;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DetellePagoPoliza getDetallePagoDevolucion() {
|
||||||
|
return detallePagoDevolucion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDetallePagoDevolucion(DetellePagoPoliza detallePagoDevolucion) {
|
||||||
|
this.detallePagoDevolucion = detallePagoDevolucion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public User getUsuarioSolicito() {
|
||||||
|
return usuarioSolicito;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsuarioSolicito(User usuarioSolicito) {
|
||||||
|
this.usuarioSolicito = usuarioSolicito;
|
||||||
|
}
|
||||||
|
|
||||||
|
public User getUsuarioCorte() {
|
||||||
|
return usuarioCorte;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsuarioCorte(User usuarioCorte) {
|
||||||
|
this.usuarioCorte = usuarioCorte;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EstatusSolicitud getEstatusSolicitud() {
|
||||||
|
return estatusSolicitud;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEstatusSolicitud(EstatusSolicitud estatusSolicitud) {
|
||||||
|
this.estatusSolicitud = estatusSolicitud;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getMontoDevolucion() {
|
||||||
|
return montoDevolucion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMontoDevolucion(Double montoDevolucion) {
|
||||||
|
this.montoDevolucion = montoDevolucion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getComentario() {
|
||||||
|
return comentario;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setComentario(String comentario) {
|
||||||
|
this.comentario = comentario;
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -93,6 +93,7 @@
|
|||||||
<mapping class="com.crov.prase.model.prase.OpcionesUsoVehiculo"/>
|
<mapping class="com.crov.prase.model.prase.OpcionesUsoVehiculo"/>
|
||||||
<mapping class="com.crov.prase.model.prase.PaquetesCobertura"/>
|
<mapping class="com.crov.prase.model.prase.PaquetesCobertura"/>
|
||||||
<mapping class="com.crov.prase.model.prase.Coberturas"/>
|
<mapping class="com.crov.prase.model.prase.Coberturas"/>
|
||||||
|
<mapping class="com.crov.prase.model.prase.SolicitudDevolucionDetellePagoPoliza"/>
|
||||||
<!-- Queries for Table mapping -->
|
<!-- Queries for Table mapping -->
|
||||||
|
|
||||||
|
|
||||||
|
@ -147,6 +147,7 @@ public class AddClosingDayBean extends TaxiGenericBean implements Serializable {
|
|||||||
setTotalPaid(null);
|
setTotalPaid(null);
|
||||||
setTotalTransfer(null);
|
setTotalTransfer(null);
|
||||||
setTotalPagosPoliza(null);
|
setTotalPagosPoliza(null);
|
||||||
|
setTotalDevolucionPagosPoliza(null);
|
||||||
validateMutual = null;
|
validateMutual = null;
|
||||||
setUsers(getController().getAllActiveUsers(getLoggedUser().getLocation()));
|
setUsers(getController().getAllActiveUsers(getLoggedUser().getLocation()));
|
||||||
getDetails().clear();
|
getDetails().clear();
|
||||||
@ -350,6 +351,7 @@ public class AddClosingDayBean extends TaxiGenericBean implements Serializable {
|
|||||||
|
|
||||||
setTotalExpenses(getController().findTotals(query_total_expenses, getSelectedUserId()) + getController().findTotals(query_total_transfer_send, getSelectedUserId()));
|
setTotalExpenses(getController().findTotals(query_total_expenses, getSelectedUserId()) + getController().findTotals(query_total_transfer_send, getSelectedUserId()));
|
||||||
setTotalPagosPoliza(getController().findTotals(query_total_poliza_prase, getSelectedUserId()));
|
setTotalPagosPoliza(getController().findTotals(query_total_poliza_prase, getSelectedUserId()));
|
||||||
|
setTotalDevolucionPagosPoliza(getController().findTotals(query_total_poliza_prase_devolucion, getSelectedUserId()));
|
||||||
setSaveCashDailyCut(true);
|
setSaveCashDailyCut(true);
|
||||||
setDetails(getController().findClosingDayDetails(getSelectedUserId()));
|
setDetails(getController().findClosingDayDetails(getSelectedUserId()));
|
||||||
sumTotals();
|
sumTotals();
|
||||||
@ -362,7 +364,7 @@ public class AddClosingDayBean extends TaxiGenericBean implements Serializable {
|
|||||||
|
|
||||||
private void sumTotals() {
|
private void sumTotals() {
|
||||||
try {
|
try {
|
||||||
totalToPay = getTotalSanctionsIn() + getTotalPagosPoliza();
|
totalToPay = getTotalSanctionsIn() + (getTotalPagosPoliza() - getTotalDevolucionPagosPoliza());
|
||||||
totalToPay += -(getTotalSanctionsOut() + getTotalExpenses());
|
totalToPay += -(getTotalSanctionsOut() + getTotalExpenses());
|
||||||
totalExpenses = getTotalExpenses();
|
totalExpenses = getTotalExpenses();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@ -410,6 +412,7 @@ public class AddClosingDayBean extends TaxiGenericBean implements Serializable {
|
|||||||
private Double totalPaid;
|
private Double totalPaid;
|
||||||
|
|
||||||
private Double totalPagosPoliza;
|
private Double totalPagosPoliza;
|
||||||
|
private Double totalDevolucionPagosPoliza;
|
||||||
|
|
||||||
private Double validateMutual;
|
private Double validateMutual;
|
||||||
private Double validateSale;
|
private Double validateSale;
|
||||||
@ -645,6 +648,14 @@ public class AddClosingDayBean extends TaxiGenericBean implements Serializable {
|
|||||||
this.totalPagosPoliza = totalPagosPoliza;
|
this.totalPagosPoliza = totalPagosPoliza;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Double getTotalDevolucionPagosPoliza() {
|
||||||
|
return totalDevolucionPagosPoliza;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalDevolucionPagosPoliza(Double totalDevolucionPagosPoliza) {
|
||||||
|
this.totalDevolucionPagosPoliza = totalDevolucionPagosPoliza;
|
||||||
|
}
|
||||||
|
|
||||||
final Logger logger = LogManager.getLogger(AddClosingDayBean.class);
|
final Logger logger = LogManager.getLogger(AddClosingDayBean.class);
|
||||||
private static final long serialVersionUID = -2421681541992908524L;
|
private static final long serialVersionUID = -2421681541992908524L;
|
||||||
|
|
||||||
@ -659,6 +670,16 @@ public class AddClosingDayBean extends TaxiGenericBean implements Serializable {
|
|||||||
+ "FROM detelle_pago_poliza WHERE DATE(fecha_pago) > " + sub_query_to_find_previously_closing_day + " "
|
+ "FROM detelle_pago_poliza WHERE DATE(fecha_pago) > " + sub_query_to_find_previously_closing_day + " "
|
||||||
+ " AND cobro = :userID "
|
+ " AND cobro = :userID "
|
||||||
+ " AND metodo_pago = 'EFECTIVO' "
|
+ " AND metodo_pago = 'EFECTIVO' "
|
||||||
|
+ " AND (estatus_pago = 'ENABLED' OR estatus_pago = 'CANCELED') "
|
||||||
|
+ " AND tipo_pago = 'ABONO' "
|
||||||
|
+ " AND estatus_activo = 'ENABLED' ";
|
||||||
|
|
||||||
|
private final String query_total_poliza_prase_devolucion = "SELECT IFNULL(SUM(cantidad_pagada), 0) AS total_pagos "
|
||||||
|
+ "FROM detelle_pago_poliza WHERE DATE(fecha_pago) > " + sub_query_to_find_previously_closing_day + " "
|
||||||
|
+ " AND cobro = :userID "
|
||||||
|
+ " AND metodo_pago = 'EFECTIVO' "
|
||||||
|
+ " AND estatus_pago = 'ENABLED' "
|
||||||
|
+ " AND tipo_pago = 'DEVOLUCION' "
|
||||||
+ " AND estatus_activo = 'ENABLED' ";
|
+ " AND estatus_activo = 'ENABLED' ";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,156 @@
|
|||||||
|
/*
|
||||||
|
* 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.prase;
|
||||||
|
|
||||||
|
import com.arrebol.taxiservicios.beans.Datatable;
|
||||||
|
import com.arrebol.taxiservicios.beans.TaxiGenericBean;
|
||||||
|
import com.arrebol.taxiservicios.controller.admin.ClosingDayServiceImpl;
|
||||||
|
import com.crov.prase.controller.prase.PagosPolizaController;
|
||||||
|
import com.crov.prase.model.prase.SolicitudDevolucionDetellePagoPoliza;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import javax.annotation.PostConstruct;
|
||||||
|
import javax.faces.application.FacesMessage;
|
||||||
|
import javax.faces.view.ViewScoped;
|
||||||
|
import javax.inject.Named;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.primefaces.event.ReorderEvent;
|
||||||
|
import org.primefaces.event.RowEditEvent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Oscar
|
||||||
|
*/
|
||||||
|
@Named("aprobarDevolucionDePagosBean")
|
||||||
|
@ViewScoped
|
||||||
|
public class AprobarDevolucionDePagosBean extends TaxiGenericBean implements Serializable, Datatable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -136031528440947006L;
|
||||||
|
final Logger logger = LogManager.getLogger(PolizaBean.class);
|
||||||
|
|
||||||
|
private PagosPolizaController pagosPolizaController;
|
||||||
|
|
||||||
|
private List<SolicitudDevolucionDetellePagoPoliza> listSolicitudes;
|
||||||
|
private SolicitudDevolucionDetellePagoPoliza selectSolicitud;
|
||||||
|
|
||||||
|
@PostConstruct
|
||||||
|
public void init() {
|
||||||
|
logger.info("init");
|
||||||
|
try {
|
||||||
|
loadTaxiPropertyFile();
|
||||||
|
loadBundlePropertyFile();
|
||||||
|
|
||||||
|
setPagosPolizaController(new PagosPolizaController());
|
||||||
|
setSelectSolicitud(null);
|
||||||
|
cargarSolicitudes();
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void cargarSolicitudes() {
|
||||||
|
logger.info("cargarSolicitudes()");
|
||||||
|
try {
|
||||||
|
setListSolicitudes(getPagosPolizaController().fillSolicitudDevolucionDetellePagoPolizaByLocation(getLoggedUser().getLocation().getId()));
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("cargarSolicitudes(): " + e);
|
||||||
|
showMessage(FacesMessage.SEVERITY_INFO, "Error", "Ocurrió un error al tratar de cargar la lista de solicitudes");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void rechazarSolicitud() {
|
||||||
|
logger.info("rechazarSolicitud()");
|
||||||
|
try {
|
||||||
|
if (getPagosPolizaController().rechazarSolicitudDevolucionDetellePagoPoliza(getSelectSolicitud(), getLoggedUser())) {
|
||||||
|
showMessage(FacesMessage.SEVERITY_INFO, "Solicitud rechazada", "Solicitud rechazada correctamente");
|
||||||
|
} else {
|
||||||
|
showMessage(FacesMessage.SEVERITY_ERROR, "Error", "Ocurrió un error al tratar de rechazar la solicitud");
|
||||||
|
}
|
||||||
|
cargarSolicitudes();
|
||||||
|
} catch (Exception e) {
|
||||||
|
showMessage(FacesMessage.SEVERITY_FATAL, "Error", "Ocurrió un error al tratar de rechazar la solicitud");
|
||||||
|
logger.error("rechazarSolicitud(): " + e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void aprobarSolcitud() {
|
||||||
|
logger.info("aprobarSolcitud()");
|
||||||
|
try {
|
||||||
|
if (new ClosingDayServiceImpl().existClosingDayByCreatedOn(correcciónDeHr(new Date(), -7), getSelectSolicitud().getUsuarioCorte())) {
|
||||||
|
showMessage(FacesMessage.SEVERITY_WARN, "Error", "El usuario al que afectará la devolución ya realizó su corte del día ");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (getPagosPolizaController().aprobarSolicitudDevolucionDetellePagoPoliza(getSelectSolicitud(), getLoggedUser())) {
|
||||||
|
showMessage(FacesMessage.SEVERITY_INFO, "Solicitud aprobada", "Solicitud aprobada correctamente");
|
||||||
|
} else {
|
||||||
|
showMessage(FacesMessage.SEVERITY_ERROR, "Error", "Ocurrió un error al tratar de aprobar la solicitud");
|
||||||
|
}
|
||||||
|
cargarSolicitudes();
|
||||||
|
} catch (Exception e) {
|
||||||
|
showMessage(FacesMessage.SEVERITY_FATAL, "Error", "Ocurrió un error al tratar de aprobar la solicitud");
|
||||||
|
logger.error("aprobarSolcitud(): " + e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void editRow(RowEditEvent event) {
|
||||||
|
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRowCancel(RowEditEvent event) {
|
||||||
|
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRowReorder(ReorderEvent event) {
|
||||||
|
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addRow() {
|
||||||
|
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteRow() {
|
||||||
|
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
|
||||||
|
}
|
||||||
|
|
||||||
|
public PagosPolizaController getPagosPolizaController() {
|
||||||
|
return pagosPolizaController;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPagosPolizaController(PagosPolizaController pagosPolizaController) {
|
||||||
|
this.pagosPolizaController = pagosPolizaController;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<SolicitudDevolucionDetellePagoPoliza> getListSolicitudes() {
|
||||||
|
return listSolicitudes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setListSolicitudes(List<SolicitudDevolucionDetellePagoPoliza> listSolicitudes) {
|
||||||
|
this.listSolicitudes = listSolicitudes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SolicitudDevolucionDetellePagoPoliza getSelectSolicitud() {
|
||||||
|
return selectSolicitud;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSelectSolicitud(SolicitudDevolucionDetellePagoPoliza selectSolicitud) {
|
||||||
|
this.selectSolicitud = selectSolicitud;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Date correcciónDeHr(Date fecha, int horas) {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(fecha);
|
||||||
|
calendar.add(Calendar.HOUR_OF_DAY, horas);
|
||||||
|
Date nuevaFecha = calendar.getTime();
|
||||||
|
return nuevaFecha;
|
||||||
|
}
|
||||||
|
}
|
@ -6,17 +6,21 @@ package com.crov.prase.prase;
|
|||||||
|
|
||||||
import com.arrebol.taxiservicios.beans.TaxiGenericBean;
|
import com.arrebol.taxiservicios.beans.TaxiGenericBean;
|
||||||
import com.arrebol.taxiservicios.controller.admin.GenericValidationController;
|
import com.arrebol.taxiservicios.controller.admin.GenericValidationController;
|
||||||
|
import com.arrebol.taxiservicios.model.enums.EstatusSolicitud;
|
||||||
import com.arrebol.taxiservicios.model.enums.GenericEnumType;
|
import com.arrebol.taxiservicios.model.enums.GenericEnumType;
|
||||||
import com.arrebol.taxiservicios.model.enums.MetodoPago;
|
import com.arrebol.taxiservicios.model.enums.MetodoPago;
|
||||||
import com.arrebol.taxiservicios.model.enums.PolizaEstatus;
|
import com.arrebol.taxiservicios.model.enums.PolizaEstatus;
|
||||||
|
import com.arrebol.taxiservicios.model.enums.TipoAbono;
|
||||||
import com.crov.prase.controller.prase.PagosPolizaController;
|
import com.crov.prase.controller.prase.PagosPolizaController;
|
||||||
import com.crov.prase.controller.prase.PolizaController;
|
import com.crov.prase.controller.prase.PolizaController;
|
||||||
import com.crov.prase.model.prase.DetellePagoPoliza;
|
import com.crov.prase.model.prase.DetellePagoPoliza;
|
||||||
import com.crov.prase.model.prase.HistorialAbonoMultiple;
|
import com.crov.prase.model.prase.HistorialAbonoMultiple;
|
||||||
import com.crov.prase.model.prase.PagosPoliza;
|
import com.crov.prase.model.prase.PagosPoliza;
|
||||||
import com.crov.prase.model.prase.Poliza;
|
import com.crov.prase.model.prase.Poliza;
|
||||||
|
import com.crov.prase.model.prase.SolicitudDevolucionDetellePagoPoliza;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
@ -56,6 +60,9 @@ public class PagosPolizasBean extends TaxiGenericBean implements Serializable {
|
|||||||
private String metodoPago;
|
private String metodoPago;
|
||||||
private HistorialAbonoMultiple selectedHistorialAbonoMultiple;
|
private HistorialAbonoMultiple selectedHistorialAbonoMultiple;
|
||||||
|
|
||||||
|
private String comentarioDevolucionPago;
|
||||||
|
private String detallePagoDisponibleParaDevocion;
|
||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void init() {
|
public void init() {
|
||||||
logger.info("init");
|
logger.info("init");
|
||||||
@ -183,6 +190,8 @@ public class PagosPolizasBean extends TaxiGenericBean implements Serializable {
|
|||||||
DetellePagoPoliza detalle = new DetellePagoPoliza();
|
DetellePagoPoliza detalle = new DetellePagoPoliza();
|
||||||
detalle.setPagoPoliza(pagoA);
|
detalle.setPagoPoliza(pagoA);
|
||||||
detalle.setEstatusActivo(GenericEnumType.ENABLED);
|
detalle.setEstatusActivo(GenericEnumType.ENABLED);
|
||||||
|
detalle.setEstatusPago(GenericEnumType.ENABLED);
|
||||||
|
detalle.setTipoPago(TipoAbono.ABONO);
|
||||||
detalle.setFechaPago(correcciónDeHr(new Date(), -7));
|
detalle.setFechaPago(correcciónDeHr(new Date(), -7));
|
||||||
detalle.setCantidadPagada(montoPagado);
|
detalle.setCantidadPagada(montoPagado);
|
||||||
detalle.setCobro(getLoggedUser());
|
detalle.setCobro(getLoggedUser());
|
||||||
@ -227,6 +236,36 @@ public class PagosPolizasBean extends TaxiGenericBean implements Serializable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void solicitarDevolusionDePago() {
|
||||||
|
logger.info("solicitarDevolusionDePago()");
|
||||||
|
try {
|
||||||
|
List<SolicitudDevolucionDetellePagoPoliza> solisitudesPendientes = getPagosPolizaController().fillSolicitudesPedientesByDetallePago(getSelectedDetellePago().getId());
|
||||||
|
if (!solisitudesPendientes.isEmpty()) {
|
||||||
|
showMessage(FacesMessage.SEVERITY_WARN, "Error", "Este detalle ya tiene una solicitud de devolución de pago en proceso");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
SolicitudDevolucionDetellePagoPoliza solicitud = new SolicitudDevolucionDetellePagoPoliza();
|
||||||
|
solicitud.setEstatusActivo(GenericEnumType.ENABLED);
|
||||||
|
solicitud.setLocation(getLoggedUser().getLocation());
|
||||||
|
solicitud.setDetallePagoSolicitud(getSelectedDetellePago());
|
||||||
|
solicitud.setDetallePagoDevolucion(null);
|
||||||
|
solicitud.setUsuarioSolicito(getLoggedUser());
|
||||||
|
solicitud.setUsuarioCorte(getLoggedUser());
|
||||||
|
solicitud.setEstatusSolicitud(EstatusSolicitud.PENDIENTE);
|
||||||
|
solicitud.setMontoDevolucion(getSelectedDetellePago().getCantidadPagada());
|
||||||
|
solicitud.setComentario(getComentarioDevolucionPago());
|
||||||
|
getPagosPolizaController().createSolicitudDevolucionDetellePagoPoliza(solicitud, getLoggedUser());
|
||||||
|
showMessage(FacesMessage.SEVERITY_INFO, "Solicitud realizada", "Solicitud de devolución de abono realizada correctamente");
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("solicitarDevolusionDePago(): " + e);
|
||||||
|
showMessage(FacesMessage.SEVERITY_ERROR, "Error", "Error al generar la solicitud de devolución de pago");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void limpiarFormDevolusionDetallePago() {
|
||||||
|
setComentarioDevolucionPago("");
|
||||||
|
}
|
||||||
|
|
||||||
public void limpiarDetallePago() {
|
public void limpiarDetallePago() {
|
||||||
setSelectedDetellePago(null);
|
setSelectedDetellePago(null);
|
||||||
setPagoExitoso(false);
|
setPagoExitoso(false);
|
||||||
@ -282,7 +321,18 @@ public class PagosPolizasBean extends TaxiGenericBean implements Serializable {
|
|||||||
|
|
||||||
public void cargarDetalles() {
|
public void cargarDetalles() {
|
||||||
try {
|
try {
|
||||||
setListDetallePagosPolizas(getPagosPolizaController().fillDetellePagoPolizaByPago(getSelectedPago().getId()));
|
List<DetellePagoPoliza> listaDeDetallesPago = getPagosPolizaController().fillDetellePagoPolizaByPago(getSelectedPago().getId());
|
||||||
|
setListDetallePagosPolizas(listaDeDetallesPago);
|
||||||
|
// se encuentra el siguiente pago que se puede devolver
|
||||||
|
String idDetallePago = "";
|
||||||
|
Collections.reverse(listaDeDetallesPago);
|
||||||
|
for (DetellePagoPoliza pa : listaDeDetallesPago) {
|
||||||
|
if (pa.getEstatusPago().equals(GenericEnumType.ENABLED) && pa.getTipoPago().equals(TipoAbono.ABONO)) {
|
||||||
|
idDetallePago = pa.getId();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setDetallePagoDisponibleParaDevocion(idDetallePago);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("cargarDetalles(): " + e);
|
logger.error("cargarDetalles(): " + e);
|
||||||
showMessage(FacesMessage.SEVERITY_ERROR, "Error", "Ocurrió un error al tratar de cargar los detalles de pago");
|
showMessage(FacesMessage.SEVERITY_ERROR, "Error", "Ocurrió un error al tratar de cargar los detalles de pago");
|
||||||
@ -455,4 +505,20 @@ public class PagosPolizasBean extends TaxiGenericBean implements Serializable {
|
|||||||
this.selectedHistorialAbonoMultiple = selectedHistorialAbonoMultiple;
|
this.selectedHistorialAbonoMultiple = selectedHistorialAbonoMultiple;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getComentarioDevolucionPago() {
|
||||||
|
return comentarioDevolucionPago;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setComentarioDevolucionPago(String comentarioDevolucionPago) {
|
||||||
|
this.comentarioDevolucionPago = comentarioDevolucionPago;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDetallePagoDisponibleParaDevocion() {
|
||||||
|
return detallePagoDisponibleParaDevocion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDetallePagoDisponibleParaDevocion(String detallePagoDisponibleParaDevocion) {
|
||||||
|
this.detallePagoDisponibleParaDevocion = detallePagoDisponibleParaDevocion;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -204,6 +204,8 @@ public class PolizaBean extends TaxiGenericBean implements Serializable, Datatab
|
|||||||
detalle.setId(UUID.randomUUID().toString());
|
detalle.setId(UUID.randomUUID().toString());
|
||||||
detalle.setPagoPoliza(pagoPoliza);
|
detalle.setPagoPoliza(pagoPoliza);
|
||||||
detalle.setEstatusActivo(GenericEnumType.ENABLED);
|
detalle.setEstatusActivo(GenericEnumType.ENABLED);
|
||||||
|
detalle.setEstatusPago(GenericEnumType.ENABLED);
|
||||||
|
detalle.setTipoPago(TipoAbono.ABONO);
|
||||||
detalle.setFechaPago(correcciónDeHr(new Date(), -7));
|
detalle.setFechaPago(correcciónDeHr(new Date(), -7));
|
||||||
detalle.setCantidadPagada(pagoPoliza.getCantidadPagada());
|
detalle.setCantidadPagada(pagoPoliza.getCantidadPagada());
|
||||||
detalle.setCobro(getLoggedUser());
|
detalle.setCobro(getLoggedUser());
|
||||||
|
@ -741,4 +741,5 @@ outcome.prase.polizas=/app/prase/poliza/index
|
|||||||
outcome.prase.pagos=/app/prase/poliza/pagos
|
outcome.prase.pagos=/app/prase/poliza/pagos
|
||||||
outcome.prase.incidencias=/app/prase/incidencias/index
|
outcome.prase.incidencias=/app/prase/incidencias/index
|
||||||
outcome.prase.cargarIncidencia=/app/prase/incidencias/cargarIncidencia
|
outcome.prase.cargarIncidencia=/app/prase/incidencias/cargarIncidencia
|
||||||
|
outcome.prase.polizas.aprobarDevolucionDePagos=/app/prase/poliza/aprobarDevolucionDePagos
|
||||||
|
|
||||||
|
@ -1077,6 +1077,10 @@ catalog.income.expenses.add.path=Cat\u00e1logo / Ingresos/Egresos (Agregar)
|
|||||||
catalog.income.expenses.delete=Borrar ingresos/egresos
|
catalog.income.expenses.delete=Borrar ingresos/egresos
|
||||||
catalog.income.expenses.delete.description=Permite borrar un ingreso o egreso.
|
catalog.income.expenses.delete.description=Permite borrar un ingreso o egreso.
|
||||||
catalog.income.expenses.delete.path=Cat\u00e1logo / Ingresos/Egresos (Borrar)
|
catalog.income.expenses.delete.path=Cat\u00e1logo / Ingresos/Egresos (Borrar)
|
||||||
|
#PRACE
|
||||||
|
admin.devolucion.pagos.aprobe.name=Aprobar devoluci\u00f3n detalle pago
|
||||||
|
admin.devolucion.pagos.aprobe.description=Permite aprobar o cancelar las solicitudes de devoluci\u00f3n de detalles de pago.
|
||||||
|
admin.devolucion.pagos.aprobe.path=Administraci\u00f3n / Solicitudes de devoci\u00f3n pagos (Aprobar)
|
||||||
######################################
|
######################################
|
||||||
# Corporativo / Historial de compras #
|
# Corporativo / Historial de compras #
|
||||||
######################################
|
######################################
|
||||||
|
@ -47,9 +47,8 @@
|
|||||||
<p:menuitem id="sub_admin_employee1" value="Ajustadores" icon="" outcome="#{i18n['outcome.employee']}?tipoEmpleado=1" rendered="#{loginBean.isUserInRole('admin.employee.name')}"/>
|
<p:menuitem id="sub_admin_employee1" value="Ajustadores" icon="" outcome="#{i18n['outcome.employee']}?tipoEmpleado=1" rendered="#{loginBean.isUserInRole('admin.employee.name')}"/>
|
||||||
<p:menuitem id="sub_admin_client" value="#{grant['admin.client.name']}s" icon="" outcome="#{i18n['outcome.client']}" rendered="#{loginBean.isUserInRole('admin.client.name')}"/>
|
<p:menuitem id="sub_admin_client" value="#{grant['admin.client.name']}s" icon="" outcome="#{i18n['outcome.client']}" rendered="#{loginBean.isUserInRole('admin.client.name')}"/>
|
||||||
<p:menuitem id="sub_admin_provider" value="Terceros" icon="" outcome="#{i18n['outcome.provider']}" rendered="#{loginBean.isUserInRole('admin.provider.name')}" />
|
<p:menuitem id="sub_admin_provider" value="Terceros" icon="" outcome="#{i18n['outcome.provider']}" rendered="#{loginBean.isUserInRole('admin.provider.name')}" />
|
||||||
|
|
||||||
<p:menuitem id="sub_admin_expense_invoice" value="Ingresos/Egresos" icon="" outcome="#{i18n['outcome.admin.expense.invoice']}" rendered="#{loginBean.isUserInRole('admin.income.expenses.name')}" />
|
<p:menuitem id="sub_admin_expense_invoice" value="Ingresos/Egresos" icon="" outcome="#{i18n['outcome.admin.expense.invoice']}" rendered="#{loginBean.isUserInRole('admin.income.expenses.name')}" />
|
||||||
|
<p:menuitem id="sub_admin_devolucion_pago" value="Solicitudes de devoción pagos" icon="" outcome="#{i18n['outcome.prase.polizas.aprobarDevolucionDePagos']}" rendered="#{loginBean.isUserInRole('admin.devolucion.pagos.aprobe.name')}" />
|
||||||
</p:submenu>
|
</p:submenu>
|
||||||
|
|
||||||
<p:submenu id="menu_catalog" label="Catálogos" icon="">
|
<p:submenu id="menu_catalog" label="Catálogos" icon="">
|
||||||
|
@ -80,7 +80,7 @@
|
|||||||
decimalSeparator="."
|
decimalSeparator="."
|
||||||
thousandSeparator=","
|
thousandSeparator=","
|
||||||
symbol="$"
|
symbol="$"
|
||||||
value="#{addClosingDayBean.totalSanctionsIn+addClosingDayBean.totalPagosPoliza}"
|
value="#{addClosingDayBean.totalSanctionsIn+(addClosingDayBean.totalPagosPoliza-addClosingDayBean.totalDevolucionPagosPoliza)}"
|
||||||
disabled="true">
|
disabled="true">
|
||||||
</p:inputNumber>
|
</p:inputNumber>
|
||||||
<label>Total de entradas</label>
|
<label>Total de entradas</label>
|
||||||
|
@ -0,0 +1,97 @@
|
|||||||
|
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
|
||||||
|
xmlns:h="http://java.sun.com/jsf/html"
|
||||||
|
xmlns:f="http://java.sun.com/jsf/core"
|
||||||
|
xmlns:ui="http://java.sun.com/jsf/facelets"
|
||||||
|
xmlns:p="http://primefaces.org/ui"
|
||||||
|
template="/WEB-INF/template.xhtml">
|
||||||
|
<ui:define name="title">#{i18n.project} - Pólizas</ui:define>
|
||||||
|
<ui:define name="head">
|
||||||
|
<h:outputScript library="js" name="catalog/carBrand.js" />
|
||||||
|
<h:outputScript library="serenity-layout" name="js/calendar_es.js" />
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.bgVerde {
|
||||||
|
background-color: #56E635 !important;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
</ui:define>
|
||||||
|
|
||||||
|
<ui:define name="breadcrumb">
|
||||||
|
<li>Prase</li>
|
||||||
|
<li>/</li>
|
||||||
|
<li><p:link outcome="#{i18n['outcome.prase.polizas.aprobarDevolucionDePagos']}">Aprobar devolución de pagos</p:link></li>
|
||||||
|
</ui:define>
|
||||||
|
|
||||||
|
<ui:define name="content">
|
||||||
|
<div class="ui-g">
|
||||||
|
<div class="ui-g-12">
|
||||||
|
<div class="card card-w-title">
|
||||||
|
<h1>Solicitudes de devolución de pagos </h1>
|
||||||
|
<h:form id="form" rendered="#{loginBean.isUserInRole('corporate.kardex.shopping.name')}">
|
||||||
|
<p:growl id="msgs" showDetail="true"/>
|
||||||
|
|
||||||
|
<p:dataTable widgetVar="dtTable" id="dtTable" var="data" draggableRows="true" draggableColumns="true" value="#{aprobarDevolucionDePagosBean.listSolicitudes}" style="margin-bottom:20px;text-align: center" reflow="true" rowsPerPageTemplate="5,10,25,50,100" emptyMessage="Sin registros"
|
||||||
|
rowKey="#{data.id}" selection="#{aprobarDevolucionDePagosBean.selectSolicitud}" editable="true" selectionMode="single" paginator="true" rows="10" paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}">
|
||||||
|
|
||||||
|
<f:facet name="header">
|
||||||
|
<p:commandButton id="toggler" type="button" value="Columnas" style="float:left;" styleClass="amber-btn flat" icon="ui-icon-calendar"/>
|
||||||
|
<p:columnToggler datasource="dtTable" trigger="toggler" />
|
||||||
|
<p:outputPanel>
|
||||||
|
<h:outputText value="#{i18n['general.search']}: " />
|
||||||
|
<p:inputText id="globalFilter" onkeyup="PF('dtTable').filter()" style="width:150px;color: #000000;"/>
|
||||||
|
</p:outputPanel>
|
||||||
|
</f:facet>
|
||||||
|
|
||||||
|
<p:column headerText="Pago a devolver" sortBy="#{data.detallePagoSolicitud.folio} - $#{data.montoDevolucion}" filterBy="#{data.detallePagoSolicitud.folio} - $#{data.montoDevolucion}">
|
||||||
|
<h:outputText value="#{data.detallePagoSolicitud.folio} - $#{data.montoDevolucion}" />
|
||||||
|
</p:column>
|
||||||
|
|
||||||
|
<p:column headerText="Solicitado por" sortBy="#{data.usuarioSolicito.userName}" filterBy="#{data.usuarioSolicito.userName}">
|
||||||
|
<h:outputText value="#{data.usuarioSolicito.userName}" />
|
||||||
|
</p:column>
|
||||||
|
|
||||||
|
<p:column headerText="Usuario afectado en el corte" sortBy="#{data.usuarioCorte.userName}" filterBy="#{data.usuarioCorte.userName}">
|
||||||
|
<h:outputText value="#{data.usuarioCorte.userName}" />
|
||||||
|
</p:column>
|
||||||
|
|
||||||
|
<p:column headerText="Estatus" sortBy="#{data.estatusSolicitud.type}" filterBy="#{data.estatusSolicitud.type}">
|
||||||
|
<h:outputText value="#{data.estatusSolicitud.type}" />
|
||||||
|
</p:column>
|
||||||
|
|
||||||
|
<p:column headerText="Comentarios" sortBy="#{data.comentario}" filterBy="#{data.comentario}">
|
||||||
|
<h:outputText value="#{data.comentario}" />
|
||||||
|
</p:column>
|
||||||
|
|
||||||
|
<p:column headerText="Acciones" style="width: 9em">
|
||||||
|
<p:commandButton
|
||||||
|
rendered="#{data.estatusSolicitud eq 'PENDIENTE'}" styleClass="edit-button rounded-button ui-button-secondary" icon="ui-icon-check"
|
||||||
|
action="#{aprobarDevolucionDePagosBean.aprobarSolcitud()}" update="form" >
|
||||||
|
<f:setPropertyActionListener value="#{data}" target="#{aprobarDevolucionDePagosBean.selectSolicitud}" />
|
||||||
|
<p:confirm header="Autorizar devolución" message="¿Quiere autorizar esta devolución?" icon="pi pi-info-circle"/>
|
||||||
|
</p:commandButton>
|
||||||
|
|
||||||
|
<p:commandButton
|
||||||
|
rendered="#{data.estatusSolicitud eq 'PENDIENTE'}" styleClass="edit-button rounded-button ui-button-secondary" style="background-color: red" icon="ui-icon-delete"
|
||||||
|
action="#{aprobarDevolucionDePagosBean.rechazarSolicitud()}" update="form" >
|
||||||
|
<f:setPropertyActionListener value="#{data}" target="#{aprobarDevolucionDePagosBean.selectSolicitud}" />
|
||||||
|
<p:confirm header="Cancelar devolución" message="¿Esta seguro de cancelar esta devolución?" icon="pi pi-info-circle"/>
|
||||||
|
</p:commandButton>
|
||||||
|
</p:column>
|
||||||
|
|
||||||
|
</p:dataTable>
|
||||||
|
|
||||||
|
<p:confirmDialog global="true" showEffect="fade" hideEffect="fade" responsive="true" width="350">
|
||||||
|
<p:commandButton value="No" type="button" styleClass="ui-confirmdialog-no ui-button-flat"/>
|
||||||
|
<p:commandButton value="Si" type="button" styleClass="ui-confirmdialog-yes" />
|
||||||
|
</p:confirmDialog>
|
||||||
|
|
||||||
|
</h:form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ui:define>
|
||||||
|
|
||||||
|
|
||||||
|
</ui:composition>
|
@ -159,10 +159,6 @@
|
|||||||
<h:outputText value="#{pago.pagoEstatus eq 'ENABLED'?'Pagado':pago.pagoEstatus eq 'INCOMPLETE'?'Incompleto':'No pagado'}" />
|
<h:outputText value="#{pago.pagoEstatus eq 'ENABLED'?'Pagado':pago.pagoEstatus eq 'INCOMPLETE'?'Incompleto':'No pagado'}" />
|
||||||
</p:column>
|
</p:column>
|
||||||
|
|
||||||
<p:column headerText="Folio" sortBy="#{pago.folio}" filterBy="#{pago.folio}">
|
|
||||||
<h:outputText value="#{pago.folio}" />
|
|
||||||
</p:column>
|
|
||||||
|
|
||||||
<p:column headerText="Pago" sortBy="#{pago.pago}" filterBy="#{pago.pago}">
|
<p:column headerText="Pago" sortBy="#{pago.pago}" filterBy="#{pago.pago}">
|
||||||
<h:outputText value="#{pago.pago}" >
|
<h:outputText value="#{pago.pago}" >
|
||||||
<f:convertNumber currencySymbol="$" groupingUsed="true" maxFractionDigits="2" type="currency" locale="en" />
|
<f:convertNumber currencySymbol="$" groupingUsed="true" maxFractionDigits="2" type="currency" locale="en" />
|
||||||
@ -187,16 +183,6 @@
|
|||||||
</h:outputText>
|
</h:outputText>
|
||||||
</p:column>
|
</p:column>
|
||||||
|
|
||||||
<p:column headerText="Fecha de pago" sortBy="#{pago.fechaPago}" filterBy="#{pago.fechaPago}">
|
|
||||||
<h:outputText value="#{pago.fechaPago}" >
|
|
||||||
<f:convertDateTime pattern="dd/MM/yyyy" />
|
|
||||||
</h:outputText>
|
|
||||||
</p:column>
|
|
||||||
|
|
||||||
<p:column headerText="Usuario cobro" sortBy="#{pago.cobro.person.firstName} #{pago.cobro.person.secondName} #{pago.cobro.person.lastName} #{pago.cobro.person.middleName}" filterBy="#{pago.cobro.person.firstName} #{pago.cobro.person.secondName} #{pago.cobro.person.lastName} #{pago.cobro.person.middleName}">
|
|
||||||
<h:outputText value="#{pago.cobro.person.firstName} #{pago.cobro.person.secondName} #{pago.cobro.person.lastName} #{pago.cobro.person.middleName}" />
|
|
||||||
</p:column>
|
|
||||||
|
|
||||||
<p:column headerText="Acciones">
|
<p:column headerText="Acciones">
|
||||||
|
|
||||||
<p:commandButton title="Pagar" value="Pagar" update="pagarForm" oncomplete="PF('pagarDialog').show()" action="#{pagosPolizasBean.cargarPago()}" rendered="#{(pago.pagoEstatus eq 'DISABLED' or pago.pagoEstatus eq 'INCOMPLETE' )and pago.id eq pagosPolizasBean.pagoSiguiente}" >
|
<p:commandButton title="Pagar" value="Pagar" update="pagarForm" oncomplete="PF('pagarDialog').show()" action="#{pagosPolizasBean.cargarPago()}" rendered="#{(pago.pagoEstatus eq 'DISABLED' or pago.pagoEstatus eq 'INCOMPLETE' )and pago.id eq pagosPolizasBean.pagoSiguiente}" >
|
||||||
@ -238,6 +224,14 @@
|
|||||||
<p:inputText id="globalFilter" onkeyup="PF('dtdetallePagos').filter()" style="width:150px;color: #000000;"/>
|
<p:inputText id="globalFilter" onkeyup="PF('dtdetallePagos').filter()" style="width:150px;color: #000000;"/>
|
||||||
</p:outputPanel>
|
</p:outputPanel>
|
||||||
</f:facet>
|
</f:facet>
|
||||||
|
|
||||||
|
<p:column headerText="Tipo pago" sortBy="#{detallePago.tipoPago}" filterBy="#{detallePago.tipoPago}">
|
||||||
|
<h:outputText value="#{detallePago.tipoPago}" />
|
||||||
|
</p:column>
|
||||||
|
|
||||||
|
<p:column headerText="Estatus del pago" sortBy="#{detallePago.estatusPago eq 'ENABLED'?'PAGADO':detallePago.estatusPago eq 'ENABLED'?'NO PAGADO':detallePago.estatusPago eq 'CANCELED'?'CANCELADO':'INCOMPLETO'}" filterBy="#{detallePago.estatusPago eq 'ENABLED'?'PAGADO':detallePago.estatusPago eq 'ENABLED'?'NO PAGADO':detallePago.estatusPago eq 'CANCELED'?'CANCELADO':'INCOMPLETO'}">
|
||||||
|
<h:outputText value="#{detallePago.estatusPago eq 'ENABLED'?'PAGADO':detallePago.estatusPago eq 'ENABLED'?'NO PAGADO':detallePago.estatusPago eq 'CANCELED'?'CANCELADO':'INCOMPLETO'}" />
|
||||||
|
</p:column>
|
||||||
|
|
||||||
<p:column headerText="Metodo pago" sortBy="#{detallePago.metodoPago}" filterBy="#{detallePago.metodoPago}">
|
<p:column headerText="Metodo pago" sortBy="#{detallePago.metodoPago}" filterBy="#{detallePago.metodoPago}">
|
||||||
<h:outputText value="#{detallePago.metodoPago}" />
|
<h:outputText value="#{detallePago.metodoPago}" />
|
||||||
@ -272,7 +266,20 @@
|
|||||||
oncomplete="PF('printer').show()"
|
oncomplete="PF('printer').show()"
|
||||||
update="formTicket"
|
update="formTicket"
|
||||||
style="margin-top: 0.5em; background-color: #E6702E"
|
style="margin-top: 0.5em; background-color: #E6702E"
|
||||||
action="#{pagosPolizasBean.reimprimirTicket()}">
|
action="#{pagosPolizasBean.reimprimirTicket()}"
|
||||||
|
rendered="#{detallePago.tipoPago eq 'ABONO' and detallePago.estatusPago eq 'ENABLED'}">
|
||||||
|
<f:setPropertyActionListener value="#{detallePago}" target="#{pagosPolizasBean.selectedDetellePago}"/>
|
||||||
|
</p:commandButton>
|
||||||
|
|
||||||
|
<p:commandButton
|
||||||
|
process="@this"
|
||||||
|
value="Devolver"
|
||||||
|
title="Devolver"
|
||||||
|
oncomplete="PF('devolverDetatallePagoDialog').show()"
|
||||||
|
update="devolverDetatallePagoForm"
|
||||||
|
style="margin-top: 0.5em; background-color: #E6702E"
|
||||||
|
action="#{pagosPolizasBean.limpiarFormDevolusionDetallePago()}"
|
||||||
|
rendered="#{detallePago.id eq pagosPolizasBean.detallePagoDisponibleParaDevocion}">
|
||||||
<f:setPropertyActionListener value="#{detallePago}" target="#{pagosPolizasBean.selectedDetellePago}"/>
|
<f:setPropertyActionListener value="#{detallePago}" target="#{pagosPolizasBean.selectedDetellePago}"/>
|
||||||
</p:commandButton>
|
</p:commandButton>
|
||||||
|
|
||||||
@ -362,6 +369,23 @@
|
|||||||
</p:dialog>
|
</p:dialog>
|
||||||
</h:form>
|
</h:form>
|
||||||
|
|
||||||
|
<h:form id="devolverDetatallePagoForm">
|
||||||
|
<p:dialog widgetVar="devolverDetatallePagoDialog" height="30%" width="30%" id="devolverDetatallePagoDialog" header="Solicitar devolución de detalle de pago" modal="true">
|
||||||
|
<p:ajax event="close" update="devolverDetatallePagoDialog" />
|
||||||
|
<p:outputPanel style="margin-top: 1em" >
|
||||||
|
|
||||||
|
<h:panelGroup styleClass="md-inputfield" >
|
||||||
|
<p:inputText id="comentario" value="#{pagosPolizasBean.comentarioDevolucionPago}" style="width: 100%;" />
|
||||||
|
<label>Motivo por el cual solicita la devoción</label>
|
||||||
|
<p:message for="comentario" display="text"/>
|
||||||
|
</h:panelGroup>
|
||||||
|
|
||||||
|
<p:commandButton id="addButton1" value="Solicitar" actionListener="#{pagosPolizasBean.solicitarDevolusionDePago()}" update="form, devolverDetatallePagoForm" />
|
||||||
|
|
||||||
|
</p:outputPanel>
|
||||||
|
</p:dialog>
|
||||||
|
</h:form>
|
||||||
|
|
||||||
<h:form id="formTicket">
|
<h:form id="formTicket">
|
||||||
<p:dialog header="Vista previa del ticket" widgetVar="printer" minHeight="40" width="350" showEffect="fade" id="printer">
|
<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()}" />
|
<p:ajax event="close" update="printer" listener="#{pagosPolizasBean.limpiarDetallePago()}" />
|
||||||
@ -409,7 +433,7 @@
|
|||||||
</f:facet>
|
</f:facet>
|
||||||
</p:dialog>
|
</p:dialog>
|
||||||
</h:form>
|
</h:form>
|
||||||
|
|
||||||
<h:form id="formTicketMultiple">
|
<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: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:ajax event="close" update="printerMultiple" listener="#{pagosPolizasBean.limpiarDetallePagoMultiple()}" />
|
||||||
|
Loading…
Reference in New Issue
Block a user