Compare commits
2 Commits
bf281bef70
...
deb3434d7d
Author | SHA1 | Date | |
---|---|---|---|
deb3434d7d | |||
96575e133d |
@ -697,10 +697,11 @@ public class ClosingDayController extends ConnectionManager implements Serializa
|
||||
List<ClosingDayDetail> details = new ArrayList<>();
|
||||
try {
|
||||
|
||||
details.addAll(buildDetailsList(4, executeNativeSQLQuery(query_details_expenses, userID)));
|
||||
details.addAll(buildDetailsList(13, executeNativeSQLQuery(query_details_expenses_by_type, userID)));
|
||||
details.addAll(buildDetailsList(13, executeNativeSQLQuery(query_details_expenses_by_type_earning, userID)));
|
||||
details.addAll(buildDetailsList(25, executeNativeSQLQuery(query_poliza_prase, userID)));
|
||||
details.addAll(buildDetailsList(1, executeNativeSQLQuery(query_details_expenses, userID)));
|
||||
details.addAll(buildDetailsList(2, executeNativeSQLQuery(query_details_expenses_by_type, userID)));
|
||||
details.addAll(buildDetailsList(2, executeNativeSQLQuery(query_details_expenses_by_type_earning, userID)));
|
||||
details.addAll(buildDetailsList(3, executeNativeSQLQuery(query_poliza_prase, userID)));
|
||||
details.addAll(buildDetailsList(4, executeNativeSQLQuery(query_poliza_prase_devolcion, userID)));
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error(e);
|
||||
@ -1030,13 +1031,34 @@ public class ClosingDayController extends ConnectionManager implements Serializa
|
||||
+ "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 ";
|
||||
|
||||
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 "
|
||||
+ "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' 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 ";
|
||||
|
||||
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.core.User;
|
||||
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.MetodoPago;
|
||||
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.HistorialAbonoMultiple;
|
||||
import com.crov.prase.model.prase.PagosPoliza;
|
||||
import com.crov.prase.model.prase.Poliza;
|
||||
import com.crov.prase.model.prase.SolicitudDevolucionDetellePagoPoliza;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
@ -98,7 +101,7 @@ public class PagosPolizaController extends ConnectionManager implements Serializ
|
||||
Predicate criterio1 = builder.equal(root.get("poliza").get("location"), location);
|
||||
Predicate criterio2 = builder.equal(root.get("estatusActivo"), GenericEnumType.ENABLED);
|
||||
Predicate criterio3 = builder.equal(root.get("pagoEstatus"), GenericEnumType.DISABLED);
|
||||
Predicate criterio4 = builder.notEqual(root.get("poliza").get("estatus"), PolizaEstatus.CANCELADO);
|
||||
Predicate criterio4 = builder.equal(root.get("poliza").get("active"), true);
|
||||
Predicate criterio5 = builder.greaterThanOrEqualTo(root.get("poliza").get("endDate").as(LocalDate.class), localHoy);
|
||||
Predicate startDatePredicate = builder.greaterThanOrEqualTo(root.get("fechaAPagar").as(LocalDate.class), localStartDate);
|
||||
Predicate endDatePredicate = builder.lessThanOrEqualTo(root.get("fechaAPagar").as(LocalDate.class), localEndDate);
|
||||
@ -371,6 +374,8 @@ public class PagosPolizaController extends ConnectionManager implements Serializ
|
||||
detalle.setId(UUID.randomUUID().toString());
|
||||
detalle.setPagoPoliza(pago);
|
||||
detalle.setEstatusActivo(GenericEnumType.ENABLED);
|
||||
detalle.setEstatusPago(GenericEnumType.ENABLED);
|
||||
detalle.setTipoPago(TipoAbono.ABONO);
|
||||
detalle.setFechaPago(fechaActual);
|
||||
detalle.setCantidadPagada(montoAplicar);
|
||||
detalle.setCobro(user);
|
||||
@ -510,6 +515,203 @@ public class PagosPolizaController extends ConnectionManager implements Serializ
|
||||
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) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(fecha);
|
||||
|
@ -12,7 +12,6 @@ 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.arrebol.taxiservicios.model.enums.PolizaEstatus;
|
||||
import com.crov.prase.model.prase.DetellePagoPoliza;
|
||||
import com.crov.prase.model.prase.PagosPoliza;
|
||||
import com.crov.prase.model.prase.Poliza;
|
||||
@ -375,7 +374,7 @@ public class PolizaController extends ConnectionManager implements Serializable
|
||||
LocalDate localEndDate = endDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||
|
||||
Predicate criterio = builder.equal(root.get("active"), Boolean.TRUE);
|
||||
Predicate criterio2 = builder.notEqual(root.get("estatus"), PolizaEstatus.CANCELADO);
|
||||
Predicate criterio2 = builder.equal(root.get("active"), true);
|
||||
Predicate criterio3 = 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);
|
||||
|
@ -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.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.User;
|
||||
import com.arrebol.taxiservicios.model.enums.ExpenseType;
|
||||
import com.arrebol.taxiservicios.model.enums.SanctionType;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
@ -21,296 +20,188 @@ import java.util.Date;
|
||||
*/
|
||||
public class ClosingDayDetail implements Serializable {
|
||||
|
||||
private String id;
|
||||
private ClosingDay closingDay;
|
||||
private String type;
|
||||
private BigDecimal amount;
|
||||
private BigDecimal amountSaving;
|
||||
private BigDecimal amountAccident;
|
||||
private Person person;
|
||||
private String comments;
|
||||
private User createdBy;
|
||||
private Date createdOn;
|
||||
private User lastUpdatedBy;
|
||||
private Date lastUpdatedOn;
|
||||
private String id;
|
||||
private ClosingDay closingDay;
|
||||
private String type;
|
||||
private BigDecimal amount;
|
||||
private BigDecimal amountSaving;
|
||||
private BigDecimal amountAccident;
|
||||
private Person person;
|
||||
private String comments;
|
||||
private User createdBy;
|
||||
private Date createdOn;
|
||||
private User lastUpdatedBy;
|
||||
private Date lastUpdatedOn;
|
||||
|
||||
private GeneralPublic general;
|
||||
private GeneralPublic general;
|
||||
|
||||
public ClosingDayDetail() {
|
||||
}
|
||||
public ClosingDayDetail() {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param type
|
||||
* @param amount
|
||||
* @param amountSaving
|
||||
* @param amountAccident
|
||||
* @param person
|
||||
* @param comments
|
||||
*/
|
||||
public ClosingDayDetail(String type, BigDecimal amount, BigDecimal amountSaving, BigDecimal amountAccident, Person person, String comments) {
|
||||
this.type = type;
|
||||
this.amount = amount;
|
||||
this.amountSaving = amountSaving;
|
||||
this.amountAccident = amountAccident;
|
||||
this.person = person;
|
||||
this.comments = comments;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param type
|
||||
* @param amount
|
||||
* @param amountSaving
|
||||
* @param amountAccident
|
||||
* @param person
|
||||
* @param comments
|
||||
*/
|
||||
public ClosingDayDetail(String type, BigDecimal amount, BigDecimal amountSaving, BigDecimal amountAccident, Person person, String comments) {
|
||||
this.type = type;
|
||||
this.amount = amount;
|
||||
this.amountSaving = amountSaving;
|
||||
this.amountAccident = amountAccident;
|
||||
this.person = person;
|
||||
this.comments = comments;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param queryNumber 1: query_details_sales, 2: query_details_sanctions_in,
|
||||
* 3: query_details_sanctions_out, 4: query_details_expenses, 5:
|
||||
* query_details_invoices.
|
||||
* @param array
|
||||
*/
|
||||
//Para poder añadir que se va a mostrar (supongo)
|
||||
public ClosingDayDetail(int queryNumber, Object[] array) {
|
||||
switch (queryNumber) {
|
||||
case 1:
|
||||
if (((String) array[6]).equals("DISABLED")) {
|
||||
this.type = "Venta diaria";
|
||||
} else {
|
||||
this.type = "Venta diaria - Depósito";
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param queryNumber 1: query_details_sales, 2: query_details_sanctions_in,
|
||||
* 3: query_details_sanctions_out, 4: query_details_expenses, 5:
|
||||
* query_details_invoices.
|
||||
* @param array
|
||||
*/
|
||||
//Para poder añadir que se va a mostrar (supongo)
|
||||
public ClosingDayDetail(int queryNumber, Object[] array) {
|
||||
switch (queryNumber) {
|
||||
|
||||
this.person = new Person((String) array[3], (String) array[5]);
|
||||
this.amount = new BigDecimal((Double) array[0]);
|
||||
this.amountSaving = new BigDecimal((Double) array[1]);
|
||||
this.amountAccident = new BigDecimal((Double) array[2]);
|
||||
this.comments = (String) array[4];
|
||||
break;
|
||||
case 2:
|
||||
this.type = SanctionType.valueOf(array[1].toString()).getType();
|
||||
this.person = new Person((String) array[2], (String) array[4]);
|
||||
this.amount = new BigDecimal((Double) array[0]);
|
||||
this.comments = (String) array[3];
|
||||
break;
|
||||
case 3:
|
||||
this.type = SanctionType.valueOf(array[1].toString()).getType();
|
||||
this.person = new Person((String) array[2], (String) array[4]);
|
||||
this.amount = new BigDecimal((Double) array[0]);
|
||||
this.comments = (String) array[3];
|
||||
break;
|
||||
case 4:
|
||||
this.type = ExpenseType.valueOf(array[1].toString()).getType();
|
||||
this.person = new Person((String) array[2], (String) array[4]);
|
||||
this.amount = new BigDecimal((Double) array[0]);
|
||||
this.comments = (String) array[3];
|
||||
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;
|
||||
}
|
||||
case 1:
|
||||
this.type = ExpenseType.valueOf(array[1].toString()).getType();
|
||||
this.person = new Person((String) array[2], (String) array[4]);
|
||||
this.amount = new BigDecimal((Double) array[0]);
|
||||
this.comments = (String) array[3];
|
||||
break;
|
||||
case 2:
|
||||
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 3:
|
||||
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;
|
||||
case 4:
|
||||
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 : " + array[3];
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public ClosingDay getClosingDay() {
|
||||
return closingDay;
|
||||
}
|
||||
public ClosingDay getClosingDay() {
|
||||
return closingDay;
|
||||
}
|
||||
|
||||
public void setClosingDay(ClosingDay closingDay) {
|
||||
this.closingDay = closingDay;
|
||||
}
|
||||
public void setClosingDay(ClosingDay closingDay) {
|
||||
this.closingDay = closingDay;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public BigDecimal getAmount() {
|
||||
return amount;
|
||||
}
|
||||
public BigDecimal getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
public void setAmount(BigDecimal amount) {
|
||||
this.amount = amount;
|
||||
}
|
||||
public void setAmount(BigDecimal amount) {
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public BigDecimal getAmountSaving() {
|
||||
return amountSaving;
|
||||
}
|
||||
public BigDecimal getAmountSaving() {
|
||||
return amountSaving;
|
||||
}
|
||||
|
||||
public void setAmountSaving(BigDecimal amountSaving) {
|
||||
this.amountSaving = amountSaving;
|
||||
}
|
||||
public void setAmountSaving(BigDecimal amountSaving) {
|
||||
this.amountSaving = amountSaving;
|
||||
}
|
||||
|
||||
public BigDecimal getAmountAccident() {
|
||||
return amountAccident;
|
||||
}
|
||||
public BigDecimal getAmountAccident() {
|
||||
return amountAccident;
|
||||
}
|
||||
|
||||
public void setAmountAccident(BigDecimal amountAccident) {
|
||||
this.amountAccident = amountAccident;
|
||||
}
|
||||
public void setAmountAccident(BigDecimal amountAccident) {
|
||||
this.amountAccident = amountAccident;
|
||||
}
|
||||
|
||||
public Person getPerson() {
|
||||
return person;
|
||||
}
|
||||
public Person getPerson() {
|
||||
return person;
|
||||
}
|
||||
|
||||
public void setPerson(Person person) {
|
||||
this.person = person;
|
||||
}
|
||||
public void setPerson(Person person) {
|
||||
this.person = person;
|
||||
}
|
||||
|
||||
public String getComments() {
|
||||
return comments;
|
||||
}
|
||||
public String getComments() {
|
||||
return comments;
|
||||
}
|
||||
|
||||
public void setComments(String comments) {
|
||||
this.comments = comments;
|
||||
}
|
||||
public void setComments(String comments) {
|
||||
this.comments = comments;
|
||||
}
|
||||
|
||||
public User getCreatedBy() {
|
||||
return createdBy;
|
||||
}
|
||||
public User getCreatedBy() {
|
||||
return createdBy;
|
||||
}
|
||||
|
||||
public void setCreatedBy(User createdBy) {
|
||||
this.createdBy = createdBy;
|
||||
}
|
||||
public void setCreatedBy(User createdBy) {
|
||||
this.createdBy = createdBy;
|
||||
}
|
||||
|
||||
public Date getCreatedOn() {
|
||||
return createdOn;
|
||||
}
|
||||
public Date getCreatedOn() {
|
||||
return createdOn;
|
||||
}
|
||||
|
||||
public void setCreatedOn(Date createdOn) {
|
||||
this.createdOn = createdOn;
|
||||
}
|
||||
public void setCreatedOn(Date createdOn) {
|
||||
this.createdOn = createdOn;
|
||||
}
|
||||
|
||||
public User getLastUpdatedBy() {
|
||||
return lastUpdatedBy;
|
||||
}
|
||||
public User getLastUpdatedBy() {
|
||||
return lastUpdatedBy;
|
||||
}
|
||||
|
||||
public void setLastUpdatedBy(User lastUpdatedBy) {
|
||||
this.lastUpdatedBy = lastUpdatedBy;
|
||||
}
|
||||
public void setLastUpdatedBy(User lastUpdatedBy) {
|
||||
this.lastUpdatedBy = lastUpdatedBy;
|
||||
}
|
||||
|
||||
public Date getLastUpdatedOn() {
|
||||
return lastUpdatedOn;
|
||||
}
|
||||
public Date getLastUpdatedOn() {
|
||||
return lastUpdatedOn;
|
||||
}
|
||||
|
||||
public void setLastUpdatedOn(Date lastUpdatedOn) {
|
||||
this.lastUpdatedOn = lastUpdatedOn;
|
||||
}
|
||||
public void setLastUpdatedOn(Date lastUpdatedOn) {
|
||||
this.lastUpdatedOn = lastUpdatedOn;
|
||||
}
|
||||
|
||||
public GeneralPublic getGeneral() {
|
||||
return general;
|
||||
}
|
||||
public GeneralPublic getGeneral() {
|
||||
return general;
|
||||
}
|
||||
|
||||
public void setGeneral(GeneralPublic general) {
|
||||
this.general = general;
|
||||
}
|
||||
public void setGeneral(GeneralPublic general) {
|
||||
this.general = general;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ClosingDayDetail{" + "closingDay=" + closingDay + ", type=" + type + ", comments=" + comments + '}';
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ClosingDayDetail{" + "closingDay=" + closingDay + ", type=" + type + ", comments=" + comments + '}';
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -9,46 +9,50 @@ package com.arrebol.taxiservicios.model.enums;
|
||||
* @author pc one
|
||||
*/
|
||||
public enum TipoAbono {
|
||||
ANTICIPO("Anticipo") {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Anticipo";
|
||||
}
|
||||
},
|
||||
ABONO("Abono") {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Abono";
|
||||
}
|
||||
},
|
||||
SUBABONO("Sub abono") {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Sub abono";
|
||||
}
|
||||
},
|
||||
|
||||
COMISION ("Comisión por apertura"){
|
||||
@Override
|
||||
public String toString() {
|
||||
return "COMISION";
|
||||
}
|
||||
},
|
||||
|
||||
AJUSTE("Ajuste") {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Ajuste";
|
||||
}
|
||||
};
|
||||
|
||||
private final String type;
|
||||
ANTICIPO("ANTICIPO") {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Anticipo";
|
||||
}
|
||||
},
|
||||
ABONO("ABONO") {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Abono";
|
||||
}
|
||||
},
|
||||
SUBABONO("ABONO") {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Sub abono";
|
||||
}
|
||||
},
|
||||
DEVOLUCION("DEVOLUCION") {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Devolución";
|
||||
}
|
||||
},
|
||||
COMISION("COMISION") {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Comisión por apertura";
|
||||
}
|
||||
},
|
||||
AJUSTE("AJUSTE") {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Ajuste";
|
||||
}
|
||||
};
|
||||
|
||||
private TipoAbono(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
private final String type;
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
private TipoAbono(String 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.enums.GenericEnumType;
|
||||
import com.arrebol.taxiservicios.model.enums.MetodoPago;
|
||||
import com.arrebol.taxiservicios.model.enums.TipoAbono;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import javax.persistence.Column;
|
||||
@ -51,6 +52,14 @@ public class DetellePagoPoliza implements Serializable {
|
||||
@Column(name = "estatus_activo", nullable = false)
|
||||
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)
|
||||
@Column(name = "fecha_pago")
|
||||
private Date fechaPago;
|
||||
@ -216,4 +225,20 @@ public class DetellePagoPoliza implements Serializable {
|
||||
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.PaquetesCobertura"/>
|
||||
<mapping class="com.crov.prase.model.prase.Coberturas"/>
|
||||
<mapping class="com.crov.prase.model.prase.SolicitudDevolucionDetellePagoPoliza"/>
|
||||
<!-- Queries for Table mapping -->
|
||||
|
||||
|
||||
|
@ -147,6 +147,7 @@ public class AddClosingDayBean extends TaxiGenericBean implements Serializable {
|
||||
setTotalPaid(null);
|
||||
setTotalTransfer(null);
|
||||
setTotalPagosPoliza(null);
|
||||
setTotalDevolucionPagosPoliza(null);
|
||||
validateMutual = null;
|
||||
setUsers(getController().getAllActiveUsers(getLoggedUser().getLocation()));
|
||||
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()));
|
||||
setTotalPagosPoliza(getController().findTotals(query_total_poliza_prase, getSelectedUserId()));
|
||||
setTotalDevolucionPagosPoliza(getController().findTotals(query_total_poliza_prase_devolucion, getSelectedUserId()));
|
||||
setSaveCashDailyCut(true);
|
||||
setDetails(getController().findClosingDayDetails(getSelectedUserId()));
|
||||
sumTotals();
|
||||
@ -362,7 +364,7 @@ public class AddClosingDayBean extends TaxiGenericBean implements Serializable {
|
||||
|
||||
private void sumTotals() {
|
||||
try {
|
||||
totalToPay = getTotalSanctionsIn() + getTotalPagosPoliza();
|
||||
totalToPay = getTotalSanctionsIn() + (getTotalPagosPoliza() - getTotalDevolucionPagosPoliza());
|
||||
totalToPay += -(getTotalSanctionsOut() + getTotalExpenses());
|
||||
totalExpenses = getTotalExpenses();
|
||||
} catch (Exception e) {
|
||||
@ -410,6 +412,7 @@ public class AddClosingDayBean extends TaxiGenericBean implements Serializable {
|
||||
private Double totalPaid;
|
||||
|
||||
private Double totalPagosPoliza;
|
||||
private Double totalDevolucionPagosPoliza;
|
||||
|
||||
private Double validateMutual;
|
||||
private Double validateSale;
|
||||
@ -645,6 +648,14 @@ public class AddClosingDayBean extends TaxiGenericBean implements Serializable {
|
||||
this.totalPagosPoliza = totalPagosPoliza;
|
||||
}
|
||||
|
||||
public Double getTotalDevolucionPagosPoliza() {
|
||||
return totalDevolucionPagosPoliza;
|
||||
}
|
||||
|
||||
public void setTotalDevolucionPagosPoliza(Double totalDevolucionPagosPoliza) {
|
||||
this.totalDevolucionPagosPoliza = totalDevolucionPagosPoliza;
|
||||
}
|
||||
|
||||
final Logger logger = LogManager.getLogger(AddClosingDayBean.class);
|
||||
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 + " "
|
||||
+ " AND cobro = :userID "
|
||||
+ " 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' ";
|
||||
|
||||
}
|
||||
|
@ -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.controller.admin.GenericValidationController;
|
||||
import com.arrebol.taxiservicios.model.enums.EstatusSolicitud;
|
||||
import com.arrebol.taxiservicios.model.enums.GenericEnumType;
|
||||
import com.arrebol.taxiservicios.model.enums.MetodoPago;
|
||||
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.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 com.crov.prase.model.prase.SolicitudDevolucionDetellePagoPoliza;
|
||||
import java.io.Serializable;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
@ -56,6 +60,9 @@ public class PagosPolizasBean extends TaxiGenericBean implements Serializable {
|
||||
private String metodoPago;
|
||||
private HistorialAbonoMultiple selectedHistorialAbonoMultiple;
|
||||
|
||||
private String comentarioDevolucionPago;
|
||||
private String detallePagoDisponibleParaDevocion;
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
logger.info("init");
|
||||
@ -183,6 +190,8 @@ public class PagosPolizasBean extends TaxiGenericBean implements Serializable {
|
||||
DetellePagoPoliza detalle = new DetellePagoPoliza();
|
||||
detalle.setPagoPoliza(pagoA);
|
||||
detalle.setEstatusActivo(GenericEnumType.ENABLED);
|
||||
detalle.setEstatusPago(GenericEnumType.ENABLED);
|
||||
detalle.setTipoPago(TipoAbono.ABONO);
|
||||
detalle.setFechaPago(correcciónDeHr(new Date(), -7));
|
||||
detalle.setCantidadPagada(montoPagado);
|
||||
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() {
|
||||
setSelectedDetellePago(null);
|
||||
setPagoExitoso(false);
|
||||
@ -282,7 +321,18 @@ public class PagosPolizasBean extends TaxiGenericBean implements Serializable {
|
||||
|
||||
public void cargarDetalles() {
|
||||
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) {
|
||||
logger.error("cargarDetalles(): " + e);
|
||||
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;
|
||||
}
|
||||
|
||||
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.setPagoPoliza(pagoPoliza);
|
||||
detalle.setEstatusActivo(GenericEnumType.ENABLED);
|
||||
detalle.setEstatusPago(GenericEnumType.ENABLED);
|
||||
detalle.setTipoPago(TipoAbono.ABONO);
|
||||
detalle.setFechaPago(correcciónDeHr(new Date(), -7));
|
||||
detalle.setCantidadPagada(pagoPoliza.getCantidadPagada());
|
||||
detalle.setCobro(getLoggedUser());
|
||||
|
@ -741,4 +741,5 @@ outcome.prase.polizas=/app/prase/poliza/index
|
||||
outcome.prase.pagos=/app/prase/poliza/pagos
|
||||
outcome.prase.incidencias=/app/prase/incidencias/index
|
||||
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.description=Permite borrar un ingreso o egreso.
|
||||
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 #
|
||||
######################################
|
||||
|
@ -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_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_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 id="menu_catalog" label="Catálogos" icon="">
|
||||
|
@ -80,7 +80,7 @@
|
||||
decimalSeparator="."
|
||||
thousandSeparator=","
|
||||
symbol="$"
|
||||
value="#{addClosingDayBean.totalSanctionsIn+addClosingDayBean.totalPagosPoliza}"
|
||||
value="#{addClosingDayBean.totalSanctionsIn+(addClosingDayBean.totalPagosPoliza-addClosingDayBean.totalDevolucionPagosPoliza)}"
|
||||
disabled="true">
|
||||
</p:inputNumber>
|
||||
<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'}" />
|
||||
</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}">
|
||||
<h:outputText value="#{pago.pago}" >
|
||||
<f:convertNumber currencySymbol="$" groupingUsed="true" maxFractionDigits="2" type="currency" locale="en" />
|
||||
@ -187,16 +183,6 @@
|
||||
</h:outputText>
|
||||
</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: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:outputPanel>
|
||||
</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}">
|
||||
<h:outputText value="#{detallePago.metodoPago}" />
|
||||
@ -272,7 +266,20 @@
|
||||
oncomplete="PF('printer').show()"
|
||||
update="formTicket"
|
||||
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}"/>
|
||||
</p:commandButton>
|
||||
|
||||
@ -362,6 +369,23 @@
|
||||
</p:dialog>
|
||||
</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">
|
||||
<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()}" />
|
||||
@ -409,7 +433,7 @@
|
||||
</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()}" />
|
||||
|
Loading…
Reference in New Issue
Block a user