- DASHBOARD - AGREGAR TABLA "Detalle de avance del día por asesor"

- VENTAS - POR AUTORIZAR - AL APROBAR PASAR DIRECTAMENTE AL ESTATUS DE 'AUTORIZADA'
- ADMINISTRACIÓN - CAJA CHICA - CORTE DÍA - AJUSTAR PARA QUE TOME EN CUENTA LOS MOVIMIENTOS A PARTIR DEL ÚLTIMO CORTE
This commit is contained in:
Brayan.Gonzalez 2025-06-23 19:11:38 -06:00
parent ecf4937bb6
commit 63cf262e38
14 changed files with 2229 additions and 1796 deletions

View File

@ -73,11 +73,13 @@
<mapping class="com.arrebol.apc.model.views.LoanToDeliveryByCertifierView"/>
<mapping class="com.arrebol.apc.model.views.ExchangeEnebledUsersView"/>
<mapping class="com.arrebol.apc.model.views.TotalCashByCurdateView"/>
<mapping class="com.arrebol.apc.model.views.TotalCashByLastClosingDayView"/>
<mapping class="com.arrebol.apc.model.views.PersonSearchHistoricalDetailsView"/>
<mapping class="com.arrebol.apc.model.views.TotalClosingDayByCurdateView"/>
<mapping class="com.arrebol.apc.model.views.TotalLoansByOfficeView"/>
<mapping class="com.arrebol.apc.model.views.PaymentDetailFromUserByCurdateView"/>
<mapping class="com.arrebol.apc.model.views.ClosingDailyDetailFromUserByCurdateView"/>
<mapping class="com.arrebol.apc.model.views.ClosingDailyDetailFromUserByLastClosingDayView"/>
<mapping class="com.arrebol.apc.model.views.LoanApprovedDetailView"/>
<mapping class="com.arrebol.apc.model.views.GeneralBoxView"/>
<mapping class="com.arrebol.apc.model.views.LoanByUserPaymentZeroView"/>

View File

@ -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.controller.admin;
@ -19,11 +19,14 @@ import com.arrebol.apc.model.core.Office;
import com.arrebol.apc.model.core.User;
import com.arrebol.apc.model.enums.ActiveStatus;
import com.arrebol.apc.model.views.ClosingDailyDetailFromUserByCurdateView;
import com.arrebol.apc.model.views.ClosingDailyDetailFromUserByLastClosingDayView;
import com.arrebol.apc.model.views.LoanByUserPaymentZeroView;
import com.arrebol.apc.model.views.TotalCashByCurdateDashboardView;
import com.arrebol.apc.model.views.TotalCashByCurdateView;
import com.arrebol.apc.model.views.TotalCashByLastClosingDayView;
import com.arrebol.apc.model.views.TotalClosingDayByCurdateView;
import com.arrebol.apc.model.views.constance.ClosingDailyDetailFromUserByCurdateCfg;
import com.arrebol.apc.model.views.constance.ClosingDailyDetailFromUserByLastClosingDayCfg;
import com.arrebol.apc.model.views.constance.LoanByUserPaymentZeroViewCfg;
import com.arrebol.apc.model.views.constance.TotalLoansByOfficeViewCfg;
import com.arrebol.apc.repository.GenericEntityRepository;
@ -42,398 +45,437 @@ import org.hibernate.Transaction;
*
* @author Oscar Armando Vargas Cardenas <oscar.vargas@arrebol.com.mx>
*/
public class ClosingDayController extends ConnectionManager implements Serializable {
public class ClosingDayController extends ConnectionManager implements Serializable {
/**
*
* Searching all closing day by office.
*
* @param officeId
* @param startDate
* @param endDate
* @return
*/
public List<ClosingDay> fillClosingDayDatatable(String officeId, Date startDate, Date endDate) {
logger.debug("fillClosingDayDatatable");
List<ModelParameter> parameters = new ArrayList<>();
Calendar calendar = Calendar.getInstance();
calendar.setTime(startDate);
calendar.add(Calendar.DAY_OF_YEAR, 1);
startDate = calendar.getTime();
/**
*
* Searching all closing day by office.
*
* @param officeId
* @param startDate
* @param endDate
* @return
*/
public List<ClosingDay> fillClosingDayDatatable(String officeId, Date startDate, Date endDate) {
logger.debug("fillClosingDayDatatable");
List<ModelParameter> parameters = new ArrayList<>();
Calendar calendarF = Calendar.getInstance();
calendarF.setTime(endDate);
calendarF.add(Calendar.DAY_OF_YEAR, 1);
endDate = calendarF.getTime();
parameters.add(new ModelParameter(ClosingDayCfg.FIELD_OFFICE, new Office(officeId)));
//parameters.add(new ModelParameter(ClosingDayCfg.FIELD_ACTIVE_STATUS, ActiveStatus.ENEBLED));
parameters.add(new ModelParameter(ClosingDayCfg.PARAM_START_DATE, startDate));
parameters.add(new ModelParameter(ClosingDayCfg.PARAM_END_DATE, endDate));
Calendar calendar = Calendar.getInstance();
calendar.setTime(startDate);
calendar.add(Calendar.DAY_OF_YEAR, 1);
startDate = calendar.getTime();
return genericEntityRepository.xmlQueryAPCEntities(ClosingDay.class, ClosingDayCfg.QUERY_FIND_ALL_CLOSING_DAY_BY_OFFICE_BETWEEN_DATES, parameters);
}
Calendar calendarF = Calendar.getInstance();
calendarF.setTime(endDate);
calendarF.add(Calendar.DAY_OF_YEAR, 1);
endDate = calendarF.getTime();
/**
*
* @param status
* @param closingDayIdToUpdate
* @param lastUpdatedBy
* @return
*/
public boolean updateClosingDayByStatus(ActiveStatus status, String closingDayIdToUpdate, String lastUpdatedBy) {
logger.debug("updateClosingDayByStatus");
parameters.add(new ModelParameter(ClosingDayCfg.FIELD_OFFICE, new Office(officeId)));
//parameters.add(new ModelParameter(ClosingDayCfg.FIELD_ACTIVE_STATUS, ActiveStatus.ENEBLED));
parameters.add(new ModelParameter(ClosingDayCfg.PARAM_START_DATE, startDate));
parameters.add(new ModelParameter(ClosingDayCfg.PARAM_END_DATE, endDate));
List<ModelParameter> parameters = new ArrayList<>();
return genericEntityRepository.xmlQueryAPCEntities(ClosingDay.class, ClosingDayCfg.QUERY_FIND_ALL_CLOSING_DAY_BY_OFFICE_BETWEEN_DATES, parameters);
}
parameters.add(new ModelParameter(ClosingDayCfg.FIELD_ACTIVE_STATUS, status));
parameters.add(new ModelParameter(ClosingDayCfg.FIELD_LAST_UPDATED_BY, lastUpdatedBy));
parameters.add(new ModelParameter(ClosingDayCfg.FIELD_LAST_UPDATED_ON, new Date()));
parameters.add(new ModelParameter(ClosingDayCfg.FIELD_ID, closingDayIdToUpdate));
/**
*
* @param status
* @param closingDayIdToUpdate
* @param lastUpdatedBy
* @return
*/
public boolean updateClosingDayByStatus(ActiveStatus status, String closingDayIdToUpdate, String lastUpdatedBy) {
logger.debug("updateClosingDayByStatus");
return genericEntityRepository.xmlUpdateOrDeleteAPCEntity(ClosingDayCfg.QUERY_UPDATE_CLOSING_DAY_BY_STATUS, parameters);
}
List<ModelParameter> parameters = new ArrayList<>();
/**
*
* @param closingDay
* @return boolean
*/
public boolean saveClosingDay(ClosingDay closingDay) {
logger.debug("saveClosingDay");
boolean success = genericEntityRepository.insertAPCEntity(closingDay);
parameters.add(new ModelParameter(ClosingDayCfg.FIELD_ACTIVE_STATUS, status));
parameters.add(new ModelParameter(ClosingDayCfg.FIELD_LAST_UPDATED_BY, lastUpdatedBy));
parameters.add(new ModelParameter(ClosingDayCfg.FIELD_LAST_UPDATED_ON, new Date()));
parameters.add(new ModelParameter(ClosingDayCfg.FIELD_ID, closingDayIdToUpdate));
return success;
}
return genericEntityRepository.xmlUpdateOrDeleteAPCEntity(ClosingDayCfg.QUERY_UPDATE_CLOSING_DAY_BY_STATUS, parameters);
}
/**
*
* Searching TotalCashByCurdateView by id.
*
* @param id
* @return
*/
public TotalCashByCurdateView getTotalCashByCurdateViewById(String id) {
logger.debug("getTotalCashByCurdateViewById");
/**
*
* @param closingDay
* @return boolean
*/
public boolean saveClosingDay(ClosingDay closingDay) {
logger.debug("saveClosingDay");
boolean success = genericEntityRepository.insertAPCEntity(closingDay);
return (TotalCashByCurdateView) genericEntityRepository.selectAPCEntityById(TotalCashByCurdateView.class, id);
}
return success;
}
/**
*
* Searching all total money day by office.
*
* @param officeId
* @return
*/
public List<TotalCashByCurdateView> getAllTotalCashByCurdateView(String officeId) {
logger.debug("getAllTotalCashByCurdateView");
List<ModelParameter> parameters = new ArrayList<>();
/**
*
* Searching TotalCashByCurdateView by id.
*
* @param id
* @return
*/
public TotalCashByCurdateView getTotalCashByCurdateViewById(String id) {
logger.debug("getTotalCashByCurdateViewById");
parameters.add(new ModelParameter(ClosingDayCfg.FIELD_VIEW_OFFICE, officeId));
return (TotalCashByCurdateView) genericEntityRepository.selectAPCEntityById(TotalCashByCurdateView.class, id);
}
return genericEntityRepository.xmlQueryAPCEntities(TotalCashByCurdateView.class, ClosingDayCfg.QUERY_FIND_TOTAL_BY_OFFICE, parameters);
}
/**
*
* Searching TotalCashByLastClosingDayView by id.
*
* @param id
* @return
*/
public TotalCashByLastClosingDayView getTotalCashByLastClosingDayViewById(String id) {
logger.debug("getTotalCashByLastClosingDayViewById");
return (TotalCashByLastClosingDayView) genericEntityRepository.selectAPCEntityById(TotalCashByLastClosingDayView.class, id);
}
public List<TotalCashByCurdateDashboardView> getAllTotalCashByCurdateDashboardView(String officeId) {
logger.debug("getAllTotalCashByCurdateDashboardView");
List<ModelParameter> parameters = new ArrayList<>();
/**
*
* Searching all total money day by office.
*
* @param officeId
* @return
*/
public List<TotalCashByCurdateView> getAllTotalCashByCurdateView(String officeId) {
logger.debug("getAllTotalCashByCurdateView");
List<ModelParameter> parameters = new ArrayList<>();
parameters.add(new ModelParameter(ClosingDayCfg.FIELD_VIEW_OFFICE, officeId));
parameters.add(new ModelParameter(ClosingDayCfg.FIELD_VIEW_OFFICE, officeId));
return genericEntityRepository.xmlQueryAPCEntities(TotalCashByCurdateDashboardView.class, ClosingDayCfg.QUERY_FIND_TOTAL_DASHBOARD_BY_OFFICE, parameters);
}
return genericEntityRepository.xmlQueryAPCEntities(TotalCashByCurdateView.class, ClosingDayCfg.QUERY_FIND_TOTAL_BY_OFFICE, parameters);
}
/**
*
* Searching all TotalClosingDayByCurdateView by curdate.
*
* @param officeId
* @return
*/
public List<TotalClosingDayByCurdateView> findAllClosingDayByCurdate(String officeId) {
logger.debug("findAllClosingDayByCurdate");
List<ModelParameter> parameters = new ArrayList<>();
public List<TotalCashByCurdateDashboardView> getAllTotalCashByCurdateDashboardView(String officeId) {
logger.debug("getAllTotalCashByCurdateDashboardView");
List<ModelParameter> parameters = new ArrayList<>();
parameters.add(new ModelParameter(ClosingDayCfg.FIELD_VIEW_OFFICE, officeId));
parameters.add(new ModelParameter(ClosingDayCfg.FIELD_VIEW_OFFICE, officeId));
return genericEntityRepository.xmlQueryAPCEntities(TotalClosingDayByCurdateView.class, ClosingDayCfg.QUERY_FIND_ALL_CLOSING_DAY_BY_CURDATE, parameters);
}
return genericEntityRepository.xmlQueryAPCEntities(TotalCashByCurdateDashboardView.class, ClosingDayCfg.QUERY_FIND_TOTAL_DASHBOARD_BY_OFFICE, parameters);
}
/**
*
* Searching all ClosingDailyDetailFromUserByCurdateView by curdate.
*
* @param userId
* @return
*/
public List<ClosingDailyDetailFromUserByCurdateView> findAllClosingDailyDetailFromUserByCurdateView(String userId) {
logger.debug("findAllClosingDailyDetailFromUserByCurdateView");
List<ModelParameter> parameters = new ArrayList<>();
/**
*
* Searching all TotalClosingDayByCurdateView by curdate.
*
* @param officeId
* @return
*/
public List<TotalClosingDayByCurdateView> findAllClosingDayByCurdate(String officeId) {
logger.debug("findAllClosingDayByCurdate");
List<ModelParameter> parameters = new ArrayList<>();
parameters.add(new ModelParameter(ClosingDailyDetailFromUserByCurdateCfg.FIELD_VIEW_USER, userId));
parameters.add(new ModelParameter(ClosingDayCfg.FIELD_VIEW_OFFICE, officeId));
return genericEntityRepository.xmlQueryAPCEntities(ClosingDailyDetailFromUserByCurdateView.class, ClosingDailyDetailFromUserByCurdateCfg.QUERY_FIND_ALL_DETAILS, parameters);
}
return genericEntityRepository.xmlQueryAPCEntities(TotalClosingDayByCurdateView.class, ClosingDayCfg.QUERY_FIND_ALL_CLOSING_DAY_BY_CURDATE, parameters);
}
/**
*
* Searching all ClosingDailyDetailFromUserByCurdateView by curdate.
*
* @param userId
* @return
*/
public List<ClosingDailyDetailFromUserByCurdateView> findAllClosingDailyDetailFromUserCertifierByCurdateView(String userId) {
logger.debug("findAllClosingDailyDetailFromUserCertifierByCurdateView");
List<ModelParameter> parameters = new ArrayList<>();
/**
*
* Searching all ClosingDailyDetailFromUserByCurdateView by curdate.
*
* @param userId
* @return
*/
public List<ClosingDailyDetailFromUserByCurdateView> findAllClosingDailyDetailFromUserByCurdateView(String userId) {
logger.debug("findAllClosingDailyDetailFromUserByCurdateView");
List<ModelParameter> parameters = new ArrayList<>();
parameters.add(new ModelParameter(ClosingDailyDetailFromUserByCurdateCfg.FIELD_VIEW_USER, userId));
parameters.add(new ModelParameter(ClosingDailyDetailFromUserByCurdateCfg.FIELD_VIEW_USER, userId));
return genericEntityRepository.xmlQueryAPCEntities(ClosingDailyDetailFromUserByCurdateView.class, ClosingDailyDetailFromUserByCurdateCfg.QUERY_FIND_ALL_DETAILS_CERTIFIER, parameters);
}
return genericEntityRepository.xmlQueryAPCEntities(ClosingDailyDetailFromUserByCurdateView.class, ClosingDailyDetailFromUserByCurdateCfg.QUERY_FIND_ALL_DETAILS, parameters);
}
/**
*
* Searching the num by closing day
*
* @param num for closing day
* @return
*/
public Long getClosingDayCurdateByUserId(String userId, String officeid) {
logger.debug("getClosingDayCurdateByUserId");
List<ModelParameter> parameters = new ArrayList<>();
/**
*
* Searching all ClosingDailyDetailFromUserByLastClosingDayView by curdate.
*
* @param userId
* @return
*/
public List<ClosingDailyDetailFromUserByLastClosingDayView> findAllClosingDailyDetailFromUserByLastClosingDayView(String userId) {
logger.debug("findAllClosingDailyDetailFromUserByLastClosingDayView");
List<ModelParameter> parameters = new ArrayList<>();
parameters.add(new ModelParameter(ClosingDailyDetailFromUserByLastClosingDayCfg.FIELD_VIEW_USER, userId));
return genericEntityRepository.xmlQueryAPCEntities(ClosingDailyDetailFromUserByLastClosingDayView.class, ClosingDailyDetailFromUserByLastClosingDayCfg.QUERY_FIND_ALL_DETAILS, parameters);
}
parameters.add(new ModelParameter(ClosingDayCfg.FIELD_USER, new User(userId)));
parameters.add(new ModelParameter(ClosingDayCfg.FIELD_OFFICE, new Office(officeid)));
/**
*
* Searching all ClosingDailyDetailFromUserByCurdateView by curdate.
*
* @param userId
* @return
*/
public List<ClosingDailyDetailFromUserByCurdateView> findAllClosingDailyDetailFromUserCertifierByCurdateView(String userId) {
logger.debug("findAllClosingDailyDetailFromUserCertifierByCurdateView");
List<ModelParameter> parameters = new ArrayList<>();
return (Long) genericEntityRepository.xmlQueryAPCEntityUniqueResult(Long.class, ClosingDayCfg.QUERY_COUNT_CLOSING_DATE_BY_USER_AND_OFFICE, parameters);
}
parameters.add(new ModelParameter(ClosingDailyDetailFromUserByCurdateCfg.FIELD_VIEW_USER, userId));
public Long getLoansCountDailyByUser(String userId) {
logger.debug("getLoansCountDailyByUser");
List<ModelParameter> parameters = new ArrayList<>();
return genericEntityRepository.xmlQueryAPCEntities(ClosingDailyDetailFromUserByCurdateView.class, ClosingDailyDetailFromUserByCurdateCfg.QUERY_FIND_ALL_DETAILS_CERTIFIER, parameters);
}
parameters.add(new ModelParameter(TotalLoansByOfficeViewCfg.FIELD_VIEW_USER, userId));
/**
*
* Searching all ClosingDailyDetailFromUserByLastClosingDayView by curdate.
*
* @param userId
* @return
*/
public List<ClosingDailyDetailFromUserByLastClosingDayView> findAllClosingDailyDetailFromUserCertifierByLastClosingDayView(String userId) {
logger.debug("findAllClosingDailyDetailFromUserCertifierByLastClosingDayView");
List<ModelParameter> parameters = new ArrayList<>();
parameters.add(new ModelParameter(ClosingDailyDetailFromUserByLastClosingDayCfg.FIELD_VIEW_USER, userId));
return genericEntityRepository.xmlQueryAPCEntities(ClosingDailyDetailFromUserByLastClosingDayView.class, ClosingDailyDetailFromUserByLastClosingDayCfg.QUERY_FIND_ALL_DETAILS_CERTIFIER, parameters);
}
return (Long) genericEntityRepository.xmlQueryAPCEntityUniqueResult(Long.class, TotalLoansByOfficeViewCfg.QUERY_COUNT_ALL_LOANS_BY_USER, parameters);
}
/**
*
* Searching the num by closing day
*
* @param num for closing day
* @return
*/
public Long getClosingDayCurdateByUserId(String userId, String officeid) {
logger.debug("getClosingDayCurdateByUserId");
List<ModelParameter> parameters = new ArrayList<>();
public List<LoanByUserPaymentZeroView> getLoansPaymentZeroByUser(String userId) {
logger.debug("getLoansPaymentZeroByUser");
List<ModelParameter> parameters = new ArrayList<>();
parameters.add(new ModelParameter(ClosingDayCfg.FIELD_USER, new User(userId)));
parameters.add(new ModelParameter(ClosingDayCfg.FIELD_OFFICE, new Office(officeid)));
parameters.add(new ModelParameter(LoanByUserPaymentZeroViewCfg.FIELD_VIEW_USER, new User(userId)));
return (Long) genericEntityRepository.xmlQueryAPCEntityUniqueResult(Long.class, ClosingDayCfg.QUERY_COUNT_CLOSING_DATE_BY_USER_AND_OFFICE, parameters);
}
return genericEntityRepository.xmlQueryAPCEntities(LoanByUserPaymentZeroView.class, LoanByUserPaymentZeroViewCfg.QUERY_FIND_ALL_LOANS_PAYMENT_ZERO_BY_USER, parameters);
}
public Long getLoansCountDailyByUser(String userId) {
logger.debug("getLoansCountDailyByUser");
List<ModelParameter> parameters = new ArrayList<>();
/**
*
* @param details
* @return boolean
*/
public boolean saveClosingDayDetail(List<ClosingDayDetail> details) {
logger.debug("saveClosingDayDetail");
boolean success = genericEntityRepository.insertManyAPCEntity(details);
parameters.add(new ModelParameter(TotalLoansByOfficeViewCfg.FIELD_VIEW_USER, userId));
return success;
}
return (Long) genericEntityRepository.xmlQueryAPCEntityUniqueResult(Long.class, TotalLoansByOfficeViewCfg.QUERY_COUNT_ALL_LOANS_BY_USER, parameters);
}
/**
*
* Searching closing day by id.
*
* @param closingDayId
* @return
*/
public ClosingDay getClosingDayById(String closingDayId) {
logger.debug("getClosingDayById");
public List<LoanByUserPaymentZeroView> getLoansPaymentZeroByUser(String userId) {
logger.debug("getLoansPaymentZeroByUser");
List<ModelParameter> parameters = new ArrayList<>();
return (ClosingDay) genericEntityRepository.selectAPCEntityById(ClosingDay.class, closingDayId);
}
parameters.add(new ModelParameter(LoanByUserPaymentZeroViewCfg.FIELD_VIEW_USER, new User(userId)));
public List<ClosingDayDetail> getClosingDayDetailByIdClosingDay(String closingDay) {
logger.debug("getClosingDayDetailByIdClosingDay");
List<ModelParameter> parameters = new ArrayList<>();
return genericEntityRepository.xmlQueryAPCEntities(LoanByUserPaymentZeroView.class, LoanByUserPaymentZeroViewCfg.QUERY_FIND_ALL_LOANS_PAYMENT_ZERO_BY_USER, parameters);
}
parameters.add(new ModelParameter(ClosingDayDetailCfg.FIELD_CLOSING_DAY, new ClosingDay(closingDay)));
/**
*
* @param details
* @return boolean
*/
public boolean saveClosingDayDetail(List<ClosingDayDetail> details) {
logger.debug("saveClosingDayDetail");
boolean success = genericEntityRepository.insertManyAPCEntity(details);
return genericEntityRepository.xmlQueryAPCEntities(ClosingDayDetail.class, ClosingDayDetailCfg.QUERY_FIND_ALL_CLOSING_DAY_DETAIL_BY_ID, parameters);
}
return success;
}
public User getUserById(String userId) {
logger.debug("getUserById");
/**
*
* Searching closing day by id.
*
* @param closingDayId
* @return
*/
public ClosingDay getClosingDayById(String closingDayId) {
logger.debug("getClosingDayById");
return (User) genericEntityRepository.selectAPCEntityById(User.class, userId);
}
return (ClosingDay) genericEntityRepository.selectAPCEntityById(ClosingDay.class, closingDayId);
}
/**
*
* @param date
* @return
*/
public boolean existNextPaidClosingDayByCreatedOn(Date date) {
logger.info("existNextPaidClosingDayByCreatedOn");
public List<ClosingDayDetail> getClosingDayDetailByIdClosingDay(String closingDay) {
logger.debug("getClosingDayDetailByIdClosingDay");
List<ModelParameter> parameters = new ArrayList<>();
String query = "SELECT cd.id "
+ "FROM APC_CLOSING_DAY cd "
+ "WHERE DATE(cd.created_on) >= DATE_ADD(DATE(:date), INTERVAL 1 DAY) "
+ "AND cd.active_status = 'ENEBLED'";
parameters.add(new ModelParameter(ClosingDayDetailCfg.FIELD_CLOSING_DAY, new ClosingDay(closingDay)));
return genericEntityRepository.existRecordsUsingSQLQueryFindByCreatedOnField(date, query);
}
return genericEntityRepository.xmlQueryAPCEntities(ClosingDayDetail.class, ClosingDayDetailCfg.QUERY_FIND_ALL_CLOSING_DAY_DETAIL_BY_ID, parameters);
}
/**
*
* @param date
* @return
*/
public boolean existStableSmallBoxByCreatedOn(Date date) {
logger.info("existStableSmallBoxByCreatedOn");
public User getUserById(String userId) {
logger.debug("getUserById");
String query = "SELECT ssb.id "
+ "FROM APC_STABLE_SMALL_BOX ssb "
+ "WHERE DATE(ssb.created_on) = DATE(:date) "
+ "AND ssb.active_status = 'ENEBLED'";
return (User) genericEntityRepository.selectAPCEntityById(User.class, userId);
}
return genericEntityRepository.existRecordsUsingSQLQueryFindByCreatedOnField(date, query);
}
/**
*
* @param date
* @return
*/
public boolean existNextPaidClosingDayByCreatedOn(Date date) {
logger.info("existNextPaidClosingDayByCreatedOn");
/**
*
* @param userId
* @return
*/
public List<Object> findDetailsFromClosingDayCurDate(String userId){
logger.debug("findDetailsFromClosingDayCurDate");
String query = "SELECT cd.id "
+ "FROM APC_CLOSING_DAY cd "
+ "WHERE DATE(cd.created_on) >= DATE_ADD(DATE(:date), INTERVAL 1 DAY) "
+ "AND cd.active_status = 'ENEBLED'";
List<Object> rows = new ArrayList<>();
Transaction transaction = null;
return genericEntityRepository.existRecordsUsingSQLQueryFindByCreatedOnField(date, query);
}
try {
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
transaction = session.beginTransaction();
/**
*
* @param date
* @return
*/
public boolean existStableSmallBoxByCreatedOn(Date date) {
logger.info("existStableSmallBoxByCreatedOn");
rows = session.createNativeQuery(queryClosingDayReport).setParameter("userId", userId).getResultList();
String query = "SELECT ssb.id "
+ "FROM APC_STABLE_SMALL_BOX ssb "
+ "WHERE DATE(ssb.created_on) = DATE(:date) "
+ "AND ssb.active_status = 'ENEBLED'";
transaction.commit();
} catch (HibernateException e) {
logger.error("Driver", e);
rollback(transaction);
} catch (Exception e) {
logger.error("Method findDetailsFromClosingDayCurDate(" + userId + " " + ") ", e);
rollback(transaction);
}
return rows;
}
public List<Object> findDetailsFromClosingDayHisotry(String idClosingDay){
logger.debug("findDetailsFromClosingDayCurDate");
return genericEntityRepository.existRecordsUsingSQLQueryFindByCreatedOnField(date, query);
}
List<Object> rows = new ArrayList<>();
Transaction transaction = null;
/**
*
* @param userId
* @return
*/
public List<Object> findDetailsFromClosingDayCurDate(String userId) {
logger.debug("findDetailsFromClosingDayCurDate");
try {
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
transaction = session.beginTransaction();
List<Object> rows = new ArrayList<>();
Transaction transaction = null;
rows = session.createNativeQuery(queryClosingDayReportHistory).setParameter("idClosingDay", idClosingDay).getResultList();
try {
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
transaction = session.beginTransaction();
transaction.commit();
} catch (HibernateException e) {
logger.error("Driver", e);
rollback(transaction);
} catch (Exception e) {
logger.error("Method findDetailsFromClosingDayHistory(" + idClosingDay + " " + ") ", e);
rollback(transaction);
}
return rows;
}
/**
*
* Searching people.
*
* @param peopleId
* @return
*/
public People findPeopleById(String peopleId) {
logger.debug("findPeopleById");
rows = session.createNativeQuery(queryClosingDayReport).setParameter("userId", userId).getResultList();
return (People) genericEntityRepository.selectAPCEntityById(User.class, peopleId);
}
final Logger logger = LogManager.getLogger(ClosingDayController.class);
private final GenericEntityRepository genericEntityRepository;
transaction.commit();
public ClosingDayController() {
this.genericEntityRepository = new GenericEntityRepository();
}
private final String queryClosingDayReport =
"SELECT " +
"cldd.comments, " +
"cldd.amount, " +
"cldd.type, " +
"cldd.saldo, " +
"cldd.created_on, " +
"cldd.comisionApertura, " +
"cldd.prestamoAnterior, " +
"cldd.route, " +
"CONCAT(hr.first_name,' ',IF(ISNULL(hr.second_name) ,'', CONCAT(hr.second_name, ' ')),hr.last_name,' ', hr.middle_name) AS username, " +
"(SELECT sum(tc.total_amount_payment) FROM APC_TOTAL_CASH_BY_CURDATE_VIEW tc where id = :userId) as total_amount_payment, " +
"(SELECT sum(tc.total_amount_deposit) FROM APC_TOTAL_CASH_BY_CURDATE_VIEW tc where id = :userId) as total_amount_deposit, " +
"(SELECT sum(tc.transfer_sender) FROM APC_TOTAL_CASH_BY_CURDATE_VIEW tc where id = :userId) as transfer_sender, " +
"(SELECT sum(tc.transfer_receiver) FROM APC_TOTAL_CASH_BY_CURDATE_VIEW tc where id = :userId) as transfer_receiver, " +
"(SELECT sum(tc.money_daily) FROM APC_TOTAL_CASH_BY_CURDATE_VIEW tc where id = :userId) as money_daily, " +
"(SELECT sum(tc.other_expense) FROM APC_TOTAL_CASH_BY_CURDATE_VIEW tc where id = :userId) as other_expense, " +
"(SELECT sum(tc.delivery) FROM APC_TOTAL_CASH_BY_CURDATE_VIEW tc where id = :userId) as delivery, " +
"(SELECT sum(tc.transfer_pending) FROM APC_TOTAL_CASH_BY_CURDATE_VIEW tc where id = :userId) as transfer_pending " +
"FROM " +
" APC_CLOSING_DAILY_DETAIL_FROM_USER_BY_CURDATE_VIEW_REPORT cldd " +
"INNER JOIN " +
" APC_USER u ON u.id = cldd.id_user " +
"INNER JOIN " +
" APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource " +
"WHERE " +
" cldd.id_user = :userId " +
"ORDER BY " +
" cldd.created_on ASC";
private final String queryClosingDayReportHistory =
" SELECT " +
" cldd.comments, " +
" cldd.amount, " +
" cldd.type, " +
" cldd.created_on, " +
" cd.amount_expected, " +
" cd.amount_paid, " +
" CONCAT(hr.first_name,' ',IF(ISNULL(hr.second_name) ,'', CONCAT(hr.second_name, ' ')),hr.last_name,' ', hr.middle_name) AS username, " +
" (SELECT IFNULL(SUM(cld.amount),0) FROM APC_CLOSING_DAY_DETAIL cld WHERE cld.type='Abono' AND cld.id_closing_day = :idClosingDay) as total_amount_payment, " +
" (SELECT IFNULL(SUM(cld.amount),0) FROM APC_CLOSING_DAY_DETAIL cld WHERE cld.type='Depósito' AND cld.id_closing_day = :idClosingDay) as total_amount_deposit, " +
" (SELECT IFNULL(SUM(cld.amount),0) FROM APC_CLOSING_DAY_DETAIL cld WHERE cld.type='Transferencia enviada' AND cld.id_closing_day = :idClosingDay) as transfer_sender, " +
" (SELECT IFNULL(SUM(cld.amount),0) FROM APC_CLOSING_DAY_DETAIL cld WHERE cld.type='Transferencia recibida' AND cld.id_closing_day = :idClosingDay) as transfer_receiver, " +
" (SELECT IFNULL(SUM(cld.amount),0) FROM APC_CLOSING_DAY_DETAIL cld WHERE cld.type='Inicio' AND cld.id_closing_day = :idClosingDay) as money_daily, " +
" (SELECT IFNULL(SUM(cld.amount),0) FROM APC_CLOSING_DAY_DETAIL cld WHERE cld.type='Gasto' AND cld.id_closing_day = :idClosingDay) as other_expense, " +
" (SELECT IFNULL(SUM(cld.amount),0) FROM APC_CLOSING_DAY_DETAIL cld WHERE cld.type='Entrega de préstamo' AND cld.id_closing_day = :idClosingDay) as delivery, " +
" (SELECT IFNULL(SUM(cld.amount),0) FROM APC_CLOSING_DAY_DETAIL cld WHERE cld.type='Multa' AND cld.id_closing_day = :idClosingDay) as total_amount_fee, " +
" cldd.dateDetail "+
" FROM " +
" APC_CLOSING_DAY_DETAIL cldd " +
" INNER JOIN " +
" APC_CLOSING_DAY cd on cldd.id_closing_day = cd.id" +
" INNER JOIN" +
" APC_USER u ON u.id = cd.id_user " +
" INNER JOIN " +
" APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource " +
" WHERE " +
" cldd.id_closing_day = :idClosingDay" +
" ORDER BY" +
" cldd.created_on ASC; ";
} catch (HibernateException e) {
logger.error("Driver", e);
rollback(transaction);
} catch (Exception e) {
logger.error("Method findDetailsFromClosingDayCurDate(" + userId + " " + ") ", e);
rollback(transaction);
}
return rows;
}
public List<Object> findDetailsFromClosingDayHisotry(String idClosingDay) {
logger.debug("findDetailsFromClosingDayCurDate");
List<Object> rows = new ArrayList<>();
Transaction transaction = null;
try {
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
transaction = session.beginTransaction();
rows = session.createNativeQuery(queryClosingDayReportHistory).setParameter("idClosingDay", idClosingDay).getResultList();
transaction.commit();
} catch (HibernateException e) {
logger.error("Driver", e);
rollback(transaction);
} catch (Exception e) {
logger.error("Method findDetailsFromClosingDayHistory(" + idClosingDay + " " + ") ", e);
rollback(transaction);
}
return rows;
}
/**
*
* Searching people.
*
* @param peopleId
* @return
*/
public People findPeopleById(String peopleId) {
logger.debug("findPeopleById");
return (People) genericEntityRepository.selectAPCEntityById(User.class, peopleId);
}
final Logger logger = LogManager.getLogger(ClosingDayController.class);
private final GenericEntityRepository genericEntityRepository;
public ClosingDayController() {
this.genericEntityRepository = new GenericEntityRepository();
}
private final String queryClosingDayReport
= "SELECT "
+ "cldd.comments, "
+ "cldd.amount, "
+ "cldd.type, "
+ "cldd.saldo, "
+ "cldd.created_on, "
+ "cldd.comisionApertura, "
+ "cldd.prestamoAnterior, "
+ "cldd.route, "
+ "CONCAT(hr.first_name,' ',IF(ISNULL(hr.second_name) ,'', CONCAT(hr.second_name, ' ')),hr.last_name,' ', hr.middle_name) AS username, "
+ "(SELECT sum(tc.total_amount_payment) FROM APC_TOTAL_CASH_BY_CURDATE_VIEW tc where id = :userId) as total_amount_payment, "
+ "(SELECT sum(tc.total_amount_deposit) FROM APC_TOTAL_CASH_BY_CURDATE_VIEW tc where id = :userId) as total_amount_deposit, "
+ "(SELECT sum(tc.transfer_sender) FROM APC_TOTAL_CASH_BY_CURDATE_VIEW tc where id = :userId) as transfer_sender, "
+ "(SELECT sum(tc.transfer_receiver) FROM APC_TOTAL_CASH_BY_CURDATE_VIEW tc where id = :userId) as transfer_receiver, "
+ "(SELECT sum(tc.money_daily) FROM APC_TOTAL_CASH_BY_CURDATE_VIEW tc where id = :userId) as money_daily, "
+ "(SELECT sum(tc.other_expense) FROM APC_TOTAL_CASH_BY_CURDATE_VIEW tc where id = :userId) as other_expense, "
+ "(SELECT sum(tc.delivery) FROM APC_TOTAL_CASH_BY_CURDATE_VIEW tc where id = :userId) as delivery, "
+ "(SELECT sum(tc.transfer_pending) FROM APC_TOTAL_CASH_BY_CURDATE_VIEW tc where id = :userId) as transfer_pending "
+ "FROM "
+ " APC_CLOSING_DAILY_DETAIL_FROM_USER_BY_LAST_CLOSING_VIEW_REPORT cldd "
+ "INNER JOIN "
+ " APC_USER u ON u.id = cldd.id_user "
+ "INNER JOIN "
+ " APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource "
+ "WHERE "
+ " cldd.id_user = :userId "
+ "ORDER BY "
+ " cldd.created_on ASC";
private final String queryClosingDayReportHistory
= " SELECT "
+ " cldd.comments, "
+ " cldd.amount, "
+ " cldd.type, "
+ " cldd.created_on, "
+ " cd.amount_expected, "
+ " cd.amount_paid, "
+ " CONCAT(hr.first_name,' ',IF(ISNULL(hr.second_name) ,'', CONCAT(hr.second_name, ' ')),hr.last_name,' ', hr.middle_name) AS username, "
+ " (SELECT IFNULL(SUM(cld.amount),0) FROM APC_CLOSING_DAY_DETAIL cld WHERE cld.type='Abono' AND cld.id_closing_day = :idClosingDay) as total_amount_payment, "
+ " (SELECT IFNULL(SUM(cld.amount),0) FROM APC_CLOSING_DAY_DETAIL cld WHERE cld.type='Depósito' AND cld.id_closing_day = :idClosingDay) as total_amount_deposit, "
+ " (SELECT IFNULL(SUM(cld.amount),0) FROM APC_CLOSING_DAY_DETAIL cld WHERE cld.type='Transferencia enviada' AND cld.id_closing_day = :idClosingDay) as transfer_sender, "
+ " (SELECT IFNULL(SUM(cld.amount),0) FROM APC_CLOSING_DAY_DETAIL cld WHERE cld.type='Transferencia recibida' AND cld.id_closing_day = :idClosingDay) as transfer_receiver, "
+ " (SELECT IFNULL(SUM(cld.amount),0) FROM APC_CLOSING_DAY_DETAIL cld WHERE cld.type='Inicio' AND cld.id_closing_day = :idClosingDay) as money_daily, "
+ " (SELECT IFNULL(SUM(cld.amount),0) FROM APC_CLOSING_DAY_DETAIL cld WHERE cld.type='Gasto' AND cld.id_closing_day = :idClosingDay) as other_expense, "
+ " (SELECT IFNULL(SUM(cld.amount),0) FROM APC_CLOSING_DAY_DETAIL cld WHERE cld.type='Entrega de préstamo' AND cld.id_closing_day = :idClosingDay) as delivery, "
+ " (SELECT IFNULL(SUM(cld.amount),0) FROM APC_CLOSING_DAY_DETAIL cld WHERE cld.type='Multa' AND cld.id_closing_day = :idClosingDay) as total_amount_fee, "
+ " cldd.dateDetail "
+ " FROM "
+ " APC_CLOSING_DAY_DETAIL cldd "
+ " INNER JOIN "
+ " APC_CLOSING_DAY cd on cldd.id_closing_day = cd.id"
+ " INNER JOIN"
+ " APC_USER u ON u.id = cd.id_user "
+ " INNER JOIN "
+ " APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource "
+ " WHERE "
+ " cldd.id_closing_day = :idClosingDay"
+ " ORDER BY"
+ " cldd.created_on ASC; ";
}

View File

@ -73,11 +73,13 @@
<mapping class="com.arrebol.apc.model.views.LoanToDeliveryByCertifierView"/>
<mapping class="com.arrebol.apc.model.views.ExchangeEnebledUsersView"/>
<mapping class="com.arrebol.apc.model.views.TotalCashByCurdateView"/>
<mapping class="com.arrebol.apc.model.views.TotalCashByLastClosingDayView"/>
<mapping class="com.arrebol.apc.model.views.PersonSearchHistoricalDetailsView"/>
<mapping class="com.arrebol.apc.model.views.TotalClosingDayByCurdateView"/>
<mapping class="com.arrebol.apc.model.views.TotalLoansByOfficeView"/>
<mapping class="com.arrebol.apc.model.views.PaymentDetailFromUserByCurdateView"/>
<mapping class="com.arrebol.apc.model.views.ClosingDailyDetailFromUserByCurdateView"/>
<mapping class="com.arrebol.apc.model.views.ClosingDailyDetailFromUserByLastClosingDayView"/>
<mapping class="com.arrebol.apc.model.views.LoanApprovedDetailView"/>
<mapping class="com.arrebol.apc.model.views.GeneralBoxView"/>
<mapping class="com.arrebol.apc.model.views.LoanByUserPaymentZeroView"/>

View File

@ -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.model.views;
@ -22,167 +22,141 @@ import org.hibernate.annotations.Immutable;
@Entity
@Immutable
@Table(name = "APC_ADVANCE_USER_DAILY_DETAIL_VIEW")
public class AdvanceUserDailyDetail implements Serializable{
public class AdvanceUserDailyDetail implements Serializable {
private static final long serialVersionUID = -4849944622024557288L;
@Id
@Column(name = "id", length = 36)
private String id;
@Column(name = "id_user")
private String idUser;
@Column(name = "customer_name")
private String customerName;
@Column(name = "payment_amount")
private String paymentAmount;
@Column(name = "created_on")
private Date createdOn;
@Column(name = "address_business")
private String address;
@Column(name = "type_ayment")
private String typePayment;
@Column(name = "amount_paid")
private String amountPaid;
@Column(name = "amount_to_pay")
private String amountToPay;
@Column(name = "last_reference_number")
private String lastReference;
@Column(name = "loan_status")
private String loanStatus;
@Column(name = "num_fee")
private String numFee;
@Column(name = "saldo_insoluto")
private String saldoInsoluto;
@Column(name = "amount_loan")
private String amountLoan;
private static final long serialVersionUID = -4849944622024557288L;
public String getId() {
return id;
}
@Id
@Column(name = "id", length = 36)
private String id;
public void setId(String id) {
this.id = id;
}
@Column(name = "id_user")
private String idUser;
public String getIdUser() {
return idUser;
}
@Column(name = "customer_name")
private String customerName;
public void setIdUser(String idUser) {
this.idUser = idUser;
}
@Column(name = "payment_amount")
private String paymentAmount;
public String getCustomerName() {
return customerName;
}
@Column(name = "created_on")
private Date createdOn;
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
@Column(name = "address_business")
private String address;
public String getPaymentAmount() {
return paymentAmount;
}
@Column(name = "type_ayment")
private String typePayment;
public void setPaymentAmount(String paymentAmount) {
this.paymentAmount = paymentAmount;
}
@Column(name = "amount_paid")
private String amountPaid;
public Date getCreatedOn() {
return createdOn;
}
@Column(name = "amount_to_pay")
private String amountToPay;
public void setCreatedOn(Date createdOn) {
this.createdOn = createdOn;
}
@Column(name = "last_reference_number")
private String lastReference;
public String getAddress() {
return address;
}
@Column(name = "loan_status")
private String loanStatus;
public void setAddress(String address) {
this.address = address;
}
@Column(name = "num_fee")
private String numFee;
public String getTypePayment() {
return typePayment;
}
public String getId() {
return id;
}
public void setTypePayment(String typePayment) {
this.typePayment = typePayment;
}
public void setId(String id) {
this.id = id;
}
public String getAmountPaid() {
return amountPaid;
}
public String getIdUser() {
return idUser;
}
public void setAmountPaid(String amountPaid) {
this.amountPaid = amountPaid;
}
public void setIdUser(String idUser) {
this.idUser = idUser;
}
public String getAmountToPay() {
return amountToPay;
}
public String getCustomerName() {
return customerName;
}
public void setAmountToPay(String amountToPay) {
this.amountToPay = amountToPay;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
public String getLastReference() {
return lastReference;
}
public String getPaymentAmount() {
return paymentAmount;
}
public void setLastReference(String lastReference) {
this.lastReference = lastReference;
}
public void setPaymentAmount(String paymentAmount) {
this.paymentAmount = paymentAmount;
}
public String getLoanStatus() {
return loanStatus;
}
public Date getCreatedOn() {
return createdOn;
}
public void setLoanStatus(String loanStatus) {
this.loanStatus = loanStatus;
}
public void setCreatedOn(Date createdOn) {
this.createdOn = createdOn;
}
public String getNumFee() {
return numFee;
}
public String getAddress() {
return address;
}
public void setNumFee(String numFee) {
this.numFee = numFee;
}
public void setAddress(String address) {
this.address = address;
}
public String getSaldoInsoluto() {
return saldoInsoluto;
}
public String getTypePayment() {
return typePayment;
}
public void setSaldoInsoluto(String saldoInsoluto) {
this.saldoInsoluto = saldoInsoluto;
}
public void setTypePayment(String typePayment) {
this.typePayment = typePayment;
}
public String getAmountLoan() {
return amountLoan;
}
public String getAmountPaid() {
return amountPaid;
}
public void setAmountPaid(String amountPaid) {
this.amountPaid = amountPaid;
}
public String getAmountToPay() {
return amountToPay;
}
public void setAmountToPay(String amountToPay) {
this.amountToPay = amountToPay;
}
public String getLastReference() {
return lastReference;
}
public void setLastReference(String lastReference) {
this.lastReference = lastReference;
}
public String getLoanStatus() {
return loanStatus;
}
public void setLoanStatus(String loanStatus) {
this.loanStatus = loanStatus;
}
public String getNumFee() {
return numFee;
}
public void setNumFee(String numFee) {
this.numFee = numFee;
}
public void setAmountLoan(String amountLoan) {
this.amountLoan = amountLoan;
}
}

View File

@ -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.model.views;
@ -23,112 +23,112 @@ import org.hibernate.annotations.Immutable;
@Entity
@Immutable
@Table(name = "APC_CLOSING_DAILY_DETAIL_FROM_USER_BY_CURDATE_VIEW")
public class ClosingDailyDetailFromUserByCurdateView implements Serializable{
public class ClosingDailyDetailFromUserByCurdateView implements Serializable {
private static final long serialVersionUID = -4593609182109393813L;
@Id
@Column(name = "id", length = 36)
private String id;
@Column(name = "comments")
private String comments;
@Column(name = "amount")
private BigDecimal amount;
@Column(name = "type")
private String type;
@Column(name = "created_on")
private Date createdOn;
@Column(name = "id_user")
private String idUser;
@Column(name = "route")
private String route;
@Column(name = "fechaFiltro")
private Date fechaFiltro;
@Column(name = "saldo")
private BigDecimal saldo;
public ClosingDailyDetailFromUserByCurdateView(){
}
private static final long serialVersionUID = -4593609182109393813L;
public String getId() {
return id;
}
@Id
@Column(name = "id", length = 36)
private String id;
public void setId(String id) {
this.id = id;
}
@Column(name = "comments")
private String comments;
public String getComments() {
return comments;
}
@Column(name = "amount")
private BigDecimal amount;
public void setComments(String comments) {
this.comments = comments;
}
@Column(name = "type")
private String type;
public BigDecimal getAmount() {
return amount;
}
@Column(name = "created_on")
private Date createdOn;
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
@Column(name = "id_user")
private String idUser;
public String getType() {
return type;
}
@Column(name = "route")
private String route;
public void setType(String type) {
this.type = type;
}
@Column(name = "fechaFiltro")
private Date fechaFiltro;
public String getIdUser() {
return idUser;
}
@Column(name = "saldo")
private BigDecimal saldo;
public void setIdUser(String idUser) {
this.idUser = idUser;
}
public ClosingDailyDetailFromUserByCurdateView() {
public Date getCreatedOn() {
return createdOn;
}
}
public void setCreatedOn(Date createdOn) {
this.createdOn = createdOn;
}
public String getId() {
return id;
}
public String getRoute() {
return route;
}
public void setId(String id) {
this.id = id;
}
public void setRoute(String route) {
this.route = route;
}
public String getComments() {
return comments;
}
public Date getFechaFiltro() {
return fechaFiltro;
}
public void setComments(String comments) {
this.comments = comments;
}
public void setFechaFiltro(Date fechaFiltro) {
this.fechaFiltro = fechaFiltro;
}
public BigDecimal getAmount() {
return amount;
}
public BigDecimal getSaldo() {
return saldo;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
public void setSaldo(BigDecimal saldo) {
this.saldo = saldo;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getIdUser() {
return idUser;
}
public void setIdUser(String idUser) {
this.idUser = idUser;
}
public Date getCreatedOn() {
return createdOn;
}
public void setCreatedOn(Date createdOn) {
this.createdOn = createdOn;
}
public String getRoute() {
return route;
}
public void setRoute(String route) {
this.route = route;
}
public Date getFechaFiltro() {
return fechaFiltro;
}
public void setFechaFiltro(Date fechaFiltro) {
this.fechaFiltro = fechaFiltro;
}
public BigDecimal getSaldo() {
return saldo;
}
public void setSaldo(BigDecimal saldo) {
this.saldo = saldo;
}
}

View File

@ -0,0 +1,134 @@
/*
* Arrebol Consultancy copyright.
*
* This code belongs to Arrebol Consultancy
* its use, redistribution or modification are prohibited
* without written authorization from Arrebol Consultancy.
*/
package com.arrebol.apc.model.views;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.Immutable;
/**
*
* @author Oscar Armando Vargas Cardenas <oscar.vargas@arrebol.com.mx>
*/
@Entity
@Immutable
@Table(name = "APC_CLOSING_DAILY_DETAIL_FROM_USER_BY_LAST_CLOSING_DAY_VIEW")
public class ClosingDailyDetailFromUserByLastClosingDayView implements Serializable {
private static final long serialVersionUID = -4593609182109393813L;
@Id
@Column(name = "id", length = 36)
private String id;
@Column(name = "comments")
private String comments;
@Column(name = "amount")
private BigDecimal amount;
@Column(name = "type")
private String type;
@Column(name = "created_on")
private Date createdOn;
@Column(name = "id_user")
private String idUser;
@Column(name = "route")
private String route;
@Column(name = "fechaFiltro")
private Date fechaFiltro;
@Column(name = "saldo")
private BigDecimal saldo;
public ClosingDailyDetailFromUserByLastClosingDayView() {
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getComments() {
return comments;
}
public void setComments(String comments) {
this.comments = comments;
}
public BigDecimal getAmount() {
return amount;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getIdUser() {
return idUser;
}
public void setIdUser(String idUser) {
this.idUser = idUser;
}
public Date getCreatedOn() {
return createdOn;
}
public void setCreatedOn(Date createdOn) {
this.createdOn = createdOn;
}
public String getRoute() {
return route;
}
public void setRoute(String route) {
this.route = route;
}
public Date getFechaFiltro() {
return fechaFiltro;
}
public void setFechaFiltro(Date fechaFiltro) {
this.fechaFiltro = fechaFiltro;
}
public BigDecimal getSaldo() {
return saldo;
}
public void setSaldo(BigDecimal saldo) {
this.saldo = saldo;
}
}

View File

@ -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.model.views;
@ -25,148 +25,148 @@ import org.hibernate.annotations.Immutable;
@Table(name = "APC_TOTAL_CASH_BY_CURDATE_VIEW")
public class TotalCashByCurdateView implements Serializable {
private static final long serialVersionUID = 617629469188727880L;
private static final long serialVersionUID = 617629469188727880L;
@Id
@Column(name = "id", length = 36)
private String id;
@Id
@Column(name = "id", length = 36)
private String id;
@Column(name = "id_office")
private String idOffice;
@Column(name = "id_office")
private String idOffice;
@Column(name = "total_amount_payment")
private BigDecimal paymentDaily;
@Column(name = "total_amount_deposit")
private BigDecimal depositDaily;
@Column(name = "total_amount_payment")
private BigDecimal paymentDaily;
@Column(name = "transfer_sender")
private BigDecimal transferSender;
@Column(name = "total_amount_deposit")
private BigDecimal depositDaily;
@Column(name = "transfer_receiver")
private BigDecimal transferReceiver;
@Column(name = "transfer_sender")
private BigDecimal transferSender;
@Column(name = "money_daily")
private BigDecimal moneyDaily;
@Column(name = "transfer_receiver")
private BigDecimal transferReceiver;
@Column(name = "other_expense")
private BigDecimal otherExpense;
@Column(name = "money_daily")
private BigDecimal moneyDaily;
@Column(name = "delivery")
private BigDecimal delivery;
@Column(name = "other_expense")
private BigDecimal otherExpense;
@Column(name = "transfer_pending")
private BigDecimal transferPending;
@Column(name = "delivery")
private BigDecimal delivery;
@Transient
private BigDecimal total;
@Column(name = "transfer_pending")
private BigDecimal transferPending;
public TotalCashByCurdateView() {
}
@Transient
private BigDecimal total;
public String getId() {
return id;
}
public TotalCashByCurdateView() {
}
public void setId(String id) {
this.id = id;
}
public String getId() {
return id;
}
public BigDecimal getPaymentDaily() {
return paymentDaily;
}
public void setId(String id) {
this.id = id;
}
public void setPaymentDaily(BigDecimal paymentDaily) {
this.paymentDaily = paymentDaily;
}
public BigDecimal getPaymentDaily() {
return paymentDaily;
}
public BigDecimal getTransferSender() {
return transferSender;
}
public void setPaymentDaily(BigDecimal paymentDaily) {
this.paymentDaily = paymentDaily;
}
public void setTransferSender(BigDecimal transferSender) {
this.transferSender = transferSender;
}
public BigDecimal getTransferSender() {
return transferSender;
}
public BigDecimal getTransferReceiver() {
return transferReceiver;
}
public void setTransferSender(BigDecimal transferSender) {
this.transferSender = transferSender;
}
public void setTransferReceiver(BigDecimal transferReceiver) {
this.transferReceiver = transferReceiver;
}
public BigDecimal getTransferReceiver() {
return transferReceiver;
}
public BigDecimal getMoneyDaily() {
return moneyDaily;
}
public void setTransferReceiver(BigDecimal transferReceiver) {
this.transferReceiver = transferReceiver;
}
public void setMoneyDaily(BigDecimal moneyDaily) {
this.moneyDaily = moneyDaily;
}
public BigDecimal getMoneyDaily() {
return moneyDaily;
}
public BigDecimal getOtherExpense() {
return otherExpense;
}
public void setMoneyDaily(BigDecimal moneyDaily) {
this.moneyDaily = moneyDaily;
}
public void setOtherExpense(BigDecimal otherExpense) {
this.otherExpense = otherExpense;
}
public BigDecimal getOtherExpense() {
return otherExpense;
}
public BigDecimal getDelivery() {
return delivery;
}
public void setOtherExpense(BigDecimal otherExpense) {
this.otherExpense = otherExpense;
}
public void setDelivery(BigDecimal delivery) {
this.delivery = delivery;
}
public BigDecimal getDelivery() {
return delivery;
}
public String getIdOffice() {
return idOffice;
}
public void setDelivery(BigDecimal delivery) {
this.delivery = delivery;
}
public void setIdOffice(String idOffice) {
this.idOffice = idOffice;
}
public String getIdOffice() {
return idOffice;
}
public BigDecimal getTransferPending() {
return transferPending;
}
public void setIdOffice(String idOffice) {
this.idOffice = idOffice;
}
public void setTransferPending(BigDecimal transferPending) {
this.transferPending = transferPending;
}
public BigDecimal getTransferPending() {
return transferPending;
}
public BigDecimal getDepositDaily() {
return depositDaily;
}
public void setTransferPending(BigDecimal transferPending) {
this.transferPending = transferPending;
}
public void setDepositDaily(BigDecimal depositDaily) {
this.depositDaily = depositDaily;
}
public BigDecimal getTotal() {
if (null == total) {
total = BigDecimal.ZERO;
}
total = BigDecimal.ZERO;
total = total
.add(getPaymentDaily())
.add(getTransferReceiver())
.subtract(getTransferSender())
.add(getMoneyDaily())
.subtract(getOtherExpense())
.subtract(getDelivery());
public BigDecimal getDepositDaily() {
return depositDaily;
}
return total;
}
public void setDepositDaily(BigDecimal depositDaily) {
this.depositDaily = depositDaily;
}
public void setTotal(BigDecimal total) {
this.total = total;
}
public BigDecimal getTotal() {
if (null == total) {
total = BigDecimal.ZERO;
}
total = BigDecimal.ZERO;
total = total
.add(getPaymentDaily())
.add(getTransferReceiver())
.subtract(getTransferSender())
.add(getMoneyDaily())
.subtract(getOtherExpense())
.subtract(getDelivery());
@Override
public String toString() {
return "TotalCashByCurdateView{" + "id=" + id + '}';
}
return total;
}
public void setTotal(BigDecimal total) {
this.total = total;
}
@Override
public String toString() {
return "TotalCashByCurdateView{" + "id=" + id + '}';
}
}

View File

@ -0,0 +1,172 @@
/*
* Arrebol Consultancy copyright.
*
* This code belongs to Arrebol Consultancy
* its use, redistribution or modification are prohibited
* without written authorization from Arrebol Consultancy.
*/
package com.arrebol.apc.model.views;
import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import org.hibernate.annotations.Immutable;
/**
*
* @author Carlos Janitzio Zavala Lopez <janitzio.zavala@arrebol.com.mx>
*/
@Entity
@Immutable
@Table(name = "APC_TOTAL_CASH_BY_LAST_CLOSING_DAY_VIEW")
public class TotalCashByLastClosingDayView implements Serializable {
private static final long serialVersionUID = 617629469188727880L;
@Id
@Column(name = "id", length = 36)
private String id;
@Column(name = "id_office")
private String idOffice;
@Column(name = "total_amount_payment")
private BigDecimal paymentDaily;
@Column(name = "total_amount_deposit")
private BigDecimal depositDaily;
@Column(name = "transfer_sender")
private BigDecimal transferSender;
@Column(name = "transfer_receiver")
private BigDecimal transferReceiver;
@Column(name = "money_daily")
private BigDecimal moneyDaily;
@Column(name = "other_expense")
private BigDecimal otherExpense;
@Column(name = "delivery")
private BigDecimal delivery;
@Column(name = "transfer_pending")
private BigDecimal transferPending;
@Transient
private BigDecimal total;
public TotalCashByLastClosingDayView() {
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public BigDecimal getPaymentDaily() {
return paymentDaily;
}
public void setPaymentDaily(BigDecimal paymentDaily) {
this.paymentDaily = paymentDaily;
}
public BigDecimal getTransferSender() {
return transferSender;
}
public void setTransferSender(BigDecimal transferSender) {
this.transferSender = transferSender;
}
public BigDecimal getTransferReceiver() {
return transferReceiver;
}
public void setTransferReceiver(BigDecimal transferReceiver) {
this.transferReceiver = transferReceiver;
}
public BigDecimal getMoneyDaily() {
return moneyDaily;
}
public void setMoneyDaily(BigDecimal moneyDaily) {
this.moneyDaily = moneyDaily;
}
public BigDecimal getOtherExpense() {
return otherExpense;
}
public void setOtherExpense(BigDecimal otherExpense) {
this.otherExpense = otherExpense;
}
public BigDecimal getDelivery() {
return delivery;
}
public void setDelivery(BigDecimal delivery) {
this.delivery = delivery;
}
public String getIdOffice() {
return idOffice;
}
public void setIdOffice(String idOffice) {
this.idOffice = idOffice;
}
public BigDecimal getTransferPending() {
return transferPending;
}
public void setTransferPending(BigDecimal transferPending) {
this.transferPending = transferPending;
}
public BigDecimal getDepositDaily() {
return depositDaily;
}
public void setDepositDaily(BigDecimal depositDaily) {
this.depositDaily = depositDaily;
}
public BigDecimal getTotal() {
if (null == total) {
total = BigDecimal.ZERO;
}
total = BigDecimal.ZERO;
total = total
.add(getPaymentDaily())
.add(getTransferReceiver())
.subtract(getTransferSender())
.add(getMoneyDaily())
.subtract(getOtherExpense())
.subtract(getDelivery());
return total;
}
public void setTotal(BigDecimal total) {
this.total = total;
}
@Override
public String toString() {
return "TotalCashByCurdateView{" + "id=" + id + '}';
}
}

View File

@ -0,0 +1,23 @@
/*
* Arrebol Consultancy copyright.
*
* This code belongs to Arrebol Consultancy
* its use, redistribution or modification are prohibited
* without written authorization from Arrebol Consultancy.
*/
package com.arrebol.apc.model.views.constance;
import com.arrebol.apc.model.core.constance.GenericCfg;
/**
*
* @author Oscar Armando Vargas Cardenas <oscar.vargas@arrebol.com.mx>
*/
public interface ClosingDailyDetailFromUserByLastClosingDayCfg extends GenericCfg {
String QUERY_FIND_ALL_DETAILS = "findAllClosingDailyDetailFromUserByLastClosingDayView";
String QUERY_FIND_ALL_DETAILS_CERTIFIER = "findAllClosingDailyDetailFromUserCertifierByLastClosingDayView";
String FIELD_VIEW_USER = "idUser";
}

View File

@ -73,11 +73,13 @@
<mapping class="com.arrebol.apc.model.views.LoanToDeliveryByCertifierView"/>
<mapping class="com.arrebol.apc.model.views.ExchangeEnebledUsersView"/>
<mapping class="com.arrebol.apc.model.views.TotalCashByCurdateView"/>
<mapping class="com.arrebol.apc.model.views.TotalCashByLastClosingDayView"/>
<mapping class="com.arrebol.apc.model.views.PersonSearchHistoricalDetailsView"/>
<mapping class="com.arrebol.apc.model.views.TotalClosingDayByCurdateView"/>
<mapping class="com.arrebol.apc.model.views.TotalLoansByOfficeView"/>
<mapping class="com.arrebol.apc.model.views.PaymentDetailFromUserByCurdateView"/>
<mapping class="com.arrebol.apc.model.views.ClosingDailyDetailFromUserByCurdateView"/>
<mapping class="com.arrebol.apc.model.views.ClosingDailyDetailFromUserByLastClosingDayView"/>
<mapping class="com.arrebol.apc.model.views.LoanApprovedDetailView"/>
<mapping class="com.arrebol.apc.model.views.GeneralBoxView"/>
<mapping class="com.arrebol.apc.model.views.LoanByUserPaymentZeroView"/>
@ -185,6 +187,7 @@
<mapping resource="com/arrebol/apc/model/queries/view/total.closing.day.by.curdate.view.hbm.xml"/>
<mapping resource="com/arrebol/apc/model/queries/view/payment.detail.from.user.by.curdate.view.hbm.xml"/>
<mapping resource="com/arrebol/apc/model/queries/view/total.closing.daily.detail.from.user.by.curdate.view.hbm.xml"/>
<mapping resource="com/arrebol/apc/model/queries/view/total.closing.daily.detail.from.user.by.last.closing.day.view.hbm.xml"/>
<mapping resource="com/arrebol/apc/model/queries/view/general.box.view.hbm.xml"/>
<mapping resource="com/arrebol/apc/model/queries/view/loan.by.user.payment.zero.view.hbm.xml"/>
<mapping resource="com/arrebol/apc/model/queries/view/advance.user.daily.view.hbm.xml"/>

View File

@ -0,0 +1,26 @@
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"https://hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<query name="findAllClosingDailyDetailFromUserByLastClosingDayView">
<![CDATA[
SELECT
t
FROM ClosingDailyDetailFromUserByLastClosingDayView t
WHERE idUser = :idUser
ORDER BY fechaFiltro ASC
]]>
</query>
<query name="findAllClosingDailyDetailFromUserCertifierByLastClosingDayView">
<![CDATA[
SELECT
t
FROM ClosingDailyDetailFromUserByLastClosingDayView t
WHERE idUser = :idUser
ORDER BY route ASC
]]>
</query>
</hibernate-mapping>

View File

@ -70,13 +70,13 @@ public class LoanPendingBean extends GenericBean implements Serializable, Datata
}
public void approvedLoan() {
loanCtrl.updateLoanByStatus(LoanStatus.TO_DELIVERY, selectedLoan.getId(), getLoggedUser().getUser().getId());
loanCtrl.updateLoanByUserByStatus(LoanStatus.TO_DELIVERY, selectedLoan);
loanCtrl.updateLoanByStatus(LoanStatus.APPROVED, selectedLoan.getId(), getLoggedUser().getUser().getId());
loanCtrl.updateLoanByUserByStatus(LoanStatus.APPROVED, selectedLoan);
loan.remove(selectedLoan);
selectedLoan = null;
selectedLoan = null;
showMessage(FacesMessage.SEVERITY_INFO, "Cambio de estatus", "la venta se cambió a estatus 'A conciliar' de forma correcta.");
showMessage(FacesMessage.SEVERITY_INFO, "Cambio de estatus", "la venta se cambió a estatus 'Aprobado' de forma correcta.");
}
@Override

View File

@ -166,6 +166,86 @@
</div>
</div>
<div class="ui-g-12">
<div class="card">
<h4>Detalle de avance del día por asesor</h4>
<p:panelGrid columns="2" layout="grid" styleClass="ui-panelgrid-blank form-group">
<h:panelGroup id="userPnlGrp" styleClass="md-inputfield">
<p:selectOneMenu style="width:100%"
filter="true"
filterMatchMode="contains"
value="#{dashboardManager.userId}"
id="user"
>
<f:selectItem itemLabel="Selecciona un usuario.." itemValue="" />
<f:selectItems value="#{dashboardManager.users}" var="user" itemLabel="#{user.humanResource.firstName} #{user.humanResource.lastName}" itemValue="#{user.id}" />
</p:selectOneMenu>
<p:message for="user" display="text"/>
</h:panelGroup>
<h:panelGroup styleClass="md-inputfield">
<p:commandButton value="#{i18n['general.search']}"
update="dtAdvancesDetail"
action="#{dashboardManager.getAdvanceDetailsByUser()}">
</p:commandButton>
</h:panelGroup>
</p:panelGrid>
<p:dataTable widgetVar="dtAdvancesDetail" id="dtAdvancesDetail" var="advancesDetail" draggableRows="true" draggableColumns="true" value="#{dashboardManager.advancesDetail}" style="margin-bottom:20px" reflow="true" rowsPerPageTemplate="5,10,25,50,100" emptyMessage="#{i18n['admin.transfers.datatable.empty']}"
rowKey="#{advancesDetail.id}" selectionMode="single" paginator="true" rows="10" paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}">
<f:facet name="header">
<p:commandButton id="toggler" type="button" value="Columnas" style="float:left;" styleClass="amber-btn flat" icon="ui-icon-calendar"/>
<p:columnToggler datasource="dtAdvancesDetail" trigger="toggler" />
<div style="float:right;padding-top: 5px;padding-left: 5px;padding-right: 5px">
<h:commandLink title="Exportar a Excel">
<p:graphicImage name="images/excel-xls-icon.png" library="serenity-layout" width="48"/>
<p:dataExporter type="xls" target="dtAdvancesDetail" fileName="AvancePorUsuario" />
</h:commandLink>
</div>
<p:outputPanel>
<h:outputText value="#{i18n['general.search']}: " />
<p:inputText id="globalFilter" onkeyup="PF('dtAdvancesDetail').filter()" style="width:150px;color: #000000;"/>
</p:outputPanel>
</f:facet>
<p:column headerText="Cliente" sortBy="#{advancesDetail.customerName}" filterBy="#{advancesDetail.customerName}">
<h:outputText value="#{advancesDetail.customerName}" />
</p:column>
<p:column headerText="Domicilio" sortBy="#{advancesDetail.address}" filterBy="#{advancesDetail.address}">
<h:outputText value="#{advancesDetail.address}" />
</p:column>
<p:column headerText="Cobro" sortBy="#{advancesDetail.paymentAmount}" filterBy="#{advancesDetail.paymentAmount}">
<h:outputText value="#{advancesDetail.paymentAmount}" />
</p:column>
<p:column headerText="Tipo" sortBy="#{advancesDetail.typePayment}" filterBy="#{advancesDetail.typePayment}">
<h:outputText value="#{advancesDetail.typePayment}" />
</p:column>
<p:column visible="false" headerText="Cantidad Pagada" sortBy="#{advancesDetail.amountPaid}" filterBy="#{advancesDetail.amountPaid}">
<h:outputText value="#{advancesDetail.amountPaid}" />
</p:column >
<p:column visible="false" headerText="Cantidad a Pagar" sortBy="#{advancesDetail.amountToPay}" filterBy="#{advancesDetail.amountToPay}">
<h:outputText value="#{advancesDetail.amountToPay}" />
</p:column>
<p:column visible="false" headerText="Numero de Accion" sortBy="#{advancesDetail.lastReference}" filterBy="#{advancesDetail.lastReference}">
<h:outputText value="#{advancesDetail.lastReference}" />
</p:column>
<p:column visible="false" headerText="Numero de multas" sortBy="#{advancesDetail.numFee}" filterBy="#{advancesDetail.numFee}">
<h:outputText value="#{advancesDetail.numFee}" />
</p:column>
<p:column visible="false" headerText="Estatus" sortBy="#{advancesDetail.loanStatus}" filterBy="#{advancesDetail.loanStatus}">
<h:outputText value="#{advancesDetail.loanStatus}" />
</p:column>
<p:column headerText="Fecha" sortBy="#{advancesDetail.createdOn}" filterBy="#{advancesDetail.createdOn}">
<h:outputText value="#{advancesDetail.createdOn}">
<f:convertDateTime type="date" locale="es" timeZone="GMT-6" pattern="dd - MMMM - yyyy "/>
</h:outputText>
</p:column>
</p:dataTable>
</div>
</div>
</h:form>
<h:form id="loanForm">