SISVECOM - QUE PERMITA HACER EL CORTE DEL DIA, AL DIA SIGUIENTE.
SISVECOM - YA NO HABRÁ AUTORIZACIÓN SERA AUTORIZADO. (ENTREGA) -VENTAS – POR AUTORIZAR – AL APROBAR UN PRÉSTAMO PASARLO DIRECTO A APROBEt SISVECOM - HARÁ UN REPORTE DE CUANTAS TRAE CADA COBRADOR UNO GENERAL Y OTRO AL DIA QUE LO ASIGNARA EL ADMINISTRADOR - CHECAR EN APC – IMPORTAR TABLA “Avance del día” SISVECOM - PRÉSTAMO CAMBIARA A COMPRA DE PRODUCTO. - CORREGIR TEXTOS
This commit is contained in:
parent
63cf262e38
commit
c25d8fb371
@ -1,12 +1,13 @@
|
||||
/*
|
||||
* 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.apc.controller.system.employee;
|
||||
|
||||
import com.arrebol.apc.controller.util.HibernateUtil;
|
||||
import com.arrebol.apc.model.ModelParameter;
|
||||
import com.arrebol.apc.model.admin.Bonus;
|
||||
import com.arrebol.apc.model.admin.constance.BonusCfg;
|
||||
@ -26,6 +27,9 @@ import java.util.List;
|
||||
import javax.persistence.Tuple;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.hibernate.HibernateException;
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.Transaction;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -33,145 +37,169 @@ import org.apache.logging.log4j.Logger;
|
||||
*/
|
||||
public class EmployeeController implements Serializable {
|
||||
|
||||
/**
|
||||
* Find where status EQUALS TO status.
|
||||
*
|
||||
* @param office
|
||||
* @param status
|
||||
* @param hrOwnerId Human resource id from user logged.
|
||||
* @return
|
||||
*/
|
||||
public List<HumanResource> findEmployeesByType(Office office, HumanResourceStatus status, String hrOwnerId) {
|
||||
List<ModelParameter> parameters = new ArrayList<>();
|
||||
/**
|
||||
* Find where status EQUALS TO status.
|
||||
*
|
||||
* @param office
|
||||
* @param status
|
||||
* @param hrOwnerId Human resource id from user logged.
|
||||
* @return
|
||||
*/
|
||||
public List<HumanResource> findEmployeesByType(Office office, HumanResourceStatus status, String hrOwnerId) {
|
||||
List<ModelParameter> parameters = new ArrayList<>();
|
||||
|
||||
parameters.add(new ModelParameter(HumanResourceCfg.FIELD_OFFICE, office));
|
||||
parameters.add(new ModelParameter(HumanResourceCfg.FIELD_HR_STATUS, status));
|
||||
parameters.add(new ModelParameter(HumanResourceByOfficeCfg.HUMAN_RESOURCE, new HumanResource(hrOwnerId)));
|
||||
parameters.add(new ModelParameter(HumanResourceCfg.FIELD_OFFICE, office));
|
||||
parameters.add(new ModelParameter(HumanResourceCfg.FIELD_HR_STATUS, status));
|
||||
parameters.add(new ModelParameter(HumanResourceByOfficeCfg.HUMAN_RESOURCE, new HumanResource(hrOwnerId)));
|
||||
|
||||
return genericEntityRepository.xmlQueryAPCEntities(HumanResource.class, HumanResourceCfg.QUERY_FIND_ALL_BY_STATUS, parameters);
|
||||
}
|
||||
return genericEntityRepository.xmlQueryAPCEntities(HumanResource.class, HumanResourceCfg.QUERY_FIND_ALL_BY_STATUS, parameters);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find where status IN status.
|
||||
*
|
||||
* @param office
|
||||
* @param statusLst
|
||||
* @param hrOwnerId Human resource id from user logged.
|
||||
* @return
|
||||
*/
|
||||
public List<HumanResource> findEmployeesInType(Office office, List<HumanResourceStatus> statusLst, String hrOwnerId) {
|
||||
List<ModelParameter> parameters = new ArrayList<>();
|
||||
/**
|
||||
* Find where status IN status.
|
||||
*
|
||||
* @param office
|
||||
* @param statusLst
|
||||
* @param hrOwnerId Human resource id from user logged.
|
||||
* @return
|
||||
*/
|
||||
public List<HumanResource> findEmployeesInType(Office office, List<HumanResourceStatus> statusLst, String hrOwnerId) {
|
||||
List<ModelParameter> parameters = new ArrayList<>();
|
||||
|
||||
parameters.add(new ModelParameter(HumanResourceCfg.FIELD_OFFICE, office));
|
||||
parameters.add(new ModelParameter(HumanResourceCfg.FIELD_HR_STATUS, statusLst));
|
||||
parameters.add(new ModelParameter(HumanResourceByOfficeCfg.HUMAN_RESOURCE, new HumanResource(hrOwnerId)));
|
||||
parameters.add(new ModelParameter(HumanResourceCfg.FIELD_OFFICE, office));
|
||||
parameters.add(new ModelParameter(HumanResourceCfg.FIELD_HR_STATUS, statusLst));
|
||||
parameters.add(new ModelParameter(HumanResourceByOfficeCfg.HUMAN_RESOURCE, new HumanResource(hrOwnerId)));
|
||||
|
||||
return genericEntityRepository.xmlQueryAPCEntities(HumanResource.class, HumanResourceCfg.QUERY_FIND_ALL_IN_STATUS, parameters);
|
||||
}
|
||||
return genericEntityRepository.xmlQueryAPCEntities(HumanResource.class, HumanResourceCfg.QUERY_FIND_ALL_IN_STATUS, parameters);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save an entity.
|
||||
*
|
||||
* @param humanResourceByOffice
|
||||
* @param humanResource
|
||||
* @return
|
||||
*/
|
||||
public boolean saveHRController(HumanResourceByOffice humanResourceByOffice, HumanResource humanResource) {
|
||||
logger.debug("saveHRController");
|
||||
/**
|
||||
* Save an entity.
|
||||
*
|
||||
* @param humanResourceByOffice
|
||||
* @param humanResource
|
||||
* @return
|
||||
*/
|
||||
public boolean saveHRController(HumanResourceByOffice humanResourceByOffice, HumanResource humanResource) {
|
||||
logger.debug("saveHRController");
|
||||
|
||||
boolean success = genericEntityRepository.insertAPCEntity(humanResource);
|
||||
boolean success = genericEntityRepository.insertAPCEntity(humanResource);
|
||||
|
||||
if (success) {
|
||||
humanResourceByOffice.setHumanResource(new HumanResource(humanResource.getId()));
|
||||
success = genericEntityRepository.insertAPCEntity(humanResourceByOffice);
|
||||
}
|
||||
if (success) {
|
||||
humanResourceByOffice.setHumanResource(new HumanResource(humanResource.getId()));
|
||||
success = genericEntityRepository.insertAPCEntity(humanResourceByOffice);
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param hr
|
||||
* @param updateAvatar
|
||||
* @return
|
||||
*/
|
||||
public boolean updateByHumanResourceId(HumanResource hr, boolean updateAvatar) {
|
||||
logger.debug("updateByHumanResourceId");
|
||||
/**
|
||||
*
|
||||
* @param hr
|
||||
* @param updateAvatar
|
||||
* @return
|
||||
*/
|
||||
public boolean updateByHumanResourceId(HumanResource hr, boolean updateAvatar) {
|
||||
logger.debug("updateByHumanResourceId");
|
||||
|
||||
return humanResourceRepository.updateByHumanResourceId(hr, updateAvatar);
|
||||
}
|
||||
return humanResourceRepository.updateByHumanResourceId(hr, updateAvatar);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param status
|
||||
* @param userIdToUpdate
|
||||
* @param lastUpdatedBy
|
||||
* @return
|
||||
*/
|
||||
public boolean updateHRByStatus(HumanResourceStatus status, String userIdToUpdate, String lastUpdatedBy) {
|
||||
logger.debug("updateHRByStatus");
|
||||
/**
|
||||
*
|
||||
* @param status
|
||||
* @param userIdToUpdate
|
||||
* @param lastUpdatedBy
|
||||
* @return
|
||||
*/
|
||||
public boolean updateHRByStatus(HumanResourceStatus status, String userIdToUpdate, String lastUpdatedBy) {
|
||||
logger.debug("updateHRByStatus");
|
||||
|
||||
List<ModelParameter> parameters = new ArrayList<>();
|
||||
List<ModelParameter> parameters = new ArrayList<>();
|
||||
|
||||
parameters.add(new ModelParameter(HumanResourceCfg.FIELD_HR_STATUS, status));
|
||||
parameters.add(new ModelParameter(HumanResourceCfg.FIELD_LAST_UPDATED_BY, lastUpdatedBy));
|
||||
parameters.add(new ModelParameter(HumanResourceCfg.FIELD_LAST_UPDATED_ON, new Date()));
|
||||
parameters.add(new ModelParameter(HumanResourceCfg.FIELD_ID, userIdToUpdate));
|
||||
parameters.add(new ModelParameter(HumanResourceCfg.FIELD_HR_STATUS, status));
|
||||
parameters.add(new ModelParameter(HumanResourceCfg.FIELD_LAST_UPDATED_BY, lastUpdatedBy));
|
||||
parameters.add(new ModelParameter(HumanResourceCfg.FIELD_LAST_UPDATED_ON, new Date()));
|
||||
parameters.add(new ModelParameter(HumanResourceCfg.FIELD_ID, userIdToUpdate));
|
||||
|
||||
return genericEntityRepository.xmlUpdateOrDeleteAPCEntity(HumanResourceCfg.UPDATE_HR_BY_STATUS, parameters);
|
||||
}
|
||||
return genericEntityRepository.xmlUpdateOrDeleteAPCEntity(HumanResourceCfg.UPDATE_HR_BY_STATUS, parameters);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param officeId
|
||||
* @return
|
||||
*/
|
||||
public List<Bonus> findAllActiveBonus(String officeId) {
|
||||
logger.debug("findAllActiveBonus");
|
||||
/**
|
||||
*
|
||||
* @param officeId
|
||||
* @return
|
||||
*/
|
||||
public List<Bonus> findAllActiveBonus(String officeId) {
|
||||
logger.debug("findAllActiveBonus");
|
||||
|
||||
List<Bonus> results = new ArrayList<>();
|
||||
try {
|
||||
List<ModelParameter> parameters = new ArrayList<>();
|
||||
List<Bonus> results = new ArrayList<>();
|
||||
try {
|
||||
List<ModelParameter> parameters = new ArrayList<>();
|
||||
|
||||
parameters.add(new ModelParameter(BonusCfg.FIELD_ACTIVE_STATUS, ActiveStatus.ENEBLED));
|
||||
parameters.add(new ModelParameter(BonusCfg.FIELD_OFFICE, new Office(officeId)));
|
||||
parameters.add(new ModelParameter(BonusCfg.FIELD_ACTIVE_STATUS, ActiveStatus.ENEBLED));
|
||||
parameters.add(new ModelParameter(BonusCfg.FIELD_OFFICE, new Office(officeId)));
|
||||
|
||||
List<Tuple> tuples = genericEntityRepository.xmlQueryAPCEntities(
|
||||
Tuple.class,
|
||||
BonusCfg.QUERY_FIND_ALL_ACTIVE_BONUS,
|
||||
parameters);
|
||||
List<Tuple> tuples = genericEntityRepository.xmlQueryAPCEntities(
|
||||
Tuple.class,
|
||||
BonusCfg.QUERY_FIND_ALL_ACTIVE_BONUS,
|
||||
parameters);
|
||||
|
||||
tuples.forEach((tuple) -> {
|
||||
results.add(new Bonus(tuple.get("id").toString(), tuple.get("name").toString()));
|
||||
});
|
||||
tuples.forEach((tuple) -> {
|
||||
results.add(new Bonus(tuple.get("id").toString(), tuple.get("name").toString()));
|
||||
});
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("findAllActiveBonus", e);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("findAllActiveBonus", e);
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param hrId
|
||||
* @return
|
||||
*/
|
||||
public HumanResource findHumanResourceById(String hrId) {
|
||||
logger.debug("findHumanResourceById");
|
||||
public boolean verificarIdentificadorFolio(String identificadorFolio) {
|
||||
logger.info("verificarIdentificadorFolio");
|
||||
boolean success = true;
|
||||
Transaction transaction = null;
|
||||
try {
|
||||
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
|
||||
transaction = session.beginTransaction();
|
||||
String query = "SELECT COUNT(hr.id) "
|
||||
+ "FROM HumanResource hr "
|
||||
+ "WHERE hr.identificadorFolio=:identi ";
|
||||
Long count = (Long) session.createQuery(query).setParameter("identi", identificadorFolio).uniqueResult();
|
||||
if (null != count && count == 0) {
|
||||
success = false;
|
||||
}
|
||||
transaction.commit();
|
||||
logger.info("Total of human resource found: " + count);
|
||||
} catch (HibernateException e) {
|
||||
logger.error("Can not find human resource", e);
|
||||
} catch (Exception e) {
|
||||
logger.error("Method verificarIdentificadorFolio()", e);
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
return (HumanResource) genericEntityRepository.selectAPCEntityById(HumanResource.class, hrId);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param hrId
|
||||
* @return
|
||||
*/
|
||||
public HumanResource findHumanResourceById(String hrId) {
|
||||
logger.debug("findHumanResourceById");
|
||||
|
||||
private static final long serialVersionUID = 2527037592427439763L;
|
||||
final Logger logger = LogManager.getLogger(EmployeeController.class);
|
||||
return (HumanResource) genericEntityRepository.selectAPCEntityById(HumanResource.class, hrId);
|
||||
}
|
||||
|
||||
private final GenericEntityRepository genericEntityRepository;
|
||||
private final HumanResourceRepository humanResourceRepository;
|
||||
private static final long serialVersionUID = 2527037592427439763L;
|
||||
final Logger logger = LogManager.getLogger(EmployeeController.class);
|
||||
|
||||
public EmployeeController() {
|
||||
this.genericEntityRepository = new GenericEntityRepository();
|
||||
this.humanResourceRepository = new HumanResourceRepository();
|
||||
}
|
||||
private final GenericEntityRepository genericEntityRepository;
|
||||
private final HumanResourceRepository humanResourceRepository;
|
||||
|
||||
public EmployeeController() {
|
||||
this.genericEntityRepository = new GenericEntityRepository();
|
||||
this.humanResourceRepository = new HumanResourceRepository();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* 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.apc.model.core;
|
||||
@ -41,388 +41,388 @@ import org.hibernate.annotations.GenericGenerator;
|
||||
@Table(name = "APC_HUMAN_RESOURCE")
|
||||
public class HumanResource implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -7296859753095844932L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(generator = "uuid")
|
||||
@GenericGenerator(name = "uuid", strategy = "uuid2")
|
||||
@Column(name = "id", length = 36)
|
||||
private String id;
|
||||
|
||||
@Column(name = "first_name", length = 25, nullable = false)
|
||||
private String firstName;
|
||||
|
||||
@Column(name = "second_name", length = 25)
|
||||
private String secondName;
|
||||
|
||||
@Column(name = "last_name", length = 25, nullable = false)
|
||||
private String lastName;
|
||||
|
||||
@Column(name = "middle_name", length = 25, nullable = false)
|
||||
private String middleName;
|
||||
|
||||
@Temporal(TemporalType.DATE)
|
||||
@Column(name = "birthdate")
|
||||
private Date birthdate;
|
||||
|
||||
@Column(name = "avatar", length = 150, nullable = false)
|
||||
private String avatar;
|
||||
|
||||
@Column(name = "curp", length = 20)
|
||||
private String curp;
|
||||
|
||||
@Column(name = "rfc", length = 13)
|
||||
private String rfc;
|
||||
|
||||
@Column(name = "ife", length = 20)
|
||||
private String ife;
|
||||
|
||||
@Temporal(TemporalType.DATE)
|
||||
@Column(name = "admission_date")
|
||||
private Date admissionDate;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
@Column(name = "human_resource_status", nullable = false)
|
||||
private HumanResourceStatus humanResourceStatus;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY, optional = false)
|
||||
@JoinColumn(
|
||||
name = "id_role",
|
||||
referencedColumnName = "id",
|
||||
nullable = false
|
||||
)
|
||||
private RoleCtlg roleCtlg;
|
||||
|
||||
@OneToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(
|
||||
name = "id_bonus",
|
||||
referencedColumnName = "id"
|
||||
)
|
||||
private Bonus bonus;
|
||||
|
||||
@Column(name = "payment")
|
||||
private BigDecimal payment;
|
||||
|
||||
@Column(name = "balance", nullable = false)
|
||||
private BigDecimal balance;
|
||||
|
||||
@Column(name = "imss")
|
||||
private BigDecimal imss;
|
||||
|
||||
@Column(name = "employee_saving")
|
||||
private BigDecimal employeeSaving;
|
||||
|
||||
@Column(name = "created_by", nullable = false, length = 36)
|
||||
private String createdBy;
|
||||
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
@Column(name = "created_on", length = 19)
|
||||
private Date createdOn;
|
||||
|
||||
@Column(name = "last_updated_by", length = 36)
|
||||
private String lastUpdatedBy;
|
||||
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
@Column(name = "last_updated_on", length = 19)
|
||||
private Date lastUpdatedOn;
|
||||
|
||||
@OneToOne(
|
||||
mappedBy = "humanResource",
|
||||
cascade = CascadeType.ALL,
|
||||
orphanRemoval = true,
|
||||
fetch = FetchType.LAZY
|
||||
)
|
||||
private User user;
|
||||
|
||||
@OneToMany(
|
||||
mappedBy = "humanResource",
|
||||
cascade = CascadeType.ALL,
|
||||
fetch = FetchType.LAZY,
|
||||
orphanRemoval = true
|
||||
)
|
||||
private List<HumanResourceByOffice> humanResourceByOffices;
|
||||
|
||||
@OneToMany(
|
||||
fetch = FetchType.LAZY,
|
||||
mappedBy = "humanResource",
|
||||
orphanRemoval = true,
|
||||
cascade = CascadeType.ALL
|
||||
)
|
||||
private List<HumanResourceHasRoute> humanResourceHasRoutes;
|
||||
|
||||
@OneToMany(
|
||||
fetch = FetchType.LAZY,
|
||||
mappedBy = "humanResource",
|
||||
orphanRemoval = true,
|
||||
cascade = CascadeType.ALL
|
||||
)
|
||||
private List<Advance> advances;
|
||||
|
||||
@Transient
|
||||
private String fullName;
|
||||
|
||||
public HumanResource() {
|
||||
}
|
||||
|
||||
public HumanResource(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param id
|
||||
* @param fullName
|
||||
*/
|
||||
public HumanResource(String id, String fullName) {
|
||||
this.id = id;
|
||||
this.fullName = fullName;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param id
|
||||
* @param firstName
|
||||
* @param lastName
|
||||
* @param avatar
|
||||
*/
|
||||
public HumanResource(String id, String firstName, String lastName, String avatar) {
|
||||
this.id = id;
|
||||
this.firstName = firstName;
|
||||
this.lastName = lastName;
|
||||
this.avatar = avatar;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param firstName
|
||||
* @param lastName
|
||||
* @param avatar
|
||||
*/
|
||||
public HumanResource(String firstName, String lastName, String avatar) {
|
||||
this.firstName = firstName;
|
||||
this.lastName = lastName;
|
||||
this.avatar = avatar;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getFirstName() {
|
||||
return firstName;
|
||||
}
|
||||
|
||||
public void setFirstName(String firstName) {
|
||||
this.firstName = firstName;
|
||||
}
|
||||
|
||||
public String getSecondName() {
|
||||
return secondName;
|
||||
}
|
||||
|
||||
public void setSecondName(String secondName) {
|
||||
this.secondName = secondName;
|
||||
}
|
||||
|
||||
public String getLastName() {
|
||||
return lastName;
|
||||
}
|
||||
|
||||
public void setLastName(String lastName) {
|
||||
this.lastName = lastName;
|
||||
}
|
||||
|
||||
public String getMiddleName() {
|
||||
return middleName;
|
||||
}
|
||||
|
||||
public void setMiddleName(String middleName) {
|
||||
this.middleName = middleName;
|
||||
}
|
||||
|
||||
public Date getBirthdate() {
|
||||
return birthdate;
|
||||
}
|
||||
|
||||
public void setBirthdate(Date birthdate) {
|
||||
this.birthdate = birthdate;
|
||||
}
|
||||
|
||||
public String getAvatar() {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
public void setAvatar(String avatar) {
|
||||
this.avatar = avatar;
|
||||
}
|
||||
|
||||
public String getCurp() {
|
||||
return curp;
|
||||
}
|
||||
|
||||
public void setCurp(String curp) {
|
||||
this.curp = curp;
|
||||
}
|
||||
|
||||
public String getRfc() {
|
||||
return rfc;
|
||||
}
|
||||
|
||||
public void setRfc(String rfc) {
|
||||
this.rfc = rfc;
|
||||
}
|
||||
|
||||
public String getIfe() {
|
||||
return ife;
|
||||
}
|
||||
|
||||
public void setIfe(String ife) {
|
||||
this.ife = ife;
|
||||
}
|
||||
|
||||
public Date getAdmissionDate() {
|
||||
return admissionDate;
|
||||
}
|
||||
|
||||
public void setAdmissionDate(Date admissionDate) {
|
||||
this.admissionDate = admissionDate;
|
||||
}
|
||||
|
||||
public HumanResourceStatus getHumanResourceStatus() {
|
||||
return humanResourceStatus;
|
||||
}
|
||||
|
||||
public void setHumanResourceStatus(HumanResourceStatus humanResourceStatus) {
|
||||
this.humanResourceStatus = humanResourceStatus;
|
||||
}
|
||||
|
||||
public RoleCtlg getRoleCtlg() {
|
||||
return roleCtlg;
|
||||
}
|
||||
|
||||
public void setRoleCtlg(RoleCtlg roleCtlg) {
|
||||
this.roleCtlg = roleCtlg;
|
||||
}
|
||||
|
||||
public Bonus getBonus() {
|
||||
return bonus;
|
||||
}
|
||||
|
||||
public void setBonus(Bonus bonus) {
|
||||
this.bonus = bonus;
|
||||
}
|
||||
|
||||
public BigDecimal getBalance() {
|
||||
return balance;
|
||||
}
|
||||
|
||||
public void setBalance(BigDecimal balance) {
|
||||
this.balance = balance;
|
||||
}
|
||||
|
||||
public BigDecimal getEmployeeSaving() {
|
||||
return employeeSaving;
|
||||
}
|
||||
|
||||
public void setEmployeeSaving(BigDecimal employeeSaving) {
|
||||
this.employeeSaving = employeeSaving;
|
||||
}
|
||||
|
||||
public BigDecimal getPayment() {
|
||||
return payment;
|
||||
}
|
||||
|
||||
public void setPayment(BigDecimal payment) {
|
||||
this.payment = payment;
|
||||
}
|
||||
|
||||
public BigDecimal getImss() {
|
||||
return imss;
|
||||
}
|
||||
|
||||
public void setImss(BigDecimal imss) {
|
||||
this.imss = imss;
|
||||
}
|
||||
|
||||
public String getCreatedBy() {
|
||||
return createdBy;
|
||||
}
|
||||
|
||||
public void setCreatedBy(String createdBy) {
|
||||
this.createdBy = createdBy;
|
||||
}
|
||||
|
||||
public Date getCreatedOn() {
|
||||
return createdOn;
|
||||
}
|
||||
|
||||
public void setCreatedOn(Date createdOn) {
|
||||
this.createdOn = createdOn;
|
||||
}
|
||||
|
||||
public String getLastUpdatedBy() {
|
||||
return lastUpdatedBy;
|
||||
}
|
||||
|
||||
public void setLastUpdatedBy(String lastUpdatedBy) {
|
||||
this.lastUpdatedBy = lastUpdatedBy;
|
||||
}
|
||||
|
||||
public Date getLastUpdatedOn() {
|
||||
return lastUpdatedOn;
|
||||
}
|
||||
|
||||
public void setLastUpdatedOn(Date lastUpdatedOn) {
|
||||
this.lastUpdatedOn = lastUpdatedOn;
|
||||
}
|
||||
|
||||
public User getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public void setUser(User user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
public List<HumanResourceByOffice> getHumanResourceByOffices() {
|
||||
return humanResourceByOffices;
|
||||
}
|
||||
|
||||
public void setHumanResourceByOffices(List<HumanResourceByOffice> humanResourceByOffices) {
|
||||
this.humanResourceByOffices = humanResourceByOffices;
|
||||
}
|
||||
|
||||
public List<HumanResourceHasRoute> getHumanResourceHasRoutes() {
|
||||
return humanResourceHasRoutes;
|
||||
}
|
||||
|
||||
public void setHumanResourceHasRoutes(List<HumanResourceHasRoute> humanResourceHasRoutes) {
|
||||
this.humanResourceHasRoutes = humanResourceHasRoutes;
|
||||
}
|
||||
|
||||
public List<Advance> getAdvances() {
|
||||
return advances;
|
||||
}
|
||||
|
||||
public void setAdvances(List<Advance> advances) {
|
||||
this.advances = advances;
|
||||
}
|
||||
|
||||
public String getFullName() {
|
||||
return fullName;
|
||||
}
|
||||
|
||||
public void setFullName(String fullName) {
|
||||
this.fullName = fullName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "HumanResource{" + "firstName=" + firstName + ", secondName=" + secondName + ", lastName=" + lastName + ", middleName=" + middleName + '}';
|
||||
}
|
||||
private static final long serialVersionUID = -7296859753095844932L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(generator = "uuid")
|
||||
@GenericGenerator(name = "uuid", strategy = "uuid2")
|
||||
@Column(name = "id", length = 36)
|
||||
private String id;
|
||||
|
||||
@Column(name = "first_name", length = 25, nullable = false)
|
||||
private String firstName;
|
||||
|
||||
@Column(name = "second_name", length = 25)
|
||||
private String secondName;
|
||||
|
||||
@Column(name = "last_name", length = 25, nullable = false)
|
||||
private String lastName;
|
||||
|
||||
@Column(name = "middle_name", length = 25, nullable = false)
|
||||
private String middleName;
|
||||
|
||||
@Temporal(TemporalType.DATE)
|
||||
@Column(name = "birthdate")
|
||||
private Date birthdate;
|
||||
|
||||
@Column(name = "avatar", length = 150, nullable = false)
|
||||
private String avatar;
|
||||
|
||||
@Column(name = "curp", length = 20)
|
||||
private String curp;
|
||||
|
||||
@Column(name = "rfc", length = 13)
|
||||
private String rfc;
|
||||
|
||||
@Column(name = "ife", length = 20)
|
||||
private String ife;
|
||||
|
||||
@Temporal(TemporalType.DATE)
|
||||
@Column(name = "admission_date")
|
||||
private Date admissionDate;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
@Column(name = "human_resource_status", nullable = false)
|
||||
private HumanResourceStatus humanResourceStatus;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY, optional = false)
|
||||
@JoinColumn(
|
||||
name = "id_role",
|
||||
referencedColumnName = "id",
|
||||
nullable = false
|
||||
)
|
||||
private RoleCtlg roleCtlg;
|
||||
|
||||
@OneToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(
|
||||
name = "id_bonus",
|
||||
referencedColumnName = "id"
|
||||
)
|
||||
private Bonus bonus;
|
||||
|
||||
@Column(name = "payment")
|
||||
private BigDecimal payment;
|
||||
|
||||
@Column(name = "balance", nullable = false)
|
||||
private BigDecimal balance;
|
||||
|
||||
@Column(name = "imss")
|
||||
private BigDecimal imss;
|
||||
|
||||
@Column(name = "employee_saving")
|
||||
private BigDecimal employeeSaving;
|
||||
|
||||
@Column(name = "created_by", nullable = false, length = 36)
|
||||
private String createdBy;
|
||||
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
@Column(name = "created_on", length = 19)
|
||||
private Date createdOn;
|
||||
|
||||
@Column(name = "last_updated_by", length = 36)
|
||||
private String lastUpdatedBy;
|
||||
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
@Column(name = "last_updated_on", length = 19)
|
||||
private Date lastUpdatedOn;
|
||||
|
||||
@OneToOne(
|
||||
mappedBy = "humanResource",
|
||||
cascade = CascadeType.ALL,
|
||||
orphanRemoval = true,
|
||||
fetch = FetchType.LAZY
|
||||
)
|
||||
private User user;
|
||||
|
||||
@OneToMany(
|
||||
mappedBy = "humanResource",
|
||||
cascade = CascadeType.ALL,
|
||||
fetch = FetchType.LAZY,
|
||||
orphanRemoval = true
|
||||
)
|
||||
private List<HumanResourceByOffice> humanResourceByOffices;
|
||||
|
||||
@OneToMany(
|
||||
fetch = FetchType.LAZY,
|
||||
mappedBy = "humanResource",
|
||||
orphanRemoval = true,
|
||||
cascade = CascadeType.ALL
|
||||
)
|
||||
private List<HumanResourceHasRoute> humanResourceHasRoutes;
|
||||
|
||||
@OneToMany(
|
||||
fetch = FetchType.LAZY,
|
||||
mappedBy = "humanResource",
|
||||
orphanRemoval = true,
|
||||
cascade = CascadeType.ALL
|
||||
)
|
||||
private List<Advance> advances;
|
||||
|
||||
@Transient
|
||||
private String fullName;
|
||||
|
||||
public HumanResource() {
|
||||
}
|
||||
|
||||
public HumanResource(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param id
|
||||
* @param fullName
|
||||
*/
|
||||
public HumanResource(String id, String fullName) {
|
||||
this.id = id;
|
||||
this.fullName = fullName;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param id
|
||||
* @param firstName
|
||||
* @param lastName
|
||||
* @param avatar
|
||||
*/
|
||||
public HumanResource(String id, String firstName, String lastName, String avatar) {
|
||||
this.id = id;
|
||||
this.firstName = firstName;
|
||||
this.lastName = lastName;
|
||||
this.avatar = avatar;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param firstName
|
||||
* @param lastName
|
||||
* @param avatar
|
||||
*/
|
||||
public HumanResource(String firstName, String lastName, String avatar) {
|
||||
this.firstName = firstName;
|
||||
this.lastName = lastName;
|
||||
this.avatar = avatar;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getFirstName() {
|
||||
return firstName;
|
||||
}
|
||||
|
||||
public void setFirstName(String firstName) {
|
||||
this.firstName = firstName;
|
||||
}
|
||||
|
||||
public String getSecondName() {
|
||||
return secondName;
|
||||
}
|
||||
|
||||
public void setSecondName(String secondName) {
|
||||
this.secondName = secondName;
|
||||
}
|
||||
|
||||
public String getLastName() {
|
||||
return lastName;
|
||||
}
|
||||
|
||||
public void setLastName(String lastName) {
|
||||
this.lastName = lastName;
|
||||
}
|
||||
|
||||
public String getMiddleName() {
|
||||
return middleName;
|
||||
}
|
||||
|
||||
public void setMiddleName(String middleName) {
|
||||
this.middleName = middleName;
|
||||
}
|
||||
|
||||
public Date getBirthdate() {
|
||||
return birthdate;
|
||||
}
|
||||
|
||||
public void setBirthdate(Date birthdate) {
|
||||
this.birthdate = birthdate;
|
||||
}
|
||||
|
||||
public String getAvatar() {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
public void setAvatar(String avatar) {
|
||||
this.avatar = avatar;
|
||||
}
|
||||
|
||||
public String getCurp() {
|
||||
return curp;
|
||||
}
|
||||
|
||||
public void setCurp(String curp) {
|
||||
this.curp = curp;
|
||||
}
|
||||
|
||||
public String getRfc() {
|
||||
return rfc;
|
||||
}
|
||||
|
||||
public void setRfc(String rfc) {
|
||||
this.rfc = rfc;
|
||||
}
|
||||
|
||||
public String getIfe() {
|
||||
return ife;
|
||||
}
|
||||
|
||||
public void setIfe(String ife) {
|
||||
this.ife = ife;
|
||||
}
|
||||
|
||||
public Date getAdmissionDate() {
|
||||
return admissionDate;
|
||||
}
|
||||
|
||||
public void setAdmissionDate(Date admissionDate) {
|
||||
this.admissionDate = admissionDate;
|
||||
}
|
||||
|
||||
public HumanResourceStatus getHumanResourceStatus() {
|
||||
return humanResourceStatus;
|
||||
}
|
||||
|
||||
public void setHumanResourceStatus(HumanResourceStatus humanResourceStatus) {
|
||||
this.humanResourceStatus = humanResourceStatus;
|
||||
}
|
||||
|
||||
public RoleCtlg getRoleCtlg() {
|
||||
return roleCtlg;
|
||||
}
|
||||
|
||||
public void setRoleCtlg(RoleCtlg roleCtlg) {
|
||||
this.roleCtlg = roleCtlg;
|
||||
}
|
||||
|
||||
public Bonus getBonus() {
|
||||
return bonus;
|
||||
}
|
||||
|
||||
public void setBonus(Bonus bonus) {
|
||||
this.bonus = bonus;
|
||||
}
|
||||
|
||||
public BigDecimal getBalance() {
|
||||
return balance;
|
||||
}
|
||||
|
||||
public void setBalance(BigDecimal balance) {
|
||||
this.balance = balance;
|
||||
}
|
||||
|
||||
public BigDecimal getEmployeeSaving() {
|
||||
return employeeSaving;
|
||||
}
|
||||
|
||||
public void setEmployeeSaving(BigDecimal employeeSaving) {
|
||||
this.employeeSaving = employeeSaving;
|
||||
}
|
||||
|
||||
public BigDecimal getPayment() {
|
||||
return payment;
|
||||
}
|
||||
|
||||
public void setPayment(BigDecimal payment) {
|
||||
this.payment = payment;
|
||||
}
|
||||
|
||||
public BigDecimal getImss() {
|
||||
return imss;
|
||||
}
|
||||
|
||||
public void setImss(BigDecimal imss) {
|
||||
this.imss = imss;
|
||||
}
|
||||
|
||||
public String getCreatedBy() {
|
||||
return createdBy;
|
||||
}
|
||||
|
||||
public void setCreatedBy(String createdBy) {
|
||||
this.createdBy = createdBy;
|
||||
}
|
||||
|
||||
public Date getCreatedOn() {
|
||||
return createdOn;
|
||||
}
|
||||
|
||||
public void setCreatedOn(Date createdOn) {
|
||||
this.createdOn = createdOn;
|
||||
}
|
||||
|
||||
public String getLastUpdatedBy() {
|
||||
return lastUpdatedBy;
|
||||
}
|
||||
|
||||
public void setLastUpdatedBy(String lastUpdatedBy) {
|
||||
this.lastUpdatedBy = lastUpdatedBy;
|
||||
}
|
||||
|
||||
public Date getLastUpdatedOn() {
|
||||
return lastUpdatedOn;
|
||||
}
|
||||
|
||||
public void setLastUpdatedOn(Date lastUpdatedOn) {
|
||||
this.lastUpdatedOn = lastUpdatedOn;
|
||||
}
|
||||
|
||||
public User getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public void setUser(User user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
public List<HumanResourceByOffice> getHumanResourceByOffices() {
|
||||
return humanResourceByOffices;
|
||||
}
|
||||
|
||||
public void setHumanResourceByOffices(List<HumanResourceByOffice> humanResourceByOffices) {
|
||||
this.humanResourceByOffices = humanResourceByOffices;
|
||||
}
|
||||
|
||||
public List<HumanResourceHasRoute> getHumanResourceHasRoutes() {
|
||||
return humanResourceHasRoutes;
|
||||
}
|
||||
|
||||
public void setHumanResourceHasRoutes(List<HumanResourceHasRoute> humanResourceHasRoutes) {
|
||||
this.humanResourceHasRoutes = humanResourceHasRoutes;
|
||||
}
|
||||
|
||||
public List<Advance> getAdvances() {
|
||||
return advances;
|
||||
}
|
||||
|
||||
public void setAdvances(List<Advance> advances) {
|
||||
this.advances = advances;
|
||||
}
|
||||
|
||||
public String getFullName() {
|
||||
return fullName;
|
||||
}
|
||||
|
||||
public void setFullName(String fullName) {
|
||||
this.fullName = fullName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "HumanResource{" + "firstName=" + firstName + ", secondName=" + secondName + ", lastName=" + lastName + ", middleName=" + middleName + '}';
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -305,7 +305,7 @@ public class ClosingDayBean extends GenericBean implements Serializable, Datatab
|
||||
cellGen.setColspan(1);
|
||||
tableGen.addCell(cellGen);
|
||||
|
||||
cellGen = new PdfPCell(new Paragraph("Entrega de préstamos: ",
|
||||
cellGen = new PdfPCell(new Paragraph("Entrega de compras de producto: ",
|
||||
FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK)));
|
||||
cellGen.setHorizontalAlignment(Element.ALIGN_LEFT);
|
||||
cellGen.setBorder(0);
|
||||
@ -630,7 +630,7 @@ public class ClosingDayBean extends GenericBean implements Serializable, Datatab
|
||||
cellGen.setColspan(1);
|
||||
tableGen.addCell(cellGen);
|
||||
|
||||
cellGen = new PdfPCell(new Paragraph("Entrega de préstamos: ",
|
||||
cellGen = new PdfPCell(new Paragraph("Entrega de compras de producto: ",
|
||||
FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK)));
|
||||
cellGen.setHorizontalAlignment(Element.ALIGN_LEFT);
|
||||
cellGen.setBorder(0);
|
||||
@ -882,7 +882,7 @@ public class ClosingDayBean extends GenericBean implements Serializable, Datatab
|
||||
|
||||
if (!(dayOfWeek == Calendar.SUNDAY) && !(userId.equalsIgnoreCase("aad0c673-eb93-11ea-b7e1-02907d0fb4e6"))) {
|
||||
if (totalCustomerWithOutAction.compareTo(new Long(0)) == 1) {
|
||||
FacesMessage msg = new FacesMessage("ERROR", "El asesor debe de realizar una acción en todos sus préstamos.");
|
||||
FacesMessage msg = new FacesMessage("ERROR", "El asesor debe de realizar una acción en todas sus compras de producto.");
|
||||
FacesContext.getCurrentInstance().addMessage(null, msg);
|
||||
return;
|
||||
}
|
||||
|
@ -9,15 +9,14 @@ import com.arrebol.apc.controller.BitacoraController;
|
||||
import com.arrebol.apc.controller.GenericController;
|
||||
import com.arrebol.apc.controller.GenericValidationController;
|
||||
import com.arrebol.apc.controller.admin.LoanEmployeeController;
|
||||
import com.arrebol.apc.model.admin.ExpenseCompany;
|
||||
import com.arrebol.apc.model.admin.LoanEmployee;
|
||||
import com.arrebol.apc.model.admin.LoanEmployeeDetails;
|
||||
import com.arrebol.apc.model.core.HumanResource;
|
||||
import com.arrebol.apc.model.core.Office;
|
||||
import com.arrebol.apc.model.views.LoanEmployeeView;
|
||||
import com.arrebol.apc.model.enums.ActiveStatus;
|
||||
import com.arrebol.apc.model.system.logs.Bitacora;
|
||||
import com.arrebol.apc.model.views.LoanEmployeeDetailAllDataView;
|
||||
import com.arrebol.apc.model.views.LoanEmployeeView;
|
||||
import com.arrebol.apc.web.beans.Datatable;
|
||||
import com.arrebol.apc.web.beans.GenericBean;
|
||||
import java.io.Serializable;
|
||||
@ -40,372 +39,369 @@ import org.primefaces.event.RowEditEvent;
|
||||
@ViewScoped
|
||||
public class LoanEmployeeListBean extends GenericBean implements Serializable, Datatable {
|
||||
|
||||
public List<LoanEmployeeDetailAllDataView> getDetails(String idLoan) {
|
||||
try {
|
||||
setLoanEmployeeDetails(getController().getLoanEmployeeDetailByIdLoan(idLoan));
|
||||
public List<LoanEmployeeDetailAllDataView> getDetails(String idLoan) {
|
||||
try {
|
||||
setLoanEmployeeDetails(getController().getLoanEmployeeDetailByIdLoan(idLoan));
|
||||
setTotalAmountLoan(fillTotalAmountLoan());
|
||||
} catch (Exception e) {
|
||||
}
|
||||
return null == loanEmployeeDetails ? new ArrayList<>() : loanEmployeeDetails;
|
||||
}
|
||||
|
||||
public void searchHistoricalAction() {
|
||||
try {
|
||||
if (getStarDate().after(getEndDate())) {
|
||||
showMessage(FacesMessage.SEVERITY_ERROR, getBundlePropertyFile().getString("generic.start.date"), getBundlePropertyFile().getString("generic.end.date.error"));
|
||||
} else {
|
||||
setLoanEmployee(getController().fillLoanEmployeeDataTable(getStarDate(), getEndDate()));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
|
||||
public BigDecimal searchTotalAmountLoan() {
|
||||
try {
|
||||
if (getStarDate().after(getEndDate())) {
|
||||
showMessage(FacesMessage.SEVERITY_ERROR, getBundlePropertyFile().getString("generic.start.date"), getBundlePropertyFile().getString("generic.end.date.error"));
|
||||
} else {
|
||||
setTotalAmountLoan(fillTotalAmountLoan());
|
||||
} catch (Exception e) {
|
||||
}
|
||||
return null == loanEmployeeDetails ? new ArrayList<>() : loanEmployeeDetails;
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
return getTotalAmountLoan();
|
||||
}
|
||||
|
||||
public void searchHistoricalAction() {
|
||||
try {
|
||||
if (getStarDate().after(getEndDate())) {
|
||||
showMessage(FacesMessage.SEVERITY_ERROR, getBundlePropertyFile().getString("generic.start.date"), getBundlePropertyFile().getString("generic.end.date.error"));
|
||||
} else {
|
||||
setLoanEmployee(getController().fillLoanEmployeeDataTable(getStarDate(), getEndDate()));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
|
||||
public BigDecimal searchTotalAmountLoan() {
|
||||
try {
|
||||
if (getStarDate().after(getEndDate())) {
|
||||
showMessage(FacesMessage.SEVERITY_ERROR, getBundlePropertyFile().getString("generic.start.date"), getBundlePropertyFile().getString("generic.end.date.error"));
|
||||
} else {
|
||||
setTotalAmountLoan(fillTotalAmountLoan());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
return getTotalAmountLoan();
|
||||
}
|
||||
public BigDecimal fillTotalAmountLoan() {
|
||||
return getController().fillTotalAmountLoan(getStarDate(), getEndDate());
|
||||
}
|
||||
|
||||
public BigDecimal fillTotalAmountLoan() {
|
||||
return getController().fillTotalAmountLoan(getStarDate(), getEndDate());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void editRow(RowEditEvent event) {
|
||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
@Override
|
||||
public void editRow(RowEditEvent event) {
|
||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRowCancel(RowEditEvent event) {
|
||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
@Override
|
||||
public void onRowCancel(RowEditEvent event) {
|
||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRowReorder(ReorderEvent event) {
|
||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
@Override
|
||||
public void onRowReorder(ReorderEvent event) {
|
||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addRow() {
|
||||
Date date = new Date();
|
||||
if (genericCtrl.existStableGeneralBoxByCreatedOn(date)) {
|
||||
showMessage(FacesMessage.SEVERITY_WARN, "Día cerrado", "No se pueden agregar más préstamos a empleados porque ya se existe un cuadre de caja general de hoy.");
|
||||
return;
|
||||
}
|
||||
|
||||
if(amountLoan.compareTo(BigDecimal.ZERO)==0 || amountToPay.compareTo(BigDecimal.ZERO)==0 ){
|
||||
|
||||
showMessage(FacesMessage.SEVERITY_WARN, "Prestamo Incorrecto", "No se pueden agregar préstamos a empleados con monto o monto de abonos de 0");
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
if(amountLoan.compareTo(amountToPay)<=0){
|
||||
|
||||
showMessage(FacesMessage.SEVERITY_WARN, "Prestamo Incorrecto", "No se pueden agregar préstamos a empleados con valor a pagar menor a sus abonos");
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
LoanEmployee loan = new LoanEmployee();
|
||||
loan.setIdEmployee(userId);
|
||||
loan.setCreatedOn(new Date());
|
||||
loan.setCreatedBy(getLoggedUser().getUser().getId());
|
||||
loan.setAmountLoan(amountLoan);
|
||||
loan.setAmountToPay(amountToPay);
|
||||
loan.setLoanEmployeeStatus(ActiveStatus.ENEBLED);
|
||||
|
||||
// Calcula numero de semanas
|
||||
Double interes = 0.05;
|
||||
Double interesReal = 0.0;
|
||||
Double semanasD = amountLoan.doubleValue()/amountToPay.doubleValue();
|
||||
int numSemanas = semanasD.intValue();
|
||||
double residuo = semanasD - numSemanas;
|
||||
if(residuo != 0.0){
|
||||
numSemanas += 1;
|
||||
}
|
||||
|
||||
// Calcula número de meses
|
||||
int numMeses = numSemanas/4;
|
||||
if(numSemanas % 4 > 0){
|
||||
numMeses += 1;
|
||||
}
|
||||
|
||||
// Calcula el interes real 0.05 por el número de meses
|
||||
interesReal = interes * numMeses;
|
||||
Double saldoTotal = (amountLoan.doubleValue() * interesReal) + amountLoan.doubleValue();
|
||||
loan.setTotalAmountToPay(new BigDecimal(saldoTotal));
|
||||
loan.setBalance(new BigDecimal(saldoTotal));
|
||||
|
||||
HumanResource hr = users.stream().filter(p -> p.getId().equals(userId)).findFirst().get();
|
||||
hr.setBalance(hr.getBalance().add(new BigDecimal(saldoTotal)));
|
||||
|
||||
getController().saveLoanEmployee(loan, hr);
|
||||
|
||||
userId = "";
|
||||
amountLoan = BigDecimal.ZERO;
|
||||
amountToPay = BigDecimal.ZERO;
|
||||
|
||||
setLoanEmployee(getController().fillLoanEmployeeDataTable(getStarDate(), getEndDate()));
|
||||
}
|
||||
@Override
|
||||
public void addRow() {
|
||||
Date date = new Date();
|
||||
if (genericCtrl.existStableGeneralBoxByCreatedOn(date)) {
|
||||
showMessage(FacesMessage.SEVERITY_WARN, "Día cerrado", "No se pueden agregar más compras de producto a empleados porque ya se existe un cuadre de caja general de hoy.");
|
||||
return;
|
||||
}
|
||||
|
||||
public void addRowLoanDetail() {
|
||||
|
||||
if(loanDetailAmount.compareTo(BigDecimal.ZERO)==0){
|
||||
|
||||
showMessage(FacesMessage.SEVERITY_WARN, "Abono Incorrecto", "No se pueden agregar un abono de 0");
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
if(loanDetailAmount.compareTo(BigDecimal.ZERO)<0){
|
||||
|
||||
showMessage(FacesMessage.SEVERITY_WARN, "Abono Incorrecto", "No se pueden agregar un abono negativo");
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
if (genericCtrl.existStableGeneralBoxByCreatedOn(new Date())) {
|
||||
showMessage(FacesMessage.SEVERITY_WARN, "Día cerrado", "No se pueden hacer mas abonos a prestamos porque ya se existe un cuadre de caja general de hoy.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(loanDetailAmount.compareTo(selectedLoan.getBalance())<=0){
|
||||
if(selectedLoan.getLoanEmployeeStatus()== ActiveStatus.ENEBLED){
|
||||
LoanEmployeeDetails loanDetail = new LoanEmployeeDetails();
|
||||
loanDetail.setIdLoan(selectedLoan.getId());
|
||||
loanDetail.setIdUser(selectedLoan.getIdUser());
|
||||
loanDetail.setPaymentAmount(loanDetailAmount);
|
||||
loanDetail.setReferenceNumber(selectedLoan.getReferenceNumber() + 1);
|
||||
loanDetail.setCreatedOn(new Date());
|
||||
loanDetail.setCreatedBy(getLoggedUser().getUser().getId());
|
||||
loanDetail.setLoanEmployeeDetailStatus(ActiveStatus.ENEBLED);
|
||||
loanDetail.setPayroll(ActiveStatus.DISABLED);
|
||||
|
||||
HumanResource hr = users.stream().filter(p -> p.getId().equals(selectedLoan.getIdUser())).findFirst().get();
|
||||
hr.setBalance(hr.getBalance().subtract(loanDetailAmount));
|
||||
if (amountLoan.compareTo(BigDecimal.ZERO) == 0 || amountToPay.compareTo(BigDecimal.ZERO) == 0) {
|
||||
|
||||
LoanEmployee loan = getController().getLoanEmployeeById(selectedLoan.getId());
|
||||
loan.setBalance(loan.getBalance().subtract(loanDetailAmount));
|
||||
|
||||
getController().saveLoanEmployeeDetail(loanDetail, hr, loan);
|
||||
loanDetailAmount = BigDecimal.ZERO;
|
||||
|
||||
setLoanEmployee(getController().fillLoanEmployeeDataTable(getStarDate(), getEndDate()));
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Abono correcto", "Abono creado correctamente.");}
|
||||
else{
|
||||
showMessage(FacesMessage.SEVERITY_WARN, "Prestamo deshabilitado", "No se puede abonar a un préstamo deshabilitado");
|
||||
}
|
||||
}else{
|
||||
showMessage(FacesMessage.SEVERITY_WARN, "Cantidad incorrecta", "La cantidad a abonar es mayor a la deuda faltante del préstamo");
|
||||
}
|
||||
|
||||
}
|
||||
showMessage(FacesMessage.SEVERITY_WARN, "Compra de producto incorrecto", "No se pueden agregar la compra de producto a empleados con monto o monto de abonos de 0");
|
||||
return;
|
||||
|
||||
@Override
|
||||
public void deleteRow() {
|
||||
|
||||
if (genericCtrl.existStableGeneralBoxByCreatedOn(selectedLoan.getCreatedOn())) {
|
||||
showMessage(FacesMessage.SEVERITY_WARN, "Préstamo a empleado", "No se puede borrar porque ya se realizó el cuadre de caja general del día.");
|
||||
} else {
|
||||
if(selectedLoan.getTotalAmountToPay().compareTo(selectedLoan.getBalance())==0){
|
||||
boolean delete = true;
|
||||
}
|
||||
|
||||
if (amountLoan.compareTo(amountToPay) <= 0) {
|
||||
|
||||
showMessage(FacesMessage.SEVERITY_WARN, "Compra de producto incorrecto", "No se pueden agregar la compra de producto a empleados con valor a pagar menor a sus abonos");
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
LoanEmployee loan = new LoanEmployee();
|
||||
loan.setIdEmployee(userId);
|
||||
loan.setCreatedOn(new Date());
|
||||
loan.setCreatedBy(getLoggedUser().getUser().getId());
|
||||
loan.setAmountLoan(amountLoan);
|
||||
loan.setAmountToPay(amountToPay);
|
||||
loan.setLoanEmployeeStatus(ActiveStatus.ENEBLED);
|
||||
|
||||
// Calcula numero de semanas
|
||||
Double interes = 0.05;
|
||||
Double interesReal = 0.0;
|
||||
Double semanasD = amountLoan.doubleValue() / amountToPay.doubleValue();
|
||||
int numSemanas = semanasD.intValue();
|
||||
double residuo = semanasD - numSemanas;
|
||||
if (residuo != 0.0) {
|
||||
numSemanas += 1;
|
||||
}
|
||||
|
||||
// Calcula número de meses
|
||||
int numMeses = numSemanas / 4;
|
||||
if (numSemanas % 4 > 0) {
|
||||
numMeses += 1;
|
||||
}
|
||||
|
||||
// Calcula el interes real 0.05 por el número de meses
|
||||
interesReal = interes * numMeses;
|
||||
Double saldoTotal = (amountLoan.doubleValue() * interesReal) + amountLoan.doubleValue();
|
||||
loan.setTotalAmountToPay(new BigDecimal(saldoTotal));
|
||||
loan.setBalance(new BigDecimal(saldoTotal));
|
||||
|
||||
HumanResource hr = users.stream().filter(p -> p.getId().equals(userId)).findFirst().get();
|
||||
hr.setBalance(hr.getBalance().add(new BigDecimal(saldoTotal)));
|
||||
|
||||
getController().saveLoanEmployee(loan, hr);
|
||||
|
||||
userId = "";
|
||||
amountLoan = BigDecimal.ZERO;
|
||||
amountToPay = BigDecimal.ZERO;
|
||||
|
||||
setLoanEmployee(getController().fillLoanEmployeeDataTable(getStarDate(), getEndDate()));
|
||||
}
|
||||
|
||||
public void addRowLoanDetail() {
|
||||
|
||||
if (loanDetailAmount.compareTo(BigDecimal.ZERO) == 0) {
|
||||
|
||||
showMessage(FacesMessage.SEVERITY_WARN, "Abono Incorrecto", "No se pueden agregar un abono de 0");
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
if (loanDetailAmount.compareTo(BigDecimal.ZERO) < 0) {
|
||||
|
||||
showMessage(FacesMessage.SEVERITY_WARN, "Abono Incorrecto", "No se pueden agregar un abono negativo");
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
if (genericCtrl.existStableGeneralBoxByCreatedOn(new Date())) {
|
||||
showMessage(FacesMessage.SEVERITY_WARN, "Día cerrado", "No se pueden hacer mas abonos a compra de productos porque ya se existe un cuadre de caja general de hoy.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (loanDetailAmount.compareTo(selectedLoan.getBalance()) <= 0) {
|
||||
if (selectedLoan.getLoanEmployeeStatus() == ActiveStatus.ENEBLED) {
|
||||
LoanEmployeeDetails loanDetail = new LoanEmployeeDetails();
|
||||
loanDetail.setIdLoan(selectedLoan.getId());
|
||||
loanDetail.setIdUser(selectedLoan.getIdUser());
|
||||
loanDetail.setPaymentAmount(loanDetailAmount);
|
||||
loanDetail.setReferenceNumber(selectedLoan.getReferenceNumber() + 1);
|
||||
loanDetail.setCreatedOn(new Date());
|
||||
loanDetail.setCreatedBy(getLoggedUser().getUser().getId());
|
||||
loanDetail.setLoanEmployeeDetailStatus(ActiveStatus.ENEBLED);
|
||||
loanDetail.setPayroll(ActiveStatus.DISABLED);
|
||||
|
||||
HumanResource hr = users.stream().filter(p -> p.getId().equals(selectedLoan.getIdUser())).findFirst().get();
|
||||
hr.setBalance(hr.getBalance().subtract(loanDetailAmount));
|
||||
|
||||
LoanEmployee loan = getController().getLoanEmployeeById(selectedLoan.getId());
|
||||
loan.setBalance(loan.getBalance().subtract(loanDetailAmount));
|
||||
|
||||
getController().saveLoanEmployeeDetail(loanDetail, hr, loan);
|
||||
loanDetailAmount = BigDecimal.ZERO;
|
||||
|
||||
setLoanEmployee(getController().fillLoanEmployeeDataTable(getStarDate(), getEndDate()));
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Abono correcto", "Abono creado correctamente.");
|
||||
} else {
|
||||
showMessage(FacesMessage.SEVERITY_WARN, "Compra de producto deshabilitado", "No se puede abonar a una compra deshabilitado");
|
||||
}
|
||||
} else {
|
||||
showMessage(FacesMessage.SEVERITY_WARN, "Cantidad incorrecta", "La cantidad a abonar es mayor a la deuda faltante de la compra de producto");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRow() {
|
||||
|
||||
if (genericCtrl.existStableGeneralBoxByCreatedOn(selectedLoan.getCreatedOn())) {
|
||||
showMessage(FacesMessage.SEVERITY_WARN, "Compra de producto a empleado", "No se puede borrar porque ya se realizó el cuadre de caja general del día.");
|
||||
} else {
|
||||
if (selectedLoan.getTotalAmountToPay().compareTo(selectedLoan.getBalance()) == 0) {
|
||||
boolean delete = true;
|
||||
delete = selectedLoan.getLoanEmployeeStatus() == ActiveStatus.ENEBLED ? true : false;
|
||||
|
||||
if (delete) {
|
||||
getController().updateLoanEmployeeByStatus(ActiveStatus.DISABLED, selectedLoan.getId(), getLoggedUser().getUser().getId());
|
||||
setLoanEmployee(getController().fillLoanEmployeeDataTable(getStarDate(), getEndDate()));
|
||||
getController().updateLoanEmployeeByStatus(ActiveStatus.DISABLED, selectedLoan.getId(), getLoggedUser().getUser().getId());
|
||||
setLoanEmployee(getController().fillLoanEmployeeDataTable(getStarDate(), getEndDate()));
|
||||
|
||||
Bitacora bitacora = new Bitacora();
|
||||
LoanEmployee loan = getController().getLoanEmployeeById(selectedLoan.getId());
|
||||
bitacora.setAction("Eliminar gasto administrativo");
|
||||
bitacora.setCommentsUser(commentsBitacora);
|
||||
bitacora.setCreatedBy(getLoggedUser().getUser().getId());
|
||||
bitacora.setCreatedOn(new Date());
|
||||
bitacora.setNameUser(getLoggedUser().getUser().getUserName());
|
||||
bitacora.setOffice(new Office(getLoggedUser().getOffice().getId()));
|
||||
bitacora.setDescription("Se eliminó el prestamo con monto $"
|
||||
+ loan.getAmountLoan()+ " y fecha " + loan.getCreatedOn());
|
||||
Bitacora bitacora = new Bitacora();
|
||||
LoanEmployee loan = getController().getLoanEmployeeById(selectedLoan.getId());
|
||||
bitacora.setAction("Eliminar gasto administrativo");
|
||||
bitacora.setCommentsUser(commentsBitacora);
|
||||
bitacora.setCreatedBy(getLoggedUser().getUser().getId());
|
||||
bitacora.setCreatedOn(new Date());
|
||||
bitacora.setNameUser(getLoggedUser().getUser().getUserName());
|
||||
bitacora.setOffice(new Office(getLoggedUser().getOffice().getId()));
|
||||
bitacora.setDescription("Se eliminó la compra de producto con monto $"
|
||||
+ loan.getAmountLoan() + " y fecha " + loan.getCreatedOn());
|
||||
|
||||
/*
|
||||
/*
|
||||
List<LoanEmployeeDetailAllDataView> details = getDetails(selectedLoan.getId());
|
||||
if (details != null) {
|
||||
for (LoanEmployeeDetailAllDataView detail : details) {
|
||||
getController().updateLoanEmployeeDetailByStatus(ActiveStatus.DISABLED, detail.getId(), getLoggedUser().getUser().getId());
|
||||
}
|
||||
}*/
|
||||
|
||||
bitacoraCtrl.saveBitacora(bitacora);
|
||||
commentsBitacora = "";
|
||||
selectedLoan = null;
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Préstamo a empleado eliminado", "Se eliminó correctamente.");
|
||||
bitacoraCtrl.saveBitacora(bitacora);
|
||||
commentsBitacora = "";
|
||||
selectedLoan = null;
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Compra de producto a empleado eliminado", "Se eliminó correctamente.");
|
||||
}
|
||||
}
|
||||
else{
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Préstamo tiene abonos agregados", "No se puede borrar un préstamo con abonos.");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
} else {
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "La compra de producto tiene abonos agregados", "No se puede borrar una compra de producto con abonos.");
|
||||
}
|
||||
|
||||
private LoanEmployeeController controller;
|
||||
private GenericController genericCtrl;
|
||||
private List<LoanEmployeeView> loanEmployeeView;
|
||||
private List<LoanEmployeeDetailAllDataView> loanEmployeeDetails;
|
||||
private LoanEmployeeView selectedLoan;
|
||||
private List<HumanResource> users;
|
||||
private String userId;
|
||||
private BigDecimal amountLoan;
|
||||
private BigDecimal amountToPay;
|
||||
private BigDecimal loanDetailAmount;
|
||||
private BigDecimal totalAmountLoan;
|
||||
|
||||
private BitacoraController bitacoraCtrl;
|
||||
private GenericValidationController genericValidateController;
|
||||
private Date lastStableGeneralBox;
|
||||
private String commentsBitacora;
|
||||
}
|
||||
}
|
||||
|
||||
public BigDecimal getTotalAmountLoan() {
|
||||
return totalAmountLoan;
|
||||
}
|
||||
private LoanEmployeeController controller;
|
||||
private GenericController genericCtrl;
|
||||
private List<LoanEmployeeView> loanEmployeeView;
|
||||
private List<LoanEmployeeDetailAllDataView> loanEmployeeDetails;
|
||||
private LoanEmployeeView selectedLoan;
|
||||
private List<HumanResource> users;
|
||||
private String userId;
|
||||
private BigDecimal amountLoan;
|
||||
private BigDecimal amountToPay;
|
||||
private BigDecimal loanDetailAmount;
|
||||
private BigDecimal totalAmountLoan;
|
||||
|
||||
public void setTotalAmountLoan(BigDecimal totalAmountLoan) {
|
||||
this.totalAmountLoan = totalAmountLoan;
|
||||
}
|
||||
private BitacoraController bitacoraCtrl;
|
||||
private GenericValidationController genericValidateController;
|
||||
private Date lastStableGeneralBox;
|
||||
private String commentsBitacora;
|
||||
|
||||
public BigDecimal getAmountLoan() {
|
||||
return amountLoan;
|
||||
}
|
||||
public BigDecimal getTotalAmountLoan() {
|
||||
return totalAmountLoan;
|
||||
}
|
||||
|
||||
public void setAmountLoan(BigDecimal amountLoan) {
|
||||
this.amountLoan = amountLoan;
|
||||
}
|
||||
public void setTotalAmountLoan(BigDecimal totalAmountLoan) {
|
||||
this.totalAmountLoan = totalAmountLoan;
|
||||
}
|
||||
|
||||
public BigDecimal getLoanDetailAmount() {
|
||||
return loanDetailAmount;
|
||||
}
|
||||
public BigDecimal getAmountLoan() {
|
||||
return amountLoan;
|
||||
}
|
||||
|
||||
public void setLoanDetailAmount(BigDecimal loanDetailAmount) {
|
||||
this.loanDetailAmount = loanDetailAmount;
|
||||
}
|
||||
public void setAmountLoan(BigDecimal amountLoan) {
|
||||
this.amountLoan = amountLoan;
|
||||
}
|
||||
|
||||
public BigDecimal getAmountToPay() {
|
||||
return amountToPay;
|
||||
}
|
||||
public BigDecimal getLoanDetailAmount() {
|
||||
return loanDetailAmount;
|
||||
}
|
||||
|
||||
public void setAmountToPay(BigDecimal amountToPay) {
|
||||
this.amountToPay = amountToPay;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
public void setLoanDetailAmount(BigDecimal loanDetailAmount) {
|
||||
this.loanDetailAmount = loanDetailAmount;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
public BigDecimal getAmountToPay() {
|
||||
return amountToPay;
|
||||
}
|
||||
|
||||
public GenericController getGenericCtrl() {
|
||||
return genericCtrl;
|
||||
}
|
||||
public void setAmountToPay(BigDecimal amountToPay) {
|
||||
this.amountToPay = amountToPay;
|
||||
}
|
||||
|
||||
public void setGenericCtrl(GenericController genericCtrl) {
|
||||
this.genericCtrl = genericCtrl;
|
||||
}
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public List<HumanResource> getUsers() {
|
||||
return users;
|
||||
}
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public void setUsers(List<HumanResource> users) {
|
||||
this.users = users;
|
||||
}
|
||||
public GenericController getGenericCtrl() {
|
||||
return genericCtrl;
|
||||
}
|
||||
|
||||
public List<LoanEmployeeView> getLoanEmployeeView() {
|
||||
return loanEmployeeView;
|
||||
}
|
||||
public void setGenericCtrl(GenericController genericCtrl) {
|
||||
this.genericCtrl = genericCtrl;
|
||||
}
|
||||
|
||||
public void setLoanEmployeeView(List<LoanEmployeeView> loanEmployeeView) {
|
||||
this.loanEmployeeView = loanEmployeeView;
|
||||
}
|
||||
public List<HumanResource> getUsers() {
|
||||
return users;
|
||||
}
|
||||
|
||||
public LoanEmployeeView getSelectedLoan() {
|
||||
return selectedLoan;
|
||||
}
|
||||
public void setUsers(List<HumanResource> users) {
|
||||
this.users = users;
|
||||
}
|
||||
|
||||
public void setSelectedLoan(LoanEmployeeView selectedLoan) {
|
||||
this.selectedLoan = selectedLoan;
|
||||
}
|
||||
public List<LoanEmployeeView> getLoanEmployeeView() {
|
||||
return loanEmployeeView;
|
||||
}
|
||||
|
||||
public LoanEmployeeController getController() {
|
||||
return controller;
|
||||
}
|
||||
public void setLoanEmployeeView(List<LoanEmployeeView> loanEmployeeView) {
|
||||
this.loanEmployeeView = loanEmployeeView;
|
||||
}
|
||||
|
||||
public void setController(LoanEmployeeController controller) {
|
||||
this.controller = controller;
|
||||
}
|
||||
public LoanEmployeeView getSelectedLoan() {
|
||||
return selectedLoan;
|
||||
}
|
||||
|
||||
public List<LoanEmployeeView> getLoanEmployee() {
|
||||
return loanEmployeeView;
|
||||
}
|
||||
public void setSelectedLoan(LoanEmployeeView selectedLoan) {
|
||||
this.selectedLoan = selectedLoan;
|
||||
}
|
||||
|
||||
public void setLoanEmployee(List<LoanEmployeeView> loanEmployee) {
|
||||
this.loanEmployeeView = loanEmployee;
|
||||
}
|
||||
public LoanEmployeeController getController() {
|
||||
return controller;
|
||||
}
|
||||
|
||||
public List<LoanEmployeeDetailAllDataView> getLoanEmployeeDetails() {
|
||||
return loanEmployeeDetails;
|
||||
}
|
||||
public void setController(LoanEmployeeController controller) {
|
||||
this.controller = controller;
|
||||
}
|
||||
|
||||
public void setLoanEmployeeDetails(List<LoanEmployeeDetailAllDataView> loanEmployeeDetails) {
|
||||
this.loanEmployeeDetails = loanEmployeeDetails;
|
||||
}
|
||||
public List<LoanEmployeeView> getLoanEmployee() {
|
||||
return loanEmployeeView;
|
||||
}
|
||||
|
||||
public String getCommentsBitacora() {
|
||||
return commentsBitacora;
|
||||
}
|
||||
public void setLoanEmployee(List<LoanEmployeeView> loanEmployee) {
|
||||
this.loanEmployeeView = loanEmployee;
|
||||
}
|
||||
|
||||
public void setCommentsBitacora(String commentsBitacora) {
|
||||
this.commentsBitacora = commentsBitacora;
|
||||
}
|
||||
public List<LoanEmployeeDetailAllDataView> getLoanEmployeeDetails() {
|
||||
return loanEmployeeDetails;
|
||||
}
|
||||
|
||||
public GenericValidationController getGenericValidateController() {
|
||||
return genericValidateController;
|
||||
}
|
||||
|
||||
public void setGenericValidateController(GenericValidationController genericController) {
|
||||
this.genericValidateController = genericController;
|
||||
}
|
||||
|
||||
public Date getLastStableGeneralBox() {
|
||||
return lastStableGeneralBox;
|
||||
}
|
||||
public void setLoanEmployeeDetails(List<LoanEmployeeDetailAllDataView> loanEmployeeDetails) {
|
||||
this.loanEmployeeDetails = loanEmployeeDetails;
|
||||
}
|
||||
|
||||
public void setLastStableGeneralBox(Date lastStableGeneralBox) {
|
||||
this.lastStableGeneralBox = lastStableGeneralBox;
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
try {
|
||||
loadBundlePropertyFile();
|
||||
genericCtrl = new GenericController();
|
||||
setController(new LoanEmployeeController());
|
||||
bitacoraCtrl = new BitacoraController();
|
||||
setGenericValidateController(new GenericValidationController());
|
||||
setLastStableGeneralBox(getGenericValidateController().lastStableGeneralBoxByDate(getLoggedUser().getUser()));
|
||||
setLoanEmployee(getController().fillLoanEmployeeDataTable(getStarDate(), getEndDate()));
|
||||
// users = genericCtrl.getAllUsersByOffice(getLoggedUser().getOffice().getId());
|
||||
users = genericCtrl.getAllHRByOffice(getLoggedUser().getOffice().getId());
|
||||
totalAmountLoan = fillTotalAmountLoan();
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
public String getCommentsBitacora() {
|
||||
return commentsBitacora;
|
||||
}
|
||||
|
||||
public void setCommentsBitacora(String commentsBitacora) {
|
||||
this.commentsBitacora = commentsBitacora;
|
||||
}
|
||||
|
||||
public GenericValidationController getGenericValidateController() {
|
||||
return genericValidateController;
|
||||
}
|
||||
|
||||
public void setGenericValidateController(GenericValidationController genericController) {
|
||||
this.genericValidateController = genericController;
|
||||
}
|
||||
|
||||
public Date getLastStableGeneralBox() {
|
||||
return lastStableGeneralBox;
|
||||
}
|
||||
|
||||
public void setLastStableGeneralBox(Date lastStableGeneralBox) {
|
||||
this.lastStableGeneralBox = lastStableGeneralBox;
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
try {
|
||||
loadBundlePropertyFile();
|
||||
genericCtrl = new GenericController();
|
||||
setController(new LoanEmployeeController());
|
||||
bitacoraCtrl = new BitacoraController();
|
||||
setGenericValidateController(new GenericValidationController());
|
||||
setLastStableGeneralBox(getGenericValidateController().lastStableGeneralBoxByDate(getLoggedUser().getUser()));
|
||||
setLoanEmployee(getController().fillLoanEmployeeDataTable(getStarDate(), getEndDate()));
|
||||
// users = genericCtrl.getAllUsersByOffice(getLoggedUser().getOffice().getId());
|
||||
users = genericCtrl.getAllHRByOffice(getLoggedUser().getOffice().getId());
|
||||
totalAmountLoan = fillTotalAmountLoan();
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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.apc.web.beans.admin;
|
||||
@ -41,43 +41,43 @@ import org.primefaces.event.RowEditEvent;
|
||||
@ViewScoped
|
||||
public class LoanHistoryBean extends GenericBean implements Serializable, Datatable {
|
||||
|
||||
public void searchHistoricalAction() {
|
||||
try {
|
||||
if (getStarDate().after(getEndDate())) {
|
||||
showMessage(FacesMessage.SEVERITY_ERROR, getBundlePropertyFile().getString("generic.start.date"), getBundlePropertyFile().getString("generic.end.date.error"));
|
||||
} else {
|
||||
setLoan(getLoanCtrl().fillAllLoansViewDatatable(getStarDate(), getEndDate()));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
public void searchHistoricalAction() {
|
||||
try {
|
||||
if (getStarDate().after(getEndDate())) {
|
||||
showMessage(FacesMessage.SEVERITY_ERROR, getBundlePropertyFile().getString("generic.start.date"), getBundlePropertyFile().getString("generic.end.date.error"));
|
||||
} else {
|
||||
setLoan(getLoanCtrl().fillAllLoansViewDatatable(getStarDate(), getEndDate()));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
|
||||
public List<HistoryLoanView> fillDatatableLoan() {
|
||||
return getLoanCtrl().fillAllLoansViewDatatable(getStarDate(), getEndDate());
|
||||
}
|
||||
public List<HistoryLoanView> fillDatatableLoan() {
|
||||
return getLoanCtrl().fillAllLoansViewDatatable(getStarDate(), getEndDate());
|
||||
}
|
||||
|
||||
public void changeBonusNewCustomer() {
|
||||
loanCtrl.updateBonusNewCustomer(ActiveStatus.ENEBLED, selectedLoan.getId(), getLoggedUser().getUser().getId());
|
||||
loan.clear();
|
||||
loan = fillDatatableLoan();
|
||||
selectedLoan = null;
|
||||
public void changeBonusNewCustomer() {
|
||||
loanCtrl.updateBonusNewCustomer(ActiveStatus.ENEBLED, selectedLoan.getId(), getLoggedUser().getUser().getId());
|
||||
loan.clear();
|
||||
loan = fillDatatableLoan();
|
||||
selectedLoan = null;
|
||||
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Cambio de bono", "El préstamo empezó a contar como bono de cliente nuevo.");
|
||||
}
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Cambio de bono", "La compra de producto empezó a contar como bono de cliente nuevo.");
|
||||
}
|
||||
|
||||
public void removeBonusNewCustomer() {
|
||||
loanCtrl.updateBonusNewCustomer(ActiveStatus.DISABLED, selectedLoan.getId(), getLoggedUser().getUser().getId());
|
||||
loan.clear();
|
||||
loan = fillDatatableLoan();
|
||||
selectedLoan = null;
|
||||
public void removeBonusNewCustomer() {
|
||||
loanCtrl.updateBonusNewCustomer(ActiveStatus.DISABLED, selectedLoan.getId(), getLoggedUser().getUser().getId());
|
||||
loan.clear();
|
||||
loan = fillDatatableLoan();
|
||||
selectedLoan = null;
|
||||
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Cambio de bono", "El préstamo ya no contará como bono de cliente nuevo.");
|
||||
}
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Cambio de bono", "La compra de producto ya no contará como bono de cliente nuevo.");
|
||||
}
|
||||
|
||||
public void deleteFeeLoan() {
|
||||
public void deleteFeeLoan() {
|
||||
|
||||
/* if (selectedLoan.getEstatusPrestamo()== LoanStatus.APPROVED.getValue() || selectedLoan.getEstatusPrestamo() == LoanStatus.PENDING_RENOVATION.getValue()) {
|
||||
|
||||
/* if (selectedLoan.getEstatusPrestamo()== LoanStatus.APPROVED.getValue() || selectedLoan.getEstatusPrestamo() == LoanStatus.PENDING_RENOVATION.getValue()) {
|
||||
|
||||
List<LoanDetails> details = loanCtrl.getLoanDetailsFeeCurdatebyIdLoan(selectedLoan.getId());
|
||||
if (details != null && !details.isEmpty()) {
|
||||
Loan loanUpdate = loanCtrl.getLoanById(selectedLoan.getId());
|
||||
@ -99,74 +99,74 @@ public class LoanHistoryBean extends GenericBean implements Serializable, Datata
|
||||
else
|
||||
{
|
||||
showMessage(FacesMessage.SEVERITY_WARN, "No se puede eliminar la multa", "Solo puedes eliminar la multa de préstamos en estatus Aprobados o Pendiente por renovación");
|
||||
return;
|
||||
}*/
|
||||
}
|
||||
|
||||
public void changeRoute() {
|
||||
if (!routeId.isEmpty()) {
|
||||
if (loanCtrl.updateRouteById(new RouteCtlg(routeId), selectedLoan.getId(), getLoggedUser().getUser().getId())) {
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Ruta modificada", "Se modificó correctamente.");
|
||||
} else {
|
||||
showMessage(FacesMessage.SEVERITY_WARN, "Ruta modificada", "Ocurrió un error durante el proceso.");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void changeLoanType() {
|
||||
if (selectedLoan.getEstatusPrestamo() != LoanStatus.TO_DELIVERY.getValue()) {
|
||||
loanTypeId = "";
|
||||
selectedLoan = null;
|
||||
showMessage(FacesMessage.SEVERITY_WARN, "No se puede cambiar el tipo de préstamo", "Solo puedes cambiar el monto a prestar de préstamos en estatus Por liberar");
|
||||
return;
|
||||
}
|
||||
Loan loanUpdate = loanCtrl.getLoanById(selectedLoan.getId());
|
||||
loanUpdate.setLoanType(new LoanType(loanTypeId));
|
||||
loanUpdate.setAmountToPay(loanTypeCtrl.getLoanTypeById(loanTypeId).getPaymentTotal());
|
||||
if (loanCtrl.updateLoan(loanUpdate)) {
|
||||
loan.clear();
|
||||
loan = fillDatatableLoan();
|
||||
loanTypeId = "";
|
||||
selectedLoan = null;
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Cambio de tipo de préstamo", "El préstamo se cambió correctamente");
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
}
|
||||
public void changeRoute() {
|
||||
if (!routeId.isEmpty()) {
|
||||
if (loanCtrl.updateRouteById(new RouteCtlg(routeId), selectedLoan.getId(), getLoggedUser().getUser().getId())) {
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Ruta modificada", "Se modificó correctamente.");
|
||||
} else {
|
||||
showMessage(FacesMessage.SEVERITY_WARN, "Ruta modificada", "Ocurrió un error durante el proceso.");
|
||||
}
|
||||
|
||||
public void deleteLoan() {
|
||||
/* loanCtrl.updateLoanByStatusWeb(LoanStatus.DELETED, selectedLoan.getId(), getLoggedUser().getUser().getId());
|
||||
}
|
||||
}
|
||||
|
||||
public void changeLoanType() {
|
||||
if (selectedLoan.getEstatusPrestamo() != LoanStatus.TO_DELIVERY.getValue()) {
|
||||
loanTypeId = "";
|
||||
selectedLoan = null;
|
||||
showMessage(FacesMessage.SEVERITY_WARN, "No se puede cambiar el tipo de compra de producto", "Solo puedes cambiar el monto a comprar de compra de producto en estatus Por liberar");
|
||||
return;
|
||||
}
|
||||
Loan loanUpdate = loanCtrl.getLoanById(selectedLoan.getId());
|
||||
loanUpdate.setLoanType(new LoanType(loanTypeId));
|
||||
loanUpdate.setAmountToPay(loanTypeCtrl.getLoanTypeById(loanTypeId).getPaymentTotal());
|
||||
if (loanCtrl.updateLoan(loanUpdate)) {
|
||||
loan.clear();
|
||||
loan = fillDatatableLoan();
|
||||
loanTypeId = "";
|
||||
selectedLoan = null;
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Cambio de tipo de compra de producto", "La compra de producto se cambió correctamente");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void deleteLoan() {
|
||||
/* loanCtrl.updateLoanByStatusWeb(LoanStatus.DELETED, selectedLoan.getId(), getLoggedUser().getUser().getId());
|
||||
loanCtrl.updateLoanByUserByStatus(LoanStatus.DELETED, selectedLoan);
|
||||
loan.remove(selectedLoan);
|
||||
selectedLoan = null;
|
||||
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Cambio de estatus", "El préstamo se cambió a estatus 'Eliminado' de forma correcta.");*/
|
||||
}
|
||||
}
|
||||
|
||||
public void changeApprovedStatus() {
|
||||
/*loanCtrl.updateLoanByStatusWeb(LoanStatus.APPROVED, selectedLoan.getId(), getLoggedUser().getUser().getId());
|
||||
public void changeApprovedStatus() {
|
||||
/*loanCtrl.updateLoanByStatusWeb(LoanStatus.APPROVED, selectedLoan.getId(), getLoggedUser().getUser().getId());
|
||||
loanCtrl.updateLoanByUserByStatus(LoanStatus.APPROVED, selectedLoan);
|
||||
loan.clear();
|
||||
loan = fillDatatableLoan();
|
||||
selectedLoan = null;
|
||||
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Cambio de estatus", "El préstamo se cambió a estatus 'Aprobado' de forma correcta.");*/
|
||||
}
|
||||
}
|
||||
|
||||
public void changeFinishStatus() {
|
||||
/*loanCtrl.updateLoanByStatusWeb(LoanStatus.FINISH, selectedLoan.getId(), getLoggedUser().getUser().getId());
|
||||
public void changeFinishStatus() {
|
||||
/*loanCtrl.updateLoanByStatusWeb(LoanStatus.FINISH, selectedLoan.getId(), getLoggedUser().getUser().getId());
|
||||
loanCtrl.updateLoanByUserByStatus(LoanStatus.FINISH, selectedLoan);
|
||||
loan.clear();
|
||||
loan = fillDatatableLoan();
|
||||
selectedLoan = null;
|
||||
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Cambio de estatus", "El préstamo se cambió a estatus 'Aprobado' de forma correcta.");*/
|
||||
}
|
||||
}
|
||||
|
||||
public void deletePaymentLoan() {
|
||||
public void deletePaymentLoan() {
|
||||
|
||||
/*if (selectedLoan.getLoanStatus() == LoanStatus.APPROVED || selectedLoan.getLoanStatus() == LoanStatus.PENDING_RENOVATION) {
|
||||
|
||||
/*if (selectedLoan.getLoanStatus() == LoanStatus.APPROVED || selectedLoan.getLoanStatus() == LoanStatus.PENDING_RENOVATION) {
|
||||
|
||||
List<LoanDetails> details = loanCtrl.getLoanDetailsCurdatebyIdLoan(selectedLoan.getId());
|
||||
if (details != null && !details.isEmpty()) {
|
||||
Loan loanUpdate = loanCtrl.getLoanById(selectedLoan.getId());
|
||||
@ -188,17 +188,17 @@ public class LoanHistoryBean extends GenericBean implements Serializable, Datata
|
||||
else
|
||||
{
|
||||
showMessage(FacesMessage.SEVERITY_WARN, "No se puede eliminar abono", "Solo puedes eliminar el abono de préstamos en estatus Aprobados o Pendiente por renovación");
|
||||
return;
|
||||
return;
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void editRow(RowEditEvent event) {
|
||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
@Override
|
||||
public void editRow(RowEditEvent event) {
|
||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
|
||||
public void addPayment() {
|
||||
/*if (selectedLoan.getLoanStatus() == LoanStatus.APPROVED || selectedLoan.getLoanStatus() == LoanStatus.PENDING_RENOVATION) {
|
||||
public void addPayment() {
|
||||
/*if (selectedLoan.getLoanStatus() == LoanStatus.APPROVED || selectedLoan.getLoanStatus() == LoanStatus.PENDING_RENOVATION) {
|
||||
LoanDetails detail = new LoanDetails();
|
||||
detail.setComments(comments);
|
||||
detail.setCreatedBy(getLoggedUser().getUser().getId());
|
||||
@ -239,10 +239,10 @@ public class LoanHistoryBean extends GenericBean implements Serializable, Datata
|
||||
return;
|
||||
}*/
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void addFee() {
|
||||
/*if (selectedLoan.getLoanStatus() != LoanStatus.APPROVED) {
|
||||
public void addFee() {
|
||||
/*if (selectedLoan.getLoanStatus() != LoanStatus.APPROVED) {
|
||||
selectedLoan = null;
|
||||
userId = "";
|
||||
comments = "";
|
||||
@ -282,10 +282,10 @@ public class LoanHistoryBean extends GenericBean implements Serializable, Datata
|
||||
fee = BigDecimal.ZERO;
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Agregar multa", "Se agregó la multa de forma correcta.");
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
public void changeOwner() {
|
||||
/*if (selectedLoan.getLoanStatus() != LoanStatus.APPROVED) {
|
||||
public void changeOwner() {
|
||||
/*if (selectedLoan.getLoanStatus() != LoanStatus.APPROVED) {
|
||||
selectedLoan = null;
|
||||
userId = "";
|
||||
showMessage(FacesMessage.SEVERITY_WARN, "No se puede modificar propietario", "Solo puedes cambiar de propietario a préstamos en estatus Aprobados");
|
||||
@ -319,228 +319,228 @@ public class LoanHistoryBean extends GenericBean implements Serializable, Datata
|
||||
selectedLoan = null;
|
||||
showMessage(FacesMessage.SEVERITY_ERROR, "Cambio de propietario", "Ocurrió un error al intentar hacer el cambio de propietario.");
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private void initStartAndEndDates() {
|
||||
try {
|
||||
Calendar starDateCalendar = Calendar.getInstance();
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private void initStartAndEndDates() {
|
||||
try {
|
||||
Calendar starDateCalendar = Calendar.getInstance();
|
||||
|
||||
starDateCalendar.setTime(DateWrapper.getTodayMXTime());
|
||||
starDateCalendar.add(Calendar.MONTH, -1);
|
||||
starDateCalendar.setTime(DateWrapper.getTodayMXTime());
|
||||
starDateCalendar.add(Calendar.MONTH, -1);
|
||||
|
||||
setStarDate(starDateCalendar.getTime());
|
||||
setEndDate(DateWrapper.getTodayMXTime());
|
||||
} catch (Exception e) {
|
||||
setStarDate(starDateCalendar.getTime());
|
||||
setEndDate(DateWrapper.getTodayMXTime());
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void approvedLoan() {
|
||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
public void approvedLoan() {
|
||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRowCancel(RowEditEvent event) {
|
||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
@Override
|
||||
public void onRowCancel(RowEditEvent event) {
|
||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRowReorder(ReorderEvent event) {
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Registro Movido", "De columna: " + (event.getFromIndex() + 1) + " a columna: " + (event.getToIndex() + 1));
|
||||
}
|
||||
@Override
|
||||
public void onRowReorder(ReorderEvent event) {
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Registro Movido", "De columna: " + (event.getFromIndex() + 1) + " a columna: " + (event.getToIndex() + 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addRow() {
|
||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
@Override
|
||||
public void addRow() {
|
||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRow() {
|
||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
@Override
|
||||
public void deleteRow() {
|
||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param outcome
|
||||
* @return
|
||||
*/
|
||||
public String detailLoan(String outcome) {
|
||||
return outcome;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param outcome
|
||||
* @return
|
||||
*/
|
||||
public String detailLoan(String outcome) {
|
||||
return outcome;
|
||||
}
|
||||
|
||||
public LoanController getLoanCtrl() {
|
||||
return loanCtrl;
|
||||
}
|
||||
public LoanController getLoanCtrl() {
|
||||
return loanCtrl;
|
||||
}
|
||||
|
||||
public void setLoanCtrl(LoanController loanCtrl) {
|
||||
this.loanCtrl = loanCtrl;
|
||||
}
|
||||
public void setLoanCtrl(LoanController loanCtrl) {
|
||||
this.loanCtrl = loanCtrl;
|
||||
}
|
||||
|
||||
public List<HistoryLoanView> getLoan() {
|
||||
return loan;
|
||||
}
|
||||
public List<HistoryLoanView> getLoan() {
|
||||
return loan;
|
||||
}
|
||||
|
||||
public void setLoan(List<HistoryLoanView> loan) {
|
||||
this.loan = loan;
|
||||
}
|
||||
public void setLoan(List<HistoryLoanView> loan) {
|
||||
this.loan = loan;
|
||||
}
|
||||
|
||||
public HistoryLoanView getSelectedLoan() {
|
||||
return selectedLoan;
|
||||
}
|
||||
public HistoryLoanView getSelectedLoan() {
|
||||
return selectedLoan;
|
||||
}
|
||||
|
||||
public void setSelectedLoan(HistoryLoanView selectedLoan) {
|
||||
this.selectedLoan = selectedLoan;
|
||||
}
|
||||
public void setSelectedLoan(HistoryLoanView selectedLoan) {
|
||||
this.selectedLoan = selectedLoan;
|
||||
}
|
||||
|
||||
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 GenericController getGenericCtrl() {
|
||||
return genericCtrl;
|
||||
}
|
||||
public GenericController getGenericCtrl() {
|
||||
return genericCtrl;
|
||||
}
|
||||
|
||||
public void setGenericCtrl(GenericController genericCtrl) {
|
||||
this.genericCtrl = genericCtrl;
|
||||
}
|
||||
public void setGenericCtrl(GenericController genericCtrl) {
|
||||
this.genericCtrl = genericCtrl;
|
||||
}
|
||||
|
||||
public List<User> getUsers() {
|
||||
return users;
|
||||
}
|
||||
public List<User> getUsers() {
|
||||
return users;
|
||||
}
|
||||
|
||||
public void setUsers(List<User> users) {
|
||||
this.users = users;
|
||||
}
|
||||
public void setUsers(List<User> users) {
|
||||
this.users = users;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public BigDecimal getPayment() {
|
||||
return payment;
|
||||
}
|
||||
public BigDecimal getPayment() {
|
||||
return payment;
|
||||
}
|
||||
|
||||
public void setPayment(BigDecimal payment) {
|
||||
this.payment = payment;
|
||||
}
|
||||
public void setPayment(BigDecimal payment) {
|
||||
this.payment = payment;
|
||||
}
|
||||
|
||||
public BigDecimal getFee() {
|
||||
return fee;
|
||||
}
|
||||
public BigDecimal getFee() {
|
||||
return fee;
|
||||
}
|
||||
|
||||
public void setFee(BigDecimal fee) {
|
||||
this.fee = fee;
|
||||
}
|
||||
public void setFee(BigDecimal fee) {
|
||||
this.fee = fee;
|
||||
}
|
||||
|
||||
public LoanTypeController getLoanTypeCtrl() {
|
||||
return loanTypeCtrl;
|
||||
}
|
||||
public LoanTypeController getLoanTypeCtrl() {
|
||||
return loanTypeCtrl;
|
||||
}
|
||||
|
||||
public void setLoanTypeCtrl(LoanTypeController loanTypeCtrl) {
|
||||
this.loanTypeCtrl = loanTypeCtrl;
|
||||
}
|
||||
public void setLoanTypeCtrl(LoanTypeController loanTypeCtrl) {
|
||||
this.loanTypeCtrl = loanTypeCtrl;
|
||||
}
|
||||
|
||||
public List<LoanType> getLoanType() {
|
||||
return loanType;
|
||||
}
|
||||
public List<LoanType> getLoanType() {
|
||||
return loanType;
|
||||
}
|
||||
|
||||
public void setLoanType(List<LoanType> loanType) {
|
||||
this.loanType = loanType;
|
||||
}
|
||||
public void setLoanType(List<LoanType> loanType) {
|
||||
this.loanType = loanType;
|
||||
}
|
||||
|
||||
public String getLoanTypeId() {
|
||||
return loanTypeId;
|
||||
}
|
||||
public String getLoanTypeId() {
|
||||
return loanTypeId;
|
||||
}
|
||||
|
||||
public void setLoanTypeId(String loanTypeId) {
|
||||
this.loanTypeId = loanTypeId;
|
||||
}
|
||||
public void setLoanTypeId(String loanTypeId) {
|
||||
this.loanTypeId = loanTypeId;
|
||||
}
|
||||
|
||||
public String getRouteId() {
|
||||
return routeId;
|
||||
}
|
||||
public String getRouteId() {
|
||||
return routeId;
|
||||
}
|
||||
|
||||
public void setRouteId(String routeId) {
|
||||
this.routeId = routeId;
|
||||
}
|
||||
public void setRouteId(String routeId) {
|
||||
this.routeId = routeId;
|
||||
}
|
||||
|
||||
public RouteController getRouteCtrl() {
|
||||
return routeCtrl;
|
||||
}
|
||||
public RouteController getRouteCtrl() {
|
||||
return routeCtrl;
|
||||
}
|
||||
|
||||
public void setRouteCtrl(RouteController routeCtrl) {
|
||||
this.routeCtrl = routeCtrl;
|
||||
}
|
||||
public void setRouteCtrl(RouteController routeCtrl) {
|
||||
this.routeCtrl = routeCtrl;
|
||||
}
|
||||
|
||||
public List<RouteCtlg> getRoute() {
|
||||
return route;
|
||||
}
|
||||
public List<RouteCtlg> getRoute() {
|
||||
return route;
|
||||
}
|
||||
|
||||
public void setRoute(List<RouteCtlg> route) {
|
||||
this.route = route;
|
||||
}
|
||||
public void setRoute(List<RouteCtlg> route) {
|
||||
this.route = route;
|
||||
}
|
||||
|
||||
public Date getStarDate() {
|
||||
return starDate;
|
||||
}
|
||||
public Date getStarDate() {
|
||||
return starDate;
|
||||
}
|
||||
|
||||
public void setStarDate(Date starDate) {
|
||||
this.starDate = starDate;
|
||||
}
|
||||
public void setStarDate(Date starDate) {
|
||||
this.starDate = starDate;
|
||||
}
|
||||
|
||||
public Date getEndDate() {
|
||||
return endDate;
|
||||
}
|
||||
public Date getEndDate() {
|
||||
return endDate;
|
||||
}
|
||||
|
||||
public void setEndDate(Date endDate) {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
public void setEndDate(Date endDate) {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
private LoanController loanCtrl;
|
||||
private LoanTypeController loanTypeCtrl;
|
||||
private GenericController genericCtrl;
|
||||
private RouteController routeCtrl;
|
||||
private LoanController loanCtrl;
|
||||
private LoanTypeController loanTypeCtrl;
|
||||
private GenericController genericCtrl;
|
||||
private RouteController routeCtrl;
|
||||
|
||||
private List<HistoryLoanView> loan;
|
||||
private List<User> users;
|
||||
private List<LoanType> loanType;
|
||||
private List<RouteCtlg> route;
|
||||
private HistoryLoanView selectedLoan;
|
||||
private String comments;
|
||||
private String userId;
|
||||
private BigDecimal payment;
|
||||
private BigDecimal fee;
|
||||
private String loanTypeId;
|
||||
private String routeId;
|
||||
private List<HistoryLoanView> loan;
|
||||
private List<User> users;
|
||||
private List<LoanType> loanType;
|
||||
private List<RouteCtlg> route;
|
||||
private HistoryLoanView selectedLoan;
|
||||
private String comments;
|
||||
private String userId;
|
||||
private BigDecimal payment;
|
||||
private BigDecimal fee;
|
||||
private String loanTypeId;
|
||||
private String routeId;
|
||||
|
||||
private Date starDate;
|
||||
private Date endDate;
|
||||
private Date starDate;
|
||||
private Date endDate;
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
loadBundlePropertyFile();
|
||||
|
||||
loanCtrl = new LoanController();
|
||||
genericCtrl = new GenericController();
|
||||
loanTypeCtrl = new LoanTypeController();
|
||||
routeCtrl = new RouteController();
|
||||
initStartAndEndDates();
|
||||
users = genericCtrl.getAllUsersByOffice(getLoggedUser().getOffice().getId());
|
||||
loanType = loanTypeCtrl.fillLoanTypeDatatable(getLoggedUser().getOffice().getId());
|
||||
route = routeCtrl.fillRoutesDatatable(getLoggedUser().getOffice().getId());
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
loadBundlePropertyFile();
|
||||
|
||||
setLoan(fillDatatableLoan());
|
||||
}
|
||||
loanCtrl = new LoanController();
|
||||
genericCtrl = new GenericController();
|
||||
loanTypeCtrl = new LoanTypeController();
|
||||
routeCtrl = new RouteController();
|
||||
initStartAndEndDates();
|
||||
users = genericCtrl.getAllUsersByOffice(getLoggedUser().getOffice().getId());
|
||||
loanType = loanTypeCtrl.fillLoanTypeDatatable(getLoggedUser().getOffice().getId());
|
||||
route = routeCtrl.fillRoutesDatatable(getLoggedUser().getOffice().getId());
|
||||
|
||||
setLoan(fillDatatableLoan());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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.apc.web.beans.admin;
|
||||
@ -41,43 +41,43 @@ import org.primefaces.event.RowEditEvent;
|
||||
@ViewScoped
|
||||
public class LoanHistoryJuridicalBean extends GenericBean implements Serializable, Datatable {
|
||||
|
||||
public void searchHistoricalAction() {
|
||||
try {
|
||||
if (getStarDate().after(getEndDate())) {
|
||||
showMessage(FacesMessage.SEVERITY_ERROR, getBundlePropertyFile().getString("generic.start.date"), getBundlePropertyFile().getString("generic.end.date.error"));
|
||||
} else {
|
||||
setLoan(getLoanCtrl().fillAllLoansJuridicalViewDatatable(getStarDate(), getEndDate()));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
public void searchHistoricalAction() {
|
||||
try {
|
||||
if (getStarDate().after(getEndDate())) {
|
||||
showMessage(FacesMessage.SEVERITY_ERROR, getBundlePropertyFile().getString("generic.start.date"), getBundlePropertyFile().getString("generic.end.date.error"));
|
||||
} else {
|
||||
setLoan(getLoanCtrl().fillAllLoansJuridicalViewDatatable(getStarDate(), getEndDate()));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
|
||||
public List<HistoryLoanView> fillDatatableLoan() {
|
||||
return getLoanCtrl().fillAllLoansJuridicalViewDatatable(getStarDate(), getEndDate());
|
||||
}
|
||||
public List<HistoryLoanView> fillDatatableLoan() {
|
||||
return getLoanCtrl().fillAllLoansJuridicalViewDatatable(getStarDate(), getEndDate());
|
||||
}
|
||||
|
||||
public void changeBonusNewCustomer() {
|
||||
loanCtrl.updateBonusNewCustomer(ActiveStatus.ENEBLED, selectedLoan.getId(), getLoggedUser().getUser().getId());
|
||||
loan.clear();
|
||||
loan = fillDatatableLoan();
|
||||
selectedLoan = null;
|
||||
public void changeBonusNewCustomer() {
|
||||
loanCtrl.updateBonusNewCustomer(ActiveStatus.ENEBLED, selectedLoan.getId(), getLoggedUser().getUser().getId());
|
||||
loan.clear();
|
||||
loan = fillDatatableLoan();
|
||||
selectedLoan = null;
|
||||
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Cambio de bono", "El préstamo empezó a contar como bono de cliente nuevo.");
|
||||
}
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Cambio de bono", "La compra de producto empezó a contar como bono de cliente nuevo.");
|
||||
}
|
||||
|
||||
public void removeBonusNewCustomer() {
|
||||
loanCtrl.updateBonusNewCustomer(ActiveStatus.DISABLED, selectedLoan.getId(), getLoggedUser().getUser().getId());
|
||||
loan.clear();
|
||||
loan = fillDatatableLoan();
|
||||
selectedLoan = null;
|
||||
public void removeBonusNewCustomer() {
|
||||
loanCtrl.updateBonusNewCustomer(ActiveStatus.DISABLED, selectedLoan.getId(), getLoggedUser().getUser().getId());
|
||||
loan.clear();
|
||||
loan = fillDatatableLoan();
|
||||
selectedLoan = null;
|
||||
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Cambio de bono", "El préstamo ya no contará como bono de cliente nuevo.");
|
||||
}
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Cambio de bono", "La compra de producto ya no contará como bono de cliente nuevo.");
|
||||
}
|
||||
|
||||
public void deleteFeeLoan() {
|
||||
public void deleteFeeLoan() {
|
||||
|
||||
/* if (selectedLoan.getEstatusPrestamo()== LoanStatus.APPROVED.getValue() || selectedLoan.getEstatusPrestamo() == LoanStatus.PENDING_RENOVATION.getValue()) {
|
||||
|
||||
/* if (selectedLoan.getEstatusPrestamo()== LoanStatus.APPROVED.getValue() || selectedLoan.getEstatusPrestamo() == LoanStatus.PENDING_RENOVATION.getValue()) {
|
||||
|
||||
List<LoanDetails> details = loanCtrl.getLoanDetailsFeeCurdatebyIdLoan(selectedLoan.getId());
|
||||
if (details != null && !details.isEmpty()) {
|
||||
Loan loanUpdate = loanCtrl.getLoanById(selectedLoan.getId());
|
||||
@ -99,74 +99,74 @@ public class LoanHistoryJuridicalBean extends GenericBean implements Serializabl
|
||||
else
|
||||
{
|
||||
showMessage(FacesMessage.SEVERITY_WARN, "No se puede eliminar la multa", "Solo puedes eliminar la multa de préstamos en estatus Aprobados o Pendiente por renovación");
|
||||
return;
|
||||
}*/
|
||||
}
|
||||
|
||||
public void changeRoute() {
|
||||
if (!routeId.isEmpty()) {
|
||||
if (loanCtrl.updateRouteById(new RouteCtlg(routeId), selectedLoan.getId(), getLoggedUser().getUser().getId())) {
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Ruta modificada", "Se modificó correctamente.");
|
||||
} else {
|
||||
showMessage(FacesMessage.SEVERITY_WARN, "Ruta modificada", "Ocurrió un error durante el proceso.");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void changeLoanType() {
|
||||
if (selectedLoan.getEstatusPrestamo() != LoanStatus.TO_DELIVERY.getValue()) {
|
||||
loanTypeId = "";
|
||||
selectedLoan = null;
|
||||
showMessage(FacesMessage.SEVERITY_WARN, "No se puede cambiar el tipo de préstamo", "Solo puedes cambiar el monto a prestar de préstamos en estatus Por liberar");
|
||||
return;
|
||||
}
|
||||
Loan loanUpdate = loanCtrl.getLoanById(selectedLoan.getId());
|
||||
loanUpdate.setLoanType(new LoanType(loanTypeId));
|
||||
loanUpdate.setAmountToPay(loanTypeCtrl.getLoanTypeById(loanTypeId).getPaymentTotal());
|
||||
if (loanCtrl.updateLoan(loanUpdate)) {
|
||||
loan.clear();
|
||||
loan = fillDatatableLoan();
|
||||
loanTypeId = "";
|
||||
selectedLoan = null;
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Cambio de tipo de préstamo", "El préstamo se cambió correctamente");
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
}
|
||||
public void changeRoute() {
|
||||
if (!routeId.isEmpty()) {
|
||||
if (loanCtrl.updateRouteById(new RouteCtlg(routeId), selectedLoan.getId(), getLoggedUser().getUser().getId())) {
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Ruta modificada", "Se modificó correctamente.");
|
||||
} else {
|
||||
showMessage(FacesMessage.SEVERITY_WARN, "Ruta modificada", "Ocurrió un error durante el proceso.");
|
||||
}
|
||||
|
||||
public void deleteLoan() {
|
||||
/* loanCtrl.updateLoanByStatusWeb(LoanStatus.DELETED, selectedLoan.getId(), getLoggedUser().getUser().getId());
|
||||
}
|
||||
}
|
||||
|
||||
public void changeLoanType() {
|
||||
if (selectedLoan.getEstatusPrestamo() != LoanStatus.TO_DELIVERY.getValue()) {
|
||||
loanTypeId = "";
|
||||
selectedLoan = null;
|
||||
showMessage(FacesMessage.SEVERITY_WARN, "No se puede cambiar el tipo de compra de producto", "Solo puedes cambiar el monto a pagar de compras de productos en estatus Por liberar");
|
||||
return;
|
||||
}
|
||||
Loan loanUpdate = loanCtrl.getLoanById(selectedLoan.getId());
|
||||
loanUpdate.setLoanType(new LoanType(loanTypeId));
|
||||
loanUpdate.setAmountToPay(loanTypeCtrl.getLoanTypeById(loanTypeId).getPaymentTotal());
|
||||
if (loanCtrl.updateLoan(loanUpdate)) {
|
||||
loan.clear();
|
||||
loan = fillDatatableLoan();
|
||||
loanTypeId = "";
|
||||
selectedLoan = null;
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Cambio de tipo de compra de producto", "La compra de producto se cambió correctamente");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void deleteLoan() {
|
||||
/* loanCtrl.updateLoanByStatusWeb(LoanStatus.DELETED, selectedLoan.getId(), getLoggedUser().getUser().getId());
|
||||
loanCtrl.updateLoanByUserByStatus(LoanStatus.DELETED, selectedLoan);
|
||||
loan.remove(selectedLoan);
|
||||
selectedLoan = null;
|
||||
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Cambio de estatus", "El préstamo se cambió a estatus 'Eliminado' de forma correcta.");*/
|
||||
}
|
||||
}
|
||||
|
||||
public void changeApprovedStatus() {
|
||||
/*loanCtrl.updateLoanByStatusWeb(LoanStatus.APPROVED, selectedLoan.getId(), getLoggedUser().getUser().getId());
|
||||
public void changeApprovedStatus() {
|
||||
/*loanCtrl.updateLoanByStatusWeb(LoanStatus.APPROVED, selectedLoan.getId(), getLoggedUser().getUser().getId());
|
||||
loanCtrl.updateLoanByUserByStatus(LoanStatus.APPROVED, selectedLoan);
|
||||
loan.clear();
|
||||
loan = fillDatatableLoan();
|
||||
selectedLoan = null;
|
||||
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Cambio de estatus", "El préstamo se cambió a estatus 'Aprobado' de forma correcta.");*/
|
||||
}
|
||||
}
|
||||
|
||||
public void changeFinishStatus() {
|
||||
/*loanCtrl.updateLoanByStatusWeb(LoanStatus.FINISH, selectedLoan.getId(), getLoggedUser().getUser().getId());
|
||||
public void changeFinishStatus() {
|
||||
/*loanCtrl.updateLoanByStatusWeb(LoanStatus.FINISH, selectedLoan.getId(), getLoggedUser().getUser().getId());
|
||||
loanCtrl.updateLoanByUserByStatus(LoanStatus.FINISH, selectedLoan);
|
||||
loan.clear();
|
||||
loan = fillDatatableLoan();
|
||||
selectedLoan = null;
|
||||
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Cambio de estatus", "El préstamo se cambió a estatus 'Aprobado' de forma correcta.");*/
|
||||
}
|
||||
}
|
||||
|
||||
public void deletePaymentLoan() {
|
||||
public void deletePaymentLoan() {
|
||||
|
||||
/*if (selectedLoan.getLoanStatus() == LoanStatus.APPROVED || selectedLoan.getLoanStatus() == LoanStatus.PENDING_RENOVATION) {
|
||||
|
||||
/*if (selectedLoan.getLoanStatus() == LoanStatus.APPROVED || selectedLoan.getLoanStatus() == LoanStatus.PENDING_RENOVATION) {
|
||||
|
||||
List<LoanDetails> details = loanCtrl.getLoanDetailsCurdatebyIdLoan(selectedLoan.getId());
|
||||
if (details != null && !details.isEmpty()) {
|
||||
Loan loanUpdate = loanCtrl.getLoanById(selectedLoan.getId());
|
||||
@ -188,17 +188,17 @@ public class LoanHistoryJuridicalBean extends GenericBean implements Serializabl
|
||||
else
|
||||
{
|
||||
showMessage(FacesMessage.SEVERITY_WARN, "No se puede eliminar abono", "Solo puedes eliminar el abono de préstamos en estatus Aprobados o Pendiente por renovación");
|
||||
return;
|
||||
return;
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void editRow(RowEditEvent event) {
|
||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
@Override
|
||||
public void editRow(RowEditEvent event) {
|
||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
|
||||
public void addPayment() {
|
||||
/*if (selectedLoan.getLoanStatus() == LoanStatus.APPROVED || selectedLoan.getLoanStatus() == LoanStatus.PENDING_RENOVATION) {
|
||||
public void addPayment() {
|
||||
/*if (selectedLoan.getLoanStatus() == LoanStatus.APPROVED || selectedLoan.getLoanStatus() == LoanStatus.PENDING_RENOVATION) {
|
||||
LoanDetails detail = new LoanDetails();
|
||||
detail.setComments(comments);
|
||||
detail.setCreatedBy(getLoggedUser().getUser().getId());
|
||||
@ -239,10 +239,10 @@ public class LoanHistoryJuridicalBean extends GenericBean implements Serializabl
|
||||
return;
|
||||
}*/
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void addFee() {
|
||||
/*if (selectedLoan.getLoanStatus() != LoanStatus.APPROVED) {
|
||||
public void addFee() {
|
||||
/*if (selectedLoan.getLoanStatus() != LoanStatus.APPROVED) {
|
||||
selectedLoan = null;
|
||||
userId = "";
|
||||
comments = "";
|
||||
@ -282,10 +282,10 @@ public class LoanHistoryJuridicalBean extends GenericBean implements Serializabl
|
||||
fee = BigDecimal.ZERO;
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Agregar multa", "Se agregó la multa de forma correcta.");
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
public void changeOwner() {
|
||||
/*if (selectedLoan.getLoanStatus() != LoanStatus.APPROVED) {
|
||||
public void changeOwner() {
|
||||
/*if (selectedLoan.getLoanStatus() != LoanStatus.APPROVED) {
|
||||
selectedLoan = null;
|
||||
userId = "";
|
||||
showMessage(FacesMessage.SEVERITY_WARN, "No se puede modificar propietario", "Solo puedes cambiar de propietario a préstamos en estatus Aprobados");
|
||||
@ -319,228 +319,228 @@ public class LoanHistoryJuridicalBean extends GenericBean implements Serializabl
|
||||
selectedLoan = null;
|
||||
showMessage(FacesMessage.SEVERITY_ERROR, "Cambio de propietario", "Ocurrió un error al intentar hacer el cambio de propietario.");
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private void initStartAndEndDates() {
|
||||
try {
|
||||
Calendar starDateCalendar = Calendar.getInstance();
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private void initStartAndEndDates() {
|
||||
try {
|
||||
Calendar starDateCalendar = Calendar.getInstance();
|
||||
|
||||
starDateCalendar.setTime(DateWrapper.getTodayMXTime());
|
||||
starDateCalendar.add(Calendar.MONTH, -1);
|
||||
starDateCalendar.setTime(DateWrapper.getTodayMXTime());
|
||||
starDateCalendar.add(Calendar.MONTH, -1);
|
||||
|
||||
setStarDate(starDateCalendar.getTime());
|
||||
setEndDate(DateWrapper.getTodayMXTime());
|
||||
} catch (Exception e) {
|
||||
setStarDate(starDateCalendar.getTime());
|
||||
setEndDate(DateWrapper.getTodayMXTime());
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void approvedLoan() {
|
||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
public void approvedLoan() {
|
||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRowCancel(RowEditEvent event) {
|
||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
@Override
|
||||
public void onRowCancel(RowEditEvent event) {
|
||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRowReorder(ReorderEvent event) {
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Registro Movido", "De columna: " + (event.getFromIndex() + 1) + " a columna: " + (event.getToIndex() + 1));
|
||||
}
|
||||
@Override
|
||||
public void onRowReorder(ReorderEvent event) {
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Registro Movido", "De columna: " + (event.getFromIndex() + 1) + " a columna: " + (event.getToIndex() + 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addRow() {
|
||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
@Override
|
||||
public void addRow() {
|
||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRow() {
|
||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
@Override
|
||||
public void deleteRow() {
|
||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param outcome
|
||||
* @return
|
||||
*/
|
||||
public String detailLoan(String outcome) {
|
||||
return outcome;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param outcome
|
||||
* @return
|
||||
*/
|
||||
public String detailLoan(String outcome) {
|
||||
return outcome;
|
||||
}
|
||||
|
||||
public LoanController getLoanCtrl() {
|
||||
return loanCtrl;
|
||||
}
|
||||
public LoanController getLoanCtrl() {
|
||||
return loanCtrl;
|
||||
}
|
||||
|
||||
public void setLoanCtrl(LoanController loanCtrl) {
|
||||
this.loanCtrl = loanCtrl;
|
||||
}
|
||||
public void setLoanCtrl(LoanController loanCtrl) {
|
||||
this.loanCtrl = loanCtrl;
|
||||
}
|
||||
|
||||
public List<HistoryLoanView> getLoan() {
|
||||
return loan;
|
||||
}
|
||||
public List<HistoryLoanView> getLoan() {
|
||||
return loan;
|
||||
}
|
||||
|
||||
public void setLoan(List<HistoryLoanView> loan) {
|
||||
this.loan = loan;
|
||||
}
|
||||
public void setLoan(List<HistoryLoanView> loan) {
|
||||
this.loan = loan;
|
||||
}
|
||||
|
||||
public HistoryLoanView getSelectedLoan() {
|
||||
return selectedLoan;
|
||||
}
|
||||
public HistoryLoanView getSelectedLoan() {
|
||||
return selectedLoan;
|
||||
}
|
||||
|
||||
public void setSelectedLoan(HistoryLoanView selectedLoan) {
|
||||
this.selectedLoan = selectedLoan;
|
||||
}
|
||||
public void setSelectedLoan(HistoryLoanView selectedLoan) {
|
||||
this.selectedLoan = selectedLoan;
|
||||
}
|
||||
|
||||
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 GenericController getGenericCtrl() {
|
||||
return genericCtrl;
|
||||
}
|
||||
public GenericController getGenericCtrl() {
|
||||
return genericCtrl;
|
||||
}
|
||||
|
||||
public void setGenericCtrl(GenericController genericCtrl) {
|
||||
this.genericCtrl = genericCtrl;
|
||||
}
|
||||
public void setGenericCtrl(GenericController genericCtrl) {
|
||||
this.genericCtrl = genericCtrl;
|
||||
}
|
||||
|
||||
public List<User> getUsers() {
|
||||
return users;
|
||||
}
|
||||
public List<User> getUsers() {
|
||||
return users;
|
||||
}
|
||||
|
||||
public void setUsers(List<User> users) {
|
||||
this.users = users;
|
||||
}
|
||||
public void setUsers(List<User> users) {
|
||||
this.users = users;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public BigDecimal getPayment() {
|
||||
return payment;
|
||||
}
|
||||
public BigDecimal getPayment() {
|
||||
return payment;
|
||||
}
|
||||
|
||||
public void setPayment(BigDecimal payment) {
|
||||
this.payment = payment;
|
||||
}
|
||||
public void setPayment(BigDecimal payment) {
|
||||
this.payment = payment;
|
||||
}
|
||||
|
||||
public BigDecimal getFee() {
|
||||
return fee;
|
||||
}
|
||||
public BigDecimal getFee() {
|
||||
return fee;
|
||||
}
|
||||
|
||||
public void setFee(BigDecimal fee) {
|
||||
this.fee = fee;
|
||||
}
|
||||
public void setFee(BigDecimal fee) {
|
||||
this.fee = fee;
|
||||
}
|
||||
|
||||
public LoanTypeController getLoanTypeCtrl() {
|
||||
return loanTypeCtrl;
|
||||
}
|
||||
public LoanTypeController getLoanTypeCtrl() {
|
||||
return loanTypeCtrl;
|
||||
}
|
||||
|
||||
public void setLoanTypeCtrl(LoanTypeController loanTypeCtrl) {
|
||||
this.loanTypeCtrl = loanTypeCtrl;
|
||||
}
|
||||
public void setLoanTypeCtrl(LoanTypeController loanTypeCtrl) {
|
||||
this.loanTypeCtrl = loanTypeCtrl;
|
||||
}
|
||||
|
||||
public List<LoanType> getLoanType() {
|
||||
return loanType;
|
||||
}
|
||||
public List<LoanType> getLoanType() {
|
||||
return loanType;
|
||||
}
|
||||
|
||||
public void setLoanType(List<LoanType> loanType) {
|
||||
this.loanType = loanType;
|
||||
}
|
||||
public void setLoanType(List<LoanType> loanType) {
|
||||
this.loanType = loanType;
|
||||
}
|
||||
|
||||
public String getLoanTypeId() {
|
||||
return loanTypeId;
|
||||
}
|
||||
public String getLoanTypeId() {
|
||||
return loanTypeId;
|
||||
}
|
||||
|
||||
public void setLoanTypeId(String loanTypeId) {
|
||||
this.loanTypeId = loanTypeId;
|
||||
}
|
||||
public void setLoanTypeId(String loanTypeId) {
|
||||
this.loanTypeId = loanTypeId;
|
||||
}
|
||||
|
||||
public String getRouteId() {
|
||||
return routeId;
|
||||
}
|
||||
public String getRouteId() {
|
||||
return routeId;
|
||||
}
|
||||
|
||||
public void setRouteId(String routeId) {
|
||||
this.routeId = routeId;
|
||||
}
|
||||
public void setRouteId(String routeId) {
|
||||
this.routeId = routeId;
|
||||
}
|
||||
|
||||
public RouteController getRouteCtrl() {
|
||||
return routeCtrl;
|
||||
}
|
||||
public RouteController getRouteCtrl() {
|
||||
return routeCtrl;
|
||||
}
|
||||
|
||||
public void setRouteCtrl(RouteController routeCtrl) {
|
||||
this.routeCtrl = routeCtrl;
|
||||
}
|
||||
public void setRouteCtrl(RouteController routeCtrl) {
|
||||
this.routeCtrl = routeCtrl;
|
||||
}
|
||||
|
||||
public List<RouteCtlg> getRoute() {
|
||||
return route;
|
||||
}
|
||||
public List<RouteCtlg> getRoute() {
|
||||
return route;
|
||||
}
|
||||
|
||||
public void setRoute(List<RouteCtlg> route) {
|
||||
this.route = route;
|
||||
}
|
||||
public void setRoute(List<RouteCtlg> route) {
|
||||
this.route = route;
|
||||
}
|
||||
|
||||
public Date getStarDate() {
|
||||
return starDate;
|
||||
}
|
||||
public Date getStarDate() {
|
||||
return starDate;
|
||||
}
|
||||
|
||||
public void setStarDate(Date starDate) {
|
||||
this.starDate = starDate;
|
||||
}
|
||||
public void setStarDate(Date starDate) {
|
||||
this.starDate = starDate;
|
||||
}
|
||||
|
||||
public Date getEndDate() {
|
||||
return endDate;
|
||||
}
|
||||
public Date getEndDate() {
|
||||
return endDate;
|
||||
}
|
||||
|
||||
public void setEndDate(Date endDate) {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
public void setEndDate(Date endDate) {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
private LoanController loanCtrl;
|
||||
private LoanTypeController loanTypeCtrl;
|
||||
private GenericController genericCtrl;
|
||||
private RouteController routeCtrl;
|
||||
private LoanController loanCtrl;
|
||||
private LoanTypeController loanTypeCtrl;
|
||||
private GenericController genericCtrl;
|
||||
private RouteController routeCtrl;
|
||||
|
||||
private List<HistoryLoanView> loan;
|
||||
private List<User> users;
|
||||
private List<LoanType> loanType;
|
||||
private List<RouteCtlg> route;
|
||||
private HistoryLoanView selectedLoan;
|
||||
private String comments;
|
||||
private String userId;
|
||||
private BigDecimal payment;
|
||||
private BigDecimal fee;
|
||||
private String loanTypeId;
|
||||
private String routeId;
|
||||
private List<HistoryLoanView> loan;
|
||||
private List<User> users;
|
||||
private List<LoanType> loanType;
|
||||
private List<RouteCtlg> route;
|
||||
private HistoryLoanView selectedLoan;
|
||||
private String comments;
|
||||
private String userId;
|
||||
private BigDecimal payment;
|
||||
private BigDecimal fee;
|
||||
private String loanTypeId;
|
||||
private String routeId;
|
||||
|
||||
private Date starDate;
|
||||
private Date endDate;
|
||||
private Date starDate;
|
||||
private Date endDate;
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
loadBundlePropertyFile();
|
||||
|
||||
loanCtrl = new LoanController();
|
||||
genericCtrl = new GenericController();
|
||||
loanTypeCtrl = new LoanTypeController();
|
||||
routeCtrl = new RouteController();
|
||||
initStartAndEndDates();
|
||||
users = genericCtrl.getAllUsersByOffice(getLoggedUser().getOffice().getId());
|
||||
loanType = loanTypeCtrl.fillLoanTypeDatatable(getLoggedUser().getOffice().getId());
|
||||
route = routeCtrl.fillRoutesDatatable(getLoggedUser().getOffice().getId());
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
loadBundlePropertyFile();
|
||||
|
||||
setLoan(fillDatatableLoan());
|
||||
}
|
||||
loanCtrl = new LoanController();
|
||||
genericCtrl = new GenericController();
|
||||
loanTypeCtrl = new LoanTypeController();
|
||||
routeCtrl = new RouteController();
|
||||
initStartAndEndDates();
|
||||
users = genericCtrl.getAllUsersByOffice(getLoggedUser().getOffice().getId());
|
||||
loanType = loanTypeCtrl.fillLoanTypeDatatable(getLoggedUser().getOffice().getId());
|
||||
route = routeCtrl.fillRoutesDatatable(getLoggedUser().getOffice().getId());
|
||||
|
||||
setLoan(fillDatatableLoan());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -143,7 +143,7 @@ public class LoanPendingBean extends GenericBean implements Serializable, Datata
|
||||
Calendar fechaAct = Calendar.getInstance();
|
||||
if (fechaAct.before(calendar)) {
|
||||
Bitacora bitacora = new Bitacora();
|
||||
bitacora.setAction("Préstamo postfechado");
|
||||
bitacora.setAction("Compra de producto postfechado");
|
||||
bitacora.setCommentsUser("");
|
||||
bitacora.setCreatedBy(getLoggedUser().getUser().getId());
|
||||
bitacora.setCreatedOn(new Date());
|
||||
|
@ -43,7 +43,7 @@ public class LoanPendingDetailBean extends GenericBean implements Serializable,
|
||||
loan.setLoanType(new LoanType(typeLoanId));
|
||||
loan.setAmountToPay(loanTypeCtrl.getLoanTypeById(typeLoanId).getPaymentTotal());
|
||||
if (loanCtrl.updateLoan(loan)) {
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Cambio de tipo de préstamo", "El préstamo se cambió correctamente");
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Cambio de tipo de compra de producto", "La compra de producto se cambió correctamente");
|
||||
}
|
||||
|
||||
}
|
||||
@ -90,13 +90,13 @@ public class LoanPendingDetailBean extends GenericBean implements Serializable,
|
||||
loanCtrl.updateLoanByUserByStatus(LoanStatus.APPROVED, renovation.getLoanOld());
|
||||
}
|
||||
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Cambio de estatus", "El préstamo se cambió a estatus 'Rechazado' de forma correcta.");
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Cambio de estatus", "La compra de producto se cambió a estatus 'Rechazado' de forma correcta.");
|
||||
}
|
||||
|
||||
public void approvedLoan() {
|
||||
loanCtrl.updateLoanByStatus(LoanStatus.TO_DELIVERY, loan.getId(), getLoggedUser().getUser().getId());
|
||||
loanCtrl.updateLoanByUserByStatus(LoanStatus.TO_DELIVERY, loan);
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Cambio de estatus", "El préstamo se cambió a estatus 'A conciliar' de forma correcta.");
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Cambio de estatus", "La compra de producto se cambió a estatus 'A conciliar' de forma correcta.");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -199,11 +199,11 @@ public class PersonCustomerBean extends GenericBean implements Serializable {
|
||||
Calendar fechaAct = Calendar.getInstance();
|
||||
if (fechaAct.before(calendar)) {
|
||||
Bitacora bitacora = new Bitacora();
|
||||
bitacora.setAction("Préstamo postfechado");
|
||||
bitacora.setAction("Compra de producto postfechado");
|
||||
bitacora.setCommentsUser("");
|
||||
bitacora.setCreatedBy(getLoggedUser().getUser().getId());
|
||||
bitacora.setCreatedOn(new Date());
|
||||
bitacora.setDescription("El usuario " + userName + " postfechó el préstamo del cliente " + temp.getCustomer().getFullName()
|
||||
bitacora.setDescription("El usuario " + userName + " postfechó la compra de producto del cliente " + temp.getCustomer().getFullName()
|
||||
+ ", con cantidad de $" + temp.getLoanType().getPayment() + " al día " + temp.getCreatedOn());
|
||||
bitacora.setNameUser(getLoggedUser().getUser().getUserName());
|
||||
bitacora.setOffice(new Office(getLoggedUser().getOffice().getId()));
|
||||
@ -280,11 +280,11 @@ public class PersonCustomerBean extends GenericBean implements Serializable {
|
||||
setAutoCompleteCustomer(null);
|
||||
setAutoCompleteEndorsement(null);
|
||||
//loan = fillDatatableLoan();
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Cliente", "Se agrego el prestamo al cliente correctamente.");
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Cliente", "Se agrego la compra de producto al cliente correctamente.");
|
||||
} catch (Exception e) {
|
||||
logger.error("", e);
|
||||
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Cliente", "No se agrego el nuevo prestamos al cliente.");
|
||||
showMessage(FacesMessage.SEVERITY_INFO, "Cliente", "No se agrego la nueva compra de producto al cliente.");
|
||||
}
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -129,7 +129,7 @@ catalog.routes.datatable.empty=No hay rutas para mostrar
|
||||
catalog.routes.datatable.column.name=Nombre
|
||||
catalog.routes.dialog.title=Rutas
|
||||
catalog.routes.dialog.require.msg.color.empty=El nombre de la ruta es obligatorio
|
||||
catalog.loanTypes.datatable.empty=No hay tipos de pr\u00e9stamo para mostrar
|
||||
catalog.loanTypes.datatable.empty=No hay tipos de compra de producto para mostrar
|
||||
catalog.loanTypes.datatable.column.name=Nombre
|
||||
catalog.loanTypes.datatable.column.totalDays=Total d\u00edas
|
||||
catalog.loanTypes.datatable.column.fee=Multa
|
||||
@ -141,7 +141,7 @@ catalog.loanTypes.dialog.name.require.msg.empty=El nombre es obligatorio
|
||||
catalog.loanTypes.dialog.name.title=Nombre
|
||||
catalog.loanTypes.dialog.totalDays.require.msg.empty=El total de d\u00edas es obligatorio
|
||||
catalog.loanTypes.dialog.totalDays.title=Total de d\u00edas
|
||||
catalog.loanTypes.dialog.payment.require.msg.empty=El valor del pr\u00e9stamo es obligatorio
|
||||
catalog.loanTypes.dialog.payment.require.msg.empty=El valor de la compra de producto es obligatorio
|
||||
catalog.loanTypes.dialog.payment.title=Precio
|
||||
catalog.loanTypes.dialog.fee.require.msg.empty=El valor de la multa es obligatorio
|
||||
catalog.loanTypes.dialog.fee.title=Multa
|
||||
@ -168,7 +168,7 @@ admin.loan=Ventas
|
||||
admin.loan.to.approve=Por autorizar
|
||||
admin.loan.history=Historial
|
||||
admin.loan.historyJuridical=Historial jur\u00eddico
|
||||
admin.loan.detail.title=Detalle del pr\u00e9stamo
|
||||
admin.loan.detail.title=Detalle del compra de producto
|
||||
admin.financial=Financiero
|
||||
admin.financial.transfer=Transferencias
|
||||
admin.financial.moneyDaily=Inicios
|
||||
@ -181,7 +181,7 @@ admin.payroll.bonus=Bonos
|
||||
admin.payroll.advance=Adelantos
|
||||
admin.payroll.create=Crear n\u00f3mina
|
||||
admin.payroll.history=Historial n\u00f3mina
|
||||
admin.payroll.loanemployee=Pr\u00e9stamos
|
||||
admin.payroll.loanemployee=Compra de producto
|
||||
admin.stats.fees=Multas
|
||||
admin.stats.closingday=Corte caja chica
|
||||
admin.stats.openingfee=Comisi\u00f3n por apertura
|
||||
@ -213,7 +213,7 @@ admin.customers.datatable.column.peopleType=Tipo
|
||||
admin.customers.datatable.column.office=Sucursal
|
||||
admin.customers.detail.title=Detalle del cliente
|
||||
admin.customers.company.title=Informaci\u00f3n del negocio
|
||||
admin.customers.loan.title=Historial de pr\u00e9stamos
|
||||
admin.customers.loan.title=Historial de compra de productos
|
||||
admin.customers.detail.field.name=Nombre
|
||||
admin.customers.detail.field.firstName=Primer nombre
|
||||
admin.customers.detail.field.secondName=Segundo nombre
|
||||
@ -227,7 +227,7 @@ admin.customers.detail.field.routeCtlg=Ruta
|
||||
admin.customers.detail.field.companyName=Nombre del negocio
|
||||
admin.customers.detail.field.phoneBusiness=Tel\u00e9fono del negocio
|
||||
admin.customers.detail.field.addressBusiness=Direcci\u00f3n del negocio
|
||||
admin.customers.detail.datatable.empty=No hay pr\u00e9stamos por mostrar
|
||||
admin.customers.detail.datatable.empty=No hay compras de productos por mostrar
|
||||
admin.customers.detail.datatable.column.endorsement=Aval
|
||||
admin.customers.detail.datatable.column.loanStatus=Estatus
|
||||
admin.customers.detail.datatable.column.amountToPay=Monto a pagar
|
||||
@ -244,7 +244,7 @@ admin.endorsements.datatable.column.routeCtlg=Ruta
|
||||
admin.endorsements.datatable.column.peopleType=Tipo
|
||||
admin.endorsements.detail.title=Detalle del aval
|
||||
admin.endorsements.company.title=Informaci\u00f3n del negocio
|
||||
admin.endorsements.loan.title=Historial de pr\u00e9stamos como aval
|
||||
admin.endorsements.loan.title=Historial de compras de productos como aval
|
||||
admin.endorsements.detail.field.name=Nombre
|
||||
admin.endorsements.detail.field.birthdate=Fecha de nacimiento
|
||||
admin.endorsements.detail.field.phoneHome=Tel\u00e9fono de casa
|
||||
@ -254,7 +254,7 @@ admin.endorsements.detail.field.routeCtlg=Ruta
|
||||
admin.endorsements.detail.field.companyName=Nombre del negocio
|
||||
admin.endorsements.detail.field.phoneBusiness=Tel\u00e9fono del negocio
|
||||
admin.endorsements.detail.field.addressBusiness=Direcci\u00f3n del negocio
|
||||
admin.endorsements.detail.datatable.empty=No hay pr\u00e9stamos por mostrar
|
||||
admin.endorsements.detail.datatable.empty=No hay compras de productos por mostrar
|
||||
admin.endorsements.detail.datatable.column.customer=Cliente
|
||||
admin.endorsements.detail.datatable.column.loanStatus=Estatus
|
||||
admin.endorsements.detail.datatable.column.amountToPay=Monto a pagar
|
||||
@ -285,7 +285,7 @@ admin.people.dialog.companyName.title=Nombre del negocio
|
||||
admin.people.form.birthdate.require.msg.empty=La fecha de nacimiento es obligatorio
|
||||
admin.people.dialog.birthdate.title=Fecha de nacimiento
|
||||
admin.people.form.route.require.msg.empty=La ruta es obligatoria
|
||||
admin.loans.datatable.empty=No hay pr\u00e9stamos por mostrar.
|
||||
admin.loans.datatable.empty=No hay compras de productos por mostrar.
|
||||
admin.loans.datatable.column.customer=Cliente
|
||||
admin.loans.datatable.column.routeCtlg=Ruta
|
||||
admin.loans.datatable.column.endorsement=Aval
|
||||
|
@ -13,7 +13,7 @@ validators.password=Contrase\u00f1a no v\u00e1lida.
|
||||
validator.select.one.menu.invalid.option=Opci\u00f3n no v\u00e1lida.
|
||||
user=Usuario
|
||||
employee=Empleado
|
||||
loanType=Tipo de pr\u00e9stamo
|
||||
loanType=Tipo de compra de producto
|
||||
people=Persona
|
||||
prmssn.update.title=Actualizaci\u00f3n de Permisos
|
||||
prmssn.add.true=Se asignaron los permisos al usuario.
|
||||
|
@ -114,13 +114,13 @@ catalog.typeLoan.add=Crear producto
|
||||
catalog.typeLoan.add.description=Men\u00fa de productos.
|
||||
catalog.typeLoan.add.path=Cat\u00e1logo / Producto (crear)
|
||||
|
||||
catalog.typeLoan.updated=Editar tipo de pr\u00e9stamos
|
||||
catalog.typeLoan.updated.description=Permite editar tipo de pr\u00e9stamos.
|
||||
catalog.typeLoan.updated.path=Cat\u00e1logo / Tipo de pr\u00e9stamos (editar)
|
||||
catalog.typeLoan.updated=Editar tipo de compra de producto
|
||||
catalog.typeLoan.updated.description=Permite editar tipo de compra de producto.
|
||||
catalog.typeLoan.updated.path=Cat\u00e1logo / Tipo de compra de producto (editar)
|
||||
|
||||
catalog.typeLoan.deleted=Eliminar tipo de pr\u00e9stamos
|
||||
catalog.typeLoan.deleted.description=Permite eliminar tipo de pr\u00e9stamos.
|
||||
catalog.typeLoan.deleted.path=Cat\u00e1logo / Tipo de pr\u00e9stamos (eliminar)
|
||||
catalog.typeLoan.deleted=Eliminar tipo de compra de producto
|
||||
catalog.typeLoan.deleted.description=Permite eliminar tipo de compra de producto.
|
||||
catalog.typeLoan.deleted.path=Cat\u00e1logo / Tipo de compra de producto (eliminar)
|
||||
#Rutas
|
||||
catalog.route=Rutas
|
||||
catalog.route.description=Men\u00fa de rutas.
|
||||
@ -170,29 +170,29 @@ admin.endorsement.deleted=Eliminar avales
|
||||
admin.endorsement.deleted.description=Permite eliminar avales.
|
||||
admin.endorsement.deleted.path=Administraci\u00f3n / Avales (eliminar)
|
||||
#Prestamos
|
||||
admin.loan=Pr\u00e9stamos
|
||||
admin.loan.description=Men\u00fa de pr\u00e9stamos.
|
||||
admin.loan.path=Administraci\u00f3n / Pr\u00e9stamos
|
||||
admin.loan=Compra de producto
|
||||
admin.loan.description=Men\u00fa de compra de productos.
|
||||
admin.loan.path=Administraci\u00f3n / Compra de producto
|
||||
|
||||
admin.loan.add=Crear pr\u00e9stamos
|
||||
admin.loan.add.description=Men\u00fa de pr\u00e9stamos.
|
||||
admin.loan.add.path=Administraci\u00f3n / Pr\u00e9stamos (crear)
|
||||
admin.loan.add=Crear compra de producto
|
||||
admin.loan.add.description=Men\u00fa de compra de producto.
|
||||
admin.loan.add.path=Administraci\u00f3n / Compra de producto (crear)
|
||||
|
||||
admin.loan.updated=Editar pr\u00e9stamos
|
||||
admin.loan.updated.description=Permite editar pr\u00e9stamos.
|
||||
admin.loan.updated.path=Administraci\u00f3n / Pr\u00e9stamos (editar)
|
||||
admin.loan.updated=Editar compra de producto
|
||||
admin.loan.updated.description=Permite editar compras de producto.
|
||||
admin.loan.updated.path=Administraci\u00f3n / Compra de producto (editar)
|
||||
|
||||
admin.loan.deleted=Eliminar pr\u00e9stamos
|
||||
admin.loan.deleted.description=Permite eliminar pr\u00e9stamos.
|
||||
admin.loan.deleted.path=Administraci\u00f3n / Pr\u00e9stamos (eliminar)
|
||||
admin.loan.deleted=Eliminar compra de producto
|
||||
admin.loan.deleted.description=Permite eliminar compras de producto.
|
||||
admin.loan.deleted.path=Administraci\u00f3n / Compra de producto (eliminar)
|
||||
|
||||
admin.loan.change.owner=Cambiar asesor
|
||||
admin.loan.change.owner.description=Submen\u00fa cambiar asesor.
|
||||
admin.loan.change.owner.path=Administraci\u00f3n / Pr\u00e9stamos / Cambiar asesor
|
||||
admin.loan.change.owner.path=Administraci\u00f3n / Compras de producto / Cambiar asesor
|
||||
|
||||
admin.loan.change.owner.update=Cambiar prestamo asesor
|
||||
admin.loan.change.owner.update.description=Permite cambiar el prestamo de asesor origen para el asesor destino.
|
||||
admin.loan.change.owner.update.path=Administraci\u00f3n / Pr\u00e9stamos / Cambiar asesor (bot\u00f3n cambiar asesor)
|
||||
admin.loan.change.owner.update=Cambiar compra de producto asesor
|
||||
admin.loan.change.owner.update.description=Permite cambiar la compra de producto de asesor origen para el asesor destino.
|
||||
admin.loan.change.owner.update.path=Administraci\u00f3n / Compras de producto / Cambiar asesor (bot\u00f3n cambiar asesor)
|
||||
#Transferencias
|
||||
admin.transfer=Transferencias
|
||||
admin.transfer.description=Men\u00fa de transferencias.
|
||||
|
@ -272,7 +272,7 @@
|
||||
rendered="#{loginBean.isUserInRole('admin.stableGeneralBox')}"/>
|
||||
<p:menuitem
|
||||
id="admin_payroll_loan_employee"
|
||||
value="Préstamos a empleados"
|
||||
value="Compra de producto a empleados"
|
||||
icon="description"
|
||||
outcome="#{i18n['outcome.payroll.loanemployee']}"
|
||||
/>
|
||||
|
@ -174,7 +174,7 @@
|
||||
autocomplete="off" disabled="true"
|
||||
>
|
||||
</p:inputText>
|
||||
<label>Préstamos sin acción</label>
|
||||
<label>Compra de producto sin acción</label>
|
||||
</h:panelGroup>
|
||||
<h:panelGroup styleClass="md-inputfield">
|
||||
<p:inputText id="comentarios"
|
||||
@ -300,7 +300,7 @@
|
||||
disabled="true">
|
||||
<f:convertNumber pattern="¤#,##0.00" locale="en_US" currencySymbol="$" />
|
||||
</p:inputText>
|
||||
<label>Total entrega de prestamos</label>
|
||||
<label>Total entrega de compras de productos</label>
|
||||
</h:panelGroup>
|
||||
<h:panelGroup styleClass="md-inputfield">
|
||||
<p:inputText id="total_totalOtherExpense"
|
||||
|
@ -52,7 +52,7 @@
|
||||
<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="dtCustomer" trigger="toggler" />
|
||||
<p:commandButton type="button" value="Agregar préstamo" styleClass="amber-btn flat" style="float: right;" icon="ui-icon-plus" onclick="PF('dlg3').show();" rendered="#{loginBean.isUserInRole('admin.loan.add')}"/>
|
||||
<p:commandButton type="button" value="Agregar compra de producto" styleClass="amber-btn flat" style="float: right;" icon="ui-icon-plus" onclick="PF('dlg3').show();" rendered="#{loginBean.isUserInRole('admin.loan.add')}"/>
|
||||
<p:commandButton type="button" value="Agregar cliente/aval" styleClass="amber-btn flat" style="float: right;" icon="ui-icon-plus" onclick="PF('dlg4').show();" rendered="#{loginBean.isUserInRole('admin.customer.add')}"/>
|
||||
</f:facet>
|
||||
|
||||
@ -139,7 +139,7 @@
|
||||
|
||||
<h:form id="loanForm">
|
||||
<p:growl id="msgsDialog2" showDetail="true"/>
|
||||
<p:dialog widgetVar="dlg3" width="30%" id="loanDialog" header="Nuevo préstamo" modal="true" responsive="true" showEffect="clip" hideEffect="clip">
|
||||
<p:dialog widgetVar="dlg3" width="30%" id="loanDialog" header="Nueva compra de producto" modal="true" responsive="true" showEffect="clip" hideEffect="clip">
|
||||
<br></br>
|
||||
<h:panelGroup id="dateStableBox" styleClass="md-inputfield">
|
||||
<p:calendar id="createdOn"
|
||||
@ -164,7 +164,7 @@
|
||||
value="#{personCustomerBean.loanTypeId}"
|
||||
id="loanTypeSearch" required="true"
|
||||
requiredMessage="#{i18n['admin.loan.form.typeLoan.require.msg.empty']}">
|
||||
<f:selectItem itemLabel="Selecciona un tipo de préstamo.." itemValue="" />
|
||||
<f:selectItem itemLabel="Selecciona un tipo de compra de producto.." itemValue="" />
|
||||
<f:selectItems value="#{personCustomerBean.loanType}" var="loanType" itemLabel="#{loanType.loanTypeName}" itemValue="#{loanType.id}" />
|
||||
<p:ajax listener="#{personCustomerBean.calculationFunction}"
|
||||
update="calculation">
|
||||
|
@ -29,7 +29,7 @@
|
||||
<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="dtCustomer" trigger="toggler" />
|
||||
<p:commandButton type="button" value="Agregar préstamo" styleClass="amber-btn flat" style="float: right;" icon="ui-icon-plus" onclick="PF('dlg3').show();" rendered="#{loginBean.isUserInRole('admin.loan.add')}"/>
|
||||
<p:commandButton type="button" value="Agregar compra de producto" styleClass="amber-btn flat" style="float: right;" icon="ui-icon-plus" onclick="PF('dlg3').show();" rendered="#{loginBean.isUserInRole('admin.loan.add')}"/>
|
||||
<p:commandButton type="button" value="Agregar cliente/aval" styleClass="amber-btn flat" style="float: right;" icon="ui-icon-plus" onclick="PF('dlg4').show();" rendered="#{loginBean.isUserInRole('admin.customer.add')}"/>
|
||||
|
||||
<p:outputPanel>
|
||||
@ -63,7 +63,7 @@
|
||||
<p:column headerText="#{i18n['admin.customers.datatable.column.office']}" sortBy="#{customer.office.officeName}" filterBy="#{customer.office.officeName}">
|
||||
<h:outputText value="#{customer.office.officeName}" />
|
||||
</p:column>
|
||||
<p:column headerText="Total préstamos" sortBy="#{customer.totalLoan}" filterBy="#{customer.totalLoan}">
|
||||
<p:column headerText="Total compras de producto" sortBy="#{customer.totalLoan}" filterBy="#{customer.totalLoan}">
|
||||
<h:outputText value="#{customer.totalLoan}" />
|
||||
</p:column>
|
||||
-
|
||||
@ -113,7 +113,7 @@
|
||||
|
||||
<h:form id="loanForm">
|
||||
<p:growl id="msgsDialog2" showDetail="true"/>
|
||||
<p:dialog widgetVar="dlg3" width="30%" id="loanDialog" header="Nuevo préstamo" modal="true" responsive="true" showEffect="clip" hideEffect="clip">
|
||||
<p:dialog widgetVar="dlg3" width="30%" id="loanDialog" header="Nueva compra de producto" modal="true" responsive="true" showEffect="clip" hideEffect="clip">
|
||||
<br></br>
|
||||
<h:panelGroup id="dateStableBox" styleClass="md-inputfield">
|
||||
<p:calendar id="createdOn"
|
||||
@ -138,7 +138,7 @@
|
||||
value="#{loanPendingManager.loanTypeId}"
|
||||
id="loanTypeSearch" required="true"
|
||||
requiredMessage="#{i18n['admin.loan.form.typeLoan.require.msg.empty']}">
|
||||
<f:selectItem itemLabel="Selecciona un tipo de préstamo.." itemValue="" />
|
||||
<f:selectItem itemLabel="Selecciona un tipo de compra de producto.." itemValue="" />
|
||||
<f:selectItems value="#{loanPendingManager.loanType}" var="loanType" itemLabel="#{loanType.loanTypeName}" itemValue="#{loanType.id}" />
|
||||
<p:ajax listener="#{loanPendingManager.calculationFunction}"
|
||||
update="calculation">
|
||||
|
@ -451,7 +451,7 @@
|
||||
|
||||
</div>
|
||||
</p:tab>
|
||||
<p:tab title="Información del préstamo" id="refrescarPrestamo">
|
||||
<p:tab title="Información de la compra de producto" id="refrescarPrestamo">
|
||||
<div class="ui-g ui-fluid">
|
||||
<div class="ui-g-12">
|
||||
<div class="ui-g-3"></div>
|
||||
@ -461,7 +461,7 @@
|
||||
<h:form id="createHRForm">
|
||||
<!-- TITLE for this FORM-->
|
||||
<p:messages id="messages" severity="info, fatal, warn" closable="true" showSummary="true" showDetail="true"/>
|
||||
<h4>Préstamo</h4>
|
||||
<h4>Compra de producto</h4>
|
||||
|
||||
<!-- CONTENT for this FORM-->
|
||||
<p:panelGrid columns="3" layout="grid" styleClass="ui-panelgrid-blank form-group">
|
||||
@ -555,7 +555,7 @@
|
||||
|
||||
<br></br>
|
||||
<br></br>
|
||||
<h2>Modificar el tipo de préstamo</h2>
|
||||
<h2>Modificar el tipo de compra de producto</h2>
|
||||
<p:panelGrid columns="2" layout="grid" styleClass="ui-panelgrid-blank form-group">
|
||||
<h:panelGroup styleClass="md-inputfield">
|
||||
<p:selectOneMenu style="width:100%"
|
||||
@ -563,7 +563,7 @@
|
||||
filterMatchMode="contains"
|
||||
value="#{loanPendingDetailManager.typeLoanId}"
|
||||
id="typeLoan" >
|
||||
<f:selectItem itemLabel="Selecciona un tipo de préstamo.." itemValue="" />
|
||||
<f:selectItem itemLabel="Selecciona un tipo de compra de producto.." itemValue="" />
|
||||
<f:selectItems value="#{loanPendingDetailManager.loanType}" var="loanType" itemLabel="#{loanType.loanTypeName}" itemValue="#{loanType.id}" />
|
||||
</p:selectOneMenu>
|
||||
<p:message for="typeLoan" display="text"/>
|
||||
|
@ -500,7 +500,7 @@
|
||||
</p:dataTable>
|
||||
</h:form>
|
||||
|
||||
<h1>Préstamos enviados a Cobranza</h1>
|
||||
<h1>Compras de producto enviados a Cobranza</h1>
|
||||
<h:form id="form5">
|
||||
<p:dataTable widgetVar="dtCobranza" id="dtCobranza" var="cobranza" value="#{driverManager.dataCobranza}" rowsPerPageTemplate="5,10,25,50,100,500,1000" emptyMessage="Sin registros"
|
||||
rowKey="#{cobranza.id}" selection="#{driverManager.selectedCobranza}" expandableRowGroups="true" paginator="true" rows="10" paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}">
|
||||
@ -803,7 +803,7 @@
|
||||
<h:outputText value="#{resumen.newCustomer}" >
|
||||
</h:outputText>
|
||||
</p:column>
|
||||
<p:column headerText="Total préstamos" sortBy="#{resumen.totalNewCustomer}" filterBy="#{resumen.totalNewCustomer}">
|
||||
<p:column headerText="Total compras de producto" sortBy="#{resumen.totalNewCustomer}" filterBy="#{resumen.totalNewCustomer}">
|
||||
<h:outputText value="#{resumen.totalNewCustomer}" >
|
||||
<f:convertNumber pattern="¤#,##0.00" locale="en_US" currencySymbol="$" />
|
||||
</h:outputText>
|
||||
|
@ -296,7 +296,7 @@
|
||||
|
||||
<p:row>
|
||||
<p:column colspan="1" class="ui-paginator ui-paginator-top ui-widget-header">Cantidad Pagada Actual</p:column>
|
||||
<p:column colspan="1" class="ui-paginator ui-paginator-top ui-widget-header">Tipo de Prestamo</p:column>
|
||||
<p:column colspan="1" class="ui-paginator ui-paginator-top ui-widget-header">Tipo de Compra de producto</p:column>
|
||||
<p:column colspan="1" class="ui-paginator ui-paginator-top ui-widget-header">Abono Diario</p:column>
|
||||
<p:column colspan="1" class="ui-paginator ui-paginator-top ui-widget-header">Comisión por Apertura</p:column>
|
||||
<p:column colspan="1" class="ui-paginator ui-paginator-top ui-widget-header">Cliente Nuevo</p:column>
|
||||
@ -681,7 +681,7 @@
|
||||
</p:dataTable>
|
||||
</h:form>
|
||||
|
||||
<h1>Préstamos enviados a Cobranza</h1>
|
||||
<h1>Compras de producto enviados a Cobranza</h1>
|
||||
<h:form id="form5">
|
||||
<p:dataTable widgetVar="dtCobranza" id="dtCobranza" var="cobranza" value="#{driverDateManager.dataCobranza}" rowsPerPageTemplate="5,10,25,50,100,500,1000" emptyMessage="Sin registros"
|
||||
rowKey="#{cobranza.id}" selection="#{driverDateManager.selectedCobranza}" expandableRowGroups="true" paginator="true" rows="10" paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}">
|
||||
|
@ -496,7 +496,7 @@
|
||||
</p:dataTable>
|
||||
</h:form>
|
||||
|
||||
<h1>Préstamos enviados a Cobranza</h1>
|
||||
<h1>Compras de producto enviados a Cobranza</h1>
|
||||
<h:form id="form5">
|
||||
<p:dataTable widgetVar="dtCobranza" id="dtCobranza" var="cobranza" value="#{driverLastManager.dataCobranza}" rowsPerPageTemplate="5,10,25,50,100,500,1000" emptyMessage="Sin registros"
|
||||
rowKey="#{cobranza.id}" selection="#{driverLastManager.selectedCobranza}" expandableRowGroups="true" paginator="true" rows="10" paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}">
|
||||
@ -799,7 +799,7 @@
|
||||
<h:outputText value="#{resumen.newCustomer}" >
|
||||
</h:outputText>
|
||||
</p:column>
|
||||
<p:column headerText="Total préstamos" sortBy="#{resumen.totalNewCustomer}" filterBy="#{resumen.totalNewCustomer}">
|
||||
<p:column headerText="Total compras de producto" sortBy="#{resumen.totalNewCustomer}" filterBy="#{resumen.totalNewCustomer}">
|
||||
<h:outputText value="#{resumen.totalNewCustomer}" >
|
||||
<f:convertNumber pattern="¤#,##0.00" locale="en_US" currencySymbol="$" />
|
||||
</h:outputText>
|
||||
|
@ -133,7 +133,7 @@
|
||||
|
||||
<p:contextMenu for="dtLoan">
|
||||
<p:menuitem value="Ver detalles" ajax="false" rendered="#{loanHistoryManager.loan.size() > 0}" icon="ui-icon-book" action="#{loanHistoryManager.detailLoan(i18n['outcome.admin.loan.history.detail'])}" />
|
||||
<p:menuitem value="Cambiar préstamo" rendered="#{loanHistoryManager.loan.size() > 0}" icon="ui-icon-edit" onclick="PF('dlg5').show();" update="dtLoan,:form:msgs" />
|
||||
<p:menuitem value="Cambiar compra de producto" rendered="#{loanHistoryManager.loan.size() > 0}" icon="ui-icon-edit" onclick="PF('dlg5').show();" update="dtLoan,:form:msgs" />
|
||||
<p:menuitem value="Cambiar ruta" rendered="#{loanHistoryManager.loan.size() > 0}" icon="ui-icon-edit" onclick="PF('dlg6').show();" update="dtLoan,:form:msgs" />
|
||||
|
||||
<p:menuitem rendered="#{loginBean.isUserInRole('admin.loan.updated')}" value="Bono cliente nuevo" update="dtLoan,:form:msgs" icon="ui-icon-check" actionListener="#{loanHistoryManager.changeBonusNewCustomer()}">
|
||||
@ -250,7 +250,7 @@
|
||||
|
||||
<h:form id="loanForm4">
|
||||
<p:growl id="msgsDialog4" showDetail="true"/>
|
||||
<p:dialog widgetVar="dlg5" width="30%" id="loanDialog4" header="Modificar monto a prestar" modal="true" responsive="true" showEffect="clip" hideEffect="clip">
|
||||
<p:dialog widgetVar="dlg5" width="30%" id="loanDialog4" header="Modificar monto a pagar" modal="true" responsive="true" showEffect="clip" hideEffect="clip">
|
||||
<br></br>
|
||||
<h:panelGroup styleClass="md-inputfield" >
|
||||
<p:selectOneMenu style="width:100%"
|
||||
@ -258,8 +258,8 @@
|
||||
filterMatchMode="contains"
|
||||
value="#{loanHistoryManager.loanTypeId}"
|
||||
id="userSearch4" required="true"
|
||||
requiredMessage="El tipo de préstamo es obligatorio">
|
||||
<f:selectItem itemLabel="Selecciona un tipo de prestamo.." itemValue="" />
|
||||
requiredMessage="El tipo de compra de producto es obligatorio">
|
||||
<f:selectItem itemLabel="Selecciona un tipo de compra de producto.." itemValue="" />
|
||||
<f:selectItems value="#{loanHistoryManager.loanType}" var="loanType" itemLabel="#{loanType.loanTypeName}" itemValue="#{loanType.id}" />
|
||||
</p:selectOneMenu>
|
||||
<p:message for="userSearch4" display="text"/>
|
||||
|
@ -437,7 +437,7 @@
|
||||
|
||||
</div>
|
||||
</p:tab>
|
||||
<p:tab title="Información del préstamo" id="refrescarPrestamo">
|
||||
<p:tab title="Información de la compra de producto" id="refrescarPrestamo">
|
||||
<div class="ui-g ui-fluid">
|
||||
<div class="ui-g-12">
|
||||
<div class="ui-g-3"></div>
|
||||
@ -447,7 +447,7 @@
|
||||
<h:form id="createHRForm">
|
||||
<!-- TITLE for this FORM-->
|
||||
<p:messages id="messages" severity="info, fatal, warn" closable="true" showSummary="true" showDetail="true"/>
|
||||
<h4>Préstamo</h4>
|
||||
<h4>Compra de producto</h4>
|
||||
|
||||
<!-- CONTENT for this FORM-->
|
||||
<p:panelGrid columns="3" layout="grid" styleClass="ui-panelgrid-blank form-group">
|
||||
|
@ -64,7 +64,7 @@
|
||||
<h:outputText value="Total Colocación" />
|
||||
</f:facet>
|
||||
</p:column>
|
||||
<p:column headerText="Cantidad Prestada" sortBy="#{loan.amountLoan}" filterBy="#{loan.amountLoan}">
|
||||
<p:column headerText="Cantidad a pagar" sortBy="#{loan.amountLoan}" filterBy="#{loan.amountLoan}">
|
||||
<h:outputText value="#{loan.amountLoan}">
|
||||
<f:convertNumber pattern="¤#,##0.00" locale="en_US" currencySymbol="$" />
|
||||
</h:outputText>
|
||||
|
@ -5,7 +5,7 @@
|
||||
xmlns:p="http://primefaces.org/ui"
|
||||
xmlns:fn="http://java.sun.com/jsp/jstl/functions"
|
||||
template="/WEB-INF/template.xhtml">
|
||||
<ui:define name="title">Préstamos a empleados</ui:define>
|
||||
<ui:define name="title">Compras de producto a empleados</ui:define>
|
||||
<ui:define name="head">
|
||||
<h:outputScript library="js" name="scriptGeneric/dialogGeneric.js" />
|
||||
<h:outputScript library="js" name="scriptGeneric/bitacora.js" />
|
||||
@ -13,14 +13,14 @@
|
||||
<ui:define name="breadcrumb">
|
||||
<li>#{grant['admin.name']}</li>
|
||||
<li>/</li>
|
||||
<li><p:link outcome="#{i18n['outcome.payroll.loanemployee']}">Préstamos empleados</p:link></li>
|
||||
<li><p:link outcome="#{i18n['outcome.payroll.loanemployee']}">Compras de producto empleados</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>Préstamos de empleados</h1>
|
||||
<h1>Compras de producto de empleados</h1>
|
||||
<h:form id="loanEmployeeForm">
|
||||
<p:growl id="msgs" showDetail="true"/>
|
||||
|
||||
@ -54,7 +54,7 @@
|
||||
/>
|
||||
|
||||
<p:outputPanel style="float: right; padding-right: 5px;">
|
||||
<h:outputText value="Total préstamos " />
|
||||
<h:outputText value="Total compras de producto " />
|
||||
<p:inputText readonly="true"
|
||||
id="totalAmountLoan"
|
||||
style="width:150px;color: #000000;"
|
||||
@ -89,7 +89,7 @@
|
||||
<h:outputText styleClass="#{loanemployee.conditionEnabled()}" value="#{loanemployee.name}" />
|
||||
</p:column>
|
||||
|
||||
<p:column headerText="Préstamo" sortBy="#{loanemployee.amountLoan}" filterBy="#{loanemployee.amountLoan}">
|
||||
<p:column headerText="Compra de producto" sortBy="#{loanemployee.amountLoan}" filterBy="#{loanemployee.amountLoan}">
|
||||
<h:outputText styleClass="#{loanemployee.conditionEnabled()}" value="#{loanemployee.amountLoan}" />
|
||||
</p:column>
|
||||
|
||||
@ -175,7 +175,7 @@
|
||||
<h:form id="bitacoraForm">
|
||||
<p:growl id="msgsDialogBitacora" showDetail="true"/>
|
||||
<p:dialog widgetVar="deleteEventBitacora" width="30%"
|
||||
id="deleteEventBitacora" header="Eliminar prestamo a empleado"
|
||||
id="deleteEventBitacora" header="Eliminar compra de producto a empleado"
|
||||
modal="true" responsive="true"
|
||||
showEffect="clip" hideEffect="clip">
|
||||
<br></br>
|
||||
@ -202,7 +202,7 @@
|
||||
|
||||
<h:form id="loanForm">
|
||||
<p:growl id="msgsDialog" showDetail="true"/>
|
||||
<p:dialog widgetVar="dlg2" width="30%" id="loanDialog" header="Nuevo préstamo" modal="true" responsive="true" showEffect="clip" hideEffect="clip">
|
||||
<p:dialog widgetVar="dlg2" width="30%" id="loanDialog" header="Nueva compra de producto" modal="true" responsive="true" showEffect="clip" hideEffect="clip">
|
||||
<br></br>
|
||||
<h:panelGroup styleClass="md-inputfield" >
|
||||
<p:selectOneMenu style="width:100%"
|
||||
@ -222,7 +222,7 @@
|
||||
<p:inputText id="totalLoan" value="#{loanEmployeeListBean.amountLoan}" required="true"
|
||||
requiredMessage="#{i18n['admin.loan.form.user.require.msg.empty']}" autocomplete="off" style="width: 100%;">
|
||||
</p:inputText>
|
||||
<label>Monto del préstamo</label>
|
||||
<label>Monto de la compra de producto</label>
|
||||
<p:message for="totalLoan" display="text"/>
|
||||
</h:panelGroup>
|
||||
<br></br>
|
||||
@ -241,7 +241,7 @@
|
||||
|
||||
<h:form id="loanFormDetail">
|
||||
<p:growl id="msgsDialog" showDetail="true"/>
|
||||
<p:dialog widgetVar="dlg3" width="30%" id="loanDialog" header="Abono a préstamo" modal="true" responsive="true" showEffect="clip" hideEffect="clip">
|
||||
<p:dialog widgetVar="dlg3" width="30%" id="loanDialog" header="Abono a compra de producto" modal="true" responsive="true" showEffect="clip" hideEffect="clip">
|
||||
<br></br>
|
||||
<h:panelGroup styleClass="md-inputfield" >
|
||||
<p:inputNumber id="loanDetailAmount" value="#{loanEmployeeListBean.loanDetailAmount}" required="true" requiredMessage="El monto es obligatorio" autocomplete="off" style="width: 100%;">
|
||||
|
@ -126,7 +126,7 @@
|
||||
<p:menuitem rendered="#{dashboardManager.getAction()}" value="Agregar abono" icon="ui-icon-check" onclick="PF('dlg3').show();" update="dtLoan,:dashboardResumen:msgs"/>
|
||||
<p:menuitem value="Agregar depósito" icon="ui-icon-check" onclick="PF('dlg7').show();" update="dtLoan,:dashboardResumen:msgs"/>
|
||||
<p:menuitem rendered="#{dashboardManager.getAction()}" value="Agregar multa" icon="ui-icon-close" onclick="PF('dlg4').show();" update="dtLoan,:dashboardResumen:msgs" />
|
||||
<p:menuitem value="Cambiar préstamo" icon="ui-icon-edit" onclick="PF('dlg5').show();" update="dtLoan,:dashboardResumen:msgs" />
|
||||
<p:menuitem value="Cambiar compra de producto" icon="ui-icon-edit" onclick="PF('dlg5').show();" update="dtLoan,:dashboardResumen:msgs" />
|
||||
<p:menuitem value="Cambiar ruta" icon="ui-icon-edit" onclick="PF('dlg6').show();" update="dtLoan,:dashboardResumen:msgs" />
|
||||
<p:menuitem rendered="#{loginBean.isUserInRole('admin.loan.deleted') and dashboardManager.getAction()}" onclick="PF('dlg9').show();" value="Borrar abono del día" update="dtLoan,:dashboardResumen:msgs" icon="ui-icon-remove">
|
||||
<p:confirm message="#{i18n['general.confirm.confirm']}" />
|
||||
@ -246,6 +246,59 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ui-g-12">
|
||||
<div class="card">
|
||||
<p:carousel value="#{dashboardManager.advances}" headerText="Avance del día" var="advances" itemStyle="text-align:center" responsive="true">
|
||||
<p:panelGrid columns="2" style="width:100%;margin:10px 0px" columnClasses="label,value" layout="grid" styleClass="ui-panelgrid-blank">
|
||||
|
||||
<h:outputText value="Asesor" style="font-weight: bold;"/>
|
||||
<h:outputText value="#{advances.userName}" />
|
||||
|
||||
<h:outputText value="Clientes por visitar" style="font-weight: bold;"/>
|
||||
<h:outputText value="#{advances.totalExpected}" />
|
||||
|
||||
<h:outputText value="Clientes visitados" style="font-weight: bold;"/>
|
||||
<h:outputText value="#{advances.totalNow}"/>
|
||||
|
||||
<h:outputText value="Porcentaje de visita" style="font-weight: bold;"/>
|
||||
<h:outputText value="#{advances.porcentaje}" >
|
||||
<f:convertNumber pattern="¤#,##0.00" locale="en_US" currencySymbol="%" />
|
||||
</h:outputText>
|
||||
|
||||
<h:outputText value="Cobro esperado por semana" style="font-weight: bold;"/>
|
||||
<h:outputText value="#{advances.totalExpectedWeek}" >
|
||||
<f:convertNumber pattern="¤#,##0.00" locale="en_US" currencySymbol="$" />
|
||||
</h:outputText>
|
||||
|
||||
<h:outputText value="Total cobrado por semana" style="font-weight: bold;"/>
|
||||
<h:outputText value="#{advances.totalReportedWeek}" >
|
||||
<f:convertNumber pattern="¤#,##0.00" locale="en_US" currencySymbol="$" />
|
||||
</h:outputText>
|
||||
|
||||
<h:outputText value="Faltante" style="font-weight: bold;"/>
|
||||
<h:outputText value="#{advances.faltante}" >
|
||||
<f:convertNumber pattern="¤#,##0.00" locale="en_US" currencySymbol="$" />
|
||||
</h:outputText>
|
||||
|
||||
<h:outputText value="Porcentaje" style="font-weight: bold;"/>
|
||||
<h:outputText value="#{advances.porcentajePaymentWeek}" >
|
||||
<f:convertNumber pattern="¤#,##0.00" locale="en_US" currencySymbol="%" />
|
||||
</h:outputText>
|
||||
|
||||
<h:outputText value="Préstamos colocados aprobados" style="font-weight: bold;"/>
|
||||
<h:outputText value="#{advances.colocationApproved}" >
|
||||
<f:convertNumber pattern="¤#,##0.00" locale="en_US" currencySymbol="$" />
|
||||
</h:outputText>
|
||||
|
||||
<h:outputText value="Préstamos colocados por liberar" style="font-weight: bold;"/>
|
||||
<h:outputText value="#{advances.colocationToDelivery}" >
|
||||
<f:convertNumber pattern="¤#,##0.00" locale="en_US" currencySymbol="$" />
|
||||
</h:outputText>
|
||||
</p:panelGrid>
|
||||
</p:carousel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</h:form>
|
||||
|
||||
<h:form id="loanForm">
|
||||
@ -355,7 +408,7 @@
|
||||
filterMatchMode="contains"
|
||||
value="#{dashboardManager.loanTypeId}"
|
||||
id="userSearch4" required="true"
|
||||
requiredMessage="El tipo de préstamo es obligatorio">
|
||||
requiredMessage="El tipo de compra de producto es obligatorio">
|
||||
<f:selectItem itemLabel="Selecciona un tipo de venta.." itemValue="" />
|
||||
<f:selectItems value="#{dashboardManager.loanType}" var="loanType" itemLabel="#{loanType.loanTypeName}" itemValue="#{loanType.id}" />
|
||||
</p:selectOneMenu>
|
||||
@ -437,7 +490,7 @@
|
||||
|
||||
<h:form id="bitacoraForm">
|
||||
<p:growl id="msgsDialogBitacora" showDetail="true"/>
|
||||
<p:dialog widgetVar="dlg8" width="30%" id="loanDialogBitacora" header="Eliminar préstamo" modal="true" responsive="true" showEffect="clip" hideEffect="clip">
|
||||
<p:dialog widgetVar="dlg8" width="30%" id="loanDialogBitacora" header="Eliminar compra de producto" modal="true" responsive="true" showEffect="clip" hideEffect="clip">
|
||||
<br></br>
|
||||
<h:panelGroup styleClass="md-inputfield" >
|
||||
<p:inputText id="commentsBitacora" value="#{dashboardManager.commentsBitacora}" autocomplete="off" style="width: 100%;">
|
||||
|
@ -444,7 +444,7 @@
|
||||
|
||||
</div>
|
||||
</p:tab>
|
||||
<p:tab title="Información del préstamo" id="refrescarPrestamo">
|
||||
<p:tab title="Información de la compra de producto" id="refrescarPrestamo">
|
||||
<div class="ui-g ui-fluid">
|
||||
<div class="ui-g-12">
|
||||
<div class="ui-g-3"></div>
|
||||
@ -454,7 +454,7 @@
|
||||
<h:form id="createHRForm">
|
||||
<!-- TITLE for this FORM-->
|
||||
<p:messages id="messages" severity="info, fatal, warn" closable="true" showSummary="true" showDetail="true"/>
|
||||
<h4>Préstamo</h4>
|
||||
<h4>Compra de producto</h4>
|
||||
|
||||
<!-- CONTENT for this FORM-->
|
||||
<p:panelGrid columns="3" layout="grid" styleClass="ui-panelgrid-blank form-group">
|
||||
|
@ -438,7 +438,7 @@
|
||||
|
||||
</div>
|
||||
</p:tab>
|
||||
<p:tab title="Información del préstamo" id="refrescarPrestamo">
|
||||
<p:tab title="Información de la compra de producto" id="refrescarPrestamo">
|
||||
<div class="ui-g ui-fluid">
|
||||
<div class="ui-g-12">
|
||||
<div class="ui-g-3"></div>
|
||||
@ -448,7 +448,7 @@
|
||||
<h:form id="createHRForm">
|
||||
<!-- TITLE for this FORM-->
|
||||
<p:messages id="messages" severity="info, fatal, warn" closable="true" showSummary="true" showDetail="true"/>
|
||||
<h4>Préstamo</h4>
|
||||
<h4>Compra de producto</h4>
|
||||
|
||||
<!-- CONTENT for this FORM-->
|
||||
<p:panelGrid columns="3" layout="grid" styleClass="ui-panelgrid-blank form-group">
|
||||
|
Loading…
Reference in New Issue
Block a user