CANCELACION Y DEVOLUCION DE PRIMAS NO DEVENGADAS
This commit is contained in:
parent
deb3434d7d
commit
70aeef8e9f
@ -702,6 +702,7 @@ public class ClosingDayController extends ConnectionManager implements Serializa
|
||||
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)));
|
||||
details.addAll(buildDetailsList(5, executeNativeSQLQuery(query_solicitudes_cancelacion_poliza, userID)));
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error(e);
|
||||
@ -1061,6 +1062,18 @@ public class ClosingDayController extends ConnectionManager implements Serializa
|
||||
+ " AND e.tipo_pago = 'DEVOLUCION' "
|
||||
+ "AND e.cobro = :userID ";
|
||||
|
||||
private final String query_solicitudes_cancelacion_poliza = "SELECT e.monto_devolucion, "
|
||||
+ " 'Primas no devengadas' AS tipo_pago, "
|
||||
+ "p.id as person, "
|
||||
+ "CONCAT('Poliza: ', pol.folio), " + complete_name + ", e.id "
|
||||
+ "FROM solicitud_cancelacion_poliza e "
|
||||
+ "INNER JOIN poliza_prase pol ON e.id_poliza = pol.id "
|
||||
+ "INNER JOIN person p ON pol.id_customer = p.id "
|
||||
+ "WHERE DATE(e.fecha_pago) > " + sub_query_to_find_previously_closing_day
|
||||
+ "AND e.estatus_activo = 'ENABLED' "
|
||||
+ " AND e.estatus_solicitud = 'APROBADO' "
|
||||
+ "AND e.id_solicitante = :userID ";
|
||||
|
||||
final Logger logger = LogManager.getLogger(ClosingDayController.class);
|
||||
private static final long serialVersionUID = -6732331411572526429L;
|
||||
}
|
||||
|
@ -103,9 +103,10 @@ public class PagosPolizaController extends ConnectionManager implements Serializ
|
||||
Predicate criterio3 = builder.equal(root.get("pagoEstatus"), GenericEnumType.DISABLED);
|
||||
Predicate criterio4 = builder.equal(root.get("poliza").get("active"), true);
|
||||
Predicate criterio5 = builder.greaterThanOrEqualTo(root.get("poliza").get("endDate").as(LocalDate.class), localHoy);
|
||||
Predicate criterio6 = builder.notEqual(root.get("poliza").get("estatus"), PolizaEstatus.CANCELADO);
|
||||
Predicate startDatePredicate = builder.greaterThanOrEqualTo(root.get("fechaAPagar").as(LocalDate.class), localStartDate);
|
||||
Predicate endDatePredicate = builder.lessThanOrEqualTo(root.get("fechaAPagar").as(LocalDate.class), localEndDate);
|
||||
criteria.where(builder.and(criterio1, criterio2, criterio3, criterio4, criterio5, startDatePredicate, endDatePredicate));
|
||||
criteria.where(builder.and(criterio1, criterio2, criterio3, criterio4, criterio5, criterio6, startDatePredicate, endDatePredicate));
|
||||
criteria.orderBy(builder.asc(root.get("fechaAPagar")));
|
||||
|
||||
resultList = session.createQuery(criteria).getResultList();
|
||||
|
@ -12,15 +12,21 @@ 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.EstatusSolicitud;
|
||||
import com.arrebol.taxiservicios.model.enums.GenericEnumType;
|
||||
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;
|
||||
import com.crov.prase.model.prase.SolicitudCancelacionPoliza;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.time.ZoneId;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import javax.persistence.NoResultException;
|
||||
import javax.persistence.criteria.CriteriaBuilder;
|
||||
import javax.persistence.criteria.CriteriaQuery;
|
||||
@ -299,6 +305,148 @@ public class PolizaController extends ConnectionManager implements Serializable
|
||||
return success;
|
||||
}
|
||||
|
||||
public boolean saveSolicitudCancelacionPoliza(SolicitudCancelacionPoliza poliza, User user) {
|
||||
logger.info("saveSolicitudCancelacionPoliza");
|
||||
boolean success = false;
|
||||
Transaction transaction = null;
|
||||
try {
|
||||
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
|
||||
transaction = session.beginTransaction();
|
||||
poliza.setId(UUID.randomUUID().toString());
|
||||
poliza.setCreatedBy(user);
|
||||
poliza.setCreatedOn(correcciónDeHr(new Date(), -7));
|
||||
session.save(poliza);
|
||||
transaction.commit();
|
||||
success = true;
|
||||
} catch (HibernateException e) {
|
||||
logger.error("Can not save solicitud entry", e);
|
||||
rollback(transaction);
|
||||
} catch (Exception e) {
|
||||
logger.error("Method saveSolicitudCancelacionPoliza()", e);
|
||||
rollback(transaction);
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
public boolean updateSolicitudCancelacionPoliza(SolicitudCancelacionPoliza poliza, User user) {
|
||||
logger.info("saveSolicitudCancelacionPoliza");
|
||||
boolean success = false;
|
||||
Transaction transaction = null;
|
||||
try {
|
||||
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
|
||||
transaction = session.beginTransaction();
|
||||
poliza.setLastUpdatedBy(user);
|
||||
poliza.setLastUpdatedOn(correcciónDeHr(new Date(), -7));
|
||||
session.update(poliza);
|
||||
transaction.commit();
|
||||
success = true;
|
||||
} catch (HibernateException e) {
|
||||
logger.error("Can not save solicitud entry", e);
|
||||
rollback(transaction);
|
||||
} catch (Exception e) {
|
||||
logger.error("Method saveSolicitudCancelacionPoliza()", e);
|
||||
rollback(transaction);
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
public List<SolicitudCancelacionPoliza> findSolicitudCancelacionPolizaByLocation(Location location) {
|
||||
logger.info("findSolicitudCancelacionPolizaByLocation");
|
||||
List<SolicitudCancelacionPoliza> results = new ArrayList<>();
|
||||
Transaction transaction = null;
|
||||
try {
|
||||
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
|
||||
transaction = session.beginTransaction();
|
||||
CriteriaBuilder builder = session.getCriteriaBuilder();
|
||||
CriteriaQuery<SolicitudCancelacionPoliza> query = builder.createQuery(SolicitudCancelacionPoliza.class);
|
||||
Root<SolicitudCancelacionPoliza> root = query.from(SolicitudCancelacionPoliza.class);
|
||||
|
||||
Predicate predicate1 = builder.equal(root.get("estatusActivo"), GenericEnumType.ENABLED);
|
||||
Predicate predicate2 = builder.equal(root.get("location"), location);
|
||||
query.where(builder.and(predicate1, predicate2));
|
||||
query.orderBy(builder.asc(root.get("createdOn")));
|
||||
|
||||
results = session.createQuery(query).getResultList();
|
||||
transaction.commit();
|
||||
logger.info("Solicitudes size: " + results.size());
|
||||
} catch (HibernateException e) {
|
||||
logger.error("Can not load solicitudes list ", e);
|
||||
rollback(transaction);
|
||||
} catch (Exception e) {
|
||||
logger.error("Method findSolicitudCancelacionPolizaByLocation() ", e);
|
||||
rollback(transaction);
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
public List<SolicitudCancelacionPoliza> findSolicitudCancelacionPolizaByPolizaAndEstatus(Poliza poliza, EstatusSolicitud estatus) {
|
||||
logger.info("findSolicitudCancelacionPolizaByLocation");
|
||||
List<SolicitudCancelacionPoliza> results = new ArrayList<>();
|
||||
Transaction transaction = null;
|
||||
try {
|
||||
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
|
||||
transaction = session.beginTransaction();
|
||||
CriteriaBuilder builder = session.getCriteriaBuilder();
|
||||
CriteriaQuery<SolicitudCancelacionPoliza> query = builder.createQuery(SolicitudCancelacionPoliza.class);
|
||||
Root<SolicitudCancelacionPoliza> root = query.from(SolicitudCancelacionPoliza.class);
|
||||
|
||||
Predicate predicate1 = builder.equal(root.get("estatusActivo"), GenericEnumType.ENABLED);
|
||||
Predicate predicate2 = builder.equal(root.get("poliza"), poliza);
|
||||
Predicate predicate3 = builder.equal(root.get("estatusSolicitud"), estatus);
|
||||
query.where(builder.and(predicate1, predicate2, predicate3));
|
||||
query.orderBy(builder.asc(root.get("createdOn")));
|
||||
|
||||
results = session.createQuery(query).getResultList();
|
||||
transaction.commit();
|
||||
logger.info("Solicitudes size: " + results.size());
|
||||
} catch (HibernateException e) {
|
||||
logger.error("Can not load solicitudes list ", e);
|
||||
rollback(transaction);
|
||||
} catch (Exception e) {
|
||||
logger.error("Method findSolicitudCancelacionPolizaByLocation() ", e);
|
||||
rollback(transaction);
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
public boolean aprovarCanselacion(SolicitudCancelacionPoliza solisitud, User user) {
|
||||
logger.info("aprovarCanselacion()");
|
||||
Session session = null;
|
||||
Transaction transaction = null;
|
||||
Date fechaActual = correcciónDeHr(new Date(), -7);
|
||||
try {
|
||||
session = HibernateUtil.getSessionFactory().getCurrentSession();
|
||||
transaction = session.beginTransaction();
|
||||
|
||||
// Se actuliza la poliza
|
||||
Poliza selectPolisa = solisitud.getPoliza();
|
||||
selectPolisa.setEstatus(PolizaEstatus.CANCELADO);
|
||||
selectPolisa.setLastUpdatedBy(user);
|
||||
selectPolisa.setLastUpdatedOn(fechaActual);
|
||||
session.update(selectPolisa);
|
||||
// Se actualiza la solicitud
|
||||
solisitud.setEstatusSolicitud(EstatusSolicitud.APROBADO);
|
||||
solisitud.setFechaPago(fechaActual);
|
||||
solisitud.setLastUpdatedBy(user);
|
||||
solisitud.setLastUpdatedOn(fechaActual);
|
||||
session.update(solisitud);
|
||||
|
||||
transaction.commit();
|
||||
return true;
|
||||
|
||||
} catch (Exception e) {
|
||||
if (transaction != null) {
|
||||
transaction.rollback();
|
||||
}
|
||||
logger.error("aprovarCanselacion(): ", e);
|
||||
return false;
|
||||
} finally {
|
||||
if (session != null) {
|
||||
session.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Poliza fillFoliosByPolizas(String abreviacionFolio) {
|
||||
Poliza result = null;
|
||||
Transaction transaction = null;
|
||||
@ -376,10 +524,11 @@ public class PolizaController extends ConnectionManager implements Serializable
|
||||
Predicate criterio = builder.equal(root.get("active"), Boolean.TRUE);
|
||||
Predicate criterio2 = builder.equal(root.get("active"), true);
|
||||
Predicate criterio3 = builder.equal(root.get("location"), location);
|
||||
Predicate criterio4 = builder.notEqual(root.get("estatus"), PolizaEstatus.CANCELADO);
|
||||
Predicate startDatePredicate = builder.greaterThanOrEqualTo(root.get("endDate").as(LocalDate.class), localStartDate);
|
||||
Predicate endDatePredicate = builder.lessThanOrEqualTo(root.get("endDate").as(LocalDate.class), localEndDate);
|
||||
|
||||
query.where(builder.and(criterio, criterio2, criterio3, startDatePredicate, endDatePredicate));
|
||||
query.where(builder.and(criterio, criterio2, criterio3, criterio4, startDatePredicate, endDatePredicate));
|
||||
query.orderBy(builder.asc(root.get("createdOn")));
|
||||
|
||||
results = session.createQuery(query).getResultList();
|
||||
@ -421,6 +570,14 @@ public class PolizaController extends ConnectionManager implements Serializable
|
||||
return success;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
private static final long serialVersionUID = -8772793021819350069L;
|
||||
final Logger logger = LogManager.getLogger(PolizaController.class);
|
||||
}
|
||||
|
@ -91,6 +91,12 @@ public class ClosingDayDetail implements Serializable {
|
||||
this.amount = new BigDecimal((Double) array[0] * -1);
|
||||
this.comments = "Devolución : " + array[3];
|
||||
break;
|
||||
case 5:
|
||||
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 = "Primas no devengadas : " + array[3];
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,220 @@
|
||||
/*
|
||||
* 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_cancelacion_poliza")
|
||||
public class SolicitudCancelacionPoliza 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;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
@Column(name = "estatus_activo", nullable = false)
|
||||
private GenericEnumType estatusActivo;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY, optional = false)
|
||||
@JoinColumn(
|
||||
name = "id_location",
|
||||
referencedColumnName = "id",
|
||||
nullable = false
|
||||
)
|
||||
private Location location;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY, optional = false)
|
||||
@JoinColumn(
|
||||
name = "id_poliza",
|
||||
referencedColumnName = "id",
|
||||
nullable = false
|
||||
)
|
||||
private Poliza poliza;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY, optional = false)
|
||||
@JoinColumn(
|
||||
name = "id_solicitante",
|
||||
referencedColumnName = "id",
|
||||
nullable = false
|
||||
)
|
||||
private User solicitante;
|
||||
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
@Column(name = "fecha_pago")
|
||||
private Date fechaPago;
|
||||
|
||||
@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 SolicitudCancelacionPoliza() {
|
||||
}
|
||||
|
||||
public SolicitudCancelacionPoliza(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public GenericEnumType getEstatusActivo() {
|
||||
return estatusActivo;
|
||||
}
|
||||
|
||||
public void setEstatusActivo(GenericEnumType estatusActivo) {
|
||||
this.estatusActivo = estatusActivo;
|
||||
}
|
||||
|
||||
public Location getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setLocation(Location location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
public Poliza getPoliza() {
|
||||
return poliza;
|
||||
}
|
||||
|
||||
public void setPoliza(Poliza poliza) {
|
||||
this.poliza = poliza;
|
||||
}
|
||||
|
||||
public 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;
|
||||
}
|
||||
|
||||
public User getSolicitante() {
|
||||
return solicitante;
|
||||
}
|
||||
|
||||
public void setSolicitante(User solicitante) {
|
||||
this.solicitante = solicitante;
|
||||
}
|
||||
|
||||
public Date getFechaPago() {
|
||||
return fechaPago;
|
||||
}
|
||||
|
||||
public void setFechaPago(Date fechaPago) {
|
||||
this.fechaPago = fechaPago;
|
||||
}
|
||||
|
||||
}
|
@ -94,6 +94,7 @@
|
||||
<mapping class="com.crov.prase.model.prase.PaquetesCobertura"/>
|
||||
<mapping class="com.crov.prase.model.prase.Coberturas"/>
|
||||
<mapping class="com.crov.prase.model.prase.SolicitudDevolucionDetellePagoPoliza"/>
|
||||
<mapping class="com.crov.prase.model.prase.SolicitudCancelacionPoliza"/>
|
||||
<!-- Queries for Table mapping -->
|
||||
|
||||
|
||||
|
@ -148,6 +148,7 @@ public class AddClosingDayBean extends TaxiGenericBean implements Serializable {
|
||||
setTotalTransfer(null);
|
||||
setTotalPagosPoliza(null);
|
||||
setTotalDevolucionPagosPoliza(null);
|
||||
setTotalRembolsosCancelacionPoliza(null);
|
||||
validateMutual = null;
|
||||
setUsers(getController().getAllActiveUsers(getLoggedUser().getLocation()));
|
||||
getDetails().clear();
|
||||
@ -352,6 +353,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()));
|
||||
setTotalRembolsosCancelacionPoliza(getController().findTotals(query_total_rembolso_cancelacion_poliza, getSelectedUserId()));
|
||||
setSaveCashDailyCut(true);
|
||||
setDetails(getController().findClosingDayDetails(getSelectedUserId()));
|
||||
sumTotals();
|
||||
@ -365,8 +367,8 @@ public class AddClosingDayBean extends TaxiGenericBean implements Serializable {
|
||||
private void sumTotals() {
|
||||
try {
|
||||
totalToPay = getTotalSanctionsIn() + (getTotalPagosPoliza() - getTotalDevolucionPagosPoliza());
|
||||
totalToPay += -(getTotalSanctionsOut() + getTotalExpenses());
|
||||
totalExpenses = getTotalExpenses();
|
||||
totalToPay += -(getTotalSanctionsOut() + getTotalExpenses() + getTotalRembolsosCancelacionPoliza());
|
||||
totalExpenses = getTotalExpenses() + getTotalRembolsosCancelacionPoliza();
|
||||
} catch (Exception e) {
|
||||
logger.error(e);
|
||||
setSaveCashDailyCut(false);
|
||||
@ -413,6 +415,7 @@ public class AddClosingDayBean extends TaxiGenericBean implements Serializable {
|
||||
|
||||
private Double totalPagosPoliza;
|
||||
private Double totalDevolucionPagosPoliza;
|
||||
private Double totalRembolsosCancelacionPoliza;
|
||||
|
||||
private Double validateMutual;
|
||||
private Double validateSale;
|
||||
@ -656,6 +659,14 @@ public class AddClosingDayBean extends TaxiGenericBean implements Serializable {
|
||||
this.totalDevolucionPagosPoliza = totalDevolucionPagosPoliza;
|
||||
}
|
||||
|
||||
public Double getTotalRembolsosCancelacionPoliza() {
|
||||
return totalRembolsosCancelacionPoliza;
|
||||
}
|
||||
|
||||
public void setTotalRembolsosCancelacionPoliza(Double totalRembolsosCancelacionPoliza) {
|
||||
this.totalRembolsosCancelacionPoliza = totalRembolsosCancelacionPoliza;
|
||||
}
|
||||
|
||||
final Logger logger = LogManager.getLogger(AddClosingDayBean.class);
|
||||
private static final long serialVersionUID = -2421681541992908524L;
|
||||
|
||||
@ -682,4 +693,10 @@ public class AddClosingDayBean extends TaxiGenericBean implements Serializable {
|
||||
+ " AND tipo_pago = 'DEVOLUCION' "
|
||||
+ " AND estatus_activo = 'ENABLED' ";
|
||||
|
||||
private final String query_total_rembolso_cancelacion_poliza = "SELECT IFNULL(SUM(monto_devolucion), 0) AS total_pago "
|
||||
+ "FROM solicitud_cancelacion_poliza WHERE DATE(fecha_pago) > " + sub_query_to_find_previously_closing_day + " "
|
||||
+ " AND id_solicitante = :userID "
|
||||
+ " AND estatus_solicitud = 'APROBADO' "
|
||||
+ " AND estatus_activo = 'ENABLED' ";
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,157 @@
|
||||
/*
|
||||
* 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.arrebol.taxiservicios.model.enums.EstatusSolicitud;
|
||||
import com.crov.prase.controller.prase.PolizaController;
|
||||
import com.crov.prase.model.prase.SolicitudCancelacionPoliza;
|
||||
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("aprobarDevolucionPolizaBean")
|
||||
@ViewScoped
|
||||
public class AprobarDevolucionPolizaBean extends TaxiGenericBean implements Serializable, Datatable {
|
||||
|
||||
private static final long serialVersionUID = -136031528440947006L;
|
||||
final Logger logger = LogManager.getLogger(PolizaBean.class);
|
||||
|
||||
private PolizaController polizaController;
|
||||
private List<SolicitudCancelacionPoliza> listSolicitudes;
|
||||
private SolicitudCancelacionPoliza selectSolicitud;
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
logger.info("init");
|
||||
try {
|
||||
loadTaxiPropertyFile();
|
||||
loadBundlePropertyFile();
|
||||
|
||||
setPolizaController(new PolizaController());
|
||||
setSelectSolicitud(null);
|
||||
cargarSolicitudes();
|
||||
} catch (Exception e) {
|
||||
logger.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void cargarSolicitudes() {
|
||||
logger.info("cargarSolicitudes()");
|
||||
try {
|
||||
setListSolicitudes(getPolizaController().findSolicitudCancelacionPolizaByLocation(getLoggedUser().getLocation()));
|
||||
} 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 {
|
||||
getSelectSolicitud().setEstatusSolicitud(EstatusSolicitud.CANCELADO);
|
||||
if (getPolizaController().updateSolicitudCancelacionPoliza(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().getSolicitante())) {
|
||||
showMessage(FacesMessage.SEVERITY_WARN, "Error", "El usuario al que afectará la devolución ya realizó su corte del día ");
|
||||
return;
|
||||
}
|
||||
if (getPolizaController().aprovarCanselacion(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 List<SolicitudCancelacionPoliza> getListSolicitudes() {
|
||||
return listSolicitudes;
|
||||
}
|
||||
|
||||
public void setListSolicitudes(List<SolicitudCancelacionPoliza> listSolicitudes) {
|
||||
this.listSolicitudes = listSolicitudes;
|
||||
}
|
||||
|
||||
public SolicitudCancelacionPoliza getSelectSolicitud() {
|
||||
return selectSolicitud;
|
||||
}
|
||||
|
||||
public void setSelectSolicitud(SolicitudCancelacionPoliza selectSolicitud) {
|
||||
this.selectSolicitud = selectSolicitud;
|
||||
}
|
||||
|
||||
public PolizaController getPolizaController() {
|
||||
return polizaController;
|
||||
}
|
||||
|
||||
public void setPolizaController(PolizaController polizaController) {
|
||||
this.polizaController = polizaController;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
@ -263,7 +263,7 @@ public class PagosPolizasBean extends TaxiGenericBean implements Serializable {
|
||||
}
|
||||
|
||||
public void limpiarFormDevolusionDetallePago() {
|
||||
setComentarioDevolucionPago("");
|
||||
setComentario("");
|
||||
}
|
||||
|
||||
public void limpiarDetallePago() {
|
||||
|
@ -23,6 +23,7 @@ import com.arrebol.taxiservicios.model.core.ContactNumber;
|
||||
import com.arrebol.taxiservicios.model.core.Person;
|
||||
import com.arrebol.taxiservicios.model.enums.AddressType;
|
||||
import com.arrebol.taxiservicios.model.enums.BasicType;
|
||||
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.PersonType;
|
||||
@ -37,6 +38,7 @@ import com.crov.prase.model.catalog.TipoPoliza;
|
||||
import com.crov.prase.model.prase.DetellePagoPoliza;
|
||||
import com.crov.prase.model.prase.PagosPoliza;
|
||||
import com.crov.prase.model.prase.Poliza;
|
||||
import com.crov.prase.model.prase.SolicitudCancelacionPoliza;
|
||||
import java.io.Serializable;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
@ -252,6 +254,11 @@ public class PolizaBean extends TaxiGenericBean implements Serializable, Datatab
|
||||
}
|
||||
}
|
||||
|
||||
public void cargarDevolucion() {
|
||||
setComentario("");
|
||||
setMontoRenbolso(getSelectedPoliza().getCantidadPagada());
|
||||
}
|
||||
|
||||
public void editarPoliza() {
|
||||
logger.info("editarPoliza()");
|
||||
try {
|
||||
@ -363,6 +370,38 @@ public class PolizaBean extends TaxiGenericBean implements Serializable, Datatab
|
||||
}
|
||||
}
|
||||
|
||||
public void solicitarCacelacionPoliza() {
|
||||
logger.info("solicitarCacelacionPoliza()");
|
||||
if (getMontoRenbolso().isNaN() || getMontoRenbolso() < 0.0 || getMontoRenbolso() > getSelectedPoliza().getCantidadPagada()) {
|
||||
showMessage(FacesMessage.SEVERITY_WARN, "Error", "Debe de colocar un monto mayor a 0 y menor al monto abotonado hasta el momento: $" + getSelectedPoliza().getCantidadPagada());
|
||||
return;
|
||||
}
|
||||
List<SolicitudCancelacionPoliza> verificarPolizas = getController().findSolicitudCancelacionPolizaByPolizaAndEstatus(getSelectedPoliza(), EstatusSolicitud.PENDIENTE);
|
||||
if (!verificarPolizas.isEmpty()) {
|
||||
showMessage(FacesMessage.SEVERITY_WARN, "Error", "Ya hay una solicitud de cancelación de póliza en proceso");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
SolicitudCancelacionPoliza socitud = new SolicitudCancelacionPoliza();
|
||||
socitud.setEstatusActivo(GenericEnumType.ENABLED);
|
||||
socitud.setLocation(getLoggedUser().getLocation());
|
||||
socitud.setPoliza(getSelectedPoliza());
|
||||
socitud.setSolicitante(getLoggedUser());
|
||||
socitud.setFechaPago(null);
|
||||
socitud.setEstatusSolicitud(EstatusSolicitud.PENDIENTE);
|
||||
socitud.setMontoDevolucion(getMontoRenbolso());
|
||||
socitud.setComentario(getComentario());
|
||||
if (getController().saveSolicitudCancelacionPoliza(socitud, getLoggedUser())) {
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Solicitud realizada", "Solicitud de cancelación de poliza realizada correctamente");
|
||||
} else {
|
||||
showMessage(FacesMessage.SEVERITY_ERROR, "Error", "Error al generar la solicitud de cancelación de poliza");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("solicitarCacelacionPoliza(): " + e);
|
||||
showMessage(FacesMessage.SEVERITY_FATAL, "Error", "Error al generar la solicitud de cancelación de piliza");
|
||||
}
|
||||
}
|
||||
|
||||
private String obtenerFolio(String ab, Date fecha) {
|
||||
logger.info("Obteniendo último folio ");
|
||||
try {
|
||||
@ -785,6 +824,7 @@ public class PolizaBean extends TaxiGenericBean implements Serializable, Datatab
|
||||
private String idCustomer;
|
||||
|
||||
private String comentario;
|
||||
private Double montoRenbolso;
|
||||
|
||||
public int getContador() {
|
||||
return contador;
|
||||
@ -1194,6 +1234,14 @@ public class PolizaBean extends TaxiGenericBean implements Serializable, Datatab
|
||||
this.metodoPago = metodoPago;
|
||||
}
|
||||
|
||||
public Double getMontoRenbolso() {
|
||||
return montoRenbolso;
|
||||
}
|
||||
|
||||
public void setMontoRenbolso(Double montoRenbolso) {
|
||||
this.montoRenbolso = montoRenbolso;
|
||||
}
|
||||
|
||||
public void getPolizaList() {
|
||||
List<Poliza> PolizaActiva = getController().findActive(getLoggedUser().getLocation());
|
||||
List<Poliza> PolizaDeshabilitada = getController().findDisable(getLoggedUser().getLocation());
|
||||
|
@ -742,4 +742,5 @@ 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
|
||||
outcome.prase.polizas.aprobarDevolucionPoliza=/app/prase/poliza/aprobarDevolucionPoliza
|
||||
|
||||
|
@ -49,6 +49,7 @@
|
||||
<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:menuitem id="sub_admin_devolucion_poliza" value="Solicitudes de devoción poliza" icon="" outcome="#{i18n['outcome.prase.polizas.aprobarDevolucionPoliza']}" />
|
||||
</p:submenu>
|
||||
|
||||
<p:submenu id="menu_catalog" label="Catálogos" icon="">
|
||||
|
@ -0,0 +1,85 @@
|
||||
<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.aprobarDevolucionPoliza']}">Aprobar devolución de poliza</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 poliza</h1>
|
||||
<h:form id="form">
|
||||
<p:growl id="msgs" showDetail="true"/>
|
||||
|
||||
<p:dataTable widgetVar="dtTable" id="dtTable" var="data" draggableRows="true" draggableColumns="true" value="#{aprobarDevolucionPolizaBean.listSolicitudes}" style="margin-bottom:20px;text-align: center" reflow="true" rowsPerPageTemplate="5,10,25,50,100" emptyMessage="Sin registros"
|
||||
rowKey="#{data.id}" selection="#{aprobarDevolucionPolizaBean.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="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="#{aprobarDevolucionPolizaBean.aprobarSolcitud()}" update="form" >
|
||||
<f:setPropertyActionListener value="#{data}" target="#{aprobarDevolucionPolizaBean.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="#{aprobarDevolucionPolizaBean.rechazarSolicitud()}" update="form" >
|
||||
<f:setPropertyActionListener value="#{data}" target="#{aprobarDevolucionPolizaBean.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>
|
@ -129,7 +129,7 @@
|
||||
oncomplete="PF('dlg2').show()"
|
||||
update="carBrandForm:carBrandDialog"
|
||||
action="#{polizaBean.cargarPoliza()}"
|
||||
rendered="#{data.active}">
|
||||
rendered="#{data.active and (data.estatus eq 'COTIZACION' or data.estatus eq 'PENDIENTE')}">
|
||||
<f:setPropertyActionListener value="#{data}" target="#{polizaBean.selectedPoliza}"/>
|
||||
</p:commandButton>
|
||||
|
||||
@ -139,16 +139,12 @@
|
||||
class="red-btn rounded-button"
|
||||
oncomplete="PF('eliminarPoliza').show()"
|
||||
update="eliminarPolizaForm:eliminarPoliza"
|
||||
rendered="#{data.active}">
|
||||
action="#{polizaBean.cargarDevolucion()}"
|
||||
rendered="#{data.active and (data.estatus eq 'COTIZACION' or data.estatus eq 'PENDIENTE')}">
|
||||
<f:setPropertyActionListener value="#{data}" target="#{polizaBean.selectedPoliza}"/>
|
||||
|
||||
|
||||
</p:commandButton>
|
||||
</p:column>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</p:dataTable>
|
||||
|
||||
<p:contextMenu for="dtTable" rendered="#{loginBean.isUserInRole('catalog.brand.car.delete')}">
|
||||
@ -274,7 +270,7 @@
|
||||
<p:ajax update="periodoGracia, metodoPago" listener="#{polizaBean.liquidadoChange()}" />
|
||||
</p:selectBooleanCheckbox>
|
||||
</h:panelGrid>
|
||||
|
||||
|
||||
<h:panelGroup styleClass="md-inputfield" style="margin-top: 2em;" rendered="#{!polizaBean.editPoliza}" >
|
||||
<p:inputText id="cantidadPagada" value="#{polizaBean.primerPago}" required="true" requiredMessage="Escribir el monto de cantidad pagada es obligatorio" style="width: 100%;" />
|
||||
<label>Primer pago * </label>
|
||||
@ -617,19 +613,24 @@
|
||||
<p:dialog header="Motivo de la eliminacion" widgetVar="eliminarPoliza" modal="true" height="30%" width="30%" id="eliminarPoliza">
|
||||
<p:ajax event="close" update="eliminarPolizaForm" listener="#{polizaBean.resetSelectedComentario}" />
|
||||
<p:outputPanel>
|
||||
|
||||
<div class="taxy-padding" style="padding-top: 2em">
|
||||
<h:panelGroup id="caselarPnlGrp" styleClass="md-inputfield">
|
||||
<p:inputTextarea id="com" style="width: 100%" value="#{polizaBean.comentario}" required="true" requiredMessage="Debe definir el motivo por el cual se cancelara la compra el inmueble" />
|
||||
<label>Indique cuál fue le motivo por el que se canceló la poliza</label>
|
||||
<p:message for="com" display="text"/>
|
||||
</h:panelGroup>
|
||||
</div>
|
||||
<div class="taxy-padding" style="padding-top: 2em">
|
||||
<h:panelGroup id="montoRenbolsoPnlGrp" styleClass="md-inputfield">
|
||||
<p:inputNumber id="montoRenbolso" style="width: 100%" value="#{polizaBean.montoRenbolso}" required="true" requiredMessage="Debe definir el monto de la devolución" />
|
||||
<label>Indique el monto a devolver</label>
|
||||
<p:message for="montoRenbolso" display="text"/>
|
||||
</h:panelGroup>
|
||||
</div>
|
||||
|
||||
<p:commandButton id="addButtonC" value="Confirmar" actionListener="#{polizaBean.deleteRow()}" update="eliminarPolizaForm, form" />
|
||||
<p:commandButton id="addButtonC" value="Confirmar" actionListener="#{polizaBean.solicitarCacelacionPoliza()}" update="eliminarPolizaForm, form" />
|
||||
</p:outputPanel>
|
||||
</p:dialog>
|
||||
</h:form>
|
||||
</h:form>
|
||||
|
||||
</div>
|
||||
</ui:define>
|
||||
|
@ -125,7 +125,7 @@
|
||||
update="pagarMultipleForm"
|
||||
oncomplete="PF('pagarMultipleDialog').show()"
|
||||
action="#{pagosPolizasBean.limpiarDetallePago()}"
|
||||
rendered="#{data.estatus=='PENDIENTE'}">
|
||||
rendered="#{data.estatus=='PENDIENTE' and data.estatus ne 'CANCELADO'}">
|
||||
<f:setPropertyActionListener value="#{data}" target="#{pagosPolizasBean.selectedPoliza}"/>
|
||||
</p:commandButton>
|
||||
</p:column>
|
||||
@ -185,7 +185,9 @@
|
||||
|
||||
<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 and (pago.poliza.estatus ne 'CANCELADO')}" >
|
||||
<f:setPropertyActionListener value="#{pago}" target="#{pagosPolizasBean.selectedPago}" />
|
||||
</p:commandButton>
|
||||
|
||||
@ -224,11 +226,11 @@
|
||||
<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>
|
||||
@ -279,7 +281,7 @@
|
||||
update="devolverDetatallePagoForm"
|
||||
style="margin-top: 0.5em; background-color: #E6702E"
|
||||
action="#{pagosPolizasBean.limpiarFormDevolusionDetallePago()}"
|
||||
rendered="#{detallePago.id eq pagosPolizasBean.detallePagoDisponibleParaDevocion}">
|
||||
rendered="#{detallePago.id eq pagosPolizasBean.detallePagoDisponibleParaDevocion and detallePago.pagoPoliza.poliza.estatus ne 'CANCELADO'}">
|
||||
<f:setPropertyActionListener value="#{detallePago}" target="#{pagosPolizasBean.selectedDetellePago}"/>
|
||||
</p:commandButton>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user