diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dd82ebf --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +/ace-controller/target/ +/ace-layout/target/ +/ace-web/target/ +/ace-security/target/ +/ace-controller-mobile/target/ +/ace-model/target/ +/ace-ws-rest/target/ diff --git a/ace-controller-mobile/nb-configuration.xml b/ace-controller-mobile/nb-configuration.xml new file mode 100644 index 0000000..a65c451 --- /dev/null +++ b/ace-controller-mobile/nb-configuration.xml @@ -0,0 +1,18 @@ + + + + + + JDK_1.8 + + diff --git a/ace-controller-mobile/pom.xml b/ace-controller-mobile/pom.xml new file mode 100644 index 0000000..bda5bee --- /dev/null +++ b/ace-controller-mobile/pom.xml @@ -0,0 +1,81 @@ + + + 4.0.0 + com.arrebol + ace-controller-mobile + 1.0.0 + jar + + UTF-8 + 1.8 + 1.8 + 2.17.0 + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12.4 + + true + + + + + + + + mysql + mysql-connector-java + 8.0.12 + + + + org.apache.logging.log4j + log4j-api + ${log4j.version} + + + org.apache.logging.log4j + log4j-core + ${log4j.version} + + + org.apache.logging.log4j + log4j-slf4j-impl + ${log4j.version} + + + + com.arrebol + ace-model + 1.0.0 + + + + junit + junit + 4.12 + test + + + ace-controller-mobile + \ No newline at end of file diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/admin/ClosingDayController.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/admin/ClosingDayController.java new file mode 100644 index 0000000..a983418 --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/admin/ClosingDayController.java @@ -0,0 +1,91 @@ +/* + * 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.controller.mobile.controller.admin; + +import com.arrebol.apc.controller.mobile.repository.admin.ClosingDayRepository; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.admin.constance.ClosingDayCfg; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.enums.ActiveStatus; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class ClosingDayController implements Serializable { + + /** + * + * @param idEmployee + * @param idOffice + * @return + * @throws Exception + */ + public String findIdClosingDayByEmployee(String idEmployee, String idOffice) throws Exception { + try { + ClosingDayRepository repository = new ClosingDayRepository(); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(ClosingDayCfg.FIELD_USER, new User(idEmployee))); + parameters.add(new ModelParameter(ClosingDayCfg.FIELD_OFFICE, new Office(idOffice))); + + return repository.findIdEntity(ClosingDayCfg.QUERY_FIND_ID_BY_EMPLOYEE_AND_OFFICE_EQUALS_CURRDATE, parameters); + } catch (Exception e) { + logger.error("findIdClosingDayByEmployee", e); + throw e; + } + } + + /** + * + * @param id + * @param updatedBy + * @return + * @throws Exception + */ + public boolean disableClosingDayById(String id, String updatedBy) throws Exception { + try { + ClosingDayRepository repository = new ClosingDayRepository(); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(ClosingDayCfg.FIELD_ID, id)); + parameters.add(new ModelParameter(ClosingDayCfg.FIELD_ACTIVE_STATUS, ActiveStatus.DISABLED)); + parameters.add(new ModelParameter(ClosingDayCfg.FIELD_LAST_UPDATED_BY, updatedBy)); + parameters.add(new ModelParameter(ClosingDayCfg.FIELD_LAST_UPDATED_ON, new Date())); + + return repository.updateClosingDay(ClosingDayCfg.QUERY_UPDATE_CLOSING_DAY_BY_STATUS, parameters); + } catch (Exception e) { + logger.error("disableClosingDayById", e); + throw e; + } + } + + public Long countIdClosingDayByEmployee(String idEmployee, String idOffice) throws Exception { + try { + ClosingDayRepository repository = new ClosingDayRepository(); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(ClosingDayCfg.FIELD_USER, new User(idEmployee))); + parameters.add(new ModelParameter(ClosingDayCfg.FIELD_OFFICE, new Office(idOffice))); + + return repository.countIdClosingDayByEmployee(ClosingDayCfg.QUERY_FIND_ID_BY_EMPLOYEE_AND_OFFICE_EQUALS_CURRDATE, parameters); + } catch (Exception e) { + logger.error("findIdClosingDayByEmployee", e); + throw e; + } + } + + final Logger logger = LogManager.getLogger(getClass()); +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/admin/StableGeneralBoxController.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/admin/StableGeneralBoxController.java new file mode 100644 index 0000000..fa17a49 --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/admin/StableGeneralBoxController.java @@ -0,0 +1,46 @@ +/* + * 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.controller.mobile.controller.admin; + +import com.arrebol.apc.controller.mobile.repository.admin.StableGeneralBoxRepository; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.admin.constance.StableGeneralBoxCfg; +import com.arrebol.apc.model.core.Office; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class StableGeneralBoxController implements Serializable { + + /** + * + * @param idOffice + * @return + * @throws Exception + */ + public boolean existStableGeneralBoxByCreatedOn(String idOffice) throws Exception { + try { + StableGeneralBoxRepository repository = new StableGeneralBoxRepository(); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(StableGeneralBoxCfg.FIELD_OFFICE, new Office(idOffice))); + + return new Long(1).compareTo(repository.countStableGeneralBoxByOfficeEqualsToCurrentDate(StableGeneralBoxCfg.QUERY_COUNT_STABLE_GENERAL_BOX_BY_OFFICE_EQUALS_TO_CURRENT_DATE, parameters)) == 0; + } catch (Exception e) { + logger.error("existStableSmallBoxByCreatedOn", e); + throw e; + } + } + final Logger logger = LogManager.getLogger(getClass()); +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/admin/StableSmallBoxController.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/admin/StableSmallBoxController.java new file mode 100644 index 0000000..be3c449 --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/admin/StableSmallBoxController.java @@ -0,0 +1,95 @@ +/* + * 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.controller.mobile.controller.admin; + +import com.arrebol.apc.controller.mobile.repository.admin.ClosingDayRepository; +import com.arrebol.apc.controller.mobile.repository.admin.StableSmallBoxRepository; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.admin.constance.StableSmallBoxCfg; +import com.arrebol.apc.model.admin.constance.StableSmallBoxCfg; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.enums.ActiveStatus; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class StableSmallBoxController implements Serializable { + + /** + * + * @param id + * @param updatedBy + * @return + * @throws Exception + */ + public boolean disableIdSmallBoxById(String id, String updatedBy) throws Exception { + try { + ClosingDayRepository repository = new ClosingDayRepository(); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(StableSmallBoxCfg.FIELD_ID, id)); + parameters.add(new ModelParameter(StableSmallBoxCfg.FIELD_ACTIVE_STATUS, ActiveStatus.DISABLED)); + parameters.add(new ModelParameter(StableSmallBoxCfg.FIELD_LAST_UPDATED_BY, updatedBy)); + parameters.add(new ModelParameter(StableSmallBoxCfg.FIELD_LAST_UPDATED_ON, new Date())); + + return repository.updateClosingDay(StableSmallBoxCfg.QUERY_UPDATE_STABLE_SMALL_BOX_BY_STATUS, parameters); + } catch (Exception e) { + logger.error("disableIdSmallBoxById", e); + throw e; + } + } + + /** + * + * @param idOffice + * @return + * @throws Exception + */ + public boolean existStableSmallBoxByCreatedOn(String idOffice) throws Exception { + try { + StableSmallBoxRepository repository = new StableSmallBoxRepository(); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(StableSmallBoxCfg.FIELD_OFFICE, new Office(idOffice))); + + return new Long(1).compareTo(repository.countStableSmallBoxByOfficeEqualsToCurrentDate(StableSmallBoxCfg.QUERY_COUNT_STABLE_SMALL_BOX_BY_OFFICE_EQUALS_TO_CURDATE, parameters)) == 0; + } catch (Exception e) { + logger.error("existStableSmallBoxByCreatedOn", e); + throw e; + } + } + + /** + * + * @param idOffice + * @return + * @throws Exception + */ + public String findIdStableSmallBoxByOfficeInCurrentDate(String idOffice) throws Exception { + try { + ClosingDayRepository repository = new ClosingDayRepository(); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(StableSmallBoxCfg.FIELD_OFFICE, new Office(idOffice))); + + return repository.findIdEntity(StableSmallBoxCfg.QUERY_FIND_STABLE_SMALL_BOX_BY_OFFICE_EQUALS_TO_CURRENT_DATE, parameters); + } catch (Exception e) { + logger.error("findIdStableSmallBoxByOfficeInCurrentDate", e); + throw e; + } + } + + final Logger logger = LogManager.getLogger(getClass()); +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/bitacora/BitacoraController.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/bitacora/BitacoraController.java new file mode 100644 index 0000000..d1c0334 --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/bitacora/BitacoraController.java @@ -0,0 +1,59 @@ +/* + * 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.controller.mobile.controller.bitacora; + +import com.arrebol.apc.controller.mobile.repository.bitacora.BitacoraRepository; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.system.logs.Bitacora; +import java.io.Serializable; +import java.util.Date; +import java.util.UUID; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class BitacoraController implements Serializable { + + /** + * + * @param action + * @param userName + * @param comments + * @param createdBy + * @param office + * @param description + * @return + */ + public boolean insertBitacoraRecord(String action, String userName, String comments, String createdBy, String office, String description) { + boolean success; + try { + BitacoraRepository repository = new BitacoraRepository(); + Bitacora bitacora = new Bitacora(); + + bitacora.setId(UUID.randomUUID().toString()); + bitacora.setNameUser(userName); + bitacora.setAction(action); + bitacora.setCommentsUser(comments); + bitacora.setCreatedBy(createdBy); + bitacora.setCreatedOn(new Date()); + bitacora.setOffice(new Office(office)); + bitacora.setDescription(description); + + success = repository.saveBitacora(bitacora); + } catch (Exception e) { + success = false; + logger.error("insertBitacoraRecord", e); + } + return success; + } + + final Logger logger = LogManager.getLogger(getClass()); +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/cash/CashRegisterCurdateByUserController.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/cash/CashRegisterCurdateByUserController.java new file mode 100644 index 0000000..4747225 --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/cash/CashRegisterCurdateByUserController.java @@ -0,0 +1,107 @@ +/* + * 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.controller.mobile.controller.cash; + +import com.arrebol.apc.controller.mobile.repository.views.CashRegisterCurdateByUserViewRepository; +import com.arrebol.apc.controller.mobile.repository.views.TotalCashByCurdateViewRepository; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.core.constance.CashRegisterCurdateByUserViewCfg; +import com.arrebol.apc.model.views.CashRegisterCurdateByUserView; +import com.arrebol.apc.model.views.TotalCashByCurdateView; +import com.arrebol.apc.model.ws.parsed.AmountJaxb; +import com.arrebol.apc.model.ws.parsed.CashRegisterJaxb; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class CashRegisterCurdateByUserController implements Serializable { + + /** + * + * @param userId + * @return + * @throws Exception + */ + public CashRegisterJaxb findAllCashRegisterCurdateByUserId(String userId) throws Exception { + logger.debug("findAllCashRegisterCurdateByUserId"); + try { + List parameters = new ArrayList<>(); + + parameters.add( + new ModelParameter( + CashRegisterCurdateByUserViewCfg.FIELD_USER_ID, + userId + ) + ); + + Double totalCash = 0d; + List amounts = new ArrayList<>(); + + List results = cashRegisterCurdateByUserViewRepository.findAllCashRegisterCurdateByUserId( + CashRegisterCurdateByUserView.class, + CashRegisterCurdateByUserViewCfg.QUERY_FIND_CASH_REGISTER, + parameters); + + for (CashRegisterCurdateByUserView result : results) { + totalCash += result.getPayment().doubleValue(); + + amounts.add( + new AmountJaxb( + result.getCustomerName(), + result.getPayment().doubleValue() + ) + ); + } + + return new CashRegisterJaxb(totalCash, amounts); + } catch (Exception e) { + logger.error("findAllCashRegisterCurdateByUserId", e); + throw e; + } + } + + /** + * + * @param userId + * @return + * @throws Exception + */ + public TotalCashByCurdateView findDailyTotalsByUserId(String userId) throws Exception { + logger.debug("findById"); + try { + TotalCashByCurdateView result = totalCashByCurdateViewRepository.findById(userId); + + if (null == result) { + throw new NullPointerException("userId: " + userId + " NOT found"); + } else { + return result; + } + } catch (Exception e) { + logger.error("findById", e); + throw e; + } + } + + private static final long serialVersionUID = -3434981661467291172L; + final Logger logger = LogManager.getLogger(CashRegisterCurdateByUserController.class); + + private final CashRegisterCurdateByUserViewRepository cashRegisterCurdateByUserViewRepository; + private final TotalCashByCurdateViewRepository totalCashByCurdateViewRepository; + + public CashRegisterCurdateByUserController() { + this.cashRegisterCurdateByUserViewRepository = new CashRegisterCurdateByUserViewRepository(); + this.totalCashByCurdateViewRepository = new TotalCashByCurdateViewRepository(); + } + +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/customer/CustomerController.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/customer/CustomerController.java new file mode 100644 index 0000000..74734ae --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/customer/CustomerController.java @@ -0,0 +1,63 @@ +/* + * 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.controller.mobile.controller.customer; + +import com.arrebol.apc.controller.mobile.repository.views.LoanByUserViewRepository; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.core.constance.LoanByUserViewCfg; +import com.arrebol.apc.model.enums.PreferenceValue; +import com.arrebol.apc.model.views.LoanByUserView; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class CustomerController implements Serializable { + + /** + * + * @param orderList + * @param userId + * @return + * @throws Exception + */ + public List findAllLoansByUserId(String orderList, String userId) throws Exception { + try { + List parameters = new ArrayList<>(); + + boolean isByOrderInList = PreferenceValue.ORDER_IN_LIST.toString().equals(orderList); + + parameters.add(new ModelParameter(LoanByUserViewCfg.FIELD_USER_ID, userId)); + + return loanByUserViewRepository + .findAllLoansByUserId( + isByOrderInList + ? LoanByUserViewCfg.QUERY_FIND_ALL_LOAN_BY_USER_ID_BY_ORDER_LIST + : LoanByUserViewCfg.QUERY_FIND_ALL_LOAN_BY_USER_ID_BY_CUSTOMER_NAME, + parameters + ); + } catch (Exception e) { + logger.error("findAllLoansByUserId", e); + throw e; + } + } + + private static final long serialVersionUID = -6689182942800786108L; + final Logger logger = LogManager.getLogger(CustomerController.class); + + private final LoanByUserViewRepository loanByUserViewRepository; + + public CustomerController() { + this.loanByUserViewRepository = new LoanByUserViewRepository(); + } +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/exchange/ExchangeEnebledUsersController.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/exchange/ExchangeEnebledUsersController.java new file mode 100644 index 0000000..abdf1aa --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/exchange/ExchangeEnebledUsersController.java @@ -0,0 +1,165 @@ +/* + * 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.controller.mobile.controller.exchange; + +import com.arrebol.apc.controller.mobile.repository.admin.TransferRepository; +import com.arrebol.apc.controller.mobile.repository.views.ExchangeEnebledUsersViewRepository; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.admin.Transfer; +import com.arrebol.apc.model.admin.constance.TransferCfg; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.core.constance.ExchangeEnebledUsersViewCfg; +import com.arrebol.apc.model.enums.ActionStatus; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.views.ExchangeEnebledUsersView; +import com.arrebol.apc.model.ws.parsed.Exchange; +import com.arrebol.apc.model.ws.parsed.ExchangeJaxb; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class ExchangeEnebledUsersController implements Serializable { + + /** + * + * @param userId + * @param officeId + * @return + * @throws Exception + */ + public List findEnebledUsersToUserId(String userId, String officeId) throws Exception { + logger.debug("exchangeEnebledUsersViewRepository"); + try { + List parameters = new ArrayList<>(); + + parameters.add( + new ModelParameter( + ExchangeEnebledUsersViewCfg.PARAM_OFFICE_ID, + officeId + ) + ); + + parameters.add( + new ModelParameter( + ExchangeEnebledUsersViewCfg.FIELD_VIEW_ID, + userId + ) + ); + + return exchangeEnebledUsersViewRepository.findEnebledUsersToUserId( + ExchangeEnebledUsersViewCfg.QUERY_FIND_ENEBLED_USERS_TO_USER_ID, + parameters + ); + } catch (Exception e) { + logger.error("findEnebledUsersToUserId", e); + throw e; + } + } + + /** + * + * @param jaxb + * @return + * @throws Exception + */ + public boolean newExchange(ExchangeJaxb jaxb) throws Exception { + logger.debug("newExchange"); + try { + Transfer transfer = new Transfer( + new User(jaxb.getSenderId()), + new User(jaxb.getReceiverId()), + ActiveStatus.ENEBLED, + ActionStatus.PENDING, + jaxb.getAmount(), + new Office(jaxb.getOfficeId()), + jaxb.getSenderId()); + + return transferRepository.addTransfer(transfer); + } catch (Exception e) { + logger.error("newExchange", e); + throw e; + } + } + + /** + * + * @param transerId + * @param userId + * @param isApproved + * @return + * @throws Exception + */ + public boolean updateExchange(String transerId, String userId, boolean isApproved) throws Exception { + logger.debug("updateExchange"); + try { + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(TransferCfg.FIELD_ACTION_STATUS, isApproved ? ActionStatus.APPROVED : ActionStatus.REJECTED)); + parameters.add(new ModelParameter(TransferCfg.FIELD_LAST_UPDATED_BY, userId)); + parameters.add(new ModelParameter(TransferCfg.FIELD_LAST_UPDATED_ON, new Date())); + parameters.add(new ModelParameter(TransferCfg.FIELD_ID, transerId)); + + return transferRepository.updateTransfer(TransferCfg.QUERY_UPDATE_TRANSFER_BY_ACTION, parameters); + } catch (Exception e) { + logger.error("updateExchange", e); + throw e; + } + } + + /** + * + * @param userId + * @return + * @throws Exception + */ + public List exchangesByUsers(String userId) throws Exception { + logger.debug("exchangesByUsers"); + try { + List parameters = new ArrayList<>(); + + parameters.add( + new ModelParameter( + TransferCfg.FIELD_USER_TRANSMITTER, + new User(userId) + ) + ); + + parameters.add( + new ModelParameter( + TransferCfg.FIELD_USER_RECEIVER, + new User(userId) + ) + ); + + return transferRepository.findAllTransferByUserIdAndCurdate(TransferCfg.QUERY_FIND_ALL_TRANSFER_BY_USER_ID_AND_CURDATE, parameters); + } catch (Exception e) { + logger.error("exchangesByUsers", e); + throw e; + } + } + + private static final long serialVersionUID = 2625775904919860613L; + final Logger logger = LogManager.getLogger(ExchangeEnebledUsersController.class); + + private final ExchangeEnebledUsersViewRepository exchangeEnebledUsersViewRepository; + private final TransferRepository transferRepository; + + public ExchangeEnebledUsersController() { + this.exchangeEnebledUsersViewRepository = new ExchangeEnebledUsersViewRepository(); + this.transferRepository = new TransferRepository(); + } + +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/gasoline/GasolineController.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/gasoline/GasolineController.java new file mode 100644 index 0000000..282ac51 --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/gasoline/GasolineController.java @@ -0,0 +1,41 @@ +/* + * 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.controller.mobile.controller.gasoline; + +import com.arrebol.apc.controller.mobile.repository.gasoline.GasolineRepository; +import com.arrebol.apc.model.gasoline.Gasoline; +import java.io.Serializable; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class GasolineController implements Serializable { + + /** + * + * @param gasoline + * @return + * @throws Exception + */ + public boolean saveNewGasolinePayment(Gasoline gasoline) throws Exception { + try { + GasolineRepository gasolineRepository = new GasolineRepository(); + + return gasolineRepository.saveNewGasolinePayment(gasoline); + } catch (Exception e) { + logger.error("addNewGasolineEntry", e); + throw e; + } + } + + private static final long serialVersionUID = -5280895557294295000L; + final Logger logger = LogManager.getLogger(getClass()); +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/loan/LoanController.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/loan/LoanController.java new file mode 100644 index 0000000..3f874bc --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/loan/LoanController.java @@ -0,0 +1,1398 @@ +/* + * 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.controller.mobile.controller.loan; + +import com.arrebol.apc.controller.mobile.json.loan.AuthorizeTransferList; +import com.arrebol.apc.controller.mobile.json.loan.AuthorizeTransferPaymentsDto; +import com.arrebol.apc.controller.mobile.json.loan.DeleteLoanDetailsJaxb; +import com.arrebol.apc.model.ws.parsed.LoanRequestedJaxb; +import com.arrebol.apc.controller.mobile.json.loan.LoanTypeJaxb; +import com.arrebol.apc.controller.mobile.json.loan.LoanTypeListJaxb; +import com.arrebol.apc.controller.mobile.json.loan.UpdateLoanToDeliveryStatusDTO; +import com.arrebol.apc.controller.mobile.json.loan.UpdateLoanToDeliveryStatusList; +import com.arrebol.apc.controller.mobile.repository.loan.AddAmountRepository; +import com.arrebol.apc.controller.mobile.repository.loan.LoanByRenovationRepository; +import com.arrebol.apc.controller.mobile.repository.loan.LoanDetailsRepository; +import com.arrebol.apc.controller.mobile.repository.loan.LoanFeeNotificationRepository; +import com.arrebol.apc.controller.mobile.repository.loan.LoanRepository; +import com.arrebol.apc.controller.mobile.repository.loan.LoanToDeliveryByCertifierRepository; +import com.arrebol.apc.controller.mobile.repository.loan.LoanTypeRepository; +import com.arrebol.apc.controller.mobile.repository.user.UserRepository; +import com.arrebol.apc.controller.mobile.repository.views.LoanApprovedDetailViewRepository; +import com.arrebol.apc.controller.mobile.repository.views.LoanInPendingStatusToDeliveryViewRepository; +import com.arrebol.apc.controller.mobile.repository.views.SearchPersonAvailableRepository; +import com.arrebol.apc.controller.mobile.repository.views.TransferInPendingStatusViewRepository; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.catalog.People; +import com.arrebol.apc.model.catalog.RouteCtlg; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.core.constance.AvailableCustomersViewCfg; +import com.arrebol.apc.model.core.constance.AvailableEndorsementsViewCfg; +import com.arrebol.apc.model.core.constance.LoanByUserCfg; +import com.arrebol.apc.model.core.constance.LoanCfg; +import com.arrebol.apc.model.core.constance.LoanDetailsCfg; +import com.arrebol.apc.model.core.constance.LoanFeeNotificationCfg; +import com.arrebol.apc.model.core.constance.LoanToDeliveryByCertifierViewCfg; +import com.arrebol.apc.model.core.constance.LoanTypeCfg; +import com.arrebol.apc.model.core.constance.UserCfg; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.enums.ComissionType; +import com.arrebol.apc.model.enums.LoanDetailsType; +import com.arrebol.apc.model.enums.LoanStatus; +import com.arrebol.apc.model.enums.OwnerLoan; +import com.arrebol.apc.model.enums.PeopleType; +import com.arrebol.apc.model.enums.TransferStatus; +import com.arrebol.apc.model.loan.Delivery; +import com.arrebol.apc.model.loan.Loan; +import com.arrebol.apc.model.loan.LoanByRenovation; +import com.arrebol.apc.model.loan.LoanByUser; +import com.arrebol.apc.model.loan.LoanByUserId; +import com.arrebol.apc.model.loan.LoanDetails; +import com.arrebol.apc.model.loan.LoanFeeNotification; +import com.arrebol.apc.model.loan.LoanType; +import com.arrebol.apc.model.views.AvailableCustomersView; +import com.arrebol.apc.model.views.AvailableEndorsementsView; +import com.arrebol.apc.model.views.LoanInPendingStatusToDeliveryView; +import com.arrebol.apc.model.views.LoanToDeliveryByCertifierView; +import com.arrebol.apc.model.views.TransferInPendingStatusView; +import com.arrebol.apc.model.views.constance.LoanInPendingStatusToDeliveryViewCfg; +import com.arrebol.apc.model.views.constance.TransferInPendingStatusViewCfg; +import com.arrebol.apc.model.ws.parsed.FeesToPayByLoanRequestJaxb; +import com.arrebol.apc.model.ws.parsed.LoanDetailJaxb; +import com.arrebol.apc.model.ws.parsed.NewAmountJaxb; +import com.arrebol.apc.model.ws.parsed.NewTransferAccountJaxb; +import com.arrebol.apc.model.ws.parsed.PersonJaxb; +import java.io.Serializable; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.text.NumberFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Locale; +import java.util.UUID; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class LoanController implements Serializable { + + /** + * + * @param loanIdToUpdate + * @return + */ + public boolean deleteLoanDetailsFeeByLoanCurdate(String loanIdToUpdate) { + logger.debug("deleteLoanDetailsFeeByLoanCurdate"); + + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanCfg.FIELD_DETAILS_LOAN, new Loan(loanIdToUpdate))); + return loanRepository.deleteLoanDetailsByLoanCurdate(LoanCfg.QUERY_DELETE_LOAN_DETAILS_FEE_CURDATE_BY_LOAN, parameters); + } + + /** + * + * @param loanIdToUpdate + * @return + */ + public boolean deleteLoanFeeNotificationByLoanCurdate(String loanIdToUpdate) { + logger.debug("deleteLoanFeeNotificationByLoanCurdate"); + + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanCfg.FIELD_DETAILS_LOAN, new Loan(loanIdToUpdate))); + + return loanRepository.deleteLoanDetailsByLoanCurdate(LoanCfg.QUERY_DELETE_LOAN_FEE_NOTIFICATION_CURDATE_BY_LOAN, parameters); + } + + /** + * + * @param loan + * @return + * @throws Exception + */ + public boolean updateLoan(Loan loan) throws Exception { + logger.debug("updateLoan"); + try { + return loanRepository.updateLoan(loan); + } catch (Exception e) { + logger.error("updateLoan", e); + throw e; + } + } + + /** + * + * @param loanIdToUpdate + * @return + */ + public boolean deleteLoanDetailsByLoanCurdate(Loan loanIdToUpdate) { + logger.debug("updateLoandByUserByUserId"); + + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanCfg.FIELD_DETAILS_LOAN, loanIdToUpdate)); + + return loanRepository.deleteLoanDetailsByLoanCurdate(LoanCfg.QUERY_DELETE_LOAN_DETAILS_CURDATE_BY_LOAN, parameters); + } + + /** + * + * @param customerId + * @param userId + * @return + * @throws Exception + */ + public DeleteLoanDetailsJaxb enebleToDeleteTodayDetails(String customerId, String userId) throws Exception { + DeleteLoanDetailsJaxb result; + try { + List parameters = new ArrayList<>(); + List statuses = new ArrayList<>(); + + parameters.add(new ModelParameter(UserCfg.FIELD_ID, userId)); + UserRepository userRepository = new UserRepository(); + + if (userRepository.containtsUserManagementProperty(UserCfg.QUERY_IS_USER_MANAGMENT, parameters)) { + statuses.add(LoanStatus.APPROVED); + statuses.add(LoanStatus.PENDING_RENOVATION); + + parameters.clear(); + parameters.add(new ModelParameter(LoanCfg.FIELD_CUSTOMER, new People(customerId))); + parameters.add(new ModelParameter(LoanCfg.FIELD_LOAN_STATUS, statuses)); + + if (1 == loanRepository.countLoan(LoanCfg.QUERY_COUNT_LOAN_BY_CUSTOMER_IN_STATUSES, parameters)) { + String loanId = loanRepository.findLoanId(LoanCfg.QUERY_SELECT_LOAN_ID_BY_CUSTOMER_IN_STATUSES, parameters); + + result = new DeleteLoanDetailsJaxb(Boolean.FALSE, Boolean.FALSE, loanId); + List types = new ArrayList<>(); + + parameters.clear(); + parameters.add(new ModelParameter(LoanCfg.FIELD_ID, loanId)); + parameters.add(new ModelParameter(LoanCfg.FIELD_LOAN_STATUS, statuses)); + + result.setApprovedOrPendingRenovation(0 < loanRepository.countLoan(LoanCfg.QUERY_COUNT_LOAN_IN_STATUSES, parameters)); + + if (result.getApprovedOrPendingRenovation()) { + types.add(LoanDetailsType.PAYMENT); + types.add(LoanDetailsType.TRANSFER); + + parameters.clear(); + parameters.add(new ModelParameter(LoanDetailsCfg.FIELD_ID_LOAN, new Loan(loanId))); + parameters.add(new ModelParameter(LoanDetailsCfg.FIELD_LOAN_DETAILS_TYPE, types)); + + result.setTodayPayment(0 < loanDetailsRepository.countLoandDetails(LoanDetailsCfg.QUERY_COUNT_LOAN_DETAILS_IN_CURRDATE, parameters)); + + types.clear(); + types.add(LoanDetailsType.FEE); + + parameters.clear(); + parameters.add(new ModelParameter(LoanDetailsCfg.FIELD_ID_LOAN, new Loan(loanId))); + parameters.add(new ModelParameter(LoanDetailsCfg.FIELD_LOAN_DETAILS_TYPE, types)); + + result.setTodayFee(0 < loanDetailsRepository.countLoandDetails(LoanDetailsCfg.QUERY_COUNT_LOAN_DETAILS_IN_CURRDATE, parameters)); + } + } else { + result = new DeleteLoanDetailsJaxb(Boolean.FALSE, Boolean.FALSE, Boolean.FALSE, ""); + } + } else { + result = new DeleteLoanDetailsJaxb(Boolean.FALSE, Boolean.FALSE, Boolean.FALSE, ""); + } + + return result; + } catch (Exception e) { + logger.error("enebleToDeleteTodayDetails", e); + throw e; + } + } + + /** + * + * @param idLoan + * @return + * @throws Exception + */ + public List findFeesToPayByLoanId(String idLoan) throws Exception { + try { + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanDetailsCfg.FIELD_ID_LOAN, new Loan(idLoan))); + return loanDetailsRepository.findFeesToPayByLoanId(LoanDetailsCfg.QUERY_FIND_ALL_FEES_BY_LOAN_ID, parameters); + } catch (Exception e) { + logger.error("findFeesToPayByLoanId", e); + throw e; + } + } + + /** + * + * @param feesToPayByLoanRequestJaxb + * @return + * @throws Exception + */ + public boolean updatePaidFeesStatusInLoanDetailIds(FeesToPayByLoanRequestJaxb feesToPayByLoanRequestJaxb) throws Exception { + try { + List parameters = new ArrayList<>(); + + List ids = new ArrayList<>(); + + feesToPayByLoanRequestJaxb.getFeeToPayList().forEach(fee -> { + ids.add(fee.getId()); + }); + + int cantidad = feesToPayByLoanRequestJaxb.getFeeToPayList().size(); + String texto; + String precio; + + Locale canada = new Locale("en", "CA"); + NumberFormat dollarFormat = NumberFormat.getCurrencyInstance(canada); + BigDecimal feePayment; + + if (1 == cantidad) { + precio = dollarFormat.format(50); + feePayment = new BigDecimal("50"); + + texto = " de la multa del " + feesToPayByLoanRequestJaxb.getFeeToPayList().get(0).getStrDateToPay(); + } else { + feePayment = new BigDecimal(50 * cantidad); + precio = dollarFormat.format(50 * cantidad); + String fechas = ""; + + for (int i = 0; i < feesToPayByLoanRequestJaxb.getFeeToPayList().size(); i++) { + fechas = fechas + feesToPayByLoanRequestJaxb.getFeeToPayList().get(i).getStrDateToPay(); + if (feesToPayByLoanRequestJaxb.getFeeToPayList().size() > 1) { + fechas = fechas + ","; + } + } + + if (feesToPayByLoanRequestJaxb.getFeeToPayList().size() > 1) { + fechas = fechas.substring(0, fechas.length() - 1); + } + + texto = " de las multas " + fechas; + } + + String comments = "Se pago " + precio + texto; + + LoanDetails details = new LoanDetails( + UUID.randomUUID().toString(), + new Loan(feesToPayByLoanRequestJaxb.getIdLoan()), + new User(feesToPayByLoanRequestJaxb.getIdUser()), + PeopleType.CUSTOMER, + 0, + feePayment, + LoanDetailsType.PAYMENT, + comments, + feesToPayByLoanRequestJaxb.getIdUser(), + new Date()); + + parameters.add(new ModelParameter(LoanDetailsCfg.FIELD_ID, ids)); + + return loanDetailsRepository.updatePaidFeesStatusInLoanDetailIds(LoanDetailsCfg.QUERY_UPDATE_PAID_FEES_STATUS_IN_LOAN_DETAILS_IDS, parameters, details); + } catch (Exception e) { + logger.error("updatePaidFeesStatusInLoanDetailIds", e); + throw e; + } + } + + /** + * + * @param officeId + * @return + * @throws Exception + */ + public LoanTypeListJaxb findAllLoanTypeByOffice(String officeId) throws Exception { + logger.debug("findAllLoanTypeByOffice"); + LoanTypeListJaxb loanTypeListJaxb = new LoanTypeListJaxb(); + try { + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanTypeCfg.FIELD_OFFICE, new Office(officeId))); + + List results = loanTypeRepository.findAllLoanTypeByOffice(LoanTypeCfg.QUERY_FIND_ALL_LOAN_TYPE_WITH_DESCRIPTION_BY_OFFICE, parameters); + List loanTypeJaxbs = new ArrayList<>(); + + results.forEach((result) -> { + loanTypeJaxbs.add(new LoanTypeJaxb(result.getId(), result.getPayment(), result.getLoanTypeName())); + }); + + loanTypeListJaxb.setLoans(loanTypeJaxbs); + + return loanTypeListJaxb; + } catch (Exception e) { + logger.error("findAllLoanTypeByOffice", e); + throw e; + } + } + + /** + * + * @param name + * @return + * @throws Exception + */ + public List findAllAvailableCustomersByType(String name) throws Exception { + logger.debug("findAllAvailableCustomersByType"); + try { + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(AvailableCustomersViewCfg.FIELD_AVAILABLE_PERSON, name)); + + return searchPersonAvailableRepository.findAvailablePersonLike( + AvailableCustomersView.class, + AvailableCustomersViewCfg.QUERY_FIND_AVAILABLE_CUSTOMERS, + parameters); + } catch (Exception e) { + logger.error("findAllAvailableCustomersByType", e); + throw e; + } + } + + /** + * + * @param name + * @return + * @throws Exception + */ + public List findAllAvailableEndorsementsByType(String name) throws Exception { + logger.debug("findAllAvailableEndorsementsByType"); + try { + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(AvailableEndorsementsViewCfg.FIELD_AVAILABLE_PERSON, name)); + + return searchPersonAvailableRepository.findAvailablePersonLike( + AvailableEndorsementsView.class, + AvailableEndorsementsViewCfg.QUERY_FIND_AVAILABLE_ENDORSEMENTS, + parameters); + } catch (Exception e) { + logger.error("findAllAvailableEndorsementsByType", e); + throw e; + } + } + + /** + * + * @param jaxb + * @return + * @throws Exception + */ + synchronized public boolean createLoan(LoanRequestedJaxb jaxb) throws Exception { + logger.debug("createLoan"); + + try { + + if (!jaxb.getCustomer().isCreatePerson() + && !verifyPersonAvailability( + AvailableCustomersView.class, + jaxb.getCustomer().getId() + )) { + throw new Exception(user_unavailable); + } + + if (!jaxb.getEndorsement().isCreatePerson() + && !verifyPersonAvailability( + AvailableEndorsementsView.class, + jaxb.getEndorsement().getId() + )) { + throw new Exception(user_unavailable); + } + +//DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Date date = new Date();//dateFormat.parse(jaxb.getStrDate()); + + LoanByUser loanByUser = new LoanByUser( + new LoanByUserId(null, jaxb.getUserId()), + LoanStatus.PENDING, + OwnerLoan.CURRENT_OWNER, + jaxb.getUserId()); + + LoanType loanType = loanTypeRepository.findLoanType(jaxb.getLoanTypeId()); + RouteCtlg routeCtlg = new RouteCtlg(jaxb.getRouteId()); + + Loan loan = new Loan( + new LoanType(loanType.getId()), + null, + null, + routeCtlg, + LoanStatus.PENDING, + BigDecimal.ZERO, + loanType.getPaymentTotal(), + 0, + jaxb.getUserId(), + date, + jaxb.getCustomer().isCreatePerson() ? ActiveStatus.ENEBLED : ActiveStatus.DISABLED, + ActiveStatus.DISABLED // FROZEN funcationality + ); + return loanRepository.createLoan( + loan, + loanByUser, + jaxb); + } catch (Exception e) { + logger.error("createLoan", e); + throw e; + } + } + + /** + * + * @param newAmountJaxb + * @return + * @throws Exception + */ + public boolean saveNewAmount(NewAmountJaxb newAmountJaxb) throws Exception { + logger.debug("saveNewAmount"); + + LoanFeeNotification notification = null; + try { + //DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Date date = new Date();//dateFormat.parse(newAmountJaxb.getStrDate()); + List parameters = new ArrayList<>(); + + if (newAmountJaxb.isFee()) { + parameters.add( + new ModelParameter( + LoanFeeNotificationCfg.FIELD_LOAN, + new Loan(newAmountJaxb.getLoanId()) + ) + ); + + Long total = loanFeeNotificationRepository.countNotificationByLoanId( + Long.class, + LoanFeeNotificationCfg.QUERY_COUNT_NOTIFICATION_BY_LOAN_ID, + parameters); + + notification = new LoanFeeNotification( + new Loan(newAmountJaxb.getLoanId()), + new User(newAmountJaxb.getUserId()), + (total.intValue() + 1), + newAmountJaxb.getUserId(), + date + ); + } + + if (newAmountJaxb.isFee() && null == notification) { + throw new Exception("Could not create the notification for the loan " + newAmountJaxb.getLoanId()); + } + + Loan loan = loanRepository.findLoanById(newAmountJaxb.getLoanId()); + int referenceNumber = loan.getLastReferenceNumber() + 1; + + LoanDetails loanDetails = new LoanDetails( + new Loan(newAmountJaxb.getLoanId()), + new User(newAmountJaxb.getUserId()), + newAmountJaxb.isCustomer() ? PeopleType.CUSTOMER : PeopleType.ENDORSEMENT, + newAmountJaxb.getAmount(), + referenceNumber, + newAmountJaxb.isFee() ? LoanDetailsType.FEE : LoanDetailsType.PAYMENT, + newAmountJaxb.getUserId(), + date, + newAmountJaxb.getComments() + ); + + BigDecimal newAmountPaid, newAmountToPay; + + if (newAmountJaxb.isFee()) { + newAmountPaid = loan.getAmountPaid(); + newAmountToPay = loan.getAmountToPay().add(newAmountJaxb.getAmount()); + } else { + newAmountPaid = loan.getAmountPaid().add(newAmountJaxb.getAmount()); + newAmountToPay = loan.getAmountToPay(); + } + + parameters.clear(); + + String query = LoanCfg.QUERY_UPDATE_LOAN_BY_ID; + + if (!newAmountJaxb.isFee() && 0 == loan.getAmountToPay().compareTo(newAmountPaid)) { + parameters.add(new ModelParameter(LoanCfg.FIELD_LOAN_STATUS, LoanStatus.FINISH)); + + query = LoanCfg.QUERY_UPDATE_AND_FINISH_LOAN_BY_ID; + } + + parameters.add(new ModelParameter(LoanCfg.FIELD_AMOUNT_PAID, newAmountPaid)); + parameters.add(new ModelParameter(LoanCfg.FIELD_AMOUNT_TO_PAY, newAmountToPay)); + parameters.add(new ModelParameter(LoanCfg.FIELD_LAST_REFERENCE_NUMBER, referenceNumber)); + parameters.add(new ModelParameter(LoanCfg.FIELD_LAST_UPDATED_BY, newAmountJaxb.getUserId())); + parameters.add(new ModelParameter(LoanCfg.FIELD_LAST_UPDATED_ON, date)); + parameters.add(new ModelParameter(LoanCfg.FIELD_ID, newAmountJaxb.getLoanId())); + + return addAmountRepository.saveNewAmount(notification, loanDetails, query, parameters); + } catch (Exception e) { + logger.error("saveNewAmount", e); + throw e; + } + } + + /** + * + * @param transfer + * @return + * @throws Exception + */ + public boolean saveNewTransferAmount(NewTransferAccountJaxb transfer) throws Exception { + logger.debug("saveNewTransferAmount"); + + LoanFeeNotification notification = null; + try { + Date date = new Date(); + List parameters = new ArrayList<>(); + + Loan loan = loanRepository.findLoanById(transfer.getLoanId()); + int referenceNumber = loan.getLastReferenceNumber() + 1; + + BigDecimal amountWithoutIVA = transfer.getAmount().divide(new BigDecimal(1.16),RoundingMode.FLOOR); + + amountWithoutIVA = amountWithoutIVA.setScale(2, RoundingMode.FLOOR); + + StringBuilder comments = new StringBuilder(transfer.getComments()); + + comments.append(". Monto de transferencia con IVA: $"); + comments.append(transfer.getAmount()); + comments.append(", monto de transferencia sin IVA: $"); + comments.append(amountWithoutIVA); + + LoanDetails loanDetails = new LoanDetails( + new Loan(transfer.getLoanId()), + new User(transfer.getUserId()), + PeopleType.CUSTOMER, + amountWithoutIVA, + referenceNumber, + LoanDetailsType.TRANSFER, + transfer.getUserId(), + date, + transfer.getComments(), + null == transfer.getTransferReference() || transfer.getTransferReference().trim().equals("") ? "Asesor no guardo la referencia de la transferencia. Rechar directamente o solicitar con el administrador la aclaraciĆ³n." : transfer.getTransferReference(), + TransferStatus.PENDING + ); + + BigDecimal newAmountPaid = loan.getAmountPaid().add(amountWithoutIVA); + + parameters.clear(); + + String query = LoanCfg.QUERY_UPDATE_LOAN_BY_ID; + + if (0 == loan.getAmountToPay().compareTo(newAmountPaid)) { + parameters.add(new ModelParameter(LoanCfg.FIELD_LOAN_STATUS, LoanStatus.FINISH)); + + query = LoanCfg.QUERY_UPDATE_AND_FINISH_LOAN_BY_ID; + } + + parameters.add(new ModelParameter(LoanCfg.FIELD_AMOUNT_PAID, newAmountPaid)); + parameters.add(new ModelParameter(LoanCfg.FIELD_AMOUNT_TO_PAY, loan.getAmountToPay())); + parameters.add(new ModelParameter(LoanCfg.FIELD_LAST_REFERENCE_NUMBER, referenceNumber)); + parameters.add(new ModelParameter(LoanCfg.FIELD_LAST_UPDATED_BY, transfer.getUserId())); + parameters.add(new ModelParameter(LoanCfg.FIELD_LAST_UPDATED_ON, date)); + parameters.add(new ModelParameter(LoanCfg.FIELD_ID, transfer.getLoanId())); + + return addAmountRepository.saveNewAmount(notification, loanDetails, query, parameters); + } catch (Exception e) { + logger.error("saveNewTransferAmount", e); + throw e; + } + } + + /** + * This method is for get all loan types applying some business rules, like + * number of Fees and if you are ok in 100% you can get next loan. + * + * @param officeId + * @param loanId + * @return + * @throws Exception + */ + public LoanTypeListJaxb findNewCreditLimit(String officeId, String loanId) throws Exception { + logger.debug("findNewCreditLimit"); + LoanTypeListJaxb loanTypeListJaxb = new LoanTypeListJaxb(); + try { + List parameters = new ArrayList<>(); + + parameters.add( + new ModelParameter( + LoanTypeCfg.FIELD_OFFICE, + new Office(officeId) + ) + ); + + parameters.add( + new ModelParameter( + LoanTypeCfg.PARAM_LOAN, + new Loan(loanId) + ) + ); + + parameters.add( + new ModelParameter( + LoanTypeCfg.PARAM_LOAN_ID, + loanId + ) + ); + + List results = loanTypeRepository.findIdAndPaymentLoans(LoanTypeCfg.QUERY_FIND_NEW_CREDIT_LINE_BY_LOAN_ID, parameters); + List loanTypeJaxbs = new ArrayList<>(); + + results.forEach((result) -> { + loanTypeJaxbs.add(new LoanTypeJaxb(result.getId(), result.getPayment())); + }); + + loanTypeListJaxb.setLoans(loanTypeJaxbs); + + return loanTypeListJaxb; + } catch (Exception e) { + logger.error("findNewCreditLimit", e); + throw e; + } + } + + /** + * + * @param officeId + * @return + * @throws Exception + */ + public LoanTypeListJaxb findAllLoansTypeByOffice(String officeId) throws Exception { + logger.debug("findNewCreditLimit"); + LoanTypeListJaxb loanTypeListJaxb = new LoanTypeListJaxb(); + try { + List parameters = new ArrayList<>(); + + parameters.add( + new ModelParameter( + LoanTypeCfg.FIELD_OFFICE, + new Office(officeId) + ) + ); + + List results = loanTypeRepository.findIdAndPaymentLoans( + LoanTypeCfg.QUERY_FIND_ALL_LOAN_TYPE_WITH_DESCRIPTION_BY_OFFICE, + parameters); + + List loanTypeJaxbs = new ArrayList<>(); + + results.forEach((result) -> { + loanTypeJaxbs.add(new LoanTypeJaxb(result.getId(), result.getPayment(), result.getLoanTypeName())); + }); + + loanTypeListJaxb.setLoans(loanTypeJaxbs); + + return loanTypeListJaxb; + } catch (Exception e) { + logger.error("findNewCreditLimit", e); + throw e; + } + } + + /** + * + * @param loan + * @param credit + * @param user + * @param paymentAmount + * @param endorsement + * @return + * @throws Exception + */ + public boolean renovation(String loan, + String credit, + String user, + BigDecimal paymentAmount, + PersonJaxb endorsement) throws Exception { + logger.debug("renovation"); + try { + Date date = new Date(); + + Loan currentLoan = loanRepository.findLoanById(loan); + LoanType newCredit = loanTypeRepository.findLoanType(credit); + int lastReferenceNumber = currentLoan.getLastReferenceNumber() + 1; + + LoanDetails loanDetails = new LoanDetails( + new Loan(loan), + new User(user), + PeopleType.CUSTOMER, + paymentAmount, + lastReferenceNumber, + LoanDetailsType.PAYMENT, + user, + date, + "Pago y solicitud de renovacion" + ); + + LoanByUser loanByUser = new LoanByUser( + new LoanByUserId(null, user), + LoanStatus.PENDING, + OwnerLoan.CURRENT_OWNER, + user); + + Loan renovation = new Loan( + new LoanType(newCredit.getId()), + new People(currentLoan.getCustomer().getId()), + null, + new RouteCtlg(currentLoan.getRouteCtlg().getId()), + LoanStatus.PENDING, + BigDecimal.ZERO, + newCredit.getPaymentTotal(), + 0, + user, + date, + ActiveStatus.DISABLED, + ActiveStatus.DISABLED // FROZEN funcationality + ); + + List parameters = new ArrayList<>(); + + parameters.add( + new ModelParameter( + LoanCfg.FIELD_AMOUNT_PAID, + currentLoan.getAmountPaid().add(paymentAmount) + ) + ); + + parameters.add( + new ModelParameter( + LoanCfg.FIELD_LAST_REFERENCE_NUMBER, + lastReferenceNumber + ) + ); + + parameters.add( + new ModelParameter( + LoanCfg.FIELD_LOAN_STATUS, + LoanStatus.PENDING_RENOVATION + ) + ); + + parameters.add( + new ModelParameter( + LoanCfg.FIELD_LAST_UPDATED_BY, + user + ) + ); + + parameters.add( + new ModelParameter( + LoanCfg.FIELD_LAST_UPDATED_ON, + date + ) + ); + + parameters.add( + new ModelParameter( + LoanCfg.FIELD_ID, + loan + ) + ); + + People people = null; + + if (null != endorsement) { + if (endorsement.isCreatePerson()) { + people = new People( + endorsement, false, + currentLoan.getRouteCtlg().getOffice().getId(), + user, currentLoan.getRouteCtlg().getId() + ); + } else { + renovation.setEndorsement(new People(endorsement.getId())); + } + } else { + renovation.setEndorsement(new People(currentLoan.getEndorsement().getId())); + } + + return loanRepository.renovationLoan( + loan, + renovation, + loanByUser, + LoanCfg.QUERY_UPDATE_LOAN_FROM_RENOVATION, + parameters, + loanDetails, people, + null == endorsement ? false : endorsement.isCreatePerson()); + } catch (Exception e) { + logger.error("renovation", e); + throw e; + } + } + + /** + * + * @param loan + * @param credit + * @param user + * @param paymentAmount + * @param currentOwner + * @param endorsement + * @return + * @throws Exception + */ + public boolean renovationHasPaymentToday(String loan, + String credit, + String user, + BigDecimal paymentAmount, + String currentOwner, + PersonJaxb endorsement) throws Exception { + logger.debug("renovationHasPaymentToday"); + try { + Date date = new Date(); + + Loan currentLoan = loanRepository.findLoanById(loan); + LoanType newCredit = loanTypeRepository.findLoanType(credit); + + LoanByUser loanByUser = new LoanByUser( + new LoanByUserId(null, currentOwner), + LoanStatus.PENDING, + OwnerLoan.CURRENT_OWNER, + user); + + Loan renovation = new Loan( + new LoanType(newCredit.getId()), + new People(currentLoan.getCustomer().getId()), + null, + new RouteCtlg(currentLoan.getRouteCtlg().getId()), + LoanStatus.PENDING, + BigDecimal.ZERO, + newCredit.getPaymentTotal(), + 0, + user, + date, + ActiveStatus.DISABLED, + ActiveStatus.DISABLED // FROZEN funcationality + ); + + People people = null; + + if (null != endorsement) { + if (endorsement.isCreatePerson()) { + people = new People( + endorsement, false, + currentLoan.getRouteCtlg().getOffice().getId(), + user, currentLoan.getRouteCtlg().getId() + ); + } else { + renovation.setEndorsement(new People(endorsement.getId())); + } + } else { + renovation.setEndorsement(new People(currentLoan.getEndorsement().getId())); + } + + return loanRepository.renovationHasPaymentToday( + loan, + renovation, + loanByUser, + people, + null == endorsement ? false : endorsement.isCreatePerson()); + } catch (Exception e) { + logger.error("renovationHasPaymentToday", e); + throw e; + } + } + + /** + * + * @param userId + * @return + * @throws Exception + */ + public List findLoansByCertifier(String userId) throws Exception { + logger.debug("findLoansByCertifier"); + try { + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanToDeliveryByCertifierViewCfg.FIELD_USER_ID, userId)); + + return toDeliveryByCertifierRepository.findLoansByCertifier( + LoanToDeliveryByCertifierView.class, + LoanToDeliveryByCertifierViewCfg.QUERY_FIND_LOANS_BY_CERTIFIER, + parameters); + } catch (Exception e) { + logger.error("findLoansByCertifier", e); + throw e; + } + } + + /** + * + * @param id + * @param user + * @param comments + * @param action true Approved otherwise Rejected. + * @param amount + * @param discount + * @return + * @throws Exception + */ + public boolean certifierAction(String id, String user, String comments, boolean action, BigDecimal amount, BigDecimal discount) throws Exception { + logger.debug("certifierAction"); + boolean success; + try { + // revisar si es nuevo (1) o renovado (2). + // 1 = se cambia el estatus al valor de action + // 2, si action es true, hay que hacer update de 3 tablas + // A)loan renovado estutus = APPROVED + // B) Finish + // 1)old loan estatus = FINISH, + // 2)old loandbyuser estatus = FINISH + // C)loans by renovation estatus = APPROVED + // 2, si action es false, hay que hacer update de 3 tablas + // A)loan renovado estutus = REJECT, and loandbyuser estatus = REJECT + // B)old loan estatus = APPROVED + // 1)old loan estatus = APPROVED + // 2)old loandbyuser estatus = APPROVED + // C)loans by renovation estatus = REJECT + LoanByRenovation loanByRenovation = loanByRenovationRepository.findLoanRenovationByNewLoanId(id); + + if (null == loanByRenovation) { + success = updateLoanByIdFromCertifiedView( + id, + user, + action, + comments, + amount, + ComissionType.INCLUDED); + } else { + LoanDetails loanDetails = null; + BigDecimal totalAmountPaid = null; + Integer newLastReferenceNumber = null; + + // Means discount is bigger than 0 + if (1 == discount.compareTo(new BigDecimal(0))) { + Loan loan = loanRepository.findLoanById(loanByRenovation.getLoanOld().getId()); + + totalAmountPaid = loan.getAmountPaid().add(discount); + newLastReferenceNumber = loan.getLastReferenceNumber() + 1; + + loanDetails = new LoanDetails( + new Loan(loanByRenovation.getLoanOld().getId()), + new User(user), + PeopleType.CUSTOMER, + discount, + newLastReferenceNumber, + LoanDetailsType.RENOVATION_PAYMENT, + user, + new Date(), + "RetenciĆ³n de " + discount + " el la entrega del crĆ©dito renovado"); + } + + success = loanByRenovationRepository.updateLoanRenovationFromCerfierView( + loanByRenovation, + user, + comments, + action, + amount, + discount, + loanDetails, + totalAmountPaid, + newLastReferenceNumber, + ComissionType.INCLUDED); + } + return success; + } catch (Exception e) { + logger.error("certifierAction", e); + throw e; + } + } + + /** + * + * @param id + * @param user + * @param comments + * @param action + * @param amount + * @param discount + * @param comissionType + * @return + * @throws Exception + */ + public boolean certifierAction(String id, String user, String comments, boolean action, BigDecimal amount, BigDecimal discount, ComissionType comissionType) throws Exception { + logger.debug("certifierAction"); + boolean success; + try { + // revisar si es nuevo (1) o renovado (2). + // 1 = se cambia el estatus al valor de action + // 2, si action es true, hay que hacer update de 3 tablas + // A)loan renovado estutus = APPROVED + // B) Finish + // 1)old loan estatus = FINISH, + // 2)old loandbyuser estatus = FINISH + // C)loans by renovation estatus = APPROVED + // 2, si action es false, hay que hacer update de 3 tablas + // A)loan renovado estutus = REJECT, and loandbyuser estatus = REJECT + // B)old loan estatus = APPROVED + // 1)old loan estatus = APPROVED + // 2)old loandbyuser estatus = APPROVED + // C)loans by renovation estatus = REJECT + LoanByRenovation loanByRenovation = loanByRenovationRepository.findLoanRenovationByNewLoanId(id); + + if (null == loanByRenovation) { + success = updateLoanByIdFromCertifiedView( + id, + user, + action, + comments, + amount, + comissionType); + } else { + LoanDetails loanDetails = null; + BigDecimal totalAmountPaid = null; + Integer newLastReferenceNumber = null; + + // Means discount is bigger than 0 + if (1 == discount.compareTo(new BigDecimal(0))) { + Loan loan = loanRepository.findLoanById(loanByRenovation.getLoanOld().getId()); + + totalAmountPaid = loan.getAmountPaid().add(discount); + newLastReferenceNumber = loan.getLastReferenceNumber() + 1; + + loanDetails = new LoanDetails( + new Loan(loanByRenovation.getLoanOld().getId()), + new User(user), + PeopleType.CUSTOMER, + discount, + newLastReferenceNumber, + LoanDetailsType.RENOVATION_PAYMENT, + user, + new Date(), + "RetenciĆ³n de " + discount + " el la entrega del crĆ©dito renovado"); + } + + success = loanByRenovationRepository.updateLoanRenovationFromCerfierView( + loanByRenovation, + user, + comments, + action, + amount, + discount, + loanDetails, + totalAmountPaid, + newLastReferenceNumber, + comissionType); + } + return success; + } catch (Exception e) { + logger.error("certifierAction", e); + throw e; + } + } + + /** + * + * @param idLoan + * @return + * @throws Exception + */ + public List approvedDetailsByIdLoan(String idLoan) throws Exception { + logger.debug("approvedDetailsByIdLoan"); + try { + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanDetailsCfg.FIELD_ID_LOAN, new Loan(idLoan))); + + return loanApprovedDetailViewRepository.findLoanDetailsByLoan( + LoanDetailsCfg.QUERY_FIND_LOAN_DETAILS_BY_LOAN, + parameters + ); + } catch (Exception e) { + logger.error("approvedDetailsByIdLoan", e); + throw e; + } + } + + /** + * Searching all loan details by id. + * + * @param loanId + * @return + * @throws Exception + */ + public List getLoanDetailsCurdatebyIdLoan(String loanId) throws Exception { + logger.debug("getLoanDetailsCurdatebyIdLoan"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanCfg.FIELD_DETAILS_LOAN, new Loan(loanId))); + + try { + return loanDetailsRepository.findLoanDetailsByLoanId(LoanCfg.QUERY_FIND_LOAN_DETAILS_CURDATE_BY_LOAN, parameters); + } catch (Exception ex) { + logger.error("getLoanDetailsCurdatebyIdLoan", ex); + throw ex; + } + } + + public List getLoanDetailsFeeCurdatebyIdLoan(String loanId) throws Exception { + logger.debug("getLoanDetailsFeeCurdatebyIdLoan"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanCfg.FIELD_DETAILS_LOAN, new Loan(loanId))); + + try { + return loanDetailsRepository.findLoanDetailsByLoanId(LoanCfg.QUERY_FIND_LOAN_DETAILS_FEE_CURDATE_BY_LOAN, parameters); + } catch (Exception ex) { + logger.error("getLoanDetailsCurdatebyIdLoan", ex); + throw ex; + } + } + + /** + * + * @param loanId + * @return + * @throws Exception + */ + public Loan getLoanById(String loanId) throws Exception { + try { + return loanRepository.findLoanById(loanId); + } catch (Exception ex) { + throw ex; + } + } + + /** + * + * @param idLoan + * @param idLoanType + * @return + * @throws Exception + */ + public boolean updatePaymentTotalLoanById(String idLoan, String idLoanType) throws Exception { + try { + Loan loan = loanRepository.findLoanById(idLoan); + LoanType loanType = loanTypeRepository.findLoanType(idLoanType); + + loan.setLoanType(loanType); + loan.setAmountToPay(loanType.getPaymentTotal()); + + return loanRepository.updateLoan(loan); + } catch (Exception ex) { + throw ex; + } + } + + /** + * + * @return @throws Exception + */ + public List findAllTransferToAuthorize() throws Exception { + try { + TransferInPendingStatusViewRepository repository = new TransferInPendingStatusViewRepository(); + List transferInPendingStatusViews = repository.findAllTransferFromHQL(TransferInPendingStatusViewCfg.QUERY_FIND_ALL_TRANSFER_IN_PENDING_STATUS, null); + List results = new ArrayList<>(); + + transferInPendingStatusViews.forEach((row) -> { + results.add(new AuthorizeTransferPaymentsDto(row.getIdLoanDetail(), + row.getStrCreatedOn(), + row.getCustomerName(), + row.getEndorsementName(), + row.getUserName(), + row.getPaymentAmount(), + row.getLoanComments())); + }); + + return results; + } catch (Exception e) { + throw e; + } + } + + /** + * + * @param authorizeTransferList + * @param transferStatus + * @return + * @throws Exception + */ + public boolean updateTransferList(AuthorizeTransferList authorizeTransferList, TransferStatus transferStatus) throws Exception { + try { + List parameters = new ArrayList<>(); + List ids = new ArrayList<>(); + + authorizeTransferList.getTransferListToUpdateStatus().forEach((row) -> { + ids.add(row.getIdLoan()); + }); + + parameters.add(new ModelParameter(LoanDetailsCfg.FIELD_TRANSFER_STATUS, transferStatus)); + parameters.add(new ModelParameter(LoanDetailsCfg.FIELD_COMMENS, authorizeTransferList.getComments())); + parameters.add(new ModelParameter(LoanDetailsCfg.FIELD_ID, ids)); + + return loanDetailsRepository.updateLoanDetails(LoanDetailsCfg.UPDATE_TRANSFER_STATUS_WHERE_ID_IN, parameters); + } catch (Exception e) { + throw e; + } + } + + /** + * + * @return @throws Exception + */ + public List findAllLoanInPendingStatusToDeliveryView() throws Exception { + try { + LoanInPendingStatusToDeliveryViewRepository repository = new LoanInPendingStatusToDeliveryViewRepository(); + List dataRows = repository.findAllLoanInPendingStatusToDeliveryViewFromHQL(LoanInPendingStatusToDeliveryViewCfg.QUERY_FIND_ALL_LOAN_IN_PENDING_STATUS_TO_DELIVERY_VIEW, null); + List results = new ArrayList<>(); + + dataRows.forEach((row) -> { + results.add(new UpdateLoanToDeliveryStatusDTO(row.getIdLoan(), + row.getStrCreatedOn(), + row.getCustomerName(), + row.getEndorsementName(), + row.getUserName(), + row.getPayment())); + }); + + return results; + } catch (Exception e) { + logger.error("findAllLoanInPendingStatusToDeliveryView", e); + throw e; + } + } + + public boolean updateLoanPendingStatusToDelivery(UpdateLoanToDeliveryStatusList updateLoanToDeliveryStatusList, LoanStatus loanStatus) throws Exception { + try { + List loanParams = new ArrayList<>(); + List loanByUserParams = new ArrayList<>(); + List ids = new ArrayList<>(); + List loans = new ArrayList<>(); + + updateLoanToDeliveryStatusList.getLoanToDeliveryList().forEach((row) -> { + ids.add(row.getIdLoan()); + loans.add(new Loan(row.getIdLoan())); + }); + + loanParams.add(new ModelParameter(LoanCfg.FIELD_LOAN_STATUS, loanStatus)); + loanParams.add(new ModelParameter(LoanCfg.FIELD_AMOUNT_PAID, new BigDecimal(0))); + loanParams.add(new ModelParameter(LoanCfg.FIELD_LAST_REFERENCE_NUMBER, 0)); + loanParams.add(new ModelParameter(LoanCfg.FIELD_LAST_UPDATED_BY, updateLoanToDeliveryStatusList.getIdUpdateUser())); + loanParams.add(new ModelParameter(LoanCfg.FIELD_LAST_UPDATED_ON, new Date())); + loanParams.add(new ModelParameter(LoanCfg.FIELD_ID, ids)); + + loanByUserParams.add(new ModelParameter(LoanByUserCfg.FIELD_LOAN_BY_USER_STATUS, loanStatus)); + loanByUserParams.add(new ModelParameter(LoanByUserCfg.FIELD_LOAN, loans)); + + return loanRepository.loanPendingStatusToDelivery(LoanCfg.QUERY_UPDATE_LOAN_STATUS_WHERE_ID_IN, LoanByUserCfg.QUERY_UPDATE_LOAN_BY_USER_STATUS_WHERE_LOAN_IN, loanParams, loanByUserParams); + } catch (Exception e) { + throw e; + } + } + + /** + * + * @param loanId + * @param userId + * @param action + * @param comments + * @param amount + * @param comissionType + * @return + * @throws Exception + */ + private boolean updateLoanByIdFromCertifiedView(String loanId, String userId, boolean action, String comments, BigDecimal amount, ComissionType comissionType) throws Exception { + logger.debug("updateLoanByIdFromCertifiedView"); + try { + List parameters = new ArrayList<>(); + Date date = new Date(); + + parameters.add( + new ModelParameter(LoanCfg.FIELD_LOAN_STATUS, action ? LoanStatus.APPROVED : LoanStatus.REJECTED) + ); + + parameters.add( + new ModelParameter(LoanCfg.FIELD_COMMENTS, comments) + ); + + parameters.add( + new ModelParameter(LoanCfg.FIELD_CREATED_ON, date) + ); + + parameters.add( + new ModelParameter(LoanCfg.FIELD_LAST_UPDATED_BY, userId) + ); + + parameters.add( + new ModelParameter(LoanCfg.FIELD_LAST_UPDATED_ON, date) + ); + + parameters.add( + new ModelParameter(LoanCfg.FIELD_ID, loanId) + ); + + Delivery delivery = null; + + if (action) { + delivery = new Delivery( + new User(userId), + new Loan(loanId), + amount, + userId, + date, + comissionType); + } + + return loanRepository.updateLoan( + loanId, + LoanCfg.QUERY_UPDATE_LOAN_WITH_CREATED_ON_BY_ID_FROM_CERTIFIER_VIEW, + parameters, + action ? LoanStatus.APPROVED : LoanStatus.REJECTED, + delivery); + } catch (Exception e) { + logger.error("updateLoanByIdFromCertifiedView", e); + throw e; + } + } + + /** + * Vefify that person is available to create a new Loan. + * + * @param clazz AvailableCustomersView or AvailableEndorsementsView. + * @param idPerson Identification NUmber + * @return true if is available otherwise false. + * @throws Exception + */ + private boolean verifyPersonAvailability(Class clazz, String idPerson) throws Exception { + logger.debug("verifyPersonAvailability"); + try { + if (null == idPerson || "".equals(idPerson.trim())) { + throw new NullPointerException(clazz + " id is null"); + } + + return null != searchPersonAvailableRepository.findAvailablePersonByPersonId(clazz, idPerson); + } catch (Exception e) { + logger.error("verifyPersonAvailability", e); + throw e; + } + } + + private static final long serialVersionUID = -3608679734068691688L; + final Logger logger = LogManager.getLogger(LoanController.class + ); + + private final LoanTypeRepository loanTypeRepository; + private final LoanRepository loanRepository; + private final LoanFeeNotificationRepository loanFeeNotificationRepository; + private final AddAmountRepository addAmountRepository; + private final LoanToDeliveryByCertifierRepository toDeliveryByCertifierRepository; + private final LoanByRenovationRepository loanByRenovationRepository; + private final SearchPersonAvailableRepository searchPersonAvailableRepository; + private final LoanApprovedDetailViewRepository loanApprovedDetailViewRepository; + private final LoanDetailsRepository loanDetailsRepository; + + private final String user_unavailable = "User unavailable to this operation"; + + public LoanController() { + this.loanTypeRepository = new LoanTypeRepository(); + this.loanRepository = new LoanRepository(); + this.loanFeeNotificationRepository = new LoanFeeNotificationRepository(); + this.addAmountRepository = new AddAmountRepository(); + this.toDeliveryByCertifierRepository = new LoanToDeliveryByCertifierRepository(); + this.loanByRenovationRepository = new LoanByRenovationRepository(); + this.searchPersonAvailableRepository = new SearchPersonAvailableRepository(); + this.loanApprovedDetailViewRepository = new LoanApprovedDetailViewRepository(); + this.loanDetailsRepository = new LoanDetailsRepository(); + } +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/login/LoginWSController.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/login/LoginWSController.java new file mode 100644 index 0000000..e83c1fb --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/login/LoginWSController.java @@ -0,0 +1,80 @@ +/* + * 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.controller.mobile.controller.login; + +import com.arrebol.apc.controller.mobile.moxy.login.UserMxy; +import com.arrebol.apc.controller.mobile.moxy.login.UserPreferenceMxy; +import com.arrebol.apc.controller.mobile.repository.jaas.AuthenticationRepository; +import com.arrebol.apc.model.mobile.access.MobileUser; +import com.arrebol.apc.model.mobile.preference.UserMobilePreference; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class LoginWSController implements Serializable { + + public UserMxy login(String userName, String password) throws Exception { + logger.debug("login"); + + UserMxy userMxy; + List preferenceLst; + try { + MobileUser mobileUser = getAuthenticationRepository().findUser(userName, password); + + if (null == mobileUser) { + throw new Exception("Access denied"); + } else { + userMxy = new UserMxy( + mobileUser.getId(), + mobileUser.getUserName(), + mobileUser.getAvatar(), + mobileUser.getOfficeId(), + mobileUser.getRouteId(), + mobileUser.getCertifier(), + mobileUser.getManagement().toString() + ); + } + + List userMobilePreferences = getAuthenticationRepository().findAllMobilePreferenceByUser(userMxy.getId()); + + if (!userMobilePreferences.isEmpty()) { + preferenceLst = new ArrayList<>(); + + userMobilePreferences.forEach((preference) -> { + preferenceLst.add(new UserPreferenceMxy(preference.getPreferenceName(), preference.getPreferenceValue())); + }); + + userMxy.setPreferences(preferenceLst); + } + } catch (Exception e) { + logger.error("login", e); + throw e; + } + return userMxy; + } + + public LoginWSController() { + this.authenticationRepository = new AuthenticationRepository(); + } + + public AuthenticationRepository getAuthenticationRepository() { + return authenticationRepository; + } + + private static final long serialVersionUID = 2795964728722199660L; + final Logger logger = LogManager.getLogger(LoginWSController.class); + + private final AuthenticationRepository authenticationRepository; + +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/otherexpense/OtherExpenseController.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/otherexpense/OtherExpenseController.java new file mode 100644 index 0000000..3df43be --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/otherexpense/OtherExpenseController.java @@ -0,0 +1,58 @@ +/* + * 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.controller.mobile.controller.otherexpense; + +import com.arrebol.apc.controller.mobile.repository.admin.OtherExpenseRepository; +import com.arrebol.apc.model.admin.OtherExpense; +import java.io.Serializable; +import java.math.BigDecimal; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class OtherExpenseController implements Serializable { + + /** + * + * @param officeId + * @param userId + * @param expense + * @param description + * @return + * @throws Exception + */ + public boolean addOtherExpense( + String officeId, + String userId, + Double expense, + String description) throws Exception { + logger.debug("addOtherExpense"); + try { + OtherExpense otherExpense = new OtherExpense(officeId, userId, new BigDecimal(expense), description); + + return otherExpenseRepository.saveOtherExpense(otherExpense); + } catch (Exception e) { + logger.error("addOtherExpense", e); + throw e; + } + } + + private static final long serialVersionUID = -1748077572747436181L; + + final Logger logger = LogManager.getLogger(OtherExpenseController.class); + + private final OtherExpenseRepository otherExpenseRepository; + + public OtherExpenseController() { + this.otherExpenseRepository = new OtherExpenseRepository(); + } + +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/person/PersonController.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/person/PersonController.java new file mode 100644 index 0000000..874e3f3 --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/person/PersonController.java @@ -0,0 +1,54 @@ +/* + * 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.controller.mobile.controller.person; + +import com.arrebol.apc.controller.mobile.repository.people.PeopleRepository; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.catalog.constance.PeopleCfg; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class PersonController implements Serializable { + + /** + * + * @param loanId + * @param lastUpdatedBy + * @param phoneNumber + * @param isCustomer + * @return + */ + public boolean changeContactNumber(String loanId, String lastUpdatedBy, String phoneNumber, boolean isCustomer) { + boolean success = false; + try { + PeopleRepository repository = new PeopleRepository(); + String personId = repository.findPeopleIdByIdLoad(loanId, isCustomer); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(PeopleCfg.FIELD_PHONE_HOME, phoneNumber)); + parameters.add(new ModelParameter(PeopleCfg.FIELD_LAST_UPDATED_BY, lastUpdatedBy)); + parameters.add(new ModelParameter(PeopleCfg.FIELD_LAST_UPDATED_ON, new Date())); + parameters.add(new ModelParameter(PeopleCfg.FIELD_ID, personId)); + + return repository.changeContactNumber(PeopleCfg.QUERY_UPDATE_PHONE_HOME_BY_PEOPLE_ID, parameters); + } catch (Exception e) { + logger.error("changeContactNumber", e); + } + return success; + } + + final Logger logger = LogManager.getLogger(getClass()); +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/preference/SystemPreferenceController.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/preference/SystemPreferenceController.java new file mode 100644 index 0000000..5c0d4af --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/preference/SystemPreferenceController.java @@ -0,0 +1,243 @@ +/* + * 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.controller.mobile.controller.preference; + +import com.arrebol.apc.controller.mobile.moxy.views.LoanByUserOrderPreferenceViewJaxb; +import com.arrebol.apc.controller.mobile.moxy.views.LoanByUserOrderPreferenceViewListJaxb; +import com.arrebol.apc.controller.mobile.repository.preference.UserMobilePreferenceRepository; +import com.arrebol.apc.controller.mobile.repository.views.LoanByUserOrderPreferenceViewRepository; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.admin.constance.ClosingDayCfg; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.core.constance.LoanByUserCfg; +import com.arrebol.apc.model.core.constance.LoanByUserOrderPreferenceViewCfg; +import com.arrebol.apc.model.core.constance.UserMobilePreferenceCfg; +import com.arrebol.apc.model.enums.PreferenceName; +import com.arrebol.apc.model.enums.PreferenceValue; +import com.arrebol.apc.model.loan.LoanByUserId; +import com.arrebol.apc.model.mobile.preference.UserMobilePreference; +import com.arrebol.apc.model.views.LoanByUserOrderPreferenceView; +import com.arrebol.apc.model.ws.parsed.ConfigurationJaxb; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class SystemPreferenceController implements Serializable { + + /** + * + * @param userId + * @return + * @throws Exception + */ + public List findAllLoanByUserOrderPreference(String userId) throws Exception { + logger.debug("findAllLoanByUserOrderPreference"); + try { + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanByUserOrderPreferenceViewCfg.FIELD_ORDER_USER_ID, userId)); + + return loanByUserOrderPreferenceViewRepository + .findAllLoanByUserOrderPreference( + LoanByUserOrderPreferenceViewCfg.QUERY_FIND_ALL_LOAN_BY_USER_ORDER_PREFERENCE, + parameters + ); + } catch (Exception e) { + logger.error("findAllLoanByUserOrderPreference", e); + throw e; + } + } + + /** + * + * @param updateOrderListPreference + * @return + * @throws Exception + */ + public boolean updateOrderInList(LoanByUserOrderPreferenceViewListJaxb updateOrderListPreference) throws Exception { + logger.debug("updateOrderInList"); + + boolean success = false; + try { + if (updateLoanByUser(updateOrderListPreference)) { + success = updateUserMobilePreference( + new User(updateOrderListPreference.getLoanByUserOrderPreferences().get(0).getUserId()), + PreferenceName.ORDER_LIST.toString(), + PreferenceValue.ORDER_IN_LIST.toString() + ); + } + return success; + } catch (Exception e) { + logger.error("updateOrderInList", e); + throw e; + } + } + + /** + * + * @param UserId + * @param preferenceName + * @param preferenceValue + * @return + * @throws Exception + */ + public boolean updateUserMobilePreference(String UserId, String preferenceName, String preferenceValue) throws Exception { + logger.debug("updateUserMobilePreference"); + + boolean success = false; + try { + success = updateUserMobilePreference( + new User(UserId), + preferenceName, + preferenceValue + ); + + } catch (Exception e) { + logger.error("updateUserMobilePreference", e); + throw e; + } + return success; + } + + /** + * + * @param updateOrderListPreference + * @return + * @throws Exception + */ + private boolean updateLoanByUser(LoanByUserOrderPreferenceViewListJaxb updateOrderListPreference) throws Exception { + logger.debug("updateLoanByUser"); + try { + for (int i = 0; i < updateOrderListPreference.getLoanByUserOrderPreferences().size(); i++) { + LoanByUserOrderPreferenceViewJaxb preference = updateOrderListPreference.getLoanByUserOrderPreferences().get(i); + List parameters = new ArrayList<>(); + + parameters.add( + new ModelParameter( + LoanByUserCfg.FIELD_ORDER_IN_LIST, + preference.getOrderInList() + ) + ); + + parameters.add( + new ModelParameter( + LoanByUserCfg.FIELD_ID, + new LoanByUserId( + preference.getId(), + preference.getUserId() + ) + ) + ); + + loanByUserOrderPreferenceViewRepository.updateQuery( + LoanByUserCfg.QUERY_UPDATE_ORDER_IN_LIST, + parameters + ); + } + return true; + } catch (Exception e) { + logger.error("updateLoanByUser", e); + throw e; + } + } + + /** + * + * @param user + * @param preferenceName + * @param preferenceValue + * @return + * @throws Exception + */ + private boolean updateUserMobilePreference(User user, String preferenceName, String preferenceValue) throws Exception { + logger.debug("updateUserMobilePreference"); + + boolean success = false; + try { + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(UserMobilePreferenceCfg.FIELD_USER, user)); + parameters.add(new ModelParameter(UserMobilePreferenceCfg.FIELD_PREFERENCE_NAME, preferenceName)); + + UserMobilePreference userMobilePreference = userMobilePreferenceRepository.findUserMobilePreference( + UserMobilePreference.class, + UserMobilePreferenceCfg.QUERY_FIND_MOBILE_PREFERENCE_BY_USER_AND_PREFERENCE_NAME, + parameters); + + if (null != userMobilePreference) { + parameters.clear(); + + parameters.add(new ModelParameter(UserMobilePreferenceCfg.FIELD_PREFERENCE_VALUE, preferenceValue)); + parameters.add(new ModelParameter(UserMobilePreferenceCfg.FIELD_LAST_UPDATED_BY, user.getId())); + parameters.add(new ModelParameter(UserMobilePreferenceCfg.FIELD_LAST_UPDATED_ON, new Date())); + parameters.add(new ModelParameter(UserMobilePreferenceCfg.FIELD_ID, userMobilePreference.getId())); + + success = userMobilePreferenceRepository.updateQueryUserMobilePreference( + UserMobilePreferenceCfg.QUERY_UPDATE_PREFERENCE_VALUE, + parameters + ); + } else { + userMobilePreference = new UserMobilePreference( + user, + preferenceName, + preferenceValue, + user.getId()); + success = userMobilePreferenceRepository.insertUserMobilePreference(userMobilePreference); + } + } catch (Exception e) { + logger.error("updateUserMobilePreference", e); + throw e; + } + return success; + } + + /** + * + * @param userId + * @param officeId + * @return + * @throws Exception + */ + public ConfigurationJaxb findConfigurationButton(String userId, String officeId) throws Exception { + logger.debug("findConfigurationButton"); + ConfigurationJaxb configuration; + try { + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(ClosingDayCfg.FIELD_USER, new User(userId))); + parameters.add(new ModelParameter(ClosingDayCfg.FIELD_OFFICE, new Office(officeId))); + + Long result = userMobilePreferenceRepository.count(ClosingDayCfg.QUERY_COUNT_CLOSING_DATE_BY_USER_AND_OFFICE, parameters); + configuration = new ConfigurationJaxb(result.compareTo(new Long(0)) == 0); + } catch (Exception e) { + logger.error("findConfigurationButton", e); + configuration = new ConfigurationJaxb(false); + } + return configuration; + } + + private static final long serialVersionUID = 6329489276545356862L; + final Logger logger = LogManager.getLogger(SystemPreferenceController.class); + + private final LoanByUserOrderPreferenceViewRepository loanByUserOrderPreferenceViewRepository; + private final UserMobilePreferenceRepository userMobilePreferenceRepository; + + public SystemPreferenceController() { + this.loanByUserOrderPreferenceViewRepository = new LoanByUserOrderPreferenceViewRepository(); + this.userMobilePreferenceRepository = new UserMobilePreferenceRepository(); + } + +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/reports/ReportsController.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/reports/ReportsController.java new file mode 100644 index 0000000..7d0f190 --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/reports/ReportsController.java @@ -0,0 +1,54 @@ +/* + * 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.controller.mobile.controller.reports; + +import com.arrebol.apc.controller.mobile.repository.reports.ReportsRepository; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.reports.UserWeekReport; +import com.arrebol.apc.model.reports.constance.UserWeekReportCfg; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class ReportsController implements Serializable { + + /** + * + * @param id + * @return + * @throws Exception + */ + public UserWeekReport findUserWeekReportDetailsByUser(String id) throws Exception { + try { + ReportsRepository reportsRepository = new ReportsRepository(); + List parameters = new ArrayList<>(); + + parameters.add( + new ModelParameter(UserWeekReportCfg.FIELD_ID, id) + ); + + return reportsRepository.findUserWeekReportDetailsByUser(UserWeekReport.class, UserWeekReportCfg.QUERY_FIND_USER_WEEK_REPORT_BY_USER, parameters); + } catch (Exception e) { + logger.error("findUserWeekReportDetailsByUser", e); + throw e; + } + } + + private static final long serialVersionUID = -5280895557294295916L; + final Logger logger = LogManager.getLogger(getClass()); + + public ReportsController() { + } + +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/route/RouteController.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/route/RouteController.java new file mode 100644 index 0000000..780db71 --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/route/RouteController.java @@ -0,0 +1,44 @@ +/* + * 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.controller.mobile.controller.route; + +import com.arrebol.apc.controller.mobile.moxy.views.ContainerRoutes; +import com.arrebol.apc.controller.mobile.repository.route.RouteRepository; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.catalog.constance.RouteCfg; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.enums.ActiveStatus; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class RouteController implements Serializable { + + public ContainerRoutes findAllRoutesAvailables(String officeId) throws Exception { + try { + RouteRepository repository = new RouteRepository(); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(RouteCfg.FIELD_OFFICE, new Office(officeId))); + parameters.add(new ModelParameter(RouteCfg.FIELD_ACTIVE_STATUS, ActiveStatus.ENEBLED)); + + return repository.findAllRoutesAvailables(RouteCfg.QUERY_FIND_ALL_AVAILABLES_ROUTES, parameters); + } catch (Exception e) { + logger.error("findAllRoutesAvailables", e); + throw e; + } + } + + final Logger logger = LogManager.getLogger(getClass()); +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/search/PersonSearchController.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/search/PersonSearchController.java new file mode 100644 index 0000000..0e66d5d --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/search/PersonSearchController.java @@ -0,0 +1,175 @@ +/* + * 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.controller.mobile.controller.search; + +import com.arrebol.apc.controller.mobile.repository.views.PersonSearchHistoricalDetailsViewRepository; +import com.arrebol.apc.controller.mobile.repository.views.PersonSearchViewRepository; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.catalog.People; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.core.constance.LoanByUserCfg; +import com.arrebol.apc.model.core.constance.LoanCfg; +import com.arrebol.apc.model.core.constance.PersonSearchHistoricalDetailsViewCfg; +import com.arrebol.apc.model.core.constance.PersonSearchViewCfg; +import com.arrebol.apc.model.core.constance.UserCfg; +import com.arrebol.apc.model.views.LoanByUserView; +import com.arrebol.apc.model.views.PersonSearchDetailView; +import com.arrebol.apc.model.views.PersonSearchHistoricalDetailsView; +import com.arrebol.apc.model.views.PersonSearchView; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class PersonSearchController implements Serializable { + + /** + * + * @param nameToSearch + * @return + * @throws Exception + */ + public PersonSearchView fullNameEqualsToPersonSearch(String nameToSearch) throws Exception { + try { + List parameters = new ArrayList<>(); + + parameters.add( + new ModelParameter( + PersonSearchViewCfg.FIELD_PERSON_SEARCH, + nameToSearch + ) + ); + + PersonSearchView result = (PersonSearchView) personSearchViewRepository.findResultXML( + PersonSearchView.class, + PersonSearchViewCfg.QUERY_FULL_NAME_EQUALS_TO_PERSON_SEARCH, + parameters + ); + + if (null == result) { + result = new PersonSearchView("N/A", "N/A"); + } + return result; + } catch (Exception e) { + logger.error("findAllCoincidences", e); + throw e; + } + } + + /** + * + * @param search + * @return If any return list of coincidences otherwise return empty list. + * @throws Exception + */ + public List findAllCoincidences(String search) throws Exception { + logger.debug("findAllCoincidences"); + try { + List parameters = new ArrayList<>(); + + parameters.add( + new ModelParameter( + PersonSearchViewCfg.FIELD_PERSON_SEARCH, + search + ) + ); + + return personSearchViewRepository.findResultList( + PersonSearchView.class, + PersonSearchViewCfg.QUERY_LIKE_BY_PERSON_SEARCH, + parameters + ); + } catch (Exception e) { + logger.error("findAllCoincidences", e); + throw e; + } + } + + /** + * + * @param personSearchId + * @return + * @throws Exception + */ + public PersonSearchDetailView findPersonSearchDetail(String personSearchId) throws Exception { + logger.debug("findPersonSearchDetail"); + try { + return personSearchViewRepository.findResult(PersonSearchDetailView.class, personSearchId); + } catch (Exception e) { + logger.error("findPersonSearchDetail", e); + throw e; + } + } + + /** + * + * @param personSearchId + * @return + * @throws Exception + */ + public List findPersonHistoricalDetailsByPersonId(String personSearchId) throws Exception { + logger.debug("findPersonHistoricalDetailsByPersonId"); + try { + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(PersonSearchHistoricalDetailsViewCfg.FIELD_PERSON_SEARCH_ID, personSearchId)); + + return personSearchHistoricalDetailsViewRepository.findAllByPersonId( + PersonSearchHistoricalDetailsView.class, + PersonSearchHistoricalDetailsViewCfg.QUERY_FIND_PERSON_SEARCH_HISTORICAL_DETAILS_BY_PERSON_ID, + parameters); + } catch (Exception e) { + logger.error("findPersonHistoricalDetailsByPersonId", e); + throw e; + } + } + + //Necesito utilizar tuple + /** + * + * @param idUser + * @param personSearch + * @return + * @throws Exception + */ + public LoanByUserView searchPaymentDetails(String idUser, String personSearch) throws Exception { + logger.debug("searchPaymentDetails"); + try { + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanCfg.FIELD_CUSTOMER, new People(personSearch))); + parameters.add(new ModelParameter(LoanByUserCfg.FIELD_USER, new User(idUser))); + parameters.add(new ModelParameter(UserCfg.FIELD_ID, idUser)); + + return (LoanByUserView) personSearchViewRepository.findResultTupleXML( + LoanCfg.QUERY_SEARCH_PAYMENT_DETAILS, + parameters); + + } catch (Exception e) { + logger.error("searchPaymentDetails", e); + throw e; + } + } + + private static final long serialVersionUID = -3224360462532091921L; + final Logger logger = LogManager.getLogger(PersonSearchController.class); + + final private PersonSearchViewRepository personSearchViewRepository; + final private PersonSearchHistoricalDetailsViewRepository personSearchHistoricalDetailsViewRepository; + + public PersonSearchController() { + this.personSearchViewRepository = new PersonSearchViewRepository(); + this.personSearchHistoricalDetailsViewRepository = new PersonSearchHistoricalDetailsViewRepository(); + } + +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/tracking/PaymentTrackingController.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/tracking/PaymentTrackingController.java new file mode 100644 index 0000000..79783c3 --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/tracking/PaymentTrackingController.java @@ -0,0 +1,69 @@ +/* + * 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.controller.mobile.controller.tracking; + +import com.arrebol.apc.controller.mobile.moxy.views.PaymentTrackingViewJaxb; +import com.arrebol.apc.controller.mobile.repository.tracking.PaymentTrackingRepository; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.views.AdvanceUserDailyView; +import com.arrebol.apc.model.views.constance.AdvanceUserDailyViewCfg; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class PaymentTrackingController implements Serializable { + + public PaymentTrackingViewJaxb paymentTrakingByUserDetails(String idUser, String idOffice) { + PaymentTrackingViewJaxb paymentTracking = new PaymentTrackingViewJaxb(); + logger.debug("paymentTrakingByUserDetails"); + try { + + List parameters = new ArrayList<>(); + + parameters.add( + new ModelParameter( + AdvanceUserDailyViewCfg.FIELD_VIEW_USER, + new User(idUser) + ) + ); + parameters.add( + new ModelParameter( + AdvanceUserDailyViewCfg.FIELD_VIEW_OFFICE, + new Office(idOffice) + ) + ); + + PaymentTrackingRepository repository = new PaymentTrackingRepository(); + + AdvanceUserDailyView result = repository.paymentTrakingByUserDetails( + AdvanceUserDailyView.class, + AdvanceUserDailyViewCfg.QUERY_PAYMENT_TRACKING_BY_IDS, + parameters); + + if (null != result) { + paymentTracking.setTotalExpected(result.getTotalExpected()); + paymentTracking.setTotalNow(result.getTotalNow()); + } + } catch (Exception e) { + logger.error("paymentTrakingByUserDetails"); + } + + return paymentTracking; + } + + private static final long serialVersionUID = -3224360462532091920L; + final Logger logger = LogManager.getLogger(PaymentTrackingController.class); +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/user/UserController.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/user/UserController.java new file mode 100644 index 0000000..2cd14fd --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/controller/user/UserController.java @@ -0,0 +1,95 @@ +/* + * 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.controller.mobile.controller.user; + +import com.arrebol.apc.controller.mobile.repository.user.UserRepository; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.core.constance.UserCfg; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class UserController implements Serializable { + + /** + * + * @param userId + * @return + * @throws Exception + */ + public boolean isUserEnebled(String userId) throws Exception { + logger.info("isUserEnebled"); + try { + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(UserCfg.FIELD_ID, userId)); + + return userId.equals(userRepository.findUserStatusById(UserCfg.QUERY_VERIFY_USER_STATUS_BY_ID, parameters)); + } catch (Exception e) { + logger.error("isUserEnebled", e); + throw e; + } + } + + /** + * + * @param userId + * @return + * @throws Exception + */ + public boolean containtsUserManagementProperty(String userId) throws Exception { + logger.info("containtsUserManagementProperty"); + try { + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(UserCfg.FIELD_ID, userId)); + + return userRepository.containtsUserManagementProperty(UserCfg.QUERY_IS_USER_MANAGMENT, parameters); + } catch (Exception e) { + logger.error("containtsUserManagementProperty", e); + throw e; + } + } + + /** + * + * @param idOffice + * @return + * @throws Exception + */ + public List listOfUsersByOffice(String idOffice) throws Exception { + try { + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(UserCfg.FIELD_OFFICE, new Office(idOffice))); + + return userRepository.listOfUsersByOffice(UserCfg.QUERY_LIST_OF_USERS_BY_OFFICE, parameters); + } catch (Exception e) { + logger.error("listOfUsersByOffice", e); + throw e; + } + } + + private static final long serialVersionUID = -2705701746315543593L; + final Logger logger = LogManager.getLogger(getClass()); + + private final UserRepository userRepository; + + public UserController() { + this.userRepository = new UserRepository(); + } + +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/json/loan/AuthorizeTransferList.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/json/loan/AuthorizeTransferList.java new file mode 100644 index 0000000..db61a0a --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/json/loan/AuthorizeTransferList.java @@ -0,0 +1,96 @@ +/* + * 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.controller.mobile.json.loan; + +import java.util.List; +import java.util.Objects; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@XmlRootElement(name = "authorizeTransferList") +public class AuthorizeTransferList { + + private String idUpdateUser; + private String comments; + private List transferListToUpdateStatus; + + /** + * + */ + public AuthorizeTransferList() { + } + + /** + * + * @param idUpdateUser + * @param comments + * @param transferListToUpdateStatus + */ + public AuthorizeTransferList(String idUpdateUser, String comments, List transferListToUpdateStatus) { + this.idUpdateUser = idUpdateUser; + this.comments = comments; + this.transferListToUpdateStatus = transferListToUpdateStatus; + } + + @XmlElement(name = "idUpdateUser") + public String getIdUpdateUser() { + return idUpdateUser; + } + + public void setIdUpdateUser(String idUpdateUser) { + this.idUpdateUser = idUpdateUser; + } + + @XmlElement(name = "comments") + public String getComments() { + return comments; + } + + public void setComments(String comments) { + this.comments = comments; + } + + @XmlElement(name = "transferListToUpdateStatus") + public List getTransferListToUpdateStatus() { + return transferListToUpdateStatus; + } + + public void setTransferListToUpdateStatus(List transferListToUpdateStatus) { + this.transferListToUpdateStatus = transferListToUpdateStatus; + } + + @Override + public int hashCode() { + int hash = 3; + hash = 31 * hash + Objects.hashCode(this.idUpdateUser); + return hash; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final AuthorizeTransferList other = (AuthorizeTransferList) obj; + if (!Objects.equals(this.idUpdateUser, other.idUpdateUser)) { + return false; + } + return true; + } + +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/json/loan/AuthorizeTransferPaymentsDto.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/json/loan/AuthorizeTransferPaymentsDto.java new file mode 100644 index 0000000..6656274 --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/json/loan/AuthorizeTransferPaymentsDto.java @@ -0,0 +1,117 @@ +/* + * 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.controller.mobile.json.loan; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@XmlRootElement(name = "authorizeTransferPaymentsDto") +public class AuthorizeTransferPaymentsDto { + + private String idLoan; + private String strDate; + private String customerName; + private String endorsementName; + private String userName; + private Double amount; + private String comments; + + /** + * + */ + public AuthorizeTransferPaymentsDto() { + } + + /** + * + * @param idLoan + * @param strDate + * @param customerName + * @param endorsementName + * @param userName + * @param amount + * @param comments + */ + public AuthorizeTransferPaymentsDto(String idLoan, String strDate, String customerName, String endorsementName, String userName, Double amount, String comments) { + this.idLoan = idLoan; + this.strDate = strDate; + this.customerName = customerName; + this.endorsementName = endorsementName; + this.userName = userName; + this.amount = amount; + this.comments = comments; + } + + @XmlElement(name = "idLoan") + public String getIdLoan() { + return idLoan; + } + + public void setIdLoan(String idLoan) { + this.idLoan = idLoan; + } + + @XmlElement(name = "strDate") + public String getStrDate() { + return strDate; + } + + public void setStrDate(String strDate) { + this.strDate = strDate; + } + + @XmlElement(name = "customerName") + public String getCustomerName() { + return customerName; + } + + public void setCustomerName(String customerName) { + this.customerName = customerName; + } + + @XmlElement(name = "endorsementName") + public String getEndorsementName() { + return endorsementName; + } + + public void setEndorsementName(String endorsementName) { + this.endorsementName = endorsementName; + } + + @XmlElement(name = "userName") + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + @XmlElement(name = "amount") + public Double getAmount() { + return amount; + } + + public void setAmount(Double amount) { + this.amount = amount; + } + + @XmlElement(name = "comments") + public String getComments() { + return comments; + } + + public void setComments(String comments) { + this.comments = comments; + } + +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/json/loan/DeleteLoanDetailsJaxb.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/json/loan/DeleteLoanDetailsJaxb.java new file mode 100644 index 0000000..03f6fda --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/json/loan/DeleteLoanDetailsJaxb.java @@ -0,0 +1,117 @@ +/* + * 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.controller.mobile.json.loan; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@XmlRootElement(name = "deleteLoanDetailsJaxb") +public class DeleteLoanDetailsJaxb { + + private Boolean approvedOrPendingRenovation; + private Boolean todayPayment; + private Boolean todayFee; + private String loanId; + + public DeleteLoanDetailsJaxb() { + } + + /** + * + * @param approvedOrPendingRenovation + * @param todayPayment + * @param todayFee + */ + public DeleteLoanDetailsJaxb(Boolean approvedOrPendingRenovation, Boolean todayPayment, Boolean todayFee) { + this.approvedOrPendingRenovation = approvedOrPendingRenovation; + this.todayPayment = todayPayment; + this.todayFee = todayFee; + } + + /** + * + * @param approvedOrPendingRenovation + * @param todayPayment + * @param todayFee + * @param loanId + */ + public DeleteLoanDetailsJaxb(Boolean approvedOrPendingRenovation, Boolean todayPayment, Boolean todayFee, String loanId) { + this.approvedOrPendingRenovation = approvedOrPendingRenovation; + this.todayPayment = todayPayment; + this.todayFee = todayFee; + this.loanId = loanId; + } + + /** + * + * @param todayPayment + * @param todayFee + */ + public DeleteLoanDetailsJaxb(Boolean todayPayment, Boolean todayFee) { + this.todayPayment = todayPayment; + this.todayFee = todayFee; + } + + /** + * + * @param todayPayment + * @param todayFee + * @param loanId + */ + public DeleteLoanDetailsJaxb(Boolean todayPayment, Boolean todayFee, String loanId) { + this.todayPayment = todayPayment; + this.todayFee = todayFee; + this.loanId = loanId; + } + + @XmlElement(name = "approvedOrPendingRenovation") + public Boolean getApprovedOrPendingRenovation() { + return approvedOrPendingRenovation; + } + + public void setApprovedOrPendingRenovation(Boolean approvedOrPendingRenovation) { + this.approvedOrPendingRenovation = approvedOrPendingRenovation; + } + + @XmlElement(name = "todayPayment") + public Boolean getTodayPayment() { + return todayPayment; + } + + public void setTodayPayment(Boolean todayPayment) { + this.todayPayment = todayPayment; + } + + @XmlElement(name = "todayFee") + public Boolean getTodayFee() { + return todayFee; + } + + public void setTodayFee(Boolean todayFee) { + this.todayFee = todayFee; + } + + @XmlElement(name = "loanId") + public String getLoanId() { + return loanId; + } + + public void setLoanId(String loanId) { + this.loanId = loanId; + } + + @Override + public String toString() { + return "DeleteLoanDetailsJaxb{" + "approvedOrPendingRenovation=" + approvedOrPendingRenovation + ", todayPayment=" + todayPayment + ", todayFee=" + todayFee + '}'; + } + +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/json/loan/GenericAPCResponserJaxb.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/json/loan/GenericAPCResponserJaxb.java new file mode 100644 index 0000000..2b4f184 --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/json/loan/GenericAPCResponserJaxb.java @@ -0,0 +1,97 @@ +/* + * 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.controller.mobile.json.loan; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@XmlRootElement(name = "apcResponse") +public class GenericAPCResponserJaxb { + + private Boolean successful; + private String message; + private String idClosingDay; + private String idSmallBox; + private String idGeneralBox; + private Boolean enabledSubmit; + + /** + * + */ + public GenericAPCResponserJaxb() { + } + + /** + * + * @param successful + * @param message + */ + public GenericAPCResponserJaxb(Boolean successful, String message) { + this.successful = successful; + this.message = message; + } + + @XmlElement(name = "successful") + public Boolean getSuccessful() { + return null == successful ? Boolean.FALSE : successful; + } + + public void setSuccessful(Boolean successful) { + this.successful = successful; + } + + @XmlElement(name = "message") + public String getMessage() { + return null == message ? "" : message; + } + + public void setMessage(String message) { + this.message = message; + } + + @XmlElement(name = "idClosingDay") + public String getIdClosingDay() { + return idClosingDay; + } + + public void setIdClosingDay(String idClosingDay) { + this.idClosingDay = idClosingDay; + } + + @XmlElement(name = "idSmallBox") + public String getIdSmallBox() { + return idSmallBox; + } + + public void setIdSmallBox(String idSmallBox) { + this.idSmallBox = idSmallBox; + } + + @XmlElement(name = "idGeneralBox") + public String getIdGeneralBox() { + return idGeneralBox; + } + + public void setIdGeneralBox(String idGeneralBox) { + this.idGeneralBox = idGeneralBox; + } + + @XmlElement(name = "enabledSubmit") + public Boolean getEnabledSubmit() { + return null == enabledSubmit ? Boolean.FALSE : enabledSubmit; + } + + public void setEnabledSubmit(Boolean enabledSubmit) { + this.enabledSubmit = enabledSubmit; + } + +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/json/loan/LoanTypeJaxb.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/json/loan/LoanTypeJaxb.java new file mode 100644 index 0000000..1f0977f --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/json/loan/LoanTypeJaxb.java @@ -0,0 +1,73 @@ +/* + * 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.controller.mobile.json.loan; + +import java.math.BigDecimal; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@XmlRootElement(name = "loan") +public class LoanTypeJaxb { + + private String id; + private BigDecimal payment; + private String description; + + public LoanTypeJaxb() { + } + + public LoanTypeJaxb(String id, BigDecimal payment) { + this.id = id; + this.payment = payment; + } + + public LoanTypeJaxb(String id, BigDecimal payment, String description) { + this.id = id; + this.payment = payment; + this.description = description; + } + + @XmlElement(name = "id") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + @XmlElement(name = "payment") + public BigDecimal getPayment() { + return payment; + } + + public void setPayment(BigDecimal payment) { + this.payment = payment; + } + + @XmlElement(name = "description") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + + + @Override + public String toString() { + return "LoanTypeJaxb{" + "payment=" + payment + '}'; + } + +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/json/loan/LoanTypeListJaxb.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/json/loan/LoanTypeListJaxb.java new file mode 100644 index 0000000..f775c4b --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/json/loan/LoanTypeListJaxb.java @@ -0,0 +1,48 @@ +/* + * 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.controller.mobile.json.loan; + +import java.util.List; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@XmlRootElement(name = "availableLoans") +public class LoanTypeListJaxb { + + private List loans; + + public LoanTypeListJaxb() { + } + + /** + * + * @param loans + */ + public LoanTypeListJaxb(List loans) { + this.loans = loans; + } + + @XmlElement(name = "loans") + public List getLoans() { + return loans; + } + + public void setLoans(List loans) { + this.loans = loans; + } + + @Override + public String toString() { + return "LoanTypeListJaxb{" + "loans=" + loans + '}'; + } + +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/json/loan/TransferListToUpdateStatus.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/json/loan/TransferListToUpdateStatus.java new file mode 100644 index 0000000..075e456 --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/json/loan/TransferListToUpdateStatus.java @@ -0,0 +1,71 @@ +/* + * 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.controller.mobile.json.loan; + +import java.util.Objects; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@XmlRootElement(name = "transferListToUpdateStatus") +public class TransferListToUpdateStatus { + + private String idLoan; + + /** + * + */ + public TransferListToUpdateStatus() { + } + + /** + * + * @param idLoan + */ + public TransferListToUpdateStatus(String idLoan) { + this.idLoan = idLoan; + } + + @XmlElement(name = "idLoan") + public String getIdLoan() { + return idLoan; + } + + public void setIdLoan(String idLoan) { + this.idLoan = idLoan; + } + + @Override + public int hashCode() { + int hash = 3; + hash = 79 * hash + Objects.hashCode(this.idLoan); + return hash; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final TransferListToUpdateStatus other = (TransferListToUpdateStatus) obj; + if (!Objects.equals(this.idLoan, other.idLoan)) { + return false; + } + return true; + } + +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/json/loan/UpdateLoanToDeliveryStatusDTO.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/json/loan/UpdateLoanToDeliveryStatusDTO.java new file mode 100644 index 0000000..461fe6c --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/json/loan/UpdateLoanToDeliveryStatusDTO.java @@ -0,0 +1,102 @@ +/* + * 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.controller.mobile.json.loan; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@XmlRootElement(name = "updateLoanToDeliveryStatusDTO") +public class UpdateLoanToDeliveryStatusDTO { + + private String idLoan; + private String strDate; + private String customerName; + private String endorsementName; + private String userName; + private Double amount; + + public UpdateLoanToDeliveryStatusDTO() { + } + + /** + * + * @param idLoan + * @param strDate + * @param customerName + * @param endorsementName + * @param userName + * @param amount + */ + public UpdateLoanToDeliveryStatusDTO(String idLoan, String strDate, String customerName, String endorsementName, String userName, Double amount) { + this.idLoan = idLoan; + this.strDate = strDate; + this.customerName = customerName; + this.endorsementName = endorsementName; + this.userName = userName; + this.amount = amount; + } + + @XmlElement(name = "idLoan") + public String getIdLoan() { + return idLoan; + } + + public void setIdLoan(String idLoan) { + this.idLoan = idLoan; + } + + @XmlElement(name = "strDate") + public String getStrDate() { + return strDate; + } + + public void setStrDate(String strDate) { + this.strDate = strDate; + } + + @XmlElement(name = "customerName") + public String getCustomerName() { + return customerName; + } + + public void setCustomerName(String customerName) { + this.customerName = customerName; + } + + @XmlElement(name = "endorsementName") + public String getEndorsementName() { + return endorsementName; + } + + public void setEndorsementName(String endorsementName) { + this.endorsementName = endorsementName; + } + + @XmlElement(name = "userName") + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + @XmlElement(name = "amount") + public Double getAmount() { + return amount; + } + + public void setAmount(Double amount) { + this.amount = amount; + } + +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/json/loan/UpdateLoanToDeliveryStatusList.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/json/loan/UpdateLoanToDeliveryStatusList.java new file mode 100644 index 0000000..584a1ca --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/json/loan/UpdateLoanToDeliveryStatusList.java @@ -0,0 +1,67 @@ +/* + * 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.controller.mobile.json.loan; + +import java.util.List; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@XmlRootElement(name = "updateLoanToDeliveryStatusList") +public class UpdateLoanToDeliveryStatusList { + + private String idUpdateUser; + private String comments; + private List loanToDeliveryList; + + public UpdateLoanToDeliveryStatusList() { + } + + /** + * + * @param idUpdateUser + * @param comments + * @param loanToDeliveryList + */ + public UpdateLoanToDeliveryStatusList(String idUpdateUser, String comments, List loanToDeliveryList) { + this.idUpdateUser = idUpdateUser; + this.comments = comments; + this.loanToDeliveryList = loanToDeliveryList; + } + + @XmlElement(name = "idUpdateUser") + public String getIdUpdateUser() { + return idUpdateUser; + } + + public void setIdUpdateUser(String idUpdateUser) { + this.idUpdateUser = idUpdateUser; + } + + @XmlElement(name = "comments") + public String getComments() { + return comments; + } + + public void setComments(String comments) { + this.comments = comments; + } + + @XmlElement(name = "loanToDeliveryList") + public List getLoanToDeliveryList() { + return loanToDeliveryList; + } + + public void setLoanToDeliveryList(List loanToDeliveryList) { + this.loanToDeliveryList = loanToDeliveryList; + } + +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/moxy/PersonMxy.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/moxy/PersonMxy.java new file mode 100644 index 0000000..e9e3afe --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/moxy/PersonMxy.java @@ -0,0 +1,122 @@ +/* + * 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.controller.mobile.moxy; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public abstract class PersonMxy { + + protected String id; + protected String firstName; + protected String secondName; + protected String lastName; + protected String middleName; + protected String addressHome; + protected String addressWork; + protected String phoneHome; + protected String phoneWork; + protected String thumbnail; + + public PersonMxy() { + } + + public PersonMxy(String id, String firstName, String lastName, String thumbnail) { + this.id = id; + this.firstName = firstName; + this.lastName = lastName; + this.thumbnail = thumbnail; + } + + 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 String getAddressHome() { + return addressHome; + } + + public void setAddressHome(String addressHome) { + this.addressHome = addressHome; + } + + public String getAddressWork() { + return addressWork; + } + + public void setAddressWork(String addressWork) { + this.addressWork = addressWork; + } + + public String getPhoneHome() { + return phoneHome; + } + + public void setPhoneHome(String phoneHome) { + this.phoneHome = phoneHome; + } + + public String getPhoneWork() { + return phoneWork; + } + + public void setPhoneWork(String phoneWork) { + this.phoneWork = phoneWork; + } + + public String getThumbnail() { + return thumbnail; + } + + public void setThumbnail(String thumbnail) { + this.thumbnail = thumbnail; + } + + @Override + public String toString() { + return "PersonMxy{" + "firstName=" + firstName + ", lastName=" + lastName + '}'; + } + +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/moxy/login/UserMxy.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/moxy/login/UserMxy.java new file mode 100644 index 0000000..f230c8c --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/moxy/login/UserMxy.java @@ -0,0 +1,121 @@ +/* + * 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.controller.mobile.moxy.login; + +import com.arrebol.apc.controller.mobile.moxy.PersonMxy; +import java.util.List; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class UserMxy extends PersonMxy { + + private String userName; + private String officeId; + private String routeId; + private String certifier; + private String management; + + private List preferences; + + public UserMxy() { + } + + /** + * + * @param id + * @param userName + * @param thumbnail + * @param officeId + * @param routeId + * @param certifier + */ + public UserMxy(String id, String userName, String thumbnail, String officeId, String routeId, String certifier) { + this.id = id; + this.userName = userName; + this.thumbnail = thumbnail; + this.officeId = officeId; + this.routeId = routeId; + this.certifier = certifier; + } + + /** + * + * @param id + * @param userName + * @param thumbnail + * @param officeId + * @param routeId + * @param certifier + * @param management + */ + public UserMxy(String id, String userName, String thumbnail, String officeId, String routeId, String certifier, String management) { + this.id = id; + this.userName = userName; + this.thumbnail = thumbnail; + this.officeId = officeId; + this.routeId = routeId; + this.certifier = certifier; + this.management = management; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getOfficeId() { + return officeId; + } + + public void setOfficeId(String officeId) { + this.officeId = officeId; + } + + public void setPreferences(List preferences) { + this.preferences = preferences; + } + + public List getPreferences() { + return preferences; + } + + public String getRouteId() { + return routeId; + } + + public void setRouteId(String routeId) { + this.routeId = routeId; + } + + public String getCertifier() { + return certifier; + } + + public void setCertifier(String certifier) { + this.certifier = certifier; + } + + public String getManagement() { + return management; + } + + public void setManagement(String management) { + this.management = management; + } + + @Override + public String toString() { + return "UserMxy{" + "userName=" + userName + ", preferences=" + preferences + '}'; + } + +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/moxy/login/UserPreferenceMxy.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/moxy/login/UserPreferenceMxy.java new file mode 100644 index 0000000..dff1fee --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/moxy/login/UserPreferenceMxy.java @@ -0,0 +1,53 @@ +/* + * 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.controller.mobile.moxy.login; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class UserPreferenceMxy { + + private String preferenceName; + private String preferenceValue; + + public UserPreferenceMxy() { + } + + /** + * + * @param preferenceName + * @param preferenceValue + */ + public UserPreferenceMxy(String preferenceName, String preferenceValue) { + this.preferenceName = preferenceName; + this.preferenceValue = preferenceValue; + } + + public String getPreferenceName() { + return preferenceName; + } + + public void setPreferenceName(String preferenceName) { + this.preferenceName = preferenceName; + } + + public String getPreferenceValue() { + return preferenceValue; + } + + public void setPreferenceValue(String preferenceValue) { + this.preferenceValue = preferenceValue; + } + + @Override + public String toString() { + return "UserPreferenceMxy{" + "preferenceName=" + preferenceName + '}'; + } + +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/moxy/views/ContainerRoutes.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/moxy/views/ContainerRoutes.java new file mode 100644 index 0000000..1282ac4 --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/moxy/views/ContainerRoutes.java @@ -0,0 +1,43 @@ +/* + * 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.controller.mobile.moxy.views; + +import java.util.List; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@XmlRootElement(name = "containerRoutes") +public class ContainerRoutes { + + private List routes; + + public ContainerRoutes() { + } + + /** + * + * @param routes + */ + public ContainerRoutes(List routes) { + this.routes = routes; + } + + @XmlElement(name = "routes") + public List getRoutes() { + return routes; + } + + public void setRoutes(List routes) { + this.routes = routes; + } + +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/moxy/views/LoanByUserOrderPreferenceViewJaxb.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/moxy/views/LoanByUserOrderPreferenceViewJaxb.java new file mode 100644 index 0000000..e96591d --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/moxy/views/LoanByUserOrderPreferenceViewJaxb.java @@ -0,0 +1,116 @@ +/* + * 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.controller.mobile.moxy.views; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@XmlRootElement(name = "loanByUserOrderPreference") +public class LoanByUserOrderPreferenceViewJaxb { + + private String id; + + private String userId; + + private String customerName; + + private String customerAddressHome; + + private String customerAddressBusiness; + + private Integer orderInList; + + public LoanByUserOrderPreferenceViewJaxb() { + } + + /** + * + * @param id + * @param userId + * @param orderInList + */ + public LoanByUserOrderPreferenceViewJaxb(String id, String userId, Integer orderInList) { + this.id = id; + this.userId = userId; + this.orderInList = orderInList; + } + + /** + * + * @param customerName + * @param orderInList + */ + public LoanByUserOrderPreferenceViewJaxb(String customerName, Integer orderInList) { + this.customerName = customerName; + this.orderInList = orderInList; + } + + @XmlAttribute(name = "id") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + @XmlAttribute(name = "userId") + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + @XmlAttribute(name = "customerName") + public String getCustomerName() { + return customerName; + } + + public void setCustomerName(String customerName) { + this.customerName = customerName; + } + + @XmlAttribute(name = "customerAddressHome") + public String getCustomerAddressHome() { + return customerAddressHome; + } + + public void setCustomerAddressHome(String customerAddressHome) { + this.customerAddressHome = customerAddressHome; + } + + @XmlAttribute(name = "customerAddressBusiness") + public String getCustomerAddressBusiness() { + return customerAddressBusiness; + } + + public void setCustomerAddressBusiness(String customerAddressBusiness) { + this.customerAddressBusiness = customerAddressBusiness; + } + + @XmlAttribute(name = "orderInList") + public Integer getOrderInList() { + return orderInList; + } + + public void setOrderInList(Integer orderInList) { + this.orderInList = orderInList; + } + + @Override + public String toString() { + return "LoanByUserOrderPreferenceViewJaxb{" + "customerName=" + customerName + ", orderInList=" + orderInList + '}'; + } + +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/moxy/views/LoanByUserOrderPreferenceViewListJaxb.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/moxy/views/LoanByUserOrderPreferenceViewListJaxb.java new file mode 100644 index 0000000..db05f0e --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/moxy/views/LoanByUserOrderPreferenceViewListJaxb.java @@ -0,0 +1,39 @@ +/* + * 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.controller.mobile.moxy.views; + +import java.util.List; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@XmlRootElement(name = "systemPreferences") +public class LoanByUserOrderPreferenceViewListJaxb { + + List loanByUserOrderPreferences; + + public LoanByUserOrderPreferenceViewListJaxb() { + } + + public LoanByUserOrderPreferenceViewListJaxb(List loanByUserOrderPreferences) { + this.loanByUserOrderPreferences = loanByUserOrderPreferences; + } + + @XmlElement(name = "loanByUserOrderPreferences") + public List getLoanByUserOrderPreferences() { + return loanByUserOrderPreferences; + } + + public void setLoanByUserOrderPreferences(List loanByUserOrderPreferences) { + this.loanByUserOrderPreferences = loanByUserOrderPreferences; + } + +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/moxy/views/PaymentTrackingViewJaxb.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/moxy/views/PaymentTrackingViewJaxb.java new file mode 100644 index 0000000..36eacce --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/moxy/views/PaymentTrackingViewJaxb.java @@ -0,0 +1,60 @@ +/* + * 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.controller.mobile.moxy.views; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@XmlRootElement(name = "paymentTracking") +public class PaymentTrackingViewJaxb { + + private String id; + + private Integer totalExpected; + + private Integer totalNow; + + @XmlElement(name = "id") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + @XmlElement(name = "totalExpected") + public Integer getTotalExpected() { + if (null == totalExpected) { + totalExpected = 0; + } + return totalExpected; + } + + public void setTotalExpected(Integer totalExpected) { + this.totalExpected = totalExpected; + } + + @XmlElement(name = "totalNow") + public Integer getTotalNow() { + if (null == totalNow) { + totalNow = 0; + } + + return totalNow; + } + + public void setTotalNow(Integer totalNow) { + this.totalNow = totalNow; + } + +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/moxy/views/RouteJaxb.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/moxy/views/RouteJaxb.java new file mode 100644 index 0000000..14c6b0d --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/moxy/views/RouteJaxb.java @@ -0,0 +1,49 @@ +/* + * 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.controller.mobile.moxy.views; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@XmlRootElement(name = "route") +public class RouteJaxb { + + private String id; + private String name; + + public RouteJaxb() { + } + + public RouteJaxb(String id, String name) { + this.id = id; + this.name = name; + } + + @XmlElement(name = "id") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + @XmlElement(name = "name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/ArrebolTestRepository.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/ArrebolTestRepository.java new file mode 100644 index 0000000..b7d4d0d --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/ArrebolTestRepository.java @@ -0,0 +1,39 @@ +/* + * 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.controller.mobile.repository; + +import com.arrebol.apc.test.ArrebolTest; +import java.io.Serializable; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class ArrebolTestRepository extends GenericRepository implements Serializable { + + /** + * + * @param arrebolTest + * @return + * @throws Exception + */ + public boolean saveArrebolTest(ArrebolTest arrebolTest) throws Exception { + logger.info("saveArrebolTest"); + try { + return save(arrebolTest); + } catch (Exception e) { + logger.error("saveArrebolTest", e); + throw e; + } + } + + private static final long serialVersionUID = -6564619785642944612L; + final Logger logger = LogManager.getLogger(ArrebolTestRepository.class); +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/GenericRepository.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/GenericRepository.java new file mode 100644 index 0000000..30d1351 --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/GenericRepository.java @@ -0,0 +1,671 @@ +/* + * 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.controller.mobile.repository; + +import com.arrebol.apc.controller.mobile.util.HibernateUtil; +import com.arrebol.apc.model.ModelParameter; +import java.util.ArrayList; +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; +import org.hibernate.query.Query; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public abstract class GenericRepository { + + private Session sessionOld; + private Transaction transactionOld; + + /** + * Save an APC entity. + * + * @param entity APC entity in DB. + * @return + * @throws java.lang.Exception + */ + protected boolean save(Object entity) throws Exception { + logger.debug("Save"); + boolean success = false; + + Session session = null; + Transaction transaction = null; + try { + session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + session.save(entity); + + transaction.commit(); + logger.debug("Entity saved: " + entity); + + success = true; + } catch (HibernateException e) { + logger.error("Save Hibernate", e); + + if (null != transaction) { + transaction.rollback(); + } + throw e; + } catch (Exception e) { + logger.error("Method save() ", e); + + if (null != transaction) { + transaction.rollback(); + } + throw e; + } + /* finally { + if (null != session) { + session.close(); + } + }*/ + + return success; + } + + /** + * + * @param entities + * @return + * @throws java.lang.Exception + */ + protected boolean saveMany(List entities) throws Exception { + logger.debug("saveMany"); + boolean success = false; + + Session session = null; + Transaction transaction = null; + try { + session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + for (Object entity : entities) { + session.save(entity); + } + + transaction.commit(); + + logger.debug("Entities saveMany: "); + + success = true; + } catch (HibernateException e) { + logger.error("saveMany Hibernate", e); + + if (null != transaction) { + transaction.rollback(); + } + throw e; + } catch (Exception e) { + logger.error("Method saveMany() ", e); + + if (null != transaction) { + transaction.rollback(); + } + throw e; + } + /* finally { + if (null != session) { + session.close(); + } + }*/ + + return success; + } + + /** + * Update an APC entity. + * + * @param entity APC entity in DB. + * @return + * @throws java.lang.Exception + */ + protected boolean update(Object entity) throws Exception { + logger.debug("update"); + + boolean success = false; + Transaction transaction = null; + + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + session.update(entity); + + transaction.commit(); + + logger.debug("Entity updated: " + entity); + + success = true; + } catch (HibernateException e) { + logger.error("update Hibernate", e); + + if (null != transaction) { + transaction.rollback(); + } + throw e; + } catch (Exception e) { + logger.error("update save() ", e); + + if (null != transaction) { + transaction.rollback(); + } + throw e; + } + + return success; + } + + /** + * + * @param xmlQuery + * @param parameters + * @return + * @throws Exception + */ + protected boolean updateCreateNamedQuery(String xmlQuery, List parameters) throws Exception { + logger.debug("updateCreateNamedQuery"); + boolean success = false; + + Transaction transaction = null; + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + if (null != parameters && !parameters.isEmpty()) { + Query query = session.createNamedQuery(xmlQuery); + + parameters.forEach((param) -> { + query.setParameter(param.getParameter(), param.getValue()); + }); + + query.executeUpdate(); + logger.debug("Query update executed"); + } + + transaction.commit(); + + logger.debug("Entity updateCreateNamedQuery"); + + success = true; + } catch (HibernateException e) { + logger.error("updateCreateNamedQuery Hibernate", e); + + if (null != transaction) { + transaction.rollback(); + } + throw e; + } catch (Exception e) { + logger.error("Method updateCreateNamedQuery() ", e); + + if (null != transaction) { + transaction.rollback(); + } + throw e; + } + return success; + } + + /** + * Delete an APC entity. + * + * @param entity APC entity in DB. + * @return + * @throws java.lang.Exception + */ + protected boolean delete(Object entity) throws Exception { + logger.debug("delete"); + boolean success = false; + + Session session = null; + Transaction transaction = null; + try { + session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + session.delete(entity); + + transaction.commit(); + + logger.debug("Entity deleted: " + entity); + + success = true; + } catch (HibernateException e) { + logger.error("delete Hibernate", e); + + if (null != transaction) { + transaction.rollback(); + } + throw e; + } catch (Exception e) { + logger.error("Method delete() ", e); + + if (null != transaction) { + transaction.rollback(); + } + throw e; + } + /* finally { + if (null != session) { + session.close(); + } + }*/ + + return success; + } + + /** + * Find a APC entity. + * + * @param clazz APC entity class name to find in DB. + * @param id + * @return + * @throws java.lang.Exception + */ + protected Object findAPCEntity(Class clazz, String id) throws Exception { + logger.debug("findAPCEntity"); + + Object apcEntity = null; + Transaction transaction = null; + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + apcEntity = session.get(clazz, id); + + transaction.commit(); + + logger.debug("APC entity found: " + apcEntity); + } catch (HibernateException e) { + logger.error("findAPCEntity Hibernate", e); + + if (null != transaction) { + transaction.rollback(); + } + throw e; + } catch (Exception e) { + logger.error("Method findAPCEntity() ", e); + + if (null != transaction) { + transaction.rollback(); + } + throw e; + } + + return apcEntity; + } + + /** + * Execute a query from XML mapping file. + * + * @param clazz + * @param xmlQuery + * @param parameters + * @return + * @throws java.lang.Exception + */ + protected Object createNamedQueryUniqueResult(Class clazz, String xmlQuery, List parameters) throws Exception { + logger.debug("createNamedQueryUniqueResult"); + + Object entity = null; + Transaction transaction = null; + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + if (null != parameters && !parameters.isEmpty()) { + Query query = session.createNamedQuery(xmlQuery, clazz); + + parameters.forEach((param) -> { + query.setParameter(param.getParameter(), param.getValue()); + }); + + entity = query.uniqueResult(); + } + + transaction.commit(); + logger.debug("APC entity from xml query: " + entity); + } catch (HibernateException e) { + logger.error("createNamedQueryUniqueResult Hibernate", e); + + if (null != transaction) { + transaction.rollback(); + } + throw e; + } catch (Exception e) { + logger.error("Method createNamedQueryUniqueResult() ", e); + + if (null != transaction) { + transaction.rollback(); + } + throw e; + } + + return entity; + } + + /** + * + * @param clazz + * @param xmlQuery + * @param parameters + * @return + * @throws java.lang.Exception + */ + protected List createNamedQueryResultList(Class clazz, String xmlQuery, List parameters) throws Exception { + logger.debug("createNamedQueryResultList"); + + List entities = new ArrayList<>(); + Transaction transaction = null; + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + if (null != parameters && !parameters.isEmpty()) { + Query query = session.createNamedQuery(xmlQuery, clazz); + + parameters.forEach((param) -> { + query.setParameter(param.getParameter(), param.getValue()); + }); + + entities = query.getResultList(); + } + + transaction.commit(); + logger.debug("Total of APC entities from xml query: " + entities.size()); + } catch (HibernateException e) { + logger.error("createNamedQueryResultList Hibernate", e); + + if (null != transaction) { + transaction.rollback(); + } + throw e; + } catch (Exception e) { + logger.error("Method createNamedQueryResultList() ", e); + + if (null != transaction) { + transaction.rollback(); + } + throw e; + } + + return entities; + } + + /** + * + * @param clazz + * @param xmlQuery + * @param parameters + * @return + * @throws Exception + */ + protected List findEntityList(Class clazz, String xmlQuery, List parameters) throws Exception { + logger.debug("findEntityList"); + + List entities = new ArrayList<>(); + Transaction transaction = null; + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + Query query = session.createNamedQuery(xmlQuery, clazz); + + if (null != parameters && !parameters.isEmpty()) { + parameters.forEach((param) -> { + query.setParameter(param.getParameter(), param.getValue()); + }); + } + + entities = query.getResultList(); + + transaction.commit(); + logger.debug("Total of APC entities from xml query: " + entities.size()); + } catch (HibernateException e) { + logger.error("findEntityList Hibernate", e); + + if (null != transaction) { + transaction.rollback(); + } + throw e; + } catch (Exception e) { + logger.error("Method findEntityList() ", e); + + if (null != transaction) { + transaction.rollback(); + } + throw e; + } + + return entities; + } + + /** + * + * @param clazz + * @param xmlQuery + * @param parameters + * @param max + * @return + * @throws java.lang.Exception + */ + protected List createNamedQueryResultList(Class clazz, String xmlQuery, List parameters, int max) throws Exception { + logger.debug("createNamedQueryResultList"); + + List entities = new ArrayList<>(); + Transaction transaction = null; + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + if (null != parameters && !parameters.isEmpty()) { + Query query = session.createNamedQuery(xmlQuery, clazz); + + parameters.forEach((param) -> { + query.setParameter(param.getParameter(), param.getValue()); + }); + + query.setMaxResults(max); + + entities = query.getResultList(); + } + + transaction.commit(); + logger.debug("Total of APC entities from xml query: " + entities.size()); + } catch (HibernateException e) { + logger.error("createNamedQueryResultList Hibernate", e); + + if (null != transaction) { + transaction.rollback(); + } + throw e; + } catch (Exception e) { + logger.error("Method createNamedQueryResultList() ", e); + + if (null != transaction) { + transaction.rollback(); + } + throw e; + } + + return entities; + } + + /** + * + * @param xmlQuery + * @param parameters + * @return + */ + protected List xmlQueryTuple(String xmlQuery, List parameters) { + logger.debug("xmlQueryTuple"); + + List entityList = null; + Transaction transaction = null; + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + Query query = session.createNamedQuery(xmlQuery, Tuple.class); + + if (null != parameters && !parameters.isEmpty()) { + parameters.forEach((param) -> { + query.setParameter(param.getParameter(), param.getValue()); + }); + + entityList = query.getResultList(); + } + + transaction.commit(); + } catch (HibernateException e) { + logger.error("xmlQueryTuple Hibernate", e); + + if (null != transaction) { + transaction.rollback(); + } + throw e; + } catch (Exception e) { + logger.error("Method xmlQueryTuple() ", e); + + if (null != transaction) { + transaction.rollback(); + } + throw e; + } + + return entityList; + } + + /** + * + * @param xmlUpdateOrDeleteQuery + * @param parameters + * @return + */ + protected boolean xmlUpdateOrDelete(String xmlUpdateOrDeleteQuery, List parameters) { + boolean success = false; + Transaction transaction = null; + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + Query updateOrDeleteQuery = session.createNamedQuery(xmlUpdateOrDeleteQuery); + + if (null != parameters && !parameters.isEmpty()) { + parameters.forEach((parameter) -> { + updateOrDeleteQuery.setParameter(parameter.getParameter(), parameter.getValue()); + }); + + int total = updateOrDeleteQuery.executeUpdate(); + + if (total > 0) { + transaction.commit(); + success = true; + } else { + transaction.rollback(); + } + } else { + transaction.rollback(); + } + } catch (HibernateException e) { + logger.error("xmlUpdateOrDelete Hibernate", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + } catch (Exception e) { + logger.error("Method xmlUpdateOrDelete() ", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + } + + return success; + } + + public Object genericObjectFromEntity(Class clazz, String xmlQuery, List parameters) throws Exception { + logger.debug("genericObjectFromEntity"); + + Object entity = null; + Transaction transaction = null; + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + Query query = session.createNamedQuery(xmlQuery, clazz); + + if (null != parameters) { + parameters.forEach((param) -> { + query.setParameter(param.getParameter(), param.getValue()); + }); + } + + entity = query.uniqueResult(); + transaction.commit(); + + logger.debug("APC generic entity from xml query: " + entity); + } catch (HibernateException e) { + logger.error("genericObjectFromEntity Hibernate", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + } catch (Exception e) { + logger.error("Method genericObjectFromEntity() ", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + } + return entity; + } + + protected Session getSession() { + return sessionOld; + } + + protected void openConnection() { + try { + sessionOld = HibernateUtil.getSessionFactory().getCurrentSession(); + transactionOld = getSession().beginTransaction(); + } catch (Exception e) { + logger.error("openConnection", e); + throw e; + } + } + + protected void closeConnection() { + try { + transactionOld.commit(); + } catch (Exception e) { + logger.error("closeConnection", e); + rollback(); + } + } + + protected void rollback() { + if (null != transactionOld) { + transactionOld.rollback(); + } + } + + protected void flushAndClear() { + if (null != sessionOld) { + getSession().flush(); + getSession().clear(); + } + } + + final Logger logger = LogManager.getLogger(GenericRepository.class); +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/admin/ClosingDayRepository.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/admin/ClosingDayRepository.java new file mode 100644 index 0000000..104d7c8 --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/admin/ClosingDayRepository.java @@ -0,0 +1,78 @@ +/* + * 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.controller.mobile.repository.admin; + +import com.arrebol.apc.controller.mobile.repository.GenericRepository; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.admin.constance.ClosingDayCfg; +import java.io.Serializable; +import java.util.List; +import javax.persistence.Tuple; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class ClosingDayRepository extends GenericRepository implements Serializable { + + /** + * + * @param xmlQuery + * @param parameters + * @return + * @throws Exception + */ + public String findIdEntity(String xmlQuery, List parameters) throws Exception { + try { + for (Tuple tuple : xmlQueryTuple(xmlQuery, parameters)) { + return tuple.get(ClosingDayCfg.FIELD_ID, String.class); + } + + return null; + } catch (Exception e) { + logger.error("findIdEntity", e); + throw e; + } + } + + /** + * + * @param hbmQuery + * @param parameters + * @return + * @throws Exception + */ + public boolean updateClosingDay(String hbmQuery, List parameters) throws Exception { + try { + return xmlUpdateOrDelete(hbmQuery, parameters); + } catch (Exception e) { + logger.error("updateClosingDay", e); + throw e; + } + } + + /** + * + * @param hbmQuery + * @param parameters + * @return + * @throws Exception + */ + public Long countIdClosingDayByEmployee(String hbmQuery, List parameters) throws Exception { + try { + return (Long) genericObjectFromEntity(Long.class, hbmQuery, parameters); + } catch (Exception e) { + logger.error("countIdClosingDayByEmployee", e); + throw e; + } + } + + final Logger logger = LogManager.getLogger(getClass()); +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/admin/OtherExpenseRepository.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/admin/OtherExpenseRepository.java new file mode 100644 index 0000000..abf7681 --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/admin/OtherExpenseRepository.java @@ -0,0 +1,41 @@ +/* + * 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.controller.mobile.repository.admin; + +import com.arrebol.apc.controller.mobile.repository.GenericRepository; +import com.arrebol.apc.model.admin.OtherExpense; +import java.io.Serializable; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class OtherExpenseRepository extends GenericRepository implements Serializable { + + /** + * + * @param otherExpense + * @return + * @throws Exception + */ + public boolean saveOtherExpense(OtherExpense otherExpense) throws Exception { + logger.debug("addOtherExpense"); + try { + return save(otherExpense); + } catch (Exception e) { + logger.error("addOtherExpense", e); + throw e; + } + } + + private static final long serialVersionUID = -8510072805726896888L; + final Logger logger = LogManager.getLogger(OtherExpenseRepository.class); + +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/admin/StableGeneralBoxRepository.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/admin/StableGeneralBoxRepository.java new file mode 100644 index 0000000..8eb2938 --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/admin/StableGeneralBoxRepository.java @@ -0,0 +1,40 @@ +/* + * 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.controller.mobile.repository.admin; + +import com.arrebol.apc.controller.mobile.repository.GenericRepository; +import com.arrebol.apc.model.ModelParameter; +import java.io.Serializable; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class StableGeneralBoxRepository extends GenericRepository implements Serializable { + + /** + * + * @param hbmQuery + * @param parameters + * @return + * @throws Exception + */ + public Long countStableGeneralBoxByOfficeEqualsToCurrentDate(String hbmQuery, List parameters) throws Exception { + try { + return (Long) genericObjectFromEntity(Long.class, hbmQuery, parameters); + } catch (Exception e) { + logger.error("countStableGeneralBoxByOfficeEqualsToCurrentDate", e); + throw e; + } + } + + final Logger logger = LogManager.getLogger(getClass()); +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/admin/StableSmallBoxRepository.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/admin/StableSmallBoxRepository.java new file mode 100644 index 0000000..ab6a6b1 --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/admin/StableSmallBoxRepository.java @@ -0,0 +1,78 @@ +/* + * 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.controller.mobile.repository.admin; + +import com.arrebol.apc.controller.mobile.repository.GenericRepository; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.admin.constance.StableSmallBoxCfg; +import java.io.Serializable; +import java.util.List; +import javax.persistence.Tuple; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class StableSmallBoxRepository extends GenericRepository implements Serializable { + + /** + * + * @param xmlQuery + * @param parameters + * @return + * @throws Exception + */ + public String findIdEntity(String xmlQuery, List parameters) throws Exception { + try { + for (Tuple tuple : xmlQueryTuple(xmlQuery, parameters)) { + return tuple.get(StableSmallBoxCfg.FIELD_ID, String.class); + } + + return null; + } catch (Exception e) { + logger.error("findIdEntity", e); + throw e; + } + } + + /** + * + * @param hbmQuery + * @param parameters + * @return + * @throws Exception + */ + public boolean updateStableSmallBox(String hbmQuery, List parameters) throws Exception { + try { + return xmlUpdateOrDelete(hbmQuery, parameters); + } catch (Exception e) { + logger.error("updateStableSmallBox", e); + throw e; + } + } + + /** + * + * @param hbmQuery + * @param parameters + * @return + * @throws Exception + */ + public Long countStableSmallBoxByOfficeEqualsToCurrentDate(String hbmQuery, List parameters) throws Exception { + try { + return (Long) genericObjectFromEntity(Long.class, hbmQuery, parameters); + } catch (Exception e) { + logger.error("countStableSmallBoxByOfficeEqualsToCurrentDate", e); + throw e; + } + } + + final Logger logger = LogManager.getLogger(getClass()); +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/admin/TransferRepository.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/admin/TransferRepository.java new file mode 100644 index 0000000..63489f1 --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/admin/TransferRepository.java @@ -0,0 +1,94 @@ +/* + * 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.controller.mobile.repository.admin; + +import com.arrebol.apc.controller.mobile.repository.GenericRepository; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.admin.Transfer; +import com.arrebol.apc.model.ws.parsed.Exchange; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import javax.persistence.Tuple; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class TransferRepository extends GenericRepository implements Serializable { + + /** + * + * @param transfer + * @return + * @throws Exception + */ + public boolean addTransfer(Transfer transfer) throws Exception { + logger.debug("addTransfer"); + try { + return save(transfer); + } catch (Exception e) { + logger.error("addTransfer", e); + throw e; + } + } + + /** + * + * @param xmlQuery + * @param parameters + * @return + * @throws Exception + */ + public boolean updateTransfer(String xmlQuery, List parameters) throws Exception { + logger.debug("updateTransfer"); + try { + return updateCreateNamedQuery(xmlQuery, parameters); + } catch (Exception e) { + logger.error("updateTransfer", e); + throw e; + } + } + + /** + * + * @param xmlQuery + * @param parameters + * @return + * @throws Exception + */ + public List findAllTransferByUserIdAndCurdate(String xmlQuery, List parameters) throws Exception { + logger.debug("findAllTransferByUserIdAndCurdate"); + List results = new ArrayList<>(); + try { + List tuples = xmlQueryTuple(xmlQuery, parameters); + + tuples.forEach((tuple) -> { + results.add( + new Exchange( + tuple.get("id").toString(), + tuple.get("userTransmitter").toString().equals("SENDER"), + (BigDecimal) tuple.get("amountToTransfer"), + tuple.get("actionStatus").toString() + ) + ); + }); + + return results; + } catch (Exception e) { + logger.error("findAllTransferByUserIdAndCurdate", e); + throw e; + } + } + + private static final long serialVersionUID = 1787207383193052932L; + final Logger logger = LogManager.getLogger(TransferRepository.class); +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/bitacora/BitacoraRepository.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/bitacora/BitacoraRepository.java new file mode 100644 index 0000000..db770e7 --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/bitacora/BitacoraRepository.java @@ -0,0 +1,40 @@ +/* + * 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.controller.mobile.repository.bitacora; + +import com.arrebol.apc.controller.mobile.repository.GenericRepository; +import com.arrebol.apc.model.system.logs.Bitacora; +import java.io.Serializable; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class BitacoraRepository extends GenericRepository implements Serializable { + + /** + * + * @param bitacora + * @return + */ + public boolean saveBitacora(Bitacora bitacora) { + boolean success; + try { + success = save(bitacora); + } catch (Exception e) { + success = false; + logger.error("saveBitacora", e); + } + return success; + } + + final Logger logger = LogManager.getLogger(getClass()); + +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/gasoline/GasolineRepository.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/gasoline/GasolineRepository.java new file mode 100644 index 0000000..4ebf827 --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/gasoline/GasolineRepository.java @@ -0,0 +1,48 @@ +/* + * 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.controller.mobile.repository.gasoline; + +import com.arrebol.apc.controller.mobile.repository.GenericRepository; +import com.arrebol.apc.model.gasoline.Gasoline; +import java.io.Serializable; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class GasolineRepository extends GenericRepository implements Serializable { + + /** + * + * @param gasoline + * @return + * @throws Exception + */ + public boolean saveNewGasolinePayment(Gasoline gasoline) throws Exception { + boolean success = false; + + try { + save(gasoline); + + logger.info("New gasoline payment saved"); + + success = true; + } catch (Exception e) { + logger.error("addNewGasolineEntry", e); + + throw e; + } + + return success; + } + + private static final long serialVersionUID = -5280895557294295010L; + final Logger logger = LogManager.getLogger(getClass()); +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/jaas/AuthenticationRepository.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/jaas/AuthenticationRepository.java new file mode 100644 index 0000000..754d768 --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/jaas/AuthenticationRepository.java @@ -0,0 +1,89 @@ +/* + * 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.controller.mobile.repository.jaas; + +import com.arrebol.apc.controller.mobile.repository.GenericRepository; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.core.constance.MobileUserCfg; +import com.arrebol.apc.model.core.constance.UserMobilePreferenceCfg; +import com.arrebol.apc.model.mobile.access.MobileUser; +import com.arrebol.apc.model.mobile.preference.UserMobilePreference; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class AuthenticationRepository extends GenericRepository implements Serializable { + + /** + * + * @param userName + * @param password + * @return + * @throws Exception + */ + public MobileUser findUser(String userName, String password) throws Exception { + logger.debug("findUser"); + + MobileUser mobileUser = null; + try { + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(MobileUserCfg.FIELD_USER_NAME, userName)); + parameters.add(new ModelParameter(MobileUserCfg.FIELD_PASSWORD, password)); + + mobileUser = (MobileUser) createNamedQueryUniqueResult( + MobileUser.class, + MobileUserCfg.QUERY_FIND_MOBILE_USER_FROM_LOGIN, + parameters + ); + } catch (Exception e) { + logger.error("findUser", e); + throw e; + } + return mobileUser; + } + + /** + * + * @param userId + * @return + * @throws Exception + */ + public List findAllMobilePreferenceByUser(String userId) throws Exception { + logger.debug("findAllMobilePreferenceByUser"); + + List userMobilePreferences = new ArrayList<>(); + try { + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(UserMobilePreferenceCfg.FIELD_USER, new User(userId))); + + userMobilePreferences = createNamedQueryResultList( + UserMobilePreference.class, + UserMobilePreferenceCfg.QUERY_FIND_ALL_MOBILE_PREFERENCES_BY_USER, + parameters + ); + + } catch (Exception e) { + logger.error("findAllMobilePreferenceByUser", e); + throw e; + } + return userMobilePreferences; + } + + private static final long serialVersionUID = 4218734911509288001L; + final Logger logger = LogManager.getLogger(AuthenticationRepository.class); + +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/loan/AddAmountRepository.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/loan/AddAmountRepository.java new file mode 100644 index 0000000..b8d2709 --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/loan/AddAmountRepository.java @@ -0,0 +1,93 @@ +/* + * 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.controller.mobile.repository.loan; + +import com.arrebol.apc.controller.mobile.repository.GenericRepository; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.loan.LoanDetails; +import com.arrebol.apc.model.loan.LoanFeeNotification; +import java.io.Serializable; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.hibernate.HibernateException; +import org.hibernate.query.Query; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class AddAmountRepository extends GenericRepository implements Serializable { + + /** + * + * @param notification + * @param loanDetails + * @param xmlQuery + * @param parameters + * @return + * @throws Exception + */ + public boolean saveNewAmount( + LoanFeeNotification notification, + LoanDetails loanDetails, + String xmlQuery, + List parameters) throws Exception { + logger.debug("saveNewAmount"); + + boolean success = false; + int total = 0; + + try { + openConnection(); + + if (null != notification) { + getSession().save(notification); + logger.info("Notification saved: " + notification); + } + + getSession().save(loanDetails); + logger.info("Loan details saved: " + loanDetails); + + if (null != parameters && !parameters.isEmpty()) { + Query query = getSession().createNamedQuery(xmlQuery); + + parameters.forEach((param) -> { + query.setParameter(param.getParameter(), param.getValue()); + }); + + total = query.executeUpdate(); + logger.info("Query update executed"); + } + + if (total > 0) { + flushAndClear(); + closeConnection(); + + success = true; + + logger.info("Loan successfuly saved"); + } else { + logger.error("Loan could not be added: " + loanDetails); + rollback(); + } + } catch (HibernateException e) { + logger.error("Save Hibernate", e); + rollback(); + throw e; + } catch (Exception e) { + logger.error("Method save() ", e); + rollback(); + throw e; + } + return success; + } + + private static final long serialVersionUID = 6466918195145358594L; + final Logger logger = LogManager.getLogger(AddAmountRepository.class); +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/loan/LoanByRenovationRepository.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/loan/LoanByRenovationRepository.java new file mode 100644 index 0000000..094353f --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/loan/LoanByRenovationRepository.java @@ -0,0 +1,219 @@ +/* + * 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.controller.mobile.repository.loan; + +import com.arrebol.apc.controller.mobile.repository.GenericRepository; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.core.constance.LoanByRenovationCfg; +import com.arrebol.apc.model.core.constance.LoanByUserCfg; +import com.arrebol.apc.model.core.constance.LoanCfg; +import com.arrebol.apc.model.enums.ComissionType; +import com.arrebol.apc.model.enums.LoanRenovationStatus; +import com.arrebol.apc.model.enums.LoanStatus; +import com.arrebol.apc.model.loan.Delivery; +import com.arrebol.apc.model.loan.Loan; +import com.arrebol.apc.model.loan.LoanByRenovation; +import com.arrebol.apc.model.loan.LoanDetails; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.hibernate.query.Query; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class LoanByRenovationRepository extends GenericRepository implements Serializable { + + private static final long serialVersionUID = 1357519239619447184L; + final Logger logger = LogManager.getLogger(LoanByRenovationRepository.class); + + /** + * + * @param newLoanId + * @return + * @throws Exception + */ + public LoanByRenovation findLoanRenovationByNewLoanId(String newLoanId) throws Exception { + logger.debug("findLoanRenovationByNewLoanId"); + try { + List parameters = new ArrayList<>(); + + parameters.add( + new ModelParameter(LoanByRenovationCfg.FIELD_LOAN_NEW, new Loan(newLoanId)) + ); + + return (LoanByRenovation) createNamedQueryUniqueResult( + LoanByRenovation.class, + LoanByRenovationCfg.QUERY_FIND_LOAN_RENOVATION_BY_NEW_LOAN_ID, + parameters); + } catch (Exception e) { + logger.error("findLoanRenovationByNewLoanId", e); + throw e; + } + } + + /** + * + * @param loanByRenovation + * @param userId + * @param comments + * @param action + * @param amount + * @param discount + * @param loanDetails + * @param totalAmountPaid + * @param newLastReferenceNumber + * @param comission + * @return + * @throws Exception + */ + public boolean updateLoanRenovationFromCerfierView( + LoanByRenovation loanByRenovation, + String userId, + String comments, + boolean action, + BigDecimal amount, + BigDecimal discount, + LoanDetails loanDetails, + BigDecimal totalAmountPaid, + Integer newLastReferenceNumber, + ComissionType comission) throws Exception { + logger.debug("updateLoanRenovationFromCerfierView"); + boolean success = false; + try { + openConnection(); + + Date lastUpdatedOn = new Date(); + List parameters = new ArrayList<>(); + + // Update loanByRenovation details in Renovation table + parameters.add(new ModelParameter(LoanByRenovationCfg.FIELD_LOAN_RENOVATION_STATUS, action ? LoanRenovationStatus.APPROVED : LoanRenovationStatus.REJECTED)); + parameters.add(new ModelParameter(LoanByRenovationCfg.FIELD_COMMENTS, comments)); + parameters.add(new ModelParameter(LoanByRenovationCfg.FIELD_LAST_UPDATED_BY, userId)); + parameters.add(new ModelParameter(LoanByRenovationCfg.FIELD_LAST_UPDATED_ON, lastUpdatedOn)); + parameters.add(new ModelParameter(LoanByRenovationCfg.FIELD_ID, loanByRenovation.getId())); + + if (0 < executeQuery(LoanByRenovationCfg.QUERY_UPDATE_LOAN_RENOVATION, parameters)) { + + parameters.clear(); + + // Update NEW loan details in Loan table + parameters.add(new ModelParameter(LoanCfg.FIELD_LOAN_STATUS, action ? LoanStatus.APPROVED : LoanStatus.REJECTED)); + parameters.add(new ModelParameter(LoanCfg.FIELD_COMMENTS, comments)); + parameters.add(new ModelParameter(LoanCfg.FIELD_CREATED_ON, lastUpdatedOn)); + parameters.add(new ModelParameter(LoanCfg.FIELD_LAST_UPDATED_BY, userId)); + parameters.add(new ModelParameter(LoanCfg.FIELD_LAST_UPDATED_ON, lastUpdatedOn)); + parameters.add(new ModelParameter(LoanCfg.FIELD_ID, loanByRenovation.getLoanNew().getId())); + + if (0 < executeQuery(LoanCfg.QUERY_UPDATE_LOAN_WITH_CREATED_ON_BY_ID_FROM_CERTIFIER_VIEW, parameters)) { + parameters.clear(); + + // Update OLD loan details in Loan table + String commentsOldLoan = action ? "CrĆ©dito renovado" : "El certificador rechazo la renovaciĆ³n de este crĆ©dito"; + String strQuery = LoanCfg.QUERY_UPDATE_LOAN_BY_ID_FROM_CERTIFIER_VIEW; + + if (action && null != loanDetails && null != totalAmountPaid && null != newLastReferenceNumber) { + parameters.add(new ModelParameter(LoanCfg.FIELD_AMOUNT_PAID, totalAmountPaid)); + parameters.add(new ModelParameter(LoanCfg.FIELD_LAST_REFERENCE_NUMBER, newLastReferenceNumber)); + + strQuery = LoanCfg.QUERY_UPDATE_DISCOUNT_AND_LOAN_BY_ID_FROM_CERTIFIER_VIEW; + } + + parameters.add(new ModelParameter(LoanCfg.FIELD_LOAN_STATUS, action ? LoanStatus.FINISH : LoanStatus.APPROVED)); + parameters.add(new ModelParameter(LoanCfg.FIELD_COMMENTS, commentsOldLoan)); + parameters.add(new ModelParameter(LoanCfg.FIELD_LAST_UPDATED_BY, userId)); + parameters.add(new ModelParameter(LoanCfg.FIELD_LAST_UPDATED_ON, lastUpdatedOn)); + parameters.add(new ModelParameter(LoanCfg.FIELD_ID, loanByRenovation.getLoanOld().getId())); + + if (0 < executeQuery(strQuery, parameters)) { + + // Update OLD loanByUser details in Loan By User Table + List params = new ArrayList<>(); + + params.add(new ModelParameter(LoanByUserCfg.FIELD_LOAN, new Loan(loanByRenovation.getLoanOld().getId()))); + params.add(new ModelParameter(LoanByUserCfg.FIELD_LOAN_BY_USER_STATUS, action ? LoanStatus.FINISH : LoanStatus.APPROVED)); + + Query query1 = getSession().createNamedQuery(LoanByUserCfg.QUERY_UPDATE_LOAN_BY_USER_BY_LOAND_ID); + + params.forEach((param) -> { + query1.setParameter(param.getParameter(), param.getValue()); + }); + + query1.executeUpdate(); + + // Update NEW loanByUser details in Loan By User Table + params.clear(); + + params.add(new ModelParameter(LoanByUserCfg.FIELD_LOAN, new Loan(loanByRenovation.getLoanNew().getId()))); + params.add(new ModelParameter(LoanByUserCfg.FIELD_LOAN_BY_USER_STATUS, action ? LoanStatus.APPROVED : LoanStatus.REJECTED)); + + Query query2 = getSession().createNamedQuery(LoanByUserCfg.QUERY_UPDATE_LOAN_BY_USER_BY_LOAND_ID); + + params.forEach((param) -> { + query2.setParameter(param.getParameter(), param.getValue()); + }); + + query2.executeUpdate(); + + if (action) { + // Insert new loanDetails (discount) in Loan Details table + if (null != loanDetails) { + getSession().save(loanDetails); + } + + // Insert delivery details (To know cash that certifier deliveried) in Delivery Table + Delivery delivery = new Delivery( + new User(userId), + new Loan(loanByRenovation.getLoanNew().getId()), + amount, + userId, + new Date(), + comission + ); + + getSession().save(delivery); + } + + flushAndClear(); + closeConnection(); + + logger.info("Certifier delivery the loan details: " + loanByRenovation); + success = true; + } else { + rollback(); + } + } else { + rollback(); + } + } else { + rollback(); + } + return success; + } catch (Exception e) { + rollback(); + logger.error("updateLoanRenovationFromCerfierView", e); + throw e; + } + } + + private int executeQuery(String xmlQuery, List parameters) { + Query query = getSession().createNamedQuery(xmlQuery); + + parameters.forEach((param) -> { + query.setParameter(param.getParameter(), param.getValue()); + }); + + return query.executeUpdate(); + } +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/loan/LoanByUserRepository.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/loan/LoanByUserRepository.java new file mode 100644 index 0000000..d7b0e05 --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/loan/LoanByUserRepository.java @@ -0,0 +1,40 @@ +/* + * 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.controller.mobile.repository.loan; + +import com.arrebol.apc.controller.mobile.repository.GenericRepository; +import com.arrebol.apc.model.loan.LoanByUser; +import java.io.Serializable; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class LoanByUserRepository extends GenericRepository implements Serializable { + + /** + * + * @param loanByUser + * @return + * @throws Exception + */ + public boolean saveLoanByUser(LoanByUser loanByUser) throws Exception { + logger.debug("saveLoanByUser"); + try { + return save(loanByUser); + } catch (Exception e) { + logger.error("saveLoanByUser", e); + throw e; + } + } + + private static final long serialVersionUID = 7523456759588286540L; + final Logger logger = LogManager.getLogger(LoanByUserRepository.class); +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/loan/LoanDetailsRepository.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/loan/LoanDetailsRepository.java new file mode 100644 index 0000000..9dd0bfc --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/loan/LoanDetailsRepository.java @@ -0,0 +1,199 @@ +/* + * 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.controller.mobile.repository.loan; + +import com.arrebol.apc.controller.mobile.repository.GenericRepository; +import com.arrebol.apc.controller.mobile.util.HibernateUtil; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.enums.FeeStatus; +import com.arrebol.apc.model.loan.Loan; +import com.arrebol.apc.model.loan.LoanDetails; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import javax.persistence.Tuple; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.hibernate.Session; +import org.hibernate.Transaction; +import org.hibernate.query.Query; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class LoanDetailsRepository extends GenericRepository implements Serializable { + + /** + * + * @param details + * @return + * @throws Exception + */ + public boolean saveLoanDetails(LoanDetails details) throws Exception { + logger.debug("saveLoanDetails"); + try { + return save(details); + } catch (Exception e) { + logger.error("saveLoanDetails", e); + throw e; + } + } + + public List findFeesToPayByLoanId(String xmlQuery, List parameters) throws Exception { + logger.debug("findFeesToPayByLoanId"); + + List results = new ArrayList<>(); + try { + List tuples = xmlQueryTuple(xmlQuery, parameters); + + tuples.forEach((tuple) -> { + results.add(new LoanDetails(tuple.get("id", String.class), tuple.get("createdOn", Date.class), tuple.get("feeStatus", FeeStatus.class))); + }); + } catch (Exception e) { + logger.error("findFeesToPayByLoanId", e); + throw e; + } + + return results; + } + + /** + * + * @param xmlQuery + * @param parameters + * @return + * @throws Exception + */ + public List findLoanDetailsByLoanId(String xmlQuery, List parameters) throws Exception { + logger.debug("findLoanDetailsByLoanId"); + + List results = new ArrayList<>(); + try { + results = createNamedQueryResultList(LoanDetails.class, xmlQuery, parameters); + } catch (Exception e) { + logger.error("findLoanDetailsByLoanId", e); + throw e; + } + + return results; + } + + /** + * + * @param xmlQuery + * @param parameters + * @param loanDetails + * @return + * @throws Exception + */ + public boolean updatePaidFeesStatusInLoanDetailIds(String xmlQuery, List parameters, LoanDetails loanDetails) throws Exception { + boolean success = false; + + Session sssn = null; + Transaction trnsctn = null; + try { + sssn = HibernateUtil.getSessionFactory().getCurrentSession(); + trnsctn = sssn.beginTransaction(); + + Loan loan = sssn.get(Loan.class, loanDetails.getLoan().getId()); + + if (null != parameters && !parameters.isEmpty()) { + Query query = sssn.createNamedQuery(xmlQuery); + parameters.forEach((param) -> { + query.setParameter(param.getParameter(), param.getValue()); + }); + query.executeUpdate(); + logger.debug("Query update executed"); + } + BigDecimal totalFees = loan.getAmountPaid().add(loanDetails.getPaymentAmount()); + + loanDetails.setReferenceNumber(loan.getLastReferenceNumber() + 1); + + sssn.save(loanDetails); + + loan.setAmountPaid(totalFees); + loan.setLastReferenceNumber(loan.getLastReferenceNumber() + 1); + loan.setLastUpdatedBy(loanDetails.getCreatedBy()); + loan.setLastUpdatedOn(new Date()); + + sssn.update(loan); + + trnsctn.commit(); + + logger.info("Entity updated"); + success = true; + } catch (Exception e) { + logger.error("Method updatePaidFeesStatusInLoanDetailIds() ", e); + if (null != trnsctn) { + trnsctn.rollback(); + } + throw e; + } + /* finally { + if (null != sssn) { + sssn.close(); + } + }*/ + return success; + } + + /** + * + * @param hbmQuery + * @param params + * @return + */ + public Long countLoandDetails(String hbmQuery, List params) { + Long count; + Transaction transaction = null; + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + Query query = session.createNamedQuery(hbmQuery); + + params.forEach((param) -> { + query.setParameter(param.getParameter(), param.getValue()); + }); + + count = (Long) query.getSingleResult(); + + transaction.commit(); + + return count; + } catch (Exception e) { + logger.error("countLoandDetails", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + } + } + + /** + * + * @param hbmQuery + * @param parameters + * @return + * @throws Exception + */ + public boolean updateLoanDetails(String hbmQuery, List parameters) throws Exception { + try { + return updateCreateNamedQuery(hbmQuery, parameters); + } catch (Exception e) { + logger.error("Method updateLoanDetails", e); + throw e; + } + } + + private static final long serialVersionUID = -6088464996350747643L; + final Logger logger = LogManager.getLogger(LoanDetailsRepository.class); +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/loan/LoanFeeNotificationRepository.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/loan/LoanFeeNotificationRepository.java new file mode 100644 index 0000000..948756f --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/loan/LoanFeeNotificationRepository.java @@ -0,0 +1,62 @@ +/* + * 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.controller.mobile.repository.loan; + +import com.arrebol.apc.controller.mobile.repository.GenericRepository; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.loan.LoanFeeNotification; +import java.io.Serializable; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class LoanFeeNotificationRepository extends GenericRepository implements Serializable { + + /** + * + * @param notification + * @return + * @throws Exception + */ + public boolean saveLoanFeeNotification(LoanFeeNotification notification) throws Exception { + logger.debug("saveLoanFeeNotification"); + + try { + return save(notification); + } catch (Exception e) { + logger.error("saveLoanFeeNotification", e); + throw e; + } + } + + /** + * + * @param clazz + * @param xmlQuery + * @param parameters + * @return + * @throws Exception + */ + public Long countNotificationByLoanId(Class clazz, String xmlQuery, List parameters) throws Exception { + logger.debug("countNotificationByLoanId"); + + try { + return (Long) createNamedQueryUniqueResult(clazz, xmlQuery, parameters); + } catch (Exception e) { + logger.error("countNotificationByLoanId", e); + throw e; + } + } + + private static final long serialVersionUID = -7172367255017070335L; + final Logger logger = LogManager.getLogger(LoanFeeNotificationRepository.class); +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/loan/LoanRepository.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/loan/LoanRepository.java new file mode 100644 index 0000000..b04e25e --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/loan/LoanRepository.java @@ -0,0 +1,630 @@ +/* + * 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.controller.mobile.repository.loan; + +import com.arrebol.apc.controller.mobile.repository.GenericRepository; +import com.arrebol.apc.controller.mobile.util.HibernateUtil; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.catalog.People; +import com.arrebol.apc.model.core.constance.LoanByUserCfg; +import com.arrebol.apc.model.core.constance.LoanCfg; +import com.arrebol.apc.model.enums.LoanRenovationStatus; +import com.arrebol.apc.model.enums.LoanStatus; +import com.arrebol.apc.model.loan.Delivery; +import com.arrebol.apc.model.loan.Loan; +import com.arrebol.apc.model.loan.LoanByRenovation; +import com.arrebol.apc.model.loan.LoanByRenovationId; +import com.arrebol.apc.model.loan.LoanByUser; +import com.arrebol.apc.model.loan.LoanDetails; +import com.arrebol.apc.model.ws.parsed.LoanRequestedJaxb; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.hibernate.HibernateException; +import org.hibernate.Session; +import org.hibernate.Transaction; +import org.hibernate.query.Query; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class LoanRepository extends GenericRepository implements Serializable { + + /** + * + * @param loan + * @return + * @throws Exception + */ + public String saveLoan(Loan loan) throws Exception { + logger.debug("saveLoan"); + try { + if (save(loan)) { + return loan.getId(); + } else { + return null; + } + } catch (Exception e) { + logger.error("saveLoan", e); + throw e; + } + } + + public boolean updateLoan(Loan loan) throws Exception { + logger.debug("saveLoan"); + try { + return update(loan); + } catch (Exception e) { + logger.error("saveLoan", e); + throw e; + } + } + + /** + * + * @param loanId + * @return + * @throws Exception + */ + public Loan findLoanById(String loanId) throws Exception { + logger.debug("findLoanById"); + try { + return (Loan) findAPCEntity(Loan.class, loanId); + } catch (Exception e) { + logger.error("findLoanById", e); + throw e; + } + } + + /** + * + * @param loanId + * @param xmlQuery + * @param parameters + * @param status + * @param delivery + * @return + * @throws Exception + */ + public boolean updateLoan(String loanId, String xmlQuery, List parameters, LoanStatus status, Delivery delivery) throws Exception { + logger.debug("updateLoan"); + boolean success = false; + Transaction transaction = null; + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + List params = new ArrayList<>(); + + params.add(new ModelParameter(LoanByUserCfg.FIELD_LOAN, new Loan(loanId))); + params.add(new ModelParameter(LoanByUserCfg.FIELD_LOAN_BY_USER_STATUS, status)); + + Query query1 = session.createNamedQuery(LoanByUserCfg.QUERY_UPDATE_LOAN_BY_USER_BY_LOAND_ID); + + params.forEach((param) -> { + query1.setParameter(param.getParameter(), param.getValue()); + }); + + query1.executeUpdate(); + + if (null != parameters && !parameters.isEmpty()) { + Query query = session.createNamedQuery(xmlQuery); + + parameters.forEach((param) -> { + query.setParameter(param.getParameter(), param.getValue()); + }); + + if (0 < query.executeUpdate()) { + + if (null != delivery) { + session.save(delivery); + } + + transaction.commit(); + + success = true; + logger.info("updateLoan suucess"); + } else { + if (null != transaction) { + transaction.rollback(); + } + } + } else { + if (null != transaction) { + transaction.rollback(); + } + } + return success; + } catch (Exception e) { + logger.error("updateLoan", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + } + } + + public boolean updateLoanWithComission(String loanId, String xmlQuery, List parameters, LoanStatus status, Delivery delivery) throws Exception { + logger.debug("updateLoan"); + boolean success = false; + + Transaction transaction = null; + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + List params = new ArrayList<>(); + + params.add(new ModelParameter(LoanByUserCfg.FIELD_LOAN, new Loan(loanId))); + params.add(new ModelParameter(LoanByUserCfg.FIELD_LOAN_BY_USER_STATUS, status)); + + Query query1 = session.createNamedQuery(LoanByUserCfg.QUERY_UPDATE_LOAN_BY_USER_BY_LOAND_ID); + + params.forEach((param) -> { + query1.setParameter(param.getParameter(), param.getValue()); + }); + + query1.executeUpdate(); + + if (null != parameters && !parameters.isEmpty()) { + Query query = session.createNamedQuery(xmlQuery); + + parameters.forEach((param) -> { + query.setParameter(param.getParameter(), param.getValue()); + }); + + if (0 < query.executeUpdate()) { + + if (null != delivery) { + session.save(delivery); + } + + transaction.commit(); + + success = true; + logger.info("updateLoan suucess"); + } else { + if (null != transaction) { + transaction.rollback(); + } + } + } else { + if (null != transaction) { + transaction.rollback(); + } + } + return success; + } catch (Exception e) { + logger.error("updateLoan", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + } + } + + /** + * + * @param loan + * @param loanByUser + * @param jaxb + * @return + * @throws Exception + */ + public boolean createLoan(Loan loan, LoanByUser loanByUser, LoanRequestedJaxb jaxb) throws Exception { + logger.debug("createLoan"); + try { + People customer = jaxb.getCustomer().isCreatePerson() + ? null + : new People(jaxb.getCustomer().getId()); + + People endorsement = jaxb.getEndorsement().isCreatePerson() + ? null + : new People(jaxb.getEndorsement().getId()); + + openConnection(); + + if (null == customer) { + customer = new People( + jaxb.getCustomer(), + true, + jaxb.getOfficeId(), + jaxb.getUserId(), + //jaxb.getRouteId() + jaxb.chooseRouteId() + ); + + getSession().save(customer); + } + + if (null == endorsement) { + endorsement = new People( + jaxb.getEndorsement(), + false, + jaxb.getOfficeId(), + jaxb.getUserId(), + jaxb.getRouteId() + ); + + getSession().save(endorsement); + } + + loan.setCustomer(customer); + loan.setEndorsement(endorsement); + + getSession().save(loan); + + loanByUser.getId().setIdLoan(loan.getId()); + + getSession().save(loanByUser); + + flushAndClear(); + closeConnection(); + + return true; + } catch (HibernateException e) { + logger.error("createLoan", e); + rollback(); + throw e; + } catch (Exception e) { + logger.error("Method createLoan() ", e); + rollback(); + throw e; + } + } + + /** + * + * @param oldLoanId + * @param loan + * @param loanByUser + * @param xmlQuery + * @param parameters + * @param loanDetails + * @param endorsement + * @param isNewEndorsement + * @return + * @throws Exception + */ + public boolean renovationLoan(String oldLoanId, + Loan loan, + LoanByUser loanByUser, + String xmlQuery, + List parameters, + LoanDetails loanDetails, + People endorsement, + boolean isNewEndorsement) throws Exception { + logger.debug("renovationLoan"); + + boolean success = false; + try { + openConnection(); + int total = 0; + + // Crea Aval y lo asigna al nuevo prestamo + if (isNewEndorsement) { + getSession().save(endorsement); + loan.setEndorsement(endorsement); + } + + // falta actualizar el status de la tabla APC_LOAN_BY_USER + // del loan (oldLoanId) a PENDING_RENOVATION + List params = new ArrayList<>(); + + params.add(new ModelParameter(LoanByUserCfg.FIELD_LOAN, new Loan(oldLoanId))); + params.add(new ModelParameter(LoanByUserCfg.FIELD_LOAN_BY_USER_STATUS, LoanStatus.PENDING_RENOVATION)); + + Query query1 = getSession().createNamedQuery(LoanByUserCfg.QUERY_UPDATE_LOAN_BY_USER_BY_LOAND_ID); + + params.forEach((param) -> { + query1.setParameter(param.getParameter(), param.getValue()); + }); + + query1.executeUpdate(); + + if (null != parameters && !parameters.isEmpty()) { + Query query = getSession().createNamedQuery(xmlQuery); + + parameters.forEach((param) -> { + query.setParameter(param.getParameter(), param.getValue()); + }); + + total = query.executeUpdate(); + logger.info("Query update executed"); + } + if (total > 0) { + getSession().save(loan); + + loanByUser.getId().setIdLoan(loan.getId()); + + getSession().save(loanByUser); + + LoanByRenovation renovation = new LoanByRenovation( + new LoanByRenovationId( + oldLoanId, + loan.getId() + ) + ); + + renovation.setLoanRenovationStatus(LoanRenovationStatus.PENDING); + renovation.setCreatedBy(loan.getCreatedBy()); + renovation.setCreatedOn(loan.getCreatedOn()); + + getSession().save(renovation); + + getSession().save(loanDetails); + + flushAndClear(); + closeConnection(); + + logger.info("Renovation was created"); + success = true; + } else { + logger.error("Renovation was not updated"); + rollback(); + } + + return success; + } catch (HibernateException e) { + logger.error("renovationLoan", e); + rollback(); + throw e; + } catch (Exception e) { + logger.error("Method renovationLoan() ", e); + rollback(); + throw e; + } + } + + /** + * + * @param oldLoanId + * @param loan + * @param loanByUser + * @param endorsement + * @param isNewEndorsement + * @return + * @throws Exception + */ + public boolean renovationHasPaymentToday(String oldLoanId, + Loan loan, + LoanByUser loanByUser, + People endorsement, + boolean isNewEndorsement) throws Exception { + logger.debug("renovationHasPaymentToday"); + + boolean success = false; + try { + openConnection(); + int total; + + // Crea Aval y lo asigna al nuevo prestamo + if (isNewEndorsement) { + getSession().save(endorsement); + loan.setEndorsement(endorsement); + } + + /** + * Actualiza el loan original a PENDING RENOVATION + */ + List params = new ArrayList<>(); + + params.add(new ModelParameter(LoanCfg.FIELD_LOAN_STATUS, LoanStatus.PENDING_RENOVATION)); + params.add(new ModelParameter(LoanCfg.FIELD_COMMENTS, "El cliente previamente abono su pago diario, solo me contactode nuevo para renovar su crĆ©dito")); + params.add(new ModelParameter(LoanCfg.FIELD_LAST_UPDATED_BY, loanByUser.getCreatedBy())); + params.add(new ModelParameter(LoanCfg.FIELD_LAST_UPDATED_ON, new Date())); + params.add(new ModelParameter(LoanCfg.FIELD_ID, oldLoanId)); + + Query query = getSession().createNamedQuery(LoanCfg.QUERY_UPDATE_LOAN_BY_ID_FROM_CERTIFIER_VIEW); + + params.forEach((param) -> { + query.setParameter(param.getParameter(), param.getValue()); + }); + + total = query.executeUpdate(); + + if (total > 0) { + /** + * Actualiza el loan by user a PENDING RENOVATION + */ + params.clear(); + + params.add(new ModelParameter(LoanByUserCfg.FIELD_LOAN, new Loan(oldLoanId))); + params.add(new ModelParameter(LoanByUserCfg.FIELD_LOAN_BY_USER_STATUS, LoanStatus.PENDING_RENOVATION)); + + Query query2 = getSession().createNamedQuery(LoanByUserCfg.QUERY_UPDATE_LOAN_BY_USER_BY_LOAND_ID); + + params.forEach((param) -> { + query2.setParameter(param.getParameter(), param.getValue()); + }); + + total = query.executeUpdate(); + + if (total > 0) { + // Crea el nuevo prestamo + getSession().save(loan); + + loanByUser.getId().setIdLoan(loan.getId()); + + // guarda elprestamo por usuario + getSession().save(loanByUser); + + // crea historico para saber de donde proviene en nuevo prestamo + LoanByRenovation renovation = new LoanByRenovation( + new LoanByRenovationId( + oldLoanId, + loan.getId() + ) + ); + + renovation.setLoanRenovationStatus(LoanRenovationStatus.PENDING); + renovation.setCreatedBy(loan.getCreatedBy()); + renovation.setCreatedOn(loan.getCreatedOn()); + + getSession().save(renovation); + + flushAndClear(); + closeConnection(); + + logger.info("renovationHasPaymentToday was created"); + success = true; + } else { + logger.error("renovationHasPaymentToday was not updated"); + rollback(); + } + } else { + logger.error("renovationHasPaymentToday was not updated"); + rollback(); + } + return success; + } catch (HibernateException e) { + logger.error("renovationHasPaymentToday", e); + rollback(); + throw e; + } catch (Exception e) { + logger.error("Method renovationHasPaymentToday() ", e); + rollback(); + throw e; + } + } + + /** + * + * @param hbmQuery + * @param params + * @return + */ + public Long countLoan(String hbmQuery, List params) { + Long count; + Transaction transaction = null; + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + Query query = session.createNamedQuery(hbmQuery); + + params.forEach((param) -> { + query.setParameter(param.getParameter(), param.getValue()); + }); + + count = (Long) query.getSingleResult(); + + transaction.commit(); + + return count; + } catch (Exception e) { + logger.error("countLoan", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + } + } + + /** + * + * @param hbmQuery + * @param params + * @return + */ + public String findLoanId(String hbmQuery, List params) { + String loanId; + Transaction transaction = null; + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + Query query = session.createNamedQuery(hbmQuery); + + params.forEach((param) -> { + query.setParameter(param.getParameter(), param.getValue()); + }); + + loanId = (String) query.getSingleResult(); + + transaction.commit(); + + return loanId; + } catch (Exception e) { + logger.error("findLoanId", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + } + } + + /** + * + * @param xmlUpdateOrDeleteQuery + * @param parameters + * @return + */ + public boolean deleteLoanDetailsByLoanCurdate(String xmlUpdateOrDeleteQuery, List parameters) { + logger.debug("updateLoandByUserByUserId"); + + return xmlUpdateOrDelete(xmlUpdateOrDeleteQuery, parameters); + } + + /** + * + * @param updateLoanStatusQuery + * @param updateLoanByUserStatusQuery + * @param loanParams + * @param loanByUserParams + * @return + * @throws Exception + */ + public boolean loanPendingStatusToDelivery(String updateLoanStatusQuery, String updateLoanByUserStatusQuery, List loanParams, List loanByUserParams) throws Exception { + boolean success = false; + Transaction transaction = null; + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + // Update loan status WHERE id IN + Query query = session.createNamedQuery(updateLoanStatusQuery); + + for (ModelParameter parameters : loanParams) { + query.setParameter(parameters.getParameter(), parameters.getValue()); + } + + query.executeUpdate(); + query.getParameters().clear(); + + // Update loan by user status WHERE loan IN + query = session.createNamedQuery(updateLoanByUserStatusQuery); + + for (ModelParameter parameters : loanByUserParams) { + query.setParameter(parameters.getParameter(), parameters.getValue()); + } + + query.executeUpdate(); + + transaction.commit(); + + success = true; + + return success; + } catch (Exception e) { + logger.error("loanPendingStatusToDelivery", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + } + } + + private static final long serialVersionUID = -9216757241090613435L; + final Logger logger = LogManager.getLogger(LoanRepository.class); + +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/loan/LoanToDeliveryByCertifierRepository.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/loan/LoanToDeliveryByCertifierRepository.java new file mode 100644 index 0000000..34046c0 --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/loan/LoanToDeliveryByCertifierRepository.java @@ -0,0 +1,45 @@ +/* + * 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.controller.mobile.repository.loan; + +import com.arrebol.apc.controller.mobile.repository.GenericRepository; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.views.LoanToDeliveryByCertifierView; +import java.io.Serializable; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class LoanToDeliveryByCertifierRepository extends GenericRepository implements Serializable { + + /** + * + * @param clazz + * @param xmlQuery + * @param parameters + * @return + * @throws Exception + */ + public List findLoansByCertifier(Class clazz, String xmlQuery, List parameters) throws Exception { + logger.debug("findLoansByCertifier"); + + try { + return createNamedQueryResultList(clazz, xmlQuery, parameters); + } catch (Exception e) { + logger.error("findLoansByCertifier", e); + throw e; + } + } + + private static final long serialVersionUID = 1692607159278862158L; + final Logger logger = LogManager.getLogger(LoanToDeliveryByCertifierRepository.class); +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/loan/LoanTypeRepository.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/loan/LoanTypeRepository.java new file mode 100644 index 0000000..ed92397 --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/loan/LoanTypeRepository.java @@ -0,0 +1,114 @@ +/* + * 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.controller.mobile.repository.loan; + +import com.arrebol.apc.controller.mobile.repository.GenericRepository; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.loan.LoanType; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import javax.persistence.Tuple; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class LoanTypeRepository extends GenericRepository implements Serializable { + + /** + * + * @param xmlQuery + * @param parameters + * @return + * @throws Exception + */ + public List findAllLoanTypeByOffice(String xmlQuery, List parameters) throws Exception { + logger.debug("findAllLoanTypeByOffice"); + + List results = new ArrayList<>(); + try { + List tuples = xmlQueryTuple(xmlQuery, parameters); + + tuples.forEach((tuple) -> { + results.add(new LoanType((String) tuple.get("id"), (BigDecimal) tuple.get("payment"), (String) tuple.get("loanTypeName"))); + }); + } catch (Exception e) { + logger.error("findAllLoanTypeByOffice", e); + throw e; + } + + return results; + } + + /** + * Find loan type by id. + * + * @param id Identifycation number + * @return + * @throws Exception + */ + public LoanType findLoanType(String id) throws Exception { + logger.debug("findLoanType"); + try { + return (LoanType) findAPCEntity(LoanType.class, id); + } catch (Exception e) { + logger.error("findLoanType", e); + throw e; + } + } + + /** + * + * @param clazz + * @param xmlQuery + * @param parameters + * @return + * @throws Exception + */ + public List findLoanTypes(Class clazz, String xmlQuery, List parameters) throws Exception { + logger.debug("findLoanTypes"); + try { + return createNamedQueryResultList(clazz, xmlQuery, parameters); + } catch (Exception e) { + logger.error("findLoanTypes", e); + throw e; + } + } + + /** + * + * @param xmlQuery + * @param parameters + * @return + * @throws Exception + */ + public List findIdAndPaymentLoans(String xmlQuery, List parameters) throws Exception { + logger.debug("findIdAndPaymentLoans"); + + List results = new ArrayList<>(); + try { + List tuples = xmlQueryTuple(xmlQuery, parameters); + + tuples.forEach((tuple) -> { + results.add(new LoanType((String) tuple.get("id"), (BigDecimal) tuple.get("payment"), (String) tuple.get("loanTypeName"))); + }); + } catch (Exception e) { + logger.error("findIdAndPaymentLoans", e); + throw e; + } + + return results; + } + + private static final long serialVersionUID = -5815645336646530766L; + final Logger logger = LogManager.getLogger(LoanTypeRepository.class); +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/people/PeopleRepository.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/people/PeopleRepository.java new file mode 100644 index 0000000..33a3ec4 --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/people/PeopleRepository.java @@ -0,0 +1,99 @@ +/* + * 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.controller.mobile.repository.people; + +import com.arrebol.apc.controller.mobile.repository.GenericRepository; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.catalog.People; +import com.arrebol.apc.model.loan.Loan; +import java.io.Serializable; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class PeopleRepository extends GenericRepository implements Serializable { + + /** + * + * @param people + * @return + * @throws Exception + */ + public String createPeople(People people) throws Exception { + logger.debug("createPeople"); + try { + save(people); + + return people.getId(); + + } catch (Exception e) { + logger.error("createPeople", e); + throw e; + } + } + + /** + * + * @param people + * @return + * @throws Exception + */ + public boolean removePeople(People people) throws Exception { + logger.debug("removePeople"); + try { + people = (People) findAPCEntity(People.class, people.getId()); + + return delete(people); + } catch (Exception e) { + logger.error("removePeople", e); + throw e; + } + } + + /** + * + * @param loanId + * @param isCustomer + * @return + * @throws Exception + */ + public String findPeopleIdByIdLoad(String loanId, boolean isCustomer) throws Exception { + try { + Loan loan = (Loan) findAPCEntity(Loan.class, loanId); + + return isCustomer ? loan.getCustomer().getId() : loan.getEndorsement().getId(); + } catch (Exception e) { + logger.error("findPeopleByIdLoad", e); + throw e; + } + } + + /** + * + * @param xmlQuery + * @param parameters + * @return + * @throws Exception + */ + public boolean changeContactNumber(String xmlQuery, List parameters) throws Exception { + logger.debug("changeContactNumber"); + try { + return updateCreateNamedQuery(xmlQuery, parameters); + } catch (Exception e) { + logger.error("changeContactNumber", e); + throw e; + } + } + + private static final long serialVersionUID = 6168828614367099322L; + final Logger logger = LogManager.getLogger(PeopleRepository.class); +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/preference/UserMobilePreferenceRepository.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/preference/UserMobilePreferenceRepository.java new file mode 100644 index 0000000..8590750 --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/preference/UserMobilePreferenceRepository.java @@ -0,0 +1,98 @@ +/* + * 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.controller.mobile.repository.preference; + +import com.arrebol.apc.controller.mobile.repository.GenericRepository; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.mobile.preference.UserMobilePreference; +import java.io.Serializable; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class UserMobilePreferenceRepository extends GenericRepository implements Serializable { + + /** + * + * @param clazz + * @param xmlQuery + * @param parameters + * @return + * @throws Exception + */ + public UserMobilePreference findUserMobilePreference(Class clazz, String xmlQuery, List parameters) throws Exception { + logger.debug("findUserMobilePreference"); + + try { + return (UserMobilePreference) createNamedQueryUniqueResult(clazz, xmlQuery, parameters); + } catch (Exception e) { + logger.error("findUserMobilePreference", e); + throw e; + } + } + + /** + * + * @param xmlQuery + * @param parameters + * @return + * @throws Exception + */ + public boolean updateQueryUserMobilePreference(String xmlQuery, List parameters) throws Exception { + logger.debug("updateQueryUserMobilePreference"); + + try { + return updateCreateNamedQuery(xmlQuery, parameters); + } catch (Exception e) { + logger.error("updateQueryUserMobilePreference", e); + throw e; + } + } + + /** + * + * @param userMobilePreference + * @return + * @throws Exception + */ + public boolean insertUserMobilePreference(UserMobilePreference userMobilePreference) throws Exception { + logger.debug("insertUserMobilePreference"); + + try { + return save(userMobilePreference); + } catch (Exception e) { + logger.error("insertUserMobilePreference", e); + throw e; + } + } + + /** + * + * @param xmlQuery + * @param parameters + * @return + * @throws Exception + */ + public Long count(String xmlQuery, List parameters) throws Exception { + logger.debug("count"); + try { + return (Long) createNamedQueryUniqueResult(Long.class, xmlQuery, parameters); + } catch (Exception e) { + logger.error("count", e); + throw e; + } + } + + private static final long serialVersionUID = 4667354927801455153L; + final Logger logger = LogManager.getLogger(UserMobilePreferenceRepository.class); + +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/reports/ReportsRepository.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/reports/ReportsRepository.java new file mode 100644 index 0000000..714a40e --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/reports/ReportsRepository.java @@ -0,0 +1,47 @@ +/* + * 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.controller.mobile.repository.reports; + +import com.arrebol.apc.controller.mobile.repository.GenericRepository; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.reports.UserWeekReport; +import java.io.Serializable; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class ReportsRepository extends GenericRepository implements Serializable { + + /** + * + * @param clazz + * @param xmlQuery + * @param parameters + * @return + * @throws Exception + */ + public UserWeekReport findUserWeekReportDetailsByUser(Class clazz, String xmlQuery, List parameters) throws Exception { + try { + return (UserWeekReport) createNamedQueryUniqueResult( + clazz, + xmlQuery, + parameters + ); + } catch (Exception e) { + logger.error("findUserWeekReportDetailsByUser", e); + throw e; + } + } + + private static final long serialVersionUID = 5669198954766725576L; + final Logger logger = LogManager.getLogger(getClass()); +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/route/RouteRepository.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/route/RouteRepository.java new file mode 100644 index 0000000..5a4c027 --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/route/RouteRepository.java @@ -0,0 +1,55 @@ +/* + * 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.controller.mobile.repository.route; + +import com.arrebol.apc.controller.mobile.moxy.views.ContainerRoutes; +import com.arrebol.apc.controller.mobile.moxy.views.RouteJaxb; +import com.arrebol.apc.controller.mobile.repository.GenericRepository; +import com.arrebol.apc.controller.mobile.repository.people.PeopleRepository; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.catalog.constance.RouteCfg; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.persistence.Tuple; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class RouteRepository extends GenericRepository implements Serializable { + + /** + * + * @param xmlQuery + * @param parameters + * @return + * @throws Exception + */ + public ContainerRoutes findAllRoutesAvailables(String xmlQuery, List parameters) throws Exception { + try { + List tuples = xmlQueryTuple(xmlQuery, parameters); + if (!tuples.isEmpty()) { + List results = new ArrayList<>(); + tuples.forEach(tuple -> { + results.add(new RouteJaxb(tuple.get(RouteCfg.FIELD_ID, String.class), tuple.get(RouteCfg.FIELD_NAME, String.class))); + }); + return new ContainerRoutes(results); + } else { + throw new Exception("Error loading route, size equals to ZERO"); + } + } catch (Exception e) { + logger.error("findAllRoutesAvailables", e); + throw e; + } + } + + final Logger logger = LogManager.getLogger(PeopleRepository.class); +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/tracking/PaymentTrackingRepository.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/tracking/PaymentTrackingRepository.java new file mode 100644 index 0000000..333805b --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/tracking/PaymentTrackingRepository.java @@ -0,0 +1,49 @@ +/* + * 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.controller.mobile.repository.tracking; + +import com.arrebol.apc.controller.mobile.moxy.views.PaymentTrackingViewJaxb; +import com.arrebol.apc.controller.mobile.repository.GenericRepository; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.reports.UserWeekReport; +import com.arrebol.apc.model.views.AdvanceUserDailyView; +import java.io.Serializable; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class PaymentTrackingRepository extends GenericRepository implements Serializable { + + /** + * + * @param clazz + * @param xmlQuery + * @param parameters + * @return + * @throws Exception + */ + public AdvanceUserDailyView paymentTrakingByUserDetails(Class clazz, String xmlQuery, List parameters) throws Exception { + try { + return (AdvanceUserDailyView) createNamedQueryUniqueResult( + clazz, + xmlQuery, + parameters + ); + } catch (Exception e) { + logger.error("PaymentTrackingViewJaxb", e); + throw e; + } + } + + private static final long serialVersionUID = 5669198954766725577L; + final Logger logger = LogManager.getLogger(getClass()); +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/user/UserRepository.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/user/UserRepository.java new file mode 100644 index 0000000..c3f2ce6 --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/user/UserRepository.java @@ -0,0 +1,114 @@ +/* + * 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.controller.mobile.repository.user; + +import com.arrebol.apc.controller.mobile.repository.GenericRepository; +import com.arrebol.apc.controller.mobile.util.HibernateUtil; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.core.constance.UserCfg; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.persistence.Tuple; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.hibernate.Session; +import org.hibernate.Transaction; +import org.hibernate.query.Query; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class UserRepository extends GenericRepository implements Serializable { + + /** + * + * @param xmlQuery + * @param parameters + * @return + * @throws Exception + */ + public String findUserStatusById(String xmlQuery, List parameters) throws Exception { + try { + for (Tuple tuple : xmlQueryTuple(xmlQuery, parameters)) { + return tuple.get(UserCfg.FIELD_ID, String.class); + } + + return null; + } catch (Exception e) { + logger.error("findUserStatusById", e); + throw e; + } + } + + /** + * + * @param hbmQuery + * @param params + * @return + * @throws Exception + */ + public boolean containtsUserManagementProperty(String hbmQuery, List params) throws Exception { + Transaction transaction = null; + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + Query query = session.createNamedQuery(hbmQuery); + + params.forEach((param) -> { + query.setParameter(param.getParameter(), param.getValue()); + }); + + Long total = (Long) query.getSingleResult(); + Long one = 1l; + transaction.commit(); + + return one.equals(total); + } catch (Exception e) { + logger.error("containtsUserManagementProperty", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + } + } + + /** + * + * @param xmlQuery + * @param parameters + * @return + * @throws Exception + */ + public List listOfUsersByOffice(String xmlQuery, List parameters) throws Exception { + try { + List users = new ArrayList<>(); + + xmlQueryTuple(xmlQuery, parameters).forEach(_item -> { + users.add( + new User( + _item.get(UserCfg.FIELD_ID, String.class), + _item.get(UserCfg.FIELD_USER_NAME, String.class) + ) + ); + }); + + return users; + } catch (Exception e) { + logger.error("listOfUsersByOffice", e); + throw e; + } + } + + private static final long serialVersionUID = -7339139534291674077L; + final Logger logger = LogManager.getLogger(getClass()); + +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/views/CashRegisterCurdateByUserViewRepository.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/views/CashRegisterCurdateByUserViewRepository.java new file mode 100644 index 0000000..2937d72 --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/views/CashRegisterCurdateByUserViewRepository.java @@ -0,0 +1,44 @@ +/* + * 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.controller.mobile.repository.views; + +import com.arrebol.apc.controller.mobile.repository.GenericRepository; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.views.CashRegisterCurdateByUserView; +import java.io.Serializable; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class CashRegisterCurdateByUserViewRepository extends GenericRepository implements Serializable { + + /** + * + * @param clazz + * @param xmlQuery + * @param parameters + * @return + * @throws Exception + */ + public List findAllCashRegisterCurdateByUserId(Class clazz, String xmlQuery, List parameters) throws Exception { + logger.debug("findAllCashRegisterCurdateByUserId"); + try { + return createNamedQueryResultList(clazz, xmlQuery, parameters); + } catch (Exception e) { + logger.error("findAllCashRegisterCurdateByUserId", e); + throw e; + } + } + + private static final long serialVersionUID = -9108098827445980249L; + final Logger logger = LogManager.getLogger(CashRegisterCurdateByUserViewRepository.class); +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/views/ExchangeEnebledUsersViewRepository.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/views/ExchangeEnebledUsersViewRepository.java new file mode 100644 index 0000000..7c1f6ed --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/views/ExchangeEnebledUsersViewRepository.java @@ -0,0 +1,43 @@ +/* + * 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.controller.mobile.repository.views; + +import com.arrebol.apc.controller.mobile.repository.GenericRepository; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.views.ExchangeEnebledUsersView; +import java.io.Serializable; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class ExchangeEnebledUsersViewRepository extends GenericRepository implements Serializable { + + /** + * + * @param xmlQuery + * @param parameters + * @return + * @throws Exception + */ + public List findEnebledUsersToUserId(String xmlQuery, List parameters) throws Exception { + logger.debug("exchangeEnebledUsersViewRepository"); + try { + return createNamedQueryResultList(ExchangeEnebledUsersView.class, xmlQuery, parameters); + } catch (Exception e) { + logger.error("findEnebledUsersToUserId", e); + throw e; + } + } + + private static final long serialVersionUID = 3811795552537797634L; + final Logger logger = LogManager.getLogger(ExchangeEnebledUsersViewRepository.class); +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/views/LoanApprovedDetailViewRepository.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/views/LoanApprovedDetailViewRepository.java new file mode 100644 index 0000000..733ab23 --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/views/LoanApprovedDetailViewRepository.java @@ -0,0 +1,124 @@ +/* + * 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.controller.mobile.repository.views; + +import com.arrebol.apc.controller.mobile.repository.GenericRepository; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.enums.LoanDetailsType; +import com.arrebol.apc.model.views.LoanApprovedDetailView; +import com.arrebol.apc.model.ws.parsed.LoanDetailJaxb; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import javax.persistence.Tuple; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class LoanApprovedDetailViewRepository extends GenericRepository implements Serializable { + + /* + public List findAllTransferByUserIdAndCurdate(String xmlQuery, List parameters) throws Exception { + logger.debug("findAllTransferByUserIdAndCurdate"); + List results = new ArrayList<>(); + try { + List tuples = xmlQueryTuple(xmlQuery, parameters); + + tuples.forEach((tuple) -> { + results.add( + new Exchange( + tuple.get("id").toString(), + tuple.get("userTransmitter").toString().equals("SENDER"), + (BigDecimal) tuple.get("amountToTransfer"), + tuple.get("actionStatus").toString() + ) + ); + }); + + return results; + } catch (Exception e) { + logger.error("findAllTransferByUserIdAndCurdate", e); + throw e; + } + } + */ + /** + * + * @param xmlQuery + * @param parameters + * @return + * @throws Exception + */ + public List findLoanDetailsByLoan(String xmlQuery, List parameters) throws Exception { + logger.debug("findLoanDetailsByLoan"); + List results = new ArrayList<>(); + try { + List tuples = xmlQueryTuple(xmlQuery, parameters); + + double total = 0d; + + for (Tuple tuple : tuples) { + if (results.isEmpty()) { + total = ((BigDecimal) tuple.get("amountToPay")).doubleValue(); + } + LoanDetailsType type = tuple.get("loanDetailsType", LoanDetailsType.class); + + switch (type) { + case PAYMENT: + total = total - ((BigDecimal) tuple.get("paymentAmount")).doubleValue(); + break; + case FEE: + total = total + ((BigDecimal) tuple.get("paymentAmount")).doubleValue(); + break; + case TRANSFER: + total = total - (tuple.get("paymentAmount", BigDecimal.class)).doubleValue(); + break; + } + + LoanDetailJaxb detail = new LoanDetailJaxb( + tuple.get("createdOn", String.class), + ((BigDecimal) tuple.get("paymentAmount")).doubleValue(), + total, + tuple.get("comments", String.class), + type.toString() + ); + + results.add(detail); + } + + return results; + } catch (Exception e) { + logger.error("findLoanDetailsByLoan", e); + throw e; + } + } + + /** + * + * @param idLoan + * @return + * @throws Exception + */ + public LoanApprovedDetailView approvedDetailsByIdLoan(String idLoan) throws Exception { + logger.debug("approvedDetailsByIdLoan"); + try { + return (LoanApprovedDetailView) findAPCEntity(LoanApprovedDetailView.class, idLoan); + } catch (Exception e) { + logger.error("approvedDetailsByIdLoan", e); + throw e; + } + } + + private static final long serialVersionUID = -7364653160752676339L; + final Logger logger = LogManager.getLogger(LoanApprovedDetailViewRepository.class); + +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/views/LoanByUserOrderPreferenceViewRepository.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/views/LoanByUserOrderPreferenceViewRepository.java new file mode 100644 index 0000000..89b2ef5 --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/views/LoanByUserOrderPreferenceViewRepository.java @@ -0,0 +1,62 @@ +/* + * 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.controller.mobile.repository.views; + +import com.arrebol.apc.controller.mobile.repository.GenericRepository; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.views.LoanByUserOrderPreferenceView; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class LoanByUserOrderPreferenceViewRepository extends GenericRepository implements Serializable { + + /** + * + * @param xmlQuery + * @param parameters + * @return + * @throws Exception + */ + public List findAllLoanByUserOrderPreference(String xmlQuery, List parameters) throws Exception { + logger.debug("findAllLoanByUserOrderPreference"); + List results = new ArrayList<>(); + + try { + results = createNamedQueryResultList( + LoanByUserOrderPreferenceView.class, + xmlQuery, + parameters + ); + } catch (Exception e) { + logger.error("findAllLoanByUserOrderPreference", e); + throw e; + } + + return results; + } + + public boolean updateQuery(String xmlQuery, List parameters) throws Exception { + logger.debug("updateQuery"); + try { + return updateCreateNamedQuery(xmlQuery, parameters); + } catch (Exception e) { + logger.error("updateQuery", e); + throw e; + } + } + + private static final long serialVersionUID = -5747654537116880219L; + final Logger logger = LogManager.getLogger(LoanByUserOrderPreferenceViewRepository.class); +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/views/LoanByUserViewRepository.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/views/LoanByUserViewRepository.java new file mode 100644 index 0000000..3cceb77 --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/views/LoanByUserViewRepository.java @@ -0,0 +1,54 @@ +/* + * 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.controller.mobile.repository.views; + +import com.arrebol.apc.controller.mobile.repository.GenericRepository; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.views.LoanByUserView; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class LoanByUserViewRepository extends GenericRepository implements Serializable { + + /** + * + * @param xmlQuery + * @param parameters + * @return + * @throws Exception + */ + public List findAllLoansByUserId(String xmlQuery, List parameters) throws Exception { + logger.debug("findAllLoansByUserId"); + List results = new ArrayList<>(); + + try { + results = createNamedQueryResultList( + LoanByUserView.class, + xmlQuery, + parameters + ); + + } catch (Exception e) { + logger.error("findAllLoansByUserId", e); + throw e; + } + + return results; + } + + private static final long serialVersionUID = 5669198954766725476L; + final Logger logger = LogManager.getLogger(LoanByUserViewRepository.class); + +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/views/LoanInPendingStatusToDeliveryViewRepository.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/views/LoanInPendingStatusToDeliveryViewRepository.java new file mode 100644 index 0000000..c9f733f --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/views/LoanInPendingStatusToDeliveryViewRepository.java @@ -0,0 +1,42 @@ +/* + * 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.controller.mobile.repository.views; + +import com.arrebol.apc.controller.mobile.repository.GenericRepository; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.views.LoanInPendingStatusToDeliveryView; +import java.io.Serializable; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class LoanInPendingStatusToDeliveryViewRepository extends GenericRepository implements Serializable { + + /** + * + * @param xmlQuery + * @param parameters + * @return + * @throws Exception + */ + public List findAllLoanInPendingStatusToDeliveryViewFromHQL(String xmlQuery, List parameters) throws Exception { + try { + return findEntityList(LoanInPendingStatusToDeliveryView.class, xmlQuery, parameters); + } catch (Exception e) { + logger.error("findAllLoanInPendingStatusToDeliveryViewFromHQL", e); + throw e; + } + } + + private static final long serialVersionUID = 6824052895894178526L; + final Logger logger = LogManager.getLogger(getClass()); +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/views/PersonSearchHistoricalDetailsViewRepository.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/views/PersonSearchHistoricalDetailsViewRepository.java new file mode 100644 index 0000000..5364ac9 --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/views/PersonSearchHistoricalDetailsViewRepository.java @@ -0,0 +1,48 @@ +/* + * 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.controller.mobile.repository.views; + +import com.arrebol.apc.controller.mobile.repository.GenericRepository; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.views.PersonSearchHistoricalDetailsView; +import java.io.Serializable; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class PersonSearchHistoricalDetailsViewRepository extends GenericRepository implements Serializable { + + /** + * + * @param clazz + * @param xmlQuery + * @param parameters + * @return + * @throws Exception + */ + public List findAllByPersonId(Class clazz, String xmlQuery, List parameters) throws Exception { + logger.debug("findAllByPersonId"); + + try { + return createNamedQueryResultList(clazz, xmlQuery, parameters); + } catch (Exception e) { + logger.error("findAllByPersonId", e); + throw e; + } + } + + + + private static final long serialVersionUID = 3507366187310617715L; + final Logger logger = LogManager.getLogger(PersonSearchHistoricalDetailsViewRepository.class); + +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/views/PersonSearchViewRepository.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/views/PersonSearchViewRepository.java new file mode 100644 index 0000000..a2a5853 --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/views/PersonSearchViewRepository.java @@ -0,0 +1,121 @@ +/* + * 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.controller.mobile.repository.views; + +import com.arrebol.apc.controller.mobile.repository.GenericRepository; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.views.LoanByUserView; +import com.arrebol.apc.model.views.PersonSearchDetailView; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; +import javax.persistence.Tuple; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class PersonSearchViewRepository extends GenericRepository implements Serializable { + + /** + * + * @param clazz + * @param xmlQuery + * @param parameters + * @return + * @throws Exception + */ + public List findResultList(Class clazz, String xmlQuery, List parameters) throws Exception { + logger.debug("likePersonSearchViewByPersonSearch"); + + try { + return createNamedQueryResultList(clazz, xmlQuery, parameters, 10); + } catch (Exception e) { + logger.error("likePersonSearchViewByPersonSearch", e); + throw e; + } + } + + /** + * + * @param clazz + * @param xmlQuery + * @param parameters + * @return + * @throws Exception + */ + public Object findResultXML(Class clazz, String xmlQuery, List parameters) throws Exception { + logger.debug("findResultXML"); + try { + return createNamedQueryUniqueResult(clazz, xmlQuery, parameters); + } catch (Exception e) { + logger.error("findResultXML", e); + throw e; + } + } + + public Object findResultTupleXML(String xmlQuery, List parameters) throws Exception { + logger.debug("findResultXML"); + try { + List tuples = xmlQueryTuple(xmlQuery, parameters); + + LoanByUserView result = new LoanByUserView(); + + for (Tuple tuple : tuples) { + + result = new LoanByUserView( + tuple.get("customerName", String.class), + tuple.get("customerAddressHome", String.class), + tuple.get("customerAddressBusiness", String.class), + tuple.get("companyName", String.class), + tuple.get("customerThumbnail", String.class), + tuple.get("endorsementName", String.class), + tuple.get("endorsementAddressHome", String.class), + tuple.get("endorsementThumbnail", String.class), + tuple.get("endorsementPhoneHome", String.class), + tuple.get("paymentDaily", BigDecimal.class), + tuple.get("fee", BigDecimal.class), + tuple.get("notificationNumber", Long.class).intValue(), + tuple.get("renovation", String.class), + tuple.get("maxAmountToPay", BigDecimal.class), + 1 == tuple.get("hasPaymentToday", Integer.class), + tuple.get("loanId", String.class), + tuple.get("currentOwner", String.class) + ); + } + + return result; + } catch (Exception e) { + logger.error("findResultXML", e); + throw e; + } + } + + /** + * + * @param clazz + * @param id + * @return + * @throws Exception + */ + public PersonSearchDetailView findResult(Class clazz, String id) throws Exception { + logger.debug("findResult"); + try { + return (PersonSearchDetailView) findAPCEntity(clazz, id); + } catch (Exception e) { + logger.error("findResult", e); + throw e; + } + } + + private static final long serialVersionUID = -5127034542019248849L; + final Logger logger = LogManager.getLogger(PersonSearchViewRepository.class); + +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/views/SearchPersonAvailableRepository.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/views/SearchPersonAvailableRepository.java new file mode 100644 index 0000000..b3c1414 --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/views/SearchPersonAvailableRepository.java @@ -0,0 +1,63 @@ +/* + * 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.controller.mobile.repository.views; + +import com.arrebol.apc.controller.mobile.repository.GenericRepository; +import com.arrebol.apc.model.ModelParameter; +import java.io.Serializable; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * Views: AvailableCustomersView or AvailableEndorsementsView + * + * @author Carlos Janitzio Zavala Lopez + */ +public class SearchPersonAvailableRepository extends GenericRepository implements Serializable { + + /** + * + * @param clazz + * @param id + * @return + * @throws Exception + */ + public Object findAvailablePersonByPersonId(Class clazz, String id) throws Exception { + logger.debug("findAvailablePersonByPersonId"); + try { + return findAPCEntity(clazz, id); + } catch (Exception e) { + logger.error("findAvailablePersonByPersonId", e); + throw e; + } + } + + /** + * Find customers or endorsemenent using hibernate like clause. + * + * @param clazz AvailableCustomersView and AvailableEndorsementsView + * @param xmlQuery + * @param parameters + * @return + * @throws Exception + */ + public List findAvailablePersonLike(Class clazz, String xmlQuery, List parameters) throws Exception { + logger.debug("findAvailablePersonLike"); + try { + return createNamedQueryResultList(clazz, xmlQuery, parameters,10); + } catch (Exception e) { + logger.error("findAvailablePersonLike", e); + throw e; + } + } + + private static final long serialVersionUID = 1734430028791204289L; + final Logger logger = LogManager.getLogger(SearchPersonAvailableRepository.class); + +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/views/TotalCashByCurdateViewRepository.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/views/TotalCashByCurdateViewRepository.java new file mode 100644 index 0000000..8189f93 --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/views/TotalCashByCurdateViewRepository.java @@ -0,0 +1,40 @@ +/* + * 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.controller.mobile.repository.views; + +import com.arrebol.apc.controller.mobile.repository.GenericRepository; +import com.arrebol.apc.model.views.TotalCashByCurdateView; +import java.io.Serializable; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class TotalCashByCurdateViewRepository extends GenericRepository implements Serializable { + + /** + * + * @param id + * @return + * @throws Exception + */ + public TotalCashByCurdateView findById(String id) throws Exception { + logger.debug("findById"); + try { + return (TotalCashByCurdateView) findAPCEntity(TotalCashByCurdateView.class, id); + } catch (Exception e) { + logger.error("findById", e); + throw e; + } + } + + private static final long serialVersionUID = 7691052895894112231L; + final Logger logger = LogManager.getLogger(TotalCashByCurdateViewRepository.class); +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/views/TransferInPendingStatusViewRepository.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/views/TransferInPendingStatusViewRepository.java new file mode 100644 index 0000000..358f1fb --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/repository/views/TransferInPendingStatusViewRepository.java @@ -0,0 +1,42 @@ +/* + * 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.controller.mobile.repository.views; + +import com.arrebol.apc.controller.mobile.repository.GenericRepository; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.views.TransferInPendingStatusView; +import java.io.Serializable; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class TransferInPendingStatusViewRepository extends GenericRepository implements Serializable { + + /** + * + * @param xmlQuery + * @param parameters + * @return + * @throws Exception + */ + public List findAllTransferFromHQL(String xmlQuery, List parameters) throws Exception { + try { + return findEntityList(TransferInPendingStatusView.class, xmlQuery, parameters); + } catch (Exception e) { + logger.error("findAllTransferFromHQL", e); + throw e; + } + } + + private static final long serialVersionUID = 5391052895894173231L; + final Logger logger = LogManager.getLogger(getClass()); +} diff --git a/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/util/HibernateUtil.java b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/util/HibernateUtil.java new file mode 100644 index 0000000..1723c04 --- /dev/null +++ b/ace-controller-mobile/src/main/java/com/arrebol/apc/controller/mobile/util/HibernateUtil.java @@ -0,0 +1,69 @@ +/* + * 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.controller.mobile.util; + +import org.hibernate.SessionFactory; +import org.hibernate.boot.Metadata; +import org.hibernate.boot.MetadataSources; +import org.hibernate.boot.registry.StandardServiceRegistryBuilder; +import org.hibernate.service.ServiceRegistry; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class HibernateUtil { + + private static final String HIBERNATE_CFG_XML = "apc.cfg.xml"; + private static SessionFactory sessionFactory; + + private HibernateUtil() { + } + + // Hibernate 5: + private static SessionFactory buildSessionFactory() { + try { + // Create the ServiceRegistry from hibernate.cfg.xml + ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder().configure(HIBERNATE_CFG_XML).build(); + + // Create a metadata sources using the specified service registry. + Metadata metadata = new MetadataSources(serviceRegistry).getMetadataBuilder().build(); + + return metadata.getSessionFactoryBuilder().build(); + } catch (Throwable ex) { + System.err.println("Initial SessionFactory creation failed." + ex); + throw new ExceptionInInitializerError(ex); + } + } + + /** + * Configuration object is used to create a SessionFactory object which in + * turn configures Hibernate for the application using the supplied + * configuration file and allows for a Session object to be instantiated. + * + * The SessionFactory is a thread safe object and used by all the threads of + * an application. + * + * The SessionFactory is a heavyweight object; it is usually created during + * application start up and kept for later use. + * + * You would need one SessionFactory object per database using a separate + * configuration file. + * + * So, if you are using multiple databases, then you would have to create + * multiple SessionFactory objects. + * + * @return SessionFactory. + */ + public final static SessionFactory getSessionFactory() { + if (null == sessionFactory) { + sessionFactory = buildSessionFactory(); + } + return sessionFactory; + } +} diff --git a/ace-controller-mobile/src/test/java/com/arrebol/apc/controller/mobile/controller/cash/CashRegisterCurdateByUserControllerTest.java b/ace-controller-mobile/src/test/java/com/arrebol/apc/controller/mobile/controller/cash/CashRegisterCurdateByUserControllerTest.java new file mode 100644 index 0000000..7fbb1d3 --- /dev/null +++ b/ace-controller-mobile/src/test/java/com/arrebol/apc/controller/mobile/controller/cash/CashRegisterCurdateByUserControllerTest.java @@ -0,0 +1,46 @@ +/* + * 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.controller.mobile.controller.cash; + +import com.arrebol.apc.model.views.TotalCashByCurdateView; +import org.junit.Assert; +import static org.junit.Assert.assertFalse; +import org.junit.Before; +import org.junit.Test; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class CashRegisterCurdateByUserControllerTest { + + public CashRegisterCurdateByUserController controller; + public static final String USER_ID = "52cbc85a-8bc9-11ea-b45c-c7b846343364"; + + public CashRegisterCurdateByUserControllerTest() { + } + + @Before + public void setUp() { + controller = new CashRegisterCurdateByUserController(); + } + + @Test + public void findAllLoansByUserId() { + try { + TotalCashByCurdateView result = controller.findDailyTotalsByUserId(USER_ID); + + System.out.println("Total: " + result.getTotal()); + + Assert.assertNotNull(result); + } catch (Exception e) { + assertFalse(true); + } + } + +} diff --git a/ace-controller-mobile/src/test/java/com/arrebol/apc/controller/mobile/controller/customer/CustomerControllerTest.java b/ace-controller-mobile/src/test/java/com/arrebol/apc/controller/mobile/controller/customer/CustomerControllerTest.java new file mode 100644 index 0000000..7c0c9df --- /dev/null +++ b/ace-controller-mobile/src/test/java/com/arrebol/apc/controller/mobile/controller/customer/CustomerControllerTest.java @@ -0,0 +1,49 @@ +package com.arrebol.apc.controller.mobile.controller.customer; + +/* + * Arrebol Consultancy copyright. + * + * This code belongs to Arrebol Consultancy + * its use, redistribution or modification are prohibited + * without written authorization from Arrebol Consultancy. + */ + + +import com.arrebol.apc.model.enums.PreferenceValue; +import com.arrebol.apc.model.views.LoanByUserView; +import java.util.List; +import org.junit.Before; +import org.junit.Test; +import static org.junit.Assert.*; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class CustomerControllerTest { + + public CustomerController controller; + public static final String USER_ID = "52cbc85a-8bc9-11ea-b45c-c7b846343364"; + + public CustomerControllerTest() { + } + + @Before + public void setUp() { + controller = new CustomerController(); + } + + @Test + public void findAllLoansByUserId() { + try { + List results = controller.findAllLoansByUserId(PreferenceValue.ORDER_IN_LIST.toString(),USER_ID); + + results.forEach(System.out::println); + + assertFalse(results.isEmpty()); + } catch (Exception e) { + assertFalse(true); + } + } + +} diff --git a/ace-controller-mobile/src/test/java/com/arrebol/apc/controller/mobile/controller/exchange/ExchangeEnebledUsersControllerTest.java b/ace-controller-mobile/src/test/java/com/arrebol/apc/controller/mobile/controller/exchange/ExchangeEnebledUsersControllerTest.java new file mode 100644 index 0000000..f98a096 --- /dev/null +++ b/ace-controller-mobile/src/test/java/com/arrebol/apc/controller/mobile/controller/exchange/ExchangeEnebledUsersControllerTest.java @@ -0,0 +1,62 @@ +/* + * 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.controller.mobile.controller.exchange; + +import com.arrebol.apc.model.views.ExchangeEnebledUsersView; +import com.arrebol.apc.model.ws.parsed.Exchange; +import java.util.List; +import static org.junit.Assert.assertFalse; +import org.junit.Before; +import org.junit.Test; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class ExchangeEnebledUsersControllerTest { + + public ExchangeEnebledUsersController controller; + public static final String USER_ID_AVATAR_TWO = "52cbc85a-8bc9-11ea-b45c-c7b846343364"; + public static final String AVATAR= "22fb81e2-8bc9-11ea-b45c-c7b846343364"; + public static final String OFFICE_ID_GDL = "e0f1a2fc-7d1f-11ea-af3e-28f659da398e"; + public static final String OFFICE_ID_TPC = "caef3a64-7d1f-11ea-af3e-28f659da398e"; + + public ExchangeEnebledUsersControllerTest() { + } + + @Before + public void setUp() { + controller = new ExchangeEnebledUsersController(); + } + + //@Test + public void findEnebledUsersToUserId() { + try { + List results = controller.findEnebledUsersToUserId(USER_ID_AVATAR_TWO, OFFICE_ID_TPC); + + results.forEach(System.out::println); + + assertFalse(results.isEmpty()); + } catch (Exception e) { + assertFalse(true); + } + } + + @Test + public void exchangesByUsers() { + try { + List results = controller.exchangesByUsers(AVATAR); + + results.forEach(System.out::println); + + assertFalse(results.isEmpty()); + } catch (Exception e) { + assertFalse(true); + } + } +} diff --git a/ace-controller-mobile/src/test/java/com/arrebol/apc/controller/mobile/controller/loan/LoanControllerTest.java b/ace-controller-mobile/src/test/java/com/arrebol/apc/controller/mobile/controller/loan/LoanControllerTest.java new file mode 100644 index 0000000..ee2d0b3 --- /dev/null +++ b/ace-controller-mobile/src/test/java/com/arrebol/apc/controller/mobile/controller/loan/LoanControllerTest.java @@ -0,0 +1,205 @@ +/* + * 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.controller.mobile.controller.loan; + +import com.arrebol.apc.controller.mobile.json.loan.DeleteLoanDetailsJaxb; +import com.arrebol.apc.controller.mobile.json.loan.LoanTypeListJaxb; +import com.arrebol.apc.model.views.AvailableCustomersView; +import com.arrebol.apc.model.views.AvailableEndorsementsView; +import com.arrebol.apc.model.views.LoanToDeliveryByCertifierView; +import com.arrebol.apc.model.ws.parsed.LoanDetailJaxb; +import com.arrebol.apc.model.ws.parsed.LoanRequestedJaxb; +import com.arrebol.apc.model.ws.parsed.PersonJaxb; +import java.util.List; +import org.junit.Test; +import static org.junit.Assert.*; +import org.junit.Before; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class LoanControllerTest { + + /** + * $3,000.00 + */ + public final static String LOAN_TYPE_ID = "8d91bc36-8e00-11ea-8745-07889553dd5f"; + /** + * GDL + */ + public static final String OFFICE_ID = "e0f1a2fc-7d1f-11ea-af3e-28f659da398e"; + /** + * TEPIC + */ + public static final String TEPIC_OFFICE_ID = "caef3a64-7d1f-11ea-af3e-28f659da398e"; + /** + * LOANS + */ + public static final String LOAND_ID = "606e42f4-8e1b-11ea-b65e-4e1376171215"; + /** + * Avatar 2 + */ + public final static String MOBILE_USER_ID = "52cbc85a-8bc9-11ea-b45c-c7b846343364"; + /** + * + */ + public final static String ROUTE_ID = "55baf3ae-8e19-11ea-b65e-4e1376171215"; + /** + * + */ + public final static String DUMMY_DATA = "DUMMY"; + private LoanController controller; + + @Before + public void setUp() { + controller = new LoanController(); + } + + //@Test + public void findAllLoanTypeByOffice() { + try { + LoanTypeListJaxb result = controller.findAllLoanTypeByOffice(OFFICE_ID); + + System.out.println(result); + + assertFalse(result.getLoans().isEmpty()); + } catch (Exception e) { + assertFalse(true); + } + } + + @Test + public void enebleToDeleteTodayDetails(){ + try { + DeleteLoanDetailsJaxb result = controller.enebleToDeleteTodayDetails(LOAND_ID,""); + + System.out.println(result); + + assertFalse(result.getApprovedOrPendingRenovation()); + } catch (Exception e) { + assertFalse(true); + } + } + + //@Test + public void findAvailableCustomersByOffice() { + try { + List results = controller.findAllAvailableCustomersByType("%SeGuNDo%"); + + results.forEach(System.out::println); + + assertFalse(results.isEmpty()); + } catch (Exception e) { + assertFalse(true); + } + } + + //@Test + public void findAvailableEndorsementByOffice() { + try { + List results = controller.findAllAvailableEndorsementsByType("%AvAl%"); + + results.forEach(System.out::println); + + assertFalse(results.isEmpty()); + } catch (Exception e) { + assertFalse(true); + } + } + + //@Test + public void findNewCreditLimit() { + try { + LoanTypeListJaxb result = controller.findNewCreditLimit(OFFICE_ID, LOAND_ID); + + System.out.println(result); + + assertFalse(result.getLoans().isEmpty()); + } catch (Exception e) { + assertFalse(true); + } + } + + //@Test + public void createLoan() { + try { + LoanRequestedJaxb jaxb = new LoanRequestedJaxb(); + + PersonJaxb customer = buildPerson(false, true); + PersonJaxb endorsement = buildPerson(false, false); + + jaxb.setLoanTypeId(LOAN_TYPE_ID); + jaxb.setOfficeId(OFFICE_ID); + jaxb.setUserId(MOBILE_USER_ID); + jaxb.setRouteId(ROUTE_ID); + jaxb.setCustomer(customer); + jaxb.setEndorsement(endorsement); + jaxb.setStrDate("2020-28-05 16:04:62"); + + //assertTrue(controller.createLoan(jaxb)); + } catch (Exception e) { + assertFalse(true); + } + } + + //@Test + public void findLoansByCertifier() { + try { + List results = controller.findLoansByCertifier(MOBILE_USER_ID); + + results.forEach(System.out::println); + + assertFalse(results.isEmpty()); + } catch (Exception e) { + assertFalse(true); + } + } + + @Test + public void approvedDetailsByIdLoan() { + try { + //LoanJaxb result = controller.approvedDetailsByIdLoan(LOAND_ID); + List result = controller.approvedDetailsByIdLoan(LOAND_ID); + System.out.println(result); + + assertNotNull(result); + } catch (Exception e) { + assertFalse(true); + } + } + + private PersonJaxb buildPerson(boolean isNewPerson, boolean isCustomer) { + PersonJaxb person = new PersonJaxb(); + + if (!isNewPerson) { + if (isCustomer) { + person.setId("e61db008-8e1e-11ea-b65e-4e1376171215"); + } else { + person.setId("2b502d50-8e1e-11ea-b65e-4e1376171215"); + } + } else { + person.setFirstName(DUMMY_DATA); + person.setSecondName(DUMMY_DATA); + person.setLastName(DUMMY_DATA); + person.setMiddleName(DUMMY_DATA); + person.setAddressHome(DUMMY_DATA); + person.setPhoneHome(DUMMY_DATA); + person.setCreatePerson(true); + person.setThumbnail("https://f0.pngfuel.com/png/980/304/man-profile-illustration-computer-icons-user-profile-avatar-png-clip-art.png"); + + if (isCustomer) { + person.setAddressWork(DUMMY_DATA); + person.setPhoneWork(DUMMY_DATA); + person.setCompanyName(DUMMY_DATA); + } + } + + return person; + } +} diff --git a/ace-controller-mobile/src/test/java/com/arrebol/apc/controller/mobile/controller/login/LoginWSControllerTest.java b/ace-controller-mobile/src/test/java/com/arrebol/apc/controller/mobile/controller/login/LoginWSControllerTest.java new file mode 100644 index 0000000..a3515a8 --- /dev/null +++ b/ace-controller-mobile/src/test/java/com/arrebol/apc/controller/mobile/controller/login/LoginWSControllerTest.java @@ -0,0 +1,46 @@ +/* + * 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.controller.mobile.controller.login; + +import com.arrebol.apc.controller.mobile.moxy.login.UserMxy; +import org.junit.Before; +import org.junit.Test; +import static org.junit.Assert.*; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class LoginWSControllerTest { + + private LoginWSController controller; + private final static String USER_NAME = "avatar1"; + private final static String PASSWORD = "8478A4A2819E9C06AB738123C5D04B4FA1AA67548EBA64EAD40B635EA8AA8D5B"; + + public LoginWSControllerTest() { + } + + @Before + public void setUp() { + controller = new LoginWSController(); + } + + @Test + public void login() { + try { + UserMxy userMxy = controller.login(USER_NAME, PASSWORD); + + System.out.println(userMxy); + + assertFalse(userMxy.getPreferences().isEmpty()); + } catch (Exception e) { + assertFalse(true); + } + } + +} diff --git a/ace-controller-mobile/src/test/java/com/arrebol/apc/controller/mobile/controller/preference/SystemPreferenceControllerTest.java b/ace-controller-mobile/src/test/java/com/arrebol/apc/controller/mobile/controller/preference/SystemPreferenceControllerTest.java new file mode 100644 index 0000000..9499b67 --- /dev/null +++ b/ace-controller-mobile/src/test/java/com/arrebol/apc/controller/mobile/controller/preference/SystemPreferenceControllerTest.java @@ -0,0 +1,58 @@ +package com.arrebol.apc.controller.mobile.controller.preference; + +/* + * Arrebol Consultancy copyright. + * + * This code belongs to Arrebol Consultancy + * its use, redistribution or modification are prohibited + * without written authorization from Arrebol Consultancy. + */ +import com.arrebol.apc.model.views.LoanByUserOrderPreferenceView; +import com.arrebol.apc.model.ws.parsed.ConfigurationJaxb; +import java.util.List; +import org.junit.Before; +import org.junit.Test; +import static org.junit.Assert.*; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class SystemPreferenceControllerTest { + + private SystemPreferenceController controller; + public static final String USER_ID = "52cbc85a-8bc9-11ea-b45c-c7b846343364"; + + public SystemPreferenceControllerTest() { + } + + @Before + public void setUp() { + controller = new SystemPreferenceController(); + } + + @Test + public void findAllLoanByUserOrderPreference() { + try { + List results = controller.findAllLoanByUserOrderPreference(USER_ID); + + results.forEach(System.out::println); + + assertFalse(results.isEmpty()); + } catch (Exception e) { + assertFalse(true); + } + } + + @Test + public void findConfigurationButton() { + try { + ConfigurationJaxb result = controller.findConfigurationButton(USER_ID, USER_ID); + + assertTrue(result.isActiveButton()); + } catch (Exception e) { + assertFalse(true); + } + } + +} diff --git a/ace-controller-mobile/src/test/java/com/arrebol/apc/controller/mobile/controller/search/PersonSearchControllerTest.java b/ace-controller-mobile/src/test/java/com/arrebol/apc/controller/mobile/controller/search/PersonSearchControllerTest.java new file mode 100644 index 0000000..4d3761a --- /dev/null +++ b/ace-controller-mobile/src/test/java/com/arrebol/apc/controller/mobile/controller/search/PersonSearchControllerTest.java @@ -0,0 +1,74 @@ +/* + * 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.controller.mobile.controller.search; + +import com.arrebol.apc.model.loan.Loan; +import com.arrebol.apc.model.views.LoanByUserView; +import com.arrebol.apc.model.views.PersonSearchDetailView; +import com.arrebol.apc.model.views.PersonSearchView; +import java.util.List; +import org.junit.Test; +import static org.junit.Assert.*; +import org.junit.Before; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class PersonSearchControllerTest { + + private PersonSearchController controller; + public static final String PERSON_SEARCH_ID = "83d2cd30-8e1d-11ea-b65e-4e1376171215"; + public static final String USER_ID = "67b3081e-8bc9-11ea-b45c-c7b846343364"; + + public PersonSearchControllerTest() { + } + + @Before + public void setUp() { + controller = new PersonSearchController(); + } + + //@Test + public void findAllLoanByUserOrderPreference() { + try { + List results = controller.findAllCoincidences("%janitzio%"); + + results.forEach(System.out::println); + + assertFalse(results.isEmpty()); + } catch (Exception e) { + assertFalse(true); + } + } + + //@Test + public void findPersonSearchDetail() { + try { + PersonSearchDetailView personSearchDetailView = controller.findPersonSearchDetail(PERSON_SEARCH_ID); + + System.out.println(personSearchDetailView); + assertNotNull(personSearchDetailView); + } catch (Exception e) { + assertFalse(true); + } + } + + @Test + public void searchPaymentDetails() { + try { + LoanByUserView personSearchDetailView = controller.searchPaymentDetails(USER_ID, PERSON_SEARCH_ID); + + System.out.println(personSearchDetailView); + assertNotNull(personSearchDetailView); + } catch (Exception e) { + assertFalse(true); + } + } + +} diff --git a/ace-controller-mobile/src/test/java/com/arrebol/apc/controller/mobile/controller/user/UserControllerTest.java b/ace-controller-mobile/src/test/java/com/arrebol/apc/controller/mobile/controller/user/UserControllerTest.java new file mode 100644 index 0000000..a662eca --- /dev/null +++ b/ace-controller-mobile/src/test/java/com/arrebol/apc/controller/mobile/controller/user/UserControllerTest.java @@ -0,0 +1,66 @@ +/* + * 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.controller.mobile.controller.user; + +import com.arrebol.apc.model.core.User; +import java.util.List; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import org.junit.Before; +import org.junit.Test; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class UserControllerTest { + + /** + * Avatar 2 + */ + public final static String USER_MOBILE_AVATAR_2_ID = "52cbc85a-8bc9-11ea-b45c-c7b846343364"; + public final static String TEPIC_OFFICE = "caef3a64-7d1f-11ea-af3e-28f659da398e"; + + private UserController controller; + + @Before + public void setUp() { + controller = new UserController(); + } + + //@Test + public void isUserEnebled() { + try { + assertTrue(controller.isUserEnebled(USER_MOBILE_AVATAR_2_ID)); + } catch (Exception e) { + assertFalse(true); + } + } + + //@Test + public void containtsUserManagementProperty() { + try { + assertTrue(controller.containtsUserManagementProperty(USER_MOBILE_AVATAR_2_ID)); + } catch (Exception e) { + assertFalse(true); + } + } + + @Test + public void listOfUsersByOffice() { + try { + List results = controller.listOfUsersByOffice(TEPIC_OFFICE); + + results.forEach(System.out::println); + + assertFalse(results.isEmpty()); + } catch (Exception e) { + assertFalse(true); + } + } +} diff --git a/ace-controller-mobile/src/test/java/com/arrebol/apc/controller/mobile/repository/ArrebolTestRepositoryTest.java b/ace-controller-mobile/src/test/java/com/arrebol/apc/controller/mobile/repository/ArrebolTestRepositoryTest.java new file mode 100644 index 0000000..07f847f --- /dev/null +++ b/ace-controller-mobile/src/test/java/com/arrebol/apc/controller/mobile/repository/ArrebolTestRepositoryTest.java @@ -0,0 +1,39 @@ +/* + * 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.controller.mobile.repository; + +import com.arrebol.apc.test.ArrebolTest; +import java.util.Date; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class ArrebolTestRepositoryTest { + + private ArrebolTestRepository repository; + + @Before + public void setUp() { + repository = new ArrebolTestRepository(); + } + + @Test + public void save() { + try { + ArrebolTest arrebolTest = new ArrebolTest(new Date(), new Date()); + + Assert.assertTrue(repository.saveArrebolTest(arrebolTest)); + } catch (Exception e) { + Assert.assertFalse(true); + } + } +} diff --git a/ace-controller-mobile/src/test/java/com/arrebol/apc/controller/mobile/repository/loan/LoanTypeRepositoryTest.java b/ace-controller-mobile/src/test/java/com/arrebol/apc/controller/mobile/repository/loan/LoanTypeRepositoryTest.java new file mode 100644 index 0000000..62d37c4 --- /dev/null +++ b/ace-controller-mobile/src/test/java/com/arrebol/apc/controller/mobile/repository/loan/LoanTypeRepositoryTest.java @@ -0,0 +1,75 @@ +/* + * 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.controller.mobile.repository.loan; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.constance.LoanTypeCfg; +import com.arrebol.apc.model.loan.Loan; +import com.arrebol.apc.model.loan.LoanType; +import java.util.ArrayList; +import java.util.List; +import static org.junit.Assert.assertFalse; +import org.junit.Before; +import org.junit.Test; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class LoanTypeRepositoryTest { + + public static final String OFFICE_ID = "caef3a64-7d1f-11ea-af3e-28f659da398e"; + public static final String LOAND_ID = "acccdfac-8e1b-11ea-b65e-4e1376171215"; + + private LoanTypeRepository repository; + + @Before + public void setUp() { + repository = new LoanTypeRepository(); + } + + @Test + public void findLoanTypes() { + try { + List parameters = new ArrayList<>(); + + parameters.add( + new ModelParameter( + LoanTypeCfg.FIELD_OFFICE, + new Office(OFFICE_ID) + ) + ); + + parameters.add( + new ModelParameter( + LoanTypeCfg.PARAM_LOAN, + new Loan(LOAND_ID) + ) + ); + + parameters.add( + new ModelParameter( + LoanTypeCfg.PARAM_LOAN_ID, + LOAND_ID + ) + ); + + List results = repository.findLoanTypes( + LoanType.class, + LoanTypeCfg.QUERY_FIND_NEW_CREDIT_LINE_BY_LOAN_ID, + parameters); + + results.forEach(System.out::println); + assertFalse(results.isEmpty()); + } catch (Exception e) { + assertFalse(true); + } + } + +} diff --git a/ace-controller-mobile/src/test/java/com/arrebol/apc/controller/mobile/repository/people/PeopleRepositoryTest.java b/ace-controller-mobile/src/test/java/com/arrebol/apc/controller/mobile/repository/people/PeopleRepositoryTest.java new file mode 100644 index 0000000..40dce2b --- /dev/null +++ b/ace-controller-mobile/src/test/java/com/arrebol/apc/controller/mobile/repository/people/PeopleRepositoryTest.java @@ -0,0 +1,68 @@ +/* + * 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.controller.mobile.repository.people; + +import com.arrebol.apc.controller.mobile.repository.people.PeopleRepository; +import com.arrebol.apc.model.catalog.People; +import com.arrebol.apc.model.catalog.RouteCtlg; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.enums.PeopleType; +import java.util.Date; +import static org.junit.Assert.*; +import org.junit.Before; +import org.junit.Test; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class PeopleRepositoryTest { + + private PeopleRepository repository; + public static final String OFFICE_ID = "e0f1a2fc-7d1f-11ea-af3e-28f659da398e"; + public static final String ROUTE_ID = "5e9a24e0-8e19-11ea-b65e-4e1376171215"; + public static final String TEXT_VALUE = "Testing"; + + public PeopleRepositoryTest() { + } + + @Before + public void setUp() { + repository = new PeopleRepository(); + } + + @Test + public void createPeople() { + try { + People people = new People(); + + people.setFirstName(TEXT_VALUE); + people.setLastName(TEXT_VALUE); + people.setMiddleName(TEXT_VALUE); + people.setAddressHome(TEXT_VALUE); + people.setPhoneHome(TEXT_VALUE); + people.setThumbnail(TEXT_VALUE); + people.setPeopleType(PeopleType.BOTH); + people.setActiveStatus(ActiveStatus.DISABLED); + people.setOffice(new Office(OFFICE_ID)); + people.setRouteCtlg(new RouteCtlg(ROUTE_ID)); + people.setCreatedBy(TEXT_VALUE); + people.setCreatedOn(new Date()); + + String id = null;//repository.createPeople(people); + + System.out.println(id); + + assertNotNull(id); + } catch (Exception e) { + assertFalse(true); + } + } + +} diff --git a/ace-controller-mobile/src/test/resources/apc.cfg.xml b/ace-controller-mobile/src/test/resources/apc.cfg.xml new file mode 100644 index 0000000..6572c6b --- /dev/null +++ b/ace-controller-mobile/src/test/resources/apc.cfg.xml @@ -0,0 +1,228 @@ + + + + + org.hibernate.dialect.MySQLDialect + com.mysql.cj.jdbc.Driver + jdbc:mysql://localhost:3306/apo_pro_com_april_ten?serverTimezone=GMT-5 + apoprocommobilelocalhost + 0Ps$6%q8 + 1 + 2 + 300 + 50 + 3000 + false + false + true + thread + ${hibernate.connection.noAccessToProcedureBodies} + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ace-controller-mobile/src/test/resources/log4j2.xml b/ace-controller-mobile/src/test/resources/log4j2.xml new file mode 100644 index 0000000..64f531e --- /dev/null +++ b/ace-controller-mobile/src/test/resources/log4j2.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ace-controller/nb-configuration.xml b/ace-controller/nb-configuration.xml new file mode 100644 index 0000000..a65c451 --- /dev/null +++ b/ace-controller/nb-configuration.xml @@ -0,0 +1,18 @@ + + + + + + JDK_1.8 + + diff --git a/ace-controller/pom.xml b/ace-controller/pom.xml new file mode 100644 index 0000000..4ef1c79 --- /dev/null +++ b/ace-controller/pom.xml @@ -0,0 +1,92 @@ + + + 4.0.0 + com.arrebol + ace-controller + 1.0.0 + jar + + UTF-8 + 1.8 + 1.8 + 2.17.0 + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12.4 + + true + + + + + + + + mysql + mysql-connector-java + 8.0.12 + + + + org.apache.logging.log4j + log4j-api + ${log4j.version} + + + org.apache.logging.log4j + log4j-core + ${log4j.version} + + + org.apache.logging.log4j + log4j-slf4j-impl + ${log4j.version} + + + org.apache.commons + commons-dbcp2 + 2.6.0 + + + + com.arrebol + ace-layout + 1.0.0 + jar + + + com.arrebol + ace-model + 1.0.0 + + + + junit + junit + 4.12 + test + + + ace-controller + \ No newline at end of file diff --git a/ace-controller/pom.xml.bak b/ace-controller/pom.xml.bak new file mode 100644 index 0000000..ba28277 --- /dev/null +++ b/ace-controller/pom.xml.bak @@ -0,0 +1,92 @@ + + + 4.0.0 + com.arrebol + ace-controller + 1.0.0 + jar + + UTF-8 + 1.8 + 1.8 + 2.17.0 + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12.4 + + true + + + + + + + + mysql + mysql-connector-java + 8.0.12 + + + + org.apache.logging.log4j + log4j-api + ${log4j.version} + + + org.apache.logging.log4j + log4j-core + ${log4j.version} + + + org.apache.logging.log4j + log4j-slf4j-impl + ${log4j.version} + + + org.apache.commons + commons-dbcp2 + 2.6.0 + + + + com.arrebol + apc-layout + 1.0.0 + jar + + + com.arrebol + apc-model + 1.0.0 + + + + junit + junit + 4.12 + test + + + ace-controller + \ No newline at end of file diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/BitacoraController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/BitacoraController.java new file mode 100644 index 0000000..f5f151c --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/BitacoraController.java @@ -0,0 +1,75 @@ +/* + * 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.controller; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.admin.constance.BitacoraCfg; +import com.arrebol.apc.model.admin.constance.GoalCfg; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.system.logs.Bitacora; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public class BitacoraController implements Serializable{ + + /** + * + * Searching all bitacora by office. + * + * @param officeId + * @return + */ + public List fillBitacoraDatatable(String officeId) { + logger.debug("fillBitacoraDatatable"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(BitacoraCfg.FIELD_OFFICE, new Office(officeId))); + + return genericEntityRepository.xmlQueryAPCEntities(Bitacora.class, BitacoraCfg.QUERY_FIND_ALL_BITACORA_BY_OFFICE, parameters); + } + + public List fillBitacoraDatatableByDate(String officeId, Date startDate, Date endDate) { + logger.debug("fillBitacoraDatatableByDate"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(BitacoraCfg.FIELD_OFFICE, new Office(officeId))); + parameters.add(new ModelParameter(GoalCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(GoalCfg.PARAM_END_DATE, endDate)); + + return genericEntityRepository.xmlQueryAPCEntities(Bitacora.class, BitacoraCfg.QUERY_FIND_ALL_BITACORA_BY_OFFICE_DATE, parameters); + } + + /** + * + * @param bitacora + * @return boolean + */ + public boolean saveBitacora(Bitacora bitacora) { + logger.debug("saveBitacora"); + boolean success = genericEntityRepository.insertAPCEntity(bitacora); + + return success; + + } + + final Logger logger = LogManager.getLogger(BitacoraController.class); + private final GenericEntityRepository genericEntityRepository; + + public BitacoraController() { + this.genericEntityRepository = new GenericEntityRepository(); + } +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/GenericController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/GenericController.java new file mode 100644 index 0000000..74a83aa --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/GenericController.java @@ -0,0 +1,236 @@ +/* + * 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.controller; + +import com.arrebol.apc.controller.util.HibernateUtil; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.admin.constance.ClosingDayCfg; +import com.arrebol.apc.model.admin.constance.StableGeneralBoxCfg; +import com.arrebol.apc.model.core.HumanResource; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.core.constance.HumanResourceCfg; +import com.arrebol.apc.model.core.constance.UserCfg; +import com.arrebol.apc.model.enums.HumanResourceStatus; +import com.arrebol.apc.model.views.GeneralBoxView; +import com.arrebol.apc.model.views.constance.GeneralBoxViewCfg; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.hibernate.HibernateException; +import org.hibernate.Session; +import org.hibernate.Transaction; +import org.hibernate.query.Query; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class GenericController implements Serializable{ + + /** + * + * Searching all user actives by office. + * + * @param officeId + * @return + */ + public List getAllUsersByOffice(String officeId) { + logger.debug("getAllUsersByOffice"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(UserCfg.FIELD_OFFICE, new Office(officeId))); + + return genericEntityRepository.xmlQueryAPCEntities(User.class, UserCfg.QUERY_FIND_ALL_USERS_COMPLETE, parameters); + } + + /** + * + * Searching all human resources actives by office. + * + * @param officeId + * @return + */ + public List getAllHRByOffice(String officeId) { + logger.debug("getAllHRByOffice"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(HumanResourceCfg.FIELD_OFFICE, new Office(officeId))); + parameters.add(new ModelParameter(HumanResourceCfg.FIELD_HR_STATUS, HumanResourceStatus.ENEBLED)); + + return genericEntityRepository.xmlQueryAPCEntities(HumanResource.class, HumanResourceCfg.QUERY_FIND_ALL_HR_BY_OFFICE, parameters); + } + + /** + * + * Searching all details by general box by office. + * + * @param officeId + * @return + */ + public BigDecimal findAllGeneralBox(String officeId) { + logger.debug("findAllGeneralBox"); + List generalBox = null; + BigDecimal totalBox; + totalBox = BigDecimal.ZERO; + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(GeneralBoxViewCfg.FIELD_OFFICE, officeId)); + + generalBox = genericEntityRepository.xmlQueryAPCEntities(GeneralBoxView.class, GeneralBoxViewCfg.QUERY_FIND_ALL_DETAILS, parameters); + + if(generalBox != null && !generalBox.isEmpty()) + { + for(GeneralBoxView total : generalBox) + { + if(total.getType().equalsIgnoreCase("Inicio")) + totalBox = totalBox.subtract(total.getAmount()); + if(total.getType().equalsIgnoreCase("Corte del dĆ­a")) + totalBox = totalBox.add(total.getAmount()); + if(total.getType().equalsIgnoreCase("Entrada")) + totalBox = totalBox.add(total.getAmount()); + if(total.getType().equalsIgnoreCase("Salida")) + totalBox = totalBox.subtract(total.getAmount()); + if(total.getType().equalsIgnoreCase("Adelanto")) + totalBox = totalBox.subtract(total.getAmount()); + if(total.getType().equalsIgnoreCase("Nomina")) + totalBox = totalBox.subtract(total.getAmount()); + if(total.getType().equalsIgnoreCase("PrĆ©stamo Empleado")) + totalBox = totalBox.subtract(total.getAmount()); + } + } + + return totalBox; + } + + public BigDecimal findAllSmallBox(String officeId) { + logger.debug("findAllSmallBox"); + BigDecimal totalBox; + totalBox = BigDecimal.ZERO; + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(ClosingDayCfg.FIELD_OFFICE, new Office(officeId))); + + totalBox = (BigDecimal)genericEntityRepository.xmlQueryAPCEntityUniqueResult(BigDecimal.class, + ClosingDayCfg.QUERY_SUM_CLOSING_DAY_BY_CURDATE_AND_OFFICE, parameters); + + return totalBox; + } + + + public BigDecimal findAllSmallBoxByLastSmallBox(String officeId, Date lastSmallBox) { + logger.debug("findAllSmallBoxByLastSmalBox"); + BigDecimal totalBox; + totalBox = BigDecimal.ZERO; + + Transaction transaction = null; + + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + Query query = session.createQuery("SELECT SUM(amountPaid) FROM ClosingDay WHERE office.id = :idOffice AND createdOn > :lastBox AND activeStatus = 'ENEBLED'"); + query.setParameter("idOffice", officeId); + query.setParameter("lastBox", lastSmallBox); + query.setMaxResults(1); + totalBox = (BigDecimal) query.uniqueResult(); + + + + transaction.commit(); + + } catch (HibernateException e) { + logger.error("Driver", e); + rollback(transaction); + } catch (Exception e) { + logger.error(e); + rollback(transaction); + } + + + return totalBox; + } + + public Date getMaxDateStableGeneralBoxByOffice(String officeid) { + logger.debug("getMaxDateStableGeneralBoxByOffice"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(StableGeneralBoxCfg.FIELD_OFFICE, new Office(officeid))); + + return (Date) genericEntityRepository.xmlQueryAPCEntityUniqueResult(Date.class, StableGeneralBoxCfg.QUERY_MAX_STABLE_GENERAL_BOX_BY_OFFICE, parameters); + } + + public Date getMaxDateClosingDayByOffice(String officeid) { + logger.debug("getMaxDateClosingDayByOffice"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(StableGeneralBoxCfg.FIELD_OFFICE, new Office(officeid))); + + return (Date) genericEntityRepository.xmlQueryAPCEntityUniqueResult(Date.class, StableGeneralBoxCfg.QUERY_MAX_CLOSING_DAY_BY_OFFICE, parameters); + } + + public boolean verifyStableGeneralBoxVsClosingDay(String officeid) + { + if(getMaxDateStableGeneralBoxByOffice(officeid) == null || getMaxDateClosingDayByOffice(officeid) == null) + { + return true; + } + if(getMaxDateStableGeneralBoxByOffice(officeid).compareTo(getMaxDateClosingDayByOffice(officeid)) == 0) + { + return true; + } + else + { + return false; + } + } + + public boolean existStableSmallBoxByCreatedOn(Date date) { + logger.info("existStableSmallBoxByCreatedOn"); + + String query = "SELECT ssb.id " + + "FROM APC_STABLE_SMALL_BOX ssb " + + "WHERE DATE(ssb.created_on) = DATE(:date) " + + "AND ssb.active_status = 'ENEBLED'"; + + return genericEntityRepository.existRecordsUsingSQLQueryFindByCreatedOnField(date, query); + } + + /** + * + * @param date + * @return + */ + public boolean existStableGeneralBoxByCreatedOn(Date date) { + logger.info("existStableGeneralBoxByCreatedOn"); + + String query = "SELECT sgb.id " + + "FROM APC_STABLE_GENERAL_BOX sgb " + + "WHERE DATE(sgb.created_on) = DATE(:date) " + + "AND sgb.active_status = 'ENEBLED'"; + + return genericEntityRepository.existRecordsUsingSQLQueryFindByCreatedOnField(date, query); + } + + protected void rollback(Transaction transaction) { + if (null != transaction) { + transaction.rollback(); + } + } + + final Logger logger = LogManager.getLogger(GenericController.class); + private final GenericEntityRepository genericEntityRepository; + + public GenericController() { + this.genericEntityRepository = new GenericEntityRepository(); + } +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/GenericValidationController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/GenericValidationController.java new file mode 100644 index 0000000..2037fd1 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/GenericValidationController.java @@ -0,0 +1,202 @@ +/* + * 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.controller; + +import com.arrebol.apc.controller.util.ConnectionManager; +import com.arrebol.apc.controller.util.HibernateUtil; +import com.arrebol.apc.model.admin.ClosingDay; +import com.arrebol.apc.model.core.User; +import java.io.Serializable; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.hibernate.HibernateException; +import org.hibernate.Session; +import org.hibernate.Transaction; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public class GenericValidationController extends ConnectionManager implements Serializable{ + + /** + * + * @param date + * @param user + * @return + */ + public boolean existClosingDayByCreatedOn(Date date, User user) { + logger.info("existClosingDayByCreatedOn"); + + boolean success = true; + Transaction transaction = null; + + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + String query = "SELECT COUNT(ssb.id) " + + "FROM ClosingDay ssb " + + "WHERE DATE(ssb.createdOn) = DATE(:date) " + + "AND ssb.activeStatus = 'ENEBLED' " + + "AND ssb.user = :user"; + + Long count = (Long) session.createQuery(query) + .setParameter("date", date) + .setParameter("user", user).uniqueResult(); + + if (null != count && count == 0) { + success = false; + } + + transaction.commit(); + + logger.info("Total of closing day found: " + count); + } catch (HibernateException e) { + logger.error("Can not find stable small box by created on", e); + rollback(transaction); + } catch (Exception e) { + logger.error("Method existStableSmallBoxByCreatedOn()", e); + rollback(transaction); + } + + return success; + } + + public boolean existStableGeneralBoxByCurdate(User user) { + logger.info("existStableGeneralBoxByCurdate"); + + boolean success = true; + Transaction transaction = null; + + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + String query = "SELECT COUNT(ssb.id) " + + "FROM StableGeneralBox ssb " + + "WHERE DATE(ssb.createdOn) = CURDATE() " + + "AND ssb.activeStatus = 'ENEBLED'"; + + Long count = (Long) session.createQuery(query).uniqueResult(); + + if (null != count && count == 0) { + success = false; + } + + transaction.commit(); + + logger.info("Total of StableGeneralBox found: " + count); + } catch (HibernateException e) { + logger.error("Can not find StableGeneralBox by created on", e); + rollback(transaction); + } catch (Exception e) { + logger.error("Method existStableGeneralBoxByCurdate()", e); + rollback(transaction); + } + + return success; + } + + public Date lastStableGeneralBoxByDate(User user) { + logger.info("lastStableGeneralBoxByDate"); + + Date success = null; + Transaction transaction = null; + + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + String query = "SELECT cd.createdOn FROM StableGeneralBox cd " + + "WHERE DATE(cd.createdOn) <= CURDATE() AND cd.activeStatus = 'ENEBLED' " + + "order by cd.createdOn DESC"; + + success = (Date) session.createQuery(query).setMaxResults(1) + .uniqueResult(); + + transaction.commit(); + + logger.info("Total of closing day found: "); + } catch (HibernateException e) { + logger.error("Can not find stable small box by created on", e); + rollback(transaction); + } catch (Exception e) { + logger.error("Method lastStableGeneralBoxByDate()", e); + rollback(transaction); + } + + return success; + } + + public Date lastStableSmallBoxByDate(User user) { + logger.info("lastStableSmallBoxByDate"); + + Date success = null; + Transaction transaction = null; + + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + String query = "SELECT cd.createdOn FROM StableSmallBox cd " + + "WHERE DATE(cd.createdOn) <= CURDATE() AND cd.activeStatus = 'ENEBLED' " + + "order by cd.createdOn DESC"; + + success = (Date) session.createQuery(query).setMaxResults(1) + .uniqueResult(); + + transaction.commit(); + + logger.info("Total of closing day found: "); + } catch (HibernateException e) { + logger.error("Can not find stable small box by created on", e); + rollback(transaction); + } catch (Exception e) { + logger.error("Method lastStableSmallBoxByDate()", e); + rollback(transaction); + } + + return success; + } + + public List allClosingDayByDate( ) { + logger.info("allClosingDayByDate"); + + List success = null; + Transaction transaction = null; + + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + String query = "SELECT cd FROM ClosingDay cd " + + "WHERE DATE(cd.createdOn) = CURDATE() AND cd.activeStatus = 'ENEBLED'"; + + success = session.createQuery(query).getResultList(); + + transaction.commit(); + + logger.info("Total of closing day found: "); + } catch (HibernateException e) { + logger.error("Can not find stable small box by created on", e); + rollback(transaction); + } catch (Exception e) { + logger.error("Method lastStableSmallBoxByDate()", e); + rollback(transaction); + } + + return success; + } + + final Logger logger = LogManager.getLogger(GenericValidationController.class); + private static final long serialVersionUID = -6732331411572526429L; + +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/admin/AdministrationPersonSearchViewController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/AdministrationPersonSearchViewController.java new file mode 100644 index 0000000..e079f61 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/AdministrationPersonSearchViewController.java @@ -0,0 +1,148 @@ +/* + * 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.controller.admin; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.catalog.RouteCtlg; +import com.arrebol.apc.model.catalog.constance.RouteCfg; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.enums.PeopleType; +import com.arrebol.apc.model.views.AdministrationPersonSerchView; +import com.arrebol.apc.model.views.constance.AdministrationPersonSerchViewCfg; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class AdministrationPersonSearchViewController implements Serializable { + + public List findAllActiveRoutesByOfficce(String idOffice) { + List routes; + try { + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(RouteCfg.FIELD_ACTIVE_STATUS, ActiveStatus.ENEBLED)); + parameters.add(new ModelParameter(RouteCfg.FIELD_OFFICE, new Office(idOffice))); + + routes = genericEntityRepository.xmlQueryAPCEntities(RouteCtlg.class, RouteCfg.QUERY_FIND_ALL_ROUTES, parameters); + } catch (Exception e) { + routes = new ArrayList<>(); + + logger.error("findPersonByTypeAndRouteAndOffice", e); + } + return routes; + } + + /** + * + * @param type + * @param idRoute + * @param idOffice + * @return + */ + public List findPersonByTypeAndRouteAndOffice(PeopleType type, String idRoute, String idOffice) { + List persons; + try { + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(AdministrationPersonSerchViewCfg.FIELD_PEOPLE_TYPE, type)); + parameters.add(new ModelParameter(AdministrationPersonSerchViewCfg.FIELD_ID_ROUTE, idRoute)); + parameters.add(new ModelParameter(AdministrationPersonSerchViewCfg.FIELD_ID_OFFICE, idOffice)); + + persons = genericEntityRepository.xmlQueryAPCEntities(AdministrationPersonSerchView.class, AdministrationPersonSerchViewCfg.QUERY_FIND_PERSON_BY_TYPE_ROUTE_OFFICE, parameters); + } catch (Exception e) { + persons = new ArrayList<>(); + + logger.error("findPersonByTypeAndRouteAndOffice", e); + } + return persons; + } + + /** + * + * @param personSearch + * @param type + * @param routes + * @param idOffice + * @return + */ + public List likePersonNameInPersonTypeInRoutesAndOffice(String personSearch, PeopleType type, List routes, String idOffice) { + List persons; + try { + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(AdministrationPersonSerchViewCfg.FIELD_PERSON_SEARCH, personSearch)); + parameters.add(new ModelParameter(AdministrationPersonSerchViewCfg.FIELD_PEOPLE_TYPE, type)); + parameters.add(new ModelParameter(AdministrationPersonSerchViewCfg.FIELD_ID_ROUTE, routes)); + parameters.add(new ModelParameter(AdministrationPersonSerchViewCfg.FIELD_ID_OFFICE, idOffice)); + + persons = genericEntityRepository.xmlQueryAPCEntities(AdministrationPersonSerchView.class, AdministrationPersonSerchViewCfg.QUERY_LIKE_PERSON_NAME_IN_PERSON_TYPE_IN_ROUTES_AND_OFFICE, parameters); + } catch (Exception e) { + persons = new ArrayList<>(); + + logger.error("likePersonNameInPersonTypeInRoutesAndOffice", e); + } + return persons; + } + + /** + * + * @param personSearch + * @param type + * @param idOffice + * @return + */ + public List likePersonNameInPersonTypeAllRoutesByOffice(String personSearch, PeopleType type, String idOffice) { + List persons; + try { + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(AdministrationPersonSerchViewCfg.FIELD_PERSON_SEARCH, personSearch)); + parameters.add(new ModelParameter(AdministrationPersonSerchViewCfg.FIELD_PEOPLE_TYPE, type)); + parameters.add(new ModelParameter(AdministrationPersonSerchViewCfg.FIELD_ID_OFFICE, idOffice)); + + persons = genericEntityRepository.xmlQueryAPCEntities(AdministrationPersonSerchView.class, AdministrationPersonSerchViewCfg.QUERY_LIKE_PERSON_NAME_IN_PERSON_TYPE_ALL_ROUTES_BY_OFFICE, parameters); + } catch (Exception e) { + persons = new ArrayList<>(); + + logger.error("likePersonNameInPersonTypeAllRoutesByOffice", e); + } + return persons; + } + + /** + * + * @param id + * @return + */ + public AdministrationPersonSerchView administrationPersonSerchViewById(String id) { + AdministrationPersonSerchView person; + try { + person = (AdministrationPersonSerchView) genericEntityRepository.selectAPCEntityById(AdministrationPersonSerchView.class, id); + } catch (Exception e) { + person = new AdministrationPersonSerchView(); + + logger.error("administrationPersonSerchViewById", e); + } + return person; + } + + public AdministrationPersonSearchViewController() { + this.genericEntityRepository = new GenericEntityRepository(); + } + + final Logger logger = LogManager.getLogger(getClass()); + private final GenericEntityRepository genericEntityRepository; +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/admin/AdvanceController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/AdvanceController.java new file mode 100644 index 0000000..d99b83d --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/AdvanceController.java @@ -0,0 +1,91 @@ +/* + * 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.controller.admin; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.admin.Advance; +import com.arrebol.apc.model.admin.constance.AdvanceCfg; +import com.arrebol.apc.model.admin.constance.BonusCfg; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public class AdvanceController implements Serializable { + + /** + * + * Searching all advances by office. + * + * @param officeId + * @param startDate + * @param endDate + * @return + */ + public List fillAdvanceDatatable(String officeId, Date startDate, Date endDate) { + logger.debug("fillAdvanceDatatable"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(AdvanceCfg.FIELD_OFFICE, new Office(officeId))); + //parameters.add(new ModelParameter(AdvanceCfg.FIELD_ACTIVE_STATUS, ActiveStatus.ENEBLED)); + parameters.add(new ModelParameter(BonusCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(BonusCfg.PARAM_END_DATE, endDate)); + + return genericEntityRepository.xmlQueryAPCEntities(Advance.class, AdvanceCfg.QUERY_FIND_ALL_ADVANCE_BY_OFFICE_BETWEEN_DATES, parameters); + } + + /** + * + * @param advance + * @return boolean + */ + public boolean saveAdvance(Advance advance) { + logger.debug("saveAdvance"); + boolean success = genericEntityRepository.insertAPCEntity(advance); + + return success; + + } + + /** + * + * @param status + * @param advanceIdToUpdate + * @param lastUpdatedBy + * @return + */ + public boolean updateAdvanceByStatus(ActiveStatus status, String advanceIdToUpdate, String lastUpdatedBy) { + logger.debug("updateAdvanceByStatus"); + + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(AdvanceCfg.FIELD_ACTIVE_STATUS, status)); + parameters.add(new ModelParameter(AdvanceCfg.FIELD_LAST_UPDATED_BY, lastUpdatedBy)); + parameters.add(new ModelParameter(AdvanceCfg.FIELD_LAST_UPDATED_ON, new Date())); + parameters.add(new ModelParameter(AdvanceCfg.FIELD_ID, advanceIdToUpdate)); + + return genericEntityRepository.xmlUpdateOrDeleteAPCEntity(AdvanceCfg.QUERY_UPDATE_ADVANCE_BY_STATUS, parameters); + } + + final Logger logger = LogManager.getLogger(AdvanceController.class); + private final GenericEntityRepository genericEntityRepository; + + public AdvanceController() { + this.genericEntityRepository = new GenericEntityRepository(); + } + +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/admin/BonusController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/BonusController.java new file mode 100644 index 0000000..af92303 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/BonusController.java @@ -0,0 +1,102 @@ +/* + * 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.controller.admin; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.admin.Bonus; +import com.arrebol.apc.model.admin.constance.BonusCfg; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public class BonusController implements Serializable{ + + private static final long serialVersionUID = 4204730064288408417L; + + /** + * + * Searching all advances by office. + * + * @param officeId + * @param startDate + * @param endDate + * @return + */ + public List fillBonusDatatable(String officeId, Date startDate, Date endDate) { + logger.debug("fillBonusDatatable"); + List parameters = new ArrayList<>(); + + 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.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(BonusCfg.PARAM_END_DATE, endDate)); + + return genericEntityRepository.xmlQueryAPCEntities(Bonus.class, BonusCfg.QUERY_FIND_ALL_BONUS_BETWEEN_DATES, parameters); + } + + /** + * + * @param bonus + * @return boolean + */ + public boolean updateByBonusId(Bonus bonus) { + logger.debug("updateByBonusId"); + + return genericEntityRepository.updateAPCEntity(bonus); + } + + /** + * + * @param bonus + * @return boolean + */ + public boolean saveBonus(Bonus bonus) { + logger.debug("saveBonus"); + boolean success = genericEntityRepository.insertAPCEntity(bonus); + + return success; + } + + /** + * + * @param status + * @param bonusIdToUpdate + * @param lastUpdatedBy + * @return + */ + public boolean updateBonusByStatus(ActiveStatus status, String bonusIdToUpdate, String lastUpdatedBy) { + logger.debug("updateBonusByStatus"); + + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(BonusCfg.FIELD_ACTIVE_STATUS, status)); + parameters.add(new ModelParameter(BonusCfg.FIELD_LAST_UPDATED_BY, lastUpdatedBy)); + parameters.add(new ModelParameter(BonusCfg.FIELD_LAST_UPDATED_ON, new Date())); + parameters.add(new ModelParameter(BonusCfg.FIELD_ID, bonusIdToUpdate)); + + return genericEntityRepository.xmlUpdateOrDeleteAPCEntity(BonusCfg.QUERY_UPDATE_BONUS_BY_STATUS, parameters); + } + + final Logger logger = LogManager.getLogger(BonusController.class); + private final GenericEntityRepository genericEntityRepository; + + public BonusController() { + this.genericEntityRepository = new GenericEntityRepository(); + } + +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/admin/ChangeOwnerController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/ChangeOwnerController.java new file mode 100644 index 0000000..3411818 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/ChangeOwnerController.java @@ -0,0 +1,140 @@ +/* + * 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.controller.admin; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.admin.constance.ClosingDayCfg; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.core.constance.LoanByUserCfg; +import com.arrebol.apc.model.loan.Loan; +import com.arrebol.apc.model.views.AvailablesOwnersView; +import com.arrebol.apc.model.views.CurrentCustomerByLoanView; +import com.arrebol.apc.model.views.constance.AvailablesOwnersViewCfg; +import com.arrebol.apc.model.views.constance.CurrentCustomerByLoanViewCfg; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class ChangeOwnerController implements Serializable { + + /** + * Find all users that have loans by office. + * + * @param officeId + * @return + * @throws Exception + */ + public List findAllCurrentOwners(String officeId) throws Exception { + logger.info("findAllCurrentOwners"); + + List results = new ArrayList(); + try { + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(AvailablesOwnersViewCfg.PARAM_OFFICE_ID, officeId)); + + results = genericEntityRepository.xmlQueryAPCEntities(AvailablesOwnersView.class, AvailablesOwnersViewCfg.QUERY_FIND_ALL_CURRENT_OWNERS, parameters); + } catch (Exception e) { + logger.error("findAllCurrentOwners", e); + } + return results; + } + + /** + * Find all users in office execluding user id (currentOwnerId). + * + * @param officeId + * @param currentOwnerId + * @return + * @throws Exception + */ + public List findAllNewOwners(String officeId, String currentOwnerId) throws Exception { + logger.info("findAllNewOwners"); + + List results = new ArrayList(); + try { + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(AvailablesOwnersViewCfg.PARAM_OFFICE_ID, officeId)); + parameters.add(new ModelParameter(AvailablesOwnersViewCfg.USER_ID, currentOwnerId)); + + results = genericEntityRepository.xmlQueryAPCEntities(AvailablesOwnersView.class, AvailablesOwnersViewCfg.QUERY_FIND_ALL_NEW_OWNERS, parameters); + } catch (Exception e) { + logger.error("findAllNewOwners", e); + } + return results; + } + + /** + * Find all loans that current owner has in status PENDING, TO_DELIVERY, + * PENDING_RENOVATION and APPROVED. + * + * @param officeId + * @param currentOwnerId + * @return + * @throws Exception + */ + public List findAllLoansByCurrentOwner(String officeId, String currentOwnerId) throws Exception { + logger.info("findAllLoansByCurrentOwner"); + + List results = new ArrayList(); + try { + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(CurrentCustomerByLoanViewCfg.PARAM_OFFICE_ID, officeId)); + parameters.add(new ModelParameter(CurrentCustomerByLoanViewCfg.USER_ID, currentOwnerId)); + + results = genericEntityRepository.xmlQueryAPCEntities(CurrentCustomerByLoanView.class, CurrentCustomerByLoanViewCfg.QUERY_FIND_ALL_LOANS_BY_CURRENT_OWNER, parameters); + } catch (Exception e) { + logger.error("findAllLoansByCurrentOwner", e); + } + return results; + } + + /** + * + * @param newOwner + * @param loans + * @return + */ + public boolean changeLoansBetweenUsers(String newOwner, List loans) { + logger.info("changeLoansBetweenUsers"); + + boolean success = false; + + try { + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanByUserCfg.FIELD_USER, new User(newOwner))); + parameters.add(new ModelParameter(LoanByUserCfg.PARAMS_LOAN, loans)); + + success = genericEntityRepository.xmlUpdateOrDeleteAPCEntity(LoanByUserCfg.QUERY_CHANGE_LOANS_BETWEEN_USERS_IN_LOAN_IDS, parameters); + } catch (Exception e) { + logger.error("changeLoansBetweenUsers", e); + } + + return success; + } + + private static final long serialVersionUID = 2051770456409752434L; + final Logger logger = LogManager.getLogger(getClass().getName()); + + private final GenericEntityRepository genericEntityRepository; + + public ChangeOwnerController() { + this.genericEntityRepository = new GenericEntityRepository(); + } +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/admin/ClosingDayController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/ClosingDayController.java new file mode 100644 index 0000000..252da32 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/ClosingDayController.java @@ -0,0 +1,439 @@ +/* + * 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.controller.admin; + +import com.arrebol.apc.controller.util.ConnectionManager; +import com.arrebol.apc.controller.util.HibernateUtil; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.admin.ClosingDay; +import com.arrebol.apc.model.admin.ClosingDayDetail; +import com.arrebol.apc.model.admin.constance.ClosingDayCfg; +import com.arrebol.apc.model.admin.constance.ClosingDayDetailCfg; +import com.arrebol.apc.model.catalog.People; +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.LoanByUserPaymentZeroView; +import com.arrebol.apc.model.views.TotalCashByCurdateDashboardView; +import com.arrebol.apc.model.views.TotalCashByCurdateView; +import com.arrebol.apc.model.views.TotalClosingDayByCurdateView; +import com.arrebol.apc.model.views.constance.ClosingDailyDetailFromUserByCurdateCfg; +import com.arrebol.apc.model.views.constance.LoanByUserPaymentZeroViewCfg; +import com.arrebol.apc.model.views.constance.TotalLoansByOfficeViewCfg; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.hibernate.HibernateException; +import org.hibernate.Session; +import org.hibernate.Transaction; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public class ClosingDayController extends ConnectionManager implements Serializable { + + /** + * + * Searching all closing day by office. + * + * @param officeId + * @param startDate + * @param endDate + * @return + */ + public List fillClosingDayDatatable(String officeId, Date startDate, Date endDate) { + logger.debug("fillClosingDayDatatable"); + List parameters = new ArrayList<>(); + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(startDate); + calendar.add(Calendar.DAY_OF_YEAR, 1); + startDate = calendar.getTime(); + + 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)); + + return genericEntityRepository.xmlQueryAPCEntities(ClosingDay.class, ClosingDayCfg.QUERY_FIND_ALL_CLOSING_DAY_BY_OFFICE_BETWEEN_DATES, parameters); + } + + /** + * + * @param status + * @param closingDayIdToUpdate + * @param lastUpdatedBy + * @return + */ + public boolean updateClosingDayByStatus(ActiveStatus status, String closingDayIdToUpdate, String lastUpdatedBy) { + logger.debug("updateClosingDayByStatus"); + + List parameters = new ArrayList<>(); + + 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 genericEntityRepository.xmlUpdateOrDeleteAPCEntity(ClosingDayCfg.QUERY_UPDATE_CLOSING_DAY_BY_STATUS, parameters); + } + + /** + * + * @param closingDay + * @return boolean + */ + public boolean saveClosingDay(ClosingDay closingDay) { + logger.debug("saveClosingDay"); + boolean success = genericEntityRepository.insertAPCEntity(closingDay); + + return success; + } + + /** + * + * Searching TotalCashByCurdateView by id. + * + * @param id + * @return + */ + public TotalCashByCurdateView getTotalCashByCurdateViewById(String id) { + logger.debug("getTotalCashByCurdateViewById"); + + return (TotalCashByCurdateView) genericEntityRepository.selectAPCEntityById(TotalCashByCurdateView.class, id); + } + + /** + * + * Searching all total money day by office. + * + * @param officeId + * @return + */ + public List getAllTotalCashByCurdateView(String officeId) { + logger.debug("getAllTotalCashByCurdateView"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(ClosingDayCfg.FIELD_VIEW_OFFICE, officeId)); + + return genericEntityRepository.xmlQueryAPCEntities(TotalCashByCurdateView.class, ClosingDayCfg.QUERY_FIND_TOTAL_BY_OFFICE, parameters); + } + + public List getAllTotalCashByCurdateDashboardView(String officeId) { + logger.debug("getAllTotalCashByCurdateDashboardView"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(ClosingDayCfg.FIELD_VIEW_OFFICE, officeId)); + + return genericEntityRepository.xmlQueryAPCEntities(TotalCashByCurdateDashboardView.class, ClosingDayCfg.QUERY_FIND_TOTAL_DASHBOARD_BY_OFFICE, parameters); + } + + /** + * + * Searching all TotalClosingDayByCurdateView by curdate. + * + * @param officeId + * @return + */ + public List findAllClosingDayByCurdate(String officeId) { + logger.debug("findAllClosingDayByCurdate"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(ClosingDayCfg.FIELD_VIEW_OFFICE, officeId)); + + return genericEntityRepository.xmlQueryAPCEntities(TotalClosingDayByCurdateView.class, ClosingDayCfg.QUERY_FIND_ALL_CLOSING_DAY_BY_CURDATE, parameters); + } + + /** + * + * Searching all ClosingDailyDetailFromUserByCurdateView by curdate. + * + * @param userId + * @return + */ + public List findAllClosingDailyDetailFromUserByCurdateView(String userId) { + logger.debug("findAllClosingDailyDetailFromUserByCurdateView"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(ClosingDailyDetailFromUserByCurdateCfg.FIELD_VIEW_USER, userId)); + + return genericEntityRepository.xmlQueryAPCEntities(ClosingDailyDetailFromUserByCurdateView.class, ClosingDailyDetailFromUserByCurdateCfg.QUERY_FIND_ALL_DETAILS, parameters); + } + + /** + * + * Searching all ClosingDailyDetailFromUserByCurdateView by curdate. + * + * @param userId + * @return + */ + public List findAllClosingDailyDetailFromUserCertifierByCurdateView(String userId) { + logger.debug("findAllClosingDailyDetailFromUserCertifierByCurdateView"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(ClosingDailyDetailFromUserByCurdateCfg.FIELD_VIEW_USER, userId)); + + return genericEntityRepository.xmlQueryAPCEntities(ClosingDailyDetailFromUserByCurdateView.class, ClosingDailyDetailFromUserByCurdateCfg.QUERY_FIND_ALL_DETAILS_CERTIFIER, parameters); + } + + /** + * + * Searching the num by closing day + * + * @param num for closing day + * @return + */ + public Long getClosingDayCurdateByUserId(String userId, String officeid) { + logger.debug("getClosingDayCurdateByUserId"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(ClosingDayCfg.FIELD_USER, new User(userId))); + parameters.add(new ModelParameter(ClosingDayCfg.FIELD_OFFICE, new Office(officeid))); + + return (Long) genericEntityRepository.xmlQueryAPCEntityUniqueResult(Long.class, ClosingDayCfg.QUERY_COUNT_CLOSING_DATE_BY_USER_AND_OFFICE, parameters); + } + + public Long getLoansCountDailyByUser(String userId) { + logger.debug("getLoansCountDailyByUser"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(TotalLoansByOfficeViewCfg.FIELD_VIEW_USER, userId)); + + return (Long) genericEntityRepository.xmlQueryAPCEntityUniqueResult(Long.class, TotalLoansByOfficeViewCfg.QUERY_COUNT_ALL_LOANS_BY_USER, parameters); + } + + public List getLoansPaymentZeroByUser(String userId) { + logger.debug("getLoansPaymentZeroByUser"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanByUserPaymentZeroViewCfg.FIELD_VIEW_USER, new User(userId))); + + return genericEntityRepository.xmlQueryAPCEntities(LoanByUserPaymentZeroView.class, LoanByUserPaymentZeroViewCfg.QUERY_FIND_ALL_LOANS_PAYMENT_ZERO_BY_USER, parameters); + } + + /** + * + * @param details + * @return boolean + */ + public boolean saveClosingDayDetail(List details) { + logger.debug("saveClosingDayDetail"); + boolean success = genericEntityRepository.insertManyAPCEntity(details); + + return success; + } + + /** + * + * Searching closing day by id. + * + * @param closingDayId + * @return + */ + public ClosingDay getClosingDayById(String closingDayId) { + logger.debug("getClosingDayById"); + + return (ClosingDay) genericEntityRepository.selectAPCEntityById(ClosingDay.class, closingDayId); + } + + public List getClosingDayDetailByIdClosingDay(String closingDay) { + logger.debug("getClosingDayDetailByIdClosingDay"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(ClosingDayDetailCfg.FIELD_CLOSING_DAY, new ClosingDay(closingDay))); + + return genericEntityRepository.xmlQueryAPCEntities(ClosingDayDetail.class, ClosingDayDetailCfg.QUERY_FIND_ALL_CLOSING_DAY_DETAIL_BY_ID, parameters); + } + + public User getUserById(String userId) { + logger.debug("getUserById"); + + return (User) genericEntityRepository.selectAPCEntityById(User.class, userId); + } + + /** + * + * @param date + * @return + */ + public boolean existNextPaidClosingDayByCreatedOn(Date date) { + logger.info("existNextPaidClosingDayByCreatedOn"); + + 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'"; + + return genericEntityRepository.existRecordsUsingSQLQueryFindByCreatedOnField(date, query); + } + + /** + * + * @param date + * @return + */ + public boolean existStableSmallBoxByCreatedOn(Date date) { + logger.info("existStableSmallBoxByCreatedOn"); + + String query = "SELECT ssb.id " + + "FROM APC_STABLE_SMALL_BOX ssb " + + "WHERE DATE(ssb.created_on) = DATE(:date) " + + "AND ssb.active_status = 'ENEBLED'"; + + return genericEntityRepository.existRecordsUsingSQLQueryFindByCreatedOnField(date, query); + } + + /** + * + * @param userId + * @return + */ + public List findDetailsFromClosingDayCurDate(String userId){ + logger.debug("findDetailsFromClosingDayCurDate"); + + List rows = new ArrayList<>(); + Transaction transaction = null; + + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + rows = session.createNativeQuery(queryClosingDayReport).setParameter("userId", userId).getResultList(); + + 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 findDetailsFromClosingDayHisotry(String idClosingDay){ + logger.debug("findDetailsFromClosingDayCurDate"); + + List 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_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; "; +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/admin/CustomerController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/CustomerController.java new file mode 100644 index 0000000..69ee707 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/CustomerController.java @@ -0,0 +1,141 @@ +/* + * 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.controller.admin; + +import com.arrebol.apc.controller.util.HibernateUtil; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.catalog.People; +import com.arrebol.apc.model.catalog.constance.PeopleCfg; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.core.constance.LoanCfg; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.loan.Loan; +import com.arrebol.apc.model.views.LoanDetailZeroView; +import com.arrebol.apc.model.views.LoanFinishedView; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.hibernate.HibernateException; +import org.hibernate.Session; +import org.hibernate.Transaction; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public class CustomerController extends PeopleController implements Serializable{ + + /** + * + * Searching all customers. + * + * @param officeId + * @return + */ + public List fillCustomersDatatable(String officeId) { + logger.debug("fillCustomersDatatable"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(PeopleCfg.FIELD_ACTIVE_STATUS, ActiveStatus.ENEBLED)); + + return genericEntityRepository.xmlQueryAPCEntities(People.class, PeopleCfg.QUERY_FIND_ALL_CUSTOMER, parameters); + } + + /** + * + * Searching all loan by customer. + * + * @param peopleId + * @return + */ + public List findLoanByCustomer(String peopleId) { + logger.debug("findLoanByCustomer"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanCfg.FIELD_CUSTOMER, new People(peopleId))); + + return genericEntityRepository.xmlQueryAPCEntities(Loan.class, LoanCfg.QUERY_FIND_LOAN_BY_CUSTOMER, parameters); + } + + public List findLoanByCustomerLimit(String peopleId) { + logger.debug("findLoanByCustomer"); + List results = new ArrayList<>(); + + Transaction transaction = null; + + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + + transaction = session.beginTransaction(); + + + + results = session.createQuery("SELECT l FROM Loan l WHERE customer = :customer AND loanStatus != 'DELETED' ORDER BY createdOn DESC") + .setParameter("customer", peopleId) + .setMaxResults(2) + .getResultList(); + + transaction.commit(); + + logger.info("Closing daily detail's list " + results.size()); + } catch (HibernateException e) { + logger.error("Can not find closing daily details list", e); + rollback(transaction); + } catch (Exception e) { + logger.error("Method findDetailsFromClosingDayID()", e); + rollback(transaction); + } + + + + + return results; + } + + /** + * + * Searching all loan for juridical. + * + * @param idUser + * @return + */ + public List findLoanJuridical(String idUser) { + logger.debug("findLoanJuridical"); + List parameters = new ArrayList<>(); + parameters.add(new ModelParameter(LoanCfg.FIELD_USER, new User(idUser))); + return genericEntityRepository.xmlQueryAPCEntities(Loan.class, LoanCfg.QUERY_FIND_LOAN_JURIDICAL, parameters); + } + + public List findLoanZero( ) { + logger.debug("findLoanZero"); + List parameters = new ArrayList<>(); + return genericEntityRepository.xmlQueryAPCEntities(LoanDetailZeroView.class, LoanCfg.QUERY_FIND_LOAN_ZERO, parameters); + } + + public List findLoanFinished( ) { + logger.debug("findLoanFinished"); + List parameters = new ArrayList<>(); + return genericEntityRepository.xmlQueryAPCEntities(LoanFinishedView.class, LoanCfg.QUERY_FIND_LOAN_FINISHED, parameters); + } + + final Logger logger = LogManager.getLogger(CustomerController.class); + private final GenericEntityRepository genericEntityRepository; + + public CustomerController() { + this.genericEntityRepository = new GenericEntityRepository(); + } + + protected void rollback(Transaction transaction) { + if (null != transaction) { + transaction.rollback(); + } + } +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/admin/EndorsementController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/EndorsementController.java new file mode 100644 index 0000000..979bacb --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/EndorsementController.java @@ -0,0 +1,67 @@ +/* + * 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.controller.admin; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.catalog.People; +import com.arrebol.apc.model.catalog.constance.PeopleCfg; +import com.arrebol.apc.model.core.constance.LoanCfg; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.loan.Loan; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public class EndorsementController extends PeopleController implements Serializable{ + + /** + * + * Searching all endorsement. + * + * @param officeId + * @return + */ + public List fillEndorsementsDatatable(String officeId) { + logger.debug("fillEndorsementsDatatable"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(PeopleCfg.FIELD_ACTIVE_STATUS, ActiveStatus.ENEBLED)); + + return genericEntityRepository.xmlQueryAPCEntities(People.class, PeopleCfg.QUERY_FIND_ALL_ENDORSEMENT, parameters); + } + + /** + * + * Searching all loan by endorsement. + * + * @param peopleId + * @return + */ + public List findLoanByEndorsement(String peopleId) { + logger.debug("findLoanByEndorsement"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanCfg.FIELD_ENDORSEMENT, new People(peopleId))); + + return genericEntityRepository.xmlQueryAPCEntities(Loan.class, LoanCfg.QUERY_FIND_LOAN_BY_ENDORSEMENT, parameters); + } + + final Logger logger = LogManager.getLogger(EndorsementController.class); + private final GenericEntityRepository genericEntityRepository; + + public EndorsementController() { + this.genericEntityRepository = new GenericEntityRepository(); + } +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/admin/ExpenseCompanyController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/ExpenseCompanyController.java new file mode 100644 index 0000000..f032e7a --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/ExpenseCompanyController.java @@ -0,0 +1,147 @@ +/* + * 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.controller.admin; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.admin.ExpenseCompany; +import com.arrebol.apc.model.admin.constance.ExpenseCompanyCfg; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.enums.ExpenseCompanyType; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public class ExpenseCompanyController implements Serializable { + + /** + * + * Searching all expense company in by office. + * + * @param officeId + * @param startDate + * @param endDate + * @return + */ + public List fillxpenseCompanyInDatatable(String officeId, Date startDate, Date endDate) { + logger.debug("fillxpenseCompanyDatatable"); + List parameters = new ArrayList<>(); + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(startDate); + calendar.add(Calendar.DAY_OF_YEAR, 1); + startDate = calendar.getTime(); + + Calendar calendarF = Calendar.getInstance(); + calendarF.setTime(endDate); + calendarF.add(Calendar.DAY_OF_YEAR, 1); + endDate = calendarF.getTime(); + + parameters.add(new ModelParameter(ExpenseCompanyCfg.FIELD_OFFICE, new Office(officeId))); + //parameters.add(new ModelParameter(ExpenseCompanyCfg.FIELD_ACTIVE_STATUS, ActiveStatus.ENEBLED)); + parameters.add(new ModelParameter(ExpenseCompanyCfg.FIELD_EXPENSE_COMPANY_TYPE, ExpenseCompanyType.PAYMENT_IN)); + parameters.add(new ModelParameter(ExpenseCompanyCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(ExpenseCompanyCfg.PARAM_END_DATE, endDate)); + + return genericEntityRepository.xmlQueryAPCEntities(ExpenseCompany.class, ExpenseCompanyCfg.QUERY_FIND_ALL_EXPENSE_COMPANY_BY_OFFICE_BETWEEN_DATES, parameters); + } + + /** + * + * Searching all expense company out by office. + * + * @param officeId + * @param startDate + * @param endDate + * @return + */ + public List fillxpenseCompanyOutDatatable(String officeId, Date startDate, Date endDate) { + logger.debug("fillxpenseCompanyOutDatatable"); + List parameters = new ArrayList<>(); + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(startDate); + calendar.add(Calendar.DAY_OF_YEAR, 1); + startDate = calendar.getTime(); + + Calendar calendarF = Calendar.getInstance(); + calendarF.setTime(endDate); + calendarF.add(Calendar.DAY_OF_YEAR, 1); + endDate = calendarF.getTime(); + + parameters.add(new ModelParameter(ExpenseCompanyCfg.FIELD_OFFICE, new Office(officeId))); + //parameters.add(new ModelParameter(ExpenseCompanyCfg.FIELD_ACTIVE_STATUS, ActiveStatus.ENEBLED)); + parameters.add(new ModelParameter(ExpenseCompanyCfg.FIELD_EXPENSE_COMPANY_TYPE, ExpenseCompanyType.PAYMENT_OUT)); + parameters.add(new ModelParameter(ExpenseCompanyCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(ExpenseCompanyCfg.PARAM_END_DATE, endDate)); + + return genericEntityRepository.xmlQueryAPCEntities(ExpenseCompany.class, ExpenseCompanyCfg.QUERY_FIND_ALL_EXPENSE_COMPANY_BY_OFFICE_BETWEEN_DATES, parameters); + } + + /** + * + * @param status + * @param expenseCompanyIdToUpdate + * @param lastUpdatedBy + * @return + */ + public boolean updateExpenseCompanyByStatus(ActiveStatus status, String expenseCompanyIdToUpdate, String lastUpdatedBy) { + logger.debug("updateExpenseCompanyByStatus"); + + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(ExpenseCompanyCfg.FIELD_ACTIVE_STATUS, status)); + parameters.add(new ModelParameter(ExpenseCompanyCfg.FIELD_LAST_UPDATED_BY, lastUpdatedBy)); + parameters.add(new ModelParameter(ExpenseCompanyCfg.FIELD_LAST_UPDATED_ON, new Date())); + parameters.add(new ModelParameter(ExpenseCompanyCfg.FIELD_ID, expenseCompanyIdToUpdate)); + + return genericEntityRepository.xmlUpdateOrDeleteAPCEntity(ExpenseCompanyCfg.QUERY_UPDATE_EXPENSE_COMPANY_BY_STATUS, parameters); + } + + /** + * + * @param expenseCompany + * @return boolean + */ + public boolean saveExpenseCompany(ExpenseCompany expenseCompany) { + logger.debug("saveExpenseCompany"); + boolean success = genericEntityRepository.insertAPCEntity(expenseCompany); + + return success; + } + + /** + * + * Searching expense by id. + * + * @param expenseId + * @return + */ + public ExpenseCompany getExpenseById(String expenseId) { + logger.debug("getExpenseById"); + + return (ExpenseCompany) genericEntityRepository.selectAPCEntityById(ExpenseCompany.class, expenseId); + } + + final Logger logger = LogManager.getLogger(ExpenseCompanyController.class); + private final GenericEntityRepository genericEntityRepository; + + public ExpenseCompanyController() { + this.genericEntityRepository = new GenericEntityRepository(); + } + +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/admin/FeesController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/FeesController.java new file mode 100644 index 0000000..a1acff2 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/FeesController.java @@ -0,0 +1,113 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.controller.admin; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.admin.constance.GoalCfg; +import com.arrebol.apc.model.enums.FeeStatus; +import com.arrebol.apc.model.views.FeesView; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import com.arrebol.apc.model.views.constance.FeesViewCfg; +import java.math.BigDecimal; +import java.util.Comparator; +import java.util.HashMap; +import java.util.Map; + +/** + * + * @author David Rodriguez + */ +public class FeesController implements Serializable { + + public List fillFeesDataTable(Date startDate, Date endDate, String idUser) { + logger.debug("fillFeesDataTable"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(GoalCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(GoalCfg.PARAM_END_DATE, endDate)); + List dataComplete = new ArrayList<>(); + + if (idUser != null && !idUser.equals("")) { + parameters.add(new ModelParameter(FeesViewCfg.FIELD_USER, idUser)); + dataComplete = genericEntityRepository.xmlQueryAPCEntities(FeesView.class, FeesViewCfg.QUERY_FIND_ALL_FEES_BETWEEN_DATES_USER, parameters); + } else { + dataComplete = genericEntityRepository.xmlQueryAPCEntities(FeesView.class, FeesViewCfg.QUERY_FIND_ALL_FEES_BETWEEN_DATES, parameters); + } + + Map mapDataFees = new HashMap<>(); + for (FeesView fee : dataComplete) { + if (mapDataFees.get(fee.getIdUser()) != null) { + mapDataFees.get(fee.getIdUser()).setTotalFees(mapDataFees.get(fee.getIdUser()).getTotalFees().add(fee.getTotalFees())); + } else { + mapDataFees.put(fee.getIdUser(), fee); + } + + if(fee.getFeeStatus() != null && fee.getFeeStatus().equals(FeeStatus.PAID)){ + mapDataFees.get(fee.getIdUser()).setTotalFeePaid(mapDataFees.get(fee.getIdUser()).getTotalFeePaid().add(fee.getTotalFees())); + } + } + dataComplete.clear(); + dataComplete.addAll(mapDataFees.values()); + return dataComplete; + } + + public List fillFeesDataTableByRoute(Date startDate, Date endDate, String idRoute) { + logger.debug("fillFeesDataTableByRoute"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(GoalCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(GoalCfg.PARAM_END_DATE, endDate)); + List dataComplete = new ArrayList<>(); + + if (idRoute != null && !idRoute.equals("")) { + parameters.add(new ModelParameter(FeesViewCfg.FIELD_ROUTE, idRoute)); + dataComplete = genericEntityRepository.xmlQueryAPCEntities(FeesView.class, FeesViewCfg.QUERY_FIND_ALL_FEES_BETWEEN_DATES_ROUTE, parameters); + } else { + dataComplete = genericEntityRepository.xmlQueryAPCEntities(FeesView.class, FeesViewCfg.QUERY_FIND_ALL_FEES_BETWEEN_DATES, parameters); + } + + Map mapDataFees = new HashMap<>(); + dataComplete.forEach((fee) -> { + if (mapDataFees.get(fee.getIdRoute()) != null) { + mapDataFees.get(fee.getIdRoute()).setTotalFees(mapDataFees.get(fee.getIdRoute()).getTotalFees().add(fee.getTotalFees())); + } else { + mapDataFees.put(fee.getIdRoute(), fee); + } + }); + dataComplete.clear(); + dataComplete.addAll(mapDataFees.values()); + + dataComplete.sort(Comparator.comparing(FeesView::getRouteName)); + return dataComplete; + } + + public BigDecimal fillTotalFees(Date startDate, Date endDate) { + logger.debug("fillFeesDataTable"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(GoalCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(GoalCfg.PARAM_END_DATE, endDate)); + List dataComplete = genericEntityRepository.xmlQueryAPCEntities(FeesView.class, FeesViewCfg.QUERY_FIND_ALL_FEES_BETWEEN_DATES, parameters); + BigDecimal totalFees = new BigDecimal("0"); + for (FeesView fee : dataComplete) { + totalFees = totalFees.add(fee.getTotalFees()); + } + return totalFees; + } + + final Logger logger = LogManager.getLogger(FeesController.class); + private final GenericEntityRepository genericEntityRepository; + + public FeesController() { + this.genericEntityRepository = new GenericEntityRepository(); + } +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/admin/GoalController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/GoalController.java new file mode 100644 index 0000000..3521b06 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/GoalController.java @@ -0,0 +1,100 @@ +/* + * 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.controller.admin; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.admin.Goal; +import com.arrebol.apc.model.admin.constance.GoalCfg; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public class GoalController implements Serializable{ + + /** + * + * Searching all goals by office. + * + * @param officeId + * @param startDate + * @param endDate + * @return + */ + public List fillGoalDatatable(String officeId, Date startDate, Date endDate) { + logger.debug("fillGoalDatatable"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(GoalCfg.FIELD_OFFICE, new Office(officeId))); + parameters.add(new ModelParameter(GoalCfg.FIELD_ACTIVE_STATUS, ActiveStatus.ENEBLED)); + parameters.add(new ModelParameter(GoalCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(GoalCfg.PARAM_END_DATE, endDate)); + + return genericEntityRepository.xmlQueryAPCEntities(Goal.class, GoalCfg.QUERY_FIND_ALL_GOALS_BY_OFFICE_BETWEEN_DATES, parameters); + } + + /** + * + * @param goal + * @return boolean + */ + public boolean saveGoal(Goal goal) { + logger.debug("saveGoal"); + boolean success = genericEntityRepository.insertAPCEntity(goal); + + return success; + + } + /** + * + * @param status + * @param goalIdToUpdate + * @param lastUpdatedBy + * @return + */ + public boolean updateGoalByStatus(ActiveStatus status, String goalIdToUpdate, String lastUpdatedBy) { + logger.debug("updateGoalByStatus"); + + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(GoalCfg.FIELD_ACTIVE_STATUS, status)); + parameters.add(new ModelParameter(GoalCfg.FIELD_LAST_UPDATED_BY, lastUpdatedBy)); + parameters.add(new ModelParameter(GoalCfg.FIELD_LAST_UPDATED_ON, new Date())); + parameters.add(new ModelParameter(GoalCfg.FIELD_ID, goalIdToUpdate)); + + return genericEntityRepository.xmlUpdateOrDeleteAPCEntity(GoalCfg.QUERY_UPDATE_GOAL_BY_STATUS, parameters); + } + + /** + * + * @param goal + * @return boolean + */ + public boolean updateByGoalId(Goal goal) { + logger.debug("updateByGoalId"); + + return genericEntityRepository.updateAPCEntity(goal); + } + + final Logger logger = LogManager.getLogger(GoalController.class); + private final GenericEntityRepository genericEntityRepository; + + public GoalController() { + this.genericEntityRepository = new GenericEntityRepository(); + } + +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/admin/LoanController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/LoanController.java new file mode 100644 index 0000000..55f89b5 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/LoanController.java @@ -0,0 +1,563 @@ +/* + * 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.controller.admin; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.catalog.People; +import com.arrebol.apc.model.catalog.RouteCtlg; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.core.constance.LoanByRenovationCfg; +import com.arrebol.apc.model.core.constance.LoanByUserCfg; +import com.arrebol.apc.model.core.constance.LoanCfg; +import com.arrebol.apc.model.core.constance.LoanDetailsCfg; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.enums.LoanRenovationStatus; +import com.arrebol.apc.model.enums.LoanStatus; +import com.arrebol.apc.model.loan.Loan; +import com.arrebol.apc.model.loan.LoanByRenovation; +import com.arrebol.apc.model.loan.LoanByUser; +import com.arrebol.apc.model.loan.LoanDetails; +import com.arrebol.apc.model.loan.LoanFeeNotification; +import com.arrebol.apc.model.views.HistoryLoanView; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public class LoanController implements Serializable { + + /** + * + * Searching all loan by status pending. + * + * @param officeId + * @return + */ + public List fillLoanByStatusPendingDatatable(String officeId) { + logger.debug("fillLoanByStatusPendingDatatable"); + List parameters = new ArrayList<>(); + + //parameters.add(new ModelParameter(LoanCfg.FIELD_CUSTOMER_OFFICE, new Office(officeId))); + return genericEntityRepository.xmlQueryAPCEntities(Loan.class, LoanCfg.QUERY_FIND_LOAN_BY_STATUS_PENDING, parameters); + } + + /** + * + * Searching all loan + * + * @return + */ + public List fillAllLoansDatatable() { + logger.debug("fillAllLoansDatatable"); + List parameters = new ArrayList<>(); + return genericEntityRepository.xmlQueryAPCEntities(Loan.class, LoanCfg.QUERY_FIND_ALL_LOANS, parameters); + } + + /** + * + * Searching all loan + * + * @return + */ + public List fillAllLoansViewDatatable() { + logger.debug("fillAllLoansViewDatatable"); + List parameters = new ArrayList<>(); + return genericEntityRepository.xmlQueryAPCEntities(HistoryLoanView.class, LoanCfg.QUERY_FIND_ALL_LOANS_VIEW, parameters); + } + + /** + * + * @param startDate + * @param endDate + * @return + */ + public List fillAllLoansViewDatatable(Date startDate, Date endDate) { + logger.debug("fillAllLoansViewDatatable from start and end date"); + try { + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(LoanCfg.PARAM_END_DATE, endDate)); + + return genericEntityRepository.xmlQueryAPCEntities(HistoryLoanView.class, LoanCfg.QUERY_FIND_ALL_LOANS_VIEW_BY_START_AND_END_DATE, parameters); + } catch (Exception e) { + logger.info("fillAllLoansViewDatatable from start and end date", e); + return new ArrayList<>(); + } + } + + /** + * + * @param startDate + * @param endDate + * @return + */ + public List fillAllLoansJuridicalViewDatatable(Date startDate, Date endDate) { + logger.debug("fillAllLoansJuridicalViewDatatable from start and end date"); + try { + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(LoanCfg.PARAM_END_DATE, endDate)); + + return genericEntityRepository.xmlQueryAPCEntities(HistoryLoanView.class, LoanCfg.QUERY_FIND_ALL_LOANS_JURIDICAL_VIEW_BY_START_AND_END_DATE, parameters); + } catch (Exception e) { + logger.info("fillAllLoansJuridicalViewDatatable from start and end date", e); + return new ArrayList<>(); + } + } + + /** + * + * Searching loan by id. + * + * @param loanId + * @return + */ + public Loan getLoanById(String loanId) { + logger.debug("getLoanById"); + + return (Loan) genericEntityRepository.selectAPCEntityById(Loan.class, loanId); + } + + /** + * + * @param status + * @param loanIdToUpdate + * @param lastUpdatedBy + * @return + */ + public boolean updateLoanByStatus(LoanStatus status, String loanIdToUpdate, String lastUpdatedBy) { + logger.debug("updateLoanByStatus"); + + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanCfg.FIELD_LOAN_STATUS, status)); + parameters.add(new ModelParameter(LoanCfg.FIELD_AMOUNT_PAID, new BigDecimal(0))); + parameters.add(new ModelParameter(LoanCfg.FIELD_LAST_REFERENCE_NUMBER, 0)); + parameters.add(new ModelParameter(LoanCfg.FIELD_LAST_UPDATED_BY, lastUpdatedBy)); + parameters.add(new ModelParameter(LoanCfg.FIELD_LAST_UPDATED_ON, new Date())); + parameters.add(new ModelParameter(LoanCfg.FIELD_ID, loanIdToUpdate)); + + return genericEntityRepository.xmlUpdateOrDeleteAPCEntity(LoanCfg.QUERY_UPDATE_LOAN_FROM_RENOVATION, parameters); + } + + /** + * + * @param status + * @param loanIdToUpdate + * @param lastUpdatedBy + * @return + */ + public boolean updateLoanByStatusWeb(LoanStatus status, String loanIdToUpdate, String lastUpdatedBy) { + logger.debug("updateLoanByStatusWeb"); + + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanCfg.FIELD_LOAN_STATUS, status)); + parameters.add(new ModelParameter(LoanCfg.FIELD_LAST_UPDATED_BY, lastUpdatedBy)); + parameters.add(new ModelParameter(LoanCfg.FIELD_LAST_UPDATED_ON, new Date())); + parameters.add(new ModelParameter(LoanCfg.FIELD_ID, loanIdToUpdate)); + + return genericEntityRepository.xmlUpdateOrDeleteAPCEntity(LoanCfg.QUERY_UPDATE_LOAN_FROM_WEB, parameters); + } + + /** + * + * Searching all loan details by id. + * + * @param loanId + * @return + */ + public List getLoanDetailsbyId(String loanId) { + logger.debug("getLoanDetailsbyId"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanCfg.FIELD_DETAILS_LOAN, new Loan(loanId))); + + return genericEntityRepository.xmlQueryAPCEntities(LoanDetails.class, LoanCfg.QUERY_FIND_LOAN_DETAILS_BY_ID, parameters); + } + + public LoanDetails getLoanDetailbyId(String loanDetailsId) { + logger.debug("getLoanDetailbyId"); + + return (LoanDetails) genericEntityRepository.selectAPCEntityById(LoanDetails.class, loanDetailsId); + } + + public boolean updateAuthorizeLoanDetailById(String loanDetailId) { + logger.debug("updateAuthorizeLoanDetailById"); + + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanDetailsCfg.FIELD_ID, loanDetailId)); + + return genericEntityRepository.xmlUpdateOrDeleteAPCEntity(LoanDetailsCfg.UPDATE_AUTHORIZE_LOAN_DETAIL, parameters); + } + + public Long countLoanDetailsAuthorize(String user) { + logger.debug("countLoanDetailsAutorize"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanDetailsCfg.FIELD_USER, user)); + return (Long) genericEntityRepository.xmlQueryAPCEntityUniqueResult(Long.class, LoanDetailsCfg.COUNT_LOAN_DETAILS_AUTHORIZE, parameters); + + } + + public boolean updateRejectLoanDetailById(String loanDetailId) { + logger.debug("updateAuthorizeLoanDetailById"); + + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanDetailsCfg.FIELD_ID, loanDetailId)); + + return genericEntityRepository.xmlUpdateOrDeleteAPCEntity(LoanDetailsCfg.UPDATE_REJECT_LOAN_DETAIL, parameters); + } + + public List fillAllTransfersLoanDetails() { + logger.debug("findAllTransfersLoanDetail"); + + return genericEntityRepository.xmlQueryAPCEntities(LoanDetails.class, LoanDetailsCfg.QUERY_FIND_ALL_TRANSFERS_LOAN_DETAIL); + } + + /** + * + * Searching all loan details by id. + * + * @param loanId + * @return + */ + public List getLoanDetailsCurdatebyIdLoan(String loanId) { + logger.debug("getLoanDetailsCurdatebyIdLoan"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanCfg.FIELD_DETAILS_LOAN, new Loan(loanId))); + + return genericEntityRepository.xmlQueryAPCEntities(LoanDetails.class, LoanCfg.QUERY_FIND_LOAN_DETAILS_CURDATE_BY_LOAN, parameters); + } + + /** + * + * @param loan + * @return boolean + */ + public boolean saveLoan(Loan loan) { + logger.debug("saveLoan"); + boolean success = genericEntityRepository.insertAPCEntity(loan); + + return success; + } + + /** + * + * @param loan + * @return boolean + */ + public boolean updateLoan(Loan loan) { + logger.debug("updateLoan"); + boolean success = genericEntityRepository.updateAPCEntity(loan); + + return success; + } + + /** + * + * @param loan + * @return boolean + */ + public boolean updateLoanByUser(LoanByUser loan) { + logger.debug("updateLoanByUser"); + boolean success = genericEntityRepository.updateAPCEntity(loan); + + return success; + } + + /** + * + * @param loan + * @return boolean + */ + public boolean saveLoanNotificationFee(LoanFeeNotification notification) { + logger.debug("saveLoanNotificationFee"); + boolean success = genericEntityRepository.insertAPCEntity(notification); + + return success; + } + + /** + * + * @param loan detail + * @return boolean + */ + public boolean saveLoanDetail(LoanDetails loan) { + logger.debug("saveLoanDetail"); + boolean success = genericEntityRepository.insertAPCEntity(loan); + + return success; + } + + /** + * + * @param loanByUser + * @return boolean + */ + public boolean saveLoanByUser(LoanByUser loanByUser) { + logger.debug("saveLoanByUser"); + boolean success = genericEntityRepository.insertAPCEntity(loanByUser); + + return success; + } + + /** + * + * @param status + * @param loanIdToUpdate + * @return + */ + public boolean updateLoanByUserByStatus(LoanStatus status, Loan loanIdToUpdate) { + logger.debug("updateLoanByUserByStatus"); + + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanByUserCfg.FIELD_LOAN_BY_USER_STATUS, status)); + parameters.add(new ModelParameter(LoanByUserCfg.FIELD_LOAN, loanIdToUpdate)); + + return genericEntityRepository.xmlUpdateOrDeleteAPCEntity(LoanByUserCfg.QUERY_UPDATE_LOAN_BY_USER_BY_LOAND_ID, parameters); + } + + /** + * + * Searching the loan by renovation by id + * + * @param loanId + * @return + */ + public LoanByRenovation getLoanByRenovationByIdLoanNew(Loan loan) { + logger.debug("getLoanByRenovationByIdLoanNew"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanByRenovationCfg.FIELD_LOAN_NEW, loan)); + + return (LoanByRenovation) genericEntityRepository.xmlQueryAPCEntityUniqueResult(LoanByRenovation.class, LoanByRenovationCfg.QUERY_FIND_LOAN_RENOVATION_BY_NEW_LOAN_ID, parameters); + } + + /** + * + * @param status + * @param loanIdToUpdate + * @param lastUpdatedBy + * @return + */ + public boolean updateLoanByRenovationByStatus(LoanRenovationStatus status, Loan loanIdToUpdate, String lastUpdatedBy) { + logger.debug("updateLoanByRenovationByStatus"); + + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanByRenovationCfg.FIELD_LOAN_RENOVATION_STATUS, status)); + parameters.add(new ModelParameter(LoanByRenovationCfg.FIELD_LOAN_NEW, loanIdToUpdate)); + parameters.add(new ModelParameter(LoanByRenovationCfg.FIELD_COMMENTS, "Se rechazĆ³ la renovaciĆ³n")); + parameters.add(new ModelParameter(LoanByRenovationCfg.FIELD_LAST_UPDATED_BY, new User(lastUpdatedBy))); + parameters.add(new ModelParameter(LoanByRenovationCfg.FIELD_LAST_UPDATED_ON, new Date())); + + return genericEntityRepository.xmlUpdateOrDeleteAPCEntity(LoanByRenovationCfg.QUERY_UPDATE_LOAN_RENOVATION_WEB, parameters); + } + + /** + * + * @param userId + * @param loanIdToUpdate + * @return + */ + public boolean updateLoandByUserByUserId(String userId, Loan loanIdToUpdate) { + logger.debug("updateLoandByUserByUserId"); + + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanByUserCfg.FIELD_USER, new User(userId))); + parameters.add(new ModelParameter(LoanByUserCfg.FIELD_LOAN, loanIdToUpdate)); + + return genericEntityRepository.xmlUpdateOrDeleteAPCEntity(LoanByUserCfg.QUERY_UPDATE_LOAN_BY_USER_BU_USER_ID, parameters); + } + + /** + * + * Searching the loan by user by id + * + * @param loan + * @return + */ + public LoanByUser getLoanByUserByIdLoan(Loan loan) { + logger.debug("getLoanByUserByIdLoan"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanByUserCfg.FIELD_LOAN, loan)); + + return (LoanByUser) genericEntityRepository.xmlQueryAPCEntityUniqueResult(LoanByUser.class, LoanByUserCfg.QUERY_FIND_LOAN_BY_USER_BY_LOAND_ID, parameters); + } + + /** + * + * @param loanByUser + * @return boolean + */ + public boolean deleteLoanByUser(LoanByUser loanByUser) { + logger.debug("deleteLoanByUser"); + boolean success = genericEntityRepository.deleteAPCEntityById(loanByUser); + + return success; + } + + /** + * + * @param loanByUser + * @return boolean + */ + public boolean deleteLoanDetails(LoanDetails loanDetail) { + logger.debug("deleteLoanDetails"); + boolean success = genericEntityRepository.deleteAPCEntityById(loanDetail); + + return success; + } + + /** + * + * @param userId + * @param loanIdToUpdate + * @return + */ + public boolean deleteLoanDetailsByLoanCurdate(Loan loanIdToUpdate) { + logger.debug("updateLoandByUserByUserId"); + + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanCfg.FIELD_DETAILS_LOAN, loanIdToUpdate)); + + return genericEntityRepository.xmlUpdateOrDeleteAPCEntity(LoanCfg.QUERY_DELETE_LOAN_DETAILS_CURDATE_BY_LOAN, parameters); + } + + /** + * + * @param route + * @param routeIdToUpdate + * @param lastUpdatedBy + * @return + */ + public boolean updateRouteById(RouteCtlg route, String routeIdToUpdate, String lastUpdatedBy) { + logger.debug("updateRouteById"); + + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanCfg.FIELD_ROUTE, route)); + parameters.add(new ModelParameter(LoanCfg.FIELD_LAST_UPDATED_BY, lastUpdatedBy)); + // parameters.add(new ModelParameter(LoanCfg.FIELD_LAST_UPDATED_ON, new Date())); + parameters.add(new ModelParameter(LoanCfg.FIELD_ID, routeIdToUpdate)); + + return genericEntityRepository.xmlUpdateOrDeleteAPCEntity(LoanCfg.QUERY_UPDATE_ROUTE_BY_ID, parameters); + } + + public boolean updatePeopleRoute(RouteCtlg route, People people) { + people.setRouteCtlg(route); + return genericEntityRepository.updateAPCEntity(people); + } + + /** + * + * Searching all loan details by id. + * + * @param loanId + * @return + */ + public List getLoanDetailsFeeCurdatebyIdLoan(String loanId) { + logger.debug("getLoanDetailsFeeCurdatebyIdLoan"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanCfg.FIELD_DETAILS_LOAN, new Loan(loanId))); + + return genericEntityRepository.xmlQueryAPCEntities(LoanDetails.class, LoanCfg.QUERY_FIND_LOAN_DETAILS_FEE_CURDATE_BY_LOAN, parameters); + } + + /** + * + * @param userId + * @param loanIdToUpdate + * @return + */ + public boolean deleteLoanDetailsFeeByLoanCurdate(Loan loanIdToUpdate) { + logger.debug("deleteLoanDetailsFeeByLoanCurdate"); + + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanCfg.FIELD_DETAILS_LOAN, loanIdToUpdate)); + + return genericEntityRepository.xmlUpdateOrDeleteAPCEntity(LoanCfg.QUERY_DELETE_LOAN_DETAILS_FEE_CURDATE_BY_LOAN, parameters); + } + + /** + * + * @param userId + * @param loanIdToUpdate + * @return + */ + public boolean deleteLoanFeeNotificationByLoanCurdate(Loan loanIdToUpdate) { + logger.debug("deleteLoanFeeNotificationByLoanCurdate"); + + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanCfg.FIELD_DETAILS_LOAN, loanIdToUpdate)); + + return genericEntityRepository.xmlUpdateOrDeleteAPCEntity(LoanCfg.QUERY_DELETE_LOAN_FEE_NOTIFICATION_CURDATE_BY_LOAN, parameters); + } + + /** + * Borra los registros de LoanFeeNotifications del prĆ©stamo que recibe + * + * @param loanIdToUpdate + * @return + */ + public boolean deleteLoanFeeNotificationByLoan(Loan loanIdToUpdate) { + logger.debug("deleteLoanFeeNotification"); + + List parameters = new ArrayList<>(); + parameters.add(new ModelParameter(LoanCfg.FIELD_DETAILS_LOAN, loanIdToUpdate)); + + return genericEntityRepository.xmlUpdateOrDeleteAPCEntity(LoanCfg.QUERY_DELETE_LOAN_FEE_NOTIFICATION_BY_LOAN, parameters); + } + + /** + * + * @param status + * @param loanIdToUpdate + * @param lastUpdatedBy + * @return + */ + public boolean updateBonusNewCustomer(ActiveStatus status, String loanIdToUpdate, String lastUpdatedBy) { + logger.debug("updateBonusNewCustomer"); + + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanCfg.FIELD_NEW_CUSTOMER, status)); + parameters.add(new ModelParameter(LoanCfg.FIELD_LAST_UPDATED_BY, lastUpdatedBy)); + parameters.add(new ModelParameter(LoanCfg.FIELD_ID, loanIdToUpdate)); + + return genericEntityRepository.xmlUpdateOrDeleteAPCEntity(LoanCfg.QUERY_UPDATE_LOAN_BONUS_NEW_CUSTOMER, parameters); + } + + final Logger logger = LogManager.getLogger(LoanController.class); + private final GenericEntityRepository genericEntityRepository; + + public LoanController() { + this.genericEntityRepository = new GenericEntityRepository(); + } +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/admin/LoanEmployeeController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/LoanEmployeeController.java new file mode 100644 index 0000000..bee5571 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/LoanEmployeeController.java @@ -0,0 +1,180 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.controller.admin; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.admin.LoanEmployee; +import com.arrebol.apc.model.admin.LoanEmployeeDetails; +import com.arrebol.apc.model.admin.constance.ExpenseCompanyCfg; +import com.arrebol.apc.model.admin.constance.GoalCfg; +import com.arrebol.apc.model.views.LoanEmployeeView; +import com.arrebol.apc.model.core.HumanResource; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.views.LoanEmployeeAllDataView; +import com.arrebol.apc.model.views.LoanEmployeeDetailAllDataView; +import com.arrebol.apc.model.views.StatsEmployeeSavingView; +import com.arrebol.apc.model.views.constance.LoanEmployeeDetailAllDataViewCfg; +import com.arrebol.apc.model.views.constance.LoanEmployeeViewCfg; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import com.arrebol.apc.model.views.constance.LoanEmployeeAllDataCfg; +import com.arrebol.apc.model.views.constance.StatsEmployeeSavingViewCfg; +import java.math.BigDecimal; + +/** + * + * @author David Rodriguez + */ +public class LoanEmployeeController implements Serializable { + + public List fillLoanEmployeeDataTable(Date startDate, Date endDate) { + logger.debug("fillLoanEmployeeDataTable"); + List parameters = new ArrayList<>(); + +// parameters.add(new ModelParameter(GoalCfg.PARAM_START_DATE, startDate)); +// parameters.add(new ModelParameter(GoalCfg.PARAM_END_DATE, endDate)); + List dataComplete = genericEntityRepository.xmlQueryAPCEntities(LoanEmployeeView.class, LoanEmployeeViewCfg.QUERY_FIND_ALL_LOAN_EMPLOYEE_HIST, parameters); + return dataComplete; + } + + public BigDecimal fillTotalAmountLoan(Date startDate, Date endDate) { + logger.debug("fillTotalAmountLoan"); + List parameters = new ArrayList<>(); + +// parameters.add(new ModelParameter(GoalCfg.PARAM_START_DATE, startDate)); +// parameters.add(new ModelParameter(GoalCfg.PARAM_END_DATE, endDate)); + List dataComplete = genericEntityRepository.xmlQueryAPCEntities(LoanEmployeeView.class, LoanEmployeeViewCfg.QUERY_FIND_ALL_LOAN_EMPLOYEE_HIST, parameters); + BigDecimal totalAmountLoan = BigDecimal.ZERO; + for (LoanEmployeeView employee : dataComplete) { + totalAmountLoan = totalAmountLoan.add(employee.getAmountLoan()); + } + return totalAmountLoan; + } + + public List getLoanEmployeeDetailByIdLoan(String idLoanEmployee) { + + logger.debug("getLoanEmployeeDetailByIdLoan"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanEmployeeDetailAllDataViewCfg.FIELD_ID_LOAN, idLoanEmployee)); + List dataComplete = genericEntityRepository.xmlQueryAPCEntities(LoanEmployeeDetailAllDataView.class, + LoanEmployeeDetailAllDataViewCfg.QUERY_FIND_ALL_LOAN_EMPLOYEE_DETAIL_BY_ID_LOAN, parameters); + + return dataComplete; + } + + public LoanEmployee getLoanEmployeeById(String idLoanEmployee) { + + logger.debug("getLoanEmployeeById"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanEmployeeAllDataCfg.FIELD_ID_LOAN, idLoanEmployee)); + List dataComplete = genericEntityRepository.xmlQueryAPCEntities(LoanEmployee.class, + LoanEmployeeAllDataCfg.QUERY_FIND_ALL_LOAN_EMPLOYEE_BY_ID, parameters); + + return dataComplete.get(0); + } + + public boolean saveLoanEmployee(LoanEmployee loan, HumanResource hr) { + logger.debug("saveLoanEmployee"); + boolean success = genericEntityRepository.insertAPCEntity(loan); + + if (hr != null) { + genericEntityRepository.updateAPCEntity(hr); + } + return success; + } + + public boolean saveLoanEmployeeDetail(LoanEmployeeDetails loanDetail, HumanResource hr, LoanEmployee loanEmployee) { + logger.debug("saveLoanEmployeeDetail"); + boolean success = genericEntityRepository.insertAPCEntity(loanDetail); + + if (hr != null) { + genericEntityRepository.updateAPCEntity(hr); + } + + if (loanEmployee != null) { + genericEntityRepository.updateAPCEntity(loanEmployee); + } + + return success; + } + + /** + * + * @param status + * @param expenseCompanyIdToUpdate + * @param lastUpdatedBy + * @return + */ + public boolean updateLoanEmployeeByStatus(ActiveStatus status, String expenseCompanyIdToUpdate, String lastUpdatedBy) { + logger.debug("updateLoanEmployeeByStatus"); + + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanEmployeeAllDataCfg.FIELD_ACTIVE_STATUS, status)); + parameters.add(new ModelParameter(ExpenseCompanyCfg.FIELD_LAST_UPDATED_BY, lastUpdatedBy)); + parameters.add(new ModelParameter(ExpenseCompanyCfg.FIELD_LAST_UPDATED_ON, new Date())); + parameters.add(new ModelParameter(LoanEmployeeAllDataCfg.FIELD_ID, expenseCompanyIdToUpdate)); + + + return genericEntityRepository.xmlUpdateOrDeleteAPCEntity(LoanEmployeeAllDataCfg.QUERY_UPDATE_LOAN_EMPLOYEE_BY_STATUS, parameters); + } + + /** + * + * @param status + * @param expenseCompanyIdToUpdate + * @param lastUpdatedBy + * @return + */ + public boolean updateLoanEmployeeDetailByStatus(String idUser, Date createdOn) { + logger.debug("updateLoanEmployeeDetailByStatus"); + + List parameters = new ArrayList<>(); + + + parameters.add(new ModelParameter(LoanEmployeeDetailAllDataViewCfg.FIELD_ID_USER, idUser )); + parameters.add(new ModelParameter(LoanEmployeeDetailAllDataViewCfg.FIELD_CREATED_ON, createdOn)); + + + return genericEntityRepository.xmlUpdateOrDeleteAPCEntity(LoanEmployeeDetailAllDataViewCfg.QUERY_UPDATE_LOAN_EMPLOYEE_DETAIL_BY_STATUS, parameters); + } + + + public List findLoanDetailToUpdate(String idUser, Date createdOn) { + logger.debug("updateLoanEmployeeDetailByStatus"); + + List parameters = new ArrayList<>(); + + + parameters.add(new ModelParameter(LoanEmployeeDetailAllDataViewCfg.FIELD_ID_USER, idUser )); + parameters.add(new ModelParameter(LoanEmployeeDetailAllDataViewCfg.FIELD_CREATED_ON, createdOn)); + + List dataComplete = genericEntityRepository.xmlQueryAPCEntities(LoanEmployeeDetails.class, LoanEmployeeDetailAllDataViewCfg.QUERY_FIND_LOAN_DETAL_TO_UPDATE, parameters); + return dataComplete; + } + + + public boolean updateLoanEmployee(LoanEmployee loanEmployee) { + logger.debug("savePayroll"); + boolean success = genericEntityRepository.updateAPCEntity(loanEmployee); + + return success; + } + + final Logger logger = LogManager.getLogger(LoanEmployeeController.class); + private final GenericEntityRepository genericEntityRepository; + + public LoanEmployeeController() { + this.genericEntityRepository = new GenericEntityRepository(); + } +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/admin/LoanRenovationDeliveryWeeklyController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/LoanRenovationDeliveryWeeklyController.java new file mode 100644 index 0000000..1269b92 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/LoanRenovationDeliveryWeeklyController.java @@ -0,0 +1,61 @@ +/* + * 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.controller.admin; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.admin.constance.AdvanceCfg; +import com.arrebol.apc.model.admin.constance.BonusCfg; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.views.LoanRenovationDeliveryWeeklyView; +import com.arrebol.apc.model.views.constance.LoanRenovationDeliveryWeeklyViewCfg; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public class LoanRenovationDeliveryWeeklyController implements Serializable { + + public List fillLoanRenovationDatatable() { + logger.debug("fillLoanRenovationDatatable"); + + return genericEntityRepository.xmlQueryAPCEntities(LoanRenovationDeliveryWeeklyView.class,LoanRenovationDeliveryWeeklyViewCfg.QUERY_FIND_LOAN_RENOVATION_DELIVERY_WEEKLY); + } + + public Long getTotalRenovation(String renovation) { + logger.debug("getTotalRenovation"); + List parameters = new ArrayList<>(); + parameters.add(new ModelParameter(LoanRenovationDeliveryWeeklyViewCfg.FIELD_RENOVATION, renovation)); + + return (Long) genericEntityRepository.xmlQueryAPCEntityUniqueResult(Long.class,LoanRenovationDeliveryWeeklyViewCfg.QUERY_FIND_LOAN_RENOVATION_TOTAL_RENOVATION,parameters); + } + + public BigDecimal getTotalRenovationAmount(String renovation) { + logger.debug("getTotalRenovation"); + List parameters = new ArrayList<>(); + parameters.add(new ModelParameter(LoanRenovationDeliveryWeeklyViewCfg.FIELD_RENOVATION, renovation)); + + return (BigDecimal) genericEntityRepository.xmlQueryAPCEntityUniqueResult(BigDecimal.class,LoanRenovationDeliveryWeeklyViewCfg.QUERY_FIND_LOAN_RENOVATION_TOTAL_RENOVATION_AMOUNT,parameters); + } + + final Logger logger = LogManager.getLogger(LoanRenovationDeliveryWeeklyController.class); + private final GenericEntityRepository genericEntityRepository; + + public LoanRenovationDeliveryWeeklyController() { + this.genericEntityRepository = new GenericEntityRepository(); + } + +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/admin/MoneyDailyController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/MoneyDailyController.java new file mode 100644 index 0000000..6cfc00f --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/MoneyDailyController.java @@ -0,0 +1,124 @@ +/* + * 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.controller.admin; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.admin.MoneyDaily; +import com.arrebol.apc.model.admin.constance.MoneyDailyCfg; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.views.MoneyDailyByUserCertifier; +import com.arrebol.apc.model.views.constance.MoneyDailyByUserCertifierViewCfg; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public class MoneyDailyController implements Serializable { + + /** + * + * Searching all money daily by office. + * + * @param officeId + * @param startDate + * @param endDate + * @param idUser + * @return + */ + public List fillMoneyDailyDatatable(String officeId, Date startDate, Date endDate, String idUser) { + logger.debug("fillMoneyDailyDatatable"); + List dataComplete = new ArrayList<>(); + List parameters = new ArrayList<>(); + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(startDate); + calendar.add(Calendar.DAY_OF_YEAR, 1); + startDate = calendar.getTime(); + + Calendar calendarF = Calendar.getInstance(); + calendarF.setTime(endDate); + calendarF.add(Calendar.DAY_OF_YEAR, 1); + endDate = calendarF.getTime(); + + parameters.add(new ModelParameter(MoneyDailyCfg.FIELD_OFFICE, new Office(officeId))); + parameters.add(new ModelParameter(MoneyDailyCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(MoneyDailyCfg.PARAM_END_DATE, endDate)); + + if (idUser != null && !idUser.equals("")) { + parameters.add(new ModelParameter(MoneyDailyCfg.FIELD_USER, new User(idUser))); + dataComplete = genericEntityRepository.xmlQueryAPCEntities(MoneyDaily.class, MoneyDailyCfg.QUERY_FIND_ALL_MONEY_DAILY_BY_OFFICE_BETWEEN_DATES_USER, parameters); + }else{ + dataComplete = genericEntityRepository.xmlQueryAPCEntities(MoneyDaily.class, MoneyDailyCfg.QUERY_FIND_ALL_MONEY_DAILY_BY_OFFICE_BETWEEN_DATES, parameters); + } + + return dataComplete; + } + + /** + * + * @param money + * @return boolean + */ + public boolean saveMoneyDaily(MoneyDaily money) { + logger.debug("saveMoneyDaily"); + boolean success = genericEntityRepository.insertAPCEntity(money); + + return success; + } + + /** + * + * @param money + * @return boolean + */ + public boolean deleteMoneyDaily(MoneyDaily money) { + logger.debug("deleteMoneyDaily"); + boolean success = genericEntityRepository.deleteAPCEntityById(money); + + return success; + } + + public List findAllAmountByUserCertifierView(String officeId) { + logger.debug("findAllAmountByUserCertifierView"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(MoneyDailyByUserCertifierViewCfg.FIELD_VIEW_OFFICE, officeId)); + + return genericEntityRepository.xmlQueryAPCEntities(MoneyDailyByUserCertifier.class, MoneyDailyByUserCertifierViewCfg.QUERY_FIND_ALL_MONEY_DAILY_BY_CERTIFIER_BY_OFFICE, parameters); + } + + /** + * + * Searching money daily by id. + * + * @param moneyDailyId + * @return + */ + public MoneyDaily getMoneyDailyById(String moneyDailyId) { + logger.debug("getMoneyDailyById"); + + return (MoneyDaily) genericEntityRepository.selectAPCEntityById(MoneyDaily.class, moneyDailyId); + } + + final Logger logger = LogManager.getLogger(MoneyDailyController.class); + private final GenericEntityRepository genericEntityRepository; + + public MoneyDailyController() { + this.genericEntityRepository = new GenericEntityRepository(); + } + +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/admin/OtherExpenseController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/OtherExpenseController.java new file mode 100644 index 0000000..7a9f92b --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/OtherExpenseController.java @@ -0,0 +1,99 @@ +/* + * 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.controller.admin; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.admin.OtherExpense; +import com.arrebol.apc.model.admin.constance.OtherExpenseCfg; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public class OtherExpenseController implements Serializable { + + /** + * + * Searching all other expenses by office. + * + * @param officeId + * @param startDate + * @param endDate + * @param idUser + * @return + */ + public List fillOtherExpenseDatatable(String officeId, Date startDate, Date endDate, String idUser) { + logger.debug("fillOtherExpenseDatatable"); + List dataComplete = new ArrayList<>(); + List parameters = new ArrayList<>(); + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(startDate); + calendar.add(Calendar.DAY_OF_YEAR, 1); + startDate = calendar.getTime(); + + Calendar calendarF = Calendar.getInstance(); + calendarF.setTime(endDate); + calendarF.add(Calendar.DAY_OF_YEAR, 1); + endDate = calendarF.getTime(); + + parameters.add(new ModelParameter(OtherExpenseCfg.FIELD_OFFICE, new Office(officeId))); + parameters.add(new ModelParameter(OtherExpenseCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(OtherExpenseCfg.PARAM_END_DATE, endDate)); + if (idUser != null && !idUser.equals("")) { + parameters.add(new ModelParameter(OtherExpenseCfg.FIELD_USER, new User(idUser))); + dataComplete = genericEntityRepository.xmlQueryAPCEntities(OtherExpense.class, OtherExpenseCfg.QUERY_FIND_ALL_OTHER_EXPENSE_BY_OFFICE_BETWEEN_DATES_USER, parameters); + } else { + dataComplete = genericEntityRepository.xmlQueryAPCEntities(OtherExpense.class, OtherExpenseCfg.QUERY_FIND_ALL_OTHER_EXPENSE_BY_OFFICE_BETWEEN_DATES, parameters); + } + + return dataComplete; + } + + /** + * + * @param otherExpense + * @return boolean + */ + public boolean saveOtherExpense(OtherExpense otherExpense) { + logger.debug("saveOtherExpense"); + boolean success = genericEntityRepository.insertAPCEntity(otherExpense); + + return success; + } + + /** + * + * @param otherExpense + * @return boolean + */ + public boolean deleteOtherExpense(OtherExpense otherExpense) { + logger.debug("deleteOtherExpense"); + boolean success = genericEntityRepository.deleteAPCEntityById(otherExpense); + + return success; + } + + final Logger logger = LogManager.getLogger(OtherExpenseController.class); + private final GenericEntityRepository genericEntityRepository; + + public OtherExpenseController() { + this.genericEntityRepository = new GenericEntityRepository(); + } + +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/admin/PayRollController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/PayRollController.java new file mode 100644 index 0000000..0c767d1 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/PayRollController.java @@ -0,0 +1,343 @@ +/* + * 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.controller.admin; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.admin.EmployeeSaving; +import com.arrebol.apc.model.admin.Goal; +import com.arrebol.apc.model.admin.LoanEmployee; +import com.arrebol.apc.model.admin.LoanEmployeeDetails; +import com.arrebol.apc.model.admin.StableGeneralBox; +import com.arrebol.apc.model.admin.constance.StableGeneralBoxCfg; +import com.arrebol.apc.model.core.HumanResource; +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.loan.Loan; +import com.arrebol.apc.model.payroll.Payroll; +import com.arrebol.apc.model.payroll.constance.PayRollCfg; +import com.arrebol.apc.model.views.LoanEmployeeView; +import com.arrebol.apc.model.views.constance.LoanEmployeeAllDataCfg; +import com.arrebol.apc.model.views.constance.LoanEmployeeViewCfg; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public class PayRollController implements Serializable { + + /** + * + * Searching all stable general box by office. + * + * @param officeId + * @param startDate + * @param endDate + * @return + */ + public List fillPayrollDatatable(String officeId, Date startDate, Date endDate) { + logger.debug("fillPayrollDatatable"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(PayRollCfg.FIELD_OFFICE, new Office(officeId))); + //parameters.add(new ModelParameter(PayRollCfg.FIELD_ACTIVE_STATUS, ActiveStatus.ENEBLED)); + parameters.add(new ModelParameter(PayRollCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(PayRollCfg.PARAM_END_DATE, endDate)); + + return genericEntityRepository.xmlQueryAPCEntities(Payroll.class, PayRollCfg.QUERY_FIND_PAYROLL_BY_OFFICE_BETWEEN_DATES, parameters); + } + + public boolean updatePayrollByStatus(ActiveStatus status, String payrollIdToUpdate, String lastUpdatedBy) { + logger.debug("updatePayrollByStatus"); + + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(PayRollCfg.FIELD_ACTIVE_STATUS, status)); + parameters.add(new ModelParameter(PayRollCfg.FIELD_LAST_UPDATED_BY, lastUpdatedBy)); + parameters.add(new ModelParameter(PayRollCfg.FIELD_LAST_UPDATED_ON, new Date())); + parameters.add(new ModelParameter(PayRollCfg.FIELD_ID, payrollIdToUpdate)); + + return genericEntityRepository.xmlUpdateOrDeleteAPCEntity(PayRollCfg.QUERY_UPDATE_PAYROLL_BY_STATUS, parameters); + } + + public List getStableGeneralBoxByDate(String officeId, Date startDate, Date endDate) { + logger.debug("fillStableGeneralBoxDatatable"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(StableGeneralBoxCfg.FIELD_OFFICE, new Office(officeId))); + parameters.add(new ModelParameter(StableGeneralBoxCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(StableGeneralBoxCfg.PARAM_END_DATE, endDate)); + + return genericEntityRepository.xmlQueryAPCEntities(StableGeneralBox.class, StableGeneralBoxCfg.QUERY_FIND_ALL_STABLE_GENERAL_BOX_BY_OFFICE_BETWEEN_DATES, parameters); + } + + /** + * + * Searching user by id. + * + * @param userId + * @return + */ + public User getUserById(String userId) { + logger.debug("getUserById"); + + return (User) genericEntityRepository.selectAPCEntityById(User.class, userId); + } + + /** + * + * Searching the advance sum by user + * + * @param humanResourceId + * @param officeId + * @param dateInit + * @param dateEnd + * @return + */ + public BigDecimal getSumAdvanceByUser(String humanResourceId, String officeId, Date dateInit, Date dateEnd) { + logger.debug("getSumAdvanceByUser"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(PayRollCfg.FIELD_ACTIVE_STATUS, ActiveStatus.ENEBLED)); + parameters.add(new ModelParameter(PayRollCfg.FIELD_OFFICE, new Office(officeId))); + parameters.add(new ModelParameter(PayRollCfg.FIELD_HUMAN_RESOURCE, new HumanResource(humanResourceId))); + parameters.add(new ModelParameter(PayRollCfg.FIELD_DATE_INIT, dateInit)); + parameters.add(new ModelParameter(PayRollCfg.FIELD_DATE_END, dateEnd)); + + return (BigDecimal) genericEntityRepository.xmlQueryAPCEntityUniqueResult(BigDecimal.class, PayRollCfg.QUERY_SUM_ALL_ADVANCE_BY_USER, parameters); + } + + /** + * + * Searching the count for new customer by loan by user + * + * @param userId + * @param dateInit + * @param dateEnd + * @return + */ + public List getTotalNewCustomerLoansByUser(String userId, Date dateInit, Date dateEnd) { + logger.debug("getTotalNewCustomerLoansByUser"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(PayRollCfg.FIELD_USER, userId)); + parameters.add(new ModelParameter(PayRollCfg.FIELD_DATE_INIT, dateInit)); + parameters.add(new ModelParameter(PayRollCfg.FIELD_DATE_END, dateEnd)); + + return genericEntityRepository.xmlQueryAPCEntities(Loan.class, PayRollCfg.QUERY_COUNT_NEW_CUSTOMER_FOR_LOANS_BY_USER, parameters); + } + + /** + * + * Searching the sum amount by loan by user + * + * @param userId + * @param dateInit + * @param dateEnd + * @return + */ + public BigDecimal getTotalLoansByUserForDates(String userId, Date dateInit, Date dateEnd) { + logger.debug("getTotalLoansByUserForDates"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(PayRollCfg.FIELD_USER, userId)); + parameters.add(new ModelParameter(PayRollCfg.FIELD_DATE_INIT, dateInit)); + parameters.add(new ModelParameter(PayRollCfg.FIELD_DATE_END, dateEnd)); + + return (BigDecimal) genericEntityRepository.xmlQueryAPCEntityUniqueResult(BigDecimal.class, PayRollCfg.QUERY_SUM_FOR_LOANS_BY_USER, parameters); + } + + /** + * + * Searching the goal by dates + * + * @param officeId + * @param dateInit + * @param dateEnd + * @return + */ + public Goal getGoalByDates(String officeId, Date dateInit, Date dateEnd) { + logger.debug("getGoalByDates"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(PayRollCfg.FIELD_OFFICE, new Office(officeId))); + parameters.add(new ModelParameter(PayRollCfg.FIELD_DATE_INIT, dateInit)); + parameters.add(new ModelParameter(PayRollCfg.FIELD_DATE_END, dateEnd)); + + return (Goal) genericEntityRepository.xmlQueryAPCEntityUniqueResult(Goal.class, PayRollCfg.QUERY_FIND_GOAL_BY_DATES, parameters); + } + + public Goal getLastGoal(String officeId) { + logger.debug("getLastGoal"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(PayRollCfg.FIELD_OFFICE, new Office(officeId))); + + return (Goal) genericEntityRepository.xmlQueryAPCEntityUniqueResult(Goal.class, PayRollCfg.QUERY_FIND_LAST_GOAL, parameters); + } + + public List getPaymentToDebtByUser(String userId) { + + logger.debug("fillLoanEmployeeDataTable"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanEmployeeViewCfg.FIEL_LOAN_EMPLOYEE_USERID, userId)); + List dataComplete = genericEntityRepository.xmlQueryAPCEntities(LoanEmployeeView.class, LoanEmployeeViewCfg.QUERY_FIND_ALL_LOAN_EMPLOYEE_BY_ID, parameters); + return dataComplete; + } + + public LoanEmployee getLoanEmployeeById(String idLoanEmployee) { + + logger.debug("getLoanEmployeeById"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanEmployeeAllDataCfg.FIELD_ID_LOAN, idLoanEmployee)); + List dataComplete = genericEntityRepository.xmlQueryAPCEntities(LoanEmployee.class, + LoanEmployeeAllDataCfg.QUERY_FIND_ALL_LOAN_EMPLOYEE_BY_ID, parameters); + + return dataComplete.get(0); + } + + public boolean saveLoanEmployeeDetail(LoanEmployeeDetails loanDetail, HumanResource hr, LoanEmployee loanEmployee) { + logger.debug("saveLoanEmployeeDetail"); + boolean success = genericEntityRepository.insertAPCEntity(loanDetail); + + if (hr != null) { + genericEntityRepository.updateAPCEntity(hr); + } + + if (loanEmployee != null) { + genericEntityRepository.updateAPCEntity(loanEmployee); + } + + return success; + } + + public boolean saveEmployeeSaving(EmployeeSaving employeeSaving, HumanResource hr) { + logger.debug("saveEmployeeSaving"); + boolean success = genericEntityRepository.insertAPCEntity(employeeSaving); + + if (hr != null) { + genericEntityRepository.updateAPCEntity(hr); + } + + return success; + } + + /** + * + * Searching the sum of loan details for type Payment by user + * + * @param userId + * @param dateInit + * @param dateEnd + * @return + */ + public BigDecimal getLoanDetailsByUserForDates(String userId, Date dateInit, Date dateEnd) { + logger.debug("getLoanDetailsByUserForDates"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(PayRollCfg.FIELD_USER, new User(userId))); + parameters.add(new ModelParameter(PayRollCfg.FIELD_DATE_INIT, dateInit)); + parameters.add(new ModelParameter(PayRollCfg.FIELD_DATE_END, dateEnd)); + + return (BigDecimal) genericEntityRepository.xmlQueryAPCEntityUniqueResult(BigDecimal.class, PayRollCfg.QUERY_SUM_LOAN_DETAILS_PAYMENT_BY_USER, parameters); + } + + /** + * + * Searching the sum of loan details for type Payment by user + * + * @param userId + * @param dateInit + * @param dateEnd + * @return + */ + public BigDecimal getFeeByUserForDates(String userId, Date dateInit, Date dateEnd) { + logger.debug("getFeeByUserForDates"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(PayRollCfg.FIELD_USER_ID, userId)); + + return (BigDecimal) genericEntityRepository.xmlQueryAPCEntityUniqueResult(BigDecimal.class, PayRollCfg.QUERY_SUM_DIFERENCES_BY_USER, parameters); + } + + /** + * + * Searching the sum of loan details for type Payment by user + * + * @param userId + * @param dateInit + * @param dateEnd + * @return + */ + public BigDecimal getDiscountByUserThisWeek(String userId) { + logger.debug("getDiscountByUserThisWeek"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(PayRollCfg.FIELD_USER, new User(userId))); + + return (BigDecimal) genericEntityRepository.xmlQueryAPCEntityUniqueResult(BigDecimal.class, PayRollCfg.QUERY_SUM_DIFERENCES_BETWEEN_CLOSING_DAY_BY_USER, parameters); + } + + /** + * + * Searching the sum of loan details for type Payment by user + * + * @param userId + * @param dateInit + * @param dateEnd + * @return + */ + public Long getTotalOpeningFeeByUser(String userId, Date dateInit, Date dateEnd) { + logger.debug("getDiscountByUserThisWeek"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(PayRollCfg.FIELD_USER, new User(userId))); + parameters.add(new ModelParameter(PayRollCfg.FIELD_DATE_INIT, dateInit)); + parameters.add(new ModelParameter(PayRollCfg.FIELD_DATE_END, dateEnd)); + + return (Long) genericEntityRepository.xmlQueryAPCEntityUniqueResult(Long.class, PayRollCfg.QUERY_SUM_OPENING_FEE_BY_USER, parameters); + } + + public BigDecimal getTotalExpectedWeekByUser(String userId) { + logger.debug("getTotalExpectedWeekByUser"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(PayRollCfg.FIELD_USER, new User(userId))); + + return (BigDecimal) genericEntityRepository.xmlQueryAPCEntityUniqueResult(BigDecimal.class, PayRollCfg.QUERY_SUM_TOTAL_EXPECTED_FOR_WEEK_BY_USER, parameters); + } + + /** + * + * @param payroll + * @return boolean + */ + public boolean savePayroll(Payroll payroll) { + logger.debug("savePayroll"); + boolean success = genericEntityRepository.insertAPCEntity(payroll); + + return success; + } + + final Logger logger = LogManager.getLogger(PayRollController.class); + private final GenericEntityRepository genericEntityRepository; + + public PayRollController() { + this.genericEntityRepository = new GenericEntityRepository(); + } +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/admin/PeopleController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/PeopleController.java new file mode 100644 index 0000000..b3c040c --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/PeopleController.java @@ -0,0 +1,133 @@ +/* + * 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.controller.admin; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.catalog.People; +import com.arrebol.apc.model.catalog.RouteCtlg; +import com.arrebol.apc.model.catalog.constance.PeopleCfg; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.enums.PeopleType; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public class PeopleController implements Serializable{ + + final Logger logger = LogManager.getLogger(PeopleController.class); + private final GenericEntityRepository genericEntityRepository; + + /** + * + * @param people + * @return boolean + */ + public boolean savePeople(People people) { + logger.debug("savePeopleController"); + boolean success = genericEntityRepository.insertAPCEntity(people); + + return success; + } + + /** + * + * @param people + * @return boolean + */ + public boolean updateByPeopleId(People people) { + logger.debug("updateByPeopleId"); + + return genericEntityRepository.updateAPCEntity(people); + } + + /** + * + * @param status + * @param peopleIdToUpdate + * @param lastUpdatedBy + * @return + */ + public boolean updatePeopleByStatus(ActiveStatus status, String peopleIdToUpdate, String lastUpdatedBy) { + logger.debug("updatePeopleByStatus"); + + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(PeopleCfg.FIELD_ACTIVE_STATUS, status)); + parameters.add(new ModelParameter(PeopleCfg.FIELD_LAST_UPDATED_BY, lastUpdatedBy)); + parameters.add(new ModelParameter(PeopleCfg.FIELD_LAST_UPDATED_ON, new Date())); + parameters.add(new ModelParameter(PeopleCfg.FIELD_ID, peopleIdToUpdate)); + + return genericEntityRepository.xmlUpdateOrDeleteAPCEntity(PeopleCfg.UPDATE_PEOPLE_BY_STATUS, parameters); + } + + /** + * + * @param type + * @param peopleIdToUpdate + * @param lastUpdatedBy + * @return + */ + public boolean updatePeopleTypeById(PeopleType type, String peopleIdToUpdate, String lastUpdatedBy) { + logger.debug("updatePeopleTypeById"); + + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(PeopleCfg.FIELD_PEOPLE_TYPE, type)); + parameters.add(new ModelParameter(PeopleCfg.FIELD_LAST_UPDATED_BY, lastUpdatedBy)); + parameters.add(new ModelParameter(PeopleCfg.FIELD_LAST_UPDATED_ON, new Date())); + parameters.add(new ModelParameter(PeopleCfg.FIELD_ID, peopleIdToUpdate)); + + return genericEntityRepository.xmlUpdateOrDeleteAPCEntity(PeopleCfg.UPDATE_PEOPLE_TYPE_BY_STATUS, parameters); + } + + /** + * + * Searching people. + * + * @param peopleId + * @return + */ + public People findPeopleById(String peopleId) { + logger.debug("findPeopleById"); + + return (People) genericEntityRepository.selectAPCEntityById(People.class, peopleId); + } + + /** + * + * @param type + * @param peopleIdToUpdate + * @param lastUpdatedBy + * @return + */ + public boolean updateRouteById(RouteCtlg route, String peopleIdToUpdate, String lastUpdatedBy) { + logger.debug("updateRouteById"); + + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(PeopleCfg.FIELD_ROUTE, route)); + parameters.add(new ModelParameter(PeopleCfg.FIELD_LAST_UPDATED_BY, lastUpdatedBy)); + parameters.add(new ModelParameter(PeopleCfg.FIELD_LAST_UPDATED_ON, new Date())); + parameters.add(new ModelParameter(PeopleCfg.FIELD_ID, peopleIdToUpdate)); + + return genericEntityRepository.xmlUpdateOrDeleteAPCEntity(PeopleCfg.UPDATE_ROUTE_BY_PEOPLE, parameters); + } + + public PeopleController() { + this.genericEntityRepository = new GenericEntityRepository(); + } + +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StableGeneralBoxController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StableGeneralBoxController.java new file mode 100644 index 0000000..61ac9e5 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StableGeneralBoxController.java @@ -0,0 +1,669 @@ +/* + * 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.controller.admin; + +import com.arrebol.apc.controller.util.ConnectionManager; +import com.arrebol.apc.controller.util.HibernateUtil; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.admin.Advance; +import com.arrebol.apc.model.admin.ClosingDay; +import com.arrebol.apc.model.admin.ExpenseCompany; +import com.arrebol.apc.model.admin.MoneyDaily; +import com.arrebol.apc.model.admin.StableGeneralBox; +import com.arrebol.apc.model.admin.constance.StableGeneralBoxCfg; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.loan.LoanDetails; +import com.arrebol.apc.model.payroll.Payroll; +import com.arrebol.apc.model.views.GeneralBoxView; +import com.arrebol.apc.model.views.ResumenTotalWeekView; +import com.arrebol.apc.model.views.constance.GeneralBoxViewCfg; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.math.BigDecimal; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.hibernate.HibernateException; +import org.hibernate.Session; +import org.hibernate.Transaction; +import org.hibernate.query.NativeQuery; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public class StableGeneralBoxController extends ConnectionManager implements Serializable { + + /** + * + * Searching all stable general box by office. + * + * @param officeId + * @param startDate + * @param endDate + * @return + */ + public List fillStableGeneralBoxDatatable(String officeId, Date startDate, Date endDate) { + logger.debug("fillStableGeneralBoxDatatable"); + List parameters = new ArrayList<>(); + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(startDate); + calendar.add(Calendar.DAY_OF_YEAR, 1); + startDate = calendar.getTime(); + + Calendar calendarF = Calendar.getInstance(); + calendarF.setTime(endDate); + calendarF.add(Calendar.DAY_OF_YEAR, 1); + endDate = calendarF.getTime(); + + parameters.add(new ModelParameter(StableGeneralBoxCfg.FIELD_OFFICE, new Office(officeId))); + //parameters.add(new ModelParameter(StableGeneralBoxCfg.FIELD_ACTIVE_STATUS, ActiveStatus.ENEBLED)); + parameters.add(new ModelParameter(StableGeneralBoxCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(StableGeneralBoxCfg.PARAM_END_DATE, endDate)); + + return genericEntityRepository.xmlQueryAPCEntities(StableGeneralBox.class, StableGeneralBoxCfg.QUERY_FIND_ALL_STABLE_GENERAL_BOX_BY_OFFICE_BETWEEN_DATES, parameters); + } + + /** + * + * @param status + * @param stableGeneralBoxIdToUpdate + * @param lastUpdatedBy + * @return + */ + public boolean updateStableGeneralBoxByStatus(ActiveStatus status, String stableGeneralBoxIdToUpdate, String lastUpdatedBy) { + logger.debug("updateStableGeneralBoxByStatus"); + + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(StableGeneralBoxCfg.FIELD_ACTIVE_STATUS, status)); + parameters.add(new ModelParameter(StableGeneralBoxCfg.FIELD_LAST_UPDATED_BY, lastUpdatedBy)); + parameters.add(new ModelParameter(StableGeneralBoxCfg.FIELD_LAST_UPDATED_ON, new Date())); + parameters.add(new ModelParameter(StableGeneralBoxCfg.FIELD_ID, stableGeneralBoxIdToUpdate)); + + return genericEntityRepository.xmlUpdateOrDeleteAPCEntity(StableGeneralBoxCfg.QUERY_UPDATE_STABLE_GENERAL_BOX_BY_STATUS, parameters); + } + + /** + * + * @param stableGeneralBox + * @return boolean + */ + public boolean saveStableGeneralBox(StableGeneralBox stableGeneralBox) { + logger.debug("saveStableGeneralBox"); + boolean success = genericEntityRepository.insertAPCEntity(stableGeneralBox); + + return success; + } + + public boolean autoSaveEntry(ExpenseCompany expense){ + logger.debug("autoSaveEntry"); + boolean success = genericEntityRepository.insertAPCEntity(expense); + + return success; + } + + /** + * + * Searching all details by general box by office. + * + * @param officeId + * @return + */ + public List findAllGeneralBox(String officeId) { + logger.debug("findAllGeneralBox"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(GeneralBoxViewCfg.FIELD_OFFICE, officeId)); + + return genericEntityRepository.xmlQueryAPCEntities(GeneralBoxView.class, GeneralBoxViewCfg.QUERY_FIND_ALL_DETAILS, parameters); + } + + /** + * + * Searching the stable general box by date and office + * + * @param createdOn + * @param officeid + * @return + */ + public Long getCountStableGeneralBoxByOfficeAndDate(Date createdOn, String officeid) { + logger.debug("getClosingDayCurdateByUserId"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(StableGeneralBoxCfg.FIELD_CREATEDON, createdOn)); + parameters.add(new ModelParameter(StableGeneralBoxCfg.FIELD_OFFICE, new Office(officeid))); + + return (Long) genericEntityRepository.xmlQueryAPCEntityUniqueResult(Long.class, StableGeneralBoxCfg.QUERY_COUNT_STABLE_GENERAL_BOX_BY_OFFICE_AND_DATE, parameters); + } + + /** + * + * Searching the stable small box by date and office + * + * @param officeid + * @return + */ + public BigDecimal getPendingByClosingDay(String officeid) { + logger.debug("getPendingByClosingDay"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(StableGeneralBoxCfg.FIELD_OFFICE_VIEW, officeid)); + + return (BigDecimal) genericEntityRepository.xmlQueryAPCEntityUniqueResult(BigDecimal.class, StableGeneralBoxCfg.QUERY_SUM_PENDING_CLOSING_BY_OFFICE, parameters); + } + + /** + * + * @param date + * @return + */ + public boolean existNextPaidStableGeneralBoxByCreatedOn(Date date) { + logger.info("existNextPaidStableGeneralBoxByCreatedOn"); + + String query = "SELECT sgb.id " + + "FROM APC_STABLE_GENERAL_BOX sgb " + + "WHERE DATE(sgb.created_on) >= DATE_ADD(DATE(:date), INTERVAL 1 DAY) " + + "AND sgb.active_status = 'ENEBLED'"; + + return genericEntityRepository.existRecordsUsingSQLQueryFindByCreatedOnField(date, query); + } + + public BigDecimal getTotalBox() { + logger.info("getTotalBox"); + BigDecimal totalBox = BigDecimal.ZERO; + Transaction transaction = null; + + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + List rows = session.createNativeQuery(queryTotalBox).getResultList(); + + transaction.commit(); + + if (rows != null) { + totalBox = (BigDecimal) rows.get(0); +// Object[] results = (Object[]) rows.get(0); +// totalBox = new BigDecimal(results[0] == null ? "0.0" : results[11].toString()); + } else { + totalBox = BigDecimal.ZERO; + } + + } catch (HibernateException e) { + logger.error("General Box - getTotalBox( )", e); + rollback(transaction); + } catch (Exception e) { + logger.error("Method getTotalBox( ) ", e); + rollback(transaction); + } + + return totalBox; + } + + final Logger logger = LogManager.getLogger(StableGeneralBoxController.class); + private final GenericEntityRepository genericEntityRepository; + + public StableGeneralBoxController() { + this.genericEntityRepository = new GenericEntityRepository(); + } + + public List getDataReport(Date fecha) { + DateFormat formatter = new SimpleDateFormat("yyyy/MM/dd"); + String dateFormat = formatter.format(fecha); + + String queryReport = generalBoxReport; + queryReport = queryReport.replace(":dateReport", dateFormat); + List rows = new ArrayList<>(); + Transaction transaction = null; + + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + //rows = session.createNativeQuery(queryReport).setParameter("dateReport", dateFormat).getResultList(); + rows = session.createNativeQuery(queryReport).getResultList(); + + transaction.commit(); + + } catch (HibernateException e) { + logger.error("Driver", e); + rollback(transaction); + } catch (Exception e) { + logger.error("Method getDataReport(" + fecha + " " + ") ", e); + rollback(transaction); + } + + return rows; + } + + public List findClosingDailyListByStableGeneralBox(Date startDate) { + logger.info("findClosingDailyListByStableGeneralBox"); + + List results = null; + Transaction transaction = null; + + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + + transaction = session.beginTransaction(); + + + + results = session.createQuery("FROM ClosingDay c WHERE c.activeStatus = 'ENEBLED' AND DATE(c.createdOn) = DATE(:fecha) ") + + .setParameter("fecha", startDate) + .getResultList(); + + transaction.commit(); + + logger.info("Closing daily detail's list " + results.size()); + } catch (HibernateException e) { + logger.error("Can not find closing daily details list", e); + rollback(transaction); + } catch (Exception e) { + logger.error("Method findDetailsFromClosingDayID()", e); + rollback(transaction); + } + return results; + } + + public List findExpenseCompanyInListByStableGeneralBox(Date startDate) { + logger.info("findExpenseCompanyInListByStableGeneralBox"); + + List results = null; + Transaction transaction = null; + + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + + transaction = session.beginTransaction(); + + + + results = session.createQuery("FROM ExpenseCompany c WHERE c.activeStatus = 'ENEBLED' AND c.expenseCompanyType = 'PAYMENT_IN' " + + "AND DATE(c.createdOn) = DATE(:fecha)") + + .setParameter("fecha", startDate) + .getResultList(); + + transaction.commit(); + + logger.info("ExpenseCompany in detail's list " + results.size()); + } catch (HibernateException e) { + logger.error("Can not find ExpenseCompany in details list", e); + rollback(transaction); + } catch (Exception e) { + logger.error("Method findExpenseCompanyInListByStableGeneralBox()", e); + rollback(transaction); + } + return results; + } + + public List findExpenseCompanyOutListByStableGeneralBox(Date startDate) { + logger.info("findExpenseCompanyOutListByStableGeneralBox"); + + List results = null; + Transaction transaction = null; + + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + + transaction = session.beginTransaction(); + + + + results = session.createQuery("FROM ExpenseCompany c WHERE c.activeStatus = 'ENEBLED' AND c.expenseCompanyType = 'PAYMENT_OUT' " + + "AND DATE(c.createdOn) = DATE(:fecha)") + + .setParameter("fecha", startDate) + .getResultList(); + + transaction.commit(); + + logger.info("ExpenseCompany out detail's list " + results.size()); + } catch (HibernateException e) { + logger.error("Can not find ExpenseCompany out details list", e); + rollback(transaction); + } catch (Exception e) { + logger.error("Method findExpenseCompanyOutListByStableGeneralBox()", e); + rollback(transaction); + } + return results; + } + + public List findPayrollListByStableGeneralBox(Date startDate) { + logger.info("findPayrollListByStableGeneralBox"); + + List results = null; + Transaction transaction = null; + + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + + transaction = session.beginTransaction(); + + + + results = session.createQuery("FROM Payroll c WHERE c.activeStatus = 'ENEBLED' " + + "AND DATE(c.createdOn) = DATE(:fecha) ") + + .setParameter("fecha", startDate) + .getResultList(); + + transaction.commit(); + + logger.info("Payroll detail's list " + results.size()); + } catch (HibernateException e) { + logger.error("Can not find Payroll details list", e); + rollback(transaction); + } catch (Exception e) { + logger.error("Method findPayrollListByStableGeneralBox()", e); + rollback(transaction); + } + return results; + } + + public List findExpenseCompanyAllListByStableGeneralBox(Date startDate) { + logger.info("findExpenseCompanyAllListByStableGeneralBox"); + + List results = null; + Transaction transaction = null; + + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + + transaction = session.beginTransaction(); + + + + results = session.createQuery("FROM ExpenseCompany c WHERE c.activeStatus = 'ENEBLED' AND c.expenseCompanyType IN ('PAYMENT_OUT', 'PAYMENT_IN') " + + "AND DATE(c.createdOn) = DATE(:fecha) ") + + .setParameter("fecha", startDate) + .getResultList(); + + transaction.commit(); + + logger.info("ExpenseCompany all detail's list " + results.size()); + } catch (HibernateException e) { + logger.error("Can not find ExpenseCompany all details list", e); + rollback(transaction); + } catch (Exception e) { + logger.error("Method findExpenseCompanyAllListByStableGeneralBox()", e); + rollback(transaction); + } + return results; + } + + public List findAdelantosListByStableGeneralBox(Date startDate) { + logger.info("findAdelantosListByStableGeneralBox"); + + List results = null; + Transaction transaction = null; + + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + + transaction = session.beginTransaction(); + + results = session.createQuery("FROM Advance c WHERE c.activeStatus = 'ENEBLED' " + + "AND DATE(c.createdOn) = DATE(:fecha) ") + + .setParameter("fecha", startDate) + .getResultList(); + + transaction.commit(); + + logger.info("Adelantos detail's list " + results.size()); + } catch (HibernateException e) { + logger.error("Can not find Adelantos details list", e); + rollback(transaction); + } catch (Exception e) { + logger.error("Method findAdelantosListByStableGeneralBox()", e); + rollback(transaction); + } + return results; + } + + public List findIniciosListByStableGeneralBox(Date startDate) { + logger.info("findIniciosListByStableGeneralBox"); + + List results = null; + Transaction transaction = null; + + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + + transaction = session.beginTransaction(); + + + + results = session.createQuery("FROM MoneyDaily c WHERE DATE(c.createdOn) = DATE(:fecha) ") + + .setParameter("fecha", startDate) + .getResultList(); + + transaction.commit(); + + logger.info("Expense detail's list " + results.size()); + } catch (HibernateException e) { + logger.error("Can not find Expense details list", e); + rollback(transaction); + } catch (Exception e) { + logger.error("Method findIniciosListByStableGeneralBox()", e); + rollback(transaction); + } + return results; + } + + public List findLoanDetailsDepositByStableGeneralBox(Date startDate) { + logger.info("findLoanDetailsDepositByStableGeneralBox"); + + List results = null; + Transaction transaction = null; + + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + + transaction = session.beginTransaction(); + + results = session.createQuery("FROM LoanDetails c WHERE DATE(c.createdOn) = DATE(:fecha) AND c.loanDetailsType = 'TRANSFER'") + + .setParameter("fecha", startDate) + .getResultList(); + + transaction.commit(); + + logger.info("Loan detail deposit list " + results.size()); + } catch (HibernateException e) { + logger.error("Can not find Sale details list", e); + rollback(transaction); + } catch (Exception e) { + logger.error("Method findLoanDetailsDepositByStableGeneralBox()", e); + rollback(transaction); + } + return results; + } + + public BigDecimal getLastStableGeneralBox(Date startDate) { + logger.info("getLastStableGeneralBox"); + + BigDecimal total = null; + Transaction transaction = null; + + DateFormat formatter = new SimpleDateFormat("yy-MM-dd"); + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + String sqlQuery = "SELECT\n" + + "(\n" + + " (CASE\n" + + " WHEN \n" + + " (SELECT COUNT(total_general_box) AS total_in_box FROM APC_STABLE_GENERAL_BOX WHERE DATE(created_on) < DATE('"+formatter.format(startDate)+"') AND active_status = 'ENEBLED' ORDER BY created_on DESC LIMIT 1) > 0\n" + + " THEN \n" + + " (SELECT IF(ISNULL(total_general_box),0,total_general_box) AS total_in_box FROM APC_STABLE_GENERAL_BOX WHERE DATE(created_on) < DATE('"+formatter.format(startDate)+"') AND active_status = 'ENEBLED' ORDER BY created_on DESC LIMIT 1)\n" + + " ELSE 0\n" + + " END)\n" + + ")AS TOTAL FROM DUAL"; + + NativeQuery nativeQuery = session.createSQLQuery(sqlQuery); + + Object totalObj = (Object) (nativeQuery.uniqueResult()); + + if (totalObj instanceof Double) { + total = BigDecimal.valueOf(((Double) totalObj)); + } else if (totalObj instanceof Float) { + total = BigDecimal.valueOf(((Float) totalObj)); + } else if (totalObj instanceof Long) { + total = BigDecimal.valueOf(((Long) totalObj)); + } else if (totalObj instanceof BigDecimal) { + total = (BigDecimal) totalObj; + } else { + total = BigDecimal.ZERO; + } + + transaction.commit(); + } catch (HibernateException e) { + logger.error("Can not load the last stable general box", e); + rollback(transaction); + } catch (Exception e) { + logger.error("Method getLastStableGeneralBox()", e); + rollback(transaction); + } + + return total; + } + + String queryTotalBox + = "SELECT \n" + + "( \n" + + " (CASE \n" + + " WHEN \n" + + " (SELECT COUNT(total_general_box) AS total_in_box FROM APC_STABLE_GENERAL_BOX WHERE DATE(created_on) < CURDATE() AND active_status = 'ENEBLED' ORDER BY created_on DESC LIMIT 1) > 0 \n" + + " THEN \n" + + " (SELECT IF(ISNULL(total_general_box),0,total_general_box) AS total_in_box FROM APC_STABLE_GENERAL_BOX WHERE DATE(created_on) < CURDATE() AND active_status = 'ENEBLED' ORDER BY created_on DESC LIMIT 1) \n" + + " ELSE 0 \n" + + " END) \n" + // + " -- Entradas\n" + + " + (SELECT IF(ISNULL(SUM(amount)),0,SUM(amount)) AS total_payment_in_today FROM APC_EXPENSE_COMPANY WHERE expense_company_type = 'PAYMENT_IN' AND DATE(created_on) > (SELECT DATE(sgb.created_on) FROM APC_STABLE_GENERAL_BOX sgb WHERE DATE(sgb.created_on) < CURDATE() AND sgb.active_status = 'ENEBLED' ORDER BY sgb.created_on DESC LIMIT 1) AND active_status = 'ENEBLED') \n" + // + " -- Salidas\n" + + " - (SELECT IF(ISNULL(SUM(amount)),0,SUM(amount)) AS total_payment_out_today FROM APC_EXPENSE_COMPANY WHERE expense_company_type = 'PAYMENT_OUT' AND DATE(created_on) > (SELECT DATE(sgb.created_on) FROM APC_STABLE_GENERAL_BOX sgb WHERE DATE(sgb.created_on) < CURDATE() AND sgb.active_status = 'ENEBLED' ORDER BY sgb.created_on DESC LIMIT 1) AND active_status = 'ENEBLED') \n" + // + " -- Inicios\n" + + " - (SELECT IF(ISNULL(SUM(amount)),0,SUM(amount)) AS payment FROM APC_MONEY_DAILY WHERE DATE(created_on) > (SELECT DATE(sgb.created_on) FROM APC_STABLE_GENERAL_BOX sgb WHERE DATE(sgb.created_on) < CURDATE() AND sgb.active_status = 'ENEBLED' ORDER BY sgb.created_on DESC LIMIT 1)) \n" + // + " -- Adelantos\n" + + " - (SELECT IF(ISNULL(SUM(amount)),0,SUM(amount)) AS total_advances_today FROM APC_ADVANCE WHERE DATE(created_on) > (SELECT DATE(sgb.created_on) FROM APC_STABLE_GENERAL_BOX sgb WHERE DATE(sgb.created_on) < CURDATE() AND sgb.active_status = 'ENEBLED' ORDER BY sgb.created_on DESC LIMIT 1) AND active_status = 'ENEBLED') \n" + // + " -- NĆ³minas\n" + + " - (SELECT IF(ISNULL(SUM(total_payment)),0,SUM(total_payment)) AS total_payroll_today FROM APC_PAYROLL WHERE DATE(created_on) > (SELECT DATE(sgb.created_on) FROM APC_STABLE_GENERAL_BOX sgb WHERE DATE(sgb.created_on) < CURDATE() AND sgb.active_status = 'ENEBLED' ORDER BY sgb.created_on DESC LIMIT 1) AND active_status = 'ENEBLED') \n" + // + " -- PrĆ©stamo empleados\n" + + " - (SELECT IF(ISNULL(SUM(amount_loan)),0,SUM(amount_loan)) AS total_loan_employee_today FROM APC_LOAN_EMPLOYEE WHERE loan_employee_status = 'ENEBLED' AND DATE(created_on) > (SELECT DATE(sgb.created_on) FROM APC_STABLE_GENERAL_BOX sgb WHERE DATE(sgb.created_on) < CURDATE() AND sgb.active_status = 'ENEBLED' ORDER BY sgb.created_on DESC LIMIT 1)) \n" + // + " -- Caja Chica\n" + + " + (SELECT IF(ISNULL(SUM(total_envelope)),0,SUM(total_envelope)) + IF(ISNULL(SUM(total_bank_note)),0,SUM(total_bank_note)) + IF(ISNULL(SUM(total_coin)),0,SUM(total_coin)) AS payment FROM APC_STABLE_SMALL_BOX WHERE active_status = 'ENEBLED' AND DATE(created_on) > (SELECT DATE(sgb.created_on) FROM APC_STABLE_GENERAL_BOX sgb WHERE DATE(sgb.created_on) < CURDATE() AND sgb.active_status = 'ENEBLED' ORDER BY sgb.created_on DESC LIMIT 1)) \n" + // + " -- DISPOSICIƓN DE AHORRO\n" + + " - (SELECT IF(ISNULL(SUM(employee_saving)),0,SUM(employee_saving)) AS payment FROM APC_EMPLOYEE_SAVING WHERE type = 'DISPOSAL' AND DATE(created_on) > (SELECT DATE(sgb.created_on) FROM APC_STABLE_GENERAL_BOX sgb WHERE DATE(sgb.created_on) < CURDATE() AND sgb.active_status = 'ENEBLED' ORDER BY sgb.created_on DESC LIMIT 1)) \n" + // + " -- ABONO A PRESTAMO FUERA DE NOMINA\n" + + " + (SELECT IF(ISNULL(SUM(payment_amount)),0,SUM(payment_amount)) AS payment FROM APC_LOAN_EMPLOYEE_DETAIL WHERE loan_employee_detail_status = 'ENEBLED' AND payroll = 'DISABLED' AND DATE(created_on) > (SELECT DATE(sgb.created_on) FROM APC_STABLE_GENERAL_BOX sgb WHERE DATE(sgb.created_on) < CURDATE() AND sgb.active_status = 'ENEBLED' ORDER BY sgb.created_on DESC LIMIT 1)) \n" + + + ")AS TOTAL FROM DUAL;"; + + String generalBoxReport + = "SELECT\n" + + "u.id,\n" + + "-- Inicios\n" + + "(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) \n" + + "FROM APC_MONEY_DAILY md\n" + + "WHERE DATE(md.money_daily_date) = DATE(':dateReport') AND md.id_office = u.id) as money_daily_today,\n" + + "-- nominas\n" + + "(SELECT IF(ISNULL(SUM(ap.total_payment)),0,SUM(ap.total_payment)) FROM APC_PAYROLL ap \n" + + "WHERE ap.id_office = u.id AND ap.active_status = 'ENEBLED' \n" + + "AND DATE(ap.created_on) = DATE(':dateReport')) as nomina_today,\n" + + "-- adelantos\n" + + "(SELECT IF(ISNULL(SUM(ap.amount)),0,SUM(ap.amount)) FROM APC_ADVANCE ap \n" + + "WHERE ap.id_office = u.id AND ap.active_status = 'ENEBLED' \n" + + "AND DATE(ap.created_on) = DATE(':dateReport')) as adelantos_today,\n" + + "-- entradas\n" + + "(SELECT IF(ISNULL(SUM(ap.amount)),0,SUM(ap.amount)) FROM APC_EXPENSE_COMPANY ap \n" + + "WHERE ap.id_office = u.id AND ap.active_status = 'ENEBLED' AND \n" + + "ap.expense_company_type = 'PAYMENT_IN'\n" + + "AND DATE(ap.created_on) = DATE(':dateReport')) as entradas_today, \n" + + "-- gastos admon\n" + + "(SELECT IF(ISNULL(SUM(ap.amount)),0,SUM(ap.amount)) FROM APC_EXPENSE_COMPANY ap \n" + + "WHERE ap.id_office = u.id AND ap.active_status = 'ENEBLED' AND \n" + + "ap.expense_company_type = 'PAYMENT_OUT'\n" + + "AND DATE(ap.created_on) = DATE(':dateReport')) as gastos_admon_today,\n" + + "-- total caja chica\n" + + "(SELECT total_small_box FROM APC_STABLE_SMALL_BOX where active_status = 'ENEBLED'\n" + + " AND DATE(created_on) = DATE(':dateReport')) total_caja_chica_today,\n" + + "(SELECT total_envelope FROM APC_STABLE_SMALL_BOX where active_status = 'ENEBLED'\n" + + " AND DATE(created_on) = DATE(':dateReport')) sobres_caja_chica_today,\n" + + "(SELECT total_bank_note FROM APC_STABLE_SMALL_BOX where active_status = 'ENEBLED'\n" + + " AND DATE(created_on) = DATE(':dateReport')) efectivo_caja_chica_today,\n" + + "(SELECT total_coin FROM APC_STABLE_SMALL_BOX where active_status = 'ENEBLED'\n" + + " AND DATE(created_on) = DATE(':dateReport')) monedas_caja_chica_today,\n" + + " (SELECT total_stable FROM APC_STABLE_SMALL_BOX where active_status = 'ENEBLED'\n" + + " AND DATE(created_on) = DATE(':dateReport')) cuadre_caja_chica_today,\n" + + " (SELECT description FROM APC_STABLE_SMALL_BOX where active_status = 'ENEBLED'\n" + + " AND DATE(created_on) = DATE(':dateReport')) descripcion_caja_chica_today,\n" + + " (SELECT total_general_box FROM APC_STABLE_GENERAL_BOX where active_status = 'ENEBLED'\n" + + " AND DATE(created_on) = DATE(':dateReport')) total_caja_general_today,\n" + + "(SELECT total_envelope FROM APC_STABLE_GENERAL_BOX where active_status = 'ENEBLED'\n" + + " AND DATE(created_on) = DATE(':dateReport')) sobres_caja_general_today,\n" + + "(SELECT total_bank_note FROM APC_STABLE_GENERAL_BOX where active_status = 'ENEBLED'\n" + + " AND DATE(created_on) = DATE(':dateReport')) efectivo_caja_general_today,\n" + + "(SELECT total_coin FROM APC_STABLE_GENERAL_BOX where active_status = 'ENEBLED'\n" + + " AND DATE(created_on) = DATE(':dateReport')) monedas_caja_general_today,\n" + + " (SELECT total_stable FROM APC_STABLE_GENERAL_BOX where active_status = 'ENEBLED'\n" + + " AND DATE(created_on) = DATE(':dateReport')) cuadre_caja_general_today,\n" + + " (SELECT description FROM APC_STABLE_GENERAL_BOX where active_status = 'ENEBLED'\n" + + " AND DATE(created_on) = DATE(':dateReport')) descripcion_caja_general_today,\n" + + " -- Cortes\n" + + "(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) \n" + + "FROM APC_CLOSING_DAY ld\n" + + "WHERE DATE(ld.created_on) = DATE(':dateReport') AND ld.active_status = 'ENEBLED' \n" + + "AND ld.id_office = u.id) as closing_day_today,\n" + + "-- Subtotal\n" + + "(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) \n" + + "FROM APC_LOAN_DETAIL ld\n" + + "INNER JOIN APC_LOAN l ON l.id = ld.id_loan \n" + + "INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id\n" + + "WHERE DATE(ld.created_on) = DATE(':dateReport') \n" + + "AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_today,\n" + + "-- comision por apertura\n" + + "(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al \n" + + " INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id \n" + + " INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id\n" + + " WHERE loan_status = 'APPROVED' \n" + + " AND DATE(al.created_on) = DATE(':dateReport')) \n" + + " as opening_fee_today,\n" + + "-- cobranza\n" + + "(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) \n" + + "FROM APC_LOAN_DETAIL ld\n" + + "INNER JOIN APC_LOAN l ON l.id = ld.id_loan \n" + + "INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id\n" + + "WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' \n" + + "AND DATE(ld.created_on) = DATE(':dateReport') \n" + + "AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_today,\n" + + "-- colocacion\n" + + "(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al \n" + + " INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id \n" + + " INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id\n" + + " WHERE loan_status = 'APPROVED' \n" + + " AND DATE(al.created_on) = DATE(':dateReport')) \n" + + " as colocation_today\n" + + "FROM APC_OFFICE u\n" + + "WHERE u.office_status = 'ENEBLED';"; + +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StableSmallBoxController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StableSmallBoxController.java new file mode 100644 index 0000000..56a657d --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StableSmallBoxController.java @@ -0,0 +1,282 @@ +/* + * 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.controller.admin; + +import com.arrebol.apc.controller.util.ConnectionManager; +import com.arrebol.apc.controller.util.HibernateUtil; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.admin.OtherExpense; +import com.arrebol.apc.model.admin.StableSmallBox; +import com.arrebol.apc.model.admin.constance.OtherExpenseCfg; +import com.arrebol.apc.model.admin.constance.StableSmallBoxCfg; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.math.BigDecimal; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.hibernate.HibernateException; +import org.hibernate.Session; +import org.hibernate.Transaction; +import org.hibernate.query.Query; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public class StableSmallBoxController extends ConnectionManager implements Serializable { + + /** + * + * Searching all stable general box by office. + * + * @param officeId + * @param startDate + * @param endDate + * @return + */ + public List fillStableSmallBoxDatatable(String officeId, Date startDate, Date endDate) { + logger.debug("fillStableSmallBoxDatatable"); + List parameters = new ArrayList<>(); + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(startDate); + calendar.add(Calendar.DAY_OF_YEAR, 1); + startDate = calendar.getTime(); + + Calendar calendarF = Calendar.getInstance(); + calendarF.setTime(endDate); + calendarF.add(Calendar.DAY_OF_YEAR, 1); + endDate = calendarF.getTime(); + + parameters.add(new ModelParameter(StableSmallBoxCfg.FIELD_OFFICE, new Office(officeId))); + //parameters.add(new ModelParameter(StableSmallBoxCfg.FIELD_ACTIVE_STATUS, ActiveStatus.ENEBLED)); + parameters.add(new ModelParameter(StableSmallBoxCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(StableSmallBoxCfg.PARAM_END_DATE, endDate)); + + return genericEntityRepository.xmlQueryAPCEntities(StableSmallBox.class, StableSmallBoxCfg.QUERY_FIND_ALL_STABLE_SMALL_BOX_BY_OFFICE_BETWEEN_DATES, parameters); + } + + /** + * + * @param status + * @param stableSmallBoxIdToUpdate + * @param lastUpdatedBy + * @return + */ + public boolean updateStableSmallBoxByStatus(ActiveStatus status, String stableSmallBoxIdToUpdate, String lastUpdatedBy) { + logger.debug("updateStableSmallBoxByStatus"); + + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(StableSmallBoxCfg.FIELD_ACTIVE_STATUS, status)); + parameters.add(new ModelParameter(StableSmallBoxCfg.FIELD_LAST_UPDATED_BY, lastUpdatedBy)); + parameters.add(new ModelParameter(StableSmallBoxCfg.FIELD_LAST_UPDATED_ON, new Date())); + parameters.add(new ModelParameter(StableSmallBoxCfg.FIELD_ID, stableSmallBoxIdToUpdate)); + + return genericEntityRepository.xmlUpdateOrDeleteAPCEntity(StableSmallBoxCfg.QUERY_UPDATE_STABLE_SMALL_BOX_BY_STATUS, parameters); + } + + /** + * + * @param stableSmallBox + * @return boolean + */ + public boolean saveStableSmallBox(StableSmallBox stableSmallBox) { + logger.debug("saveStableSmallBox"); + boolean success = genericEntityRepository.insertAPCEntity(stableSmallBox); + + return success; + } + + /** + * + * Searching the stable small box by date and office + * + * @param createdOn + * @param officeid + * @return + */ + public Long getCountStableSmallBoxByOfficeAndDate(Date createdOn, String officeid) { + logger.debug("getCountStableSmallBoxByOfficeAndDate"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(StableSmallBoxCfg.FIELD_CREATEDON, createdOn)); + parameters.add(new ModelParameter(StableSmallBoxCfg.FIELD_OFFICE, new Office(officeid))); + + return (Long) genericEntityRepository.xmlQueryAPCEntityUniqueResult(Long.class, StableSmallBoxCfg.QUERY_COUNT_STABLE_SMALL_BOX_BY_OFFICE_AND_DATE, parameters); + } + + /** + * + * Searching the stable small box by date and office + * + * @param officeid + * @return + */ + public BigDecimal getPendingByClosingDay(String officeid) { + logger.debug("getPendingByClosingDay"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(StableSmallBoxCfg.FIELD_OFFICE_VIEW, officeid)); + + return (BigDecimal) genericEntityRepository.xmlQueryAPCEntityUniqueResult(BigDecimal.class, StableSmallBoxCfg.QUERY_SUM_PENDING_CLOSING_BY_OFFICE, parameters); + } + + /** + * + * @param date + * @return + */ + public boolean existStableGeneralBoxByCreatedOn(Date date) { + logger.info("existStableGeneralBoxByCreatedOn"); + + String query = "SELECT sgb.id " + + "FROM APC_STABLE_GENERAL_BOX sgb " + + "WHERE DATE(sgb.created_on) = DATE(:date) " + + "AND sgb.active_status = 'ENEBLED'"; + + return genericEntityRepository.existRecordsUsingSQLQueryFindByCreatedOnField(date, query); + } + + /** + * + * @param date + * @return + */ + public boolean existNextPaidStableSmallBoxByCreatedOn(Date date) { + logger.info("existNextPaidStableSmallBoxByCreatedOn"); + + String query = "SELECT ssb.id " + + "FROM APC_STABLE_SMALL_BOX ssb " + + "WHERE DATE(ssb.created_on) >= DATE_ADD(DATE(:date), INTERVAL 1 DAY) " + + "AND ssb.active_status = 'ENEBLED'"; + + return genericEntityRepository.existRecordsUsingSQLQueryFindByCreatedOnField(date, query); + } + + public List getDataReport(Date fecha) { + DateFormat formatter = new SimpleDateFormat("yyyy/MM/dd"); + String dateFormat = formatter.format(fecha); + + String queryReportLocal = queryReport; + queryReportLocal = queryReportLocal.replace(":dateReport", dateFormat); + List rows = new ArrayList<>(); + Transaction transaction = null; + + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + //rows = session.createNativeQuery(queryReport).setParameter("dateReport", dateFormat).getResultList(); + rows = session.createNativeQuery(queryReportLocal).getResultList(); + + transaction.commit(); + + } catch (HibernateException e) { + logger.error("Driver", e); + rollback(transaction); + } catch (Exception e) { + logger.error("Method getDataReport(" + fecha + " " + ") ", e); + rollback(transaction); + } + + return rows; + } + + public List fillOtherExpenseDatatable(String officeId, Date startDate, Date endDate) { + logger.debug("fillOtherExpenseDatatable"); + List parameters = new ArrayList<>(); + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(startDate); + calendar.add(Calendar.DAY_OF_YEAR, 1); + startDate = calendar.getTime(); + + Calendar calendarF = Calendar.getInstance(); + calendarF.setTime(endDate); + calendarF.add(Calendar.DAY_OF_YEAR, 1); + endDate = calendarF.getTime(); + + parameters.add(new ModelParameter(OtherExpenseCfg.FIELD_OFFICE, new Office(officeId))); + parameters.add(new ModelParameter(OtherExpenseCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(OtherExpenseCfg.PARAM_END_DATE, endDate)); + + return genericEntityRepository.xmlQueryAPCEntities(OtherExpense.class, OtherExpenseCfg.QUERY_FIND_ALL_OTHER_EXPENSE_BY_OFFICE_BETWEEN_DATES, parameters); + } + + final Logger logger = LogManager.getLogger(StableSmallBoxController.class); + private final GenericEntityRepository genericEntityRepository; + + public StableSmallBoxController() { + this.genericEntityRepository = new GenericEntityRepository(); + } + + public Date getLastSmallBox(String idOffice){ + + Date rows = null; + Transaction transaction = null; + + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + Query query = session.createQuery("SELECT createdOn FROM StableSmallBox WHERE office.id = :idOffice AND activeStatus = 'ENEBLED' ORDER BY createdOn DESC"); + query.setParameter("idOffice", idOffice); + query.setMaxResults(1); + rows = (Date) query.uniqueResult(); + + + + transaction.commit(); + + } catch (HibernateException e) { + logger.error("Driver", e); + rollback(transaction); + } catch (Exception e) { + logger.error(e); + + rollback(transaction); + } + + return rows; + + } + + private String queryReport + = "SELECT\n" + + "CONCAT(hr.first_name, ' ', hr.last_name) as asesor,\n" + + "rt.route_name as ruta,\n" + + "cd.amount_expected as monto_esperado,\n" + + "cd.amount_paid as monto_reportado,\n" + + "cd.comments as comentarios,\n" + + "(SELECT total_small_box FROM APC_STABLE_SMALL_BOX WHERE active_status = 'ENEBLED' and DATE(created_on) = DATE(':dateReport')) as total_caja,\n" + + "(SELECT total_envelope FROM APC_STABLE_SMALL_BOX WHERE active_status = 'ENEBLED' and DATE(created_on) = DATE(':dateReport')) as total_sobre,\n" + + "(SELECT total_bank_note FROM APC_STABLE_SMALL_BOX WHERE active_status = 'ENEBLED' and DATE(created_on) = DATE(':dateReport')) as total_efectivo,\n" + + "(SELECT total_coin FROM APC_STABLE_SMALL_BOX WHERE active_status = 'ENEBLED' and DATE(created_on) = DATE(':dateReport')) as total_monedas,\n" + + "(SELECT total_stable FROM APC_STABLE_SMALL_BOX WHERE active_status = 'ENEBLED' and DATE(created_on) = DATE(':dateReport')) as total_cuadre,\n" + + "(SELECT description FROM APC_STABLE_SMALL_BOX WHERE active_status = 'ENEBLED' and DATE(created_on) = DATE(':dateReport')) as descripcion_cuadre\n" + + "FROM APC_CLOSING_DAY cd\n" + + "INNER JOIN APC_USER u ON cd.id_user = u.id\n" + + "INNER JOIN APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource\n" + + "INNER JOIN (\n" + + " SELECT id_human_resource, id_route, max(created_on) \n" + + " FROM APC_HUMAN_RESOURCE_HAS_ROUTE\n" + + " GROUP BY id_human_resource\n" + + ")hrr ON hr.id = hrr.id_human_resource\n" + + "INNER JOIN APC_ROUTE rt ON hrr.id_route = rt.id\n" + + "WHERE cd.active_status = 'ENEBLED' and DATE(cd.created_on) = DATE(':dateReport');"; + +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StatsAdvancesController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StatsAdvancesController.java new file mode 100644 index 0000000..3874de0 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StatsAdvancesController.java @@ -0,0 +1,100 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.controller.admin; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.admin.constance.GoalCfg; +import com.arrebol.apc.model.views.StatsAdvancesView; +import com.arrebol.apc.model.views.constance.StatsAdvancesViewCfg; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.Comparator; +import java.util.HashMap; +import java.util.Map; + +/** + * + * @author David Rodriguez + */ +public class StatsAdvancesController implements Serializable { + + public List fillAdvancesDataTable(Date startDate, Date endDate, String idRoute) { + logger.debug("fillAdvancesDataTable"); + List parameters = new ArrayList<>(); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(startDate); + calendar.add(Calendar.DAY_OF_YEAR, 1); + startDate = calendar.getTime(); + + Calendar calendarF = Calendar.getInstance(); + calendarF.setTime(endDate); + calendarF.add(Calendar.DAY_OF_YEAR, 1); + endDate = calendarF.getTime(); + + parameters.add(new ModelParameter(GoalCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(GoalCfg.PARAM_END_DATE, endDate)); + List dataComplete = new ArrayList<>(); + + if (idRoute != null && !idRoute.equals("")) { + parameters.add(new ModelParameter(StatsAdvancesViewCfg.FIELD_ROUTE, idRoute)); + dataComplete = genericEntityRepository.xmlQueryAPCEntities(StatsAdvancesView.class, StatsAdvancesViewCfg.QUERY_FIND_ALL_ADVANCES_BETWEEN_DATES_ROUTE, parameters); + } else { + dataComplete = genericEntityRepository.xmlQueryAPCEntities(StatsAdvancesView.class, StatsAdvancesViewCfg.QUERY_FIND_ALL_ADVANCES_BETWEEN_DATES, parameters); + } + + Map mapDataAdvances = new HashMap<>(); + for (StatsAdvancesView advances : dataComplete) { + if (mapDataAdvances.get(advances.getIdRoute()) != null) { + mapDataAdvances.get(advances.getIdRoute()).setTotalAdvances(mapDataAdvances.get(advances.getIdRoute()).getTotalAdvances().add(advances.getTotalAdvances())); + } else { + mapDataAdvances.put(advances.getIdRoute(), advances); + } + } + dataComplete.clear(); + dataComplete.addAll(mapDataAdvances.values()); + + dataComplete.sort(Comparator.comparing(StatsAdvancesView::getRouteName)); + return dataComplete; + } + + public BigDecimal fillTotalAdvances(Date startDate, Date endDate) { + logger.debug("fillTotalAdvances"); + List parameters = new ArrayList<>(); + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(startDate); + calendar.add(Calendar.DAY_OF_YEAR, 1); + startDate = calendar.getTime(); + + Calendar calendarF = Calendar.getInstance(); + calendarF.setTime(endDate); + calendarF.add(Calendar.DAY_OF_YEAR, 1); + endDate = calendarF.getTime(); + + parameters.add(new ModelParameter(GoalCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(GoalCfg.PARAM_END_DATE, endDate)); + List dataComplete = genericEntityRepository.xmlQueryAPCEntities(StatsAdvancesView.class, StatsAdvancesViewCfg.QUERY_FIND_ALL_ADVANCES_BETWEEN_DATES, parameters); + BigDecimal totalAdvances = new BigDecimal("0"); + for (StatsAdvancesView advances : dataComplete) { + totalAdvances = totalAdvances.add(advances.getTotalAdvances()); + } + return totalAdvances; + } + + final Logger logger = LogManager.getLogger(StatsAdvancesController.class); + private final GenericEntityRepository genericEntityRepository; + + public StatsAdvancesController() { + this.genericEntityRepository = new GenericEntityRepository(); + } +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StatsClosingDayController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StatsClosingDayController.java new file mode 100644 index 0000000..c7a06a3 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StatsClosingDayController.java @@ -0,0 +1,102 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.controller.admin; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.admin.constance.GoalCfg; +import com.arrebol.apc.model.views.StatsClosingDayView; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import com.arrebol.apc.model.views.constance.StatsClosingDayViewCfg; +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.Comparator; +import java.util.HashMap; +import java.util.Map; + +/** + * + * @author David Rodriguez + */ +public class StatsClosingDayController implements Serializable { + + public List fillClosingDayDataTable(Date startDate, Date endDate, String idUser) { + logger.debug("fillClosingDayDataTable"); + List parameters = new ArrayList<>(); + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(startDate); + calendar.add(Calendar.DAY_OF_YEAR, 1); + startDate = calendar.getTime(); + + Calendar calendarF = Calendar.getInstance(); + calendarF.setTime(endDate); + calendarF.add(Calendar.DAY_OF_YEAR, 1); + endDate = calendarF.getTime(); + + parameters.add(new ModelParameter(GoalCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(GoalCfg.PARAM_END_DATE, endDate)); + List dataComplete = new ArrayList<>(); + + if (idUser != null && !idUser.equals("")) { + parameters.add(new ModelParameter(StatsClosingDayViewCfg.FIELD_USER, idUser)); + dataComplete = genericEntityRepository.xmlQueryAPCEntities(StatsClosingDayView.class, StatsClosingDayViewCfg.QUERY_FIND_ALL_CLOSING_DAY_BETWEEN_DATES_USER, parameters); + } else { + dataComplete = genericEntityRepository.xmlQueryAPCEntities(StatsClosingDayView.class, StatsClosingDayViewCfg.QUERY_FIND_ALL_CLOSING_DAY_BETWEEN_DATES, parameters); + } + + Map mapDataClosingDay = new HashMap<>(); + for (StatsClosingDayView closingDay : dataComplete) { + if (mapDataClosingDay.get(closingDay.getIdUser()) != null) { + mapDataClosingDay.get(closingDay.getIdUser()).setTotalClosingDay( + mapDataClosingDay.get(closingDay.getIdUser()).getTotalClosingDay().add(closingDay.getTotalClosingDay())); + } else { + mapDataClosingDay.put(closingDay.getIdUser(), closingDay); + } + } + dataComplete.clear(); + dataComplete.addAll(mapDataClosingDay.values()); + + dataComplete.sort(Comparator.comparing(StatsClosingDayView::getRouteName)); + return dataComplete; + } + + public BigDecimal fillTotalClosingDay(Date startDate, Date endDate) { + logger.debug("fillTotalClosingDay"); + List parameters = new ArrayList<>(); + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(startDate); + calendar.add(Calendar.DAY_OF_YEAR, 1); + startDate = calendar.getTime(); + + Calendar calendarF = Calendar.getInstance(); + calendarF.setTime(endDate); + calendarF.add(Calendar.DAY_OF_YEAR, 1); + endDate = calendarF.getTime(); + + parameters.add(new ModelParameter(GoalCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(GoalCfg.PARAM_END_DATE, endDate)); + List dataComplete = genericEntityRepository.xmlQueryAPCEntities(StatsClosingDayView.class, StatsClosingDayViewCfg.QUERY_FIND_ALL_CLOSING_DAY_BETWEEN_DATES, parameters); + BigDecimal totalClosingDay = new BigDecimal("0"); + for (StatsClosingDayView closingDay : dataComplete) { + totalClosingDay = totalClosingDay.add(closingDay.getTotalClosingDay()); + } + return totalClosingDay; + } + + final Logger logger = LogManager.getLogger(StatsClosingDayController.class); + private final GenericEntityRepository genericEntityRepository; + + public StatsClosingDayController() { + this.genericEntityRepository = new GenericEntityRepository(); + } +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StatsDepositsController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StatsDepositsController.java new file mode 100644 index 0000000..58d9905 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StatsDepositsController.java @@ -0,0 +1,105 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.controller.admin; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.admin.constance.GoalCfg; +import com.arrebol.apc.model.views.StatsDepositsView; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import com.arrebol.apc.model.views.constance.StatsDepositsViewCfg; +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.Comparator; +import java.util.HashMap; +import java.util.Map; + +/** + * + * @author David Rodriguez + */ +public class StatsDepositsController implements Serializable { + + public List fillDepositsDataTable(Date startDate, Date endDate, String idUser) { + logger.debug("fillDepositsDataTable"); + List parameters = new ArrayList<>(); + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(startDate); + calendar.add(Calendar.DAY_OF_YEAR, 1); + startDate = calendar.getTime(); + + Calendar calendarF = Calendar.getInstance(); + calendarF.setTime(endDate); + calendarF.add(Calendar.DAY_OF_YEAR, 1); + endDate = calendarF.getTime(); + + parameters.add(new ModelParameter(GoalCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(GoalCfg.PARAM_END_DATE, endDate)); + List dataComplete = new ArrayList<>(); + + if (idUser != null && !idUser.equals("")) { + parameters.add(new ModelParameter(StatsDepositsViewCfg.FIELD_USER, idUser)); + dataComplete = genericEntityRepository.xmlQueryAPCEntities(StatsDepositsView.class, StatsDepositsViewCfg.QUERY_FIND_ALL_DEPOSITS_BETWEEN_DATES_USER, parameters); + } else { + dataComplete = genericEntityRepository.xmlQueryAPCEntities(StatsDepositsView.class, StatsDepositsViewCfg.QUERY_FIND_ALL_DEPOSITS_BETWEEN_DATES, parameters); + } + + Map mapDataDeposits = new HashMap<>(); + /* + for (StatsDepositsView deposits : dataComplete) { + if (mapDataDeposits.get(deposits.getIdUser()) != null) { + if(!mapDataDeposits.get(deposits.getIdUser()).getRouteName().contains(deposits.getRouteName())){ + mapDataDeposits.get(deposits.getIdUser()).setRouteName(mapDataDeposits.get(deposits.getIdUser()).getRouteName() + ", " + deposits.getRouteName()); + } + + mapDataDeposits.get(deposits.getIdUser()).setTotalDeposits( + mapDataDeposits.get(deposits.getIdUser()).getTotalDeposits().add(deposits.getTotalDeposits())); + } else { + mapDataDeposits.put(deposits.getIdUser(), deposits); + } + } + */ + dataComplete.sort(Comparator.comparing(StatsDepositsView::getRouteName)); + return dataComplete; + } + + public BigDecimal fillTotalDeposits(Date startDate, Date endDate) { + logger.debug("fillTotalDeposits"); + List parameters = new ArrayList<>(); + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(startDate); + calendar.add(Calendar.DAY_OF_YEAR, 1); + startDate = calendar.getTime(); + + Calendar calendarF = Calendar.getInstance(); + calendarF.setTime(endDate); + calendarF.add(Calendar.DAY_OF_YEAR, 1); + endDate = calendarF.getTime(); + + parameters.add(new ModelParameter(GoalCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(GoalCfg.PARAM_END_DATE, endDate)); + List dataComplete = genericEntityRepository.xmlQueryAPCEntities(StatsDepositsView.class, StatsDepositsViewCfg.QUERY_FIND_ALL_DEPOSITS_BETWEEN_DATES, parameters); + BigDecimal totalDeposits = new BigDecimal("0"); + for (StatsDepositsView deposits : dataComplete) { + totalDeposits = totalDeposits.add(deposits.getTotalDeposits()); + } + return totalDeposits; + } + + final Logger logger = LogManager.getLogger(StatsDepositsController.class); + private final GenericEntityRepository genericEntityRepository; + + public StatsDepositsController() { + this.genericEntityRepository = new GenericEntityRepository(); + } +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StatsEmployeeSavingController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StatsEmployeeSavingController.java new file mode 100644 index 0000000..d5a6345 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StatsEmployeeSavingController.java @@ -0,0 +1,155 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.controller.admin; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.admin.EmployeeSaving; +import com.arrebol.apc.model.admin.constance.GoalCfg; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.enums.EmployeeSavingType; +import com.arrebol.apc.model.views.StatsEmployeeSavingView; +import com.arrebol.apc.model.views.constance.StatsEmployeeSavingViewCfg; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.HashMap; +import java.util.Map; + +/** + * + * @author David Rodriguez + */ +public class StatsEmployeeSavingController implements Serializable { + public List fillEmployeeSavingDataTable (Date startDate, Date endDate) { + logger.debug("fillEmployeeSavingDataTable"); + List parameters = new ArrayList<>(); + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(startDate); + calendar.add(Calendar.DAY_OF_YEAR, 1); + startDate = calendar.getTime(); + + Calendar calendarF = Calendar.getInstance(); + calendarF.setTime(endDate); + calendarF.add(Calendar.DAY_OF_YEAR, 1); + endDate = calendarF.getTime(); + + parameters.add(new ModelParameter(GoalCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(GoalCfg.PARAM_END_DATE, endDate)); + List dataComplete = genericEntityRepository.xmlQueryAPCEntities(StatsEmployeeSavingView.class, StatsEmployeeSavingViewCfg.QUERY_FIND_ALL_EMPLOYEE_SAVING_BETWEEN_DATES, parameters); + Map mapDataEmployeeSaving = new HashMap<>(); + for (StatsEmployeeSavingView employeeSaving : dataComplete) { + if (mapDataEmployeeSaving.get(employeeSaving.getIdUser()) != null) { + if (employeeSaving.getType().equals(EmployeeSavingType.SAVING)) { + mapDataEmployeeSaving.get(employeeSaving.getIdUser()).setEmployeeSaving( + mapDataEmployeeSaving.get(employeeSaving.getIdUser()).getEmployeeSaving().add(employeeSaving.getEmployeeSaving())); + }else{ + mapDataEmployeeSaving.get(employeeSaving.getIdUser()).setEmployeeSaving( + mapDataEmployeeSaving.get(employeeSaving.getIdUser()).getEmployeeSaving().subtract(employeeSaving.getEmployeeSaving())); + } + } else { + if (employeeSaving.getType().equals(EmployeeSavingType.SAVING)) { + employeeSaving.setEmployeeSaving(employeeSaving.getEmployeeSaving()); + }else{ + employeeSaving.setEmployeeSaving(employeeSaving.getEmployeeSaving().negate()); + } + mapDataEmployeeSaving.put(employeeSaving.getIdUser(), employeeSaving); + } + } + + dataComplete.clear(); + dataComplete.addAll(mapDataEmployeeSaving.values()); + + // Asigna todas las rutas al usuario + // dataComplete.forEach(d -> d.setRouteName(mapDataEmployeeSaving.get(d.getIdUser()).getRouteName())); + + return dataComplete; + } + + public List getEmployeeSavingById (Date startDate, Date endDate, String idUser) { + logger.debug("getEmployeeSavingById"); + List parameters = new ArrayList<>(); + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(startDate); + calendar.add(Calendar.DAY_OF_YEAR, 1); + startDate = calendar.getTime(); + + Calendar calendarF = Calendar.getInstance(); + calendarF.setTime(endDate); + calendarF.add(Calendar.DAY_OF_YEAR, 1); + endDate = calendarF.getTime(); + + parameters.add(new ModelParameter(GoalCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(GoalCfg.PARAM_END_DATE, endDate)); + parameters.add(new ModelParameter(StatsEmployeeSavingViewCfg.USER_ID, idUser)); + List dataComplete = genericEntityRepository.xmlQueryAPCEntities(StatsEmployeeSavingView.class, StatsEmployeeSavingViewCfg.QUERY_FIND_ALL_EMPLOYEE_SAVING_BY_ID_BETWEEN_DATES, parameters); + + return dataComplete; + + } + + public BigDecimal fillTotalEmployeeSaving(Date startDate, Date endDate) { + logger.debug("fillTotalEmployeeSaving"); + List parameters = new ArrayList<>(); + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(startDate); + calendar.add(Calendar.DAY_OF_YEAR, 1); + startDate = calendar.getTime(); + + Calendar calendarF = Calendar.getInstance(); + calendarF.setTime(endDate); + calendarF.add(Calendar.DAY_OF_YEAR, 1); + endDate = calendarF.getTime(); + + parameters.add(new ModelParameter(GoalCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(GoalCfg.PARAM_END_DATE, endDate)); + List dataComplete = genericEntityRepository.xmlQueryAPCEntities(StatsEmployeeSavingView.class, StatsEmployeeSavingViewCfg.QUERY_FIND_ALL_EMPLOYEE_SAVING_BETWEEN_DATES, parameters); + BigDecimal totalEmployeeSaving = BigDecimal.ZERO; + for (StatsEmployeeSavingView employeeSaving : dataComplete) { + if (employeeSaving.getType().equals(EmployeeSavingType.SAVING)) { + totalEmployeeSaving = totalEmployeeSaving.add(employeeSaving.getEmployeeSaving()); + }else{ + totalEmployeeSaving = totalEmployeeSaving.subtract(employeeSaving.getEmployeeSaving()); + } + } + return totalEmployeeSaving; + } + + public boolean saveEmployeeSaving(EmployeeSaving employeeSaving) { + logger.debug("saveEmployeeSaving"); + boolean success = genericEntityRepository.insertAPCEntity(employeeSaving); + + return success; + } + + /** + * + * Searching user by id. + * + * @param userId + * @return + */ + public User getUserById(String userId) { + logger.debug("getUserById"); + + return (User) genericEntityRepository.selectAPCEntityById(User.class, userId); + } + + final Logger logger = LogManager.getLogger(StatsEmployeeSavingController.class); + private final GenericEntityRepository genericEntityRepository; + + public StatsEmployeeSavingController() { + this.genericEntityRepository = new GenericEntityRepository(); + } +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StatsGasolineController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StatsGasolineController.java new file mode 100644 index 0000000..dbfbfa3 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StatsGasolineController.java @@ -0,0 +1,81 @@ +/* + * 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.controller.admin; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.admin.constance.GoalCfg; +import com.arrebol.apc.model.views.StatsGasolineView; +import com.arrebol.apc.model.views.constance.StatsGasolineViewCfg; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public class StatsGasolineController implements Serializable { + + public List fillGasolineDataTable(Date startDate, Date endDate) { + logger.debug("fillGasolineDataTable"); + List parameters = new ArrayList<>(); + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(startDate); + calendar.add(Calendar.DAY_OF_YEAR, 1); + startDate = calendar.getTime(); + + Calendar calendarF = Calendar.getInstance(); + calendarF.setTime(endDate); + calendarF.add(Calendar.DAY_OF_YEAR, 1); + endDate = calendarF.getTime(); + + parameters.add(new ModelParameter(GoalCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(GoalCfg.PARAM_END_DATE, endDate)); + List dataComplete = genericEntityRepository.xmlQueryAPCEntities(StatsGasolineView.class, StatsGasolineViewCfg.QUERY_FIND_ALL_GASOLINE_BETWEEN_DATES, parameters); + + return dataComplete; + } + + public Double fillTotalGasoline(Date startDate, Date endDate) { + logger.debug("fillTotalGasoline"); + List parameters = new ArrayList<>(); + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(startDate); + calendar.add(Calendar.DAY_OF_YEAR, 1); + startDate = calendar.getTime(); + + Calendar calendarF = Calendar.getInstance(); + calendarF.setTime(endDate); + calendarF.add(Calendar.DAY_OF_YEAR, 1); + endDate = calendarF.getTime(); + + parameters.add(new ModelParameter(GoalCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(GoalCfg.PARAM_END_DATE, endDate)); + List dataComplete = genericEntityRepository.xmlQueryAPCEntities(StatsGasolineView.class, StatsGasolineViewCfg.QUERY_FIND_ALL_GASOLINE_BETWEEN_DATES, parameters); + Double totalGasoline = 0.0; + for (StatsGasolineView gasoline : dataComplete) { + totalGasoline = totalGasoline + gasoline.getTotalGasoline(); + } + return totalGasoline; + } + + final Logger logger = LogManager.getLogger(StatsAdvancesController.class); + private final GenericEntityRepository genericEntityRepository; + + public StatsGasolineController() { + this.genericEntityRepository = new GenericEntityRepository(); + } + +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StatsOpeningFeesController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StatsOpeningFeesController.java new file mode 100644 index 0000000..66191b0 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StatsOpeningFeesController.java @@ -0,0 +1,107 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.controller.admin; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.admin.constance.GoalCfg; +import com.arrebol.apc.model.views.StatsOpeningFeesView; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import com.arrebol.apc.model.views.constance.StatsOpeningFeesViewCfg; +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.Map; + +/** + * + * @author David Rodriguez + */ +public class StatsOpeningFeesController implements Serializable { + + public List fillOpeningFeesDataTable(Date startDate, Date endDate, String idUser) { + logger.debug("fillOpeningFeesDataTable"); + List parameters = new ArrayList<>(); + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(startDate); + calendar.add(Calendar.DAY_OF_YEAR, 1); + startDate = calendar.getTime(); + + Calendar calendarF = Calendar.getInstance(); + calendarF.setTime(endDate); + calendarF.add(Calendar.DAY_OF_YEAR, 1); + endDate = calendarF.getTime(); + + parameters.add(new ModelParameter(GoalCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(GoalCfg.PARAM_END_DATE, endDate)); + List dataComplete = new ArrayList<>(); + + if (idUser != null && !idUser.equals("")) { + parameters.add(new ModelParameter(StatsOpeningFeesViewCfg.FIELD_USER, idUser)); + dataComplete = genericEntityRepository.xmlQueryAPCEntities(StatsOpeningFeesView.class, StatsOpeningFeesViewCfg.QUERY_FIND_ALL_OPENING_FEES_BETWEEN_DATES_USER, parameters); + } else { + dataComplete = genericEntityRepository.xmlQueryAPCEntities(StatsOpeningFeesView.class, StatsOpeningFeesViewCfg.QUERY_FIND_ALL_OPENING_FEES_BETWEEN_DATES, parameters); + } + + Map mapDataOpeningFees = new HashMap<>(); + for (StatsOpeningFeesView openingFee : dataComplete) { + if (mapDataOpeningFees.get(openingFee.getIdUser()) != null) { + if(!mapDataOpeningFees.get(openingFee.getIdUser()).getRouteName().contains(openingFee.getRouteName())){ + mapDataOpeningFees.get(openingFee.getIdUser()).setRouteName(mapDataOpeningFees.get(openingFee.getIdUser()).getRouteName() + ", " + openingFee.getRouteName()); + } + + mapDataOpeningFees.get(openingFee.getIdUser()).setTotaltotalOpeningFees( + mapDataOpeningFees.get(openingFee.getIdUser()).getTotalOpeningFees().add(openingFee.getTotalOpeningFees())); + } else { + mapDataOpeningFees.put(openingFee.getIdUser(), openingFee); + } + } + dataComplete.clear(); + dataComplete.addAll(mapDataOpeningFees.values()); + + dataComplete.sort(Comparator.comparing(StatsOpeningFeesView::getRouteName)); + return dataComplete; + } + + public BigDecimal fillTotalOpeningFees(Date startDate, Date endDate) { + logger.debug("fillTotalOpeningFees"); + List parameters = new ArrayList<>(); + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(startDate); + calendar.add(Calendar.DAY_OF_YEAR, 1); + startDate = calendar.getTime(); + + Calendar calendarF = Calendar.getInstance(); + calendarF.setTime(endDate); + calendarF.add(Calendar.DAY_OF_YEAR, 1); + endDate = calendarF.getTime(); + + parameters.add(new ModelParameter(GoalCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(GoalCfg.PARAM_END_DATE, endDate)); + List dataComplete = genericEntityRepository.xmlQueryAPCEntities(StatsOpeningFeesView.class, StatsOpeningFeesViewCfg.QUERY_FIND_ALL_OPENING_FEES_BETWEEN_DATES, parameters); + BigDecimal totalOpeningFees = new BigDecimal("0"); + for (StatsOpeningFeesView openingFee : dataComplete) { + totalOpeningFees = totalOpeningFees.add(openingFee.getTotalOpeningFees()); + } + return totalOpeningFees; + } + + final Logger logger = LogManager.getLogger(StatsOpeningFeesController.class); + private final GenericEntityRepository genericEntityRepository; + + public StatsOpeningFeesController() { + this.genericEntityRepository = new GenericEntityRepository(); + } +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StatsPaymentController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StatsPaymentController.java new file mode 100644 index 0000000..abb091e --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StatsPaymentController.java @@ -0,0 +1,117 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.controller.admin; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.admin.constance.GoalCfg; +import com.arrebol.apc.model.views.StatsPaymentView; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import com.arrebol.apc.model.views.constance.StatsPaymentViewCfg; +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.Comparator; +import java.util.HashMap; +import java.util.Map; + +/** + * + * @author David Rodriguez + */ +public class StatsPaymentController implements Serializable { + + public List fillPaymentDataTable(Date startDate, Date endDate, String idUser) { + logger.debug("fillPaymentDataTable"); + List parameters = new ArrayList<>(); + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(startDate); + calendar.add(Calendar.DAY_OF_YEAR, 1); + startDate = calendar.getTime(); + + Calendar calendarF = Calendar.getInstance(); + calendarF.setTime(endDate); + calendarF.add(Calendar.DAY_OF_YEAR, 1); + endDate = calendarF.getTime(); + + parameters.add(new ModelParameter(GoalCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(GoalCfg.PARAM_END_DATE, endDate)); + List dataComplete = new ArrayList<>(); + + if (idUser != null && !idUser.equals("")) { + parameters.add(new ModelParameter(StatsPaymentViewCfg.FIELD_USER, idUser)); + dataComplete = genericEntityRepository.xmlQueryAPCEntities(StatsPaymentView.class, StatsPaymentViewCfg.QUERY_FIND_ALL_PAYMENT_BETWEEN_DATES_USER, parameters); + } else { + dataComplete = genericEntityRepository.xmlQueryAPCEntities(StatsPaymentView.class, StatsPaymentViewCfg.QUERY_FIND_ALL_PAYMENT_BETWEEN_DATES, parameters); + } + + Map mapDataPayment = new HashMap<>(); + List listLoanTypeSum = new ArrayList<>(); + + for (StatsPaymentView payment : dataComplete) { + if (mapDataPayment.get(payment.getIdUser()) != null) { + mapDataPayment.get(payment.getIdUser()).setTotalPayment( + mapDataPayment.get(payment.getIdUser()).getTotalPayment().add(payment.getTotalPayment())); + if(!listLoanTypeSum.contains(payment.getIdLoan())){ + listLoanTypeSum.add(payment.getIdLoan()); + mapDataPayment.get(payment.getIdUser()).setTotalPayment( + mapDataPayment.get(payment.getIdUser()).getTotalPayment().add(payment.getOpeningFee())); + } + } else { + payment.setTotalPayment(payment.getTotalPayment().add(payment.getOpeningFee())); + mapDataPayment.put(payment.getIdUser(), payment); + listLoanTypeSum.add(payment.getIdLoan()); + + } + } + dataComplete.clear(); + dataComplete.addAll(mapDataPayment.values()); + + dataComplete.sort(Comparator.comparing(StatsPaymentView::getRouteName)); + return dataComplete; + } + + public BigDecimal fillTotalPayment(Date startDate, Date endDate) { + logger.debug("fillTotalPayment"); + List parameters = new ArrayList<>(); + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(startDate); + calendar.add(Calendar.DAY_OF_YEAR, 1); + startDate = calendar.getTime(); + + Calendar calendarF = Calendar.getInstance(); + calendarF.setTime(endDate); + calendarF.add(Calendar.DAY_OF_YEAR, 1); + endDate = calendarF.getTime(); + + parameters.add(new ModelParameter(GoalCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(GoalCfg.PARAM_END_DATE, endDate)); + List dataComplete = genericEntityRepository.xmlQueryAPCEntities(StatsPaymentView.class, StatsPaymentViewCfg.QUERY_FIND_ALL_PAYMENT_BETWEEN_DATES, parameters); + List listLoanTypeSum = new ArrayList<>(); + BigDecimal totalPayment = new BigDecimal("0"); + for (StatsPaymentView payment : dataComplete) { + totalPayment = totalPayment.add(payment.getTotalPayment()); + if(!listLoanTypeSum.contains(payment.getIdLoan())){ + listLoanTypeSum.add(payment.getIdLoan()); + totalPayment = totalPayment.add(payment.getOpeningFee()); + } + } + return totalPayment; + } + + final Logger logger = LogManager.getLogger(StatsPaymentController.class); + private final GenericEntityRepository genericEntityRepository; + + public StatsPaymentController() { + this.genericEntityRepository = new GenericEntityRepository(); + } +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StatsPaymentRenovationController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StatsPaymentRenovationController.java new file mode 100644 index 0000000..8bb700b --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StatsPaymentRenovationController.java @@ -0,0 +1,86 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.controller.admin; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.admin.constance.GoalCfg; +import com.arrebol.apc.model.views.StatsPaymentRenovationView; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import com.arrebol.apc.model.views.constance.StatsPaymentRenovationViewCfg; +import java.math.BigDecimal; +import java.util.Calendar; + +/** + * + * @author David Rodriguez + */ +public class StatsPaymentRenovationController implements Serializable { + + public List fillPaymentDataTable(Date startDate, Date endDate, String idUser) { + logger.debug("fillPaymentDataTable"); + List parameters = new ArrayList<>(); + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(startDate); + calendar.add(Calendar.DAY_OF_YEAR, 1); + startDate = calendar.getTime(); + + Calendar calendarF = Calendar.getInstance(); + calendarF.setTime(endDate); + calendarF.add(Calendar.DAY_OF_YEAR, 1); + endDate = calendarF.getTime(); + + parameters.add(new ModelParameter(GoalCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(GoalCfg.PARAM_END_DATE, endDate)); + List dataComplete = new ArrayList<>(); + + if (idUser != null && !idUser.equals("")) { + parameters.add(new ModelParameter(StatsPaymentRenovationViewCfg.FIELD_USER, idUser)); + dataComplete = genericEntityRepository.xmlQueryAPCEntities(StatsPaymentRenovationView.class, StatsPaymentRenovationViewCfg.QUERY_FIND_ALL_PAYMENT_RENOVATION_BETWEEN_DATES_USER, parameters); + } else { + dataComplete = genericEntityRepository.xmlQueryAPCEntities(StatsPaymentRenovationView.class, StatsPaymentRenovationViewCfg.QUERY_FIND_ALL_PAYMENT_RENOVATION_BETWEEN_DATES, parameters); + } + + return dataComplete; + } + + public BigDecimal fillTotalPayment(Date startDate, Date endDate) { + logger.debug("fillTotalPayment"); + List parameters = new ArrayList<>(); + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(startDate); + calendar.add(Calendar.DAY_OF_YEAR, 1); + startDate = calendar.getTime(); + + Calendar calendarF = Calendar.getInstance(); + calendarF.setTime(endDate); + calendarF.add(Calendar.DAY_OF_YEAR, 1); + endDate = calendarF.getTime(); + + parameters.add(new ModelParameter(GoalCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(GoalCfg.PARAM_END_DATE, endDate)); + List dataComplete = genericEntityRepository.xmlQueryAPCEntities(StatsPaymentRenovationView.class, StatsPaymentRenovationViewCfg.QUERY_FIND_ALL_PAYMENT_RENOVATION_BETWEEN_DATES, parameters); + BigDecimal totalPayment = new BigDecimal("0"); + for (StatsPaymentRenovationView payment : dataComplete) { + totalPayment = totalPayment.add(payment.getTotalPayment()); + } + return totalPayment; + } + + final Logger logger = LogManager.getLogger(StatsPaymentRenovationController.class); + private final GenericEntityRepository genericEntityRepository; + + public StatsPaymentRenovationController() { + this.genericEntityRepository = new GenericEntityRepository(); + } +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StatsPaymentRouteController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StatsPaymentRouteController.java new file mode 100644 index 0000000..989b72d --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StatsPaymentRouteController.java @@ -0,0 +1,120 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.controller.admin; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.admin.constance.GoalCfg; +import com.arrebol.apc.model.views.StatsPaymentRouteView; +import com.arrebol.apc.model.views.constance.StatsPaymentRouteViewCfg; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.Comparator; +import java.util.HashMap; +import java.util.Map; + +/** + * + * @author David Rodriguez + */ +public class StatsPaymentRouteController implements Serializable { + + public BigDecimal fillTotalPayment(Date startDate, Date endDate) { + logger.debug("fillTotalPayment"); + List parameters = new ArrayList<>(); + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(startDate); + calendar.add(Calendar.DAY_OF_YEAR, 1); + startDate = calendar.getTime(); + + Calendar calendarF = Calendar.getInstance(); + calendarF.setTime(endDate); + calendarF.add(Calendar.DAY_OF_YEAR, 1); + endDate = calendarF.getTime(); + + parameters.add(new ModelParameter(GoalCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(GoalCfg.PARAM_END_DATE, endDate)); + List dataComplete = genericEntityRepository.xmlQueryAPCEntities(StatsPaymentRouteView.class, StatsPaymentRouteViewCfg.QUERY_FIND_ALL_PAYMENT_ROUTE_BETWEEN_DATES, parameters); + BigDecimal totalPayment = new BigDecimal("0"); + List listLoanTypeSum = new ArrayList<>(); + for (StatsPaymentRouteView payment : dataComplete) { + totalPayment = totalPayment.add(payment.getTotalPayment()); + if (!listLoanTypeSum.contains(payment.getIdLoan())) { + listLoanTypeSum.add(payment.getIdLoan()); + totalPayment = totalPayment.add(payment.getOpeningFee()); + } + } + return totalPayment; + } + + public List fillPaymentDataTable(Date startDate, Date endDate, String idRoute) { + logger.debug("fillPaymentDataTable"); + List parameters = new ArrayList<>(); + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(startDate); + calendar.add(Calendar.DAY_OF_YEAR, 1); + startDate = calendar.getTime(); + + Calendar calendarF = Calendar.getInstance(); + calendarF.setTime(endDate); + calendarF.add(Calendar.DAY_OF_YEAR, 1); + endDate = calendarF.getTime(); + + List dataComplete = new ArrayList<>(); + parameters.add(new ModelParameter(GoalCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(GoalCfg.PARAM_END_DATE, endDate)); + + if (idRoute != null && !idRoute.equals("")) { + parameters.add(new ModelParameter(StatsPaymentRouteViewCfg.FIELD_ROUTE, idRoute)); + dataComplete = genericEntityRepository.xmlQueryAPCEntities(StatsPaymentRouteView.class, StatsPaymentRouteViewCfg.QUERY_FIND_ALL_PAYMENT_ROUTE_BETWEEN_DATES_ROUTE, parameters); + } else { + dataComplete = genericEntityRepository.xmlQueryAPCEntities(StatsPaymentRouteView.class, StatsPaymentRouteViewCfg.QUERY_FIND_ALL_PAYMENT_ROUTE_BETWEEN_DATES, parameters); + } + + Map mapDataPayment = new HashMap<>(); + List listLoanTypeSum = new ArrayList<>(); + + for (StatsPaymentRouteView payment : dataComplete) { + if (mapDataPayment.get(payment.getIdRoute()) != null) { + if(!mapDataPayment.get(payment.getIdRoute()).getUserName().contains(payment.getUserName())){ + mapDataPayment.get(payment.getIdRoute()).setUserName(mapDataPayment.get(payment.getIdRoute()).getUserName() + ", " + payment.getUserName()); + } + mapDataPayment.get(payment.getIdRoute()).setTotalPayment( + mapDataPayment.get(payment.getIdRoute()).getTotalPayment().add(payment.getTotalPayment())); + + if (!listLoanTypeSum.contains(payment.getIdLoan())) { + listLoanTypeSum.add(payment.getIdLoan()); + mapDataPayment.get(payment.getIdRoute()).setTotalPayment( + mapDataPayment.get(payment.getIdRoute()).getTotalPayment().add(payment.getOpeningFee())); + } + } else { + payment.setTotalPayment(payment.getTotalPayment().add(payment.getOpeningFee())); + mapDataPayment.put(payment.getIdRoute(), payment); + listLoanTypeSum.add(payment.getIdLoan()); + } + } + dataComplete.clear(); + dataComplete.addAll(mapDataPayment.values()); + + dataComplete.sort(Comparator.comparing(StatsPaymentRouteView::getRouteName)); + return dataComplete; + } + + final Logger logger = LogManager.getLogger(StatsPaymentRouteController.class); + private final GenericEntityRepository genericEntityRepository; + + public StatsPaymentRouteController() { + this.genericEntityRepository = new GenericEntityRepository(); + } +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StatsPayrollController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StatsPayrollController.java new file mode 100644 index 0000000..2ace223 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StatsPayrollController.java @@ -0,0 +1,99 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.controller.admin; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.admin.constance.GoalCfg; +import com.arrebol.apc.model.views.StatsPayrollView; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import com.arrebol.apc.model.views.constance.StatsPayrollViewCfg; +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.HashMap; +import java.util.Map; + +/** + * + * @author David Rodriguez + */ +public class StatsPayrollController implements Serializable { + + public List fillPayrollDataTable(Date startDate, Date endDate, String idUser) { + logger.debug("fillPayrollDataTable"); + List parameters = new ArrayList<>(); + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(startDate); + calendar.add(Calendar.DAY_OF_YEAR, 1); + startDate = calendar.getTime(); + + Calendar calendarF = Calendar.getInstance(); + calendarF.setTime(endDate); + calendarF.add(Calendar.DAY_OF_YEAR, 1); + endDate = calendarF.getTime(); + + parameters.add(new ModelParameter(GoalCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(GoalCfg.PARAM_END_DATE, endDate)); + List dataComplete = new ArrayList<>(); + + if (idUser != null && !idUser.equals("")) { + parameters.add(new ModelParameter(StatsPayrollViewCfg.FIELD_USER, idUser)); + dataComplete = genericEntityRepository.xmlQueryAPCEntities(StatsPayrollView.class, StatsPayrollViewCfg.QUERY_FIND_ALL_PAYROLL_BETWEEN_DATES_USER, parameters); + } else { + dataComplete = genericEntityRepository.xmlQueryAPCEntities(StatsPayrollView.class, StatsPayrollViewCfg.QUERY_FIND_ALL_PAYROLL_BETWEEN_DATES, parameters); + } + + Map mapDataPayroll = new HashMap<>(); + for (StatsPayrollView payroll : dataComplete) { + if (mapDataPayroll.get(payroll.getIdUser()) != null) { + mapDataPayroll.get(payroll.getIdUser()).setTotalPayroll( + mapDataPayroll.get(payroll.getIdUser()).getTotalPayroll().add(payroll.getTotalPayroll())); + } else { + mapDataPayroll.put(payroll.getIdUser(), payroll); + } + } + dataComplete.clear(); + dataComplete.addAll(mapDataPayroll.values()); + return dataComplete; + } + + public BigDecimal fillTotalPayroll(Date startDate, Date endDate) { + logger.debug("fillTotalPayroll"); + List parameters = new ArrayList<>(); + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(startDate); + calendar.add(Calendar.DAY_OF_YEAR, 1); + startDate = calendar.getTime(); + + Calendar calendarF = Calendar.getInstance(); + calendarF.setTime(endDate); + calendarF.add(Calendar.DAY_OF_YEAR, 1); + endDate = calendarF.getTime(); + + parameters.add(new ModelParameter(GoalCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(GoalCfg.PARAM_END_DATE, endDate)); + List dataComplete = genericEntityRepository.xmlQueryAPCEntities(StatsPayrollView.class, StatsPayrollViewCfg.QUERY_FIND_ALL_PAYROLL_BETWEEN_DATES, parameters); + BigDecimal totalPayroll = new BigDecimal("0"); + for (StatsPayrollView payroll : dataComplete) { + totalPayroll = totalPayroll.add(payroll.getTotalPayroll()); + } + return totalPayroll; + } + + final Logger logger = LogManager.getLogger(StatsPayrollController.class); + private final GenericEntityRepository genericEntityRepository; + + public StatsPayrollController() { + this.genericEntityRepository = new GenericEntityRepository(); + } +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StatsSummaryController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StatsSummaryController.java new file mode 100644 index 0000000..3595778 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StatsSummaryController.java @@ -0,0 +1,233 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.controller.admin; + +import com.arrebol.apc.controller.util.ConnectionManager; +import com.arrebol.apc.controller.util.HibernateUtil; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.admin.constance.GoalCfg; +import com.arrebol.apc.model.views.StatsPayrollView; +import com.arrebol.apc.model.views.StatsSummaryView; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import com.arrebol.apc.model.views.constance.StatsPayrollViewCfg; +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import org.hibernate.HibernateException; +import org.hibernate.Session; +import org.hibernate.Transaction; + +/** + * + * @author David Rodriguez + */ +public class StatsSummaryController extends ConnectionManager implements Serializable { + + public List fillSummaryDataTable(Date startDate, Date endDate) { + logger.debug("fillSummaryDataTable"); + List dataList = new ArrayList<>(); + Transaction transaction = null; + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(startDate); + calendar.add(Calendar.DAY_OF_YEAR, 1); + startDate = calendar.getTime(); + + Calendar calendarF = Calendar.getInstance(); + calendarF.setTime(endDate); + calendarF.add(Calendar.DAY_OF_YEAR, 1); + endDate = calendarF.getTime(); + + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd"); + + List rows = session.createNativeQuery(querySummary) + .setParameter("startDate", startDate) + .setParameter("endDate", endDate) + .getResultList(); + + transaction.commit(); + + rows.forEach((row) -> { + Object[] results = (Object[]) row; + + // Create Data Row + StatsSummaryView summaryRow = new StatsSummaryView(); + summaryRow.setIdUser(results[0] == null ? "" : results[0].toString()); + summaryRow.setUserName(results[1] == null ? "" : results[1].toString()); + summaryRow.setOpeningFee(new BigDecimal(results[2] == null ? "0.0" : results[2].toString())); + summaryRow.setDeposits(new BigDecimal(results[3] == null ? "0.0" : results[3].toString())); + summaryRow.setPayment(new BigDecimal(results[4] == null ? "0.0" : results[4].toString())); + summaryRow.setPayroll(new BigDecimal(results[5] == null ? "0.0" : results[5].toString())); + summaryRow.setGasoline(new BigDecimal(results[6] == null ? "0.0" : results[6].toString())); + summaryRow.setAdvances(new BigDecimal(results[7] == null ? "0.0" : results[7].toString())); + summaryRow.setExpenses(new BigDecimal(results[8] == null ? "0.0" : results[8].toString())); + summaryRow.setTrasferTransmitter(new BigDecimal(results[9] == null ? "0.0" : results[9].toString())); + summaryRow.setTrasferReceiver(new BigDecimal(results[10] == null ? "0.0" : results[10].toString())); + + dataList.add(summaryRow); + }); + + } catch (HibernateException e) { + logger.error("Driver", e); + rollback(transaction); + } catch (Exception e) { + logger.error("Method fillSummaryDataTable(" + startDate + " " + ") ", e); + rollback(transaction); + } + + return dataList; + } + + public BigDecimal fillTotalSummary(Date startDate, Date endDate) { + logger.debug("fillTotalSummary"); + List parameters = new ArrayList<>(); + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(startDate); + calendar.add(Calendar.DAY_OF_YEAR, 1); + startDate = calendar.getTime(); + + Calendar calendarF = Calendar.getInstance(); + calendarF.setTime(endDate); + calendarF.add(Calendar.DAY_OF_YEAR, 1); + endDate = calendarF.getTime(); + + parameters.add(new ModelParameter(GoalCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(GoalCfg.PARAM_END_DATE, endDate)); + List dataComplete = genericEntityRepository.xmlQueryAPCEntities(StatsPayrollView.class, StatsPayrollViewCfg.QUERY_FIND_ALL_PAYROLL_BETWEEN_DATES, parameters); + BigDecimal totalPayroll = new BigDecimal("0"); + for (StatsPayrollView payroll : dataComplete) { + totalPayroll = totalPayroll.add(payroll.getTotalPayroll()); + } + return totalPayroll; + } + + final Logger logger = LogManager.getLogger(StatsSummaryController.class); + private final GenericEntityRepository genericEntityRepository; + + public StatsSummaryController() { + this.genericEntityRepository = new GenericEntityRepository(); + } + + private final String querySummary + = "SELECT " + + " HR.id AS id_user, " + + " CONCAT(HR.first_name, ' ', HR.last_name) AS Name, " + + " IFNULL(OFE.opening_fee, 0.0) AS opening_fee, " + + " IFNULL(DEP.total_deposits, 0.0) AS deposits, " + + " IFNULL(PAY.total_payment, 0.0) AS payment, " + + " IFNULL(PR.total_payroll, 0.0) AS payroll, " + + " IFNULL(GAS.total_gasoline, 0.0) AS gasoline, " + + " IFNULL(ADV.total_advances, 0.0) AS advances, " + + " IFNULL(EXP.total_expenses, 0.0) AS expenses, " + + " IFNULL(TE.total_transfer, 0.0) AS trasfer_transmitter, " + + " IFNULL(TR.total_transfer, 0.0) AS trasfer_receiver " + + "FROM APC_HUMAN_RESOURCE AS HR " + + "INNER JOIN APC_USER AS U ON U.id_human_resource = HR.Id " + + "LEFT JOIN " + + "( " + + " SELECT " + + " HR.id AS id_HR, CONCAT(HR.first_name, ' ', HR.last_name) AS Name, SUM(LT.opening_fee) AS opening_fee " + + " FROM APC_LOAN L " + + " INNER JOIN APC_LOAN_TYPE LT ON L.id_loan_type = LT.id " + + " INNER JOIN APC_USER U ON L.created_by = U.id " + + " INNER JOIN APC_HUMAN_RESOURCE HR ON U.id_human_resource = HR.id " + + " WHERE DATE(L.created_on) BETWEEN DATE(:startDate) AND DATE(:endDate) " + + " GROUP BY HR.id " + + ") OFE ON HR.id = OFE.id_HR " + + "LEFT JOIN " + + "( " + + " SELECT " + + " HR.id AS id_HR, CONCAT(HR.first_name, ' ', HR.last_name) AS Name, SUM(LD.payment_amount )AS total_deposits " + + " FROM APC_LOAN_DETAIL LD " + + " INNER JOIN APC_LOAN L ON LD.id_loan = L.id AND L.loan_status <> 'DELETED' " + + " INNER JOIN APC_USER U ON LD.id_user = U.id " + + " INNER JOIN APC_HUMAN_RESOURCE HR ON U.id_human_resource = HR.id " + + " WHERE loan_details_type IN ('TRANSFER') AND DATE(LD.created_on) BETWEEN DATE(:startDate) AND DATE(:endDate) " + + " GROUP BY HR.id " + + ") DEP ON HR.id = DEP.id_HR " + + "LEFT JOIN " + + "( " + + " SELECT " + + " HR.id AS id_HR, CONCAT(HR.first_name, ' ', HR.last_name) AS Name, SUM(LD.payment_amount )AS total_payment " + + " FROM APC_LOAN_DETAIL LD " + + " INNER JOIN APC_LOAN L ON LD.id_loan = L.id AND L.loan_status <> 'DELETED' " + + " INNER JOIN APC_USER U ON LD.id_user = U.id " + + " INNER JOIN APC_HUMAN_RESOURCE HR ON U.id_human_resource = HR.id " + + " WHERE loan_details_type IN ('PAYMENT') AND DATE(LD.created_on) BETWEEN DATE(:startDate) AND DATE(:endDate) " + + " GROUP BY HR.id " + + ") PAY ON HR.id = PAY.id_HR " + + "LEFT JOIN " + + "( " + + " SELECT " + + " P.id_human_resource AS id_HR, " + + " SUM(P.salary + P.total_bonus_colocation + P.total_bonus_mora + P.total_bonus_new_customer + P.increases) AS total_payroll " + + " FROM APC_PAYROLL P " + + " WHERE DATE(P.created_on) BETWEEN DATE(:startDate) AND DATE(:endDate) " + + " GROUP BY P.id_human_resource " + + ")PR ON HR.id = PR.id_HR " + + "LEFT JOIN " + + "( " + + " SELECT " + + " HR.id AS id_HR, CONCAT(HR.first_name, ' ', HR.last_name) AS user_name, SUM(G.total) AS total_gasoline " + + " FROM APC_GASOLINE G " + + " INNER JOIN APC_USER U ON G.id_user = U.id " + + " INNER JOIN APC_HUMAN_RESOURCE HR ON U.id_human_resource = HR.id " + + " WHERE G.status = 'ENABLED' AND DATE(G.created_on) BETWEEN DATE(:startDate) AND DATE(:endDate) " + + " GROUP BY HR.id " + + ")GAS ON HR.id = GAS.id_HR " + + "LEFT JOIN " + + "( " + + " SELECT " + + " HR.id AS id_HR, SUM(LD.payment_amount) AS total_advances " + + " FROM APC_LOAN_DETAIL LD " + + " INNER JOIN APC_LOAN L ON LD.id_loan = L.id AND L.loan_status <> 'DELETED' " + + " INNER JOIN APC_USER U ON LD.id_user = U.id " + + " INNER JOIN APC_HUMAN_RESOURCE HR ON U.id_human_resource = HR.id " + + " WHERE loan_details_type IN ('RENOVATION_PAYMENT') AND DATE(LD.created_on) BETWEEN DATE(:startDate) AND DATE(:endDate) " + + " GROUP BY HR.id " + + ")ADV ON HR.id = ADV.id_HR " + + "LEFT JOIN " + + "( " + + " SELECT " + + " HR.id AS id_HR, CONCAT(HR.first_name, ' ', HR.last_name) AS user_name, SUM(OE.expense) AS total_expenses " + + " FROM APC_OTHER_EXPENSE OE " + + " INNER JOIN APC_USER U ON OE.id_user = U.id " + + " INNER JOIN APC_HUMAN_RESOURCE HR ON U.id_human_resource = HR.id " + + " WHERE DATE(OE.created_on) BETWEEN DATE(:startDate) AND DATE(:endDate) " + + " GROUP BY HR.id " + + ")EXP ON HR.id = EXP.id_HR " + + "LEFT JOIN " + + "( " + + " SELECT " + + " HR.id AS id_HR, CONCAT(HR.first_name, ' ', HR.last_name) AS user_name, SUM(TE.amount_to_transfer) AS total_transfer " + + " FROM APC_TRANSFER TE " + + " INNER JOIN APC_USER U ON TE.id_user_transmitter = U.id " + + " INNER JOIN APC_HUMAN_RESOURCE HR ON U.id_human_resource = HR.id " + + " WHERE DATE(TE.created_on) BETWEEN DATE(:startDate) AND DATE(:endDate) " + + " GROUP BY HR.id " + + ")TE ON HR.id = TE.id_HR " + + "LEFT JOIN " + + "( " + + " SELECT " + + " HR.id AS id_HR, CONCAT(HR.first_name, ' ', HR.last_name) AS user_name, SUM(TR.amount_to_transfer) AS total_transfer " + + " FROM APC_TRANSFER TR " + + " INNER JOIN APC_USER U ON TR.id_user_receiver = U.id " + + " INNER JOIN APC_HUMAN_RESOURCE HR ON U.id_human_resource = HR.id " + + " WHERE DATE(TR.created_on) BETWEEN DATE(:startDate) AND DATE(:endDate) " + + " GROUP BY HR.id " + + ")TR ON HR.id = TR.id_HR " + + "WHERE HR.human_resource_status = 'ENEBLED';"; +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StatsVehicleController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StatsVehicleController.java new file mode 100644 index 0000000..39cbf94 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StatsVehicleController.java @@ -0,0 +1,53 @@ +/* + * 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.controller.admin; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.catalog.Vehicle; +import com.arrebol.apc.model.views.constance.StatsVehicleCfg; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public class StatsVehicleController implements Serializable { + + public List fillVehicleDataTable(Date startDate, Date endDate) { + logger.debug("fillVehicleDataTable"); + List parameters = new ArrayList<>(); + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(startDate); + calendar.add(Calendar.DAY_OF_YEAR, 1); + startDate = calendar.getTime(); + + Calendar calendarF = Calendar.getInstance(); + calendarF.setTime(endDate); + calendarF.add(Calendar.DAY_OF_YEAR, 1); + endDate = calendarF.getTime(); + + List dataComplete = genericEntityRepository.xmlQueryAPCEntities(Vehicle.class, StatsVehicleCfg.QUERY_FIND_ALL_VEHICLES, parameters); + + return dataComplete; + } + + final Logger logger = LogManager.getLogger(StatsAdvancesController.class); + private final GenericEntityRepository genericEntityRepository; + + public StatsVehicleController() { + this.genericEntityRepository = new GenericEntityRepository(); + } +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StatsZeroPaymentsController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StatsZeroPaymentsController.java new file mode 100644 index 0000000..0dbd44e --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/StatsZeroPaymentsController.java @@ -0,0 +1,113 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.controller.admin; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.admin.constance.GoalCfg; +import com.arrebol.apc.model.views.StatsZeroPaymentsView; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import com.arrebol.apc.model.views.constance.StatsZeroPaymentsViewCfg; +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.Comparator; +import java.util.HashMap; +import java.util.Map; + +/** + * + * @author David Rodriguez + */ +public class StatsZeroPaymentsController implements Serializable { + + public List fillZeroPaymentsDataTable(Date startDate, Date endDate, String idUser) { + logger.debug("fillZeroPaymentsDataTable"); + List parameters = new ArrayList<>(); + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(startDate); + calendar.add(Calendar.DAY_OF_YEAR, 1); + startDate = calendar.getTime(); + + Calendar calendarF = Calendar.getInstance(); + calendarF.setTime(endDate); + calendarF.add(Calendar.DAY_OF_YEAR, 1); + endDate = calendarF.getTime(); + + parameters.add(new ModelParameter(GoalCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(GoalCfg.PARAM_END_DATE, endDate)); + List dataComplete = new ArrayList<>(); + + if (idUser != null && !idUser.equals("")) { + parameters.add(new ModelParameter(StatsZeroPaymentsViewCfg.FIELD_USER, idUser)); + dataComplete = genericEntityRepository.xmlQueryAPCEntities(StatsZeroPaymentsView.class, StatsZeroPaymentsViewCfg.QUERY_FIND_ALL_ZERO_PAYMENTS_BETWEEN_DATES_USER, parameters); + } else { + dataComplete = genericEntityRepository.xmlQueryAPCEntities(StatsZeroPaymentsView.class, StatsZeroPaymentsViewCfg.QUERY_FIND_ALL_ZERO_PAYMENTS_BETWEEN_DATES, parameters); + } + + Map mapDataZeroPayments = new HashMap<>(); + for (StatsZeroPaymentsView zeroPayments : dataComplete) { + if (mapDataZeroPayments.get(zeroPayments.getIdUser()) != null) { + if(!mapDataZeroPayments.get(zeroPayments.getIdUser()).getRouteName().contains(zeroPayments.getRouteName())){ + mapDataZeroPayments.get(zeroPayments.getIdUser()).setRouteName(mapDataZeroPayments.get(zeroPayments.getIdUser()).getRouteName() + ", " + zeroPayments.getRouteName()); + } + } else { + mapDataZeroPayments.put(zeroPayments.getIdUser(), zeroPayments); + } + } + // Asigna todas las rutas al usuario + dataComplete.forEach(d -> d.setRouteName(mapDataZeroPayments.get(d.getIdUser()).getRouteName())); + + mapDataZeroPayments.clear(); + for (StatsZeroPaymentsView zeroPayments : dataComplete) { + if (mapDataZeroPayments.get(zeroPayments.getIdUser()) != null) { + mapDataZeroPayments.get(zeroPayments.getIdUser()).setTotalZeroPayments(mapDataZeroPayments.get(zeroPayments.getIdUser()).getTotalZeroPayments().add(BigDecimal.ONE)); + } else { + zeroPayments.setTotalZeroPayments(BigDecimal.ONE); + mapDataZeroPayments.put(zeroPayments.getIdUser(), zeroPayments); + } + } + dataComplete.clear(); + dataComplete.addAll(mapDataZeroPayments.values()); + + dataComplete.sort(Comparator.comparing(StatsZeroPaymentsView::getRouteName)); + + return dataComplete; + } + + public int fillTotalZeroPayments(Date startDate, Date endDate) { + logger.debug("fillTotalZeroPayments"); + List parameters = new ArrayList<>(); + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(startDate); + calendar.add(Calendar.DAY_OF_YEAR, 1); + startDate = calendar.getTime(); + + Calendar calendarF = Calendar.getInstance(); + calendarF.setTime(endDate); + calendarF.add(Calendar.DAY_OF_YEAR, 1); + endDate = calendarF.getTime(); + + parameters.add(new ModelParameter(GoalCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(GoalCfg.PARAM_END_DATE, endDate)); + List dataComplete = genericEntityRepository.xmlQueryAPCEntities(StatsZeroPaymentsView.class, StatsZeroPaymentsViewCfg.QUERY_FIND_ALL_ZERO_PAYMENTS_BETWEEN_DATES, parameters); + + return dataComplete.size(); + } + + final Logger logger = LogManager.getLogger(StatsZeroPaymentsController.class); + private final GenericEntityRepository genericEntityRepository; + + public StatsZeroPaymentsController() { + this.genericEntityRepository = new GenericEntityRepository(); + } +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/admin/TransferController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/TransferController.java new file mode 100644 index 0000000..adc2c83 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/TransferController.java @@ -0,0 +1,110 @@ +/* + * 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.controller.admin; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.admin.Transfer; +import com.arrebol.apc.model.admin.constance.TransferCfg; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public class TransferController implements Serializable{ + + /** + * + * Searching all transfer by office. + * + * @param officeId + * @param startDate + * @param endDate + * @return + */ + public List fillTransferDatatable(String officeId, Date startDate, Date endDate) { + logger.debug("fillTransferDatatable"); + List parameters = new ArrayList<>(); + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(startDate); + calendar.add(Calendar.DAY_OF_YEAR, 1); + startDate = calendar.getTime(); + + Calendar calendarF = Calendar.getInstance(); + calendarF.setTime(endDate); + calendarF.add(Calendar.DAY_OF_YEAR, 1); + endDate = calendarF.getTime(); + + parameters.add(new ModelParameter(TransferCfg.FIELD_OFFICE, new Office(officeId))); + parameters.add(new ModelParameter(TransferCfg.PARAM_START_DATE, startDate)); + parameters.add(new ModelParameter(TransferCfg.PARAM_END_DATE, endDate)); + + return genericEntityRepository.xmlQueryAPCEntities(Transfer.class, TransferCfg.QUERY_FIND_ALL_TRANFERS_BY_OFFICE_BETWEEN_DATES, parameters); + } + + /** + * + * @param transfer + * @return boolean + */ + public boolean saveTransfer(Transfer transfer) { + logger.debug("saveTransfer"); + boolean success = genericEntityRepository.insertAPCEntity(transfer); + + return success; + } + + /** + * + * @param transfer + * @return boolean + */ + public boolean updateByTransferId(Transfer transfer) { + logger.debug("updateByTransferId"); + + return genericEntityRepository.updateAPCEntity(transfer); + } + + /** + * + * @param status + * @param transferIdToUpdate + * @param lastUpdatedBy + * @return + */ + public boolean updateTransferByStatus(ActiveStatus status, String transferIdToUpdate, String lastUpdatedBy) { + logger.debug("updateTransferByStatus"); + + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(TransferCfg.FIELD_ACTIVE_STATUS, status)); + parameters.add(new ModelParameter(TransferCfg.FIELD_LAST_UPDATED_BY, lastUpdatedBy)); + parameters.add(new ModelParameter(TransferCfg.FIELD_LAST_UPDATED_ON, new Date())); + parameters.add(new ModelParameter(TransferCfg.FIELD_ID, transferIdToUpdate)); + + return genericEntityRepository.xmlUpdateOrDeleteAPCEntity(TransferCfg.QUERY_UPDATE_TRANSFER_BY_ACTIVE_STATUS, parameters); + } + + final Logger logger = LogManager.getLogger(TransferController.class); + private final GenericEntityRepository genericEntityRepository; + + public TransferController() { + this.genericEntityRepository = new GenericEntityRepository(); + } + +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/admin/VehicleController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/VehicleController.java new file mode 100644 index 0000000..1d4e7e4 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/admin/VehicleController.java @@ -0,0 +1,170 @@ +/* + * 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.controller.admin; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.admin.Bonus; +import com.arrebol.apc.model.admin.constance.BonusCfg; +import com.arrebol.apc.model.catalog.Vehicle; +import com.arrebol.apc.model.core.HumanResource; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.constance.HumanResourceByOfficeCfg; +import com.arrebol.apc.model.core.constance.HumanResourceCfg; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.enums.HumanResourceStatus; +import com.arrebol.apc.repository.GenericEntityRepository; +import com.arrebol.apc.repository.core.HumanResourceRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import javax.persistence.Tuple; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class VehicleController implements Serializable { + + /** + * Find where status EQUALS TO status. + * + * @param office + * @param status + * @param hrOwnerId Human resource id from user logged. + * @return + */ + public List findEmployeesByType(Office office, HumanResourceStatus status, String hrOwnerId) { + List 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))); + + 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 findEmployeesInType(Office office, List statusLst, String hrOwnerId) { + List 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))); + + return genericEntityRepository.xmlQueryAPCEntities(HumanResource.class, HumanResourceCfg.QUERY_FIND_ALL_IN_STATUS, parameters); + } + + /** + * Save an entity. + * + * @param vehicle + * @return + */ + public boolean saveVehicle(Vehicle vehicle) { + logger.debug("saveVehicle"); + + boolean success = genericEntityRepository.insertAPCEntity(vehicle); + return success; + } + + /** + * + * @param hr + * @param updateAvatar + * @return + */ + public boolean updateByHumanResourceId(HumanResource hr, boolean updateAvatar) { + logger.debug("updateByHumanResourceId"); + + return humanResourceRepository.updateByHumanResourceId(hr, updateAvatar); + } + + /** + * + * @param status + * @param userIdToUpdate + * @param lastUpdatedBy + * @return + */ + public boolean updateHRByStatus(HumanResourceStatus status, String userIdToUpdate, String lastUpdatedBy) { + logger.debug("updateHRByStatus"); + + List 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)); + + return genericEntityRepository.xmlUpdateOrDeleteAPCEntity(HumanResourceCfg.UPDATE_HR_BY_STATUS, parameters); + } + + /** + * + * @param officeId + * @return + */ + public List findAllActiveBonus(String officeId) { + logger.debug("findAllActiveBonus"); + + List results = new ArrayList<>(); + try { + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(BonusCfg.FIELD_ACTIVE_STATUS, ActiveStatus.ENEBLED)); + parameters.add(new ModelParameter(BonusCfg.FIELD_OFFICE, new Office(officeId))); + + List 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())); + }); + + } catch (Exception e) { + logger.error("findAllActiveBonus", e); + } + + return results; + } + + /** + * + * @param hrId + * @return + */ + public HumanResource findHumanResourceById(String hrId) { + logger.debug("findHumanResourceById"); + + return (HumanResource) genericEntityRepository.selectAPCEntityById(HumanResource.class, hrId); + } + + private static final long serialVersionUID = 2527037592427439763L; + final Logger logger = LogManager.getLogger(VehicleController.class); + + private final GenericEntityRepository genericEntityRepository; + private final HumanResourceRepository humanResourceRepository; + + public VehicleController() { + this.genericEntityRepository = new GenericEntityRepository(); + this.humanResourceRepository = new HumanResourceRepository(); + } + +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/catalog/LoanTypeController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/catalog/LoanTypeController.java new file mode 100644 index 0000000..367d222 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/catalog/LoanTypeController.java @@ -0,0 +1,85 @@ +/* + * 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.controller.catalog; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.constance.LoanTypeCfg; +import com.arrebol.apc.model.loan.LoanType; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public class LoanTypeController implements Serializable{ + + /** + * + * Searching all loans type. + * + * @param officeId + * @return + */ + public List fillLoanTypeDatatable(String officeId) { + logger.debug("fillLoanTypeDatatable"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanTypeCfg.FIELD_OFFICE, new Office(officeId))); + + return genericEntityRepository.xmlQueryAPCEntities(LoanType.class, LoanTypeCfg.QUERY_FIND_ALL_DATA_LOAN_TYPE_BY_OFFICE, parameters); + } + + /** + * + * @param loanType + * @return boolean + */ + public boolean saveLoanType(LoanType loanType) { + logger.debug("saveLoanTypeController"); + boolean success = genericEntityRepository.insertAPCEntity(loanType); + + return success; + } + + /** + * + * @param loanType + * @return boolean + */ + public boolean updateByLoanTypeId(LoanType loanType) { + logger.debug("updateByLoanTypeId"); + + return genericEntityRepository.updateAPCEntity(loanType); + } + + /** + * + * Searching loantype by id. + * + * @param loanTypeId + * @return + */ + public LoanType getLoanTypeById(String loanTypeId) { + logger.debug("getLoanTypeById"); + + return (LoanType) genericEntityRepository.selectAPCEntityById(LoanType.class, loanTypeId); + } + + final Logger logger = LogManager.getLogger(LoanTypeController.class); + private final GenericEntityRepository genericEntityRepository; + + public LoanTypeController() { + this.genericEntityRepository = new GenericEntityRepository(); + } +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/catalog/RoleController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/catalog/RoleController.java new file mode 100644 index 0000000..8fb8774 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/catalog/RoleController.java @@ -0,0 +1,93 @@ +/* + * 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.controller.catalog; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.catalog.RoleCtlg; +import com.arrebol.apc.model.catalog.constance.RoleCfg; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public class RoleController implements Serializable{ + + /** + * + * Searching all roles. + * + * @return + */ + public List fillRolesDatatable() { + + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(RoleCfg.FIELD_ACTIVE_STATUS, ActiveStatus.ENEBLED)); + + return genericEntityRepository.xmlQueryAPCEntities(RoleCtlg.class, RoleCfg.QUERY_FIND_ALL_ROLES, parameters); + } + + /** + * + * @param role + * @return boolean + */ + public boolean saveRoles(RoleCtlg role) { + logger.debug("saveRolesController"); + boolean success = genericEntityRepository.insertAPCEntity(role); + + return success; + } + + /** + * + * @param role + * @return boolean + */ + public boolean updateByRoleId(RoleCtlg role) { + logger.debug("updateByRoleId"); + + return genericEntityRepository.updateAPCEntity(role); + } + + /** + * + * @param status + * @param roleIdToUpdate + * @return + */ + public boolean updateRoleByStatus(ActiveStatus status, String roleIdToUpdate, String lastUpdatedBy) { + logger.debug("updateRoleByStatus"); + + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(RoleCfg.FIELD_ACTIVE_STATUS, status)); + parameters.add(new ModelParameter(RoleCfg.FIELD_LAST_UPDATED_BY, lastUpdatedBy)); + parameters.add(new ModelParameter(RoleCfg.FIELD_LAST_UPDATED_ON, new Date())); + parameters.add(new ModelParameter(RoleCfg.FIELD_ID, roleIdToUpdate)); + + return genericEntityRepository.xmlUpdateOrDeleteAPCEntity(RoleCfg.UPDATE_ROLE_BY_STATUS, parameters); + } + + + final Logger logger = LogManager.getLogger(RoleController.class); + private final GenericEntityRepository genericEntityRepository; + + public RoleController() { + this.genericEntityRepository = new GenericEntityRepository(); + } +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/catalog/RouteController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/catalog/RouteController.java new file mode 100644 index 0000000..b9a7a04 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/catalog/RouteController.java @@ -0,0 +1,96 @@ +/* + * 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.controller.catalog; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.catalog.RouteCtlg; +import com.arrebol.apc.model.catalog.constance.RouteCfg; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public class RouteController implements Serializable { + + /** + * + * Searching all roles. + * + * @param officeId + * @return + */ + public List fillRoutesDatatable(String officeId) { + logger.debug("fillRoutesDatatable"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(RouteCfg.FIELD_ACTIVE_STATUS, ActiveStatus.ENEBLED)); + parameters.add(new ModelParameter(RouteCfg.FIELD_OFFICE, new Office(officeId))); + + return genericEntityRepository.xmlQueryAPCEntities(RouteCtlg.class, RouteCfg.QUERY_FIND_ALL_ROUTES, parameters); + } + + /** + * + * @param route + * @return boolean + */ + public boolean saveRoute(RouteCtlg route) { + logger.debug("saveRouteController"); + boolean success = genericEntityRepository.insertAPCEntity(route); + + return success; + } + + /** + * + * @param route + * @return boolean + */ + public boolean updateByRouteId(RouteCtlg route) { + logger.debug("updateByRouteId"); + + return genericEntityRepository.updateAPCEntity(route); + } + + /** + * + * @param status + * @param routeIdToUpdate + * @param lastUpdatedBy + * @return + */ + public boolean updateRouteByStatus(ActiveStatus status, String routeIdToUpdate, String lastUpdatedBy) { + logger.debug("updateRouteByStatus"); + + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(RouteCfg.FIELD_ACTIVE_STATUS, status)); + parameters.add(new ModelParameter(RouteCfg.FIELD_LAST_UPDATED_BY, lastUpdatedBy)); + parameters.add(new ModelParameter(RouteCfg.FIELD_LAST_UPDATED_ON, new Date())); + parameters.add(new ModelParameter(RouteCfg.FIELD_ID, routeIdToUpdate)); + + return genericEntityRepository.xmlUpdateOrDeleteAPCEntity(RouteCfg.UPDATE_ROUTE_BY_STATUS, parameters); + } + + private static final long serialVersionUID = -6277126340752974003L; + final Logger logger = LogManager.getLogger(RoleController.class); + private final GenericEntityRepository genericEntityRepository; + + public RouteController() { + this.genericEntityRepository = new GenericEntityRepository(); + } +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/dashboard/CustomerWithoutRenovationViewService.java b/ace-controller/src/main/java/com/arrebol/apc/controller/dashboard/CustomerWithoutRenovationViewService.java new file mode 100644 index 0000000..6332a4f --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/dashboard/CustomerWithoutRenovationViewService.java @@ -0,0 +1,41 @@ +/* + * 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.controller.dashboard; + +import com.arrebol.apc.model.views.CustomerWithoutRenovationView; +import java.util.List; +import java.util.Map; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface CustomerWithoutRenovationViewService { + + /** + * + * @param officeId + * @param filterBy + * @param map + * @return + */ + public Long countAllCustomerWithOutRenovationByOfficePaginator(String officeId, String filterBy, Map map); + + /** + * + * @param officeId + * @param first + * @param pageSize + * @param filterBy + * @param sortBy + * @param sorting + * @param map + * @return + */ + public List findAllCustomerWithOutRenovationByOfficePaginator(String officeId, int first, int pageSize, String filterBy, String sortBy, String sorting, Map map); +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/dashboard/CustomerWithoutRenovationViewServiceImpl.java b/ace-controller/src/main/java/com/arrebol/apc/controller/dashboard/CustomerWithoutRenovationViewServiceImpl.java new file mode 100644 index 0000000..1ecc584 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/dashboard/CustomerWithoutRenovationViewServiceImpl.java @@ -0,0 +1,154 @@ +/* + * 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.controller.dashboard; + +import com.arrebol.apc.controller.util.FilterMap; +import com.arrebol.apc.controller.util.HibernateUtil; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.views.CustomerWithoutRenovationView; +import java.util.List; +import java.util.Map; +import javax.enterprise.context.RequestScoped; +import javax.persistence.Query; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.hibernate.HibernateException; +import org.hibernate.Session; +import org.hibernate.Transaction; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@RequestScoped +public class CustomerWithoutRenovationViewServiceImpl implements CustomerWithoutRenovationViewService { + + @Override + public Long countAllCustomerWithOutRenovationByOfficePaginator(String officeId, String filterBy, Map map) { + logger.debug("countAllCustomerWithOutRenovationByOfficePaginator"); + + Long result = 0l; + Session session = null; + Transaction transaction = null; + try { + session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + StringBuilder sqlQuery = new StringBuilder("SELECT COUNT(id) FROM CustomerWithoutRenovationView "); + + sqlQuery.append(buildQueryForCustomerWithoutRenovationView(filterBy, map)); + + result = session + .createQuery(sqlQuery.toString(), Long.class) + .setParameter("office", new Office(officeId)) + .getSingleResult(); + + transaction.commit(); + } catch (HibernateException e) { + logger.error("countAllCustomerWithOutRenovationByOfficePaginator Hibernate", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + } catch (Exception e) { + logger.error("Method countAllCustomerWithOutRenovationByOfficePaginator() ", e); + if (null != transaction) { + transaction.rollback(); + throw e; + } + } finally { + if (null != session) { + session.close(); + } + } + return result; + } + + @Override + public List findAllCustomerWithOutRenovationByOfficePaginator(String officeId, int first, int pageSize, String filterBy, String sortBy, String sorting, Map map) { + logger.debug("findAllCustomerWithOutRenovationByOfficePaginator"); + + List results = null; + Session session = null; + Transaction transaction = null; + try { + session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + StringBuilder sqlQuery = new StringBuilder("FROM CustomerWithoutRenovationView "); + + sqlQuery.append(buildQueryForCustomerWithoutRenovationView(filterBy, map)); + sqlQuery.append(" ORDER BY "); + + if (null == sortBy || "".equals(sortBy)) { + sqlQuery.append("personName ASC"); + } else { + sqlQuery.append(sortBy); + sqlQuery.append(" "); + sqlQuery.append(sorting); + } + + Query query = session.createQuery(sqlQuery.toString(), CustomerWithoutRenovationView.class); + + query.setFirstResult(first); + query.setMaxResults(pageSize); + + results = query.setParameter("office", new Office(officeId)).getResultList(); + + transaction.commit(); + } catch (HibernateException e) { + logger.error("findAllCustomerWithOutRenovationByOfficePaginator Hibernate", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + } catch (Exception e) { + logger.error("Method findAllCustomerWithOutRenovationByOfficePaginator() ", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + } finally { + if (null != session) { + session.close(); + } + } + return results; + } + + /** + * + * @param filterBy + * @param map + * @return + */ + private StringBuilder buildQueryForCustomerWithoutRenovationView( + String filterBy, Map map) { + StringBuilder sqlQuery = new StringBuilder("WHERE office = :office "); + + if (null != filterBy & !"".equals(filterBy)) { + sqlQuery.append("AND (personName LIKE '"); + sqlQuery.append(filterBy); + sqlQuery.append("' OR "); + + sqlQuery.append("routeName LIKE '"); + sqlQuery.append(filterBy); + sqlQuery.append("' OR "); + + sqlQuery.append("strPaymentDate LIKE '"); + sqlQuery.append(filterBy); + sqlQuery.append("') "); + } + + sqlQuery.append(FilterMap.genericFilterByMapping(map, true)); + + return sqlQuery; + } + + final Logger logger = LogManager.getLogger(getClass()); +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/dashboard/DashboardController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/dashboard/DashboardController.java new file mode 100644 index 0000000..b2a942b --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/dashboard/DashboardController.java @@ -0,0 +1,150 @@ +/* + * 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.controller.dashboard; + +import com.arrebol.apc.controller.util.FilterMap; +import com.arrebol.apc.controller.util.HibernateUtil; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.payroll.TotalExpectedPaymentDailyByUser; +import com.arrebol.apc.model.payroll.constance.TotalExpectedPaymentDailyByUserCfg; +import com.arrebol.apc.model.views.AdvanceUserDailyDetail; +import com.arrebol.apc.model.views.AdvanceUserDailyView; +import com.arrebol.apc.model.views.CustomerWithoutRenovationView; +import com.arrebol.apc.model.views.TotalLoansByOfficeView; +import com.arrebol.apc.model.views.constance.AdvanceUserDailyDetailViewCfg; +import com.arrebol.apc.model.views.constance.AdvanceUserDailyViewCfg; +import com.arrebol.apc.model.views.constance.CustomerWithoutRenovationViewCfg; +import com.arrebol.apc.model.views.constance.TotalLoansApprovedByOfficeViewCfg; +import com.arrebol.apc.model.views.constance.TotalLoansByOfficeViewCfg; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import javax.persistence.Query; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.hibernate.HibernateException; +import org.hibernate.Session; +import org.hibernate.Transaction; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public class DashboardController implements Serializable { + + /** + * + * Searching loans by office. + * + * @param officeId + * @return + */ + public List fillAllLoansByOffice(String officeId) { + logger.debug("fillClosingDayDatatable"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(TotalLoansByOfficeViewCfg.FIELD_VIEW_OFFICE, officeId)); + + return genericEntityRepository.xmlQueryAPCEntities(TotalLoansByOfficeView.class, TotalLoansByOfficeViewCfg.QUERY_FIND_ALL_LOANS_BY_OFFICE, parameters); + } + + /** + * + * Searching loans by office. + * + * @param officeId + * @return + */ + public BigDecimal sumLoansApprovedByOffice(String officeId) { + logger.debug("sumLoansApprovedByOffice"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(TotalLoansApprovedByOfficeViewCfg.FIELD_VIEW_OFFICE, officeId)); + + return (BigDecimal) genericEntityRepository.xmlQueryAPCEntityUniqueResult(BigDecimal.class, TotalLoansApprovedByOfficeViewCfg.QUERY_SUM_ALL_LOANS_BY_OFFICE, parameters); + } + + public Long getLoansSumPaymentDailyByUser(String userId) { + logger.debug("getLoansSumPaymentDailyByUser"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(TotalLoansByOfficeViewCfg.FIELD_VIEW_USER, userId)); + + return (Long) genericEntityRepository.xmlQueryAPCEntityUniqueResult(Long.class, TotalLoansByOfficeViewCfg.QUERY_COUNT_ALL_LOANS_BY_USER, parameters); + } + + public BigDecimal getLoansSumPaymentDailyByUserMoney(String userId) { + logger.debug("getLoansSumPaymentDailyByUserMoney"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(TotalLoansByOfficeViewCfg.FIELD_VIEW_USER, userId)); + + return (BigDecimal) genericEntityRepository.xmlQueryAPCEntityUniqueResult(BigDecimal.class, TotalLoansByOfficeViewCfg.QUERY_FIND_ALL_LOANS_BY_USER, parameters); + } + + /** + * + * @param advance + * @return boolean + */ + public boolean saveTotalExpectedPaymentDailyByUser(TotalExpectedPaymentDailyByUser totalExpectedPaymentDailyByUser) { + logger.debug("saveTotalExpectedPaymentDailyByUser"); + boolean success = genericEntityRepository.insertAPCEntity(totalExpectedPaymentDailyByUser); + + return success; + + } + + public Long verifyTotalExpectedPaymentDailyByUserCreatedByOffice(String officeid) { + logger.debug("verifyTotalExpectedPaymentDailyByUserCreatedByOffice"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(TotalExpectedPaymentDailyByUserCfg.FIELD_OFFICE, new Office(officeid))); + + return (Long) genericEntityRepository.xmlQueryAPCEntityUniqueResult(Long.class, TotalExpectedPaymentDailyByUserCfg.QUERY_SELECT_MAX_DATE_BY_CURDATE, parameters); + } + + public List fillAllAdvanceUserDailyByOffice(String officeId) { + logger.debug("fillAllAdvanceUserDailyByOffice"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(AdvanceUserDailyViewCfg.FIELD_VIEW_OFFICE, new Office(officeId))); + + return genericEntityRepository.xmlQueryAPCEntities(AdvanceUserDailyView.class, AdvanceUserDailyViewCfg.QUERY_FIND_ALL_ADVANCE_USER_DAILY_BY_OFFICE, parameters); + } + + public List findAllCustomerWithOutRenovationByOffice(String officeId) { + logger.debug("findAllCustomerWithOutRenovationByOffice"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(CustomerWithoutRenovationViewCfg.FIELD_VIEW_OFFICE, new Office(officeId))); + + return genericEntityRepository.xmlQueryAPCEntities(CustomerWithoutRenovationView.class, CustomerWithoutRenovationViewCfg.QUERY_FIND_ALL_CUSTOMER_WITHOUT_RENOVATION_BY_OFFICE, parameters); + } + + public List findAllAdvancesUserDailyDetailByUser(String userId) { + logger.debug("findAllAdvancesUserDailyDetailByUser"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(AdvanceUserDailyDetailViewCfg.FIELD_VIEW_USER, userId)); + + return genericEntityRepository.xmlQueryAPCEntities(AdvanceUserDailyDetail.class, AdvanceUserDailyDetailViewCfg.QUERY_FIND_ALL_ADVANCE_USER_DAILY_DETAIL_BY_USER, parameters); + } + + final Logger logger = LogManager.getLogger(DashboardController.class); + private final GenericEntityRepository genericEntityRepository; + + public DashboardController() { + this.genericEntityRepository = new GenericEntityRepository(); + } + +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/drive/DriverController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/drive/DriverController.java new file mode 100644 index 0000000..aecbea7 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/drive/DriverController.java @@ -0,0 +1,1434 @@ +/* + * 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.controller.drive; + +import com.arrebol.apc.controller.util.ConnectionManager; +import com.arrebol.apc.controller.util.HibernateUtil; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.views.CobranzaLastWeekByUserView; +import com.arrebol.apc.model.views.CobranzaWeekByUserView; +import com.arrebol.apc.model.views.ColocationLastWeekByUserView; +import com.arrebol.apc.model.views.ColocationWeekByUserView; +import com.arrebol.apc.model.views.InformationLoanLastWeekView; +import com.arrebol.apc.model.views.InformationLoanWeekView; +import com.arrebol.apc.model.views.ResumeNewCustomerLastWeekView; +import com.arrebol.apc.model.views.ResumeNewCustomerWeekView; +import com.arrebol.apc.model.views.ResumenInOutLastWeekByUserView; +import com.arrebol.apc.model.views.ResumenInOutWeekByUserView; +import com.arrebol.apc.model.views.ResumenTotalLastWeekView; +import com.arrebol.apc.model.views.ResumenTotalWeekView; +import com.arrebol.apc.model.views.SubtotalLastWeekByUserView; +import com.arrebol.apc.model.views.SubtotalWeekByUserView; +import com.arrebol.apc.model.views.constance.InformationLoanWeekViewCfg; +import com.arrebol.apc.model.views.constance.ResumenNewCustomerLastWeekViewCfg; +import com.arrebol.apc.model.views.constance.ResumenNewCustomerWeekViewCfg; +import com.arrebol.apc.model.views.constance.ResumenTotalLastWeekViewCfg; +import com.arrebol.apc.model.views.constance.ResumenTotalWeekViewCfg; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.math.BigDecimal; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.hibernate.HibernateException; +import org.hibernate.Session; +import org.hibernate.Transaction; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public class DriverController extends ConnectionManager implements Serializable{ + + /** + * + * Searching all loans with activity at this week by office. + * + * @param officeId + * @return + */ + public List getAllLoanThisWeekByOffice(String officeId) { + logger.debug("getAllLoanThisWeekByOffice"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(InformationLoanWeekViewCfg.FIELD_VIEW_OFFICE, officeId)); + + return genericEntityRepository.xmlQueryAPCEntities(InformationLoanWeekView.class, InformationLoanWeekViewCfg.QUERY_FIND_ALL_LOANS_THIS_WEEK_BY_OFFICE, parameters); + } + + public List getAllLoanLastWeekByOffice(String officeId) { + logger.debug("getAllLoanLastWeekByOffice"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(InformationLoanWeekViewCfg.FIELD_VIEW_OFFICE, officeId)); + + return genericEntityRepository.xmlQueryAPCEntities(InformationLoanLastWeekView.class, InformationLoanWeekViewCfg.QUERY_FIND_ALL_LOANS_LAST_WEEK_BY_OFFICE, parameters); + } + + public List getAllColocationWeekByOffice(String officeId) { + logger.debug("getAllColocationWeekByOffice"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(InformationLoanWeekViewCfg.FIELD_VIEW_OFFICE_COLOCATION, new Office(officeId))); + + return genericEntityRepository.xmlQueryAPCEntities(ColocationWeekByUserView.class, InformationLoanWeekViewCfg.QUERY_FIND_ALL_COLOCATION_WEEK_BY_OFFICE, parameters); + } + + public List getAllColocationLastWeekByOffice(String officeId) { + logger.debug("getAllColocationLastWeekByOffice"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(InformationLoanWeekViewCfg.FIELD_VIEW_OFFICE_COLOCATION, new Office(officeId))); + + return genericEntityRepository.xmlQueryAPCEntities(ColocationLastWeekByUserView.class, InformationLoanWeekViewCfg.QUERY_FIND_ALL_COLOCATION_LAST_WEEK_BY_OFFICE, parameters); + } + + public List getAllSubtotalLastWeekByOffice(String officeId) { + logger.debug("getAllSubtotalLastWeekByOffice"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(InformationLoanWeekViewCfg.FIELD_VIEW_OFFICE_COLOCATION, new Office(officeId))); + + return genericEntityRepository.xmlQueryAPCEntities(SubtotalLastWeekByUserView.class, InformationLoanWeekViewCfg.QUERY_FIND_ALL_SUBTOTAL_LAST_WEEK_BY_OFFICE, parameters); + } + + public List getAllSubtotalThisWeekByOffice(String officeId) { + logger.debug("getAllSubtotalThisWeekByOffice"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(InformationLoanWeekViewCfg.FIELD_VIEW_OFFICE_COLOCATION, new Office(officeId))); + + return genericEntityRepository.xmlQueryAPCEntities(SubtotalWeekByUserView.class, InformationLoanWeekViewCfg.QUERY_FIND_ALL_SUBTOTAL_WEEK_BY_OFFICE, parameters); + } + + public List getAllResumenInOutThisWeekByOffice(String officeId) { + logger.debug("getAllResumenInOutThisWeekByOffice"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(InformationLoanWeekViewCfg.FIELD_VIEW_OFFICE_COLOCATION, new Office(officeId))); + + return genericEntityRepository.xmlQueryAPCEntities(ResumenInOutWeekByUserView.class, InformationLoanWeekViewCfg.QUERY_FIND_ALL_RESUMEN_IN_OUT_WEEK_BY_OFFICE, parameters); + } + + public List getAllResumenInOutLastWeekByOffice(String officeId) { + logger.debug("getAllResumenInOutLastWeekByOffice"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(InformationLoanWeekViewCfg.FIELD_VIEW_OFFICE_COLOCATION, new Office(officeId))); + + return genericEntityRepository.xmlQueryAPCEntities(ResumenInOutLastWeekByUserView.class, InformationLoanWeekViewCfg.QUERY_FIND_ALL_RESUMEN_IN_OUT_LAST_WEEK_BY_OFFICE, parameters); + } + + public List getAllCobranzaLastWeekByOffice(String officeId) { + logger.debug("getAllCobranzaLastWeekByOffice"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(InformationLoanWeekViewCfg.FIELD_VIEW_OFFICE_COLOCATION, new Office(officeId))); + + return genericEntityRepository.xmlQueryAPCEntities(CobranzaLastWeekByUserView.class, InformationLoanWeekViewCfg.QUERY_FIND_ALL_COBRANZA_LAST_WEEK_BY_OFFICE, parameters); + } + + public List getAllCobranzaThisWeekByOffice(String officeId) { + logger.debug("getAllCobranzaThisWeekByOffice"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(InformationLoanWeekViewCfg.FIELD_VIEW_OFFICE_COLOCATION, new Office(officeId))); + + return genericEntityRepository.xmlQueryAPCEntities(CobranzaWeekByUserView.class, InformationLoanWeekViewCfg.QUERY_FIND_ALL_COBRANZA_WEEK_BY_OFFICE, parameters); + } + + public List getAllResumenTotalLastWeekByOffice(String officeId) { + logger.debug("getAllResumenTotalLastWeekByOffice"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(ResumenTotalLastWeekViewCfg.FIELD_VIEW_OFFICE, officeId)); + + return genericEntityRepository.xmlQueryAPCEntities(ResumenTotalLastWeekView.class, ResumenTotalLastWeekViewCfg.QUERY_FIND_ALL_RESUMEN_TOTAL, parameters); + } + + public List getAllResumenNewCustomerLastWeekByOffice() { + logger.debug("getAllResumenNewCustomerLastWeekByOffice"); + List parameters = new ArrayList<>(); + + return genericEntityRepository.xmlQueryAPCEntities(ResumeNewCustomerLastWeekView.class, ResumenNewCustomerLastWeekViewCfg.QUERY_FIND_ALL_RESUMEN_NEW_CUSTOMER, parameters); + } + + public List getAllResumenNewCustomerWeekByOffice() { + logger.debug("getAllResumenNewCustomerWeekByOffice"); + List parameters = new ArrayList<>(); + + return genericEntityRepository.xmlQueryAPCEntities(ResumeNewCustomerWeekView.class, ResumenNewCustomerWeekViewCfg.QUERY_FIND_ALL_RESUMEN_NEW_CUSTOMER, parameters); + } + + public List getAllResumenTotalWeekByOffice(String officeId) { + logger.debug("getAllResumenTotalWeekByOffice"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(ResumenTotalWeekViewCfg.FIELD_VIEW_OFFICE, officeId)); + + return genericEntityRepository.xmlQueryAPCEntities(ResumenTotalWeekView.class, ResumenTotalWeekViewCfg.QUERY_FIND_ALL_RESUMEN_TOTAL, parameters); + } + + /** + * + * Searching all loans with activity at this week by office. + * @param startDate + * @param officeId + * @return + */ + public List getAllLoanWeekByOfficeMySQLQuery(String startDate, String idOffice) { + logger.debug("getAllLoanWeekByOfficeMySQLQuery"); + logger.debug("Fecha inicial: " + startDate); + + List dataList = new ArrayList<>(); + Transaction transaction = null; + + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd"); + + List rows = session.createNativeQuery(queryLoanWeek) + .setParameter("startDate", startDate) + .setParameter("idOffice", idOffice) + .getResultList(); + + transaction.commit(); + + rows.forEach((row) -> { + Object[] results = (Object[]) row; + + // Create Data Row + InformationLoanWeekView loanWeek = new InformationLoanWeekView( ); + loanWeek.setId(results[0] == null ? "" : results[0].toString()); + loanWeek.setIdUser(results[1] == null ? "" : results[1].toString()); + loanWeek.setIdOffice(results[2] == null ? "" : results[2].toString()); + try { + loanWeek.setFecha(DATE_FORMAT.parse(results[3].toString())); + } catch (ParseException ex) { + logger.error("driver week", ex); + } + loanWeek.setApoyos(new BigDecimal(results[4] == null ? "0.0" : results[4].toString())); + loanWeek.setApoyosTotal(new BigDecimal(results[5] == null ? "0.0" : results[5].toString())); + loanWeek.setComisionApertura(new BigDecimal(results[6] == null ? "0.0" : results[6].toString())); + loanWeek.setAval(results[7] == null ? "" : results[7].toString()); + loanWeek.setCustomer(results[8] == null ? "" : results[8].toString()); + loanWeek.setDocumentoPor(new BigDecimal(results[9] == null ? "0.0" : results[9].toString())); + loanWeek.setAbonoDiario(new BigDecimal(results[10] == null ? "0.0" : results[10].toString())); + loanWeek.setAmountPaid(new BigDecimal(results[11] == null ? "0.0" : results[11].toString())); + loanWeek.setSaldoInsoluto(new BigDecimal(results[12] == null ? "0.0" : results[12].toString())); + loanWeek.setRouteName(results[13] == null ? "" : results[13].toString()); + loanWeek.setAsesor(results[14] == null ? "" : results[14].toString()); + loanWeek.setNumFee(Integer.parseInt(results[15] == null ? "0" : results[15].toString())); + loanWeek.setPaymentMonday(new BigDecimal(results[16] == null ? "0.0" : results[16].toString())); + loanWeek.setFeeMonday(new BigDecimal(results[17] == null ? "0.0" : results[17].toString())); + loanWeek.setPaymentTuesday(new BigDecimal(results[18] == null ? "0.0" : results[18].toString())); + loanWeek.setFeeTuesday(new BigDecimal(results[19] == null ? "0.0" : results[19].toString())); + loanWeek.setPaymentWednesday(new BigDecimal(results[20] == null ? "0.0" : results[20].toString())); + loanWeek.setFeeWednesday(new BigDecimal(results[21] == null ? "0.0" : results[21].toString())); + loanWeek.setPaymentThursday(new BigDecimal(results[22] == null ? "0.0" : results[22].toString())); + loanWeek.setFeeThursday(new BigDecimal(results[23] == null ? "0.0" : results[23].toString())); + loanWeek.setPaymentFriday(new BigDecimal(results[24] == null ? "0.0" : results[24].toString())); + loanWeek.setFeeFriday(new BigDecimal(results[25] == null ? "0.0" : results[25].toString())); + loanWeek.setPaymentSaturday(new BigDecimal(results[26] == null ? "0.0" : results[26].toString())); + loanWeek.setFeeSaturday(new BigDecimal(results[27] == null ? "0.0" : results[27].toString())); + loanWeek.setFaltante(new BigDecimal(results[28] == null ? "0.0" : results[28].toString())); + loanWeek.setNewCustomer(results[29] == null ? "" : results[29].toString()); + loanWeek.setRenovation(results[30] == null ? "" : results[30].toString()); + loanWeek.setEstatusPrestamo(results[31] == null ? "" : results[31].toString()); + loanWeek.setNumPagosAll(new BigDecimal(results[32] == null ? "0.0" : results[32].toString())); + loanWeek.setNumPagosWeek(new BigDecimal(results[33] == null ? "0.0" : results[33].toString())); + loanWeek.setFeeTodos(new BigDecimal(results[34] == null ? "0.0" : results[34].toString())); + loanWeek.setLoanTypeName(results[35] == null ? "" : results[35].toString()); + if (results[36] == null) { + loanWeek.setFrozen(ActiveStatus.DISABLED); + } else { + if (results[36].equals(ActiveStatus.ENEBLED.getValue())) { + loanWeek.setFrozen(ActiveStatus.ENEBLED); + } else { + loanWeek.setFrozen(ActiveStatus.DISABLED); + } + } + loanWeek.setTotalPaid(new BigDecimal(results[37].toString())); + loanWeek.setNumPagosLoanType(new BigDecimal(results[38] == null ? "0.0" : results[38].toString())); + loanWeek.setMovimientosMonday(results[39] == null ? "" : results[39].toString()); + loanWeek.setMovimientosTuesday(results[40] == null ? "" : results[40].toString()); + loanWeek.setMovimientosWednesday(results[41] == null ? "" : results[41].toString()); + loanWeek.setMovimientosThursday(results[42] == null ? "" : results[42].toString()); + loanWeek.setMovimientosFriday(results[43] == null ? "" : results[43].toString()); + loanWeek.setMovimientosSaturday(results[44] == null ? "" : results[44].toString()); + loanWeek.setRenovationMonday(results[45] == null ? "" : results[45].toString()); + loanWeek.setRenovationTuesday(results[46] == null ? "" : results[46].toString()); + loanWeek.setRenovationWednesday(results[47] == null ? "" : results[47].toString()); + loanWeek.setRenovationThursday(results[48] == null ? "" : results[48].toString()); + loanWeek.setRenovationFriday(results[49] == null ? "" : results[49].toString()); + loanWeek.setRenovationSaturday(results[50] == null ? "" : results[50].toString()); + loanWeek.setReactivation(results[51] == null ? "" : results[51].toString()); + loanWeek.setWeekOfCreation(results[52] == null ? "" : results[52].toString()); + dataList.add(loanWeek); + }); + + } catch (HibernateException e) { + logger.error("Driver", e); + rollback(transaction); + } catch (Exception e) { + logger.error("Method getAllLoanWeekByOfficeMySQLQuery(" + startDate + " " + ") ", e); + rollback(transaction); + } + + return dataList; + } + + /** + * + * Searching all loans with activity at this week by office. + * @param startDate + * @param officeId + * @return + */ + public List getAllColocationWeekByOfficeMySQLQuery(String startDate, String idOffice){ + logger.debug("getAllColocationWeekByOfficeMySQLQuery"); + + List dataList = new ArrayList<>(); + Transaction transaction = null; + + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + List rows = session.createNativeQuery(queryColocation) + .setParameter("startDate", startDate) + .setParameter("idOffice", idOffice) + .getResultList(); + + transaction.commit(); + + rows.forEach((row) -> { + Object[] results = (Object[]) row; + + // Create Data Row + ColocationWeekByUserView colocation = new ColocationWeekByUserView( ); + colocation.setId(results[0] == null ? "" : results[0].toString()); + colocation.setUserName(results[1] == null ? "" : results[1].toString()); + colocation.setOffice(new Office(idOffice)); + colocation.setColocationMonday(new BigDecimal(results[3] == null ? "0.0" : results[3].toString())); + colocation.setColocationTuesday(new BigDecimal(results[4] == null ? "0.0" : results[4].toString())); + colocation.setColocationWednesday(new BigDecimal(results[5] == null ? "0.0" : results[5].toString())); + colocation.setColocationThursday(new BigDecimal(results[6] == null ? "0.0" : results[6].toString())); + colocation.setColocationFriday(new BigDecimal(results[7] == null ? "0.0" : results[7].toString())); + colocation.setColocationSaturday(new BigDecimal(results[8] == null ? "0.0" : results[8].toString())); + colocation.setColocationTotal(new BigDecimal(results[9] == null ? "0.0" : results[9].toString())); + + dataList.add(colocation); + }); + + } catch (HibernateException e) { + logger.error("Driver", e); + rollback(transaction); + } catch (Exception e) { + logger.error("Method getAllColocationWeekByOfficeMySQLQuery(" + idOffice + " " + ") ", e); + rollback(transaction); + } + + return dataList; + } + + /** + * + * Searching all loans with activity at this week by office. + * @param startDate + * @param officeId + * @return + */ + public List getAllSubtotalThisWeekByOfficeMySQLQuery(String startDate, String idOffice) { + logger.debug("getAllSubtotalThisWeekByOfficeMySQLQuery"); + + List dataList = new ArrayList<>(); + Transaction transaction = null; + + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + List rows = session.createNativeQuery(querySubtotal) + .setParameter("startDate", startDate) + .setParameter("idOffice", idOffice) + .getResultList(); + + transaction.commit(); + + rows.forEach((row) -> { + Object[] results = (Object[]) row; + + // Create Data Row + SubtotalWeekByUserView subtotal = new SubtotalWeekByUserView( ); + subtotal.setId(results[0] == null ? "" : results[0].toString()); + subtotal.setUserName(results[1] == null ? "" : results[1].toString()); + subtotal.setOffice(new Office(idOffice)); + subtotal.setSubtotalMonday(new BigDecimal(results[3] == null ? "0.0" : results[3].toString())); + subtotal.setOpeningFeeMonday(new BigDecimal(results[4] == null ? "0.0" : results[4].toString())); + subtotal.setSubtotalTuesday(new BigDecimal(results[5] == null ? "0.0" : results[5].toString())); + subtotal.setOpeningFeeTuesday(new BigDecimal(results[6] == null ? "0.0" : results[6].toString())); + subtotal.setSubtotalWednesday(new BigDecimal(results[7] == null ? "0.0" : results[7].toString())); + subtotal.setOpeningFeeWednesday(new BigDecimal(results[8] == null ? "0.0" : results[8].toString())); + subtotal.setSubtotalThursday(new BigDecimal(results[9] == null ? "0.0" : results[9].toString())); + subtotal.setOpeningFeeThursday(new BigDecimal(results[10] == null ? "0.0" : results[10].toString())); + subtotal.setSubtotalFriday(new BigDecimal(results[11] == null ? "0.0" : results[11].toString())); + subtotal.setOpeningFeeFriday(new BigDecimal(results[12] == null ? "0.0" : results[12].toString())); + subtotal.setSubtotalSaturday(new BigDecimal(results[13] == null ? "0.0" : results[13].toString())); + subtotal.setOpeningFeeSaturday(new BigDecimal(results[14] == null ? "0.0" : results[14].toString())); + subtotal.setSubtotalTotal(new BigDecimal(results[15] == null ? "0.0" : results[15].toString())); + + dataList.add(subtotal); + }); + + } catch (HibernateException e) { + logger.error("Driver", e); + rollback(transaction); + } catch (Exception e) { + logger.error("Method getAllSubtotalThisWeekByOfficeMySQLQuery(" + idOffice + " " + ") ", e); + rollback(transaction); + } + + return dataList; + } + + /** + * + * Searching all loans with activity at this week by office. + * @param startDate + * @param officeId + * @return + */ + public List getAllResumenInOutThisWeekByOfficeMySQLQuery(String startDate, String idOffice) { + logger.debug("getAllResumenInOutThisWeekByOffice"); + + List dataList = new ArrayList<>(); + Transaction transaction = null; + + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + List rows = session.createNativeQuery(queryResumenInOut) + .setParameter("startDate", startDate) + .setParameter("idOffice", idOffice) + .getResultList(); + + transaction.commit(); + + rows.forEach((row) -> { + Object[] results = (Object[]) row; + + // Create Data Row + ResumenInOutWeekByUserView resumen = new ResumenInOutWeekByUserView( ); + resumen.setId(results[0] == null ? "" : results[0].toString()); + resumen.setUserName(results[1] == null ? "" : results[1].toString()); + resumen.setOffice(new Office(idOffice)); + resumen.setClosingMonday(new BigDecimal(results[3] == null ? "0.0" : results[3].toString())); + resumen.setExpenseMonday(new BigDecimal(results[4] == null ? "0.0" : results[4].toString())); + resumen.setMoneyDailyTodayMonday(new BigDecimal(results[5] == null ? "0.0" : results[5].toString())); + resumen.setClosingTuesday(new BigDecimal(results[6] == null ? "0.0" : results[6].toString())); + resumen.setExpenseTuesday(new BigDecimal(results[7] == null ? "0.0" : results[7].toString())); + resumen.setMoneyDailyTodayTuesday(new BigDecimal(results[8] == null ? "0.0" : results[8].toString())); + resumen.setClosingWednesday(new BigDecimal(results[9] == null ? "0.0" : results[9].toString())); + resumen.setExpenseWednesday(new BigDecimal(results[10] == null ? "0.0" : results[10].toString())); + resumen.setMoneyDailyTodayWednesday(new BigDecimal(results[11] == null ? "0.0" : results[11].toString())); + resumen.setClosingThursday(new BigDecimal(results[12] == null ? "0.0" : results[12].toString())); + resumen.setExpenseThursday(new BigDecimal(results[13] == null ? "0.0" : results[13].toString())); + resumen.setMoneyDailyTodayThursday(new BigDecimal(results[14] == null ? "0.0" : results[14].toString())); + resumen.setClosingFriday(new BigDecimal(results[15] == null ? "0.0" : results[15].toString())); + resumen.setExpenseFriday(new BigDecimal(results[16] == null ? "0.0" : results[16].toString())); + resumen.setMoneyDailyTodayFriday(new BigDecimal(results[17] == null ? "0.0" : results[17].toString())); + resumen.setClosingSaturday(new BigDecimal(results[18] == null ? "0.0" : results[18].toString())); + resumen.setExpenseSaturday(new BigDecimal(results[19] == null ? "0.0" : results[19].toString())); + resumen.setMoneyDailyTodaySaturday(new BigDecimal(results[20] == null ? "0.0" : results[20].toString())); + + dataList.add(resumen); + }); + + } catch (HibernateException e) { + logger.error("Driver", e); + rollback(transaction); + } catch (Exception e) { + logger.error("Method getAllResumenInOutThisWeekByOffice(" + idOffice + " " + ") ", e); + rollback(transaction); + } + + return dataList; + } + + /** + * Searching all loans with activity at this week by office. + * @param startDate + * @param officeId + * @return + */ + public List getAllCobranzaThisWeekByOfficeMySQLQuery(String startDate, String idOffice) { + logger.debug("getAllCobranzaThisWeekByOfficeMySQLQuery"); + + List dataList = new ArrayList<>(); + Transaction transaction = null; + + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + List rows = session.createNativeQuery(queryCobranza) + .setParameter("startDate", startDate) + .setParameter("idOffice", idOffice) + .getResultList(); + + transaction.commit(); + + rows.forEach((row) -> { + Object[] results = (Object[]) row; + + // Create Data Row + CobranzaWeekByUserView cobranza = new CobranzaWeekByUserView( ); + cobranza.setId(results[0] == null ? "" : results[0].toString()); + cobranza.setUserName(results[1] == null ? "" : results[1].toString()); + cobranza.setOffice(new Office(idOffice)); + cobranza.setCobranzaMonday(new BigDecimal(results[3] == null ? "0.0" : results[3].toString())); + cobranza.setCobranzaTuesday(new BigDecimal(results[4] == null ? "0.0" : results[4].toString())); + cobranza.setCobranzaWednesday(new BigDecimal(results[5] == null ? "0.0" : results[5].toString())); + cobranza.setCobranzaThursday(new BigDecimal(results[6] == null ? "0.0" : results[6].toString())); + cobranza.setCobranzaFriday(new BigDecimal(results[7] == null ? "0.0" : results[7].toString())); + cobranza.setCobranzaSaturday(new BigDecimal(results[8] == null ? "0.0" : results[8].toString())); + cobranza.setCobranzaTotal(new BigDecimal(results[9] == null ? "0.0" : results[9].toString())); + + dataList.add(cobranza); + }); + + } catch (HibernateException e) { + logger.error("Driver", e); + rollback(transaction); + } catch (Exception e) { + logger.error("Method getAllCobranzaThisWeekByOfficeMySQLQuery(" + idOffice + " " + ") ", e); + rollback(transaction); + } + + return dataList; + } + /** + * Searching all loans with activity at this week by office. + * @param startDate + * @param officeId + * @return + */ + public List getAllResumenTotalWeekByOfficeMySQLQuery(String startDate, String idOffice) { + logger.debug("getAllResumenTotalWeekByOfficeMySQLQuery"); + + List dataList = new ArrayList<>(); + Transaction transaction = null; + + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + List rows = session.createNativeQuery(queryResumenTotal) + .setParameter("startDate", startDate) + .setParameter("idOffice", idOffice) + .getResultList(); + + transaction.commit(); + + rows.forEach((row) -> { + Object[] results = (Object[]) row; + + // Create Data Row + ResumenTotalWeekView resumenTotal = new ResumenTotalWeekView( ); + resumenTotal.setId(results[0] == null ? "" : results[0].toString()); + resumenTotal.setOfficeName(results[1] == null ? "" : results[1].toString()); + resumenTotal.setClosingDayTotal(new BigDecimal(results[2] == null ? "0.0" : results[3].toString())); + resumenTotal.setMoneyDailyTodayTotal(new BigDecimal(results[3] == null ? "0.0" : results[3].toString())); + resumenTotal.setSubtotalTotal(new BigDecimal(results[4] == null ? "0.0" : results[4].toString())); + resumenTotal.setOpeningFeeTotal(new BigDecimal(results[5] == null ? "0.0" : results[5].toString())); + resumenTotal.setCobranzaToday(new BigDecimal(results[6] == null ? "0.0" : results[6].toString())); + resumenTotal.setColocationTotal(new BigDecimal(results[7] == null ? "0.0" : results[7].toString())); + resumenTotal.setNominaTotal(new BigDecimal(results[8] == null ? "0.0" : results[8].toString())); + resumenTotal.setAdelantosTotal(new BigDecimal(results[9] == null ? "0.0" : results[9].toString())); + resumenTotal.setEntradasTotal(new BigDecimal(results[10] == null ? "0.0" : results[10].toString())); + resumenTotal.setGastosAdmonTotal(new BigDecimal(results[11] == null ? "0.0" : results[11].toString())); + + dataList.add(resumenTotal); + }); + + } catch (HibernateException e) { + logger.error("Driver", e); + rollback(transaction); + } catch (Exception e) { + logger.error("Method getAllResumenTotalWeekByOfficeMySQLQuery(" + idOffice + " " + ") ", e); + rollback(transaction); + } + + return dataList; + } + + final Logger logger = LogManager.getLogger(DriverController.class); + private final GenericEntityRepository genericEntityRepository; + + public DriverController() { + this.genericEntityRepository = new GenericEntityRepository(); + } + + private final String queryLoanWeek = +"SELECT " + +" l.id, " + +" u.id as id_user, " + +" r.id_office, " + +" l.created_on as fecha, " + +" lt.payment as apoyos, " + +" lt.payment_total as apoyos_total, " + +" lt.opening_fee as comision_apertura, " + +" CONCAT(endor.first_name,' ', IF(ISNULL(endor.second_name) ,'', CONCAT(endor.second_name,' ')) ,endor.last_name, ' ', endor.middle_name) AS aval, " + +" CONCAT(cus.first_name,' ', IF(ISNULL(cus.second_name) ,'', CONCAT(cus.second_name,' ')) ,cus.last_name, ' ', cus.middle_name) AS customer, " + +" l.amount_to_pay as documento_por, " + +" lt.payment_daily as abono_diario, " + +" l.amount_paid, " + +" (l.amount_to_pay - l.amount_paid) saldo_insoluto, " + +" r.route_name, " + +" CONCAT(hr.first_name,' ', IF(ISNULL(hr.second_name) ,'', CONCAT(hr.second_name,' ')) ,hr.last_name, ' ', hr.middle_name) AS asesor, " + +" (SELECT COUNT(lfn.id) FROM APC_LOAN_FEE_NOTIFICATION lfn WHERE lfn.id_loan = l.id) as num_fee, " + +//"-- Lunes " + +" (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) " + +" FROM APC_LOAN_DETAIL ldLunes \n" + +" WHERE ldLunes.id_loan = l.id AND ldLunes.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldLunes.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day))" + +" AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'monday' " + +" AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_monday, " + +" (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) " + +" FROM APC_LOAN_DETAIL ldLunes " + +" WHERE ldLunes.id_loan = l.id AND ldLunes.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldLunes.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day)) " + +" AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'monday' " + +" AND ldLunes.loan_details_type IN ('FEE')) as fee_monday, " + +//"-- Martes " + +" (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) " + +" FROM APC_LOAN_DETAIL ldLunes " + +" WHERE ldLunes.id_loan = l.id AND ldLunes.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldLunes.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day))" + +" AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'tuesday' " + +" AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_tuesday, " + +" (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) " + +" FROM APC_LOAN_DETAIL ldLunes " + +" WHERE ldLunes.id_loan = l.id AND ldLunes.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldLunes.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day)) " + +" AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'tuesday' " + +" AND ldLunes.loan_details_type IN ('FEE')) as fee_tuesday, " + +//"-- Miercoles " + +" (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) " + +" FROM APC_LOAN_DETAIL ldLunes " + +" WHERE ldLunes.id_loan = l.id AND ldLunes.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldLunes.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day))" + +" AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'wednesday' " + +" AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_wednesday, " + +" (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) " + +" FROM APC_LOAN_DETAIL ldLunes " + +" WHERE ldLunes.id_loan = l.id AND ldLunes.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldLunes.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day))" + +" AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'wednesday' " + +" AND ldLunes.loan_details_type IN ('FEE')) as fee_wednesday, " + +//"-- Jueves " + +" (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) " + +" FROM APC_LOAN_DETAIL ldLunes " + +" WHERE ldLunes.id_loan = l.id AND ldLunes.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldLunes.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day))" + +" AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'thursday' " + +" AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_thursday, " + +" (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) " + +" FROM APC_LOAN_DETAIL ldLunes " + +" WHERE ldLunes.id_loan = l.id AND ldLunes.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldLunes.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day)) " + +" AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'thursday' " + +" AND ldLunes.loan_details_type IN ('FEE')) as fee_thursday, " + +//"-- Viernes " + +" (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) " + +" FROM APC_LOAN_DETAIL ldLunes " + +" WHERE ldLunes.id_loan = l.id AND ldLunes.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldLunes.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day))" + +" AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'friday' " + +" AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_friday, " + +" (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) " + +" FROM APC_LOAN_DETAIL ldLunes " + +" WHERE ldLunes.id_loan = l.id AND ldLunes.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldLunes.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day))" + +" AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'friday' " + +" AND ldLunes.loan_details_type IN ('FEE')) as fee_friday, " + +//"-- Sabado " + +" (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) " + +" FROM APC_LOAN_DETAIL ldLunes " + +" WHERE ldLunes.id_loan = l.id AND ldLunes.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldLunes.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day))" + +" AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'saturday' " + +" AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_saturday, " + +" (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) " + +" FROM APC_LOAN_DETAIL ldLunes " + +" WHERE ldLunes.id_loan = l.id AND ldLunes.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldLunes.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day))" + +" AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'saturday' " + +" AND ldLunes.loan_details_type IN ('FEE')) as fee_saturday, " + +//"-- Faltante " + +" ((lt.payment_daily * (SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) > 5, 5 , COUNT(DISTINCT(DATE(ldFaltante.created_on)))) FROM APC_LOAN_DETAIL ldFaltante " + +" WHERE ldFaltante.id_loan = l.id AND WEEK(DATE(ldFaltante.created_on),1) = WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1) AND " + +" YEAR(DATE(ldFaltante.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('saturday','sunday') " + +" AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER', 'FEE'))) " + +" - (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) " + +" FROM APC_LOAN_DETAIL ldLunes " + +" WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1) AND " + +" YEAR(DATE(ldLunes.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +" AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER'))) as faltante, " + +//"-- new_customer " + +" CASE WHEN l.new_customer = 'ENEBLED' AND WEEK(DATE(l.created_on),1) = WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1) THEN 'Si' ELSE 'No' END as new_customer, " + +//"-- renovation " + +" if((SELECT COUNT(id_loan_old) FROM APC_LOAN_BY_RENOVATION lbr " + +" INNER JOIN APC_LOAN lRenovation ON lbr.id_loan_new = lRenovation.id " + +" WHERE id_loan_old = l.id " + +" AND loan_by_renovation_status = 'APPROVED' and WEEK(DATE(lRenovation.created_on),1) <= WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1) AND " + +" YEAR(DATE(lRenovation.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d'))) = 0 , 'No' , 'Si') as renovation, " + +//" -- estatus_prestamo " + +" l.loan_status as estatus_prestamo, " + +//"-- num_pagos_all " + +" (SELECT COUNT(DISTINCT(DATE(ldFaltante.created_on))) FROM APC_LOAN_DETAIL ldFaltante " + +" WHERE ldFaltante.id_loan = l.id AND ldFaltante.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('sunday') " + +" AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER', 'FEE')) as num_pagos_all, " + +//"-- num_pagos_week " + +" (SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) > 6, 6, COUNT(DISTINCT(DATE(ldFaltante.created_on)))) FROM APC_LOAN_DETAIL ldFaltante " + +" WHERE ldFaltante.id_loan = l.id AND ldFaltante.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldFaltante.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day)) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('sunday') " + +" AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER', 'FEE')) as num_pagos_week, " + +//"-- fee_todos " + +" (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) " + +" FROM APC_LOAN_DETAIL ldLunes " + +" WHERE ldLunes.id_loan = l.id AND ldLunes.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) " + +" AND ldLunes.loan_details_type IN ('FEE')) as fee_todos, " + +" lt.loan_type_name AS loan_type_name, " + +" l.frozen AS frozen, "+ + +" (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) " + +" FROM APC_LOAN_DETAIL ldLunes " + +" WHERE ldLunes.id_loan= l.id AND ldLunes.created_on <=(DATE_ADD(DATE_ADD(:startDate, INTERVAL -WEEKDAY(:startDate)-1 DAY), INTERVAL 7 DAY)) " + +" AND ldLunes.loan_details_type IN ('PAYMENT','TRANSFER','RENOVATION_PAYMENT')) AS totalPaid, " + +" lt.total_days AS numPagosLoanType, " + + +" (SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) >= 1, 'Si','No') FROM APC_LOAN_DETAIL ldFaltante \n" + +" WHERE ldFaltante.id_loan = l.id AND ldFaltante.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldFaltante.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day)) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('sunday')\n" + +" AND LOWER(DAYNAME(DATE(ldFaltante.created_on))) = 'monday' \n" + +" AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER','FEE')) as movimiento_monday, \n" + + +" (SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) >= 1, 'Si','No') FROM APC_LOAN_DETAIL ldFaltante \n" + +" WHERE ldFaltante.id_loan = l.id AND ldFaltante.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldFaltante.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day)) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('sunday')\n" + +" AND LOWER(DAYNAME(DATE(ldFaltante.created_on))) = 'tuesday' \n" + +" AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER','FEE')) as movimiento_tuesday, \n" + + +" (SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) >= 1, 'Si','No') FROM APC_LOAN_DETAIL ldFaltante \n" + +" WHERE ldFaltante.id_loan = l.id AND ldFaltante.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldFaltante.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day)) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('sunday')\n" + +" AND LOWER(DAYNAME(DATE(ldFaltante.created_on))) = 'wednesday' \n" + +" AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER','FEE')) as movimiento_wendsday, \n" + + +" (SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) >= 1, 'Si','No') FROM APC_LOAN_DETAIL ldFaltante \n" + +" WHERE ldFaltante.id_loan = l.id AND ldFaltante.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldFaltante.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day)) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('sunday')\n" + +" AND LOWER(DAYNAME(DATE(ldFaltante.created_on))) = 'thursday' \n" + +" AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER','FEE')) as movimiento_thursday,\n" + + +" (SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) >= 1, 'Si','No') FROM APC_LOAN_DETAIL ldFaltante \n" + +" WHERE ldFaltante.id_loan = l.id AND ldFaltante.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldFaltante.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day)) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('sunday')\n" + +" AND LOWER(DAYNAME(DATE(ldFaltante.created_on))) = 'friday' \n" + +" AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER','FEE')) as movimiento_friday,\n" + + +" (SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) >= 1= 1, 'Si','No') FROM APC_LOAN_DETAIL ldFaltante \n" + +" WHERE ldFaltante.id_loan = l.id AND ldFaltante.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldFaltante.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day)) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('sunday')\n" + +" AND LOWER(DAYNAME(DATE(ldFaltante.created_on))) = 'saturday' \n" + +" AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER','FEE')) as movimiento_saturday,\n" + + +" (SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) >= 1, 'Si','No') FROM APC_LOAN_DETAIL ldFaltante \n" + +" WHERE ldFaltante.id_loan = l.id AND ldFaltante.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldFaltante.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day)) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('sunday')\n" + +" AND LOWER(DAYNAME(DATE(ldFaltante.created_on))) = 'monday' \n" + +" AND ldFaltante.loan_details_type IN ('RENOVATION_PAYMENT')) as renovation_monday, \n" + + +" (SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) >= 1, 'Si','No') FROM APC_LOAN_DETAIL ldFaltante \n" + +" WHERE ldFaltante.id_loan = l.id AND ldFaltante.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldFaltante.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day)) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('sunday')\n" + +" AND LOWER(DAYNAME(DATE(ldFaltante.created_on))) = 'tuesday' \n" + +" AND ldFaltante.loan_details_type IN ('RENOVATION_PAYMENT')) as renovation_tuesday, \n" + + +" (SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) >= 1, 'Si','No') FROM APC_LOAN_DETAIL ldFaltante \n" + +" WHERE ldFaltante.id_loan = l.id AND ldFaltante.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldFaltante.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day)) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('sunday')\n" + +" AND LOWER(DAYNAME(DATE(ldFaltante.created_on))) = 'wednesday' \n" + +" AND ldFaltante.loan_details_type IN ('RENOVATION_PAYMENT')) as renovation_wendsday, \n" + + +" (SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) >= 1, 'Si','No') FROM APC_LOAN_DETAIL ldFaltante \n" + +" WHERE ldFaltante.id_loan = l.id AND ldFaltante.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldFaltante.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day)) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('sunday')\n" + +" AND LOWER(DAYNAME(DATE(ldFaltante.created_on))) = 'thursday' \n" + +" AND ldFaltante.loan_details_type IN ('RENOVATION_PAYMENT')) as renovation_thursday,\n" + + +" (SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) >= 1, 'Si','No') FROM APC_LOAN_DETAIL ldFaltante \n" + +" WHERE ldFaltante.id_loan = l.id AND ldFaltante.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldFaltante.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day)) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('sunday')\n" + +" AND LOWER(DAYNAME(DATE(ldFaltante.created_on))) = 'friday' \n" + +" AND ldFaltante.loan_details_type IN ('RENOVATION_PAYMENT')) as renovation_friday,\n" + + +" (SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) >= 1, 'Si','No') FROM APC_LOAN_DETAIL ldFaltante \n" + +" WHERE ldFaltante.id_loan = l.id AND ldFaltante.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldFaltante.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day)) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('sunday')\n" + +" AND LOWER(DAYNAME(DATE(ldFaltante.created_on))) = 'saturday' \n" + +" AND ldFaltante.loan_details_type IN ('RENOVATION_PAYMENT')) as renovation_saturday, "+ + + "IF((SELECT count(ln.id_customer) FROM apo_pro_com_april_ten.APC_LOAN ln WHERE ln.id_customer=l.id_customer and \n" + +" NOT (SELECT COUNT(id_loan_new) from APC_LOAN_BY_RENOVATION WHERE id_loan_new = l.id) > 0) = 0 , 'No' , 'Si') as reactivation, " + + + "if((Select count(lsemana.id) from APC_LOAN lsemana where lsemana.id= l.id and \n" + +" lsemana.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) \n" + +" and lsemana.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day)))>0,'Si','No') as weekOfCreation " + + +"FROM APC_LOAN l " + +"INNER JOIN APC_LOAN_TYPE lt ON l.id_loan_type = lt.id " + +"INNER JOIN APC_PEOPLE cus ON cus.id = l.id_customer " + +"INNER JOIN APC_PEOPLE endor ON endor.id = l.id_endorsement " + +"INNER JOIN APC_ROUTE r ON r.id = l.id_route AND r.id_office = :idOffice " + +"INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id " + +"INNER JOIN APC_USER u ON u.id = lbu.id_user " + +"INNER JOIN APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource " + +"WHERE " + +"l.loan_status not in ('DELETED','REJECTED') AND " + +"((SELECT COUNT(ld.id) FROM APC_LOAN_DETAIL ld WHERE WEEK(DATE(ld.created_on),1) = WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1) AND " + +" YEAR(DATE(ld.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) AND ld.id_loan = l.id) > 0 ) " + +"UNION " + +"SELECT " + +" l.id, " + +" u.id as id_user, " + +" r.id_office, " + +" l.created_on as fecha, " + +" lt.payment as apoyos, " + +" lt.payment_total as apoyos_total, " + +" lt.opening_fee as comision_apertura, " + +" CONCAT(endor.first_name,' ', IF(ISNULL(endor.second_name) ,'', CONCAT(endor.second_name,' ')) ,endor.last_name, ' ', endor.middle_name) AS aval, " + +" CONCAT(cus.first_name,' ', IF(ISNULL(cus.second_name) ,'', CONCAT(cus.second_name,' ')) ,cus.last_name, ' ', cus.middle_name) AS customer, " + +" l.amount_to_pay as documento_por, " + +" lt.payment_daily as abono_diario, " + +" l.amount_paid, " + +" (l.amount_to_pay - l.amount_paid) saldo_insoluto, " + +" r.route_name, " + +" CONCAT(hr.first_name,' ', IF(ISNULL(hr.second_name) ,'', CONCAT(hr.second_name,' ')) ,hr.last_name, ' ', hr.middle_name) AS asesor, " + +" (SELECT COUNT(lfn.id) FROM APC_LOAN_FEE_NOTIFICATION lfn WHERE lfn.id_loan = l.id) as num_fee, " + +//"-- Lunes " + +" (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) " + +" FROM APC_LOAN_DETAIL ldLunes \n" + +" WHERE ldLunes.id_loan = l.id AND ldLunes.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldLunes.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day))" + +" AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'monday' " + +" AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_monday, " + +" (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) " + +" FROM APC_LOAN_DETAIL ldLunes " + +" WHERE ldLunes.id_loan = l.id AND ldLunes.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldLunes.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day)) " + +" AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'monday' " + +" AND ldLunes.loan_details_type IN ('FEE')) as fee_monday, " + +//"-- Martes " + +" (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) " + +" FROM APC_LOAN_DETAIL ldLunes " + +" WHERE ldLunes.id_loan = l.id AND ldLunes.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldLunes.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day))" + +" AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'tuesday' " + +" AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_tuesday, " + +" (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) " + +" FROM APC_LOAN_DETAIL ldLunes " + +" WHERE ldLunes.id_loan = l.id AND ldLunes.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldLunes.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day)) " + +" AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'tuesday' " + +" AND ldLunes.loan_details_type IN ('FEE')) as fee_tuesday, " + +//"-- Miercoles " + +" (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) " + +" FROM APC_LOAN_DETAIL ldLunes " + +" WHERE ldLunes.id_loan = l.id AND ldLunes.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldLunes.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day))" + +" AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'wednesday' " + +" AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_wednesday, " + +" (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) " + +" FROM APC_LOAN_DETAIL ldLunes " + +" WHERE ldLunes.id_loan = l.id AND ldLunes.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldLunes.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day))" + +" AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'wednesday' " + +" AND ldLunes.loan_details_type IN ('FEE')) as fee_wednesday, " + +//"-- Jueves " + +" (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) " + +" FROM APC_LOAN_DETAIL ldLunes " + +" WHERE ldLunes.id_loan = l.id AND ldLunes.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldLunes.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day))" + +" AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'thursday' " + +" AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_thursday, " + +" (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) " + +" FROM APC_LOAN_DETAIL ldLunes " + +" WHERE ldLunes.id_loan = l.id AND ldLunes.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldLunes.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day)) " + +" AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'thursday' " + +" AND ldLunes.loan_details_type IN ('FEE')) as fee_thursday, " + +//"-- Viernes " + +" (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) " + +" FROM APC_LOAN_DETAIL ldLunes " + +" WHERE ldLunes.id_loan = l.id AND ldLunes.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldLunes.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day))" + +" AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'friday' " + +" AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_friday, " + +" (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) " + +" FROM APC_LOAN_DETAIL ldLunes " + +" WHERE ldLunes.id_loan = l.id AND ldLunes.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldLunes.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day))" + +" AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'friday' " + +" AND ldLunes.loan_details_type IN ('FEE')) as fee_friday, " + +//"-- Sabado " + +" (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) " + +" FROM APC_LOAN_DETAIL ldLunes " + +" WHERE ldLunes.id_loan = l.id AND ldLunes.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldLunes.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day))" + +" AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'saturday' " + +" AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_saturday, " + +" (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) " + +" FROM APC_LOAN_DETAIL ldLunes " + +" WHERE ldLunes.id_loan = l.id AND ldLunes.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldLunes.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day))" + +" AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'saturday' " + +" AND ldLunes.loan_details_type IN ('FEE')) as fee_saturday, " + +//"-- Faltante " + +" ((lt.payment_daily * (SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) > 5, 5 , COUNT(DISTINCT(DATE(ldFaltante.created_on)))) FROM APC_LOAN_DETAIL ldFaltante " + +" WHERE ldFaltante.id_loan = l.id AND WEEK(DATE(ldFaltante.created_on),1) = WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1) AND " + +" YEAR(DATE(ldFaltante.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('saturday','sunday') " + +" AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER', 'FEE'))) " + +" - (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) " + +" FROM APC_LOAN_DETAIL ldLunes " + +" WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1) AND " + +" YEAR(DATE(ldLunes.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +" AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER'))) as faltante, " + +//"-- new_customer " + +" CASE WHEN l.new_customer = 'ENEBLED' AND WEEK(DATE(l.created_on),1) = WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1) THEN 'Si' ELSE 'No' END as new_customer, " + +//"-- renovation " + +" if((SELECT COUNT(id_loan_old) FROM APC_LOAN_BY_RENOVATION lbr " + +" INNER JOIN APC_LOAN lRenovation ON lbr.id_loan_new = lRenovation.id " + +" WHERE id_loan_old = l.id " + +" AND loan_by_renovation_status = 'APPROVED' and WEEK(DATE(lRenovation.created_on),1) <= WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1) AND " + +" YEAR(DATE(lRenovation.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d'))) = 0 , 'No' , 'Si') as renovation, " + +//" -- estatus_prestamo " + +" l.loan_status as estatus_prestamo, " + +//"-- num_pagos_all " + +" (SELECT COUNT(DISTINCT(DATE(ldFaltante.created_on))) FROM APC_LOAN_DETAIL ldFaltante " + +" WHERE ldFaltante.id_loan = l.id AND ldFaltante.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('sunday') " + +" AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER', 'FEE')) as num_pagos_all, " + +//"-- num_pagos_week " + +" (SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) > 6, 6, COUNT(DISTINCT(DATE(ldFaltante.created_on)))) FROM APC_LOAN_DETAIL ldFaltante " + +" WHERE ldFaltante.id_loan = l.id AND ldFaltante.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldFaltante.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day)) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('sunday') " + +" AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER', 'FEE')) as num_pagos_week, " + +//"-- fee_todos " + +" (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) " + +" FROM APC_LOAN_DETAIL ldLunes " + +" WHERE ldLunes.id_loan = l.id AND ldLunes.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) " + +" AND ldLunes.loan_details_type IN ('FEE')) as fee_todos, " + +" lt.loan_type_name AS loan_type_name, " + +" l.frozen AS frozen, "+ + +" (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) " + +" FROM APC_LOAN_DETAIL ldLunes " + +" WHERE ldLunes.id_loan= l.id AND ldLunes.created_on <=(DATE_ADD(DATE_ADD(:startDate, INTERVAL -WEEKDAY(:startDate)-1 DAY), INTERVAL 7 DAY)) " + +" AND ldLunes.loan_details_type IN ('PAYMENT','TRANSFER','RENOVATION_PAYMENT')) AS totalPaid, " + +" lt.total_days AS numPagosLoanType, " + + +" (SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) >= 1, 'Si','No') FROM APC_LOAN_DETAIL ldFaltante \n" + +" WHERE ldFaltante.id_loan = l.id AND ldFaltante.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldFaltante.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day)) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('sunday')\n" + +" AND LOWER(DAYNAME(DATE(ldFaltante.created_on))) = 'monday' \n" + +" AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER','FEE')) as movimiento_monday, \n" + + +" (SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) >= 1, 'Si','No') FROM APC_LOAN_DETAIL ldFaltante \n" + +" WHERE ldFaltante.id_loan = l.id AND ldFaltante.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldFaltante.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day)) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('sunday')\n" + +" AND LOWER(DAYNAME(DATE(ldFaltante.created_on))) = 'tuesday' \n" + +" AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER','FEE')) as movimiento_tuesday, \n" + + +" (SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) >= 1, 'Si','No') FROM APC_LOAN_DETAIL ldFaltante \n" + +" WHERE ldFaltante.id_loan = l.id AND ldFaltante.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldFaltante.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day)) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('sunday')\n" + +" AND LOWER(DAYNAME(DATE(ldFaltante.created_on))) = 'wednesday' \n" + +" AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER','FEE')) as movimiento_wendsday, \n" + + +" (SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) >= 1, 'Si','No') FROM APC_LOAN_DETAIL ldFaltante \n" + +" WHERE ldFaltante.id_loan = l.id AND ldFaltante.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldFaltante.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day)) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('sunday')\n" + +" AND LOWER(DAYNAME(DATE(ldFaltante.created_on))) = 'thursday' \n" + +" AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER','FEE')) as movimiento_thursday,\n" + + +" (SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) >= 1, 'Si','No') FROM APC_LOAN_DETAIL ldFaltante \n" + +" WHERE ldFaltante.id_loan = l.id AND ldFaltante.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldFaltante.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day)) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('sunday')\n" + +" AND LOWER(DAYNAME(DATE(ldFaltante.created_on))) = 'friday' \n" + +" AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER','FEE')) as movimiento_friday,\n" + + +" (SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) >= 1= 1, 'Si','No') FROM APC_LOAN_DETAIL ldFaltante \n" + +" WHERE ldFaltante.id_loan = l.id AND ldFaltante.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldFaltante.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day)) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('sunday')\n" + +" AND LOWER(DAYNAME(DATE(ldFaltante.created_on))) = 'saturday' \n" + +" AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER','FEE')) as movimiento_saturday,\n" + + +" (SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) >= 1, 'Si','No') FROM APC_LOAN_DETAIL ldFaltante \n" + +" WHERE ldFaltante.id_loan = l.id AND ldFaltante.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldFaltante.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day)) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('sunday')\n" + +" AND LOWER(DAYNAME(DATE(ldFaltante.created_on))) = 'monday' \n" + +" AND ldFaltante.loan_details_type IN ('RENOVATION_PAYMENT')) as renovation_monday, \n" + + +" (SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) >= 1, 'Si','No') FROM APC_LOAN_DETAIL ldFaltante \n" + +" WHERE ldFaltante.id_loan = l.id AND ldFaltante.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldFaltante.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day)) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('sunday')\n" + +" AND LOWER(DAYNAME(DATE(ldFaltante.created_on))) = 'tuesday' \n" + +" AND ldFaltante.loan_details_type IN ('RENOVATION_PAYMENT')) as renovation_tuesday, \n" + + +" (SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) >= 1, 'Si','No') FROM APC_LOAN_DETAIL ldFaltante \n" + +" WHERE ldFaltante.id_loan = l.id AND ldFaltante.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldFaltante.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day)) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('sunday')\n" + +" AND LOWER(DAYNAME(DATE(ldFaltante.created_on))) = 'wednesday' \n" + +" AND ldFaltante.loan_details_type IN ('RENOVATION_PAYMENT')) as renovation_wendsday, \n" + + +" (SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) >= 1, 'Si','No') FROM APC_LOAN_DETAIL ldFaltante \n" + +" WHERE ldFaltante.id_loan = l.id AND ldFaltante.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldFaltante.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day)) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('sunday')\n" + +" AND LOWER(DAYNAME(DATE(ldFaltante.created_on))) = 'thursday' \n" + +" AND ldFaltante.loan_details_type IN ('RENOVATION_PAYMENT')) as renovation_thursday,\n" + + +" (SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) >= 1, 'Si','No') FROM APC_LOAN_DETAIL ldFaltante \n" + +" WHERE ldFaltante.id_loan = l.id AND ldFaltante.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldFaltante.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day)) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('sunday')\n" + +" AND LOWER(DAYNAME(DATE(ldFaltante.created_on))) = 'friday' \n" + +" AND ldFaltante.loan_details_type IN ('RENOVATION_PAYMENT')) as renovation_friday,\n" + + +" (SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) >= 1, 'Si','No') FROM APC_LOAN_DETAIL ldFaltante \n" + +" WHERE ldFaltante.id_loan = l.id AND ldFaltante.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) and ldFaltante.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day)) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('sunday')\n" + +" AND LOWER(DAYNAME(DATE(ldFaltante.created_on))) = 'saturday' \n" + +" AND ldFaltante.loan_details_type IN ('RENOVATION_PAYMENT')) as renovation_saturday, "+ + + "IF((SELECT count(ln.id_customer) FROM apo_pro_com_april_ten.APC_LOAN ln WHERE ln.id_customer=l.id_customer and \n" + +" NOT (SELECT COUNT(id_loan_new) from APC_LOAN_BY_RENOVATION WHERE id_loan_new = l.id) > 0) = 0 , 'No' , 'Si') as reactivation, " + + "if((Select count(lsemana.id) from APC_LOAN lsemana where lsemana.id= l.id and \n" + +" lsemana.created_on <=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 7 day)) \n" + +" and lsemana.created_on >=(date_add(date_add(:startDate, interval -WEEKDAY(:startDate)-1 day), interval 1 day)))>0,'Si','No') as weekOfCreation"+ +" from APC_LOAN l\n" + +"INNER JOIN APC_LOAN_TYPE lt ON l.id_loan_type = lt.id \n" + +"INNER JOIN APC_PEOPLE cus ON cus.id = l.id_customer \n" + +"INNER JOIN APC_PEOPLE endor ON endor.id = l.id_endorsement \n" + +"INNER JOIN APC_ROUTE r ON r.id = l.id_route AND r.id_office = \"caef3a64-7d1f-11ea-af3e-28f659da398e\"\n" + +"INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id \n" + +"INNER JOIN APC_USER u ON u.id = lbu.id_user \n" + +"INNER JOIN APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource \n" + +"where WEEK(DATE(l.created_on),1) = WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1) AND \n" + +" YEAR(DATE(l.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) and l.loan_status='APPROVED'\n" + +"ORDER BY fecha;"; + + private final String queryColocation = +"SELECT " + +"u.id, " + +"CONCAT(hr.first_name, ' ' , hr.last_name) as username, " + +"ubo.id_office, " + +"(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al " + +" INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id " + +" INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id " + +" WHERE loan_status = 'APPROVED' AND al.created_by = u.id " + +" AND WEEK(DATE(al.created_on),1) = WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1) AND " + +" YEAR(Date(al.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +" AND LOWER(DAYNAME(DATE(al.created_on))) = 'monday') " + +" as colocation_monday, " + +"(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al " + +" INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id " + +" INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id " + +" WHERE loan_status = 'APPROVED' AND al.created_by = u.id " + +" AND WEEK(DATE(al.created_on),1) = WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1) AND " + +" YEAR(Date(al.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +" AND LOWER(DAYNAME(DATE(al.created_on))) = 'tuesday') " + +" as colocation_tuesday, " + +"(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al " + +" INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id " + +" INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id " + +" WHERE loan_status = 'APPROVED' AND al.created_by = u.id " + +" AND WEEK(DATE(al.created_on),1) = WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1) AND " + +" YEAR(Date(al.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +" AND LOWER(DAYNAME(DATE(al.created_on))) = 'wednesday') " + +" as colocation_wednesday, " + +"(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al " + +" INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id " + +" INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id " + +" WHERE loan_status = 'APPROVED' AND al.created_by = u.id " + +" AND WEEK(DATE(al.created_on),1) = WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1) AND " + +" YEAR(Date(al.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +" AND LOWER(DAYNAME(DATE(al.created_on))) = 'thursday') " + +" as colocation_thursday, " + +"(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al " + +" INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id " + +" INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id " + +" WHERE loan_status = 'APPROVED' AND al.created_by = u.id " + +" AND WEEK(DATE(al.created_on),1) = WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1) AND " + +" YEAR(Date(al.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +" AND LOWER(DAYNAME(DATE(al.created_on))) = 'friday') " + +" as colocation_friday, " + +"(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al " + +" INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id " + +" INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id " + +" WHERE loan_status = 'APPROVED' AND al.created_by = u.id " + +" AND WEEK(DATE(al.created_on),1) = WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1) AND " + +" YEAR(Date(al.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +" AND LOWER(DAYNAME(DATE(al.created_on))) = 'saturday') " + +" as colocation_saturday, " + +"(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al " + +" INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id " + +" INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id " + +" WHERE loan_status = 'APPROVED' AND al.created_by = u.id " + +" AND WEEK(DATE(al.created_on),1) = WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1) AND " + +" YEAR(Date(al.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d'))) " + +" as colocation_total " + +"FROM APC_USER u " + +"INNER JOIN APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource AND hr.human_resource_status = 'ENEBLED' " + +"INNER JOIN APC_USER_BY_OFFICE ubo ON ubo.id_user = u.id AND ubo.id_office = :idOffice " + +"WHERE u.user_status = 'ENEBLED' AND " + +"u.user_type IN ('MOBILE','BOTH');"; + + private final String queryCobranza = +"SELECT " + +"u.id, " + +"CONCAT(hr.first_name, ' ' , hr.last_name) as username, " + +"ubo.id_office, " + +"(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) " + +"FROM APC_LOAN_DETAIL ld " + +"INNER JOIN APC_LOAN l ON l.id = ld.id_loan " + +"INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id " + +"WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' AND ld.id_user = u.id " + +"AND WEEK(DATE(ld.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +"YEAR(DATE(ld.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +"AND LOWER(DAYNAME(DATE(ld.created_on))) = 'monday' " + +"AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_monday, " + +"(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) " + +"FROM APC_LOAN_DETAIL ld " + +"INNER JOIN APC_LOAN l ON l.id = ld.id_loan " + +"INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id " + +"WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' and ld.id_user = u.id " + +"AND WEEK(DATE(ld.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +"YEAR(DATE(ld.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +"AND LOWER(DAYNAME(DATE(ld.created_on))) = 'tuesday' " + +"AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_tuesday, " + +"(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) " + +"FROM APC_LOAN_DETAIL ld " + +"INNER JOIN APC_LOAN l ON l.id = ld.id_loan " + +"INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id " + +"WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' and ld.id_user = u.id " + +"AND WEEK(DATE(ld.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +"YEAR(DATE(ld.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +"AND LOWER(DAYNAME(DATE(ld.created_on))) = 'wednesday' " + +"AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_wednesday, " + +"(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) " + +"FROM APC_LOAN_DETAIL ld " + +"INNER JOIN APC_LOAN l ON l.id = ld.id_loan " + +"INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id " + +"WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' and ld.id_user = u.id " + +"AND WEEK(DATE(ld.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +"YEAR(DATE(ld.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +"AND LOWER(DAYNAME(DATE(ld.created_on))) = 'thursday' " + +"AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_thursday, " + +"(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) " + +"FROM APC_LOAN_DETAIL ld " + +"INNER JOIN APC_LOAN l ON l.id = ld.id_loan " + +"INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id " + +"WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' and ld.id_user = u.id " + +"AND WEEK(DATE(ld.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +"YEAR(DATE(ld.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +"AND LOWER(DAYNAME(DATE(ld.created_on))) = 'friday' " + +"AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_friday, " + +"(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) " + +"FROM APC_LOAN_DETAIL ld " + +"INNER JOIN APC_LOAN l ON l.id = ld.id_loan " + +"INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id " + +"WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' and ld.id_user = u.id " + +"AND WEEK(DATE(ld.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +"YEAR(DATE(ld.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +"AND LOWER(DAYNAME(DATE(ld.created_on))) = 'saturday' " + +"AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_saturday, " + +"(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) " + +"FROM APC_LOAN_DETAIL ld " + +"INNER JOIN APC_LOAN l ON l.id = ld.id_loan " + +"INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id " + +"WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' and ld.id_user = u.id " + +"AND WEEK(DATE(ld.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +"YEAR(DATE(ld.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +"AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_total " + +"FROM APC_USER u " + +"INNER JOIN APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource AND hr.human_resource_status = 'ENEBLED' " + +"INNER JOIN APC_USER_BY_OFFICE ubo ON ubo.id_user = u.id AND ubo.id_office = :idOffice " + +"WHERE u.user_status = 'ENEBLED' AND " + +"u.user_type IN ('MOBILE','BOTH') AND " + +"u.certifier = 'DISABLED';"; + + private final String querySubtotal = +"SELECT " + +"u.id, " + +"CONCAT(hr.first_name, ' ' , hr.last_name) as username, " + +"ubo.id_office, " + +"(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) " + +"FROM APC_LOAN_DETAIL ld " + +"INNER JOIN APC_LOAN l ON l.id = ld.id_loan " + +"INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id " + +"WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +"YEAR(DATE(ld.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +"AND LOWER(DAYNAME(DATE(ld.created_on))) = 'monday' " + +"AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_monday, " + +"(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al " + +" INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id " + +" INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id " + +" WHERE loan_status = 'APPROVED' AND albu.id_user = u.id " + +" AND WEEK(DATE(al.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +" YEAR(Date(al.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +" AND LOWER(DAYNAME(DATE(al.created_on))) = 'monday') " + +" as opening_fee_monday, " + +"(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) " + +"FROM APC_LOAN_DETAIL ld " + +"INNER JOIN APC_LOAN l ON l.id = ld.id_loan " + +"INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id " + +"WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +"YEAR(DATE(ld.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +"AND LOWER(DAYNAME(DATE(ld.created_on))) = 'tuesday' " + +"AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_tuesday, " + +"(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al " + +" INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id " + +" INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id " + +" WHERE loan_status = 'APPROVED' AND albu.id_user = u.id " + +" AND WEEK(DATE(al.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +" YEAR(Date(al.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +" AND LOWER(DAYNAME(DATE(al.created_on))) = 'tuesday') " + +" as opening_fee_tuesday, " + +"(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) " + +"FROM APC_LOAN_DETAIL ld " + +"INNER JOIN APC_LOAN l ON l.id = ld.id_loan " + +"INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id " + +"WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +"YEAR(DATE(ld.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +"AND LOWER(DAYNAME(DATE(ld.created_on))) = 'wednesday' " + +"AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_wednesday, " + +"(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al " + +" INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id " + +" INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id " + +" WHERE loan_status = 'APPROVED' AND albu.id_user = u.id " + +" AND WEEK(DATE(al.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +" YEAR(Date(al.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +" AND LOWER(DAYNAME(DATE(al.created_on))) = 'wednesday') " + +" as opening_fee_wednesday, " + +"(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) " + +"FROM APC_LOAN_DETAIL ld " + +"INNER JOIN APC_LOAN l ON l.id = ld.id_loan " + +"INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id " + +"WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +"YEAR(DATE(ld.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +"AND LOWER(DAYNAME(DATE(ld.created_on))) = 'thursday' " + +"AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_thursday, " + +"(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al " + +" INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id " + +" INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id " + +" WHERE loan_status = 'APPROVED' AND albu.id_user = u.id " + +" AND WEEK(DATE(al.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +" YEAR(Date(al.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +" AND LOWER(DAYNAME(DATE(al.created_on))) = 'thursday') " + +" as opening_fee_thursday, " + +"(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) " + +"FROM APC_LOAN_DETAIL ld " + +"INNER JOIN APC_LOAN l ON l.id = ld.id_loan " + +"INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id " + +"WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +"YEAR(DATE(ld.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +"AND LOWER(DAYNAME(DATE(ld.created_on))) = 'friday' " + +"AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_friday, " + +"(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al " + +" INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id " + +" INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id " + +" WHERE loan_status = 'APPROVED' AND albu.id_user = u.id " + +" AND WEEK(DATE(al.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +" YEAR(Date(al.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +" AND LOWER(DAYNAME(DATE(al.created_on))) = 'friday') " + +" as opening_fee_friday, " + +"(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) " + +"FROM APC_LOAN_DETAIL ld " + +"INNER JOIN APC_LOAN l ON l.id = ld.id_loan " + +"INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id " + +"WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +"YEAR(DATE(ld.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +"AND LOWER(DAYNAME(DATE(ld.created_on))) = 'saturday' " + +"AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_saturday, " + +"(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al " + +" INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id " + +" INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id " + +" WHERE loan_status = 'APPROVED' AND albu.id_user = u.id " + +" AND WEEK(DATE(al.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +" YEAR(Date(al.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +" AND LOWER(DAYNAME(DATE(al.created_on))) = 'saturday') " + +" as opening_fee_saturday, " + +"(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) " + +"FROM APC_LOAN_DETAIL ld " + +"INNER JOIN APC_LOAN l ON l.id = ld.id_loan " + +"INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id " + +"WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +"YEAR(DATE(ld.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +"AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_total, " + +"(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al " + +" INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id " + +" INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id " + +" WHERE loan_status = 'APPROVED' AND albu.id_user = u.id " + +" AND WEEK(DATE(al.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +" YEAR(Date(al.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) ) " + +" as opening_fee_total " + +"FROM APC_USER u " + +"INNER JOIN APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource AND hr.human_resource_status = 'ENEBLED' " + +"INNER JOIN APC_USER_BY_OFFICE ubo ON ubo.id_user = u.id AND ubo.id_office = :idOffice " + +"WHERE u.user_status = 'ENEBLED' AND " + +"u.user_type IN ('MOBILE','BOTH') AND " + +"u.certifier = 'DISABLED';"; + + private final String queryResumenInOut = +"SELECT " + +"u.id, " + +"CONCAT(hr.first_name, ' ' , hr.last_name) as username, " + +"ubo.id_office, " + +//"-- Lunes " + +"(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) " + +"FROM APC_CLOSING_DAY ld " + +"WHERE ld.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +"YEAR(DATE(ld.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +"AND LOWER(DAYNAME(DATE(ld.created_on))) = 'monday') as closing_monday, " + +"(SELECT IF(ISNULL(SUM(oe.expense)),0,SUM(oe.expense)) " + +"FROM APC_OTHER_EXPENSE oe " + +"WHERE oe.id_user = u.id AND WEEK(DATE(oe.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +"YEAR(DATE(oe.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +"AND LOWER(DAYNAME(DATE(oe.created_on))) = 'monday') as expense_monday, " + +"(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) " + +"FROM APC_MONEY_DAILY md " + +"WHERE md.id_user = u.id AND WEEK(DATE(md.money_daily_date),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +"YEAR(DATE(md.money_daily_date)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +"AND LOWER(DAYNAME(DATE(md.money_daily_date))) = 'monday') as money_daily_today_monday, " + +//"-- Martes " + +"(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) " + +"FROM APC_CLOSING_DAY ld " + +"WHERE ld.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +"YEAR(DATE(ld.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +"AND LOWER(DAYNAME(DATE(ld.created_on))) = 'tuesday') as closing_tuesday, " + +"(SELECT IF(ISNULL(SUM(oe.expense)),0,SUM(oe.expense)) " + +"FROM APC_OTHER_EXPENSE oe " + +"WHERE oe.id_user = u.id AND WEEK(DATE(oe.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +"YEAR(DATE(oe.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +"AND LOWER(DAYNAME(DATE(oe.created_on))) = 'tuesday') as expense_tuesday, " + +"(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) " + +"FROM APC_MONEY_DAILY md " + +"WHERE md.id_user = u.id AND WEEK(DATE(md.money_daily_date),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +"YEAR(DATE(md.money_daily_date)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +"AND LOWER(DAYNAME(DATE(md.money_daily_date))) = 'tuesday') as money_daily_today_tuesday, " + +//"-- Miercoles " + +"(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) " + +"FROM APC_CLOSING_DAY ld " + +"WHERE ld.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +"YEAR(DATE(ld.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +"AND LOWER(DAYNAME(DATE(ld.created_on))) = 'wednesday') as closing_wednesday, " + +"(SELECT IF(ISNULL(SUM(oe.expense)),0,SUM(oe.expense)) " + +"FROM APC_OTHER_EXPENSE oe " + +"WHERE oe.id_user = u.id AND WEEK(DATE(oe.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +"YEAR(DATE(oe.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +"AND LOWER(DAYNAME(DATE(oe.created_on))) = 'wednesday') as expense_wednesday, " + +"(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) " + +"FROM APC_MONEY_DAILY md " + +"WHERE md.id_user = u.id AND WEEK(DATE(md.money_daily_date),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +"YEAR(DATE(md.money_daily_date)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +"AND LOWER(DAYNAME(DATE(md.money_daily_date))) = 'wednesday') as money_daily_today_wednesday, " + +//"-- Jueves " + +"(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) " + +"FROM APC_CLOSING_DAY ld " + +"WHERE ld.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +"YEAR(DATE(ld.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +"AND LOWER(DAYNAME(DATE(ld.created_on))) = 'thursday') as closing_thursday, " + +"(SELECT IF(ISNULL(SUM(oe.expense)),0,SUM(oe.expense)) " + +"FROM APC_OTHER_EXPENSE oe " + +"WHERE oe.id_user = u.id AND WEEK(DATE(oe.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +"YEAR(DATE(oe.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +"AND LOWER(DAYNAME(DATE(oe.created_on))) = 'thursday') as expense_thursday, " + +"(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) " + +"FROM APC_MONEY_DAILY md " + +"WHERE md.id_user = u.id AND WEEK(DATE(md.money_daily_date),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +"YEAR(DATE(md.money_daily_date)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +"AND LOWER(DAYNAME(DATE(md.money_daily_date))) = 'thursday') as money_daily_today_thursday, " + +//"-- Viernes " + +"(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) " + +"FROM APC_CLOSING_DAY ld " + +"WHERE ld.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +"YEAR(DATE(ld.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +"AND LOWER(DAYNAME(DATE(ld.created_on))) = 'friday') as closing_friday, " + +"(SELECT IF(ISNULL(SUM(oe.expense)),0,SUM(oe.expense)) " + +"FROM APC_OTHER_EXPENSE oe " + +"WHERE oe.id_user = u.id AND WEEK(DATE(oe.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +"YEAR(DATE(oe.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +"AND LOWER(DAYNAME(DATE(oe.created_on))) = 'friday') as expense_friday, " + +"(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) " + +"FROM APC_MONEY_DAILY md " + +"WHERE md.id_user = u.id AND WEEK(DATE(md.money_daily_date),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +"YEAR(DATE(md.money_daily_date)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +"AND LOWER(DAYNAME(DATE(md.money_daily_date))) = 'friday') as money_daily_today_friday, " + +//"-- Sabado " + +"(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) " + +"FROM APC_CLOSING_DAY ld " + +"WHERE ld.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +"YEAR(DATE(ld.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +"AND LOWER(DAYNAME(DATE(ld.created_on))) = 'saturday') as closing_saturday, " + +"(SELECT IF(ISNULL(SUM(oe.expense)),0,SUM(oe.expense)) " + +"FROM APC_OTHER_EXPENSE oe " + +"WHERE oe.id_user = u.id AND WEEK(DATE(oe.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +"YEAR(DATE(oe.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +"AND LOWER(DAYNAME(DATE(oe.created_on))) = 'saturday') as expense_saturday, " + +"(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) " + +"FROM APC_MONEY_DAILY md " + +"WHERE md.id_user = u.id AND WEEK(DATE(md.money_daily_date),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +"YEAR(DATE(md.money_daily_date)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +"AND LOWER(DAYNAME(DATE(md.money_daily_date))) = 'saturday') as money_daily_today_saturday " + +"FROM APC_USER u " + +"INNER JOIN APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource AND hr.human_resource_status = 'ENEBLED' " + +"INNER JOIN APC_USER_BY_OFFICE ubo ON ubo.id_user = u.id AND ubo.id_office = :idOffice " + +"WHERE u.user_status = 'ENEBLED' AND " + +"u.user_type IN ('MOBILE','BOTH');"; + + private final String queryResumenTotal = +"SELECT " + +"u.id, " + +"u.office_name, " + +//"-- Cortes " + +"(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) " + +"FROM APC_CLOSING_DAY ld " + +"WHERE WEEK(DATE(ld.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +"YEAR(DATE(ld.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) AND ld.active_status = 'ENEBLED' " + +"AND ld.id_office = u.id) as closing__day_total, " + +//"-- Inicios " + +"(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) " + +"FROM APC_MONEY_DAILY md " + +"WHERE WEEK(DATE(md.money_daily_date),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +"YEAR(DATE(md.money_daily_date)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) AND md.id_office = u.id) as money_daily_today_total, " + +//"-- Subtotal " + +"(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) " + +"FROM APC_LOAN_DETAIL ld " + +"INNER JOIN APC_LOAN l ON l.id = ld.id_loan " + +"INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id " + +"WHERE WEEK(DATE(ld.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +"YEAR(DATE(ld.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +"AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_total, " + +//"-- comision por apertura " + +"(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al " + +" INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id " + +" INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id " + +" WHERE loan_status = 'APPROVED' " + +" AND WEEK(DATE(al.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +" YEAR(Date(al.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d'))) " + +" as opening_fee_total, " + +//"-- cobranza " + +"(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) " + +"FROM APC_LOAN_DETAIL ld " + +"INNER JOIN APC_LOAN l ON l.id = ld.id_loan " + +"INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id " + +"WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' " + +"AND WEEK(DATE(ld.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +"YEAR(DATE(ld.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) " + +"AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_today, " + +//"-- colocacion " + +"(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al " + +" INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id " + +" INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id " + +" WHERE loan_status = 'APPROVED' " + +" AND WEEK(DATE(al.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +" YEAR(Date(al.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d')) ) " + +" as colocation_total, " + +//"-- nominas " + +"(SELECT IF(ISNULL(SUM(ap.total_payment)),0,SUM(ap.total_payment)) FROM APC_PAYROLL ap " + +"WHERE ap.id_office = u.id AND ap.active_status = 'ENEBLED' " + +"AND WEEK(DATE(ap.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +" YEAR(Date(ap.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d'))) as nomina_total, " + +//"-- adelantos " + +"(SELECT IF(ISNULL(SUM(ap.amount)),0,SUM(ap.amount)) FROM APC_ADVANCE ap " + +"WHERE ap.id_office = u.id AND ap.active_status = 'ENEBLED' " + +"AND WEEK(DATE(ap.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +" YEAR(Date(ap.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d'))) as adelantos_total, " + +//"-- entradas " + +"(SELECT IF(ISNULL(SUM(ap.amount)),0,SUM(ap.amount)) FROM APC_EXPENSE_COMPANY ap " + +"WHERE ap.id_office = u.id AND ap.active_status = 'ENEBLED' AND " + +"ap.expense_company_type = 'PAYMENT_IN' " + +"AND WEEK(DATE(ap.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +" YEAR(Date(ap.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d'))) as entradas_total, " + +//"-- gastos admon " + +"(SELECT IF(ISNULL(SUM(ap.amount)),0,SUM(ap.amount)) FROM APC_EXPENSE_COMPANY ap " + +"WHERE ap.id_office = u.id AND ap.active_status = 'ENEBLED' AND " + +"ap.expense_company_type = 'PAYMENT_OUT' " + +"AND WEEK(DATE(ap.created_on),1) = (WEEK(STR_TO_DATE(:startDate, '%Y-%m-%d'),1)) AND " + +" YEAR(Date(ap.created_on)) = YEAR(STR_TO_DATE(:startDate, '%Y-%m-%d'))) as gastos_admon_total " + +"FROM APC_OFFICE u " + +"WHERE u.office_status = 'ENEBLED' AND u.id = :idOffice ;"; +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/drive/FaltanteInDatesController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/drive/FaltanteInDatesController.java new file mode 100644 index 0000000..6522289 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/drive/FaltanteInDatesController.java @@ -0,0 +1,222 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.controller.drive; + +import com.arrebol.apc.controller.util.ConnectionManager; +import com.arrebol.apc.controller.util.HibernateUtil; +import com.arrebol.apc.model.views.FaltanteInDates; +//import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.math.BigDecimal; +//import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.hibernate.HibernateException; +import org.hibernate.Session; +import org.hibernate.Transaction; + + +/** + * + * @author Donadony + */ +public class FaltanteInDatesController extends ConnectionManager implements Serializable { + + + public List getAllLoanWeekMySQLQuery(String startDate,String endDate) { + logger.debug("getAllLoanWeekByOfficeMySQLQuery"); + logger.debug("Fecha inicial: " + startDate); + + List dataList = new ArrayList<>(); + Transaction transaction = null; + + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + //SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd"); + + List rows = session.createNativeQuery(queryLoan) + .setParameter("startDate", startDate) + .setParameter("endDate",endDate) + .getResultList(); + + transaction.commit(); + + rows.forEach((row) -> { + Object[] results = (Object[]) row; + + // Create Data Row + FaltanteInDates loanWeek = new FaltanteInDates( ); + loanWeek.setId(results[0] == null ? "" : results[0].toString()); + loanWeek.setIdUser(results[1] == null ? "" : results[1].toString()); + loanWeek.setUserName(results[2] == null ? "" : results[2].toString()); + loanWeek.setCustomerName(results[3] == null ? "" : results[3].toString()); + loanWeek.setRouteName(results[4] == null ? "" : results[4].toString()); + loanWeek.setAmountPaid(new BigDecimal(results[5] == null ? "0.0" : results[5].toString())); + loanWeek.setAmountToPay(new BigDecimal(results[6] == null ? "0.0" : results[6].toString())); + loanWeek.setAmountToPayNoFee(new BigDecimal(results[7] == null ? "0.0" : results[7].toString())); + loanWeek.setPaymentDaily(new BigDecimal(results[8] == null ? "0.0" : results[8].toString())); + loanWeek.setExpectedPayment(new BigDecimal(results[9] == null ? "0.0" : results[9].toString())); + loanWeek.setAmountPaidDetails(new BigDecimal(results[10] == null ? "0.0" : results[10].toString())); + loanWeek.setFee(new BigDecimal(results[11] == null ? "0.0" : results[11].toString())); + loanWeek.setFeeNumber(results[12] == null ? 0 : (Long) results[12]); + loanWeek.setNumPagosAll(results[13] == null ? 0 :(Long) results[13]); + + + dataList.add(loanWeek); + }); + + } catch (HibernateException e) { + logger.error("Driver", e); + rollback(transaction); + } catch (Exception e) { + logger.error("Method getAllLoanWeekByOfficeMySQLQuery(" + startDate + " " + ") ", e); + rollback(transaction); + } + + return dataList; + } + + final Logger logger = LogManager.getLogger(DriverController.class); + /*private final GenericEntityRepository genericEntityRepository; + + public FaltanteInDatesController() { + this.genericEntityRepository = new GenericEntityRepository(); + }*/ + + + private final String queryLoan = +"SELECT " + +" al.id," + +" ald.id_user," + +" CONCAT((CASE" + +" WHEN" + +" ((hr.first_name IS NOT NULL)" + +" AND (hr.first_name <> ''))" + +" THEN" + +" CONCAT(SUBSTR(UPPER(hr.first_name), 1, 1)," + +" SUBSTR(LOWER(hr.first_name), 2)," + +" ' ')" + +" ELSE ''" + +" END)," + +" (CASE" + +" WHEN" + +" ((hr.second_name IS NOT NULL)" + +" AND (hr.second_name <> ''))" + +" THEN" + +" CONCAT(SUBSTR(UPPER(hr.second_name), 1, 1)," + +" SUBSTR(LOWER(hr.second_name), 2)," + +" ' ')" + +" ELSE ''" + +" END)," + +" (CASE" + +" WHEN" + +" ((hr.last_name IS NOT NULL)" + +" AND (hr.last_name <> ''))" + +" THEN" + +" CONCAT(SUBSTR(UPPER(hr.last_name), 1, 1)," + +" SUBSTR(LOWER(hr.last_name), 2))" + +" ELSE ''" + +" END)) AS user_name," + +" CONCAT((CASE" + +" WHEN" + +" ((cstmr.first_name IS NOT NULL)" + +" AND (cstmr.first_name <> ''))" + +" THEN" + +" CONCAT(SUBSTR(UPPER(cstmr.first_name)," + +" 1," + +" 1)," + +" SUBSTR(LOWER(cstmr.first_name), 2)," + +" ' ')" + +" ELSE ''" + +" END)," + +" (CASE" + +" WHEN" + +" ((cstmr.second_name IS NOT NULL)" + +" AND (cstmr.second_name <> ''))" + +" THEN\n" + +" CONCAT(SUBSTR(UPPER(cstmr.second_name)," + +" 1," + +" 1)," + +" SUBSTR(LOWER(cstmr.second_name), 2)," + +" ' ')" + +" ELSE ''" + +" END)," + +" (CASE" + +" WHEN" + +" ((cstmr.last_name IS NOT NULL)" + +" AND (cstmr.last_name <> ''))" + +" THEN" + +" CONCAT(SUBSTR(UPPER(cstmr.last_name), 1, 1)," + +" SUBSTR(LOWER(cstmr.last_name), 2))" + +" ELSE ''" + +" END)) AS customer_name," + +" ar.route_name," + +" al.amount_paid," + +" al.amount_to_pay, " + +" al.amount_to_pay-(SELECT " + +" IF((SUM(ldLunes.payment_amount) IS NULL)," + +" 0," + +" SUM(ldLunes.payment_amount))" + +" FROM" + +" APC_LOAN_DETAIL ldLunes" + +" WHERE" + +" ((ldLunes.id_loan = al.id)" + +" AND (ldLunes.loan_details_type = 'FEE'))) AS amount_to_pay_no_fee," + +" alt.payment_daily," + +" (SELECT " + +" COUNT(DISTINCT CAST(ldfaltante.created_on AS DATE))" + +" FROM\n" + +" APC_LOAN_DETAIL ldfaltante" + +" WHERE" + +" ((ldfaltante.id_loan = ald.id_loan)" + +" AND ldfaltante.id_user = ald.id_user" + +" AND (LOWER(DAYNAME(CAST(ldfaltante.created_on AS DATE))) <> 'sunday')" + +" AND date(ldfaltante.created_on) >= :startDate and date(ldfaltante.created_on) <= :endDate" + +" AND (ldfaltante.loan_details_type = 'PAYMENT')))*alt.payment_daily as expected_payment," + +" sum(ald.payment_amount) as amount_paid_details, " + +" (SELECT " + +" IF((SUM(ldLunes.payment_amount) IS NULL)," + +" 0," + +" SUM(ldLunes.payment_amount))" + +" FROM" + +" APC_LOAN_DETAIL ldLunes" + +" WHERE" + +" ((ldLunes.id_loan = al.id)" + +" AND (ldLunes.loan_details_type = 'FEE'))) AS fee," + +" (SELECT " + +" count(ldLunes.created_on)" + +" FROM" + +" APC_LOAN_DETAIL ldLunes" + +" WHERE\n" + +" ((ldLunes.id_loan = al.id)" + +" AND (ldLunes.loan_details_type = 'FEE'))) AS fee_number," + +" (SELECT " + +" COUNT(DISTINCT CAST(ldfaltante.created_on AS DATE))" + +" FROM\n" + +" APC_LOAN_DETAIL ldfaltante" + +" WHERE" + +" ((ldfaltante.id_loan = ald.id_loan)" + +" AND ldfaltante.id_user = ald.id_user" + +" AND (LOWER(DAYNAME(CAST(ldfaltante.created_on AS DATE))) <> 'sunday')" + +" AND date(ldfaltante.created_on) >= :startDate and date(ldfaltante.created_on) <= :endDate" + +" AND (ldfaltante.loan_details_type IN ('PAYMENT','TRANSFER')))) AS num_pagos_all," + +" al.created_on " + +"FROM APC_LOAN_DETAIL ald" + +"JOIN APC_LOAN al ON al.id = ald.id_loan" + +"JOIN APC_USER au ON au.id = ald.id_user" + +"JOIN APC_ROUTE ar on al.id_route = ar.id" + +"JOIN APC_LOAN_BY_USER lub ON lub.id_loan = al.id" + +"JOIN APC_LOAN_TYPE alt on alt.id = al.id_loan_type" + +"JOIN APC_PEOPLE cstmr ON ((al.id_customer = cstmr.id))" + +"JOIN APC_USER u ON ((ald.id_user = u.id))" + +"JOIN APC_HUMAN_RESOURCE hr ON ((hr.id = u.id_human_resource))" + +"WHERE al.loan_status= 'APPROVED' AND ald.loan_details_type in('PAYMENT','TRANSFER') and date(ald.created_on) >= :startDate and date(ald.created_on) <= :endDate" + +" AND lub.id_user <> 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6'" + +"group by ald.id_loan,ald.id_user"; +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/login/LoginController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/login/LoginController.java new file mode 100644 index 0000000..ffdce78 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/login/LoginController.java @@ -0,0 +1,56 @@ +/* + * 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.controller.login; + +import com.arrebol.apc.repository.core.OfficeRepository; +import com.arrebol.apc.repository.core.UserByOfficeRepository; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.UserByOffice; +import java.io.Serializable; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class LoginController implements Serializable { + + public List getAllActiveOfficeController() { + logger.debug("getAllActiveOfficeController"); + + return getOfficeRepository().getAllActiveOffice(); + + } + + public UserByOffice findUserLoggedController(UserByOffice userByOffice) { + logger.debug("findUserLoggedController"); + return getUserByOfficeRepository().findUserLogged(userByOffice); + } + + private static final long serialVersionUID = 6949757021314889125L; + final Logger logger = LogManager.getLogger(LoginController.class); + + private final OfficeRepository officeRepository; + private final UserByOfficeRepository userByOfficeRepository; + + public LoginController() { + this.officeRepository = new OfficeRepository(); + this.userByOfficeRepository = new UserByOfficeRepository(); + } + + public OfficeRepository getOfficeRepository() { + return officeRepository; + } + + public UserByOfficeRepository getUserByOfficeRepository() { + return userByOfficeRepository; + } + +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/login/LoginService.java b/ace-controller/src/main/java/com/arrebol/apc/controller/login/LoginService.java new file mode 100644 index 0000000..7eb7cb6 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/login/LoginService.java @@ -0,0 +1,32 @@ +/* + * 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.controller.login; + +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.UserByOffice; +import java.util.List; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface LoginService { + + /** + * + * @return + */ + public List getAllActiveOfficeController(); + + /** + * + * @param userByOffice + * @return + */ + public UserByOffice findUserLoggedController(UserByOffice userByOffice); +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/login/LoginServiceImpl.java b/ace-controller/src/main/java/com/arrebol/apc/controller/login/LoginServiceImpl.java new file mode 100644 index 0000000..669cf87 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/login/LoginServiceImpl.java @@ -0,0 +1,47 @@ +/* + * 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.controller.login; + +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.UserByOffice; +import com.arrebol.apc.repository.core.OfficeRepository; +import com.arrebol.apc.repository.core.UserByOfficeRepository; +import java.util.List; +import javax.enterprise.context.RequestScoped; +import javax.inject.Inject; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@RequestScoped +public class LoginServiceImpl implements LoginService { + + @Override + public List getAllActiveOfficeController() { + logger.debug("getAllActiveOfficeController"); + + return officeRepository.getAllActiveOffice(); + + } + + @Override + public UserByOffice findUserLoggedController(UserByOffice userByOffice) { + logger.debug("findUserLoggedController"); + return userByOfficeRepository.findUserLogged(userByOffice); + } + + final Logger logger = LogManager.getLogger(getClass()); + + @Inject + private OfficeRepository officeRepository; + @Inject + private UserByOfficeRepository userByOfficeRepository; +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/system/employee/EmployeeController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/system/employee/EmployeeController.java new file mode 100644 index 0000000..3cf3fda --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/system/employee/EmployeeController.java @@ -0,0 +1,177 @@ +/* + * 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.controller.system.employee; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.admin.Bonus; +import com.arrebol.apc.model.admin.constance.BonusCfg; +import com.arrebol.apc.model.core.HumanResource; +import com.arrebol.apc.model.core.HumanResourceByOffice; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.constance.HumanResourceByOfficeCfg; +import com.arrebol.apc.model.core.constance.HumanResourceCfg; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.enums.HumanResourceStatus; +import com.arrebol.apc.repository.GenericEntityRepository; +import com.arrebol.apc.repository.core.HumanResourceRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import javax.persistence.Tuple; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +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 findEmployeesByType(Office office, HumanResourceStatus status, String hrOwnerId) { + List 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))); + + 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 findEmployeesInType(Office office, List statusLst, String hrOwnerId) { + List 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))); + + 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"); + + boolean success = genericEntityRepository.insertAPCEntity(humanResource); + + if (success) { + humanResourceByOffice.setHumanResource(new HumanResource(humanResource.getId())); + success = genericEntityRepository.insertAPCEntity(humanResourceByOffice); + } + + return success; + } + + /** + * + * @param hr + * @param updateAvatar + * @return + */ + public boolean updateByHumanResourceId(HumanResource hr, boolean updateAvatar) { + logger.debug("updateByHumanResourceId"); + + return humanResourceRepository.updateByHumanResourceId(hr, updateAvatar); + } + + /** + * + * @param status + * @param userIdToUpdate + * @param lastUpdatedBy + * @return + */ + public boolean updateHRByStatus(HumanResourceStatus status, String userIdToUpdate, String lastUpdatedBy) { + logger.debug("updateHRByStatus"); + + List 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)); + + return genericEntityRepository.xmlUpdateOrDeleteAPCEntity(HumanResourceCfg.UPDATE_HR_BY_STATUS, parameters); + } + + /** + * + * @param officeId + * @return + */ + public List findAllActiveBonus(String officeId) { + logger.debug("findAllActiveBonus"); + + List results = new ArrayList<>(); + try { + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(BonusCfg.FIELD_ACTIVE_STATUS, ActiveStatus.ENEBLED)); + parameters.add(new ModelParameter(BonusCfg.FIELD_OFFICE, new Office(officeId))); + + List 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())); + }); + + } catch (Exception e) { + logger.error("findAllActiveBonus", e); + } + + return results; + } + + /** + * + * @param hrId + * @return + */ + public HumanResource findHumanResourceById(String hrId) { + logger.debug("findHumanResourceById"); + + return (HumanResource) genericEntityRepository.selectAPCEntityById(HumanResource.class, hrId); + } + + private static final long serialVersionUID = 2527037592427439763L; + final Logger logger = LogManager.getLogger(EmployeeController.class); + + private final GenericEntityRepository genericEntityRepository; + private final HumanResourceRepository humanResourceRepository; + + public EmployeeController() { + this.genericEntityRepository = new GenericEntityRepository(); + this.humanResourceRepository = new HumanResourceRepository(); + } + +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/system/office/OfficeController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/system/office/OfficeController.java new file mode 100644 index 0000000..a2e15e4 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/system/office/OfficeController.java @@ -0,0 +1,91 @@ +/* + * 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.controller.system.office; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.constance.OfficeCfg; +import com.arrebol.apc.model.enums.OfficeStatus; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public class OfficeController implements Serializable{ + + /** + * + * Searching all roles. + * + * @return + */ + public List fillOfficeDatatable() { + + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(OfficeCfg.FIELD_OFFICE_STATUS, OfficeStatus.ENEBLED)); + + return genericEntityRepository.xmlQueryAPCEntities(Office.class, OfficeCfg.QUERY_FIND_ALL_OFFICES_ACTIVES, parameters); + } + + /** + * + * @param office + * @return boolean + */ + public boolean saveOffice(Office office) { + logger.debug("saveOffice"); + boolean success = genericEntityRepository.insertAPCEntity(office); + + return success; + } + + /** + * + * @param office + * @return boolean + */ + public boolean updateByOfficeId(Office office) { + logger.debug("updateByOfficeId"); + + return genericEntityRepository.updateAPCEntity(office); + } + + /** + * + * @param status + * @param officeIdToUpdate + * @return + */ + public boolean updateOfficeByStatus(OfficeStatus status, String officeIdToUpdate, String lastUpdatedBy) { + logger.debug("updateOfficeByStatus"); + + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(OfficeCfg.FIELD_OFFICE_STATUS, status)); + parameters.add(new ModelParameter(OfficeCfg.FIELD_LAST_UPDATED_BY, lastUpdatedBy)); + parameters.add(new ModelParameter(OfficeCfg.FIELD_LAST_UPDATED_ON, new Date())); + parameters.add(new ModelParameter(OfficeCfg.FIELD_ID, officeIdToUpdate)); + + return genericEntityRepository.xmlUpdateOrDeleteAPCEntity(OfficeCfg.UPDATE_OFFICES_BY_ID, parameters); + } + + final Logger logger = LogManager.getLogger(OfficeController.class); + private final GenericEntityRepository genericEntityRepository; + + public OfficeController() { + this.genericEntityRepository = new GenericEntityRepository(); + } +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/system/user/UserAccessController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/system/user/UserAccessController.java new file mode 100644 index 0000000..39461c5 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/system/user/UserAccessController.java @@ -0,0 +1,185 @@ +/* + * 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.controller.system.user; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.Permission; +import com.arrebol.apc.model.core.UserByOffice; +import com.arrebol.apc.model.core.UserByOfficeHasPermission; +import com.arrebol.apc.model.core.UserByOfficeHasPermissionId; +import com.arrebol.apc.model.core.constance.PermissionCfg; +import com.arrebol.apc.model.core.constance.UserByOfficeHasPermissionCfg; +import com.arrebol.apc.model.enums.UserStatus; +import com.arrebol.apc.repository.GenericEntityRepository; +import com.arrebol.apc.repository.core.PermissionRepository; +import com.arrebol.apc.repository.core.UserByOfficeRepository; +import com.arrebol.apc.repository.core.UserRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Optional; +import java.util.Set; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class UserAccessController implements Serializable { + + public List findUsersInOfficeInStatuses(List statuses, String officeId, String ownerId) { + logger.debug("findUsersInOfficeInStatuses"); + List retults = new ArrayList(); + try { + retults = getUserByOfficeRepository() + .findUsersInOfficeInStatuses(statuses, new Office(officeId), ownerId); + } catch (Exception e) { + logger.error("findUsersInOfficeInStatuses", e); + } + + return retults; + } + + /** + * + * @param userByOffice + * @param missing + * @return + */ + public List loadUserByOfficePermissionLst(UserByOffice userByOffice, boolean missing) { + logger.debug("loadUserByOfficePermissionLst"); + String query = PermissionCfg.QUERY_FIND_PERMISSION_THAT_USER_HAS_ASSIGNED; + + if (missing) { + query = PermissionCfg.QUERY_FIND_MISSING_PERMISSION_UBO; + } + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(UserByOfficeHasPermissionCfg.FIELD_USER_BY_OFFICE, userByOffice)); + + return getGenericEntityRepository().xmlQueryAPCEntities(Permission.class, query, parameters); + } + + /** + * + * @param permissions + * @param createdBy + * @param userByOfficeId Used to look all old permissions that need to be + * delete before to insert new permission list. + * @return + */ + public boolean updatePermissionsController(List permissions, String userByOfficeId, String createdBy) { + logger.debug("updatePermissionsController"); + + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(UserByOfficeHasPermissionCfg.FIELD_USER_BY_OFFICE, new UserByOffice(userByOfficeId))); + + boolean success = getGenericEntityRepository().xmlUpdateOrDeleteAPCEntity(UserByOfficeHasPermissionCfg.XML_QUERY_DELETE_PERMISSION_BY_USER_ID_AND_OFFICE_ID, parameters); + + if (success) { + success = getGenericEntityRepository().insertManyAPCEntity(buildUniquePermissionList(permissions, userByOfficeId, createdBy)); + } + + return success; + } + + /** + * + * @return + */ + public List findAllEnebledPermissions() { + logger.debug("findAllEnebledPermissions"); + return getPermissionRepository().findAllEnebledPermissions(); + } + + /** + * + * @param entities + * @return + */ + private List buildUniquePermissionList(List permissions, String userByOfficeId, String createdBy) { + logger.info("buildUniquePermissionList"); + + List allNewPermissions = new ArrayList<>(); + + try { + Set uniquePermission = new HashSet<>(); + + List appMenuLst = findAllEnebledPermissions(); + + permissions.forEach((permission) -> { + if (!uniquePermission.contains(permission)) { + uniquePermission.add(permission); + } + + Optional optional = appMenuLst.stream() + .filter((appMenu) -> appMenu.getPermission().equals(permission.getParentName())) + .findAny(); + + if (optional.isPresent()) { + if (!uniquePermission.contains(optional.get())) { + uniquePermission.add(optional.get()); + } + } + }); + + uniquePermission.forEach((unique) -> { + allNewPermissions.add( + new UserByOfficeHasPermission( + new UserByOfficeHasPermissionId( + userByOfficeId, + unique.getId() + ), + createdBy + ) + ); + }); + } catch (Exception e) { + logger.error("buildUniquePermissionList", e); + throw e; + } + + return allNewPermissions; + } + + private static final long serialVersionUID = -4994341295468752327L; + final Logger logger = LogManager.getLogger(UserAccessController.class); + + private final GenericEntityRepository genericEntityRepository; + private final UserRepository userRepository; + private final UserByOfficeRepository userByOfficeRepository; + private final PermissionRepository permissionRepository; + + public UserAccessController() { + this.genericEntityRepository = new GenericEntityRepository(); + this.userRepository = new UserRepository(); + this.userByOfficeRepository = new UserByOfficeRepository(); + this.permissionRepository = new PermissionRepository(); + } + + public GenericEntityRepository getGenericEntityRepository() { + return genericEntityRepository; + } + + public UserRepository getUserRepository() { + return userRepository; + } + + public UserByOfficeRepository getUserByOfficeRepository() { + return userByOfficeRepository; + } + + public PermissionRepository getPermissionRepository() { + return permissionRepository; + } + +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/system/user/UserAdminController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/system/user/UserAdminController.java new file mode 100644 index 0000000..eb30113 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/system/user/UserAdminController.java @@ -0,0 +1,111 @@ +/* + * 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.controller.system.user; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.catalog.RouteCtlg; +import com.arrebol.apc.model.catalog.constance.RouteCfg; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.UserByOffice; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.enums.UserStatus; +import com.arrebol.apc.repository.GenericEntityRepository; +import com.arrebol.apc.repository.core.UserByOfficeRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class UserAdminController implements Serializable { + + /** + * + * @param statuses + * @param officeId + * @param ownerId + * @return + */ + public List findUsersInOfficeInStatuses(List statuses, String officeId, String ownerId) { + logger.debug("findUsersInOfficeInStatuses"); + List retults = new ArrayList(); + try { + retults = getUserByOfficeRepository() + .findUsersInOfficeInStatuses(statuses, new Office(officeId), ownerId); + } catch (Exception e) { + logger.error("findUsersInOfficeInStatuses", e); + } + + return retults; + } + + /** + * + * @param officeId + * @return + * @throws Exception + */ + public List findRoutesByOffice(String officeId) throws Exception { + logger.debug("findRoutesByOffice"); + try { + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(RouteCfg.FIELD_ACTIVE_STATUS, ActiveStatus.ENEBLED)); + parameters.add(new ModelParameter(RouteCfg.FIELD_OFFICE, new Office(officeId))); + + return genericEntityRepository.xmlQueryAPCEntities(RouteCtlg.class, RouteCfg.QUERY_FIND_ALL_ROUTES, parameters); + } catch (Exception e) { + logger.error("findRoutesByOffice", e); + throw e; + } + } + + /** + * + * @param officeId + * @return + * @throws Exception + */ + public List findRoutesWithNoCertifierUser(String officeId) throws Exception { + logger.debug("findRoutesWithNoCertifierUser"); + try { + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(RouteCfg.FIELD_OFFICE, new Office(officeId))); + + return genericEntityRepository.xmlQueryAPCEntities(RouteCtlg.class, RouteCfg.QUERY_FIND_ROUTES_WITH_NO_CERTIFIER_USER, parameters); + } catch (Exception e) { + logger.error("findRoutesWithNoCertifierUser", e); + throw e; + } + } + + private static final long serialVersionUID = -2718549077979303345L; + final Logger logger = LogManager.getLogger(UserAdminController.class); + + private final GenericEntityRepository genericEntityRepository; + private final UserByOfficeRepository userByOfficeRepository; + + public UserAdminController() { + this.genericEntityRepository = new GenericEntityRepository(); + this.userByOfficeRepository = new UserByOfficeRepository(); + } + + public GenericEntityRepository getGenericEntityRepository() { + return genericEntityRepository; + } + + public UserByOfficeRepository getUserByOfficeRepository() { + return userByOfficeRepository; + } + +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/system/user/UserCreateController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/system/user/UserCreateController.java new file mode 100644 index 0000000..72c88e0 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/system/user/UserCreateController.java @@ -0,0 +1,419 @@ +/* + * 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.controller.system.user; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.catalog.HumanResourceHasRoute; +import com.arrebol.apc.model.catalog.HumanResourceHasRouteId; +import com.arrebol.apc.model.catalog.RouteCtlg; +import com.arrebol.apc.model.catalog.constance.RouteCfg; +import com.arrebol.apc.model.core.HumanResource; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.Permission; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.core.UserByOffice; +import com.arrebol.apc.model.core.UserByOfficeHasPermission; +import com.arrebol.apc.model.core.UserByOfficeHasPermissionId; +import com.arrebol.apc.model.core.constance.HumanResourceCfg; +import com.arrebol.apc.model.core.constance.OfficeCfg; +import com.arrebol.apc.model.core.constance.PermissionCfg; +import com.arrebol.apc.model.core.constance.UserByOfficeCfg; +import com.arrebol.apc.model.core.constance.UserByOfficeHasPermissionCfg; +import com.arrebol.apc.model.core.constance.UserCfg; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.enums.HumanResourceStatus; +import com.arrebol.apc.model.enums.PermissionStatus; +import com.arrebol.apc.model.enums.PermissionType; +import com.arrebol.apc.repository.GenericEntityRepository; +import com.arrebol.apc.repository.core.HumanResourceRepository; +import com.arrebol.apc.repository.core.PermissionRepository; +import com.arrebol.apc.repository.core.UserByOfficeRepository; +import com.arrebol.apc.repository.core.UserRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Optional; +import java.util.Set; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class UserCreateController implements Serializable { + + /** + * + * @return + */ + public List getAllActivePermissionController() { + logger.debug("getAllActivePermissionController"); + return getPermissionRepository().getAllActivePermissionByType(PermissionType.PRIVATE); + } + + /** + * + * @param searchingName + * @param officeId + * @return True if userName is available otherwise false. + */ + public boolean isUsernameAvailableController(String searchingName, String officeId) { + logger.debug("isUsernameAvailableController"); + + boolean available = false; + try { + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(UserCfg.FIELD_USER_NAME, searchingName)); + parameters.add(new ModelParameter(OfficeCfg.FIELD_ID, officeId)); + + Long count = (Long) getUserRepository() + .xmlQueryAPCEntityUniqueResult( + UserCfg.QUERY_IS_USERNAME_AVAILABLE, + parameters + ); + + if (count == 0) { + available = true; + } + } catch (Exception e) { + logger.error("isUsernameAvailableController", e); + } + + return available; + } + + /** + * 1) Verifica que el usuario aun este disponible 2) Verifica que tipo de + * usuario se va a crear y en todos los casos se debera de guardar usuario y + * oficina mĆ”s las carecteristicas propias de cada tipo de usuario: A) WEB + * debe guardar permisos B) MOBILE debe guardar rutas C) BOTH debe guardar + * rutas y permisos. + * + * @param user + * @param userByOffice + * @param routes + * @param permissions + * @return + */ + public boolean saveUserController(User user, UserByOffice userByOffice, + List routes, List permissions) { + logger.debug("saveUserController"); + boolean success = false; + try { + List humanResourceHasRoutes = new ArrayList<>(); + List userByOfficeHasPermissions = new ArrayList<>(); + List parameters = new ArrayList<>(); + List types = new ArrayList<>(); + List genericPermissions; + + switch (user.getUserType()) { + case WEB: + types.add(PermissionType.PUBLIC); + + parameters.add(new ModelParameter(PermissionCfg.FIELD_PERMISSION_TYPE, types)); + parameters.add(new ModelParameter(PermissionCfg.FIELD_PERMISSION_STATUS, PermissionStatus.ENEBLED)); + + genericPermissions = getGenericEntityRepository().xmlQueryAPCEntities(Permission.class, PermissionCfg.QUERY_FIND_PERMISSION_BY_TYPE_AND_STATUS, parameters); + + genericPermissions.forEach((Permission value) -> { + UserByOfficeHasPermission row = new UserByOfficeHasPermission( + new UserByOfficeHasPermissionId(null, value.getId()), user.getCreatedBy() + ); + + userByOfficeHasPermissions.add(row); + }); + + permissions.forEach((Permission value) -> { + UserByOfficeHasPermission row = new UserByOfficeHasPermission( + new UserByOfficeHasPermissionId(null, value.getId()), user.getCreatedBy() + ); + + userByOfficeHasPermissions.add(row); + }); + break; + case MOBILE: + routes.forEach((RouteCtlg value) -> { + HumanResourceHasRoute row = new HumanResourceHasRoute( + new HumanResourceHasRouteId(user.getHumanResource().getId(), value.getId()), + user.getCreatedBy() + ); + + humanResourceHasRoutes.add(row); + }); + break; + case BOTH: + types.add(PermissionType.PUBLIC); + + parameters.add(new ModelParameter(PermissionCfg.FIELD_PERMISSION_TYPE, types)); + parameters.add(new ModelParameter(PermissionCfg.FIELD_PERMISSION_STATUS, PermissionStatus.ENEBLED)); + + genericPermissions = getGenericEntityRepository().xmlQueryAPCEntities(Permission.class, PermissionCfg.QUERY_FIND_PERMISSION_BY_TYPE_AND_STATUS, parameters); + + genericPermissions.forEach((Permission value) -> { + UserByOfficeHasPermission row = new UserByOfficeHasPermission( + new UserByOfficeHasPermissionId(null, value.getId()), user.getCreatedBy() + ); + + userByOfficeHasPermissions.add(row); + }); + + permissions.forEach((Permission value) -> { + UserByOfficeHasPermission row = new UserByOfficeHasPermission( + new UserByOfficeHasPermissionId(null, value.getId()), user.getCreatedBy() + ); + + userByOfficeHasPermissions.add(row); + }); + + routes.forEach((RouteCtlg value) -> { + HumanResourceHasRoute row = new HumanResourceHasRoute( + new HumanResourceHasRouteId(user.getHumanResource().getId(), value.getId()), + user.getCreatedBy() + ); + + humanResourceHasRoutes.add(row); + }); + break; + } + + success = userRepository.createUser(user, + userByOffice, + humanResourceHasRoutes, + userByOfficeHasPermissions); + } catch (Exception e) { + logger.error(e); + } + + return success; + } + + /** + * Save a list of APC entities + * + * + * @param permissions + * @param userByOfficeId + * @param createdBy + * @return + */ + public boolean saveManyController(List permissions, String userByOfficeId, String createdBy) { + + return getGenericEntityRepository().insertManyAPCEntity(buildUniquePermissionList(permissions, userByOfficeId, createdBy)); + } + + /** + * + * @param permissions New permission to be saved. + * @param createdBy + * @param userByOfficeId Used to look all old permissions that need to be + * delete before to insert new permission list. + * @return + */ + public boolean updatePermissionsController(List permissions, String userByOfficeId, String createdBy) { + + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(UserByOfficeHasPermissionCfg.FIELD_USER_BY_OFFICE, new UserByOffice(userByOfficeId))); + + boolean success = getGenericEntityRepository().xmlUpdateOrDeleteAPCEntity(UserByOfficeHasPermissionCfg.XML_QUERY_DELETE_PERMISSION_BY_USER_ID_AND_OFFICE_ID, parameters); + + if (success) { + success = getGenericEntityRepository().insertManyAPCEntity(buildUniquePermissionList(permissions, userByOfficeId, createdBy)); + } + + return success; + } + + /** + * + * @param user + * @param fromView 1 = From User-> Create
+ * @return + */ + @Deprecated + public boolean updateCreateUserController(User user, int fromView) { + logger.debug("updateCreateUser"); + + return getUserRepository().updateUserById(user, fromView); + } + + /** + * + * @param office + * @param humanResourceStatus + * @return + */ + public List findAllHRsWithoutUser(Office office, HumanResourceStatus humanResourceStatus) { + logger.debug("findAllHRsWithoutUser"); + + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(HumanResourceCfg.FIELD_OFFICE, office)); + parameters.add(new ModelParameter(HumanResourceCfg.FIELD_HR_STATUS, humanResourceStatus)); + + return getGenericEntityRepository().xmlQueryAPCEntities(HumanResource.class, HumanResourceCfg.QUERY_FIND_ALL_HRS_WITHOUT_USER, parameters); + } + + /** + * + * @param userId + * @param officeId + * @return If user was found return an instace of UserByOffice object, but + * return null if user was not found. + */ + public UserByOffice findIdOfUserByOffice(String userId, String officeId) { + logger.debug("findAllHRsWithoutUser"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(UserByOfficeCfg.FIELD_USER, new User(userId))); + parameters.add(new ModelParameter(UserByOfficeCfg.FIELD_OFFICE, new Office(officeId))); + + return getUserByOfficeRepository().findIdOfUserByOffice(UserByOfficeCfg.QUERY_FIND_ID_OF_USER_BY_OFFICE, parameters); + } + + /** + * + * @return + */ + public List findAllEnebledPermissions() { + logger.debug("findAllEnebledPermissions"); + return getPermissionRepository().findAllEnebledPermissions(); + } + + /** + * + * @param entities + * @return + */ + private List buildUniquePermissionList(List permissions, String userByOfficeId, String createdBy) { + logger.info("buildUniquePermissionList"); + + List allNewPermissions = new ArrayList<>(); + + try { + Set uniquePermission = new HashSet<>(); + + List appMenuLst = findAllEnebledPermissions(); + + permissions.forEach((permission) -> { + if (!uniquePermission.contains(permission)) { + uniquePermission.add(permission); + } + + Optional optional = appMenuLst.stream() + .filter((appMenu) -> appMenu.getPermission().equals(permission.getParentName())) + .findAny(); + + if (optional.isPresent()) { + if (!uniquePermission.contains(optional.get())) { + uniquePermission.add(optional.get()); + } + } + }); + + uniquePermission.forEach((unique) -> { + allNewPermissions.add( + new UserByOfficeHasPermission( + new UserByOfficeHasPermissionId( + userByOfficeId, + unique.getId() + ), + createdBy + ) + ); + }); + } catch (Exception e) { + logger.error("buildUniquePermissionList", e); + throw e; + } + + return allNewPermissions; + } + + /** + * + * @param officeId + * @return + * @throws Exception + */ + public List findRoutesByOffice(String officeId) throws Exception { + logger.debug("findRoutesByOffice"); + try { + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(RouteCfg.FIELD_ACTIVE_STATUS, ActiveStatus.ENEBLED)); + parameters.add(new ModelParameter(RouteCfg.FIELD_OFFICE, new Office(officeId))); + + return genericEntityRepository.xmlQueryAPCEntities(RouteCtlg.class, RouteCfg.QUERY_FIND_ALL_ROUTES, parameters); + } catch (Exception e) { + logger.error("findRoutesByOffice", e); + throw e; + } + } + + /** + * + * @param officeId + * @return + * @throws Exception + */ + public List findRoutesWithNoCertifierUser(String officeId) throws Exception { + logger.debug("findRoutesWithNoCertifierUser"); + try { + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(RouteCfg.FIELD_OFFICE, new Office(officeId))); + + return genericEntityRepository.xmlQueryAPCEntities(RouteCtlg.class, RouteCfg.QUERY_FIND_ROUTES_WITH_NO_CERTIFIER_USER, parameters); + } catch (Exception e) { + logger.error("findRoutesWithNoCertifierUser", e); + throw e; + } + } + + private static final long serialVersionUID = 3496689435395697940L; + final Logger logger = LogManager.getLogger(UserCreateController.class); + + private final GenericEntityRepository genericEntityRepository; + private final PermissionRepository permissionRepository; + private final UserRepository userRepository; + private final HumanResourceRepository humanResourceRepository; + private final UserByOfficeRepository userByOfficeRepository; + + public UserCreateController() { + this.genericEntityRepository = new GenericEntityRepository(); + this.permissionRepository = new PermissionRepository(); + this.userRepository = new UserRepository(); + this.humanResourceRepository = new HumanResourceRepository(); + this.userByOfficeRepository = new UserByOfficeRepository(); + } + + private GenericEntityRepository getGenericEntityRepository() { + return genericEntityRepository; + } + + private PermissionRepository getPermissionRepository() { + return permissionRepository; + } + + private UserRepository getUserRepository() { + return userRepository; + } + + private HumanResourceRepository getHumanResourceRepository() { + return humanResourceRepository; + } + + public UserByOfficeRepository getUserByOfficeRepository() { + return userByOfficeRepository; + } + +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/system/user/UserUpdateController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/system/user/UserUpdateController.java new file mode 100644 index 0000000..1ef42b0 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/system/user/UserUpdateController.java @@ -0,0 +1,294 @@ +/* + * 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.controller.system.user; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.catalog.HumanResourceHasRoute; +import com.arrebol.apc.model.catalog.HumanResourceHasRouteId; +import com.arrebol.apc.model.catalog.RouteCtlg; +import com.arrebol.apc.model.catalog.constance.RouteCfg; +import com.arrebol.apc.model.core.HumanResource; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.Permission; +import com.arrebol.apc.model.core.UserByOffice; +import com.arrebol.apc.model.core.UserByOfficeHasPermission; +import com.arrebol.apc.model.core.UserByOfficeHasPermissionId; +import com.arrebol.apc.model.core.constance.HumanResourceHasRouteCfg; +import com.arrebol.apc.model.core.constance.OfficeCfg; +import com.arrebol.apc.model.core.constance.PermissionCfg; +import com.arrebol.apc.model.core.constance.UserByOfficeHasPermissionCfg; +import com.arrebol.apc.model.core.constance.UserCfg; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.enums.PermissionStatus; +import com.arrebol.apc.model.enums.PermissionType; +import com.arrebol.apc.model.enums.UserStatus; +import com.arrebol.apc.model.enums.UserType; +import com.arrebol.apc.repository.core.UserByOfficeRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class UserUpdateController implements Serializable { + + /** + * + * @param statuses + * @param officeId + * @param ownerId + * @return + */ + public List findUsersInOfficeInStatuses(List statuses, String officeId, String ownerId) { + logger.debug("findUsersInOfficeInStatuses"); + List retults = new ArrayList(); + try { + retults = userByOfficeRepository.findUsersInOfficeInStatuses(statuses, new Office(officeId), ownerId); + } catch (Exception e) { + logger.error("findUsersInOfficeInStatuses", e); + } + + return retults; + } + + /** + * + * @param isRoute true is route otherwise is permission. + * @param in true means bring by UBO or HR, otherwise means find list that + * does not have UBO or HR. + * @param uboId User By Office Id. + * @param hrId Human Resource Id. + * @param officeId Office Id. + * @return + */ + public List findList(boolean isRoute, boolean in, String uboId, String hrId, String officeId) { + logger.debug("findList"); + List results = new ArrayList(); + try { + String query; + List parameters = new ArrayList<>(); + + if (isRoute) { + query = in ? RouteCfg.QUERY_FIND_ALL_ROUTES_BY_HRHR : RouteCfg.QUERY_FIND_ALL_NOT_ROUTES_BY_HRHR; + + parameters.add(new ModelParameter(HumanResourceHasRouteCfg.FIELD_HUMAN_RESOURCE, new HumanResource(hrId))); + parameters.add(new ModelParameter(RouteCfg.FIELD_OFFICE, new Office(officeId))); + } else { + query = in ? PermissionCfg.QUERY_FIND_ALL_PERMISSIONS_BY_UBO : PermissionCfg.QUERY_FIND_ALL_NOT_PERMISSIONS_BY_UBO; + + parameters.add(new ModelParameter(UserByOfficeHasPermissionCfg.FIELD_USER_BY_OFFICE, new UserByOffice(uboId))); + } + results = userByOfficeRepository.findList(isRoute, query, parameters); + } catch (Exception e) { + logger.error("findList", e); + } + return results; + } + + /** + * + * @param isRoute + * @param types + * @param officeId + * @return + */ + public List findGeneralList(boolean isRoute, List types, String officeId) { + logger.debug("findGeneralList"); + List results = new ArrayList(); + try { + String query; + List parameters = new ArrayList<>(); + + if (isRoute) { + query = RouteCfg.QUERY_FIND_ALL_AVAILABLES_ROUTES; + + parameters.add(new ModelParameter(RouteCfg.FIELD_OFFICE, new Office(officeId))); + parameters.add(new ModelParameter(RouteCfg.FIELD_ACTIVE_STATUS, ActiveStatus.ENEBLED)); + } else { + query = PermissionCfg.QUERY_FIND_ALL_PERMISSION_BY_TYPE_AND_STATUS; + + parameters.add(new ModelParameter(PermissionCfg.FIELD_PERMISSION_TYPE, types)); + parameters.add(new ModelParameter(PermissionCfg.FIELD_PERMISSION_STATUS, PermissionStatus.ENEBLED)); + } + results = userByOfficeRepository.findList(isRoute, query, parameters); + } catch (Exception e) { + logger.error("findGeneralList", e); + } + return results; + } + + public boolean updateUser(UserType newUserType, UserByOffice userByOffice, + List routes, List permissions, ActiveStatus certifier, ActiveStatus management) { + logger.info("updateUser"); + boolean success = false; + try { + List humanResourceHasRoutes = new ArrayList<>(); + List userByOfficeHasPermissions = new ArrayList<>(); + + switch (newUserType) { + case WEB: + permissions.forEach((Permission value) -> { + UserByOfficeHasPermission row = new UserByOfficeHasPermission( + new UserByOfficeHasPermissionId(userByOffice.getId(), value.getId()), userByOffice.getCreatedBy() + ); + + userByOfficeHasPermissions.add(row); + }); + break; + case MOBILE: + routes.forEach((RouteCtlg value) -> { + HumanResourceHasRoute row = new HumanResourceHasRoute( + new HumanResourceHasRouteId(userByOffice.getUser().getHumanResource().getId(), value.getId()), + userByOffice.getCreatedBy() + ); + + humanResourceHasRoutes.add(row); + }); + break; + case BOTH: + permissions.forEach((Permission value) -> { + UserByOfficeHasPermission row = new UserByOfficeHasPermission( + new UserByOfficeHasPermissionId(userByOffice.getId(), value.getId()), userByOffice.getCreatedBy() + ); + + userByOfficeHasPermissions.add(row); + }); + + routes.forEach((RouteCtlg value) -> { + HumanResourceHasRoute row = new HumanResourceHasRoute( + new HumanResourceHasRouteId(userByOffice.getUser().getHumanResource().getId(), value.getId()), + userByOffice.getCreatedBy() + ); + + humanResourceHasRoutes.add(row); + }); + break; + } + + // 1 Borrar rutas y/o permisos + // a- Si usuario previo es web - borrar permisos + // b- Si usuario previo es mobile - borrar rutas + // c- Si usuario previo es ambos - borrar permisos y rutas. + // 2 Actualizar datos + // a- Si usuario es web - agregar permisos + // b- Si usuario es mobile - agragar rutas + // c- Si usuario es ambos - agregar permisos y rutas. + success = userByOfficeRepository.updateUser( + newUserType, + userByOffice, + certifier, + humanResourceHasRoutes, + userByOfficeHasPermissions, + management + + ); + } catch (Exception e) { + logger.error("updateUser", e); + } + return success; + } + + /** + * + * @param searchingName + * @param officeId + * @return + */ + public boolean isUsernameAvailableController(String searchingName, String officeId) { + logger.debug("isUsernameAvailableController"); + + boolean available = false; + try { + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(UserCfg.FIELD_USER_NAME, searchingName)); + parameters.add(new ModelParameter(OfficeCfg.FIELD_ID, officeId)); + + Long count = (Long) userByOfficeRepository + .xmlQueryAPCEntityUniqueResult( + UserCfg.QUERY_IS_USERNAME_AVAILABLE, + parameters + ); + + if (count == 0) { + available = true; + } + } catch (Exception e) { + logger.error("isUsernameAvailableController", e); + } + + return available; + } + + /** + * + * @param action Actions are pwd, usr, enebled, disabled & deleted. + * @param userId + * @param status + * @param pwd + * @param userName + * @param lastUpdatedBy + * @return + */ + public boolean updateUserOtherActions( + String action, + String userId, + UserStatus status, + String pwd, + String userName, + String lastUpdatedBy) { + logger.info("updateUserOtherActions"); + boolean success = false; + try { + String updateQuery; + List parameters = new ArrayList<>(); + switch (action) { + case "pwd": + updateQuery = UserCfg.QUERY_UPDATE_PASSWORD_BY_USER_ID; + + parameters.add(new ModelParameter(UserCfg.FIELD_PASSWORD, pwd)); + break; + case "usr": + updateQuery = UserCfg.QUERY_UPDATE_USER_NAME_BY_USER_ID; + + parameters.add(new ModelParameter(UserCfg.FIELD_USER_NAME, userName)); + parameters.add(new ModelParameter(UserCfg.FIELD_LAST_UPDATED_BY, lastUpdatedBy)); + parameters.add(new ModelParameter(UserCfg.FIELD_LAST_UPDATED_ON, new Date())); + break; + default: + updateQuery = UserCfg.QUERY_UPDATE_USER_STATUS_BY_USER_ID; + + parameters.add(new ModelParameter(UserCfg.FIELD_USER_STATUS, status)); + parameters.add(new ModelParameter(UserCfg.FIELD_LAST_UPDATED_BY, lastUpdatedBy)); + parameters.add(new ModelParameter(UserCfg.FIELD_LAST_UPDATED_ON, new Date())); + break; + } + parameters.add(new ModelParameter(UserCfg.FIELD_ID, userId)); + + success = userByOfficeRepository.updateEntityByQuery(updateQuery, parameters); + } catch (Exception e) { + logger.error("updateUserOtherActions", e); + } + return success; + } + + private static final long serialVersionUID = -6448348501480568726L; + final Logger logger = LogManager.getLogger(UserUpdateController.class); + + public UserUpdateController() { + this.userByOfficeRepository = new UserByOfficeRepository(); + } + + private final UserByOfficeRepository userByOfficeRepository; + +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/topbar/PrivacyController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/topbar/PrivacyController.java new file mode 100644 index 0000000..8207636 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/topbar/PrivacyController.java @@ -0,0 +1,56 @@ +/* + * 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.controller.topbar; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.core.constance.UserCfg; +import com.arrebol.apc.repository.GenericEntityRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class PrivacyController implements Serializable { + + /** + * + * @param password + * @param userId + * @return + * @throws Exception + */ + public boolean updatePasswordByUserId(String password, String userId) throws Exception { + logger.debug("updatePasswordByUserId"); + try { + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(UserCfg.FIELD_PASSWORD, password)); + parameters.add(new ModelParameter(UserCfg.FIELD_ID, userId)); + + return genericEntityRepository.xmlUpdateOrDeleteAPCEntity(UserCfg.QUERY_UPDATE_PASSWORD_BY_USER_ID, parameters); + } catch (Exception e) { + logger.error("updatePasswordByUserId", e); + throw e; + } + } + + private static final long serialVersionUID = 1131011930227628970L; + final Logger logger = LogManager.getLogger(PrivacyController.class); + + private final GenericEntityRepository genericEntityRepository; + + public PrivacyController() { + this.genericEntityRepository = new GenericEntityRepository(); + } + +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/topbar/TopBarController.java b/ace-controller/src/main/java/com/arrebol/apc/controller/topbar/TopBarController.java new file mode 100644 index 0000000..aa4d5e9 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/topbar/TopBarController.java @@ -0,0 +1,51 @@ +/* + * 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.controller.topbar; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.repository.core.OfficeRepository; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.core.constance.OfficeCfg; +import com.arrebol.apc.model.core.constance.UserByOfficeCfg; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class TopBarController implements Serializable { + + public List findAllOfficesByUserController(String userId) { + logger.debug("findAllOfficesByUserController"); + + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(UserByOfficeCfg.FIELD_USER, new User(userId))); + + return getOfficeRepository().findAllOfficesByUser(OfficeCfg.QUERY_TUPLE_FIND_ALL_OFFICES_BY_USER, parameters); + } + + private static final long serialVersionUID = -4239053737928432361L; + final Logger logger = LogManager.getLogger(TopBarController.class); + + public final OfficeRepository officeRepository; + + public TopBarController() { + this.officeRepository = new OfficeRepository(); + } + + public OfficeRepository getOfficeRepository() { + return officeRepository; + } + +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/util/ConnectionManager.java b/ace-controller/src/main/java/com/arrebol/apc/controller/util/ConnectionManager.java new file mode 100644 index 0000000..a376c20 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/util/ConnectionManager.java @@ -0,0 +1,40 @@ +/* + * 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.controller.util; + +import org.hibernate.Session; +import org.hibernate.Transaction; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public class ConnectionManager { + + /** + * + * @param session + */ + protected void closeSession(Session session) { + if (null != session) { + session.close(); + } + } + + /** + * + * @param transaction + */ + protected void rollback(Transaction transaction) { + if (null != transaction) { + transaction.rollback(); + } + } + + public static final String USER_ID_MANAGER_APPLICATION = "User-Id-Manager-Application"; +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/util/DateWrapper.java b/ace-controller/src/main/java/com/arrebol/apc/controller/util/DateWrapper.java new file mode 100644 index 0000000..0021cdf --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/util/DateWrapper.java @@ -0,0 +1,199 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.controller.util; + +import static java.util.Calendar.MONTH; +import static java.util.Calendar.DAY_OF_YEAR; +import static java.util.Calendar.DAY_OF_MONTH; +import static java.util.Calendar.HOUR_OF_DAY; +import static java.util.Calendar.MILLISECOND; +import static java.util.Calendar.MINUTE; +import static java.util.Calendar.SECOND; + +import java.util.Calendar; +import java.util.Date; + +/** + * + * @author oscarvargas + */ +public class DateWrapper { + + @Override + public String toString() { + return this.date.toString(); + } + + public static DateWrapper getInstance() { + return new DateWrapper(); + } + + public static DateWrapper today() { + return new DateWrapper(); + } + + /** + * Get date time Gregorian Time - 6 (GT-6). + * + * @return + */ + public static Date getTodayMXTime() { + Calendar calendar = Calendar.getInstance(); + + calendar.add(Calendar.HOUR_OF_DAY, -6); + + return calendar.getTime(); + } + + public static Date updateDateToMXTime(Date curdate) { + Calendar calendar = Calendar.getInstance(); + + calendar.setTime(curdate); + + calendar.add(Calendar.HOUR_OF_DAY, -6); + + return calendar.getTime(); + } + + /** + * Get date time Gregorian Time - 6 (GT-6), set time to midnigth + * 00:00:00:000. + * + * @return + */ + public static Date midnigthMXTime() { + Calendar calendar = Calendar.getInstance(); + + calendar.add(Calendar.HOUR_OF_DAY, -6); + + calendar.set(HOUR_OF_DAY, 0); + calendar.set(MINUTE, 0); + calendar.set(SECOND, 0); + calendar.set(MILLISECOND, 0); + + return calendar.getTime(); + } + + public static Date startDate(Date startDate) { + Calendar calendar = Calendar.getInstance(); + + calendar.setTime(startDate); + + calendar.add(Calendar.HOUR_OF_DAY, -6); + + calendar.set(HOUR_OF_DAY, 0); + calendar.set(MINUTE, 0); + calendar.set(SECOND, 0); + calendar.set(MILLISECOND, 0); + + return calendar.getTime(); + } + + public static Date endDate(Date endDate) { + Calendar calendar = Calendar.getInstance(); + + calendar.setTime(endDate); + + calendar.add(Calendar.HOUR_OF_DAY, -6); + + calendar.set(HOUR_OF_DAY, 23); + calendar.set(MINUTE, 59); + calendar.set(SECOND, 59); + calendar.set(MILLISECOND, 999); + + return calendar.getTime(); + } + + /** + * Get date time Gregorian Time - 6 (GT-6), set time to midnigth 23:59:59. + * + * @return + */ + public static Date lastMXTime() { + Calendar calendar = Calendar.getInstance(); + + calendar.add(Calendar.HOUR, -6); + + calendar.set(HOUR_OF_DAY, 23); + calendar.set(MINUTE, 59); + calendar.set(SECOND, 59); + + return calendar.getTime(); + } + + public DateWrapper midnigthTime() { + Calendar calendar = this.newCalendar(this.date); + calendar.set(HOUR_OF_DAY, 0); + calendar.set(MINUTE, 0); + calendar.set(SECOND, 0); + calendar.set(MILLISECOND, 0); + return new DateWrapper(calendar.getTime()); + } + + public DateWrapper add(int aCalendarField, int anMount) { + Calendar calendar = this.newCalendar(this.date); + calendar.add(aCalendarField, anMount); + return new DateWrapper(calendar.getTime()); + } + + private Calendar newCalendar(Date aDate) { + Calendar calendar = Calendar.getInstance(); + calendar.setLenient(false); + calendar.setTime(aDate); + return calendar; + } + + public DateWrapper subtractDaysOfYears(int anMount) { + return this.addDaysOfYears(-anMount); + } + + public DateWrapper addDaysOfYears(int anMount) { + return this.add(DAY_OF_YEAR, anMount); + } + + public Date asDate() { + return (Date) this.date.clone(); + } + + public DateWrapper firstDateForMonth() { + + Calendar calendar = newCalendar(this.date); + calendar.set(DAY_OF_MONTH, Calendar.getInstance().getActualMinimum(DAY_OF_MONTH)); + return new DateWrapper(calendar.getTime()); + } + + public DateWrapper lastDateForMonth() { + Calendar calendar = newCalendar(this.date); + calendar.set(DAY_OF_MONTH, Calendar.getInstance().getActualMaximum(DAY_OF_MONTH)); + return new DateWrapper(calendar.getTime()); + } + + public DateWrapper subtractMonths(int months) { + return this.addMonths(-months); + } + + public DateWrapper subtractHours(int hours) { + return this.addHours(-hours); + } + + public DateWrapper addMonths(int months) { + return this.add(MONTH, months); + } + + public DateWrapper addHours(int hours) { + return this.add(HOUR_OF_DAY, hours); + } + + public Date date; + + public DateWrapper(Date aDate) { + this.date = aDate; + } + + private DateWrapper() { + this.date = new Date(); + } +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/util/FilterMap.java b/ace-controller/src/main/java/com/arrebol/apc/controller/util/FilterMap.java new file mode 100644 index 0000000..87b7c81 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/util/FilterMap.java @@ -0,0 +1,79 @@ +/* + * 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.controller.util; + +import java.util.Map; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class FilterMap { + + static final String GLOBAL_FILTER = "globalFilter"; + + /** + * + * @param map + * @param hasWhere + * @return + */ + public static StringBuilder genericFilterByMapping(Map map, boolean hasWhere) { + StringBuilder sqlQuery = new StringBuilder(); + if (null != map) { + for (Map.Entry mapping : map.entrySet()) { + if (hasWhere) { + sqlQuery.append(" AND "); + sqlQuery.append(mapping.getKey()); + sqlQuery.append(" LIKE '%"); + sqlQuery.append(mapping.getValue()); + sqlQuery.append("%' "); + } else { + sqlQuery.append(" WHERE "); + sqlQuery.append(mapping.getKey()); + sqlQuery.append(" LIKE '%"); + sqlQuery.append(mapping.getValue()); + sqlQuery.append("%' "); + hasWhere = true; + } + } + } + return sqlQuery; + } + + /** + * + * @param filterBy + * @param hasWhere True is query contains where clause otherwise false + * @return + */ + public static StringBuilder filterByExcludeGlobalFilter(Map filterBy, boolean hasWhere) { + StringBuilder sqlQuery = new StringBuilder(); + if (null != filterBy) { + for (Map.Entry mapping : filterBy.entrySet()) { + if (!GLOBAL_FILTER.equals(mapping.getKey())) { + if (hasWhere) { + sqlQuery.append(" AND "); + sqlQuery.append(mapping.getKey()); + sqlQuery.append(" LIKE '%"); + sqlQuery.append(mapping.getValue().toString()); + sqlQuery.append("%' "); + } else { + sqlQuery.append(" WHERE "); + sqlQuery.append(mapping.getKey()); + sqlQuery.append(" LIKE '%"); + sqlQuery.append(mapping.getValue().toString()); + sqlQuery.append("%' "); + hasWhere = true; + } + } + } + } + return sqlQuery; + } +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/util/HibernateUtil.java b/ace-controller/src/main/java/com/arrebol/apc/controller/util/HibernateUtil.java new file mode 100644 index 0000000..4fa65d7 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/util/HibernateUtil.java @@ -0,0 +1,69 @@ +/* + * 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.controller.util; + +import org.hibernate.SessionFactory; +import org.hibernate.boot.Metadata; +import org.hibernate.boot.MetadataSources; +import org.hibernate.boot.registry.StandardServiceRegistryBuilder; +import org.hibernate.service.ServiceRegistry; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class HibernateUtil { + + private static final String HIBERNATE_CFG_XML = "apc.cfg.xml"; + private static SessionFactory sessionFactory; + + private HibernateUtil() { + } + + // Hibernate 5: + private static SessionFactory buildSessionFactory() { + try { + // Create the ServiceRegistry from hibernate.cfg.xml + ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder().configure(HIBERNATE_CFG_XML).build(); + + // Create a metadata sources using the specified service registry. + Metadata metadata = new MetadataSources(serviceRegistry).getMetadataBuilder().build(); + + return metadata.getSessionFactoryBuilder().build(); + } catch (Throwable ex) { + System.err.println("Initial SessionFactory creation failed." + ex); + throw new ExceptionInInitializerError(ex); + } + } + + /** + * Configuration object is used to create a SessionFactory object which in + * turn configures Hibernate for the application using the supplied + * configuration file and allows for a Session object to be instantiated. + * + * The SessionFactory is a thread safe object and used by all the threads of + * an application. + * + * The SessionFactory is a heavyweight object; it is usually created during + * application start up and kept for later use. + * + * You would need one SessionFactory object per database using a separate + * configuration file. + * + * So, if you are using multiple databases, then you would have to create + * multiple SessionFactory objects. + * + * @return SessionFactory. + */ + public final static SessionFactory getSessionFactory() { + if (null == sessionFactory) { + sessionFactory = buildSessionFactory(); + } + return sessionFactory; + } + +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/controller/util/logger/LogConnectionFactory.java b/ace-controller/src/main/java/com/arrebol/apc/controller/util/logger/LogConnectionFactory.java new file mode 100644 index 0000000..36ca2eb --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/controller/util/logger/LogConnectionFactory.java @@ -0,0 +1,34 @@ +/* + * 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.controller.util.logger; + +import java.sql.Connection; +import java.sql.SQLException; +import org.apache.commons.dbcp2.BasicDataSource; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class LogConnectionFactory { + + private static BasicDataSource dataSource; + + public LogConnectionFactory() { + } + + public static Connection getConnection() throws SQLException { + if (dataSource == null) { + dataSource = new BasicDataSource(); + dataSource.setUrl("jdbc:mysql://localhost:3306/apo_pro_com_april_ten?serverTimezone=UTC"); + dataSource.setDriverClassName("com.mysql.cj.jdbc.Driver"); + dataSource.setUsername("errortracelocalhost"); + dataSource.setPassword("zy61$Jql"); + } + return dataSource.getConnection(); + } +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/repository/AbstractRepository.java b/ace-controller/src/main/java/com/arrebol/apc/repository/AbstractRepository.java new file mode 100644 index 0000000..d1526cc --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/repository/AbstractRepository.java @@ -0,0 +1,763 @@ +/* + * 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.repository; + +import com.arrebol.apc.controller.util.HibernateUtil; +import com.arrebol.apc.model.ModelParameter; +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; +import org.hibernate.query.Query; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public abstract class AbstractRepository { + + private Session sessionOld; + private Transaction transactionOld; + + /** + * Save an APC entity. + * + * @param entity APC entity in DB. + * @return + */ + protected boolean save(Object entity) { + logger.debug("Save"); + boolean success = false; + + //Session session = null; + Transaction transaction = null; + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + session.save(entity); + transaction.commit(); + + logger.debug("Entity saved: " + entity); + + success = true; + } catch (HibernateException e) { + logger.error("Save Hibernate", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + } catch (Exception e) { + logger.error("Method save() ", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + }/* finally { + if (null != session) { + session.close(); + } + }*/ + + return success; + } + + /** + * + * @param entities + * @return + */ + protected boolean saveMany(List entities) { + logger.debug("saveMany"); + boolean success = false; + + //Session session = null; + Transaction transaction = null; + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + entities.forEach(entity -> { + session.save(entity); + }); + transaction.commit(); + + logger.debug("Entities saved: "); + + success = true; + } catch (HibernateException e) { + logger.error("saveMany Hibernate", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + } catch (Exception e) { + logger.error("Method saveMany() ", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + }/* finally { + if (null != session) { + session.close(); + } + }*/ + + return success; + } + + /** + * Update an APC entity. + * + * @param entity APC entity in DB. + * @return + */ + protected boolean update(Object entity) { + logger.debug("update"); + boolean success = false; + + //Session session = null; + Transaction transaction = null; + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + session.update(entity); + transaction.commit(); + + logger.debug("Entity updated: " + entity); + + success = true; + } catch (HibernateException e) { + logger.error("update Hibernate", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + } catch (Exception e) { + logger.error("Method update() ", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + }/* finally { + if (null != session) { + session.close(); + } + }*/ + + return success; + } + + /** + * Delete an APC entity. + * + * @param entity APC entity in DB. + * @return + */ + protected boolean delete(Object entity) { + logger.debug("delete"); + boolean success = false; + + //Session session = null; + Transaction transaction = null; + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + session.delete(entity); + transaction.commit(); + + logger.debug("Entity deleted: " + entity); + + success = true; + } catch (HibernateException e) { + logger.error("delete Hibernate", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + } catch (Exception e) { + logger.error("Method delete() ", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + }/* finally { + if (null != session) { + session.close(); + } + }*/ + + return success; + } + + /** + * Find a APC entity. + * + * @param clazz APC entity class name to find in DB. + * @param id + * @return + */ + protected Object findAPCEntity(Class clazz, String id) { + logger.debug("findAPCEntity"); + Object apcEntity = null; + + //Session session = null; + Transaction transaction = null; + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + apcEntity = session.get(clazz, id); + + transaction.commit(); + + logger.debug("APC entity found: " + apcEntity); + } catch (HibernateException e) { + logger.error("findAPCEntity Hibernate", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + } catch (Exception e) { + logger.error("Method findAPCEntity() ", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + }/* finally { + if (null != session) { + session.close(); + } + }*/ + return apcEntity; + } + + /** + * + * @param clazz + * @param xmlQuery + * @param parameters + * @return + */ + protected List xmlQueryLoadEntities(Class clazz, String xmlQuery, List parameters) { + logger.debug("xmlQueryLoadEntities"); + + List entities = null; + //Session session = null; + Transaction transaction = null; + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + Query query = session.createNamedQuery(xmlQuery, clazz); + + if (null != parameters) { + parameters.forEach((param) -> { + query.setParameter(param.getParameter(), param.getValue()); + }); + } + + entities = query.getResultList(); + + transaction.commit(); + + logger.debug("APC entities loaded from xml query: " + entities.size()); + } catch (HibernateException e) { + logger.error("xmlQueryLoadEntities Hibernate", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + } catch (Exception e) { + logger.error("Method xmlQueryLoadEntities() ", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + }/* finally { + if (null != session) { + session.close(); + } + }*/ + return entities; + } + + /** + * + * @param xmlQuery + * @param parameters + * @return + */ + protected List xmlQueryTuple(String xmlQuery, List parameters) { + logger.debug("xmlQueryTuple"); + + List entityList = null; + //Session session = null; + Transaction transaction = null; + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + Query query = session.createNamedQuery(xmlQuery, Tuple.class); + + if (null != parameters) { + parameters.forEach((param) -> { + query.setParameter(param.getParameter(), param.getValue()); + }); + } + + entityList = query.getResultList(); + transaction.commit(); + + logger.debug("APC entity from xml query list size: " + entityList.size()); + } catch (HibernateException e) { + logger.error("xmlQueryTuple Hibernate", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + } catch (Exception e) { + logger.error("Method xmlQueryTuple() ", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + }/* finally { + if (null != session) { + session.close(); + } + }*/ + return entityList; + } + + /** + * + * @param strQuery + * @param parameters + * @return + */ + protected List queryTuple(String strQuery, List parameters) { + logger.debug("queryTuple"); + + List entityList = null; + //Session session = null; + Transaction transaction = null; + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + Query query = session.createQuery(strQuery, Tuple.class); + + if (null != parameters) { + parameters.forEach((param) -> { + query.setParameter(param.getParameter(), param.getValue()); + }); + } + + entityList = query.getResultList(); + transaction.commit(); + + logger.debug("APC entity from string query list size: " + entityList.size()); + } catch (HibernateException e) { + logger.error("queryTuple Hibernate", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + } catch (Exception e) { + logger.error("Method queryTuple() ", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + }/* finally { + if (null != session) { + session.close(); + } + }*/ + return entityList; + } + + /** + * + * @param clazz + * @param xmlQuery + * @param parameters + * @return + */ + public List xmlQueryAPCEntities(Class clazz, String xmlQuery, List parameters) { + logger.debug("xmlQueryAPCEntities"); + + List entityList = null; + //Session session = null; + Transaction transaction = null; + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + Query query = session.createNamedQuery(xmlQuery, clazz); + + if (null != parameters) { + parameters.forEach((param) -> { + query.setParameter(param.getParameter(), param.getValue()); + }); + } + + entityList = query.getResultList(); + transaction.commit(); + + logger.debug("APC entities from xml query list size: " + entityList.size()); + } catch (HibernateException e) { + logger.error("xmlQueryAPCEntities Hibernate", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + } catch (Exception e) { + logger.error("Method xmlQueryAPCEntities() ", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + }/* finally { + if (null != session) { + session.close(); + } + }*/ + return entityList; + } + + + public List xmlQueryAPCEntities(Class clazz, String xmlQuery) { + logger.debug("xmlQueryAPCEntities"); + + List entityList = null; + //Session session = null; + Transaction transaction = null; + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + Query query = session.createNamedQuery(xmlQuery, clazz); + + entityList = query.getResultList(); + transaction.commit(); + + logger.debug("APC entities from xml query list size: " + entityList.size()); + } catch (HibernateException e) { + logger.error("xmlQueryAPCEntities Hibernate", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + } catch (Exception e) { + logger.error("Method xmlQueryAPCEntities() ", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + }/* finally { + if (null != session) { + session.close(); + } + }*/ + return entityList; + } + + /** + * + * @param clazz + * @param strQuery + * @param parameters + * @return + */ + public List queryAPCEntities(Class clazz, String strQuery, List parameters) { + logger.debug("queryAPCEntities"); + + List entityList = null; + //Session session = null; + Transaction transaction = null; + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + Query query = session.createQuery(strQuery, clazz); + + if (null != parameters) { + parameters.forEach((param) -> { + query.setParameter(param.getParameter(), param.getValue()); + }); + } + + entityList = query.getResultList(); + transaction.commit(); + + logger.debug("APC entities from string query list size: " + entityList.size()); + } catch (HibernateException e) { + logger.error("queryAPCEntities Hibernate", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + } catch (Exception e) { + logger.error("Method queryAPCEntities() ", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + }/* finally { + if (null != session) { + session.close(); + } + }*/ + return entityList; + } + + /** + * + * @param clazz + * @param xmlQuery + * @param parameters + * @return + */ + public Object xmlQueryAPCEntityUniqueResult(Class clazz, String xmlQuery, List parameters) { + logger.debug("xmlQueryAPCEntityUniqueResult"); + + Object entity = null; + //Session session = null; + Transaction transaction = null; + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + Query query = session.createNamedQuery(xmlQuery, clazz); + + if (null != parameters) { + parameters.forEach((param) -> { + query.setParameter(param.getParameter(), param.getValue()); + }); + } + + entity = query.uniqueResult(); + transaction.commit(); + + logger.debug("APC entity from xml query: " + entity); + } catch (HibernateException e) { + logger.error("xmlQueryAPCEntityUniqueResult Hibernate", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + } catch (Exception e) { + logger.error("Method xmlQueryAPCEntityUniqueResult() ", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + }/* finally { + if (null != session) { + session.close(); + } + }*/ + return entity; + } + + /** + * + * @param xmlQuery + * @param parameters + * @return + */ + public Object xmlQueryAPCEntityUniqueResult(String xmlQuery, List parameters) { + logger.debug("xmlQueryAPCEntityUniqueResult"); + + Object entity = null; + //Session session = null; + Transaction transaction = null; + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + Query query = session.createNamedQuery(xmlQuery); + + if (null != parameters) { + parameters.forEach((param) -> { + query.setParameter(param.getParameter(), param.getValue()); + }); + } + + entity = query.uniqueResult(); + transaction.commit(); + + logger.debug("APC entity from xml query: " + entity); + } catch (HibernateException e) { + logger.error("xmlQueryAPCEntityUniqueResult Hibernate", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + } catch (Exception e) { + logger.error("Method xmlQueryAPCEntityUniqueResult() ", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + }/* finally { + if (null != session) { + session.close(); + } + }*/ + return entity; + } + + /** + * + * @param clazz + * @param strQuery + * @param parameters + * @return + */ + public Object queryAPCEntityUniqueResult(Class clazz, String strQuery, List parameters) { + logger.debug("queryAPCEntity"); + + Object entity = null; + //Session session = null; + Transaction transaction = null; + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + Query query = session.createQuery(strQuery, clazz); + + if (null != parameters) { + parameters.forEach((param) -> { + query.setParameter(param.getParameter(), param.getValue()); + }); + } + + entity = query.uniqueResult(); + transaction.commit(); + + logger.debug("APC entity from string query " + entity); + } catch (HibernateException e) { + logger.error("queryAPCEntityUniqueResult Hibernate", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + } catch (Exception e) { + logger.error("Method queryAPCEntityUniqueResult() ", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + }/* finally { + if (null != session) { + session.close(); + } + }*/ + return entity; + } + + /** + * + * @param xmlUpdateOrDeleteQuery XML query mapped in Model hbm file. + * @param parameters Paramerter cannot be empy, it has at least one paramert + * in list. + * @return Is parameters is empty return false, otherwise execute and return + * true if was success the execution of query. + */ + protected boolean xmlUpdateOrDelete(String xmlUpdateOrDeleteQuery, List parameters) { + boolean success = false; + //Session session = null; + Transaction transaction = null; + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + Query updateOrDeleteQuery = session.createNamedQuery(xmlUpdateOrDeleteQuery); + + if (null != parameters && !parameters.isEmpty()) { + parameters.forEach((parameter) -> { + updateOrDeleteQuery.setParameter(parameter.getParameter(), parameter.getValue()); + }); + + int total = updateOrDeleteQuery.executeUpdate(); + + if (total > 0) { + transaction.commit(); + success = true; + } else { + transaction.rollback(); + } + } else { + transaction.rollback(); + } + } catch (HibernateException e) { + logger.error("xmlUpdateOrDelete Hibernate", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + } catch (Exception e) { + logger.error("Method xmlUpdateOrDelete() ", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + }/* finally { + if (null != session) { + session.close(); + } + }*/ + return success; + } + + protected void openConnection() { + try { + sessionOld = HibernateUtil.getSessionFactory().getCurrentSession(); + transactionOld = sessionOld.beginTransaction(); + } catch (Exception e) { + logger.error("openConnection", e); + throw e; + } + } + + protected Session getSession() { + return sessionOld; + } + + protected void closeConnection() { + try { + transactionOld.commit(); + } catch (Exception e) { + logger.error("closeConnection", e); + rollback(); + } + } + + protected void rollback() { + if (null != transactionOld) { + transactionOld.rollback(); + } + } + + protected void flushAndClear() { + if (null != sessionOld) { + sessionOld.flush(); + sessionOld.clear(); + } + } + + final Logger logger = LogManager.getLogger(AbstractRepository.class); +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/repository/AutoCompleteDAORepository.java b/ace-controller/src/main/java/com/arrebol/apc/repository/AutoCompleteDAORepository.java new file mode 100644 index 0000000..620cbd3 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/repository/AutoCompleteDAORepository.java @@ -0,0 +1,56 @@ +/* + * 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.repository; + +import com.arrebol.apc.controller.util.HibernateUtil; +import com.arrebol.apc.model.ModelParameter; +import java.util.ArrayList; +import java.util.List; +import org.hibernate.Session; +import org.hibernate.Transaction; +import org.hibernate.query.Query; + +/** + * + * @author Carlos Janitzio Zavala Lopez + * @param + */ +public abstract class AutoCompleteDAORepository extends AbstractRepository { + + /** + * + * @param clazz + * @param hbmQuery + * @param parameters + * @return + */ + public List searchLike(Class clazz, String hbmQuery, List parameters) { + List results; + Transaction transaction = null; + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + Query query = session.createQuery(hbmQuery, clazz); + if (null != parameters) { + parameters.forEach(param -> { + query.setParameter(param.getParameter(), param.getValue()); + }); + } + query.setMaxResults(10); + results = query.getResultList(); + transaction.commit(); + } catch (Exception e) { + logger.error("searchLike from class: " + clazz.getName(), e); + if (null != transaction) { + transaction.rollback(); + } + results = new ArrayList<>(); + } + return results; + } +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/repository/GenericEntityRepository.java b/ace-controller/src/main/java/com/arrebol/apc/repository/GenericEntityRepository.java new file mode 100644 index 0000000..41a02de --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/repository/GenericEntityRepository.java @@ -0,0 +1,111 @@ +/* + * 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.repository; + +import com.arrebol.apc.model.ModelParameter; +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class GenericEntityRepository extends AbstractRepository implements Serializable { + + private static final long serialVersionUID = -886033066217353341L; + + /** + * Insert APC entity. + * + * @param apcEntity + * @return + */ + public boolean insertAPCEntity(Object apcEntity) { + return super.save(apcEntity); + } + + /** + * Insert APC entities list. + * + * @param apcEntities + * @return + */ + public boolean insertManyAPCEntity(List apcEntities) { + return super.saveMany(apcEntities); + } + + /** + * Delete APC entity. + * + * @param apcEntity + * @return + */ + public boolean deleteAPCEntityById(Object apcEntity) { + return super.delete(apcEntity); + } + + /** + * + * @param xmlUpdateOrDeleteQuery XML query mapped in Model hbm file. + * @param parameters Paramerter cannot be empy, it has at least one paramert + * in list. + * @return Is parameters is empty return false, otherwise execute and return + * true if was success the execution of query. + */ + public boolean xmlUpdateOrDeleteAPCEntity(String xmlUpdateOrDeleteQuery, List parameters) { + return super.xmlUpdateOrDelete(xmlUpdateOrDeleteQuery, parameters); + } + + /** + * Find an Object by its primary key. + * + * @param clazz + * @param id + * @return + */ + public Object selectAPCEntityById(Class clazz, String id) { + return (Object) findAPCEntity(clazz, id); + } + + /** + * Update APC entity. + * + * @param apcEntity + * @return + */ + public boolean updateAPCEntity(Object apcEntity) { + return super.update(apcEntity); + } + + /** + * + * @param date + * @param query Must has parameter named ":date" and return just one field + * @return + */ + public boolean existRecordsUsingSQLQueryFindByCreatedOnField(Date date, String query) { + boolean success = true; + + try { + openConnection(); + + List records = getSession().createSQLQuery(query).setParameter("date", date).getResultList(); + + if (records.isEmpty()) { + success = false; + } + + closeConnection(); + } catch (Exception e) { + logger.error("existNextPaidStableGeneralBoxByCreatedOn", e); + rollback(); + } + return success; + } +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/repository/LazyDataModelDAORepository.java b/ace-controller/src/main/java/com/arrebol/apc/repository/LazyDataModelDAORepository.java new file mode 100644 index 0000000..74e18fb --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/repository/LazyDataModelDAORepository.java @@ -0,0 +1,94 @@ +/* + * 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.repository; + +import com.arrebol.apc.controller.util.HibernateUtil; +import com.arrebol.apc.model.ModelParameter; +import java.util.ArrayList; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.hibernate.Session; +import org.hibernate.Transaction; +import org.hibernate.query.Query; + +/** + * + * @author Carlos Janitzio Zavala Lopez + * @param + */ +public abstract class LazyDataModelDAORepository extends AbstractRepository { + + /** + * + * @param hbmQuery + * @param parameters + * @return + */ + public long lazyLoadingEntityCount(String hbmQuery, List parameters) { + Long total; + Transaction transaction = null; + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + Query query = session.createQuery(hbmQuery, Long.class); + if (null != parameters) { + parameters.forEach(param -> { + query.setParameter(param.getParameter(), param.getValue()); + }); + } + total = (Long) query.getSingleResult(); + transaction.commit(); + } catch (Exception e) { + logger.error("lazyLoadingEntityCount from hbmQuery: " + hbmQuery, e); + if (null != transaction) { + transaction.rollback(); + } + total = 0l; + } + return total; + } + + /** + * + * @param clazz + * @param hbmQuery + * @param parameters + * @param first + * @param pageSize + * @return + */ + public List lazyLoadingEntityList(Class clazz, String hbmQuery, List parameters, int first, int pageSize) { + List results; + Transaction transaction = null; + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + Query query = session.createQuery(hbmQuery, clazz); + if (null != parameters) { + parameters.forEach(param -> { + query.setParameter(param.getParameter(), param.getValue()); + }); + } + query.setFirstResult(first); + query.setMaxResults(pageSize); + + results = query.getResultList(); + transaction.commit(); + } catch (Exception e) { + logger.error("lazyLoadingEntityList from class: " + clazz.getName(), e); + if (null != transaction) { + transaction.rollback(); + } + results = new ArrayList<>(); + } + return results; + } + + final Logger logger = LogManager.getLogger(getClass()); +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/repository/core/HumanResourceRepository.java b/ace-controller/src/main/java/com/arrebol/apc/repository/core/HumanResourceRepository.java new file mode 100644 index 0000000..0849bcb --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/repository/core/HumanResourceRepository.java @@ -0,0 +1,97 @@ +/* + * 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.repository.core; + +import com.arrebol.apc.model.core.HumanResource; +import com.arrebol.apc.model.core.constance.HumanResourceCfg; +import com.arrebol.apc.repository.AbstractRepository; +import java.io.Serializable; +import java.math.BigDecimal; +import javax.persistence.criteria.CriteriaBuilder; +import javax.persistence.criteria.CriteriaUpdate; +import javax.persistence.criteria.Root; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.hibernate.HibernateException; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class HumanResourceRepository extends AbstractRepository implements Serializable { + + /** + * + * @param hr + * @param updateAvatar + * @return + */ + public boolean updateByHumanResourceId(HumanResource hr, boolean updateAvatar) { + logger.debug("updateByHumanResourceId"); + + boolean success = false; + try { + openConnection(); + + CriteriaBuilder builder = getSession().getCriteriaBuilder(); + CriteriaUpdate update = builder.createCriteriaUpdate(HumanResource.class); + Root root = update.from(HumanResource.class); + + if (updateAvatar) { + update.set(root.get(HumanResourceCfg.FIELD_AVATAR), hr.getAvatar()); + } else { + update.set(root.get(HumanResourceCfg.FIELD_FIRST_NAME), hr.getFirstName()); + update.set(root.get(HumanResourceCfg.FIELD_SECOND_NAME), hr.getSecondName()); + update.set(root.get(HumanResourceCfg.FIELD_LAST_NAME), hr.getLastName()); + update.set(root.get(HumanResourceCfg.FIELD_MIDDLE_NAME), hr.getMiddleName()); + update.set(root.get(HumanResourceCfg.FIELD_BIRTHDATE), hr.getBirthdate()); + update.set(root.get(HumanResourceCfg.FIELD_ADMISSION_DATE), hr.getAdmissionDate()); + update.set(root.get(HumanResourceCfg.FIELD_PAYMENT), hr.getPayment()); + update.set(root.get(HumanResourceCfg.FIELD_IMSS), hr.getImss()); + update.set(root.get(HumanResourceCfg.FIELD_ROLE), hr.getRoleCtlg()); + update.set(root.get(HumanResourceCfg.FIELD_BONUS), hr.getBonus()); + + if(hr.getEmployeeSaving() != null){ + update.set(root.get(HumanResourceCfg.FIELD_EMPLOYEE_SAVING), hr.getEmployeeSaving()); + }else{ + update.set(root.get(HumanResourceCfg.FIELD_EMPLOYEE_SAVING), BigDecimal.ZERO); + } + + //update.set(root.get(HumanResourceCfg.FIELD_HR_TYPE), hr.getHumanResourceType()); + } + + update.set(root.get(HumanResourceCfg.FIELD_LAST_UPDATED_BY), hr.getLastUpdatedBy()); + update.set(root.get(HumanResourceCfg.FIELD_LAST_UPDATED_ON), hr.getLastUpdatedOn()); + + update.where(builder.equal(root.get(HumanResourceCfg.FIELD_ID), hr.getId())); + + int total = getSession().createQuery(update).executeUpdate(); + + if (1 == total) { + closeConnection(); + + success = true; + + logger.debug("Human resource updated"); + } else { + logger.error("Update HR from create user", new Exception("Was avatar update " + updateAvatar)); + rollback(); + } + } catch (HibernateException e) { + logger.error("updateByHumanResourceId hibernate", e); + rollback(); + } catch (Exception e) { + logger.error("Method updateByHumanResourceId() ", e); + rollback(); + } + return success; + } + + private static final long serialVersionUID = -5624272695296306941L; + final Logger logger = LogManager.getLogger(HumanResourceRepository.class); +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/repository/core/OfficeRepository.java b/ace-controller/src/main/java/com/arrebol/apc/repository/core/OfficeRepository.java new file mode 100644 index 0000000..01b4c77 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/repository/core/OfficeRepository.java @@ -0,0 +1,110 @@ +/* + * 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.repository.core; + +import com.arrebol.apc.controller.util.HibernateUtil; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.constance.OfficeCfg; +import com.arrebol.apc.model.enums.OfficeStatus; +import com.arrebol.apc.repository.AbstractRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.enterprise.context.RequestScoped; +import javax.persistence.Tuple; +import javax.persistence.criteria.CriteriaBuilder; +import javax.persistence.criteria.CriteriaQuery; +import javax.persistence.criteria.Path; +import javax.persistence.criteria.Root; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.hibernate.HibernateException; +import org.hibernate.Session; +import org.hibernate.Transaction; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@RequestScoped +public class OfficeRepository extends AbstractRepository implements Serializable { + + public List getAllActiveOffice() { + logger.debug("getAllActiveOffice"); + + List offices = null; + Session session = null; + Transaction transaction = null; + try { + session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + CriteriaBuilder builder = session.getCriteriaBuilder(); + CriteriaQuery query = builder.createQuery(Office.class); + Root root = query.from(Office.class); + Path idPath = root.get(OfficeCfg.FIELD_ID); + Path permissionPath = root.get(OfficeCfg.FIELD_PERMISSION); + + query.select(builder.construct(Office.class, idPath, permissionPath)); + query.where(builder.equal(root.get(OfficeCfg.FIELD_OFFICE_STATUS), OfficeStatus.ENEBLED)); + query.orderBy(builder.asc(root.get(OfficeCfg.FIELD_PERMISSION))); + + offices = session.createQuery(query).getResultList(); + + transaction.commit(); + logger.debug("Total of office: " + offices.size()); + } catch (HibernateException e) { + logger.error("getAllActiveOffice Hibernate", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + } catch (Exception e) { + logger.error("Method getAllActiveOffice() ", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + } finally { + if (null != session) { + session.close(); + } + } + return offices; + } + + /** + * + * @param xmlQueryTuple + * @param parameters + * @return + */ + public List findAllOfficesByUser(String xmlQueryTuple, List parameters) { + logger.debug("findAllOfficesByUser"); + + List offices = new ArrayList<>(); + try { + List tupleLst = xmlQueryTuple(xmlQueryTuple, parameters); + + tupleLst.forEach((tuple) -> { + offices.add(new Office((String) tuple.get(0), (String) tuple.get(1))); + }); + + logger.debug("User has office " + offices.size()); + } catch (HibernateException e) { + logger.error("findAllOfficeByUser hibernate", e); + } catch (Exception e) { + logger.error("Method findAllOfficeByUser() ", e); + } + return offices; + } + + private static final long serialVersionUID = 1712329089116981172L; + final Logger logger = LogManager.getLogger(OfficeRepository.class); +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/repository/core/PermissionRepository.java b/ace-controller/src/main/java/com/arrebol/apc/repository/core/PermissionRepository.java new file mode 100644 index 0000000..2afc8dd --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/repository/core/PermissionRepository.java @@ -0,0 +1,93 @@ +/* + * 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.repository.core; + +import com.arrebol.apc.model.core.Permission; +import com.arrebol.apc.model.core.constance.PermissionCfg; +import com.arrebol.apc.model.enums.PermissionStatus; +import com.arrebol.apc.model.enums.PermissionType; +import com.arrebol.apc.repository.AbstractRepository; +import java.io.Serializable; +import java.util.List; +import javax.persistence.criteria.CriteriaBuilder; +import javax.persistence.criteria.CriteriaQuery; +import javax.persistence.criteria.Path; +import javax.persistence.criteria.Root; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.hibernate.HibernateException; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class PermissionRepository extends AbstractRepository implements Serializable { + + public List getAllActivePermissionByType(PermissionType permissionType) { + logger.debug("getAllActivePermissionByType"); + + List permissions = null; + try { + openConnection(); + + CriteriaBuilder builder = getSession().getCriteriaBuilder(); + CriteriaQuery query = builder.createQuery(Permission.class); + Root root = query.from(Permission.class); + Path id = root.get(PermissionCfg.FIELD_ID); + Path permission = root.get(PermissionCfg.FIELD_PERMISSION); + Path description = root.get(PermissionCfg.FIELD_DESCRIPTION); + Path menuPath = root.get(PermissionCfg.FIELD_MENU_PATH); + + query.select(builder.construct(Permission.class, id, permission, description, menuPath)); + query.where( + builder.and( + builder.equal(root.get(PermissionCfg.FIELD_PERMISSION_STATUS), PermissionStatus.ENEBLED), + builder.equal(root.get(PermissionCfg.FIELD_PERMISSION_TYPE), permissionType) + ) + ); + + query.orderBy( + builder.asc(root.get(PermissionCfg.FIELD_LEFT_TO_RIGHT)), + builder.asc(root.get(PermissionCfg.FIELD_TOP_TO_BOTTOM)) + ); + + permissions = getSession().createQuery(query).getResultList(); + + closeConnection(); + logger.debug("Total of permissions: " + permissions.size()); + } catch (HibernateException e) { + logger.error("getAllActivePermissionByType hibernate", e); + rollback(); + } catch (Exception e) { + logger.error("Method getAllActivePermissionByType() ", e); + rollback(); + } + + return permissions; + } + + /** + * + * @return + */ + public List findAllEnebledPermissions() { + logger.debug("findAllEnebledPermissions"); + List permissions = null; + + try { + permissions = xmlQueryAPCEntities(Permission.class, PermissionCfg.QUERY_FIND_ENEBLED_PERMISSIONS, null); + } catch (Exception e) { + logger.error("findAllEnebledPermissions", e); + } + + return permissions; + } + + private static final long serialVersionUID = -3100646446560072563L; + final Logger logger = LogManager.getLogger(PermissionRepository.class); +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/repository/core/UserByOfficeRepository.java b/ace-controller/src/main/java/com/arrebol/apc/repository/core/UserByOfficeRepository.java new file mode 100644 index 0000000..430d641 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/repository/core/UserByOfficeRepository.java @@ -0,0 +1,373 @@ +/* + * 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.repository.core; + +import com.arrebol.apc.controller.util.HibernateUtil; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.catalog.HumanResourceHasRoute; +import com.arrebol.apc.model.catalog.RouteCtlg; +import com.arrebol.apc.model.core.HumanResource; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.Permission; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.core.UserByOffice; +import com.arrebol.apc.model.core.UserByOfficeHasPermission; +import com.arrebol.apc.model.core.constance.HumanResourceHasRouteCfg; +import com.arrebol.apc.model.core.constance.UserByOfficeCfg; +import com.arrebol.apc.model.core.constance.UserByOfficeHasPermissionCfg; +import com.arrebol.apc.model.core.constance.UserCfg; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.enums.UserStatus; +import com.arrebol.apc.model.enums.UserType; +import com.arrebol.apc.repository.AbstractRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import javax.enterprise.context.RequestScoped; +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; +import org.hibernate.query.Query; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@RequestScoped +public class UserByOfficeRepository extends AbstractRepository implements Serializable { + + public List findUsersInOfficeInStatuses(List statuses, Office office, String ownerId) { + logger.debug("findUsersInOfficeInStatuses"); + + List userByOfficeLst = new ArrayList<>(); + Session session = null; + Transaction transaction = null; + try { + session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + List tupleLst = session + .createNamedQuery( + UserByOfficeCfg.QUERY_FIND_USERS_IN_OFFICE_IN_STATUSES, Tuple.class + ) + .setParameter(UserByOfficeCfg.FIELD_OFFICE, office) + .setParameter(UserByOfficeCfg.PARAM_OWNER_ID, ownerId) + .setParameter(UserCfg.FIELD_USER_STATUS, statuses) + .getResultList(); + + tupleLst.forEach( + (tuple) -> { + userByOfficeLst.add( + new UserByOffice( + tuple.get("id", String.class), + new User( + tuple.get("usrId", String.class), + new HumanResource( + tuple.get("hrId", String.class), + tuple.get("fullName", String.class) + ), + tuple.get("userName", String.class), + tuple.get("certifier", ActiveStatus.class), + tuple.get("userType", UserType.class), + tuple.get("management",ActiveStatus.class) + ) + ) + ); + } + ); + + transaction.commit(); + logger.debug("Office has users " + userByOfficeLst.size()); + } catch (HibernateException e) { + logger.error("findUsersInOfficeInStatuses Hibernate", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + } catch (Exception e) { + logger.error("Method findUsersInOfficeInStatuses() ", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + } finally { + if (null != session) { + session.close(); + } + } + return userByOfficeLst; + } + + /** + * + * @param userByOffice + * @return + */ + public UserByOffice findUserLogged(UserByOffice userByOffice) { + logger.debug("findUserLogged"); + + Session session = null; + Transaction transaction = null; + try { + session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + Object idsLst = session.createNamedQuery(UserByOfficeCfg.QUERY_FIND_USER_LOGGED) + .setParameter(UserByOfficeCfg.PARAM_USER_NAME, userByOffice.getUser().getUserName()) + .setParameter(UserByOfficeCfg.PARAM_OFFICE_ID, userByOffice.getOffice().getId()) + .uniqueResult(); + + if (null != idsLst && idsLst instanceof Object[] && ((Object[]) idsLst).length == 8) { + Object[] obj = ((Object[]) idsLst); + + HumanResource hr = new HumanResource( + obj[2].toString(), + obj[3].toString(), + obj[4].toString(), + obj[5].toString() + ); + + userByOffice.setId(obj[0].toString()); + userByOffice.getUser().setId(obj[1].toString()); + userByOffice.getUser().setHumanResource(hr); + userByOffice.setOffice(new Office(obj[6].toString(), obj[7].toString())); + } + + transaction.commit(); + logger.debug("User logged: " + userByOffice); + } catch (HibernateException e) { + logger.error("findUserLogged Hibernate", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + } catch (Exception e) { + logger.error("Method findUserLogged() ", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + } finally { + if (null != session) { + session.close(); + } + } + + return userByOffice; + } + + /** + * + * @param xmlQuery + * @param parameters + * @return + */ + public UserByOffice findIdOfUserByOffice(String xmlQuery, List parameters) { + UserByOffice userByOffice = null; + try { + List tupleLst = xmlQueryTuple(xmlQuery, parameters); + + for (Tuple tuple : tupleLst) { + userByOffice = new UserByOffice((String) tuple.get(UserByOfficeCfg.FIELD_ID)); + } + } catch (Exception e) { + logger.error("getAllActiveOffice hibernate", e); + } + return userByOffice; + } + + public List findList(boolean isRoute, String xmlQuery, List parameters) { + List results = new ArrayList(); + try { + List tupleLst = xmlQueryTuple(xmlQuery, parameters); + + tupleLst.forEach((tuple) -> { + if (isRoute) { + results.add( + new RouteCtlg( + tuple.get("id", String.class), + tuple.get("route", String.class) + ) + ); + } else { + results.add( + new Permission( + tuple.get("id", String.class), + tuple.get("permission", String.class), + tuple.get("description", String.class), + tuple.get("menuPath", String.class) + ) + ); + } + }); + } catch (Exception e) { + logger.error("getAllActiveOffice hibernate", e); + } + return results; + } + + // 1 Borrar rutas y/o permisos + // a- Si usuario previo es web - borrar permisos + // b- Si usuario previo es mobile - borrar rutas + // c- Si usuario previo es ambos - borrar permisos y rutas. + // 2 Actualizar datos + // a- Si usuario es web - agregar permisos + // b- Si usuario es mobile - agragar rutas + // c- Si usuario es ambos - agregar permisos y rutas. + // 3 Actualiza cretificador + public boolean updateUser(UserType newUserType, + UserByOffice userByOffice, ActiveStatus certifier, + List humanResourceHasRoutes, + List userByOfficeHasPermissions,ActiveStatus management) { + logger.info("updateUser"); + boolean success = false; + Session session = null; + Transaction transaction = null; + try { + session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + String query = UserCfg.QUERY_UPDATE_CERTIFIER_AND_USER_TYPE_BY_ID; + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(UserCfg.FIELD_USER_TYPE, newUserType)); + parameters.add(new ModelParameter(UserCfg.FIELD_CERTIFIER, certifier)); + parameters.add(new ModelParameter(UserCfg.FIELD_LAST_UPDATED_BY, userByOffice.getCreatedBy())); + parameters.add(new ModelParameter(UserCfg.FIELD_LAST_UPDATED_ON, new Date())); + parameters.add(new ModelParameter(UserCfg.FIELD_ID, userByOffice.getUser().getId())); + parameters.add(new ModelParameter(UserCfg.FIELD_MANAGMENT, management)); + + Query updateOrDeleteQuery = session.createNamedQuery(query); + + for (ModelParameter parameter : parameters) { + updateOrDeleteQuery.setParameter(parameter.getParameter(), parameter.getValue()); + } + + int total = updateOrDeleteQuery.executeUpdate(); + + if (total > 0) { + switch (userByOffice.getUser().getUserType()) { + case WEB: + query = UserByOfficeHasPermissionCfg.QUERY_DELETE_ALL_PERMISSION_BY_UBO; + updateOrDeleteQuery = session.createNamedQuery(query); + + parameters.clear(); + parameters.add(new ModelParameter(UserByOfficeHasPermissionCfg.FIELD_USER_BY_OFFICE, new UserByOffice(userByOffice.getId()))); + + for (ModelParameter parameter : parameters) { + updateOrDeleteQuery.setParameter(parameter.getParameter(), parameter.getValue()); + } + + updateOrDeleteQuery.executeUpdate(); + break; + case MOBILE: + query = HumanResourceHasRouteCfg.QUERY_DELETE_ALL_HR_HAS_ROUTE_BY_HR; + updateOrDeleteQuery = session.createNamedQuery(query); + + parameters.clear(); + parameters.add(new ModelParameter(HumanResourceHasRouteCfg.FIELD_HUMAN_RESOURCE, new HumanResource(userByOffice.getUser().getHumanResource().getId()))); + + for (ModelParameter parameter : parameters) { + updateOrDeleteQuery.setParameter(parameter.getParameter(), parameter.getValue()); + } + + updateOrDeleteQuery.executeUpdate(); + break; + case BOTH: + // WEB + query = UserByOfficeHasPermissionCfg.QUERY_DELETE_ALL_PERMISSION_BY_UBO; + updateOrDeleteQuery = session.createNamedQuery(query); + + parameters.clear(); + parameters.add(new ModelParameter(UserByOfficeHasPermissionCfg.FIELD_USER_BY_OFFICE, new UserByOffice(userByOffice.getId()))); + + for (ModelParameter parameter : parameters) { + updateOrDeleteQuery.setParameter(parameter.getParameter(), parameter.getValue()); + } + + updateOrDeleteQuery.executeUpdate(); + + // MOBILE + query = HumanResourceHasRouteCfg.QUERY_DELETE_ALL_HR_HAS_ROUTE_BY_HR; + updateOrDeleteQuery = session.createNamedQuery(query); + + parameters.clear(); + parameters.add(new ModelParameter(HumanResourceHasRouteCfg.FIELD_HUMAN_RESOURCE, new HumanResource(userByOffice.getUser().getHumanResource().getId()))); + + for (ModelParameter parameter : parameters) { + updateOrDeleteQuery.setParameter(parameter.getParameter(), parameter.getValue()); + } + + updateOrDeleteQuery.executeUpdate(); + break; + } + + switch (newUserType) { + case WEB: + userByOfficeHasPermissions.forEach(session::save); + break; + case MOBILE: + humanResourceHasRoutes.forEach(session::save); + break; + case BOTH: + userByOfficeHasPermissions.forEach(session::save); + humanResourceHasRoutes.forEach(session::save); + break; + } + + success = true; + transaction.commit(); + } else { + transaction.rollback(); + } + } catch (HibernateException e) { + logger.error("updateUser Hibernate", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + } catch (Exception e) { + logger.error("Method updateUser() ", e); + if (null != transaction) { + transaction.rollback(); + } + throw e; + } finally { + if (null != session) { + session.close(); + } + } + return success; + } + + /** + * + * @param updateQuery + * @param parameters + * @return + */ + public boolean updateEntityByQuery(String updateQuery, List parameters) { + logger.info("updateEntityByQuery"); + try { + if (null == updateQuery || null == parameters || parameters.isEmpty()) { + return false; + } + + return xmlUpdateOrDelete(updateQuery, parameters); + } catch (Exception e) { + logger.error("updateEntityByQuery", e); + throw e; + } + } + + private static final long serialVersionUID = -6925993802118470170L; + final Logger logger = LogManager.getLogger(UserByOfficeRepository.class); +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/repository/core/UserRepository.java b/ace-controller/src/main/java/com/arrebol/apc/repository/core/UserRepository.java new file mode 100644 index 0000000..870ff75 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/repository/core/UserRepository.java @@ -0,0 +1,186 @@ +/* + * 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.repository.core; + +import com.arrebol.apc.model.catalog.HumanResourceHasRoute; +import com.arrebol.apc.model.catalog.HumanResourceHasRouteId; +import com.arrebol.apc.model.catalog.RouteCtlg; +import com.arrebol.apc.model.core.HumanResource; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.core.UserByOffice; +import com.arrebol.apc.model.core.UserByOfficeHasPermission; +import com.arrebol.apc.model.core.constance.UserByOfficeCfg; +import com.arrebol.apc.model.core.constance.UserCfg; +import com.arrebol.apc.repository.AbstractRepository; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.persistence.Tuple; +import javax.persistence.criteria.CriteriaBuilder; +import javax.persistence.criteria.CriteriaUpdate; +import javax.persistence.criteria.Root; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.hibernate.HibernateException; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class UserRepository extends AbstractRepository implements Serializable { + + /** + * + * @param officeId + * @return + */ + public List findAllUsersByOffice(String officeId) { + logger.debug("findAllUsersByOffice"); + + List users = new ArrayList<>(); + try { + openConnection(); + + List tupleLst = getSession().createNamedQuery(UserCfg.QUERY_FIND_ALL_USERS_BY_OFFICE, Tuple.class) + .setParameter(UserByOfficeCfg.FIELD_OFFICE, new Office(officeId)) + .getResultList(); + + tupleLst.forEach((tuple) -> { + HumanResource hr = new HumanResource((String) tuple.get(0), (String) tuple.get(0), (String) tuple.get(0)); + User usr = new User((String) tuple.get(0), (String) tuple.get(1), hr); + + users.add(usr); + }); + + closeConnection(); + logger.debug("Office has users " + users.size()); + } catch (HibernateException e) { + logger.error("findAllUsersByOffice hibernate", e); + rollback(); + } catch (Exception e) { + logger.error("Method findAllUsersByOffice() ", e); + rollback(); + } + return users; + } + + /** + * + * @param user + * @param fromView 1 = From View User -> Create
+ * @return + */ + @Deprecated + public boolean updateUserById(User user, int fromView) { + logger.debug("updateByHumanResourceId"); + + boolean success = false; + try { + openConnection(); + + CriteriaBuilder builder = getSession().getCriteriaBuilder(); + CriteriaUpdate update = builder.createCriteriaUpdate(HumanResource.class); + Root root = update.from(HumanResource.class); + + switch (fromView) { + case 1: + update.set(root.get(UserCfg.FIELD_HUMAN_RESOURCE), user.getHumanResource()); + //update.set(root.get(UserCfg.FIELD_USER_NAME), user.getUserName()); + update.set(root.get(UserCfg.FIELD_PASSWORD), user.getPassword()); + break; + } + + update.set(root.get(UserCfg.FIELD_LAST_UPDATED_BY), user.getLastUpdatedBy()); + update.set(root.get(UserCfg.FIELD_LAST_UPDATED_ON), user.getLastUpdatedOn()); + + update.where(builder.equal(root.get(UserCfg.FIELD_ID), user.getId())); + + int total = getSession().createQuery(update).executeUpdate(); + + if (1 == total) { + closeConnection(); + success = true; + logger.debug("User updated"); + } else { + logger.error("Update user", new Exception("From: " + fromView)); + rollback(); + } + } catch (HibernateException e) { + logger.error("updateByHumanResourceId hibernate", e); + rollback(); + } catch (Exception e) { + logger.error("Method updateByHumanResourceId() ", e); + rollback(); + } + return success; + } + + /** + * 1) Verifica que el usuario aun este disponible 2) Verifica que tipo de + * usuario se va a crear y en todos los casos se debera de guardar usuario y + * oficina mĆ”s las carecteristicas propias de cada tipo de usuario: A) WEB + * debe guardar permisos B) MOBILE debe guardar rutas C) BOTH debe guardar + * rutas y permisos. + * + * @param user + * @param userByOffice + * @param humanResourceHasRoutes + * @param userByOfficeHasPermissions + * @return + */ + public boolean createUser(User user, UserByOffice userByOffice, + List humanResourceHasRoutes, + List userByOfficeHasPermissions) { + boolean success = false; + + try { + openConnection(); + + // Start generic block for all user types + getSession().save(user); + + userByOffice.setUser(new User(user.getId())); + + getSession().save(userByOffice); + // End generic block for all user types + + switch (user.getUserType()) { + case WEB: + userByOfficeHasPermissions.forEach((value) -> { + value.getId().setIdUserByOffice(userByOffice.getId()); + getSession().save(value); + }); + break; + case MOBILE: + humanResourceHasRoutes.forEach(getSession()::save); + break; + case BOTH: + userByOfficeHasPermissions.forEach((value) -> { + value.getId().setIdUserByOffice(userByOffice.getId()); + getSession().save(value); + }); + + humanResourceHasRoutes.forEach(getSession()::save); + break; + } + + closeConnection(); + success = true; + } catch (HibernateException e) { + logger.error("updateByHumanResourceId hibernate", e); + rollback(); + } catch (Exception e) { + logger.error("Method updateByHumanResourceId() ", e); + rollback(); + } + return success; + } + private static final long serialVersionUID = -3153392012298562511L; + final Logger logger = LogManager.getLogger(UserRepository.class); +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/service/AutoCompleteService.java b/ace-controller/src/main/java/com/arrebol/apc/service/AutoCompleteService.java new file mode 100644 index 0000000..1667ddc --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/service/AutoCompleteService.java @@ -0,0 +1,25 @@ +/* + * 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.service; + +import java.util.List; + +/** + * + * @author Carlos Janitzio Zavala Lopez + * @param + */ +public interface AutoCompleteService { + + /** + * + * @param valueToSearch + * @return + */ + public List queryLike(String valueToSearch); +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/service/BitacoraService.java b/ace-controller/src/main/java/com/arrebol/apc/service/BitacoraService.java new file mode 100644 index 0000000..2a28295 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/service/BitacoraService.java @@ -0,0 +1,24 @@ +/* + * 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.service; + +import com.arrebol.apc.model.system.logs.Bitacora; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface BitacoraService { + + /** + * + * @param bitacora + * @return + */ + boolean saveBitacora(Bitacora bitacora); +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/service/BitacoraServiceImpl.java b/ace-controller/src/main/java/com/arrebol/apc/service/BitacoraServiceImpl.java new file mode 100644 index 0000000..1fe5017 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/service/BitacoraServiceImpl.java @@ -0,0 +1,30 @@ +/* + * 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.service; + +import com.arrebol.apc.model.system.logs.Bitacora; +import com.arrebol.apc.repository.LazyDataModelDAORepository; +import javax.enterprise.context.RequestScoped; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@RequestScoped +public class BitacoraServiceImpl extends LazyDataModelDAORepository implements BitacoraService { + + @Override + public boolean saveBitacora(Bitacora bitacora) { + logger.debug("saveBitacora"); + return save(bitacora); + } + + final Logger logger = LogManager.getLogger(getClass()); +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/service/GenericValidationService.java b/ace-controller/src/main/java/com/arrebol/apc/service/GenericValidationService.java new file mode 100644 index 0000000..054c1b5 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/service/GenericValidationService.java @@ -0,0 +1,32 @@ +/* + * 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.service; + +import com.arrebol.apc.model.core.User; +import java.util.Date; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface GenericValidationService { + + /** + * + * @param user + * @return + */ + Date lastStableSmallBoxByDate(User user); + + /** + * + * @param date + * @return + */ + boolean existStableSmallBoxByCreatedOn(Date date); +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/service/GenericValidationServiceImpl.java b/ace-controller/src/main/java/com/arrebol/apc/service/GenericValidationServiceImpl.java new file mode 100644 index 0000000..0950292 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/service/GenericValidationServiceImpl.java @@ -0,0 +1,93 @@ +/* + * 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.service; + +import com.arrebol.apc.controller.util.HibernateUtil; +import com.arrebol.apc.model.core.User; +import java.util.Date; +import java.util.List; +import javax.enterprise.context.RequestScoped; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.hibernate.HibernateException; +import org.hibernate.Session; +import org.hibernate.Transaction; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@RequestScoped +public class GenericValidationServiceImpl implements GenericValidationService { + + @Override + public Date lastStableSmallBoxByDate(User user) { + logger.info("lastStableSmallBoxByDate"); + + Date success = null; + Transaction transaction = null; + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + String query = "SELECT cd.createdOn FROM StableSmallBox cd " + + "WHERE DATE(cd.createdOn) <= CURDATE() AND cd.activeStatus = 'ENEBLED' " + + "order by cd.createdOn DESC"; + + success = (Date) session.createQuery(query).setMaxResults(1) + .uniqueResult(); + + transaction.commit(); + + logger.info("Total of closing day found: "); + } catch (HibernateException e) { + logger.error("Can not find stable small box by created on", e); + if (null != transaction) { + transaction.rollback(); + } + } catch (Exception e) { + logger.error("Method lastStableSmallBoxByDate()", e); + if (null != transaction) { + transaction.rollback(); + } + } + + return success; + } + + @Override + public boolean existStableSmallBoxByCreatedOn(Date date) { + logger.info("existStableSmallBoxByCreatedOn"); + boolean success = true; + Transaction transaction = null; + try { + Session session = HibernateUtil.getSessionFactory().getCurrentSession(); + transaction = session.beginTransaction(); + + String query = "SELECT ssb.id FROM APC_STABLE_SMALL_BOX ssb " + + "WHERE DATE(ssb.created_on) = DATE(:date) AND ssb.active_status = 'ENEBLED'"; + + List records = session.createSQLQuery(query).setParameter("date", date).getResultList(); + + if (records.isEmpty()) { + success = false; + } + + transaction.commit(); + } catch (Exception e) { + logger.error("existStableSmallBoxByCreatedOn", e); + if (null != transaction) { + transaction.rollback(); + } + } + return success; + } + + final Logger logger = LogManager.getLogger(getClass()); + +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/service/LazyDataModelBetweenDatesService.java b/ace-controller/src/main/java/com/arrebol/apc/service/LazyDataModelBetweenDatesService.java new file mode 100644 index 0000000..865df56 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/service/LazyDataModelBetweenDatesService.java @@ -0,0 +1,46 @@ +/* + * 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.service; + +import com.arrebol.apc.model.admin.Transfer; +import java.util.Date; +import java.util.List; +import java.util.Map; +import org.primefaces.model.SortOrder; + +/** + * + * @author Carlos Janitzio Zavala Lopez + * @param + */ +public interface LazyDataModelBetweenDatesService { + + /** + * + * @param filterBy + * @param officeId + * @param starDate + * @param endDate + * @return + */ + long countPaginator(Map filterBy, String officeId, Date starDate, Date endDate); + + /** + * + * @param first + * @param pageSize + * @param sortField + * @param sortOrder + * @param filterBy + * @param officeId + * @param starDate + * @param endDate + * @return + */ + List lazyEntityListPaginator(int first, int pageSize, String sortField, SortOrder sortOrder, Map filterBy, String officeId, Date starDate, Date endDate); +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/service/LazyDataModelService.java b/ace-controller/src/main/java/com/arrebol/apc/service/LazyDataModelService.java new file mode 100644 index 0000000..06a0316 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/service/LazyDataModelService.java @@ -0,0 +1,38 @@ +/* + * 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.service; + +import java.util.List; +import java.util.Map; +import org.primefaces.model.SortOrder; + +/** + * + * @author Carlos Janitzio Zavala Lopez + * @param + */ +public interface LazyDataModelService { + + /** + * + * @param filterBy + * @return + */ + long countPaginator(Map filterBy); + + /** + * + * @param first + * @param pageSize + * @param sortField + * @param sortOrder + * @param filterBy + * @return + */ + List lazyEntityListPaginator(int first, int pageSize, String sortField, SortOrder sortOrder, Map filterBy); +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/service/admin/CustomerService.java b/ace-controller/src/main/java/com/arrebol/apc/service/admin/CustomerService.java new file mode 100644 index 0000000..fa34359 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/service/admin/CustomerService.java @@ -0,0 +1,58 @@ +/* + * 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.service.admin; + +import com.arrebol.apc.model.catalog.RouteCtlg; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.enums.CustomerClassification; +import com.arrebol.apc.model.enums.PeopleType; +import com.arrebol.apc.model.views.CustomerView; +import com.arrebol.apc.service.LazyDataModelService; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface CustomerService extends LazyDataModelService { + + /** + * + * @param type + * @param peopleIdToUpdate + * @param lastUpdatedBy + * @return + */ + boolean updatePeopleTypeById(PeopleType type, String peopleIdToUpdate, String lastUpdatedBy); + + /** + * + * @param status + * @param peopleIdToUpdate + * @param lastUpdatedBy + * @return + */ + boolean updatePeopleByStatus(ActiveStatus status, String peopleIdToUpdate, String lastUpdatedBy); + + /** + * + * @param classification + * @param peopleIdToUpdate + * @param lastUpdatedBy + * @return + */ + public boolean updatePeopleByClassification(CustomerClassification classification, String peopleIdToUpdate, String lastUpdatedBy); + + /** + * + * @param route + * @param peopleIdToUpdate + * @param lastUpdatedBy + * @return + */ + boolean updateRouteById(RouteCtlg route, String peopleIdToUpdate, String lastUpdatedBy); +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/service/admin/CustomerServiceImpl.java b/ace-controller/src/main/java/com/arrebol/apc/service/admin/CustomerServiceImpl.java new file mode 100644 index 0000000..9e380e2 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/service/admin/CustomerServiceImpl.java @@ -0,0 +1,137 @@ +/* + * 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.service.admin; + +import com.arrebol.apc.controller.util.FilterMap; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.catalog.RouteCtlg; +import com.arrebol.apc.model.catalog.constance.PeopleCfg; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.enums.CustomerClassification; +import com.arrebol.apc.model.enums.PeopleType; +import com.arrebol.apc.model.views.CustomerView; +import com.arrebol.apc.repository.LazyDataModelDAORepository; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; +import javax.enterprise.context.RequestScoped; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.primefaces.model.SortOrder; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@RequestScoped +public class CustomerServiceImpl extends LazyDataModelDAORepository implements CustomerService { + + @Override + public boolean updatePeopleTypeById(PeopleType type, String peopleIdToUpdate, String lastUpdatedBy) { + logger.debug("updatePeopleTypeById"); + + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(PeopleCfg.FIELD_PEOPLE_TYPE, type)); + parameters.add(new ModelParameter(PeopleCfg.FIELD_LAST_UPDATED_BY, lastUpdatedBy)); + parameters.add(new ModelParameter(PeopleCfg.FIELD_LAST_UPDATED_ON, new Date())); + parameters.add(new ModelParameter(PeopleCfg.FIELD_ID, peopleIdToUpdate)); + + return xmlUpdateOrDelete(PeopleCfg.UPDATE_PEOPLE_TYPE_BY_STATUS, parameters); + } + + @Override + public boolean updatePeopleByStatus(ActiveStatus status, String peopleIdToUpdate, String lastUpdatedBy) { + logger.debug("updatePeopleByStatus"); + + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(PeopleCfg.FIELD_ACTIVE_STATUS, status)); + parameters.add(new ModelParameter(PeopleCfg.FIELD_LAST_UPDATED_BY, lastUpdatedBy)); + parameters.add(new ModelParameter(PeopleCfg.FIELD_LAST_UPDATED_ON, new Date())); + parameters.add(new ModelParameter(PeopleCfg.FIELD_ID, peopleIdToUpdate)); + + return xmlUpdateOrDelete(PeopleCfg.UPDATE_PEOPLE_BY_STATUS, parameters); + } + + @Override + public boolean updatePeopleByClassification(CustomerClassification classification, String peopleIdToUpdate, String lastUpdatedBy) { + logger.debug("updatePeopleByClassification"); + + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(PeopleCfg.FIELD_CLASSIFICATION, classification)); + parameters.add(new ModelParameter(PeopleCfg.FIELD_LAST_UPDATED_BY, lastUpdatedBy)); + parameters.add(new ModelParameter(PeopleCfg.FIELD_LAST_UPDATED_ON, new Date())); + parameters.add(new ModelParameter(PeopleCfg.FIELD_ID, peopleIdToUpdate)); + + return xmlUpdateOrDelete(PeopleCfg.UPDATE_PEOPLE_BY_CLASSIFICATION, parameters); + } + + @Override + public boolean updateRouteById(RouteCtlg route, String peopleIdToUpdate, String lastUpdatedBy) { + logger.debug("updateRouteById"); + + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(PeopleCfg.FIELD_ROUTE, route)); + parameters.add(new ModelParameter(PeopleCfg.FIELD_LAST_UPDATED_BY, lastUpdatedBy)); + parameters.add(new ModelParameter(PeopleCfg.FIELD_LAST_UPDATED_ON, new Date())); + parameters.add(new ModelParameter(PeopleCfg.FIELD_ID, peopleIdToUpdate)); + + return xmlUpdateOrDelete(PeopleCfg.UPDATE_ROUTE_BY_PEOPLE, parameters); + } + + @Override + public long countPaginator(Map filterBy) { + logger.debug("countPaginator"); + try { + StringBuilder sqlQuery = new StringBuilder("SELECT COUNT(id) FROM CustomerView "); + + sqlQuery.append(FilterMap.filterByExcludeGlobalFilter(filterBy, false)); + + return lazyLoadingEntityCount(sqlQuery.toString(), null); + } catch (Exception e) { + logger.error("countPaginator", e); + + return 0l; + } + } + + @Override + public List lazyEntityListPaginator(int first, int pageSize, String sortField, SortOrder sortOrder, Map filterBy) { + logger.debug("fillListPaginator"); + try { + StringBuilder sqlQuery = new StringBuilder("FROM CustomerView "); + + sqlQuery.append(FilterMap.filterByExcludeGlobalFilter(filterBy, false)); + sqlQuery.append(" ORDER BY "); + + if (null == sortField || "".equals(sortField)) { + sqlQuery.append(" fullName ASC"); + } else { + sqlQuery.append(sortField); + + if (null != sortOrder) { + sqlQuery.append(" "); + sqlQuery.append(sortOrder.equals(SortOrder.ASCENDING) ? "ASC" : "DESC"); + } else { + sqlQuery.append(" ASC"); + } + } + + return lazyLoadingEntityList(CustomerView.class, sqlQuery.toString(), null, first, pageSize); + } catch (Exception e) { + logger.error("CustomerView", e); + return new ArrayList(); + } + } + + final Logger logger = LogManager.getLogger(getClass()); +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/service/admin/PeopleService.java b/ace-controller/src/main/java/com/arrebol/apc/service/admin/PeopleService.java new file mode 100644 index 0000000..cdda933 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/service/admin/PeopleService.java @@ -0,0 +1,31 @@ +/* + * 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.service.admin; + +import com.arrebol.apc.model.catalog.People; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface PeopleService { + + /** + * + * @param peopleId + * @return + */ + People findPeopleById(String peopleId); + + /** + * + * @param people + * @return + */ + boolean savePeople(People people); +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/service/admin/PeopleServiceImpl.java b/ace-controller/src/main/java/com/arrebol/apc/service/admin/PeopleServiceImpl.java new file mode 100644 index 0000000..caf2a65 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/service/admin/PeopleServiceImpl.java @@ -0,0 +1,36 @@ +/* + * 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.service.admin; + +import com.arrebol.apc.model.catalog.People; +import com.arrebol.apc.repository.LazyDataModelDAORepository; +import javax.enterprise.context.RequestScoped; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@RequestScoped +public class PeopleServiceImpl extends LazyDataModelDAORepository implements PeopleService { + + @Override + public People findPeopleById(String peopleId) { + logger.debug("findPeopleById"); + + return (People) findAPCEntity(People.class, peopleId); + } + + public boolean savePeople(People people) { + logger.debug("savePeopleController"); + return save(people); + } + + final Logger logger = LogManager.getLogger(getClass()); +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/service/admin/TransferService.java b/ace-controller/src/main/java/com/arrebol/apc/service/admin/TransferService.java new file mode 100644 index 0000000..dac1030 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/service/admin/TransferService.java @@ -0,0 +1,36 @@ +/* + * 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.service.admin; + +import com.arrebol.apc.model.admin.Transfer; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.views.TransferView; +import com.arrebol.apc.service.LazyDataModelBetweenDatesService; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface TransferService extends LazyDataModelBetweenDatesService { + + /** + * + * @param status + * @param transferIdToUpdate + * @param lastUpdatedBy + * @return + */ + boolean updateTransferByStatus(ActiveStatus status, String transferIdToUpdate, String lastUpdatedBy); + + /** + * + * @param transfer + * @return + */ + boolean saveTransfer(Transfer transfer); +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/service/admin/TransferServiceImpl.java b/ace-controller/src/main/java/com/arrebol/apc/service/admin/TransferServiceImpl.java new file mode 100644 index 0000000..2370c4c --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/service/admin/TransferServiceImpl.java @@ -0,0 +1,131 @@ +/* + * 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.service.admin; + +import com.arrebol.apc.controller.util.FilterMap; +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.admin.Transfer; +import com.arrebol.apc.model.admin.constance.TransferCfg; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.views.TransferView; +import com.arrebol.apc.repository.LazyDataModelDAORepository; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; +import javax.enterprise.context.RequestScoped; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.primefaces.model.SortOrder; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@RequestScoped +public class TransferServiceImpl extends LazyDataModelDAORepository implements TransferService { + + final Logger logger = LogManager.getLogger(getClass()); + + @Override + public boolean updateTransferByStatus(ActiveStatus status, String transferIdToUpdate, String lastUpdatedBy) { + logger.debug("updateTransferByStatus"); + try { + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(TransferCfg.FIELD_ACTIVE_STATUS, status)); + parameters.add(new ModelParameter(TransferCfg.FIELD_LAST_UPDATED_BY, lastUpdatedBy)); + parameters.add(new ModelParameter(TransferCfg.FIELD_LAST_UPDATED_ON, new Date())); + parameters.add(new ModelParameter(TransferCfg.FIELD_ID, transferIdToUpdate)); + + return xmlUpdateOrDelete(TransferCfg.QUERY_UPDATE_TRANSFER_BY_ACTIVE_STATUS, parameters); + } catch (Exception e) { + logger.error("updateTransferByStatus", e); + return false; + } + } + + @Override + public boolean saveTransfer(Transfer transfer) { + logger.debug("saveTransfer"); + return save(transfer); + } + + @Override + public long countPaginator(Map filterBy, String officeId, Date starDate, Date endDate) { + logger.debug("countPaginator"); + try { + StringBuilder sqlQuery = new StringBuilder("SELECT COUNT(id) FROM TransferView "); + + sqlQuery.append(FilterMap.filterByExcludeGlobalFilter(filterBy, false)); + + if (null != filterBy && !filterBy.isEmpty()) { + sqlQuery.append(" AND DATE(createdOn) BETWEEN DATE(:startDate) AND DATE(:endDate) "); + sqlQuery.append(" AND idOffice = :idOffice "); + } else { + sqlQuery.append(" WHERE DATE(createdOn) BETWEEN DATE(:startDate) AND DATE(:endDate) "); + sqlQuery.append(" AND idOffice = :idOffice "); + } + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter("startDate", starDate)); + parameters.add(new ModelParameter("endDate", endDate)); + parameters.add(new ModelParameter("idOffice", officeId)); + + return lazyLoadingEntityCount(sqlQuery.toString(), parameters); + } catch (Exception e) { + logger.error("countPaginator", e); + + return 0l; + } + } + + @Override + public List lazyEntityListPaginator(int first, int pageSize, String sortField, SortOrder sortOrder, Map filterBy, String officeId, Date starDate, Date endDate) { + logger.debug("fillListPaginator"); + try { + StringBuilder sqlQuery = new StringBuilder("FROM TransferView "); + + sqlQuery.append(FilterMap.filterByExcludeGlobalFilter(filterBy, false)); + + if (null != filterBy && !filterBy.isEmpty()) { + sqlQuery.append(" AND DATE(createdOn) BETWEEN DATE(:startDate) AND DATE(:endDate) "); + sqlQuery.append(" AND idOffice = :idOffice "); + } else { + sqlQuery.append(" WHERE DATE(createdOn) BETWEEN DATE(:startDate) AND DATE(:endDate) "); + sqlQuery.append(" AND idOffice = :idOffice "); + } + + sqlQuery.append(" ORDER BY "); + + if (null == sortField || "".equals(sortField)) { + sqlQuery.append(" createdOn ASC"); + } else { + sqlQuery.append(sortField); + + if (null != sortOrder) { + sqlQuery.append(" "); + sqlQuery.append(sortOrder.equals(SortOrder.ASCENDING) ? "ASC" : "DESC"); + } else { + sqlQuery.append(" ASC"); + } + } + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter("startDate", starDate)); + parameters.add(new ModelParameter("endDate", endDate)); + parameters.add(new ModelParameter("idOffice", officeId)); + + return lazyLoadingEntityList(TransferView.class, sqlQuery.toString(), parameters, first, pageSize); + } catch (Exception e) { + logger.error("CustomerView", e); + return new ArrayList(); + } + } +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/service/catalog/LoanService.java b/ace-controller/src/main/java/com/arrebol/apc/service/catalog/LoanService.java new file mode 100644 index 0000000..c8f1d8a --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/service/catalog/LoanService.java @@ -0,0 +1,47 @@ +/* + * 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.service.catalog; + +import com.arrebol.apc.model.loan.Loan; +import com.arrebol.apc.model.loan.LoanByUser; +import com.arrebol.apc.model.loan.LoanDetails; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface LoanService { + + /** + * + * @param loan + * @return + */ + boolean saveLoan(Loan loan); + + /** + * + * @param loanId + * @return + */ + Loan getLoanById(String loanId); + + /** + * + * @param loanByUser + * @return + */ + boolean saveLoanByUser(LoanByUser loanByUser); + + /** + * + * @param loanDetails + * @return + */ + boolean saveLoanDetail(LoanDetails loanDetails); +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/service/catalog/LoanServiceImpl.java b/ace-controller/src/main/java/com/arrebol/apc/service/catalog/LoanServiceImpl.java new file mode 100644 index 0000000..97aa142 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/service/catalog/LoanServiceImpl.java @@ -0,0 +1,51 @@ +/* + * 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.service.catalog; + +import com.arrebol.apc.model.loan.Loan; +import com.arrebol.apc.model.loan.LoanByUser; +import com.arrebol.apc.model.loan.LoanDetails; +import com.arrebol.apc.repository.LazyDataModelDAORepository; +import javax.enterprise.context.RequestScoped; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@RequestScoped +public class LoanServiceImpl extends LazyDataModelDAORepository implements LoanService { + + @Override + public boolean saveLoan(Loan loan) { + logger.debug("saveLoan"); + return save(loan); + } + + @Override + public Loan getLoanById(String loanId) { + logger.debug("getLoanById"); + + return (Loan) findAPCEntity(Loan.class, loanId); + } + + @Override + public boolean saveLoanByUser(LoanByUser loanByUser) { + logger.debug("saveLoanByUser"); + return save(loanByUser); + } + + @Override + public boolean saveLoanDetail(LoanDetails loanDetails) { + logger.debug("saveLoanDetail"); + return save(loanDetails); + } + + final Logger logger = LogManager.getLogger(getClass()); +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/service/catalog/LoanTypeService.java b/ace-controller/src/main/java/com/arrebol/apc/service/catalog/LoanTypeService.java new file mode 100644 index 0000000..7d9312d --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/service/catalog/LoanTypeService.java @@ -0,0 +1,32 @@ +/* + * 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.service.catalog; + +import com.arrebol.apc.model.loan.LoanType; +import java.util.List; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface LoanTypeService { + + /** + * + * @param loanTypeId + * @return + */ + LoanType getLoanTypeById(String loanTypeId); + + /** + * + * @param officeId + * @return + */ + List fillLoanTypeDatatable(String officeId); +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/service/catalog/LoanTypeServiceImpl.java b/ace-controller/src/main/java/com/arrebol/apc/service/catalog/LoanTypeServiceImpl.java new file mode 100644 index 0000000..e2ddd08 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/service/catalog/LoanTypeServiceImpl.java @@ -0,0 +1,47 @@ +/* + * 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.service.catalog; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.constance.LoanTypeCfg; +import com.arrebol.apc.model.loan.LoanType; +import com.arrebol.apc.repository.LazyDataModelDAORepository; +import java.util.ArrayList; +import java.util.List; +import javax.enterprise.context.RequestScoped; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@RequestScoped +public class LoanTypeServiceImpl extends LazyDataModelDAORepository implements LoanTypeService { + + @Override + public LoanType getLoanTypeById(String loanTypeId) { + logger.debug("getLoanTypeById"); + + return (LoanType) findAPCEntity(LoanType.class, loanTypeId); + } + + @Override + public List fillLoanTypeDatatable(String officeId) { + logger.debug("fillLoanTypeDatatable"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(LoanTypeCfg.FIELD_OFFICE, new Office(officeId))); + + return xmlQueryAPCEntities(LoanType.class, LoanTypeCfg.QUERY_FIND_ALL_DATA_LOAN_TYPE_BY_OFFICE, parameters); + } + + final Logger logger = LogManager.getLogger(getClass()); + +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/service/catalog/PeopleAutoCompleteService.java b/ace-controller/src/main/java/com/arrebol/apc/service/catalog/PeopleAutoCompleteService.java new file mode 100644 index 0000000..52fff2b --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/service/catalog/PeopleAutoCompleteService.java @@ -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.service.catalog; + +import com.arrebol.apc.model.catalog.People; +import java.util.List; + +/** + * + * @author Carlos Janitzio Zavala Lopez + * + */ +public interface PeopleAutoCompleteService { + + List findCustomersLike(String valueToSearch); + + List findEndorsementsLike(String valueToSearch); +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/service/catalog/PeopleAutoCompleteServiceImpl.java b/ace-controller/src/main/java/com/arrebol/apc/service/catalog/PeopleAutoCompleteServiceImpl.java new file mode 100644 index 0000000..601f5a4 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/service/catalog/PeopleAutoCompleteServiceImpl.java @@ -0,0 +1,83 @@ +/* + * 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.service.catalog; + +import com.arrebol.apc.model.catalog.People; +import com.arrebol.apc.repository.AutoCompleteDAORepository; +import java.util.ArrayList; +import java.util.List; +import javax.enterprise.context.RequestScoped; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@RequestScoped +public class PeopleAutoCompleteServiceImpl extends AutoCompleteDAORepository implements PeopleAutoCompleteService { + + @Override + public List findCustomersLike(String valueToSearch) { + try { + StringBuilder builder = new StringBuilder("FROM People WHERE "); + + builder.append("(firstName LIKE '%"); + builder.append(valueToSearch); + builder.append("%' OR "); + builder.append("secondName LIKE '%"); + builder.append(valueToSearch); + builder.append("%' OR "); + builder.append("lastName LIKE '%"); + builder.append(valueToSearch); + builder.append("%' OR "); + builder.append("middleName LIKE '%"); + builder.append(valueToSearch); + builder.append("%') "); + builder.append("AND peopleType IN('CUSTOMER','BOTH') "); + builder.append("AND activeStatus = 'ENEBLED' "); + builder.append("ORDER BY firstName"); + + return searchLike(People.class, builder.toString(), null); + } catch (Exception e) { + logger.error("findCustomersLike", e); + return new ArrayList<>(); + } + } + + @Override + public List findEndorsementsLike(String valueToSearch) { + try { + StringBuilder builder = new StringBuilder("FROM People WHERE "); + + builder.append("(firstName LIKE '%"); + builder.append(valueToSearch); + builder.append("%' OR "); + builder.append("secondName LIKE '%"); + builder.append(valueToSearch); + builder.append("%' OR "); + builder.append("lastName LIKE '%"); + builder.append(valueToSearch); + builder.append("%' OR "); + builder.append("middleName LIKE '%"); + builder.append(valueToSearch); + builder.append("%') "); + builder.append("AND peopleType IN('ENDORSEMENT','BOTH') "); + builder.append("AND activeStatus = 'ENEBLED' "); + builder.append("ORDER BY firstName"); + + return searchLike(People.class, builder.toString(), null); + } catch (Exception e) { + logger.error("findEndorsementsLike", e); + return new ArrayList<>(); + } + } + + final Logger logger = LogManager.getLogger(getClass()); + +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/service/catalog/RouteService.java b/ace-controller/src/main/java/com/arrebol/apc/service/catalog/RouteService.java new file mode 100644 index 0000000..40337b4 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/service/catalog/RouteService.java @@ -0,0 +1,25 @@ +/* + * 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.service.catalog; + +import com.arrebol.apc.model.catalog.RouteCtlg; +import java.util.List; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface RouteService { + + /** + * + * @param officeId + * @return + */ + List fillRoutesDatatable(String officeId); +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/service/catalog/RouteServiceImpl.java b/ace-controller/src/main/java/com/arrebol/apc/service/catalog/RouteServiceImpl.java new file mode 100644 index 0000000..d6823dd --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/service/catalog/RouteServiceImpl.java @@ -0,0 +1,42 @@ +/* + * 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.service.catalog; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.catalog.RouteCtlg; +import com.arrebol.apc.model.catalog.constance.RouteCfg; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.repository.LazyDataModelDAORepository; +import java.util.ArrayList; +import java.util.List; +import javax.enterprise.context.RequestScoped; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@RequestScoped +public class RouteServiceImpl extends LazyDataModelDAORepository implements RouteService { + + @Override + public List fillRoutesDatatable(String officeId) { + logger.debug("fillRoutesDatatable"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(RouteCfg.FIELD_ACTIVE_STATUS, ActiveStatus.ENEBLED)); + parameters.add(new ModelParameter(RouteCfg.FIELD_OFFICE, new Office(officeId))); + + return xmlQueryAPCEntities(RouteCtlg.class, RouteCfg.QUERY_FIND_ALL_ROUTES, parameters); + } + + final Logger logger = LogManager.getLogger(getClass()); + +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/service/core/UserService.java b/ace-controller/src/main/java/com/arrebol/apc/service/core/UserService.java new file mode 100644 index 0000000..a7d8c56 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/service/core/UserService.java @@ -0,0 +1,25 @@ +/* + * 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.service.core; + +import com.arrebol.apc.model.core.User; +import java.util.List; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface UserService { + + /** + * + * @param officeId + * @return + */ + List getAllUsersByOffice(String officeId); +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/service/core/UserServiceImpl.java b/ace-controller/src/main/java/com/arrebol/apc/service/core/UserServiceImpl.java new file mode 100644 index 0000000..42dd1c3 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/service/core/UserServiceImpl.java @@ -0,0 +1,39 @@ +/* + * 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.service.core; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.core.constance.UserCfg; +import com.arrebol.apc.repository.LazyDataModelDAORepository; +import java.util.ArrayList; +import java.util.List; +import javax.enterprise.context.RequestScoped; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@RequestScoped +public class UserServiceImpl extends LazyDataModelDAORepository implements UserService { + + @Override + public List getAllUsersByOffice(String officeId) { + logger.debug("getAllUsersByOffice"); + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(UserCfg.FIELD_OFFICE, new Office(officeId))); + + return xmlQueryAPCEntities(User.class, UserCfg.QUERY_FIND_ALL_USERS_COMPLETE, parameters); + } + + final Logger logger = LogManager.getLogger(getClass()); +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/service/views/EnabledUserDetailsViewService.java b/ace-controller/src/main/java/com/arrebol/apc/service/views/EnabledUserDetailsViewService.java new file mode 100644 index 0000000..02ff983 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/service/views/EnabledUserDetailsViewService.java @@ -0,0 +1,25 @@ +/* + * 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.service.views; + +import com.arrebol.apc.model.views.EnabledUserDetailsView; +import java.util.List; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface EnabledUserDetailsViewService { + + /** + * + * @param officeId + * @return + */ + List findEnabledUsersByOffice(String officeId); +} diff --git a/ace-controller/src/main/java/com/arrebol/apc/service/views/EnabledUserDetailsViewServiceImpl.java b/ace-controller/src/main/java/com/arrebol/apc/service/views/EnabledUserDetailsViewServiceImpl.java new file mode 100644 index 0000000..b399c55 --- /dev/null +++ b/ace-controller/src/main/java/com/arrebol/apc/service/views/EnabledUserDetailsViewServiceImpl.java @@ -0,0 +1,43 @@ +/* + * 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.service.views; + +import com.arrebol.apc.model.ModelParameter; +import com.arrebol.apc.model.views.EnabledUserDetailsView; +import com.arrebol.apc.model.views.constance.EnabledUserDetailsViewCfg; +import com.arrebol.apc.repository.LazyDataModelDAORepository; +import java.util.ArrayList; +import java.util.List; +import javax.enterprise.context.RequestScoped; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@RequestScoped +public class EnabledUserDetailsViewServiceImpl extends LazyDataModelDAORepository implements EnabledUserDetailsViewService { + + @Override + public List findEnabledUsersByOffice(String officeId) { + logger.debug("findEnabledUsersByOffice"); + try { + List parameters = new ArrayList<>(); + + parameters.add(new ModelParameter(EnabledUserDetailsViewCfg.PARAM_OFFICE_ID, officeId)); + + return xmlQueryAPCEntities(EnabledUserDetailsView.class, EnabledUserDetailsViewCfg.QUERY_FIND_ENABLED_USERS_BY_OFFICE, parameters); + } catch (Exception e) { + logger.error("findEnabledUsersByOffice", e); + return new ArrayList<>(); + } + } + + final Logger logger = LogManager.getLogger(getClass()); +} diff --git a/ace-controller/src/test/java/com/arrebol/apc/controller/admin/AdministrationPersonSearchViewControllerTest.java b/ace-controller/src/test/java/com/arrebol/apc/controller/admin/AdministrationPersonSearchViewControllerTest.java new file mode 100644 index 0000000..f1de3ee --- /dev/null +++ b/ace-controller/src/test/java/com/arrebol/apc/controller/admin/AdministrationPersonSearchViewControllerTest.java @@ -0,0 +1,47 @@ +/* + * 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.controller.admin; + +import com.arrebol.apc.model.enums.PeopleType; +import com.arrebol.apc.model.views.AdministrationPersonSerchView; +import java.util.ArrayList; +import java.util.List; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class AdministrationPersonSearchViewControllerTest { + + private AdministrationPersonSearchViewController controller; + private final String person_search = "%mari%"; + private final String id_office = "caef3a64-7d1f-11ea-af3e-28f659da398e"; + private List routes; + + @Before + public void init() { + controller = new AdministrationPersonSearchViewController(); + routes = new ArrayList<>(); + + routes.add("51b207a2-8e19-11ea-b65e-4e1376171215"); + routes.add("5a329e3c-8e19-11ea-b65e-4e1376171215"); + routes.add("55baf3ae-8e19-11ea-b65e-4e1376171215"); + } + + @Test + public void existStableSmallBoxByCreatedOn() { + List results = controller.likePersonNameInPersonTypeInRoutesAndOffice(person_search, PeopleType.ENDORSEMENT, routes, id_office); + + results.forEach(System.out::println); + + Assert.assertTrue(!results.isEmpty()); + } +} diff --git a/ace-controller/src/test/java/com/arrebol/apc/controller/admin/ClosingDayControllerTest.java b/ace-controller/src/test/java/com/arrebol/apc/controller/admin/ClosingDayControllerTest.java new file mode 100644 index 0000000..e307df5 --- /dev/null +++ b/ace-controller/src/test/java/com/arrebol/apc/controller/admin/ClosingDayControllerTest.java @@ -0,0 +1,46 @@ +/* + * 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.controller.admin; + +import java.util.Calendar; +import java.util.Date; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class ClosingDayControllerTest { + + private Date date; + private ClosingDayController controller; + + @Before + public void init() { + Calendar calendar = Calendar.getInstance(); + + //2021-March-07 09:07:04 + calendar.set(2021, 2, 13, 9, 7, 4); + date = calendar.getTime(); + + controller = new ClosingDayController(); + } + + @Test + public void existStableSmallBoxByCreatedOn() { + Assert.assertTrue(controller.existStableSmallBoxByCreatedOn(date)); + } + + @Test + public void existNextPaidClosingDayByCreatedOn() { + Assert.assertTrue(controller.existNextPaidClosingDayByCreatedOn(date)); + } + +} diff --git a/ace-controller/src/test/java/com/arrebol/apc/controller/admin/StableGeneralBoxControllerTest.java b/ace-controller/src/test/java/com/arrebol/apc/controller/admin/StableGeneralBoxControllerTest.java new file mode 100644 index 0000000..949dd9b --- /dev/null +++ b/ace-controller/src/test/java/com/arrebol/apc/controller/admin/StableGeneralBoxControllerTest.java @@ -0,0 +1,40 @@ +/* + * 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.controller.admin; + +import java.util.Calendar; +import java.util.Date; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class StableGeneralBoxControllerTest { + + private Date date; + private StableGeneralBoxController controller; + + @Before + public void init() { + Calendar calendar = Calendar.getInstance(); + + //2021-March-07 09:07:04 + calendar.set(2021, 2, 13, 9, 7, 4); + date = calendar.getTime(); + + controller = new StableGeneralBoxController(); + } + + @Test + public void existNextPaidStableGeneralBoxByCreatedOn() { + Assert.assertTrue(controller.existNextPaidStableGeneralBoxByCreatedOn(date)); + } +} diff --git a/ace-controller/src/test/java/com/arrebol/apc/controller/admin/StableSmallBoxControllerTest.java b/ace-controller/src/test/java/com/arrebol/apc/controller/admin/StableSmallBoxControllerTest.java new file mode 100644 index 0000000..e816f8f --- /dev/null +++ b/ace-controller/src/test/java/com/arrebol/apc/controller/admin/StableSmallBoxControllerTest.java @@ -0,0 +1,45 @@ +/* + * 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.controller.admin; + +import java.util.Calendar; +import java.util.Date; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class StableSmallBoxControllerTest { + + private Date date; + private StableSmallBoxController controller; + + @Before + public void init() { + Calendar calendar = Calendar.getInstance(); + + //2021-March-07 09:07:04 + calendar.set(2021, 2, 13, 9, 7, 4); + date = calendar.getTime(); + + controller = new StableSmallBoxController(); + } + + @Test + public void existStableGeneralBoxByCreatedOn() { + Assert.assertTrue(controller.existStableGeneralBoxByCreatedOn(date)); + } + + @Test + public void existNextPaidStableSmallBoxByCreatedOn() { + Assert.assertTrue(controller.existNextPaidStableSmallBoxByCreatedOn(date)); + } +} diff --git a/ace-controller/src/test/java/com/arrebol/apc/controller/login/LoginControllerTest.java b/ace-controller/src/test/java/com/arrebol/apc/controller/login/LoginControllerTest.java new file mode 100644 index 0000000..6109817 --- /dev/null +++ b/ace-controller/src/test/java/com/arrebol/apc/controller/login/LoginControllerTest.java @@ -0,0 +1,62 @@ +/* + * 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.controller.login; + +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.core.UserByOffice; +import java.util.List; +import org.junit.Test; +import static org.junit.Assert.*; +import org.junit.Before; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class LoginControllerTest { + + private LoginController controller; + private UserByOffice ubo; + private String USER_DIRECTOR = "direccion"; + private String CEO = "ejecutivo"; + private String OFFICE_TEPIC = "caef3a64-7d1f-11ea-af3e-28f659da398e"; + private String OFFICE_GDL = "e0f1a2fc-7d1f-11ea-af3e-28f659da398e"; + + public LoginControllerTest() { + } + + @Before + public void init() { + User user = new User("", CEO); + Office office = new Office(OFFICE_GDL); + ubo = new UserByOffice(user, office); + controller = new LoginController(); + } + + @Test + public void getAllActiveOffice() { + try { + List offices = controller.getAllActiveOfficeController(); + + assertFalse(offices.isEmpty()); + } catch (Exception e) { + assertFalse(true); + } + } + + @Test + public void findUserLogged() { + try { + assertNotNull(controller.findUserLoggedController(ubo)); + } catch (Exception e) { + assertFalse(true); + } + } + +} diff --git a/ace-controller/src/test/java/com/arrebol/apc/controller/system/employee/EmployeeControllerTest.java b/ace-controller/src/test/java/com/arrebol/apc/controller/system/employee/EmployeeControllerTest.java new file mode 100644 index 0000000..cbfcf00 --- /dev/null +++ b/ace-controller/src/test/java/com/arrebol/apc/controller/system/employee/EmployeeControllerTest.java @@ -0,0 +1,122 @@ +/* + * 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.controller.system.employee; + +import com.arrebol.apc.model.admin.Bonus; +import com.arrebol.apc.model.core.HumanResource; +import com.arrebol.apc.model.core.HumanResourceByOffice; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.enums.ApplicationOwner; +import com.arrebol.apc.model.enums.HumanResourceStatus; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.UUID; +import org.junit.Test; +import static org.junit.Assert.*; +import org.junit.Before; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class EmployeeControllerTest { + + private EmployeeController controller; + private String JANITZIO = "13c588a6-7d1b-11ea-af3e-28f659da398e"; + private String RUBEN = "0dc7c246-7db8-11ea-9b1f-500320958bf8"; + private String DIRECCION_JANITZIO = "5751074e-7d1b-11ea-af3e-28f659da398e"; + private String OFFICE_TEPIC = "caef3a64-7d1f-11ea-af3e-28f659da398e"; + private String OFFICE_GDL = "e0f1a2fc-7d1f-11ea-af3e-28f659da398e"; + + public EmployeeControllerTest() { + } + + @Before + public void init() { + controller = new EmployeeController(); + } + + //@Test + public void findEmployeesByType() { + try { + List result = controller.findEmployeesByType( + new Office(OFFICE_GDL), + HumanResourceStatus.ENEBLED, + JANITZIO + ); + + result.forEach(System.out::println); + + assertFalse(result.isEmpty()); + } catch (Exception e) { + assertFalse(true); + } + } + + //@Test + public void findEmployeesInType() { + try { + List resourceStatuses = new ArrayList<>(); + + resourceStatuses.add(HumanResourceStatus.ENEBLED); + resourceStatuses.add(HumanResourceStatus.DISABLED); + + List result = controller.findEmployeesInType( + new Office(OFFICE_GDL), + resourceStatuses, + JANITZIO + ); + + result.forEach(System.out::println); + + assertFalse(result.isEmpty()); + } catch (Exception e) { + assertFalse(true); + } + } + + //@Test + public void saveHRController() { + try { + HumanResource hr = new HumanResource(); + hr.setId(UUID.randomUUID().toString()); + hr.setFirstName("Empleado 1"); + hr.setSecondName("Empleado 1"); + hr.setLastName("Paterno 1"); + hr.setMiddleName("Materno 2"); + hr.setAvatar("images/avatar.png"); + //hr.setHumanResourceType(HumanResourceType.ADVISER); + hr.setHumanResourceStatus(HumanResourceStatus.ENEBLED); + hr.setCreatedBy(DIRECCION_JANITZIO); + + HumanResourceByOffice humanResourceByOffice = new HumanResourceByOffice( + new Office(OFFICE_GDL), + DIRECCION_JANITZIO, + new Date(), + ApplicationOwner.APP_USER + ); + + assertTrue(controller.saveHRController(humanResourceByOffice, hr)); + + } catch (Exception e) { + assertFalse(true); + } + } + + @Test + public void findAllActiveBonus() { + try { + List bonuses = controller.findAllActiveBonus(OFFICE_TEPIC); + + assertTrue(bonuses.isEmpty()); + } catch (Exception e) { + assertFalse(true); + } + } +} diff --git a/ace-controller/src/test/java/com/arrebol/apc/controller/system/user/UserAccessControllerTest.java b/ace-controller/src/test/java/com/arrebol/apc/controller/system/user/UserAccessControllerTest.java new file mode 100644 index 0000000..0f48fb2 --- /dev/null +++ b/ace-controller/src/test/java/com/arrebol/apc/controller/system/user/UserAccessControllerTest.java @@ -0,0 +1,66 @@ +/* + * 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.controller.system.user; + +import com.arrebol.apc.model.core.Permission; +import com.arrebol.apc.model.core.UserByOffice; +import java.util.List; +import org.junit.Test; +import static org.junit.Assert.*; +import org.junit.Before; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class UserAccessControllerTest { + + private UserAccessController controller; + private UserByOffice userByOffice; + + public UserAccessControllerTest() { + } + + @Before + public void init() { + controller = new UserAccessController(); + userByOffice = new UserByOffice("d855f570-7dbb-11ea-9b1f-500320958bf8"); + } + + //@Test + public void loadUserByOfficePermissionLst() { + try { + List source = controller.loadUserByOfficePermissionLst(userByOffice, true); + List target = controller.loadUserByOfficePermissionLst(userByOffice, false); + + System.out.println("SOURCE"); + source.forEach(System.out::println); + System.out.println("TARGET"); + target.forEach(System.out::println); + + assertFalse(source.isEmpty()); + assertFalse(target.isEmpty()); + } catch (Exception e) { + assertFalse(true); + } + } + + @Test + public void findAllEnebledPermissions() { + try { + List permissions = controller.findAllEnebledPermissions(); + + permissions.forEach(System.out::println); + + assertFalse(permissions.isEmpty()); + } catch (Exception e) { + assertFalse(true); + } + } + +} diff --git a/ace-controller/src/test/java/com/arrebol/apc/controller/system/user/UserCreateControllerTest.java b/ace-controller/src/test/java/com/arrebol/apc/controller/system/user/UserCreateControllerTest.java new file mode 100644 index 0000000..0f8766d --- /dev/null +++ b/ace-controller/src/test/java/com/arrebol/apc/controller/system/user/UserCreateControllerTest.java @@ -0,0 +1,99 @@ +/* + * 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.controller.system.user; + +import com.arrebol.apc.model.catalog.RouteCtlg; +import com.arrebol.apc.model.core.HumanResource; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.UserByOffice; +import com.arrebol.apc.model.enums.HumanResourceStatus; +import java.util.List; +import static org.junit.Assert.*; +import org.junit.Before; +import org.junit.Test; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class UserCreateControllerTest { + + private UserCreateController controller; + private String USER_DIRECTOR = "DireCCioNa"; + private String CEO = "ejecutivo"; + private String USER_GLD_JANITZIO = "5751074e-7d1b-11ea-af3e-28f659da398e"; + private String OFFICE_TEPIC = "caef3a64-7d1f-11ea-af3e-28f659da398e"; + private String OFFICE_GDL = "e0f1a2fc-7d1f-11ea-af3e-28f659da398e"; + + @Before + public void init() { + controller = new UserCreateController(); + } + + @Test + public void isUsernameAvailableController() { + try { + assertTrue(controller.isUsernameAvailableController(USER_DIRECTOR, OFFICE_GDL)); + } catch (Exception e) { + assertFalse(true); + } + } + + @Test + public void findAllHRsWithoutUser() { + try { + List result = controller.findAllHRsWithoutUser(new Office(OFFICE_GDL), HumanResourceStatus.ENEBLED); + + result.forEach(System.out::println); + + assertFalse(result.isEmpty()); + } catch (Exception e) { + assertFalse(true); + } + } + + @Test + public void findIdOfUserByOffice() { + try { + UserByOffice userByOffice = controller.findIdOfUserByOffice(USER_GLD_JANITZIO, OFFICE_GDL); + + System.out.println(userByOffice); + + assertNotNull(userByOffice); + } catch (Exception e) { + assertFalse(true); + } + } + + @Test + public void findRoutesByOffice() { + try { + List result = controller.findRoutesByOffice(OFFICE_GDL); + + result.forEach(System.out::println); + + assertFalse(result.isEmpty()); + } catch (Exception e) { + assertFalse(true); + } + } + + @Test + public void findRoutesWithNoCertifierUser() { + try { + List result = controller.findRoutesWithNoCertifierUser(OFFICE_TEPIC); + + result.forEach(System.out::println); + + assertTrue(result.isEmpty()); + } catch (Exception e) { + assertFalse(true); + } + } + +} diff --git a/ace-controller/src/test/java/com/arrebol/apc/controller/system/user/UserUpdateControllerTest.java b/ace-controller/src/test/java/com/arrebol/apc/controller/system/user/UserUpdateControllerTest.java new file mode 100644 index 0000000..23b7673 --- /dev/null +++ b/ace-controller/src/test/java/com/arrebol/apc/controller/system/user/UserUpdateControllerTest.java @@ -0,0 +1,64 @@ +/* + * 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.controller.system.user; + +import com.arrebol.apc.model.core.Permission; +import com.arrebol.apc.model.core.UserByOffice; +import com.arrebol.apc.model.enums.UserStatus; +import java.util.ArrayList; +import java.util.List; +import org.junit.Test; +import static org.junit.Assert.*; +import org.junit.Before; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class UserUpdateControllerTest { + + private UserUpdateController controller; + private final String OWNER_ID = "0dc7c246-7db8-11ea-9b1f-500320958bf8"; + private final String BALAM_UBO_ID = "caee5744-017b-4d1b-83f4-9087631cce4a"; + private final String BALAM_HR_ID = "9dc91af3-8c95-4234-b188-4e193e04e6bc"; + private final String YUNUEN_UBO_ID = "e9b4d118-da8a-48ac-aac8-50327294be71"; + private final String YUNUEN_HR_ID = "6ec0f133-bb05-4be9-ab9d-ec7b89d344ac"; + private final String OFFICE_ID = "caef3a64-7d1f-11ea-af3e-28f659da398e"; + private final boolean IS_ROUTE = true; + private final boolean IN = false; + + @Before + public void init() { + controller = new UserUpdateController(); + } + + @Test + public void findUsersInOfficeInStatuses() { + try { + List statuses = new ArrayList<>(); + + statuses.add(UserStatus.ENEBLED); + controller.findUsersInOfficeInStatuses(statuses, OFFICE_ID, OWNER_ID); + } catch (Exception e) { + assertFalse(true); + } + } + + @Test + public void findList() { + try { + List result = controller.findList(IS_ROUTE, IN, BALAM_UBO_ID, BALAM_HR_ID, OFFICE_ID); + + System.out.println("Size of the list: " + result.size()); + result.forEach(System.out::println); + assertFalse(result.isEmpty()); + } catch (Exception e) { + assertFalse(true); + } + } +} diff --git a/ace-controller/src/test/java/com/arrebol/apc/controller/topbar/TopBarControllerTest.java b/ace-controller/src/test/java/com/arrebol/apc/controller/topbar/TopBarControllerTest.java new file mode 100644 index 0000000..4ac01a8 --- /dev/null +++ b/ace-controller/src/test/java/com/arrebol/apc/controller/topbar/TopBarControllerTest.java @@ -0,0 +1,46 @@ +/* + * 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.controller.topbar; + +import com.arrebol.apc.model.core.Office; +import java.util.List; +import org.junit.Test; +import static org.junit.Assert.*; +import org.junit.Before; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class TopBarControllerTest { + + private TopBarController controller; + private final String USER_ID = "5751074e-7d1b-11ea-af3e-28f659da398e"; + private final String OFFICE_ID = "e0f1a2fc-7d1f-11ea-af3e-28f659da398e"; + + public TopBarControllerTest() { + } + + @Before + public void init() { + controller = new TopBarController(); + } + + @Test + public void findAllOfficesByUser() { + try { + List offices = controller.findAllOfficesByUserController(USER_ID); + + offices.forEach(System.out::println); + + assertFalse(offices.isEmpty()); + } catch (Exception e) { + assertFalse(true); + } + } +} diff --git a/ace-controller/src/test/resources/apc.cfg.xml b/ace-controller/src/test/resources/apc.cfg.xml new file mode 100644 index 0000000..7179e6f --- /dev/null +++ b/ace-controller/src/test/resources/apc.cfg.xml @@ -0,0 +1,224 @@ + + + + + org.hibernate.dialect.MySQLDialect + com.mysql.cj.jdbc.Driver + jdbc:mysql://localhost:3306/apo_pro_com_april_ten?serverTimezone=GMT-5 + apoprocomlocalhost + Yj$2Da0z! + 1 + 2 + 300 + 50 + 3000 + false + false + true + thread + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ace-controller/src/test/resources/log4j2.xml b/ace-controller/src/test/resources/log4j2.xml new file mode 100644 index 0000000..9611256 --- /dev/null +++ b/ace-controller/src/test/resources/log4j2.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ace-db/build.xml b/ace-db/build.xml new file mode 100644 index 0000000..8735ff9 --- /dev/null +++ b/ace-db/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ace-db. + + + diff --git a/ace-db/manifest.mf b/ace-db/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/ace-db/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/ace-db/nbproject/build-impl.xml b/ace-db/nbproject/build-impl.xml new file mode 100644 index 0000000..b577b5a --- /dev/null +++ b/ace-db/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set test.src.dir + Must set build.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + No tests executed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set JVM to use for profiling in profiler.info.jvm + Must set profiler agent JVM arguments in profiler.info.jvmargs.agent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + To run this application from the command line without Ant, try: + + java -jar "${dist.jar.resolved}" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + Must select one file in the IDE or set profile.class + This target only works when run from inside the NetBeans IDE. + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + + + Must select some files in the IDE or set test.includes + + + + + Must select one file in the IDE or set run.class + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + Must select some files in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + Must select one file in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + + + + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ace-db/nbproject/genfiles.properties b/ace-db/nbproject/genfiles.properties new file mode 100644 index 0000000..fbc37bf --- /dev/null +++ b/ace-db/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=12e85bef +build.xml.script.CRC32=0aedc5cc +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=12e85bef +nbproject/build-impl.xml.script.CRC32=3953416a +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.104.0.48 diff --git a/ace-db/nbproject/private/private.properties b/ace-db/nbproject/private/private.properties new file mode 100644 index 0000000..ccc44d8 --- /dev/null +++ b/ace-db/nbproject/private/private.properties @@ -0,0 +1 @@ +user.properties.file=C:\\Users\\oscar\\AppData\\Roaming\\NetBeans\\15\\build.properties diff --git a/ace-db/nbproject/project.properties b/ace-db/nbproject/project.properties new file mode 100644 index 0000000..e20ff6c --- /dev/null +++ b/ace-db/nbproject/project.properties @@ -0,0 +1,86 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processor.options= +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +build.classes.dir=${build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +# This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources +# Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +# Uncomment to specify the preferred debugger connection transport: +#debug.transport=dt_socket +debug.classpath=\ + ${run.classpath} +debug.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# Files in build.classes.dir which should be excluded from distribution jar +dist.archive.excludes= +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/ace-db.jar +dist.javadoc.dir=${dist.dir}/javadoc +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=1.8 +javac.target=1.8 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +main.class= +manifest.file=manifest.mf +meta.inf.dir=${src.dir}/META-INF +mkdist.disabled=false +platform.active=default_platform +run.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +# Space-separated list of JVM arguments used when running the project. +# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. +# To set system properties for unit tests define test-sys-prop.name=value: +run.jvmargs= +run.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/ace-db/nbproject/project.xml b/ace-db/nbproject/project.xml new file mode 100644 index 0000000..ba33244 --- /dev/null +++ b/ace-db/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ace-db + + + + + + + + + diff --git a/ace-db/src/XXXXXXXX.sql b/ace-db/src/XXXXXXXX.sql new file mode 100644 index 0000000..261405d --- /dev/null +++ b/ace-db/src/XXXXXXXX.sql @@ -0,0 +1,303 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +/** + * Author: Oscar + * Created: 11/01/2022 + */ + +CREATE OR REPLACE VIEW `APC_INFORMATION_LOAN_WEEK_VIEW` AS +SELECT +l.id, +u.id as id_user, +r.id_office, +l.created_on as fecha, +lt.payment as apoyos, +lt.payment_total as apoyos_total, +lt.opening_fee as comision_apertura, +CONCAT(endor.first_name,' ', IF(ISNULL(endor.second_name) ,'', CONCAT(endor.second_name,' ')) ,endor.last_name, ' ', endor.middle_name) AS aval, +CONCAT(cus.first_name,' ', IF(ISNULL(cus.second_name) ,'', CONCAT(cus.second_name,' ')) ,cus.last_name, ' ', cus.middle_name) AS customer, +l.amount_to_pay as documento_por, +lt.payment_daily as abono_diario, +l.amount_paid, +(l.amount_to_pay - l.amount_paid) saldo_insoluto, +r.route_name, +CONCAT(hr.first_name,' ', IF(ISNULL(hr.second_name) ,'', CONCAT(hr.second_name,' ')) ,hr.last_name, ' ', hr.middle_name) AS asesor, +(SELECT COUNT(lfn.id) FROM APC_LOAN_FEE_NOTIFICATION lfn WHERE lfn.id_loan = l.id) as num_fee, +-- Lunes +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'monday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_monday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'monday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_monday, +-- Martes +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'tuesday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_tuesday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'tuesday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_tuesday, +-- Miercoles +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) +AND YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'wednesday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_wednesday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'wednesday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_wednesday, +-- Jueves +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'thursday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_thursday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'thursday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_thursday, +-- Viernes +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'friday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_friday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'friday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_friday, +-- Sabado +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'saturday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_saturday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'saturday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_saturday, + +((lt.payment_daily * (SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) > 5, 5 , COUNT(DISTINCT(DATE(ldFaltante.created_on)))) FROM APC_LOAN_DETAIL ldFaltante +WHERE ldFaltante.id_loan = l.id AND WEEK(DATE(ldFaltante.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldFaltante.created_on)) = YEAR(CURDATE()) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('saturday','sunday') +AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER', 'FEE'))) +- (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER'))) as faltante, + +CASE WHEN l.new_customer = 'ENEBLED' AND WEEK(DATE(l.created_on),1) = WEEK(CURDATE(),1) THEN 'Si' ELSE 'No' END as new_customer, +if((SELECT COUNT(id_loan_old) FROM APC_LOAN_BY_RENOVATION lbr +INNER JOIN APC_LOAN lRenovation ON lbr.id_loan_new = lRenovation.id +WHERE id_loan_old = l.id + AND loan_by_renovation_status = 'APPROVED' and WEEK(DATE(lRenovation.created_on),1) <= WEEK(CURDATE(),1) AND + YEAR(DATE(lRenovation.created_on)) = YEAR(CURDATE())) = 0 , 'No' , 'Si') as renovation, +l.loan_status as estatus_prestamo, +(SELECT COUNT(DISTINCT(DATE(ldFaltante.created_on))) FROM APC_LOAN_DETAIL ldFaltante +WHERE ldFaltante.id_loan = l.id AND LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('saturday','sunday') +AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER', 'FEE')) as num_pagos_all, +(SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) > 5, 5, COUNT(DISTINCT(DATE(ldFaltante.created_on)))) FROM APC_LOAN_DETAIL ldFaltante +WHERE ldFaltante.id_loan = l.id AND WEEK(DATE(ldFaltante.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ldFaltante.created_on)) = YEAR(CURDATE()) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('saturday','sunday') +AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER', 'FEE')) as num_pagos_week, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND ldLunes.loan_details_type IN ('FEE')) as fee_todos +FROM +APC_LOAN l +INNER JOIN APC_LOAN_TYPE lt ON l.id_loan_type = lt.id +INNER JOIN APC_PEOPLE cus ON cus.id = l.id_customer +INNER JOIN APC_PEOPLE endor ON endor.id = l.id_endorsement +INNER JOIN APC_ROUTE r ON r.id = l.id_route +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +INNER JOIN APC_USER u ON u.id = lbu.id_user +INNER JOIN APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource +WHERE +l.loan_status not in ('DELETED','REJECTED') AND +((SELECT COUNT(ld.id) FROM APC_LOAN_DETAIL ld WHERE WEEK(DATE(ld.created_on),1) = WEEK(CURDATE(),1) AND + YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.id_loan = l.id) > 0 OR + ((SELECT COUNT(ld.id) FROM APC_LOAN_DETAIL ld WHERE WEEK(DATE(ld.created_on),1) = WEEK(CURDATE(),1) AND + YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.id_loan = l.id) = 0 AND l.loan_status = 'APPROVED' AND + WEEK(DATE(l.created_on),1) <= (WEEK(CURDATE(),1)))); +---------------------------------------------------------------- +---------------------------------------------------------------- +CREATE OR REPLACE VIEW `APC_INFORMATION_LOAN_LAST_WEEK_VIEW` AS +SELECT +l.id, +u.id as id_user, +r.id_office, +l.created_on as fecha, +lt.payment as apoyos, +lt.payment_total as apoyos_total, +lt.opening_fee as comision_apertura, +CONCAT(endor.first_name,' ', IF(ISNULL(endor.second_name) ,'', CONCAT(endor.second_name,' ')) ,endor.last_name, ' ', endor.middle_name) AS aval, +CONCAT(cus.first_name,' ', IF(ISNULL(cus.second_name) ,'', CONCAT(cus.second_name,' ')) ,cus.last_name, ' ', cus.middle_name) AS customer, +l.amount_to_pay as documento_por, +lt.payment_daily as abono_diario, +l.amount_paid, +(l.amount_to_pay - l.amount_paid) saldo_insoluto, +r.route_name, +CONCAT(hr.first_name,' ', IF(ISNULL(hr.second_name) ,'', CONCAT(hr.second_name,' ')) ,hr.last_name, ' ', hr.middle_name) AS asesor, +(SELECT COUNT(lfn.id) FROM APC_LOAN_FEE_NOTIFICATION lfn WHERE lfn.id_loan = l.id) as num_fee, +-- Lunes +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'monday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_monday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'monday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_monday, +-- Martes +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'tuesday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_tuesday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'tuesday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_tuesday, +-- Miercoles +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'wednesday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_wednesday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'wednesday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_wednesday, +-- Jueves +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'thursday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_thursday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'thursday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_thursday, +-- Viernes +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'friday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_friday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'friday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_friday, +-- Sabado +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'saturday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_saturday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'saturday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_saturday, + +((lt.payment_daily * (SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) > 5, 5, COUNT(DISTINCT(DATE(ldFaltante.created_on)))) FROM APC_LOAN_DETAIL ldFaltante +WHERE ldFaltante.id_loan = l.id AND WEEK(DATE(ldFaltante.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldFaltante.created_on)) = YEAR(CURDATE()) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('saturday','sunday') +AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER', 'FEE'))) +- (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER'))) as faltante, + +CASE WHEN l.new_customer = 'ENEBLED' AND WEEK(DATE(l.created_on),1) = (WEEK(CURDATE(),1) - 1) THEN 'Si' ELSE 'No' END as new_customer, +(SELECT IF(COUNT(id_loan_old) = 0 , 'No' , 'Si') FROM APC_LOAN_BY_RENOVATION lbr +INNER JOIN APC_LOAN lRenovation ON lbr.id_loan_new = lRenovation.id +WHERE id_loan_old = l.id + AND loan_by_renovation_status = 'APPROVED' and WEEK(DATE(lRenovation.created_on),1) <= (WEEK(CURDATE(),1) - 1) AND + YEAR(DATE(lRenovation.created_on)) = YEAR(CURDATE())) as renovation, +l.loan_status as estatus_prestamo, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as abono_semana_actual, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND ldLunes.loan_details_type IN ('FEE')) as fee_semana_actual, +(SELECT COUNT(DISTINCT(DATE(ldFaltante.created_on))) FROM APC_LOAN_DETAIL ldFaltante +WHERE ldFaltante.id_loan = l.id AND DATE(ldFaltante.created_on) <= DATE('2022-01-23') and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('saturday','sunday') +AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER', 'FEE')) as num_pagos_all, +(SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) > 5, 5, COUNT(DISTINCT(DATE(ldFaltante.created_on)))) FROM APC_LOAN_DETAIL ldFaltante +WHERE ldFaltante.id_loan = l.id AND WEEK(DATE(ldFaltante.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldFaltante.created_on)) = YEAR(CURDATE()) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('saturday','sunday') +AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER', 'FEE')) as num_pagos_week, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) <= DATE('2022-01-23') +AND ldLunes.loan_details_type IN ('FEE')) as fee_todos +FROM +APC_LOAN l +INNER JOIN APC_LOAN_TYPE lt ON l.id_loan_type = lt.id +INNER JOIN APC_PEOPLE cus ON cus.id = l.id_customer +INNER JOIN APC_PEOPLE endor ON endor.id = l.id_endorsement +INNER JOIN APC_ROUTE r ON r.id = l.id_route +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +INNER JOIN APC_USER u ON u.id = lbu.id_user +INNER JOIN APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource +WHERE +l.loan_status not in ('DELETED','REJECTED') AND +((SELECT COUNT(ld.id) FROM APC_LOAN_DETAIL ld WHERE WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.id_loan = l.id) > 0 OR + ((SELECT COUNT(ld.id) FROM APC_LOAN_DETAIL ld WHERE WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.id_loan = l.id) = 0 AND l.loan_status = 'APPROVED' AND + WEEK(DATE(l.created_on),1) <= (WEEK(CURDATE(),1) - 1))); \ No newline at end of file diff --git a/ace-db/src/apc-config-db-aws.sql b/ace-db/src/apc-config-db-aws.sql new file mode 100644 index 0000000..5785fe7 --- /dev/null +++ b/ace-db/src/apc-config-db-aws.sql @@ -0,0 +1,133 @@ +-- -------------------------------------------------------- +-- Arrebol Consuntancy +-- version 1.0.1 +-- http://www.arrebolconsultancy.com +-- -------------------------------------------------------- + +SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; +SET AUTOCOMMIT = 0; +START TRANSACTION; +-- SET time_zone = "+00:00"; + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8mb4 */; + +-- -------------------------------------------------------- + +-- +-- Base de datos: `apo_pro_com_april_ten` +-- +USE `apo_pro_com_april_ten`; + +-- -------------------------------------------------------- + +-- +-- Drop users: apoprocom & errortrace +-- +DROP USER IF EXISTS 'apoprocom'@'%'; +DROP USER IF EXISTS 'errortrace'@'%'; +DROP USER IF EXISTS 'apoprocommobile'@'%'; +DROP USER IF EXISTS 'apcreportdesktop'@'%'; +-- -------------------------------------------------------- + +-- +-- App user: `apoprocom` application user +-- + +CREATE USER 'apoprocom'@'%' + IDENTIFIED BY 'Yj$2Da0z!'; + +GRANT SELECT ON apo_pro_com_april_ten.* TO 'apoprocom'@'%'; +GRANT INSERT, UPDATE, DELETE ON apo_pro_com_april_ten.* TO 'apoprocom'@'%'; +GRANT EXECUTE ON apo_pro_com_april_ten.* TO 'apoprocom'@'%'; + +-- -------------------------------------------------------- + +-- +-- Error trace user: `errortrace` DB user +-- + +-- -------------------------------------------------------- + +CREATE USER 'errortrace'@'%' + IDENTIFIED BY 'zy61$Jql'; +GRANT ALL ON apo_pro_com_april_ten.APC_ERROR_APP_LOG TO 'errortrace'@'%'; + +-- -------------------------------------------------------- + +-- +-- Error trace user: `apoprocommobile` DB user +-- + +-- -------------------------------------------------------- + +CREATE USER 'apoprocommobile'@'%' + IDENTIFIED BY '0Ps$6%q8'; + +GRANT SELECT, INSERT, DELETE ON apo_pro_com_april_ten.APC_LOAN_DETAIL TO 'apoprocommobile'@'%'; +GRANT SELECT, INSERT, DELETE ON apo_pro_com_april_ten.APC_LOAN_FEE_NOTIFICATION TO 'apoprocommobile'@'%'; +GRANT SELECT, INSERT ON apo_pro_com_april_ten.APC_DELIVERY TO 'apoprocommobile'@'%'; +GRANT SELECT, INSERT ON apo_pro_com_april_ten.APC_OTHER_EXPENSE TO 'apoprocommobile'@'%'; + +GRANT SELECT, INSERT, UPDATE ON apo_pro_com_april_ten.APC_LOAN_BY_RENOVATION TO 'apoprocommobile'@'%'; +GRANT SELECT, INSERT, UPDATE ON apo_pro_com_april_ten.APC_LOAN_BY_USER TO 'apoprocommobile'@'%'; +GRANT SELECT, INSERT, UPDATE ON apo_pro_com_april_ten.APC_USER_MOBILE_PREFERECE TO 'apoprocommobile'@'%'; +GRANT SELECT, INSERT, UPDATE ON apo_pro_com_april_ten.APC_PEOPLE TO 'apoprocommobile'@'%'; +GRANT SELECT, INSERT, UPDATE ON apo_pro_com_april_ten.APC_LOAN TO 'apoprocommobile'@'%'; +GRANT SELECT, INSERT, UPDATE ON apo_pro_com_april_ten.APC_TRANSFER TO 'apoprocommobile'@'%'; +-- SELECT +GRANT SELECT ON apo_pro_com_april_ten.APC_OFFICE TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_USER TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_LOAN_TYPE TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_MONEY_DAILY TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_CLOSING_DAY TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_HUMAN_RESOURCE_HAS_ROUTE TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_ROUTE TO 'apoprocommobile'@'%'; +-- Views +GRANT SELECT ON apo_pro_com_april_ten.APC_SECURITY_AUTHENTICATION_MOBILE TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_LOAN_BY_USER_VIEW TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_LOAN_BY_USER_ORDER_PREFERENCE_VIEW TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_PERSON_SEARCH_VIEW TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_PERSON_SEARCH_DETAIL_VIEW TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_AVAILABLE_CUSTOMERS_VIEW TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_AVAILABLE_ENDORSEMENTS_VIEW TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_CASH_REGISTER_CURDATE_BY_USER_VIEW TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_LOAN_TO_DELIVERY_BY_CERTIFIER_VIEW TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_EXCHANGE_ENEBLED_USERS_VIEW TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_TOTAL_CASH_BY_CURDATE_VIEW TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_PERSON_SEARCH_HISTORICAL_DETAILS_VIEW TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_LOAN_APPROVED_DETAIL_VIEW TO 'apoprocommobile'@'%'; +-- ---------------------------------------------------------------------- +GRANT ALL ON apo_pro_com_april_ten.ARREBOL_TEST TO 'apoprocommobile'@'%'; +-- -------------------------------------------------------- + +-- +-- App user: `apcreportdesktop` report desktop user +-- + +CREATE USER 'apcreportdesktop'@'%' + IDENTIFIED BY 'hY5znQ8j'; + +GRANT SELECT ON apo_pro_com_april_ten.APC_USER TO 'apcreportdesktop'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_HUMAN_RESOURCE TO 'apcreportdesktop'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_TOTAL_CASH_BY_CURDATE_VIEW TO 'apcreportdesktop'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_CLOSING_DAILY_DETAIL_FROM_USER_BY_CURDATE_VIEW TO 'apcreportdesktop'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_CLOSING_DAILY_DETAIL_FROM_USER_BY_CURDATE_VIEW_REPORT TO 'apcreportdesktop'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_STABLE_SMALL_BOX TO 'apcreportdesktop'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_CLOSING_DAY TO 'apcreportdesktop'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_MONEY_DAILY TO 'apcreportdesktop'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_PAYROLL TO 'apcreportdesktop'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_ADVANCE TO 'apcreportdesktop'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_EXPENSE_COMPANY TO 'apcreportdesktop'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_STABLE_GENERAL_BOX TO 'apcreportdesktop'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_LOAN TO 'apcreportdesktop'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_LOAN_TYPE TO 'apcreportdesktop'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_LOAN_DETAIL TO 'apcreportdesktop'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_LOAN_BY_USER TO 'apcreportdesktop'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_OFFICE TO 'apcreportdesktop'@'%'; +-- ---------------------------------------------------------------------- +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; \ No newline at end of file diff --git a/ace-db/src/apc-config-db-localhost.sql b/ace-db/src/apc-config-db-localhost.sql new file mode 100644 index 0000000..cdb1dd6 --- /dev/null +++ b/ace-db/src/apc-config-db-localhost.sql @@ -0,0 +1,133 @@ +-- -------------------------------------------------------- +-- Arrebol Consuntancy +-- version 1.0.1 +-- http://www.arrebolconsultancy.com +-- -------------------------------------------------------- + +SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; +SET AUTOCOMMIT = 0; +START TRANSACTION; +-- SET time_zone = "+00:00"; + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8mb4 */; + +-- -------------------------------------------------------- + +-- +-- Base de datos: `apo_pro_com_april_ten` +-- +USE `apo_pro_com_april_ten`; + +-- -------------------------------------------------------- + +-- +-- Drop users: apoprocomlocalhost & errortracelocalhost +-- +DROP USER IF EXISTS 'apoprocomlocalhost'@'localhost'; +DROP USER IF EXISTS 'errortracelocalhost'@'localhost'; +DROP USER IF EXISTS 'apoprocommobilelocalhost'@'localhost'; +DROP USER IF EXISTS 'apcreportdesktop'@'localhost'; +-- -------------------------------------------------------- + +-- +-- App user: `apoprocomlocalhost` application user +-- + +CREATE USER 'apoprocomlocalhost'@'localhost' + IDENTIFIED BY 'Yj$2Da0z!'; + +GRANT SELECT ON apo_pro_com_april_ten.* TO 'apoprocomlocalhost'@'localhost'; +GRANT INSERT, UPDATE, DELETE ON apo_pro_com_april_ten.* TO 'apoprocomlocalhost'@'localhost'; +GRANT EXECUTE ON apo_pro_com_april_ten.* TO 'apoprocomlocalhost'@'localhost'; + +-- -------------------------------------------------------- + +-- +-- Error trace user: `errortracelocalhost` DB user +-- + +-- -------------------------------------------------------- + +CREATE USER 'errortracelocalhost'@'localhost' + IDENTIFIED BY 'zy61$Jql'; +GRANT ALL ON apo_pro_com_april_ten.APC_ERROR_APP_LOG TO 'errortracelocalhost'@'localhost'; + +-- -------------------------------------------------------- + +-- +-- Error trace user: `apoprocommobilelocalhost` DB user +-- + +-- -------------------------------------------------------- + +CREATE USER 'apoprocommobilelocalhost'@'localhost' + IDENTIFIED BY '0Ps$6%q8'; + +GRANT SELECT, INSERT, DELETE ON apo_pro_com_april_ten.APC_LOAN_DETAIL TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT, INSERT, DELETE ON apo_pro_com_april_ten.APC_LOAN_FEE_NOTIFICATION TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT, INSERT ON apo_pro_com_april_ten.APC_DELIVERY TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT, INSERT ON apo_pro_com_april_ten.APC_OTHER_EXPENSE TO 'apoprocommobilelocalhost'@'localhost'; + +GRANT SELECT, INSERT, UPDATE ON apo_pro_com_april_ten.APC_LOAN_BY_RENOVATION TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT, INSERT, UPDATE ON apo_pro_com_april_ten.APC_LOAN_BY_USER TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT, INSERT, UPDATE ON apo_pro_com_april_ten.APC_USER_MOBILE_PREFERECE TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT, INSERT, UPDATE ON apo_pro_com_april_ten.APC_PEOPLE TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT, INSERT, UPDATE ON apo_pro_com_april_ten.APC_LOAN TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT, INSERT, UPDATE ON apo_pro_com_april_ten.APC_TRANSFER TO 'apoprocommobilelocalhost'@'localhost'; +-- SELECT +GRANT SELECT ON apo_pro_com_april_ten.APC_OFFICE TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_USER TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_LOAN_TYPE TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_MONEY_DAILY TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_CLOSING_DAY TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_HUMAN_RESOURCE_HAS_ROUTE TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_ROUTE TO 'apoprocommobilelocalhost'@'localhost'; +-- Views +GRANT SELECT ON apo_pro_com_april_ten.APC_SECURITY_AUTHENTICATION_MOBILE TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_LOAN_BY_USER_VIEW TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_LOAN_BY_USER_ORDER_PREFERENCE_VIEW TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_PERSON_SEARCH_VIEW TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_PERSON_SEARCH_DETAIL_VIEW TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_AVAILABLE_CUSTOMERS_VIEW TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_AVAILABLE_ENDORSEMENTS_VIEW TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_CASH_REGISTER_CURDATE_BY_USER_VIEW TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_LOAN_TO_DELIVERY_BY_CERTIFIER_VIEW TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_EXCHANGE_ENEBLED_USERS_VIEW TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_TOTAL_CASH_BY_CURDATE_VIEW TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_PERSON_SEARCH_HISTORICAL_DETAILS_VIEW TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_LOAN_APPROVED_DETAIL_VIEW TO 'apoprocommobilelocalhost'@'localhost'; +-- ------------------------------------------------------------------------------------- +GRANT ALL ON apo_pro_com_april_ten.ARREBOL_TEST TO'apoprocommobilelocalhost'@'localhost'; +-- -------------------------------------------------------- + +-- +-- App user: `apcreportdesktop` report desktop user +-- + +CREATE USER 'apcreportdesktop'@'localhost' + IDENTIFIED BY 'hY5znQ8j'; + +GRANT SELECT ON apo_pro_com_april_ten.APC_USER TO 'apcreportdesktop'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_HUMAN_RESOURCE TO 'apcreportdesktop'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_TOTAL_CASH_BY_CURDATE_VIEW TO 'apcreportdesktop'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_CLOSING_DAILY_DETAIL_FROM_USER_BY_CURDATE_VIEW TO 'apcreportdesktop'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_CLOSING_DAILY_DETAIL_FROM_USER_BY_CURDATE_VIEW_REPORT TO 'apcreportdesktop'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_STABLE_SMALL_BOX TO 'apcreportdesktop'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_CLOSING_DAY TO 'apcreportdesktop'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_MONEY_DAILY TO 'apcreportdesktop'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_PAYROLL TO 'apcreportdesktop'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_ADVANCE TO 'apcreportdesktop'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_EXPENSE_COMPANY TO 'apcreportdesktop'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_STABLE_GENERAL_BOX TO 'apcreportdesktop'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_LOAN TO 'apcreportdesktop'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_LOAN_TYPE TO 'apcreportdesktop'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_LOAN_DETAIL TO 'apcreportdesktop'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_LOAN_BY_USER TO 'apcreportdesktop'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_OFFICE TO 'apcreportdesktop'@'localhost'; +-- ------------------------------------------------------------------------------------- +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; \ No newline at end of file diff --git a/ace-db/src/apc-db-populate-empty.sql b/ace-db/src/apc-db-populate-empty.sql new file mode 100644 index 0000000..382f3b4 --- /dev/null +++ b/ace-db/src/apc-db-populate-empty.sql @@ -0,0 +1,27 @@ +-- -------------------------------------------------------- +-- Arrebol Consuntancy +-- version 1.0.1 +-- http://www.arrebolconsultancy.com +-- -------------------------------------------------------- + +SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; +SET AUTOCOMMIT = 0; +START TRANSACTION; +-- SET time_zone = "+00:00"; + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8mb4 */; + +-- -------------------------------------------------------- + +-- +-- Base de datos: Select `apo_pro_com_april_ten` DB +-- +USE `apo_pro_com_april_ten`; + +COMMIT; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; diff --git a/ace-db/src/apc-db-populate.sql b/ace-db/src/apc-db-populate.sql new file mode 100644 index 0000000..62d1dd8 --- /dev/null +++ b/ace-db/src/apc-db-populate.sql @@ -0,0 +1,515 @@ +-- -------------------------------------------------------- +-- Arrebol Consuntancy +-- version 1.0.1 +-- http://www.arrebolconsultancy.com +-- -------------------------------------------------------- + +SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; +SET AUTOCOMMIT = 0; +START TRANSACTION; +-- SET time_zone = "+00:00"; + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8mb4 */; + +-- -------------------------------------------------------- + +-- +-- Base de datos: Select `apo_pro_com_april_ten` DB +-- +USE `apo_pro_com_april_ten`; +-- -------------------------------------------------------- +-- +-- Volcado de datos para la tabla `APC_ROLE` +-- +INSERT INTO APC_ROLE(id,role_name,active_status,created_by) +VALUES +('56dd386a-88c8-11ea-a6b0-82987069bf80','DIRECTOR GENERAL','ENEBLED','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('b9c76e82-88c8-11ea-a6b0-82987069bf80','GERENCIA','ENEBLED','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('e7fbf750-88c8-11ea-a6b0-82987069bf80','SUPERVISOR REGIONAL','ENEBLED','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('ee39d1aa-88c8-11ea-a6b0-82987069bf80','CERTIFICADOR Y FACILITADOR DE CREDITO','ENEBLED','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('3e07c998-a81e-11ea-aa38-77eb3547c70f','JEFE DE ASESORES','ENEBLED','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('b5b506f9-3ca4-4ceb-b938-dc58da3f039b','ASESORES DE CREDITO Y COBRANZA','ENEBLED','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('e67360db-5953-46ba-9fe1-d71e30ae9b59','JURIDICO','ENEBLED','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('b691aea2-3ba5-4e4d-a256-37f749a310bd','JEFE DE PERSONAL PRO FAM','ENEBLED','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('44cb12f9-19e6-439a-9cd9-abdf4af38651','EJECUTIVO DE RUTA PRO FAM','ENEBLED','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('23259ba5-7a0e-4503-a470-b8bd900635e1','AUXILIAR DE RUTA PRO FAM.','ENEBLED','0dc7c246-7db8-11ea-9b1f-500320958bf8'); +-- -------------------------------------------------------- +-- +-- Volcado de datos para la tabla `APC_HUMAN_RESOURCE` +-- +INSERT INTO APC_HUMAN_RESOURCE(id,first_name,second_name,last_name,middle_name,birthdate,avatar,human_resource_status, id_role ,created_by) +VALUES +('13c588a6-7d1b-11ea-af3e-28f659da398e','Carlos','Janitzio','Zavala','Lopez',str_to_date('1977-03-02','%Y-%m-%d'),'images/avatar1.png','ENEBLED','b9c76e82-88c8-11ea-a6b0-82987069bf80','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('cb5e8bec-7db7-11ea-9b1f-500320958bf8','Oscar','Armando','Vargas','Cardenas',str_to_date('1977-03-02','%Y-%m-%d'),'images/avatar2.png','ENEBLED','b9c76e82-88c8-11ea-a6b0-82987069bf80','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('ebae5148-7db7-11ea-9b1f-500320958bf8','Ruben','Ruben','Campos','Campos',str_to_date('1977-03-02','%Y-%m-%d'),'images/avatar3.png','ENEBLED','b9c76e82-88c8-11ea-a6b0-82987069bf80','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('c021214a-8bc7-11ea-b45c-c7b846343364','Avatar 1','Avatar 1','Campos','Campos',str_to_date('1977-03-02','%Y-%m-%d'),'https://freisteller24.eu/wp-content/uploads/2017/11/26603674-1200x1200.jpg','ENEBLED','e7fbf750-88c8-11ea-a6b0-82987069bf80','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('d2869da6-8bc7-11ea-b45c-c7b846343364','Avatar 2','Avatar 2','Campos','Campos',str_to_date('1977-03-02','%Y-%m-%d'),'https://freisteller24.eu/wp-content/uploads/2017/11/97783667-1200x1200.jpg','ENEBLED','3e07c998-a81e-11ea-aa38-77eb3547c70f','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('088d7268-8bc7-11ea-b45c-c7b846343364','Avatar 4','Avatar 4','Campos','Campos',str_to_date('1977-03-02','%Y-%m-%d'),'https://freisteller24.eu/wp-content/uploads/2017/10/573675226-1200x1200.jpg','ENEBLED','e7fbf750-88c8-11ea-a6b0-82987069bf80','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('c687acca-8bc7-11ea-b45c-c7b846343364','Avatar 3','Avatar 3','Campos','Campos',str_to_date('1977-03-02','%Y-%m-%d'),'https://freisteller24.eu/wp-content/uploads/2017/10/653323645.jpg','ENEBLED','ee39d1aa-88c8-11ea-a6b0-82987069bf80','0dc7c246-7db8-11ea-9b1f-500320958bf8'); +-- -------------------------------------------------------- +-- +-- Volcado de datos para la tabla `APC_OFFICE` +-- +INSERT INTO APC_OFFICE(id,office_name,office_status,created_by) +VALUES +-- Tepic +('caef3a64-7d1f-11ea-af3e-28f659da398e','TEPIC','ENEBLED','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +-- Compostela +('e0f1a2fc-7d1f-11ea-af3e-28f659da398e','COMPOSTELA','ENEBLED','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('a7fa34c1-f549-49d9-a262-4d61af50d8c4','PROYECTOS FAMILIARES','ENEBLED','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('1223d3a5-092e-49a5-9d94-f05af4720342','JURIDICO','ENEBLED','0dc7c246-7db8-11ea-9b1f-500320958bf8'); +-- -------------------------------------------------------- +-- +-- Add APC_HUMAN_RESOURCE_BY_OFFICE +-- +INSERT INTO APC_HUMAN_RESOURCE_BY_OFFICE(id,id_human_resource,id_office,application_owner,created_by) +VALUES +-- Janitzio GDL +('e540fd40-8246-11ea-9f9f-a9ab5ed40dc4','13c588a6-7d1b-11ea-af3e-28f659da398e','e0f1a2fc-7d1f-11ea-af3e-28f659da398e','APP_USER','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +-- Oscar Tepic +('14affe8c-8247-11ea-9f9f-a9ab5ed40dc4','cb5e8bec-7db7-11ea-9b1f-500320958bf8','caef3a64-7d1f-11ea-af3e-28f659da398e','APP_USER','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +-- Ruben Tepic +('f41be05a-8246-11ea-9f9f-a9ab5ed40dc4','ebae5148-7db7-11ea-9b1f-500320958bf8','caef3a64-7d1f-11ea-af3e-28f659da398e','APP_OWNER','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +-- Ruben GDL +('0a8cf342-8247-11ea-9f9f-a9ab5ed40dc4','ebae5148-7db7-11ea-9b1f-500320958bf8','e0f1a2fc-7d1f-11ea-af3e-28f659da398e','APP_OWNER','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +-- Avatar 1 Tepic +('0fc73388-8bc8-11ea-b45c-c7b846343364','c021214a-8bc7-11ea-b45c-c7b846343364','caef3a64-7d1f-11ea-af3e-28f659da398e','APP_USER','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +-- Avatar 2 Tepic +('2412e3d2-8bc8-11ea-b45c-c7b846343364','d2869da6-8bc7-11ea-b45c-c7b846343364','caef3a64-7d1f-11ea-af3e-28f659da398e','APP_USER','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +-- Avatar 4 GDL +('32ea4a62-8bc8-11ea-b45c-c7b846343364','088d7268-8bc7-11ea-b45c-c7b846343364','e0f1a2fc-7d1f-11ea-af3e-28f659da398e','APP_USER','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +-- Avatar 3 Tepic +('49662edc-8bc8-11ea-b45c-c7b846343364','c687acca-8bc7-11ea-b45c-c7b846343364','caef3a64-7d1f-11ea-af3e-28f659da398e','APP_USER','0dc7c246-7db8-11ea-9b1f-500320958bf8'); +-- -------------------------------------------------------- +-- +-- Volcado de datos para la tabla `APC_USER` +-- +INSERT INTO APC_USER(id,id_human_resource,user_name,pwd,user_type,user_status,application_owner,created_by,certifier) +VALUES +-- Janitzio WEB +('5751074e-7d1b-11ea-af3e-28f659da398e','13c588a6-7d1b-11ea-af3e-28f659da398e','direccion','8478A4A2819E9C06AB738123C5D04B4FA1AA67548EBA64EAD40B635EA8AA8D5B','WEB','ENEBLED','APP_USER','0dc7c246-7db8-11ea-9b1f-500320958bf8','DISABLED'), +-- Oscar WEB +('092a95d8-7db8-11ea-9b1f-500320958bf8','cb5e8bec-7db7-11ea-9b1f-500320958bf8','direccion','8478A4A2819E9C06AB738123C5D04B4FA1AA67548EBA64EAD40B635EA8AA8D5B','WEB','ENEBLED','APP_USER','0dc7c246-7db8-11ea-9b1f-500320958bf8','DISABLED'), +-- Ruben WEB +('0dc7c246-7db8-11ea-9b1f-500320958bf8','ebae5148-7db7-11ea-9b1f-500320958bf8','ejecutivo','8478A4A2819E9C06AB738123C5D04B4FA1AA67548EBA64EAD40B635EA8AA8D5B','WEB','ENEBLED','APP_OWNER','0dc7c246-7db8-11ea-9b1f-500320958bf8','DISABLED'), +-- Avatar 1 MOBILE +('67b3081e-8bc9-11ea-b45c-c7b846343364','c021214a-8bc7-11ea-b45c-c7b846343364','avatar1','8478A4A2819E9C06AB738123C5D04B4FA1AA67548EBA64EAD40B635EA8AA8D5B','MOBILE','ENEBLED','APP_USER','0dc7c246-7db8-11ea-9b1f-500320958bf8','DISABLED'), +-- Avatar 2 MOBILE +('52cbc85a-8bc9-11ea-b45c-c7b846343364','d2869da6-8bc7-11ea-b45c-c7b846343364','avatar2','8478A4A2819E9C06AB738123C5D04B4FA1AA67548EBA64EAD40B635EA8AA8D5B','MOBILE','ENEBLED','APP_USER','0dc7c246-7db8-11ea-9b1f-500320958bf8','ENEBLED'), +-- Avatar 4 MOBILE +('3870767c-8bc9-11ea-b45c-c7b846343364','088d7268-8bc7-11ea-b45c-c7b846343364','avatar4','8478A4A2819E9C06AB738123C5D04B4FA1AA67548EBA64EAD40B635EA8AA8D5B','MOBILE','ENEBLED','APP_USER','0dc7c246-7db8-11ea-9b1f-500320958bf8','DISABLED'), +-- Avatar 3 MOBILE +('22fb81e2-8bc9-11ea-b45c-c7b846343364','c687acca-8bc7-11ea-b45c-c7b846343364','avatar3','8478A4A2819E9C06AB738123C5D04B4FA1AA67548EBA64EAD40B635EA8AA8D5B','MOBILE','ENEBLED','APP_USER','0dc7c246-7db8-11ea-9b1f-500320958bf8','DISABLED'); +-- -------------------------------------------------------- +-- +-- Add APC_USER_BY_OFFICE +-- +INSERT INTO APC_USER_BY_OFFICE(id,id_user,id_office,user_by_office_status,application_owner,created_by) +VALUES +-- Janitzio GDL +('a742dfe8-7d20-11ea-af3e-28f659da398e','5751074e-7d1b-11ea-af3e-28f659da398e','e0f1a2fc-7d1f-11ea-af3e-28f659da398e','ENEBLED','APP_USER','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +-- Oscar Tepic +('d855f570-7dbb-11ea-9b1f-500320958bf8','092a95d8-7db8-11ea-9b1f-500320958bf8','caef3a64-7d1f-11ea-af3e-28f659da398e','ENEBLED','APP_USER','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +-- Ruben Tepic +('eca3f824-7dbb-11ea-9b1f-500320958bf8','0dc7c246-7db8-11ea-9b1f-500320958bf8','caef3a64-7d1f-11ea-af3e-28f659da398e','ENEBLED','APP_OWNER','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +-- Ruben GDL +('e5a44222-7dbb-11ea-9b1f-500320958bf8','0dc7c246-7db8-11ea-9b1f-500320958bf8','e0f1a2fc-7d1f-11ea-af3e-28f659da398e','ENEBLED','APP_OWNER','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +-- Avatar 1 Tepic +('37835b02-8bca-11ea-b45c-c7b846343364','67b3081e-8bc9-11ea-b45c-c7b846343364','caef3a64-7d1f-11ea-af3e-28f659da398e','ENEBLED','APP_USER','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +-- Avatar 2 Tepic +('5e4c992e-8bca-11ea-b45c-c7b846343364','52cbc85a-8bc9-11ea-b45c-c7b846343364','caef3a64-7d1f-11ea-af3e-28f659da398e','ENEBLED','APP_USER','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +-- Avatar 4 GDL +('efffe026-8bcd-11ea-b45c-c7b846343364','3870767c-8bc9-11ea-b45c-c7b846343364','e0f1a2fc-7d1f-11ea-af3e-28f659da398e','ENEBLED','APP_USER','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +-- Avatar 3 Tepic +('f6dfcbc2-8bcd-11ea-b45c-c7b846343364','22fb81e2-8bc9-11ea-b45c-c7b846343364','caef3a64-7d1f-11ea-af3e-28f659da398e','ENEBLED','APP_USER','0dc7c246-7db8-11ea-9b1f-500320958bf8'); +-- -------------------------------------------------------- +-- +-- Add APC_PERMISSION +-- +INSERT INTO `APC_PERMISSION` (`id`, `permission`, `description`, `menu_path`, `left_to_right_order`, `top_to_bottom_order` , `permission_type`, `permission_status`,`created_by`) +VALUES +('7a6cbba2-7dba-11ea-9b1f-500320958bf8','public.access', 'public.access.description', 'public.access.path', 0, 10,'PUBLIC', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('001055b6-804f-11ea-bd33-54754d23c678','system.employee', 'system.employee.description', 'system.employee.path', 10, 10,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('7f116c66-7dba-11ea-9b1f-500320958bf8','system.user.create', 'system.user.create.description', 'system.user.create.path', 10, 20,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('87d3d32a-7dba-11ea-9b1f-500320958bf8','system.user.admin', 'system.user.admin.description', 'system.user.admin.path', 10, 30,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('8c54a1f4-7dba-11ea-9b1f-500320958bf8','system.user.access', 'system.user.access.description', 'system.user.access.path', 10, 40,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('3697f4e3-6a7d-46df-9618-60c632e3e472','catalog.role', 'catalog.role.description', 'catalog.role.path', 10, 50,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('572bccc2-4848-4dad-b63c-ddf6f29c14f7','catalog.typeLoan', 'catalog.typeLoan.description', 'catalog.typeLoan.path', 10, 60,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('7f139dd9-a1fb-42a4-866c-e70b4d84587a','catalog.route', 'catalog.route.description', 'catalog.route.path', 10, 70,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('58ef9e12-13b3-4a7d-a5ad-fd0db3557d3c','admin.customer', 'admin.customer.description', 'admin.customer.path', 10, 80,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('45f2cd84-98df-4991-be77-3f22dfa7d4b2','admin.endorsement', 'admin.endorsement.description', 'admin.endorsement.path', 10, 90,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('e492bbf5-b25e-4ff2-b126-dc92a733e921','admin.loan', 'admin.loan.description', 'admin.loan.path', 10, 100,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('fee9d1d9-3961-4dfa-a8e2-56eccae1e347','admin.transfer', 'admin.transfer.description', 'admin.transfer.path', 10, 100,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('7a8d71b0-1d2b-43ae-b7f7-fd048929ae8e','admin.moneyDaily', 'admin.moneyDaily.description', 'admin.moneyDaily.path', 10, 100,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('55a79bce-9466-44f8-8a13-7b69f176b80b','admin.closingDay', 'admin.closingDay.description', 'admin.closingDay.path', 10, 100,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('04d9cf0f-b8e9-46fb-9b77-b301dec9c533','admin.otherExpense', 'admin.otherExpense.description', 'admin.otherExpense.path', 10, 100,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('f01aeaac-8b18-4eb5-95ae-d02ae5a0716d','admin.goal', 'admin.goal.description', 'admin.goal.path', 10, 100,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('6c2ec1ce-9163-42b4-bbf1-8448e3894d55','admin.bonus', 'admin.bonus.description', 'admin.bonus.path', 10, 100,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('9067f64e-b2eb-4361-9c9b-c6dccc29e67f','admin.advance', 'admin.advance.description', 'admin.advance.path', 10, 100,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('de5d48ac-2242-4937-95e2-1140b987b8c2','system.office', 'system.office.description', 'system.office.path', 10, 110,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'); +-- Permission by role +INSERT INTO `APC_PERMISSION` (`id`, `permission`, `description`, `menu_path`, `left_to_right_order`, `top_to_bottom_order` , `permission_type`, `permission_status`,`created_by`, `parent_name`) +VALUES +-- employee +('dcfafbee-82a1-11ea-a6b6-200fe86028a8','system.employee.add', 'system.employee.add.description', 'system.employee.add.path', 10, 11,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','system.employee'), +('e2ea92a8-82a1-11ea-a6b6-200fe86028a8','system.employee.enebled', 'system.employee.enebled.description', 'system.employee.enebled.path', 10, 12,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','system.employee'), +('eb530786-82a1-11ea-a6b6-200fe86028a8','system.employee.disabled', 'system.employee.disabled.description', 'system.employee.disabled.path', 10, 13,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','system.employee'), +('f2245ed4-82a1-11ea-a6b6-200fe86028a8','system.employee.deleted', 'system.employee.deleted.description', 'system.employee.deleted.path', 10, 14,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','system.employee'), +('fec3b7a2-82a1-11ea-a6b6-200fe86028a8','system.employee.updated', 'system.employee.updated.description', 'system.employee.updated.path', 10, 15,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','system.employee'), +-- user create +('065b2432-82a2-11ea-a6b6-200fe86028a8','system.user.create.permission', 'system.user.create.permission.description', 'system.user.create.permission.path', 10, 21,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','system.user.create'), +('10d740d0-82a2-11ea-a6b6-200fe86028a8','system.user.admin.enebled', 'system.user.admin.enebled.description', 'system.user.admin.enebled.path', 10, 31,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','system.user.admin'), +('36b619fe-82fa-11ea-a6b6-200fe86028a8','system.user.admin.disabled', 'system.user.admin.disabled.description', 'system.user.admin.disabled.path', 10, 32,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','system.user.admin'), +('2fcf2806-82fa-11ea-a6b6-200fe86028a8','system.user.admin.deleted', 'system.user.admin.deleted.description', 'system.user.admin.deleted.path', 10, 33,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','system.user.admin'), +('282079e8-82fa-11ea-a6b6-200fe86028a8','system.user.admin.updated', 'system.user.admin.updated.description', 'system.user.admin.updated.path', 10, 34,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','system.user.admin'), +('176d3744-82fa-11ea-a6b6-200fe86028a8','system.user.admin.pwd', 'system.user.admin.pwd.description', 'system.user.admin.pwd.path', 10, 35,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','system.user.admin'), +('1fecd260-82a2-11ea-a6b6-200fe86028a8','system.user.admin.avatar', 'system.user.admin.avatar.description', 'system.user.admin.avatar.path', 10, 36,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','system.user.admin'), +-- office +('c5ef3b18-6cc2-4d62-88ba-41304c6ae9c8','system.office.add', 'system.office.add.description', 'system.office.add.path', 10, 111,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','system.user.admin'), +('037ea752-c33f-4bfe-ae84-da867de0d7cd','system.office.updated', 'system.office.updated.description', 'system.office.updated.path', 10, 112,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','system.user.admin'), +('65399669-44da-4e17-9217-c6b89c1f0a61','system.office.deleted', 'system.office.deleted.description', 'system.office.deleted.path', 10, 113,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','system.user.admin'); + +INSERT INTO `APC_PERMISSION` (`id`, `permission`, `description`, `menu_path`, `left_to_right_order`, `top_to_bottom_order` , `permission_type`, `permission_status`,`created_by`, `parent_name`) +VALUES +-- role +('96f78612-1e06-47cf-a282-f4f1a14f8e0d','catalog.role.add', 'catalog.role.add.description', 'catalog.role.add.path', 10, 51,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','catalog.role'), +('1c8175f5-dcde-4611-b2d7-9b79a68b3f0c','catalog.role.updated', 'catalog.role.updated.description', 'catalog.role.updated.path', 10, 52,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','catalog.role'), +('4c11f842-6c29-4d18-a58c-595df41afaa0','catalog.role.deleted', 'catalog.role.deleted.description', 'catalog.role.deleted.path', 10, 53,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','catalog.role'), +-- type loan +('29445731-3e36-427b-a14a-ee53b9699582','catalog.typeLoan.add', 'catalog.typeLoan.add.description', 'catalog.typeLoan.add.path', 10, 61,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','catalog.typeLoan'), +('39482063-a243-490b-bb78-0c0599bce30e','catalog.typeLoan.updated', 'catalog.typeLoan.updated.description', 'catalog.typeLoan.updated.path', 10, 62,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','catalog.typeLoan'), +('c573acd1-cb14-4464-8bbc-b962dbb0bc62','catalog.typeLoan.deleted', 'catalog.typeLoan.deleted.description', 'catalog.typeLoan.deleted.path', 10, 63,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','catalog.typeLoan'), +-- route +('ab812966-4df0-4462-a9e2-a2c364cf97f1','catalog.route.add', 'catalog.route.add.description', 'catalog.route.add.path', 10, 71,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','catalog.route'), +('886ab08d-9494-4ae4-8635-4a6b4363cdf7','catalog.route.updated', 'catalog.route.updated.description', 'catalog.route.updated.path', 10, 72,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','catalog.route'), +('629c0be7-b3a9-49f5-9c20-3f6681a4b6d3','catalog.route.deleted', 'catalog.route.deleted.description', 'catalog.route.deleted.path', 10, 73,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','catalog.route'); + +INSERT INTO `APC_PERMISSION` (`id`, `permission`, `description`, `menu_path`, `left_to_right_order`, `top_to_bottom_order` , `permission_type`, `permission_status`,`created_by`, `parent_name`) +VALUES +-- customer +('65928cb3-f463-4266-9d29-bc29c560c891','admin.customer.add', 'admin.customer.add.description', 'admin.customer.add.path', 10, 81,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.customer'), +('b209327b-f568-4783-8da1-7d45b88fd65b','admin.customer.updated', 'admin.customer.updated.description', 'admin.customer.updated.path', 10, 82,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.customer'), +('6aeb69ff-bb96-4ab9-9d07-8a3b237cfc9e','admin.customer.deleted', 'admin.customer.deleted.description', 'admin.customer.deleted.path', 10, 83,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.customer'), +-- endorsement +('8bee00dc-199f-43c5-8e83-5d670502552b','admin.endorsement.add', 'admin.endorsement.add.description', 'admin.endorsement.add.path', 10, 91,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.endorsement'), +('d16b9b0b-7c4d-456a-a257-ed67586226b0','admin.endorsement.updated', 'admin.endorsement.updated.description', 'admin.endorsement.updated.path', 10, 92,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.endorsement'), +('b57da38c-ba69-4d1e-944f-0dd1f11d816f','admin.endorsement.deleted', 'admin.endorsement.deleted.description', 'admin.endorsement.deleted.path', 10, 93,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.endorsement'), +-- loan +('cca7b7e8-2d41-471b-bb81-c4ca518294dc','admin.loan.add', 'admin.loan.add.description', 'admin.loan.add.path', 10, 101,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.loan'), +('55fd99c6-8110-4604-901b-0ed95ca31132','admin.loan.updated', 'admin.loan.updated.description', 'admin.loan.updated.path', 10, 102,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.loan'), +('1e98037f-1950-417e-be11-39b51203c409','admin.loan.deleted', 'admin.loan.deleted.description', 'admin.loan.deleted.path', 10, 103,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.loan'), +-- transfer +('0d582b8a-2820-4a58-95ca-37484daa8304','admin.transfer.add', 'admin.transfer.add.description', 'admin.transfer.add.path', 10, 101,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.transfer'), +('f8bb6db8-acd1-4c5e-845a-ef62f16c7b2d','admin.transfer.updated', 'admin.transfer.updated.description', 'admin.transfer.updated.path', 10, 102,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.transfer'), +('ae782c52-1e20-40a3-88cf-28f2fb7d7583','admin.transfer.deleted', 'admin.transfer.deleted.description', 'admin.transfer.deleted.path', 10, 103,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.transfer'), +-- money daily +('d14f5077-ecd9-467e-b274-8674e1955667','admin.moneyDaily.add', 'admin.moneyDaily.add.description', 'admin.moneyDaily.add.path', 10, 101,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.moneyDaily'), +('a8f492bf-0a8b-4a4e-9d61-0de2b7153334','admin.moneyDaily.updated', 'admin.moneyDaily.updated.description', 'admin.moneyDaily.updated.path', 10, 102,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.moneyDaily'), +('285860be-92fd-4c7a-bac2-eec1f530d6d9','admin.moneyDaily.deleted', 'admin.moneyDaily.deleted.description', 'admin.moneyDaily.deleted.path', 10, 103,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.moneyDaily'), +-- closing day +('8ab4bea2-3e00-4474-bf94-e01f1ed6b52c','admin.closingDay.add', 'admin.closingDay.add.description', 'admin.closingDay.add.path', 10, 101,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.closingDay'), +('89d55a97-8bc4-4430-8e8d-ce8d15851695','admin.closingDay.updated', 'admin.closingDay.updated.description', 'admin.closingDay.updated.path', 10, 102,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.closingDay'), +('4e8ab1c5-1889-45b3-8550-101f300b2e70','admin.closingDay.deleted', 'admin.closingDay.deleted.description', 'admin.closingDay.deleted.path', 10, 103,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.closingDay'), +-- other expense +('f8b6306b-166d-48b8-8626-0e8a92970c17','admin.otherExpense.add', 'admin.otherExpense.add.description', 'admin.otherExpense.add.path', 10, 101,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.otherExpense'), +('2dbc0faa-2cd0-4490-a5af-e6a8eb4eb132','admin.otherExpense.updated', 'admin.otherExpense.updated.description', 'admin.otherExpense.updated.path', 10, 102,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.otherExpense'), +('aa7c8eca-2117-45a0-b7ce-6d78599b0a66','admin.otherExpense.deleted', 'admin.otherExpense.deleted.description', 'admin.otherExpense.deleted.path', 10, 103,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.otherExpense'), +-- goal +('2e3e6bc1-6baf-4fde-9cc2-c60cd4c1d2f3','admin.goal.add', 'admin.goal.add.description', 'admin.goal.add.path', 10, 101,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.goal'), +('6add466f-4a1d-464a-a96c-2aecc67087ab','admin.goal.updated', 'admin.goal.updated.description', 'admin.goal.updated.path', 10, 102,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.goal'), +('cd3306f9-b713-4995-a8bf-7585e42c2ca0','admin.goal.deleted', 'admin.goal.deleted.description', 'admin.goal.deleted.path', 10, 103,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.goal'), +-- bonus +('71e44e75-91e8-4a55-8d36-d24e2a645f10','admin.bonus.add', 'admin.bonus.add.description', 'admin.bonus.add.path', 10, 101,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.bonus'), +('14b6bf11-cc3b-41d9-b589-7c2aebc5dbeb','admin.bonus.updated', 'admin.bonus.updated.description', 'admin.bonus.updated.path', 10, 102,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.bonus'), +('9f5d7c8d-2115-4114-82a6-5b7329c3efc7','admin.bonus.deleted', 'admin.bonus.deleted.description', 'admin.bonus.deleted.path', 10, 103,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.bonus'), +-- advance +('961193c0-754e-4444-b281-7c62aacb3987','admin.advance.add', 'admin.advance.add.description', 'admin.advance.add.path', 10, 101,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.advance'), +('0fa64abd-3e2a-4a42-96cf-1672bdd51086','admin.advance.updated', 'admin.advance.updated.description', 'admin.advance.updated.path', 10, 102,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.advance'), +('6ee26a46-919b-4400-8837-31762892fa97','admin.advance.deleted', 'admin.advance.deleted.description', 'admin.advance.deleted.path', 10, 103,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.advance'); + +-- Entradas de caja general +INSERT INTO `APC_PERMISSION` (`id`, `permission`, `description`, `menu_path`, `left_to_right_order`, `top_to_bottom_order` , `permission_type`, `permission_status`,`created_by`) +VALUES +('1bd221ee-bfd2-49e1-899a-8456cc05e559','admin.expenseCompanyIn', 'admin.expenseCompanyIn.description', 'admin.expenseCompanyIn.path', 10, 100,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'); + +INSERT INTO `APC_PERMISSION` (`id`, `permission`, `description`, `menu_path`, `left_to_right_order`, `top_to_bottom_order` , `permission_type`, `permission_status`,`created_by`,`parent_name`) +VALUES +('b855fbbc-e25a-4051-8789-9ec9af62ce3a','admin.expenseCompanyIn.add', 'admin.expenseCompanyIn.add.description', 'admin.expenseCompanyIn.add.path', 10, 101,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.expenseCompanyIn'), +('8165c4e7-eb55-4eb7-bb07-98e14234ad8b','admin.expenseCompanyIn.updated', 'admin.expenseCompanyIn.updated.description', 'admin.expenseCompanyIn.updated.path', 10, 102,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.expenseCompanyIn'), +('292e5385-1368-4b8d-895d-638181e05e0d','admin.expenseCompanyIn.deleted', 'admin.expenseCompanyIn.deleted.description', 'admin.expenseCompanyIn.deleted.path', 10, 103,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.expenseCompanyIn'); + +-- Salidas de caja general +INSERT INTO `APC_PERMISSION` (`id`, `permission`, `description`, `menu_path`, `left_to_right_order`, `top_to_bottom_order` , `permission_type`, `permission_status`,`created_by`) +VALUES +('a5301073-05f2-4d80-bed9-e39e0739ee95','admin.expenseCompanyOut', 'admin.expenseCompanyOut.description', 'admin.expenseCompanyOut.path', 10, 100,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'); + +INSERT INTO `APC_PERMISSION` (`id`, `permission`, `description`, `menu_path`, `left_to_right_order`, `top_to_bottom_order` , `permission_type`, `permission_status`,`created_by`,`parent_name`) +VALUES +('8d4985e8-c3e1-4534-9ebc-06d2f708398c','admin.expenseCompanyOut.add', 'admin.expenseCompanyOut.add.description', 'admin.expenseCompanyOut.add.path', 10, 101,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.expenseCompanyOut'), +('3d812774-98ec-4157-ab62-5a60a69f6ddd','admin.expenseCompanyOut.updated', 'admin.expenseCompanyOut.updated.description', 'admin.expenseCompanyOut.updated.path', 10, 102,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.expenseCompanyOut'), +('c59fd63d-7658-40e9-82be-c2a75221e200','admin.expenseCompanyOut.deleted', 'admin.expenseCompanyOut.deleted.description', 'admin.expenseCompanyOut.deleted.path', 10, 103,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.expenseCompanyOut'); + +-- Cuadre de caja general +INSERT INTO `APC_PERMISSION` (`id`, `permission`, `description`, `menu_path`, `left_to_right_order`, `top_to_bottom_order` , `permission_type`, `permission_status`,`created_by`) +VALUES +('a18072cb-ff92-4763-977c-c604828ff4c7','admin.stableGeneralBox', 'admin.stableGeneralBox.description', 'admin.stableGeneralBox.path', 10, 100,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'); + +INSERT INTO `APC_PERMISSION` (`id`, `permission`, `description`, `menu_path`, `left_to_right_order`, `top_to_bottom_order` , `permission_type`, `permission_status`,`created_by`,`parent_name`) +VALUES +('4273bd52-7435-483b-a185-d6686c8fb3e7','admin.stableGeneralBox.add', 'admin.stableGeneralBox.add.description', 'admin.stableGeneralBox.add.path', 10, 101,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.stableGeneralBox'), +('2cceb95d-6d3c-4c67-8c9f-cedc75d4e293','admin.stableGeneralBox.updated', 'admin.stableGeneralBox.updated.description', 'admin.stableGeneralBox.updated.path', 10, 102,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.stableGeneralBox'), +('c46ebab5-904c-4cc1-8c77-49a9fded0fba','admin.stableGeneralBox.deleted', 'admin.stableGeneralBox.deleted.description', 'admin.stableGeneralBox.deleted.path', 10, 103,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.stableGeneralBox'); +-- Chages loans between users +INSERT INTO `APC_PERMISSION` +(`id`, `permission`, `description`, `menu_path`, `left_to_right_order`, `top_to_bottom_order` , + `permission_type`, `permission_status`,`created_by`, `parent_name`) +VALUES +('073fba18-2a8e-11eb-9de2-a30e5a9c0028','admin.loan.change.owner', 'admin.loan.change.owner.description', 'admin.loan.change.owner.path', 10, 110,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.loan'), +('50942348-2a8e-11eb-9de2-a30e5a9c0028','admin.loan.change.owner.update', 'admin.loan.change.owner.update.description', 'admin.loan.change.owner.update.path', 10, 111,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.loan'); + +INSERT INTO APC_USER_BY_OFFICE_HAS_PERMISSION (id_user_by_office,id_permission,created_by) +SELECT + -- Janitzio GDL + 'a742dfe8-7d20-11ea-af3e-28f659da398e', + id, + '0dc7c246-7db8-11ea-9b1f-500320958bf8' +FROM APC_PERMISSION; + +INSERT INTO APC_USER_BY_OFFICE_HAS_PERMISSION (id_user_by_office,id_permission,created_by) +SELECT + -- Oscar Tepic + 'd855f570-7dbb-11ea-9b1f-500320958bf8', + id, + '0dc7c246-7db8-11ea-9b1f-500320958bf8' +FROM APC_PERMISSION; + +INSERT INTO APC_USER_BY_OFFICE_HAS_PERMISSION (id_user_by_office,id_permission,created_by) +SELECT + -- Ruben Tepic + 'eca3f824-7dbb-11ea-9b1f-500320958bf8', + id, + '0dc7c246-7db8-11ea-9b1f-500320958bf8' +FROM APC_PERMISSION; + + +INSERT INTO APC_USER_BY_OFFICE_HAS_PERMISSION (id_user_by_office,id_permission,created_by) +SELECT + -- Ruben GDL + 'e5a44222-7dbb-11ea-9b1f-500320958bf8', + id, + '0dc7c246-7db8-11ea-9b1f-500320958bf8' +FROM APC_PERMISSION; + +INSERT INTO APC_USER_MOBILE_PREFERECE(id,id_user,preference_name,preference_value,created_by,created_on) +VALUES +-- Avatar 1 +('235e819e-8bbe-11ea-8c0e-beeb61238d59','67b3081e-8bc9-11ea-b45c-c7b846343364','ORDER_LIST','ALPHABETICALLY','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +-- Avatar 2 +('e914e614-8bd0-11ea-b45c-c7b846343364','52cbc85a-8bc9-11ea-b45c-c7b846343364','ORDER_LIST','ALPHABETICALLY','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +-- Avatar 4 +('ef48f296-8bd0-11ea-b45c-c7b846343364','3870767c-8bc9-11ea-b45c-c7b846343364','ORDER_LIST','ALPHABETICALLY','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +-- Avatar 3 +('f49797de-8bd0-11ea-b45c-c7b846343364','22fb81e2-8bc9-11ea-b45c-c7b846343364','ORDER_LIST','ALPHABETICALLY','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()); +-- ------------------------- +-- Logica de negocio de los +-- pagos de APC +-- ------------------------- +-- FALTA CREAR RUTA +INSERT INTO APC_ROUTE(id,id_office,route_name,active_status,created_by, created_on) +VALUES +-- Tepic +('51b207a2-8e19-11ea-b65e-4e1376171215','caef3a64-7d1f-11ea-af3e-28f659da398e','Ruta 1 Tepic','ENEBLED','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +('55baf3ae-8e19-11ea-b65e-4e1376171215','caef3a64-7d1f-11ea-af3e-28f659da398e','Ruta 2 Tepic','ENEBLED','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +('5a329e3c-8e19-11ea-b65e-4e1376171215','caef3a64-7d1f-11ea-af3e-28f659da398e','Ruta 3 Tepic','ENEBLED','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +-- GDL +('5e9a24e0-8e19-11ea-b65e-4e1376171215','e0f1a2fc-7d1f-11ea-af3e-28f659da398e','Ruta 1 GDL','ENEBLED','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()); +-- FALTA MAPEAR RUTA CON USUARIO + +INSERT INTO APC_PEOPLE(id,first_name,second_name,last_name, middle_name, phone_home,address_home, phone_business, address_business, company_name, people_type, active_status,id_office,id_route,created_by,created_on,thumbnail) +VALUES +-- Clientes tepic +('83d2cd30-8e1d-11ea-b65e-4e1376171215','Diego','Segundo 1','Rivera','Materno 1','11-11-11-11-11','Cliente Casa Calle #Num. col. Colonia, Tepic Nayarit','22-22-22-22','Negocio Calle #Num. col. Colonia, Tepic Nayarit','Nombre Negocio 01','CUSTOMER','ENEBLED','caef3a64-7d1f-11ea-af3e-28f659da398e','51b207a2-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/10/653323645.jpg'), +('c32a578c-8e1d-11ea-b65e-4e1376171215','David','Segundo 2','Alfaro','Siqueiros','11-11-11-11-11','Cliente Casa Calle #Num. col. Colonia, Tepic Nayarit','22-22-22-22','Negocio Calle #Num. col. Colonia, Tepic Nayarit','Nombre Negocio 01','CUSTOMER','ENEBLED','caef3a64-7d1f-11ea-af3e-28f659da398e','51b207a2-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/11/blogbeitrag-haare-2-1024x713.jpg'), +('ca7fbd56-8e1d-11ea-b65e-4e1376171215','Jose','Segundo 3','Clemente','Orozco','11-11-11-11-11','Cliente Casa Calle #Num. col. Colonia, Tepic Nayarit','22-22-22-22','Negocio Calle #Num. col. Colonia, Tepic Nayarit','Nombre Negocio 01','CUSTOMER','ENEBLED','caef3a64-7d1f-11ea-af3e-28f659da398e','51b207a2-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/10/666164992-1200x1200.jpg'), +('d0e60fec-8e1d-11ea-b65e-4e1376171215','Aurora','Segundo 4','Reyes','Materno 4','11-11-11-11-11','Cliente Casa Calle #Num. col. Colonia, Tepic Nayarit','22-22-22-22','Negocio Calle #Num. col. Colonia, Tepic Nayarit','Nombre Negocio 01','CUSTOMER','ENEBLED','caef3a64-7d1f-11ea-af3e-28f659da398e','51b207a2-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/10/653323645.jpg'), +('d9763d1c-8e1d-11ea-b65e-4e1376171215','Jorge','Segundo 5','Gonzalez','Camarena','11-11-11-11-11','Cliente Casa Calle #Num. col. Colonia, Tepic Nayarit','22-22-22-22','Negocio Calle #Num. col. Colonia, Tepic Nayarit','Nombre Negocio 01','CUSTOMER','ENEBLED','caef3a64-7d1f-11ea-af3e-28f659da398e','51b207a2-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/10/104313029.jpg'), +('e32dd9fa-8e1d-11ea-b65e-4e1376171215','Juan','Segundo 6','O Gorman','Materno 6','11-11-11-11-11','Cliente Casa Calle #Num. col. Colonia, Tepic Nayarit','22-22-22-22','Negocio Calle #Num. col. Colonia, Tepic Nayarit','Nombre Negocio 01','CUSTOMER','ENEBLED','caef3a64-7d1f-11ea-af3e-28f659da398e','51b207a2-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/10/666164992-1200x1200.jpg'), +('e8eafa6c-8e1d-11ea-b65e-4e1376171215','Jose','Luis','Cuevas','Materno 7','11-11-11-11-11','Cliente Casa Calle #Num. col. Colonia, Tepic Nayarit','22-22-22-22','Negocio Calle #Num. col. Colonia, Tepic Nayarit','Nombre Negocio 01','CUSTOMER','ENEBLED','caef3a64-7d1f-11ea-af3e-28f659da398e','51b207a2-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/10/653323645.jpg'), +('eecbe234-8e1d-11ea-b65e-4e1376171215','Pedro','Segundo 8','Nel','Gomez','11-11-11-11-11','Cliente Casa Calle #Num. col. Colonia, Tepic Nayarit','22-22-22-22','Negocio Calle #Num. col. Colonia, Tepic Nayarit','Nombre Negocio 01','CUSTOMER','ENEBLED','caef3a64-7d1f-11ea-af3e-28f659da398e','51b207a2-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/11/blogbeitrag-haare-2-1024x713.jpg'), +('f45155a4-8e1d-11ea-b65e-4e1376171215','Fernando','Segundo 9','Leal','Materno 9','11-11-11-11-11','Cliente Casa Calle #Num. col. Colonia, Tepic Nayarit','22-22-22-22','Negocio Calle #Num. col. Colonia, Tepic Nayarit','Nombre Negocio 01','CUSTOMER','ENEBLED','caef3a64-7d1f-11ea-af3e-28f659da398e','51b207a2-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/10/229554145-1200x1200.jpg'), +('faa43aa2-8e1d-11ea-b65e-4e1376171215','Mario','Segundo 10','Orozco','Rivera','11-11-11-11-11','Cliente Casa Calle #Num. col. Colonia, Tepic Nayarit','22-22-22-22','Negocio Calle #Num. col. Colonia, Tepic Nayarit','Nombre Negocio 01','CUSTOMER','ENEBLED','caef3a64-7d1f-11ea-af3e-28f659da398e','55baf3ae-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/10/229554145-1200x1200.jpg'), +('fffd273e-8e1d-11ea-b65e-4e1376171215','Saturnino','Segundo 11','Herran','Materno 11','11-11-11-11-11','Cliente Casa Calle #Num. col. Colonia, Tepic Nayarit','22-22-22-22','Negocio Calle #Num. col. Colonia, Tepic Nayarit','Nombre Negocio 01','CUSTOMER','ENEBLED','caef3a64-7d1f-11ea-af3e-28f659da398e','55baf3ae-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/10/666164992-1200x1200.jpg'), +('05d35002-8e1e-11ea-b65e-4e1376171215','Fermin','Segundo 12','Revueltas','Materno 12','11-11-11-11-11','Cliente Casa Calle #Num. col. Colonia, Tepic Nayarit','22-22-22-22','Negocio Calle #Num. col. Colonia, Tepic Nayarit','Nombre Negocio 01','CUSTOMER','ENEBLED','caef3a64-7d1f-11ea-af3e-28f659da398e','55baf3ae-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/10/653323645.jpg'), +('0b27081e-8e1e-11ea-b65e-4e1376171215','Zabel','Segundo 13','Merida','Materno 13','11-11-11-11-11','Cliente Casa Calle #Num. col. Colonia, Tepic Nayarit','22-22-22-22','Negocio Calle #Num. col. Colonia, Tepic Nayarit','Nombre Negocio 01','CUSTOMER','ENEBLED','caef3a64-7d1f-11ea-af3e-28f659da398e','55baf3ae-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/11/blogbeitrag-haare-2-1024x713.jpg'), +('109b9b84-8e1e-11ea-b65e-4e1376171215','Luis','Segundo 14','Nishizawa','Flores','11-11-11-11-11','Cliente Casa Calle #Num. col. Colonia, Tepic Nayarit','22-22-22-22','Negocio Calle #Num. col. Colonia, Tepic Nayarit','Nombre Negocio 01','CUSTOMER','ENEBLED','caef3a64-7d1f-11ea-af3e-28f659da398e','55baf3ae-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/10/104313029.jpg'), +('15151320-8e1e-11ea-b65e-4e1376171215','Jose','Segundo 15','Chavez','Morado','11-11-11-11-11','Cliente Casa Calle #Num. col. Colonia, Tepic Nayarit','22-22-22-22','Negocio Calle #Num. col. Colonia, Tepic Nayarit','Nombre Negocio 01','CUSTOMER','ENEBLED','caef3a64-7d1f-11ea-af3e-28f659da398e','55baf3ae-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/10/229554145-1200x1200.jpg'), +('1f292d38-8e1e-11ea-b65e-4e1376171215','Alfredo','Segundo 16','Ramos','Martinez','11-11-11-11-11','Cliente Casa Calle #Num. col. Colonia, Tepic Nayarit','22-22-22-22','Negocio Calle #Num. col. Colonia, Tepic Nayarit','Nombre Negocio 01','CUSTOMER','ENEBLED','caef3a64-7d1f-11ea-af3e-28f659da398e','5a329e3c-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/10/666164992-1200x1200.jpg'), +('25bf9ccc-8e1e-11ea-b65e-4e1376171215','Desiderio','Segundo 17','Hernandez','Xochitiotzin','11-11-11-11-11','Cliente Casa Calle #Num. col. Colonia, Tepic Nayarit','22-22-22-22','Negocio Calle #Num. col. Colonia, Tepic Nayarit','Nombre Negocio 01','CUSTOMER','ENEBLED','caef3a64-7d1f-11ea-af3e-28f659da398e','5a329e3c-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/10/653323645.jpg'), +('2b502d50-8e1e-11ea-b65e-4e1376171215','Rina','Segundo 18','Lazo','Materno 18','11-11-11-11-11','Cliente Casa Calle #Num. col. Colonia, Tepic Nayarit','22-22-22-22','Negocio Calle #Num. col. Colonia, Tepic Nayarit','Nombre Negocio 01','CUSTOMER','ENEBLED','caef3a64-7d1f-11ea-af3e-28f659da398e','5a329e3c-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/11/blogbeitrag-haare-2-1024x713.jpg'), +('305aee3e-8e1e-11ea-b65e-4e1376171215','Ramon','Segundo 19','Alva','de la Canal','11-11-11-11-11','Cliente Casa Calle #Num. col. Colonia, Tepic Nayarit','22-22-22-22','Negocio Calle #Num. col. Colonia, Tepic Nayarit','Nombre Negocio 01','CUSTOMER','ENEBLED','caef3a64-7d1f-11ea-af3e-28f659da398e','5a329e3c-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/10/104313029.jpg'), +('394ffa70-8e1e-11ea-b65e-4e1376171215','Xavier','Segundo 20','Guerrero','Materno 20','11-11-11-11-11','Cliente Casa Calle #Num. col. Colonia, Tepic Nayarit','22-22-22-22','Negocio Calle #Num. col. Colonia, Tepic Nayarit','Nombre Negocio 01','CUSTOMER','ENEBLED','caef3a64-7d1f-11ea-af3e-28f659da398e','5a329e3c-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/10/666164992-1200x1200.jpg'), +-- Clientes GDL +('3d8c43e6-8e1e-11ea-b65e-4e1376171215','Juan','Segundo 21','Rulfo','Materno 21','11-11-11-11-11','Cliente Casa Calle #Num. col. Colonia, Guadalajara Jalisco','22-22-22-22','Negocio Calle #Num. col. Colonia, Guadalajara Jalisco','Nombre Negocio 01','CUSTOMER','ENEBLED','e0f1a2fc-7d1f-11ea-af3e-28f659da398e','5e9a24e0-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/10/653323645.jpg'), +('428c5b88-8e1e-11ea-b65e-4e1376171215','Octavio','Segundo 22','Paz','Materno 22','11-11-11-11-11','Cliente Casa Calle #Num. col. Colonia, Guadalajara Jalisco','22-22-22-22','Negocio Calle #Num. col. Colonia, Guadalajara Jalisco','Nombre Negocio 01','CUSTOMER','ENEBLED','e0f1a2fc-7d1f-11ea-af3e-28f659da398e','5e9a24e0-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/11/blogbeitrag-haare-2-1024x713.jpg'), +('46f6f070-8e1e-11ea-b65e-4e1376171215','Carlos','Segundo 23','Fuentes','Materno 23','11-11-11-11-11','Cliente Casa Calle #Num. col. Colonia, Guadalajara Jalisco','22-22-22-22','Negocio Calle #Num. col. Colonia, Guadalajara Jalisco','Nombre Negocio 01','CUSTOMER','ENEBLED','e0f1a2fc-7d1f-11ea-af3e-28f659da398e','5e9a24e0-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/10/104313029.jpg'), +('4adc2c28-8e1e-11ea-b65e-4e1376171215','Juan','Jose','Arreola','Materno 24','11-11-11-11-11','Cliente Casa Calle #Num. col. Colonia, Guadalajara Jalisco','22-22-22-22','Negocio Calle #Num. col. Colonia, Guadalajara Jalisco','Nombre Negocio 01','CUSTOMER','ENEBLED','e0f1a2fc-7d1f-11ea-af3e-28f659da398e','5e9a24e0-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/10/229554145-1200x1200.jpg'), +('4ed391e0-8e1e-11ea-b65e-4e1376171215','Rosario','Segundo 25','Castellanos','Materno 25','11-11-11-11-11','Cliente Casa Calle #Num. col. Colonia, Guadalajara Jalisco','22-22-22-22','Negocio Calle #Num. col. Colonia, Guadalajara Jalisco','Nombre Negocio 01','CUSTOMER','ENEBLED','e0f1a2fc-7d1f-11ea-af3e-28f659da398e','5e9a24e0-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/10/666164992-1200x1200.jpg'); +INSERT INTO APC_PEOPLE(id,first_name,second_name,last_name, middle_name, phone_home,address_home, people_type, active_status,id_office,id_route,created_by,created_on,thumbnail) +VALUES +-- Avales tepic +('76a2650c-8e1e-11ea-b65e-4e1376171215','Frida','Segundo 1','Kahlo','Materno 1','11-11-11-11-11','Aval Casa Calle #Num. col. Colonia, Tepic Nayarit','ENDORSEMENT','ENEBLED','caef3a64-7d1f-11ea-af3e-28f659da398e','51b207a2-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/10/653323645.jpg'), +('7ce4fdc6-8e1e-11ea-b65e-4e1376171215','Enrique','Segundo 2','Carbajal','Materno 2','11-11-11-11-11','Aval Casa Calle #Num. col. Colonia, Tepic Nayarit','ENDORSEMENT','ENEBLED','caef3a64-7d1f-11ea-af3e-28f659da398e','51b207a2-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/10/104313029.jpg'), +('818a97aa-8e1e-11ea-b65e-4e1376171215','Juan','Segundo 3','Soriano','Materno 3','11-11-11-11-11','Aval Casa Calle #Num. col. Colonia, Tepic Nayarit','ENDORSEMENT','ENEBLED','caef3a64-7d1f-11ea-af3e-28f659da398e','51b207a2-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/10/666164992-1200x1200.jpg'), +('85d8f694-8e1e-11ea-b65e-4e1376171215','Jose','Segundo 4','Marin','Materno 4','11-11-11-11-11','Aval Casa Calle #Num. col. Colonia, Tepic Nayarit','ENDORSEMENT','ENEBLED','caef3a64-7d1f-11ea-af3e-28f659da398e','51b207a2-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/10/229554145-1200x1200.jpg'), +('8a4ad7a6-8e1e-11ea-b65e-4e1376171215','Vicente','Segundo 5','Rojo','Almazan','11-11-11-11-11','Aval Casa Calle #Num. col. Colonia, Tepic Nayarit','ENDORSEMENT','ENEBLED','caef3a64-7d1f-11ea-af3e-28f659da398e','51b207a2-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/10/653323645.jpg'), +('91328532-8e1e-11ea-b65e-4e1376171215','Luis','Segundo 6','Ortiz','Monasterio','11-11-11-11-11','Aval Casa Calle #Num. col. Colonia, Tepic Nayarit','ENDORSEMENT','ENEBLED','caef3a64-7d1f-11ea-af3e-28f659da398e','51b207a2-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/10/104313029.jpg'), +('96c9319e-8e1e-11ea-b65e-4e1376171215','Pedro','Segundo 7','Coronel','Materno 7','11-11-11-11-11','Aval Casa Calle #Num. col. Colonia, Tepic Nayarit','ENDORSEMENT','ENEBLED','caef3a64-7d1f-11ea-af3e-28f659da398e','51b207a2-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/10/666164992-1200x1200.jpg'), +('9c481676-8e1e-11ea-b65e-4e1376171215','Miriam','Segundo 8','Medrez','Materno 8','11-11-11-11-11','Aval Casa Calle #Num. col. Colonia, Tepic Nayarit','ENDORSEMENT','ENEBLED','caef3a64-7d1f-11ea-af3e-28f659da398e','51b207a2-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/11/blogbeitrag-haare-2-1024x713.jpg'), +('aca49c06-8e1e-11ea-b65e-4e1376171215','Maria','Elena','Delgado','Materno 9','11-11-11-11-11','Aval Casa Calle #Num. col. Colonia, Tepic Nayarit','ENDORSEMENT','ENEBLED','caef3a64-7d1f-11ea-af3e-28f659da398e','51b207a2-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/10/653323645.jpg'), +('b0361e44-8e1e-11ea-b65e-4e1376171215','Angela','Segundo 10','Gurria','Materno 10','11-11-11-11-11','Aval Casa Calle #Num. col. Colonia, Tepic Nayarit','ENDORSEMENT','ENEBLED','caef3a64-7d1f-11ea-af3e-28f659da398e','55baf3ae-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/10/104313029.jpg'), +('b4c2e9ba-8e1e-11ea-b65e-4e1376171215','Aval 11','Segundo 11','Paterno 11','Materno 11','11-11-11-11-11','Aval Casa Calle #Num. col. Colonia, Tepic Nayarit','ENDORSEMENT','ENEBLED','caef3a64-7d1f-11ea-af3e-28f659da398e','55baf3ae-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/11/blogbeitrag-haare-2-1024x713.jpg'), +('ba2faa96-8e1e-11ea-b65e-4e1376171215','Aval 12','Segundo 12','Paterno 12','Materno 12','11-11-11-11-11','Aval Casa Calle #Num. col. Colonia, Tepic Nayarit','ENDORSEMENT','ENEBLED','caef3a64-7d1f-11ea-af3e-28f659da398e','55baf3ae-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/11/blogbeitrag-haare-2-1024x713.jpg'), +('be92604c-8e1e-11ea-b65e-4e1376171215','Aval 13','Segundo 13','Paterno 13','Materno 13','11-11-11-11-11','Aval Casa Calle #Num. col. Colonia, Tepic Nayarit','ENDORSEMENT','ENEBLED','caef3a64-7d1f-11ea-af3e-28f659da398e','55baf3ae-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/10/653323645.jpg'), +('c2b2b2f8-8e1e-11ea-b65e-4e1376171215','Aval 14','Segundo 14','Paterno 14','Materno 14','11-11-11-11-11','Aval Casa Calle #Num. col. Colonia, Tepic Nayarit','ENDORSEMENT','ENEBLED','caef3a64-7d1f-11ea-af3e-28f659da398e','55baf3ae-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/10/104313029.jpg'), +('c6a8b04c-8e1e-11ea-b65e-4e1376171215','Aval 15','Segundo 15','Paterno 15','Materno 15','11-11-11-11-11','Aval Casa Calle #Num. col. Colonia, Tepic Nayarit','ENDORSEMENT','ENEBLED','caef3a64-7d1f-11ea-af3e-28f659da398e','55baf3ae-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/10/666164992-1200x1200.jpg'), +('cb0e8d00-8e1e-11ea-b65e-4e1376171215','Aval 16','Segundo 16','Paterno 16','Materno 16','11-11-11-11-11','Aval Casa Calle #Num. col. Colonia, Tepic Nayarit','ENDORSEMENT','ENEBLED','caef3a64-7d1f-11ea-af3e-28f659da398e','5a329e3c-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/10/229554145-1200x1200.jpg'), +('cfafc590-8e1e-11ea-b65e-4e1376171215','Aval 17','Segundo 17','Paterno 17','Materno 17','11-11-11-11-11','Aval Casa Calle #Num. col. Colonia, Tepic Nayarit','ENDORSEMENT','ENEBLED','caef3a64-7d1f-11ea-af3e-28f659da398e','5a329e3c-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/10/653323645.jpg'), +('d474b96e-8e1e-11ea-b65e-4e1376171215','Aval 18','Segundo 18','Paterno 18','Materno 18','11-11-11-11-11','Aval Casa Calle #Num. col. Colonia, Tepic Nayarit','ENDORSEMENT','ENEBLED','caef3a64-7d1f-11ea-af3e-28f659da398e','5a329e3c-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/10/104313029.jpg'), +('d8f8c804-8e1e-11ea-b65e-4e1376171215','Aval 19','Segundo 19','Paterno 19','Materno 19','11-11-11-11-11','Aval Casa Calle #Num. col. Colonia, Tepic Nayarit','ENDORSEMENT','ENEBLED','caef3a64-7d1f-11ea-af3e-28f659da398e','5a329e3c-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/10/666164992-1200x1200.jpg'), +('dd7b34e8-8e1e-11ea-b65e-4e1376171215','Aval 20','Segundo 20','Paterno 20','Materno 20','11-11-11-11-11','Aval Casa Calle #Num. col. Colonia, Tepic Nayarit','ENDORSEMENT','ENEBLED','caef3a64-7d1f-11ea-af3e-28f659da398e','5a329e3c-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/10/229554145-1200x1200.jpg'), +-- Avales GDL +('e13baa9a-8e1e-11ea-b65e-4e1376171215','Aval 21','Segundo 21','Paterno 21','Materno 21','11-11-11-11-11','Aval Casa Calle #Num. col. Colonia, Guadalajara Jalisco','ENDORSEMENT','ENEBLED','e0f1a2fc-7d1f-11ea-af3e-28f659da398e','5e9a24e0-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/10/653323645.jpg'), +('e61db008-8e1e-11ea-b65e-4e1376171215','Aval 22','Segundo 22','Paterno 22','Materno 22','11-11-11-11-11','Aval Casa Calle #Num. col. Colonia, Guadalajara Jalisco','ENDORSEMENT','ENEBLED','e0f1a2fc-7d1f-11ea-af3e-28f659da398e','5e9a24e0-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/10/104313029.jpg'), +('eaa8c70c-8e1e-11ea-b65e-4e1376171215','Aval 23','Segundo 23','Paterno 23','Materno 23','11-11-11-11-11','Aval Casa Calle #Num. col. Colonia, Guadalajara Jalisco','ENDORSEMENT','ENEBLED','e0f1a2fc-7d1f-11ea-af3e-28f659da398e','5e9a24e0-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/10/666164992-1200x1200.jpg'), +('ef10171e-8e1e-11ea-b65e-4e1376171215','Aval 24','Segundo 24','Paterno 24','Materno 24','11-11-11-11-11','Aval Casa Calle #Num. col. Colonia, Guadalajara Jalisco','ENDORSEMENT','ENEBLED','e0f1a2fc-7d1f-11ea-af3e-28f659da398e','5e9a24e0-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/10/229554145-1200x1200.jpg'), +('f30d1358-8e1e-11ea-b65e-4e1376171215','Guillermo','Segundo 25','Tellez','Materno 25','11-11-11-11-11','Aval Casa Calle #Num. col. Colonia, Guadalajara Jalisco','ENDORSEMENT','ENEBLED','e0f1a2fc-7d1f-11ea-af3e-28f659da398e','5e9a24e0-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),'https://freisteller24.eu/wp-content/uploads/2017/11/blogbeitrag-haare-2-1024x713.jpg'); +INSERT INTO APC_LOAN_TYPE(id,loan_type_name,total_days, loan_fee, payment,payment_daily,payment_total, id_office,created_by, created_on,opening_fee) +VALUES +-- Para tepic +('db833bf0-8e5e-11ea-8ee4-e54bc704beac','Prestamo $1000', 22,50,1000,60,1320,'caef3a64-7d1f-11ea-af3e-28f659da398e','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),20), +('c59e5bee-8dff-11ea-8745-07889553dd5f','Prestamo $2000', 22,50,2000,120,2640,'caef3a64-7d1f-11ea-af3e-28f659da398e','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),40), +('dc255a16-8dff-11ea-8745-07889553dd5f','Prestamo $3000', 22,50,3000,180,3960,'caef3a64-7d1f-11ea-af3e-28f659da398e','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),60), +('e7cc91c2-8dff-11ea-8745-07889553dd5f','Prestamo $4000', 22,50,4000,240,5280,'caef3a64-7d1f-11ea-af3e-28f659da398e','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),80), +('f0cb05ba-8dff-11ea-8745-07889553dd5f','Prestamo $5000', 22,50,5000,300,6600,'caef3a64-7d1f-11ea-af3e-28f659da398e','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),100), +('fdaa4318-8dff-11ea-8745-07889553dd5f','Prestamo $6000', 22,50,6000,360,7920,'caef3a64-7d1f-11ea-af3e-28f659da398e','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),120), +-- Para GDL; +('7f0cc30e-8e00-11ea-8745-07889553dd5f','Prestamo $1000', 22,50,1000,60,1320,'e0f1a2fc-7d1f-11ea-af3e-28f659da398e','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),20), +('8623efbe-8e00-11ea-8745-07889553dd5f','Prestamo $2000', 22,50,2000,120,2640,'e0f1a2fc-7d1f-11ea-af3e-28f659da398e','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),40), +('8d91bc36-8e00-11ea-8745-07889553dd5f','Prestamo $3000', 22,50,3000,180,3960,'e0f1a2fc-7d1f-11ea-af3e-28f659da398e','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),60), +('93b13506-8e00-11ea-8745-07889553dd5f','Prestamo $4000', 22,50,4000,240,5280,'e0f1a2fc-7d1f-11ea-af3e-28f659da398e','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),80), +('99d91a66-8e00-11ea-8745-07889553dd5f','Prestamo $5000', 22,50,5000,300,6600,'e0f1a2fc-7d1f-11ea-af3e-28f659da398e','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),100), +('a0292d0c-8e00-11ea-8745-07889553dd5f','Prestamo $6000', 22,50,6000,360,7920,'e0f1a2fc-7d1f-11ea-af3e-28f659da398e','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),120); +INSERT INTO APC_LOAN(id,id_loan_type,id_customer,id_endorsement,id_route,loan_status,amount_paid,amount_to_pay,last_reference_number,created_by,created_on,last_updated_on) +VALUES +-- Tepic / Avatar 1 +('c4ed9e5a-8e1b-11ea-b65e-4e1376171215','db833bf0-8e5e-11ea-8ee4-e54bc704beac','83d2cd30-8e1d-11ea-b65e-4e1376171215','76a2650c-8e1e-11ea-b65e-4e1376171215','51b207a2-8e19-11ea-b65e-4e1376171215','APPROVED',0,1320,0,'0dc7c246-7db8-11ea-9b1f-500320958bf8',DATE_SUB(NOW(), INTERVAL 1 DAY),DATE_SUB(NOW(), INTERVAL 1 DAY)), +('c09f127a-8e1b-11ea-b65e-4e1376171215','db833bf0-8e5e-11ea-8ee4-e54bc704beac','c32a578c-8e1d-11ea-b65e-4e1376171215','7ce4fdc6-8e1e-11ea-b65e-4e1376171215','51b207a2-8e19-11ea-b65e-4e1376171215','REJECTED',0,1320,0,'0dc7c246-7db8-11ea-9b1f-500320958bf8',DATE_SUB(NOW(), INTERVAL 1 DAY),NOW()), +('bc185d2e-8e1b-11ea-b65e-4e1376171215','db833bf0-8e5e-11ea-8ee4-e54bc704beac','ca7fbd56-8e1d-11ea-b65e-4e1376171215','818a97aa-8e1e-11ea-b65e-4e1376171215','51b207a2-8e19-11ea-b65e-4e1376171215','APPROVED',0,1320,0,'0dc7c246-7db8-11ea-9b1f-500320958bf8',DATE_SUB(NOW(), INTERVAL 1 DAY),NOW()), +('b64c6e94-8e1b-11ea-b65e-4e1376171215','db833bf0-8e5e-11ea-8ee4-e54bc704beac','d0e60fec-8e1d-11ea-b65e-4e1376171215','85d8f694-8e1e-11ea-b65e-4e1376171215','51b207a2-8e19-11ea-b65e-4e1376171215','FINISH',1320,1320,22,'0dc7c246-7db8-11ea-9b1f-500320958bf8',DATE_SUB(NOW(), INTERVAL 1 DAY),DATE_SUB(NOW(), INTERVAL 1 DAY)), +('b0d25168-8e1b-11ea-b65e-4e1376171215','db833bf0-8e5e-11ea-8ee4-e54bc704beac','d9763d1c-8e1d-11ea-b65e-4e1376171215','8a4ad7a6-8e1e-11ea-b65e-4e1376171215','51b207a2-8e19-11ea-b65e-4e1376171215','PENDING',0,1320,0,'0dc7c246-7db8-11ea-9b1f-500320958bf8',DATE_SUB(NOW(), INTERVAL 1 DAY),NOW()), +-- Tepic / Avatar 2 +('acccdfac-8e1b-11ea-b65e-4e1376171215','c59e5bee-8dff-11ea-8745-07889553dd5f','e32dd9fa-8e1d-11ea-b65e-4e1376171215','91328532-8e1e-11ea-b65e-4e1376171215','55baf3ae-8e19-11ea-b65e-4e1376171215','APPROVED',0,2640,0,'0dc7c246-7db8-11ea-9b1f-500320958bf8',DATE_SUB(NOW(), INTERVAL 1 DAY),DATE_SUB(NOW(), INTERVAL 1 DAY)), +('a811395e-8e1b-11ea-b65e-4e1376171215','c59e5bee-8dff-11ea-8745-07889553dd5f','e8eafa6c-8e1d-11ea-b65e-4e1376171215','96c9319e-8e1e-11ea-b65e-4e1376171215','55baf3ae-8e19-11ea-b65e-4e1376171215','APPROVED',0,2640,0,'0dc7c246-7db8-11ea-9b1f-500320958bf8',DATE_SUB(NOW(), INTERVAL 1 DAY),DATE_SUB(NOW(), INTERVAL 1 DAY)), +('a42ceb26-8e1b-11ea-b65e-4e1376171215','c59e5bee-8dff-11ea-8745-07889553dd5f','eecbe234-8e1d-11ea-b65e-4e1376171215','9c481676-8e1e-11ea-b65e-4e1376171215','55baf3ae-8e19-11ea-b65e-4e1376171215','FINISH',2640,2640,22,'0dc7c246-7db8-11ea-9b1f-500320958bf8',DATE_SUB(NOW(), INTERVAL 1 DAY),NOW()), +('9ff730b6-8e1b-11ea-b65e-4e1376171215','c59e5bee-8dff-11ea-8745-07889553dd5f','f45155a4-8e1d-11ea-b65e-4e1376171215','aca49c06-8e1e-11ea-b65e-4e1376171215','55baf3ae-8e19-11ea-b65e-4e1376171215','APPROVED',0,2640,0,'0dc7c246-7db8-11ea-9b1f-500320958bf8',DATE_SUB(NOW(), INTERVAL 1 DAY),NOW()), +('98c4de60-8e1b-11ea-b65e-4e1376171215','c59e5bee-8dff-11ea-8745-07889553dd5f','faa43aa2-8e1d-11ea-b65e-4e1376171215','b0361e44-8e1e-11ea-b65e-4e1376171215','55baf3ae-8e19-11ea-b65e-4e1376171215','APPROVED',0,2640,0,'0dc7c246-7db8-11ea-9b1f-500320958bf8',DATE_SUB(NOW(), INTERVAL 1 DAY),DATE_SUB(NOW(), INTERVAL 1 DAY)), +('94aad8a2-8e1b-11ea-b65e-4e1376171215','e7cc91c2-8dff-11ea-8745-07889553dd5f','fffd273e-8e1d-11ea-b65e-4e1376171215','b4c2e9ba-8e1e-11ea-b65e-4e1376171215','55baf3ae-8e19-11ea-b65e-4e1376171215','FINISH',5280,5280,22,'0dc7c246-7db8-11ea-9b1f-500320958bf8',DATE_SUB(NOW(), INTERVAL 1 DAY),DATE_SUB(NOW(), INTERVAL 1 DAY)), +('90dadcae-8e1b-11ea-b65e-4e1376171215','e7cc91c2-8dff-11ea-8745-07889553dd5f','05d35002-8e1e-11ea-b65e-4e1376171215','ba2faa96-8e1e-11ea-b65e-4e1376171215','55baf3ae-8e19-11ea-b65e-4e1376171215','APPROVED',0,5280,0,'0dc7c246-7db8-11ea-9b1f-500320958bf8',DATE_SUB(NOW(), INTERVAL 1 DAY),NOW()), +('8d017a66-8e1b-11ea-b65e-4e1376171215','e7cc91c2-8dff-11ea-8745-07889553dd5f','0b27081e-8e1e-11ea-b65e-4e1376171215','be92604c-8e1e-11ea-b65e-4e1376171215','55baf3ae-8e19-11ea-b65e-4e1376171215','TO_DELIVERY',0,5280,0,'0dc7c246-7db8-11ea-9b1f-500320958bf8',DATE_SUB(NOW(), INTERVAL 2 DAY),DATE_SUB(NOW(), INTERVAL 2 DAY)), +('86a09490-8e1b-11ea-b65e-4e1376171215','dc255a16-8dff-11ea-8745-07889553dd5f','109b9b84-8e1e-11ea-b65e-4e1376171215','c2b2b2f8-8e1e-11ea-b65e-4e1376171215','55baf3ae-8e19-11ea-b65e-4e1376171215','APPROVED',0,3960,0,'0dc7c246-7db8-11ea-9b1f-500320958bf8',DATE_SUB(NOW(), INTERVAL 1 DAY),DATE_SUB(NOW(), INTERVAL 1 DAY)), +('82a781dc-8e1b-11ea-b65e-4e1376171215','dc255a16-8dff-11ea-8745-07889553dd5f','15151320-8e1e-11ea-b65e-4e1376171215','c6a8b04c-8e1e-11ea-b65e-4e1376171215','55baf3ae-8e19-11ea-b65e-4e1376171215','FINISH',3960,3960,22,'0dc7c246-7db8-11ea-9b1f-500320958bf8',DATE_SUB(NOW(), INTERVAL 1 DAY),DATE_SUB(NOW(), INTERVAL 1 DAY)), +-- Tepic / Avatar 3 +('7ec212f8-8e1b-11ea-b65e-4e1376171215','f0cb05ba-8dff-11ea-8745-07889553dd5f','1f292d38-8e1e-11ea-b65e-4e1376171215','cb0e8d00-8e1e-11ea-b65e-4e1376171215','5a329e3c-8e19-11ea-b65e-4e1376171215','APPROVED',0,6600,0,'0dc7c246-7db8-11ea-9b1f-500320958bf8',DATE_SUB(NOW(), INTERVAL 1 DAY),NOW()), +('788f666a-8e1b-11ea-b65e-4e1376171215','f0cb05ba-8dff-11ea-8745-07889553dd5f','25bf9ccc-8e1e-11ea-b65e-4e1376171215','cfafc590-8e1e-11ea-b65e-4e1376171215','5a329e3c-8e19-11ea-b65e-4e1376171215','REJECTED',0,6600,0,'0dc7c246-7db8-11ea-9b1f-500320958bf8',DATE_SUB(NOW(), INTERVAL 1 DAY),DATE_SUB(NOW(), INTERVAL 1 DAY)), +('74eca1c6-8e1b-11ea-b65e-4e1376171215','f0cb05ba-8dff-11ea-8745-07889553dd5f','2b502d50-8e1e-11ea-b65e-4e1376171215','d474b96e-8e1e-11ea-b65e-4e1376171215','5a329e3c-8e19-11ea-b65e-4e1376171215','APPROVED',0,6600,0,'0dc7c246-7db8-11ea-9b1f-500320958bf8',DATE_SUB(NOW(), INTERVAL 1 DAY),DATE_SUB(NOW(), INTERVAL 1 DAY)), +('705b9662-8e1b-11ea-b65e-4e1376171215','f0cb05ba-8dff-11ea-8745-07889553dd5f','305aee3e-8e1e-11ea-b65e-4e1376171215','d8f8c804-8e1e-11ea-b65e-4e1376171215','5a329e3c-8e19-11ea-b65e-4e1376171215','APPROVED',0,6600,0,'0dc7c246-7db8-11ea-9b1f-500320958bf8',DATE_SUB(NOW(), INTERVAL 1 DAY),DATE_SUB(NOW(), INTERVAL 1 DAY)), +('6cd18fec-8e1b-11ea-b65e-4e1376171215','fdaa4318-8dff-11ea-8745-07889553dd5f','394ffa70-8e1e-11ea-b65e-4e1376171215','dd7b34e8-8e1e-11ea-b65e-4e1376171215','5a329e3c-8e19-11ea-b65e-4e1376171215','APPROVED',0,7920,0,'0dc7c246-7db8-11ea-9b1f-500320958bf8',DATE_SUB(NOW(), INTERVAL 1 DAY),DATE_SUB(NOW(), INTERVAL 1 DAY)), +-- GDL / Avatar 4 +('68b7b92c-8e1b-11ea-b65e-4e1376171215','7f0cc30e-8e00-11ea-8745-07889553dd5f','3d8c43e6-8e1e-11ea-b65e-4e1376171215','e13baa9a-8e1e-11ea-b65e-4e1376171215','5e9a24e0-8e19-11ea-b65e-4e1376171215','FINISH',1320,1320,22,'0dc7c246-7db8-11ea-9b1f-500320958bf8',DATE_SUB(NOW(), INTERVAL 4 DAY),DATE_SUB(NOW(), INTERVAL 4 DAY)), +('6613cd16-9a9e-11ea-b304-ce916d70ea46','7f0cc30e-8e00-11ea-8745-07889553dd5f','3d8c43e6-8e1e-11ea-b65e-4e1376171215','e13baa9a-8e1e-11ea-b65e-4e1376171215','5e9a24e0-8e19-11ea-b65e-4e1376171215','REJECTED',0,1320,0,'0dc7c246-7db8-11ea-9b1f-500320958bf8',DATE_SUB(NOW(), INTERVAL 3 DAY),DATE_SUB(NOW(), INTERVAL 3 DAY)), +('6fab97c8-9a9e-11ea-b304-ce916d70ea46','7f0cc30e-8e00-11ea-8745-07889553dd5f','3d8c43e6-8e1e-11ea-b65e-4e1376171215','e13baa9a-8e1e-11ea-b65e-4e1376171215','5e9a24e0-8e19-11ea-b65e-4e1376171215','APPROVED',0,1320,0,'0dc7c246-7db8-11ea-9b1f-500320958bf8',DATE_SUB(NOW(), INTERVAL 1 DAY),DATE_SUB(NOW(), INTERVAL 1 DAY)), +('606e42f4-8e1b-11ea-b65e-4e1376171215','8623efbe-8e00-11ea-8745-07889553dd5f','428c5b88-8e1e-11ea-b65e-4e1376171215','e61db008-8e1e-11ea-b65e-4e1376171215','5e9a24e0-8e19-11ea-b65e-4e1376171215','APPROVED',0,2640,0,'0dc7c246-7db8-11ea-9b1f-500320958bf8',DATE_SUB(NOW(), INTERVAL 1 DAY),DATE_SUB(NOW(), INTERVAL 1 DAY)), +('5c925364-8e1b-11ea-b65e-4e1376171215','8d91bc36-8e00-11ea-8745-07889553dd5f','46f6f070-8e1e-11ea-b65e-4e1376171215','eaa8c70c-8e1e-11ea-b65e-4e1376171215','5e9a24e0-8e19-11ea-b65e-4e1376171215','APPROVED',0,3960,0,'0dc7c246-7db8-11ea-9b1f-500320958bf8',DATE_SUB(NOW(), INTERVAL 1 DAY),DATE_SUB(NOW(), INTERVAL 1 DAY)), +('58f3fb72-8e1b-11ea-b65e-4e1376171215','93b13506-8e00-11ea-8745-07889553dd5f','4adc2c28-8e1e-11ea-b65e-4e1376171215','ef10171e-8e1e-11ea-b65e-4e1376171215','5e9a24e0-8e19-11ea-b65e-4e1376171215','FINISH',5280,5280,22,'0dc7c246-7db8-11ea-9b1f-500320958bf8',DATE_SUB(NOW(), INTERVAL 3 DAY),DATE_SUB(NOW(), INTERVAL 3 DAY)), +('551308c2-8e1b-11ea-b65e-4e1376171215','99d91a66-8e00-11ea-8745-07889553dd5f','4ed391e0-8e1e-11ea-b65e-4e1376171215','f30d1358-8e1e-11ea-b65e-4e1376171215','5e9a24e0-8e19-11ea-b65e-4e1376171215','REJECTED',0,6600,0,'0dc7c246-7db8-11ea-9b1f-500320958bf8',DATE_SUB(NOW(), INTERVAL 2 DAY),DATE_SUB(NOW(), INTERVAL 2 DAY)), +('7d9d4850-9a9d-11ea-b304-ce916d70ea46','99d91a66-8e00-11ea-8745-07889553dd5f','4ed391e0-8e1e-11ea-b65e-4e1376171215','f30d1358-8e1e-11ea-b65e-4e1376171215','5e9a24e0-8e19-11ea-b65e-4e1376171215','APPROVED',0,6600,0,'0dc7c246-7db8-11ea-9b1f-500320958bf8',DATE_SUB(NOW(), INTERVAL 1 DAY),NOW()); +INSERT INTO APC_HUMAN_RESOURCE_HAS_ROUTE(id_human_resource,id_route,created_by,created_on) +VALUES +-- Avatar 1 +('c021214a-8bc7-11ea-b45c-c7b846343364','51b207a2-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +-- Avatar 2 +('d2869da6-8bc7-11ea-b45c-c7b846343364','51b207a2-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +('d2869da6-8bc7-11ea-b45c-c7b846343364','55baf3ae-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +('d2869da6-8bc7-11ea-b45c-c7b846343364','5a329e3c-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +-- Avatar 3 +('c687acca-8bc7-11ea-b45c-c7b846343364','5a329e3c-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +-- Avatar 4 +('088d7268-8bc7-11ea-b45c-c7b846343364','5e9a24e0-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()); +INSERT INTO APC_LOAN_BY_USER(id_loan,id_user,loan_by_user_status,owner_loan,created_by,created_on) +VALUES +-- Tepic / Avatar 1 +('c4ed9e5a-8e1b-11ea-b65e-4e1376171215','67b3081e-8bc9-11ea-b45c-c7b846343364','APPROVED','CURRENT_OWNER','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +('c09f127a-8e1b-11ea-b65e-4e1376171215','67b3081e-8bc9-11ea-b45c-c7b846343364','REJECTED','CURRENT_OWNER','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +('bc185d2e-8e1b-11ea-b65e-4e1376171215','67b3081e-8bc9-11ea-b45c-c7b846343364','APPROVED','CURRENT_OWNER','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +('b64c6e94-8e1b-11ea-b65e-4e1376171215','67b3081e-8bc9-11ea-b45c-c7b846343364','FINISH','CURRENT_OWNER','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +('b0d25168-8e1b-11ea-b65e-4e1376171215','67b3081e-8bc9-11ea-b45c-c7b846343364','PENDING','CURRENT_OWNER','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +-- Tepic / Avatar 2 +('acccdfac-8e1b-11ea-b65e-4e1376171215','52cbc85a-8bc9-11ea-b45c-c7b846343364','APPROVED','CURRENT_OWNER','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +('a811395e-8e1b-11ea-b65e-4e1376171215','52cbc85a-8bc9-11ea-b45c-c7b846343364','APPROVED','CURRENT_OWNER','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +('a42ceb26-8e1b-11ea-b65e-4e1376171215','52cbc85a-8bc9-11ea-b45c-c7b846343364','FINISH','CURRENT_OWNER','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +('9ff730b6-8e1b-11ea-b65e-4e1376171215','52cbc85a-8bc9-11ea-b45c-c7b846343364','APPROVED','CURRENT_OWNER','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +('98c4de60-8e1b-11ea-b65e-4e1376171215','52cbc85a-8bc9-11ea-b45c-c7b846343364','APPROVED','CURRENT_OWNER','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +('94aad8a2-8e1b-11ea-b65e-4e1376171215','52cbc85a-8bc9-11ea-b45c-c7b846343364','FINISH','CURRENT_OWNER','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +('90dadcae-8e1b-11ea-b65e-4e1376171215','52cbc85a-8bc9-11ea-b45c-c7b846343364','APPROVED','CURRENT_OWNER','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +('8d017a66-8e1b-11ea-b65e-4e1376171215','52cbc85a-8bc9-11ea-b45c-c7b846343364','TO_DELIVERY','CURRENT_OWNER','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +('86a09490-8e1b-11ea-b65e-4e1376171215','52cbc85a-8bc9-11ea-b45c-c7b846343364','APPROVED','CURRENT_OWNER','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +('82a781dc-8e1b-11ea-b65e-4e1376171215','52cbc85a-8bc9-11ea-b45c-c7b846343364','FINISH','CURRENT_OWNER','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +-- Tepic / Avatar 3 +('7ec212f8-8e1b-11ea-b65e-4e1376171215','22fb81e2-8bc9-11ea-b45c-c7b846343364','APPROVED','CURRENT_OWNER','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +('788f666a-8e1b-11ea-b65e-4e1376171215','22fb81e2-8bc9-11ea-b45c-c7b846343364','REJECTED','CURRENT_OWNER','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +('74eca1c6-8e1b-11ea-b65e-4e1376171215','22fb81e2-8bc9-11ea-b45c-c7b846343364','APPROVED','CURRENT_OWNER','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +('705b9662-8e1b-11ea-b65e-4e1376171215','22fb81e2-8bc9-11ea-b45c-c7b846343364','APPROVED','CURRENT_OWNER','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +('6cd18fec-8e1b-11ea-b65e-4e1376171215','22fb81e2-8bc9-11ea-b45c-c7b846343364','APPROVED','CURRENT_OWNER','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +-- GDL / Avatar 4 +('68b7b92c-8e1b-11ea-b65e-4e1376171215','3870767c-8bc9-11ea-b45c-c7b846343364','FINISH','CURRENT_OWNER','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +('6613cd16-9a9e-11ea-b304-ce916d70ea46','3870767c-8bc9-11ea-b45c-c7b846343364','REJECTED','CURRENT_OWNER','0dc7c246-7db8-11ea-9b1f-500320958bf8',DATE_ADD(NOW(), INTERVAL 22 DAY)), +('6fab97c8-9a9e-11ea-b304-ce916d70ea46','3870767c-8bc9-11ea-b45c-c7b846343364','APPROVED','CURRENT_OWNER','0dc7c246-7db8-11ea-9b1f-500320958bf8',DATE_ADD(NOW(), INTERVAL 44 DAY)), +('606e42f4-8e1b-11ea-b65e-4e1376171215','3870767c-8bc9-11ea-b45c-c7b846343364','APPROVED','CURRENT_OWNER','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +('5c925364-8e1b-11ea-b65e-4e1376171215','3870767c-8bc9-11ea-b45c-c7b846343364','APPROVED','CURRENT_OWNER','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +('58f3fb72-8e1b-11ea-b65e-4e1376171215','3870767c-8bc9-11ea-b45c-c7b846343364','FINISH','CURRENT_OWNER','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +('551308c2-8e1b-11ea-b65e-4e1376171215','3870767c-8bc9-11ea-b45c-c7b846343364','REJECTED','CURRENT_OWNER','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +('7d9d4850-9a9d-11ea-b304-ce916d70ea46','3870767c-8bc9-11ea-b45c-c7b846343364','APPROVED','CURRENT_OWNER','0dc7c246-7db8-11ea-9b1f-500320958bf8',DATE_ADD(NOW(), INTERVAL 22 DAY)); +INSERT INTO APC_LOAN_DETAIL(id,id_loan,id_user,people_type,payment_amount,reference_number,loan_details_type, created_by, created_on) +VALUES +(UUID(),'acccdfac-8e1b-11ea-b65e-4e1376171215','52cbc85a-8bc9-11ea-b45c-c7b846343364','CUSTOMER',120,1,'PAYMENT','52cbc85a-8bc9-11ea-b45c-c7b846343364', DATE_SUB(NOW(), INTERVAL 21 DAY)), +(UUID(),'acccdfac-8e1b-11ea-b65e-4e1376171215','52cbc85a-8bc9-11ea-b45c-c7b846343364','CUSTOMER',120,2,'PAYMENT','52cbc85a-8bc9-11ea-b45c-c7b846343364', DATE_SUB(NOW(), INTERVAL 20 DAY)), +(UUID(),'acccdfac-8e1b-11ea-b65e-4e1376171215','52cbc85a-8bc9-11ea-b45c-c7b846343364','CUSTOMER',120,3,'PAYMENT','52cbc85a-8bc9-11ea-b45c-c7b846343364', DATE_SUB(NOW(), INTERVAL 19 DAY)), +(UUID(),'acccdfac-8e1b-11ea-b65e-4e1376171215','52cbc85a-8bc9-11ea-b45c-c7b846343364','CUSTOMER',120,4,'PAYMENT','52cbc85a-8bc9-11ea-b45c-c7b846343364', DATE_SUB(NOW(), INTERVAL 18 DAY)), +(UUID(),'acccdfac-8e1b-11ea-b65e-4e1376171215','52cbc85a-8bc9-11ea-b45c-c7b846343364','CUSTOMER',120,5,'PAYMENT','52cbc85a-8bc9-11ea-b45c-c7b846343364', DATE_SUB(NOW(), INTERVAL 17 DAY)), +(UUID(),'acccdfac-8e1b-11ea-b65e-4e1376171215','52cbc85a-8bc9-11ea-b45c-c7b846343364','CUSTOMER',120,6,'PAYMENT','52cbc85a-8bc9-11ea-b45c-c7b846343364', DATE_SUB(NOW(), INTERVAL 16 DAY)), +(UUID(),'acccdfac-8e1b-11ea-b65e-4e1376171215','52cbc85a-8bc9-11ea-b45c-c7b846343364','CUSTOMER',120,7,'PAYMENT','52cbc85a-8bc9-11ea-b45c-c7b846343364', DATE_SUB(NOW(), INTERVAL 15 DAY)), +(UUID(),'acccdfac-8e1b-11ea-b65e-4e1376171215','52cbc85a-8bc9-11ea-b45c-c7b846343364','CUSTOMER',120,8,'PAYMENT','52cbc85a-8bc9-11ea-b45c-c7b846343364', DATE_SUB(NOW(), INTERVAL 14 DAY)), +(UUID(),'acccdfac-8e1b-11ea-b65e-4e1376171215','52cbc85a-8bc9-11ea-b45c-c7b846343364','CUSTOMER',120,9,'PAYMENT','52cbc85a-8bc9-11ea-b45c-c7b846343364', DATE_SUB(NOW(), INTERVAL 13 DAY)), +(UUID(),'acccdfac-8e1b-11ea-b65e-4e1376171215','52cbc85a-8bc9-11ea-b45c-c7b846343364','CUSTOMER',120,10,'PAYMENT','52cbc85a-8bc9-11ea-b45c-c7b846343364', DATE_SUB(NOW(), INTERVAL 12 DAY)), +(UUID(),'acccdfac-8e1b-11ea-b65e-4e1376171215','52cbc85a-8bc9-11ea-b45c-c7b846343364','CUSTOMER',120,11,'PAYMENT','52cbc85a-8bc9-11ea-b45c-c7b846343364', DATE_SUB(NOW(), INTERVAL 11 DAY)), +(UUID(),'acccdfac-8e1b-11ea-b65e-4e1376171215','52cbc85a-8bc9-11ea-b45c-c7b846343364','CUSTOMER',120,12,'PAYMENT','52cbc85a-8bc9-11ea-b45c-c7b846343364', DATE_SUB(NOW(), INTERVAL 10 DAY)), +(UUID(),'acccdfac-8e1b-11ea-b65e-4e1376171215','52cbc85a-8bc9-11ea-b45c-c7b846343364','CUSTOMER',120,13,'PAYMENT','52cbc85a-8bc9-11ea-b45c-c7b846343364', DATE_SUB(NOW(), INTERVAL 9 DAY)), +(UUID(),'acccdfac-8e1b-11ea-b65e-4e1376171215','52cbc85a-8bc9-11ea-b45c-c7b846343364','CUSTOMER',120,14,'PAYMENT','52cbc85a-8bc9-11ea-b45c-c7b846343364', DATE_SUB(NOW(), INTERVAL 8 DAY)), +(UUID(),'acccdfac-8e1b-11ea-b65e-4e1376171215','52cbc85a-8bc9-11ea-b45c-c7b846343364','CUSTOMER',120,15,'PAYMENT','52cbc85a-8bc9-11ea-b45c-c7b846343364', DATE_SUB(NOW(), INTERVAL 7 DAY)), +(UUID(),'acccdfac-8e1b-11ea-b65e-4e1376171215','52cbc85a-8bc9-11ea-b45c-c7b846343364','CUSTOMER',120,16,'PAYMENT','52cbc85a-8bc9-11ea-b45c-c7b846343364', DATE_SUB(NOW(), INTERVAL 6 DAY)), +(UUID(),'acccdfac-8e1b-11ea-b65e-4e1376171215','52cbc85a-8bc9-11ea-b45c-c7b846343364','CUSTOMER',120,17,'PAYMENT','52cbc85a-8bc9-11ea-b45c-c7b846343364', DATE_SUB(NOW(), INTERVAL 5 DAY)), +-- sumar 100 al monto por pagar +(UUID(),'acccdfac-8e1b-11ea-b65e-4e1376171215','52cbc85a-8bc9-11ea-b45c-c7b846343364','CUSTOMER',50,18,'FEE','52cbc85a-8bc9-11ea-b45c-c7b846343364', DATE_SUB(NOW(), INTERVAL 4 DAY)), +(UUID(),'acccdfac-8e1b-11ea-b65e-4e1376171215','52cbc85a-8bc9-11ea-b45c-c7b846343364','CUSTOMER',50,19,'FEE','52cbc85a-8bc9-11ea-b45c-c7b846343364', DATE_SUB(NOW(), INTERVAL 3 DAY)), +-- sumar +120 al monto pagado +(UUID(),'acccdfac-8e1b-11ea-b65e-4e1376171215','52cbc85a-8bc9-11ea-b45c-c7b846343364','CUSTOMER',120,20,'PAYMENT','52cbc85a-8bc9-11ea-b45c-c7b846343364', DATE_SUB(NOW(), INTERVAL 2 DAY)); +UPDATE APC_LOAN +SET amount_paid = 2160, amount_to_pay = 2740 ,last_reference_number = 20, last_updated_by = '52cbc85a-8bc9-11ea-b45c-c7b846343364', last_updated_on = DATE_SUB(NOW(), INTERVAL 1 DAY) +WHERE id = 'acccdfac-8e1b-11ea-b65e-4e1376171215'; +COMMIT; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; diff --git a/ace-db/src/apc-db.sql b/ace-db/src/apc-db.sql new file mode 100644 index 0000000..7c070ba --- /dev/null +++ b/ace-db/src/apc-db.sql @@ -0,0 +1,3430 @@ +-- -------------------------------------------------------- +-- Arrebol Consuntancy +-- version 1.0.1 +-- http://www.arrebolconsultancy.com +-- -------------------------------------------------------- + +SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; +SET AUTOCOMMIT = 0; +START TRANSACTION; +-- SET time_zone = "+00:00"; + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8mb4 */; + +DROP DATABASE IF EXISTS `apo_pro_com_april_ten`; + +CREATE DATABASE IF NOT EXISTS `apo_pro_com_april_ten` DEFAULT CHARACTER SET latin1 COLLATE latin1_spanish_ci; +USE `apo_pro_com_april_ten`; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_ERROR_APP_LOG` +-- +CREATE TABLE `APC_ERROR_APP_LOG`( + `id_log` varchar(36) primary key, + `log_entry_date` timestamp, + `log_logger` varchar(100), + `log_level` varchar(100), + `log_message` varchar(250), + `log_exception` varchar(4000) +)ENGINE=InnoDB DEFAULT CHARSET=latin1; +USE `apo_pro_com_april_ten`; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_OFFICE` +-- +CREATE TABLE `APC_OFFICE`( + `id` char(36) NOT NULL, + `office_name` varchar(100) NOT NULL, + `address` varchar(250), + `office_status` ENUM('ENEBLED', 'DISABLED', 'DELETED') NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_office_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_office_uk` UNIQUE KEY (`office_name`) +)ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_ROLE` +-- +CREATE TABLE `APC_ROLE`( + `id` char(36) NOT NULL, + `role_name` varchar(100) NOT NULL, + `active_status` ENUM('ENEBLED', 'DISABLED') NOT NULL DEFAULT 'ENEBLED', + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_role_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_role_uk` UNIQUE KEY (`role_name`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_ROUTE` +-- +CREATE TABLE `APC_ROUTE`( + `id` char(36) NOT NULL, + `id_office` char(36) NOT NULL, + `route_name` varchar(25) NOT NULL, + `active_status` ENUM('ENEBLED', 'DISABLED') NOT NULL DEFAULT 'ENEBLED', + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_route_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_route_uk` UNIQUE KEY (`id_office`,`route_name`), + CONSTRAINT `apc_route_to_apc_office_fk` + FOREIGN KEY (`id_office`) REFERENCES `APC_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------------------- +-- +-- Estructura para la vista `APC_BONUS` +-- +-- Dar de alta los bonos activos. +-- +CREATE TABLE `APC_BONUS`( + `id` char(36) NOT NULL, + `name` varchar(100) NOT NULL, + `loan_bonus` numeric(8,2) NOT NULL, + `mora_bonus` numeric(8,2) NOT NULL, + `new_customer_bonus` numeric(8,2) NOT NULL, + `administrative` ENUM('ENEBLED', 'DISABLED') NOT NULL DEFAULT 'ENEBLED', + `active_status` ENUM('ENEBLED', 'DISABLED') NOT NULL DEFAULT 'ENEBLED', + `id_office` char(36) NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_bono_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_bono_to_apc_office_fk` + FOREIGN KEY (`id_office`) REFERENCES `APC_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_HUMAN_RESOURCES` +-- +CREATE TABLE `APC_HUMAN_RESOURCE` ( + `id` char(36) NOT NULL, + `first_name` varchar(25) NOT NULL, + `second_name` varchar(25) DEFAULT NULL, + `last_name` varchar(25) NOT NULL, + `middle_name` varchar(25) NOT NULL, + `birthdate` date DEFAULT NULL, + `avatar` varchar(150) NOT NULL, + `curp` varchar(20) DEFAULT NULL, + `rfc` varchar(13) DEFAULT NULL, + `ife` varchar(20) DEFAULT NULL, + `admission_date` date DEFAULT NULL, + `human_resource_status` ENUM('ENEBLED', 'DISABLED', 'DELETED') NOT NULL, + `id_role` char(36) NOT NULL, + `id_bonus` char(36) DEFAULT NULL, + `payment` numeric(8,2) DEFAULT NULL, + `imss` numeric(8,2) DEFAULT NULL, + `created_by` char(36) DEFAULT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `person_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_human_resource_to_apc_role_fk` + FOREIGN KEY (`id_role`) REFERENCES `APC_ROLE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_human_resource_to_apc_bonus_fk` + FOREIGN KEY (`id_bonus`) REFERENCES `APC_BONUS`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_HUMAN_RESOURCE_HAS_ROUTE` +-- +CREATE TABLE `APC_HUMAN_RESOURCE_HAS_ROUTE`( + `id_human_resource` char(36) NOT NULL, + `id_route` char(36) NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_human_resource_has_route_pk` PRIMARY KEY (`id_human_resource`, `id_route`), + CONSTRAINT `apc_human_resource_has_route_to_apc_human_resource_fk` + FOREIGN KEY (`id_human_resource`) REFERENCES `APC_HUMAN_RESOURCE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_human_resource_has_route_to_apc_office_fk` + FOREIGN KEY (`id_route`) REFERENCES `APC_ROUTE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +)ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_PEOPLE` +-- +CREATE TABLE `APC_PEOPLE`( + `id` char(36) NOT NULL, + `first_name` varchar(25) NOT NULL, + `second_name` varchar(25) DEFAULT NULL, + `last_name` varchar(25) NOT NULL, + `middle_name` varchar(25) NOT NULL, + `birthdate` date DEFAULT NULL, + `thumbnail` varchar(250) NOT NULL, + `phone_home` varchar(15) NOT NULL, + `address_home` varchar(150) NOT NULL, + `phone_business` varchar(15), + `address_business` varchar(150), + `company_name` varchar(150), + `people_type` ENUM('CUSTOMER', 'ENDORSEMENT', 'BOTH') NOT NULL DEFAULT 'CUSTOMER', + `active_status` ENUM('ENEBLED', 'DISABLED') NOT NULL DEFAULT 'ENEBLED', + `id_office` char(36) NOT NULL, + `id_route` char(36) NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_people_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_people_to_apc_office_fk` + FOREIGN KEY (`id_office`) REFERENCES `APC_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_people_to_apc_route_fk` + FOREIGN KEY (`id_route`) REFERENCES `APC_ROUTE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +)ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_LOAN_TYPE` +-- +CREATE TABLE `APC_LOAN_TYPE`( + `id` char(36) NOT NULL, + `loan_type_name` varchar(50) NOT NULL, + `total_days` smallint NOT NULL DEFAULT 22, + `loan_fee` numeric(8,2) NOT NULL,-- Multa + `opening_fee` int NOT NULL, -- ComisiĆ³n + `payment` numeric(8,2) NOT NULL,-- Monte del prestamo + `payment_daily` numeric(8,2) NOT NULL,-- 60 x c/1000 + `payment_total` numeric(8,2) NOT NULL, -- Prestamo mĆ”s intereses + `payment_monday` ENUM('MONDAY'), + `payment_tuesday` ENUM('TUESDAY'), + `payment_wednesday` ENUM('WEDNESDAY'), + `payment_thursday` ENUM('THURSDAY'), + `payment_friday` ENUM('FRIDAY'), + `payment_saturday` ENUM('SATURDAY'), + `payment_sunday` ENUM('SUNDAY'), + `id_office` char(36) NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_loan_type_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_loan_type_to_apc_office_fk` + FOREIGN KEY (`id_office`) REFERENCES `APC_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +)ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_LOAN` +-- +CREATE TABLE `APC_LOAN`( + `id` char(36) NOT NULL, + `id_loan_type` char(36) NOT NULL, + `id_customer` char(36) NOT NULL, + `id_endorsement` char(36) NOT NULL, + `id_route` char(36) NOT NULL, + `loan_status` ENUM('PENDING', 'FINISH','BLACK_LIST', 'APPROVED','REJECTED', 'PENDING_RENOVATION', 'TO_DELIVERY') NOT NULL DEFAULT 'PENDING', + `new_customer` ENUM('ENEBLED', 'DISABLED') DEFAULT 'DISABLED', + `amount_paid` numeric(8,2) NOT NULL, + `amount_to_pay` numeric(8,2) NOT NULL, + `last_reference_number` smallint NOT NULL, + `comments` varchar(200), + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36), + `last_updated_on` datetime, + CONSTRAINT `apc_loan_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_loan_to_apc_loan_type_fk` + FOREIGN KEY (`id_loan_type`) REFERENCES `APC_LOAN_TYPE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_loan_to_apc_person_as_customer_fk` + FOREIGN KEY (`id_customer`) REFERENCES `APC_PEOPLE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_loan_to_apc_person_as_endorsement_fk` + FOREIGN KEY (`id_endorsement`) REFERENCES `APC_PEOPLE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_loan_to_apc_route_fk` + FOREIGN KEY (`id_route`) REFERENCES `APC_ROUTE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +)ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_HUMAN_RESOURCE_BY_OFFICE` +-- +CREATE TABLE `APC_HUMAN_RESOURCE_BY_OFFICE`( + `id` char(36) NOT NULL, + `id_human_resource` char(36) NOT NULL, + `id_office` char(36) NOT NULL, + `application_owner` ENUM('APP_OWNER', 'APP_USER') NOT NULL DEFAULT 'APP_USER', + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_human_resource_by_office_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_human_resource_by_office_uk` UNIQUE KEY (`id_human_resource`, `id_office`), + CONSTRAINT `apc_human_resource_by_office_to_apc_human_resource_fk` + FOREIGN KEY (`id_human_resource`) REFERENCES `APC_HUMAN_RESOURCE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_human_resource_by_office_to_apc_office_fk` + FOREIGN KEY (`id_office`) REFERENCES `APC_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +)ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_USER` +-- +CREATE TABLE `APC_USER`( + `id` char(36) NOT NULL, + `id_human_resource` char(36) NOT NULL, + `user_name` varchar(100) NOT NULL, + `pwd` varchar(100)NOT NULL, + `user_type` ENUM('WEB', 'MOBILE', 'BOTH') NOT NULL, + `user_status` ENUM('ENEBLED', 'DISABLED', 'DELETED') NOT NULL, + `application_owner` ENUM('APP_OWNER', 'APP_USER') NOT NULL DEFAULT 'APP_USER', + `certifier` ENUM('ENEBLED', 'DISABLED') NOT NULL DEFAULT 'DISABLED', + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_user_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_user_by_office_to_apc_human_resource_fk` + FOREIGN KEY (`id_human_resource`) REFERENCES `APC_HUMAN_RESOURCE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +)ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_LOAN_DETAIL` +-- +CREATE TABLE `APC_LOAN_DETAIL`( + `id` char(36) NOT NULL, + `id_loan` char(36) NOT NULL, + `id_user` char(36) NOT NULL, + `people_type` ENUM('CUSTOMER', 'ENDORSEMENT') NOT NULL DEFAULT 'CUSTOMER', + `payment_amount` numeric(8,2) NOT NULL, + `reference_number` smallint NOT NULL, + `loan_details_type` ENUM('CREDIT_PAYMENT', 'DEBIT_PAYMENT', 'PAYMENT', 'FEE','RENOVATION_PAYMENT') NOT NULL, + `loan_comments` varchar(150), + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_loan_details_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_loan_details_uk` UNIQUE KEY (`id`,`reference_number`), + CONSTRAINT `apc_loan_details_to_apc_loan_fk` + FOREIGN KEY (`id_loan`) REFERENCES `APC_LOAN`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_loan_details_to_apc_user_fk` + FOREIGN KEY (`id_user`) REFERENCES `APC_USER`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +)ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_LOAN_FEE_NOTIFICATION` +-- +CREATE TABLE `APC_LOAN_FEE_NOTIFICATION`( + `id` char(36) NOT NULL, + `id_loan` char(36) NOT NULL, + `id_user` char(36) NOT NULL, + `notification_number` smallint NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_loan_notification_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_loan_notification_to_apc_loan_fk` + FOREIGN KEY (`id_loan`) REFERENCES `APC_LOAN`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_loan_notification_to_apc_user_fk` + FOREIGN KEY (`id_user`) REFERENCES `APC_USER`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +)ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_LOAN_BY_USER` +-- +CREATE TABLE `APC_LOAN_BY_USER`( + `id_loan` char(36) NOT NULL, + `id_user` char(36) NOT NULL, + `loan_by_user_status` ENUM('PENDING', 'FINISH','BLACK_LIST', 'APPROVED','REJECTED', 'PENDING_RENOVATION', 'TO_DELIVERY') NOT NULL DEFAULT 'PENDING', + `comments` varchar(150), + `owner_loan` ENUM('CURRENT_OWNER', 'OLD_OWNER') NOT NULL, + `order_in_list` smallint DEFAULT 0, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_loan_by_user_pk` PRIMARY KEY (`id_loan`, `id_user`), + CONSTRAINT `apc_loan_by_user_to_apc_loan_fk` + FOREIGN KEY (`id_loan`) REFERENCES `APC_LOAN`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_loan_by_user_to_apc_user_fk` + FOREIGN KEY (`id_user`) REFERENCES `APC_USER`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +)ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_LOAN_BY_RENOVATION` +-- +CREATE TABLE `APC_LOAN_BY_RENOVATION`( + `id_loan_old` char(36) NOT NULL, + `id_loan_new` char(36) NOT NULL, + `loan_by_renovation_status` ENUM('PENDING', 'APPROVED','REJECTED') NOT NULL DEFAULT 'PENDING', + `comments` varchar(150), + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_loan_by_renovation_pk` PRIMARY KEY (`id_loan_old`, `id_loan_new`), + CONSTRAINT `apc_loan_by_renovation_old_to_apc_loan_fk` + FOREIGN KEY (`id_loan_old`) REFERENCES `APC_LOAN`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_loan_by_renovation_new_to_apc_user_fk` + FOREIGN KEY (`id_loan_new`) REFERENCES `APC_LOAN`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +)ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_USER_BY_OFFICE` +-- +CREATE TABLE `APC_USER_BY_OFFICE`( + `id` char(36) NOT NULL, + `id_user` char(36) NOT NULL, + `id_office` char(36) NOT NULL, + `user_by_office_status` ENUM('ENEBLED', 'DISABLED', 'DELETED') NOT NULL, + `application_owner` ENUM('APP_OWNER', 'APP_USER')NOT NULL DEFAULT 'APP_USER', + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_user_by_office_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_user_by_office_uk` UNIQUE KEY (`id_user`, `id_office`), + CONSTRAINT `apc_user_by_office_to_apc_user_fk` + FOREIGN KEY (`id_user`) REFERENCES `APC_USER`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_user_by_office_to_apc_office_fk` + FOREIGN KEY (`id_office`) REFERENCES `APC_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +)ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_PERMISSION` +-- +CREATE TABLE `APC_PERMISSION` ( + `id` char(36) NOT NULL, + `permission` varchar(200) NOT NULL, -- dashboard.policy.to.expire.name + `description` varchar(200) NOT NULL, -- dashboard.policy.to.expire.description + `menu_path` varchar(200) NOT NULL, -- dashboard.policy.to.expire.path + `left_to_right_order` smallint NOT NULL, -- Orden en la que aparece el menu principal (Dashboard, AdministraciĆ³n, CatĆ”logo) + `top_to_bottom_order` smallint NOT NULL, -- Orden en la que aparece de arriba hacia abajo + `permission_type` ENUM('PUBLIC', 'PRIVATE', 'EXCLUSIVE') NOT NULL, + `parent_name` varchar(200), + `permission_status` ENUM('ENEBLED', 'DISABLED') NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_permission_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_permission_uk` UNIQUE KEY (`permission`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_USER_BY_OFFICE_HAS_PERMISSION` +-- +CREATE TABLE `APC_USER_BY_OFFICE_HAS_PERMISSION` ( + `id_user_by_office` char(36) NOT NULL, + `id_permission` char(36) NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_user_by_office_has_permission_pk` PRIMARY KEY (`id_user_by_office`,`id_permission`) , + CONSTRAINT `apc_user_by_office_has_permission_to_apc_user_by_office_fk` + FOREIGN KEY (`id_user_by_office`) REFERENCES `APC_USER_BY_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_user_by_office_has_permission_to_apc_permission_fk` + FOREIGN KEY (`id_permission`) REFERENCES `APC_PERMISSION`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_USER_MOBILE_PREFERECE` +-- +CREATE TABLE `APC_USER_MOBILE_PREFERECE`( + `id` char(36) NOT NULL, + `id_user` char(36) NOT NULL, + `preference_name` varchar(25) NOT NULL, + `preference_value` varchar(25) NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_user_mobile_preference_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_user_mobile_preference_uk` UNIQUE KEY (`id_user`,`preference_name`), + CONSTRAINT `apc_user_mobile_preference_to_apc_user_fk` + FOREIGN KEY (`id_user`) REFERENCES `APC_USER`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +)ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_TRANSFER` +-- +CREATE TABLE `APC_TRANSFER`( + `id` char(36) NOT NULL, + `id_user_transmitter` char(36) NOT NULL, + `id_user_receiver` char(36) NOT NULL, + `active_status` ENUM('ENEBLED', 'DISABLED') NOT NULL DEFAULT 'ENEBLED', + `action_status` ENUM('PENDING', 'APPROVED','REJECTED') NOT NULL DEFAULT 'PENDING', + `amount_to_transfer` numeric(8,2) NOT NULL, + `id_office` char(36) NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_transfer_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_transfer_user_transmitter_to_apc_user_fk` + FOREIGN KEY (`id_user_transmitter`) REFERENCES `APC_USER`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_transfer_user_receiver_to_apc_user_fk` + FOREIGN KEY (`id_user_receiver`) REFERENCES `APC_USER`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_transfer_by_office_to_apc_office_fk` + FOREIGN KEY (`id_office`) REFERENCES `APC_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_MONEY_DAILY` +-- +CREATE TABLE `APC_MONEY_DAILY`( + `id` char(36) NOT NULL, + `money_daily_date` datetime DEFAULT CURRENT_TIMESTAMP, + `amount` numeric(8,2) NOT NULL, + `id_user` char(36) NOT NULL, + `id_office` char(36) NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_money_daily_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_money_daily_by_id_user_to_apc_user_fk` + FOREIGN KEY (`id_user`) REFERENCES `APC_USER`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_money_daily_by_id_office_to_apc_office_fk` + FOREIGN KEY (`id_office`) REFERENCES `APC_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de la tabla `APC_DELIVERY` +-- +CREATE TABLE `APC_DELIVERY`( + `id` char(36) NOT NULL, + `id_user` char(36) NOT NULL, + `id_loan` char(36) NOT NULL, + `amount` numeric(8,2) NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_delivery_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_delivery_by_id_user_to_apc_user_fk` + FOREIGN KEY (`id_user`) REFERENCES `APC_USER`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_delivery_to_apc_loan_fk` + FOREIGN KEY (`id_loan`) REFERENCES `APC_LOAN`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- ------------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_CLOSING_DAY` +-- +CREATE TABLE `APC_CLOSING_DAY`( + `id` char(36) NOT NULL, + `id_office` char(36) NOT NULL, + `id_user` char(36) NOT NULL, + `active_status` ENUM('ENEBLED', 'DISABLED') NOT NULL DEFAULT 'ENEBLED', + `amount_paid` numeric(8,2) NOT NULL, + `amount_expected` numeric(8,2) NOT NULL, + `comments` varchar(250), + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_closing_day_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_closing_day_to_apc_office_fk` + FOREIGN KEY (`id_office`) REFERENCES `APC_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_closing_day_to_apc_user_fk` + FOREIGN KEY (`id_user`) REFERENCES `APC_USER`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- ------------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_OTHER_EXPENSE` +-- +CREATE TABLE `APC_OTHER_EXPENSE`( + `id` char(36) NOT NULL, + `id_user` char(36) NOT NULL, + `id_office` char(36) NOT NULL, + `expense` numeric(8,2) NOT NULL, + `description` varchar(200) NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_other_expense_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_other_expense_to_apc_user_fk` + FOREIGN KEY (`id_user`) REFERENCES `APC_USER`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_other_expense_to_apc_office_fk` + FOREIGN KEY (`id_office`) REFERENCES `APC_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------------------- +-- +-- Estructura para la vista `APC_GOAL` +-- +-- Dar de alta las metas de los trabajadores. +-- +CREATE TABLE `APC_GOAL`( + `id` char(36) NOT NULL, + `start_date` date NOT NULL, + `end_date` date NOT NULL, + `amount` numeric(8,2) NOT NULL, + `active_status` ENUM('ENEBLED', 'DISABLED') NOT NULL DEFAULT 'ENEBLED', + `id_office` char(36) NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_goal_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_goal_to_apc_office_fk` + FOREIGN KEY (`id_office`) REFERENCES `APC_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------------------- +-- +-- Estructura para la vista `APC_ADVANCE` +-- +-- Adelanto de nomina. +-- +CREATE TABLE `APC_ADVANCE`( + `id` char(36) NOT NULL, + `id_human_resource` char(36) NOT NULL, + `id_office` char(36) NOT NULL, + `amount` numeric(8,2) NOT NULL, + `active_status` ENUM('ENEBLED', 'DISABLED') NOT NULL DEFAULT 'ENEBLED', + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_advance_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_advance_to_apc_human_resource_fk` + FOREIGN KEY (`id_human_resource`) REFERENCES `APC_HUMAN_RESOURCE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_advance_to_apc_office_fk` + FOREIGN KEY (`id_office`) REFERENCES `APC_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------------------- +-- +-- Estructura para la tabla `APC_EXPENSE_COMPANY` +-- +-- Gastos de la compaƱia. +-- +CREATE TABLE `APC_EXPENSE_COMPANY`( + `id` char(36) NOT NULL, + `id_office` char(36) NOT NULL, + `amount` numeric(8,2) NOT NULL, + `description` varchar(200), + `expense_company_type` ENUM('PAYMENT_IN', 'PAYMENT_OUT') NOT NULL, + `active_status` ENUM('ENEBLED', 'DISABLED') NOT NULL DEFAULT 'ENEBLED', + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_expense_company_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_expense_company_to_apc_office_fk` + FOREIGN KEY (`id_office`) REFERENCES `APC_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------------------- +-- +-- Estructura para la tabla `APC_STABLE_GENERAL_BOX` +-- +-- Totales de la caja de APC. +-- +CREATE TABLE `APC_STABLE_GENERAL_BOX`( + `id` char(36) NOT NULL, + `total_general_box` numeric(8,2) NOT NULL, + `total_envelope` numeric(8,2) NOT NULL, + `total_bank_note` numeric(8,2) NOT NULL, + `total_coin` numeric(8,2) NOT NULL, + `total_stable` numeric(8,2) NOT NULL, + `active_status` ENUM('ENEBLED', 'DISABLED') NOT NULL DEFAULT 'ENEBLED', + `description` varchar(200), + `id_office` char(36) NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_stable_general_box_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_stable_general_box_to_apc_office_fk` + FOREIGN KEY (`id_office`) REFERENCES `APC_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- +-- Estructura para la tabla `APC_STABLE_GENERAL_BOX` +-- +-- Totales de la caja de APC. +-- +CREATE TABLE `APC_TOTAL_EXPECTED_PAYMENT_DAILY_BY_USER`( + `id` char(36) NOT NULL, + `total_expected` numeric(8,2) NOT NULL, + `active_status` ENUM('ENEBLED', 'DISABLED') NOT NULL DEFAULT 'ENEBLED', + `id_office` char(36) NOT NULL, + `id_user` char(36) NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_total_expected_payment_daily_by_user_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_total_expected_payment_daily_by_user_to_apc_office_fk` + FOREIGN KEY (`id_office`) REFERENCES `APC_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_total_expected_payment_daily_by_user_to_apc_user_fk` + FOREIGN KEY (`id_user`) REFERENCES `APC_USER`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------------------- +-- +-- Estructura para la vista `ARREBOL_TEST` +-- +-- Solo para pruebas exclusivas. +-- +CREATE TABLE `ARREBOL_TEST`( + `id` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP +)ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- ------------------------------------------------------------- +-- +-- Estructura para la vista `APC_SECURITY_AUTHENTICATION` (USER) +-- +CREATE OR REPLACE VIEW `APC_SECURITY_AUTHENTICATION` AS +SELECT CONCAT(`usr`.`user_name`,`ubo`.`id_office`) AS `user_name`, `usr`.`pwd` AS `pwd` +FROM `APC_USER_BY_OFFICE` `ubo` +INNER JOIN `APC_USER` `usr` ON `ubo`.`id_user` = `usr`.`id` +INNER JOIN `APC_HUMAN_RESOURCE` `hr` ON `usr`.`id_human_resource` = `hr`.`id` +WHERE +`usr`.`user_status` = 'ENEBLED' AND +`usr`.`user_type` IN ('WEB', 'BOTH') AND +`ubo`.`user_by_office_status` = 'ENEBLED' AND +`hr`.`human_resource_status` = 'ENEBLED'; +-- ------------------------------------------------------------ +-- +-- Estructura para la vista `APC_SECURITY_AUTHORIZATION` (ROLE) +-- +CREATE OR REPLACE VIEW `APC_SECURITY_AUTHORIZATION` AS +SELECT CONCAT(`usr`.`user_name`,`ubo`.`id_office`) AS `user_name`, `perm`.`permission` AS `permission` +FROM `APC_PERMISSION` `perm` +INNER JOIN `APC_USER_BY_OFFICE_HAS_PERMISSION` `ubohp` ON `perm`.`id` = `ubohp`.`id_permission` +INNER JOIN `APC_USER_BY_OFFICE` `ubo` ON `ubohp`.`id_user_by_office` = `ubo`.`id` +INNER JOIN `APC_USER` `usr` ON `ubo`.`id_user` = `usr`.`id` +INNER JOIN `APC_HUMAN_RESOURCE` `hr` ON `usr`.`id_human_resource` = `hr`.`id` +WHERE +`perm`.`permission_status` = 'ENEBLED' AND +`ubo`.`user_by_office_status` = 'ENEBLED' AND +`usr`.`user_status` = 'ENEBLED' AND +`usr`.`user_type` IN ('WEB', 'BOTH') AND +`hr`.`human_resource_status` = 'ENEBLED' +ORDER BY `user_name`; +-- ------------------------------------------------------------------- +-- +-- Estructura para la vista `APC_SECURITY_AUTHENTICATION_MOBILE` (USER) +-- +CREATE OR REPLACE VIEW `APC_SECURITY_AUTHENTICATION_MOBILE` AS +SELECT +`usr`.`id` AS `id`, +`usr`.`user_name` AS `user_name`, +`usr`.`pwd` AS `pwd`, +`hr`.`avatar` AS `avatar`, +`ubo`.`id_office` AS `id_office`, +`hrhr`.`id_route` AS `id_route`, +`usr`.`certifier` AS `certifier` +FROM `APC_USER_BY_OFFICE` `ubo` +INNER JOIN `APC_USER` `usr` ON `ubo`.`id_user` = `usr`.`id` +INNER JOIN `APC_HUMAN_RESOURCE` `hr` ON `usr`.`id_human_resource` = `hr`.`id` +INNER JOIN `APC_HUMAN_RESOURCE_HAS_ROUTE` `hrhr` ON `hr`.`id` = `hrhr`.`id_human_resource` +WHERE +`usr`.`user_status` = 'ENEBLED' AND +`usr`.`user_type` IN ('MOBILE', 'BOTH') AND +`ubo`.`user_by_office_status` = 'ENEBLED' AND +`hr`.`human_resource_status` = 'ENEBLED'; +-- -------------------------------------------------------------------- +-- +-- Estructura para la vista `APC_LOAN_BY_USER_VIEW` (USER) +-- Se utiliza para que un Asesor cargue todos los pretamos que tiene +-- que cobrar en el dĆ­a actual. +-- +CREATE OR REPLACE VIEW `APC_LOAN_BY_USER_VIEW` AS +SELECT + CONCAT(l.id, u.id) AS id, + u.id AS user_id, + CONCAT( + CASE + WHEN cstmr.first_name IS NOT NULL AND cstmr.first_name != '' + THEN CONCAT(SUBSTR(UPPER(cstmr.first_name), 1, 1),SUBSTR(LOWER(cstmr.first_name), 2), ' ') + ELSE '' + END, + CASE + WHEN cstmr.second_name IS NOT NULL AND cstmr.second_name != '' + THEN CONCAT(SUBSTR(UPPER(cstmr.second_name), 1, 1),SUBSTR(LOWER(cstmr.second_name), 2), ' ') + ELSE '' + END, + CASE + WHEN cstmr.last_name IS NOT NULL AND cstmr.last_name != '' + THEN CONCAT(SUBSTR(UPPER(cstmr.last_name), 1, 1),SUBSTR(LOWER(cstmr.last_name), 2)) + ELSE '' + END + ) AS customer_name, + (CASE + WHEN cstmr.address_home IS NULL THEN '' + ELSE cstmr.address_home + END) AS customer_address_home, + (CASE + WHEN cstmr.address_business IS NULL THEN '' + ELSE cstmr.address_business + END) AS customer_address_business, + (CASE + WHEN cstmr.company_name IS NULL THEN '' + ELSE cstmr.company_name + END) AS company_name, + (CASE + WHEN cstmr.thumbnail IS NULL THEN '' + ELSE cstmr.thumbnail + END) AS customer_thumbnail, + CONCAT( + CASE + WHEN ndrsmnt.first_name IS NOT NULL AND ndrsmnt.first_name != '' + THEN CONCAT(SUBSTR(UPPER(ndrsmnt.first_name), 1, 1),SUBSTR(LOWER(ndrsmnt.first_name), 2), ' ') + ELSE '' + END, + CASE + WHEN ndrsmnt.second_name IS NOT NULL AND ndrsmnt.second_name != '' + THEN CONCAT(SUBSTR(UPPER(ndrsmnt.second_name), 1, 1),SUBSTR(LOWER(ndrsmnt.second_name), 2), ' ') + ELSE '' + END, + CASE + WHEN ndrsmnt.last_name IS NOT NULL AND ndrsmnt.last_name != '' + THEN CONCAT(SUBSTR(UPPER(ndrsmnt.last_name), 1, 1),SUBSTR(LOWER(ndrsmnt.last_name), 2)) + ELSE '' + END + )AS endorsement_name, + (CASE + WHEN ndrsmnt.address_home IS NULL THEN '' + ELSE ndrsmnt.address_home + END) AS endorsement_address_home, + (CASE + WHEN ndrsmnt.thumbnail IS NULL THEN '' + ELSE ndrsmnt.thumbnail + END) AS endorsement_thumbnail, + (CASE + WHEN ndrsmnt.phone_home IS NULL THEN '' + ELSE ndrsmnt.phone_home + END) AS endorsement_phone_home, + IF((l.amount_to_pay - l.amount_paid >= lt.payment_daily), lt.payment_daily, l.amount_to_pay - l.amount_paid) AS payment_daily, + lt.loan_fee, + lbu.order_in_list, + (SELECT count(notification_number) FROM APC_LOAN_FEE_NOTIFICATION WHERE id_loan = l.id) AS notification_number, +IF( + ( + l.amount_paid >= (SELECT FLOOR(lt.payment_total * .6364) FROM DUAL) + ), + CASE + WHEN + (SELECT count(notification_number) as total + FROM APC_LOAN_FEE_NOTIFICATION + WHERE id_loan = l.id + ) < 4 + THEN 'ENEBLED' + WHEN + (SELECT count(notification_number) as total + FROM APC_LOAN_FEE_NOTIFICATION + WHERE id_loan = l.id + ) BETWEEN 4 AND 5 + AND + lt.payment > 1000 + THEN 'ENEBLED' + ELSE 'DISABLED' + END + ,'DISABLED' +) as renovation, +(SELECT amount_to_pay - amount_paid FROM APC_LOAN WHERE id = l.id) AS max_amount_to_pay +FROM APC_LOAN_BY_USER lbu +INNER JOIN APC_LOAN l ON lbu.id_loan = l.id +INNER JOIN APC_LOAN_TYPE lt ON l.id_loan_type = lt.id +INNER JOIN APC_PEOPLE cstmr ON l.id_customer = cstmr.id +INNER JOIN APC_PEOPLE ndrsmnt ON l.id_endorsement = ndrsmnt.id +INNER JOIN APC_USER u ON lbu.id_user = u.id +WHERE + l.loan_status = 'APPROVED' AND + l.id = ( + CASE + -- WHEN IS NEW AND update created_on less equals to currentdate + WHEN ( + (SELECT count(id) FROM APC_LOAN_DETAIL WHERE id_loan = l.id ) = 0 AND + DATE(l.last_updated_on) < curdate() + ) THEN l.id + -- WHEN LOAN HAS PAYMENTS + WHEN ( + ( + SELECT count(id) + FROM APC_LOAN_DETAIL + WHERE + id_loan = l.id AND + reference_number = l.last_reference_number AND + DATE(created_on) < curdate() + ) > 0 AND + DATE(l.last_updated_on) < curdate() + ) THEN l.id + ELSE '' + END + ) AND + lbu.owner_loan = 'CURRENT_OWNER'; +-- -------------------------------------------------------------------- +-- +-- Estructura para la vista `APC_LOAN_BY_USER_ORDER_PREFERENCE_VIEW` (USER) +-- Se utiliza para que un Asesor cargue todos los pretamos que tiene +-- que cobrar en el dĆ­a actual y los pueda order por order de preferencia +-- para que pueda programar suta a su gusto. +-- +CREATE OR REPLACE VIEW `APC_LOAN_BY_USER_ORDER_PREFERENCE_VIEW` AS +SELECT + CONCAT(l.id, u.id) AS id, + u.id AS user_id, + CONCAT(cstmr.first_name,' ',IF(ISNULL(cstmr.second_name) ,'', CONCAT(cstmr.second_name, ' ')),cstmr.last_name,' ', cstmr.middle_name) AS customer_name, + cstmr.address_home AS customer_address_home, + cstmr.address_business AS customer_address_business, + lbu.order_in_list +FROM APC_LOAN_BY_USER lbu +INNER JOIN APC_LOAN l ON lbu.id_loan = l.id +INNER JOIN APC_PEOPLE cstmr ON l.id_customer = cstmr.id +INNER JOIN APC_USER u ON lbu.id_user = u.id +WHERE l.loan_status = 'APPROVED'; +-- -------------------------------------------------------------------- +-- +-- Estructura para la vista `APC_PERSON_SEARCH_VIEW` +-- Se utiliza para realizar busqueda por nombre. +-- +CREATE OR REPLACE VIEW `APC_PERSON_SEARCH_VIEW` AS +SELECT + id, + CONCAT( + CASE + WHEN first_name IS NOT NULL AND first_name != '' + THEN CONCAT(SUBSTR(UPPER(first_name), 1, 1),SUBSTR(LOWER(first_name), 2)) + ELSE '' + END, + CASE + WHEN second_name IS NOT NULL AND second_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(second_name), 1, 1),SUBSTR(LOWER(second_name), 2)) + ELSE '' + END, + CASE + WHEN last_name IS NOT NULL AND last_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(last_name), 1, 1),SUBSTR(LOWER(last_name), 2)) + ELSE '' + END, + CASE + WHEN middle_name IS NOT NULL AND middle_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(middle_name), 1, 1),SUBSTR(LOWER(middle_name), 2)) + ELSE '' + END + ) AS person_search +FROM APC_PEOPLE +WHERE active_status = 'ENEBLED' +ORDER BY person_search; +-- -------------------------------------------------------------------- +-- +-- Estructura para la vista `APC_PERSON_SEARCH_DETAIL_VIEW` +-- Busca los detalles de una persona en el sistema. +CREATE OR REPLACE VIEW `APC_PERSON_SEARCH_DETAIL_VIEW` AS +SELECT + p.id AS id, + CONCAT( + CASE + WHEN p.first_name IS NOT NULL AND p.first_name != '' + THEN CONCAT(SUBSTR(UPPER(p.first_name), 1, 1),SUBSTR(LOWER(p.first_name), 2), ' ') + ELSE '' + END, + CASE + WHEN p.second_name IS NOT NULL AND p.second_name != '' + THEN CONCAT(SUBSTR(UPPER(p.second_name), 1, 1),SUBSTR(LOWER(p.second_name), 2), ' ') + ELSE '' + END, + CASE + WHEN p.last_name IS NOT NULL AND p.last_name != '' + THEN CONCAT(SUBSTR(UPPER(p.last_name), 1, 1),SUBSTR(LOWER(p.last_name), 2), ' ') + ELSE '' + END, + CASE + WHEN p.middle_name IS NOT NULL AND p.middle_name != '' + THEN CONCAT(SUBSTR(UPPER(p.middle_name), 1, 1),SUBSTR(LOWER(p.middle_name), 2)) + ELSE '' + END + ) AS person_search, + p.thumbnail, + CASE + WHEN + 0 < ( + SELECT COUNT(ID) + FROM APC_LOAN + WHERE + id_customer = p.id AND + loan_status = 'APPROVED') + THEN + 'ENEBLED' + WHEN + 0 < ( + SELECT COUNT(ID) + FROM APC_LOAN + WHERE + id_endorsement = p.id AND + loan_status = 'APPROVED') + THEN + 'ENEBLED' + ELSE + 'DISABLED' + END AS loanStatus +FROM APC_PEOPLE p; +-- -------------------------------------------------------------------- +-- +-- Estructura para la vista `APC_PERSON_SEARCH_HISTORICAL_DETAILS_VIEW` +-- Busca los detalles historicos de una persona en el sistema mĆ³vil. +CREATE OR REPLACE VIEW `APC_PERSON_SEARCH_HISTORICAL_DETAILS_VIEW` AS +SELECT + l.id, + p.id AS id_person_search, + DATE_FORMAT(l.created_on,'%d-%m-%Y') AS format_date, + CASE + WHEN 0 < (SELECT COUNT(ID) FROM APC_LOAN WHERE id_customer = p.id) + THEN 'Cliente' + WHEN 0 < (SELECT COUNT(ID) FROM APC_LOAN WHERE id_endorsement = p.id) + THEN 'Aval' + ELSE + 'Indeterminado' + END AS person_type, + CASE + WHEN 0 < (SELECT COUNT(ID) FROM APC_LOAN WHERE id_customer = p.id) + THEN + (SELECT CONCAT(in_p.first_name,' ', in_p.last_name) + FROM APC_LOAN in_l + INNER JOIN APC_PEOPLE in_p ON in_l.id_endorsement = in_p.id + WHERE in_l.id = l.id) + WHEN 0 < (SELECT COUNT(ID) FROM APC_LOAN WHERE id_endorsement = p.id) + THEN (SELECT CONCAT(in_p.first_name,' ', in_p.last_name) + FROM APC_LOAN in_l + INNER JOIN APC_PEOPLE in_p ON in_l.id_customer = in_p.id + WHERE in_l.id = l.id) + ELSE + 'Indeterminado' + END AS relationship, + lt.payment AS loan, + CASE + WHEN l.loan_status = 'APPROVED' + THEN CONCAT(l.last_reference_number, ' de 22') + ELSE '' + END AS payment_number, + CASE + WHEN l.loan_status = 'APPROVED' + THEN (l.amount_to_pay - l.amount_paid) + ELSE 0 + END AS amount_to_pay, + (SELECT COUNT(id) FROM APC_LOAN_FEE_NOTIFICATION WHERE id_loan = l.id) AS total_fees, + CASE + WHEN l.loan_status = 'PENDING' + THEN 'Pendiente' + WHEN l.loan_status = 'FINISH' + THEN 'Terminado' + WHEN l.loan_status = 'BLACK_LIST' + THEN 'Lista negra' + WHEN l.loan_status = 'APPROVED' + THEN 'Activo' + WHEN l.loan_status = 'REJECTED' + THEN 'Rechazado' + WHEN l.loan_status = 'PENDING_RENOVATION' + THEN 'Pendiente renovaciĆ³n' + WHEN l.loan_status = 'TO_DELIVERY' + THEN 'Por recibir' + END AS loan_status +FROM APC_LOAN l +INNER JOIN APC_PEOPLE p ON (l.id_customer = p.id or l.id_endorsement = p.id) +INNER JOIN APC_LOAN_TYPE lt ON l.id_loan_type = lt.id +ORDER BY l.created_on DESC; +-- -------------------------------------------------------------------- +-- +-- Estructura para la vista `APC_AVAILABLE_CUSTOMERS_VIEW` +-- +-- Sirve para cargar todos los posibles clientes de una oficina +-- que puedan solicitar un prestamo nuevo. +-- +CREATE OR REPLACE VIEW `APC_AVAILABLE_CUSTOMERS_VIEW` AS +SELECT + p.id, + CONCAT(p.first_name,' ', IF(ISNULL(p.second_name) ,'', CONCAT(p.second_name,' ')) ,p.last_name, ' ', p.middle_name) AS available_person, + CASE + WHEN p.people_type = 'BOTH' + THEN + CASE + WHEN 0 < (SELECT COUNT(id) FROM APC_LOAN WHERE id_customer = p.id) + THEN (SELECT id_endorsement FROM APC_LOAN WHERE id_customer = p.id ORDER BY created_on DESC LIMIT 1 ) + ELSE '' + END + ELSE '' + END as cross_signature +FROM APC_PEOPLE p +WHERE + p.people_type IN ('CUSTOMER', 'BOTH') AND + p.active_status = 'ENEBLED' AND + CASE + WHEN 0 = ( + SELECT COUNT(id) + FROM APC_LOAN + WHERE + id_customer = p.id AND + loan_status IN ('PENDING', 'BLACK_LIST', 'APPROVED', 'PENDING_RENOVATION', 'TO_DELIVERY') + ) + THEN TRUE + ELSE FALSE + END +ORDER BY available_person; +-- -------------------------------------------------------------------- +-- +-- Estructura para la vista `APC_AVAILABLE_ENDORSEMENT_VIEW` +-- +-- Sirve para cargar todos los posibles avales de una oficina +-- que puedan solicitar un prestamo nuevo. +-- +CREATE OR REPLACE VIEW `APC_AVAILABLE_ENDORSEMENTS_VIEW` AS +SELECT + p.id, + CONCAT(p.first_name,' ', IF(ISNULL(p.second_name) ,'', CONCAT(p.second_name,' ')) ,p.last_name, ' ', p.middle_name) AS available_person, + CASE + WHEN p.people_type = 'BOTH' + THEN + CASE + WHEN 0 < (SELECT COUNT(id) FROM APC_LOAN WHERE id_endorsement = p.id) + THEN (SELECT id_customer FROM APC_LOAN WHERE id_endorsement = p.id ORDER BY created_on DESC LIMIT 1 ) + ELSE '' + END + ELSE '' + END as cross_signature +FROM APC_PEOPLE p +WHERE + p.people_type IN ('ENDORSEMENT', 'BOTH') AND + p.active_status = 'ENEBLED' AND + CASE + WHEN 0 = ( + SELECT COUNT(id) + FROM APC_LOAN + WHERE + id_endorsement = p.id AND + loan_status IN ('PENDING', 'BLACK_LIST', 'APPROVED', 'PENDING_RENOVATION', 'TO_DELIVERY') + ) + THEN TRUE + ELSE FALSE + END +ORDER BY available_person; +-- -------------------------------------------------------------------- +-- +-- Estructura para la vista `APC_CASH_REGISTER_CURDATE_BY_USER_VIEW` +-- +-- Sirve para obtener todos los pagos que recabo un asesor en el dĆ­a. +-- +CREATE OR REPLACE VIEW `APC_CASH_REGISTER_CURDATE_BY_USER_VIEW` AS +SELECT + UUID() AS id, + lt.payment_amount AS payment, + CONCAT(p.first_name, ' ', p.last_name) AS customer_name, + lt.id_user AS id_user +FROM APC_LOAN_DETAIL lt +INNER JOIN APC_LOAN l ON lt.id_loan = l.id +INNER JOIN APC_PEOPLE p ON l.id_customer = p.id +WHERE + lt.loan_details_type = 'PAYMENT' AND + DATE(lt.created_on) = CURDATE() +ORDER BY lt.created_on; +-- -------------------------------------------------------------------- +-- +-- Estructura para la vista `APC_LOAN_TO_DELIVERY_BY_CERTIFIER_VIEW` +-- +-- Sirve para obtener todos los prestamos que un certificador tiene que entregar. +-- +CREATE OR REPLACE VIEW `APC_LOAN_TO_DELIVERY_BY_CERTIFIER_VIEW` AS +SELECT + l.id AS id_loan, + u.id AS id_user, + -- u.user_name, + -- hrhr.id_route, + -- l.loan_status, + CONCAT( + CASE + WHEN p.first_name IS NOT NULL + THEN CONCAT(SUBSTR(UPPER(p.first_name), 1, 1),SUBSTR(LOWER(p.first_name), 2)) + ELSE '' + END, + CASE + WHEN p.second_name IS NOT NULL + THEN CONCAT(' ',SUBSTR(UPPER(p.second_name), 1, 1),SUBSTR(LOWER(p.second_name), 2)) + ELSE '' + END, + CASE + WHEN p.last_name IS NOT NULL + THEN CONCAT(' ',SUBSTR(UPPER(p.last_name), 1, 1),SUBSTR(LOWER(p.last_name), 2)) + ELSE '' + END + ) AS customer_name, + CASE + WHEN p.address_business IS NOT NULL + THEN CONCAT(SUBSTR(UPPER(p.address_business), 1, 1),SUBSTR(LOWER(p.address_business), 2)) + ELSE '' + END AS customer_address, + p.thumbnail AS thumbnail, + CASE + WHEN (SELECT COUNT(id_loan_new) FROM APC_LOAN_BY_RENOVATION WHERE id_loan_new = l.id) > 0 + THEN 'star' + ELSE 'new' + END AS icon, + CASE + WHEN (SELECT COUNT(id_loan_new) FROM APC_LOAN_BY_RENOVATION WHERE id_loan_new = l.id) > 0 + THEN + CASE + WHEN -- (SELECT amount_to_pay - amount_paid FROM APC_LOAN WHERE id = l.id) > (lt.payment_daily * 2) + (SELECT innerL.amount_to_pay - innerL.amount_paid FROM APC_LOAN innerL + INNER JOIN APC_LOAN_TYPE innerLT ON innerL.id_loan_type = innerLT.id + WHERE innerL.id = (SELECT id_loan_old FROM APC_LOAN_BY_RENOVATION WHERE id_loan_new = l.id)) + > + (SELECT innerLT.payment_daily FROM APC_LOAN innerL + INNER JOIN APC_LOAN_TYPE innerLT ON innerL.id_loan_type = innerLT.id + WHERE innerL.id = (SELECT id_loan_old FROM APC_LOAN_BY_RENOVATION WHERE id_loan_new = l.id)) + THEN + CASE + WHEN + (SELECT (innerL.amount_to_pay - innerL.amount_paid) - (innerLT.payment_daily * 2) FROM APC_LOAN innerL + INNER JOIN APC_LOAN_TYPE innerLT ON innerL.id_loan_type = innerLT.id + WHERE innerL.id = (SELECT id_loan_old FROM APC_LOAN_BY_RENOVATION WHERE id_loan_new = l.id)) > 0 + THEN + lt.payment - + (lt.opening_fee + + -- ((l.amount_to_pay - l.amount_paid) - (lt.payment_daily * 2)) + (SELECT (innerL.amount_to_pay - innerL.amount_paid) - (innerLT.payment_daily * 2) FROM APC_LOAN innerL + INNER JOIN APC_LOAN_TYPE innerLT ON innerL.id_loan_type = innerLT.id + WHERE innerL.id = (SELECT id_loan_old FROM APC_LOAN_BY_RENOVATION WHERE id_loan_new = l.id))) + ELSE + lt.payment - + (lt.opening_fee + + -- ((l.amount_to_pay - l.amount_paid) - (lt.payment_daily * 2)) + (SELECT (innerLT.payment_daily * 2) - (innerL.amount_to_pay - innerL.amount_paid) FROM APC_LOAN innerL + INNER JOIN APC_LOAN_TYPE innerLT ON innerL.id_loan_type = innerLT.id + WHERE innerL.id = (SELECT id_loan_old FROM APC_LOAN_BY_RENOVATION WHERE id_loan_new = l.id))) + END + ELSE lt.payment - lt.opening_fee + END + ELSE lt.payment - lt.opening_fee + END AS amount_to_delivery, + CASE + WHEN (SELECT COUNT(id_loan_new) FROM APC_LOAN_BY_RENOVATION WHERE id_loan_new = l.id) > 0 + THEN + CASE + WHEN -- (SELECT amount_to_pay - amount_paid FROM APC_LOAN WHERE id = l.id) > (lt.payment_daily * 2) + (SELECT innerL.amount_to_pay - innerL.amount_paid FROM APC_LOAN innerL + INNER JOIN APC_LOAN_TYPE innerLT ON innerL.id_loan_type = innerLT.id + WHERE innerL.id = (SELECT id_loan_old FROM APC_LOAN_BY_RENOVATION WHERE id_loan_new = l.id)) + > + (SELECT innerLT.payment_daily FROM APC_LOAN innerL + INNER JOIN APC_LOAN_TYPE innerLT ON innerL.id_loan_type = innerLT.id + WHERE innerL.id = (SELECT id_loan_old FROM APC_LOAN_BY_RENOVATION WHERE id_loan_new = l.id)) + THEN -- ((l.amount_to_pay - l.amount_paid) - (lt.payment_daily * 2)) + CASE + WHEN + (SELECT (innerL.amount_to_pay - innerL.amount_paid) - (innerLT.payment_daily * 2) FROM APC_LOAN innerL + INNER JOIN APC_LOAN_TYPE innerLT ON innerL.id_loan_type = innerLT.id + WHERE innerL.id = (SELECT id_loan_old FROM APC_LOAN_BY_RENOVATION WHERE id_loan_new = l.id)) + > 0 + THEN + (SELECT (innerL.amount_to_pay - innerL.amount_paid) - (innerLT.payment_daily * 2) FROM APC_LOAN innerL + INNER JOIN APC_LOAN_TYPE innerLT ON innerL.id_loan_type = innerLT.id + WHERE innerL.id = (SELECT id_loan_old FROM APC_LOAN_BY_RENOVATION WHERE id_loan_new = l.id)) + ELSE + (SELECT (innerLT.payment_daily * 2) -(innerL.amount_to_pay - innerL.amount_paid) FROM APC_LOAN innerL + INNER JOIN APC_LOAN_TYPE innerLT ON innerL.id_loan_type = innerLT.id + WHERE innerL.id = (SELECT id_loan_old FROM APC_LOAN_BY_RENOVATION WHERE id_loan_new = l.id)) + END + ELSE 0 + END + ELSE 0 + END AS discount, + lt.opening_fee AS opening, + lt.payment AS payment +FROM + APC_USER u + INNER JOIN APC_HUMAN_RESOURCE_HAS_ROUTE hrhr ON u.id_human_resource = hrhr.id_human_resource + INNER JOIN APC_HUMAN_RESOURCE hr ON hrhr.id_human_resource = hr.id + INNER JOIN APC_ROLE r ON hr.id_role = r.id + INNER JOIN APC_LOAN l ON hrhr.id_route = l.id_route + INNER JOIN APC_LOAN_TYPE lt ON l.id_loan_type = lt.id + INNER JOIN APC_PEOPLE p ON l.id_customer = p.id +WHERE + u.certifier = 'ENEBLED' AND + l.loan_status = 'TO_DELIVERY' AND + DATE(l.created_on) <= CURDATE() +ORDER BY customer_name DESC; +-- -------------------------------------------------------------------- +-- +-- Estructura para la vista `APC_EXCHANGE_ENEBLED_USERS_VIEW` +-- +-- Sirve para obtener todos los usuarios disponibles para realizar traspasos. +-- +CREATE OR REPLACE VIEW `APC_EXCHANGE_ENEBLED_USERS_VIEW` AS +SELECT +u.id AS id_user, +CONCAT(hr.first_name, ' ', IF(ISNULL(hr.second_name) ,'', CONCAT(hr.second_name,' ')), hr.second_name, ' ', hr.last_name) AS user_name, +hrbo.id_office AS id_office +FROM APC_USER u +INNER JOIN APC_HUMAN_RESOURCE hr ON u.id_human_resource = hr.id +INNER JOIN APC_HUMAN_RESOURCE_BY_OFFICE hrbo ON hr.id = hrbo.id_human_resource +WHERE u.user_status = 'ENEBLED' and +u.user_type IN ('MOBILE','BOTH'); +-- -------------------------------------------------------------------- +-- +-- Estructura para la vista `APC_TOTAL_CASH_BY_CURDATE_VIEW` +-- +-- Sirve para obtener lo que tiene que entregar el asesor al final del dĆ­a. +-- +CREATE OR REPLACE VIEW `APC_TOTAL_CASH_BY_CURDATE_VIEW` AS +SELECT + u.id, + ubo.id_office, + IF( + (SELECT COUNT(id) FROM APC_CLOSING_DAY WHERE id_user = u.id AND id_office = ubo.id_office AND active_status = 'ENEBLED' AND DATE(created_on) = CURDATE()) = 0 + ,(SELECT IF(ISNULL(SUM(ld.payment_amount)),0, SUM(ld.payment_amount)) + FROM APC_LOAN_DETAIL ld + WHERE + ld.id_user = u.id AND + ld.loan_details_type = 'PAYMENT' AND + DATE(ld.created_on) = CURDATE() + ) + ,0.0 + )AS total_amount_payment, + IF( + (SELECT COUNT(id) FROM APC_CLOSING_DAY WHERE id_user = u.id AND id_office = ubo.id_office AND active_status = 'ENEBLED' AND DATE(created_on) = CURDATE()) = 0 + ,(SELECT IF(ISNULL(SUM(ld.payment_amount)),0, SUM(ld.payment_amount)) + FROM APC_LOAN_DETAIL ld + WHERE + ld.id_user = u.id AND + ld.loan_details_type = 'TRANSFER' AND + DATE(ld.created_on) = CURDATE() + ) + ,0.0 + )AS total_amount_deposit, + IF( + (SELECT COUNT(id) FROM APC_CLOSING_DAY WHERE id_user = u.id AND id_office = ubo.id_office AND active_status = 'ENEBLED' AND DATE(created_on) = CURDATE()) = 0 + ,(SELECT IF(ISNULL(SUM(amount_to_transfer)),0, SUM(amount_to_transfer)) + FROM APC_TRANSFER + WHERE + id_user_transmitter = u.id AND + action_status = 'APPROVED' AND + active_status = 'ENEBLED' AND + DATE(last_updated_on) = CURDATE() + ) + ,0.0 + ) AS transfer_sender, + IF( + (SELECT COUNT(id) FROM APC_CLOSING_DAY WHERE id_user = u.id AND id_office = ubo.id_office AND active_status = 'ENEBLED' AND DATE(created_on) = CURDATE()) = 0 + ,(SELECT IF(ISNULL(SUM(amount_to_transfer)),0, SUM(amount_to_transfer)) + FROM APC_TRANSFER + WHERE + id_user_receiver = u.id AND + action_status = 'APPROVED' AND + active_status = 'ENEBLED' AND + DATE(last_updated_on) = CURDATE() + ) + ,0.0 + ) AS transfer_receiver, + IF( + (SELECT COUNT(id) FROM APC_CLOSING_DAY WHERE id_user = u.id AND id_office = ubo.id_office AND active_status = 'ENEBLED' AND DATE(created_on) = CURDATE()) = 0 + ,(SELECT IF(ISNULL(SUM(amount)),0, SUM(amount)) + FROM APC_MONEY_DAILY + WHERE + id_user = u.id AND + DATE(money_daily_date) = CURDATE() + ) + ,0.0 + ) AS money_daily, + IF( + (SELECT COUNT(id) FROM APC_CLOSING_DAY WHERE id_user = u.id AND id_office = ubo.id_office AND active_status = 'ENEBLED' AND DATE(created_on) = CURDATE()) = 0 + ,(SELECT IF(ISNULL(SUM(expense)),0, SUM(expense)) + FROM APC_OTHER_EXPENSE + WHERE + id_user = u.id AND + DATE(created_on) = CURDATE() + ) + ,0.0 + )AS other_expense, + IF( + (SELECT COUNT(id) FROM APC_CLOSING_DAY WHERE id_user = u.id AND id_office = ubo.id_office AND active_status = 'ENEBLED' AND DATE(created_on) = CURDATE()) = 0 + ,(SELECT IF(ISNULL(SUM(amount)),0, SUM(amount)) + FROM APC_DELIVERY + WHERE + id_user = u.id AND + DATE(created_on) = CURDATE() + ) + , 0.0 + ) as delivery, + IF( + (SELECT COUNT(id) FROM APC_CLOSING_DAY WHERE id_user = u.id AND id_office = ubo.id_office AND active_status = 'ENEBLED' AND DATE(created_on) = CURDATE()) = 0 + ,(SELECT IF(ISNULL(SUM(amount_to_transfer)),0, SUM(amount_to_transfer)) + FROM APC_TRANSFER + WHERE + id_user_receiver = u.id AND + action_status = 'PENDING' AND + active_status = 'ENEBLED' AND + DATE(created_on) = CURDATE() + ) + ,0.0 + ) AS transfer_pending +FROM APC_USER u +JOIN APC_USER_BY_OFFICE ubo ON ubo.id_user = u.id +WHERE + u.user_status = 'ENEBLED'; +-- -------------------------------------------------------------------- +-- +-- Estructura para la vista `APC_TOTAL_LOANS_BY_OFFICE` +-- +-- +CREATE OR REPLACE VIEW `APC_TOTAL_LOANS_BY_OFFICE` AS +SELECT + l.id, + l.loan_status, + r.id_office, + r.route_name, + l.id_route, + l.amount_to_pay, + l.amount_paid + FROM + APC_LOAN l + JOIN + APC_ROUTE r ON r.id = l.id_route + WHERE + l.loan_status in ('PENDING', 'FINISH', 'APPROVED','REJECTED','TO_DELIVERY') + AND r.active_status = 'ENEBLED'; +-- -------------------------------------------------------------------- +-- Estructura para la vista `APC_TOTAL_CLOSING_DAY_BY_CURDATE_VIEW` +-- +-- Sirve para obtener lo que tiene que entregar el asesor al final del dĆ­a. +-- +CREATE OR REPLACE VIEW `APC_TOTAL_CLOSING_DAY_BY_CURDATE_VIEW` AS +SELECT + u.id, + u.id_office, + u.amount_paid +FROM APC_CLOSING_DAY u +WHERE + u.active_status = 'ENEBLED' AND + DATE(u.created_on) = CURDATE(); +-- -------------------------------------------------------------------- +-- Estructura para la vista `APC_CLOSING_DAILY_DETAIL_FROM_USER_BY_CURDATE_VIEW` +-- +-- Sirve para obtener los detalles del total de los cobros realizados por los asesores +-- estos pueden ser tanto pagos como multas. +-- +CREATE OR REPLACE VIEW `APC_CLOSING_DAILY_DETAIL_FROM_USER_BY_CURDATE_VIEW` AS +SELECT + ld.id, + CONCAT(p.first_name,' ',IF(ISNULL(p.second_name) ,'', CONCAT(p.second_name, ' ')),p.last_name,' ', p.middle_name) AS comments, + ld.payment_amount as amount, + CASE + WHEN ld.loan_details_type = 'PAYMENT' THEN 'Abono' + WHEN ld.loan_details_type = 'FEE' THEN 'Multa' + WHEN ld.loan_details_type = 'TRANSFER' THEN 'DepĆ³sito' + ELSE '' END as type, + ld.id_user, + ld.created_on, + l.created_on as fechaFiltro, + 'xxxx' as route, + (l.amount_to_pay - amount_paid) as saldo +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON ld.id_loan = l.id +INNER JOIN APC_PEOPLE p ON l.id_customer = p.id +WHERE DATE(ld.created_on) = CURDATE() +AND ld.loan_details_type in ('PAYMENT', 'FEE', 'TRANSFER' ) +UNION +SELECT + md.id, + DATE(md.money_daily_date) AS comments, + md.amount as amount, + 'Inicio' as type, + md.id_user, + md.created_on, + CURDATE() as fechaFiltro, + 'xxxx' as route, + 0 as saldo +FROM + APC_MONEY_DAILY md +WHERE DATE(md.money_daily_date) = CURDATE() +UNION +SELECT + oe.id, + oe.description, + oe.expense, + 'Gasto', + oe.id_user, + oe.created_on, + CURDATE() as fechaFiltro, + 'xxxx' as route, + 0 as saldo +FROM + APC_OTHER_EXPENSE oe +WHERE DATE(oe.created_on) = CURDATE() +UNION +SELECT + te.id, + CONCAT(hr.first_name,' ',IF(ISNULL(hr.second_name) ,'', CONCAT(hr.second_name, ' ')),hr.last_name,' ', hr.middle_name), + te.amount_to_transfer, + 'Transferencia enviada', + te.id_user_transmitter, + te.created_on, + CURDATE() as fechaFiltro, + 'xxxx' as route, + 0 as saldo +FROM + APC_TRANSFER te +JOIN + APC_USER u on u.id = te.id_user_receiver +JOIN + APC_HUMAN_RESOURCE hr on hr.id = u.id_human_resource +WHERE DATE(te.created_on) = CURDATE() +UNION +SELECT + tr.id, + CONCAT(hr.first_name,' ',IF(ISNULL(hr.second_name) ,'', CONCAT(hr.second_name, ' ')),hr.last_name,' ', hr.middle_name), + tr.amount_to_transfer, + 'Transferencia recibida', + tr.id_user_receiver, + tr.created_on, + CURDATE() as fechaFiltro, + 'xxxx' as route, + 0 as saldo +FROM + APC_TRANSFER tr +JOIN + APC_USER u on u.id = tr.id_user_transmitter +JOIN + APC_HUMAN_RESOURCE hr on hr.id = u.id_human_resource +WHERE DATE(tr.created_on) = CURDATE() +UNION +SELECT + d.id, + CONCAT(p.first_name,' ',IF(ISNULL(p.second_name) ,'', CONCAT(p.second_name, ' ')),p.last_name,' ', p.middle_name, ' - ', + r.route_name , ', Abono prĆ©stamo anterior : ', Case WHEN (SELECT CASE WHEN ld.payment_amount is null or 0 THEN 0 ELSE ld.payment_amount END FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l3 ON ld.id_loan = l3.id +WHERE ld.loan_details_type = 'RENOVATION_PAYMENT' +AND l3.id = (SELECT albr.id_loan_old FROM APC_LOAN_BY_RENOVATION albr WHERE albr.id_loan_new = l.id)) is null then 0 else (SELECT CASE WHEN ld.payment_amount is null or 0 THEN 0 ELSE ld.payment_amount END FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l3 ON ld.id_loan = l3.id +WHERE ld.loan_details_type = 'RENOVATION_PAYMENT' +AND l3.id = (SELECT albr.id_loan_old FROM APC_LOAN_BY_RENOVATION albr WHERE albr.id_loan_new = l.id)) end , ', ComisiĆ³n por apertura: ', lt.opening_fee), + d.amount, + 'Entrega de prĆ©stamo', + d.id_user, + d.created_on, + CURDATE() as fechaFiltro, + r.route_name as route, + CASE WHEN (SELECT (l2.amount_to_pay - l2.amount_paid) FROM APC_LOAN_BY_RENOVATION lr + INNER JOIN APC_LOAN l2 ON l2.id = lr.id_loan_old + WHERE lr.id_loan_new = l.id) is null THEN 0 ELSE + (SELECT (l2.amount_to_pay - l2.amount_paid) FROM APC_LOAN_BY_RENOVATION lr + INNER JOIN APC_LOAN l2 ON l2.id = lr.id_loan_old + WHERE lr.id_loan_new = l.id) END as saldo +FROM APC_DELIVERY d +INNER JOIN APC_LOAN l ON d.id_loan = l.id +INNER JOIN APC_LOAN_TYPE lt ON l.id_loan_type = lt.id +INNER JOIN APC_PEOPLE p ON l.id_customer = p.id +INNER JOIN APC_ROUTE r ON r.id = l.id_route +WHERE DATE(d.created_on) = CURDATE(); +-- -------------------------------------------------------------------- +-- Estructura para la vista `APC_LOAN_APPROVED_DETAIL_VIEW` +-- +-- Sirve para obtener los detalles del total de los prestamos que estan +-- en estatus de APROBADO. +-- +CREATE OR REPLACE VIEW `APC_LOAN_APPROVED_DETAIL_VIEW` AS +SELECT + l.id, + l.amount_to_pay - l.amount_paid AS total_to_pay, + l.amount_to_pay - (l.amount_paid + (SELECT IF(ISNULL(SUM(payment_amount)),0,SUM(payment_amount)) FROM APC_LOAN_DETAIL WHERE id_loan = l.id AND loan_details_type = 'FEE')) AS loan_amount_to_pay, + ( + SELECT + IF(ISNULL(SUM(payment_amount)),0,SUM(payment_amount)) + FROM APC_LOAN_DETAIL + WHERE + id_loan = l.id AND + loan_details_type = 'FEE' + )AS total_fee +FROM APC_LOAN l +WHERE l.loan_status = 'APPROVED'; +-- -------------------------------------------------------------------- +-- Estructura para la vista `APC_GENERAL_BOX_VIEW` +-- +CREATE OR REPLACE VIEW `APC_GENERAL_BOX_VIEW` AS +SELECT + md.id, + CONCAT(hr.first_name,' ',IF(ISNULL(hr.second_name) ,'', CONCAT(hr.second_name, ' ')),hr.last_name,' ', hr.middle_name) AS comments, + Date(md.money_daily_date) as fecha, + md.amount as amount, + md.id_office as office, + 'Inicio' as type +FROM APC_MONEY_DAILY md +JOIN + APC_USER u on u.id = md.id_user +JOIN + APC_HUMAN_RESOURCE hr on hr.id = u.id_human_resource +UNION +SELECT + cd.id, + CONCAT(hr.first_name,' ',IF(ISNULL(hr.second_name) ,'', CONCAT(hr.second_name, ' ')),hr.last_name,' ', hr.middle_name) AS comments, + Date(cd.created_on), + cd.amount_paid, + cd.id_office, + 'Corte del dĆ­a' +FROM APC_CLOSING_DAY cd +JOIN + APC_USER u on u.id = cd.id_user +JOIN + APC_HUMAN_RESOURCE hr on hr.id = u.id_human_resource +WHERE cd.active_status = 'ENEBLED' +UNION +SELECT + ecin.id, + ecin.description, + date(ecin.created_on), + ecin.amount, + ecin.id_office, + 'Entrada' +FROM APC_EXPENSE_COMPANY as ecin +WHERE ecin.expense_company_type = 'PAYMENT_IN' +AND ecin.active_status = 'ENEBLED' +UNION +SELECT + ecin.id, + ecin.description, + date(ecin.created_on), + ecin.amount, + ecin.id_office, + 'Salida' +FROM APC_EXPENSE_COMPANY as ecin +WHERE ecin.expense_company_type = 'PAYMENT_OUT' +AND ecin.active_status = 'ENEBLED' +UNION +SELECT + a.id, + CONCAT(hr.first_name,' ',IF(ISNULL(hr.second_name) ,'', CONCAT(hr.second_name, ' ')),hr.last_name,' ', hr.middle_name) AS comments, + date(a.created_on), + a.amount, + a.id_office, + 'Adelanto' +FROM + APC_ADVANCE a +JOIN + APC_HUMAN_RESOURCE hr on hr.id = a.id_human_resource +WHERE + a.active_status = 'ENEBLED' +UNION +SELECT + pay.id, + CONCAT(hr.first_name,' ',IF(ISNULL(hr.second_name) ,'', CONCAT(hr.second_name, ' ')),hr.last_name,' ', hr.middle_name) AS comments, + date(pay.created_on), + pay.total_payment, + pay.id_office, + 'Nomina' +FROM + APC_PAYROLL pay +JOIN + APC_HUMAN_RESOURCE hr on hr.id = pay.id_human_resource +WHERE + pay.active_status = 'ENEBLED'; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_LOAN` +-- +-- MODUFY COLUMN loan_status +-- +ALTER TABLE APC_LOAN +MODIFY COLUMN `loan_status` ENUM('PENDING', 'FINISH','BLACK_LIST', 'APPROVED','REJECTED', 'PENDING_RENOVATION', 'TO_DELIVERY', 'DELETED') NOT NULL DEFAULT 'PENDING'; + +ALTER TABLE APC_LOAN_BY_USER +MODIFY COLUMN `loan_by_user_status` ENUM('PENDING', 'FINISH','BLACK_LIST', 'APPROVED','REJECTED', 'PENDING_RENOVATION', 'TO_DELIVERY', 'DELETED') NOT NULL DEFAULT 'PENDING'; + +-- +-- Estructura para la vista `APC_LOAN_BY_USER_PAYMENT_ZERO_VIEW` +-- +-- Total de abonos en ceros por dia. +-- +CREATE OR REPLACE VIEW `APC_LOAN_BY_USER_PAYMENT_ZERO_VIEW` AS +SELECT + ald.id, + ald.id_user, + al.id_customer, + ald.loan_comments +FROM APC_LOAN_DETAIL ald +INNER JOIN APC_LOAN al ON ald.id_loan = al.id +WHERE + DATE(ald.created_on) = CURDATE() + AND ald.payment_amount = 0 + AND al.loan_status != 'DELETED' + AND ald.loan_details_type = 'PAYMENT'; +-- +-- Estructura para la tabla `APC_PAYROLL` +-- +-- Totales de la caja de APC. +-- +CREATE TABLE `APC_PAYROLL`( + `id` char(36) NOT NULL, + `active_status` ENUM('ENEBLED', 'DISABLED') NOT NULL DEFAULT 'ENEBLED', + `id_office` char(36) NOT NULL, + `id_human_resource` char(36) NOT NULL, + `salary` numeric(8,2) NOT NULL, + `imss` numeric(8,2) NOT NULL, + `advance` numeric(8,2) NOT NULL, + `total_bonus_new_customer` numeric(8,2) NOT NULL, + `total_bonus_colocation` numeric(8,2) NOT NULL, + `total_bonus_mora` numeric(8,2) NOT NULL, + `discounts` numeric(8,2) NOT NULL, + `increases` numeric(8,2) NOT NULL, + `total_payment` numeric(8,2) NOT NULL, + `total_days_salary` smallint NOT NULL DEFAULT 5, + `total_days_bonus` smallint NOT NULL DEFAULT 5, + `comments_discounts` varchar(200), + `comments_increases` varchar(200), + `observation` varchar(200), + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_payroll_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_payroll_to_apc_office_fk` + FOREIGN KEY (`id_office`) REFERENCES `APC_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_payroll_to_apc_human_resource_fk` + FOREIGN KEY (`id_human_resource`) REFERENCES `APC_HUMAN_RESOURCE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE OR REPLACE VIEW `APC_ADVANCE_USER_DAILY_VIEW` AS +SELECT + ate.id, + CONCAT(ahr.first_name, ' ' , ahr.last_name) as user_name, + ate.total_expected, + (ate.total_expected - (SELECT COUNT(id) FROM APC_LOAN_BY_USER_VIEW where user_id = ate.id_user)) as total_now, + CASE WHEN (ate.total_expected - (SELECT COUNT(id) FROM APC_LOAN_BY_USER_VIEW where user_id = ate.id_user)) = 0 + THEN 0 + ELSE + ((ate.total_expected - (SELECT COUNT(id) FROM APC_LOAN_BY_USER_VIEW where user_id = ate.id_user)) * 100) / ate.total_expected + END + as porcentaje, + ate.id_office, + ate.id_user, + (SELECT IF(ISNULL(SUM(ate2.total_expected_payment)),0,SUM(ate2.total_expected_payment)) FROM APC_TOTAL_EXPECTED_PAYMENT_DAILY_BY_USER ate2 + where WEEK(DATE(ate2.created_on),1) = (Select WEEK(CURDATE(),1)) and YEAR(DATE(ate2.created_on)) = (SELECT YEAR(CURDATE())) AND ate2.id_user = ate.id_user) + as total_expected_week, + (SELECT IF(ISNULL(SUM(ald.payment_amount)),0,SUM(ald.payment_amount)) FROM APC_LOAN_DETAIL ald + where WEEK(Date(ald.created_on),1) = (Select WEEK(CURDATE(),1)) and YEAR(Date(ald.created_on)) = (SELECT YEAR(CURDATE())) AND ald.id_user = ate.id_user + AND ald.loan_details_type IN ('PAYMENT', 'RENOVATION_PAYMENT', 'TRANSFER')) + as total_reported_week, + (SELECT IF(ISNULL(SUM(ailwv.faltante)),0,SUM(ailwv.faltante)) FROM APC_INFORMATION_LOAN_WEEK_VIEW ailwv + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = ailwv.id + WHERE albu.id_user = ate.id_user) as faltante, + (SELECT IF(ISNULL(SUM(ald.payment_amount)),0,SUM(ald.payment_amount)) + FROM APC_LOAN_DETAIL ald + INNER JOIN APC_LOAN al ON ald.id_loan = al.id + INNER JOIN APC_LOAN_BY_USER albu ON al.id = albu.id_loan + where WEEK(Date(ald.created_on),1) = (Select WEEK(CURDATE(),1)) and YEAR(Date(ald.created_on)) = (SELECT YEAR(CURDATE())) + AND ald.loan_details_type IN ('RENOVATION_PAYMENT') AND albu.id_user = ate.id_user) as total_reported_renovation_week, + (SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) + FROM APC_LOAN al + INNER JOIN APC_LOAN_BY_USER albu ON al.id = albu.id_loan + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + WHERE albu.id_user = ate.id_user AND al.loan_status = 'APPROVED' AND + WEEK(Date(al.created_on),1) = (Select WEEK(CURDATE(),1)) and YEAR(Date(al.created_on)) = (SELECT YEAR(CURDATE())) + ) as total_comision_fee, + (SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = ate.id_user + AND WEEK(DATE(al.created_on),1) = WEEK(CURDATE(),1) AND + YEAR(Date(al.created_on)) = (SELECT YEAR(CURDATE()))) + as colocation_approved, + (SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'TO_DELIVERY' AND albu.id_user = ate.id_user + AND WEEK(DATE(al.created_on),1) = WEEK(CURDATE(),1) AND + YEAR(Date(al.created_on)) = (SELECT YEAR(CURDATE()))) + as colocation_to_delivery +FROM + APC_TOTAL_EXPECTED_PAYMENT_DAILY_BY_USER ate +INNER JOIN APC_USER au ON au.id = ate.id_user +INNER JOIN APC_HUMAN_RESOURCE ahr ON ahr.id = au.id_human_resource +WHERE + DATE(ate.created_on) = CURDATE() + AND ate.active_status = 'ENEBLED'; + +CREATE OR REPLACE VIEW `APC_CUSTOMERS_WITHOUT_RENOVATION_VIEW` AS +SELECT + p.id, + CONCAT(p.first_name,' ', IF(ISNULL(p.second_name) ,'', CONCAT(p.second_name,' ')) ,p.last_name, ' ', p.middle_name) AS available_person, + ar.route_name, + (SELECT MAX(l.created_on) FROM APC_LOAN l WHERE l.id_customer = p.id) as last_loan, + p.id_office +FROM APC_PEOPLE p +INNER JOIN APC_ROUTE ar ON ar.id = p.id_route +WHERE + p.people_type IN ('CUSTOMER', 'BOTH') AND + p.active_status = 'ENEBLED' AND + (SELECT COUNT(l.id) FROM APC_LOAN l WHERE l.id_customer = p.id) > 0 AND + CASE + WHEN 0 = ( + SELECT COUNT(id) + FROM APC_LOAN + WHERE + id_customer = p.id AND + loan_status IN ('PENDING', 'BLACK_LIST', 'APPROVED', 'PENDING_RENOVATION', 'TO_DELIVERY') + ) + THEN TRUE + ELSE FALSE + END +ORDER BY available_person; + +CREATE OR REPLACE VIEW `APC_ADVANCE_USER_DAILY_DETAIL_VIEW` AS +SELECT +ald.id, +ald.id_user, +CONCAT(ap.first_name, + ' ', + ap.last_name) AS customer_name, +ald.payment_amount, +ald.created_on, +ap.address_business, +CASE + WHEN ald.loan_details_type = 'PAYMENT' THEN 'Abono' + WHEN ald.loan_details_type = 'FEE' THEN 'Multa' + WHEN ald.loan_details_type = 'TRANSFER' THEN 'DepĆ³sito' + ELSE '' END as type_ayment +FROM APC_LOAN_DETAIL ald +INNER JOIN APC_LOAN al ON al.id = ald.id_loan +INNER JOIN APC_PEOPLE ap ON ap.id = al.id_customer +WHERE DATE(ald.created_on) = CURDATE() AND +al.loan_status != 'DELETED' AND +ald.loan_details_type IN ('PAYMENT','FEE','TRANSFER') +UNION +SELECT +id, +user_id, +customer_name, +'Sin visita', +CURDATE(), +customer_address_business, +'Sin visita' +FROM APC_LOAN_BY_USER_VIEW; + +CREATE TABLE `APC_CLOSING_DAY_DETAIL`( + `id` char(36) NOT NULL, + `id_closing_day` char(36) NOT NULL, + `comments` varchar(200) NOT NULL, + `amount` numeric(8,2) NOT NULL, + `type` varchar(200) NOT NULL, + `dateDetail` datetime, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_closing_day_detail_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_closing_day_detail_to_apc_closing_day_fk` + FOREIGN KEY (`id_closing_day`) REFERENCES `APC_CLOSING_DAY`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE OR REPLACE VIEW `APC_TOTAL_LOANS_APPROVED_BY_OFFICE` AS +SELECT + l.id, + l.loan_status, + r.id_office, + r.payment_daily + FROM + APC_LOAN l + JOIN + APC_LOAN_TYPE r ON r.id = l.id_loan_type + WHERE + l.loan_status in ('APPROVED'); + +CREATE OR REPLACE VIEW `APC_TOTAL_CASH_BY_CURDATE_DASHBOARD_VIEW` AS +SELECT + u.id, + ubo.id_office, + (SELECT IF(ISNULL(SUM(ld.payment_amount)),0, SUM(ld.payment_amount)) + FROM APC_LOAN_DETAIL ld + WHERE + ld.id_user = u.id AND + ld.loan_details_type = 'PAYMENT' AND + DATE(ld.created_on) = CURDATE() + + )AS total_amount_payment, + (SELECT IF(ISNULL(SUM(ld.payment_amount)),0, SUM(ld.payment_amount)) + FROM APC_LOAN_DETAIL ld + WHERE + ld.id_user = u.id AND + ld.loan_details_type = 'TRANSFER' AND + DATE(ld.created_on) = CURDATE() + + )AS total_amount_deposit, + (SELECT IF(ISNULL(SUM(amount_to_transfer)),0, SUM(amount_to_transfer)) + FROM APC_TRANSFER + WHERE + id_user_transmitter = u.id AND + action_status = 'APPROVED' AND + active_status = 'ENEBLED' AND + DATE(last_updated_on) = CURDATE() + )AS transfer_sender, + (SELECT IF(ISNULL(SUM(amount_to_transfer)),0, SUM(amount_to_transfer)) + FROM APC_TRANSFER + WHERE + id_user_receiver = u.id AND + action_status = 'APPROVED' AND + active_status = 'ENEBLED' AND + DATE(last_updated_on) = CURDATE() + ) AS transfer_receiver, + (SELECT IF(ISNULL(SUM(amount)),0, SUM(amount)) + FROM APC_MONEY_DAILY + WHERE + id_user = u.id AND + DATE(money_daily_date) = CURDATE() + ) AS money_daily, + (SELECT IF(ISNULL(SUM(expense)),0, SUM(expense)) + FROM APC_OTHER_EXPENSE + WHERE + id_user = u.id AND + DATE(created_on) = CURDATE() + ) AS other_expense, + (SELECT IF(ISNULL(SUM(amount)),0, SUM(amount)) + FROM APC_DELIVERY + WHERE + id_user = u.id AND + DATE(created_on) = CURDATE() + ) as delivery, + (SELECT IF(ISNULL(SUM(amount_to_transfer)),0, SUM(amount_to_transfer)) + FROM APC_TRANSFER + WHERE + id_user_receiver = u.id AND + action_status = 'PENDING' AND + active_status = 'ENEBLED' AND + DATE(created_on) = CURDATE() + ) AS transfer_pending +FROM APC_USER u +JOIN APC_USER_BY_OFFICE ubo ON ubo.id_user = u.id +WHERE + u.user_status = 'ENEBLED'; + +CREATE OR REPLACE VIEW `APC_MONEY_DAILY_BY_USER_CERTIFIER_VIEW` AS +SELECT + u.id, + u.user_name, + uo.id_office, + CONCAT(hr.first_name, ' ' , hr.last_name) as employee, + (SELECT SUM(ldc.amount_to_delivery) FROM APC_LOAN_TO_DELIVERY_BY_CERTIFIER_VIEW ldc + WHERE ldc.id_user = u.id) as amount +FROM + APC_USER u +INNER JOIN + APC_USER_BY_OFFICE uo ON u.id = uo.id_user +INNER JOIN + APC_HUMAN_RESOURCE hr ON u.id_human_resource = hr.id +WHERE + u.user_status = 'ENEBLED' +AND + u.certifier = 'ENEBLED'; +-- -------------------------------------------------------- +-- +-- Alter table to `APC_LOAN_DETAIL` +-- +-- Add new loan details status to save transfer payments. +-- +ALTER TABLE APC_LOAN_DETAIL +MODIFY COLUMN `loan_details_type` ENUM('CREDIT_PAYMENT', 'DEBIT_PAYMENT', 'PAYMENT', 'FEE','RENOVATION_PAYMENT', 'TRANSFER') NOT NULL; + +ALTER TABLE APC_TOTAL_EXPECTED_PAYMENT_DAILY_BY_USER +ADD COLUMN `total_expected_payment` numeric(8,2) default null; + +CREATE OR REPLACE VIEW `APC_INFORMATION_LOAN_WEEK_VIEW` AS +SELECT +l.id, +u.id as id_user, +r.id_office, +l.created_on as fecha, +lt.payment as apoyos, +lt.payment_total as apoyos_total, +lt.opening_fee as comision_apertura, +CONCAT(endor.first_name,' ', IF(ISNULL(endor.second_name) ,'', CONCAT(endor.second_name,' ')) ,endor.last_name, ' ', endor.middle_name) AS aval, +CONCAT(cus.first_name,' ', IF(ISNULL(cus.second_name) ,'', CONCAT(cus.second_name,' ')) ,cus.last_name, ' ', cus.middle_name) AS customer, +l.amount_to_pay as documento_por, +lt.payment_daily as abono_diario, +l.amount_paid, +(l.amount_to_pay - l.amount_paid) saldo_insoluto, +r.route_name, +CONCAT(hr.first_name,' ', IF(ISNULL(hr.second_name) ,'', CONCAT(hr.second_name,' ')) ,hr.last_name, ' ', hr.middle_name) AS asesor, +(SELECT COUNT(lfn.id) FROM APC_LOAN_FEE_NOTIFICATION lfn WHERE lfn.id_loan = l.id) as num_fee, +-- Lunes +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'monday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_monday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'monday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_monday, +-- Martes +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'tuesday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_tuesday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'tuesday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_tuesday, +-- Miercoles +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) +AND YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'wednesday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_wednesday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'wednesday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_wednesday, +-- Jueves +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'thursday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_thursday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'thursday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_thursday, +-- Viernes +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'friday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_friday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'friday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_friday, +-- Sabado +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'saturday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_saturday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'saturday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_saturday, + +((lt.payment_daily * (SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) > 5, 5 , COUNT(DISTINCT(DATE(ldFaltante.created_on)))) FROM APC_LOAN_DETAIL ldFaltante +WHERE ldFaltante.id_loan = l.id AND WEEK(DATE(ldFaltante.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldFaltante.created_on)) = YEAR(CURDATE()) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('saturday','sunday') +AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER', 'FEE'))) +- (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER'))) as faltante, + +CASE WHEN l.new_customer = 'ENEBLED' THEN 'Si' ELSE 'No' END as new_customer, +if((SELECT COUNT(id_loan_old) FROM APC_LOAN_BY_RENOVATION lbr +INNER JOIN APC_LOAN lRenovation ON lbr.id_loan_new = lRenovation.id +WHERE id_loan_old = l.id + AND loan_by_renovation_status = 'APPROVED' and WEEK(DATE(lRenovation.created_on),1) <= WEEK(CURDATE(),1) AND + YEAR(DATE(lRenovation.created_on)) = YEAR(CURDATE())) = 0 , 'No' , 'Si') as renovation, +l.loan_status as estatus_prestamo, +(SELECT COUNT(DISTINCT(DATE(ldFaltante.created_on))) FROM APC_LOAN_DETAIL ldFaltante +WHERE ldFaltante.id_loan = l.id AND WEEK(DATE(ldFaltante.created_on),1) <= (WEEK(CURDATE(),1)) AND +YEAR(DATE(ldFaltante.created_on)) = YEAR(CURDATE()) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('saturday','sunday') +AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER', 'FEE')) as num_pagos_all, +(SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) > 5, 5, COUNT(DISTINCT(DATE(ldFaltante.created_on)))) FROM APC_LOAN_DETAIL ldFaltante +WHERE ldFaltante.id_loan = l.id AND WEEK(DATE(ldFaltante.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ldFaltante.created_on)) = YEAR(CURDATE()) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('saturday','sunday') +AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER', 'FEE')) as num_pagos_week, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) <= (WEEK(CURDATE(),1)) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND ldLunes.loan_details_type IN ('FEE')) as fee_todos +FROM +APC_LOAN l +INNER JOIN APC_LOAN_TYPE lt ON l.id_loan_type = lt.id +INNER JOIN APC_PEOPLE cus ON cus.id = l.id_customer +INNER JOIN APC_PEOPLE endor ON endor.id = l.id_endorsement +INNER JOIN APC_ROUTE r ON r.id = l.id_route +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +INNER JOIN APC_USER u ON u.id = lbu.id_user +INNER JOIN APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource +WHERE +l.loan_status not in ('DELETED','REJECTED') AND +(SELECT COUNT(ld.id) FROM APC_LOAN_DETAIL ld WHERE WEEK(DATE(ld.created_on),1) = WEEK(CURDATE(),1) AND + YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.id_loan = l.id) > 0; +-- -------------------------------------------------------- +-- +-- Estructura para la vista `APC_USER_BY_ROUTE_VIEW` +-- +-- Se utiliza para identificar a los usuarios por rutas. +-- +CREATE OR REPLACE VIEW `APC_USER_BY_ROUTE_VIEW` AS +SELECT +CONCAT(u.id,hrhr.id_route) AS id, +u.id AS id_user, +hrhr.id_route AS id_route, + CONCAT( + CASE + WHEN hr.first_name IS NOT NULL AND hr.first_name != '' + THEN CONCAT(SUBSTR(UPPER(hr.first_name), 1, 1),SUBSTR(LOWER(hr.first_name), 2)) + ELSE '' + END, + CASE + WHEN hr.second_name IS NOT NULL AND hr.second_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(hr.second_name), 1, 1),SUBSTR(LOWER(hr.second_name), 2)) + ELSE '' + END, + CASE + WHEN hr.last_name IS NOT NULL AND hr.last_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(hr.last_name), 1, 1),SUBSTR(LOWER(hr.last_name), 2)) + ELSE '' + END, + CASE + WHEN hr.middle_name IS NOT NULL AND hr.middle_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(hr.middle_name), 1, 1),SUBSTR(LOWER(hr.middle_name), 2)) + ELSE '' + END + ) AS employee_name +FROM APC_HUMAN_RESOURCE_HAS_ROUTE hrhr +INNER JOIN APC_HUMAN_RESOURCE hr ON hrhr.id_human_resource = hr.id +INNER JOIN APC_USER u ON hr.id = u.id_human_resource +WHERE u.user_status = 'ENEBLED' AND +u.user_type IN ('MOBILE','BOTH') +ORDER BY employee_name; + +CREATE OR REPLACE VIEW `APC_LOAN_DIFERENCES_BY_USER_LAST_WEEK_VIEW` AS +SELECT +l.id, +lbu.id_user, +((lt.payment_daily * 5) - (SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +WHERE ld.id_loan = l.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) +AND YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER'))) + as faltante +FROM + APC_LOAN l +INNER JOIN + APC_LOAN_TYPE lt ON l.id_loan_type = lt.id +INNER JOIN + APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE +l.loan_status not in ('DELETED','REJECTED') AND +(SELECT COUNT(ld2.id) FROM APC_LOAN_DETAIL ld2 WHERE WEEK(DATE(ld2.created_on),1) = (WEEK(CURDATE(),1)-1) +AND YEAR(DATE(ld2.created_on)) = YEAR(CURDATE()) AND ld2.id_loan = l.id) > 4; + +CREATE OR REPLACE VIEW `APC_INFORMATION_LOAN_LAST_WEEK_VIEW` AS +SELECT +l.id, +u.id as id_user, +r.id_office, +l.created_on as fecha, +lt.payment as apoyos, +lt.payment_total as apoyos_total, +lt.opening_fee as comision_apertura, +CONCAT(endor.first_name,' ', IF(ISNULL(endor.second_name) ,'', CONCAT(endor.second_name,' ')) ,endor.last_name, ' ', endor.middle_name) AS aval, +CONCAT(cus.first_name,' ', IF(ISNULL(cus.second_name) ,'', CONCAT(cus.second_name,' ')) ,cus.last_name, ' ', cus.middle_name) AS customer, +l.amount_to_pay as documento_por, +lt.payment_daily as abono_diario, +l.amount_paid, +(l.amount_to_pay - l.amount_paid) saldo_insoluto, +r.route_name, +CONCAT(hr.first_name,' ', IF(ISNULL(hr.second_name) ,'', CONCAT(hr.second_name,' ')) ,hr.last_name, ' ', hr.middle_name) AS asesor, +(SELECT COUNT(lfn.id) FROM APC_LOAN_FEE_NOTIFICATION lfn WHERE lfn.id_loan = l.id) as num_fee, +-- Lunes +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'monday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_monday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'monday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_monday, +-- Martes +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'tuesday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_tuesday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'tuesday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_tuesday, +-- Miercoles +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'wednesday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_wednesday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'wednesday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_wednesday, +-- Jueves +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'thursday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_thursday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'thursday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_thursday, +-- Viernes +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'friday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_friday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'friday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_friday, +-- Sabado +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'saturday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_saturday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'saturday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_saturday, + +((lt.payment_daily * (SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) > 5, 5, COUNT(DISTINCT(DATE(ldFaltante.created_on)))) FROM APC_LOAN_DETAIL ldFaltante +WHERE ldFaltante.id_loan = l.id AND WEEK(DATE(ldFaltante.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldFaltante.created_on)) = YEAR(CURDATE()) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('saturday','sunday') +AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER', 'FEE'))) +- (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER'))) as faltante, + +CASE WHEN l.new_customer = 'ENEBLED' THEN 'Si' ELSE 'No' END as new_customer, +(SELECT IF(COUNT(id_loan_old) = 0 , 'No' , 'Si') FROM APC_LOAN_BY_RENOVATION lbr +INNER JOIN APC_LOAN lRenovation ON lbr.id_loan_new = lRenovation.id +WHERE id_loan_old = l.id + AND loan_by_renovation_status = 'APPROVED' and WEEK(DATE(lRenovation.created_on),1) <= (WEEK(CURDATE(),1) - 1) AND + YEAR(DATE(lRenovation.created_on)) = YEAR(CURDATE())) as renovation, +l.loan_status as estatus_prestamo, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as abono_semana_actual, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND ldLunes.loan_details_type IN ('FEE')) as fee_semana_actual, +(SELECT COUNT(DISTINCT(DATE(ldFaltante.created_on))) FROM APC_LOAN_DETAIL ldFaltante +WHERE ldFaltante.id_loan = l.id AND WEEK(DATE(ldFaltante.created_on),1) <= (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldFaltante.created_on)) = YEAR(CURDATE()) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('saturday','sunday') +AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER', 'FEE')) as num_pagos_all, +(SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) > 5, 5, COUNT(DISTINCT(DATE(ldFaltante.created_on)))) FROM APC_LOAN_DETAIL ldFaltante +WHERE ldFaltante.id_loan = l.id AND WEEK(DATE(ldFaltante.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldFaltante.created_on)) = YEAR(CURDATE()) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('saturday','sunday') +AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER', 'FEE')) as num_pagos_week, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) <= (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND ldLunes.loan_details_type IN ('FEE')) as fee_todos +FROM +APC_LOAN l +INNER JOIN APC_LOAN_TYPE lt ON l.id_loan_type = lt.id +INNER JOIN APC_PEOPLE cus ON cus.id = l.id_customer +INNER JOIN APC_PEOPLE endor ON endor.id = l.id_endorsement +INNER JOIN APC_ROUTE r ON r.id = l.id_route +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +INNER JOIN APC_USER u ON u.id = lbu.id_user +INNER JOIN APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource +WHERE +l.loan_status not in ('DELETED','REJECTED') AND +(SELECT COUNT(ld.id) FROM APC_LOAN_DETAIL ld WHERE WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) +AND YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.id_loan = l.id) > 0; + +CREATE OR REPLACE VIEW `APC_COLOCATION_WEEK_BY_USER_VIEW` AS +SELECT +u.id, +CONCAT(hr.first_name, ' ' , hr.last_name) as username, +ubo.id_office, +(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND al.created_by = u.id + AND WEEK(DATE(al.created_on),1) = WEEK(CURDATE(),1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'monday') + as colocation_monday, +(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND al.created_by = u.id + AND WEEK(DATE(al.created_on),1) = WEEK(CURDATE(),1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'tuesday') + as colocation_tuesday, +(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND al.created_by = u.id + AND WEEK(DATE(al.created_on),1) = WEEK(CURDATE(),1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'wednesday') + as colocation_wednesday, +(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND al.created_by = u.id + AND WEEK(DATE(al.created_on),1) = WEEK(CURDATE(),1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'thursday') + as colocation_thursday, +(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND al.created_by = u.id + AND WEEK(DATE(al.created_on),1) = WEEK(CURDATE(),1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'friday') + as colocation_friday, +(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND al.created_by = u.id + AND WEEK(DATE(al.created_on),1) = WEEK(CURDATE(),1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'saturday') + as colocation_saturday, +(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND al.created_by = u.id + AND WEEK(DATE(al.created_on),1) = WEEK(CURDATE(),1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE())) + as colocation_total +FROM APC_USER u +INNER JOIN APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource +INNER JOIN APC_USER_BY_OFFICE ubo ON ubo.id_user = u.id +WHERE u.user_status = 'ENEBLED' AND +u.user_type IN ('MOBILE') AND +u.certifier = 'DISABLED'; + +CREATE OR REPLACE VIEW `APC_COLOCATION_LAST_WEEK_BY_USER_VIEW` AS +SELECT +u.id, +CONCAT(hr.first_name, ' ' , hr.last_name) as username, +ubo.id_office, +(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND al.created_by = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1)-1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'monday') + as colocation_monday, +(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND al.created_by = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1)-1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'tuesday') + as colocation_tuesday, +(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND al.created_by = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1)-1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'wednesday') + as colocation_wednesday, +(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND al.created_by = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1)-1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'thursday') + as colocation_thursday, +(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND al.created_by = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1)-1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'friday') + as colocation_friday, +(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND al.created_by = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1)-1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'saturday') + as colocation_saturday, +(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND al.created_by = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1)-1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE())) + as colocation_total +FROM APC_USER u +INNER JOIN APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource +INNER JOIN APC_USER_BY_OFFICE ubo ON ubo.id_user = u.id +WHERE u.user_status = 'ENEBLED' AND +u.user_type IN ('MOBILE') AND +u.certifier = 'DISABLED'; + + +CREATE OR REPLACE VIEW `APC_SUBTOTAL_LAST_WEEK_BY_USER_VIEW` AS +SELECT +u.id, +CONCAT(hr.first_name, ' ' , hr.last_name) as username, +ubo.id_office, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'monday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_monday, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'monday') + as opening_fee_monday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'tuesday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_tuesday, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'tuesday') + as opening_fee_tuesday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'wednesday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_wednesday, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'wednesday') + as opening_fee_wednesday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'thursday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_thursday, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'thursday') + as opening_fee_thursday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'friday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_friday, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'friday') + as opening_fee_friday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'saturday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_saturday, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'saturday') + as opening_fee_saturday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_total, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) ) + as opening_fee_total +FROM APC_USER u +INNER JOIN APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource +INNER JOIN APC_USER_BY_OFFICE ubo ON ubo.id_user = u.id +WHERE u.user_status = 'ENEBLED' AND +u.user_type IN ('MOBILE') AND +u.certifier = 'DISABLED'; + +CREATE OR REPLACE VIEW `APC_SUBTOTAL_WEEK_BY_USER_VIEW` AS +SELECT +u.id, +CONCAT(hr.first_name, ' ' , hr.last_name) as username, +ubo.id_office, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'monday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_monday, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1)) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'monday') + as opening_fee_monday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'tuesday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_tuesday, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1)) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'tuesday') + as opening_fee_tuesday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'wednesday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_wednesday, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1)) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'wednesday') + as opening_fee_wednesday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'thursday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_thursday, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1)) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'thursday') + as opening_fee_thursday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'friday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_friday, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1)) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'friday') + as opening_fee_friday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'saturday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_saturday, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1)) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'saturday') + as opening_fee_saturday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_total, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1)) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) ) + as opening_fee_total +FROM APC_USER u +INNER JOIN APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource +INNER JOIN APC_USER_BY_OFFICE ubo ON ubo.id_user = u.id +WHERE u.user_status = 'ENEBLED' AND +u.user_type IN ('MOBILE') AND +u.certifier = 'DISABLED'; +-- -------------------------------------------------------------------- +-- +-- Estructura para la vista `APC_CURRENT_CUSTOMER_BY_LOAN_VIEW` +-- SIRVE PARA TRAER LOS PRESTAMOS CON SUS CLIENTES, AVALES Y ASESORES. +-- +-- -------------------------------------------------------------------- +CREATE OR REPLACE VIEW `APC_CURRENT_CUSTOMER_BY_LOAN_VIEW` AS +SELECT +loan.id AS id_loan, +usr.id AS id_user, +usr_by_office.id_office AS id_office, +loan_type.payment AS payment, +CONCAT( + CASE + WHEN customer.first_name IS NOT NULL AND customer.first_name != '' + THEN CONCAT(SUBSTR(UPPER(customer.first_name), 1, 1),SUBSTR(LOWER(customer.first_name), 2)) + ELSE '' + END, + CASE + WHEN customer.second_name IS NOT NULL AND customer.second_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(customer.second_name), 1, 1),SUBSTR(LOWER(customer.second_name), 2)) + ELSE '' + END, + CASE + WHEN customer.last_name IS NOT NULL AND customer.last_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(customer.last_name), 1, 1),SUBSTR(LOWER(customer.last_name), 2)) + ELSE '' + END, + CASE + WHEN customer.middle_name IS NOT NULL AND customer.middle_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(customer.middle_name), 1, 1),SUBSTR(LOWER(customer.middle_name), 2)) + ELSE '' + END + ) AS customer_name, + CONCAT( + CASE + WHEN endorsement.first_name IS NOT NULL AND endorsement.first_name != '' + THEN CONCAT(SUBSTR(UPPER(endorsement.first_name), 1, 1),SUBSTR(LOWER(endorsement.first_name), 2)) + ELSE '' + END, + CASE + WHEN endorsement.second_name IS NOT NULL AND endorsement.second_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(endorsement.second_name), 1, 1),SUBSTR(LOWER(endorsement.second_name), 2)) + ELSE '' + END, + CASE + WHEN endorsement.last_name IS NOT NULL AND endorsement.last_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(endorsement.last_name), 1, 1),SUBSTR(LOWER(endorsement.last_name), 2)) + ELSE '' + END, + CASE + WHEN endorsement.middle_name IS NOT NULL AND endorsement.middle_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(endorsement.middle_name), 1, 1),SUBSTR(LOWER(endorsement.middle_name), 2)) + ELSE '' + END + ) AS endorsement_name, + loan.loan_status AS loan_status, + loan.created_on AS created_on, + route.route_name AS route_name +FROM APC_LOAN loan +INNER JOIN APC_PEOPLE customer ON loan.id_customer = customer.id +INNER JOIN APC_PEOPLE endorsement ON loan.id_endorsement = endorsement.id +INNER JOIN APC_LOAN_TYPE loan_type ON loan.id_loan_type = loan_type.id +INNER JOIN APC_LOAN_BY_USER loan_by_user ON loan.id = loan_by_user.id_loan +INNER JOIN APC_USER usr ON loan_by_user.id_user = usr.id +INNER JOIN APC_USER_BY_OFFICE usr_by_office ON usr.id = usr_by_office.id_user +INNER JOIN APC_ROUTE route ON loan.id_route = route.id +WHERE loan.loan_status IN('APPROVED','PENDING','PENDING_RENOVATION','TO_DELIVERY') +ORDER BY usr.id, loan.created_on; +-- -------------------------------------------------------------------- +-- +-- Estructura para la vista `APC_AVAILABLES_OWNERS_VIEW` +-- REGRESA LOS USUARIOS ACTIVOS DE TIPO MOBILE AND BOTH. +-- +-- -------------------------------------------------------------------- +CREATE OR REPLACE VIEW `APC_AVAILABLES_OWNERS_VIEW` AS +SELECT +usr.id AS id_user, +usr_by_office.id_office AS id_office, +usr.user_name AS user_name, +CONCAT( + CASE + WHEN human_resource.first_name IS NOT NULL AND human_resource.first_name != '' + THEN CONCAT(SUBSTR(UPPER(human_resource.first_name), 1, 1),SUBSTR(LOWER(human_resource.first_name), 2)) + ELSE '' + END, + CASE + WHEN human_resource.second_name IS NOT NULL AND human_resource.second_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(human_resource.second_name), 1, 1),SUBSTR(LOWER(human_resource.second_name), 2)) + ELSE '' + END, + CASE + WHEN human_resource.last_name IS NOT NULL AND human_resource.last_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(human_resource.last_name), 1, 1),SUBSTR(LOWER(human_resource.last_name), 2)) + ELSE '' + END, + CASE + WHEN human_resource.middle_name IS NOT NULL AND human_resource.middle_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(human_resource.middle_name), 1, 1),SUBSTR(LOWER(human_resource.middle_name), 2)) + ELSE '' + END + ) AS full_name +FROM APC_USER usr +INNER JOIN APC_HUMAN_RESOURCE human_resource ON usr.id_human_resource = human_resource.id +INNER JOIN APC_USER_BY_OFFICE usr_by_office ON usr.id = usr_by_office.id_user +WHERE usr.user_status = 'ENEBLED' AND +usr.user_type IN ('MOBILE','BOTH') AND +usr.certifier = 'DISABLED'; + +CREATE OR REPLACE VIEW `APC_COBRANZA_LAST_WEEK_BY_USER_VIEW` AS +SELECT +u.id, +CONCAT(hr.first_name, ' ' , hr.last_name) as username, +ubo.id_office, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' AND ld.id_user = u.id +AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'monday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_monday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' and ld.id_user = u.id +AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'tuesday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_tuesday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' and ld.id_user = u.id +AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'wednesday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_wednesday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' and ld.id_user = u.id +AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'thursday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_thursday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' and ld.id_user = u.id +AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'friday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_friday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' and ld.id_user = u.id +AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'saturday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_saturday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' and ld.id_user = u.id +AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_total +FROM APC_USER u +INNER JOIN APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource +INNER JOIN APC_USER_BY_OFFICE ubo ON ubo.id_user = u.id +WHERE u.user_status = 'ENEBLED' AND +u.user_type IN ('MOBILE') AND +u.certifier = 'DISABLED'; + +CREATE OR REPLACE VIEW `APC_COBRANZA_WEEK_BY_USER_VIEW` AS +SELECT +u.id, +CONCAT(hr.first_name, ' ' , hr.last_name) as username, +ubo.id_office, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' AND ld.id_user = u.id +AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'monday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_monday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' and ld.id_user = u.id +AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'tuesday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_tuesday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' and ld.id_user = u.id +AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'wednesday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_wednesday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' and ld.id_user = u.id +AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'thursday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_thursday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' and ld.id_user = u.id +AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'friday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_friday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' and ld.id_user = u.id +AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'saturday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_saturday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' and ld.id_user = u.id +AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_total +FROM APC_USER u +INNER JOIN APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource +INNER JOIN APC_USER_BY_OFFICE ubo ON ubo.id_user = u.id +WHERE u.user_status = 'ENEBLED' AND +u.user_type IN ('MOBILE') AND +u.certifier = 'DISABLED'; + +CREATE OR REPLACE VIEW `APC_ADVANCE_USER_DAILY_DASHBOARD_VIEW` AS +SELECT + ate.id, + CONCAT(ahr.first_name, ' ' , ahr.last_name) as user_name, + ate.total_expected, + (ate.total_expected - (SELECT COUNT(id) FROM APC_LOAN_BY_USER_VIEW where user_id = ate.id_user)) as total_now, + CASE WHEN (ate.total_expected - (SELECT COUNT(id) FROM APC_LOAN_BY_USER_VIEW where user_id = ate.id_user)) = 0 + THEN 0 + ELSE + ((ate.total_expected - (SELECT COUNT(id) FROM APC_LOAN_BY_USER_VIEW where user_id = ate.id_user)) * 100) / ate.total_expected + END + as porcentaje, + ate.id_office, + ate.id_user, + (SELECT IF(ISNULL(SUM(ate2.total_expected_payment)),0,SUM(ate2.total_expected_payment)) FROM APC_TOTAL_EXPECTED_PAYMENT_DAILY_BY_USER ate2 + where WEEK(DATE(ate2.created_on),1) = (Select WEEK(CURDATE(),1)) and YEAR(DATE(ate2.created_on)) = (SELECT YEAR(CURDATE())) AND ate2.id_user = ate.id_user) + as total_expected_week, + (SELECT IF(ISNULL(SUM(ald.payment_amount)),0,SUM(ald.payment_amount)) FROM APC_LOAN_DETAIL ald + where WEEK(Date(ald.created_on),1) = (Select WEEK(CURDATE(),1)) and YEAR(Date(ald.created_on)) = (SELECT YEAR(CURDATE())) AND ald.id_user = ate.id_user + AND ald.loan_details_type IN ('PAYMENT', 'RENOVATION_PAYMENT', 'TRANSFER')) + as total_reported_week, +( + select + IF(ISNULL( + SUM( + CASE WHEN l.loan_status IN ('PENDING_RENOVATION', 'FINISH') then 0 ELSE + ((lt.payment_daily * (SELECT COUNT(ldFaltante.id) FROM APC_LOAN_DETAIL ldFaltante + WHERE ldFaltante.id_loan = l.id AND WEEK(DATE(ldFaltante.created_on),1) = WEEK(CURDATE(),1) AND + YEAR(DATE(ldFaltante.created_on)) = YEAR(CURDATE()) + AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER', 'FEE'))) + - (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) + FROM APC_LOAN_DETAIL ldLunes + WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND + YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) + AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER'))) END + ) + ),0, + SUM( + CASE WHEN l.loan_status IN ('PENDING_RENOVATION', 'FINISH') then 0 ELSE + ((lt.payment_daily * (SELECT COUNT(ldFaltante.id) FROM APC_LOAN_DETAIL ldFaltante + WHERE ldFaltante.id_loan = l.id AND WEEK(DATE(ldFaltante.created_on),1) = WEEK(CURDATE(),1) AND + YEAR(DATE(ldFaltante.created_on)) = YEAR(CURDATE()) + AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER', 'FEE'))) + - (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) + FROM APC_LOAN_DETAIL ldLunes + WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND + YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) + AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER'))) END + ) + ) + as faltante + + FROM + APC_LOAN l + INNER JOIN APC_LOAN_TYPE lt ON l.id_loan_type = lt.id + INNER JOIN APC_LOAN_BY_USER albu ON l.id = albu.id_loan + WHERE albu.id_user = ate.id_user + AND albu.owner_loan = 'CURRENT_OWNER' + +) +as faltante, + (SELECT IF(ISNULL(SUM(ald.payment_amount)),0,SUM(ald.payment_amount)) + FROM APC_LOAN_DETAIL ald + INNER JOIN APC_LOAN al ON ald.id_loan = al.id + INNER JOIN APC_LOAN_BY_USER albu ON al.id = albu.id_loan + where WEEK(Date(ald.created_on),1) = (Select WEEK(CURDATE(),1)) and YEAR(Date(ald.created_on)) = (SELECT YEAR(CURDATE())) + AND ald.loan_details_type IN ('RENOVATION_PAYMENT') AND albu.id_user = ate.id_user) as total_reported_renovation_week, + (SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) + FROM APC_LOAN al + INNER JOIN APC_LOAN_BY_USER albu ON al.id = albu.id_loan + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + WHERE albu.id_user = ate.id_user AND al.loan_status = 'APPROVED' AND + WEEK(Date(al.created_on),1) = (Select WEEK(CURDATE(),1)) and YEAR(Date(al.created_on)) = (SELECT YEAR(CURDATE())) + ) as total_comision_fee, + (SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND al.created_by = ate.id_user + AND WEEK(DATE(al.created_on),1) = WEEK(CURDATE(),1) AND + YEAR(Date(al.created_on)) = (SELECT YEAR(CURDATE()))) + as colocation_approved, + (SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'TO_DELIVERY' AND al.created_by = ate.id_user + AND WEEK(DATE(al.created_on),1) = WEEK(CURDATE(),1) AND + YEAR(Date(al.created_on)) = (SELECT YEAR(CURDATE()))) + as colocation_to_delivery +FROM + APC_TOTAL_EXPECTED_PAYMENT_DAILY_BY_USER ate +INNER JOIN APC_USER au ON au.id = ate.id_user +INNER JOIN APC_HUMAN_RESOURCE ahr ON ahr.id = au.id_human_resource +WHERE + DATE(ate.created_on) = CURDATE() + AND ate.active_status = 'ENEBLED'; + +CREATE OR REPLACE VIEW `APC_SUBTOTAL_LAST_WEEK_BY_USER_VIEW` AS +SELECT +u.id, +CONCAT(hr.first_name, ' ' , hr.last_name) as username, +ubo.id_office, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'monday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_monday, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'monday') + as opening_fee_monday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'tuesday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_tuesday, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'tuesday') + as opening_fee_tuesday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'wednesday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_wednesday, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'wednesday') + as opening_fee_wednesday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'thursday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_thursday, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'thursday') + as opening_fee_thursday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'friday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_friday, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'friday') + as opening_fee_friday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'saturday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_saturday, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'saturday') + as opening_fee_saturday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_total, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) ) + as opening_fee_total, +( + select + IF(ISNULL( + SUM( + CASE WHEN l.loan_status IN ('PENDING_RENOVATION', 'FINISH') then 0 ELSE + ((lt.payment_daily * (SELECT COUNT(ldFaltante.id) FROM APC_LOAN_DETAIL ldFaltante + WHERE ldFaltante.id_loan = l.id AND WEEK(DATE(ldFaltante.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(DATE(ldFaltante.created_on)) = YEAR(CURDATE()) + AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER', 'FEE'))) + - (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) + FROM APC_LOAN_DETAIL ldLunes + WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) + AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER'))) END + ) + ),0, + SUM( + CASE WHEN l.loan_status IN ('PENDING_RENOVATION', 'FINISH') then 0 ELSE + ((lt.payment_daily * (SELECT COUNT(ldFaltante.id) FROM APC_LOAN_DETAIL ldFaltante + WHERE ldFaltante.id_loan = l.id AND WEEK(DATE(ldFaltante.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(DATE(ldFaltante.created_on)) = YEAR(CURDATE()) + AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER', 'FEE'))) + - (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) + FROM APC_LOAN_DETAIL ldLunes + WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) + AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER'))) END + ) + ) + as faltante + + FROM + APC_LOAN l + INNER JOIN APC_LOAN_TYPE lt ON l.id_loan_type = lt.id + INNER JOIN APC_LOAN_BY_USER albu ON l.id = albu.id_loan + WHERE albu.id_user = u.id + AND albu.owner_loan = 'CURRENT_OWNER' + +) +as faltante +FROM APC_USER u +INNER JOIN APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource +INNER JOIN APC_USER_BY_OFFICE ubo ON ubo.id_user = u.id +WHERE u.user_status = 'ENEBLED' AND +u.user_type IN ('MOBILE') AND +u.certifier = 'DISABLED'; + +-- -------------------------------------------------------------------- +-- +-- Estructura para la tabla `APC_STABLE_GENERAL_BOX` +-- +-- Totales de la caja de APC. +-- +CREATE TABLE `APC_STABLE_SMALL_BOX`( + `id` char(36) NOT NULL, + `total_small_box` numeric(8,2) NOT NULL, + `total_envelope` numeric(8,2) NOT NULL, + `total_bank_note` numeric(8,2) NOT NULL, + `total_coin` numeric(8,2) NOT NULL, + `total_stable` numeric(8,2) NOT NULL, + `active_status` ENUM('ENEBLED', 'DISABLED') NOT NULL DEFAULT 'ENEBLED', + `description` varchar(200), + `id_office` char(36) NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_stable_small_box_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_stable_small_box_to_apc_office_fk` + FOREIGN KEY (`id_office`) REFERENCES `APC_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +ALTER TABLE APC_LOAN_TYPE +ADD COLUMN `convenio` ENUM('ENEBLED','DISABLED') DEFAULT 'DISABLED' +AFTER `payment_sunday`; + +CREATE TABLE `APC_BITACORA`( + `id` char(36) NOT NULL, + `id_office` char(36) NOT NULL, + `comments_user` varchar(300) NOT NULL, + `action` varchar(50) NOT NULL, + `description` varchar(300) NOT NULL, + `name_user` varchar(200) NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_bitacora_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_bitacora_to_apc_office_fk` + FOREIGN KEY (`id_office`) REFERENCES `APC_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE OR REPLACE VIEW APC_HISTORY_LOAN_VIEW AS +SELECT +l.id, +CONCAT(pc.first_name, ' ', pc.last_name) customerName, +CONCAT(pa.first_name, ' ', pa.last_name) endorsementName, +r.route_name routeName, +o.office_name officeName, +lt.payment montoPrestado, +l.amount_to_pay montoAPagar, +l.amount_paid montoPagado, +(l.amount_to_pay - l.amount_paid) saldoInsoluto, +(SELECT count(lfn.id) FROM APC_LOAN_FEE_NOTIFICATION lfn WHERE lfn.id_loan = l.id) numMultas, +CASE WHEN l.loan_status = 'PENDING' THEN 'Pendiente' +WHEN l.loan_status = 'FINISH' THEN 'Terminado' +WHEN l.loan_status = 'APPROVED' THEN 'Aprobado' +WHEN l.loan_status = 'REJECTED' THEN 'Rechazado' +WHEN l.loan_status = 'PENDING_RENOVATION' THEN 'Pendiente de renovaciĆ³n' +WHEN l.loan_status = 'TO_DELIVERY' THEN 'Por liberar' +END as estatusPrestamo, +DATE(l.created_on) as fecha, +u.user_name nombreUsuario +FROM +APC_LOAN l +INNER JOIN APC_PEOPLE pc ON l.id_customer = pc.id +INNER JOIN APC_PEOPLE pa ON l.id_endorsement = pa.id +INNER JOIN APC_ROUTE r ON l.id_route = r.id +INNER JOIN APC_OFFICE o ON r.id_office = o.id +INNER JOIN APC_LOAN_TYPE lt ON l.id_loan_type = lt.id +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +INNER JOIN APC_USER u ON u.id = lbu.id_user +WHERE l.loan_status NOT IN ('DELETED') +ORDER BY l.created_on DESC +-- ------------------------------------------------------------- +-- +-- Estructura para la vista `APC_STATS_FEES_VIEW` +-- +CREATE OR REPLACE VIEW APC_FEES_VIEW AS +SELECT +LD.ID, +LD.id_user, +CONCAT(HR.first_name, ' ', HR.last_name) AS name, +LD.payment_amount AS total_fees, +LD.created_on +FROM apc_loan_detail LD +INNER JOIN apc_loan L ON LD.id_loan = L.id AND L.loan_status <> 'DELETED' +INNER JOIN apc_user U ON LD.id_user = U.id +INNER JOIN apc_human_resource HR ON U.id_human_resource = HR.id +WHERE loan_details_type = 'FEE' +-- -------------------------------------------------------- +-- +-- Estructura para la vista `APC_ADMINISTRATION_PERSON_SEARCH_VIEW` +-- +CREATE OR REPLACE VIEW `APC_ADMINISTRATION_PERSON_SEARCH_VIEW` AS +SELECT + people.id AS id, people.phone_home AS phone_home, people.address_home AS address_home, people.people_type AS people_type, + people.id_route AS id_route, route.route_name AS route_name, people.id_office AS id_office, office.office_name AS office_name, + CONCAT( + CASE + WHEN people.first_name IS NOT NULL AND people.first_name != '' + THEN CONCAT(SUBSTR(UPPER(people.first_name), 1, 1),SUBSTR(LOWER(people.first_name), 2)) + ELSE '' + END, + CASE + WHEN people.second_name IS NOT NULL AND people.second_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(people.second_name), 1, 1),SUBSTR(LOWER(people.second_name), 2)) + ELSE '' + END, + CASE + WHEN people.last_name IS NOT NULL AND people.last_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(people.last_name), 1, 1),SUBSTR(LOWER(people.last_name), 2)) + ELSE '' + END, + CASE + WHEN people.middle_name IS NOT NULL AND people.middle_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(people.middle_name), 1, 1),SUBSTR(LOWER(people.middle_name), 2)) + ELSE '' + END + ) AS person_search +FROM APC_PEOPLE people +INNER JOIN APC_OFFICE office ON people.id_office = office.id +INNER JOIN APC_ROUTE route ON people.id_route = route.id +WHERE + people.active_status = 'ENEBLED' +ORDER BY office_name, route_name, person_search; +-- -------------------------------------------------------- +-- +-- Estructura para la vista `APC_ADMINISTRATION_PERSON_SEARCH_VIEW` +-- +ALTER TABLE APC_USER +ADD COLUMN `management` ENUM('ENEBLED','DISABLED'); +-- -------------------------------------------------------------------- +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; + +-- Formula es: +-- monto_pagado >= a FLOOR(payment_total * .7728) +-- y +-- monto_pagado < a FLOOR(payment_total * .8182) +-- El pago puede renovarce segun las reglas y si se acpeta en este caso +-- se deberĆ”n condonar pago 21 y 22. +-- El pago 19 y 20 se cobrarĆ” cuando se entregue la renovaciĆ³n. +/* +SELECT + FLOOR(payment_total * .7728) as inicio, + + FLOOR(payment_total * .8182) as fin +FROM APC_LOAN_TYPE WHERE id_office = 'e0f1a2fc-7d1f-11ea-af3e-28f659da398e' ORDER BY payment; + + -- SEGUNDO CASO PAGO 20 se condona 21 y se deberĆ” pagar el 22 + +SELECT + FLOOR(payment_total * 0.8637) as inicio, + + FLOOR(payment_total * 0.9091) as fin +FROM APC_LOAN_TYPE WHERE id_office = 'e0f1a2fc-7d1f-11ea-af3e-28f659da398e' ORDER BY payment; +*/ + + +-- VISTA RESPALDADA +-- CREATE ALGORITHM=UNDEFINED DEFINER=`AlphaCJZL`@`%` SQL SECURITY DEFINER VIEW `APC_LOAN_BY_USER_VIEW` AS select concat(`l`.`id`,`u`.`id`) AS `id`,`u`.`id` AS `user_id`,concat((case when ((`cstmr`.`first_name` is not null) and (`cstmr`.`first_name` <> '')) then concat(substr(upper(`cstmr`.`first_name`),1,1),substr(lower(`cstmr`.`first_name`),2),' ') else '' end),(case when ((`cstmr`.`second_name` is not null) and (`cstmr`.`second_name` <> '')) then concat(substr(upper(`cstmr`.`second_name`),1,1),substr(lower(`cstmr`.`second_name`),2),' ') else '' end),(case when ((`cstmr`.`last_name` is not null) and (`cstmr`.`last_name` <> '')) then concat(substr(upper(`cstmr`.`last_name`),1,1),substr(lower(`cstmr`.`last_name`),2)) else '' end)) AS `customer_name`,`cstmr`.`address_home` AS `customer_address_home`,`cstmr`.`address_business` AS `customer_address_business`,`cstmr`.`company_name` AS `company_name`,`cstmr`.`thumbnail` AS `customer_thumbnail`,concat((case when ((`ndrsmnt`.`first_name` is not null) and (`ndrsmnt`.`first_name` <> '')) then concat(substr(upper(`ndrsmnt`.`first_name`),1,1),substr(lower(`ndrsmnt`.`first_name`),2),' ') else '' end),(case when ((`ndrsmnt`.`second_name` is not null) and (`ndrsmnt`.`second_name` <> '')) then concat(substr(upper(`ndrsmnt`.`second_name`),1,1),substr(lower(`ndrsmnt`.`second_name`),2),' ') else '' end),(case when ((`ndrsmnt`.`last_name` is not null) and (`ndrsmnt`.`last_name` <> '')) then concat(substr(upper(`ndrsmnt`.`last_name`),1,1),substr(lower(`ndrsmnt`.`last_name`),2)) else '' end)) AS `endorsement_name`,`ndrsmnt`.`address_home` AS `endorsement_address_home`,`ndrsmnt`.`thumbnail` AS `endorsement_thumbnail`,`ndrsmnt`.`phone_home` AS `endorsement_phone_home`,if(((`l`.`amount_to_pay` - `l`.`amount_paid`) >= `lt`.`payment_daily`),`lt`.`payment_daily`,(`l`.`amount_to_pay` - `l`.`amount_paid`)) AS `payment_daily`,`lt`.`loan_fee` AS `loan_fee`,`lbu`.`order_in_list` AS `order_in_list`,(select count(`APC_LOAN_FEE_NOTIFICATION`.`notification_number`) from `APC_LOAN_FEE_NOTIFICATION` where (`APC_LOAN_FEE_NOTIFICATION`.`id_loan` = `l`.`id`)) AS `notification_number`,if((`l`.`amount_paid` >= (select floor((`lt`.`payment_total` * 0.6364)))),(case when ((select count(`APC_LOAN_FEE_NOTIFICATION`.`notification_number`) AS `total` from `APC_LOAN_FEE_NOTIFICATION` where (`APC_LOAN_FEE_NOTIFICATION`.`id_loan` = `l`.`id`)) < 4) then 'ENEBLED' when (((select count(`APC_LOAN_FEE_NOTIFICATION`.`notification_number`) AS `total` from `APC_LOAN_FEE_NOTIFICATION` where (`APC_LOAN_FEE_NOTIFICATION`.`id_loan` = `l`.`id`)) between 4 and 5) and (`lt`.`payment` > 1000)) then 'ENEBLED' else 'DISABLED' end),'DISABLED') AS `renovation`,(select (`APC_LOAN`.`amount_to_pay` - `APC_LOAN`.`amount_paid`) from `APC_LOAN` where (`APC_LOAN`.`id` = `l`.`id`)) AS `max_amount_to_pay` from (((((`APC_LOAN_BY_USER` `lbu` join `APC_LOAN` `l` on((`lbu`.`id_loan` = `l`.`id`))) join `APC_LOAN_TYPE` `lt` on((`l`.`id_loan_type` = `lt`.`id`))) join `APC_PEOPLE` `cstmr` on((`l`.`id_customer` = `cstmr`.`id`))) join `APC_PEOPLE` `ndrsmnt` on((`l`.`id_endorsement` = `ndrsmnt`.`id`))) join `APC_USER` `u` on((`lbu`.`id_user` = `u`.`id`))) where ((`l`.`loan_status` in ('APPROVED','PENDING','TO_DELIVERY')) and (`l`.`id` = (case when (((select count(`APC_LOAN_DETAIL`.`id`) from `APC_LOAN_DETAIL` where (`APC_LOAN_DETAIL`.`id_loan` = `l`.`id`)) = 0) and (cast(`l`.`last_updated_on` as date) < curdate())) then `l`.`id` when (((select count(`APC_LOAN_DETAIL`.`id`) from `APC_LOAN_DETAIL` where ((`APC_LOAN_DETAIL`.`id_loan` = `l`.`id`) and (`APC_LOAN_DETAIL`.`reference_number` = `l`.`last_reference_number`) and (cast(`APC_LOAN_DETAIL`.`created_on` as date) < curdate()))) > 0) and (cast(`l`.`last_updated_on` as date) < curdate())) then `l`.`id` else '' end)) and (`lbu`.`owner_loan` = 'CURRENT_OWNER') and (0 <> (case when (lower(dayname(curdate())) = 'monday') then ('monday' = `lt`.`payment_monday`) when (lower(dayname(curdate())) = 'tuesday') then ('tuesday' = lower(`lt`.`payment_tuesday`)) when (lower(dayname(curdate())) = 'wednesday') then ('wednesday' = lower(`lt`.`payment_wednesday`)) when (lower(dayname(curdate())) = 'thursday') then ('thursday' = lower(`lt`.`payment_thursday`)) when (lower(dayname(curdate())) = 'friday') then ('friday' = lower(`lt`.`payment_friday`)) when (lower(dayname(curdate())) = 'saturday') then ('saturday' = lower(`lt`.`payment_saturday`)) when (lower(dayname(curdate())) = 'sunday') then ('sunday' = lower(`lt`.`payment_sunday`)) else false end))); +-- NO BORRAR vista APC_LOAN_BY_USER_VIEW diff --git a/ace-db/src/apc-drop-tables-prod.sql b/ace-db/src/apc-drop-tables-prod.sql new file mode 100644 index 0000000..c0b0dde --- /dev/null +++ b/ace-db/src/apc-drop-tables-prod.sql @@ -0,0 +1,46 @@ +-- -------------------------------------------------------- +-- Arrebol Consuntancy +-- version 1.0.1 +-- http://www.arrebolconsultancy.com +-- -------------------------------------------------------- + +SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; +SET AUTOCOMMIT = 0; +START TRANSACTION; +-- SET time_zone = "+00:00"; + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8mb4 */; + +USE `apo_pro_com_april_ten`; + +-- -------------------------------------------------------------------- +-- +-- Estructura para la vista `APC_CASH_REGISTER_CURDATE_BY_USER_VIEW` +-- +-- Sirve para obtener todos los pagos que recabo un asesor en el dĆ­a. +-- +DROP TABLE IF EXISTS APC_LOAN_BY_RENOVATION; +DROP TABLE IF EXISTS APC_USER_MOBILE_PREFERECE; +DROP TABLE IF EXISTS APC_USER_BY_OFFICE_HAS_PERMISSION; +DROP TABLE IF EXISTS APC_PERMISSION; +DROP TABLE IF EXISTS APC_USER_BY_OFFICE; +DROP TABLE IF EXISTS APC_LOAN_BY_USER; +DROP TABLE IF EXISTS APC_LOAN_FEE_NOTIFICATION; +DROP TABLE IF EXISTS APC_LOAN_DETAIL; +DROP TABLE IF EXISTS APC_USER; +DROP TABLE IF EXISTS APC_HUMAN_RESOURCE_BY_OFFICE; +DROP TABLE IF EXISTS APC_LOAN; +DROP TABLE IF EXISTS APC_LOAN_TYPE; +DROP TABLE IF EXISTS APC_PEOPLE; +DROP TABLE IF EXISTS APC_HUMAN_RESOURCE_HAS_ROUTE; +DROP TABLE IF EXISTS APC_HUMAN_RESOURCE; +DROP TABLE IF EXISTS APC_ROUTE; +DROP TABLE IF EXISTS APC_ROLE; +DROP TABLE IF EXISTS APC_OFFICE; +DROP TABLE IF EXISTS APC_ERROR_APP_LOG; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; \ No newline at end of file diff --git a/ace-db/src/cambio_de_anio.sql b/ace-db/src/cambio_de_anio.sql new file mode 100644 index 0000000..c18f0a6 --- /dev/null +++ b/ace-db/src/cambio_de_anio.sql @@ -0,0 +1,794 @@ +-- -------------------------------------------------------- +-- +-- Estructura para la vista `APC_INFORMATION_LOAN_LAST_WEEK_VIEW` +-- +CREATE OR REPLACE VIEW `APC_INFORMATION_LOAN_LAST_WEEK_VIEW` AS +SELECT +l.id, +u.id as id_user, +r.id_office, +l.created_on as fecha, +lt.payment as apoyos, +lt.payment_total as apoyos_total, +lt.opening_fee as comision_apertura, +CONCAT(endor.first_name,' ', IF(ISNULL(endor.second_name) ,'', CONCAT(endor.second_name,' ')) ,endor.last_name, ' ', endor.middle_name) AS aval, +CONCAT(cus.first_name,' ', IF(ISNULL(cus.second_name) ,'', CONCAT(cus.second_name,' ')) ,cus.last_name, ' ', cus.middle_name) AS customer, +l.amount_to_pay as documento_por, +lt.payment_daily as abono_diario, +l.amount_paid, +(l.amount_to_pay - l.amount_paid) saldo_insoluto, +r.route_name, +CONCAT(hr.first_name,' ', IF(ISNULL(hr.second_name) ,'', CONCAT(hr.second_name,' ')) ,hr.last_name, ' ', hr.middle_name) AS asesor, +(SELECT COUNT(lfn.id) FROM APC_LOAN_FEE_NOTIFICATION lfn WHERE lfn.id_loan = l.id) as num_fee, +-- Lunes +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'monday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_monday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'monday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_monday, +-- Martes +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'tuesday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_tuesday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'tuesday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_tuesday, +-- Miercoles +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'wednesday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_wednesday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'wednesday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_wednesday, +-- Jueves +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'thursday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_thursday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'thursday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_thursday, +-- Viernes +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'friday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_friday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'friday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_friday, +-- Sabado +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'saturday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_saturday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'saturday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_saturday, + +((lt.payment_daily * (SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) > 5, 5, COUNT(DISTINCT(DATE(ldFaltante.created_on)))) FROM APC_LOAN_DETAIL ldFaltante +WHERE ldFaltante.id_loan = l.id AND WEEK(DATE(ldFaltante.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldFaltante.created_on)) = YEAR(CURDATE()) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('saturday','sunday') +AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER', 'FEE'))) +- (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER'))) as faltante, + +CASE WHEN l.new_customer = 'ENEBLED' AND WEEK(DATE(l.created_on),1) = (WEEK(CURDATE(),1) - 1) THEN 'Si' ELSE 'No' END as new_customer, +(SELECT IF(COUNT(id_loan_old) = 0 , 'No' , 'Si') FROM APC_LOAN_BY_RENOVATION lbr +INNER JOIN APC_LOAN lRenovation ON lbr.id_loan_new = lRenovation.id +WHERE id_loan_old = l.id + AND loan_by_renovation_status = 'APPROVED' and WEEK(DATE(lRenovation.created_on),1) <= (WEEK(CURDATE(),1) - 1) AND + YEAR(DATE(lRenovation.created_on)) = YEAR(CURDATE())) as renovation, +l.loan_status as estatus_prestamo, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as abono_semana_actual, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND ldLunes.loan_details_type IN ('FEE')) as fee_semana_actual, +(SELECT COUNT(DISTINCT(DATE(ldFaltante.created_on))) FROM APC_LOAN_DETAIL ldFaltante +WHERE ldFaltante.id_loan = l.id AND WEEK(DATE(ldFaltante.created_on),1) <= (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldFaltante.created_on)) = YEAR(CURDATE()) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('saturday','sunday') +AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER', 'FEE')) as num_pagos_all, +(SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) > 5, 5, COUNT(DISTINCT(DATE(ldFaltante.created_on)))) FROM APC_LOAN_DETAIL ldFaltante +WHERE ldFaltante.id_loan = l.id AND WEEK(DATE(ldFaltante.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldFaltante.created_on)) = YEAR(CURDATE()) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('saturday','sunday') +AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER', 'FEE')) as num_pagos_week, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) <= (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND ldLunes.loan_details_type IN ('FEE')) as fee_todos +FROM +APC_LOAN l +INNER JOIN APC_LOAN_TYPE lt ON l.id_loan_type = lt.id +INNER JOIN APC_PEOPLE cus ON cus.id = l.id_customer +INNER JOIN APC_PEOPLE endor ON endor.id = l.id_endorsement +INNER JOIN APC_ROUTE r ON r.id = l.id_route +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +INNER JOIN APC_USER u ON u.id = lbu.id_user +INNER JOIN APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource +WHERE +l.loan_status not in ('DELETED','REJECTED') AND +((SELECT COUNT(ld.id) FROM APC_LOAN_DETAIL ld WHERE WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.id_loan = l.id) > 0 OR + ((SELECT COUNT(ld.id) FROM APC_LOAN_DETAIL ld WHERE WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.id_loan = l.id) = 0 AND l.loan_status = 'APPROVED' AND + WEEK(DATE(l.created_on),1) <= (WEEK(CURDATE(),1) - 1))); +-- -------------------------------------------------------- +-- +-- Estructura para la vista `APC_COLOCATION_LAST_WEEK_BY_USER_VIEW` +-- +CREATE OR REPLACE VIEW `APC_COLOCATION_LAST_WEEK_BY_USER_VIEW` AS +SELECT +u.id, +CONCAT(hr.first_name, ' ' , hr.last_name) as username, +ubo.id_office, +(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND al.created_by = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1)-1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'monday') + as colocation_monday, +(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND al.created_by = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1)-1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'tuesday') + as colocation_tuesday, +(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND al.created_by = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1)-1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'wednesday') + as colocation_wednesday, +(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND al.created_by = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1)-1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'thursday') + as colocation_thursday, +(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND al.created_by = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1)-1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'friday') + as colocation_friday, +(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND al.created_by = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1)-1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'saturday') + as colocation_saturday, +(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND al.created_by = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1)-1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE())) + as colocation_total +FROM APC_USER u +INNER JOIN APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource +INNER JOIN APC_USER_BY_OFFICE ubo ON ubo.id_user = u.id +WHERE u.user_status = 'ENEBLED' AND +u.user_type IN ('MOBILE') AND +u.certifier = 'DISABLED'; +-- -------------------------------------------------------- +-- +-- Estructura para la vista `APC_RESUMEN_IN_OUT_LAST_WEEK_BY_USER_VIEW` +-- +CREATE OR REPLACE VIEW `APC_RESUMEN_IN_OUT_LAST_WEEK_BY_USER_VIEW` AS +SELECT +u.id, +CONCAT(hr.first_name, ' ' , hr.last_name) as username, +ubo.id_office, +-- Lunes +(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) +FROM APC_CLOSING_DAY ld +WHERE ld.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.active_status = 'ENEBLED' +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'monday') as closing_monday, +(SELECT IF(ISNULL(SUM(oe.expense)),0,SUM(oe.expense)) +FROM APC_OTHER_EXPENSE oe +WHERE oe.id_user = u.id AND WEEK(DATE(oe.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(oe.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(oe.created_on))) = 'monday') as expense_monday, +(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) +FROM APC_MONEY_DAILY md +WHERE md.id_user = u.id AND WEEK(DATE(md.money_daily_date),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(md.money_daily_date)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(md.money_daily_date))) = 'monday') as money_daily_today_monday, +-- Martes +(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) +FROM APC_CLOSING_DAY ld +WHERE ld.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.active_status = 'ENEBLED' +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'tuesday') as closing_tuesday, +(SELECT IF(ISNULL(SUM(oe.expense)),0,SUM(oe.expense)) +FROM APC_OTHER_EXPENSE oe +WHERE oe.id_user = u.id AND WEEK(DATE(oe.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(oe.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(oe.created_on))) = 'tuesday') as expense_tuesday, +(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) +FROM APC_MONEY_DAILY md +WHERE md.id_user = u.id AND WEEK(DATE(md.money_daily_date),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(md.money_daily_date)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(md.money_daily_date))) = 'tuesday') as money_daily_today_tuesday, +-- Miercoles +(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) +FROM APC_CLOSING_DAY ld +WHERE ld.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.active_status = 'ENEBLED' +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'wednesday') as closing_wednesday, +(SELECT IF(ISNULL(SUM(oe.expense)),0,SUM(oe.expense)) +FROM APC_OTHER_EXPENSE oe +WHERE oe.id_user = u.id AND WEEK(DATE(oe.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(oe.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(oe.created_on))) = 'wednesday') as expense_wednesday, +(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) +FROM APC_MONEY_DAILY md +WHERE md.id_user = u.id AND WEEK(DATE(md.money_daily_date),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(md.money_daily_date)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(md.money_daily_date))) = 'wednesday') as money_daily_today_wednesday, +-- Jueves +(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) +FROM APC_CLOSING_DAY ld +WHERE ld.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.active_status = 'ENEBLED' +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'thursday') as closing_thursday, +(SELECT IF(ISNULL(SUM(oe.expense)),0,SUM(oe.expense)) +FROM APC_OTHER_EXPENSE oe +WHERE oe.id_user = u.id AND WEEK(DATE(oe.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(oe.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(oe.created_on))) = 'thursday') as expense_thursday, +(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) +FROM APC_MONEY_DAILY md +WHERE md.id_user = u.id AND WEEK(DATE(md.money_daily_date),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(md.money_daily_date)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(md.money_daily_date))) = 'thursday') as money_daily_today_thursday, +-- Viernes +(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) +FROM APC_CLOSING_DAY ld +WHERE ld.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.active_status = 'ENEBLED' +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'friday') as closing_friday, +(SELECT IF(ISNULL(SUM(oe.expense)),0,SUM(oe.expense)) +FROM APC_OTHER_EXPENSE oe +WHERE oe.id_user = u.id AND WEEK(DATE(oe.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(oe.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(oe.created_on))) = 'friday') as expense_friday, +(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) +FROM APC_MONEY_DAILY md +WHERE md.id_user = u.id AND WEEK(DATE(md.money_daily_date),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(md.money_daily_date)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(md.money_daily_date))) = 'friday') as money_daily_today_friday, +-- Sabado +(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) +FROM APC_CLOSING_DAY ld +WHERE ld.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.active_status = 'ENEBLED' +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'saturday') as closing_saturday, +(SELECT IF(ISNULL(SUM(oe.expense)),0,SUM(oe.expense)) +FROM APC_OTHER_EXPENSE oe +WHERE oe.id_user = u.id AND WEEK(DATE(oe.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(oe.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(oe.created_on))) = 'saturday') as expense_saturday, +(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) +FROM APC_MONEY_DAILY md +WHERE md.id_user = u.id AND WEEK(DATE(md.money_daily_date),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(md.money_daily_date)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(md.money_daily_date))) = 'saturday') as money_daily_today_saturday +FROM APC_USER u +INNER JOIN APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource +INNER JOIN APC_USER_BY_OFFICE ubo ON ubo.id_user = u.id +WHERE u.user_status = 'ENEBLED' AND +u.user_type IN ('MOBILE','BOTH'); +-- -------------------------------------------------------- +-- +-- Estructura para la vista `APC_LOAN_DIFERENCES_BY_USER_LAST_WEEK_VIEW` +-- +CREATE OR REPLACE VIEW `APC_LOAN_DIFERENCES_BY_USER_LAST_WEEK_VIEW` AS +SELECT +l.id, +lbu.id_user, +((lt.payment_daily * 5) - (SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +WHERE ld.id_loan = l.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) +AND YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER'))) + as faltante +FROM + APC_LOAN l +INNER JOIN + APC_LOAN_TYPE lt ON l.id_loan_type = lt.id +INNER JOIN + APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE +l.loan_status not in ('DELETED','REJECTED') AND +(SELECT COUNT(ld2.id) FROM APC_LOAN_DETAIL ld2 WHERE WEEK(DATE(ld2.created_on),1) = (WEEK(CURDATE(),1)-1) +AND YEAR(DATE(ld2.created_on)) = YEAR(CURDATE()) AND ld2.id_loan = l.id) > 4; +-- -------------------------------------------------------- +-- +-- Estructura para la vista `APC_SUBTOTAL_LAST_WEEK_BY_USER_VIEW` +-- +CREATE OR REPLACE VIEW `APC_SUBTOTAL_LAST_WEEK_BY_USER_VIEW` AS +SELECT +u.id, +CONCAT(hr.first_name, ' ' , hr.last_name) as username, +ubo.id_office, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'monday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_monday, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'monday') + as opening_fee_monday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'tuesday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_tuesday, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'tuesday') + as opening_fee_tuesday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'wednesday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_wednesday, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'wednesday') + as opening_fee_wednesday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'thursday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_thursday, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'thursday') + as opening_fee_thursday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'friday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_friday, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'friday') + as opening_fee_friday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'saturday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_saturday, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'saturday') + as opening_fee_saturday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_total, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) ) + as opening_fee_total, +( + select + IF(ISNULL( + SUM( + CASE WHEN l.loan_status IN ('PENDING_RENOVATION', 'FINISH') then 0 ELSE + ((lt.payment_daily * (SELECT COUNT(ldFaltante.id) FROM APC_LOAN_DETAIL ldFaltante + WHERE ldFaltante.id_loan = l.id AND WEEK(DATE(ldFaltante.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(DATE(ldFaltante.created_on)) = YEAR(CURDATE()) + AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER', 'FEE'))) + - (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) + FROM APC_LOAN_DETAIL ldLunes + WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) + AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER'))) END + ) + ),0, + SUM( + CASE WHEN l.loan_status IN ('PENDING_RENOVATION', 'FINISH') then 0 ELSE + ((lt.payment_daily * (SELECT COUNT(ldFaltante.id) FROM APC_LOAN_DETAIL ldFaltante + WHERE ldFaltante.id_loan = l.id AND WEEK(DATE(ldFaltante.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(DATE(ldFaltante.created_on)) = YEAR(CURDATE()) + AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER', 'FEE'))) + - (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) + FROM APC_LOAN_DETAIL ldLunes + WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) + AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER'))) END + ) + ) + as faltante + + FROM + APC_LOAN l + INNER JOIN APC_LOAN_TYPE lt ON l.id_loan_type = lt.id + INNER JOIN APC_LOAN_BY_USER albu ON l.id = albu.id_loan + WHERE albu.id_user = u.id + AND albu.owner_loan = 'CURRENT_OWNER' + +) +as faltante +FROM APC_USER u +INNER JOIN APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource +INNER JOIN APC_USER_BY_OFFICE ubo ON ubo.id_user = u.id +WHERE u.user_status = 'ENEBLED' AND +u.user_type IN ('MOBILE') AND +u.certifier = 'DISABLED'; +-- -------------------------------------------------------- +-- +-- Estructura para la vista `APC_COBRANZA_LAST_WEEK_BY_USER_VIEW` +-- +CREATE OR REPLACE VIEW `APC_COBRANZA_LAST_WEEK_BY_USER_VIEW` AS +SELECT +u.id, +CONCAT(hr.first_name, ' ' , hr.last_name) as username, +ubo.id_office, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' AND ld.id_user = u.id +AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'monday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_monday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' and ld.id_user = u.id +AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'tuesday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_tuesday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' and ld.id_user = u.id +AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'wednesday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_wednesday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' and ld.id_user = u.id +AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'thursday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_thursday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' and ld.id_user = u.id +AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'friday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_friday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' and ld.id_user = u.id +AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'saturday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_saturday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' and ld.id_user = u.id +AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_total +FROM APC_USER u +INNER JOIN APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource +INNER JOIN APC_USER_BY_OFFICE ubo ON ubo.id_user = u.id +WHERE u.user_status = 'ENEBLED' AND +u.user_type IN ('MOBILE') AND +u.certifier = 'DISABLED'; +-- -------------------------------------------------------- +-- +-- Estructura para la vista `APC_RESUMEN_TOTAL_LAST_WEEK_VIEW` +-- +CREATE OR REPLACE VIEW `APC_RESUMEN_TOTAL_LAST_WEEK_VIEW` AS +SELECT +u.id, +u.office_name, +-- Cortes +(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) +FROM APC_CLOSING_DAY ld +WHERE WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.active_status = 'ENEBLED' +AND ld.id_office = u.id) as closing__day_total, +-- Inicios +(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) +FROM APC_MONEY_DAILY md +WHERE WEEK(DATE(md.money_daily_date),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(md.money_daily_date)) = YEAR(CURDATE()) AND md.id_office = u.id) as money_daily_today_total, +-- Subtotal +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_total, +-- comision por apertura +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE())) + as opening_fee_total, +-- cobranza +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' +AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) -1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_today, +-- colocacion +(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1)-1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) ) + as colocation_total, +-- nominas +(SELECT IF(ISNULL(SUM(ap.total_payment)),0,SUM(ap.total_payment)) FROM APC_PAYROLL ap +WHERE ap.id_office = u.id AND ap.active_status = 'ENEBLED' +AND WEEK(DATE(ap.created_on),1) = (WEEK(CURDATE(),1)-1) AND + YEAR(Date(ap.created_on)) = YEAR(CURDATE())) as nomina_total, +-- adelantos +(SELECT IF(ISNULL(SUM(ap.amount)),0,SUM(ap.amount)) FROM APC_ADVANCE ap +WHERE ap.id_office = u.id AND ap.active_status = 'ENEBLED' +AND WEEK(DATE(ap.created_on),1) = (WEEK(CURDATE(),1)-1) AND + YEAR(Date(ap.created_on)) = YEAR(CURDATE())) as adelantos_total, +-- entradas +(SELECT IF(ISNULL(SUM(ap.amount)),0,SUM(ap.amount)) FROM APC_EXPENSE_COMPANY ap +WHERE ap.id_office = u.id AND ap.active_status = 'ENEBLED' AND +ap.expense_company_type = 'PAYMENT_IN' +AND WEEK(DATE(ap.created_on),1) = (WEEK(CURDATE(),1)-1) AND + YEAR(Date(ap.created_on)) = YEAR(CURDATE())) as entradas_total, +-- gastos admon +(SELECT IF(ISNULL(SUM(ap.amount)),0,SUM(ap.amount)) FROM APC_EXPENSE_COMPANY ap +WHERE ap.id_office = u.id AND ap.active_status = 'ENEBLED' AND +ap.expense_company_type = 'PAYMENT_OUT' +AND WEEK(DATE(ap.created_on),1) = (WEEK(CURDATE(),1)-1) AND + YEAR(Date(ap.created_on)) = YEAR(CURDATE())) as gastos_admon_total +FROM APC_OFFICE u +WHERE u.office_status = 'ENEBLED'; +-- -------------------------------------------------------- +-- +-- Estructura para la vista `` +-- +CREATE OR REPLACE VIEW `APC_RESUMEN_TOTAL_LAST_WEEK_VIEW` AS +SELECT +u.id, +u.office_name, +-- Cortes +(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) +FROM APC_CLOSING_DAY ld +WHERE WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.active_status = 'ENEBLED' +AND ld.id_office = u.id) as closing__day_total, +-- Inicios +(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) +FROM APC_MONEY_DAILY md +WHERE WEEK(DATE(md.money_daily_date),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(md.money_daily_date)) = YEAR(CURDATE()) AND md.id_office = u.id) as money_daily_today_total, +-- Subtotal +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_total, +-- comision por apertura +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE())) + as opening_fee_total, +-- cobranza +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' +AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) -1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_today, +-- colocacion +(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1)-1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) ) + as colocation_total, +-- nominas +(SELECT IF(ISNULL(SUM(ap.total_payment)),0,SUM(ap.total_payment)) FROM APC_PAYROLL ap +WHERE ap.id_office = u.id AND ap.active_status = 'ENEBLED' +AND WEEK(DATE(ap.created_on),1) = (WEEK(CURDATE(),1)-1) AND + YEAR(Date(ap.created_on)) = YEAR(CURDATE())) as nomina_total, +-- adelantos +(SELECT IF(ISNULL(SUM(ap.amount)),0,SUM(ap.amount)) FROM APC_ADVANCE ap +WHERE ap.id_office = u.id AND ap.active_status = 'ENEBLED' +AND WEEK(DATE(ap.created_on),1) = (WEEK(CURDATE(),1)-1) AND + YEAR(Date(ap.created_on)) = YEAR(CURDATE())) as adelantos_total, +-- entradas +(SELECT IF(ISNULL(SUM(ap.amount)),0,SUM(ap.amount)) FROM APC_EXPENSE_COMPANY ap +WHERE ap.id_office = u.id AND ap.active_status = 'ENEBLED' AND +ap.expense_company_type = 'PAYMENT_IN' +AND WEEK(DATE(ap.created_on),1) = (WEEK(CURDATE(),1)-1) AND + YEAR(Date(ap.created_on)) = YEAR(CURDATE())) as entradas_total, +-- gastos admon +(SELECT IF(ISNULL(SUM(ap.amount)),0,SUM(ap.amount)) FROM APC_EXPENSE_COMPANY ap +WHERE ap.id_office = u.id AND ap.active_status = 'ENEBLED' AND +ap.expense_company_type = 'PAYMENT_OUT' +AND WEEK(DATE(ap.created_on),1) = (WEEK(CURDATE(),1)-1) AND + YEAR(Date(ap.created_on)) = YEAR(CURDATE())) as gastos_admon_total +FROM APC_OFFICE u +WHERE u.office_status = 'ENEBLED'; +-- -------------------------------------------------------- +-- +-- Estructura para la vista `` +-- + +-- -------------------------------------------------------- +-- +-- Estructura para la vista `` +-- + +-- -------------------------------------------------------- +-- +-- Estructura para la vista `` +-- + +-- -------------------------------------------------------- +-- +-- Estructura para la vista `` +-- + +-- -------------------------------------------------------- +-- +-- Estructura para la vista `` +-- + +-- -------------------------------------------------------- +-- +-- Estructura para la vista `` +-- + +-- -------------------------------------------------------- +-- +-- Estructura para la vista `` +-- + +-- -------------------------------------------------------- +-- +-- Estructura para la vista `` +-- \ No newline at end of file diff --git a/ace-db/src/cocina-lore-db.sql b/ace-db/src/cocina-lore-db.sql new file mode 100644 index 0000000..d2c927f --- /dev/null +++ b/ace-db/src/cocina-lore-db.sql @@ -0,0 +1,412 @@ +/* + * Arrebol Consultancy copyright. + * + * This code belongs to Arrebol Consultancy + * its use, redistribution or modification are prohibited + * without written authorization from Arrebol Consultancy. + */ +/** + * Author: Oscar Armando Vargas Cardenas + * Created: 19/04/2021 + */ + +SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; +SET AUTOCOMMIT = 0; +START TRANSACTION; +-- SET time_zone = "+00:00"; + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8mb4 */; + +DROP DATABASE IF EXISTS `cocina_lore_db_arrebol`; + +CREATE DATABASE IF NOT EXISTS `cocina_lore_db_arrebol` DEFAULT CHARACTER SET latin1 COLLATE latin1_spanish_ci; +USE `cocina_lore_db_arrebol`; + +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `CL_OFFICE` +-- +CREATE TABLE `CL_OFFICE`( + `id` char(36) NOT NULL, + `office_name` varchar(100) NOT NULL, + `address` varchar(250), + `office_status` ENUM('ENEBLED', 'DISABLED', 'DELETED') NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `cl_office_pk` PRIMARY KEY (`id`), + CONSTRAINT `cl_office_uk` UNIQUE KEY (`office_name`) +)ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `CL_ROLE` +-- +CREATE TABLE `CL_ROLE`( + `id` char(36) NOT NULL, + `role_name` varchar(100) NOT NULL, + `active_status` ENUM('ENEBLED', 'DISABLED') NOT NULL DEFAULT 'ENEBLED', + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `cl_role_pk` PRIMARY KEY (`id`), + CONSTRAINT `cl_role_uk` UNIQUE KEY (`role_name`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `CL_ROUTE` +-- +CREATE TABLE `CL_ROUTE`( + `id` char(36) NOT NULL, + `id_office` char(36) NOT NULL, + `route_name` varchar(25) NOT NULL, + `active_status` ENUM('ENEBLED', 'DISABLED') NOT NULL DEFAULT 'ENEBLED', + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `cl_route_pk` PRIMARY KEY (`id`), + CONSTRAINT `cl_route_uk` UNIQUE KEY (`id_office`,`route_name`), + CONSTRAINT `cl_route_to_cl_office_fk` + FOREIGN KEY (`id_office`) REFERENCES `CL_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `CL_HUMAN_RESOURCES` +-- +CREATE TABLE `CL_HUMAN_RESOURCE` ( + `id` char(36) NOT NULL, + `first_name` varchar(25) NOT NULL, + `second_name` varchar(25) DEFAULT NULL, + `last_name` varchar(25) NOT NULL, + `middle_name` varchar(25) NOT NULL, + `birthdate` date DEFAULT NULL, + `avatar` varchar(150) NOT NULL, + `curp` varchar(20) DEFAULT NULL, + `rfc` varchar(13) DEFAULT NULL, + `ife` varchar(20) DEFAULT NULL, + `admission_date` date DEFAULT NULL, + `human_resource_status` ENUM('ENEBLED', 'DISABLED', 'DELETED') NOT NULL, + `id_role` char(36) NOT NULL, + `payment` numeric(8,2) DEFAULT NULL, + `imss` numeric(8,2) DEFAULT NULL, + `created_by` char(36) DEFAULT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `person_pk` PRIMARY KEY (`id`), + CONSTRAINT `cl_human_resource_to_cl_role_fk` + FOREIGN KEY (`id_role`) REFERENCES `CL_ROLE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `CL_HUMAN_RESOURCE_HAS_ROUTE` +-- +CREATE TABLE `CL_HUMAN_RESOURCE_HAS_ROUTE`( + `id_human_resource` char(36) NOT NULL, + `id_route` char(36) NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `cl_human_resource_has_route_pk` PRIMARY KEY (`id_human_resource`, `id_route`), + CONSTRAINT `cl_human_resource_has_route_to_cl_human_resource_fk` + FOREIGN KEY (`id_human_resource`) REFERENCES `CL_HUMAN_RESOURCE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `cl_human_resource_has_route_to_cl_route_fk` + FOREIGN KEY (`id_route`) REFERENCES `CL_ROUTE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +)ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `CL_PEOPLE` +-- +CREATE TABLE `CL_PEOPLE`( + `id` char(36) NOT NULL, + `first_name` varchar(25) NOT NULL, + `second_name` varchar(25) DEFAULT NULL, + `last_name` varchar(25) NOT NULL, + `middle_name` varchar(25) NOT NULL, + `birthdate` date DEFAULT NULL, + `thumbnail` varchar(250) NOT NULL, + `phone_home` varchar(15) NOT NULL, + `address_home` varchar(150) NOT NULL, + `phone_business` varchar(15), + `address_business` varchar(150), + `company_name` varchar(150), + `people_type` ENUM('CUSTOMER') NOT NULL DEFAULT 'CUSTOMER', + `active_status` ENUM('ENEBLED', 'DISABLED') NOT NULL DEFAULT 'ENEBLED', + `id_office` char(36) NOT NULL, + `id_route` char(36) NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `cl_people_pk` PRIMARY KEY (`id`), + CONSTRAINT `cl_people_to_cl_office_fk` + FOREIGN KEY (`id_office`) REFERENCES `CL_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `cl_people_to_cl_route_fk` + FOREIGN KEY (`id_route`) REFERENCES `CL_ROUTE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +)ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `CL_ORDER` +-- +CREATE TABLE `CL_ORDER`( + `id` char(36) NOT NULL, + `id_customer` char(36) NOT NULL, + `id_route` char(36) NOT NULL, + `order_status` ENUM('PENDING', 'FINISH', 'REJECTED', 'TO_DELIVERY') NOT NULL DEFAULT 'PENDING', + `new_customer` ENUM('ENEBLED', 'DISABLED') DEFAULT 'DISABLED', + `amount_paid` numeric(8,2) NOT NULL, + `amount_to_pay` numeric(8,2) NOT NULL, + `comments` varchar(600), + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36), + `last_updated_on` datetime, + CONSTRAINT `cl_order_pk` PRIMARY KEY (`id`), + CONSTRAINT `cl_order_to_cl_person_as_customer_fk` + FOREIGN KEY (`id_customer`) REFERENCES `CL_PEOPLE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `cl_order_to_cl_route_fk` + FOREIGN KEY (`id_route`) REFERENCES `CL_ROUTE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +)ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `CL_HUMAN_RESOURCE_BY_OFFICE` +-- +CREATE TABLE `CL_HUMAN_RESOURCE_BY_OFFICE`( + `id` char(36) NOT NULL, + `id_human_resource` char(36) NOT NULL, + `id_office` char(36) NOT NULL, + `application_owner` ENUM('APP_OWNER', 'APP_USER') NOT NULL DEFAULT 'APP_USER', + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `cl_human_resource_by_office_pk` PRIMARY KEY (`id`), + CONSTRAINT `cl_human_resource_by_office_uk` UNIQUE KEY (`id_human_resource`, `id_office`), + CONSTRAINT `cl_human_resource_by_office_to_cl_human_resource_fk` + FOREIGN KEY (`id_human_resource`) REFERENCES `CL_HUMAN_RESOURCE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `cl_human_resource_by_office_to_cl_office_fk` + FOREIGN KEY (`id_office`) REFERENCES `CL_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +)ENGINE=InnoDB DEFAULT CHARSET=latin1; + + +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `CL_USER` +-- +CREATE TABLE `CL_USER`( + `id` char(36) NOT NULL, + `id_human_resource` char(36) NOT NULL, + `user_name` varchar(100) NOT NULL, + `pwd` varchar(100)NOT NULL, + `user_type` ENUM('WEB', 'MOBILE', 'BOTH') NOT NULL, + `user_status` ENUM('ENEBLED', 'DISABLED', 'DELETED') NOT NULL, + `application_owner` ENUM('APP_OWNER', 'APP_USER') NOT NULL DEFAULT 'APP_USER', + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `cl_user_pk` PRIMARY KEY (`id`), + CONSTRAINT `cl_user_by_office_to_cl_human_resource_fk` + FOREIGN KEY (`id_human_resource`) REFERENCES `CL_HUMAN_RESOURCE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +)ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `CL_ORDER_BY_USER` +-- +CREATE TABLE `CL_ORDER_BY_USER`( + `id_order` char(36) NOT NULL, + `id_user` char(36) NOT NULL, + `loan_by_user_status` ENUM('PENDING', 'FINISH','REJECTED', 'TO_DELIVERY') NOT NULL DEFAULT 'PENDING', + `comments` varchar(150), + `owner_loan` ENUM('CURRENT_OWNER', 'OLD_OWNER') NOT NULL, + `order_in_list` smallint DEFAULT 0, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `cl_order_by_user_pk` PRIMARY KEY (`id_order`, `id_user`), + CONSTRAINT `cl_order_by_user_to_cl_order_fk` + FOREIGN KEY (`id_order`) REFERENCES `CL_ORDER`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `cl_order_by_user_to_cl_user_fk` + FOREIGN KEY (`id_user`) REFERENCES `CL_USER`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +)ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `CL_USER_BY_OFFICE` +-- +CREATE TABLE `CL_USER_BY_OFFICE`( + `id` char(36) NOT NULL, + `id_user` char(36) NOT NULL, + `id_office` char(36) NOT NULL, + `user_by_office_status` ENUM('ENEBLED', 'DISABLED', 'DELETED') NOT NULL, + `application_owner` ENUM('APP_OWNER', 'APP_USER')NOT NULL DEFAULT 'APP_USER', + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `cl_user_by_office_pk` PRIMARY KEY (`id`), + CONSTRAINT `cl_user_by_office_uk` UNIQUE KEY (`id_user`, `id_office`), + CONSTRAINT `cl_user_by_office_to_cl_user_fk` + FOREIGN KEY (`id_user`) REFERENCES `CL_USER`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `cl_user_by_office_to_cl_office_fk` + FOREIGN KEY (`id_office`) REFERENCES `CL_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +)ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `CL_PERMISSION` +-- +CREATE TABLE `CL_PERMISSION` ( + `id` char(36) NOT NULL, + `permission` varchar(200) NOT NULL, -- dashboard.policy.to.expire.name + `description` varchar(200) NOT NULL, -- dashboard.policy.to.expire.description + `menu_path` varchar(200) NOT NULL, -- dashboard.policy.to.expire.path + `left_to_right_order` smallint NOT NULL, -- Orden en la que aparece el menu principal (Dashboard, AdministraciĆ³n, CatĆ”logo) + `top_to_bottom_order` smallint NOT NULL, -- Orden en la que aparece de arriba hacia abajo + `permission_type` ENUM('PUBLIC', 'PRIVATE', 'EXCLUSIVE') NOT NULL, + `parent_name` varchar(200), + `permission_status` ENUM('ENEBLED', 'DISABLED') NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `cl_permission_pk` PRIMARY KEY (`id`), + CONSTRAINT `cl_permission_uk` UNIQUE KEY (`permission`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `CL_USER_BY_OFFICE_HAS_PERMISSION` +-- +CREATE TABLE `CL_USER_BY_OFFICE_HAS_PERMISSION` ( + `id_user_by_office` char(36) NOT NULL, + `id_permission` char(36) NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `cl_user_by_office_has_permission_pk` PRIMARY KEY (`id_user_by_office`,`id_permission`) , + CONSTRAINT `cl_user_by_office_has_permission_to_cl_user_by_office_fk` + FOREIGN KEY (`id_user_by_office`) REFERENCES `CL_USER_BY_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `cl_user_by_office_has_permission_to_cl_permission_fk` + FOREIGN KEY (`id_permission`) REFERENCES `CL_PERMISSION`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `CL_USER_MOBILE_PREFERECE` +-- +CREATE TABLE `CL_USER_MOBILE_PREFERECE`( + `id` char(36) NOT NULL, + `id_user` char(36) NOT NULL, + `preference_name` varchar(25) NOT NULL, + `preference_value` varchar(25) NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `cl_user_mobile_preference_pk` PRIMARY KEY (`id`), + CONSTRAINT `cl_user_mobile_preference_uk` UNIQUE KEY (`id_user`,`preference_name`), + CONSTRAINT `cl_user_mobile_preference_to_cl_user_fk` + FOREIGN KEY (`id_user`) REFERENCES `CL_USER`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +)ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- + +-- ------------------------------------------------------------- +-- +-- Estructura para la vista `CL_SECURITY_AUTHENTICATION` (USER) +-- +CREATE OR REPLACE VIEW `CL_SECURITY_AUTHENTICATION` AS +SELECT CONCAT(`usr`.`user_name`,`ubo`.`id_office`) AS `user_name`, `usr`.`pwd` AS `pwd` +FROM `CL_USER_BY_OFFICE` `ubo` +INNER JOIN `CL_USER` `usr` ON `ubo`.`id_user` = `usr`.`id` +INNER JOIN `CL_HUMAN_RESOURCE` `hr` ON `usr`.`id_human_resource` = `hr`.`id` +WHERE +`usr`.`user_status` = 'ENEBLED' AND +`usr`.`user_type` IN ('WEB', 'BOTH') AND +`ubo`.`user_by_office_status` = 'ENEBLED' AND +`hr`.`human_resource_status` = 'ENEBLED'; +-- ------------------------------------------------------------ +-- +-- Estructura para la vista `CL_SECURITY_AUTHORIZATION` (ROLE) +-- +CREATE OR REPLACE VIEW `CL_SECURITY_AUTHORIZATION` AS +SELECT CONCAT(`usr`.`user_name`,`ubo`.`id_office`) AS `user_name`, `perm`.`permission` AS `permission` +FROM `CL_PERMISSION` `perm` +INNER JOIN `CL_USER_BY_OFFICE_HAS_PERMISSION` `ubohp` ON `perm`.`id` = `ubohp`.`id_permission` +INNER JOIN `CL_USER_BY_OFFICE` `ubo` ON `ubohp`.`id_user_by_office` = `ubo`.`id` +INNER JOIN `CL_USER` `usr` ON `ubo`.`id_user` = `usr`.`id` +INNER JOIN `CL_HUMAN_RESOURCE` `hr` ON `usr`.`id_human_resource` = `hr`.`id` +WHERE +`perm`.`permission_status` = 'ENEBLED' AND +`ubo`.`user_by_office_status` = 'ENEBLED' AND +`usr`.`user_status` = 'ENEBLED' AND +`usr`.`user_type` IN ('WEB', 'BOTH') AND +`hr`.`human_resource_status` = 'ENEBLED' +ORDER BY `user_name`; +-- ------------------------------------------------------------------- +-- +-- Estructura para la vista `CL_SECURITY_AUTHENTICATION_MOBILE` (USER) +-- +CREATE OR REPLACE VIEW `CL_SECURITY_AUTHENTICATION_MOBILE` AS +SELECT +`usr`.`id` AS `id`, +`usr`.`user_name` AS `user_name`, +`usr`.`pwd` AS `pwd`, +`hr`.`avatar` AS `avatar`, +`ubo`.`id_office` AS `id_office`, +`hrhr`.`id_route` AS `id_route` +FROM `CL_USER_BY_OFFICE` `ubo` +INNER JOIN `CL_USER` `usr` ON `ubo`.`id_user` = `usr`.`id` +INNER JOIN `CL_HUMAN_RESOURCE` `hr` ON `usr`.`id_human_resource` = `hr`.`id` +INNER JOIN `CL_HUMAN_RESOURCE_HAS_ROUTE` `hrhr` ON `hr`.`id` = `hrhr`.`id_human_resource` +WHERE +`usr`.`user_status` = 'ENEBLED' AND +`usr`.`user_type` IN ('MOBILE', 'BOTH') AND +`ubo`.`user_by_office_status` = 'ENEBLED' AND +`hr`.`human_resource_status` = 'ENEBLED'; + diff --git a/ace-db/src/create/from/scratch/apc-config-db-aws.sql b/ace-db/src/create/from/scratch/apc-config-db-aws.sql new file mode 100644 index 0000000..2d082af --- /dev/null +++ b/ace-db/src/create/from/scratch/apc-config-db-aws.sql @@ -0,0 +1,134 @@ +-- -------------------------------------------------------- +-- Arrebol Consuntancy +-- version 1.0.1 +-- http://www.arrebolconsultancy.com +-- -------------------------------------------------------- + +SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; +SET AUTOCOMMIT = 0; +START TRANSACTION; +-- SET time_zone = "+00:00"; + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8mb4 */; + +-- -------------------------------------------------------- + +-- +-- Base de datos: `apo_pro_com_april_ten` +-- +USE `apo_pro_com_april_ten`; + +-- -------------------------------------------------------- + +-- +-- Drop users: apoprocom & errortrace +-- +DROP USER IF EXISTS 'apoprocom'@'%'; +DROP USER IF EXISTS 'errortrace'@'%'; +DROP USER IF EXISTS 'apoprocommobile'@'%'; +DROP USER IF EXISTS 'apcreportdesktop'@'%'; +-- -------------------------------------------------------- + +-- +-- App user: `apoprocom` application user +-- + +CREATE USER 'apoprocom'@'%' + IDENTIFIED BY 'Yj$2Da0z!'; + +GRANT SELECT ON apo_pro_com_april_ten.* TO 'apoprocom'@'%'; +GRANT INSERT, UPDATE, DELETE ON apo_pro_com_april_ten.* TO 'apoprocom'@'%'; +GRANT EXECUTE ON apo_pro_com_april_ten.* TO 'apoprocom'@'%'; + +-- -------------------------------------------------------- + +-- +-- Error trace user: `errortrace` DB user +-- + +-- -------------------------------------------------------- + +CREATE USER 'errortrace'@'%' + IDENTIFIED BY 'zy61$Jql'; +GRANT ALL ON apo_pro_com_april_ten.APC_ERROR_APP_LOG TO 'errortrace'@'%'; + +-- -------------------------------------------------------- + +-- +-- Error trace user: `apoprocommobile` DB user +-- + +-- -------------------------------------------------------- + +CREATE USER 'apoprocommobile'@'%' + IDENTIFIED BY '0Ps$6%q8'; + +GRANT SELECT, INSERT ON apo_pro_com_april_ten.APC_LOAN_FEE_NOTIFICATION TO 'apoprocommobile'@'%'; +GRANT SELECT, INSERT ON apo_pro_com_april_ten.APC_DELIVERY TO 'apoprocommobile'@'%'; +GRANT SELECT, INSERT ON apo_pro_com_april_ten.APC_OTHER_EXPENSE TO 'apoprocommobile'@'%'; + +GRANT SELECT, INSERT, UPDATE ON apo_pro_com_april_ten.APC_LOAN_DETAIL TO 'apoprocommobile'@'%'; +GRANT SELECT, INSERT, UPDATE ON apo_pro_com_april_ten.APC_LOAN_BY_RENOVATION TO 'apoprocommobile'@'%'; +GRANT SELECT, INSERT, UPDATE ON apo_pro_com_april_ten.APC_LOAN_BY_USER TO 'apoprocommobile'@'%'; +GRANT SELECT, INSERT, UPDATE ON apo_pro_com_april_ten.APC_USER_MOBILE_PREFERECE TO 'apoprocommobile'@'%'; +GRANT SELECT, INSERT, UPDATE ON apo_pro_com_april_ten.APC_PEOPLE TO 'apoprocommobile'@'%'; +GRANT SELECT, INSERT, UPDATE ON apo_pro_com_april_ten.APC_LOAN TO 'apoprocommobile'@'%'; +GRANT SELECT, INSERT, UPDATE ON apo_pro_com_april_ten.APC_TRANSFER TO 'apoprocommobile'@'%'; +GRANT SELECT, INSERT, UPDATE ON apo_pro_com_april_ten.APC_GASOLINE TO 'apoprocommobile'@'%'; +-- SELECT +GRANT SELECT ON apo_pro_com_april_ten.APC_OFFICE TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_USER TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_LOAN_TYPE TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_MONEY_DAILY TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_CLOSING_DAY TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_HUMAN_RESOURCE_HAS_ROUTE TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_ROUTE TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_USER_BY_OFFICE TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_HUMAN_RESOURCE TO 'apoprocommobile'@'%'; +GRANT SELECT, UPDATE ON apo_pro_com_april_ten.APC_STABLE_GENERAL_BOX TO 'apoprocommobile'@'%'; +GRANT SELECT, UPDATE ON apo_pro_com_april_ten.APC_STABLE_SMALL_BOX TO 'apoprocommobile'@'%'; +GRANT SELECT, UPDATE ON apo_pro_com_april_ten.APC_CLOSING_DAY TO 'apoprocommobile'@'%'; +GRANT SELECT, INSERT ON apo_pro_com_april_ten.APC_BITACORA TO 'apoprocommobile'@'%'; +-- Views +GRANT SELECT ON apo_pro_com_april_ten.APC_SECURITY_AUTHENTICATION_MOBILE TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_LOAN_BY_USER_VIEW TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_LOAN_BY_USER_ORDER_PREFERENCE_VIEW TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_PERSON_SEARCH_VIEW TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_PERSON_SEARCH_DETAIL_VIEW TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_AVAILABLE_CUSTOMERS_VIEW TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_AVAILABLE_ENDORSEMENTS_VIEW TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_CASH_REGISTER_CURDATE_BY_USER_VIEW TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_LOAN_TO_DELIVERY_BY_CERTIFIER_VIEW TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_EXCHANGE_ENEBLED_USERS_VIEW TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_TOTAL_CASH_BY_CURDATE_VIEW TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_PERSON_SEARCH_HISTORICAL_DETAILS_VIEW TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_LOAN_APPROVED_DETAIL_VIEW TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_USER_WEEK_REPORT_VIEW TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_LOAN_DETAIL_ZERO_VIEW TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_LOAN_FINISHED_VIEW TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_ADVANCE_USER_DAILY_DASHBOARD_VIEW TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_TRANSFER_IN_PENDING_STATUS_VIEW TO 'apoprocommobile'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_LOAN_IN_PENDING_STATUS_TO_DELIVERY_VIEW TO 'apoprocommobile'@'%'; +-- ---------------------------------------------------------------------- +GRANT ALL ON apo_pro_com_april_ten.ARREBOL_TEST TO 'apoprocommobile'@'%'; +-- -------------------------------------------------------- + +-- +-- App user: `apcreportdesktop` report desktop user +-- + +CREATE USER 'apcreportdesktop'@'%' + IDENTIFIED BY 'hY5znQ8j'; + +GRANT SELECT ON apo_pro_com_april_ten.APC_USER TO 'apcreportdesktop'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_HUMAN_RESOURCE TO 'apcreportdesktop'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_TOTAL_CASH_BY_CURDATE_VIEW TO 'apcreportdesktop'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_CLOSING_DAILY_DETAIL_FROM_USER_BY_CURDATE_VIEW TO 'apcreportdesktop'@'%'; +GRANT SELECT ON apo_pro_com_april_ten.APC_CLOSING_DAILY_DETAIL_FROM_USER_BY_CURDATE_VIEW_REPORT TO 'apcreportdesktop'@'%'; +-- ---------------------------------------------------------------------- +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; \ No newline at end of file diff --git a/ace-db/src/create/from/scratch/apc-config-db-localhost.sql b/ace-db/src/create/from/scratch/apc-config-db-localhost.sql new file mode 100644 index 0000000..e03e3dc --- /dev/null +++ b/ace-db/src/create/from/scratch/apc-config-db-localhost.sql @@ -0,0 +1,136 @@ +-- -------------------------------------------------------- +-- Arrebol Consuntancy +-- version 1.0.1 +-- http://www.arrebolconsultancy.com +-- -------------------------------------------------------- + +SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; +SET AUTOCOMMIT = 0; +START TRANSACTION; +-- SET time_zone = "+00:00"; + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8mb4 */; + +-- -------------------------------------------------------- + +-- +-- Base de datos: `apo_pro_com_april_ten` +-- +USE `apo_pro_com_april_ten`; + +-- -------------------------------------------------------- + +-- +-- Drop users: apoprocomlocalhost & errortracelocalhost +-- +DROP USER IF EXISTS 'apoprocomlocalhost'@'localhost'; +DROP USER IF EXISTS 'errortracelocalhost'@'localhost'; +DROP USER IF EXISTS 'apoprocommobilelocalhost'@'localhost'; +DROP USER IF EXISTS 'apcreportdesktop'@'localhost'; +-- -------------------------------------------------------- + +-- +-- App user: `apoprocomlocalhost` application user +-- + +CREATE USER 'apoprocomlocalhost'@'localhost' + IDENTIFIED BY 'Yj$2Da0z!'; + +GRANT SELECT ON apo_pro_com_april_ten.* TO 'apoprocomlocalhost'@'localhost'; +GRANT INSERT, UPDATE, DELETE ON apo_pro_com_april_ten.* TO 'apoprocomlocalhost'@'localhost'; +GRANT EXECUTE ON apo_pro_com_april_ten.* TO 'apoprocomlocalhost'@'localhost'; + +-- -------------------------------------------------------- + +-- +-- Error trace user: `errortracelocalhost` DB user +-- + +-- -------------------------------------------------------- + +CREATE USER 'errortracelocalhost'@'localhost' + IDENTIFIED BY 'zy61$Jql'; +GRANT ALL ON apo_pro_com_april_ten.APC_ERROR_APP_LOG TO 'errortracelocalhost'@'localhost'; + +-- -------------------------------------------------------- + +-- +-- Error trace user: `apoprocommobilelocalhost` DB user +-- + +-- -------------------------------------------------------- + +CREATE USER 'apoprocommobilelocalhost'@'localhost' + IDENTIFIED BY '0Ps$6%q8'; + + +GRANT SELECT, INSERT, DELETE ON apo_pro_com_april_ten.APC_LOAN_DETAIL TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT, INSERT, DELETE ON apo_pro_com_april_ten.APC_LOAN_FEE_NOTIFICATION TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT, INSERT ON apo_pro_com_april_ten.APC_DELIVERY TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT, INSERT ON apo_pro_com_april_ten.APC_OTHER_EXPENSE TO 'apoprocommobilelocalhost'@'localhost'; + +GRANT SELECT, INSERT, UPDATE ON apo_pro_com_april_ten.APC_LOAN_DETAIL TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT, INSERT, UPDATE ON apo_pro_com_april_ten.APC_LOAN_BY_RENOVATION TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT, INSERT, UPDATE ON apo_pro_com_april_ten.APC_LOAN_BY_USER TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT, INSERT, UPDATE ON apo_pro_com_april_ten.APC_USER_MOBILE_PREFERECE TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT, INSERT, UPDATE ON apo_pro_com_april_ten.APC_PEOPLE TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT, INSERT, UPDATE ON apo_pro_com_april_ten.APC_LOAN TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT, INSERT, UPDATE ON apo_pro_com_april_ten.APC_TRANSFER TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT, INSERT, UPDATE ON apo_pro_com_april_ten.APC_GASOLINE TO 'apoprocommobilelocalhost'@'localhost'; +-- SELECT +GRANT SELECT ON apo_pro_com_april_ten.APC_OFFICE TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_USER TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_LOAN_TYPE TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_MONEY_DAILY TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_CLOSING_DAY TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_HUMAN_RESOURCE_HAS_ROUTE TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_ROUTE TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_USER_BY_OFFICE TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_HUMAN_RESOURCE TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT, UPDATE ON apo_pro_com_april_ten.APC_STABLE_GENERAL_BOX TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT, UPDATE ON apo_pro_com_april_ten.APC_STABLE_SMALL_BOX TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT, UPDATE ON apo_pro_com_april_ten.APC_CLOSING_DAY TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT, INSERT ON apo_pro_com_april_ten.APC_BITACORA TO 'apoprocommobilelocalhost'@'localhost'; +-- Views +GRANT SELECT ON apo_pro_com_april_ten.APC_SECURITY_AUTHENTICATION_MOBILE TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_LOAN_BY_USER_VIEW TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_LOAN_BY_USER_ORDER_PREFERENCE_VIEW TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_PERSON_SEARCH_VIEW TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_PERSON_SEARCH_DETAIL_VIEW TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_AVAILABLE_CUSTOMERS_VIEW TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_AVAILABLE_ENDORSEMENTS_VIEW TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_CASH_REGISTER_CURDATE_BY_USER_VIEW TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_LOAN_TO_DELIVERY_BY_CERTIFIER_VIEW TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_EXCHANGE_ENEBLED_USERS_VIEW TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_TOTAL_CASH_BY_CURDATE_VIEW TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_PERSON_SEARCH_HISTORICAL_DETAILS_VIEW TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_LOAN_APPROVED_DETAIL_VIEW TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_USER_WEEK_REPORT_VIEW TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_LOAN_DETAIL_ZERO_VIEW TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_LOAN_FINISHED_VIEW TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_ADVANCE_USER_DAILY_DASHBOARD_VIEW TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_TRANSFER_IN_PENDING_STATUS_VIEW TO 'apoprocommobilelocalhost'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_LOAN_IN_PENDING_STATUS_TO_DELIVERY_VIEW TO 'apoprocommobilelocalhost'@'localhost'; +-- ------------------------------------------------------------------------------------- +GRANT ALL ON apo_pro_com_april_ten.ARREBOL_TEST TO'apoprocommobilelocalhost'@'localhost'; +-- -------------------------------------------------------- + +-- +-- App user: `apcreportdesktop` report desktop user +-- + +CREATE USER 'apcreportdesktop'@'localhost' + IDENTIFIED BY 'hY5znQ8j'; + +GRANT SELECT ON apo_pro_com_april_ten.APC_USER TO 'apcreportdesktop'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_HUMAN_RESOURCE TO 'apcreportdesktop'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_TOTAL_CASH_BY_CURDATE_VIEW TO 'apcreportdesktop'@'localhost'; +GRANT SELECT ON apo_pro_com_april_ten.APC_CLOSING_DAILY_DETAIL_FROM_USER_BY_CURDATE_VIEW TO 'apcreportdesktop'@'localhost'; + +-- ------------------------------------------------------------------------------------- +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; \ No newline at end of file diff --git a/ace-db/src/create/from/scratch/apc-db-init-populate.sql b/ace-db/src/create/from/scratch/apc-db-init-populate.sql new file mode 100644 index 0000000..66a297d --- /dev/null +++ b/ace-db/src/create/from/scratch/apc-db-init-populate.sql @@ -0,0 +1,293 @@ +-- -------------------------------------------------------- +-- Arrebol Consuntancy +-- version 1.0.1 +-- http://www.arrebolconsultancy.com +-- -------------------------------------------------------- + +SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; +SET AUTOCOMMIT = 0; +START TRANSACTION; +-- SET time_zone = "+00:00"; + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8mb4 */; + +-- -------------------------------------------------------- + +-- +-- Base de datos: Select `apo_pro_com_april_ten` DB +-- +USE `apo_pro_com_april_ten`; +-- -------------------------------------------------------- +-- +-- Volcado de datos para la tabla `APC_ROLE` +-- +INSERT INTO APC_ROLE(id,role_name,active_status,created_by) +VALUES +('56dd386a-88c8-11ea-a6b0-82987069bf80','DIRECTOR GENERAL','ENEBLED','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('b9c76e82-88c8-11ea-a6b0-82987069bf80','GERENCIA','ENEBLED','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('e7fbf750-88c8-11ea-a6b0-82987069bf80','SUPERVISOR REGIONAL','ENEBLED','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('ee39d1aa-88c8-11ea-a6b0-82987069bf80','CERTIFICADOR Y FACILITADOR DE CREDITO','ENEBLED','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('3e07c998-a81e-11ea-aa38-77eb3547c70f','JEFE DE ASESORES','ENEBLED','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('b5b506f9-3ca4-4ceb-b938-dc58da3f039b','ASESORES DE CREDITO Y COBRANZA','ENEBLED','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('e67360db-5953-46ba-9fe1-d71e30ae9b59','JURIDICO','ENEBLED','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('b691aea2-3ba5-4e4d-a256-37f749a310bd','JEFE DE PERSONAL PRO FAM','ENEBLED','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('44cb12f9-19e6-439a-9cd9-abdf4af38651','EJECUTIVO DE RUTA PRO FAM','ENEBLED','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('23259ba5-7a0e-4503-a470-b8bd900635e1','AUXILIAR DE RUTA PRO FAM.','ENEBLED','0dc7c246-7db8-11ea-9b1f-500320958bf8'); +-- -------------------------------------------------------- +-- +-- Volcado de datos para la tabla `APC_HUMAN_RESOURCE` +-- +INSERT INTO APC_HUMAN_RESOURCE(id,first_name,second_name,last_name,middle_name,birthdate,avatar,human_resource_status, id_role ,created_by) +VALUES +('13c588a6-7d1b-11ea-af3e-28f659da398e','Ruben','','Campos','Bueno',str_to_date('1977-03-02','%Y-%m-%d'),'images/avatar1.png','ENEBLED','b9c76e82-88c8-11ea-a6b0-82987069bf80','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('c021214a-8bc7-11ea-b45c-c7b846343364','Hector','Alonso','Ubaldo','Nolasco',str_to_date('1977-03-02','%Y-%m-%d'),'https://freisteller24.eu/wp-content/uploads/2017/11/26603674-1200x1200.jpg','ENEBLED','b5b506f9-3ca4-4ceb-b938-dc58da3f039b','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('d2869da6-8bc7-11ea-b45c-c7b846343364','Juan','Carlos','Campos','Campos',str_to_date('1977-03-02','%Y-%m-%d'),'https://freisteller24.eu/wp-content/uploads/2017/11/97783667-1200x1200.jpg','ENEBLED','b5b506f9-3ca4-4ceb-b938-dc58da3f039b','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('088d7268-8bc7-11ea-b45c-c7b846343364','Avatar 4','Avatar 4','Campos','Campos',str_to_date('1977-03-02','%Y-%m-%d'),'https://freisteller24.eu/wp-content/uploads/2017/10/573675226-1200x1200.jpg','ENEBLED','ee39d1aa-88c8-11ea-a6b0-82987069bf80','0dc7c246-7db8-11ea-9b1f-500320958bf8'); +-- -------------------------------------------------------- +-- +-- Volcado de datos para la tabla `APC_OFFICE` +-- +INSERT INTO APC_OFFICE(id,office_name,office_status,created_by) +VALUES +-- Tepic +('caef3a64-7d1f-11ea-af3e-28f659da398e','TEPIC','ENEBLED','0dc7c246-7db8-11ea-9b1f-500320958bf8'); +-- -------------------------------------------------------- +-- +-- Add APC_HUMAN_RESOURCE_BY_OFFICE +-- +INSERT INTO APC_HUMAN_RESOURCE_BY_OFFICE(id,id_human_resource,id_office,application_owner,created_by) +VALUES +-- Ruben +('e540fd40-8246-11ea-9f9f-a9ab5ed40dc4','13c588a6-7d1b-11ea-af3e-28f659da398e','caef3a64-7d1f-11ea-af3e-28f659da398e','APP_OWNER','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +-- Hector Tepic +('14affe8c-8247-11ea-9f9f-a9ab5ed40dc4','c021214a-8bc7-11ea-b45c-c7b846343364','caef3a64-7d1f-11ea-af3e-28f659da398e','APP_USER','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +-- Juan Tepic +('f41be05a-8246-11ea-9f9f-a9ab5ed40dc4','d2869da6-8bc7-11ea-b45c-c7b846343364','caef3a64-7d1f-11ea-af3e-28f659da398e','APP_USER','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +-- Certificador Tepic +('0a8cf342-8247-11ea-9f9f-a9ab5ed40dc4','088d7268-8bc7-11ea-b45c-c7b846343364','caef3a64-7d1f-11ea-af3e-28f659da398e','APP_USER','0dc7c246-7db8-11ea-9b1f-500320958bf8'); +-- -------------------------------------------------------- +-- +-- Volcado de datos para la tabla `APC_USER` +-- +INSERT INTO APC_USER(id,id_human_resource,user_name,pwd,user_type,user_status,application_owner,created_by,certifier) +VALUES +-- Ruben WEB +('5751074e-7d1b-11ea-af3e-28f659da398e','13c588a6-7d1b-11ea-af3e-28f659da398e','ejecutivo','8478A4A2819E9C06AB738123C5D04B4FA1AA67548EBA64EAD40B635EA8AA8D5B','WEB','ENEBLED','APP_OWNER','0dc7c246-7db8-11ea-9b1f-500320958bf8','DISABLED'), +-- Hector MOBILE +('092a95d8-7db8-11ea-9b1f-500320958bf8','c021214a-8bc7-11ea-b45c-c7b846343364','ruta3','8478A4A2819E9C06AB738123C5D04B4FA1AA67548EBA64EAD40B635EA8AA8D5B','MOBILE','ENEBLED','APP_USER','0dc7c246-7db8-11ea-9b1f-500320958bf8','DISABLED'), +-- Juan MOBILE +('0dc7c246-7db8-11ea-9b1f-500320958bf8','d2869da6-8bc7-11ea-b45c-c7b846343364','ruta7','8478A4A2819E9C06AB738123C5D04B4FA1AA67548EBA64EAD40B635EA8AA8D5B','MOBILE','ENEBLED','APP_USER','0dc7c246-7db8-11ea-9b1f-500320958bf8','DISABLED'), +-- Certificador MOBILE +('67b3081e-8bc9-11ea-b45c-c7b846343364','088d7268-8bc7-11ea-b45c-c7b846343364','certificador','8478A4A2819E9C06AB738123C5D04B4FA1AA67548EBA64EAD40B635EA8AA8D5B','MOBILE','ENEBLED','APP_USER','0dc7c246-7db8-11ea-9b1f-500320958bf8','ENEBLED'); +-- -------------------------------------------------------- +-- +-- Add APC_USER_BY_OFFICE +-- +INSERT INTO APC_USER_BY_OFFICE(id,id_user,id_office,user_by_office_status,application_owner,created_by) +VALUES +-- Ruben Tepic +('a742dfe8-7d20-11ea-af3e-28f659da398e','5751074e-7d1b-11ea-af3e-28f659da398e','caef3a64-7d1f-11ea-af3e-28f659da398e','ENEBLED','APP_OWNER','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +-- Hector Tepic +('d855f570-7dbb-11ea-9b1f-500320958bf8','092a95d8-7db8-11ea-9b1f-500320958bf8','caef3a64-7d1f-11ea-af3e-28f659da398e','ENEBLED','APP_USER','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +-- Juan Tepic +('eca3f824-7dbb-11ea-9b1f-500320958bf8','0dc7c246-7db8-11ea-9b1f-500320958bf8','caef3a64-7d1f-11ea-af3e-28f659da398e','ENEBLED','APP_USER','0dc7c246-7db8-11ea-9b1f-500320958bf8'), +-- Certificador Tepic +('e5a44222-7dbb-11ea-9b1f-500320958bf8','67b3081e-8bc9-11ea-b45c-c7b846343364','caef3a64-7d1f-11ea-af3e-28f659da398e','ENEBLED','APP_USER','0dc7c246-7db8-11ea-9b1f-500320958bf8'); +-- -------------------------------------------------------- +-- +-- Add APC_PERMISSION +-- +INSERT INTO `APC_PERMISSION` (`id`, `permission`, `description`, `menu_path`, `left_to_right_order`, `top_to_bottom_order` , `permission_type`, `permission_status`,`created_by`) +VALUES +('7a6cbba2-7dba-11ea-9b1f-500320958bf8','public.access', 'public.access.description', 'public.access.path', 0, 10,'PUBLIC', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('001055b6-804f-11ea-bd33-54754d23c678','system.employee', 'system.employee.description', 'system.employee.path', 10, 10,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('7f116c66-7dba-11ea-9b1f-500320958bf8','system.user.create', 'system.user.create.description', 'system.user.create.path', 10, 20,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('87d3d32a-7dba-11ea-9b1f-500320958bf8','system.user.admin', 'system.user.admin.description', 'system.user.admin.path', 10, 30,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('8c54a1f4-7dba-11ea-9b1f-500320958bf8','system.user.access', 'system.user.access.description', 'system.user.access.path', 10, 40,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('3697f4e3-6a7d-46df-9618-60c632e3e472','catalog.role', 'catalog.role.description', 'catalog.role.path', 10, 50,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('572bccc2-4848-4dad-b63c-ddf6f29c14f7','catalog.typeLoan', 'catalog.typeLoan.description', 'catalog.typeLoan.path', 10, 60,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('7f139dd9-a1fb-42a4-866c-e70b4d84587a','catalog.route', 'catalog.route.description', 'catalog.route.path', 10, 70,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('58ef9e12-13b3-4a7d-a5ad-fd0db3557d3c','admin.customer', 'admin.customer.description', 'admin.customer.path', 10, 80,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('45f2cd84-98df-4991-be77-3f22dfa7d4b2','admin.endorsement', 'admin.endorsement.description', 'admin.endorsement.path', 10, 90,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('e492bbf5-b25e-4ff2-b126-dc92a733e921','admin.loan', 'admin.loan.description', 'admin.loan.path', 10, 100,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('fee9d1d9-3961-4dfa-a8e2-56eccae1e347','admin.transfer', 'admin.transfer.description', 'admin.transfer.path', 10, 100,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('7a8d71b0-1d2b-43ae-b7f7-fd048929ae8e','admin.moneyDaily', 'admin.moneyDaily.description', 'admin.moneyDaily.path', 10, 100,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('55a79bce-9466-44f8-8a13-7b69f176b80b','admin.closingDay', 'admin.closingDay.description', 'admin.closingDay.path', 10, 100,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('04d9cf0f-b8e9-46fb-9b77-b301dec9c533','admin.otherExpense', 'admin.otherExpense.description', 'admin.otherExpense.path', 10, 100,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('f01aeaac-8b18-4eb5-95ae-d02ae5a0716d','admin.goal', 'admin.goal.description', 'admin.goal.path', 10, 100,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('6c2ec1ce-9163-42b4-bbf1-8448e3894d55','admin.bonus', 'admin.bonus.description', 'admin.bonus.path', 10, 100,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('9067f64e-b2eb-4361-9c9b-c6dccc29e67f','admin.advance', 'admin.advance.description', 'admin.advance.path', 10, 100,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'), +('de5d48ac-2242-4937-95e2-1140b987b8c2','system.office', 'system.office.description', 'system.office.path', 10, 110,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'); +-- Permission by role +INSERT INTO `APC_PERMISSION` (`id`, `permission`, `description`, `menu_path`, `left_to_right_order`, `top_to_bottom_order` , `permission_type`, `permission_status`,`created_by`, `parent_name`) +VALUES +-- employee +('dcfafbee-82a1-11ea-a6b6-200fe86028a8','system.employee.add', 'system.employee.add.description', 'system.employee.add.path', 10, 11,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','system.employee'), +('e2ea92a8-82a1-11ea-a6b6-200fe86028a8','system.employee.enebled', 'system.employee.enebled.description', 'system.employee.enebled.path', 10, 12,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','system.employee'), +('eb530786-82a1-11ea-a6b6-200fe86028a8','system.employee.disabled', 'system.employee.disabled.description', 'system.employee.disabled.path', 10, 13,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','system.employee'), +('f2245ed4-82a1-11ea-a6b6-200fe86028a8','system.employee.deleted', 'system.employee.deleted.description', 'system.employee.deleted.path', 10, 14,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','system.employee'), +('fec3b7a2-82a1-11ea-a6b6-200fe86028a8','system.employee.updated', 'system.employee.updated.description', 'system.employee.updated.path', 10, 15,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','system.employee'), +-- user create +('065b2432-82a2-11ea-a6b6-200fe86028a8','system.user.create.permission', 'system.user.create.permission.description', 'system.user.create.permission.path', 10, 21,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','system.user.create'), +('10d740d0-82a2-11ea-a6b6-200fe86028a8','system.user.admin.enebled', 'system.user.admin.enebled.description', 'system.user.admin.enebled.path', 10, 31,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','system.user.admin'), +('36b619fe-82fa-11ea-a6b6-200fe86028a8','system.user.admin.disabled', 'system.user.admin.disabled.description', 'system.user.admin.disabled.path', 10, 32,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','system.user.admin'), +('2fcf2806-82fa-11ea-a6b6-200fe86028a8','system.user.admin.deleted', 'system.user.admin.deleted.description', 'system.user.admin.deleted.path', 10, 33,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','system.user.admin'), +('282079e8-82fa-11ea-a6b6-200fe86028a8','system.user.admin.updated', 'system.user.admin.updated.description', 'system.user.admin.updated.path', 10, 34,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','system.user.admin'), +('176d3744-82fa-11ea-a6b6-200fe86028a8','system.user.admin.pwd', 'system.user.admin.pwd.description', 'system.user.admin.pwd.path', 10, 35,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','system.user.admin'), +('1fecd260-82a2-11ea-a6b6-200fe86028a8','system.user.admin.avatar', 'system.user.admin.avatar.description', 'system.user.admin.avatar.path', 10, 36,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','system.user.admin'), +-- office +('c5ef3b18-6cc2-4d62-88ba-41304c6ae9c8','system.office.add', 'system.office.add.description', 'system.office.add.path', 10, 111,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','system.user.admin'), +('037ea752-c33f-4bfe-ae84-da867de0d7cd','system.office.updated', 'system.office.updated.description', 'system.office.updated.path', 10, 112,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','system.user.admin'), +('65399669-44da-4e17-9217-c6b89c1f0a61','system.office.deleted', 'system.office.deleted.description', 'system.office.deleted.path', 10, 113,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','system.user.admin'); + +INSERT INTO `APC_PERMISSION` (`id`, `permission`, `description`, `menu_path`, `left_to_right_order`, `top_to_bottom_order` , `permission_type`, `permission_status`,`created_by`, `parent_name`) +VALUES +-- role +('96f78612-1e06-47cf-a282-f4f1a14f8e0d','catalog.role.add', 'catalog.role.add.description', 'catalog.role.add.path', 10, 51,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','catalog.role'), +('1c8175f5-dcde-4611-b2d7-9b79a68b3f0c','catalog.role.updated', 'catalog.role.updated.description', 'catalog.role.updated.path', 10, 52,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','catalog.role'), +('4c11f842-6c29-4d18-a58c-595df41afaa0','catalog.role.deleted', 'catalog.role.deleted.description', 'catalog.role.deleted.path', 10, 53,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','catalog.role'), +-- type loan +('29445731-3e36-427b-a14a-ee53b9699582','catalog.typeLoan.add', 'catalog.typeLoan.add.description', 'catalog.typeLoan.add.path', 10, 61,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','catalog.typeLoan'), +('39482063-a243-490b-bb78-0c0599bce30e','catalog.typeLoan.updated', 'catalog.typeLoan.updated.description', 'catalog.typeLoan.updated.path', 10, 62,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','catalog.typeLoan'), +('c573acd1-cb14-4464-8bbc-b962dbb0bc62','catalog.typeLoan.deleted', 'catalog.typeLoan.deleted.description', 'catalog.typeLoan.deleted.path', 10, 63,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','catalog.typeLoan'), +-- route +('ab812966-4df0-4462-a9e2-a2c364cf97f1','catalog.route.add', 'catalog.route.add.description', 'catalog.route.add.path', 10, 71,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','catalog.route'), +('886ab08d-9494-4ae4-8635-4a6b4363cdf7','catalog.route.updated', 'catalog.route.updated.description', 'catalog.route.updated.path', 10, 72,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','catalog.route'), +('629c0be7-b3a9-49f5-9c20-3f6681a4b6d3','catalog.route.deleted', 'catalog.route.deleted.description', 'catalog.route.deleted.path', 10, 73,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','catalog.route'); + +INSERT INTO `APC_PERMISSION` (`id`, `permission`, `description`, `menu_path`, `left_to_right_order`, `top_to_bottom_order` , `permission_type`, `permission_status`,`created_by`, `parent_name`) +VALUES +-- customer +('65928cb3-f463-4266-9d29-bc29c560c891','admin.customer.add', 'admin.customer.add.description', 'admin.customer.add.path', 10, 81,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.customer'), +('b209327b-f568-4783-8da1-7d45b88fd65b','admin.customer.updated', 'admin.customer.updated.description', 'admin.customer.updated.path', 10, 82,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.customer'), +('6aeb69ff-bb96-4ab9-9d07-8a3b237cfc9e','admin.customer.deleted', 'admin.customer.deleted.description', 'admin.customer.deleted.path', 10, 83,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.customer'), +-- endorsement +('8bee00dc-199f-43c5-8e83-5d670502552b','admin.endorsement.add', 'admin.endorsement.add.description', 'admin.endorsement.add.path', 10, 91,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.endorsement'), +('d16b9b0b-7c4d-456a-a257-ed67586226b0','admin.endorsement.updated', 'admin.endorsement.updated.description', 'admin.endorsement.updated.path', 10, 92,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.endorsement'), +('b57da38c-ba69-4d1e-944f-0dd1f11d816f','admin.endorsement.deleted', 'admin.endorsement.deleted.description', 'admin.endorsement.deleted.path', 10, 93,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.endorsement'), +-- loan +('cca7b7e8-2d41-471b-bb81-c4ca518294dc','admin.loan.add', 'admin.loan.add.description', 'admin.loan.add.path', 10, 101,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.loan'), +('55fd99c6-8110-4604-901b-0ed95ca31132','admin.loan.updated', 'admin.loan.updated.description', 'admin.loan.updated.path', 10, 102,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.loan'), +('1e98037f-1950-417e-be11-39b51203c409','admin.loan.deleted', 'admin.loan.deleted.description', 'admin.loan.deleted.path', 10, 103,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.loan'), +-- transfer +('0d582b8a-2820-4a58-95ca-37484daa8304','admin.transfer.add', 'admin.transfer.add.description', 'admin.transfer.add.path', 10, 101,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.transfer'), +('f8bb6db8-acd1-4c5e-845a-ef62f16c7b2d','admin.transfer.updated', 'admin.transfer.updated.description', 'admin.transfer.updated.path', 10, 102,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.transfer'), +('ae782c52-1e20-40a3-88cf-28f2fb7d7583','admin.transfer.deleted', 'admin.transfer.deleted.description', 'admin.transfer.deleted.path', 10, 103,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.transfer'), +-- money daily +('d14f5077-ecd9-467e-b274-8674e1955667','admin.moneyDaily.add', 'admin.moneyDaily.add.description', 'admin.moneyDaily.add.path', 10, 101,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.moneyDaily'), +('a8f492bf-0a8b-4a4e-9d61-0de2b7153334','admin.moneyDaily.updated', 'admin.moneyDaily.updated.description', 'admin.moneyDaily.updated.path', 10, 102,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.moneyDaily'), +('285860be-92fd-4c7a-bac2-eec1f530d6d9','admin.moneyDaily.deleted', 'admin.moneyDaily.deleted.description', 'admin.moneyDaily.deleted.path', 10, 103,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.moneyDaily'), +-- closing day +('8ab4bea2-3e00-4474-bf94-e01f1ed6b52c','admin.closingDay.add', 'admin.closingDay.add.description', 'admin.closingDay.add.path', 10, 101,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.closingDay'), +('89d55a97-8bc4-4430-8e8d-ce8d15851695','admin.closingDay.updated', 'admin.closingDay.updated.description', 'admin.closingDay.updated.path', 10, 102,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.closingDay'), +('4e8ab1c5-1889-45b3-8550-101f300b2e70','admin.closingDay.deleted', 'admin.closingDay.deleted.description', 'admin.closingDay.deleted.path', 10, 103,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.closingDay'), +-- other expense +('f8b6306b-166d-48b8-8626-0e8a92970c17','admin.otherExpense.add', 'admin.otherExpense.add.description', 'admin.otherExpense.add.path', 10, 101,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.otherExpense'), +('2dbc0faa-2cd0-4490-a5af-e6a8eb4eb132','admin.otherExpense.updated', 'admin.otherExpense.updated.description', 'admin.otherExpense.updated.path', 10, 102,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.otherExpense'), +('aa7c8eca-2117-45a0-b7ce-6d78599b0a66','admin.otherExpense.deleted', 'admin.otherExpense.deleted.description', 'admin.otherExpense.deleted.path', 10, 103,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.otherExpense'), +-- goal +('2e3e6bc1-6baf-4fde-9cc2-c60cd4c1d2f3','admin.goal.add', 'admin.goal.add.description', 'admin.goal.add.path', 10, 101,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.goal'), +('6add466f-4a1d-464a-a96c-2aecc67087ab','admin.goal.updated', 'admin.goal.updated.description', 'admin.goal.updated.path', 10, 102,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.goal'), +('cd3306f9-b713-4995-a8bf-7585e42c2ca0','admin.goal.deleted', 'admin.goal.deleted.description', 'admin.goal.deleted.path', 10, 103,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.goal'), +-- bonus +('71e44e75-91e8-4a55-8d36-d24e2a645f10','admin.bonus.add', 'admin.bonus.add.description', 'admin.bonus.add.path', 10, 101,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.bonus'), +('14b6bf11-cc3b-41d9-b589-7c2aebc5dbeb','admin.bonus.updated', 'admin.bonus.updated.description', 'admin.bonus.updated.path', 10, 102,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.bonus'), +('9f5d7c8d-2115-4114-82a6-5b7329c3efc7','admin.bonus.deleted', 'admin.bonus.deleted.description', 'admin.bonus.deleted.path', 10, 103,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.bonus'), +-- advance +('961193c0-754e-4444-b281-7c62aacb3987','admin.advance.add', 'admin.advance.add.description', 'admin.advance.add.path', 10, 101,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.advance'), +('0fa64abd-3e2a-4a42-96cf-1672bdd51086','admin.advance.updated', 'admin.advance.updated.description', 'admin.advance.updated.path', 10, 102,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.advance'), +('6ee26a46-919b-4400-8837-31762892fa97','admin.advance.deleted', 'admin.advance.deleted.description', 'admin.advance.deleted.path', 10, 103,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.advance'); + +-- Entradas de caja general +INSERT INTO `APC_PERMISSION` (`id`, `permission`, `description`, `menu_path`, `left_to_right_order`, `top_to_bottom_order` , `permission_type`, `permission_status`,`created_by`) +VALUES +('1bd221ee-bfd2-49e1-899a-8456cc05e559','admin.expenseCompanyIn', 'admin.expenseCompanyIn.description', 'admin.expenseCompanyIn.path', 10, 100,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'); + +INSERT INTO `APC_PERMISSION` (`id`, `permission`, `description`, `menu_path`, `left_to_right_order`, `top_to_bottom_order` , `permission_type`, `permission_status`,`created_by`,`parent_name`) +VALUES +('b855fbbc-e25a-4051-8789-9ec9af62ce3a','admin.expenseCompanyIn.add', 'admin.expenseCompanyIn.add.description', 'admin.expenseCompanyIn.add.path', 10, 101,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.expenseCompanyIn'), +('8165c4e7-eb55-4eb7-bb07-98e14234ad8b','admin.expenseCompanyIn.updated', 'admin.expenseCompanyIn.updated.description', 'admin.expenseCompanyIn.updated.path', 10, 102,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.expenseCompanyIn'), +('292e5385-1368-4b8d-895d-638181e05e0d','admin.expenseCompanyIn.deleted', 'admin.expenseCompanyIn.deleted.description', 'admin.expenseCompanyIn.deleted.path', 10, 103,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.expenseCompanyIn'); + +-- Salidas de caja general +INSERT INTO `APC_PERMISSION` (`id`, `permission`, `description`, `menu_path`, `left_to_right_order`, `top_to_bottom_order` , `permission_type`, `permission_status`,`created_by`) +VALUES +('a5301073-05f2-4d80-bed9-e39e0739ee95','admin.expenseCompanyOut', 'admin.expenseCompanyOut.description', 'admin.expenseCompanyOut.path', 10, 100,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'); + +INSERT INTO `APC_PERMISSION` (`id`, `permission`, `description`, `menu_path`, `left_to_right_order`, `top_to_bottom_order` , `permission_type`, `permission_status`,`created_by`,`parent_name`) +VALUES +('8d4985e8-c3e1-4534-9ebc-06d2f708398c','admin.expenseCompanyOut.add', 'admin.expenseCompanyOut.add.description', 'admin.expenseCompanyOut.add.path', 10, 101,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.expenseCompanyOut'), +('3d812774-98ec-4157-ab62-5a60a69f6ddd','admin.expenseCompanyOut.updated', 'admin.expenseCompanyOut.updated.description', 'admin.expenseCompanyOut.updated.path', 10, 102,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.expenseCompanyOut'), +('c59fd63d-7658-40e9-82be-c2a75221e200','admin.expenseCompanyOut.deleted', 'admin.expenseCompanyOut.deleted.description', 'admin.expenseCompanyOut.deleted.path', 10, 103,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.expenseCompanyOut'); + +-- Cuadre de caja general +INSERT INTO `APC_PERMISSION` (`id`, `permission`, `description`, `menu_path`, `left_to_right_order`, `top_to_bottom_order` , `permission_type`, `permission_status`,`created_by`) +VALUES +('a18072cb-ff92-4763-977c-c604828ff4c7','admin.stableGeneralBox', 'admin.stableGeneralBox.description', 'admin.stableGeneralBox.path', 10, 100,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8'); + +INSERT INTO `APC_PERMISSION` (`id`, `permission`, `description`, `menu_path`, `left_to_right_order`, `top_to_bottom_order` , `permission_type`, `permission_status`,`created_by`,`parent_name`) +VALUES +('4273bd52-7435-483b-a185-d6686c8fb3e7','admin.stableGeneralBox.add', 'admin.stableGeneralBox.add.description', 'admin.stableGeneralBox.add.path', 10, 101,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.stableGeneralBox'), +('2cceb95d-6d3c-4c67-8c9f-cedc75d4e293','admin.stableGeneralBox.updated', 'admin.stableGeneralBox.updated.description', 'admin.stableGeneralBox.updated.path', 10, 102,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.stableGeneralBox'), +('c46ebab5-904c-4cc1-8c77-49a9fded0fba','admin.stableGeneralBox.deleted', 'admin.stableGeneralBox.deleted.description', 'admin.stableGeneralBox.deleted.path', 10, 103,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.stableGeneralBox'); + +INSERT INTO APC_USER_BY_OFFICE_HAS_PERMISSION (id_user_by_office,id_permission,created_by) +SELECT +-- Ruben Tepic +'a742dfe8-7d20-11ea-af3e-28f659da398e', +id, +'0dc7c246-7db8-11ea-9b1f-500320958bf8' +FROM APC_PERMISSION; + + +INSERT INTO APC_USER_MOBILE_PREFERECE(id,id_user,preference_name,preference_value,created_by,created_on) +VALUES +-- Hector +('235e819e-8bbe-11ea-8c0e-beeb61238d59','092a95d8-7db8-11ea-9b1f-500320958bf8','ORDER_LIST','ALPHABETICALLY','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +-- Juan +('e914e614-8bd0-11ea-b45c-c7b846343364','0dc7c246-7db8-11ea-9b1f-500320958bf8','ORDER_LIST','ALPHABETICALLY','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +-- Certificador +('ef48f296-8bd0-11ea-b45c-c7b846343364','67b3081e-8bc9-11ea-b45c-c7b846343364','ORDER_LIST','ALPHABETICALLY','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()); +-- ------------------------- +-- Logica de negocio de los +-- pagos de APC +-- ------------------------- +-- FALTA CREAR RUTA +INSERT INTO APC_ROUTE(id,id_office,route_name,active_status,created_by, created_on) +VALUES +-- Tepic +('51b207a2-8e19-11ea-b65e-4e1376171215','caef3a64-7d1f-11ea-af3e-28f659da398e','Ruta 3 Tepic','ENEBLED','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +('55baf3ae-8e19-11ea-b65e-4e1376171215','caef3a64-7d1f-11ea-af3e-28f659da398e','Ruta 7 Tepic','ENEBLED','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()); + +INSERT INTO APC_LOAN_TYPE(id,loan_type_name,total_days, loan_fee, payment,payment_daily,payment_total, id_office,created_by, created_on,opening_fee) +VALUES +-- Para tepic +('db833bf0-8e5e-11ea-8ee4-e54bc704beac','Prestamo $1000', 22,50,1000,60,1320,'caef3a64-7d1f-11ea-af3e-28f659da398e','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),20), +('c59e5bee-8dff-11ea-8745-07889553dd5f','Prestamo $2000', 22,50,2000,120,2640,'caef3a64-7d1f-11ea-af3e-28f659da398e','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),40), +('dc255a16-8dff-11ea-8745-07889553dd5f','Prestamo $3000', 22,50,3000,180,3960,'caef3a64-7d1f-11ea-af3e-28f659da398e','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),60), +('e7cc91c2-8dff-11ea-8745-07889553dd5f','Prestamo $4000', 22,50,4000,240,5280,'caef3a64-7d1f-11ea-af3e-28f659da398e','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),80), +('f0cb05ba-8dff-11ea-8745-07889553dd5f','Prestamo $5000', 22,50,5000,300,6600,'caef3a64-7d1f-11ea-af3e-28f659da398e','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),100), +('fdaa4318-8dff-11ea-8745-07889553dd5f','Prestamo $6000', 22,50,6000,360,7920,'caef3a64-7d1f-11ea-af3e-28f659da398e','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),120), + +('32af80cf-5961-4ed9-9bbb-c8c3d17151c0','Prestamo $7000', 22,50,7000,420,9240,'caef3a64-7d1f-11ea-af3e-28f659da398e','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),140), +('a436bf31-8229-4817-b014-3a1c76bffe9d','Prestamo $8000', 22,50,8000,480,10560,'caef3a64-7d1f-11ea-af3e-28f659da398e','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),160), +('f0f2fe2a-a7ec-45e6-80ea-f46a1e689584','Prestamo $9000', 22,50,9000,540,11880,'caef3a64-7d1f-11ea-af3e-28f659da398e','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),180), +('4015d73b-6d05-4f69-a5f3-d446e3870f40','Prestamo $10000', 22,50,10000,600,13200,'caef3a64-7d1f-11ea-af3e-28f659da398e','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW(),200); + +INSERT INTO APC_HUMAN_RESOURCE_HAS_ROUTE(id_human_resource,id_route,created_by,created_on) +VALUES +-- Hector +('c021214a-8bc7-11ea-b45c-c7b846343364','51b207a2-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +-- Juan +('d2869da6-8bc7-11ea-b45c-c7b846343364','55baf3ae-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +-- Certificador +('088d7268-8bc7-11ea-b45c-c7b846343364','51b207a2-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()), +('088d7268-8bc7-11ea-b45c-c7b846343364','55baf3ae-8e19-11ea-b65e-4e1376171215','0dc7c246-7db8-11ea-9b1f-500320958bf8',NOW()); + +COMMIT; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; diff --git a/ace-db/src/create/from/scratch/apc-db-tables.sql b/ace-db/src/create/from/scratch/apc-db-tables.sql new file mode 100644 index 0000000..518bcce --- /dev/null +++ b/ace-db/src/create/from/scratch/apc-db-tables.sql @@ -0,0 +1,1016 @@ +-- -------------------------------------------------------- +-- Arrebol Consuntancy +-- version 1.0.1 +-- http://www.arrebolconsultancy.com +-- -------------------------------------------------------- + +SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; +SET AUTOCOMMIT = 0; +START TRANSACTION; +-- SET time_zone = "+00:00"; + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8mb4 */; + +DROP DATABASE IF EXISTS `apo_pro_com_april_ten`; + +CREATE DATABASE IF NOT EXISTS `apo_pro_com_april_ten` DEFAULT CHARACTER SET latin1 COLLATE latin1_spanish_ci; +USE `apo_pro_com_april_ten`; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_ERROR_APP_LOG` +-- +CREATE TABLE `APC_ERROR_APP_LOG` ( + `id_log` varchar(36) NOT NULL, + `log_entry_date` timestamp NULL DEFAULT NULL, + `log_logger` varchar(100) DEFAULT NULL, + `log_level` varchar(100) DEFAULT NULL, + `log_message` varchar(250) DEFAULT NULL, + `log_exception` varchar(4000) DEFAULT NULL, + PRIMARY KEY (`id_log`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_OFFICE` +-- +CREATE TABLE `APC_OFFICE` ( + `id` char(36) NOT NULL, + `office_name` varchar(100) NOT NULL, + `address` varchar(250) DEFAULT NULL, + `office_status` enum('ENEBLED','DISABLED','DELETED') NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_office_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_office_uk` UNIQUE KEY (`office_name`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_ROLE` +-- +CREATE TABLE `APC_ROLE` ( + `id` char(36) NOT NULL, + `role_name` varchar(100) NOT NULL, + `active_status` enum('ENEBLED','DISABLED') NOT NULL DEFAULT 'ENEBLED', + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_role_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_role_uk` UNIQUE KEY (`role_name`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_ROUTE` +-- +CREATE TABLE `APC_ROUTE`( + `id` char(36) NOT NULL, + `id_office` char(36) NOT NULL, + `route_name` varchar(25) NOT NULL, + `active_status` ENUM('ENEBLED', 'DISABLED') NOT NULL DEFAULT 'ENEBLED', + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_route_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_route_uk` UNIQUE KEY (`id_office`,`route_name`), + CONSTRAINT `apc_route_to_apc_office_fk` + FOREIGN KEY (`id_office`) REFERENCES `APC_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------------------- +-- +-- Estructura para la vista `APC_BONUS` +-- +-- Dar de alta los bonos activos. +-- +CREATE TABLE `APC_BONUS`( + `id` char(36) NOT NULL, + `name` varchar(100) NOT NULL, + `loan_bonus` numeric(8,2) NOT NULL, + `mora_bonus` numeric(8,2) NOT NULL, + `new_customer_bonus` numeric(8,2) NOT NULL, + `administrative` ENUM('ENEBLED', 'DISABLED') NOT NULL DEFAULT 'ENEBLED', + `active_status` ENUM('ENEBLED', 'DISABLED') NOT NULL DEFAULT 'ENEBLED', + `id_office` char(36) NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_bono_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_bono_to_apc_office_fk` + FOREIGN KEY (`id_office`) REFERENCES `APC_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_HUMAN_RESOURCES` +-- +CREATE TABLE `APC_HUMAN_RESOURCE` ( + `id` char(36) NOT NULL, + `first_name` varchar(25) NOT NULL, + `second_name` varchar(25) DEFAULT NULL, + `last_name` varchar(25) NOT NULL, + `middle_name` varchar(25) NOT NULL, + `birthdate` date DEFAULT NULL, + `avatar` varchar(150) NOT NULL, + `curp` varchar(20) DEFAULT NULL, + `rfc` varchar(13) DEFAULT NULL, + `ife` varchar(20) DEFAULT NULL, + `admission_date` date DEFAULT NULL, + `human_resource_status` ENUM('ENEBLED', 'DISABLED', 'DELETED') NOT NULL, + `id_role` char(36) NOT NULL, + `id_bonus` char(36) DEFAULT NULL, + `payment` numeric(8,2) DEFAULT NULL, + `imss` numeric(8,2) DEFAULT NULL, + `balance` decimal(8,2) NOT NULL, + `employee_saving` DECIMAL(8,2) DEFAULT 0.00, + `created_by` char(36) DEFAULT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `person_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_human_resource_to_apc_role_fk` + FOREIGN KEY (`id_role`) REFERENCES `APC_ROLE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_human_resource_to_apc_bonus_fk` + FOREIGN KEY (`id_bonus`) REFERENCES `APC_BONUS`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_HUMAN_RESOURCE_HAS_ROUTE` +-- +CREATE TABLE `APC_HUMAN_RESOURCE_HAS_ROUTE`( + `id_human_resource` char(36) NOT NULL, + `id_route` char(36) NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_human_resource_has_route_pk` PRIMARY KEY (`id_human_resource`, `id_route`), + CONSTRAINT `apc_human_resource_has_route_to_apc_human_resource_fk` + FOREIGN KEY (`id_human_resource`) REFERENCES `APC_HUMAN_RESOURCE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_human_resource_has_route_to_apc_office_fk` + FOREIGN KEY (`id_route`) REFERENCES `APC_ROUTE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +)ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_PEOPLE` +-- +CREATE TABLE `APC_PEOPLE`( + `id` char(36) NOT NULL, + `first_name` varchar(25) NOT NULL, + `second_name` varchar(25) DEFAULT NULL, + `last_name` varchar(25) NOT NULL, + `middle_name` varchar(25) NOT NULL, + `birthdate` date DEFAULT NULL, + `thumbnail` varchar(250) NOT NULL, + `phone_home` varchar(15) NOT NULL, + `address_home` varchar(150) NOT NULL, + `phone_business` varchar(15), + `address_business` varchar(150), + `company_name` varchar(150), + `people_type` ENUM('CUSTOMER', 'ENDORSEMENT', 'BOTH') NOT NULL DEFAULT 'CUSTOMER', + `active_status` ENUM('ENEBLED', 'DISABLED') NOT NULL DEFAULT 'ENEBLED', + `id_office` char(36) NOT NULL, + `id_route` char(36) NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_people_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_people_to_apc_office_fk` + FOREIGN KEY (`id_office`) REFERENCES `APC_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_people_to_apc_route_fk` + FOREIGN KEY (`id_route`) REFERENCES `APC_ROUTE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +)ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_LOAN_TYPE` +-- +CREATE TABLE `APC_LOAN_TYPE`( + `id` char(36) NOT NULL, + `loan_type_name` varchar(50) NOT NULL, + `total_days` smallint NOT NULL DEFAULT 22, + `loan_fee` numeric(8,2) NOT NULL,-- Multa + `opening_fee` int NOT NULL, -- ComisiĆ³n + `payment` numeric(8,2) NOT NULL,-- Monte del prestamo + `payment_daily` numeric(8,2) NOT NULL,-- 60 x c/1000 + `payment_total` numeric(8,2) NOT NULL, -- Prestamo mĆ”s intereses + `payment_monday` ENUM('MONDAY'), + `payment_tuesday` ENUM('TUESDAY'), + `payment_wednesday` ENUM('WEDNESDAY'), + `payment_thursday` ENUM('THURSDAY'), + `payment_friday` ENUM('FRIDAY'), + `payment_saturday` ENUM('SATURDAY'), + `payment_sunday` ENUM('SUNDAY'), + `convenio` ENUM('ENEBLED','DISABLED') DEFAULT 'DISABLED' + `id_office` char(36) NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_loan_type_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_loan_type_to_apc_office_fk` + FOREIGN KEY (`id_office`) REFERENCES `APC_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +)ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_LOAN` +-- +CREATE TABLE `APC_LOAN`( + `id` char(36) NOT NULL, + `id_loan_type` char(36) NOT NULL, + `id_customer` char(36) NOT NULL, + `id_endorsement` char(36) NOT NULL, + `id_route` char(36) NOT NULL, + `loan_status` ENUM('PENDING','FINISH','BLACK_LIST','APPROVED','REJECTED','PENDING_RENOVATION','TO_DELIVERY','DELETED') NOT NULL DEFAULT 'PENDING', + `new_customer` ENUM('ENEBLED', 'DISABLED') DEFAULT 'DISABLED', + `amount_paid` numeric(8,2) NOT NULL, + `amount_to_pay` numeric(8,2) NOT NULL, + `last_reference_number` smallint NOT NULL, + `comments` varchar(200), + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36), + `last_updated_on` datetime, + CONSTRAINT `apc_loan_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_loan_to_apc_loan_type_fk` + FOREIGN KEY (`id_loan_type`) REFERENCES `APC_LOAN_TYPE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_loan_to_apc_person_as_customer_fk` + FOREIGN KEY (`id_customer`) REFERENCES `APC_PEOPLE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_loan_to_apc_person_as_endorsement_fk` + FOREIGN KEY (`id_endorsement`) REFERENCES `APC_PEOPLE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_loan_to_apc_route_fk` + FOREIGN KEY (`id_route`) REFERENCES `APC_ROUTE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +)ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_HUMAN_RESOURCE_BY_OFFICE` +-- +CREATE TABLE `APC_HUMAN_RESOURCE_BY_OFFICE`( + `id` char(36) NOT NULL, + `id_human_resource` char(36) NOT NULL, + `id_office` char(36) NOT NULL, + `application_owner` ENUM('APP_OWNER', 'APP_USER') NOT NULL DEFAULT 'APP_USER', + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_human_resource_by_office_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_human_resource_by_office_uk` UNIQUE KEY (`id_human_resource`, `id_office`), + CONSTRAINT `apc_human_resource_by_office_to_apc_human_resource_fk` + FOREIGN KEY (`id_human_resource`) REFERENCES `APC_HUMAN_RESOURCE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_human_resource_by_office_to_apc_office_fk` + FOREIGN KEY (`id_office`) REFERENCES `APC_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +)ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_USER` +-- +CREATE TABLE `APC_USER`( + `id` char(36) NOT NULL, + `id_human_resource` char(36) NOT NULL, + `user_name` varchar(100) NOT NULL, + `pwd` varchar(100)NOT NULL, + `user_type` ENUM('WEB', 'MOBILE', 'BOTH') NOT NULL, + `user_status` ENUM('ENEBLED', 'DISABLED', 'DELETED') NOT NULL, + `application_owner` ENUM('APP_OWNER', 'APP_USER') NOT NULL DEFAULT 'APP_USER', + `certifier` ENUM('ENEBLED', 'DISABLED') NOT NULL DEFAULT 'DISABLED', + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_user_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_user_by_office_to_apc_human_resource_fk` + FOREIGN KEY (`id_human_resource`) REFERENCES `APC_HUMAN_RESOURCE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +)ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_LOAN_DETAIL` +-- +CREATE TABLE `APC_LOAN_DETAIL`( + `id` char(36) NOT NULL, + `id_loan` char(36) NOT NULL, + `id_user` char(36) NOT NULL, + `people_type` ENUM('CUSTOMER', 'ENDORSEMENT') NOT NULL DEFAULT 'CUSTOMER', + `payment_amount` numeric(8,2) NOT NULL, + `reference_number` smallint NOT NULL, + `loan_details_type` ENUM('CREDIT_PAYMENT','DEBIT_PAYMENT','PAYMENT','FEE','RENOVATION_PAYMENT','TRANSFER') NOT NULL, + `loan_comments` varchar(150), + `fee_status` enum('TO_PAY','PAID') DEFAULT 'TO_PAY', + `transfer_status` enum('AUTHORIZED','PENDING','REJECTED') DEFAULT 'PENDING', + `transfer_number` varchar(100), + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_loan_details_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_loan_details_uk` UNIQUE KEY (`id`,`reference_number`), + CONSTRAINT `apc_loan_details_to_apc_loan_fk` + FOREIGN KEY (`id_loan`) REFERENCES +APC_LOAN`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_loan_details_to_apc_user_fk` + FOREIGN KEY (`id_user`) REFERENCES `APC_USER`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +)ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_LOAN_FEE_NOTIFICATION` +-- +CREATE TABLE `APC_LOAN_FEE_NOTIFICATION`( + `id` char(36) NOT NULL, + `id_loan` char(36) NOT NULL, + `id_user` char(36) NOT NULL, + `notification_number` smallint NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_loan_notification_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_loan_notification_to_apc_loan_fk` + FOREIGN KEY (`id_loan`) REFERENCES `APC_LOAN`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_loan_notification_to_apc_user_fk` + FOREIGN KEY (`id_user`) REFERENCES `APC_USER`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +)ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_LOAN_BY_USER` +-- +CREATE TABLE `APC_LOAN_BY_USER`( + `id_loan` char(36) NOT NULL, + `id_user` char(36) NOT NULL, + `loan_by_user_status` enum('PENDING','FINISH','BLACK_LIST','APPROVED','REJECTED','PENDING_RENOVATION','TO_DELIVERY','DELETED') NOT NULL DEFAULT 'PENDING', + `comments` varchar(150) DEFAULT NULL, + `owner_loan` enum('CURRENT_OWNER','OLD_OWNER') NOT NULL, + `order_in_list` smallint(6) DEFAULT '0', + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_loan_by_user_pk` PRIMARY KEY (`id_loan`, `id_user`), + CONSTRAINT `apc_loan_by_user_to_apc_loan_fk` + FOREIGN KEY (`id_loan`) REFERENCES `APC_LOAN`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_loan_by_user_to_apc_user_fk` + FOREIGN KEY (`id_user`) REFERENCES `APC_USER`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +)ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_LOAN_BY_RENOVATION` +-- +CREATE TABLE `APC_LOAN_BY_RENOVATION`( + `id_loan_old` char(36) NOT NULL, + `id_loan_new` char(36) NOT NULL, + `loan_by_renovation_status` ENUM('PENDING', 'APPROVED','REJECTED') NOT NULL DEFAULT 'PENDING', + `comments` varchar(150), + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_loan_by_renovation_pk` PRIMARY KEY (`id_loan_old`, `id_loan_new`), + CONSTRAINT `apc_loan_by_renovation_old_to_apc_loan_fk` + FOREIGN KEY (`id_loan_old`) REFERENCES `APC_LOAN`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_loan_by_renovation_new_to_apc_user_fk` + FOREIGN KEY (`id_loan_new`) REFERENCES `APC_LOAN`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +)ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_USER_BY_OFFICE` +-- +CREATE TABLE `APC_USER_BY_OFFICE`( + `id` char(36) NOT NULL, + `id_user` char(36) NOT NULL, + `id_office` char(36) NOT NULL, + `user_by_office_status` ENUM('ENEBLED', 'DISABLED', 'DELETED') NOT NULL, + `application_owner` ENUM('APP_OWNER', 'APP_USER')NOT NULL DEFAULT 'APP_USER', + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_user_by_office_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_user_by_office_uk` UNIQUE KEY (`id_user`, `id_office`), + CONSTRAINT `apc_user_by_office_to_apc_user_fk` + FOREIGN KEY (`id_user`) REFERENCES `APC_USER`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_user_by_office_to_apc_office_fk` + FOREIGN KEY (`id_office`) REFERENCES `APC_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +)ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_PERMISSION` +-- +CREATE TABLE `APC_PERMISSION` ( + `id` char(36) NOT NULL, + `permission` varchar(200) NOT NULL, -- dashboard.policy.to.expire.name + `description` varchar(200) NOT NULL, -- dashboard.policy.to.expire.description + `menu_path` varchar(200) NOT NULL, -- dashboard.policy.to.expire.path + `left_to_right_order` smallint NOT NULL, -- Orden en la que aparece el menu principal (Dashboard, AdministraciĆ³n, CatĆ”logo) + `top_to_bottom_order` smallint NOT NULL, -- Orden en la que aparece de arriba hacia abajo + `permission_type` ENUM('PUBLIC', 'PRIVATE', 'EXCLUSIVE') NOT NULL, + `parent_name` varchar(200), + `permission_status` ENUM('ENEBLED', 'DISABLED') NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_permission_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_permission_uk` UNIQUE KEY (`permission`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_USER_BY_OFFICE_HAS_PERMISSION` +-- +CREATE TABLE `APC_USER_BY_OFFICE_HAS_PERMISSION` ( + `id_user_by_office` char(36) NOT NULL, + `id_permission` char(36) NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_user_by_office_has_permission_pk` PRIMARY KEY (`id_user_by_office`,`id_permission`) , + CONSTRAINT `apc_user_by_office_has_permission_to_apc_user_by_office_fk` + FOREIGN KEY (`id_user_by_office`) REFERENCES `APC_USER_BY_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_user_by_office_has_permission_to_apc_permission_fk` + FOREIGN KEY (`id_permission`) REFERENCES `APC_PERMISSION`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_USER_MOBILE_PREFERECE` +-- +CREATE TABLE `APC_USER_MOBILE_PREFERECE`( + `id` char(36) NOT NULL, + `id_user` char(36) NOT NULL, + `preference_name` varchar(25) NOT NULL, + `preference_value` varchar(25) NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_user_mobile_preference_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_user_mobile_preference_uk` UNIQUE KEY (`id_user`,`preference_name`), + CONSTRAINT `apc_user_mobile_preference_to_apc_user_fk` + FOREIGN KEY (`id_user`) REFERENCES `APC_USER`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +)ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_TRANSFER` +-- +CREATE TABLE `APC_TRANSFER`( + `id` char(36) NOT NULL, + `id_user_transmitter` char(36) NOT NULL, + `id_user_receiver` char(36) NOT NULL, + `active_status` ENUM('ENEBLED', 'DISABLED') NOT NULL DEFAULT 'ENEBLED', + `action_status` ENUM('PENDING', 'APPROVED','REJECTED') NOT NULL DEFAULT 'PENDING', + `amount_to_transfer` numeric(8,2) NOT NULL, + `id_office` char(36) NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_transfer_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_transfer_user_transmitter_to_apc_user_fk` + FOREIGN KEY (`id_user_transmitter`) REFERENCES `APC_USER`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_transfer_user_receiver_to_apc_user_fk` + FOREIGN KEY (`id_user_receiver`) REFERENCES `APC_USER`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_transfer_by_office_to_apc_office_fk` + FOREIGN KEY (`id_office`) REFERENCES `APC_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_MONEY_DAILY` +-- +CREATE TABLE `APC_MONEY_DAILY`( + `id` char(36) NOT NULL, + `money_daily_date` datetime DEFAULT CURRENT_TIMESTAMP, + `amount` numeric(8,2) NOT NULL, + `id_user` char(36) NOT NULL, + `id_office` char(36) NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_money_daily_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_money_daily_by_id_user_to_apc_user_fk` + FOREIGN KEY (`id_user`) REFERENCES `APC_USER`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_money_daily_by_id_office_to_apc_office_fk` + FOREIGN KEY (`id_office`) REFERENCES `APC_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de la tabla `APC_DELIVERY` +-- +CREATE TABLE `APC_DELIVERY`( + `id` char(36) NOT NULL, + `id_user` char(36) NOT NULL, + `id_loan` char(36) NOT NULL, + `amount` numeric(8,2) NOT NULL, + `comission` comission enum('INCLUDED','EXCLUDED') DEFAULT 'INCLUDED', + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_delivery_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_delivery_by_id_user_to_apc_user_fk` + FOREIGN KEY (`id_user`) REFERENCES `APC_USER`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_delivery_to_apc_loan_fk` + FOREIGN KEY (`id_loan`) REFERENCES `APC_LOAN`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- ------------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_CLOSING_DAY` +-- +CREATE TABLE `APC_CLOSING_DAY`( + `id` char(36) NOT NULL, + `id_office` char(36) NOT NULL, + `id_user` char(36) NOT NULL, + `active_status` ENUM('ENEBLED', 'DISABLED') NOT NULL DEFAULT 'ENEBLED', + `amount_paid` numeric(8,2) NOT NULL, + `amount_expected` numeric(8,2) NOT NULL, + `comments` varchar(250), + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_closing_day_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_closing_day_to_apc_office_fk` + FOREIGN KEY (`id_office`) REFERENCES `APC_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_closing_day_to_apc_user_fk` + FOREIGN KEY (`id_user`) REFERENCES `APC_USER`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- ------------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_OTHER_EXPENSE` +-- +CREATE TABLE `APC_OTHER_EXPENSE`( + `id` char(36) NOT NULL, + `id_user` char(36) NOT NULL, + `id_office` char(36) NOT NULL, + `expense` numeric(8,2) NOT NULL, + `description` varchar(200) NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_other_expense_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_other_expense_to_apc_user_fk` + FOREIGN KEY (`id_user`) REFERENCES `APC_USER`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_other_expense_to_apc_office_fk` + FOREIGN KEY (`id_office`) REFERENCES `APC_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------------------- +-- +-- Estructura para la vista `APC_GOAL` +-- +-- Dar de alta las metas de los trabajadores. +-- +CREATE TABLE `APC_GOAL`( + `id` char(36) NOT NULL, + `start_date` date NOT NULL, + `end_date` date NOT NULL, + `amount` numeric(8,2) NOT NULL, + `active_status` ENUM('ENEBLED', 'DISABLED') NOT NULL DEFAULT 'ENEBLED', + `id_office` char(36) NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_goal_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_goal_to_apc_office_fk` + FOREIGN KEY (`id_office`) REFERENCES `APC_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------------------- +-- +-- Estructura para la vista `APC_ADVANCE` +-- +-- Adelanto de nomina. +-- +CREATE TABLE `APC_ADVANCE`( + `id` char(36) NOT NULL, + `id_human_resource` char(36) NOT NULL, + `id_office` char(36) NOT NULL, + `amount` numeric(8,2) NOT NULL, + `active_status` ENUM('ENEBLED', 'DISABLED') NOT NULL DEFAULT 'ENEBLED', + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_advance_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_advance_to_apc_human_resource_fk` + FOREIGN KEY (`id_human_resource`) REFERENCES `APC_HUMAN_RESOURCE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_advance_to_apc_office_fk` + FOREIGN KEY (`id_office`) REFERENCES `APC_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------------------- +-- +-- Estructura para la tabla `APC_EXPENSE_COMPANY` +-- +-- Gastos de la compaƱia. +-- +CREATE TABLE `APC_EXPENSE_COMPANY`( + `id` char(36) NOT NULL, + `id_office` char(36) NOT NULL, + `amount` numeric(8,2) NOT NULL, + `description` varchar(200), + `expense_company_type` ENUM('PAYMENT_IN', 'PAYMENT_OUT') NOT NULL, + `active_status` ENUM('ENEBLED', 'DISABLED') NOT NULL DEFAULT 'ENEBLED', + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_expense_company_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_expense_company_to_apc_office_fk` + FOREIGN KEY (`id_office`) REFERENCES `APC_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------------------- +-- +-- Estructura para la tabla `APC_STABLE_GENERAL_BOX` +-- +-- Totales de la caja de APC. +-- +CREATE TABLE `APC_STABLE_GENERAL_BOX`( + `id` char(36) NOT NULL, + `total_general_box` decimal(8,2) NOT NULL, + `total_envelope` decimal(8,2) NOT NULL, + `total_bank_note` decimal(8,2) NOT NULL, + `total_coin` decimal(8,2) NOT NULL, + `total_stable` decimal(8,2) NOT NULL, + `active_status` enum('ENEBLED','DISABLED') NOT NULL DEFAULT 'ENEBLED', + `description` varchar(200) DEFAULT NULL, + `id_office` char(36) NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_stable_general_box_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_stable_general_box_to_apc_office_fk` + FOREIGN KEY (`id_office`) REFERENCES `APC_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------------------- +-- +-- Estructura para la tabla `APC_STABLE_GENERAL_BOX` +-- +-- Totales de la caja de APC. +-- +CREATE TABLE `APC_TOTAL_EXPECTED_PAYMENT_DAILY_BY_USER`( + `id` char(36) NOT NULL, + `total_expected` decimal(8,2) NOT NULL, + `active_status` enum('ENEBLED','DISABLED') NOT NULL DEFAULT 'ENEBLED', + `id_office` char(36) NOT NULL, + `id_user` char(36) NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + `total_expected_payment` decimal(8,2) DEFAULT NULL, + CONSTRAINT `apc_total_expected_payment_daily_by_user_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_total_expected_payment_daily_by_user_to_apc_office_fk` + FOREIGN KEY (`id_office`) REFERENCES `APC_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_total_expected_payment_daily_by_user_to_apc_user_fk` + FOREIGN KEY (`id_user`) REFERENCES `APC_USER`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------------------- +-- +-- Estructura para la vista `ARREBOL_TEST` +-- +-- Solo para pruebas exclusivas. +-- +CREATE TABLE `ARREBOL_TEST`( + `id` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP +)ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------------------- +-- +-- Estructura para la tabla `APC_PAYROLL` +-- +CREATE TABLE `APC_PAYROLL`( + `id` char(36) NOT NULL, + `active_status` enum('ENEBLED','DISABLED') NOT NULL DEFAULT 'ENEBLED', + `id_office` char(36) NOT NULL, + `id_human_resource` char(36) NOT NULL, + `salary` decimal(8,2) NOT NULL, + `imss` decimal(8,2) NOT NULL, + `advance` decimal(8,2) NOT NULL, + `total_bonus_new_customer` decimal(8,2) NOT NULL, + `total_bonus_colocation` decimal(8,2) NOT NULL, + `total_bonus_mora` decimal(8,2) NOT NULL, + `discounts` decimal(8,2) NOT NULL, + `increases` decimal(8,2) NOT NULL, + `total_payment` decimal(8,2) NOT NULL, + `total_days_salary` smallint(6) NOT NULL DEFAULT '5', + `total_days_bonus` smallint(6) NOT NULL DEFAULT '5', + `comments_discounts` varchar(200) DEFAULT NULL, + `comments_increases` varchar(200) DEFAULT NULL, + `observation` varchar(200) DEFAULT NULL, + `boxed` decimal(8,2) NOT NULL, + `saving` decimal(8,2) NOT NULL, + `payment_to_debt` decimal(8,2) NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_payroll_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_payroll_to_apc_office_fk` + FOREIGN KEY (`id_office`) REFERENCES `APC_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_payroll_to_apc_human_resource_fk` + FOREIGN KEY (`id_human_resource`) REFERENCES `APC_HUMAN_RESOURCE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------------------- +-- +-- Estructura para la tabla `APC_CLOSING_DAY_DETAIL` +-- +CREATE TABLE `APC_CLOSING_DAY_DETAIL`( + `id` char(36) NOT NULL, + `id_closing_day` char(36) NOT NULL, + `comments` varchar(200) NOT NULL, + `amount` decimal(8,2) NOT NULL, + `type` varchar(200) NOT NULL, + `dateDetail` datetime DEFAULT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_closing_day_detail_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_closing_day_detail_to_apc_closing_day_fk` + FOREIGN KEY (`id_closing_day`) REFERENCES `APC_CLOSING_DAY`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------------------- +-- +-- Estructura para la tabla `APC_STABLE_SMALL_BOX` +-- +-- Caja chica. +-- +CREATE TABLE `APC_STABLE_SMALL_BOX`( + `id` char(36) NOT NULL, + `total_small_box` numeric(8,2) NOT NULL, + `total_envelope` numeric(8,2) NOT NULL, + `total_bank_note` numeric(8,2) NOT NULL, + `total_coin` numeric(8,2) NOT NULL, + `total_stable` numeric(8,2) NOT NULL, + `active_status` ENUM('ENEBLED', 'DISABLED') NOT NULL DEFAULT 'ENEBLED', + `description` varchar(200), + `id_office` char(36) NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_stable_small_box_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_stable_small_box_to_apc_office_fk` + FOREIGN KEY (`id_office`) REFERENCES `APC_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------------------- +-- +-- Estructura para la tabla `APC_BITACORA` +-- +-- Bitacora de APC. +-- +CREATE TABLE `APC_BITACORA`( + `id` char(36) NOT NULL, + `id_office` char(36) NOT NULL, + `comments_user` varchar(300) NOT NULL, + `action` varchar(50) NOT NULL, + `description` varchar(300) NOT NULL, + `name_user` varchar(200) NOT NULL, + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_bitacora_pk` PRIMARY KEY (`id`), + CONSTRAINT `apc_bitacora_to_apc_office_fk` + FOREIGN KEY (`id_office`) REFERENCES `APC_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------------------- +-- +-- Estructura para la tabla `APC_LOAN_EMPLOYEE` +-- +-- Crear tabla para prĆ©stamos de empleados +-- +CREATE TABLE `APC_LOAN_EMPLOYEE` ( + `id` CHAR(36) NOT NULL, + `id_employee` CHAR(36) NOT NULL, + `amount_loan` DECIMAL(8,2), + `amount_to_pay` DECIMAL(8,2), + `balance` DECIMAL(8,2), + `loan_employee_status` ENUM('ENEBLED', 'DISABLED', 'DELETED') NOT NULL, + `total_amount_to_pay` DECIMAL(8,2), + `created_by` CHAR(36) NOT NULL, + `created_on` DATETIME DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` CHAR(36) DEFAULT NULL, + `last_updated_on` DATETIME DEFAULT NULL, + + CONSTRAINT `apc_loan_employee_pk` PRIMARY KEY (id), + CONSTRAINT `apc_loan_to_apc_person_as_employee_fk` + FOREIGN KEY (`id_employee`) REFERENCES `APC_HUMAN_RESOURCE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------------------- +-- +-- Estructura para la tabla `APC_LOAN_EMPLOYEE_DETAIL` +-- +-- Crear tabla para detalles (abonos) +-- +CREATE TABLE `APC_LOAN_EMPLOYEE_DETAIL` ( + `id` char(36) NOT NULL, + `id_loan` char(36) NOT NULL, + `id_user` char(36) NOT NULL, + `payment_amount` DECIMAL(8,2), + `reference_number` SMALLINT NOT NULL, + `loan_employee_detail_status` ENUM('ENEBLED', 'DISABLED', 'DELETED') NOT NULL, + `created_by` CHAR(36) NOT NULL, + `created_on` DATETIME DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT `apc_loan_employee_detail_pk` PRIMARY KEY (id), + CONSTRAINT `apc_loan_employee_details_uk` UNIQUE KEY (`id`,`reference_number`), + CONSTRAINT `apc_loan_details_to_apc_loan_employee_fk` + FOREIGN KEY (`id_loan`) REFERENCES `APC_LOAN_EMPLOYEE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_loan_employee_details_to_apc_user_fk` + FOREIGN KEY (`id_user`) REFERENCES `APC_HUMAN_RESOURCE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +)ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_GASOLINE` +-- +CREATE TABLE `APC_GASOLINE` ( + `id` char(36) NOT NULL, + `id_user` char(36) NOT NULL, + `id_office` char(36) NOT NULL, + `id_route` char(36) NOT NULL, + `quantity` DOUBLE DEFAULT 0.0, + `km_old` DOUBLE DEFAULT 0.0, + `km_new` DOUBLE DEFAULT 0.0, + `total` DOUBLE DEFAULT 0.0, + `status` ENUM('ENABLED', 'DISABLED', 'DELETED') NOT NULL, + `description` VARCHAR(500), + `created_by` char(36) NOT NULL, + `created_on` datetime DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` char(36) DEFAULT NULL, + `last_updated_on` datetime DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT `apc_gasoline_to_apc_user_fk` + FOREIGN KEY (`id_user`) REFERENCES `APC_USER`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_gasoline_to_apc_office_fk` + FOREIGN KEY (`id_office`) REFERENCES `APC_OFFICE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT, + CONSTRAINT `apc_gasoline_to_apc_route_fk` + FOREIGN KEY (`id_route`) REFERENCES `APC_ROUTE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +)ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE TABLE `APC_EMPLOYEE_SAVING` ( + `id` char(36) NOT NULL, + -- `id_payroll` char(36) NOT NULL, + `id_user` char(36) NOT NULL, + `employee_saving` DECIMAL(8,2) default 0, + `created_by` CHAR(36) NOT NULL, + `created_on` DATETIME DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` CHAR(36) DEFAULT NULL, + `last_updated_on` DATETIME DEFAULT NULL, + + CONSTRAINT `apc_employee_saving_pk` PRIMARY KEY (id), + -- CONSTRAINT `apc_employee_saving_to_apc_payroll_fk` + -- FOREIGN KEY (`id_payroll`) REFERENCES `APC_PAYROLL`(`id`) + -- ON UPDATE CASCADE + -- ON DELETE RESTRICT, + CONSTRAINT `apc_employee_saving_to_apc_user_fk` + FOREIGN KEY (`id_user`) REFERENCES `APC_HUMAN_RESOURCE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +)ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- +-- +-- Estructura de tabla para la tabla `APC_VEHICLES` +-- +CREATE TABLE `APC_VEHICLES` ( + `id` CHAR(36) NOT NULL, + `id_driver` CHAR(36) NOT NULL, + `license_plate` VARCHAR(50), + `economic_number` VARCHAR(50), + `serial_number` VARCHAR(50), + `engine_number` VARCHAR(50), + `mileage` DECIMAL(8,2), + `year` INTEGER, + `insurance_name` VARCHAR(150), + `insurance_number` VARCHAR(50), + `coverage_type` VARCHAR(50), + `model` VARCHAR(50), + `colour` VARCHAR(50), + `gps` BIT, + `gps_number` VARCHAR(50), + `comments` varchar(200), + `vehicle_status` ENUM('ENEBLED', 'DISABLED', 'DELETED') NOT NULL, + `created_by` CHAR(36) NOT NULL, + `created_on` DATETIME DEFAULT CURRENT_TIMESTAMP, + `last_updated_by` CHAR(36) DEFAULT NULL, + `last_updated_on` DATETIME DEFAULT NULL, + + CONSTRAINT `apc_vehicles_pk` PRIMARY KEY (id), + CONSTRAINT `apc_vehicles_to_apc_person_as_employee_fk` + FOREIGN KEY (`id_driver`) REFERENCES `APC_HUMAN_RESOURCE`(`id`) + ON UPDATE CASCADE + ON DELETE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------------------- +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; \ No newline at end of file diff --git a/ace-db/src/create/from/scratch/apc-db-views.sql b/ace-db/src/create/from/scratch/apc-db-views.sql new file mode 100644 index 0000000..0b9ca08 --- /dev/null +++ b/ace-db/src/create/from/scratch/apc-db-views.sql @@ -0,0 +1,3847 @@ +-- -------------------------------------------------------- +-- Arrebol Consuntancy +-- version 1.0.1 +-- http://www.arrebolconsultancy.com +-- -------------------------------------------------------- + +SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; +SET AUTOCOMMIT = 0; +START TRANSACTION; +-- SET time_zone = "+00:00"; + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8mb4 */; +USE `apo_pro_com_april_ten`; +-- ------------------------------------------------------------- +-- +-- Estructura para la vista `APC_SECURITY_AUTHENTICATION` (USER) +-- +CREATE OR REPLACE VIEW `APC_SECURITY_AUTHENTICATION` AS +SELECT CONCAT(`usr`.`user_name`,`ubo`.`id_office`) AS `user_name`, `usr`.`pwd` AS `pwd` +FROM `APC_USER_BY_OFFICE` `ubo` +INNER JOIN `APC_USER` `usr` ON `ubo`.`id_user` = `usr`.`id` +INNER JOIN `APC_HUMAN_RESOURCE` `hr` ON `usr`.`id_human_resource` = `hr`.`id` +WHERE +`usr`.`user_status` = 'ENEBLED' AND +`usr`.`user_type` IN ('WEB', 'BOTH') AND +`ubo`.`user_by_office_status` = 'ENEBLED' AND +`hr`.`human_resource_status` = 'ENEBLED'; +-- ------------------------------------------------------------ +-- +-- Estructura para la vista `APC_SECURITY_AUTHORIZATION` (ROLE) +-- +CREATE OR REPLACE VIEW `APC_SECURITY_AUTHORIZATION` AS +SELECT CONCAT(`usr`.`user_name`,`ubo`.`id_office`) AS `user_name`, `perm`.`permission` AS `permission` +FROM `APC_PERMISSION` `perm` +INNER JOIN `APC_USER_BY_OFFICE_HAS_PERMISSION` `ubohp` ON `perm`.`id` = `ubohp`.`id_permission` +INNER JOIN `APC_USER_BY_OFFICE` `ubo` ON `ubohp`.`id_user_by_office` = `ubo`.`id` +INNER JOIN `APC_USER` `usr` ON `ubo`.`id_user` = `usr`.`id` +INNER JOIN `APC_HUMAN_RESOURCE` `hr` ON `usr`.`id_human_resource` = `hr`.`id` +WHERE +`perm`.`permission_status` = 'ENEBLED' AND +`ubo`.`user_by_office_status` = 'ENEBLED' AND +`usr`.`user_status` = 'ENEBLED' AND +`usr`.`user_type` IN ('WEB', 'BOTH') AND +`hr`.`human_resource_status` = 'ENEBLED' +ORDER BY `user_name`; +-- ------------------------------------------------------------------- +-- +-- Estructura para la vista `APC_SECURITY_AUTHENTICATION_MOBILE` (USER) +-- +CREATE OR REPLACE VIEW `APC_SECURITY_AUTHENTICATION_MOBILE` AS +SELECT +`usr`.`id` AS `id`, +`usr`.`user_name` AS `user_name`, +`usr`.`pwd` AS `pwd`, +`hr`.`avatar` AS `avatar`, +`ubo`.`id_office` AS `id_office`, +`hrhr`.`id_route` AS `id_route`, +`usr`.`certifier` AS `certifier`, +`usr`.`management` AS `management` +FROM `APC_USER_BY_OFFICE` `ubo` +INNER JOIN `APC_USER` `usr` ON `ubo`.`id_user` = `usr`.`id` +INNER JOIN `APC_HUMAN_RESOURCE` `hr` ON `usr`.`id_human_resource` = `hr`.`id` +INNER JOIN `APC_HUMAN_RESOURCE_HAS_ROUTE` `hrhr` ON `hr`.`id` = `hrhr`.`id_human_resource` +WHERE +`usr`.`user_status` = 'ENEBLED' AND +`usr`.`user_type` IN ('MOBILE', 'BOTH') AND +`ubo`.`user_by_office_status` = 'ENEBLED' AND +`hr`.`human_resource_status` = 'ENEBLED'; +-- -------------------------------------------------------------------- +-- +-- Estructura para la vista `APC_LOAN_BY_USER_VIEW` (USER) +-- Se utiliza para que un Asesor cargue todos los pretamos que tiene +-- que cobrar en el dĆ­a actual. +-- +CREATE OR REPLACE VIEW `APC_LOAN_BY_USER_VIEW` AS +SELECT + CONCAT(l.id, u.id) AS id, + u.id AS user_id, + CONCAT( + CASE + WHEN cstmr.first_name IS NOT NULL AND cstmr.first_name != '' + THEN CONCAT(SUBSTR(UPPER(cstmr.first_name), 1, 1),SUBSTR(LOWER(cstmr.first_name), 2), ' ') + ELSE '' + END, + CASE + WHEN cstmr.second_name IS NOT NULL AND cstmr.second_name != '' + THEN CONCAT(SUBSTR(UPPER(cstmr.second_name), 1, 1),SUBSTR(LOWER(cstmr.second_name), 2), ' ') + ELSE '' + END, + CASE + WHEN cstmr.last_name IS NOT NULL AND cstmr.last_name != '' + THEN CONCAT(SUBSTR(UPPER(cstmr.last_name), 1, 1),SUBSTR(LOWER(cstmr.last_name), 2)) + ELSE '' + END + ) AS customer_name, + cstmr.address_home AS customer_address_home, + cstmr.address_business AS customer_address_business, + cstmr.company_name, + cstmr.thumbnail AS customer_thumbnail, + CONCAT( + CASE + WHEN ndrsmnt.first_name IS NOT NULL AND ndrsmnt.first_name != '' + THEN CONCAT(SUBSTR(UPPER(ndrsmnt.first_name), 1, 1),SUBSTR(LOWER(ndrsmnt.first_name), 2), ' ') + ELSE '' + END, + CASE + WHEN ndrsmnt.second_name IS NOT NULL AND ndrsmnt.second_name != '' + THEN CONCAT(SUBSTR(UPPER(ndrsmnt.second_name), 1, 1),SUBSTR(LOWER(ndrsmnt.second_name), 2), ' ') + ELSE '' + END, + CASE + WHEN ndrsmnt.last_name IS NOT NULL AND ndrsmnt.last_name != '' + THEN CONCAT(SUBSTR(UPPER(ndrsmnt.last_name), 1, 1),SUBSTR(LOWER(ndrsmnt.last_name), 2)) + ELSE '' + END + )AS endorsement_name, + ndrsmnt.address_home AS endorsement_address_home, + ndrsmnt.thumbnail AS endorsement_thumbnail, + ndrsmnt.phone_home AS endorsement_phone_home, + IF((l.amount_to_pay - l.amount_paid >= lt.payment_daily), lt.payment_daily, l.amount_to_pay - l.amount_paid) AS payment_daily, + lt.loan_fee, + lbu.order_in_list, + (SELECT count(notification_number) FROM APC_LOAN_FEE_NOTIFICATION WHERE id_loan = l.id) AS notification_number, +IF( + ( + l.amount_paid >= (SELECT FLOOR(lt.payment_total * .6364) FROM DUAL) + ), + CASE + WHEN + (SELECT count(notification_number) as total + FROM APC_LOAN_FEE_NOTIFICATION + WHERE id_loan = l.id + ) < 4 + THEN 'ENEBLED' + WHEN + (SELECT count(notification_number) as total + FROM APC_LOAN_FEE_NOTIFICATION + WHERE id_loan = l.id + ) BETWEEN 4 AND 5 + AND + lt.payment > 1000 + THEN 'ENEBLED' + ELSE 'DISABLED' + END + ,'DISABLED' +) as renovation, +(SELECT amount_to_pay - amount_paid FROM APC_LOAN WHERE id = l.id) AS max_amount_to_pay +FROM APC_LOAN_BY_USER lbu +INNER JOIN APC_LOAN l ON lbu.id_loan = l.id +INNER JOIN APC_LOAN_TYPE lt ON l.id_loan_type = lt.id +INNER JOIN APC_PEOPLE cstmr ON l.id_customer = cstmr.id +INNER JOIN APC_PEOPLE ndrsmnt ON l.id_endorsement = ndrsmnt.id +INNER JOIN APC_USER u ON lbu.id_user = u.id +WHERE + l.loan_status = 'APPROVED' AND + l.id = ( + CASE + -- WHEN IS NEW AND update created_on less equals to currentdate + WHEN ( + (SELECT count(id) FROM APC_LOAN_DETAIL WHERE id_loan = l.id ) = 0 AND + DATE(l.last_updated_on) < curdate() + ) THEN l.id + -- WHEN LOAN HAS PAYMENTS + WHEN ( + ( + SELECT count(id) + FROM APC_LOAN_DETAIL + WHERE + id_loan = l.id AND + reference_number = l.last_reference_number AND + DATE(created_on) < curdate() + ) > 0 AND + DATE(l.last_updated_on) < curdate() + ) THEN l.id + ELSE '' + END + ) AND + lbu.owner_loan = 'CURRENT_OWNER' AND + CASE + WHEN LOWER(DAYNAME(CURDATE())) = 'monday' + THEN ('monday' = lt.payment_monday) + WHEN LOWER(DAYNAME(CURDATE())) = 'tuesday' + THEN ('tuesday' = LOWER(lt.payment_tuesday)) + WHEN LOWER(DAYNAME(CURDATE())) = 'wednesday' + THEN ('wednesday' = LOWER(lt.payment_wednesday)) + WHEN LOWER(DAYNAME(CURDATE())) = 'thursday' + THEN ('thursday' =LOWER(lt.payment_thursday)) + WHEN LOWER(DAYNAME(CURDATE())) = 'friday' + THEN ('friday' = LOWER(lt.payment_friday)) + WHEN LOWER(DAYNAME(CURDATE())) = 'saturday' + THEN ('saturday' = LOWER(lt.payment_saturday)) + WHEN LOWER(DAYNAME(CURDATE())) = 'sunday' + THEN ('sunday' = LOWER(lt.payment_sunday)) + ELSE FALSE + END; +-- ------------------------------------------------------------- +-- COPY PRODUCTION 2022/JULY/16 +-- Estructura para la vista `APC_LOAN_BY_USER_VIEW` +-- LATEST VERSION WITH NO MARGING +-- IT WAS TAKEN FROM PRODUCTION +CREATE OR REPLACE VIEW `APC_LOAN_BY_USER_VIEW` AS +select concat(`l`.`id`,`u`.`id`) AS `id`, + `u`.`id` AS `user_id`, + concat((case when ((`cstmr`.`first_name` is not null) and (`cstmr`.`first_name` <> '')) then concat(substr(upper(`cstmr`.`first_name`),1,1),substr(lower(`cstmr`.`first_name`),2),' ') else '' end),(case when ((`cstmr`.`second_name` is not null) and (`cstmr`.`second_name` <> '')) then concat(substr(upper(`cstmr`.`second_name`),1,1),substr(lower(`cstmr`.`second_name`),2),' ') else '' end),(case when ((`cstmr`.`last_name` is not null) and (`cstmr`.`last_name` <> '')) then concat(substr(upper(`cstmr`.`last_name`),1,1),substr(lower(`cstmr`.`last_name`),2)) else '' end)) AS `customer_name`, + (case when (`cstmr`.`address_home` is null) then '' else `cstmr`.`address_home` end) AS `customer_address_home`, + (case when (`cstmr`.`address_business` is null) then '' else `cstmr`.`address_business` end) AS `customer_address_business`, + (case when (`cstmr`.`company_name` is null) then '' else `cstmr`.`company_name` end) AS `company_name`, + (case when (`cstmr`.`thumbnail` is null) then '' else `cstmr`.`thumbnail` end) AS `customer_thumbnail`, + concat((case when ((`ndrsmnt`.`first_name` is not null) and (`ndrsmnt`.`first_name` <> '')) then concat(substr(upper(`ndrsmnt`.`first_name`),1,1),substr(lower(`ndrsmnt`.`first_name`),2),' ') else '' end),(case when ((`ndrsmnt`.`second_name` is not null) and (`ndrsmnt`.`second_name` <> '')) then concat(substr(upper(`ndrsmnt`.`second_name`),1,1),substr(lower(`ndrsmnt`.`second_name`),2),' ') else '' end),(case when ((`ndrsmnt`.`last_name` is not null) and (`ndrsmnt`.`last_name` <> '')) then concat(substr(upper(`ndrsmnt`.`last_name`),1,1),substr(lower(`ndrsmnt`.`last_name`),2)) else '' end)) AS `endorsement_name`, + (case when (`ndrsmnt`.`address_home` is null) then '' else `ndrsmnt`.`address_home` end) AS `endorsement_address_home`,(case when (`ndrsmnt`.`thumbnail` is null) then '' else `ndrsmnt`.`thumbnail` end) AS `endorsement_thumbnail`, + (case when (`ndrsmnt`.`phone_home` is null) then '' else `ndrsmnt`.`phone_home` end) AS `endorsement_phone_home`, + if(((`l`.`amount_to_pay` - `l`.`amount_paid`) >= `lt`.`payment_daily`),`lt`.`payment_daily`,(`l`.`amount_to_pay` - `l`.`amount_paid`)) AS `payment_daily`, + `lt`.`loan_fee` AS `loan_fee`,`lbu`.`order_in_list` AS `order_in_list`, + (select count(`APC_LOAN_FEE_NOTIFICATION`.`notification_number`) from `APC_LOAN_FEE_NOTIFICATION` where (`APC_LOAN_FEE_NOTIFICATION`.`id_loan` = `l`.`id`)) AS `notification_number`, + if((`l`.`amount_paid` >= (select floor((`lt`.`payment_total` * 0.6364)))),(case when ((select count(`APC_LOAN_FEE_NOTIFICATION`.`notification_number`) AS `total` from `APC_LOAN_FEE_NOTIFICATION` where (`APC_LOAN_FEE_NOTIFICATION`.`id_loan` = `l`.`id`)) < 4) then 'ENEBLED' when (((select count(`APC_LOAN_FEE_NOTIFICATION`.`notification_number`) AS `total` from `APC_LOAN_FEE_NOTIFICATION` where (`APC_LOAN_FEE_NOTIFICATION`.`id_loan` = `l`.`id`)) between 4 and 5) and (`lt`.`payment` > 1000)) then 'ENEBLED' else 'DISABLED' end),'DISABLED') AS `renovation`, + (select (`APC_LOAN`.`amount_to_pay` - `APC_LOAN`.`amount_paid`) from `APC_LOAN` where (`APC_LOAN`.`id` = `l`.`id`)) AS `max_amount_to_pay`, + `cstmr`.`phone_home` AS `customer_phone_home` +from (((((`APC_LOAN_BY_USER` `lbu` join `APC_LOAN` `l` on((`lbu`.`id_loan` = `l`.`id`))) join `APC_LOAN_TYPE` `lt` on((`l`.`id_loan_type` = `lt`.`id`))) join `APC_PEOPLE` `cstmr` on((`l`.`id_customer` = `cstmr`.`id`))) join `APC_PEOPLE` `ndrsmnt` on((`l`.`id_endorsement` = `ndrsmnt`.`id`))) join `APC_USER` `u` on((`lbu`.`id_user` = `u`.`id`))) where ((`l`.`frozen` = 'DISABLED') and (`l`.`loan_status` = 'APPROVED') and (`l`.`id` = (case when (((select count(`APC_LOAN_DETAIL`.`id`) from `APC_LOAN_DETAIL` where (`APC_LOAN_DETAIL`.`id_loan` = `l`.`id`)) = 0) and (cast(`l`.`last_updated_on` as date) < curdate())) then `l`.`id` when (((select count(`APC_LOAN_DETAIL`.`id`) from `APC_LOAN_DETAIL` where ((`APC_LOAN_DETAIL`.`id_loan` = `l`.`id`) and (`APC_LOAN_DETAIL`.`reference_number` = `l`.`last_reference_number`) and (cast(`APC_LOAN_DETAIL`.`created_on` as date) < curdate()))) > 0) and (cast(`l`.`last_updated_on` as date) < curdate())) then `l`.`id` else '' end)) and (`lbu`.`owner_loan` = 'CURRENT_OWNER') + ); +-- -------------------------------------------------------------------- +-- +-- Estructura para la vista `APC_LOAN_BY_USER_ORDER_PREFERENCE_VIEW` (USER) +-- Se utiliza para que un Asesor cargue todos los pretamos que tiene +-- que cobrar en el dĆ­a actual y los pueda order por order de preferencia +-- para que pueda programar suta a su gusto. +-- +CREATE OR REPLACE VIEW `APC_LOAN_BY_USER_ORDER_PREFERENCE_VIEW` AS +SELECT + CONCAT(l.id, u.id) AS id, + u.id AS user_id, + CONCAT(cstmr.first_name,' ',IF(ISNULL(cstmr.second_name) ,'', CONCAT(cstmr.second_name, ' ')),cstmr.last_name,' ', cstmr.middle_name) AS customer_name, + cstmr.address_home AS customer_address_home, + cstmr.address_business AS customer_address_business, + lbu.order_in_list +FROM APC_LOAN_BY_USER lbu +INNER JOIN APC_LOAN l ON lbu.id_loan = l.id +INNER JOIN APC_PEOPLE cstmr ON l.id_customer = cstmr.id +INNER JOIN APC_USER u ON lbu.id_user = u.id +WHERE l.loan_status = 'APPROVED'; +-- -------------------------------------------------------------------- +-- +-- Estructura para la vista `APC_PERSON_SEARCH_VIEW` +-- Se utiliza para realizar busqueda por nombre. +-- +CREATE OR REPLACE VIEW `APC_PERSON_SEARCH_VIEW` AS +SELECT + id, + CONCAT( + CASE + WHEN first_name IS NOT NULL AND first_name != '' + THEN CONCAT(SUBSTR(UPPER(first_name), 1, 1),SUBSTR(LOWER(first_name), 2)) + ELSE '' + END, + CASE + WHEN second_name IS NOT NULL AND second_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(second_name), 1, 1),SUBSTR(LOWER(second_name), 2)) + ELSE '' + END, + CASE + WHEN last_name IS NOT NULL AND last_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(last_name), 1, 1),SUBSTR(LOWER(last_name), 2)) + ELSE '' + END, + CASE + WHEN middle_name IS NOT NULL AND middle_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(middle_name), 1, 1),SUBSTR(LOWER(middle_name), 2)) + ELSE '' + END + ) AS person_search +FROM APC_PEOPLE +WHERE active_status = 'ENEBLED' +ORDER BY person_search; +-- -------------------------------------------------------------------- +-- +-- Estructura para la vista `APC_PERSON_SEARCH_DETAIL_VIEW` +-- Busca los detalles de una persona en el sistema. +CREATE OR REPLACE VIEW `APC_PERSON_SEARCH_DETAIL_VIEW` AS +SELECT + p.id AS id, + CONCAT( + CASE + WHEN p.first_name IS NOT NULL AND p.first_name != '' + THEN CONCAT(SUBSTR(UPPER(p.first_name), 1, 1),SUBSTR(LOWER(p.first_name), 2), ' ') + ELSE '' + END, + CASE + WHEN p.second_name IS NOT NULL AND p.second_name != '' + THEN CONCAT(SUBSTR(UPPER(p.second_name), 1, 1),SUBSTR(LOWER(p.second_name), 2), ' ') + ELSE '' + END, + CASE + WHEN p.last_name IS NOT NULL AND p.last_name != '' + THEN CONCAT(SUBSTR(UPPER(p.last_name), 1, 1),SUBSTR(LOWER(p.last_name), 2), ' ') + ELSE '' + END, + CASE + WHEN p.middle_name IS NOT NULL AND p.middle_name != '' + THEN CONCAT(SUBSTR(UPPER(p.middle_name), 1, 1),SUBSTR(LOWER(p.middle_name), 2)) + ELSE '' + END + ) AS person_search, + p.thumbnail, + CASE + WHEN + 0 < ( + SELECT COUNT(ID) + FROM APC_LOAN + WHERE + id_customer = p.id AND + loan_status = 'APPROVED') + THEN + 'ENEBLED' + WHEN + 0 < ( + SELECT COUNT(ID) + FROM APC_LOAN + WHERE + id_endorsement = p.id AND + loan_status = 'APPROVED') + THEN + 'ENEBLED' + ELSE + 'DISABLED' + END AS loanStatus +FROM APC_PEOPLE p; +-- -------------------------------------------------------------------- +-- +-- Estructura para la vista `APC_PERSON_SEARCH_HISTORICAL_DETAILS_VIEW` +-- Busca los detalles historicos de una persona en el sistema mĆ³vil. +CREATE OR REPLACE VIEW `APC_PERSON_SEARCH_HISTORICAL_DETAILS_VIEW` AS +SELECT + l.id, + p.id AS id_person_search, + DATE_FORMAT(l.created_on,'%d-%m-%Y') AS format_date, + CASE + WHEN 0 < (SELECT COUNT(ID) FROM APC_LOAN WHERE id_customer = p.id AND id = l.id) + THEN 'Cliente' + WHEN 0 < (SELECT COUNT(ID) FROM APC_LOAN WHERE id_endorsement = p.id AND id = l.id) + THEN 'Aval' + ELSE + 'Indeterminado' + END AS person_type, + CASE + WHEN 0 < (SELECT COUNT(ID) FROM APC_LOAN WHERE id_customer = p.id AND id = l.id) + THEN + (SELECT CONCAT(in_p.first_name,' ', in_p.last_name) + FROM APC_LOAN in_l + INNER JOIN APC_PEOPLE in_p ON in_l.id_endorsement = in_p.id + WHERE in_l.id = l.id) + WHEN 0 < (SELECT COUNT(ID) FROM APC_LOAN WHERE id_endorsement = p.id AND id = l.id) + THEN (SELECT CONCAT(in_p.first_name,' ', in_p.last_name) + FROM APC_LOAN in_l + INNER JOIN APC_PEOPLE in_p ON in_l.id_customer = in_p.id + WHERE in_l.id = l.id) + ELSE + 'Indeterminado' + END AS relationship, + lt.payment AS loan, + CASE + WHEN l.loan_status = 'APPROVED' + THEN CONCAT(l.last_reference_number, ' de 22') + ELSE '' + END AS payment_number, + CASE + WHEN l.loan_status = 'APPROVED' + THEN (l.amount_to_pay - l.amount_paid) + ELSE 0 + END AS amount_to_pay, + (SELECT COUNT(id) FROM APC_LOAN_FEE_NOTIFICATION WHERE id_loan = l.id) AS total_fees, + CASE + WHEN l.loan_status = 'PENDING' + THEN 'Pendiente' + WHEN l.loan_status = 'FINISH' + THEN 'Terminado' + WHEN l.loan_status = 'BLACK_LIST' + THEN 'Lista negra' + WHEN l.loan_status = 'APPROVED' + THEN 'Activo' + WHEN l.loan_status = 'REJECTED' + THEN 'Rechazado' + WHEN l.loan_status = 'PENDING_RENOVATION' + THEN 'Pendiente renovaciĆ³n' + WHEN l.loan_status = 'TO_DELIVERY' + THEN 'Por recibir' + END AS loan_status +FROM APC_LOAN l +INNER JOIN APC_PEOPLE p ON (l.id_customer = p.id or l.id_endorsement = p.id) +INNER JOIN APC_LOAN_TYPE lt ON l.id_loan_type = lt.id +ORDER BY l.created_on DESC; +-- -------------------------------------------------------------------- +-- +-- Estructura para la vista `APC_AVAILABLE_CUSTOMERS_VIEW` +-- +-- Sirve para cargar todos los posibles clientes de una oficina +-- que puedan solicitar un prestamo nuevo. +-- +CREATE OR REPLACE VIEW `APC_AVAILABLE_CUSTOMERS_VIEW` AS +SELECT + p.id, + CONCAT(p.first_name,' ', IF(ISNULL(p.second_name) ,'', CONCAT(p.second_name,' ')) ,p.last_name, ' ', p.middle_name) AS available_person, + CASE + WHEN p.people_type = 'BOTH' + THEN + CASE + WHEN 0 < (SELECT COUNT(id) FROM APC_LOAN WHERE id_customer = p.id) + THEN (SELECT id_endorsement FROM APC_LOAN WHERE id_customer = p.id ORDER BY created_on DESC LIMIT 1 ) + ELSE '' + END + ELSE '' + END as cross_signature +FROM APC_PEOPLE p +WHERE + p.people_type IN ('CUSTOMER', 'BOTH') AND + p.active_status = 'ENEBLED' AND + CASE + WHEN 0 = ( + SELECT COUNT(id) + FROM APC_LOAN + WHERE + id_customer = p.id AND + loan_status IN ('PENDING', 'BLACK_LIST', 'APPROVED', 'PENDING_RENOVATION', 'TO_DELIVERY') + ) + THEN TRUE + ELSE FALSE + END +ORDER BY available_person; +-- -------------------------------------------------------------------- +-- +-- Estructura para la vista `APC_AVAILABLE_ENDORSEMENT_VIEW` +-- +-- Sirve para cargar todos los posibles avales de una oficina +-- que puedan solicitar un prestamo nuevo. +-- +CREATE OR REPLACE VIEW `APC_AVAILABLE_ENDORSEMENTS_VIEW` AS +SELECT + p.id, + CONCAT(p.first_name,' ', IF(ISNULL(p.second_name) ,'', CONCAT(p.second_name,' ')) ,p.last_name, ' ', p.middle_name) AS available_person, + CASE + WHEN p.people_type = 'BOTH' + THEN + CASE + WHEN 0 < (SELECT COUNT(id) FROM APC_LOAN WHERE id_endorsement = p.id) + THEN (SELECT id_customer FROM APC_LOAN WHERE id_endorsement = p.id ORDER BY created_on DESC LIMIT 1 ) + ELSE '' + END + ELSE '' + END as cross_signature +FROM APC_PEOPLE p +WHERE + p.people_type IN ('ENDORSEMENT', 'BOTH') AND + p.active_status = 'ENEBLED' AND + CASE + WHEN 0 = ( + SELECT COUNT(id) + FROM APC_LOAN + WHERE + id_endorsement = p.id AND + loan_status IN ('PENDING', 'BLACK_LIST', 'APPROVED', 'PENDING_RENOVATION', 'TO_DELIVERY') + ) + THEN TRUE + ELSE FALSE + END +ORDER BY available_person; +-- -------------------------------------------------------------------- +-- +-- Estructura para la vista `APC_CASH_REGISTER_CURDATE_BY_USER_VIEW` +-- +-- Sirve para obtener todos los pagos que recabo un asesor en el dĆ­a. +-- +CREATE OR REPLACE VIEW `APC_CASH_REGISTER_CURDATE_BY_USER_VIEW` AS +SELECT + UUID() AS id, + lt.payment_amount AS payment, + CONCAT(p.first_name, ' ', p.last_name) AS customer_name, + lt.id_user AS id_user +FROM APC_LOAN_DETAIL lt +INNER JOIN APC_LOAN l ON lt.id_loan = l.id +INNER JOIN APC_PEOPLE p ON l.id_customer = p.id +WHERE + lt.loan_details_type = 'PAYMENT' AND + DATE(lt.created_on) = CURDATE() +ORDER BY lt.created_on; +-- -------------------------------------------------------------------- +-- +-- Estructura para la vista `APC_LOAN_TO_DELIVERY_BY_CERTIFIER_VIEW` +-- +-- Sirve para obtener todos los prestamos que un certificador tiene que entregar. +-- cambio no subido pero proximo a deployar, se espera autorizacion. +-- +CREATE OR REPLACE VIEW `APC_LOAN_TO_DELIVERY_BY_CERTIFIER_VIEW` AS +SELECT + l.id AS id_loan, + CASE + WHEN (SELECT COUNT(id_loan_new) FROM APC_LOAN_BY_RENOVATION WHERE id_loan_new = l.id) = 1 + THEN (SELECT id_loan_old FROM APC_LOAN_BY_RENOVATION WHERE id_loan_new = l.id) + ELSE 'N/A' + END AS id_old_loan, + u.id AS id_user, + -- u.user_name, + -- hrhr.id_route, + -- l.loan_status, + CONCAT( + CASE + WHEN p.first_name IS NOT NULL + THEN CONCAT(SUBSTR(UPPER(p.first_name), 1, 1),SUBSTR(LOWER(p.first_name), 2)) + ELSE '' + END, + CASE + WHEN p.second_name IS NOT NULL + THEN CONCAT(' ',SUBSTR(UPPER(p.second_name), 1, 1),SUBSTR(LOWER(p.second_name), 2)) + ELSE '' + END, + CASE + WHEN p.last_name IS NOT NULL + THEN CONCAT(' ',SUBSTR(UPPER(p.last_name), 1, 1),SUBSTR(LOWER(p.last_name), 2)) + ELSE '' + END + ) AS customer_name, + CASE + WHEN p.address_business IS NOT NULL + THEN CONCAT(SUBSTR(UPPER(p.address_business), 1, 1),SUBSTR(LOWER(p.address_business), 2)) + ELSE '' + END AS customer_address, + p.thumbnail AS thumbnail, + CASE + WHEN (SELECT COUNT(id_loan_new) FROM APC_LOAN_BY_RENOVATION WHERE id_loan_new = l.id) > 0 + THEN 'star' + ELSE 'new' + END AS icon, + CASE + WHEN (SELECT COUNT(id_loan_new) FROM APC_LOAN_BY_RENOVATION WHERE id_loan_new = l.id) > 0 + THEN + CASE + WHEN -- El monto del prestamo origen es almenos $1 mayor que el doble del pago diario + (SELECT (innerL.amount_to_pay - innerL.amount_paid) - (innerLT.payment_daily * 2) FROM APC_LOAN innerL + INNER JOIN APC_LOAN_TYPE innerLT ON innerL.id_loan_type = innerLT.id + WHERE innerL.id = (SELECT id_loan_old FROM APC_LOAN_BY_RENOVATION WHERE id_loan_new = l.id)) > 0 + THEN + lt.payment - + (lt.opening_fee + + (SELECT (innerL.amount_to_pay - innerL.amount_paid) - (innerLT.payment_daily * 2) FROM APC_LOAN innerL + INNER JOIN APC_LOAN_TYPE innerLT ON innerL.id_loan_type = innerLT.id + WHERE innerL.id = (SELECT id_loan_old FROM APC_LOAN_BY_RENOVATION WHERE id_loan_new = l.id))) + ELSE lt.payment - lt.opening_fee -- Es igual o menor al doble del pago diario, no se aplica descuento. + END + ELSE lt.payment - lt.opening_fee -- Es solo prestamo nuevo, no es renovacion + END AS amount_to_delivery, + CASE + WHEN (SELECT COUNT(id_loan_new) FROM APC_LOAN_BY_RENOVATION WHERE id_loan_new = l.id) > 0 + THEN + CASE + WHEN -- (SELECT amount_to_pay - amount_paid FROM APC_LOAN WHERE id = l.id) > (lt.payment_daily * 2) + (SELECT innerL.amount_to_pay - innerL.amount_paid FROM APC_LOAN innerL + INNER JOIN APC_LOAN_TYPE innerLT ON innerL.id_loan_type = innerLT.id + WHERE innerL.id = (SELECT id_loan_old FROM APC_LOAN_BY_RENOVATION WHERE id_loan_new = l.id)) + > + (SELECT innerLT.payment_daily FROM APC_LOAN innerL + INNER JOIN APC_LOAN_TYPE innerLT ON innerL.id_loan_type = innerLT.id + WHERE innerL.id = (SELECT id_loan_old FROM APC_LOAN_BY_RENOVATION WHERE id_loan_new = l.id)) + THEN -- ((l.amount_to_pay - l.amount_paid) - (lt.payment_daily * 2)) + CASE + WHEN + (SELECT (innerL.amount_to_pay - innerL.amount_paid) - (innerLT.payment_daily * 2) FROM APC_LOAN innerL + INNER JOIN APC_LOAN_TYPE innerLT ON innerL.id_loan_type = innerLT.id + WHERE innerL.id = (SELECT id_loan_old FROM APC_LOAN_BY_RENOVATION WHERE id_loan_new = l.id)) + > 0 + THEN + (SELECT (innerL.amount_to_pay - innerL.amount_paid) - (innerLT.payment_daily * 2) FROM APC_LOAN innerL + INNER JOIN APC_LOAN_TYPE innerLT ON innerL.id_loan_type = innerLT.id + WHERE innerL.id = (SELECT id_loan_old FROM APC_LOAN_BY_RENOVATION WHERE id_loan_new = l.id)) + ELSE + 0 + END + ELSE 0 + END + ELSE 0 + END AS discount, + lt.opening_fee AS opening, + lt.payment AS payment, + CASE + WHEN (SELECT COUNT(id_loan_new) FROM APC_LOAN_BY_RENOVATION WHERE id_loan_new = l.id) = 1 + THEN (SELECT amount_to_pay - amount_paid FROM APC_LOAN WHERE id = (SELECT id_loan_old FROM APC_LOAN_BY_RENOVATION WHERE id_loan_new = l.id)) + ELSE 0.0 + END AS 'total_last_loan' +FROM + APC_USER u + INNER JOIN APC_HUMAN_RESOURCE_HAS_ROUTE hrhr ON u.id_human_resource = hrhr.id_human_resource + INNER JOIN APC_HUMAN_RESOURCE hr ON hrhr.id_human_resource = hr.id + INNER JOIN APC_ROLE r ON hr.id_role = r.id + INNER JOIN APC_LOAN l ON hrhr.id_route = l.id_route + INNER JOIN APC_LOAN_TYPE lt ON l.id_loan_type = lt.id + INNER JOIN APC_PEOPLE p ON l.id_customer = p.id +WHERE + u.certifier = 'ENEBLED' AND + l.loan_status = 'TO_DELIVERY' AND + DATE(l.created_on) <= CURDATE() +ORDER BY customer_name DESC; +-- -------------------------------------------------------------------- +-- +-- Estructura para la vista `APC_EXCHANGE_ENEBLED_USERS_VIEW` +-- +-- Sirve para obtener todos los usuarios disponibles para realizar traspasos. +-- +CREATE OR REPLACE VIEW `APC_EXCHANGE_ENEBLED_USERS_VIEW` AS +SELECT +u.id AS id_user, +CONCAT(hr.first_name, ' ', IF(ISNULL(hr.second_name) ,'', CONCAT(hr.second_name,' ')), hr.second_name, ' ', hr.last_name) AS user_name, +hrbo.id_office AS id_office +FROM APC_USER u +INNER JOIN APC_HUMAN_RESOURCE hr ON u.id_human_resource = hr.id +INNER JOIN APC_HUMAN_RESOURCE_BY_OFFICE hrbo ON hr.id = hrbo.id_human_resource +WHERE u.user_status = 'ENEBLED' and +u.user_type IN ('MOBILE','BOTH'); +-- -------------------------------------------------------------------- +-- +-- Estructura para la vista `APC_TOTAL_CASH_BY_CURDATE_VIEW` +-- +-- Sirve para obtener lo que tiene que entregar el asesor al final del dĆ­a. +-- +CREATE OR REPLACE VIEW `APC_TOTAL_CASH_BY_CURDATE_VIEW` AS +SELECT + u.id, + ubo.id_office, + IF( + (SELECT COUNT(id) FROM APC_CLOSING_DAY WHERE id_user = u.id AND id_office = ubo.id_office AND active_status = 'ENEBLED' AND DATE(created_on) = CURDATE()) = 0 + ,(SELECT IF(ISNULL(SUM(ld.payment_amount)),0, SUM(ld.payment_amount)) + FROM APC_LOAN_DETAIL ld + WHERE + ld.id_user = u.id AND + ld.loan_details_type = 'PAYMENT' AND + DATE(ld.created_on) = CURDATE() + ) + ,0.0 + )AS total_amount_payment, + IF( + (SELECT COUNT(id) FROM APC_CLOSING_DAY WHERE id_user = u.id AND id_office = ubo.id_office AND active_status = 'ENEBLED' AND DATE(created_on) = CURDATE()) = 0 + ,(SELECT IF(ISNULL(SUM(ld.payment_amount)),0, SUM(ld.payment_amount)) + FROM APC_LOAN_DETAIL ld + WHERE + ld.id_user = u.id AND + ld.loan_details_type = 'TRANSFER' AND + DATE(ld.created_on) = CURDATE() + ) + ,0.0 + )AS total_amount_deposit, + IF( + (SELECT COUNT(id) FROM APC_CLOSING_DAY WHERE id_user = u.id AND id_office = ubo.id_office AND active_status = 'ENEBLED' AND DATE(created_on) = CURDATE()) = 0 + ,(SELECT IF(ISNULL(SUM(amount_to_transfer)),0, SUM(amount_to_transfer)) + FROM APC_TRANSFER + WHERE + id_user_transmitter = u.id AND + action_status = 'APPROVED' AND + active_status = 'ENEBLED' AND + DATE(last_updated_on) = CURDATE() + ) + ,0.0 + ) AS transfer_sender, + IF( + (SELECT COUNT(id) FROM APC_CLOSING_DAY WHERE id_user = u.id AND id_office = ubo.id_office AND active_status = 'ENEBLED' AND DATE(created_on) = CURDATE()) = 0 + ,(SELECT IF(ISNULL(SUM(amount_to_transfer)),0, SUM(amount_to_transfer)) + FROM APC_TRANSFER + WHERE + id_user_receiver = u.id AND + action_status = 'APPROVED' AND + active_status = 'ENEBLED' AND + DATE(last_updated_on) = CURDATE() + ) + ,0.0 + ) AS transfer_receiver, + IF( + (SELECT COUNT(id) FROM APC_CLOSING_DAY WHERE id_user = u.id AND id_office = ubo.id_office AND active_status = 'ENEBLED' AND DATE(created_on) = CURDATE()) = 0 + ,(SELECT IF(ISNULL(SUM(amount)),0, SUM(amount)) + FROM APC_MONEY_DAILY + WHERE + id_user = u.id AND + DATE(money_daily_date) = CURDATE() + ) + ,0.0 + ) AS money_daily, + IF( + (SELECT COUNT(id) FROM APC_CLOSING_DAY WHERE id_user = u.id AND id_office = ubo.id_office AND active_status = 'ENEBLED' AND DATE(created_on) = CURDATE()) = 0 + ,(SELECT IF(ISNULL(SUM(expense)),0, SUM(expense)) + FROM APC_OTHER_EXPENSE + WHERE + id_user = u.id AND + DATE(created_on) = CURDATE() + ) + ,0.0 + )AS other_expense, + IF( + (SELECT COUNT(id) FROM APC_CLOSING_DAY WHERE id_user = u.id AND id_office = ubo.id_office AND active_status = 'ENEBLED' AND DATE(created_on) = CURDATE()) = 0 + ,(SELECT IF(ISNULL(SUM(amount)),0, SUM(amount)) + FROM APC_DELIVERY + WHERE + id_user = u.id AND + DATE(created_on) = CURDATE() + ) + , 0.0 + ) as delivery, + IF( + (SELECT COUNT(id) FROM APC_CLOSING_DAY WHERE id_user = u.id AND id_office = ubo.id_office AND active_status = 'ENEBLED' AND DATE(created_on) = CURDATE()) = 0 + ,(SELECT IF(ISNULL(SUM(amount_to_transfer)),0, SUM(amount_to_transfer)) + FROM APC_TRANSFER + WHERE + id_user_receiver = u.id AND + action_status = 'PENDING' AND + active_status = 'ENEBLED' AND + DATE(created_on) = CURDATE() + ) + ,0.0 + ) AS transfer_pending +FROM APC_USER u +JOIN APC_USER_BY_OFFICE ubo ON ubo.id_user = u.id +WHERE + u.user_status = 'ENEBLED'; +-- -------------------------------------------------------------------- +-- +-- Estructura para la vista `APC_TOTAL_LOANS_BY_OFFICE` +-- +-- +CREATE OR REPLACE VIEW `APC_TOTAL_LOANS_BY_OFFICE` AS +SELECT + l.id, + l.loan_status, + r.id_office, + r.route_name, + l.id_route, + l.amount_to_pay, + l.amount_paid + FROM + APC_LOAN l + JOIN + APC_ROUTE r ON r.id = l.id_route + WHERE + l.loan_status in ('PENDING', 'FINISH', 'APPROVED','REJECTED','TO_DELIVERY') + AND r.active_status = 'ENEBLED'; +-- -------------------------------------------------------------------- +-- Estructura para la vista `APC_TOTAL_CLOSING_DAY_BY_CURDATE_VIEW` +-- +-- Sirve para obtener lo que tiene que entregar el asesor al final del dĆ­a. +-- +CREATE OR REPLACE VIEW `APC_TOTAL_CLOSING_DAY_BY_CURDATE_VIEW` AS +SELECT + u.id, + u.id_office, + u.amount_paid +FROM APC_CLOSING_DAY u +WHERE + u.active_status = 'ENEBLED' AND + DATE(u.created_on) = CURDATE(); +-- -------------------------------------------------------------------- +-- Estructura para la vista `APC_CLOSING_DAILY_DETAIL_FROM_USER_BY_CURDATE_VIEW` +-- +-- Sirve para obtener los detalles del total de los cobros realizados por los asesores +-- estos pueden ser tanto pagos como multas. +-- +CREATE OR REPLACE VIEW `APC_CLOSING_DAILY_DETAIL_FROM_USER_BY_CURDATE_VIEW` AS +SELECT + ld.id, + CONCAT(p.first_name,' ',IF(ISNULL(p.second_name) ,'', CONCAT(p.second_name, ' ')),p.last_name,' ', p.middle_name) AS comments, + ld.payment_amount as amount, + CASE + WHEN ld.loan_details_type = 'PAYMENT' THEN 'Abono' + WHEN ld.loan_details_type = 'FEE' THEN 'Multa' + WHEN ld.loan_details_type = 'TRANSFER' THEN 'DepĆ³sito' + ELSE '' END as type, + ld.id_user, + ld.created_on, + l.created_on as fechaFiltro, + 'xxxx' as route, + (l.amount_to_pay - amount_paid) as saldo +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON ld.id_loan = l.id +INNER JOIN APC_PEOPLE p ON l.id_customer = p.id +WHERE DATE(ld.created_on) = CURDATE() +AND ld.loan_details_type in ('PAYMENT', 'FEE', 'TRANSFER' ) +UNION +SELECT + md.id, + DATE(md.money_daily_date) AS comments, + md.amount as amount, + 'Inicio' as type, + md.id_user, + md.created_on, + CURDATE() as fechaFiltro, + 'xxxx' as route, + 0 as saldo +FROM + APC_MONEY_DAILY md +WHERE DATE(md.money_daily_date) = CURDATE() +UNION +SELECT + oe.id, + oe.description, + oe.expense, + 'Gasto', + oe.id_user, + oe.created_on, + CURDATE() as fechaFiltro, + 'xxxx' as route, + 0 as saldo +FROM + APC_OTHER_EXPENSE oe +WHERE DATE(oe.created_on) = CURDATE() +UNION +SELECT + te.id, + CONCAT(hr.first_name,' ',IF(ISNULL(hr.second_name) ,'', CONCAT(hr.second_name, ' ')),hr.last_name,' ', hr.middle_name), + te.amount_to_transfer, + 'Transferencia enviada', + te.id_user_transmitter, + te.created_on, + CURDATE() as fechaFiltro, + 'xxxx' as route, + 0 as saldo +FROM + APC_TRANSFER te +JOIN + APC_USER u on u.id = te.id_user_receiver +JOIN + APC_HUMAN_RESOURCE hr on hr.id = u.id_human_resource +WHERE DATE(te.created_on) = CURDATE() +UNION +SELECT + tr.id, + CONCAT(hr.first_name,' ',IF(ISNULL(hr.second_name) ,'', CONCAT(hr.second_name, ' ')),hr.last_name,' ', hr.middle_name), + tr.amount_to_transfer, + 'Transferencia recibida', + tr.id_user_receiver, + tr.created_on, + CURDATE() as fechaFiltro, + 'xxxx' as route, + 0 as saldo +FROM + APC_TRANSFER tr +JOIN + APC_USER u on u.id = tr.id_user_transmitter +JOIN + APC_HUMAN_RESOURCE hr on hr.id = u.id_human_resource +WHERE DATE(tr.created_on) = CURDATE() +UNION +SELECT + d.id, + CONCAT(p.first_name,' ',IF(ISNULL(p.second_name) ,'', CONCAT(p.second_name, ' ')),p.last_name,' ', p.middle_name, ' - ', + r.route_name , ', Abono prĆ©stamo anterior : ', Case WHEN (SELECT CASE WHEN ld.payment_amount is null or 0 THEN 0 ELSE ld.payment_amount END FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l3 ON ld.id_loan = l3.id +WHERE ld.loan_details_type = 'RENOVATION_PAYMENT' +AND l3.id = (SELECT albr.id_loan_old FROM APC_LOAN_BY_RENOVATION albr WHERE albr.id_loan_new = l.id)) is null then 0 else (SELECT CASE WHEN ld.payment_amount is null or 0 THEN 0 ELSE ld.payment_amount END FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l3 ON ld.id_loan = l3.id +WHERE ld.loan_details_type = 'RENOVATION_PAYMENT' +AND l3.id = (SELECT albr.id_loan_old FROM APC_LOAN_BY_RENOVATION albr WHERE albr.id_loan_new = l.id)) end , ', ComisiĆ³n por apertura: ', lt.opening_fee), + d.amount, + 'Entrega de prĆ©stamo', + d.id_user, + d.created_on, + CURDATE() as fechaFiltro, + r.route_name as route, + CASE WHEN (SELECT (l2.amount_to_pay - l2.amount_paid) FROM APC_LOAN_BY_RENOVATION lr + INNER JOIN APC_LOAN l2 ON l2.id = lr.id_loan_old + WHERE lr.id_loan_new = l.id) is null THEN 0 ELSE + (SELECT (l2.amount_to_pay - l2.amount_paid) FROM APC_LOAN_BY_RENOVATION lr + INNER JOIN APC_LOAN l2 ON l2.id = lr.id_loan_old + WHERE lr.id_loan_new = l.id) END as saldo +FROM APC_DELIVERY d +INNER JOIN APC_LOAN l ON d.id_loan = l.id +INNER JOIN APC_LOAN_TYPE lt ON l.id_loan_type = lt.id +INNER JOIN APC_PEOPLE p ON l.id_customer = p.id +INNER JOIN APC_ROUTE r ON r.id = l.id_route +WHERE DATE(d.created_on) = CURDATE(); +-- -------------------------------------------------------------------- +-- Estructura para la vista `APC_LOAN_APPROVED_DETAIL_VIEW` +-- +-- Sirve para obtener los detalles del total de los prestamos que estan +-- en estatus de APROBADO. +-- +CREATE OR REPLACE VIEW `APC_LOAN_APPROVED_DETAIL_VIEW` AS +SELECT + l.id, + l.amount_to_pay - l.amount_paid AS total_to_pay, + l.amount_to_pay - (l.amount_paid + (SELECT IF(ISNULL(SUM(payment_amount)),0,SUM(payment_amount)) FROM APC_LOAN_DETAIL WHERE id_loan = l.id AND loan_details_type = 'FEE')) AS loan_amount_to_pay, + ( + SELECT + IF(ISNULL(SUM(payment_amount)),0,SUM(payment_amount)) + FROM APC_LOAN_DETAIL + WHERE + id_loan = l.id AND + loan_details_type = 'FEE' + )AS total_fee +FROM APC_LOAN l +WHERE l.loan_status = 'APPROVED'; +-- -------------------------------------------------------------------- +-- Estructura para la vista `APC_GENERAL_BOX_VIEW` +-- +CREATE OR REPLACE VIEW `APC_GENERAL_BOX_VIEW` AS +SELECT + md.id, + CONCAT(hr.first_name,' ',IF(ISNULL(hr.second_name) ,'', CONCAT(hr.second_name, ' ')),hr.last_name,' ', hr.middle_name) AS comments, + Date(md.money_daily_date) as fecha, + md.amount as amount, + md.id_office as office, + 'Inicio' as type +FROM APC_MONEY_DAILY md +JOIN + APC_USER u on u.id = md.id_user +JOIN + APC_HUMAN_RESOURCE hr on hr.id = u.id_human_resource +UNION +SELECT + cd.id, + CONCAT(hr.first_name,' ',IF(ISNULL(hr.second_name) ,'', CONCAT(hr.second_name, ' ')),hr.last_name,' ', hr.middle_name) AS comments, + Date(cd.created_on), + cd.amount_paid, + cd.id_office, + 'Corte del dĆ­a' +FROM APC_CLOSING_DAY cd +JOIN + APC_USER u on u.id = cd.id_user +JOIN + APC_HUMAN_RESOURCE hr on hr.id = u.id_human_resource +WHERE cd.active_status = 'ENEBLED' +UNION +SELECT + ecin.id, + ecin.description, + date(ecin.created_on), + ecin.amount, + ecin.id_office, + 'Entrada' +FROM APC_EXPENSE_COMPANY as ecin +WHERE ecin.expense_company_type = 'PAYMENT_IN' +AND ecin.active_status = 'ENEBLED' +UNION +SELECT + ecin.id, + ecin.description, + date(ecin.created_on), + ecin.amount, + ecin.id_office, + 'Salida' +FROM APC_EXPENSE_COMPANY as ecin +WHERE ecin.expense_company_type = 'PAYMENT_OUT' +AND ecin.active_status = 'ENEBLED' +UNION +SELECT + a.id, + CONCAT(hr.first_name,' ',IF(ISNULL(hr.second_name) ,'', CONCAT(hr.second_name, ' ')),hr.last_name,' ', hr.middle_name) AS comments, + date(a.created_on), + a.amount, + a.id_office, + 'Adelanto' +FROM + APC_ADVANCE a +JOIN + APC_HUMAN_RESOURCE hr on hr.id = a.id_human_resource +WHERE + a.active_status = 'ENEBLED' +UNION +SELECT + pay.id, + CONCAT(hr.first_name,' ',IF(ISNULL(hr.second_name) ,'', CONCAT(hr.second_name, ' ')),hr.last_name,' ', hr.middle_name) AS comments, + date(pay.created_on), + pay.total_payment, + pay.id_office, + 'Nomina' +FROM + APC_PAYROLL pay +JOIN + APC_HUMAN_RESOURCE hr on hr.id = pay.id_human_resource +WHERE + pay.active_status = 'ENEBLED' +UNION +SELECT + l.id, + CONCAT(hr.first_name,' ',IF(ISNULL(hr.second_name) ,'', CONCAT(hr.second_name, ' ')),hr.last_name,' ', hr.middle_name) AS comments, + date(l.created_on), + l.amount_loan, + 'caef3a64-7d1f-11ea-af3e-28f659da398e' as office, + 'PrĆ©stamo Empleado' as type +FROM + APC_LOAN_EMPLOYEE l +JOIN + APC_HUMAN_RESOURCE hr on hr.id = l.id_employee +WHERE + l.loan_employee_status = 'ENEBLED'; + +-- -------------------------------------------------------- +-- +-- Estructura para la vista `APC_LOAN_BY_USER_PAYMENT_ZERO_VIEW` +-- +-- Total de abonos en ceros por dia. +-- +CREATE OR REPLACE VIEW `APC_LOAN_BY_USER_PAYMENT_ZERO_VIEW` AS +SELECT + ald.id, + ald.id_user, + al.id_customer, + ald.loan_comments +FROM APC_LOAN_DETAIL ald +INNER JOIN APC_LOAN al ON ald.id_loan = al.id +WHERE + DATE(ald.created_on) = CURDATE() + AND ald.payment_amount = 0 + AND al.loan_status != 'DELETED' + AND ald.loan_details_type = 'PAYMENT'; +-- ---------------------------------------------------------------- +-- +-- Estructura para la vista `APC_INFORMATION_LOAN_WEEK_VIEW` +-- +CREATE OR REPLACE VIEW `APC_INFORMATION_LOAN_WEEK_VIEW` AS +SELECT +l.id, +u.id as id_user, +r.id_office, +l.created_on as fecha, +lt.payment as apoyos, +lt.payment_total as apoyos_total, +lt.opening_fee as comision_apertura, +CONCAT(endor.first_name,' ', IF(ISNULL(endor.second_name) ,'', CONCAT(endor.second_name,' ')) ,endor.last_name, ' ', endor.middle_name) AS aval, +CONCAT(cus.first_name,' ', IF(ISNULL(cus.second_name) ,'', CONCAT(cus.second_name,' ')) ,cus.last_name, ' ', cus.middle_name) AS customer, +l.amount_to_pay as documento_por, +lt.payment_daily as abono_diario, +l.amount_paid, +(l.amount_to_pay - l.amount_paid) saldo_insoluto, +r.route_name, +CONCAT(hr.first_name,' ', IF(ISNULL(hr.second_name) ,'', CONCAT(hr.second_name,' ')) ,hr.last_name, ' ', hr.middle_name) AS asesor, +(SELECT COUNT(lfn.id) FROM APC_LOAN_FEE_NOTIFICATION lfn WHERE lfn.id_loan = l.id) as num_fee, +-- Lunes +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'monday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_monday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'monday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_monday, +-- Martes +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'tuesday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_tuesday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'tuesday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_tuesday, +-- Miercoles +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) +AND YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'wednesday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_wednesday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'wednesday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_wednesday, +-- Jueves +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'thursday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_thursday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'thursday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_thursday, +-- Viernes +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'friday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_friday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'friday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_friday, +-- Sabado +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'saturday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_saturday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'saturday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_saturday, + +((lt.payment_daily * (SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) > 5, 5 , COUNT(DISTINCT(DATE(ldFaltante.created_on)))) FROM APC_LOAN_DETAIL ldFaltante +WHERE ldFaltante.id_loan = l.id AND WEEK(DATE(ldFaltante.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldFaltante.created_on)) = YEAR(CURDATE()) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('saturday','sunday') +AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER', 'FEE'))) +- (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER'))) as faltante, + +CASE WHEN l.new_customer = 'ENEBLED' AND WEEK(DATE(l.created_on),1) = WEEK(CURDATE(),1) THEN 'Si' ELSE 'No' END as new_customer, +if((SELECT COUNT(id_loan_old) FROM APC_LOAN_BY_RENOVATION lbr +INNER JOIN APC_LOAN lRenovation ON lbr.id_loan_new = lRenovation.id +WHERE id_loan_old = l.id + AND loan_by_renovation_status = 'APPROVED' and WEEK(DATE(lRenovation.created_on),1) <= WEEK(CURDATE(),1) AND + YEAR(DATE(lRenovation.created_on)) = YEAR(CURDATE())) = 0 , 'No' , 'Si') as renovation, +l.loan_status as estatus_prestamo, +(SELECT COUNT(DISTINCT(DATE(ldFaltante.created_on))) FROM APC_LOAN_DETAIL ldFaltante +WHERE ldFaltante.id_loan = l.id AND WEEK(DATE(ldFaltante.created_on),1) <= (WEEK(CURDATE(),1)) AND +YEAR(DATE(ldFaltante.created_on)) = YEAR(CURDATE()) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('saturday','sunday') +AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER', 'FEE')) as num_pagos_all, +(SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) > 5, 5, COUNT(DISTINCT(DATE(ldFaltante.created_on)))) FROM APC_LOAN_DETAIL ldFaltante +WHERE ldFaltante.id_loan = l.id AND WEEK(DATE(ldFaltante.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ldFaltante.created_on)) = YEAR(CURDATE()) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('saturday','sunday') +AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER', 'FEE')) as num_pagos_week, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) <= (WEEK(CURDATE(),1)) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND ldLunes.loan_details_type IN ('FEE')) as fee_todos +FROM +APC_LOAN l +INNER JOIN APC_LOAN_TYPE lt ON l.id_loan_type = lt.id +INNER JOIN APC_PEOPLE cus ON cus.id = l.id_customer +INNER JOIN APC_PEOPLE endor ON endor.id = l.id_endorsement +INNER JOIN APC_ROUTE r ON r.id = l.id_route +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +INNER JOIN APC_USER u ON u.id = lbu.id_user +INNER JOIN APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource +WHERE +l.loan_status not in ('DELETED','REJECTED') AND +((SELECT COUNT(ld.id) FROM APC_LOAN_DETAIL ld WHERE WEEK(DATE(ld.created_on),1) = WEEK(CURDATE(),1) AND + YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.id_loan = l.id) > 0 OR + ((SELECT COUNT(ld.id) FROM APC_LOAN_DETAIL ld WHERE WEEK(DATE(ld.created_on),1) = WEEK(CURDATE(),1) AND + YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.id_loan = l.id) = 0 AND l.loan_status = 'APPROVED' AND + WEEK(DATE(l.created_on),1) <= (WEEK(CURDATE(),1)))); +-- ---------------------------------------------------------------- +-- +-- Estructura para la vista `APC_CUSTOMERS_WITHOUT_RENOVATION_VIEW` +-- +CREATE OR REPLACE VIEW `APC_CUSTOMERS_WITHOUT_RENOVATION_VIEW` AS +SELECT + p.id as id, + CONCAT(p.first_name,' ', IF(ISNULL(p.second_name) ,'', CONCAT(p.second_name,' ')) ,p.last_name, ' ', p.middle_name) AS available_person, + ar.route_name, + (SELECT MAX(l.created_on) FROM APC_LOAN l WHERE l.id_customer = p.id) as last_loan, + p.id_office AS office, +FROM APC_PEOPLE p +INNER JOIN APC_ROUTE ar ON ar.id = p.id_route +WHERE + p.people_type IN ('CUSTOMER', 'BOTH') AND + p.active_status = 'ENEBLED' AND + (SELECT COUNT(l.id) FROM APC_LOAN l WHERE l.id_customer = p.id) > 0 AND + CASE + WHEN 0 = ( + SELECT COUNT(id) + FROM APC_LOAN + WHERE + id_customer = p.id AND + loan_status IN ('PENDING', 'BLACK_LIST', 'APPROVED', 'PENDING_RENOVATION', 'TO_DELIVERY') + ) + THEN TRUE + ELSE FALSE + END +ORDER BY available_person; +-- ---------------------------------------------------------------- +-- +-- Estructura para la vista `APC_ADVANCE_USER_DAILY_DETAIL_VIEW` +-- +CREATE OR REPLACE VIEW `APC_ADVANCE_USER_DAILY_DETAIL_VIEW` AS +SELECT +ald.id, +ald.id_user, +CONCAT(ap.first_name, ' ', ap.last_name) AS customer_name, +ald.payment_amount, +ald.created_on, +ap.address_business, +CASE + WHEN ald.loan_details_type = 'PAYMENT' THEN 'Abono' + WHEN ald.loan_details_type = 'FEE' THEN 'Multa' + WHEN ald.loan_details_type = 'TRANSFER' THEN 'DepĆ³sito' + ELSE '' END as type_ayment +FROM APC_LOAN_DETAIL ald +INNER JOIN APC_LOAN al ON al.id = ald.id_loan +INNER JOIN APC_PEOPLE ap ON ap.id = al.id_customer +WHERE DATE(ald.created_on) = CURDATE() AND +al.loan_status != 'DELETED' AND +ald.loan_details_type IN ('PAYMENT','FEE','TRANSFER') +UNION +SELECT +id, +user_id, +customer_name, +'Sin visita', +CURDATE(), +customer_address_business, +'Sin visita' +FROM APC_LOAN_BY_USER_VIEW; +-- ---------------------------------------------------------------- +-- +-- Estructura para la vista `APC_TOTAL_LOANS_APPROVED_BY_OFFICE` +-- +CREATE OR REPLACE VIEW `APC_TOTAL_LOANS_APPROVED_BY_OFFICE` AS +SELECT + l.id, + l.loan_status, + r.id_office, + r.payment_daily + FROM + APC_LOAN l + JOIN + APC_LOAN_TYPE r ON r.id = l.id_loan_type + WHERE + l.loan_status in ('APPROVED'); +-- ---------------------------------------------------------------- +-- +-- Estructura para la vista `APC_TOTAL_CASH_BY_CURDATE_DASHBOARD_VIEW` +-- +CREATE OR REPLACE VIEW `APC_TOTAL_CASH_BY_CURDATE_DASHBOARD_VIEW` AS +SELECT + u.id, + ubo.id_office, + (SELECT IF(ISNULL(SUM(ld.payment_amount)),0, SUM(ld.payment_amount)) + FROM APC_LOAN_DETAIL ld + WHERE + ld.id_user = u.id AND + ld.loan_details_type = 'PAYMENT' AND + DATE(ld.created_on) = CURDATE() + + )AS total_amount_payment, + (SELECT IF(ISNULL(SUM(ld.payment_amount)),0, SUM(ld.payment_amount)) + FROM APC_LOAN_DETAIL ld + WHERE + ld.id_user = u.id AND + ld.loan_details_type = 'TRANSFER' AND + DATE(ld.created_on) = CURDATE() + + )AS total_amount_deposit, + (SELECT IF(ISNULL(SUM(amount_to_transfer)),0, SUM(amount_to_transfer)) + FROM APC_TRANSFER + WHERE + id_user_transmitter = u.id AND + action_status = 'APPROVED' AND + active_status = 'ENEBLED' AND + DATE(last_updated_on) = CURDATE() + )AS transfer_sender, + (SELECT IF(ISNULL(SUM(amount_to_transfer)),0, SUM(amount_to_transfer)) + FROM APC_TRANSFER + WHERE + id_user_receiver = u.id AND + action_status = 'APPROVED' AND + active_status = 'ENEBLED' AND + DATE(last_updated_on) = CURDATE() + ) AS transfer_receiver, + (SELECT IF(ISNULL(SUM(amount)),0, SUM(amount)) + FROM APC_MONEY_DAILY + WHERE + id_user = u.id AND + DATE(money_daily_date) = CURDATE() + ) AS money_daily, + (SELECT IF(ISNULL(SUM(expense)),0, SUM(expense)) + FROM APC_OTHER_EXPENSE + WHERE + id_user = u.id AND + DATE(created_on) = CURDATE() + ) AS other_expense, + (SELECT IF(ISNULL(SUM(amount)),0, SUM(amount)) + FROM APC_DELIVERY + WHERE + id_user = u.id AND + DATE(created_on) = CURDATE() + ) as delivery, + (SELECT IF(ISNULL(SUM(amount_to_transfer)),0, SUM(amount_to_transfer)) + FROM APC_TRANSFER + WHERE + id_user_receiver = u.id AND + action_status = 'PENDING' AND + active_status = 'ENEBLED' AND + DATE(created_on) = CURDATE() + ) AS transfer_pending +FROM APC_USER u +JOIN APC_USER_BY_OFFICE ubo ON ubo.id_user = u.id +WHERE + u.user_status = 'ENEBLED'; +-- ---------------------------------------------------------------- +-- +-- Estructura para la vista `APC_MONEY_DAILY_BY_USER_CERTIFIER_VIEW` +-- +CREATE OR REPLACE VIEW `APC_MONEY_DAILY_BY_USER_CERTIFIER_VIEW` AS +SELECT + u.id, + u.user_name, + uo.id_office, + CONCAT(hr.first_name, ' ' , hr.last_name) as employee, + (SELECT SUM(ldc.amount_to_delivery) FROM APC_LOAN_TO_DELIVERY_BY_CERTIFIER_VIEW ldc + WHERE ldc.id_user = u.id) as amount +FROM + APC_USER u +INNER JOIN + APC_USER_BY_OFFICE uo ON u.id = uo.id_user +INNER JOIN + APC_HUMAN_RESOURCE hr ON u.id_human_resource = hr.id +WHERE + u.user_status = 'ENEBLED' +AND + u.certifier = 'ENEBLED'; +-- -------------------------------------------------------- +-- +-- Estructura para la vista `APC_USER_BY_ROUTE_VIEW` +-- +-- Se utiliza para identificar a los usuarios por rutas. +-- +CREATE OR REPLACE VIEW `APC_USER_BY_ROUTE_VIEW` AS +SELECT +CONCAT(u.id,hrhr.id_route) AS id, +u.id AS id_user, +hrhr.id_route AS id_route, + CONCAT( + CASE + WHEN hr.first_name IS NOT NULL AND hr.first_name != '' + THEN CONCAT(SUBSTR(UPPER(hr.first_name), 1, 1),SUBSTR(LOWER(hr.first_name), 2)) + ELSE '' + END, + CASE + WHEN hr.second_name IS NOT NULL AND hr.second_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(hr.second_name), 1, 1),SUBSTR(LOWER(hr.second_name), 2)) + ELSE '' + END, + CASE + WHEN hr.last_name IS NOT NULL AND hr.last_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(hr.last_name), 1, 1),SUBSTR(LOWER(hr.last_name), 2)) + ELSE '' + END, + CASE + WHEN hr.middle_name IS NOT NULL AND hr.middle_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(hr.middle_name), 1, 1),SUBSTR(LOWER(hr.middle_name), 2)) + ELSE '' + END + ) AS employee_name +FROM APC_HUMAN_RESOURCE_HAS_ROUTE hrhr +INNER JOIN APC_HUMAN_RESOURCE hr ON hrhr.id_human_resource = hr.id +INNER JOIN APC_USER u ON hr.id = u.id_human_resource +WHERE u.user_status = 'ENEBLED' AND +u.user_type IN ('MOBILE','BOTH') +ORDER BY employee_name; +-- ---------------------------------------------------------------- +-- +-- Estructura para la vista `APC_LOAN_DIFERENCES_BY_USER_LAST_WEEK_VIEW` +-- +CREATE OR REPLACE VIEW `APC_LOAN_DIFERENCES_BY_USER_LAST_WEEK_VIEW` AS +SELECT +l.id, +lbu.id_user, +((lt.payment_daily * 5) - (SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +WHERE ld.id_loan = l.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) +AND YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER'))) + as faltante +FROM + APC_LOAN l +INNER JOIN + APC_LOAN_TYPE lt ON l.id_loan_type = lt.id +INNER JOIN + APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE +l.loan_status not in ('DELETED','REJECTED') AND +(SELECT COUNT(ld2.id) FROM APC_LOAN_DETAIL ld2 WHERE WEEK(DATE(ld2.created_on),1) = (WEEK(CURDATE(),1)-1) +AND YEAR(DATE(ld2.created_on)) = YEAR(CURDATE()) AND ld2.id_loan = l.id) > 4; +-- ---------------------------------------------------------------- +-- +-- Estructura para la vista `APC_INFORMATION_LOAN_LAST_WEEK_VIEW` +-- +CREATE OR REPLACE VIEW `APC_INFORMATION_LOAN_LAST_WEEK_VIEW` AS +SELECT +l.id, +u.id as id_user, +r.id_office, +l.created_on as fecha, +lt.payment as apoyos, +lt.payment_total as apoyos_total, +lt.opening_fee as comision_apertura, +CONCAT(endor.first_name,' ', IF(ISNULL(endor.second_name) ,'', CONCAT(endor.second_name,' ')) ,endor.last_name, ' ', endor.middle_name) AS aval, +CONCAT(cus.first_name,' ', IF(ISNULL(cus.second_name) ,'', CONCAT(cus.second_name,' ')) ,cus.last_name, ' ', cus.middle_name) AS customer, +l.amount_to_pay as documento_por, +lt.payment_daily as abono_diario, +l.amount_paid, +(l.amount_to_pay - l.amount_paid) saldo_insoluto, +r.route_name, +CONCAT(hr.first_name,' ', IF(ISNULL(hr.second_name) ,'', CONCAT(hr.second_name,' ')) ,hr.last_name, ' ', hr.middle_name) AS asesor, +(SELECT COUNT(lfn.id) FROM APC_LOAN_FEE_NOTIFICATION lfn WHERE lfn.id_loan = l.id) as num_fee, +-- Lunes +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'monday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_monday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'monday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_monday, +-- Martes +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'tuesday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_tuesday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'tuesday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_tuesday, +-- Miercoles +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'wednesday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_wednesday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'wednesday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_wednesday, +-- Jueves +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'thursday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_thursday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'thursday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_thursday, +-- Viernes +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'friday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_friday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'friday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_friday, +-- Sabado +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'saturday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_saturday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'saturday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_saturday, + +((lt.payment_daily * (SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) > 5, 5, COUNT(DISTINCT(DATE(ldFaltante.created_on)))) FROM APC_LOAN_DETAIL ldFaltante +WHERE ldFaltante.id_loan = l.id AND WEEK(DATE(ldFaltante.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldFaltante.created_on)) = YEAR(CURDATE()) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('saturday','sunday') +AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER', 'FEE'))) +- (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER'))) as faltante, + +CASE WHEN l.new_customer = 'ENEBLED' AND WEEK(DATE(l.created_on),1) = (WEEK(CURDATE(),1) - 1) THEN 'Si' ELSE 'No' END as new_customer, +(SELECT IF(COUNT(id_loan_old) = 0 , 'No' , 'Si') FROM APC_LOAN_BY_RENOVATION lbr +INNER JOIN APC_LOAN lRenovation ON lbr.id_loan_new = lRenovation.id +WHERE id_loan_old = l.id + AND loan_by_renovation_status = 'APPROVED' and WEEK(DATE(lRenovation.created_on),1) <= (WEEK(CURDATE(),1) - 1) AND + YEAR(DATE(lRenovation.created_on)) = YEAR(CURDATE())) as renovation, +l.loan_status as estatus_prestamo, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as abono_semana_actual, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND ldLunes.loan_details_type IN ('FEE')) as fee_semana_actual, +(SELECT COUNT(DISTINCT(DATE(ldFaltante.created_on))) FROM APC_LOAN_DETAIL ldFaltante +WHERE ldFaltante.id_loan = l.id AND WEEK(DATE(ldFaltante.created_on),1) <= (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldFaltante.created_on)) = YEAR(CURDATE()) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('saturday','sunday') +AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER', 'FEE')) as num_pagos_all, +(SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) > 5, 5, COUNT(DISTINCT(DATE(ldFaltante.created_on)))) FROM APC_LOAN_DETAIL ldFaltante +WHERE ldFaltante.id_loan = l.id AND WEEK(DATE(ldFaltante.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldFaltante.created_on)) = YEAR(CURDATE()) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('saturday','sunday') +AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER', 'FEE')) as num_pagos_week, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) <= (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND ldLunes.loan_details_type IN ('FEE')) as fee_todos +FROM +APC_LOAN l +INNER JOIN APC_LOAN_TYPE lt ON l.id_loan_type = lt.id +INNER JOIN APC_PEOPLE cus ON cus.id = l.id_customer +INNER JOIN APC_PEOPLE endor ON endor.id = l.id_endorsement +INNER JOIN APC_ROUTE r ON r.id = l.id_route +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +INNER JOIN APC_USER u ON u.id = lbu.id_user +INNER JOIN APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource +WHERE +l.loan_status not in ('DELETED','REJECTED') AND +((SELECT COUNT(ld.id) FROM APC_LOAN_DETAIL ld WHERE WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.id_loan = l.id) > 0 OR + ((SELECT COUNT(ld.id) FROM APC_LOAN_DETAIL ld WHERE WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.id_loan = l.id) = 0 AND l.loan_status = 'APPROVED' AND + WEEK(DATE(l.created_on),1) <= (WEEK(CURDATE(),1) - 1))); +-- ---------------------------------------------------------------- +-- +-- Estructura para la vista `APC_COLOCATION_WEEK_BY_USER_VIEW` +-- +CREATE OR REPLACE VIEW `APC_COLOCATION_WEEK_BY_USER_VIEW` AS +SELECT +u.id, +CONCAT(hr.first_name, ' ' , hr.last_name) as username, +ubo.id_office, +(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND al.created_by = u.id + AND WEEK(DATE(al.created_on),1) = WEEK(CURDATE(),1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'monday') + as colocation_monday, +(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND al.created_by = u.id + AND WEEK(DATE(al.created_on),1) = WEEK(CURDATE(),1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'tuesday') + as colocation_tuesday, +(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND al.created_by = u.id + AND WEEK(DATE(al.created_on),1) = WEEK(CURDATE(),1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'wednesday') + as colocation_wednesday, +(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND al.created_by = u.id + AND WEEK(DATE(al.created_on),1) = WEEK(CURDATE(),1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'thursday') + as colocation_thursday, +(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND al.created_by = u.id + AND WEEK(DATE(al.created_on),1) = WEEK(CURDATE(),1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'friday') + as colocation_friday, +(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND al.created_by = u.id + AND WEEK(DATE(al.created_on),1) = WEEK(CURDATE(),1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'saturday') + as colocation_saturday, +(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND al.created_by = u.id + AND WEEK(DATE(al.created_on),1) = WEEK(CURDATE(),1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE())) + as colocation_total +FROM APC_USER u +INNER JOIN APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource AND hr.human_resource_status = 'ENEBLED' +INNER JOIN APC_USER_BY_OFFICE ubo ON ubo.id_user = u.id +WHERE u.user_status = 'ENEBLED' AND +u.user_type IN ('MOBILE'); +-- ---------------------------------------------------------------- +-- +-- Estructura para la vista `APC_COLOCATION_LAST_WEEK_BY_USER_VIEW` +-- +CREATE OR REPLACE VIEW `APC_COLOCATION_LAST_WEEK_BY_USER_VIEW` AS +SELECT +u.id, +CONCAT(hr.first_name, ' ' , hr.last_name) as username, +ubo.id_office, +(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND al.created_by = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1)-1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'monday') + as colocation_monday, +(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND al.created_by = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1)-1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'tuesday') + as colocation_tuesday, +(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND al.created_by = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1)-1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'wednesday') + as colocation_wednesday, +(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND al.created_by = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1)-1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'thursday') + as colocation_thursday, +(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND al.created_by = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1)-1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'friday') + as colocation_friday, +(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND al.created_by = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1)-1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'saturday') + as colocation_saturday, +(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND al.created_by = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1)-1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE())) + as colocation_total +FROM APC_USER u +INNER JOIN APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource AND hr.human_resource_status = 'ENEBLED' +INNER JOIN APC_USER_BY_OFFICE ubo ON ubo.id_user = u.id +WHERE u.user_status = 'ENEBLED' AND +u.user_type IN ('MOBILE'); +-- ---------------------------------------------------------------- +-- +-- Estructura para la vista `APC_SUBTOTAL_LAST_WEEK_BY_USER_VIEW` +-- +CREATE OR REPLACE VIEW `APC_SUBTOTAL_LAST_WEEK_BY_USER_VIEW` AS +SELECT +u.id, +CONCAT(hr.first_name, ' ' , hr.last_name) as username, +ubo.id_office, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'monday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_monday, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'monday') + as opening_fee_monday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'tuesday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_tuesday, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'tuesday') + as opening_fee_tuesday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'wednesday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_wednesday, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'wednesday') + as opening_fee_wednesday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'thursday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_thursday, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'thursday') + as opening_fee_thursday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'friday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_friday, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'friday') + as opening_fee_friday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'saturday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_saturday, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'saturday') + as opening_fee_saturday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_total, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) ) + as opening_fee_total, +( + select + IF(ISNULL( + SUM( + CASE WHEN l.loan_status IN ('PENDING_RENOVATION', 'FINISH') then 0 ELSE + ((lt.payment_daily * (SELECT COUNT(ldFaltante.id) FROM APC_LOAN_DETAIL ldFaltante + WHERE ldFaltante.id_loan = l.id AND WEEK(DATE(ldFaltante.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(DATE(ldFaltante.created_on)) = YEAR(CURDATE()) + AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER', 'FEE'))) + - (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) + FROM APC_LOAN_DETAIL ldLunes + WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) + AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER'))) END + ) + ),0, + SUM( + CASE WHEN l.loan_status IN ('PENDING_RENOVATION', 'FINISH') then 0 ELSE + ((lt.payment_daily * (SELECT COUNT(ldFaltante.id) FROM APC_LOAN_DETAIL ldFaltante + WHERE ldFaltante.id_loan = l.id AND WEEK(DATE(ldFaltante.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(DATE(ldFaltante.created_on)) = YEAR(CURDATE()) + AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER', 'FEE'))) + - (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) + FROM APC_LOAN_DETAIL ldLunes + WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) + AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER'))) END + ) + ) + as faltante + + FROM + APC_LOAN l + INNER JOIN APC_LOAN_TYPE lt ON l.id_loan_type = lt.id + INNER JOIN APC_LOAN_BY_USER albu ON l.id = albu.id_loan + WHERE albu.id_user = u.id + AND albu.owner_loan = 'CURRENT_OWNER' + +) +as faltante +FROM APC_USER u +INNER JOIN APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource AND hr.human_resource_status = 'ENEBLED' +INNER JOIN APC_USER_BY_OFFICE ubo ON ubo.id_user = u.id +WHERE u.user_status = 'ENEBLED' AND +u.user_type IN ('MOBILE') AND +u.certifier = 'DISABLED'; +-- ---------------------------------------------------------------- +-- +-- Estructura para la vista `APC_SUBTOTAL_WEEK_BY_USER_VIEW` +-- +CREATE OR REPLACE VIEW `APC_SUBTOTAL_WEEK_BY_USER_VIEW` AS +SELECT +u.id, +CONCAT(hr.first_name, ' ' , hr.last_name) as username, +ubo.id_office, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'monday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_monday, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1)) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'monday') + as opening_fee_monday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'tuesday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_tuesday, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1)) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'tuesday') + as opening_fee_tuesday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'wednesday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_wednesday, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1)) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'wednesday') + as opening_fee_wednesday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'thursday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_thursday, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1)) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'thursday') + as opening_fee_thursday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'friday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_friday, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1)) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'friday') + as opening_fee_friday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'saturday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_saturday, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1)) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) + AND LOWER(DAYNAME(DATE(al.created_on))) = 'saturday') + as opening_fee_saturday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_total, +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND albu.id_user = u.id + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1)) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) ) + as opening_fee_total +FROM APC_USER u +INNER JOIN APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource AND hr.human_resource_status = 'ENEBLED' +INNER JOIN APC_USER_BY_OFFICE ubo ON ubo.id_user = u.id +WHERE u.user_status = 'ENEBLED' AND +u.user_type IN ('MOBILE') AND +u.certifier = 'DISABLED'; +-- -------------------------------------------------------------------- +-- +-- Estructura para la vista `APC_CURRENT_CUSTOMER_BY_LOAN_VIEW` +-- SIRVE PARA TRAER LOS PRESTAMOS CON SUS CLIENTES, AVALES Y ASESORES. +-- +-- -------------------------------------------------------------------- +CREATE OR REPLACE VIEW `APC_CURRENT_CUSTOMER_BY_LOAN_VIEW` AS +SELECT +loan.id AS id_loan, +usr.id AS id_user, +usr_by_office.id_office AS id_office, +loan_type.payment AS payment, +CONCAT( + CASE + WHEN customer.first_name IS NOT NULL AND customer.first_name != '' + THEN CONCAT(SUBSTR(UPPER(customer.first_name), 1, 1),SUBSTR(LOWER(customer.first_name), 2)) + ELSE '' + END, + CASE + WHEN customer.second_name IS NOT NULL AND customer.second_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(customer.second_name), 1, 1),SUBSTR(LOWER(customer.second_name), 2)) + ELSE '' + END, + CASE + WHEN customer.last_name IS NOT NULL AND customer.last_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(customer.last_name), 1, 1),SUBSTR(LOWER(customer.last_name), 2)) + ELSE '' + END, + CASE + WHEN customer.middle_name IS NOT NULL AND customer.middle_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(customer.middle_name), 1, 1),SUBSTR(LOWER(customer.middle_name), 2)) + ELSE '' + END + ) AS customer_name, + CONCAT( + CASE + WHEN endorsement.first_name IS NOT NULL AND endorsement.first_name != '' + THEN CONCAT(SUBSTR(UPPER(endorsement.first_name), 1, 1),SUBSTR(LOWER(endorsement.first_name), 2)) + ELSE '' + END, + CASE + WHEN endorsement.second_name IS NOT NULL AND endorsement.second_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(endorsement.second_name), 1, 1),SUBSTR(LOWER(endorsement.second_name), 2)) + ELSE '' + END, + CASE + WHEN endorsement.last_name IS NOT NULL AND endorsement.last_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(endorsement.last_name), 1, 1),SUBSTR(LOWER(endorsement.last_name), 2)) + ELSE '' + END, + CASE + WHEN endorsement.middle_name IS NOT NULL AND endorsement.middle_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(endorsement.middle_name), 1, 1),SUBSTR(LOWER(endorsement.middle_name), 2)) + ELSE '' + END + ) AS endorsement_name, + loan.loan_status AS loan_status, + loan.created_on AS created_on, + route.route_name AS route_name +FROM APC_LOAN loan +INNER JOIN APC_PEOPLE customer ON loan.id_customer = customer.id +INNER JOIN APC_PEOPLE endorsement ON loan.id_endorsement = endorsement.id +INNER JOIN APC_LOAN_TYPE loan_type ON loan.id_loan_type = loan_type.id +INNER JOIN APC_LOAN_BY_USER loan_by_user ON loan.id = loan_by_user.id_loan +INNER JOIN APC_USER usr ON loan_by_user.id_user = usr.id +INNER JOIN APC_USER_BY_OFFICE usr_by_office ON usr.id = usr_by_office.id_user +INNER JOIN APC_ROUTE route ON loan.id_route = route.id +WHERE loan.loan_status IN('APPROVED','PENDING','PENDING_RENOVATION','TO_DELIVERY') +ORDER BY usr.id, loan.created_on; +-- -------------------------------------------------------------------- +-- +-- Estructura para la vista `APC_AVAILABLES_OWNERS_VIEW` +-- REGRESA LOS USUARIOS ACTIVOS DE TIPO MOBILE AND BOTH. +-- +-- -------------------------------------------------------------------- +CREATE OR REPLACE VIEW `APC_AVAILABLES_OWNERS_VIEW` AS +SELECT +usr.id AS id_user, +usr_by_office.id_office AS id_office, +usr.user_name AS user_name, +CONCAT( + CASE + WHEN human_resource.first_name IS NOT NULL AND human_resource.first_name != '' + THEN CONCAT(SUBSTR(UPPER(human_resource.first_name), 1, 1),SUBSTR(LOWER(human_resource.first_name), 2)) + ELSE '' + END, + CASE + WHEN human_resource.second_name IS NOT NULL AND human_resource.second_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(human_resource.second_name), 1, 1),SUBSTR(LOWER(human_resource.second_name), 2)) + ELSE '' + END, + CASE + WHEN human_resource.last_name IS NOT NULL AND human_resource.last_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(human_resource.last_name), 1, 1),SUBSTR(LOWER(human_resource.last_name), 2)) + ELSE '' + END, + CASE + WHEN human_resource.middle_name IS NOT NULL AND human_resource.middle_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(human_resource.middle_name), 1, 1),SUBSTR(LOWER(human_resource.middle_name), 2)) + ELSE '' + END + ) AS full_name +FROM APC_USER usr +INNER JOIN APC_HUMAN_RESOURCE human_resource ON usr.id_human_resource = human_resource.id +INNER JOIN APC_USER_BY_OFFICE usr_by_office ON usr.id = usr_by_office.id_user +WHERE usr.user_status = 'ENEBLED' AND +usr.user_type IN ('MOBILE','BOTH') AND +usr.certifier = 'DISABLED'; +-- ---------------------------------------------------------------- +-- +-- Estructura para la vista `APC_COBRANZA_LAST_WEEK_BY_USER_VIEW` +-- +CREATE OR REPLACE VIEW `APC_COBRANZA_LAST_WEEK_BY_USER_VIEW` AS +SELECT +u.id, +CONCAT(hr.first_name, ' ' , hr.last_name) as username, +ubo.id_office, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' AND ld.id_user = u.id +AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'monday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_monday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' and ld.id_user = u.id +AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'tuesday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_tuesday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' and ld.id_user = u.id +AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'wednesday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_wednesday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' and ld.id_user = u.id +AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'thursday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_thursday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' and ld.id_user = u.id +AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'friday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_friday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' and ld.id_user = u.id +AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'saturday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_saturday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' and ld.id_user = u.id +AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_total +FROM APC_USER u +INNER JOIN APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource AND hr.human_resource_status = 'ENEBLED' +INNER JOIN APC_USER_BY_OFFICE ubo ON ubo.id_user = u.id +WHERE u.user_status = 'ENEBLED' AND +u.user_type IN ('MOBILE') AND +u.certifier = 'DISABLED'; +-- ---------------------------------------------------------------- +-- +-- Estructura para la vista `APC_COBRANZA_WEEK_BY_USER_VIEW` +-- +CREATE OR REPLACE VIEW `APC_COBRANZA_WEEK_BY_USER_VIEW` AS +SELECT +u.id, +CONCAT(hr.first_name, ' ' , hr.last_name) as username, +ubo.id_office, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' AND ld.id_user = u.id +AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'monday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_monday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' and ld.id_user = u.id +AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'tuesday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_tuesday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' and ld.id_user = u.id +AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'wednesday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_wednesday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' and ld.id_user = u.id +AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'thursday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_thursday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' and ld.id_user = u.id +AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'friday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_friday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' and ld.id_user = u.id +AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'saturday' +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_saturday, +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' and ld.id_user = u.id +AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_total +FROM APC_USER u +INNER JOIN APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource AND hr.human_resource_status = 'ENEBLED' +INNER JOIN APC_USER_BY_OFFICE ubo ON ubo.id_user = u.id +WHERE u.user_status = 'ENEBLED' AND +u.user_type IN ('MOBILE') AND +u.certifier = 'DISABLED'; +-- ---------------------------------------------------------------- +-- +-- Estructura para la vista `APC_ADVANCE_USER_DAILY_DASHBOARD_VIEW` +-- +CREATE OR REPLACE VIEW `APC_ADVANCE_USER_DAILY_DASHBOARD_VIEW` AS +SELECT + ate.id, + CONCAT(ahr.first_name, ' ' , ahr.last_name) as user_name, + ate.total_expected, + (ate.total_expected - (SELECT COUNT(id) FROM APC_LOAN_BY_USER_VIEW where user_id = ate.id_user)) as total_now, + CASE WHEN (ate.total_expected - (SELECT COUNT(id) FROM APC_LOAN_BY_USER_VIEW where user_id = ate.id_user)) = 0 + THEN 0 + ELSE + ((ate.total_expected - (SELECT COUNT(id) FROM APC_LOAN_BY_USER_VIEW where user_id = ate.id_user)) * 100) / ate.total_expected + END + as porcentaje, + ate.id_office, + ate.id_user, + (SELECT IF(ISNULL(SUM(ate2.total_expected_payment)),0,SUM(ate2.total_expected_payment)) FROM APC_TOTAL_EXPECTED_PAYMENT_DAILY_BY_USER ate2 + where WEEK(DATE(ate2.created_on),1) = (Select WEEK(CURDATE(),1)) and YEAR(DATE(ate2.created_on)) = (SELECT YEAR(CURDATE())) AND ate2.id_user = ate.id_user) + as total_expected_week, + (SELECT IF(ISNULL(SUM(ald.payment_amount)),0,SUM(ald.payment_amount)) FROM APC_LOAN_DETAIL ald + where WEEK(Date(ald.created_on),1) = (Select WEEK(CURDATE(),1)) and YEAR(Date(ald.created_on)) = (SELECT YEAR(CURDATE())) AND ald.id_user = ate.id_user + AND ald.loan_details_type IN ('PAYMENT', 'RENOVATION_PAYMENT', 'TRANSFER')) + as total_reported_week, +( + select + IF(ISNULL( + SUM( + CASE WHEN l.loan_status IN ('PENDING_RENOVATION', 'FINISH') then 0 ELSE + ((lt.payment_daily * (SELECT COUNT(ldFaltante.id) FROM APC_LOAN_DETAIL ldFaltante + WHERE ldFaltante.id_loan = l.id AND WEEK(DATE(ldFaltante.created_on),1) = WEEK(CURDATE(),1) AND + YEAR(DATE(ldFaltante.created_on)) = YEAR(CURDATE()) + AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER', 'FEE'))) + - (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) + FROM APC_LOAN_DETAIL ldLunes + WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND + YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) + AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER'))) END + ) + ),0, + SUM( + CASE WHEN l.loan_status IN ('PENDING_RENOVATION', 'FINISH') then 0 ELSE + ((lt.payment_daily * (SELECT COUNT(ldFaltante.id) FROM APC_LOAN_DETAIL ldFaltante + WHERE ldFaltante.id_loan = l.id AND WEEK(DATE(ldFaltante.created_on),1) = WEEK(CURDATE(),1) AND + YEAR(DATE(ldFaltante.created_on)) = YEAR(CURDATE()) + AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER', 'FEE'))) + - (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) + FROM APC_LOAN_DETAIL ldLunes + WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND + YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) + AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER'))) END + ) + ) + as faltante + + FROM + APC_LOAN l + INNER JOIN APC_LOAN_TYPE lt ON l.id_loan_type = lt.id + INNER JOIN APC_LOAN_BY_USER albu ON l.id = albu.id_loan + WHERE albu.id_user = ate.id_user + AND albu.owner_loan = 'CURRENT_OWNER' + +) +as faltante, + (SELECT IF(ISNULL(SUM(ald.payment_amount)),0,SUM(ald.payment_amount)) + FROM APC_LOAN_DETAIL ald + INNER JOIN APC_LOAN al ON ald.id_loan = al.id + INNER JOIN APC_LOAN_BY_USER albu ON al.id = albu.id_loan + where WEEK(Date(ald.created_on),1) = (Select WEEK(CURDATE(),1)) and YEAR(Date(ald.created_on)) = (SELECT YEAR(CURDATE())) + AND ald.loan_details_type IN ('RENOVATION_PAYMENT') AND albu.id_user = ate.id_user) as total_reported_renovation_week, + (SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) + FROM APC_LOAN al + INNER JOIN APC_LOAN_BY_USER albu ON al.id = albu.id_loan + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + WHERE albu.id_user = ate.id_user AND al.loan_status = 'APPROVED' AND + WEEK(Date(al.created_on),1) = (Select WEEK(CURDATE(),1)) and YEAR(Date(al.created_on)) = (SELECT YEAR(CURDATE())) + ) as total_comision_fee, + (SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND al.created_by = ate.id_user + AND WEEK(DATE(al.created_on),1) = WEEK(CURDATE(),1) AND + YEAR(Date(al.created_on)) = (SELECT YEAR(CURDATE()))) + as colocation_approved, + (SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'TO_DELIVERY' AND al.created_by = ate.id_user + AND WEEK(DATE(al.created_on),1) = WEEK(CURDATE(),1) AND + YEAR(Date(al.created_on)) = (SELECT YEAR(CURDATE()))) + as colocation_to_delivery +FROM + APC_TOTAL_EXPECTED_PAYMENT_DAILY_BY_USER ate +INNER JOIN APC_USER au ON au.id = ate.id_user +INNER JOIN APC_HUMAN_RESOURCE ahr ON ahr.id = au.id_human_resource +WHERE + DATE(ate.created_on) = CURDATE() + AND ate.active_status = 'ENEBLED'; +-- -------------------------------------------------------- +-- +-- Estructura para la vista `APC_CLOSING_DAILY_DETAIL_FROM_USER_BY_CURDATE_VIEW_REPORT` +-- +CREATE OR REPLACE VIEW `APC_CLOSING_DAILY_DETAIL_FROM_USER_BY_CURDATE_VIEW_REPORT` AS +SELECT + ld.id, + CONCAT(p.first_name,' ',IF(ISNULL(p.second_name) ,'', CONCAT(p.second_name, ' ')),p.last_name,' ', p.middle_name) AS comments, + ld.payment_amount as amount, + CASE + WHEN ld.loan_details_type = 'PAYMENT' THEN 'Abono' + WHEN ld.loan_details_type = 'FEE' THEN 'Multa' + WHEN ld.loan_details_type = 'TRANSFER' THEN 'DepĆ³sito' + ELSE '' END as type, + ld.id_user, + ld.created_on, + l.created_on as fechaFiltro, + 'xxxx' as route, + (l.amount_to_pay - amount_paid) as saldo, + 0 as comisionApertura, + 0 as prestamoAnterior +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON ld.id_loan = l.id +INNER JOIN APC_PEOPLE p ON l.id_customer = p.id +WHERE DATE(ld.created_on) = CURDATE() +AND ld.loan_details_type in ('PAYMENT', 'FEE', 'TRANSFER' ) +UNION +SELECT + md.id, + DATE(md.money_daily_date) AS comments, + md.amount as amount, + 'Inicio' as type, + md.id_user, + md.created_on, + CURDATE() as fechaFiltro, + 'xxxx' as route, + 0 as saldo, + 0 as comisionApertura, + 0 as prestamoAnterior +FROM + APC_MONEY_DAILY md +WHERE DATE(md.money_daily_date) = CURDATE() +UNION +SELECT + oe.id, + oe.description, + oe.expense, + 'Gasto', + oe.id_user, + oe.created_on, + CURDATE() as fechaFiltro, + 'xxxx' as route, + 0 as saldo, + 0 as comisionApertura, + 0 as prestamoAnterior +FROM + APC_OTHER_EXPENSE oe +WHERE DATE(oe.created_on) = CURDATE() +UNION +SELECT + te.id, + CONCAT(hr.first_name,' ',IF(ISNULL(hr.second_name) ,'', CONCAT(hr.second_name, ' ')),hr.last_name,' ', hr.middle_name), + te.amount_to_transfer, + 'Transferencia enviada', + te.id_user_transmitter, + te.created_on, + CURDATE() as fechaFiltro, + 'xxxx' as route, + 0 as saldo, + 0 as comisionApertura, + 0 as prestamoAnterior +FROM + APC_TRANSFER te +JOIN + APC_USER u on u.id = te.id_user_receiver +JOIN + APC_HUMAN_RESOURCE hr on hr.id = u.id_human_resource +WHERE DATE(te.created_on) = CURDATE() +UNION +SELECT + tr.id, + CONCAT(hr.first_name,' ',IF(ISNULL(hr.second_name) ,'', CONCAT(hr.second_name, ' ')),hr.last_name,' ', hr.middle_name), + tr.amount_to_transfer, + 'Transferencia recibida', + tr.id_user_receiver, + tr.created_on, + CURDATE() as fechaFiltro, + 'xxxx' as route, + 0 as saldo, + 0 as comisionApertura, + 0 as prestamoAnterior +FROM + APC_TRANSFER tr +JOIN + APC_USER u on u.id = tr.id_user_transmitter +JOIN + APC_HUMAN_RESOURCE hr on hr.id = u.id_human_resource +WHERE DATE(tr.created_on) = CURDATE() +UNION +SELECT + d.id, + CONCAT(p.first_name,' ',IF(ISNULL(p.second_name) ,'', CONCAT(p.second_name, ' ')),p.last_name,' ', p.middle_name), + d.amount, + 'Entrega de prĆ©stamo', + d.id_user, + d.created_on, + CURDATE() as fechaFiltro, + r.route_name as route, + CASE WHEN (SELECT (l2.amount_to_pay - l2.amount_paid) FROM APC_LOAN_BY_RENOVATION lr + INNER JOIN APC_LOAN l2 ON l2.id = lr.id_loan_old + WHERE lr.id_loan_new = l.id) is null THEN 0 ELSE + (SELECT (l2.amount_to_pay - l2.amount_paid) FROM APC_LOAN_BY_RENOVATION lr + INNER JOIN APC_LOAN l2 ON l2.id = lr.id_loan_old + WHERE lr.id_loan_new = l.id) END as saldo, + lt.opening_fee as comisionApertura, + (SELECT CASE WHEN ld.payment_amount is null or 0 THEN 0 ELSE ld.payment_amount END FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l3 ON ld.id_loan = l3.id +WHERE ld.loan_details_type = 'RENOVATION_PAYMENT' +AND l3.id = (SELECT albr.id_loan_old FROM APC_LOAN_BY_RENOVATION albr WHERE albr.id_loan_new = l.id)) as prestamoAnterior +FROM APC_DELIVERY d +INNER JOIN APC_LOAN l ON d.id_loan = l.id +INNER JOIN APC_LOAN_TYPE lt ON l.id_loan_type = lt.id +INNER JOIN APC_PEOPLE p ON l.id_customer = p.id +INNER JOIN APC_ROUTE r ON r.id = l.id_route +WHERE DATE(d.created_on) = CURDATE(); +-- -------------------------------------------------------- +-- +-- Estructura para la vista `APC_RESUMEN_IN_OUT_WEEK_BY_USER_VIEW` +-- +CREATE OR REPLACE VIEW `APC_RESUMEN_IN_OUT_WEEK_BY_USER_VIEW` AS +SELECT +u.id, +CONCAT(hr.first_name, ' ' , hr.last_name) as username, +ubo.id_office, +-- Lunes +(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) +FROM APC_CLOSING_DAY ld +WHERE ld.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'monday') as closing_monday, +(SELECT IF(ISNULL(SUM(oe.expense)),0,SUM(oe.expense)) +FROM APC_OTHER_EXPENSE oe +WHERE oe.id_user = u.id AND WEEK(DATE(oe.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(oe.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(oe.created_on))) = 'monday') as expense_monday, +(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) +FROM APC_MONEY_DAILY md +WHERE md.id_user = u.id AND WEEK(DATE(md.money_daily_date),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(md.money_daily_date)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(md.money_daily_date))) = 'monday') as money_daily_today_monday, +-- Martes +(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) +FROM APC_CLOSING_DAY ld +WHERE ld.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'tuesday') as closing_tuesday, +(SELECT IF(ISNULL(SUM(oe.expense)),0,SUM(oe.expense)) +FROM APC_OTHER_EXPENSE oe +WHERE oe.id_user = u.id AND WEEK(DATE(oe.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(oe.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(oe.created_on))) = 'tuesday') as expense_tuesday, +(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) +FROM APC_MONEY_DAILY md +WHERE md.id_user = u.id AND WEEK(DATE(md.money_daily_date),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(md.money_daily_date)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(md.money_daily_date))) = 'tuesday') as money_daily_today_tuesday, +-- Miercoles +(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) +FROM APC_CLOSING_DAY ld +WHERE ld.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'wednesday') as closing_wednesday, +(SELECT IF(ISNULL(SUM(oe.expense)),0,SUM(oe.expense)) +FROM APC_OTHER_EXPENSE oe +WHERE oe.id_user = u.id AND WEEK(DATE(oe.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(oe.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(oe.created_on))) = 'wednesday') as expense_wednesday, +(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) +FROM APC_MONEY_DAILY md +WHERE md.id_user = u.id AND WEEK(DATE(md.money_daily_date),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(md.money_daily_date)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(md.money_daily_date))) = 'wednesday') as money_daily_today_wednesday, +-- Jueves +(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) +FROM APC_CLOSING_DAY ld +WHERE ld.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'thursday') as closing_thursday, +(SELECT IF(ISNULL(SUM(oe.expense)),0,SUM(oe.expense)) +FROM APC_OTHER_EXPENSE oe +WHERE oe.id_user = u.id AND WEEK(DATE(oe.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(oe.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(oe.created_on))) = 'thursday') as expense_thursday, +(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) +FROM APC_MONEY_DAILY md +WHERE md.id_user = u.id AND WEEK(DATE(md.money_daily_date),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(md.money_daily_date)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(md.money_daily_date))) = 'thursday') as money_daily_today_thursday, +-- Viernes +(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) +FROM APC_CLOSING_DAY ld +WHERE ld.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'friday') as closing_friday, +(SELECT IF(ISNULL(SUM(oe.expense)),0,SUM(oe.expense)) +FROM APC_OTHER_EXPENSE oe +WHERE oe.id_user = u.id AND WEEK(DATE(oe.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(oe.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(oe.created_on))) = 'friday') as expense_friday, +(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) +FROM APC_MONEY_DAILY md +WHERE md.id_user = u.id AND WEEK(DATE(md.money_daily_date),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(md.money_daily_date)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(md.money_daily_date))) = 'friday') as money_daily_today_friday, +-- Sabado +(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) +FROM APC_CLOSING_DAY ld +WHERE ld.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'saturday') as closing_saturday, +(SELECT IF(ISNULL(SUM(oe.expense)),0,SUM(oe.expense)) +FROM APC_OTHER_EXPENSE oe +WHERE oe.id_user = u.id AND WEEK(DATE(oe.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(oe.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(oe.created_on))) = 'saturday') as expense_saturday, +(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) +FROM APC_MONEY_DAILY md +WHERE md.id_user = u.id AND WEEK(DATE(md.money_daily_date),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(md.money_daily_date)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(md.money_daily_date))) = 'saturday') as money_daily_today_saturday +FROM APC_USER u +INNER JOIN APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource AND hr.human_resource_status = 'ENEBLED' +INNER JOIN APC_USER_BY_OFFICE ubo ON ubo.id_user = u.id +WHERE u.user_status = 'ENEBLED' AND +u.user_type IN ('MOBILE','BOTH'); +-- -------------------------------------------------------- +-- +-- Estructura para la vista `APC_RESUMEN_IN_OUT_LAST_WEEK_BY_USER_VIEW` +-- +CREATE OR REPLACE VIEW `APC_RESUMEN_IN_OUT_LAST_WEEK_BY_USER_VIEW` AS +SELECT +u.id, +CONCAT(hr.first_name, ' ' , hr.last_name) as username, +ubo.id_office, +-- Lunes +(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) +FROM APC_CLOSING_DAY ld +WHERE ld.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.active_status = 'ENEBLED' +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'monday') as closing_monday, +(SELECT IF(ISNULL(SUM(oe.expense)),0,SUM(oe.expense)) +FROM APC_OTHER_EXPENSE oe +WHERE oe.id_user = u.id AND WEEK(DATE(oe.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(oe.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(oe.created_on))) = 'monday') as expense_monday, +(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) +FROM APC_MONEY_DAILY md +WHERE md.id_user = u.id AND WEEK(DATE(md.money_daily_date),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(md.money_daily_date)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(md.money_daily_date))) = 'monday') as money_daily_today_monday, +-- Martes +(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) +FROM APC_CLOSING_DAY ld +WHERE ld.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.active_status = 'ENEBLED' +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'tuesday') as closing_tuesday, +(SELECT IF(ISNULL(SUM(oe.expense)),0,SUM(oe.expense)) +FROM APC_OTHER_EXPENSE oe +WHERE oe.id_user = u.id AND WEEK(DATE(oe.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(oe.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(oe.created_on))) = 'tuesday') as expense_tuesday, +(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) +FROM APC_MONEY_DAILY md +WHERE md.id_user = u.id AND WEEK(DATE(md.money_daily_date),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(md.money_daily_date)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(md.money_daily_date))) = 'tuesday') as money_daily_today_tuesday, +-- Miercoles +(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) +FROM APC_CLOSING_DAY ld +WHERE ld.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.active_status = 'ENEBLED' +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'wednesday') as closing_wednesday, +(SELECT IF(ISNULL(SUM(oe.expense)),0,SUM(oe.expense)) +FROM APC_OTHER_EXPENSE oe +WHERE oe.id_user = u.id AND WEEK(DATE(oe.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(oe.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(oe.created_on))) = 'wednesday') as expense_wednesday, +(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) +FROM APC_MONEY_DAILY md +WHERE md.id_user = u.id AND WEEK(DATE(md.money_daily_date),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(md.money_daily_date)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(md.money_daily_date))) = 'wednesday') as money_daily_today_wednesday, +-- Jueves +(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) +FROM APC_CLOSING_DAY ld +WHERE ld.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.active_status = 'ENEBLED' +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'thursday') as closing_thursday, +(SELECT IF(ISNULL(SUM(oe.expense)),0,SUM(oe.expense)) +FROM APC_OTHER_EXPENSE oe +WHERE oe.id_user = u.id AND WEEK(DATE(oe.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(oe.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(oe.created_on))) = 'thursday') as expense_thursday, +(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) +FROM APC_MONEY_DAILY md +WHERE md.id_user = u.id AND WEEK(DATE(md.money_daily_date),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(md.money_daily_date)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(md.money_daily_date))) = 'thursday') as money_daily_today_thursday, +-- Viernes +(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) +FROM APC_CLOSING_DAY ld +WHERE ld.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.active_status = 'ENEBLED' +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'friday') as closing_friday, +(SELECT IF(ISNULL(SUM(oe.expense)),0,SUM(oe.expense)) +FROM APC_OTHER_EXPENSE oe +WHERE oe.id_user = u.id AND WEEK(DATE(oe.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(oe.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(oe.created_on))) = 'friday') as expense_friday, +(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) +FROM APC_MONEY_DAILY md +WHERE md.id_user = u.id AND WEEK(DATE(md.money_daily_date),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(md.money_daily_date)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(md.money_daily_date))) = 'friday') as money_daily_today_friday, +-- Sabado +(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) +FROM APC_CLOSING_DAY ld +WHERE ld.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.active_status = 'ENEBLED' +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'saturday') as closing_saturday, +(SELECT IF(ISNULL(SUM(oe.expense)),0,SUM(oe.expense)) +FROM APC_OTHER_EXPENSE oe +WHERE oe.id_user = u.id AND WEEK(DATE(oe.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(oe.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(oe.created_on))) = 'saturday') as expense_saturday, +(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) +FROM APC_MONEY_DAILY md +WHERE md.id_user = u.id AND WEEK(DATE(md.money_daily_date),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(md.money_daily_date)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(md.money_daily_date))) = 'saturday') as money_daily_today_saturday +FROM APC_USER u +INNER JOIN APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource AND hr.human_resource_status = 'ENEBLED' +INNER JOIN APC_USER_BY_OFFICE ubo ON ubo.id_user = u.id +WHERE u.user_status = 'ENEBLED' AND +u.user_type IN ('MOBILE','BOTH'); +-- -------------------------------------------------------- +-- +-- Estructura para la vista `APC_RESUMEN_TOTAL_LAST_WEEK_VIEW` +-- +CREATE OR REPLACE VIEW `APC_RESUMEN_TOTAL_LAST_WEEK_VIEW` AS +SELECT +u.id, +u.office_name, +-- Cortes +(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) +FROM APC_CLOSING_DAY ld +WHERE WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.active_status = 'ENEBLED' +AND ld.id_office = u.id) as closing__day_total, +-- Inicios +(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) +FROM APC_MONEY_DAILY md +WHERE WEEK(DATE(md.money_daily_date),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(md.money_daily_date)) = YEAR(CURDATE()) AND md.id_office = u.id) as money_daily_today_total, +-- Subtotal +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_total, +-- comision por apertura +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE())) + as opening_fee_total, +-- cobranza +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' +AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) -1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_today, +-- colocacion +(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1)-1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) ) + as colocation_total, +-- nominas +(SELECT IF(ISNULL(SUM(ap.total_payment)),0,SUM(ap.total_payment)) FROM APC_PAYROLL ap +WHERE ap.id_office = u.id AND ap.active_status = 'ENEBLED' +AND WEEK(DATE(ap.created_on),1) = (WEEK(CURDATE(),1)-1) AND + YEAR(Date(ap.created_on)) = YEAR(CURDATE())) as nomina_total, +-- adelantos +(SELECT IF(ISNULL(SUM(ap.amount)),0,SUM(ap.amount)) FROM APC_ADVANCE ap +WHERE ap.id_office = u.id AND ap.active_status = 'ENEBLED' +AND WEEK(DATE(ap.created_on),1) = (WEEK(CURDATE(),1)-1) AND + YEAR(Date(ap.created_on)) = YEAR(CURDATE())) as adelantos_total, +-- entradas +(SELECT IF(ISNULL(SUM(ap.amount)),0,SUM(ap.amount)) FROM APC_EXPENSE_COMPANY ap +WHERE ap.id_office = u.id AND ap.active_status = 'ENEBLED' AND +ap.expense_company_type = 'PAYMENT_IN' +AND WEEK(DATE(ap.created_on),1) = (WEEK(CURDATE(),1)-1) AND + YEAR(Date(ap.created_on)) = YEAR(CURDATE())) as entradas_total, +-- gastos admon +(SELECT IF(ISNULL(SUM(ap.amount)),0,SUM(ap.amount)) FROM APC_EXPENSE_COMPANY ap +WHERE ap.id_office = u.id AND ap.active_status = 'ENEBLED' AND +ap.expense_company_type = 'PAYMENT_OUT' +AND WEEK(DATE(ap.created_on),1) = (WEEK(CURDATE(),1)-1) AND + YEAR(Date(ap.created_on)) = YEAR(CURDATE())) as gastos_admon_total +FROM APC_OFFICE u +WHERE u.office_status = 'ENEBLED'; +-- -------------------------------------------------------- +-- +-- Estructura para la vista `APC_HISTORY_LOAN_VIEW` +-- +CREATE OR REPLACE VIEW APC_HISTORY_LOAN_VIEW AS +SELECT +l.id, +CONCAT(pc.first_name, ' ', pc.last_name) customerName, +CONCAT(pa.first_name, ' ', pa.last_name) endorsementName, +r.route_name routeName, +o.office_name officeName, +lt.payment montoPrestado, +l.amount_to_pay montoAPagar, +l.amount_paid montoPagado, +(l.amount_to_pay - l.amount_paid) saldoInsoluto, +(SELECT count(lfn.id) FROM APC_LOAN_FEE_NOTIFICATION lfn WHERE lfn.id_loan = l.id) numMultas, +CASE WHEN l.loan_status = 'PENDING' THEN 'Pendiente' +WHEN l.loan_status = 'FINISH' THEN 'Terminado' +WHEN l.loan_status = 'APPROVED' THEN 'Aprobado' +WHEN l.loan_status = 'REJECTED' THEN 'Rechazado' +WHEN l.loan_status = 'PENDING_RENOVATION' THEN 'Pendiente de renovaciĆ³n' +WHEN l.loan_status = 'TO_DELIVERY' THEN 'Por liberar' +END as estatusPrestamo, +DATE(l.created_on) as fecha, +u.user_name nombreUsuario +FROM +APC_LOAN l +INNER JOIN APC_PEOPLE pc ON l.id_customer = pc.id +INNER JOIN APC_PEOPLE pa ON l.id_endorsement = pa.id +INNER JOIN APC_ROUTE r ON l.id_route = r.id +INNER JOIN APC_OFFICE o ON r.id_office = o.id +INNER JOIN APC_LOAN_TYPE lt ON l.id_loan_type = lt.id +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +INNER JOIN APC_USER u ON u.id = lbu.id_user +WHERE l.loan_status NOT IN ('DELETED') +ORDER BY l.created_on DESC; +-- -------------------------------------------------------- +-- +-- Estructura para la vista `APC_RESUMEN_TOTAL_LAST_WEEK_VIEW` +-- +CREATE OR REPLACE VIEW `APC_RESUMEN_TOTAL_LAST_WEEK_VIEW` AS +SELECT +u.id, +u.office_name, +-- Cortes +(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) +FROM APC_CLOSING_DAY ld +WHERE WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.active_status = 'ENEBLED' +AND ld.id_office = u.id) as closing__day_total, +-- Inicios +(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) +FROM APC_MONEY_DAILY md +WHERE WEEK(DATE(md.money_daily_date),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(md.money_daily_date)) = YEAR(CURDATE()) AND md.id_office = u.id) as money_daily_today_total, +-- Subtotal +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_total, +-- comision por apertura +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1) - 1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE())) + as opening_fee_total, +-- cobranza +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' +AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) -1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_today, +-- colocacion +(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1)-1) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) ) + as colocation_total, +-- nominas +(SELECT IF(ISNULL(SUM(ap.total_payment)),0,SUM(ap.total_payment)) FROM APC_PAYROLL ap +WHERE ap.id_office = u.id AND ap.active_status = 'ENEBLED' +AND WEEK(DATE(ap.created_on),1) = (WEEK(CURDATE(),1)-1) AND + YEAR(Date(ap.created_on)) = YEAR(CURDATE())) as nomina_total, +-- adelantos +(SELECT IF(ISNULL(SUM(ap.amount)),0,SUM(ap.amount)) FROM APC_ADVANCE ap +WHERE ap.id_office = u.id AND ap.active_status = 'ENEBLED' +AND WEEK(DATE(ap.created_on),1) = (WEEK(CURDATE(),1)-1) AND + YEAR(Date(ap.created_on)) = YEAR(CURDATE())) as adelantos_total, +-- entradas +(SELECT IF(ISNULL(SUM(ap.amount)),0,SUM(ap.amount)) FROM APC_EXPENSE_COMPANY ap +WHERE ap.id_office = u.id AND ap.active_status = 'ENEBLED' AND +ap.expense_company_type = 'PAYMENT_IN' +AND WEEK(DATE(ap.created_on),1) = (WEEK(CURDATE(),1)-1) AND + YEAR(Date(ap.created_on)) = YEAR(CURDATE())) as entradas_total, +-- gastos admon +(SELECT IF(ISNULL(SUM(ap.amount)),0,SUM(ap.amount)) FROM APC_EXPENSE_COMPANY ap +WHERE ap.id_office = u.id AND ap.active_status = 'ENEBLED' AND +ap.expense_company_type = 'PAYMENT_OUT' +AND WEEK(DATE(ap.created_on),1) = (WEEK(CURDATE(),1)-1) AND + YEAR(Date(ap.created_on)) = YEAR(CURDATE())) as gastos_admon_total +FROM APC_OFFICE u +WHERE u.office_status = 'ENEBLED'; +-- -------------------------------------------------------- +-- +-- Estructura para la vista `APC_RESUMEN_TOTAL_WEEK_VIEW` +-- +CREATE OR REPLACE VIEW `APC_RESUMEN_TOTAL_WEEK_VIEW` AS +SELECT +u.id, +u.office_name, +-- Cortes +(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) +FROM APC_CLOSING_DAY ld +WHERE WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.active_status = 'ENEBLED' +AND ld.id_office = u.id) as closing__day_total, +-- Inicios +(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) +FROM APC_MONEY_DAILY md +WHERE WEEK(DATE(md.money_daily_date),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(md.money_daily_date)) = YEAR(CURDATE()) AND md.id_office = u.id) as money_daily_today_total, +-- Subtotal +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as subtotal_total, +-- comision por apertura +(SELECT IF(ISNULL(SUM(alt.opening_fee)),0,SUM(alt.opening_fee)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1)) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE())) + as opening_fee_total, +-- cobranza +(SELECT IF(ISNULL(SUM(ld.payment_amount)),0,SUM(ld.payment_amount)) +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON l.id = ld.id_loan +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +WHERE lbu.id_user = 'aad0c673-eb93-11ea-b7e1-02907d0fb4e6' +AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) +AND ld.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as cobranza_today, +-- colocacion +(SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' + AND WEEK(DATE(al.created_on),1) = (WEEK(CURDATE(),1)) AND + YEAR(Date(al.created_on)) = YEAR(CURDATE()) ) + as colocation_total, +-- nominas +(SELECT IF(ISNULL(SUM(ap.total_payment)),0,SUM(ap.total_payment)) FROM APC_PAYROLL ap +WHERE ap.id_office = u.id AND ap.active_status = 'ENEBLED' +AND WEEK(DATE(ap.created_on),1) = (WEEK(CURDATE(),1)) AND + YEAR(Date(ap.created_on)) = YEAR(CURDATE())) as nomina_total, +-- adelantos +(SELECT IF(ISNULL(SUM(ap.amount)),0,SUM(ap.amount)) FROM APC_ADVANCE ap +WHERE ap.id_office = u.id AND ap.active_status = 'ENEBLED' +AND WEEK(DATE(ap.created_on),1) = (WEEK(CURDATE(),1)) AND + YEAR(Date(ap.created_on)) = YEAR(CURDATE())) as adelantos_total, +-- entradas +(SELECT IF(ISNULL(SUM(ap.amount)),0,SUM(ap.amount)) FROM APC_EXPENSE_COMPANY ap +WHERE ap.id_office = u.id AND ap.active_status = 'ENEBLED' AND +ap.expense_company_type = 'PAYMENT_IN' +AND WEEK(DATE(ap.created_on),1) = (WEEK(CURDATE(),1)) AND + YEAR(Date(ap.created_on)) = YEAR(CURDATE())) as entradas_total, +-- gastos admon +(SELECT IF(ISNULL(SUM(ap.amount)),0,SUM(ap.amount)) FROM APC_EXPENSE_COMPANY ap +WHERE ap.id_office = u.id AND ap.active_status = 'ENEBLED' AND +ap.expense_company_type = 'PAYMENT_OUT' +AND WEEK(DATE(ap.created_on),1) = (WEEK(CURDATE(),1)) AND + YEAR(Date(ap.created_on)) = YEAR(CURDATE())) as gastos_admon_total +FROM APC_OFFICE u +WHERE u.office_status = 'ENEBLED'; +-- -------------------------------------------------------- +-- +-- Estructura para la vista `APC_ADMINISTRATION_PERSON_SEARCH_VIEW` +-- +CREATE OR REPLACE VIEW `APC_ADMINISTRATION_PERSON_SEARCH_VIEW` AS +SELECT + people.id AS id, people.phone_home AS phone_home, people.address_home AS address_home, people.people_type AS people_type, + people.id_route AS id_route, route.route_name AS route_name, people.id_office AS id_office, office.office_name AS office_name, + CONCAT( + CASE + WHEN people.first_name IS NOT NULL AND people.first_name != '' + THEN CONCAT(SUBSTR(UPPER(people.first_name), 1, 1),SUBSTR(LOWER(people.first_name), 2)) + ELSE '' + END, + CASE + WHEN people.second_name IS NOT NULL AND people.second_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(people.second_name), 1, 1),SUBSTR(LOWER(people.second_name), 2)) + ELSE '' + END, + CASE + WHEN people.last_name IS NOT NULL AND people.last_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(people.last_name), 1, 1),SUBSTR(LOWER(people.last_name), 2)) + ELSE '' + END, + CASE + WHEN people.middle_name IS NOT NULL AND people.middle_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(people.middle_name), 1, 1),SUBSTR(LOWER(people.middle_name), 2)) + ELSE '' + END + ) AS person_search +FROM APC_PEOPLE people +INNER JOIN APC_OFFICE office ON people.id_office = office.id +INNER JOIN APC_ROUTE route ON people.id_route = route.id +WHERE + people.active_status = 'ENEBLED' +ORDER BY office_name, route_name, person_search; + +CREATE OR REPLACE VIEW APC_HISTORY_LOAN_VIEW AS +SELECT +l.id, +CONCAT(pc.first_name, ' ', pc.last_name) customerName, +CONCAT(pa.first_name, ' ', pa.last_name) endorsementName, +r.route_name routeName, +o.office_name officeName, +lt.payment montoPrestado, +l.amount_to_pay montoAPagar, +l.amount_paid montoPagado, +(l.amount_to_pay - l.amount_paid) saldoInsoluto, +(SELECT count(lfn.id) FROM APC_LOAN_FEE_NOTIFICATION lfn WHERE lfn.id_loan = l.id) numMultas, +CASE WHEN l.loan_status = 'PENDING' THEN 'Pendiente' +WHEN l.loan_status = 'FINISH' THEN 'Terminado' +WHEN l.loan_status = 'APPROVED' THEN 'Aprobado' +WHEN l.loan_status = 'REJECTED' THEN 'Rechazado' +WHEN l.loan_status = 'PENDING_RENOVATION' THEN 'Pendiente de renovaciĆ³n' +WHEN l.loan_status = 'TO_DELIVERY' THEN 'Por liberar' +END as estatusPrestamo, +DATE(l.created_on) as fecha, +u.user_name nombreUsuario +FROM +APC_LOAN l +INNER JOIN APC_PEOPLE pc ON l.id_customer = pc.id +INNER JOIN APC_PEOPLE pa ON l.id_endorsement = pa.id +INNER JOIN APC_ROUTE r ON l.id_route = r.id +INNER JOIN APC_OFFICE o ON r.id_office = o.id +INNER JOIN APC_LOAN_TYPE lt ON l.id_loan_type = lt.id +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +INNER JOIN APC_USER u ON u.id = lbu.id_user +WHERE l.loan_status NOT IN ('DELETED') +ORDER BY l.created_on DESC +-- ------------------------------------------------------------- +-- +-- Estructura para la vista `APC_STATS_FEES_VIEW` +-- +CREATE OR REPLACE VIEW APC_FEES_VIEW AS +SELECT + LD.ID, + LD.id_user, + R.id AS id_route, + R.route_name AS route_name, + CONCAT(HR.first_name, ' ', HR.last_name) AS name, + LD.payment_amount AS total_fees, + LD.fee_status AS fee_status, + 0.0 AS total_fee_paid, + LD.created_on +FROM APC_LOAN_DETAIL LD +INNER JOIN APC_LOAN L ON LD.id_loan = L.id AND L.loan_status <> 'DELETED' +INNER JOIN APC_USER U ON LD.id_user = U.id +INNER JOIN APC_ROUTE R ON L.id_route = R.id +INNER JOIN APC_HUMAN_RESOURCE HR ON U.id_human_resource = HR.id +WHERE loan_details_type = 'FEE' +-- -------------------------------------------------------- +-- +-- Estructura para la vista `APC_ADMINISTRATION_PERSON_SEARCH_VIEW` +-- +CREATE OR REPLACE VIEW `APC_ADMINISTRATION_PERSON_SEARCH_VIEW` AS +SELECT + people.id AS id, people.phone_home AS phone_home, people.address_home AS address_home, people.people_type AS people_type, + people.id_route AS id_route, route.route_name AS route_name, people.id_office AS id_office, office.office_name AS office_name, + CONCAT( + CASE + WHEN people.first_name IS NOT NULL AND people.first_name != '' + THEN CONCAT(SUBSTR(UPPER(people.first_name), 1, 1),SUBSTR(LOWER(people.first_name), 2)) + ELSE '' + END, + CASE + WHEN people.second_name IS NOT NULL AND people.second_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(people.second_name), 1, 1),SUBSTR(LOWER(people.second_name), 2)) + ELSE '' + END, + CASE + WHEN people.last_name IS NOT NULL AND people.last_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(people.last_name), 1, 1),SUBSTR(LOWER(people.last_name), 2)) + ELSE '' + END, + CASE + WHEN people.middle_name IS NOT NULL AND people.middle_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(people.middle_name), 1, 1),SUBSTR(LOWER(people.middle_name), 2)) + ELSE '' + END + ) AS person_search +FROM APC_PEOPLE people +INNER JOIN APC_OFFICE office ON people.id_office = office.id +INNER JOIN APC_ROUTE route ON people.id_route = route.id +WHERE + people.active_status = 'ENEBLED' +ORDER BY office_name, route_name, person_search; +-- ------------------------------------------------------------- +-- +-- Estructura para la vista `APC_CLOSING_DAY_VIEW` +-- +CREATE OR REPLACE VIEW APC_CLOSING_DAY_VIEW AS +SELECT + CD.ID, + CD.id_user, + CONCAT(HR.first_name, ' ', HR.last_name) AS name, + HRR.route_name AS route_name, + CD.amount_paid AS total_closing, + CD.created_on +FROM APC_CLOSING_DAY CD +INNER JOIN APC_USER U ON CD.id_user = U.id +INNER JOIN APC_HUMAN_RESOURCE HR ON U.id_human_resource = HR.id +INNER JOIN( + SELECT + HRR.id_human_resource, + GROUP_CONCAT(DISTINCT R.route_name SEPARATOR',') AS route_name + FROM APC_HUMAN_RESOURCE_HAS_ROUTE HRR + INNER JOIN APC_ROUTE R ON HRR.id_route = R.id + GROUP BY HRR.id_human_resource +) HRR ON HR.id = HRR.id_human_resource +WHERE CD.active_status <> 'DISABLED'; + +-- ------------------------------------------------------------- +-- +-- Estructura para la vista `APC_OPENING_FEES_VIEW` +-- +CREATE OR REPLACE VIEW `APC_OPENING_FEES_VIEW` AS +SELECT + L.id, + L.created_by AS id_user, + CONCAT(HR.first_name, ' ', HR.last_name) AS name, + R.route_name AS route_name, + LT.opening_fee, + L.created_on +FROM APC_LOAN L +INNER JOIN APC_LOAN_TYPE LT ON L.id_loan_type = LT.id +INNER JOIN APC_USER U ON L.created_by = U.id +INNER JOIN APC_HUMAN_RESOURCE HR ON U.id_human_resource = HR.id +INNER JOIN APC_HUMAN_RESOURCE_HAS_ROUTE HRR ON HR.id = HRR.id_human_resource +INNER JOIN APC_ROUTE R ON HRR.id_route = R.id; +-- ------------------------------------------------------------- +-- +-- Estructura para la vista `APC_PAYMENT_VIEW` +-- +CREATE OR REPLACE VIEW APC_PAYMENT_VIEW AS +SELECT + LD.id, + L.id AS id_loan, + LD.id_user, + CONCAT(HR.first_name, ' ', HR.last_name) AS name, + HRR.route_name, + LD.payment_amount AS total_payment, + LT.opening_fee, + LD.created_on +FROM APC_LOAN_DETAIL LD +INNER JOIN APC_LOAN L ON LD.id_loan = L.id AND L.loan_status <> 'DELETED' +INNER JOIN APC_LOAN_TYPE LT ON L.id_loan_type = LT.id +INNER JOIN APC_USER U ON LD.id_user = U.id +INNER JOIN APC_HUMAN_RESOURCE HR ON U.id_human_resource = HR.id +INNER JOIN( + SELECT + HRR.id_human_resource, + GROUP_CONCAT(DISTINCT R.route_name SEPARATOR',') AS route_name + FROM APC_HUMAN_RESOURCE_HAS_ROUTE HRR + INNER JOIN APC_ROUTE R ON HRR.id_route = R.id + GROUP BY HRR.id_human_resource +) HRR ON HR.id = HRR.id_human_resource +WHERE loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER'); +-- ------------------------------------------------------------- +-- +-- Estructura para la vista `APC_PAYROLL_STATS_VIEW` +-- +CREATE OR REPLACE VIEW `APC_PAYROLL_STATS_VIEW` AS +SELECT + P.id, + P.id_human_resource AS id_user, + CONCAT(HR.first_name, ' ', HR.last_name) AS name, + P.salary + P.total_bonus_colocation + P.total_bonus_mora + P.total_bonus_new_customer + P.increases + P.boxed + P.saving + P.payment_to_debt + P.advance - P.imss AS total_payroll, + P.created_on +FROM APC_PAYROLL P +INNER JOIN APC_HUMAN_RESOURCE HR ON P.id_human_resource = HR.id; +-- ------------------------------------------------------------- +-- +-- Estructura para la vista `APC_PAYMENT_ROUTE_VIEW` +-- +CREATE OR REPLACE VIEW `APC_PAYMENT_ROUTE_VIEW` AS +SELECT + LD.id, + L.id AS id_loan, + R.id AS id_route, + R.route_name AS name, + CONCAT(HR.first_name, ' ', HR.last_name) AS user_name, + LD.payment_amount AS total_payment, + LT.opening_fee, + LD.created_on +FROM APC_LOAN_DETAIL LD +INNER JOIN APC_LOAN L ON LD.id_loan = L.id AND L.loan_status <> 'DELETED' +INNER JOIN APC_LOAN_TYPE LT ON L.id_loan_type = LT.id +INNER JOIN APC_ROUTE R ON L.id_route = R.id +INNER JOIN APC_USER U ON LD.id_user = U.id +INNER JOIN APC_HUMAN_RESOURCE HR ON U.id_human_resource = HR.id +WHERE loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER'); +-- ------------------------------------------------------------- +-- +-- Estructura para la vista `APC_STATS_PAYMENT_RENOVATION_VIEW` +-- +CREATE OR REPLACE VIEW `APC_STATS_PAYMENT_RENOVATION_VIEW` AS +SELECT + LD.id, + LD.created_by AS id_user, + CONCAT(HR.first_name, ' ', HR.last_name) AS employee_name, + P.id AS id_customer, + CONCAT(P.first_name, ' ', P.second_name, ' ', P.last_name, ' ', P.middle_name) AS customer_name, + LD.payment_amount AS total_payment, + LD.created_on +FROM APC_LOAN_DETAIL LD +INNER JOIN APC_LOAN L ON LD.id_loan = L.id AND L.loan_status <> 'DELETED' +INNER JOIN APC_PEOPLE P ON L.id_customer = P.id +INNER JOIN APC_USER U ON LD.created_by = U.id +INNER JOIN APC_HUMAN_RESOURCE HR ON U.id_human_resource = HR.id +WHERE LD.loan_details_type IN ('RENOVATION_PAYMENT'); +-- ------------------------------------------------------------- +-- +-- Estructura para la vista `APC_STATS_DEPOSITS_VIEW` +-- +CREATE OR REPLACE VIEW `APC_STATS_DEPOSITS_VIEW` AS +SELECT + LD.id, + LD.id_user, + CONCAT(HR.first_name, ' ', HR.last_name) AS name, + HRR.route_name AS route_name, + LD.payment_amount AS total_deposits, + LD.created_on +FROM APC_LOAN_DETAIL LD +INNER JOIN APC_LOAN L ON LD.id_loan = L.id AND L.loan_status <> 'DELETED' +INNER JOIN APC_USER U ON LD.id_user = U.id +INNER JOIN APC_HUMAN_RESOURCE HR ON U.id_human_resource = HR.id +INNER JOIN( + SELECT + HRR.id_human_resource, + GROUP_CONCAT(DISTINCT R.route_name SEPARATOR',') AS route_name + FROM APC_HUMAN_RESOURCE_HAS_ROUTE HRR + INNER JOIN APC_ROUTE R ON HRR.id_route = R.id + GROUP BY HRR.id_human_resource +) HRR ON HR.id = HRR.id_human_resource +WHERE loan_details_type IN ('TRANSFER'); +-- ------------------------------------------------------------- +-- +-- Estructura para la vista `APC_STATS_ADVANCE_VIEW` +-- +CREATE OR REPLACE VIEW `APC_STATS_ADVANCE_VIEW` AS +SELECT + LD.ID, + R.id AS id_route, + R.route_name AS name, + LD.payment_amount AS total_advances, + LD.created_on +FROM APC_LOAN_DETAIL LD +INNER JOIN APC_LOAN L ON LD.id_loan = L.id AND L.loan_status <> 'DELETED' +INNER JOIN APC_USER U ON LD.id_user = U.id +INNER JOIN APC_ROUTE R ON L.id_route = R.id +INNER JOIN APC_HUMAN_RESOURCE HR ON U.id_human_resource = HR.id +WHERE loan_details_type IN ('RENOVATION_PAYMENT'); +-- ------------------------------------------------------------- +-- +-- Estructura para la vista `APC_LOAN_EMPLOYEE_VIEW` +-- +CREATE OR REPLACE VIEW `APC_LOAN_EMPLOYEE_VIEW` AS +SELECT + L.id, + CONCAT(HR.first_name, ' ', HR.last_name) AS name, + HR.id AS id_user, + L.amount_loan, + L.amount_to_pay, + L.balance, + L.total_amount_to_pay, + L.created_on, + L.loan_employee_status, + CONCAT(HRU.first_name, ' ', HRU.last_name) AS created_by_name, + (SELECT IFNULL(MAX(LD.reference_number), 0) FROM APC_LOAN_EMPLOYEE_DETAIL LD WHERE LD.id_loan = L.id) AS reference_number +FROM APC_LOAN_EMPLOYEE L +INNER JOIN APC_HUMAN_RESOURCE HR ON L.id_employee = HR.id +INNER JOIN APC_USER US ON L.created_by = US.id +INNER JOIN APC_HUMAN_RESOURCE HRU ON US.id_human_resource = HRU.id +ORDER BY name, created_on DESC; +-- ------------------------------------------------------------- +-- +-- Estructura para la vista `APC_LOAN_EMPLOYEE_ALL_DATA_VIEW` +-- +CREATE OR REPLACE VIEW `APC_LOAN_EMPLOYEE_ALL_DATA_VIEW` AS +SELECT + L.id, + CONCAT(HR.first_name, ' ', HR.last_name) AS name, + HR.id AS id_user, + L.amount_loan, + L.amount_to_pay, + L.balance, + L.created_on, + L.loan_employee_status +FROM APC_LOAN_EMPLOYEE L +INNER JOIN APC_HUMAN_RESOURCE HR ON L.id_employee = HR.id; +-- ------------------------------------------------------------- +-- +-- Estructura para la vista `APC_LOAN_EMPLOYEE_DETAIL_ALL_DATA_VIEW` +-- +CREATE OR REPLACE VIEW `APC_LOAN_EMPLOYEE_DETAIL_ALL_DATA_VIEW` AS +SELECT + id, + id_loan, + id_user, + payment_amount, + reference_number, + loan_employee_detail_status, + created_on +FROM APC_LOAN_EMPLOYEE_DETAIL +ORDER BY created_on ASC; +-- ------------------------------------------------------------- +-- +-- Estructura para la vista `APC_USER_WEEK_REPORT_VIEW` +-- +CREATE OR REPLACE VIEW `APC_USER_WEEK_REPORT_VIEW` AS +SELECT + u.id AS id_user, + (SELECT IF(ISNULL(SUM(alt.payment)),0,SUM(alt.payment)) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND al.created_by = u.id + AND DATE(al.created_on) + BETWEEN + DATE(DATE_SUB(CURDATE(),INTERVAL WEEKDAY(CURDATE()) DAY)) + AND + DATE(DATE_ADD(CURDATE(),INTERVAL (6 - WEEKDAY(CURDATE())) DAY)) + ) AS payment_week, + (SELECT COUNT(al.id) FROM APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_LOAN_BY_USER albu ON albu.id_loan = al.id + WHERE loan_status = 'APPROVED' AND al.created_by = u.id + AND al.new_customer = 'ENEBLED' + AND DATE(al.created_on) + BETWEEN + DATE(DATE_SUB(CURDATE(),INTERVAL WEEKDAY(CURDATE()) DAY)) + AND + DATE(DATE_ADD(CURDATE(),INTERVAL (6 - WEEKDAY(CURDATE())) DAY)) + ) AS total_new_customer_currweek, + 0.0 AS debit_week, + ( + SELECT COUNT(innerLBU.id_loan) + FROM APC_LOAN_BY_USER innerLBU + WHERE innerLBU.loan_by_user_status = 'APPROVED' AND innerLBU.id_user = u.id + ) AS total_approved_loan, + ( + SELECT + COUNT(innerLBU.id_loan) + FROM APC_LOAN_BY_USER innerLBU WHERE innerLBU.loan_by_user_status = 'TO_DELIVERY' AND innerLBU.id_user = u.id + ) AS total_to_delivery_loan +FROM APC_USER u +INNER JOIN APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource +INNER JOIN APC_USER_BY_OFFICE ubo ON ubo.id_user = u.id +WHERE u.user_status = 'ENEBLED' AND +u.user_type IN ('MOBILE') AND +u.certifier = 'DISABLED'; +-- ------------------------------------------------------------- +-- +-- Estructura para la vista `APC_STATS_GASOLINE_VIEW` +-- +CREATE OR REPLACE VIEW `APC_STATS_GASOLINE_VIEW` AS +SELECT + G.ID, + R.id AS id_route, + R.route_name AS route_name, + G.id_user, + CONCAT(HR.first_name, ' ', HR.last_name) AS user_name, + (SELECT GAS.km_new FROM APC_GASOLINE GAS WHERE GAS.created_on < G.created_on AND GAS.id_user = G.id_user ORDER BY GAS.created_on DESC LIMIT 1) AS km_old, + G.km_new, + G.total AS total_gasoline, + G.Description AS description, + G.created_on, + G.quantity +FROM APC_GASOLINE G +INNER JOIN APC_USER U ON G.id_user = U.id +INNER JOIN APC_HUMAN_RESOURCE HR ON U.id_human_resource = HR.id +INNER JOIN APC_ROUTE R ON G.id_route = R.id +WHERE G.status = 'ENABLED'; + +-- ------------------------------------------------------------- +-- +-- Estructura para la vista `APC_STATS_ZERO_PAYMENTS_VIEW` +-- +CREATE OR REPLACE VIEW `APC_STATS_ZERO_PAYMENTS_VIEW` AS +SELECT + LD.id, + LD.id_user, + CONCAT(HR.first_name, ' ', HR.last_name) AS name, + R.route_name AS route_name, + LD.payment_amount AS total_zeroPayments, + LD.created_on +FROM APC_LOAN_DETAIL LD +INNER JOIN APC_LOAN L ON LD.id_loan = L.id AND L.loan_status <> 'DELETED' +INNER JOIN APC_USER U ON LD.id_user = U.id +INNER JOIN APC_HUMAN_RESOURCE HR ON U.id_human_resource = HR.id +INNER JOIN( + SELECT + HRR.id_human_resource, + GROUP_CONCAT(DISTINCT R.route_name SEPARATOR',') AS route_name + FROM APC_HUMAN_RESOURCE_HAS_ROUTE HRR + INNER JOIN APC_ROUTE R ON HRR.id_route = R.id + GROUP BY HRR.id_human_resource +) HRR ON HR.id = HRR.id_human_resource +WHERE loan_details_type IN ('PAYMENT') AND LD.payment_amount = 0; + +-- ------------------------------------------------------------- +-- +-- Estructura para la vista `APC_STATS_EMPLOYEE_SAVING_VIEW` +-- +CREATE OR REPLACE VIEW `APC_STATS_EMPLOYEE_SAVING_VIEW` AS +SELECT + ES.id, + ES.id_user, + CONCAT(HR.first_name, ' ', HR.last_name) AS name, + HRR.route_name AS route_name, + ES.employee_saving AS employee_saving, + ES.created_on, + ES.Type +FROM APC_EMPLOYEE_SAVING ES +INNER JOIN APC_HUMAN_RESOURCE HR ON ES.id_user = HR.id +INNER JOIN( + SELECT + HRR.id_human_resource, + GROUP_CONCAT(DISTINCT R.route_name SEPARATOR',') AS route_name + FROM APC_HUMAN_RESOURCE_HAS_ROUTE HRR + INNER JOIN APC_ROUTE R ON HRR.id_route = R.id + GROUP BY HRR.id_human_resource +) HRR ON HR.id = HRR.id_human_resource; +-- ------------------------------------------------------------- +-- +-- Estructura para la vista `APC_CUSTOMER_VIEW` +-- +CREATE OR REPLACE VIEW `APC_CUSTOMER_VIEW` AS +SELECT +ap.id AS id, +CONCAT( + CASE + WHEN ap.first_name IS NOT NULL AND ap.first_name != '' + THEN CONCAT(SUBSTR(UPPER(ap.first_name), 1, 1),SUBSTR(LOWER(ap.first_name), 2), ' ') + ELSE '' + END, + CASE + WHEN ap.second_name IS NOT NULL AND ap.second_name != '' + THEN CONCAT(SUBSTR(UPPER(ap.second_name), 1, 1),SUBSTR(LOWER(ap.second_name), 2), ' ') + ELSE '' + END, + CASE + WHEN ap.last_name IS NOT NULL AND ap.last_name != '' + THEN CONCAT(SUBSTR(UPPER(ap.last_name), 1, 1),SUBSTR(LOWER(ap.last_name), 2), ' ') + ELSE '' + END, + CASE + WHEN ap.middle_name IS NOT NULL AND ap.middle_name != '' + THEN CONCAT(SUBSTR(UPPER(ap.middle_name), 1, 1),SUBSTR(LOWER(ap.middle_name), 2)) + ELSE '' + END +) AS full_name, +ap.company_name AS company_name, +ap.address_home AS address_home, +ap.address_business AS address_business, +ar.route_name, +ap.people_type AS people_type, +(CASE + WHEN ap.people_type = 'CUSTOMER' THEN 'Cliente' + WHEN ap.people_type = 'BOTH' THEN 'Cliente y aval' +END) AS str_people_type, +ao.office_name AS office_name, +(SELECT COUNT(id) FROM APC_LOAN WHERE id_customer = ap.id) AS total_of_loan, +ap.classification +FROM APC_PEOPLE ap +INNER JOIN APC_ROUTE ar ON ap.id_route = ar.id +INNER JOIN APC_OFFICE ao ON ap.id_office = ao.id +WHERE ap.active_status = 'ENEBLED' AND ap.people_type IN ('CUSTOMER','BOTH'); +-- ------------------------------------------------------------- +-- +-- Estructura para la vista `APC_TRANSFER_VIEW` +-- +CREATE OR REPLACE VIEW `APC_TRANSFER_VIEW` AS +SELECT +at.id AS id, +at.id_office AS id_office, +CONCAT( + CASE + WHEN ahr.first_name IS NOT NULL AND ahr.first_name != '' + THEN CONCAT(SUBSTR(UPPER(ahr.first_name), 1, 1),SUBSTR(LOWER(ahr.first_name), 2), ' ') + ELSE '' + END, + CASE + WHEN ahr.second_name IS NOT NULL AND ahr.second_name != '' + THEN CONCAT(SUBSTR(UPPER(ahr.second_name), 1, 1),SUBSTR(LOWER(ahr.second_name), 2), ' ') + ELSE '' + END, + CASE + WHEN ahr.last_name IS NOT NULL AND ahr.last_name != '' + THEN CONCAT(SUBSTR(UPPER(ahr.last_name), 1, 1),SUBSTR(LOWER(ahr.last_name), 2), ' ') + ELSE '' + END, + CASE + WHEN ahr.middle_name IS NOT NULL AND ahr.middle_name != '' + THEN CONCAT(SUBSTR(UPPER(ahr.middle_name), 1, 1),SUBSTR(LOWER(ahr.middle_name), 2)) + ELSE '' + END +) AS full_name_transmitter, +( + SELECT GROUP_CONCAT(inner_ar.route_name) + FROM APC_HUMAN_RESOURCE_HAS_ROUTE inner_ahrhr + INNER JOIN APC_ROUTE inner_ar ON inner_ahrhr.id_route = inner_ar.id + WHERE id_human_resource = ahr.id +) AS transmitter_routes, +CONCAT( + CASE + WHEN ahrr.first_name IS NOT NULL AND ahrr.first_name != '' + THEN CONCAT(SUBSTR(UPPER(ahrr.first_name), 1, 1),SUBSTR(LOWER(ahrr.first_name), 2), ' ') + ELSE '' + END, + CASE + WHEN ahrr.second_name IS NOT NULL AND ahrr.second_name != '' + THEN CONCAT(SUBSTR(UPPER(ahrr.second_name), 1, 1),SUBSTR(LOWER(ahrr.second_name), 2), ' ') + ELSE '' + END, + CASE + WHEN ahrr.last_name IS NOT NULL AND ahrr.last_name != '' + THEN CONCAT(SUBSTR(UPPER(ahrr.last_name), 1, 1),SUBSTR(LOWER(ahrr.last_name), 2), ' ') + ELSE '' + END, + CASE + WHEN ahrr.middle_name IS NOT NULL AND ahrr.middle_name != '' + THEN CONCAT(SUBSTR(UPPER(ahrr.middle_name), 1, 1),SUBSTR(LOWER(ahrr.middle_name), 2)) + ELSE '' + END +) AS full_name_receiver, +( + SELECT GROUP_CONCAT(inner_ar.route_name) + FROM APC_HUMAN_RESOURCE_HAS_ROUTE inner_ahrhr + INNER JOIN APC_ROUTE inner_ar ON inner_ahrhr.id_route = inner_ar.id + WHERE id_human_resource = ahrr.id +) AS receiver_routes, +at.amount_to_transfer AS amount_to_transfer, +at.action_status AS action_status, +( +CASE + WHEN at.action_status = 'PENDING' THEN 'Pendiente' + WHEN at.action_status = 'APPROVED' THEN 'Aprobada' + ELSE 'REJECTED' +END) AS str_action_status, +at.created_on AS created_on, +( +CASE + WHEN date_format(at.created_on,'%m') = '01' + THEN concat(date_format(at.created_on,'%d'),' - Enero - ',date_format(at.created_on,'%Y')) + WHEN date_format(at.created_on,'%m') = '02' + THEN concat(date_format(at.created_on,'%d'),' - Febrero - ',date_format(at.created_on,'%Y')) + WHEN date_format(at.created_on,'%m') = '03' + THEN concat(date_format(at.created_on,'%d'),' - Marzo - ',date_format(at.created_on,'%Y')) + WHEN date_format(at.created_on,'%m') = '04' + THEN concat(date_format(at.created_on,'%d'),' - Abril - ',date_format(at.created_on,'%Y')) + WHEN date_format(at.created_on,'%m') = '05' + THEN concat(date_format(at.created_on,'%d'),' - Mayo - ',date_format(at.created_on,'%Y')) + WHEN date_format(at.created_on,'%m') = '06' + THEN concat(date_format(at.created_on,'%d'),' - Junio - ',date_format(at.created_on,'%Y')) + WHEN date_format(at.created_on,'%m') = '07' + THEN concat(date_format(at.created_on,'%d'),' - Julio - ',date_format(at.created_on,'%Y')) + WHEN date_format(at.created_on,'%m') = '08' + THEN concat(date_format(at.created_on,'%d'),' - Agosto - ',date_format(at.created_on,'%Y')) + WHEN date_format(at.created_on,'%m') = '09' + THEN concat(date_format(at.created_on,'%d'),' - Septiembre - ',date_format(at.created_on,'%Y')) + WHEN date_format(at.created_on,'%m') = '10' + THEN concat(date_format(at.created_on,'%d'),' - Octubre - ',date_format(at.created_on,'%Y')) + WHEN date_format(at.created_on,'%m') = '11' + THEN concat(date_format(at.created_on,'%d'),' - Noviembre - ',date_format(at.created_on,'%Y')) + WHEN date_format(at.created_on,'%m') = '12' + THEN concat(date_format(at.created_on,'%d'),' - Diciembre - ',date_format(at.created_on,'%Y')) +END +) AS str_created_on, +( +CASE + WHEN at.active_status = 'DISABLED' THEN 'grayRow' + ELSE NULL +END +)AS style_class +FROM APC_TRANSFER at +INNER JOIN APC_USER au ON at.id_user_transmitter = au.id +INNER JOIN APC_HUMAN_RESOURCE ahr ON au.id_human_resource = ahr.id +INNER JOIN APC_USER aur ON at.id_user_receiver = aur.id +INNER JOIN APC_HUMAN_RESOURCE ahrr ON aur.id_human_resource = ahrr.id; +-- ------------------------------------------------------------- +-- +-- Estructura para la vista `APC_ENABLED_USER_DETAILS_VIEW` +-- +CREATE OR REPLACE VIEW `APC_ENABLED_USER_DETAILS_VIEW` AS +SELECT +au.id AS id_user, +CONCAT( + CASE + WHEN ahr.first_name IS NOT NULL AND ahr.first_name != '' + THEN CONCAT(SUBSTR(UPPER(ahr.first_name), 1, 1),SUBSTR(LOWER(ahr.first_name), 2), ' ') + ELSE '' + END, + CASE + WHEN ahr.second_name IS NOT NULL AND ahr.second_name != '' + THEN CONCAT(SUBSTR(UPPER(ahr.second_name), 1, 1),SUBSTR(LOWER(ahr.second_name), 2), ' ') + ELSE '' + END, + CASE + WHEN ahr.last_name IS NOT NULL AND ahr.last_name != '' + THEN CONCAT(SUBSTR(UPPER(ahr.last_name), 1, 1),SUBSTR(LOWER(ahr.last_name), 2), ' ') + ELSE '' + END, + CASE + WHEN ahr.middle_name IS NOT NULL AND ahr.middle_name != '' + THEN CONCAT(SUBSTR(UPPER(ahr.middle_name), 1, 1),SUBSTR(LOWER(ahr.middle_name), 2)) + ELSE '' + END +) AS full_name, +aubo.id_office AS id_office +FROM APC_USER au +INNER JOIN APC_HUMAN_RESOURCE ahr ON au.id_human_resource = ahr.id +INNER JOIN APC_USER_BY_OFFICE aubo ON au.id = aubo.id_user +WHERE ahr.human_resource_status = 'ENEBLED' AND au.user_status = 'ENEBLED'; + +CREATE OR REPLACE VIEW `APC_LOAN_DETAIL_ZERO_VIEW` AS +SELECT + LD.id, + CONCAT(IFNULL(P.first_name, ''), ' ', IFNULL(P.second_name, ''), ' ', IFNULL(P.last_name, ''), ' ', IFNULL(P.middle_name, '')) AS customer_name, + P.address_home, + L.amount_to_pay, + LD.loan_comments, + CONCAT(HR.first_name, ' ', HR.last_name) AS user_name, + L.id_loan_type, + LT.payment +FROM APC_LOAN_DETAIL AS LD +INNER JOIN APC_LOAN AS L ON LD.id_loan = L.id +INNER JOIN APC_PEOPLE AS P ON L.id_customer = P.id +INNER JOIN APC_LOAN_TYPE LT ON L.id_loan_type = LT.id +INNER JOIN APC_USER U ON LD.id_user = U.id +INNER JOIN APC_HUMAN_RESOURCE HR ON U.id_human_resource = HR.id +WHERE LD.loan_details_type = 'PAYMENT' + AND DATE(LD.created_on) = DATE(CURDATE()) + AND LD.payment_amount = 0; +-- ------------------------------------------------------------- +-- +-- Estructura para la vista `APC_TRANSFER_IN_PENDING_STATUS_VIEW` +-- +CREATE OR REPLACE VIEW `APC_TRANSFER_IN_PENDING_STATUS_VIEW` AS +SELECT + ald.id AS id_loan_detail, + ald.payment_amount AS payment_amount, + ( +CASE + WHEN date_format(ald.created_on,'%m') = '01' + THEN concat(date_format(ald.created_on,'%d'),' - Enero - ',date_format(ald.created_on,'%Y')) + WHEN date_format(ald.created_on,'%m') = '02' + THEN concat(date_format(ald.created_on,'%d'),' - Febrero - ',date_format(ald.created_on,'%Y')) + WHEN date_format(ald.created_on,'%m') = '03' + THEN concat(date_format(ald.created_on,'%d'),' - Marzo - ',date_format(ald.created_on,'%Y')) + WHEN date_format(ald.created_on,'%m') = '04' + THEN concat(date_format(ald.created_on,'%d'),' - Abril - ',date_format(ald.created_on,'%Y')) + WHEN date_format(ald.created_on,'%m') = '05' + THEN concat(date_format(ald.created_on,'%d'),' - Mayo - ',date_format(ald.created_on,'%Y')) + WHEN date_format(ald.created_on,'%m') = '06' + THEN concat(date_format(ald.created_on,'%d'),' - Junio - ',date_format(ald.created_on,'%Y')) + WHEN date_format(ald.created_on,'%m') = '07' + THEN concat(date_format(ald.created_on,'%d'),' - Julio - ',date_format(ald.created_on,'%Y')) + WHEN date_format(ald.created_on,'%m') = '08' + THEN concat(date_format(ald.created_on,'%d'),' - Agosto - ',date_format(ald.created_on,'%Y')) + WHEN date_format(ald.created_on,'%m') = '09' + THEN concat(date_format(ald.created_on,'%d'),' - Septiembre - ',date_format(ald.created_on,'%Y')) + WHEN date_format(ald.created_on,'%m') = '10' + THEN concat(date_format(ald.created_on,'%d'),' - Octubre - ',date_format(ald.created_on,'%Y')) + WHEN date_format(ald.created_on,'%m') = '11' + THEN concat(date_format(ald.created_on,'%d'),' - Noviembre - ',date_format(ald.created_on,'%Y')) + WHEN date_format(ald.created_on,'%m') = '12' + THEN concat(date_format(ald.created_on,'%d'),' - Diciembre - ',date_format(ald.created_on,'%Y')) +END +) AS str_created_on, +CONCAT( + CASE + WHEN ap_customer.first_name IS NOT NULL AND ap_customer.first_name != '' + THEN CONCAT(SUBSTR(UPPER(ap_customer.first_name), 1, 1),SUBSTR(LOWER(ap_customer.first_name), 2), ' ') + ELSE '' + END, + CASE + WHEN ap_customer.second_name IS NOT NULL AND ap_customer.second_name != '' + THEN CONCAT(SUBSTR(UPPER(ap_customer.second_name), 1, 1),SUBSTR(LOWER(ap_customer.second_name), 2), ' ') + ELSE '' + END, + CASE + WHEN ap_customer.last_name IS NOT NULL AND ap_customer.last_name != '' + THEN CONCAT(SUBSTR(UPPER(ap_customer.last_name), 1, 1),SUBSTR(LOWER(ap_customer.last_name), 2), ' ') + ELSE '' + END, + CASE + WHEN ap_customer.middle_name IS NOT NULL AND ap_customer.middle_name != '' + THEN CONCAT(SUBSTR(UPPER(ap_customer.middle_name), 1, 1),SUBSTR(LOWER(ap_customer.middle_name), 2)) + ELSE '' + END +) AS customer_name, +CONCAT( + CASE + WHEN ap_endorsement.first_name IS NOT NULL AND ap_endorsement.first_name != '' + THEN CONCAT(SUBSTR(UPPER(ap_endorsement.first_name), 1, 1),SUBSTR(LOWER(ap_endorsement.first_name), 2), ' ') + ELSE '' + END, + CASE + WHEN ap_endorsement.second_name IS NOT NULL AND ap_endorsement.second_name != '' + THEN CONCAT(SUBSTR(UPPER(ap_endorsement.second_name), 1, 1),SUBSTR(LOWER(ap_endorsement.second_name), 2), ' ') + ELSE '' + END, + CASE + WHEN ap_endorsement.last_name IS NOT NULL AND ap_endorsement.last_name != '' + THEN CONCAT(SUBSTR(UPPER(ap_endorsement.last_name), 1, 1),SUBSTR(LOWER(ap_endorsement.last_name), 2), ' ') + ELSE '' + END, + CASE + WHEN ap_endorsement.middle_name IS NOT NULL AND ap_endorsement.middle_name != '' + THEN CONCAT(SUBSTR(UPPER(ap_endorsement.middle_name), 1, 1),SUBSTR(LOWER(ap_endorsement.middle_name), 2)) + ELSE '' + END +) AS endorsement_name, +CONCAT( + CASE + WHEN ahr.first_name IS NOT NULL AND ahr.first_name != '' + THEN CONCAT(SUBSTR(UPPER(ahr.first_name), 1, 1),SUBSTR(LOWER(ahr.first_name), 2), ' ') + ELSE '' + END, + CASE + WHEN ahr.second_name IS NOT NULL AND ahr.second_name != '' + THEN CONCAT(SUBSTR(UPPER(ahr.second_name), 1, 1),SUBSTR(LOWER(ahr.second_name), 2), ' ') + ELSE '' + END, + CASE + WHEN ahr.last_name IS NOT NULL AND ahr.last_name != '' + THEN CONCAT(SUBSTR(UPPER(ahr.last_name), 1, 1),SUBSTR(LOWER(ahr.last_name), 2), ' ') + ELSE '' + END, + CASE + WHEN ahr.middle_name IS NOT NULL AND ahr.middle_name != '' + THEN CONCAT(SUBSTR(UPPER(ahr.middle_name), 1, 1),SUBSTR(LOWER(ahr.middle_name), 2)) + ELSE '' + END + ) AS user_name, + ald.loan_comments AS loan_comments, + ald.created_on AS created_on +FROM + APC_LOAN_DETAIL ald + INNER JOIN APC_LOAN al ON ald.id_loan = al.id + INNER JOIN APC_PEOPLE ap_customer ON al.id_customer = ap_customer.id + INNER JOIN APC_PEOPLE ap_endorsement ON al.id_endorsement = ap_endorsement.id + INNER JOIN APC_USER au ON ald.created_by = au.id + INNER JOIN APC_HUMAN_RESOURCE ahr ON au.id_human_resource = ahr.id +WHERE + ald.loan_details_type = 'TRANSFER' AND + ald.transfer_status = 'PENDING' +ORDER BY ald.created_on; +-- ---------------------------------------------------------------------- +-- +-- Estructura para la vista `APC_LOAN_IN_PENDING_STATUS_TO_DELIVERY_VIEW` +-- +-- ---------------------------------------------------------------------- +CREATE OR REPLACE VIEW `APC_LOAN_IN_PENDING_STATUS_TO_DELIVERY_VIEW` AS +SELECT + al.id AS id_loan, + alt.payment AS payment, + ( +CASE + WHEN date_format(al.created_on,'%m') = '01' + THEN concat(date_format(al.created_on,'%d'),' - Enero - ',date_format(al.created_on,'%Y')) + WHEN date_format(al.created_on,'%m') = '02' + THEN concat(date_format(al.created_on,'%d'),' - Febrero - ',date_format(al.created_on,'%Y')) + WHEN date_format(al.created_on,'%m') = '03' + THEN concat(date_format(al.created_on,'%d'),' - Marzo - ',date_format(al.created_on,'%Y')) + WHEN date_format(al.created_on,'%m') = '04' + THEN concat(date_format(al.created_on,'%d'),' - Abril - ',date_format(al.created_on,'%Y')) + WHEN date_format(al.created_on,'%m') = '05' + THEN concat(date_format(al.created_on,'%d'),' - Mayo - ',date_format(al.created_on,'%Y')) + WHEN date_format(al.created_on,'%m') = '06' + THEN concat(date_format(al.created_on,'%d'),' - Junio - ',date_format(al.created_on,'%Y')) + WHEN date_format(al.created_on,'%m') = '07' + THEN concat(date_format(al.created_on,'%d'),' - Julio - ',date_format(al.created_on,'%Y')) + WHEN date_format(al.created_on,'%m') = '08' + THEN concat(date_format(al.created_on,'%d'),' - Agosto - ',date_format(al.created_on,'%Y')) + WHEN date_format(al.created_on,'%m') = '09' + THEN concat(date_format(al.created_on,'%d'),' - Septiembre - ',date_format(al.created_on,'%Y')) + WHEN date_format(al.created_on,'%m') = '10' + THEN concat(date_format(al.created_on,'%d'),' - Octubre - ',date_format(al.created_on,'%Y')) + WHEN date_format(al.created_on,'%m') = '11' + THEN concat(date_format(al.created_on,'%d'),' - Noviembre - ',date_format(al.created_on,'%Y')) + WHEN date_format(al.created_on,'%m') = '12' + THEN concat(date_format(al.created_on,'%d'),' - Diciembre - ',date_format(al.created_on,'%Y')) +END +) AS str_created_on, +CONCAT( + CASE + WHEN ap_customer.first_name IS NOT NULL AND ap_customer.first_name != '' + THEN CONCAT(SUBSTR(UPPER(ap_customer.first_name), 1, 1),SUBSTR(LOWER(ap_customer.first_name), 2), ' ') + ELSE '' + END, + CASE + WHEN ap_customer.second_name IS NOT NULL AND ap_customer.second_name != '' + THEN CONCAT(SUBSTR(UPPER(ap_customer.second_name), 1, 1),SUBSTR(LOWER(ap_customer.second_name), 2), ' ') + ELSE '' + END, + CASE + WHEN ap_customer.last_name IS NOT NULL AND ap_customer.last_name != '' + THEN CONCAT(SUBSTR(UPPER(ap_customer.last_name), 1, 1),SUBSTR(LOWER(ap_customer.last_name), 2), ' ') + ELSE '' + END, + CASE + WHEN ap_customer.middle_name IS NOT NULL AND ap_customer.middle_name != '' + THEN CONCAT(SUBSTR(UPPER(ap_customer.middle_name), 1, 1),SUBSTR(LOWER(ap_customer.middle_name), 2)) + ELSE '' + END +) AS customer_name, +CONCAT( + CASE + WHEN ap_endorsement.first_name IS NOT NULL AND ap_endorsement.first_name != '' + THEN CONCAT(SUBSTR(UPPER(ap_endorsement.first_name), 1, 1),SUBSTR(LOWER(ap_endorsement.first_name), 2), ' ') + ELSE '' + END, + CASE + WHEN ap_endorsement.second_name IS NOT NULL AND ap_endorsement.second_name != '' + THEN CONCAT(SUBSTR(UPPER(ap_endorsement.second_name), 1, 1),SUBSTR(LOWER(ap_endorsement.second_name), 2), ' ') + ELSE '' + END, + CASE + WHEN ap_endorsement.last_name IS NOT NULL AND ap_endorsement.last_name != '' + THEN CONCAT(SUBSTR(UPPER(ap_endorsement.last_name), 1, 1),SUBSTR(LOWER(ap_endorsement.last_name), 2), ' ') + ELSE '' + END, + CASE + WHEN ap_endorsement.middle_name IS NOT NULL AND ap_endorsement.middle_name != '' + THEN CONCAT(SUBSTR(UPPER(ap_endorsement.middle_name), 1, 1),SUBSTR(LOWER(ap_endorsement.middle_name), 2)) + ELSE '' + END +) AS endorsement_name, +CONCAT( + CASE + WHEN ahr.first_name IS NOT NULL AND ahr.first_name != '' + THEN CONCAT(SUBSTR(UPPER(ahr.first_name), 1, 1),SUBSTR(LOWER(ahr.first_name), 2), ' ') + ELSE '' + END, + CASE + WHEN ahr.second_name IS NOT NULL AND ahr.second_name != '' + THEN CONCAT(SUBSTR(UPPER(ahr.second_name), 1, 1),SUBSTR(LOWER(ahr.second_name), 2), ' ') + ELSE '' + END, + CASE + WHEN ahr.last_name IS NOT NULL AND ahr.last_name != '' + THEN CONCAT(SUBSTR(UPPER(ahr.last_name), 1, 1),SUBSTR(LOWER(ahr.last_name), 2), ' ') + ELSE '' + END, + CASE + WHEN ahr.middle_name IS NOT NULL AND ahr.middle_name != '' + THEN CONCAT(SUBSTR(UPPER(ahr.middle_name), 1, 1),SUBSTR(LOWER(ahr.middle_name), 2)) + ELSE '' + END + ) AS user_name, + al.created_on AS created_on +FROM + APC_LOAN al + INNER JOIN APC_LOAN_TYPE alt ON al.id_loan_type = alt.id + INNER JOIN APC_PEOPLE ap_customer ON al.id_customer = ap_customer.id + INNER JOIN APC_PEOPLE ap_endorsement ON al.id_endorsement = ap_endorsement.id + INNER JOIN APC_USER au ON al.created_by = au.id + INNER JOIN APC_HUMAN_RESOURCE ahr ON au.id_human_resource = ahr.id +WHERE al.loan_status = 'PENDING' +ORDER BY al.created_on ASC; +-- -------------------------------------------------------------------- +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; diff --git a/ace-db/src/create/from/scratch/mora/f1_isMobileEnabledUser.sql b/ace-db/src/create/from/scratch/mora/f1_isMobileEnabledUser.sql new file mode 100644 index 0000000..62fb424 --- /dev/null +++ b/ace-db/src/create/from/scratch/mora/f1_isMobileEnabledUser.sql @@ -0,0 +1,45 @@ +/* + * Arrebol Consultancy copyright. + * + * This code belongs to Arrebol Consultancy + * its use, redistribution or modification are prohibited + * without written authorization from Arrebol Consultancy. + */ +/** + * Author: Carlos Janitzio Zavala Lopez + * Created: 9 mar. 2022 + */ +DROP FUNCTION IF EXISTS `isMobileEnabledUser`; +-- -------------------------------------------------------- +-- +-- Estructura para la funciĆ³n `isMobileEnabledUser` +-- +-- Verifica que el usuario este activo y que no sea certificador +-- +DELIMITER // +CREATE FUNCTION `isMobileEnabledUser` ( + p_user_id VARCHAR(36) +) +RETURNS BOOL DETERMINISTIC +BEGIN + DECLARE v_is_mobile_enabled_user INT; + + SELECT + COUNT(u.id) INTO v_is_mobile_enabled_user + FROM APC_USER u + INNER JOIN APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource + INNER JOIN APC_USER_BY_OFFICE ubo ON ubo.id_user = u.id + WHERE u.user_status = 'ENEBLED' AND + u.user_type IN ('MOBILE') AND + u.certifier = 'DISABLED' + AND u.id = CONVERT(p_user_id USING utf8mb4); + + IF v_is_mobile_enabled_user = 1 + THEN + RETURN TRUE; + ELSE + RETURN FALSE; + END IF; + +END; // +DELIMITER ; diff --git a/ace-db/src/janitzio.sql b/ace-db/src/janitzio.sql new file mode 100644 index 0000000..703cae9 --- /dev/null +++ b/ace-db/src/janitzio.sql @@ -0,0 +1,2 @@ +ALTER TABLE APC_DELIVERY +ADD COLUMN comission enum('INCLUDED','EXCLUDED') DEFAULT 'INCLUDED' AFTER amount; \ No newline at end of file diff --git a/ace-db/src/notes.txt b/ace-db/src/notes.txt new file mode 100644 index 0000000..80f752a --- /dev/null +++ b/ace-db/src/notes.txt @@ -0,0 +1,175 @@ +Path web +cd /Users/Picasso/Documents/workspace/arrebol/ApoyoProyectosComerciales/apc-web/ + +SASS command +sass --update src/main/webapp/resources:src/main/webapp/resources --no-source-map + +http://pdqcoders.com/font-based-icons.html +Font: Google Material Icons +-- prueba commit + +# +# Here, or in other properties files in this directory, you can define +# various properties that you want to make available to the template +# processor while creating various templates. +# Lo!Hx?w90$ +# D35aRr0Yad0R +# R1n0c3R0nT3= +# R1n0c3R0nT3= + +# uncomment the next line and specify your user name to be used in new templates +#user=Your Name (AlphaCJZL) +user=Carlos Janitzio Zavala Lopez + + + +<#if licenseFirst??> +${licenseFirst} + +${licensePrefix}Arrebol Consultancy copyright. +${licensePrefix} +${licensePrefix}This code belongs to Arrebol Consultancy +${licensePrefix}its use, redistribution or modification are prohibited +${licensePrefix}without written authorization from Arrebol Consultancy. +<#if licenseLast??> +${licenseLast} + + + +search/payment-details?user=83d2cd30-8e1d-11ea-b65e-4e1376171215&personSearch=67b3081e-8bc9-11ea-b45c-c7b846343364 + +Cambios para abono con transferencia bancaria. +alter table +web services y web deberan ser desplegados en prod. + + +-- EJECUTIVO 5751074e-7d1b-11ea-af3e-28f659da398e +-- recursos.humanos 564f976d-e869-11ea-b7e1-02907d0fb4e6 +-- gerencia 42e99ff0-e59c-11ea-b7e1-02907d0fb4e6 + + +INSERT INTO `APC_PERMISSION` +(`id`, `permission`, `description`, `menu_path`, `left_to_right_order`, `top_to_bottom_order` , + `permission_type`, `permission_status`,`created_by`, `parent_name`) +VALUES +('073fba18-2a8e-11eb-9de2-a30e5a9c0028','admin.loan.change.owner', 'admin.loan.change.owner.description', 'admin.loan.change.owner.path', 10, 110,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.loan'), +('50942348-2a8e-11eb-9de2-a30e5a9c0028','admin.loan.change.owner.update', 'admin.loan.change.owner.update.description', 'admin.loan.change.owner.update.path', 10, 111,'PRIVATE', 'ENEBLED', '0dc7c246-7db8-11ea-9b1f-500320958bf8','admin.loan'); + +INSERT INTO `APC_USER_BY_OFFICE_HAS_PERMISSION` +(`id_user_by_office`,`id_permission`,`created_by`,`created_on`) +VALUES +('bbb978f3-e59c-11ea-b7e1-02907d0fb4e6','073fba18-2a8e-11eb-9de2-a30e5a9c0028','42e99ff0-e59c-11ea-b7e1-02907d0fb4e6',NOW()), +('bbb978f3-e59c-11ea-b7e1-02907d0fb4e6','50942348-2a8e-11eb-9de2-a30e5a9c0028','42e99ff0-e59c-11ea-b7e1-02907d0fb4e6',NOW()), +('894b4e5c-e869-11ea-b7e1-02907d0fb4e6','073fba18-2a8e-11eb-9de2-a30e5a9c0028','42e99ff0-e59c-11ea-b7e1-02907d0fb4e6',NOW()), +('894b4e5c-e869-11ea-b7e1-02907d0fb4e6','50942348-2a8e-11eb-9de2-a30e5a9c0028','42e99ff0-e59c-11ea-b7e1-02907d0fb4e6',NOW()), +('a742dfe8-7d20-11ea-af3e-28f659da398e','073fba18-2a8e-11eb-9de2-a30e5a9c0028','42e99ff0-e59c-11ea-b7e1-02907d0fb4e6',NOW()), +('a742dfe8-7d20-11ea-af3e-28f659da398e','50942348-2a8e-11eb-9de2-a30e5a9c0028','42e99ff0-e59c-11ea-b7e1-02907d0fb4e6',NOW()),; +COMMIT; +-- -------------------------------------------------------------------- +-- +-- Estructura para la vista `APC_CURRENT_CUSTOMER_BY_LOAN_VIEW` +-- SIRVE PARA TRAER LOS PRESTAMOS CON SUS CLIENTES, AVALES Y ASESORES. +-- +-- -------------------------------------------------------------------- +CREATE OR REPLACE VIEW `APC_CURRENT_CUSTOMER_BY_LOAN_VIEW` AS +SELECT +loan.id AS id_loan, +usr.id AS id_user, +usr_by_office.id_office AS id_office, +loan_type.payment AS payment, +CONCAT( + CASE + WHEN customer.first_name IS NOT NULL AND customer.first_name != '' + THEN CONCAT(SUBSTR(UPPER(customer.first_name), 1, 1),SUBSTR(LOWER(customer.first_name), 2)) + ELSE '' + END, + CASE + WHEN customer.second_name IS NOT NULL AND customer.second_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(customer.second_name), 1, 1),SUBSTR(LOWER(customer.second_name), 2)) + ELSE '' + END, + CASE + WHEN customer.last_name IS NOT NULL AND customer.last_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(customer.last_name), 1, 1),SUBSTR(LOWER(customer.last_name), 2)) + ELSE '' + END, + CASE + WHEN customer.middle_name IS NOT NULL AND customer.middle_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(customer.middle_name), 1, 1),SUBSTR(LOWER(customer.middle_name), 2)) + ELSE '' + END + ) AS customer_name, + CONCAT( + CASE + WHEN endorsement.first_name IS NOT NULL AND endorsement.first_name != '' + THEN CONCAT(SUBSTR(UPPER(endorsement.first_name), 1, 1),SUBSTR(LOWER(endorsement.first_name), 2)) + ELSE '' + END, + CASE + WHEN endorsement.second_name IS NOT NULL AND endorsement.second_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(endorsement.second_name), 1, 1),SUBSTR(LOWER(endorsement.second_name), 2)) + ELSE '' + END, + CASE + WHEN endorsement.last_name IS NOT NULL AND endorsement.last_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(endorsement.last_name), 1, 1),SUBSTR(LOWER(endorsement.last_name), 2)) + ELSE '' + END, + CASE + WHEN endorsement.middle_name IS NOT NULL AND endorsement.middle_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(endorsement.middle_name), 1, 1),SUBSTR(LOWER(endorsement.middle_name), 2)) + ELSE '' + END + ) AS endorsement_name, + loan.loan_status AS loan_status, + loan.created_on AS created_on, + route.route_name AS route_name +FROM APC_LOAN loan +INNER JOIN APC_PEOPLE customer ON loan.id_customer = customer.id +INNER JOIN APC_PEOPLE endorsement ON loan.id_endorsement = endorsement.id +INNER JOIN APC_LOAN_TYPE loan_type ON loan.id_loan_type = loan_type.id +INNER JOIN APC_LOAN_BY_USER loan_by_user ON loan.id = loan_by_user.id_loan +INNER JOIN APC_USER usr ON loan_by_user.id_user = usr.id +INNER JOIN APC_USER_BY_OFFICE usr_by_office ON usr.id = usr_by_office.id_user +INNER JOIN APC_ROUTE route ON loan.id_route = route.id +WHERE loan.loan_status IN('APPROVED','PENDING','PENDING_RENOVATION','TO_DELIVERY') +ORDER BY usr.id, loan.created_on; +-- -------------------------------------------------------------------- +-- +-- Estructura para la vista `APC_AVAILABLES_OWNERS_VIEW` +-- REGRESA LOS USUARIOS ACTIVOS DE TIPO MOBILE AND BOTH. +-- +-- -------------------------------------------------------------------- +CREATE OR REPLACE VIEW `APC_AVAILABLES_OWNERS_VIEW` AS +SELECT +usr.id AS id_user, +usr_by_office.id_office AS id_office, +usr.user_name AS user_name, +CONCAT( + CASE + WHEN human_resource.first_name IS NOT NULL AND human_resource.first_name != '' + THEN CONCAT(SUBSTR(UPPER(human_resource.first_name), 1, 1),SUBSTR(LOWER(human_resource.first_name), 2)) + ELSE '' + END, + CASE + WHEN human_resource.second_name IS NOT NULL AND human_resource.second_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(human_resource.second_name), 1, 1),SUBSTR(LOWER(human_resource.second_name), 2)) + ELSE '' + END, + CASE + WHEN human_resource.last_name IS NOT NULL AND human_resource.last_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(human_resource.last_name), 1, 1),SUBSTR(LOWER(human_resource.last_name), 2)) + ELSE '' + END, + CASE + WHEN human_resource.middle_name IS NOT NULL AND human_resource.middle_name != '' + THEN CONCAT(' ',SUBSTR(UPPER(human_resource.middle_name), 1, 1),SUBSTR(LOWER(human_resource.middle_name), 2)) + ELSE '' + END + ) AS full_name +FROM APC_USER usr +INNER JOIN APC_HUMAN_RESOURCE human_resource ON usr.id_human_resource = human_resource.id +INNER JOIN APC_USER_BY_OFFICE usr_by_office ON usr.id = usr_by_office.id_user +WHERE usr.user_status = 'ENEBLED' AND +usr.user_type IN ('MOBILE','BOTH') AND +usr.certifier = 'DISABLED'; \ No newline at end of file diff --git a/ace-db/src/oscar.sql b/ace-db/src/oscar.sql new file mode 100644 index 0000000..cb1c81e --- /dev/null +++ b/ace-db/src/oscar.sql @@ -0,0 +1,493 @@ +/* + * Arrebol Consultancy copyright. + * + * This code belongs to Arrebol Consultancy + * its use, redistribution or modification are prohibited + * without written authorization from Arrebol Consultancy. + */ +/** + * Author: Oscar Armando Vargas Cardenas + * Created: 28/10/2020 + */ + +CREATE OR REPLACE VIEW `APC_CLOSING_DAILY_DETAIL_FROM_USER_BY_CURDATE_VIEW_REPORT` AS +SELECT + ld.id, + CONCAT(p.first_name,' ',IF(ISNULL(p.second_name) ,'', CONCAT(p.second_name, ' ')),p.last_name,' ', p.middle_name) AS comments, + ld.payment_amount as amount, + CASE + WHEN ld.loan_details_type = 'PAYMENT' THEN 'Abono' + WHEN ld.loan_details_type = 'FEE' THEN 'Multa' + WHEN ld.loan_details_type = 'TRANSFER' THEN 'DepĆ³sito' + ELSE '' END as type, + ld.id_user, + ld.created_on, + l.created_on as fechaFiltro, + 'xxxx' as route, + (l.amount_to_pay - amount_paid) as saldo, + 0 as comisionApertura, + 0 as prestamoAnterior +FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l ON ld.id_loan = l.id +INNER JOIN APC_PEOPLE p ON l.id_customer = p.id +WHERE DATE(ld.created_on) = CURDATE() +AND ld.loan_details_type in ('PAYMENT', 'FEE', 'TRANSFER' ) +UNION +SELECT + md.id, + DATE(md.money_daily_date) AS comments, + md.amount as amount, + 'Inicio' as type, + md.id_user, + md.created_on, + CURDATE() as fechaFiltro, + 'xxxx' as route, + 0 as saldo, + 0 as comisionApertura, + 0 as prestamoAnterior +FROM + APC_MONEY_DAILY md +WHERE DATE(md.money_daily_date) = CURDATE() +UNION +SELECT + oe.id, + oe.description, + oe.expense, + 'Gasto', + oe.id_user, + oe.created_on, + CURDATE() as fechaFiltro, + 'xxxx' as route, + 0 as saldo, + 0 as comisionApertura, + 0 as prestamoAnterior +FROM + APC_OTHER_EXPENSE oe +WHERE DATE(oe.created_on) = CURDATE() +UNION +SELECT + te.id, + CONCAT(hr.first_name,' ',IF(ISNULL(hr.second_name) ,'', CONCAT(hr.second_name, ' ')),hr.last_name,' ', hr.middle_name), + te.amount_to_transfer, + 'Transferencia enviada', + te.id_user_transmitter, + te.created_on, + CURDATE() as fechaFiltro, + 'xxxx' as route, + 0 as saldo, + 0 as comisionApertura, + 0 as prestamoAnterior +FROM + APC_TRANSFER te +JOIN + APC_USER u on u.id = te.id_user_receiver +JOIN + APC_HUMAN_RESOURCE hr on hr.id = u.id_human_resource +WHERE DATE(te.created_on) = CURDATE() and te.action_status = 'APPROVED' +UNION +SELECT + tr.id, + CONCAT(hr.first_name,' ',IF(ISNULL(hr.second_name) ,'', CONCAT(hr.second_name, ' ')),hr.last_name,' ', hr.middle_name), + tr.amount_to_transfer, + 'Transferencia recibida', + tr.id_user_receiver, + tr.created_on, + CURDATE() as fechaFiltro, + 'xxxx' as route, + 0 as saldo, + 0 as comisionApertura, + 0 as prestamoAnterior +FROM + APC_TRANSFER tr +JOIN + APC_USER u on u.id = tr.id_user_transmitter +JOIN + APC_HUMAN_RESOURCE hr on hr.id = u.id_human_resource +WHERE DATE(tr.created_on) = CURDATE() and tr.action_status = 'APPROVED' +UNION +SELECT + d.id, + CONCAT(p.first_name,' ',IF(ISNULL(p.second_name) ,'', CONCAT(p.second_name, ' ')),p.last_name,' ', p.middle_name), + d.amount, + 'Entrega de prĆ©stamo', + d.id_user, + d.created_on, + CURDATE() as fechaFiltro, + r.route_name as route, + CASE WHEN (SELECT (l2.amount_to_pay - l2.amount_paid) FROM APC_LOAN_BY_RENOVATION lr + INNER JOIN APC_LOAN l2 ON l2.id = lr.id_loan_old + WHERE lr.id_loan_new = l.id) is null THEN 0 ELSE + (SELECT (l2.amount_to_pay - l2.amount_paid) FROM APC_LOAN_BY_RENOVATION lr + INNER JOIN APC_LOAN l2 ON l2.id = lr.id_loan_old + WHERE lr.id_loan_new = l.id) END as saldo, + lt.opening_fee as comisionApertura, + (SELECT CASE WHEN ld.payment_amount is null or 0 THEN 0 ELSE ld.payment_amount END FROM APC_LOAN_DETAIL ld +INNER JOIN APC_LOAN l3 ON ld.id_loan = l3.id +WHERE ld.loan_details_type = 'RENOVATION_PAYMENT' +AND l3.id = (SELECT albr.id_loan_old FROM APC_LOAN_BY_RENOVATION albr WHERE albr.id_loan_new = l.id)) as prestamoAnterior +FROM APC_DELIVERY d +INNER JOIN APC_LOAN l ON d.id_loan = l.id +INNER JOIN APC_LOAN_TYPE lt ON l.id_loan_type = lt.id +INNER JOIN APC_PEOPLE p ON l.id_customer = p.id +INNER JOIN APC_ROUTE r ON r.id = l.id_route +WHERE DATE(d.created_on) = CURDATE(); + + +CREATE OR REPLACE VIEW `APC_RESUMEN_IN_OUT_WEEK_BY_USER_VIEW` AS +SELECT +u.id, +CONCAT(hr.first_name, ' ' , hr.last_name) as username, +ubo.id_office, +-- Lunes +(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) +FROM APC_CLOSING_DAY ld +WHERE ld.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.active_status = 'ENEBLED' +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'monday') as closing_monday, +(SELECT IF(ISNULL(SUM(oe.expense)),0,SUM(oe.expense)) +FROM APC_OTHER_EXPENSE oe +WHERE oe.id_user = u.id AND WEEK(DATE(oe.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(oe.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(oe.created_on))) = 'monday') as expense_monday, +(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) +FROM APC_MONEY_DAILY md +WHERE md.id_user = u.id AND WEEK(DATE(md.money_daily_date),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(md.money_daily_date)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(md.money_daily_date))) = 'monday') as money_daily_today_monday, +-- Martes +(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) +FROM APC_CLOSING_DAY ld +WHERE ld.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.active_status = 'ENEBLED' +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'tuesday') as closing_tuesday, +(SELECT IF(ISNULL(SUM(oe.expense)),0,SUM(oe.expense)) +FROM APC_OTHER_EXPENSE oe +WHERE oe.id_user = u.id AND WEEK(DATE(oe.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(oe.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(oe.created_on))) = 'tuesday') as expense_tuesday, +(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) +FROM APC_MONEY_DAILY md +WHERE md.id_user = u.id AND WEEK(DATE(md.money_daily_date),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(md.money_daily_date)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(md.money_daily_date))) = 'tuesday') as money_daily_today_tuesday, +-- Miercoles +(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) +FROM APC_CLOSING_DAY ld +WHERE ld.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.active_status = 'ENEBLED' +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'wednesday') as closing_wednesday, +(SELECT IF(ISNULL(SUM(oe.expense)),0,SUM(oe.expense)) +FROM APC_OTHER_EXPENSE oe +WHERE oe.id_user = u.id AND WEEK(DATE(oe.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(oe.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(oe.created_on))) = 'wednesday') as expense_wednesday, +(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) +FROM APC_MONEY_DAILY md +WHERE md.id_user = u.id AND WEEK(DATE(md.money_daily_date),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(md.money_daily_date)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(md.money_daily_date))) = 'wednesday') as money_daily_today_wednesday, +-- Jueves +(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) +FROM APC_CLOSING_DAY ld +WHERE ld.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.active_status = 'ENEBLED' +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'thursday') as closing_thursday, +(SELECT IF(ISNULL(SUM(oe.expense)),0,SUM(oe.expense)) +FROM APC_OTHER_EXPENSE oe +WHERE oe.id_user = u.id AND WEEK(DATE(oe.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(oe.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(oe.created_on))) = 'thursday') as expense_thursday, +(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) +FROM APC_MONEY_DAILY md +WHERE md.id_user = u.id AND WEEK(DATE(md.money_daily_date),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(md.money_daily_date)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(md.money_daily_date))) = 'thursday') as money_daily_today_thursday, +-- Viernes +(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) +FROM APC_CLOSING_DAY ld +WHERE ld.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.active_status = 'ENEBLED' +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'friday') as closing_friday, +(SELECT IF(ISNULL(SUM(oe.expense)),0,SUM(oe.expense)) +FROM APC_OTHER_EXPENSE oe +WHERE oe.id_user = u.id AND WEEK(DATE(oe.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(oe.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(oe.created_on))) = 'friday') as expense_friday, +(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) +FROM APC_MONEY_DAILY md +WHERE md.id_user = u.id AND WEEK(DATE(md.money_daily_date),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(md.money_daily_date)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(md.money_daily_date))) = 'friday') as money_daily_today_friday, +-- Sabado +(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) +FROM APC_CLOSING_DAY ld +WHERE ld.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.active_status = 'ENEBLED' +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'saturday') as closing_saturday, +(SELECT IF(ISNULL(SUM(oe.expense)),0,SUM(oe.expense)) +FROM APC_OTHER_EXPENSE oe +WHERE oe.id_user = u.id AND WEEK(DATE(oe.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(oe.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(oe.created_on))) = 'saturday') as expense_saturday, +(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) +FROM APC_MONEY_DAILY md +WHERE md.id_user = u.id AND WEEK(DATE(md.money_daily_date),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(md.money_daily_date)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(md.money_daily_date))) = 'saturday') as money_daily_today_saturday +FROM APC_USER u +INNER JOIN APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource +INNER JOIN APC_USER_BY_OFFICE ubo ON ubo.id_user = u.id +WHERE u.user_status = 'ENEBLED' AND +u.user_type IN ('MOBILE','BOTH'); + +CREATE OR REPLACE VIEW `APC_RESUMEN_IN_OUT_LAST_WEEK_BY_USER_VIEW` AS +SELECT +u.id, +CONCAT(hr.first_name, ' ' , hr.last_name) as username, +ubo.id_office, +-- Lunes +(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) +FROM APC_CLOSING_DAY ld +WHERE ld.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.active_status = 'ENEBLED' +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'monday') as closing_monday, +(SELECT IF(ISNULL(SUM(oe.expense)),0,SUM(oe.expense)) +FROM APC_OTHER_EXPENSE oe +WHERE oe.id_user = u.id AND WEEK(DATE(oe.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(oe.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(oe.created_on))) = 'monday') as expense_monday, +(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) +FROM APC_MONEY_DAILY md +WHERE md.id_user = u.id AND WEEK(DATE(md.money_daily_date),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(md.money_daily_date)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(md.money_daily_date))) = 'monday') as money_daily_today_monday, +-- Martes +(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) +FROM APC_CLOSING_DAY ld +WHERE ld.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.active_status = 'ENEBLED' +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'tuesday') as closing_tuesday, +(SELECT IF(ISNULL(SUM(oe.expense)),0,SUM(oe.expense)) +FROM APC_OTHER_EXPENSE oe +WHERE oe.id_user = u.id AND WEEK(DATE(oe.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(oe.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(oe.created_on))) = 'tuesday') as expense_tuesday, +(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) +FROM APC_MONEY_DAILY md +WHERE md.id_user = u.id AND WEEK(DATE(md.money_daily_date),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(md.money_daily_date)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(md.money_daily_date))) = 'tuesday') as money_daily_today_tuesday, +-- Miercoles +(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) +FROM APC_CLOSING_DAY ld +WHERE ld.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.active_status = 'ENEBLED' +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'wednesday') as closing_wednesday, +(SELECT IF(ISNULL(SUM(oe.expense)),0,SUM(oe.expense)) +FROM APC_OTHER_EXPENSE oe +WHERE oe.id_user = u.id AND WEEK(DATE(oe.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(oe.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(oe.created_on))) = 'wednesday') as expense_wednesday, +(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) +FROM APC_MONEY_DAILY md +WHERE md.id_user = u.id AND WEEK(DATE(md.money_daily_date),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(md.money_daily_date)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(md.money_daily_date))) = 'wednesday') as money_daily_today_wednesday, +-- Jueves +(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) +FROM APC_CLOSING_DAY ld +WHERE ld.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.active_status = 'ENEBLED' +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'thursday') as closing_thursday, +(SELECT IF(ISNULL(SUM(oe.expense)),0,SUM(oe.expense)) +FROM APC_OTHER_EXPENSE oe +WHERE oe.id_user = u.id AND WEEK(DATE(oe.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(oe.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(oe.created_on))) = 'thursday') as expense_thursday, +(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) +FROM APC_MONEY_DAILY md +WHERE md.id_user = u.id AND WEEK(DATE(md.money_daily_date),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(md.money_daily_date)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(md.money_daily_date))) = 'thursday') as money_daily_today_thursday, +-- Viernes +(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) +FROM APC_CLOSING_DAY ld +WHERE ld.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.active_status = 'ENEBLED' +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'friday') as closing_friday, +(SELECT IF(ISNULL(SUM(oe.expense)),0,SUM(oe.expense)) +FROM APC_OTHER_EXPENSE oe +WHERE oe.id_user = u.id AND WEEK(DATE(oe.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(oe.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(oe.created_on))) = 'friday') as expense_friday, +(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) +FROM APC_MONEY_DAILY md +WHERE md.id_user = u.id AND WEEK(DATE(md.money_daily_date),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(md.money_daily_date)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(md.money_daily_date))) = 'friday') as money_daily_today_friday, +-- Sabado +(SELECT IF(ISNULL(SUM(ld.amount_paid)),0,SUM(ld.amount_paid)) +FROM APC_CLOSING_DAY ld +WHERE ld.id_user = u.id AND WEEK(DATE(ld.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.active_status = 'ENEBLED' +AND LOWER(DAYNAME(DATE(ld.created_on))) = 'saturday') as closing_saturday, +(SELECT IF(ISNULL(SUM(oe.expense)),0,SUM(oe.expense)) +FROM APC_OTHER_EXPENSE oe +WHERE oe.id_user = u.id AND WEEK(DATE(oe.created_on),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(oe.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(oe.created_on))) = 'saturday') as expense_saturday, +(SELECT IF(ISNULL(SUM(md.amount)),0,SUM(md.amount)) +FROM APC_MONEY_DAILY md +WHERE md.id_user = u.id AND WEEK(DATE(md.money_daily_date),1) = (WEEK(CURDATE(),1) - 1) AND +YEAR(DATE(md.money_daily_date)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(md.money_daily_date))) = 'saturday') as money_daily_today_saturday +FROM APC_USER u +INNER JOIN APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource +INNER JOIN APC_USER_BY_OFFICE ubo ON ubo.id_user = u.id +WHERE u.user_status = 'ENEBLED' AND +u.user_type IN ('MOBILE','BOTH'); + + +CREATE OR REPLACE VIEW `APC_INFORMATION_LOAN_WEEK_VIEW` AS +SELECT +l.id, +u.id as id_user, +r.id_office, +l.created_on as fecha, +lt.payment as apoyos, +lt.payment_total as apoyos_total, +lt.opening_fee as comision_apertura, +CONCAT(endor.first_name,' ', IF(ISNULL(endor.second_name) ,'', CONCAT(endor.second_name,' ')) ,endor.last_name, ' ', endor.middle_name) AS aval, +CONCAT(cus.first_name,' ', IF(ISNULL(cus.second_name) ,'', CONCAT(cus.second_name,' ')) ,cus.last_name, ' ', cus.middle_name) AS customer, +l.amount_to_pay as documento_por, +lt.payment_daily as abono_diario, +l.amount_paid, +(l.amount_to_pay - l.amount_paid) saldo_insoluto, +r.route_name, +CONCAT(hr.first_name,' ', IF(ISNULL(hr.second_name) ,'', CONCAT(hr.second_name,' ')) ,hr.last_name, ' ', hr.middle_name) AS asesor, +(SELECT COUNT(lfn.id) FROM APC_LOAN_FEE_NOTIFICATION lfn WHERE lfn.id_loan = l.id) as num_fee, +-- Lunes +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'monday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_monday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'monday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_monday, +-- Martes +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'tuesday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_tuesday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'tuesday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_tuesday, +-- Miercoles +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) +AND YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'wednesday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_wednesday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'wednesday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_wednesday, +-- Jueves +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'thursday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_thursday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'thursday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_thursday, +-- Viernes +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'friday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_friday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'friday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_friday, +-- Sabado +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'saturday' +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')) as payment_saturday, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND LOWER(DAYNAME(DATE(ldLunes.created_on))) = 'saturday' +AND ldLunes.loan_details_type IN ('FEE')) as fee_saturday, + +((lt.payment_daily * (SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) > 5, 5 , COUNT(DISTINCT(DATE(ldFaltante.created_on)))) FROM APC_LOAN_DETAIL ldFaltante +WHERE ldFaltante.id_loan = l.id AND WEEK(DATE(ldFaltante.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldFaltante.created_on)) = YEAR(CURDATE()) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('saturday','sunday') +AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER', 'FEE'))) +- (SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) = WEEK(CURDATE(),1) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND ldLunes.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER'))) as faltante, + +CASE WHEN l.new_customer = 'ENEBLED' AND WEEK(DATE(l.created_on),1) = WEEK(CURDATE(),1) THEN 'Si' ELSE 'No' END as new_customer, +if((SELECT COUNT(id_loan_old) FROM APC_LOAN_BY_RENOVATION lbr +INNER JOIN APC_LOAN lRenovation ON lbr.id_loan_new = lRenovation.id +WHERE id_loan_old = l.id + AND loan_by_renovation_status = 'APPROVED' and WEEK(DATE(lRenovation.created_on),1) <= WEEK(CURDATE(),1) AND + YEAR(DATE(lRenovation.created_on)) = YEAR(CURDATE())) = 0 , 'No' , 'Si') as renovation, +l.loan_status as estatus_prestamo, +(SELECT COUNT(DISTINCT(DATE(ldFaltante.created_on))) FROM APC_LOAN_DETAIL ldFaltante +WHERE ldFaltante.id_loan = l.id AND WEEK(DATE(ldFaltante.created_on),1) <= (WEEK(CURDATE(),1)) AND +YEAR(DATE(ldFaltante.created_on)) = YEAR(CURDATE()) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('saturday','sunday') +AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER', 'FEE')) as num_pagos_all, +(SELECT IF(COUNT(DISTINCT(DATE(ldFaltante.created_on))) > 5, 5, COUNT(DISTINCT(DATE(ldFaltante.created_on)))) FROM APC_LOAN_DETAIL ldFaltante +WHERE ldFaltante.id_loan = l.id AND WEEK(DATE(ldFaltante.created_on),1) = (WEEK(CURDATE(),1)) AND +YEAR(DATE(ldFaltante.created_on)) = YEAR(CURDATE()) and LOWER(DAYNAME(DATE(ldFaltante.created_on))) NOT IN('saturday','sunday') +AND ldFaltante.loan_details_type IN ('PAYMENT','RENOVATION_PAYMENT','TRANSFER', 'FEE')) as num_pagos_week, +(SELECT IF(ISNULL(SUM(ldLunes.payment_amount)),0,SUM(ldLunes.payment_amount)) +FROM APC_LOAN_DETAIL ldLunes +WHERE ldLunes.id_loan = l.id AND WEEK(DATE(ldLunes.created_on),1) <= (WEEK(CURDATE(),1)) AND +YEAR(DATE(ldLunes.created_on)) = YEAR(CURDATE()) +AND ldLunes.loan_details_type IN ('FEE')) as fee_todos +FROM +APC_LOAN l +INNER JOIN APC_LOAN_TYPE lt ON l.id_loan_type = lt.id +INNER JOIN APC_PEOPLE cus ON cus.id = l.id_customer +INNER JOIN APC_PEOPLE endor ON endor.id = l.id_endorsement +INNER JOIN APC_ROUTE r ON r.id = l.id_route +INNER JOIN APC_LOAN_BY_USER lbu ON lbu.id_loan = l.id +INNER JOIN APC_USER u ON u.id = lbu.id_user +INNER JOIN APC_HUMAN_RESOURCE hr ON hr.id = u.id_human_resource +WHERE +l.loan_status not in ('DELETED','REJECTED') AND +((SELECT COUNT(ld.id) FROM APC_LOAN_DETAIL ld WHERE WEEK(DATE(ld.created_on),1) = WEEK(CURDATE(),1) AND + YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.id_loan = l.id) > 0 OR + ((SELECT COUNT(ld.id) FROM APC_LOAN_DETAIL ld WHERE WEEK(DATE(ld.created_on),1) = WEEK(CURDATE(),1) AND + YEAR(DATE(ld.created_on)) = YEAR(CURDATE()) AND ld.id_loan = l.id) = 0 AND l.loan_status = 'APPROVED' AND + WEEK(DATE(l.created_on),1) <= (WEEK(CURDATE(),1)))); \ No newline at end of file diff --git a/ace-db/src/respaldo_xxxxxxxx.sql b/ace-db/src/respaldo_xxxxxxxx.sql new file mode 100644 index 0000000..e5ea235 --- /dev/null +++ b/ace-db/src/respaldo_xxxxxxxx.sql @@ -0,0 +1,3 @@ +CREATE OR REPLACE VIEW `APC_INFORMATION_LOAN_WEEK_VIEW` AS +select `l`.`id` AS `id`,`u`.`id` AS `id_user`,`r`.`id_office` AS `id_office`,`l`.`created_on` AS `fecha`,`lt`.`payment` AS `apoyos`,`lt`.`payment_total` AS `apoyos_total`,`lt`.`opening_fee` AS `comision_apertura`,concat(`endor`.`first_name`,' ',if((`endor`.`second_name` is null),'',concat(`endor`.`second_name`,' ')),`endor`.`last_name`,' ',`endor`.`middle_name`) AS `aval`,concat(`cus`.`first_name`,' ',if((`cus`.`second_name` is null),'',concat(`cus`.`second_name`,' ')),`cus`.`last_name`,' ',`cus`.`middle_name`) AS `customer`,`l`.`amount_to_pay` AS `documento_por`,`lt`.`payment_daily` AS `abono_diario`,`l`.`amount_paid` AS `amount_paid`,(`l`.`amount_to_pay` - `l`.`amount_paid`) AS `saldo_insoluto`,`r`.`route_name` AS `route_name`,concat(`hr`.`first_name`,' ',if((`hr`.`second_name` is null),'',concat(`hr`.`second_name`,' ')),`hr`.`last_name`,' ',`hr`.`middle_name`) AS `asesor`,(select count(`lfn`.`id`) from `APC_LOAN_FEE_NOTIFICATION` `lfn` where (`lfn`.`id_loan` = `l`.`id`)) AS `num_fee`,(select if((sum(`ldLunes`.`payment_amount`) is null),0,sum(`ldLunes`.`payment_amount`)) from `APC_LOAN_DETAIL` `ldLunes` where ((`ldLunes`.`id_loan` = `l`.`id`) and (week(cast(`ldLunes`.`created_on` as date),1) = week(curdate(),1)) and (year(cast(`ldLunes`.`created_on` as date)) = year(curdate())) and (lower(dayname(cast(`ldLunes`.`created_on` as date))) = 'monday') and (`ldLunes`.`loan_details_type` in ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')))) AS `payment_monday`,(select if((sum(`ldLunes`.`payment_amount`) is null),0,sum(`ldLunes`.`payment_amount`)) from `APC_LOAN_DETAIL` `ldLunes` where ((`ldLunes`.`id_loan` = `l`.`id`) and (week(cast(`ldLunes`.`created_on` as date),1) = week(curdate(),1)) and (year(cast(`ldLunes`.`created_on` as date)) = year(curdate())) and (lower(dayname(cast(`ldLunes`.`created_on` as date))) = 'monday') and (`ldLunes`.`loan_details_type` = 'FEE'))) AS `fee_monday`,(select if((sum(`ldLunes`.`payment_amount`) is null),0,sum(`ldLunes`.`payment_amount`)) from `APC_LOAN_DETAIL` `ldLunes` where ((`ldLunes`.`id_loan` = `l`.`id`) and (week(cast(`ldLunes`.`created_on` as date),1) = week(curdate(),1)) and (year(cast(`ldLunes`.`created_on` as date)) = year(curdate())) and (lower(dayname(cast(`ldLunes`.`created_on` as date))) = 'tuesday') and (`ldLunes`.`loan_details_type` in ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')))) AS `payment_tuesday`,(select if((sum(`ldLunes`.`payment_amount`) is null),0,sum(`ldLunes`.`payment_amount`)) from `APC_LOAN_DETAIL` `ldLunes` where ((`ldLunes`.`id_loan` = `l`.`id`) and (week(cast(`ldLunes`.`created_on` as date),1) = week(curdate(),1)) and (year(cast(`ldLunes`.`created_on` as date)) = year(curdate())) and (lower(dayname(cast(`ldLunes`.`created_on` as date))) = 'tuesday') and (`ldLunes`.`loan_details_type` = 'FEE'))) AS `fee_tuesday`,(select if((sum(`ldLunes`.`payment_amount`) is null),0,sum(`ldLunes`.`payment_amount`)) from `APC_LOAN_DETAIL` `ldLunes` where ((`ldLunes`.`id_loan` = `l`.`id`) and (week(cast(`ldLunes`.`created_on` as date),1) = week(curdate(),1)) and (year(cast(`ldLunes`.`created_on` as date)) = year(curdate())) and (lower(dayname(cast(`ldLunes`.`created_on` as date))) = 'wednesday') and (`ldLunes`.`loan_details_type` in ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')))) AS `payment_wednesday`,(select if((sum(`ldLunes`.`payment_amount`) is null),0,sum(`ldLunes`.`payment_amount`)) from `APC_LOAN_DETAIL` `ldLunes` where ((`ldLunes`.`id_loan` = `l`.`id`) and (week(cast(`ldLunes`.`created_on` as date),1) = week(curdate(),1)) and (year(cast(`ldLunes`.`created_on` as date)) = year(curdate())) and (lower(dayname(cast(`ldLunes`.`created_on` as date))) = 'wednesday') and (`ldLunes`.`loan_details_type` = 'FEE'))) AS `fee_wednesday`,(select if((sum(`ldLunes`.`payment_amount`) is null),0,sum(`ldLunes`.`payment_amount`)) from `APC_LOAN_DETAIL` `ldLunes` where ((`ldLunes`.`id_loan` = `l`.`id`) and (week(cast(`ldLunes`.`created_on` as date),1) = week(curdate(),1)) and (year(cast(`ldLunes`.`created_on` as date)) = year(curdate())) and (lower(dayname(cast(`ldLunes`.`created_on` as date))) = 'thursday') and (`ldLunes`.`loan_details_type` in ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')))) AS `payment_thursday`,(select if((sum(`ldLunes`.`payment_amount`) is null),0,sum(`ldLunes`.`payment_amount`)) from `APC_LOAN_DETAIL` `ldLunes` where ((`ldLunes`.`id_loan` = `l`.`id`) and (week(cast(`ldLunes`.`created_on` as date),1) = week(curdate(),1)) and (year(cast(`ldLunes`.`created_on` as date)) = year(curdate())) and (lower(dayname(cast(`ldLunes`.`created_on` as date))) = 'thursday') and (`ldLunes`.`loan_details_type` = 'FEE'))) AS `fee_thursday`,(select if((sum(`ldLunes`.`payment_amount`) is null),0,sum(`ldLunes`.`payment_amount`)) from `APC_LOAN_DETAIL` `ldLunes` where ((`ldLunes`.`id_loan` = `l`.`id`) and (week(cast(`ldLunes`.`created_on` as date),1) = week(curdate(),1)) and (year(cast(`ldLunes`.`created_on` as date)) = year(curdate())) and (lower(dayname(cast(`ldLunes`.`created_on` as date))) = 'friday') and (`ldLunes`.`loan_details_type` in ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')))) AS `payment_friday`,(select if((sum(`ldLunes`.`payment_amount`) is null),0,sum(`ldLunes`.`payment_amount`)) from `APC_LOAN_DETAIL` `ldLunes` where ((`ldLunes`.`id_loan` = `l`.`id`) and (week(cast(`ldLunes`.`created_on` as date),1) = week(curdate(),1)) and (year(cast(`ldLunes`.`created_on` as date)) = year(curdate())) and (lower(dayname(cast(`ldLunes`.`created_on` as date))) = 'friday') and (`ldLunes`.`loan_details_type` = 'FEE'))) AS `fee_friday`,(select if((sum(`ldLunes`.`payment_amount`) is null),0,sum(`ldLunes`.`payment_amount`)) from `APC_LOAN_DETAIL` `ldLunes` where ((`ldLunes`.`id_loan` = `l`.`id`) and (week(cast(`ldLunes`.`created_on` as date),1) = week(curdate(),1)) and (year(cast(`ldLunes`.`created_on` as date)) = year(curdate())) and (lower(dayname(cast(`ldLunes`.`created_on` as date))) = 'saturday') and (`ldLunes`.`loan_details_type` in ('PAYMENT','RENOVATION_PAYMENT','TRANSFER')))) AS `payment_saturday`,(select if((sum(`ldLunes`.`payment_amount`) is null),0,sum(`ldLunes`.`payment_amount`)) from `APC_LOAN_DETAIL` `ldLunes` where ((`ldLunes`.`id_loan` = `l`.`id`) and (week(cast(`ldLunes`.`created_on` as date),1) = week(curdate(),1)) and (year(cast(`ldLunes`.`created_on` as date)) = year(curdate())) and (lower(dayname(cast(`ldLunes`.`created_on` as date))) = 'saturday') and (`ldLunes`.`loan_details_type` = 'FEE'))) AS `fee_saturday`,((`lt`.`payment_daily` * (select if((count(distinct cast(`ldFaltante`.`created_on` as date)) > 5),5,count(distinct cast(`ldFaltante`.`created_on` as date))) from `APC_LOAN_DETAIL` `ldFaltante` where ((`ldFaltante`.`id_loan` = `l`.`id`) and (week(cast(`ldFaltante`.`created_on` as date),1) = week(curdate(),1)) and (year(cast(`ldFaltante`.`created_on` as date)) = year(curdate())) and (lower(dayname(cast(`ldFaltante`.`created_on` as date))) not in ('saturday','sunday')) and (`ldFaltante`.`loan_details_type` in ('PAYMENT','RENOVATION_PAYMENT','TRANSFER','FEE'))))) - (select if((sum(`ldLunes`.`payment_amount`) is null),0,sum(`ldLunes`.`payment_amount`)) from `APC_LOAN_DETAIL` `ldLunes` where ((`ldLunes`.`id_loan` = `l`.`id`) and (week(cast(`ldLunes`.`created_on` as date),1) = week(curdate(),1)) and (year(cast(`ldLunes`.`created_on` as date)) = year(curdate())) and (`ldLunes`.`loan_details_type` in ('PAYMENT','RENOVATION_PAYMENT','TRANSFER'))))) AS `faltante`,(case when ((`l`.`new_customer` = 'ENEBLED') and (week(cast(`l`.`created_on` as date),1) = week(curdate(),1))) then 'Si' else 'No' end) AS `new_customer`,if(((select count(`lbr`.`id_loan_old`) from (`APC_LOAN_BY_RENOVATION` `lbr` join `APC_LOAN` `lRenovation` on((`lbr`.`id_loan_new` = `lRenovation`.`id`))) where ((`lbr`.`id_loan_old` = `l`.`id`) and (`lbr`.`loan_by_renovation_status` = 'APPROVED') and (week(cast(`lRenovation`.`created_on` as date),1) <= week(curdate(),1)) and (year(cast(`lRenovation`.`created_on` as date)) = year(curdate())))) = 0),'No','Si') AS `renovation`,`l`.`loan_status` AS `estatus_prestamo`,(select count(distinct cast(`ldFaltante`.`created_on` as date)) from `APC_LOAN_DETAIL` `ldFaltante` where ((`ldFaltante`.`id_loan` = `l`.`id`) and (week(cast(`ldFaltante`.`created_on` as date),1) <= week(curdate(),1)) and (year(cast(`ldFaltante`.`created_on` as date)) = year(curdate())) and (lower(dayname(cast(`ldFaltante`.`created_on` as date))) not in ('saturday','sunday')) and (`ldFaltante`.`loan_details_type` in ('PAYMENT','RENOVATION_PAYMENT','TRANSFER','FEE')))) AS `num_pagos_all`,(select if((count(distinct cast(`ldFaltante`.`created_on` as date)) > 5),5,count(distinct cast(`ldFaltante`.`created_on` as date))) from `APC_LOAN_DETAIL` `ldFaltante` where ((`ldFaltante`.`id_loan` = `l`.`id`) and (week(cast(`ldFaltante`.`created_on` as date),1) = week(curdate(),1)) and (year(cast(`ldFaltante`.`created_on` as date)) = year(curdate())) and (lower(dayname(cast(`ldFaltante`.`created_on` as date))) not in ('saturday','sunday')) and (`ldFaltante`.`loan_details_type` in ('PAYMENT','RENOVATION_PAYMENT','TRANSFER','FEE')))) AS `num_pagos_week`,(select if((sum(`ldLunes`.`payment_amount`) is null),0,sum(`ldLunes`.`payment_amount`)) from `APC_LOAN_DETAIL` `ldLunes` where ((`ldLunes`.`id_loan` = `l`.`id`) and (week(cast(`ldLunes`.`created_on` as date),1) <= week(curdate(),1)) and (year(cast(`ldLunes`.`created_on` as date)) = year(curdate())) and (`ldLunes`.`loan_details_type` = 'FEE'))) AS `fee_todos` from (((((((`APC_LOAN` `l` join `APC_LOAN_TYPE` `lt` on((`l`.`id_loan_type` = `lt`.`id`))) join `APC_PEOPLE` `cus` on((`cus`.`id` = `l`.`id_customer`))) join `APC_PEOPLE` `endor` on((`endor`.`id` = `l`.`id_endorsement`))) join `APC_ROUTE` `r` on((`r`.`id` = `l`.`id_route`))) join `APC_LOAN_BY_USER` `lbu` on((`lbu`.`id_loan` = `l`.`id`))) join `APC_USER` `u` on((`u`.`id` = `lbu`.`id_user`))) join `APC_HUMAN_RESOURCE` `hr` on((`hr`.`id` = `u`.`id_human_resource`))) where ((`l`.`loan_status` not in ('DELETED','REJECTED')) and (((select count(`ld`.`id`) from `APC_LOAN_DETAIL` `ld` where ((week(cast(`ld`.`created_on` as date),1) = week(curdate(),1)) and (year(cast(`ld`.`created_on` as date)) = year(curdate())) and (`ld`.`id_loan` = `l`.`id`))) > 0) or (((select count(`ld`.`id`) from `APC_LOAN_DETAIL` `ld` where ((week(cast(`ld`.`created_on` as date),1) = week(curdate(),1)) and (year(cast(`ld`.`created_on` as date)) = year(curdate())) and (`ld`.`id_loan` = `l`.`id`))) = 0) and (`l`.`loan_status` = 'APPROVED') and (week(cast(`l`.`created_on` as date),1) <= week(curdate(),1))))); + diff --git a/ace-db/src/to_execute.sql b/ace-db/src/to_execute.sql new file mode 100644 index 0000000..0888b11 --- /dev/null +++ b/ace-db/src/to_execute.sql @@ -0,0 +1,11 @@ +/* + * Arrebol Consultancy copyright. + * + * This code belongs to Arrebol Consultancy + * its use, redistribution or modification are prohibited + * without written authorization from Arrebol Consultancy. + */ +/** + * Author: Oscar Armando Vargas Cardenas + * Created: 1/03/2021 + */ \ No newline at end of file diff --git a/ace-db/src/to_update.sql b/ace-db/src/to_update.sql new file mode 100644 index 0000000..a463898 --- /dev/null +++ b/ace-db/src/to_update.sql @@ -0,0 +1,44 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +/** + * Author: Oscar + * Created: 26/10/2021 + */ + +ALTER TABLE `apo_pro_com_april_ten`.`apc_loan_employee` +ADD COLUMN `payroll` ENUM('ENEBLED', 'DISABLED') NOT NULL AFTER `total_amount_to_pay`, +ADD COLUMN `active_status` ENUM('ENEBLED', 'DISABLED') NULL AFTER `payroll`; + + +/*Updates de donadony*/ +ALTER TABLE `apo_pro_com_april_ten`.`apc_loan_employee_detail` +ADD COLUMN `payroll` ENUM('ENEBLED', 'DISABLED') NOT NULL DEFAULT 'ENEBLED' AFTER `created_on`; + + +/*Update Base de datos saving view*/ +CREATE + OR REPLACE +VIEW `APC_STATS_EMPLOYEE_SAVING_VIEW` AS + SELECT + `es`.`id` AS `id`, + `es`.`id_user` AS `id_user`, + CONCAT(`hr`.`first_name`, ' ', `hr`.`last_name`) AS `name`, + `hrr`.`route_name` AS `route_name`, + `es`.`employee_saving` AS `employee_saving`, + `es`.`created_on` AS `created_on`, + `es`.`Type` AS `Type` + FROM + ((`APC_EMPLOYEE_SAVING` `es` + JOIN `APC_HUMAN_RESOURCE` `hr` ON ((`es`.`id_user` = `hr`.`id`))) + LEFT JOIN (SELECT + `hrr`.`id_human_resource` AS `id_human_resource`, + GROUP_CONCAT(DISTINCT `r`.`route_name` + SEPARATOR ',') AS `route_name` + FROM + (`APC_HUMAN_RESOURCE_HAS_ROUTE` `hrr` + LEFT JOIN `APC_ROUTE` `r` ON ((`hrr`.`id_route` = `r`.`id`))) + GROUP BY `hrr`.`id_human_resource`) `hrr` ON ((`hr`.`id` = `hrr`.`id_human_resource`))) + diff --git a/ace-layout/nb-configuration.xml b/ace-layout/nb-configuration.xml new file mode 100644 index 0000000..a65c451 --- /dev/null +++ b/ace-layout/nb-configuration.xml @@ -0,0 +1,18 @@ + + + + + + JDK_1.8 + + diff --git a/ace-layout/pom.xml b/ace-layout/pom.xml new file mode 100644 index 0000000..c18ff59 --- /dev/null +++ b/ace-layout/pom.xml @@ -0,0 +1,125 @@ + + + 4.0.0 + com.arrebol + ace-layout + 1.0.0 + jar + + UTF-8 + 1.8 + 1.8 + 2.0.20 + 2.3.14 + 1.3.24 + 5.0.0 + + + + org.primefaces + primefaces + 6.2 + + + + org.glassfish + jakarta.faces + ${mojarra.version} + + + javax.el + javax.el-api + 3.0.0 + provided + + + javax.servlet + javax.servlet-api + 3.1.0 + provided + + + + + org.apache.geronimo.specs + geronimo-atinject_1.0_spec + 1.0 + + + org.apache.geronimo.specs + geronimo-jcdi_2.0_spec + 1.1 + + + org.apache.geronimo.specs + geronimo-interceptor_1.2_spec + 1.0 + + + org.apache.geronimo.specs + geronimo-annotation_1.3_spec + 1.0 + + + + + org.apache.openwebbeans + openwebbeans-impl + ${owb.version} + + + org.apache.openwebbeans + openwebbeans-web + ${owb.version} + + + org.apache.openwebbeans + openwebbeans-jsf + ${owb.version} + + + + + org.apache.poi + poi + ${poi.version} + + + org.apache.poi + poi-ooxml + ${poi.version} + + + org.apache.xmlgraphics + batik-all + + + de.rototor.pdfbox + graphics2d + + + org.apache.santuario + xmlsec + + + org.bouncycastle + bcpkix-jdk15on + + + com.github.virtuald + curvesapi + + + org.bouncycastle + bcprov-jdk15on + + + + + com.github.librepdf + openpdf + ${open-pdf.version} + + + ace-layout + \ No newline at end of file diff --git a/ace-layout/src/main/java/org/primefaces/serenity/component/SerenityMenu.java b/ace-layout/src/main/java/org/primefaces/serenity/component/SerenityMenu.java new file mode 100644 index 0000000..8b8f2b3 --- /dev/null +++ b/ace-layout/src/main/java/org/primefaces/serenity/component/SerenityMenu.java @@ -0,0 +1,130 @@ +package org.primefaces.serenity.component; + +import javax.faces.component.UIComponent; +import org.primefaces.component.menu.AbstractMenu; +import javax.faces.context.FacesContext; +import javax.faces.component.UINamingContainer; +import javax.faces.component.UIOutput; +import javax.faces.component.UIViewRoot; +import javax.faces.event.AbortProcessingException; +import javax.faces.event.ComponentSystemEvent; +import javax.faces.event.ComponentSystemEventListener; +import javax.faces.event.ListenerFor; +import javax.faces.event.PostAddToViewEvent; +import org.primefaces.component.api.Widget; + +@ListenerFor(sourceClass = SerenityMenu.class, systemEventClass = PostAddToViewEvent.class) +public class SerenityMenu extends AbstractMenu implements Widget,ComponentSystemEventListener { + + public static final String COMPONENT_TYPE = "org.primefaces.component.SerenityMenu"; + public static final String COMPONENT_FAMILY = "org.primefaces.component"; + private static final String DEFAULT_RENDERER = "org.primefaces.component.SerenityMenuRenderer"; + private static final String[] LEGACY_RESOURCES = new String[]{"primefaces.css","jquery/jquery.js","jquery/jquery-plugins.js","primefaces.js"}; + private static final String[] MODERN_RESOURCES = new String[]{"components.css","jquery/jquery.js","jquery/jquery-plugins.js","core.js"}; + + protected enum PropertyKeys { + + widgetVar, model, style, styleClass, closeDelay; + + String toString; + + PropertyKeys(String toString) { + this.toString = toString; + } + + PropertyKeys() { + } + + public String toString() { + return ((this.toString != null) ? this.toString : super.toString()); + } + } + + public SerenityMenu() { + setRendererType(DEFAULT_RENDERER); + } + + public String getFamily() { + return COMPONENT_FAMILY; + } + + public java.lang.String getWidgetVar() { + return (java.lang.String) getStateHelper().eval(PropertyKeys.widgetVar, null); + } + + public void setWidgetVar(java.lang.String _widgetVar) { + getStateHelper().put(PropertyKeys.widgetVar, _widgetVar); + } + + public org.primefaces.model.menu.MenuModel getModel() { + return (org.primefaces.model.menu.MenuModel) getStateHelper().eval(PropertyKeys.model, null); + } + + public void setModel(org.primefaces.model.menu.MenuModel _model) { + getStateHelper().put(PropertyKeys.model, _model); + } + + public java.lang.String getStyle() { + return (java.lang.String) getStateHelper().eval(PropertyKeys.style, null); + } + + public void setStyle(java.lang.String _style) { + getStateHelper().put(PropertyKeys.style, _style); + } + + public java.lang.String getStyleClass() { + return (java.lang.String) getStateHelper().eval(PropertyKeys.styleClass, null); + } + + public void setStyleClass(java.lang.String _styleClass) { + getStateHelper().put(PropertyKeys.styleClass, _styleClass); + } + + public int getCloseDelay() { + return (java.lang.Integer) getStateHelper().eval(PropertyKeys.closeDelay, 250); + } + public void setCloseDelay(int _closeDelay) { + getStateHelper().put(PropertyKeys.closeDelay, _closeDelay); + } + + public String resolveWidgetVar() { + FacesContext context = getFacesContext(); + String userWidgetVar = (String) getAttributes().get("widgetVar"); + + if (userWidgetVar != null) { + return userWidgetVar; + } else { + return "widget_" + getClientId(context).replaceAll("-|" + UINamingContainer.getSeparatorChar(context), "_"); + } + } + + @Override + public void processEvent(ComponentSystemEvent event) throws AbortProcessingException { + if(event instanceof PostAddToViewEvent) { + FacesContext context = getFacesContext(); + UIViewRoot root = context.getViewRoot(); + + boolean isPrimeConfig; + try { + isPrimeConfig = Class.forName("org.primefaces.config.PrimeConfiguration") != null; + } catch (ClassNotFoundException e) { + isPrimeConfig = false; + } + + String[] resources = (isPrimeConfig) ? MODERN_RESOURCES : LEGACY_RESOURCES; + + for(String res : resources) { + UIComponent component = context.getApplication().createComponent(UIOutput.COMPONENT_TYPE); + if(res.endsWith("css")) + component.setRendererType("javax.faces.resource.Stylesheet"); + else if(res.endsWith("js")) + component.setRendererType("javax.faces.resource.Script"); + + component.getAttributes().put("library", "primefaces"); + component.getAttributes().put("name", res); + + root.addComponentResource(context, component); + } + } + } +} diff --git a/ace-layout/src/main/java/org/primefaces/serenity/component/SerenityMenuRenderer.java b/ace-layout/src/main/java/org/primefaces/serenity/component/SerenityMenuRenderer.java new file mode 100644 index 0000000..50fa595 --- /dev/null +++ b/ace-layout/src/main/java/org/primefaces/serenity/component/SerenityMenuRenderer.java @@ -0,0 +1,295 @@ +package org.primefaces.serenity.component; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import javax.faces.FacesException; +import javax.faces.component.UIComponent; +import javax.faces.context.FacesContext; +import javax.faces.context.ResponseWriter; +import org.primefaces.component.api.AjaxSource; +import org.primefaces.component.api.UIOutcomeTarget; +import org.primefaces.component.menu.AbstractMenu; +import org.primefaces.component.menu.BaseMenuRenderer; +import org.primefaces.component.menuitem.UIMenuItem; +import org.primefaces.component.submenu.UISubmenu; +import org.primefaces.model.menu.MenuElement; +import org.primefaces.model.menu.MenuItem; +import org.primefaces.model.menu.Separator; +import org.primefaces.model.menu.Submenu; +import org.primefaces.util.ComponentUtils; +import org.primefaces.util.WidgetBuilder; + +public class SerenityMenuRenderer extends BaseMenuRenderer { + + @Override + protected void encodeMarkup(FacesContext context, AbstractMenu abstractMenu) throws IOException { + SerenityMenu menu = (SerenityMenu) abstractMenu; + ResponseWriter writer = context.getResponseWriter(); + String style = menu.getStyle(); + String styleClass = menu.getStyleClass(); + String defaultStyleClass = "layout-menu"; + styleClass = styleClass == null ? defaultStyleClass : defaultStyleClass + " " + styleClass; + + writer.startElement("ul", menu); + writer.writeAttribute("id", menu.getClientId(context), "id"); + writer.writeAttribute("class", styleClass, "styleClass"); + + if(style != null) { + writer.writeAttribute("style", style, "style"); + } + + if(menu.getElementsCount() > 0) { + encodeElements(context, menu, menu.getElements()); + } + + writer.endElement("ul"); + } + + protected void encodeElements(FacesContext context, AbstractMenu menu, List elements) throws IOException { + int size = elements.size(); + + for (int i = 0; i < size; i++) { + encodeElement(context, menu, elements.get(i)); + } + } + + protected void encodeElement(FacesContext context, AbstractMenu menu, MenuElement element) throws IOException { + ResponseWriter writer = context.getResponseWriter(); + + if(element.isRendered()) { + if(element instanceof MenuItem) { + MenuItem menuItem = (MenuItem) element; + String menuItemClientId = (menuItem instanceof UIComponent) ? menuItem.getClientId() : menu.getClientId(context) + "_" + menuItem.getClientId(); + String containerStyle = menuItem.getContainerStyle(); + String containerStyleClass = menuItem.getContainerStyleClass(); + + writer.startElement("li", null); + writer.writeAttribute("id", menuItemClientId, null); + writer.writeAttribute("role", "menuitem", null); + + if(containerStyle != null) writer.writeAttribute("style", containerStyle, null); + if(containerStyleClass != null) writer.writeAttribute("class", containerStyleClass, null); + + encodeMenuItem(context, menu, menuItem); + + writer.endElement("li"); + } + else if(element instanceof Submenu) { + Submenu submenu = (Submenu) element; + String submenuClientId = (submenu instanceof UIComponent) ? ((UIComponent) submenu).getClientId() : menu.getClientId(context) + "_" + submenu.getId(); + String style = submenu.getStyle(); + String styleClass = submenu.getStyleClass(); + + writer.startElement("li", null); + writer.writeAttribute("id", submenuClientId, null); + writer.writeAttribute("role", "menuitem", null); + + if(style != null) writer.writeAttribute("style", style, null); + if(styleClass != null) writer.writeAttribute("class", styleClass, null); + + encodeSubmenu(context, menu, submenu); + + writer.endElement("li"); + } + else if(element instanceof Separator) { + encodeSeparator(context, (Separator) element); + } + } + } + + protected void encodeSubmenu(FacesContext context, AbstractMenu menu, Submenu submenu) throws IOException{ + ResponseWriter writer = context.getResponseWriter(); + String icon = submenu.getIcon(); + String label = submenu.getLabel(); + int childrenElementsCount = submenu.getElementsCount(); + + writer.startElement("a", null); + writer.writeAttribute("href", "#", null); + writer.writeAttribute("class", "ripplelink", null); + + encodeItemIcon(context, icon); + + if(label != null) { + writer.startElement("span", null); + writer.writeAttribute("class", "menuitem-text", null); + writer.writeText(label, null); + writer.endElement("span"); + + encodeToggleIcon(context, submenu, childrenElementsCount); + + if(submenu instanceof UISubmenu) { + encodeBadge(context, ((UISubmenu) submenu).getAttributes().get("badge")); + } + } + + writer.endElement("a"); + + //submenus and menuitems + if(childrenElementsCount > 0) { + writer.startElement("ul", null); + writer.writeAttribute("role", "menu", null); + encodeElements(context, menu, submenu.getElements()); + writer.endElement("ul"); + } + } + + protected void encodeItemIcon(FacesContext context, String icon) throws IOException { + if(icon != null) { + ResponseWriter writer = context.getResponseWriter(); + + writer.startElement("i", null); + if(icon.contains("fa fa-") || icon.contains("ui-icon ui-icon-")) { + writer.writeAttribute("class", icon, null); + } + else { + writer.writeAttribute("class", "material-icons", null); + writer.writeText(icon, null); + } + + writer.endElement("i"); + } + } + + protected void encodeToggleIcon(FacesContext context, Submenu submenu, int childrenElementsCount) throws IOException { + if(childrenElementsCount > 0) { + ResponseWriter writer = context.getResponseWriter(); + + writer.startElement("i", null); + writer.writeAttribute("class", "material-icons layout-submenu-toggler", null); + writer.write(""); + writer.endElement("i"); + } + } + + protected void encodeBadge(FacesContext context, Object value) throws IOException { + if(value != null) { + ResponseWriter writer = context.getResponseWriter(); + + writer.startElement("span", null); + writer.writeAttribute("class", "menuitem-badge", null); + writer.writeText(value.toString(), null); + writer.endElement("span"); + } + } + + @Override + protected void encodeSeparator(FacesContext context, Separator separator) throws IOException { + ResponseWriter writer = context.getResponseWriter(); + String style = separator.getStyle(); + String styleClass = separator.getStyleClass(); + styleClass = styleClass == null ? "Separator" : "Separator " + styleClass; + + //title + writer.startElement("li", null); + writer.writeAttribute("class", styleClass, null); + if(style != null) { + writer.writeAttribute("style", style, null); + } + + writer.endElement("li"); + } + + @Override + protected void encodeMenuItem(FacesContext context, AbstractMenu menu, MenuItem menuitem) throws IOException { + ResponseWriter writer = context.getResponseWriter(); + String title = menuitem.getTitle(); + boolean disabled = menuitem.isDisabled(); + Object value = menuitem.getValue(); + String style = menuitem.getStyle(); + String styleClass = menuitem.getStyleClass(); + String defaultStyleClass = "ripplelink"; + styleClass = styleClass == null ? defaultStyleClass : defaultStyleClass + " " + styleClass; + + writer.startElement("a", null); + writer.writeAttribute("class", styleClass, null); + if(title != null) writer.writeAttribute("title", title, null); + if(style != null) writer.writeAttribute("style", style, null); + + if(disabled) { + writer.writeAttribute("href", "#", null); + writer.writeAttribute("onclick", "return false;", null); + } + else { + String onclick = menuitem.getOnclick(); + + //GET + if(menuitem.getUrl() != null || menuitem.getOutcome() != null) { + String targetURL = getTargetURL(context, (UIOutcomeTarget) menuitem); + writer.writeAttribute("href", targetURL, null); + + if(menuitem.getTarget() != null) { + writer.writeAttribute("target", menuitem.getTarget(), null); + } + } + //POST + else { + writer.writeAttribute("href", "#", null); + + UIComponent form = ComponentUtils.findParentForm(context, menu); + if(form == null) { + throw new FacesException("MenuItem must be inside a form element"); + } + + String command; + if(menuitem.isDynamic()) { + String menuClientId = menu.getClientId(context); + Map> params = menuitem.getParams(); + if(params == null) { + params = new LinkedHashMap>(); + } + List idParams = new ArrayList(); + idParams.add(menuitem.getId()); + params.put(menuClientId + "_menuid", idParams); + + command = menuitem.isAjax() ? buildAjaxRequest(context, menu, (AjaxSource) menuitem, form, params) : buildNonAjaxRequest(context, menu, form, menuClientId, params, true); + } + else { + command = menuitem.isAjax() ? buildAjaxRequest(context, (AjaxSource) menuitem, form) : buildNonAjaxRequest(context, ((UIComponent) menuitem), form, ((UIComponent) menuitem).getClientId(context), true); + } + + onclick = (onclick == null) ? command : onclick + ";" + command; + } + + if(onclick != null) { + writer.writeAttribute("onclick", onclick, null); + } + } + + encodeMenuItemContent(context, menu, menuitem); + + writer.endElement("a"); + } + + @Override + protected void encodeMenuItemContent(FacesContext context, AbstractMenu menu, MenuItem menuitem) throws IOException { + ResponseWriter writer = context.getResponseWriter(); + String icon = menuitem.getIcon(); + Object value = menuitem.getValue(); + + if(menuitem instanceof UIMenuItem) { + encodeBadge(context, ((UIMenuItem) menuitem).getAttributes().get("badge")); + } + encodeItemIcon(context, icon); + + if(value != null) { + writer.startElement("span", null); + writer.writeAttribute("class", "menuitem-text", null); + writer.writeText(value, "value"); + writer.endElement("span"); + } + } + + @Override + protected void encodeScript(FacesContext context, AbstractMenu abstractMenu) throws IOException { + SerenityMenu menu = (SerenityMenu) abstractMenu; + String clientId = menu.getClientId(context); + WidgetBuilder wb = getWidgetBuilder(context); + wb.init("Serenity", menu.resolveWidgetVar(), clientId) + .attr("closeDelay", menu.getCloseDelay()) + .finish(); + } + +} diff --git a/ace-layout/src/main/java/org/primefaces/serenity/filter/CharacterEncodingFilter.java b/ace-layout/src/main/java/org/primefaces/serenity/filter/CharacterEncodingFilter.java new file mode 100644 index 0000000..0cb3611 --- /dev/null +++ b/ace-layout/src/main/java/org/primefaces/serenity/filter/CharacterEncodingFilter.java @@ -0,0 +1,44 @@ +/* + * Copyright 2009-2014 PrimeTek. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.primefaces.serenity.filter; + +import java.io.IOException; + +import javax.servlet.Filter; +import javax.servlet.FilterChain; +import javax.servlet.FilterConfig; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; + +public class CharacterEncodingFilter implements Filter { + + public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException { + req.setCharacterEncoding("UTF-8"); + resp.setCharacterEncoding("UTF-8"); + chain.doFilter(req, resp); + } + + public void init(FilterConfig filterConfig) throws ServletException { + + } + + public void destroy() { + + } + + +} diff --git a/ace-layout/src/main/java/org/primefaces/serenity/view/GuestPreferences.java b/ace-layout/src/main/java/org/primefaces/serenity/view/GuestPreferences.java new file mode 100644 index 0000000..e1245d4 --- /dev/null +++ b/ace-layout/src/main/java/org/primefaces/serenity/view/GuestPreferences.java @@ -0,0 +1,77 @@ +/* + * Copyright 2009-2014 PrimeTek. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.primefaces.serenity.view; + +import java.io.Serializable; +import javax.faces.bean.ManagedBean; +import javax.faces.bean.SessionScoped; + +@ManagedBean +@SessionScoped +public class GuestPreferences implements Serializable { + + private static final long serialVersionUID = 7356208868875521211L; + + private String layout = "lightblue"; + + private String theme = "bluegrey"; + + private boolean darkMenu; + + private boolean horizontal = false; + + private boolean orientationRTL; + + public String getTheme() { + return theme; + } + + public void setTheme(String theme) { + this.theme = theme; + } + + public String getLayout() { + return layout; + } + + public void setLayout(String layout) { + this.layout = layout; + } + + public boolean isDarkMenu() { + return darkMenu; + } + + public void setDarkMenu(boolean darkMenu) { + this.darkMenu = darkMenu; + } + + public boolean isOrientationRTL() { + return orientationRTL; + } + + public void setOrientationRTL(boolean orientationRTL) { + this.orientationRTL = orientationRTL; + } + + public boolean isHorizontal() { + return this.horizontal; + } + + public void setHorizontal(boolean value) { + this.horizontal = value; + } +} diff --git a/ace-model/nb-configuration.xml b/ace-model/nb-configuration.xml new file mode 100644 index 0000000..a65c451 --- /dev/null +++ b/ace-model/nb-configuration.xml @@ -0,0 +1,18 @@ + + + + + + JDK_1.8 + + diff --git a/ace-model/pom.xml b/ace-model/pom.xml new file mode 100644 index 0000000..c4e09fd --- /dev/null +++ b/ace-model/pom.xml @@ -0,0 +1,183 @@ + + + 4.0.0 + com.arrebol + ace-model + 1.0.0 + jar + + UTF-8 + 1.8 + 1.8 + + + + + org.hibernate + hibernate-agroal + 5.4.14.Final + pom + + + org.hibernate + hibernate-c3p0 + 5.6.7.Final + + + c3p0 + c3p0 + 0.9.1.2 + + + + + AWS-EC2 + + jdbc:mysql://localhost:3306/apo_pro_com_april_ten?serverTimezone=UTC + root + Saladeespera2_ + 10 + 40 + 1800 + 300 + + + + + src/main/resources + true + + + + + + Localhost + + jdbc:mysql://localhost:3306/apo_pro_com_april_ten?serverTimezone=GMT-5 + apoprocomlocalhost + Yj$2Da0z! + 10 + 40 + 1800 + 300 + + + + + src/main/resources + true + + + + + + Localhost-Mobile-APP + + jdbc:mysql://localhost:3306/apo_pro_com_april_ten?serverTimezone=GMT-5 + apoprocommobilelocalhost + 0Ps$6%q8 + 10 + 40 + 1800 + 300 + + + + + src/main/resources + true + + + + + + Amazon-Web-Services + + jdbc:mysql://3.143.107.236:3306/apo_pro_com_april_ten?serverTimezone=GMT-6 + ace_remoto + Saladeespera2_ + 10 + 20 + 1800 + 300 + true + false + + + + + src/main/resources + true + + + + + + Amazon-Web-Services-Test + + jdbc:mysql://apc.clwlkknfqkjh.us-east-2.rds.amazonaws.com:3306/apo_pro_com_april_ten?serverTimezone=GMT-6 + apoprocom + Yj$2Da0z! + 10 + 20 + 1800 + 300 + + + + + src/main/resources + true + + + + + + Amazon-Web-Services-Mobile-APP + + jdbc:mysql://ace.civi8tosgaol.us-east-2.rds.amazonaws.com:3306/apo_pro_com_april_ten + apoprocommobile + 0Ps$6%q8 + 10 + 30 + 2000 + 1000 + + + + + src/main/resources + true + + + + + + Amazon-Web-Services-Mobile-APP-Test + + jdbc:mysql://apc.clwlkknfqkjh.us-east-2.rds.amazonaws.com:3306/apo_pro_com_april_ten?serverTimezone=GMT-6 + apoprocommobile + 0Ps$6%q8 + 10 + 30 + 2000 + 1000 + + + + + src/main/resources + true + + + + + + ace-model + \ No newline at end of file diff --git a/ace-model/src/main/java/com/arrebol/apc/model/DateFormatModel.java b/ace-model/src/main/java/com/arrebol/apc/model/DateFormatModel.java new file mode 100644 index 0000000..0fe4805 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/DateFormatModel.java @@ -0,0 +1,24 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.model; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Locale; + +/** + * + * @author Oscar + */ +public class DateFormatModel { + + public String getDateFormat(Date date){ + Locale espanol = new Locale("es","MX"); + SimpleDateFormat format = new SimpleDateFormat("dd - MMMMM - yyyy",espanol); + String stringDate = format.format(date); + return stringDate; + } +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/ModelParameter.java b/ace-model/src/main/java/com/arrebol/apc/model/ModelParameter.java new file mode 100644 index 0000000..7b5cfbe --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/ModelParameter.java @@ -0,0 +1,43 @@ +/* + * 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; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class ModelParameter { + + private String parameter; + private Object value; + + public ModelParameter() { + } + + public ModelParameter(String parameter, Object value) { + this.parameter = parameter; + this.value = value; + } + + public String getParameter() { + return parameter; + } + + public void setParameter(String parameter) { + this.parameter = parameter; + } + + public Object getValue() { + return value; + } + + public void setValue(Object value) { + this.value = value; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/admin/Advance.java b/ace-model/src/main/java/com/arrebol/apc/model/admin/Advance.java new file mode 100644 index 0000000..48821ae --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/admin/Advance.java @@ -0,0 +1,222 @@ +/* + * 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.admin; + +import com.arrebol.apc.model.core.HumanResource; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.enums.ActiveStatus; +import java.io.Serializable; +import java.math.BigDecimal; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Table(name = "APC_ADVANCE") +public class Advance implements Serializable { + + private static final long serialVersionUID = -4380548310735493011L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_human_resource", + referencedColumnName = "id", + nullable = false + ) + private HumanResource humanResource; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_office", + referencedColumnName = "id", + nullable = false + ) + private Office office; + + @Column(name = "amount", nullable = false) + private BigDecimal amount; + + @Enumerated(EnumType.STRING) + @Column(name = "active_status", nullable = false) + private ActiveStatus activeStatus; + + @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; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "created_by", + referencedColumnName = "id", + insertable = false, + updatable = false, + nullable = false + ) + private User user; + + public Advance() { + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public HumanResource getHumanResource() { + return humanResource; + } + + public void setHumanResource(HumanResource humanResource) { + this.humanResource = humanResource; + } + + public Office getOffice() { + return office; + } + + public void setOffice(Office office) { + this.office = office; + } + + public BigDecimal getAmount() { + return amount; + } + + public void setAmount(BigDecimal amount) { + this.amount = amount; + } + + public ActiveStatus getActiveStatus() { + return activeStatus; + } + + public void setActiveStatus(ActiveStatus activeStatus) { + this.activeStatus = activeStatus; + } + + 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 boolean getActive() { + if (activeStatus == ActiveStatus.ENEBLED) { + return true; + } else { + return false; + } + + } + + public boolean getAction(Date lastStableGeneralBox) { + Date date = createdOn; + boolean action = true; + try { + SimpleDateFormat dt1 = new SimpleDateFormat("yyyy-MM-dd"); + + String dateStr = dt1.format(date); + date = dt1.parse(dateStr); + + action = date.after(lastStableGeneralBox); + + } catch (ParseException ex) { + Logger.getLogger(ExpenseCompany.class.getName()).log(Level.SEVERE, null, ex); + } + return action; + } + + public String conditionEnabled() { + if (activeStatus == ActiveStatus.DISABLED) { + return "grayRow"; + } else { + return null; + } + } + + @Override + public String toString() { + return "Advance{" + "active_status=" + activeStatus + ", createdOn=" + createdOn + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/admin/Bonus.java b/ace-model/src/main/java/com/arrebol/apc/model/admin/Bonus.java new file mode 100644 index 0000000..54f1d36 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/admin/Bonus.java @@ -0,0 +1,209 @@ +/* + * 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.admin; + +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.enums.ActiveStatus; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Table(name = "APC_BONUS") +public class Bonus implements Serializable { + + private static final long serialVersionUID = 3584728331941248013L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @Column(name = "name", nullable = false, length = 100) + private String name; + + @Column(name = "loan_bonus", nullable = false) + private BigDecimal loanBonus; + + @Column(name = "mora_bonus", nullable = false) + private BigDecimal moraBonus; + + @Column(name = "new_customer_bonus", nullable = false) + private BigDecimal newCustomerBonus; + + @Enumerated(EnumType.STRING) + @Column(name = "administrative", nullable = false) + private ActiveStatus administrative; + + @Enumerated(EnumType.STRING) + @Column(name = "active_status", nullable = false) + private ActiveStatus activeStatus; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_office", + referencedColumnName = "id", + nullable = false + ) + private Office office; + + @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; + + public Bonus() { + } + + /** + * + * @param id + */ + public Bonus(String id) { + this.id = id; + } + + /** + * + * @param id + * @param name + */ + public Bonus(String id, String name) { + this.id = id; + this.name = name; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public BigDecimal getLoanBonus() { + return loanBonus; + } + + public void setLoanBonus(BigDecimal loanBonus) { + this.loanBonus = loanBonus; + } + + public BigDecimal getMoraBonus() { + return moraBonus; + } + + public void setMoraBonus(BigDecimal moraBonus) { + this.moraBonus = moraBonus; + } + + public BigDecimal getNewCustomerBonus() { + return newCustomerBonus; + } + + public void setNewCustomerBonus(BigDecimal newCustomerBonus) { + this.newCustomerBonus = newCustomerBonus; + } + + public ActiveStatus getAdministrative() { + return administrative; + } + + public void setAdministrative(ActiveStatus administrative) { + this.administrative = administrative; + } + + public ActiveStatus getActiveStatus() { + return activeStatus; + } + + public void setActiveStatus(ActiveStatus activeStatus) { + this.activeStatus = activeStatus; + } + + public Office getOffice() { + return office; + } + + public void setOffice(Office office) { + this.office = office; + } + + 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; + } + + @Override + public String toString() { + return "Bonus{" + "name=" + name + ", createdOn=" + createdOn + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/admin/ClosingDay.java b/ace-model/src/main/java/com/arrebol/apc/model/admin/ClosingDay.java new file mode 100644 index 0000000..13de1a1 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/admin/ClosingDay.java @@ -0,0 +1,256 @@ +/* + * 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.admin; + +import com.arrebol.apc.model.catalog.RouteCtlg; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.core.UserByOffice; +import com.arrebol.apc.model.enums.ActiveStatus; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Entity +@Table(name = "APC_CLOSING_DAY") +public class ClosingDay implements Serializable{ + + private static final long serialVersionUID = 347958707624227979L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_user", + referencedColumnName = "id", + nullable = false + ) + private User user; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_office", + referencedColumnName = "id", + nullable = false + ) + private Office office; + + @Column(name = "amount_paid", nullable = false) + private BigDecimal amountPaid; + + @Column(name = "amount_expected", nullable = false) + private BigDecimal amountExpected; + + @Column(name = "comments", length = 250) + private String comments; + + @Enumerated(EnumType.STRING) + @Column(name = "active_status", nullable = false) + private ActiveStatus activeStatus; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "created_by", + referencedColumnName = "id", + nullable = false + ) + private UserByOffice createdBy; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_route", + referencedColumnName = "id", + nullable = true + ) + private RouteCtlg routeCtlg; + + @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; + + public ClosingDay() { + } + + public ClosingDay(String id) { + this.id = id; + } + + public ClosingDay(String id, User user, Office office, BigDecimal amountPaid, BigDecimal amountExpected, ActiveStatus activeStatus, String comments, UserByOffice createdBy, Date createdOn) { + this.id = id; + this.user = user; + this.office = office; + this.amountPaid = amountPaid; + this.amountExpected = amountExpected; + this.activeStatus = activeStatus; + this.createdBy = createdBy; + this.createdOn = createdOn; + this.comments = comments; + } + + public ClosingDay(String id, User user, Office office, BigDecimal amountPaid, BigDecimal amountExpected, String comments, ActiveStatus activeStatus, UserByOffice createdBy) { + this.id = id; + this.user = user; + this.office = office; + this.amountPaid = amountPaid; + this.amountExpected = amountExpected; + this.activeStatus = activeStatus; + this.createdBy = createdBy; + this.createdOn = new Date(); + this.comments = comments; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } + + public Office getOffice() { + return office; + } + + public void setOffice(Office office) { + this.office = office; + } + + public BigDecimal getAmountPaid() { + return amountPaid; + } + + public void setAmountPaid(BigDecimal amountPaid) { + this.amountPaid = amountPaid; + } + + public BigDecimal getAmountExpected() { + return amountExpected; + } + + public void setAmountExpected(BigDecimal amountExpected) { + this.amountExpected = amountExpected; + } + + public BigDecimal getDiferencia(){ + BigDecimal diferencia = amountPaid.subtract(amountExpected); + + return diferencia; + } + + public ActiveStatus getActiveStatus() { + return activeStatus; + } + + public void setActiveStatus(ActiveStatus activeStatus) { + this.activeStatus = activeStatus; + } + + public UserByOffice getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(UserByOffice 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 String getComments() { + return comments; + } + + public void setComments(String comments) { + this.comments = comments; + } + + public RouteCtlg getRouteCtlg() { + return routeCtlg; + } + + public void setRouteCtlg(RouteCtlg routeCtlg) { + this.routeCtlg = routeCtlg; + } + + public String conditionEnabled() { + if(getActiveStatus() == ActiveStatus.DISABLED) + return "grayRow"; + else + return null; + } + + public boolean conditionEnabledBool() { + if (getActiveStatus() == ActiveStatus.DISABLED) { + return false; + } else { + return true; + } + } + + public boolean getActive() { + return activeStatus == ActiveStatus.ENEBLED; + + } +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/admin/ClosingDayDetail.java b/ace-model/src/main/java/com/arrebol/apc/model/admin/ClosingDayDetail.java new file mode 100644 index 0000000..788094d --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/admin/ClosingDayDetail.java @@ -0,0 +1,154 @@ +/* + * 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.admin; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Entity +@Table(name = "APC_CLOSING_DAY_DETAIL") +public class ClosingDayDetail implements Serializable{ + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_closing_day", + referencedColumnName = "id", + nullable = false + ) + private ClosingDay closingDay; + + @Column(name = "comments", length = 250) + private String comments; + + @Column(name = "amount", nullable = false) + private BigDecimal amount; + + @Column(name = "type", length = 250) + private String type; + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "dateDetail", length = 19) + private Date dateDetail; + + @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; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ClosingDay getClosingDay() { + return closingDay; + } + + public void setClosingDay(ClosingDay closingDay) { + this.closingDay = closingDay; + } + + 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 Date getDateDetail() { + return dateDetail; + } + + public void setDateDetail(Date dateDetail) { + this.dateDetail = dateDetail; + } + + 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; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/admin/EmployeeSaving.java b/ace-model/src/main/java/com/arrebol/apc/model/admin/EmployeeSaving.java new file mode 100644 index 0000000..29902e8 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/admin/EmployeeSaving.java @@ -0,0 +1,102 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.model.admin; + +import com.arrebol.apc.model.enums.EmployeeSavingType; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author Administrador + */ +@Entity +@Table(name = "APC_EMPLOYEE_SAVING") +public class EmployeeSaving implements Serializable { + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @Column(name = "id_user", length = 36) + private String idUser; + + @Column(name = "employee_saving", nullable = false) + private BigDecimal employeeSaving; + + @Column(name = "created_by", length = 36) + private String createdBy; + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "created_on", length = 19) + private Date createdOn; + + @Enumerated(EnumType.STRING) + @Column(name = "type", nullable = false) + private EmployeeSavingType type; + + public EmployeeSavingType getType() { + return type; + } + + public void setType(EmployeeSavingType type) { + this.type = type; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getIdUser() { + return idUser; + } + + public void setIdUser(String idUser) { + this.idUser = idUser; + } + + public BigDecimal getEmployeeSaving() { + return employeeSaving; + } + + public void setEmployeeSaving(BigDecimal paymentAmount) { + this.employeeSaving = paymentAmount; + } + + 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; + } +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/admin/ExpenseCompany.java b/ace-model/src/main/java/com/arrebol/apc/model/admin/ExpenseCompany.java new file mode 100644 index 0000000..007a4f6 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/admin/ExpenseCompany.java @@ -0,0 +1,242 @@ +/* + * 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.admin; + +import com.arrebol.apc.model.DateFormatModel; +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.enums.ExpenseCompanyType; +import java.io.Serializable; +import java.math.BigDecimal; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Table(name = "APC_EXPENSE_COMPANY") +public class ExpenseCompany extends DateFormatModel implements Serializable { + + private static final long serialVersionUID = 7927698024624765461L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_office", + referencedColumnName = "id", + nullable = false + ) + private Office office; + + @Column(name = "amount", nullable = false) + private BigDecimal amount; + + @Column(name = "description", length = 200) + private String description; + + @Enumerated(EnumType.STRING) + @Column(name = "expense_company_type", nullable = false) + private ExpenseCompanyType expenseCompanyType; + + @Enumerated(EnumType.STRING) + @Column(name = "active_status", nullable = false) + private ActiveStatus activeStatus; + + @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; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "created_by", + referencedColumnName = "id", + insertable = false, + updatable = false, + nullable = false + ) + private User user; + + public ExpenseCompany() { + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Office getOffice() { + return office; + } + + public void setOffice(Office office) { + this.office = office; + } + + public BigDecimal getAmount() { + return amount; + } + + public void setAmount(BigDecimal amount) { + this.amount = amount; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public ExpenseCompanyType getExpenseCompanyType() { + return expenseCompanyType; + } + + public void setExpenseCompanyType(ExpenseCompanyType expenseCompanyType) { + this.expenseCompanyType = expenseCompanyType; + } + + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public Date getCreatedOn() { + return createdOn; + } + + public boolean getAction(Date lastStableGeneralBox) { + Date date = createdOn; + boolean action = true; + try { + SimpleDateFormat dt1 = new SimpleDateFormat("yyyy-MM-dd"); + + String dateStr = dt1.format(date); + date = dt1.parse(dateStr); + Logger.getLogger(ExpenseCompany.class.getName()).log(Level.INFO, "@@@@@@@@@@@@@@@@@@@@@ CreatedOn - " + createdOn); + Logger.getLogger(ExpenseCompany.class.getName()).log(Level.INFO, "@@@@@@@@@@@@@@@@@@@@@ date - " + date); + Logger.getLogger(ExpenseCompany.class.getName()).log(Level.INFO, "@@@@@@@@@@@@@@@@@@@@@ lastStableGeneralBox - " + lastStableGeneralBox); + + + action = date.after(lastStableGeneralBox); + + Logger.getLogger(ExpenseCompany.class.getName()).log(Level.INFO, "@@@@@@@@@@@@@@@@@@@@@ Action - " + action); + + } catch (ParseException ex) { + Logger.getLogger(ExpenseCompany.class.getName()).log(Level.SEVERE, null, ex); + } + return action; + } + + 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 ActiveStatus getActiveStatus() { + return activeStatus; + } + + public void setActiveStatus(ActiveStatus activeStatus) { + this.activeStatus = activeStatus; + } + + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } + + public String getUserName() { + String lNombre = user.getHumanResource().getFirstName() + " " + user.getHumanResource().getSecondName() + " " + user.getHumanResource().getLastName(); + return lNombre; + } + + public String conditionEnabled() { + if(getActiveStatus() == ActiveStatus.DISABLED) + return "grayRow"; + else + return null; + } + + public boolean getActive() { + if (activeStatus == ActiveStatus.ENEBLED) { + return true; + } else { + return false; + } + + } + + public Date getLastStableGB(Date lastStableGeneralBox) { + return lastStableGeneralBox; + } + + @Override + public String toString() { + return "ExpenseCompany{" + "description=" + description + ", createdBy=" + createdBy + ", createdOn=" + createdOn + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/admin/Goal.java b/ace-model/src/main/java/com/arrebol/apc/model/admin/Goal.java new file mode 100644 index 0000000..5200627 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/admin/Goal.java @@ -0,0 +1,170 @@ +/* + * 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.admin; + +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.enums.ActiveStatus; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Table(name = "APC_GOAL") +public class Goal implements Serializable { + + private static final long serialVersionUID = 2775085143559471536L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @Temporal(TemporalType.DATE) + @Column(name = "start_date") + private Date startDate; + + @Temporal(TemporalType.DATE) + @Column(name = "end_date") + private Date endDate; + + @Column(name = "amount", nullable = false) + private BigDecimal amount; + + @Enumerated(EnumType.STRING) + @Column(name = "active_status", nullable = false) + private ActiveStatus activeStatus; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_office", + referencedColumnName = "id", + nullable = false + ) + private Office office; + + @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; + + public Goal() { + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Date getStartDate() { + return startDate; + } + + public void setStartDate(Date startDate) { + this.startDate = startDate; + } + + public Date getEndDate() { + return endDate; + } + + public void setEndDate(Date endDate) { + this.endDate = endDate; + } + + public BigDecimal getAmount() { + return amount; + } + + public void setAmount(BigDecimal amount) { + this.amount = amount; + } + + public ActiveStatus getActiveStatus() { + return activeStatus; + } + + public void setActiveStatus(ActiveStatus activeStatus) { + this.activeStatus = activeStatus; + } + + public Office getOffice() { + return office; + } + + public void setOffice(Office office) { + this.office = office; + } + + 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; + } + + @Override + public String toString() { + return "Goal{" + "active_status=" + activeStatus + ", office=" + office + ", createdOn=" + createdOn + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/admin/LoanEmployee.java b/ace-model/src/main/java/com/arrebol/apc/model/admin/LoanEmployee.java new file mode 100644 index 0000000..5f3f970 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/admin/LoanEmployee.java @@ -0,0 +1,159 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.model.admin; + +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.enums.LoanStatus; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author Administrador + */ +@Entity +@Table(name = "APC_LOAN_EMPLOYEE") +public class LoanEmployee implements Serializable { + private static final long serialVersionUID = 2775085143559471537L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @Column(name = "id_employee", length = 36) + private String idEmployee; + + @Column(name = "amount_loan", nullable = false) + private BigDecimal amountLoan; + + @Column(name = "balance", nullable = false) + private BigDecimal balance; + + @Column(name = "amount_to_pay", nullable = false) + private BigDecimal amountToPay; + + @Column(name = "total_amount_to_pay", nullable = false) + private BigDecimal totalAmountToPay; + + @Enumerated(EnumType.STRING) + @Column(name = "loan_employee_status", nullable = false) + private ActiveStatus loanEmployeeStatus; + + @Column(name = "created_by", 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; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getIdEmployee() { + return idEmployee; + } + + public void setIdEmployee(String idEmployee) { + this.idEmployee = idEmployee; + } + + public BigDecimal getAmountLoan() { + return amountLoan; + } + + public void setAmountLoan(BigDecimal amountLoan) { + this.amountLoan = amountLoan; + } + + public BigDecimal getBalance() { + return balance; + } + + public void setBalance(BigDecimal balance) { + this.balance = balance; + } + + public BigDecimal getAmountToPay() { + return amountToPay; + } + + public void setAmountToPay(BigDecimal amountToPay) { + this.amountToPay = amountToPay; + } + + public ActiveStatus getLoanEmployeeStatus() { + return loanEmployeeStatus; + } + + public void setLoanEmployeeStatus(ActiveStatus loanEmployeeStatus) { + this.loanEmployeeStatus = loanEmployeeStatus; + } + + 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 BigDecimal getTotalAmountToPay() { + return totalAmountToPay; + } + + public void setTotalAmountToPay(BigDecimal totalAmountToPay) { + this.totalAmountToPay = totalAmountToPay; + } +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/admin/LoanEmployeeDetails.java b/ace-model/src/main/java/com/arrebol/apc/model/admin/LoanEmployeeDetails.java new file mode 100644 index 0000000..66da165 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/admin/LoanEmployeeDetails.java @@ -0,0 +1,137 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.model.admin; + +import com.arrebol.apc.model.enums.ActiveStatus; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author Administrador + */ +@Entity +@Table(name = "APC_LOAN_EMPLOYEE_DETAIL") +public class LoanEmployeeDetails implements Serializable { + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @Column(name = "id_loan", length = 36) + private String idLoan; + + @Column(name = "id_user", length = 36) + private String idUser; + + @Column(name = "payment_amount", nullable = false) + private BigDecimal paymentAmount; + + @Column(name = "reference_number", nullable = false) + private int referenceNumber; + + @Enumerated(EnumType.STRING) + @Column(name = "loan_employee_detail_status", nullable = false) + private ActiveStatus loanEmployeeDetailStatus; + + @Column(name = "created_by", length = 36) + private String createdBy; + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "created_on", length = 19) + private Date createdOn; + + @Enumerated(EnumType.STRING) + @Column(name = "payroll", nullable = false) + private ActiveStatus payroll; + + public ActiveStatus getPayroll() { + return payroll; + } + + public void setPayroll(ActiveStatus payroll) { + this.payroll = payroll; + } + + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getIdLoan() { + return idLoan; + } + + public void setIdLoan(String idLoan) { + this.idLoan = idLoan; + } + + public String getIdUser() { + return idUser; + } + + public void setIdUser(String idUser) { + this.idUser = idUser; + } + + public BigDecimal getPaymentAmount() { + return paymentAmount; + } + + public void setPaymentAmount(BigDecimal paymentAmount) { + this.paymentAmount = paymentAmount; + } + + public int getReferenceNumber() { + return referenceNumber; + } + + public void setReferenceNumber(int referenceNumber) { + this.referenceNumber = referenceNumber; + } + + public ActiveStatus getLoanEmployeeDetailStatus() { + return loanEmployeeDetailStatus; + } + + public void setLoanEmployeeDetailStatus(ActiveStatus loanEmployeeDetailStatus) { + this.loanEmployeeDetailStatus = loanEmployeeDetailStatus; + } + + 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; + } +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/admin/MoneyDaily.java b/ace-model/src/main/java/com/arrebol/apc/model/admin/MoneyDaily.java new file mode 100644 index 0000000..c426651 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/admin/MoneyDaily.java @@ -0,0 +1,164 @@ +/* + * 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.admin; + +import com.arrebol.apc.model.DateFormatModel; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.User; +import java.io.Serializable; +import java.math.BigDecimal; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Locale; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Table(name = "APC_MONEY_DAILY") +public class MoneyDaily extends DateFormatModel implements Serializable { + + private static final long serialVersionUID = 4622672186001211722L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "money_daily_date", length = 19) + private Date moneyDailyDate; + + @Column(name = "amount", nullable = false) + private BigDecimal amount; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_user", + referencedColumnName = "id", + nullable = false + ) + private User user; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_office", + referencedColumnName = "id", + nullable = false + ) + private Office office; + + @Column(name = "created_by", nullable = false, length = 36) + private String createdBy; + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "created_on", length = 19) + private Date createdOn; + + public MoneyDaily() { + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Date getMoneyDailyDate() { + return moneyDailyDate; + } + + public void setMoneyDailyDate(Date moneyDailyDate) { + this.moneyDailyDate = moneyDailyDate; + } + + public BigDecimal getAmount() { + return amount; + } + + public void setAmount(BigDecimal amount) { + this.amount = amount; + } + + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } + + public Office getOffice() { + return office; + } + + public void setOffice(Office office) { + this.office = office; + } + + 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 boolean getAction(Date lastStableGeneralBox) { + Date date = createdOn; + boolean action = true; + try { + SimpleDateFormat dt1 = new SimpleDateFormat("yyyy-MM-dd"); + + String dateStr = dt1.format(date); + date = dt1.parse(dateStr); + + action = date.after(lastStableGeneralBox); + + } catch (ParseException ex) { + Logger.getLogger(ExpenseCompany.class.getName()).log(Level.SEVERE, null, ex); + } + return action; + } + + @Override + public String toString() { + return "MoneyDaily{" + "moneyDailyDate=" + moneyDailyDate + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/admin/OtherExpense.java b/ace-model/src/main/java/com/arrebol/apc/model/admin/OtherExpense.java new file mode 100644 index 0000000..3698e7e --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/admin/OtherExpense.java @@ -0,0 +1,256 @@ +/* + * 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.admin; + +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.User; +import java.io.Serializable; +import java.math.BigDecimal; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import java.util.Optional; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.stream.Collectors; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Table(name = "APC_OTHER_EXPENSE") +@Entity +public class OtherExpense implements Serializable { + + private static final long serialVersionUID = 6233701552847217683L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn( + name = "id_user", + referencedColumnName = "id", + nullable = false + ) + private User user; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_office", + referencedColumnName = "id", + nullable = false + ) + private Office office; + + @Column(name = "expense", nullable = false) + private BigDecimal expense; + + @Column(name = "description", length = 200, nullable = false) + private String description; + + @Column(name = "created_by", nullable = false, length = 36) + private String createdBy; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn( + name = "created_by", + referencedColumnName = "id", + nullable = false, + insertable = false, + updatable = false + + ) + private User userCreatedBy; + + @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; + + public OtherExpense() { + } + + /** + * + * @param officeId + * @param userId + * @param expense + * @param description + */ + public OtherExpense(String officeId, String userId, BigDecimal expense, String description) { + this.office = new Office(officeId); + this.user = new User(userId); + this.expense = expense; + this.description = description; + this.createdBy = userId; + this.createdOn = new Date(); + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } + + public Office getOffice() { + return office; + } + + public void setOffice(Office office) { + this.office = office; + } + + public BigDecimal getExpense() { + return expense; + } + + public void setExpense(BigDecimal expense) { + this.expense = expense; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + 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 String getUserRoutes() { + String routes = ""; + routes = user.getHumanResource().getHumanResourceHasRoutes().stream().map((py) -> py.getRouteCtlg().getRoute()).collect(Collectors.joining(", ")); + + return routes; + } + + public User getUserCreatedBy() { + return userCreatedBy; + } + + public void setUserCreatedBy(User userCreatedBy) { + this.userCreatedBy = userCreatedBy; + } + + public String getCreatedByName() { + String name = getUserCreatedBy().getHumanResource().getFirstName() + " " + getUserCreatedBy().getHumanResource().getLastName(); + + return name; + } + + public boolean getAction(Date lastStableSmallBox, List closingDayToday) { + Date date = createdOn; + String closingDayUser = null; + boolean action = true; + try { + SimpleDateFormat dt1 = new SimpleDateFormat("yyyy-MM-dd"); + + String dateStr = dt1.format(date); + date = dt1.parse(dateStr); + + action = date.after(lastStableSmallBox); + + // Busca el corte del dĆ­a de este usuario + if (closingDayToday != null) { + Optional optUser = closingDayToday.stream().filter(p -> p.getUser().getId().equalsIgnoreCase(user.getId()) + && p.getCreatedOn().equals(createdOn)).findFirst(); + closingDayUser = optUser.isPresent() ? optUser.get().getId(): null; + + String dateStrCD; + Date dateCD; + for(ClosingDay dato : closingDayToday){ + dateStrCD = dt1.format(dato.getCreatedOn()); + dateCD = dt1.parse(dateStrCD); + + if(dato.getUser().getId().equalsIgnoreCase(getUser().getId()) && dateCD.equals(date)){ + closingDayUser = dato.getUser().getId(); + } + } + } + + if(action){ + if(closingDayUser != null){ + action = false; + } + } + + } catch (ParseException ex) { + Logger.getLogger(ExpenseCompany.class.getName()).log(Level.SEVERE, null, ex); + } + return action; + } + + @Override + public String toString() { + return "OtherExpense{" + "description=" + description + ", createdOn=" + createdOn + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/admin/StableGeneralBox.java b/ace-model/src/main/java/com/arrebol/apc/model/admin/StableGeneralBox.java new file mode 100644 index 0000000..51ba7cc --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/admin/StableGeneralBox.java @@ -0,0 +1,241 @@ +/* + * 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.admin; + +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.enums.ActiveStatus; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Table(name = "APC_STABLE_GENERAL_BOX") +public class StableGeneralBox implements Serializable { + + private static final long serialVersionUID = -3501956555560463690L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @Column(name = "total_general_box", nullable = false) + private BigDecimal totalGeneralBox; + + @Column(name = "total_envelope", nullable = false) + private BigDecimal totalEnvelope; + + @Column(name = "total_bank_note", nullable = false) + private BigDecimal totalBankNote; + + @Column(name = "total_coin", nullable = false) + private BigDecimal totalCoin; + + @Column(name = "total_stable", nullable = false) + private BigDecimal totalStable; + + @Column(name = "description", length = 200) + private String description; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_office", + referencedColumnName = "id", + nullable = false + ) + private Office office; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "created_by", + referencedColumnName = "id", + insertable = false, + updatable = false, + nullable = false + ) + private User user; + + @Enumerated(EnumType.STRING) + @Column(name = "active_status", nullable = false) + private ActiveStatus activeStatus; + + @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; + + public StableGeneralBox() { + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public BigDecimal getTotalGeneralBox() { + return totalGeneralBox; + } + + public void setTotalGeneralBox(BigDecimal totalGeneralBox) { + this.totalGeneralBox = totalGeneralBox; + } + + public BigDecimal getTotalEnvelope() { + return totalEnvelope; + } + + public void setTotalEnvelope(BigDecimal totalEnvelope) { + this.totalEnvelope = totalEnvelope; + } + + public BigDecimal getTotalBankNote() { + return totalBankNote; + } + + public void setTotalBankNote(BigDecimal totalBankNote) { + this.totalBankNote = totalBankNote; + } + + public BigDecimal getTotalCoin() { + return totalCoin; + } + + public void setTotalCoin(BigDecimal totalCoin) { + this.totalCoin = totalCoin; + } + + public BigDecimal getTotalStable() { + return totalStable; + } + + public void setTotalStable(BigDecimal totalStable) { + this.totalStable = totalStable; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Office getOffice() { + return office; + } + + public void setOffice(Office office) { + this.office = office; + } + + 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 ActiveStatus getActiveStatus() { + return activeStatus; + } + + public void setActiveStatus(ActiveStatus activeStatus) { + this.activeStatus = activeStatus; + } + + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } + + public String getUserName() { + String lNombre = user.getHumanResource().getFirstName() + " " + user.getHumanResource().getSecondName() + " " + user.getHumanResource().getLastName(); + return lNombre; + } + + public String conditionEnabled() { + if(getActiveStatus() == ActiveStatus.DISABLED) + return "grayRow"; + else + return null; + } + + public boolean getActive() { + if (activeStatus == ActiveStatus.ENEBLED) { + return true; + } else { + return false; + } + + } + + @Override + public String toString() { + return "StableGeneralBox{" + "description=" + description + ", createdBy=" + createdBy + ", createdOn=" + createdOn + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/admin/StableSmallBox.java b/ace-model/src/main/java/com/arrebol/apc/model/admin/StableSmallBox.java new file mode 100644 index 0000000..dba6621 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/admin/StableSmallBox.java @@ -0,0 +1,262 @@ +/* + * 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.admin; + +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.enums.ActiveStatus; +import java.io.Serializable; +import java.math.BigDecimal; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Table(name = "APC_STABLE_SMALL_BOX") +public class StableSmallBox implements Serializable { + + private static final long serialVersionUID = -3501956555560463690L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @Column(name = "total_small_box", nullable = false) + private BigDecimal totalSmallBox; + + @Column(name = "total_envelope", nullable = false) + private BigDecimal totalEnvelope; + + @Column(name = "total_bank_note", nullable = false) + private BigDecimal totalBankNote; + + @Column(name = "total_coin", nullable = false) + private BigDecimal totalCoin; + + @Column(name = "total_stable", nullable = false) + private BigDecimal totalStable; + + @Column(name = "description", length = 200) + private String description; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_office", + referencedColumnName = "id", + nullable = false + ) + private Office office; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "created_by", + referencedColumnName = "id", + insertable = false, + updatable = false, + nullable = false + ) + private User user; + + @Enumerated(EnumType.STRING) + @Column(name = "active_status", nullable = false) + private ActiveStatus activeStatus; + + @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; + + public StableSmallBox() { + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public BigDecimal getTotalSmallBox() { + return totalSmallBox; + } + + public void setTotalSmallBox(BigDecimal totalSmallBox) { + this.totalSmallBox = totalSmallBox; + } + + public BigDecimal getTotalEnvelope() { + return totalEnvelope; + } + + public void setTotalEnvelope(BigDecimal totalEnvelope) { + this.totalEnvelope = totalEnvelope; + } + + public BigDecimal getTotalBankNote() { + return totalBankNote; + } + + public void setTotalBankNote(BigDecimal totalBankNote) { + this.totalBankNote = totalBankNote; + } + + public BigDecimal getTotalCoin() { + return totalCoin; + } + + public void setTotalCoin(BigDecimal totalCoin) { + this.totalCoin = totalCoin; + } + + public BigDecimal getTotalStable() { + return totalStable; + } + + public void setTotalStable(BigDecimal totalStable) { + this.totalStable = totalStable; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Office getOffice() { + return office; + } + + public void setOffice(Office office) { + this.office = office; + } + + 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 ActiveStatus getActiveStatus() { + return activeStatus; + } + + public void setActiveStatus(ActiveStatus activeStatus) { + this.activeStatus = activeStatus; + } + + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } + + public String getUserName (){ + String lNombre = user.getHumanResource().getFirstName() +" "+ user.getHumanResource().getSecondName() +" "+ user.getHumanResource().getLastName(); + return lNombre; + } + + public String conditionEnabled() { + if(getActiveStatus() == ActiveStatus.DISABLED) + return "grayRow"; + else + return null; + } + + public boolean getActive() { + if (activeStatus == ActiveStatus.ENEBLED) { + return true; + } else { + return false; + } + + } + + public boolean getAction(Date lastStableGeneralBox) { + Date date = createdOn; + boolean action = true; + try { + SimpleDateFormat dt1 = new SimpleDateFormat("yyyy-MM-dd"); + + String dateStr = dt1.format(date); + date = dt1.parse(dateStr); + + action = date.after(lastStableGeneralBox); + + } catch (ParseException ex) { + Logger.getLogger(ExpenseCompany.class.getName()).log(Level.SEVERE, null, ex); + } + return action; + } + + @Override + public String toString() { + return "StableSmallBox{" + "description=" + description + ", createdBy=" + createdBy + ", createdOn=" + createdOn + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/admin/Transfer.java b/ace-model/src/main/java/com/arrebol/apc/model/admin/Transfer.java new file mode 100644 index 0000000..4df0815 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/admin/Transfer.java @@ -0,0 +1,297 @@ +/* + * 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.admin; + +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.enums.ActionStatus; +import com.arrebol.apc.model.enums.ActiveStatus; +import java.io.Serializable; +import java.math.BigDecimal; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.stream.Collectors; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Entity +@Table(name = "APC_TRANSFER") +public class Transfer implements Serializable { + + private static final long serialVersionUID = -1304758262604329766L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_user_transmitter", + referencedColumnName = "id", + nullable = false + ) + private User userTransmitter; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_user_receiver", + referencedColumnName = "id", + nullable = false + ) + private User userReceiver; + + @Enumerated(EnumType.STRING) + @Column(name = "active_status", nullable = false) + private ActiveStatus activeStatus; + + @Enumerated(EnumType.STRING) + @Column(name = "action_status", nullable = false) + private ActionStatus actionStatus; + + @Column(name = "amount_to_transfer", nullable = false) + private BigDecimal amountToTransfer; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_office", + referencedColumnName = "id", + nullable = false + ) + private Office office; + + @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; + + public Transfer() { + + } + + /** + * + * @param userTransmitter + * @param userReceiver + * @param activeStatus + * @param actionStatus + * @param amountToTransfer + * @param office + * @param createdBy + */ + public Transfer(User userTransmitter, User userReceiver, ActiveStatus activeStatus, ActionStatus actionStatus, BigDecimal amountToTransfer, Office office, String createdBy) { + this.userTransmitter = userTransmitter; + this.userReceiver = userReceiver; + this.activeStatus = activeStatus; + this.actionStatus = actionStatus; + this.amountToTransfer = amountToTransfer; + this.office = office; + this.createdBy = createdBy; + this.createdOn = new Date(); + } + + /** + * + * @param id + */ + public Transfer(String id) { + this.id = id; + } + + public Transfer(String id, User userTransmitter, User userReceiver, ActiveStatus activeStatus, ActionStatus actionStatus, BigDecimal amountToTransfer, Office office, String createdBy) { + this.id = id; + this.userTransmitter = userTransmitter; + this.userReceiver = userReceiver; + this.activeStatus = activeStatus; + this.actionStatus = actionStatus; + this.amountToTransfer = amountToTransfer; + this.office = office; + this.createdBy = createdBy; + this.createdOn = new Date(); + } + + public Transfer(String id, User userTransmitter, User userReceiver, ActiveStatus activeStatus, ActionStatus actionStatus, BigDecimal amountToTransfer, Office office, String createdBy, Date createdOn) { + this.id = id; + this.userTransmitter = userTransmitter; + this.userReceiver = userReceiver; + this.activeStatus = activeStatus; + this.actionStatus = actionStatus; + this.amountToTransfer = amountToTransfer; + this.office = office; + this.createdBy = createdBy; + this.createdOn = createdOn; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public User getUserTransmitter() { + return userTransmitter; + } + + public void setUserTransmitter(User userTransmitter) { + this.userTransmitter = userTransmitter; + } + + public User getUserReceiver() { + return userReceiver; + } + + public void setUserReceiver(User userReceiver) { + this.userReceiver = userReceiver; + } + + public ActiveStatus getActiveStatus() { + return activeStatus; + } + + public void setActiveStatus(ActiveStatus activeStatus) { + this.activeStatus = activeStatus; + } + + public ActionStatus getActionStatus() { + return actionStatus; + } + + public void setActionStatus(ActionStatus actionStatus) { + this.actionStatus = actionStatus; + } + + public BigDecimal getAmountToTransfer() { + return amountToTransfer; + } + + public void setAmountToTransfer(BigDecimal amountToTransfer) { + this.amountToTransfer = amountToTransfer; + } + + 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 Office getOffice() { + return office; + } + + public void setOffice(Office office) { + this.office = office; + } + + public String getUserReceiverRoutes(){ + String routes = ""; + routes = userReceiver.getHumanResource().getHumanResourceHasRoutes().stream().map((py) -> py.getRouteCtlg().getRoute()).collect(Collectors.joining(", ")); + + return routes; + } + + public String getUserTransmitterRoutes(){ + String routes = ""; + routes = userTransmitter.getHumanResource().getHumanResourceHasRoutes().stream().map((py) -> py.getRouteCtlg().getRoute()).collect(Collectors.joining(", ")); + + return routes; + } + + public boolean getAction(Date lastStableSmallBox) { + Date date = createdOn; + boolean action = true; + try { + SimpleDateFormat dt1 = new SimpleDateFormat("yyyy-MM-dd"); + + String dateStr = dt1.format(date); + date = dt1.parse(dateStr); + + action = date.after(lastStableSmallBox); + + } catch (Exception ex) { + Logger.getLogger(ExpenseCompany.class.getName()).log(Level.SEVERE, null, ex); + } + return action; + } + + public boolean getActive() { + if (activeStatus == ActiveStatus.ENEBLED) { + return true; + } else { + return false; + } + } + + public String conditionEnabled() { + if(getActiveStatus() == ActiveStatus.DISABLED) + return "grayRow"; + else + return null; + } + + @Override + public String toString() { + return "Transfer{" + "activeStatus=" + activeStatus + ", actionStatus=" + actionStatus + ", createdOn=" + createdOn + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/admin/constance/AdvanceCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/admin/constance/AdvanceCfg.java new file mode 100644 index 0000000..abe6e45 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/admin/constance/AdvanceCfg.java @@ -0,0 +1,24 @@ +/* + * 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.admin.constance; + +import com.arrebol.apc.model.core.constance.GenericCfg; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public interface AdvanceCfg extends GenericCfg { + + String QUERY_FIND_ALL_ADVANCE_BY_OFFICE = "findAllAdvanceByOffice"; + String QUERY_FIND_ALL_ADVANCE_BY_OFFICE_BETWEEN_DATES = "findAllAdvanceByOfficeBetweenDates"; + String QUERY_UPDATE_ADVANCE_BY_STATUS = "updateAdvanceByStatus"; + + String FIELD_OFFICE = "office"; + String FIELD_ACTIVE_STATUS = "activeStatus"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/admin/constance/BitacoraCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/admin/constance/BitacoraCfg.java new file mode 100644 index 0000000..708cd4d --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/admin/constance/BitacoraCfg.java @@ -0,0 +1,22 @@ +/* + * 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.admin.constance; + +import com.arrebol.apc.model.core.constance.GenericCfg; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public interface BitacoraCfg extends GenericCfg { + + String QUERY_FIND_ALL_BITACORA_BY_OFFICE = "findAllBitacoraByOffice"; + String QUERY_FIND_ALL_BITACORA_BY_OFFICE_DATE = "findAllBitacoraByOfficeDate"; + + String FIELD_OFFICE = "office"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/admin/constance/BonusCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/admin/constance/BonusCfg.java new file mode 100644 index 0000000..378510d --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/admin/constance/BonusCfg.java @@ -0,0 +1,25 @@ +/* + * 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.admin.constance; + +import com.arrebol.apc.model.core.constance.GenericCfg; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface BonusCfg extends GenericCfg { + + String QUERY_FIND_ALL_ACTIVE_BONUS = "findAllActiveBonus"; + String QUERY_FIND_ALL_BONUS = "findAllBonus"; + String QUERY_FIND_ALL_BONUS_BETWEEN_DATES = "findAllBonusBetweenDates"; + String QUERY_UPDATE_BONUS_BY_STATUS = "updateBonusByStatus"; + + String FIELD_ACTIVE_STATUS = "activeStatus"; + String FIELD_OFFICE = "office"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/admin/constance/ClosingDayCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/admin/constance/ClosingDayCfg.java new file mode 100644 index 0000000..f3e0181 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/admin/constance/ClosingDayCfg.java @@ -0,0 +1,35 @@ +/* + * 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.admin.constance; + +import com.arrebol.apc.model.core.constance.GenericCfg; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public interface ClosingDayCfg extends GenericCfg { + + String QUERY_FIND_ALL_CLOSING_DAY_BY_OFFICE = "findAllClosingDayByOffice"; + String QUERY_FIND_ALL_CLOSING_DAY_BY_OFFICE_BETWEEN_DATES = "findAllClosingDayByOfficeBetweenCreatedOn"; + String QUERY_UPDATE_CLOSING_DAY_BY_STATUS = "updateClosingDayByStatus"; + String QUERY_FIND_TOTAL_BY_USER = "findAllTotalCashByCurdateByUserId"; + String QUERY_FIND_TOTAL_BY_OFFICE = "findAllTotalCashByCurdateByOffice"; + String QUERY_FIND_TOTAL_DASHBOARD_BY_OFFICE = "findAllTotalCashByCurdateDashboardByOffice"; + String QUERY_FIND_ALL_CLOSING_DAY_BY_CURDATE = "findAllViewTotalClosingDayByCurdateByOffice"; + String QUERY_COUNT_CLOSING_DATE_BY_USER_AND_OFFICE = "countClosingDateByUserAndOffice"; + String QUERY_SUM_CLOSING_DAY_BY_CURDATE_AND_OFFICE = "findSumClosingDayByCurdate"; + String QUERY_FIND_ID_BY_EMPLOYEE_AND_OFFICE_EQUALS_CURRDATE = "findIdByEmployeeAndOfficeEqualsToCurrdate"; + + String FIELD_USER = "user"; + String FIELD_OFFICE = "office"; + String FIELD_ACTIVE_STATUS = "activeStatus"; + String FIELD_VIEW_OFFICE = "idOffice"; + String FIELD_CREATED_ON = "createdOn"; + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/admin/constance/ClosingDayDetailCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/admin/constance/ClosingDayDetailCfg.java new file mode 100644 index 0000000..1478a55 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/admin/constance/ClosingDayDetailCfg.java @@ -0,0 +1,22 @@ +/* + * 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.admin.constance; + +import com.arrebol.apc.model.core.constance.GenericCfg; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public interface ClosingDayDetailCfg extends GenericCfg{ + + String QUERY_FIND_ALL_CLOSING_DAY_DETAIL_BY_ID = "findAllClosingDayDetailById"; + + String FIELD_CLOSING_DAY = "closingDay"; + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/admin/constance/ExpenseCompanyCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/admin/constance/ExpenseCompanyCfg.java new file mode 100644 index 0000000..8efdaa2 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/admin/constance/ExpenseCompanyCfg.java @@ -0,0 +1,26 @@ +/* + * 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.admin.constance; + +import com.arrebol.apc.model.core.constance.GenericCfg; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface ExpenseCompanyCfg extends GenericCfg { + + String QUERY_FIND_ALL_EXPENSE_COMPANY_BY_OFFICE = "findAllExpenseCompanyByOffice"; + String QUERY_FIND_ALL_EXPENSE_COMPANY_BY_OFFICE_BETWEEN_DATES = "findAllExpenseCompanyByOfficeBetweenDates"; + String QUERY_UPDATE_EXPENSE_COMPANY_BY_STATUS = "updateExpenseCompanyByStatus"; + + String FIELD_OFFICE = "office"; + String FIELD_ACTIVE_STATUS = "activeStatus"; + String FIELD_EXPENSE_COMPANY_TYPE = "expenseCompanyType"; + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/admin/constance/GoalCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/admin/constance/GoalCfg.java new file mode 100644 index 0000000..c19f302 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/admin/constance/GoalCfg.java @@ -0,0 +1,24 @@ +/* + * 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.admin.constance; + +import com.arrebol.apc.model.core.constance.GenericCfg; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public interface GoalCfg extends GenericCfg { + + String QUERY_FIND_ALL_GOALS_BY_OFFICE = "findAllGoalsByOffice"; + String QUERY_FIND_ALL_GOALS_BY_OFFICE_BETWEEN_DATES = "findAllGoalsByOfficeBetweenDates"; + String QUERY_UPDATE_GOAL_BY_STATUS = "updateGoalByStatus"; + + String FIELD_OFFICE = "office"; + String FIELD_ACTIVE_STATUS = "activeStatus"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/admin/constance/MoneyDailyCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/admin/constance/MoneyDailyCfg.java new file mode 100644 index 0000000..dab506d --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/admin/constance/MoneyDailyCfg.java @@ -0,0 +1,25 @@ +/* + * 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.admin.constance; + +import com.arrebol.apc.model.core.constance.GenericCfg; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public interface MoneyDailyCfg extends GenericCfg { + + String QUERY_FIND_ALL_MONEY_DAILY_BY_OFFICE = "findAllMoneyDailyByOffice"; + String QUERY_FIND_ALL_MONEY_DAILY_BY_OFFICE_BETWEEN_DATES = "findAllMoneyDailyByOfficeBetweenDates"; + String QUERY_FIND_ALL_MONEY_DAILY_BY_OFFICE_BETWEEN_DATES_USER = "findAllMoneyDailyByOfficeBetweenDatesUser"; + + String FIELD_OFFICE = "office"; + String FIELD_USER = "user"; + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/admin/constance/OtherExpenseCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/admin/constance/OtherExpenseCfg.java new file mode 100644 index 0000000..d44e5d6 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/admin/constance/OtherExpenseCfg.java @@ -0,0 +1,25 @@ +/* + * 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.admin.constance; + +import com.arrebol.apc.model.core.constance.GenericCfg; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public interface OtherExpenseCfg extends GenericCfg { + + String QUERY_FIND_ALL_OTHER_EXPENSE_BY_OFFICE = "findAllOtherExpensesByOffice"; + String QUERY_FIND_ALL_OTHER_EXPENSE_BY_OFFICE_BETWEEN_DATES = "findAllOtherExpensesByOfficeBetweenDates"; + String QUERY_FIND_ALL_OTHER_EXPENSE_BY_OFFICE_BETWEEN_DATES_USER = "findAllOtherExpensesByOfficeBetweenDatesUser"; + + String FIELD_OFFICE = "office"; + String FIELD_USER = "user"; + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/admin/constance/StableGeneralBoxCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/admin/constance/StableGeneralBoxCfg.java new file mode 100644 index 0000000..db41be2 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/admin/constance/StableGeneralBoxCfg.java @@ -0,0 +1,34 @@ +/* + * 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.admin.constance; + +import com.arrebol.apc.model.core.constance.GenericCfg; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface StableGeneralBoxCfg extends GenericCfg { + + String QUERY_FIND_ALL_STABLE_GENERAL_BOX_BY_OFFICE = "findAllStableGeneralBoxByOffice"; + String QUERY_FIND_ALL_STABLE_GENERAL_BOX_BY_OFFICE_BETWEEN_DATES = "findAllStableGeneralBoxByOfficeBetweenDates"; + String QUERY_UPDATE_STABLE_GENERAL_BOX_BY_STATUS = "updateStableGeneralBoxByStatus"; + String QUERY_COUNT_STABLE_GENERAL_BOX_BY_OFFICE_AND_DATE = "countStableGeneralBoxByOfficeAndDate"; + String QUERY_COUNT_STABLE_GENERAL_BOX_BY_OFFICE_EQUALS_TO_CURRENT_DATE = "countStableGeneralBoxByOfficeEqualsToCurrentDate"; + + String QUERY_MAX_STABLE_GENERAL_BOX_BY_OFFICE = "verifyStableGeneralBoxCreatedByOffice"; + String QUERY_MAX_CLOSING_DAY_BY_OFFICE = "verifyClosingDayCreatedByOffice"; + + String QUERY_SUM_PENDING_CLOSING_BY_OFFICE = "sumAdvancesUserDailyByOffice"; + + String FIELD_OFFICE = "office"; + String FIELD_OFFICE_VIEW = "idOffice"; + String FIELD_ACTIVE_STATUS = "activeStatus"; + String FIELD_CREATEDON = "createdOn"; + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/admin/constance/StableSmallBoxCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/admin/constance/StableSmallBoxCfg.java new file mode 100644 index 0000000..159217f --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/admin/constance/StableSmallBoxCfg.java @@ -0,0 +1,32 @@ +/* + * 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.admin.constance; + +import com.arrebol.apc.model.core.constance.GenericCfg; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface StableSmallBoxCfg extends GenericCfg { + + String QUERY_FIND_ALL_STABLE_SMALL_BOX_BY_OFFICE = "findAllStableSmallBoxByOffice"; + String QUERY_FIND_ALL_STABLE_SMALL_BOX_BY_OFFICE_BETWEEN_DATES = "findAllStableSmallBoxByOfficeBetweenDates"; + String QUERY_UPDATE_STABLE_SMALL_BOX_BY_STATUS = "updateStableSmallBoxByStatus"; + String QUERY_COUNT_STABLE_SMALL_BOX_BY_OFFICE_AND_DATE = "countStableSmallBoxByOfficeAndDate"; + String QUERY_COUNT_STABLE_SMALL_BOX_BY_OFFICE_EQUALS_TO_CURDATE = "countStableSmallBoxByOfficeEqualsToCurrentDate"; + String QUERY_FIND_STABLE_SMALL_BOX_BY_OFFICE_EQUALS_TO_CURRENT_DATE = "findStableSmallBoxByOfficeEqualsToCurrrentDate"; + + String QUERY_SUM_PENDING_CLOSING_BY_OFFICE = "sumAdvancesUserDailyByOffice"; + + String FIELD_OFFICE = "office"; + String FIELD_OFFICE_VIEW = "idOffice"; + String FIELD_ACTIVE_STATUS = "activeStatus"; + String FIELD_CREATEDON = "createdOn"; + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/admin/constance/TransferCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/admin/constance/TransferCfg.java new file mode 100644 index 0000000..362c39d --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/admin/constance/TransferCfg.java @@ -0,0 +1,31 @@ +/* + * 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.admin.constance; + +import com.arrebol.apc.model.core.constance.GenericCfg; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public interface TransferCfg extends GenericCfg { + + String QUERY_FIND_ALL_TRANFERS_BY_OFFICE = "findAllTransferByOffice"; + String QUERY_FIND_ALL_TRANFERS_BY_OFFICE_BETWEEN_DATES = "findAllTransferByOfficeBetweenDates"; + String QUERY_FIND_ALL_TRANFERS_BY_USER_TRANSMITTER = "findAllTransferByUserTransmitter"; + String QUERY_FIND_ALL_TRANFERS_BY_USER_RECEIVER = "findAllTransferByUserReceiver"; + String QUERY_UPDATE_TRANSFER_BY_ACTION = "updateTransferByAction"; + String QUERY_UPDATE_TRANSFER_BY_ACTIVE_STATUS = "updateTransferByActive"; + String QUERY_FIND_ALL_TRANSFER_BY_USER_ID_AND_CURDATE = "findAllTransferByUserIdAndCurdate"; + + String FIELD_USER_TRANSMITTER = "userTransmitter"; + String FIELD_USER_RECEIVER = "userReceiver"; + String FIELD_OFFICE = "office"; + String FIELD_ACTION_STATUS = "actionStatus"; + String FIELD_ACTIVE_STATUS = "activeStatus"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/catalog/HumanResourceHasRoute.java b/ace-model/src/main/java/com/arrebol/apc/model/catalog/HumanResourceHasRoute.java new file mode 100644 index 0000000..d1ed3ab --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/catalog/HumanResourceHasRoute.java @@ -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.catalog; + +import com.arrebol.apc.model.core.HumanResource; +import java.io.Serializable; +import java.util.Date; +import java.util.Objects; +import javax.persistence.Column; +import javax.persistence.EmbeddedId; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Table(name = "APC_HUMAN_RESOURCE_HAS_ROUTE") +public class HumanResourceHasRoute implements Serializable { + + private static final long serialVersionUID = -8746549036588217517L; + + @EmbeddedId + private HumanResourceHasRouteId id; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn( + name = "id_human_resource", + referencedColumnName = "id", + insertable = false, + updatable = false + ) + private HumanResource humanResource; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn( + name = "id_route", + referencedColumnName = "id", + insertable = false, + updatable = false + ) + private RouteCtlg routeCtlg; + + @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; + + public HumanResourceHasRoute() { + } + + /** + * + * @param id + */ + public HumanResourceHasRoute(HumanResourceHasRouteId id) { + this.id = id; + } + + /** + * + * @param id + * @param createdBy + */ + public HumanResourceHasRoute(HumanResourceHasRouteId id, String createdBy) { + this.id = id; + this.createdBy = createdBy; + createdOn = new Date(); + } + + public HumanResourceHasRouteId getId() { + return id; + } + + public void setId(HumanResourceHasRouteId id) { + this.id = id; + } + + public HumanResource getHumanResource() { + return humanResource; + } + + public void setHumanResource(HumanResource humanResource) { + this.humanResource = humanResource; + } + + public RouteCtlg getRouteCtlg() { + return routeCtlg; + } + + public void setRouteCtlg(RouteCtlg routeCtlg) { + this.routeCtlg = routeCtlg; + } + + 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; + } + + @Override + public int hashCode() { + int hash = 3; + hash = 71 * hash + Objects.hashCode(this.id); + return hash; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final HumanResourceHasRoute other = (HumanResourceHasRoute) obj; + if (!Objects.equals(this.id, other.id)) { + return false; + } + return true; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/catalog/HumanResourceHasRouteId.java b/ace-model/src/main/java/com/arrebol/apc/model/catalog/HumanResourceHasRouteId.java new file mode 100644 index 0000000..9237e89 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/catalog/HumanResourceHasRouteId.java @@ -0,0 +1,88 @@ +/* + * 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.catalog; + +import java.io.Serializable; +import java.util.Objects; +import javax.persistence.Column; +import javax.persistence.Embeddable; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Embeddable +public class HumanResourceHasRouteId implements Serializable { + + private static final long serialVersionUID = -2805382610552215637L; + + @Column(name = "id_human_resource", length = 36, nullable = true) + private String idHumanResource; + + @Column(name = "id_route", length = 36, nullable = true) + private String idRoute; + + public HumanResourceHasRouteId() { + } + + /** + * + * @param idHumanResource + * @param idRoute + */ + public HumanResourceHasRouteId(String idHumanResource, String idRoute) { + this.idHumanResource = idHumanResource; + this.idRoute = idRoute; + } + + public String getIdHumanResource() { + return idHumanResource; + } + + public void setIdHumanResource(String idHumanResource) { + this.idHumanResource = idHumanResource; + } + + public String getIdRoute() { + return idRoute; + } + + public void setIdRoute(String idRoute) { + this.idRoute = idRoute; + } + + @Override + public int hashCode() { + int hash = 5; + hash = 17 * hash + Objects.hashCode(this.idHumanResource); + hash = 17 * hash + Objects.hashCode(this.idRoute); + return hash; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final HumanResourceHasRouteId other = (HumanResourceHasRouteId) obj; + if (!Objects.equals(this.idHumanResource, other.idHumanResource)) { + return false; + } + if (!Objects.equals(this.idRoute, other.idRoute)) { + return false; + } + return true; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/catalog/People.java b/ace-model/src/main/java/com/arrebol/apc/model/catalog/People.java new file mode 100644 index 0000000..a91fb0a --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/catalog/People.java @@ -0,0 +1,437 @@ +/* + * 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.catalog; + +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.enums.CustomerClassification; +import com.arrebol.apc.model.enums.PeopleType; +import com.arrebol.apc.model.loan.Loan; +import com.arrebol.apc.model.ws.parsed.PersonJaxb; +import java.io.Serializable; +import java.util.Date; +import java.util.List; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Table(name = "APC_PEOPLE") +public class People implements Serializable { + + private static final long serialVersionUID = -3628564854853325265L; + + @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 = "thumbnail", length = 250, nullable = false) + private String thumbnail; + + @Column(name = "phone_home", length = 15, nullable = false) + private String phoneHome; + + @Column(name = "address_home", length = 150, nullable = false) + private String addressHome; + + @Column(name = "phone_business", length = 15) + private String phoneBusiness; + + @Column(name = "address_business", length = 150) + private String addressBusiness; + + @Column(name = "company_name", length = 150) + private String companyName; + + @Enumerated(EnumType.STRING) + @Column(name = "people_type", nullable = false) + private PeopleType peopleType; + + @Enumerated(EnumType.STRING) + @Column(name = "active_status", nullable = false) + private ActiveStatus activeStatus; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_office", + referencedColumnName = "id", + nullable = false + ) + private Office office; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_route", + referencedColumnName = "id", + nullable = false + ) + private RouteCtlg routeCtlg; + + @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; + + @Enumerated(EnumType.STRING) + @Column(name = "classification", nullable = false) + private CustomerClassification classification; + + + + @OneToMany( + mappedBy = "customer", + cascade = CascadeType.ALL, + fetch = FetchType.LAZY, + orphanRemoval = true + ) + private List customerLoans; + + @OneToMany( + mappedBy = "endorsement", + cascade = CascadeType.ALL, + fetch = FetchType.LAZY, + orphanRemoval = true + ) + private List endorsementLoans; + + public People() { + } + + /** + * + * @param id + */ + public People(String id) { + this.id = id; + } + + /** + * Complete constructor. + * + * @param id + * @param firstName + * @param secondName + * @param lastName + * @param middleName + * @param birthdate + * @param phoneHome + * @param addressHome + * @param phoneBusiness + * @param addressBusiness + * @param companyName + * @param peopleType + * @param activeStatus + * @param office + * @param routeCtlg + * @param createdBy + * @param createdOn + * @param lastUpdatedBy + * @param lastUpdatedOn + */ + public People(String id, String firstName, String secondName, String lastName, String middleName, Date birthdate, String phoneHome, String addressHome, String phoneBusiness, String addressBusiness, String companyName, PeopleType peopleType, ActiveStatus activeStatus, Office office, RouteCtlg routeCtlg, String createdBy, Date createdOn, String lastUpdatedBy, Date lastUpdatedOn) { + this.id = id; + this.firstName = firstName; + this.secondName = secondName; + this.lastName = lastName; + this.middleName = middleName; + this.birthdate = birthdate; + this.phoneHome = phoneHome; + this.addressHome = addressHome; + this.phoneBusiness = phoneBusiness; + this.addressBusiness = addressBusiness; + this.companyName = companyName; + this.peopleType = peopleType; + this.activeStatus = activeStatus; + this.office = office; + this.routeCtlg = routeCtlg; + this.createdBy = createdBy; + this.createdOn = createdOn; + this.lastUpdatedBy = lastUpdatedBy; + this.lastUpdatedOn = lastUpdatedOn; + } + + /** + * + * @param jaxb + * @param isCustomer + * @param officeId + * @param userId + * @param routeId + */ + public People(PersonJaxb jaxb, boolean isCustomer, String officeId, String userId, String routeId) { + this.firstName = jaxb.getFirstName(); + this.secondName = jaxb.getSecondName(); + this.lastName = jaxb.getLastName(); + this.middleName = jaxb.getMiddleName(); + this.phoneHome = jaxb.getPhoneHome(); + this.addressHome = jaxb.getAddressHome(); + + if (isCustomer) { + this.phoneBusiness = jaxb.getPhoneWork(); + this.addressBusiness = jaxb.getAddressWork(); + this.companyName = jaxb.getCompanyName(); + this.peopleType = PeopleType.CUSTOMER; + } else { + this.peopleType = PeopleType.ENDORSEMENT; + } + + this.activeStatus = ActiveStatus.ENEBLED; + this.office = new Office(officeId); + this.routeCtlg = new RouteCtlg(routeId); + this.thumbnail = jaxb.getThumbnail(); + this.createdBy = userId; + this.createdOn = new Date(); + this.classification = CustomerClassification.WHITE; + + } + + 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 getThumbnail() { + return thumbnail; + } + + public void setThumbnail(String thumbnail) { + this.thumbnail = thumbnail; + } + + public String getPhoneHome() { + return phoneHome; + } + + public void setPhoneHome(String phoneHome) { + this.phoneHome = phoneHome; + } + + public String getAddressHome() { + return addressHome; + } + + public void setAddressHome(String addressHome) { + this.addressHome = addressHome; + } + + public String getPhoneBusiness() { + return phoneBusiness; + } + + public void setPhoneBusiness(String phoneBusiness) { + this.phoneBusiness = phoneBusiness; + } + + public String getAddressBusiness() { + return addressBusiness; + } + + public void setAddressBusiness(String addressBusiness) { + this.addressBusiness = addressBusiness; + } + + public String getCompanyName() { + return companyName; + } + + public void setCompanyName(String companyName) { + this.companyName = companyName; + } + + public PeopleType getPeopleType() { + return peopleType; + } + + public void setPeopleType(PeopleType peopleType) { + this.peopleType = peopleType; + } + + public ActiveStatus getActiveStatus() { + return activeStatus; + } + + public void setActiveStatus(ActiveStatus activeStatus) { + this.activeStatus = activeStatus; + } + + public Office getOffice() { + return office; + } + + public void setOffice(Office office) { + this.office = office; + } + + public RouteCtlg getRouteCtlg() { + return routeCtlg; + } + + public void setRouteCtlg(RouteCtlg routeCtlg) { + this.routeCtlg = routeCtlg; + } + + 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 List getCustomerLoans() { + return customerLoans; + } + + public void setCustomerLoans(List customerLoans) { + this.customerLoans = customerLoans; + } + + public List getEndorsementLoans() { + return endorsementLoans; + } + + public void setEndorsementLoans(List endorsementLoans) { + this.endorsementLoans = endorsementLoans; + } + + public Integer getTotalLoan() { + if (getCustomerLoans()!= null) { + return getCustomerLoans().size(); + } else { + return 0; + } + } + + public CustomerClassification getClassification() { + return classification; + } + + public void setClassification(CustomerClassification classification) { + this.classification = classification; + } + + public String getFullName() + { + String name = ""; + if(secondName == null || secondName.equalsIgnoreCase("null") || secondName.isEmpty()) + return firstName.trim() + " " + lastName.trim() + " " + middleName.trim(); + else + return firstName.trim() + " " + secondName.trim() + " " + lastName.trim() + " " + middleName.trim(); + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/catalog/RoleCtlg.java b/ace-model/src/main/java/com/arrebol/apc/model/catalog/RoleCtlg.java new file mode 100644 index 0000000..99591e8 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/catalog/RoleCtlg.java @@ -0,0 +1,180 @@ +/* + * 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.catalog; + +import com.arrebol.apc.model.core.HumanResource; +import com.arrebol.apc.model.enums.ActiveStatus; +import java.io.Serializable; +import java.util.Date; +import java.util.List; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.UniqueConstraint; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Table(name = "APC_ROLE", + uniqueConstraints = { + @UniqueConstraint(columnNames = {"role_name"}) + } +) +public class RoleCtlg implements Serializable { + + private static final long serialVersionUID = -7005571878079681478L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @Column(name = "role_name", length = 100, nullable = false) + private String role; + + @Enumerated(EnumType.STRING) + @Column(name = "active_status", nullable = false) + private ActiveStatus activeStatus; + + @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; + + @OneToMany( + mappedBy = "roleCtlg", + fetch = FetchType.LAZY, + cascade = CascadeType.ALL, + orphanRemoval = true + ) + private List humanResources; + + public RoleCtlg() { + } + + public RoleCtlg(String id, String role) { + this.id = id; + this.role = role; + } + + public RoleCtlg(String id) { + this.id = id; + } + /** + * Complete constructor. + * + * @param id + * @param role + * @param activeStatus + * @param createdBy + * @param createdOn + * @param lastUpdatedBy + * @param lastUpdatedOn + */ + public RoleCtlg(String id, String role, ActiveStatus activeStatus, String createdBy, Date createdOn, String lastUpdatedBy, Date lastUpdatedOn) { + this.id = id; + this.role = role; + this.activeStatus = activeStatus; + this.createdBy = createdBy; + this.createdOn = createdOn; + this.lastUpdatedBy = lastUpdatedBy; + this.lastUpdatedOn = lastUpdatedOn; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getRole() { + return role; + } + + public void setRole(String role) { + this.role = role; + } + + public ActiveStatus getActiveStatus() { + return activeStatus; + } + + public void setActiveStatus(ActiveStatus activeStatus) { + this.activeStatus = activeStatus; + } + + 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 List getHumanResources() { + return humanResources; + } + + public void setHumanResources(List humanResources) { + this.humanResources = humanResources; + } + + @Override + public String toString() { + return "RoleCtlg{" + "role=" + role + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/catalog/RouteCtlg.java b/ace-model/src/main/java/com/arrebol/apc/model/catalog/RouteCtlg.java new file mode 100644 index 0000000..77392e5 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/catalog/RouteCtlg.java @@ -0,0 +1,262 @@ +/* + * 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.catalog; + +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.gasoline.Gasoline; +import com.arrebol.apc.model.loan.Loan; +import java.io.Serializable; +import java.util.Date; +import java.util.List; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.UniqueConstraint; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Table(name = "APC_ROUTE", + uniqueConstraints = { + @UniqueConstraint(columnNames = {"id_office", "route_name"}, name = "apc_route_uk") + } +) +public class RouteCtlg implements Serializable { + + private static final long serialVersionUID = -903631618997045859L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_office", + referencedColumnName = "id", + nullable = false + ) + private Office office; + + @Column(name = "route_name", length = 25, nullable = false) + private String route; + + @Enumerated(EnumType.STRING) + @Column(name = "active_status", nullable = false) + private ActiveStatus activeStatus; + + @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; + + @OneToMany( + fetch = FetchType.LAZY, + mappedBy = "routeCtlg", + orphanRemoval = true, + cascade = CascadeType.ALL + ) + private List humanResourceHasRoutes; + + @OneToMany( + mappedBy = "office", + cascade = CascadeType.ALL, + fetch = FetchType.LAZY, + orphanRemoval = true + ) + private List peoples; + + @OneToMany( + mappedBy = "routeCtlg", + cascade = CascadeType.ALL, + fetch = FetchType.LAZY, + orphanRemoval = true + ) + private List loans; + + @OneToMany( + fetch = FetchType.LAZY, + mappedBy = "routeCtlg", + orphanRemoval = true, + cascade = CascadeType.ALL + ) + private List gasolines; + + public RouteCtlg() { + } + + /** + * + * @param id + */ + public RouteCtlg(String id) { + this.id = id; + } + + /** + * + * @param id + * @param route + */ + public RouteCtlg(String id, String route) { + this.id = id; + this.route = route; + } + + /** + * Complete constructor. + * + * @param id + * @param office + * @param route + * @param activeStatus + * @param createdBy + * @param createdOn + * @param lastUpdatedBy + * @param lastUpdatedOn + * @param humanResourceHasRoutes + */ + public RouteCtlg(String id, Office office, String route, ActiveStatus activeStatus, String createdBy, Date createdOn, String lastUpdatedBy, Date lastUpdatedOn, List humanResourceHasRoutes) { + this.id = id; + this.office = office; + this.route = route; + this.activeStatus = activeStatus; + this.createdBy = createdBy; + this.createdOn = createdOn; + this.lastUpdatedBy = lastUpdatedBy; + this.lastUpdatedOn = lastUpdatedOn; + this.humanResourceHasRoutes = humanResourceHasRoutes; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Office getOffice() { + return office; + } + + public void setOffice(Office office) { + this.office = office; + } + + public String getRoute() { + return route; + } + + public void setRoute(String route) { + this.route = route; + } + + public ActiveStatus getActiveStatus() { + return activeStatus; + } + + public void setActiveStatus(ActiveStatus activeStatus) { + this.activeStatus = activeStatus; + } + + 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 List getHumanResourceHasRoutes() { + return humanResourceHasRoutes; + } + + public void setHumanResourceHasRoutes(List humanResourceHasRoutes) { + this.humanResourceHasRoutes = humanResourceHasRoutes; + } + + public List getPeoples() { + return peoples; + } + + public void setPeoples(List peoples) { + this.peoples = peoples; + } + + public List getLoans() { + return loans; + } + + public void setLoans(List loans) { + this.loans = loans; + } + + public List getGasolines() { + return gasolines; + } + + public void setGasolines(List gasolines) { + this.gasolines = gasolines; + } + + @Override + public String toString() { + return "RouteCtlg{" + "route=" + route + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/catalog/Vehicle.java b/ace-model/src/main/java/com/arrebol/apc/model/catalog/Vehicle.java new file mode 100644 index 0000000..3fabcf9 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/catalog/Vehicle.java @@ -0,0 +1,323 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.model.catalog; + +import com.arrebol.apc.model.core.HumanResource; +import com.arrebol.apc.model.enums.ActiveStatus; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author David Rodriguez + */ +@Entity +@Table(name = "APC_VEHICLES") +public class Vehicle implements Serializable { + + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @Column(name = "id_driver", length = 36) + private String idDriver; + + @Column(name = "license_plate") + private String licensePlate; + + @Column(name = "economic_number") + private String economicNumber; + + @Column(name = "serial_number") + private String serialNumber; + + @Column(name = "engine_number") + private String engineNumber; + + @Column(name = "mileage") + private BigDecimal mileage; + + @Column(name = "year") + private int year; + + @Column(name = "insurance_name") + private String insuranceName; + + @Column(name = "insurance_number") + private String insuranceNumber; + + @Column(name = "coverage_type") + private String coverageType; + + @Column(name = "colour") + private String colour; + + @Column(name = "model") + private String model; + + @Column(name = "gps") + private boolean gps; + + @Column(name = "gps_number") + private String gpsNumber; + + @Column(name = "comments") + private String comments; + + @Enumerated(EnumType.STRING) + @Column(name = "vehicle_status", nullable = false) + private ActiveStatus vehicleStatus; + + @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; + + @Column(name = "type") + private String type; + + @Column(name = "brand") + private String brand; + + @OneToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_driver", + referencedColumnName = "id", + nullable = false, + insertable = false, + updatable = false + ) + private HumanResource humanResource; + + public HumanResource getHumanResource() { + return humanResource; + } + + public void setHumanResource(HumanResource humanResource) { + this.humanResource = humanResource; + } + + public String getBrand() { + return brand; + } + + public void setBrand(String brand) { + this.brand = brand; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getIdDriver() { + return idDriver; + } + + public void setIdDriver(String idDriver) { + this.idDriver = idDriver; + } + + public String getLicensePlate() { + return licensePlate; + } + + public void setLicensePlate(String licensePlate) { + this.licensePlate = licensePlate; + } + + public String getEconomicNumber() { + return economicNumber; + } + + public void setEconomicNumber(String economicNumber) { + this.economicNumber = economicNumber; + } + + public String getSerialNumber() { + return serialNumber; + } + + public void setSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + } + + public String getEngineNumber() { + return engineNumber; + } + + public void setEngineNumber(String engineNumber) { + this.engineNumber = engineNumber; + } + + public BigDecimal getMileage() { + return mileage; + } + + public void setMileage(BigDecimal mileage) { + this.mileage = mileage; + } + + public int getYear() { + return year; + } + + public void setYear(int year) { + this.year = year; + } + + public String getInsuranceName() { + return insuranceName; + } + + public void setInsuranceName(String insuranceName) { + this.insuranceName = insuranceName; + } + + public String getInsuranceNumber() { + return insuranceNumber; + } + + public void setInsuranceNumber(String insuranceNumber) { + this.insuranceNumber = insuranceNumber; + } + + public String getCoverageType() { + return coverageType; + } + + public void setCoverageType(String coverageType) { + this.coverageType = coverageType; + } + + public String getColour() { + return colour; + } + + public void setColour(String colour) { + this.colour = colour; + } + + public String getModel() { + return model; + } + + public void setModel(String model) { + this.model = model; + } + + public boolean isGps() { + return gps; + } + + public void setGps(boolean gps) { + this.gps = gps; + } + + public String getGpsNumber() { + return gpsNumber; + } + + public void setGpsNumber(String gpsNumber) { + this.gpsNumber = gpsNumber; + } + + public String getComments() { + return comments; + } + + public void setComments(String comments) { + this.comments = comments; + } + + public ActiveStatus getVehicleStatus() { + return vehicleStatus; + } + + public void setVehicleStatus(ActiveStatus vehicleStatus) { + this.vehicleStatus = vehicleStatus; + } + + 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 String getDriver() { + String name = humanResource.getFirstName() + " " + humanResource.getLastName(); + return name; + } + + @Override + public String toString() { + return "VehĆ­cle: "; + } +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/catalog/constance/PeopleCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/catalog/constance/PeopleCfg.java new file mode 100644 index 0000000..4b19d05 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/catalog/constance/PeopleCfg.java @@ -0,0 +1,33 @@ +/* + * 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.catalog.constance; + +import com.arrebol.apc.model.core.constance.GenericCfg; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public interface PeopleCfg extends GenericCfg { + + String UPDATE_PEOPLE_BY_STATUS = "updateByPeopleId"; + String UPDATE_PEOPLE_TYPE_BY_STATUS = "updateTypeByPeopleId"; + String UPDATE_ROUTE_BY_PEOPLE = "updateRouteByPeopleId"; + String UPDATE_PEOPLE_BY_CLASSIFICATION = "updateByPeopleClassification"; + String QUERY_FIND_ALL_CUSTOMER = "findAllCustomerPeople"; + String QUERY_FIND_ALL_ENDORSEMENT = "findAllEndorsementPeople"; + String QUERY_FIND_PEOPLE_BY_ID = "findPeopleById"; + String QUERY_UPDATE_PHONE_HOME_BY_PEOPLE_ID = "updatePhoneHomeByPeopleId"; + + String FIELD_PEOPLE_TYPE = "peopleType"; + String FIELD_ACTIVE_STATUS = "activeStatus"; + String FIELD_OFFICE = "office"; + String FIELD_ROUTE = "routeCtlg"; + String FIELD_CLASSIFICATION = "classification"; + String FIELD_PHONE_HOME = "phoneHome"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/catalog/constance/RoleCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/catalog/constance/RoleCfg.java new file mode 100644 index 0000000..816ea99 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/catalog/constance/RoleCfg.java @@ -0,0 +1,24 @@ +/* + * 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.catalog.constance; + +import com.arrebol.apc.model.core.constance.GenericCfg; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public interface RoleCfg extends GenericCfg { + + String UPDATE_ROLE_BY_STATUS = "updateByRoleId"; + String QUERY_FIND_ALL_ROLES = "findAllRoles"; + + String FIELD_NAME = "role"; + String FIELD_ACTIVE_STATUS = "activeStatus"; + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/catalog/constance/RouteCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/catalog/constance/RouteCfg.java new file mode 100644 index 0000000..f3246e1 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/catalog/constance/RouteCfg.java @@ -0,0 +1,29 @@ +/* + * 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.catalog.constance; + +import com.arrebol.apc.model.core.constance.GenericCfg; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public interface RouteCfg extends GenericCfg { + + String UPDATE_ROUTE_BY_STATUS = "updateByRouteId"; + String QUERY_FIND_ALL_ROUTES = "findAllRoutes"; + String QUERY_FIND_ROUTES_WITH_NO_CERTIFIER_USER = "findRoutesWithNoCertifierUser"; + String QUERY_FIND_ALL_ROUTES_BY_HRHR = "findAllRoutesByHRHR"; + String QUERY_FIND_ALL_NOT_ROUTES_BY_HRHR = "findAllNotRoutesByHRHR"; + String QUERY_FIND_ALL_AVAILABLES_ROUTES = "findAllAvailablesRoutes"; + + String FIELD_NAME = "route"; + String FIELD_ACTIVE_STATUS = "activeStatus"; + String FIELD_OFFICE = "office"; + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/core/HumanResource.java b/ace-model/src/main/java/com/arrebol/apc/model/core/HumanResource.java new file mode 100644 index 0000000..355978e --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/core/HumanResource.java @@ -0,0 +1,428 @@ +/* + * 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.core; + +import com.arrebol.apc.model.admin.Advance; +import com.arrebol.apc.model.admin.Bonus; +import com.arrebol.apc.model.catalog.HumanResourceHasRoute; +import com.arrebol.apc.model.catalog.RoleCtlg; +import com.arrebol.apc.model.enums.HumanResourceStatus; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.OneToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.Transient; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@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 humanResourceByOffices; + + @OneToMany( + fetch = FetchType.LAZY, + mappedBy = "humanResource", + orphanRemoval = true, + cascade = CascadeType.ALL + ) + private List humanResourceHasRoutes; + + @OneToMany( + fetch = FetchType.LAZY, + mappedBy = "humanResource", + orphanRemoval = true, + cascade = CascadeType.ALL + ) + private List 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 getHumanResourceByOffices() { + return humanResourceByOffices; + } + + public void setHumanResourceByOffices(List humanResourceByOffices) { + this.humanResourceByOffices = humanResourceByOffices; + } + + public List getHumanResourceHasRoutes() { + return humanResourceHasRoutes; + } + + public void setHumanResourceHasRoutes(List humanResourceHasRoutes) { + this.humanResourceHasRoutes = humanResourceHasRoutes; + } + + public List getAdvances() { + return advances; + } + + public void setAdvances(List 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 + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/core/HumanResourceByOffice.java b/ace-model/src/main/java/com/arrebol/apc/model/core/HumanResourceByOffice.java new file mode 100644 index 0000000..fbc5c06 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/core/HumanResourceByOffice.java @@ -0,0 +1,179 @@ +/* + * 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.core; + +import com.arrebol.apc.model.enums.ApplicationOwner; +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.UniqueConstraint; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Table(name = "APC_HUMAN_RESOURCE_BY_OFFICE", + uniqueConstraints = { + @UniqueConstraint(columnNames = {"id_human_resource", "id_office"}, name = "apc_human_resource_by_office_uk") + }) +public class HumanResourceByOffice implements Serializable { + + private static final long serialVersionUID = -2892820400055813543L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_human_resource", + referencedColumnName = "id", + nullable = false + ) + private HumanResource humanResource; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_office", + referencedColumnName = "id", + nullable = false + ) + private Office office; + + @Enumerated(EnumType.STRING) + @Column(name = "application_owner", nullable = false) + private ApplicationOwner applicationOwner; + + @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; + + public HumanResourceByOffice() { + } + + /** + * + * @param id + * @param humanResource + * @param office + */ + public HumanResourceByOffice(String id, HumanResource humanResource, Office office) { + this.id = id; + this.humanResource = humanResource; + this.office = office; + } + + /** + * + * @param office + * @param createdBy + * @param createdOn + * @param applicationOwner + */ + public HumanResourceByOffice(Office office, String createdBy, Date createdOn, ApplicationOwner applicationOwner) { + this.office = office; + this.createdBy = createdBy; + this.createdOn = createdOn; + this.applicationOwner = applicationOwner; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public HumanResource getHumanResource() { + return humanResource; + } + + public void setHumanResource(HumanResource humanResource) { + this.humanResource = humanResource; + } + + public Office getOffice() { + return office; + } + + public void setOffice(Office office) { + this.office = office; + } + + public ApplicationOwner getApplicationOwner() { + return applicationOwner; + } + + public void setApplicationOwner(ApplicationOwner applicationOwner) { + this.applicationOwner = applicationOwner; + } + + 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; + } + + @Override + public String toString() { + return "HumanResourceByOffice{" + "humanResource=" + humanResource + ", office=" + office + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/core/Office.java b/ace-model/src/main/java/com/arrebol/apc/model/core/Office.java new file mode 100644 index 0000000..d21fe4a --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/core/Office.java @@ -0,0 +1,421 @@ +/* + * 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.core; + +import com.arrebol.apc.model.admin.Advance; +import com.arrebol.apc.model.admin.Bonus; +import com.arrebol.apc.model.admin.ExpenseCompany; +import com.arrebol.apc.model.admin.Goal; +import com.arrebol.apc.model.admin.MoneyDaily; +import com.arrebol.apc.model.admin.OtherExpense; +import com.arrebol.apc.model.admin.StableGeneralBox; +import com.arrebol.apc.model.admin.Transfer; +import com.arrebol.apc.model.catalog.People; +import com.arrebol.apc.model.catalog.RouteCtlg; +import com.arrebol.apc.model.enums.OfficeStatus; +import com.arrebol.apc.model.gasoline.Gasoline; +import com.arrebol.apc.model.loan.LoanType; +import java.io.Serializable; +import java.util.Date; +import java.util.List; +import java.util.Objects; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.UniqueConstraint; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Table(name = "APC_OFFICE", + uniqueConstraints = { + @UniqueConstraint(columnNames = {"office_name"})} +) +public class Office implements Serializable { + + private static final long serialVersionUID = -141661123746446879L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @Column(name = "office_name", length = 100, nullable = false) + private String officeName; + + @Column(name = "address", length = 250) + private String address; + + @Enumerated(EnumType.STRING) + @Column(name = "office_status", nullable = false) + private OfficeStatus officeStatus; + + @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; + + @OneToMany( + mappedBy = "office", + cascade = CascadeType.ALL, + fetch = FetchType.LAZY, + orphanRemoval = true + ) + private List userByOffices; + + @OneToMany( + mappedBy = "office", + cascade = CascadeType.ALL, + fetch = FetchType.LAZY, + orphanRemoval = true + ) + private List humanResourceByOffices; + + @OneToMany( + mappedBy = "office", + cascade = CascadeType.ALL, + fetch = FetchType.LAZY, + orphanRemoval = true + ) + private List routeCtlgs; + + @OneToMany( + mappedBy = "office", + cascade = CascadeType.ALL, + fetch = FetchType.LAZY, + orphanRemoval = true + ) + private List peoples; + + @OneToMany( + mappedBy = "office", + cascade = CascadeType.ALL, + fetch = FetchType.LAZY, + orphanRemoval = true + ) + private List loanTypes; + + @OneToMany( + mappedBy = "office", + cascade = CascadeType.ALL, + fetch = FetchType.LAZY, + orphanRemoval = true + ) + private List transfers; + + @OneToMany( + mappedBy = "office", + cascade = CascadeType.ALL, + fetch = FetchType.LAZY, + orphanRemoval = true + ) + private List moneyDailys; + + @OneToMany( + mappedBy = "office", + cascade = CascadeType.ALL, + fetch = FetchType.LAZY, + orphanRemoval = true + ) + private List otherExpenses; + + @OneToMany( + mappedBy = "office", + cascade = CascadeType.ALL, + fetch = FetchType.LAZY, + orphanRemoval = true + ) + private List goals; + + @OneToMany( + fetch = FetchType.LAZY, + mappedBy = "office", + orphanRemoval = true, + cascade = CascadeType.ALL + ) + private List advances; + + @OneToMany( + fetch = FetchType.LAZY, + mappedBy = "office", + orphanRemoval = true, + cascade = CascadeType.ALL + ) + private List bonuses; + + @OneToMany( + fetch = FetchType.LAZY, + mappedBy = "office", + orphanRemoval = true, + cascade = CascadeType.ALL + ) + private List expenseCompanies; + + @OneToMany( + fetch = FetchType.LAZY, + mappedBy = "office", + orphanRemoval = true, + cascade = CascadeType.ALL + ) + private List stableGeneralBoxes; + + @OneToMany( + fetch = FetchType.LAZY, + mappedBy = "office", + orphanRemoval = true, + cascade = CascadeType.ALL + ) + private List gasolines; + + public Office() { + } + + /** + * + * @param id + */ + public Office(String id) { + this.id = id; + } + + /** + * + * @param id + * @param officeName + */ + public Office(String id, String officeName) { + this.id = id; + this.officeName = officeName; + } + + public Office(String id, String officeName, String address) { + this.id = id; + this.officeName = officeName; + this.address = address; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getOfficeName() { + return officeName; + } + + public void setOfficeName(String officeName) { + this.officeName = officeName; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public OfficeStatus getOfficeStatus() { + return officeStatus; + } + + public void setOfficeStatus(OfficeStatus officeStatus) { + this.officeStatus = officeStatus; + } + + 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 List getUserByOffices() { + return userByOffices; + } + + public void setUserByOffices(List userByOffices) { + this.userByOffices = userByOffices; + } + + public List getHumanResourceByOffices() { + return humanResourceByOffices; + } + + public void setHumanResourceByOffices(List humanResourceByOffices) { + this.humanResourceByOffices = humanResourceByOffices; + } + + public List getRouteCtlgs() { + return routeCtlgs; + } + + public void setRouteCtlgs(List routeCtlgs) { + this.routeCtlgs = routeCtlgs; + } + + public List getPeoples() { + return peoples; + } + + public void setPeoples(List peoples) { + this.peoples = peoples; + } + + public List getLoanTypes() { + return loanTypes; + } + + public void setLoanTypes(List loanTypes) { + this.loanTypes = loanTypes; + } + + public List getTransfers() { + return transfers; + } + + public void setTransfers(List transfers) { + this.transfers = transfers; + } + + public List getMoneyDailys() { + return moneyDailys; + } + + public void setMoneyDailys(List moneyDailys) { + this.moneyDailys = moneyDailys; + } + + public List getOtherExpenses() { + return otherExpenses; + } + + public void setOtherExpenses(List otherExpenses) { + this.otherExpenses = otherExpenses; + } + + public List getGoals() { + return goals; + } + + public void setGoals(List goals) { + this.goals = goals; + } + + public List getAdvances() { + return advances; + } + + public void setAdvances(List advances) { + this.advances = advances; + } + + public List getBonuses() { + return bonuses; + } + + public void setBonuses(List bonuses) { + this.bonuses = bonuses; + } + + public List getExpenseCompanies() { + return expenseCompanies; + } + + public void setExpenseCompanies(List expenseCompanies) { + this.expenseCompanies = expenseCompanies; + } + + public List getStableGeneralBoxes() { + return stableGeneralBoxes; + } + + public void setStableGeneralBoxes(List stableGeneralBoxes) { + this.stableGeneralBoxes = stableGeneralBoxes; + } + + @Override + public int hashCode() { + int hash = 3; + hash = 97 * hash + Objects.hashCode(this.id); + return hash; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final Office other = (Office) obj; + if (!Objects.equals(this.id, other.id)) { + return false; + } + return true; + } + + @Override + public String toString() { + return "Office{" + "officeName=" + officeName + ", address=" + address + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/core/Permission.java b/ace-model/src/main/java/com/arrebol/apc/model/core/Permission.java new file mode 100644 index 0000000..b981610 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/core/Permission.java @@ -0,0 +1,257 @@ +/* + * 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.core; + +import com.arrebol.apc.model.enums.PermissionStatus; +import com.arrebol.apc.model.enums.PermissionType; +import java.io.Serializable; +import java.util.Date; +import java.util.List; +import java.util.Objects; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.UniqueConstraint; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Table(name = "APC_PERMISSION", + uniqueConstraints = { + @UniqueConstraint(columnNames = {"permission"}) + } +) +public class Permission implements Serializable { + + private static final long serialVersionUID = -4259020491787578065L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @Column(name = "permission", length = 200, nullable = false) + private String permission; + + @Column(name = "description", length = 200, nullable = false) + private String description; + + @Column(name = "menu_path", length = 200, nullable = false) + private String menuPath; + + @Column(name = "left_to_right_order", nullable = false) + private Integer leftToRightOrder; + + @Column(name = "top_to_bottom_order", nullable = false) + private Integer topToBottomOrder; + + @Enumerated(EnumType.STRING) + @Column(name = "permission_type", nullable = false) + private PermissionType permissionType; + + @Column(name = "parent_name", length = 200) + private String parentName; + + @Enumerated(EnumType.STRING) + @Column(name = "permission_status", nullable = false) + private PermissionStatus permissionStatus; + + @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; + + @OneToMany( + fetch = FetchType.LAZY, + mappedBy = "permission", + orphanRemoval = true, + cascade = CascadeType.ALL + ) + private List userByOfficeHasPermissions; + + public Permission() { + } + + /** + * + * @param id + * @param permission + * @param description + * @param menuPath + */ + public Permission(String id, String permission, String description, String menuPath) { + this.id = id; + this.permission = permission; + this.description = description; + this.menuPath = menuPath; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getPermission() { + return permission; + } + + public void setPermission(String permission) { + this.permission = permission; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getMenuPath() { + return menuPath; + } + + public void setMenuPath(String menuPath) { + this.menuPath = menuPath; + } + + public Integer getLeftToRightOrder() { + return leftToRightOrder; + } + + public void setLeftToRightOrder(Integer leftToRightOrder) { + this.leftToRightOrder = leftToRightOrder; + } + + public Integer getTopToBottomOrder() { + return topToBottomOrder; + } + + public void setTopToBottomOrder(Integer topToBottomOrder) { + this.topToBottomOrder = topToBottomOrder; + } + + public PermissionType getPermissionType() { + return permissionType; + } + + public void setPermissionType(PermissionType permissionType) { + this.permissionType = permissionType; + } + + public String getParentName() { + return parentName; + } + + public void setParentName(String parentName) { + this.parentName = parentName; + } + + public PermissionStatus getPermissionStatus() { + return permissionStatus; + } + + public void setPermissionStatus(PermissionStatus permissionStatus) { + this.permissionStatus = permissionStatus; + } + + 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 List getUserByOfficeHasPermissions() { + return userByOfficeHasPermissions; + } + + public void setUserByOfficeHasPermissions(List userByOfficeHasPermissions) { + this.userByOfficeHasPermissions = userByOfficeHasPermissions; + } + + @Override + public int hashCode() { + int hash = 5; + hash = 89 * hash + Objects.hashCode(this.id); + return hash; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final Permission other = (Permission) obj; + if (!Objects.equals(this.id, other.id)) { + return false; + } + return true; + } + + @Override + public String toString() { + return "Permission{" + "description=" + description + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/core/User.java b/ace-model/src/main/java/com/arrebol/apc/model/core/User.java new file mode 100644 index 0000000..64033c2 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/core/User.java @@ -0,0 +1,435 @@ +/* + * 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.core; + +import com.arrebol.apc.model.admin.MoneyDaily; +import com.arrebol.apc.model.admin.OtherExpense; +import com.arrebol.apc.model.admin.Transfer; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.enums.ApplicationOwner; +import com.arrebol.apc.model.enums.UserStatus; +import com.arrebol.apc.model.enums.UserType; +import com.arrebol.apc.model.gasoline.Gasoline; +import com.arrebol.apc.model.loan.Delivery; +import com.arrebol.apc.model.loan.LoanByUser; +import com.arrebol.apc.model.loan.LoanDetails; +import com.arrebol.apc.model.loan.LoanFeeNotification; +import com.arrebol.apc.model.mobile.preference.UserMobilePreference; +import java.io.Serializable; +import java.util.Date; +import java.util.List; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToMany; +import javax.persistence.OneToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Table(name = "APC_USER") +public class User implements Serializable { + + private static final long serialVersionUID = 5293919946950359645L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @OneToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_human_resource", + referencedColumnName = "id", + nullable = false + ) + private HumanResource humanResource; + + @Column(name = "user_name", length = 100, nullable = false) + private String userName; + + @Column(name = "pwd", length = 100, nullable = false) + private String password; + + @Enumerated(EnumType.STRING) + @Column(name = "user_type", nullable = false) + private UserType userType; + + @Enumerated(EnumType.STRING) + @Column(name = "user_status", nullable = false) + private UserStatus userStatus; + + @Enumerated(EnumType.STRING) + @Column(name = "application_owner", nullable = false) + private ApplicationOwner applicationOwner; + + @Enumerated(EnumType.STRING) + @Column(name = "certifier", nullable = false) + private ActiveStatus certifier; + + @Enumerated(EnumType.STRING) + @Column(name = "management", nullable = false) + private ActiveStatus management; + + @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; + + @OneToMany( + mappedBy = "user", + fetch = FetchType.LAZY, + cascade = CascadeType.ALL, + orphanRemoval = true + ) + private List userByOffices; + + @OneToMany( + mappedBy = "user", + fetch = FetchType.LAZY, + cascade = CascadeType.ALL, + orphanRemoval = true + ) + private List userMobilePreferences; + + @OneToMany( + mappedBy = "user", + cascade = CascadeType.ALL, + fetch = FetchType.LAZY, + orphanRemoval = true + ) + private List loanDetailses; + + @OneToMany( + mappedBy = "user", + cascade = CascadeType.ALL, + fetch = FetchType.LAZY, + orphanRemoval = true + ) + private List loanByUsers; + + @OneToMany( + mappedBy = "user", + cascade = CascadeType.ALL, + fetch = FetchType.LAZY, + orphanRemoval = true + ) + private List loanFeeNotifications; + + @OneToMany( + mappedBy = "userTransmitter", + cascade = CascadeType.ALL, + fetch = FetchType.LAZY, + orphanRemoval = true + ) + private List userTransmitters; + + @OneToMany( + mappedBy = "userReceiver", + cascade = CascadeType.ALL, + fetch = FetchType.LAZY, + orphanRemoval = true + ) + private List userReceivers; + + @OneToMany( + mappedBy = "user", + cascade = CascadeType.ALL, + fetch = FetchType.LAZY, + orphanRemoval = true + ) + private List moneyDailys; + + @OneToMany( + mappedBy = "user", + cascade = CascadeType.ALL, + fetch = FetchType.LAZY, + orphanRemoval = true + ) + private List deliverys; + + @OneToMany( + mappedBy = "user", + cascade = CascadeType.ALL, + fetch = FetchType.LAZY, + orphanRemoval = true + ) + private List otherExpenses; + + @OneToMany( + fetch = FetchType.LAZY, + mappedBy = "user", + orphanRemoval = true, + cascade = CascadeType.ALL + ) + private List gasolines; + + public User() { + } + + public User(String id) { + this.id = id; + } + + /** + * + * @param id + * @param userName + */ + public User(String id, String userName) { + this.id = id; + this.userName = userName; + } + + /** + * + * @param id + * @param userName + * @param humanResource + */ + public User(String id, String userName, HumanResource humanResource) { + this.id = id; + this.userName = userName; + this.humanResource = humanResource; + } + + /** + * + * @param id + * @param humanResource + * @param userName + * @param certifier + * @param userType + */ + public User(String id, HumanResource humanResource, String userName, ActiveStatus certifier, UserType userType,ActiveStatus management) { + this.id = id; + this.humanResource = humanResource; + this.userName = userName; + this.certifier = certifier; + this.userType = userType; + this.management = management; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public HumanResource getHumanResource() { + return humanResource; + } + + public void setHumanResource(HumanResource humanResource) { + this.humanResource = humanResource; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public UserType getUserType() { + return userType; + } + + public void setUserType(UserType userType) { + this.userType = userType; + } + + public UserStatus getUserStatus() { + return userStatus; + } + + public void setUserStatus(UserStatus userStatus) { + this.userStatus = userStatus; + } + + public ApplicationOwner getApplicationOwner() { + return applicationOwner; + } + + public void setApplicationOwner(ApplicationOwner applicationOwner) { + this.applicationOwner = applicationOwner; + } + + public ActiveStatus getCertifier() { + return certifier; + } + + public void setCertifier(ActiveStatus certifier) { + this.certifier = certifier; + } + + public ActiveStatus getManagement() { + return management; + } + + public void setManagement(ActiveStatus management) { + this.management = management; + } + + 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 List getUserByOffices() { + return userByOffices; + } + + public void setUserByOffices(List userByOffices) { + this.userByOffices = userByOffices; + } + + public List getUserMobilePreferences() { + return userMobilePreferences; + } + + public void setUserMobilePreferences(List userMobilePreferences) { + this.userMobilePreferences = userMobilePreferences; + } + + public List getLoanDetailses() { + return loanDetailses; + } + + public void setLoanDetailses(List loanDetailses) { + this.loanDetailses = loanDetailses; + } + + public List getLoanByUsers() { + return loanByUsers; + } + + public void setLoanByUsers(List loanByUsers) { + this.loanByUsers = loanByUsers; + } + + public List getLoanFeeNotifications() { + return loanFeeNotifications; + } + + public void setLoanFeeNotifications(List loanFeeNotifications) { + this.loanFeeNotifications = loanFeeNotifications; + } + + public List getUserTransmitters() { + return userTransmitters; + } + + public void setUserTransmitters(List userTransmitters) { + this.userTransmitters = userTransmitters; + } + + public List getUserReceivers() { + return userReceivers; + } + + public void setUserReceivers(List userReceivers) { + this.userReceivers = userReceivers; + } + + public List getMoneyDailys() { + return moneyDailys; + } + + public void setMoneyDailys(List moneyDailys) { + this.moneyDailys = moneyDailys; + } + + public List getDeliverys() { + return deliverys; + } + + public void setDeliverys(List deliverys) { + this.deliverys = deliverys; + } + + public List getOtherExpenses() { + return otherExpenses; + } + + public void setOtherExpenses(List otherExpenses) { + this.otherExpenses = otherExpenses; + } + + public List getGasolines() { + return gasolines; + } + + public void setGasolines(List gasolines) { + this.gasolines = gasolines; + } + + @Override + public String toString() { + return "User{" + "userName=" + userName + '}'; + } +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/core/UserByOffice.java b/ace-model/src/main/java/com/arrebol/apc/model/core/UserByOffice.java new file mode 100644 index 0000000..bb71205 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/core/UserByOffice.java @@ -0,0 +1,268 @@ +/* + * 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.core; + +import com.arrebol.apc.model.enums.ApplicationOwner; +import com.arrebol.apc.model.enums.UserByOfficeStatus; +import java.io.Serializable; +import java.util.Date; +import java.util.List; +import java.util.Objects; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.UniqueConstraint; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Table(name = "APC_USER_BY_OFFICE", + uniqueConstraints = { + @UniqueConstraint(columnNames = {"id_user", "id_office"}, name = "apc_user_by_office_uk")} +) +public class UserByOffice implements Serializable { + + private static final long serialVersionUID = -8206398520981509425L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_user", + referencedColumnName = "id", + nullable = false + ) + private User user; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_office", + referencedColumnName = "id", + nullable = false + ) + private Office office; + + @Enumerated(EnumType.STRING) + @Column(name = "user_by_office_status", nullable = true) + private UserByOfficeStatus userByOfficeStatus; + + @Enumerated(EnumType.STRING) + @Column(name = "application_owner", nullable = false) + private ApplicationOwner applicationOwner; + + @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; + + @OneToMany( + fetch = FetchType.LAZY, + mappedBy = "userByOffice", + orphanRemoval = true, + cascade = CascadeType.ALL + ) + private List userByOfficeHasPermissions; + + public UserByOffice() { + } + + /** + * + * @param id + */ + public UserByOffice(String id) { + this.id = id; + } + + /** + * + * @param user + * @param office + */ + public UserByOffice(User user, Office office) { + this.user = user; + this.office = office; + } + + /** + * + * @param office + * @param userByOfficeStatus + * @param createdBy + * @param createdOn + */ + public UserByOffice(Office office, UserByOfficeStatus userByOfficeStatus, String createdBy, Date createdOn) { + this.office = office; + this.userByOfficeStatus = userByOfficeStatus; + this.createdBy = createdBy; + this.createdOn = createdOn; + } + + /** + * + * @param office + * @param userByOfficeStatus + * @param applicationOwner + * @param createdBy + * @param createdOn + */ + public UserByOffice(Office office, UserByOfficeStatus userByOfficeStatus, ApplicationOwner applicationOwner, String createdBy, Date createdOn) { + this.office = office; + this.userByOfficeStatus = userByOfficeStatus; + this.applicationOwner = applicationOwner; + this.createdBy = createdBy; + this.createdOn = createdOn; + } + + /** + * + * @param id + * @param user + */ + public UserByOffice(String id, User user) { + this.id = id; + this.user = user; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } + + public Office getOffice() { + return office; + } + + public void setOffice(Office office) { + this.office = office; + } + + public UserByOfficeStatus getUserByOfficeStatus() { + return userByOfficeStatus; + } + + public void setUserByOfficeStatus(UserByOfficeStatus userByOfficeStatus) { + this.userByOfficeStatus = userByOfficeStatus; + } + + public ApplicationOwner getApplicationOwner() { + return applicationOwner; + } + + public void setApplicationOwner(ApplicationOwner applicationOwner) { + this.applicationOwner = applicationOwner; + } + + 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 List getUserByOfficeHasPermissions() { + return userByOfficeHasPermissions; + } + + public void setUserByOfficeHasPermissions(List userByOfficeHasPermissions) { + this.userByOfficeHasPermissions = userByOfficeHasPermissions; + } + + @Override + public int hashCode() { + int hash = 7; + hash = 37 * hash + Objects.hashCode(this.id); + return hash; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final UserByOffice other = (UserByOffice) obj; + if (!Objects.equals(this.id, other.id)) { + return false; + } + return true; + } + + @Override + public String toString() { + return "UserByOffice{" + "user=" + user + ", office=" + office + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/core/UserByOfficeHasPermission.java b/ace-model/src/main/java/com/arrebol/apc/model/core/UserByOfficeHasPermission.java new file mode 100644 index 0000000..49ee290 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/core/UserByOfficeHasPermission.java @@ -0,0 +1,177 @@ +/* + * 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.core; + +import java.io.Serializable; +import java.util.Date; +import java.util.Objects; +import javax.persistence.Column; +import javax.persistence.EmbeddedId; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Table(name = "APC_USER_BY_OFFICE_HAS_PERMISSION") +public class UserByOfficeHasPermission implements Serializable { + + private static final long serialVersionUID = -4218581013559259950L; + + @EmbeddedId + private UserByOfficeHasPermissionId id; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn( + name = "id_user_by_office", + referencedColumnName = "id", + insertable = false, + updatable = false + ) + private UserByOffice userByOffice; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn( + name = "id_permission", + referencedColumnName = "id", + insertable = false, + updatable = false + ) + private Permission permission; + + @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; + + public UserByOfficeHasPermission() { + } + + /** + * + * @param id + * @param createdBy + */ + public UserByOfficeHasPermission(UserByOfficeHasPermissionId id, String createdBy) { + this.id = id; + this.createdBy = createdBy; + this.createdOn = new Date(); + } + + /** + * + * @param userByOffice + * @param createdBy + */ + public UserByOfficeHasPermission(UserByOffice userByOffice, String createdBy) { + this.userByOffice = userByOffice; + this.createdBy = createdBy; + } + + public UserByOfficeHasPermissionId getId() { + return id; + } + + public void setId(UserByOfficeHasPermissionId id) { + this.id = id; + } + + public UserByOffice getUserByOffice() { + return userByOffice; + } + + public void setUserByOffice(UserByOffice userByOffice) { + this.userByOffice = userByOffice; + } + + public Permission getPermission() { + return permission; + } + + public void setPermission(Permission permission) { + this.permission = permission; + } + + 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; + } + + @Override + public int hashCode() { + int hash = 3; + hash = 97 * hash + Objects.hashCode(this.id); + return hash; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final UserByOfficeHasPermission other = (UserByOfficeHasPermission) obj; + if (!Objects.equals(this.id, other.id)) { + return false; + } + return true; + } + + @Override + public String toString() { + return "UserByOfficeHasPermission{" + "userByOffice=" + userByOffice + ", permission=" + permission + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/core/UserByOfficeHasPermissionId.java b/ace-model/src/main/java/com/arrebol/apc/model/core/UserByOfficeHasPermissionId.java new file mode 100644 index 0000000..fb4e68a --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/core/UserByOfficeHasPermissionId.java @@ -0,0 +1,82 @@ +/* + * 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.core; + +import java.io.Serializable; +import java.util.Objects; +import javax.persistence.Column; +import javax.persistence.Embeddable; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Embeddable +public class UserByOfficeHasPermissionId implements Serializable { + + private static final long serialVersionUID = -7541179490083208294L; + + @Column(name = "id_user_by_office", length = 36, nullable = true) + private String idUserByOffice; + + @Column(name = "id_permission", length = 36, nullable = true) + private String idPermission; + + public UserByOfficeHasPermissionId() { + } + + public UserByOfficeHasPermissionId(String idUserByOffice, String idPermission) { + this.idUserByOffice = idUserByOffice; + this.idPermission = idPermission; + } + + public String getIdUserByOffice() { + return idUserByOffice; + } + + public void setIdUserByOffice(String idUserByOffice) { + this.idUserByOffice = idUserByOffice; + } + + public String getIdPermission() { + return idPermission; + } + + public void setIdPermission(String idPermission) { + this.idPermission = idPermission; + } + + @Override + public int hashCode() { + int hash = 7; + hash = 29 * hash + Objects.hashCode(this.idUserByOffice); + hash = 29 * hash + Objects.hashCode(this.idPermission); + return hash; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final UserByOfficeHasPermissionId other = (UserByOfficeHasPermissionId) obj; + if (!Objects.equals(this.idUserByOffice, other.idUserByOffice)) { + return false; + } + if (!Objects.equals(this.idPermission, other.idPermission)) { + return false; + } + return true; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/core/constance/AvailableCustomersViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/AvailableCustomersViewCfg.java new file mode 100644 index 0000000..f94fd72 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/AvailableCustomersViewCfg.java @@ -0,0 +1,18 @@ +/* + * 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.core.constance; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface AvailableCustomersViewCfg extends GenericCfg { + + String QUERY_FIND_AVAILABLE_CUSTOMERS = "findAllAvailableCustomersByType"; + String FIELD_AVAILABLE_PERSON = "availablePerson"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/core/constance/AvailableEndorsementsViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/AvailableEndorsementsViewCfg.java new file mode 100644 index 0000000..c9ae46c --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/AvailableEndorsementsViewCfg.java @@ -0,0 +1,18 @@ +/* + * 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.core.constance; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface AvailableEndorsementsViewCfg extends GenericCfg { + + String QUERY_FIND_AVAILABLE_ENDORSEMENTS = "findAllAvailableEndorsementsByType"; + String FIELD_AVAILABLE_PERSON = "availablePerson"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/core/constance/CashRegisterCurdateByUserViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/CashRegisterCurdateByUserViewCfg.java new file mode 100644 index 0000000..f5588d2 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/CashRegisterCurdateByUserViewCfg.java @@ -0,0 +1,18 @@ +/* + * 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.core.constance; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface CashRegisterCurdateByUserViewCfg extends GenericCfg { + + String QUERY_FIND_CASH_REGISTER = "findAllCashRegisterCurdateByUserId"; + String FIELD_USER_ID = "userId"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/core/constance/ExchangeEnebledUsersViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/ExchangeEnebledUsersViewCfg.java new file mode 100644 index 0000000..429c5a1 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/ExchangeEnebledUsersViewCfg.java @@ -0,0 +1,19 @@ +/* + * 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.core.constance; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface ExchangeEnebledUsersViewCfg extends GenericCfg{ + + String QUERY_FIND_ENEBLED_USERS_TO_USER_ID = "findEnebledUsersToUserId"; + String FIELD_VIEW_ID = "userId"; + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/core/constance/GenericCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/GenericCfg.java new file mode 100644 index 0000000..45ed495 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/GenericCfg.java @@ -0,0 +1,26 @@ +/* + * 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.core.constance; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface GenericCfg { + + String FIELD_ID = "id"; + String FIELD_LAST_UPDATED_BY = "lastUpdatedBy"; + String FIELD_LAST_UPDATED_ON = "lastUpdatedOn"; + + String PARAM_USER_NAME = "userName"; + String PARAM_OFFICE_ID = "officeId"; + String PARAM_USER_IDS = "userIds"; + String PARAM_OWNER_ID = "ownerId"; + String PARAM_START_DATE = "startDate"; + String PARAM_END_DATE = "endDate"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/core/constance/HumanResourceByOfficeCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/HumanResourceByOfficeCfg.java new file mode 100644 index 0000000..3d6d49f --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/HumanResourceByOfficeCfg.java @@ -0,0 +1,17 @@ +/* + * 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.core.constance; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface HumanResourceByOfficeCfg extends GenericCfg { + + String HUMAN_RESOURCE = "humanResource"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/core/constance/HumanResourceCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/HumanResourceCfg.java new file mode 100644 index 0000000..28b042c --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/HumanResourceCfg.java @@ -0,0 +1,37 @@ +/* + * 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.core.constance; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface HumanResourceCfg extends GenericCfg { + + String QUERY_FIND_ALL_HRS_WITHOUT_USER = "findAllHRWithoutUser"; + String QUERY_FIND_ALL_BY_STATUS = "findAllHByStatus"; + String QUERY_FIND_ALL_IN_STATUS = "findAllHRInStatus"; + String QUERY_FIND_ALL_HR_BY_OFFICE = "findAllHRByOffice"; + String UPDATE_HR_BY_STATUS = "updateHRByStatus"; + + String FIELD_FIRST_NAME = "firstName"; + String FIELD_SECOND_NAME = "secondName"; + String FIELD_LAST_NAME = "lastName"; + String FIELD_MIDDLE_NAME = "middleName"; + String FIELD_BIRTHDATE = "birthdate"; + String FIELD_AVATAR = "AVATAR"; + String FIELD_HR_TYPE = "humanResourceType"; + String FIELD_ADMISSION_DATE = "admissionDate"; + String FIELD_HR_STATUS = "humanResourceStatus"; + String FIELD_OFFICE = "office"; + String FIELD_PAYMENT = "payment"; + String FIELD_IMSS = "imss"; + String FIELD_ROLE = "roleCtlg"; + String FIELD_BONUS = "bonus"; + String FIELD_EMPLOYEE_SAVING = "employeeSaving"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/core/constance/HumanResourceHasRouteCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/HumanResourceHasRouteCfg.java new file mode 100644 index 0000000..45ff174 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/HumanResourceHasRouteCfg.java @@ -0,0 +1,19 @@ +/* + * 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.core.constance; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface HumanResourceHasRouteCfg extends GenericCfg { + + String QUERY_DELETE_ALL_HR_HAS_ROUTE_BY_HR = "deleteAllHRHasRouteByHR"; + + String FIELD_HUMAN_RESOURCE = "humanResource"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/core/constance/LoanApprovedDetailViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/LoanApprovedDetailViewCfg.java new file mode 100644 index 0000000..79b0b95 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/LoanApprovedDetailViewCfg.java @@ -0,0 +1,16 @@ +/* + * 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.core.constance; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface LoanApprovedDetailViewCfg extends GenericCfg{ + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/core/constance/LoanByRenovationCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/LoanByRenovationCfg.java new file mode 100644 index 0000000..de71b2a --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/LoanByRenovationCfg.java @@ -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.core.constance; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface LoanByRenovationCfg extends GenericCfg { + + String QUERY_FIND_LOAN_RENOVATION_BY_NEW_LOAN_ID = "findLoanRenovationByNewLoanId"; + String QUERY_UPDATE_LOAN_RENOVATION = "updateLoanRenovation"; + String QUERY_UPDATE_LOAN_RENOVATION_WEB = "updateLoanRenovationWeb"; + + String FIELD_LOAN_NEW = "loanNew"; + String FIELD_LOAN_RENOVATION_STATUS = "loanRenovationStatus"; + String FIELD_COMMENTS = "comments"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/core/constance/LoanByUserCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/LoanByUserCfg.java new file mode 100644 index 0000000..4ed4543 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/LoanByUserCfg.java @@ -0,0 +1,29 @@ +/* + * 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.core.constance; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface LoanByUserCfg extends GenericCfg { + + String QUERY_UPDATE_ORDER_IN_LIST = "updateOrderInList"; + String QUERY_UPDATE_LOAN_BY_USER_BY_LOAND_ID = "updateLoandByUserByLoanId"; + String QUERY_UPDATE_LOAN_BY_USER_STATUS_WHERE_LOAN_IN = "updateLoanByUserStatusWhereLoanIn"; + String QUERY_UPDATE_LOAN_BY_USER_BU_USER_ID = "updateLoandByUserByUserId"; + String QUERY_FIND_LOAN_BY_USER_BY_LOAND_ID = "findLoandByUserByLoanId"; + String QUERY_CHANGE_LOANS_BETWEEN_USERS_IN_LOAN_IDS = "changeLoansBetweenUsersInLoanIds"; + + String FIELD_ORDER_IN_LIST = "orderInList"; + String FIELD_LOAN = "loan"; + String FIELD_LOAN_BY_USER_STATUS = "loanByUserStatus"; + String FIELD_USER = "user"; + + String PARAMS_LOAN = "loans"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/core/constance/LoanByUserOrderPreferenceViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/LoanByUserOrderPreferenceViewCfg.java new file mode 100644 index 0000000..4844f75 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/LoanByUserOrderPreferenceViewCfg.java @@ -0,0 +1,25 @@ +/* + * 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.core.constance; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface LoanByUserOrderPreferenceViewCfg extends GenericCfg { + + /** + * + */ + String QUERY_FIND_ALL_LOAN_BY_USER_ORDER_PREFERENCE = "findAllLoanByUserOrderPreference"; + + /** + * + */ + String FIELD_ORDER_USER_ID = "userId"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/core/constance/LoanByUserViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/LoanByUserViewCfg.java new file mode 100644 index 0000000..b098bdc --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/LoanByUserViewCfg.java @@ -0,0 +1,45 @@ +/* + * 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.core.constance; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface LoanByUserViewCfg extends GenericCfg { + + /** + * + */ + String QUERY_FIND_ALL_LOAN_BY_USER_ID_BY_ORDER_LIST = "findAllLoansByUserIdOrderByOrderList"; + + /** + * + */ + String QUERY_FIND_ALL_LOAN_BY_USER_ID_BY_CUSTOMER_NAME = "findAllLoansByUserIdOrderByCustomerName"; + + /** + * + */ + String FIELD_USER_ID = "userId"; + + /** + * + */ + String FIELD_ORDER_IN_LIST = "orderInList"; + + /** + * + */ + String FIELD_CUSTOMER_NAME = "customerName"; + + /** + * + */ + String PARAM_PREFERENCE_ORDER = "preferenceOrder"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/core/constance/LoanCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/LoanCfg.java new file mode 100644 index 0000000..021d3a3 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/LoanCfg.java @@ -0,0 +1,63 @@ +/* + * 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.core.constance; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface LoanCfg extends GenericCfg { + + String QUERY_UPDATE_LOAN_BY_ID = "updateLoanById"; + String QUERY_UPDATE_LOAN_FROM_RENOVATION = "updateLoanFromRenovation"; + String QUERY_UPDATE_LOAN_STATUS_WHERE_ID_IN = "updateLoanStatusWhereIdIn"; + String QUERY_UPDATE_LOAN_FROM_WEB = "updateLoanFromWeb"; + String QUERY_FIND_LOAN_BY_CUSTOMER = "findLoansByCustomer"; + String QUERY_FIND_LOAN_JURIDICAL = "findLoansJuridical"; + String QUERY_FIND_LOAN_ZERO = "findLoansZero"; + String QUERY_FIND_LOAN_FINISHED = "findLoansFinished"; + String QUERY_FIND_LOAN_BY_ENDORSEMENT = "findLoansByEndorsement"; + String QUERY_UPDATE_LOAN_BY_ID_FROM_CERTIFIER_VIEW = "updateLoanByIdFromCertifiedView"; + String QUERY_UPDATE_LOAN_WITH_CREATED_ON_BY_ID_FROM_CERTIFIER_VIEW = "updateLoanWithCreatedOnByIdFromCertifiedView"; + String QUERY_UPDATE_AND_FINISH_LOAN_BY_ID = "updateAndFinishLoanById"; + String QUERY_UPDATE_DISCOUNT_AND_LOAN_BY_ID_FROM_CERTIFIER_VIEW = "updateDiscountAndLoanByIdFromCertifiedView"; + String QUERY_FIND_LOAN_DETAILS_CURDATE_BY_LOAN = "findLoanDetailsPaymentCurdateByLoan"; + String QUERY_DELETE_LOAN_DETAILS_CURDATE_BY_LOAN = "deleteLoanDetailsPaymentCurdateByLoan"; + String QUERY_SEARCH_PAYMENT_DETAILS = "searchPaymentDetails"; + String QUERY_UPDATE_ROUTE_BY_ID = "updateRouteFromLoan"; + String QUERY_FIND_LOAN_DETAILS_FEE_CURDATE_BY_LOAN = "findLoanDetailsFeeCurdateByLoan"; + String QUERY_DELETE_LOAN_DETAILS_FEE_CURDATE_BY_LOAN = "deleteLoanDetailsFeeCurdateByLoan"; + String QUERY_DELETE_LOAN_FEE_NOTIFICATION_CURDATE_BY_LOAN = "deleteLoanFeeNotificationCurdateByLoan"; + String QUERY_DELETE_LOAN_FEE_NOTIFICATION_BY_LOAN = "deleteLoanFeeNotificationByLoan"; + String QUERY_UPDATE_LOAN_BONUS_NEW_CUSTOMER = "updateBonusNewCustomer"; + String QUERY_FIND_LAST_REFERENCE_NUMBER_BY_LOAN = "findLastReferenceNumberByLoan"; + String QUERY_COUNT_LOAN_IN_STATUSES = "countLoanInStatuses"; + String QUERY_COUNT_LOAN_BY_CUSTOMER_IN_STATUSES = "countLoanByCustomerInStatuses"; + String QUERY_SELECT_LOAN_ID_BY_CUSTOMER_IN_STATUSES = "selectLoanIdByCustomerInStatuses"; + + String QUERY_FIND_LOAN_BY_STATUS_PENDING = "findLoansByStatusPending"; + String QUERY_FIND_ALL_LOANS = "findAllLoans"; + String QUERY_FIND_ALL_LOANS_VIEW = "findAllLoansView"; + String QUERY_FIND_ALL_LOANS_VIEW_BY_START_AND_END_DATE = "findAllLoansViewByStartAndEndDate"; + String QUERY_FIND_ALL_LOANS_JURIDICAL_VIEW_BY_START_AND_END_DATE = "findAllLoansJuridicalViewByStartAndEndDate"; + String QUERY_FIND_LOAN_DETAILS_BY_ID = "findLoansDetailById"; + String FIELD_AMOUNT_PAID = "amountPaid"; + String FIELD_AMOUNT_TO_PAY = "amountToPay"; + String FIELD_LAST_REFERENCE_NUMBER = "lastReferenceNumber"; + String FIELD_LOAN_STATUS = "loanStatus"; + String FIELD_NEW_CUSTOMER = "newCustomer"; + String FIELD_CUSTOMER = "customer"; + String FIELD_ENDORSEMENT = "endorsement"; + String FIELD_CUSTOMER_OFFICE = "customer.office"; + String FIELD_DETAILS_LOAN = "loan"; + String FIELD_COMMENTS = "comments"; + String FIELD_ROUTE = "routeCtlg"; + String FIELD_CREATED_ON = "createdOn"; + String FIELD_USER = "idUser"; + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/core/constance/LoanDetailsCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/LoanDetailsCfg.java new file mode 100644 index 0000000..315d892 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/LoanDetailsCfg.java @@ -0,0 +1,34 @@ +/* + * 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.core.constance; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface LoanDetailsCfg extends GenericCfg { + + String QUERY_FIND_LOAN_DETAILS_BY_LOAN = "findLoanDetailsByLoan"; + String QUERY_FIND_FEES_TO_PAY_BY_LOAN_ID = "findFeesToPayByLoanId"; + String QUERY_FIND_ALL_FEES_BY_LOAN_ID = "findAllFeesByLoanId"; + String QUERY_UPDATE_PAID_FEES_STATUS_IN_LOAN_DETAILS_IDS = "updatePaidFeesStatusInLoanDetailIds"; + String QUERY_COUNT_LOAN_DETAILS_IN_CURRDATE = "countLoanDetailsInCurrdate"; + String QUERY_FIND_ALL_TRANSFERS_LOAN_DETAIL = "findAllTransfersLoanDetail"; + String UPDATE_AUTHORIZE_LOAN_DETAIL = "updateAuthorizeTransferStatusInLoanDetailIds"; + String UPDATE_TRANSFER_STATUS_WHERE_ID_IN = "updateTransferStatusWhereIdIn"; + String UPDATE_REJECT_LOAN_DETAIL = "updateRejectTransferStatusInLoanDetailIds"; + String COUNT_LOAN_DETAILS_AUTHORIZE = "countLoanDetailsAuthorize"; + + String FIELD_ID_LOAN = "loan"; + String FIELD_LOAN_DETAILS_TYPE = "loanDetailsType"; + String FIELD_FEE_STATUS = "feeStatus"; + String FIELD_USER = "user"; + String FIELD_COMMENS = "comments"; + String FIELD_TRANSFER_STATUS = "transferStatus"; + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/core/constance/LoanFeeNotificationCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/LoanFeeNotificationCfg.java new file mode 100644 index 0000000..4b5896c --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/LoanFeeNotificationCfg.java @@ -0,0 +1,19 @@ +/* + * 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.core.constance; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface LoanFeeNotificationCfg extends GenericCfg { + + String QUERY_COUNT_NOTIFICATION_BY_LOAN_ID = "countNotificationByLoanId"; + + String FIELD_LOAN = "loan"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/core/constance/LoanToDeliveryByCertifierViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/LoanToDeliveryByCertifierViewCfg.java new file mode 100644 index 0000000..a22f695 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/LoanToDeliveryByCertifierViewCfg.java @@ -0,0 +1,17 @@ +/* + * 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.core.constance; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface LoanToDeliveryByCertifierViewCfg extends GenericCfg{ + String QUERY_FIND_LOANS_BY_CERTIFIER = "findLoansByCertifier"; + String FIELD_USER_ID = "userId"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/core/constance/LoanTypeCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/LoanTypeCfg.java new file mode 100644 index 0000000..c691519 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/LoanTypeCfg.java @@ -0,0 +1,26 @@ +/* + * 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.core.constance; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface LoanTypeCfg extends GenericCfg { + + String QUERY_FIND_ALL_LOAN_TYPE_BY_OFFICE = "findAllLoanTypeByOffice"; + String QUERY_FIND_ALL_LOAN_TYPE_WITH_DESCRIPTION_BY_OFFICE = "findAllLoanTypeWithDescrpitionByOffice"; + String QUERY_FIND_NEW_CREDIT_LINE_BY_LOAN_ID = "findNewCreditLineByLoanId"; + + String QUERY_FIND_ALL_DATA_LOAN_TYPE_BY_OFFICE = "findAllDataLoanTypeByOffice"; + + String FIELD_OFFICE = "office"; + + String PARAM_LOAN = "loan"; + String PARAM_LOAN_ID = "loanId"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/core/constance/MobileUserCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/MobileUserCfg.java new file mode 100644 index 0000000..6bd10ee --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/MobileUserCfg.java @@ -0,0 +1,20 @@ +/* + * 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.core.constance; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface MobileUserCfg extends GenericCfg { + + String QUERY_FIND_MOBILE_USER_FROM_LOGIN = "findMobileUserFromLogin"; + + String FIELD_USER_NAME = "userName"; + String FIELD_PASSWORD = "password"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/core/constance/OfficeCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/OfficeCfg.java new file mode 100644 index 0000000..a35ee3c --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/OfficeCfg.java @@ -0,0 +1,41 @@ +/* + * 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.core.constance; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface OfficeCfg extends GenericCfg { + + /** + * + */ + String QUERY_TUPLE_FIND_ALL_OFFICES_BY_USER = "findAllOfficesByUser"; + String QUERY_FIND_ALL_OFFICES_ACTIVES = "findAllOfficesActives"; + String UPDATE_OFFICES_BY_ID = "updateByOfficeId"; + + /** + * Fields + */ + String FIELD_PERMISSION = "officeName"; + String FIELD_OFFICE_STATUS = "officeStatus"; + String FIELD_ADDRESS = "address"; + /** + * Query string + */ + String QUERY_AS_STRING_TUPLE_FIND_ALL_OFFICES_BY_USER = "SELECT \n" + + " o.id,\n" + + " o.officeName\n" + + " FROM Office o\n" + + " INNER JOIN UserByOffice ubo ON o.id = ubo.office\n" + + " WHERE\n" + + " ubo.user = :user AND\n" + + " ubo.userByOfficeStatus = 'ENEBLED' AND\n" + + " o.officeStatus = 'ENEBLED'"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/core/constance/PermissionCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/PermissionCfg.java new file mode 100644 index 0000000..f53dcd5 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/PermissionCfg.java @@ -0,0 +1,32 @@ +/* + * 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.core.constance; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface PermissionCfg extends GenericCfg { + + String QUERY_FIND_PERMISSION_THAT_USER_HAS_ASSIGNED = "finPermissionThatUserHasAssigned"; + String QUERY_FIND_MISSING_PERMISSION_UBO = "findMissingPermissionByUserByOffice"; + String QUERY_FIND_ENEBLED_PERMISSIONS = "findAllEnebledPermissions"; + String QUERY_FIND_PERMISSION_BY_TYPE_AND_STATUS = "findPermissionByTypeAndStatus"; + String QUERY_FIND_ALL_PERMISSIONS_BY_UBO = "findAllPermissionsByUBO"; + String QUERY_FIND_ALL_NOT_PERMISSIONS_BY_UBO = "findAllNotPermissionsByUBO"; + String QUERY_FIND_ALL_PERMISSION_BY_TYPE_AND_STATUS = "findAllPermissionByTypeAndStatus"; + + String FIELD_PERMISSION = "permission"; + String FIELD_DESCRIPTION = "description"; + String FIELD_MENU_PATH = "menuPath"; + String FIELD_LEFT_TO_RIGHT = "leftToRightOrder"; + String FIELD_TOP_TO_BOTTOM = "topToBottomOrder"; + String FIELD_PERMISSION_STATUS = "permissionStatus"; + String FIELD_PERMISSION_TYPE = "permissionType"; + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/core/constance/PersonSearchDetailViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/PersonSearchDetailViewCfg.java new file mode 100644 index 0000000..9cb27f3 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/PersonSearchDetailViewCfg.java @@ -0,0 +1,17 @@ +/* + * 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.core.constance; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface PersonSearchDetailViewCfg extends GenericCfg{ + + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/core/constance/PersonSearchHistoricalDetailsViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/PersonSearchHistoricalDetailsViewCfg.java new file mode 100644 index 0000000..cc90071 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/PersonSearchHistoricalDetailsViewCfg.java @@ -0,0 +1,18 @@ +/* + * 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.core.constance; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface PersonSearchHistoricalDetailsViewCfg { + + String QUERY_FIND_PERSON_SEARCH_HISTORICAL_DETAILS_BY_PERSON_ID = "findPersonHistoricalDetailsByPersonId"; + String FIELD_PERSON_SEARCH_ID = "personSearchId"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/core/constance/PersonSearchViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/PersonSearchViewCfg.java new file mode 100644 index 0000000..2d6bc6c --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/PersonSearchViewCfg.java @@ -0,0 +1,20 @@ +/* + * 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.core.constance; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface PersonSearchViewCfg extends GenericCfg { + + String QUERY_LIKE_BY_PERSON_SEARCH = "likePersonSearchViewByPersonSearch"; + String QUERY_FULL_NAME_EQUALS_TO_PERSON_SEARCH = "fullNameEqualsToPersonSearch"; + + String FIELD_PERSON_SEARCH = "personSearch"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/core/constance/UserByOfficeCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/UserByOfficeCfg.java new file mode 100644 index 0000000..1e06b3d --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/UserByOfficeCfg.java @@ -0,0 +1,25 @@ +/* + * 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.core.constance; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface UserByOfficeCfg extends GenericCfg { + + String QUERY_FIND_USER_LOGGED = "findIdsFromUserLogged"; + String QUERY_FIND_USERS_IN_OFFICE_IN_STATUSES = "findUsersInOfficeInStatuses"; + String QUERY_FIND_ID_OF_USER_BY_OFFICE = "findIdOfUserByOffice"; + + String FIELD_USER = "user"; + String FIELD_OFFICE = "office"; + + String PARAM_USER_BY_OFFICE_ID = "userByOfficeId"; + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/core/constance/UserByOfficeHasPermissionCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/UserByOfficeHasPermissionCfg.java new file mode 100644 index 0000000..5984e61 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/UserByOfficeHasPermissionCfg.java @@ -0,0 +1,20 @@ +/* + * 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.core.constance; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface UserByOfficeHasPermissionCfg extends GenericCfg { + + String XML_QUERY_DELETE_PERMISSION_BY_USER_ID_AND_OFFICE_ID = "deletePermissionByUserIdAndOfficeId"; + String QUERY_DELETE_ALL_PERMISSION_BY_UBO = "deleteAllPermissionByUBO"; + + String FIELD_USER_BY_OFFICE = "userByOffice"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/core/constance/UserCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/UserCfg.java new file mode 100644 index 0000000..391eaf0 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/UserCfg.java @@ -0,0 +1,40 @@ +/* + * 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.core.constance; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface UserCfg extends GenericCfg { + + /** + * Queries + */ + String QUERY_FIND_ALL_USERS_BY_OFFICE = "findAllUsersByOffice"; + String QUERY_IS_USERNAME_AVAILABLE = "isUsernameAvailable"; + String QUERY_FIND_ALL_USERS_COMPLETE = "findAllUsersCompleteByOffice"; + String QUERY_UPDATE_PASSWORD_BY_USER_ID = "updatePasswordByUserId"; + String QUERY_UPDATE_CERTIFIER_AND_USER_TYPE_BY_ID = "updateCertifierAndUserTypeById"; + String QUERY_UPDATE_USER_NAME_BY_USER_ID = "updateUserNameById"; + String QUERY_UPDATE_USER_STATUS_BY_USER_ID = "updateUserStatusById"; + String QUERY_VERIFY_USER_STATUS_BY_ID = "verifyUserStatusById"; + String QUERY_IS_USER_MANAGMENT = "isUserManagement"; + String QUERY_LIST_OF_USERS_BY_OFFICE = "listOfUsersByOffice"; + + /** + * Field + */ + String FIELD_USER_NAME = "userName"; + String FIELD_PASSWORD = "password"; + String FIELD_HUMAN_RESOURCE = "humanResource"; + String FIELD_USER_STATUS = "userStatus"; + String FIELD_OFFICE = "office"; + String FIELD_CERTIFIER = "certifier"; + String FIELD_USER_TYPE = "userType"; + String FIELD_MANAGMENT = "managements"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/core/constance/UserMobilePreferenceCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/UserMobilePreferenceCfg.java new file mode 100644 index 0000000..b75207f --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/core/constance/UserMobilePreferenceCfg.java @@ -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.core.constance; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface UserMobilePreferenceCfg extends GenericCfg { + + String QUERY_FIND_ALL_MOBILE_PREFERENCES_BY_USER = "findAllMobilePreferenceByUser"; + String QUERY_FIND_MOBILE_PREFERENCE_BY_USER_AND_PREFERENCE_NAME = "findMobilePreferenceByUserAndPreferenceName"; + String QUERY_UPDATE_PREFERENCE_VALUE = "updatePreferenceValueInUserMobilePreferenceById"; + + String FIELD_USER = "user"; + String FIELD_PREFERENCE_NAME = "preferenceName"; + String FIELD_PREFERENCE_VALUE = "preferenceValue"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/enums/ActionStatus.java b/ace-model/src/main/java/com/arrebol/apc/model/enums/ActionStatus.java new file mode 100644 index 0000000..3795ef5 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/enums/ActionStatus.java @@ -0,0 +1,26 @@ +/* + * 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.enums; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public enum ActionStatus { + PENDING("Pendiente"), APPROVED("Aprobado"), REJECTED("Rechazado"); + + private final String value; + + private ActionStatus(String value) { + this.value = value; + } + + public String getValue() { + return value; + } +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/enums/ActiveStatus.java b/ace-model/src/main/java/com/arrebol/apc/model/enums/ActiveStatus.java new file mode 100644 index 0000000..0fde7f4 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/enums/ActiveStatus.java @@ -0,0 +1,26 @@ +/* + * 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.enums; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public enum ActiveStatus { + ENEBLED("ENEBLED"), DISABLED("DISABLED"); + + private final String value; + + private ActiveStatus(String value) { + this.value = value; + } + + public String getValue() { + return value; + } +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/enums/ApplicationOwner.java b/ace-model/src/main/java/com/arrebol/apc/model/enums/ApplicationOwner.java new file mode 100644 index 0000000..808bc4c --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/enums/ApplicationOwner.java @@ -0,0 +1,19 @@ +/* + * 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.enums; + +/** + * APP_OWNER (Application Owner) Is an exclusive value from the root, all other + * users must be created as APP_USER (Application user like secretary, adviser, + * ceo, for web or mobile). + * + * @author Carlos Janitzio Zavala Lopez + */ +public enum ApplicationOwner { + APP_OWNER, APP_USER +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/enums/ComissionType.java b/ace-model/src/main/java/com/arrebol/apc/model/enums/ComissionType.java new file mode 100644 index 0000000..823d230 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/enums/ComissionType.java @@ -0,0 +1,37 @@ +/* + * 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.enums; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public enum ComissionType { + INCLUDED("INCLUDED") { + @Override + public String toString() { + return "INCLUDED"; + } + }, EXCLUDED("EXCLUDED") { + @Override + public String toString() { + return "EXCLUDED"; + } + }; + + private final String type; + + private ComissionType(String type) { + this.type = type; + } + + public String getType() { + return type; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/enums/CustomerClassification.java b/ace-model/src/main/java/com/arrebol/apc/model/enums/CustomerClassification.java new file mode 100644 index 0000000..d057643 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/enums/CustomerClassification.java @@ -0,0 +1,26 @@ +/* + * 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.enums; + +/** + * + * @author David RodrĆ­guez Huaracha + */ +public enum CustomerClassification { + WHITE("WHITE"), RED("RED"), YELLOW("YELLOW"); + + private final String value; + + private CustomerClassification(String value) { + this.value = value; + } + + public String getValue() { + return value; + } +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/enums/DaysInWeekend.java b/ace-model/src/main/java/com/arrebol/apc/model/enums/DaysInWeekend.java new file mode 100644 index 0000000..1e438f1 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/enums/DaysInWeekend.java @@ -0,0 +1,16 @@ +/* + * 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.enums; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public enum DaysInWeekend { + MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/enums/EmployeeSavingType.java b/ace-model/src/main/java/com/arrebol/apc/model/enums/EmployeeSavingType.java new file mode 100644 index 0000000..12c370a --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/enums/EmployeeSavingType.java @@ -0,0 +1,16 @@ +/* + * 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.enums; + +/** + * + * @author David RodrĆ­guez Huaracha + */ +public enum EmployeeSavingType { + SAVING, DISPOSAL, CANCEL +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/enums/ExpenseCompanyType.java b/ace-model/src/main/java/com/arrebol/apc/model/enums/ExpenseCompanyType.java new file mode 100644 index 0000000..c788bdf --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/enums/ExpenseCompanyType.java @@ -0,0 +1,37 @@ +/* + * 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.enums; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public enum ExpenseCompanyType { + PAYMENT_IN("Entrada") { + @Override + public String toString() { + return "PAYMENT_IN"; + } + }, PAYMENT_OUT("Salida") { + @Override + public String toString() { + return "PAYMENT_OUT"; + } + }; + + private final String label; + + private ExpenseCompanyType(String label) { + this.label = label; + } + + public String getLabel() { + return label; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/enums/FeeStatus.java b/ace-model/src/main/java/com/arrebol/apc/model/enums/FeeStatus.java new file mode 100644 index 0000000..5495fe7 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/enums/FeeStatus.java @@ -0,0 +1,16 @@ +/* + * 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.enums; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public enum FeeStatus { + TO_PAY, PAID +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/enums/GenericStatus.java b/ace-model/src/main/java/com/arrebol/apc/model/enums/GenericStatus.java new file mode 100644 index 0000000..53febdd --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/enums/GenericStatus.java @@ -0,0 +1,16 @@ +/* + * 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.enums; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public enum GenericStatus { + ENABLED, DISABLED, DELETED +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/enums/HumanResourceStatus.java b/ace-model/src/main/java/com/arrebol/apc/model/enums/HumanResourceStatus.java new file mode 100644 index 0000000..1f5da3e --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/enums/HumanResourceStatus.java @@ -0,0 +1,41 @@ +/* + * 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.enums; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public enum HumanResourceStatus { + ENEBLED("enebled") { + @Override + public String toString() { + return "ENEBLED"; + } + }, DISABLED("disabled") { + @Override + public String toString() { + return "DISABLED"; + } + }, DELETED("deleted") { + @Override + public String toString() { + return "DELETED"; + } + }; + + private final String status; + + private HumanResourceStatus(String status) { + this.status = status; + } + + public String getStatus() { + return status; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/enums/LoanDetailsType.java b/ace-model/src/main/java/com/arrebol/apc/model/enums/LoanDetailsType.java new file mode 100644 index 0000000..fab567a --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/enums/LoanDetailsType.java @@ -0,0 +1,31 @@ +/* + * 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.enums; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public enum LoanDetailsType { + CREDIT_PAYMENT("Tarjeta de crĆ©dito"), + DEBIT_PAYMENT("Efectivo"), + PAYMENT("Abono"), + FEE("Multa"), + RENOVATION_PAYMENT("Cobro en entrega de renovaciĆ³n"), + TRANSFER("Transferencia bancaria"); + + private final String value; + + private LoanDetailsType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/enums/LoanRenovationStatus.java b/ace-model/src/main/java/com/arrebol/apc/model/enums/LoanRenovationStatus.java new file mode 100644 index 0000000..324758c --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/enums/LoanRenovationStatus.java @@ -0,0 +1,16 @@ +/* + * 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.enums; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public enum LoanRenovationStatus { + PENDING, APPROVED, REJECTED +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/enums/LoanStatus.java b/ace-model/src/main/java/com/arrebol/apc/model/enums/LoanStatus.java new file mode 100644 index 0000000..ad9b0cc --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/enums/LoanStatus.java @@ -0,0 +1,26 @@ +/* + * 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.enums; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public enum LoanStatus { + PENDING("Pendiente"), FINISH("Terminado"), BLACK_LIST("Lista negra"), APPROVED("Aprobado"), REJECTED("Rechazado"), PENDING_RENOVATION("Pendiente de renovaciĆ³n"), TO_DELIVERY("Por liberar"), DELETED("Borrado"); + + private final String value; + + private LoanStatus(String value) { + this.value = value; + } + + public String getValue() { + return value; + } +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/enums/OfficeStatus.java b/ace-model/src/main/java/com/arrebol/apc/model/enums/OfficeStatus.java new file mode 100644 index 0000000..7a50517 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/enums/OfficeStatus.java @@ -0,0 +1,42 @@ +/* + * 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.enums; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public enum OfficeStatus { + ENEBLED("enebled") { + @Override + public String toString() { + return "ENEBLED"; + } + }, DISABLED("disabled") { + @Override + public String toString() { + return "DISABLED"; + } + }, + DELETED("deleted") { + @Override + public String toString() { + return "DELETED"; + } + }; + + private final String status; + + private OfficeStatus(String status) { + this.status = status; + } + + public String getStatus() { + return status; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/enums/OwnerLoan.java b/ace-model/src/main/java/com/arrebol/apc/model/enums/OwnerLoan.java new file mode 100644 index 0000000..0d63203 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/enums/OwnerLoan.java @@ -0,0 +1,16 @@ +/* + * 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.enums; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public enum OwnerLoan { + CURRENT_OWNER, OLD_OWNER +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/enums/PeopleType.java b/ace-model/src/main/java/com/arrebol/apc/model/enums/PeopleType.java new file mode 100644 index 0000000..db948ae --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/enums/PeopleType.java @@ -0,0 +1,26 @@ +/* + * 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.enums; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public enum PeopleType { + CUSTOMER("Cliente"), ENDORSEMENT("Aval"), BOTH("Cliente y aval"); + + private final String value; + + private PeopleType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/enums/PermissionStatus.java b/ace-model/src/main/java/com/arrebol/apc/model/enums/PermissionStatus.java new file mode 100644 index 0000000..e184415 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/enums/PermissionStatus.java @@ -0,0 +1,36 @@ +/* + * 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.enums; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public enum PermissionStatus { + ENEBLED("enebled") { + @Override + public String toString() { + return "ENEBLED"; + } + }, DISABLED("disabled") { + @Override + public String toString() { + return "DISABLED"; + } + }; + + private final String status; + + private PermissionStatus(String status) { + this.status = status; + } + + public String getStatus() { + return status; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/enums/PermissionType.java b/ace-model/src/main/java/com/arrebol/apc/model/enums/PermissionType.java new file mode 100644 index 0000000..edfa64d --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/enums/PermissionType.java @@ -0,0 +1,41 @@ +/* + * 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.enums; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public enum PermissionType { + PUBLIC("public") { + @Override + public String toString() { + return "PUBLIC"; + } + }, PRIVATE("private") { + @Override + public String toString() { + return "PRIVATE"; + } + }, EXCLUSIVE("exclusive") { + @Override + public String toString() { + return "EXCLUSIVE"; + } + }; + + private final String type; + + private PermissionType(String type) { + this.type = type; + } + + public String getType() { + return type; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/enums/PreferenceName.java b/ace-model/src/main/java/com/arrebol/apc/model/enums/PreferenceName.java new file mode 100644 index 0000000..b470766 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/enums/PreferenceName.java @@ -0,0 +1,16 @@ +/* + * 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.enums; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public enum PreferenceName { + ORDER_LIST +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/enums/PreferenceValue.java b/ace-model/src/main/java/com/arrebol/apc/model/enums/PreferenceValue.java new file mode 100644 index 0000000..9d5046b --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/enums/PreferenceValue.java @@ -0,0 +1,16 @@ +/* + * 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.enums; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public enum PreferenceValue { + ALPHABETICALLY, ORDER_IN_LIST +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/enums/TransferStatus.java b/ace-model/src/main/java/com/arrebol/apc/model/enums/TransferStatus.java new file mode 100644 index 0000000..e9b1a95 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/enums/TransferStatus.java @@ -0,0 +1,27 @@ +/* + * 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.enums; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public enum TransferStatus { + PENDING("Pendiente"), AUTHORIZED("Autorizado"), REJECTED("Rechazado"); + + private final String status; + + private TransferStatus(String status) { + this.status = status; + } + + public String getStatus() { + return status; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/enums/UserByOfficeStatus.java b/ace-model/src/main/java/com/arrebol/apc/model/enums/UserByOfficeStatus.java new file mode 100644 index 0000000..d32912b --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/enums/UserByOfficeStatus.java @@ -0,0 +1,42 @@ +/* + * 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.enums; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public enum UserByOfficeStatus { + ENEBLED("enebled") { + @Override + public String toString() { + return "ENEBLED"; + } + }, DISABLED("disabled") { + @Override + public String toString() { + return "DISABLED"; + } + }, DELETED("deleted") { + @Override + public String toString() { + return "DELETED"; + } + }; + + private final String status; + + private UserByOfficeStatus(String status) { + this.status = status; + } + + public String getStatus() { + return status; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/enums/UserStatus.java b/ace-model/src/main/java/com/arrebol/apc/model/enums/UserStatus.java new file mode 100644 index 0000000..28899cd --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/enums/UserStatus.java @@ -0,0 +1,41 @@ +/* + * 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.enums; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public enum UserStatus { + ENEBLED("enebled") { + @Override + public String toString() { + return "ENEBLED"; + } + }, DISABLED("disabled") { + @Override + public String toString() { + return "DISABLED"; + } + }, DELETED("deleted") { + @Override + public String toString() { + return "DELETED"; + } + }; + + private final String status; + + private UserStatus(String status) { + this.status = status; + } + + public String getStatus() { + return status; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/enums/UserType.java b/ace-model/src/main/java/com/arrebol/apc/model/enums/UserType.java new file mode 100644 index 0000000..75615ef --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/enums/UserType.java @@ -0,0 +1,46 @@ +/* + * 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.enums; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public enum UserType { + WEB("web") { + @Override + public String toString() { + return "WEB"; + } + }, MOBILE("mobile") { + @Override + public String toString() { + return "MOBILE"; + } + }, BOTH("both") { + @Override + public String toString() { + return "BOTH"; + } + }, ROOT("root") { + @Override + public String toString() { + return "ROOT"; + } + }; + + private final String type; + + private UserType(String type) { + this.type = type; + } + + public String getType() { + return type; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/gasoline/Gasoline.java b/ace-model/src/main/java/com/arrebol/apc/model/gasoline/Gasoline.java new file mode 100644 index 0000000..dfc1288 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/gasoline/Gasoline.java @@ -0,0 +1,264 @@ +/* + * 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.gasoline; + +import com.arrebol.apc.model.catalog.RouteCtlg; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.enums.GenericStatus; +import java.io.Serializable; +import java.util.Date; +import java.util.Objects; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Table(name = "APC_GASOLINE") +public class Gasoline implements Serializable { + + private static final long serialVersionUID = -1257291916093653466L; + + @Id + @Column(name = "id", length = 36) + private String id; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_user", + referencedColumnName = "id", + nullable = false + ) + private User user; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_office", + referencedColumnName = "id", + nullable = false + ) + private Office office; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_route", + referencedColumnName = "id", + nullable = false + ) + private RouteCtlg routeCtlg; + + @Column(name = "quantity") + private Double quantity; + + @Column(name = "km_old") + private Double kmOld; + + @Column(name = "km_new") + private Double kmNew; + + @Column(name = "total") + private Double total; + + @Enumerated(EnumType.STRING) + @Column(name = "status", nullable = false) + private GenericStatus status; + + @Column(name = "description", length = 500) + private String description; + + @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; + + public Gasoline() { + } + + /** + * + * @param id + * @param user + * @param office + * @param routeCtlg + * @param kmNew + * @param total + * @param status + * @param description + * @param createdBy + * @param createdOn + */ + public Gasoline(String id, User user, Office office, RouteCtlg routeCtlg, Double quantity,Double kmNew, Double total, GenericStatus status, String description, String createdBy, Date createdOn) { + this.id = id; + this.user = user; + this.office = office; + this.routeCtlg = routeCtlg; + this.quantity = quantity; + this.kmNew = kmNew; + this.total = total; + this.status = status; + this.description = description; + this.createdBy = createdBy; + this.createdOn = createdOn; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } + + public Office getOffice() { + return office; + } + + public void setOffice(Office office) { + this.office = office; + } + + public RouteCtlg getRouteCtlg() { + return routeCtlg; + } + + public void setRouteCtlg(RouteCtlg routeCtlg) { + this.routeCtlg = routeCtlg; + } + + public Double getQuantity() { + return quantity; + } + + public void setQuantity(Double quantity) { + this.quantity = quantity; + } + + public Double getKmOld() { + return kmOld; + } + + public void setKmOld(Double kmOld) { + this.kmOld = kmOld; + } + + public Double getKmNew() { + return kmNew; + } + + public void setKmNew(Double kmNew) { + this.kmNew = kmNew; + } + + public Double getTotal() { + return total; + } + + public void setTotal(Double total) { + this.total = total; + } + + public GenericStatus getStatus() { + return status; + } + + public void setStatus(GenericStatus status) { + this.status = status; + } + + 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; + } + + @Override + public int hashCode() { + int hash = 7; + hash = 79 * hash + Objects.hashCode(this.id); + return hash; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final Gasoline other = (Gasoline) obj; + if (!Objects.equals(this.id, other.id)) { + return false; + } + return true; + } + + @Override + public String toString() { + return "Gasoline{" + "id=" + id + ", createdBy=" + createdBy + ", createdOn=" + createdOn + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/gasoline/constance/GasolineCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/gasoline/constance/GasolineCfg.java new file mode 100644 index 0000000..7335ac2 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/gasoline/constance/GasolineCfg.java @@ -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.gasoline.constance; + +import com.arrebol.apc.model.core.constance.GenericCfg; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface GasolineCfg extends GenericCfg { + + String QUERY_FIND_LATEST_GASOLINE_PAYMENT_BY_USER_AND_ROUTE_AND_STATUS = "findLatestGasolinePaymentByuserAndRouteAndStatus"; + + String FIELD_USER = "user"; + String FIELD_ROUTE = "route"; + String FIELD_STATUS = "status"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/loan/Delivery.java b/ace-model/src/main/java/com/arrebol/apc/model/loan/Delivery.java new file mode 100644 index 0000000..6a771a6 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/loan/Delivery.java @@ -0,0 +1,176 @@ +/* + * 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.loan; + +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.enums.ComissionType; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Table(name = "APC_DELIVERY") +public class Delivery implements Serializable { + + private static final long serialVersionUID = 7580350030712936070L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_user", + referencedColumnName = "id", + nullable = false + ) + private User user; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_loan", + referencedColumnName = "id", + nullable = false + ) + private Loan loan; + + @Column(name = "amount", nullable = false) + private BigDecimal amount; + + @Enumerated(EnumType.STRING) + @Column(name = "comission") + private ComissionType comission; + + @Column(name = "created_by", nullable = false, length = 36) + private String createdBy; + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "created_on", length = 19) + private Date createdOn; + + public Delivery() { + } + + /** + * + * @param user + * @param loan + * @param amount + * @param createdBy + * @param createdOn + */ + public Delivery(User user, Loan loan, BigDecimal amount, String createdBy, Date createdOn) { + this.user = user; + this.loan = loan; + this.amount = amount; + this.createdBy = createdBy; + this.createdOn = createdOn; + } + + /** + * + * @param user + * @param loan + * @param amount + * @param createdBy + * @param createdOn + * @param comission + */ + public Delivery(User user, Loan loan, BigDecimal amount, String createdBy, Date createdOn, ComissionType comission) { + this.user = user; + this.loan = loan; + this.amount = amount; + this.createdBy = createdBy; + this.createdOn = createdOn; + this.comission = comission; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } + + public Loan getLoan() { + return loan; + } + + public void setLoan(Loan loan) { + this.loan = loan; + } + + public BigDecimal getAmount() { + return amount; + } + + public void setAmount(BigDecimal amount) { + this.amount = amount; + } + + public ComissionType getComission() { + if (null == comission) { + comission = ComissionType.INCLUDED; + } + return comission; + } + + public void setComission(ComissionType comission) { + this.comission = comission; + } + + 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; + } + + @Override + public String toString() { + return "Delivery{" + "user=" + user + ", createdOn=" + createdOn + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/loan/Loan.java b/ace-model/src/main/java/com/arrebol/apc/model/loan/Loan.java new file mode 100644 index 0000000..7c08c71 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/loan/Loan.java @@ -0,0 +1,524 @@ +/* + * 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.loan; + +import com.arrebol.apc.model.catalog.People; +import com.arrebol.apc.model.catalog.RouteCtlg; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.enums.LoanStatus; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Table(name = "APC_LOAN") +public class Loan implements Serializable { + + private static final long serialVersionUID = -601238781806641208L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_loan_type", + referencedColumnName = "id", + nullable = false + ) + private LoanType loanType; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_customer", + referencedColumnName = "id", + nullable = false + ) + private People customer; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_endorsement", + referencedColumnName = "id", + nullable = false + ) + private People endorsement; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_route", + referencedColumnName = "id", + nullable = false + ) + private RouteCtlg routeCtlg; + + @Enumerated(EnumType.STRING) + @Column(name = "loan_status", nullable = false) + private LoanStatus loanStatus; + + @Enumerated(EnumType.STRING) + @Column(name = "new_customer") + private ActiveStatus newCustomer; + + @Column(name = "amount_paid", nullable = false) + private BigDecimal amountPaid; + + @Column(name = "amount_to_pay", nullable = false) + private BigDecimal amountToPay; + + @Column(name = "last_reference_number", nullable = false) + private Integer lastReferenceNumber; + + @Column(name = "comments", length = 200) + private String comments; + + @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; + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "juridical_date", length = 19) + private Date juridicalDate; + + @Enumerated(EnumType.STRING) + @Column(name = "frozen") + private ActiveStatus frozen; + + @OneToMany( + mappedBy = "loan", + cascade = CascadeType.ALL, + fetch = FetchType.LAZY, + orphanRemoval = true + ) + private List loanDetailses; + + @OneToMany( + mappedBy = "loan", + cascade = CascadeType.ALL, + fetch = FetchType.LAZY, + orphanRemoval = true + ) + private List loanByUsers; + + @OneToMany( + mappedBy = "loan", + cascade = CascadeType.ALL, + fetch = FetchType.LAZY, + orphanRemoval = true + ) + private List loanFeeNotifications; + + @OneToMany( + mappedBy = "loanOld", + cascade = CascadeType.ALL, + fetch = FetchType.LAZY, + orphanRemoval = true + ) + private List loanOldByRenovations; + + @OneToMany( + mappedBy = "loanNew", + cascade = CascadeType.ALL, + fetch = FetchType.LAZY, + orphanRemoval = true + ) + private List loanNewByRenovations; + + @OneToMany( + mappedBy = "loan", + cascade = CascadeType.ALL, + fetch = FetchType.LAZY, + orphanRemoval = true + ) + private List deliverys; + + public Loan() { + } + + /** + * + * @param loanType + * @param customer + * @param endorsement + * @param routeCtlg + * @param loanStatus + * @param amountPaid + * @param amountToPay + * @param lastReferenceNumber + * @param createdBy + * @param createdOn + * @param newCustomer + */ + public Loan(LoanType loanType, People customer, People endorsement, RouteCtlg routeCtlg, LoanStatus loanStatus, BigDecimal amountPaid, BigDecimal amountToPay, Integer lastReferenceNumber, String createdBy, Date createdOn, ActiveStatus newCustomer) { + this.loanType = loanType; + this.customer = customer; + this.endorsement = endorsement; + this.routeCtlg = routeCtlg; + this.loanStatus = loanStatus; + this.amountPaid = amountPaid; + this.amountToPay = amountToPay; + this.lastReferenceNumber = lastReferenceNumber; + this.createdBy = createdBy; + this.createdOn = createdOn; + this.newCustomer = newCustomer; + } + + /** + * + * @param loanType + * @param customer + * @param endorsement + * @param routeCtlg + * @param loanStatus + * @param amountPaid + * @param amountToPay + * @param lastReferenceNumber + * @param createdBy + * @param createdOn + * @param newCustomer + * @param frozen + */ + public Loan(LoanType loanType, People customer, People endorsement, RouteCtlg routeCtlg, LoanStatus loanStatus, BigDecimal amountPaid, BigDecimal amountToPay, Integer lastReferenceNumber, String createdBy, Date createdOn, ActiveStatus newCustomer, ActiveStatus frozen) { + this.loanType = loanType; + this.customer = customer; + this.endorsement = endorsement; + this.routeCtlg = routeCtlg; + this.loanStatus = loanStatus; + this.amountPaid = amountPaid; + this.amountToPay = amountToPay; + this.lastReferenceNumber = lastReferenceNumber; + this.createdBy = createdBy; + this.createdOn = createdOn; + this.newCustomer = newCustomer; + this.frozen = frozen; + } + + /** + * + * @param id + */ + public Loan(String id) { + this.id = id; + } + + /** + * + * @param loanType + * @param customer + * @param endorsement + * @param routeCtlg + * @param loanStatus + * @param amountPaid + * @param amountToPay + * @param lastReferenceNumber + * @param comments + * @param createdBy + */ + public Loan(LoanType loanType, People customer, People endorsement, RouteCtlg routeCtlg, LoanStatus loanStatus, BigDecimal amountPaid, BigDecimal amountToPay, Integer lastReferenceNumber, String comments, String createdBy) { + this.loanType = loanType; + this.customer = customer; + this.endorsement = endorsement; + this.routeCtlg = routeCtlg; + this.loanStatus = loanStatus; + this.amountPaid = amountPaid; + this.amountToPay = amountToPay; + this.lastReferenceNumber = lastReferenceNumber; + this.comments = comments; + this.createdBy = createdBy; + this.createdOn = new Date(); + } + + public Loan(LoanType loanType, People customer, People endorsement, RouteCtlg routeCtlg, LoanStatus loanStatus, BigDecimal amountPaid, BigDecimal amountToPay, Integer lastReferenceNumber, String createdBy) { + this.loanType = loanType; + this.customer = customer; + this.endorsement = endorsement; + this.routeCtlg = routeCtlg; + this.loanStatus = loanStatus; + this.amountPaid = amountPaid; + this.amountToPay = amountToPay; + this.lastReferenceNumber = lastReferenceNumber; + this.createdBy = createdBy; + this.createdOn = new Date(); + } + + /** + * Save create on from mobile devices. + * + * @param loanType + * @param customer + * @param endorsement + * @param routeCtlg + * @param loanStatus + * @param amountPaid + * @param amountToPay + * @param lastReferenceNumber + * @param createdBy + * @param createdOn + */ + public Loan(LoanType loanType, People customer, People endorsement, RouteCtlg routeCtlg, LoanStatus loanStatus, BigDecimal amountPaid, BigDecimal amountToPay, Integer lastReferenceNumber, String comments, String createdBy, Date createdOn) { + this.loanType = loanType; + this.customer = customer; + this.endorsement = endorsement; + this.routeCtlg = routeCtlg; + this.loanStatus = loanStatus; + this.amountPaid = amountPaid; + this.amountToPay = amountToPay; + this.lastReferenceNumber = lastReferenceNumber; + this.comments = comments; + this.createdBy = createdBy; + this.createdOn = createdOn; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public LoanType getLoanType() { + return loanType; + } + + public void setLoanType(LoanType loanType) { + this.loanType = loanType; + } + + public People getCustomer() { + return customer; + } + + public void setCustomer(People customer) { + this.customer = customer; + } + + public People getEndorsement() { + return endorsement; + } + + public void setEndorsement(People endorsement) { + this.endorsement = endorsement; + } + + public RouteCtlg getRouteCtlg() { + return routeCtlg; + } + + public void setRouteCtlg(RouteCtlg routeCtlg) { + this.routeCtlg = routeCtlg; + } + + public LoanStatus getLoanStatus() { + return loanStatus; + } + + public void setLoanStatus(LoanStatus loanStatus) { + this.loanStatus = loanStatus; + } + + public ActiveStatus getNewCustomer() { + return newCustomer; + } + + public void setNewCustomer(ActiveStatus newCustomer) { + this.newCustomer = newCustomer; + } + + public BigDecimal getAmountPaid() { + return amountPaid; + } + + public void setAmountPaid(BigDecimal amountPaid) { + this.amountPaid = amountPaid; + } + + public BigDecimal getAmountToPay() { + return amountToPay; + } + + public void setAmountToPay(BigDecimal amountToPay) { + this.amountToPay = amountToPay; + } + + public Integer getLastReferenceNumber() { + return lastReferenceNumber; + } + + public void setLastReferenceNumber(Integer lastReferenceNumber) { + this.lastReferenceNumber = lastReferenceNumber; + } + + 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 List getLoanDetailses() { + return loanDetailses; + } + + public void setLoanDetailses(List loanDetailses) { + this.loanDetailses = loanDetailses; + } + + public List getLoanByUsers() { + return loanByUsers; + } + + public void setLoanByUsers(List loanByUsers) { + this.loanByUsers = loanByUsers; + } + + public List getLoanFeeNotifications() { + return loanFeeNotifications; + } + + public void setLoanFeeNotifications(List loanFeeNotifications) { + this.loanFeeNotifications = loanFeeNotifications; + } + + public List getLoanOldByRenovations() { + return loanOldByRenovations; + } + + public void setLoanOldByRenovations(List loanOldByRenovations) { + this.loanOldByRenovations = loanOldByRenovations; + } + + public List getLoanNewByRenovations() { + return loanNewByRenovations; + } + + public void setLoanNewByRenovations(List loanNewByRenovations) { + this.loanNewByRenovations = loanNewByRenovations; + } + + public String getComments() { + return comments; + } + + public void setComments(String comments) { + this.comments = comments; + } + + public Integer getTotalFeeByLoan() { + if (getLoanFeeNotifications() != null) { + return getLoanFeeNotifications().size(); + } else { + return 0; + } + } + + public String getAsesor() { + if (getLoanByUsers() != null && !getLoanByUsers().isEmpty()) { + return getLoanByUsers().get(0).getUser().getHumanResource().getFirstName() + " " + + getLoanByUsers().get(0).getUser().getHumanResource().getLastName(); + } else { + return ""; + } + } + + public List getDeliverys() { + return deliverys; + } + + public void setDeliverys(List deliverys) { + this.deliverys = deliverys; + } + + public Date getJuridicalDate() { + return juridicalDate; + } + + public void setJuridicalDate(Date juridicalDate) { + this.juridicalDate = juridicalDate; + } + + public ActiveStatus getFrozen() { + if (frozen == null) { + frozen = ActiveStatus.DISABLED; + } + + return frozen; + } + + public void setFrozen(ActiveStatus frozen) { + this.frozen = frozen; + } + + @Override + public String toString() { + return "Loan{" + "loanType=" + loanType + ", createdBy=" + createdBy + '}'; + } + + public String getLoanTypeByDays(){ + + return getLoanType().getLoanTypeName() + " a " +getLoanType().getTotalDays() + " dias"; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/loan/LoanByRenovation.java b/ace-model/src/main/java/com/arrebol/apc/model/loan/LoanByRenovation.java new file mode 100644 index 0000000..9de339d --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/loan/LoanByRenovation.java @@ -0,0 +1,168 @@ +/* + * 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.loan; + +import com.arrebol.apc.model.enums.LoanRenovationStatus; +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Column; +import javax.persistence.EmbeddedId; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Table(name = "APC_LOAN_BY_RENOVATION") +public class LoanByRenovation implements Serializable { + + private static final long serialVersionUID = 6330391021926685986L; + + @EmbeddedId + LoanByRenovationId id; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn( + name = "id_loan_old", + referencedColumnName = "id", + insertable = false, + updatable = false + ) + private Loan loanOld; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn( + name = "id_loan_new", + referencedColumnName = "id", + insertable = false, + updatable = false + ) + private Loan loanNew; + + @Enumerated(EnumType.STRING) + @Column(name = "loan_by_renovation_status", nullable = false) + private LoanRenovationStatus loanRenovationStatus; + + @Column(name = "comments", length = 150) + private String comments; + + @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; + + public LoanByRenovation() { + } + + public LoanByRenovation(LoanByRenovationId id) { + this.id = id; + } + + public LoanByRenovation(LoanByRenovationId id, LoanRenovationStatus loanRenovationStatus, String createdBy, Date createdOn) { + this.id = id; + this.loanRenovationStatus = loanRenovationStatus; + this.createdBy = createdBy; + this.createdOn = createdOn; + } + + public LoanByRenovationId getId() { + return id; + } + + public void setId(LoanByRenovationId id) { + this.id = id; + } + + public Loan getLoanOld() { + return loanOld; + } + + public void setLoanOld(Loan loanOld) { + this.loanOld = loanOld; + } + + public Loan getLoanNew() { + return loanNew; + } + + public void setLoanNew(Loan loanNew) { + this.loanNew = loanNew; + } + + public LoanRenovationStatus getLoanRenovationStatus() { + return loanRenovationStatus; + } + + public void setLoanRenovationStatus(LoanRenovationStatus loanRenovationStatus) { + this.loanRenovationStatus = loanRenovationStatus; + } + + public String getComments() { + return comments; + } + + public void setComments(String comments) { + this.comments = comments; + } + + 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; + } + + @Override + public String toString() { + return "LoanByRenovation{" + "loanOld=" + loanOld + ", loanNew=" + loanNew + ", loanRenovationStatus=" + loanRenovationStatus + ", comments=" + comments + ", createdOn=" + createdOn + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/loan/LoanByRenovationId.java b/ace-model/src/main/java/com/arrebol/apc/model/loan/LoanByRenovationId.java new file mode 100644 index 0000000..db27630 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/loan/LoanByRenovationId.java @@ -0,0 +1,88 @@ +/* + * 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.loan; + +import java.io.Serializable; +import java.util.Objects; +import javax.persistence.Column; +import javax.persistence.Embeddable; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Embeddable +public class LoanByRenovationId implements Serializable { + + private static final long serialVersionUID = 5820034171440805154L; + + @Column(name = "id_loan_old", length = 36, nullable = true) + private String idLoanOld; + + @Column(name = "id_loan_new", length = 36, nullable = true) + private String idUserNew; + + public LoanByRenovationId() { + } + + /** + * + * @param idLoanOld + * @param idUserNew + */ + public LoanByRenovationId(String idLoanOld, String idUserNew) { + this.idLoanOld = idLoanOld; + this.idUserNew = idUserNew; + } + + public String getIdLoanOld() { + return idLoanOld; + } + + public void setIdLoanOld(String idLoanOld) { + this.idLoanOld = idLoanOld; + } + + public String getIdUserNew() { + return idUserNew; + } + + public void setIdUserNew(String idUserNew) { + this.idUserNew = idUserNew; + } + + @Override + public int hashCode() { + int hash = 5; + hash = 41 * hash + Objects.hashCode(this.idLoanOld); + hash = 41 * hash + Objects.hashCode(this.idUserNew); + return hash; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final LoanByRenovationId other = (LoanByRenovationId) obj; + if (!Objects.equals(this.idLoanOld, other.idLoanOld)) { + return false; + } + if (!Objects.equals(this.idUserNew, other.idUserNew)) { + return false; + } + return true; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/loan/LoanByUser.java b/ace-model/src/main/java/com/arrebol/apc/model/loan/LoanByUser.java new file mode 100644 index 0000000..8d334e0 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/loan/LoanByUser.java @@ -0,0 +1,179 @@ +/* + * 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.loan; + +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.enums.LoanStatus; +import com.arrebol.apc.model.enums.OwnerLoan; +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Column; +import javax.persistence.EmbeddedId; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Table(name = "APC_LOAN_BY_USER") +public class LoanByUser implements Serializable { + + private static final long serialVersionUID = 6101775548154917785L; + + @EmbeddedId + private LoanByUserId id; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn( + name = "id_loan", + referencedColumnName = "id", + insertable = false, + updatable = false + ) + private Loan loan; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn( + name = "id_user", + referencedColumnName = "id", + insertable = false, + updatable = false + ) + private User user; + + @Enumerated(EnumType.STRING) + @Column(name = "loan_by_user_status", nullable = false) + private LoanStatus loanByUserStatus; + + @Column(name = "order_in_list") + private Integer orderInList; + + @Column(name = "comments", length = 150) + private String comments; + + @Enumerated(EnumType.STRING) + @Column(name = "owner_loan", nullable = false) + private OwnerLoan ownerLoan; + + @Column(name = "created_by", nullable = false, length = 36) + private String createdBy; + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "created_on", length = 19) + private Date createdOn; + + public LoanByUser() { + } + + /** + * + * @param id + * @param loanByUserStatus + * @param ownerLoan + * @param createdBy + */ + public LoanByUser(LoanByUserId id, LoanStatus loanByUserStatus, OwnerLoan ownerLoan, String createdBy) { + this.id = id; + this.loanByUserStatus = loanByUserStatus; + this.ownerLoan = ownerLoan; + this.createdBy = createdBy; + this.createdOn = new Date(); + } + + /** + * + * @param id + * @param orderInList + */ + public LoanByUser(LoanByUserId id, Integer orderInList) { + this.id = id; + this.orderInList = orderInList; + } + + public LoanByUserId getId() { + return id; + } + + public void setId(LoanByUserId id) { + this.id = id; + } + + public Loan getLoan() { + return loan; + } + + public void setLoan(Loan loan) { + this.loan = loan; + } + + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } + + public LoanStatus getLoanByUserStatus() { + return loanByUserStatus; + } + + public void setLoanByUserStatus(LoanStatus loanByUserStatus) { + this.loanByUserStatus = loanByUserStatus; + } + + public Integer getOrderInList() { + return orderInList; + } + + public void setOrderInList(Integer orderInList) { + this.orderInList = orderInList; + } + + public String getComments() { + return comments; + } + + public void setComments(String comments) { + this.comments = comments; + } + + public OwnerLoan getOwnerLoan() { + return ownerLoan; + } + + public void setOwnerLoan(OwnerLoan ownerLoan) { + this.ownerLoan = ownerLoan; + } + + 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; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/loan/LoanByUserId.java b/ace-model/src/main/java/com/arrebol/apc/model/loan/LoanByUserId.java new file mode 100644 index 0000000..6c807f4 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/loan/LoanByUserId.java @@ -0,0 +1,88 @@ +/* + * 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.loan; + +import java.io.Serializable; +import java.util.Objects; +import javax.persistence.Column; +import javax.persistence.Embeddable; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Embeddable +public class LoanByUserId implements Serializable { + + private static final long serialVersionUID = -8533525004902104723L; + + @Column(name = "id_loan", length = 36, nullable = true) + private String idLoan; + + @Column(name = "id_user", length = 36, nullable = true) + private String idUser; + + public LoanByUserId() { + } + + /** + * + * @param idLoan + * @param idUser + */ + public LoanByUserId(String idLoan, String idUser) { + this.idLoan = idLoan; + this.idUser = idUser; + } + + public String getIdLoan() { + return idLoan; + } + + public void setIdLoan(String idLoan) { + this.idLoan = idLoan; + } + + public String getIdUser() { + return idUser; + } + + public void setIdUser(String idUser) { + this.idUser = idUser; + } + + @Override + public int hashCode() { + int hash = 7; + hash = 47 * hash + Objects.hashCode(this.idLoan); + hash = 47 * hash + Objects.hashCode(this.idUser); + return hash; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final LoanByUserId other = (LoanByUserId) obj; + if (!Objects.equals(this.idLoan, other.idLoan)) { + return false; + } + if (!Objects.equals(this.idUser, other.idUser)) { + return false; + } + return true; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/loan/LoanDetails.java b/ace-model/src/main/java/com/arrebol/apc/model/loan/LoanDetails.java new file mode 100644 index 0000000..9dc0695 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/loan/LoanDetails.java @@ -0,0 +1,345 @@ +/* + * 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.loan; + +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.enums.FeeStatus; +import com.arrebol.apc.model.enums.LoanDetailsType; +import com.arrebol.apc.model.enums.PeopleType; +import com.arrebol.apc.model.enums.TransferStatus; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.Transient; +import javax.persistence.UniqueConstraint; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Table(name = "APC_LOAN_DETAIL", + uniqueConstraints = { + @UniqueConstraint(columnNames = {"id", "reference_number"}, name = "apc_loan_details_uk") + }) +public class LoanDetails implements Serializable { + + private static final long serialVersionUID = -6757564734339598051L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_loan", + referencedColumnName = "id", + nullable = false + ) + private Loan loan; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_user", + referencedColumnName = "id", + nullable = false + ) + private User user; + + @Enumerated(EnumType.STRING) + @Column(name = "people_type", nullable = false) + private PeopleType peopleType; + + @Column(name = "payment_amount", nullable = false) + private BigDecimal paymentAmount; + + @Column(name = "reference_number") + private Integer referenceNumber; + + @Enumerated(EnumType.STRING) + @Column(name = "loan_details_type", nullable = false) + private LoanDetailsType loanDetailsType; + + @Column(name = "loan_comments", length = 150) + private String comments; + + @Enumerated(EnumType.STRING) + @Column(name = "fee_status") + private FeeStatus feeStatus; + + @Enumerated(EnumType.STRING) + @Column(name = "transfer_status") + private TransferStatus transferStatus; + + @Column(name = "transfer_number", length = 150) + private String transferNumber; + + @Column(name = "created_by", nullable = false, length = 36) + private String createdBy; + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "created_on", length = 19) + private Date createdOn; + + @Transient + private BigDecimal saldoInsoluto; + + public LoanDetails() { + } + + /** + * + * @param id + * @param createdOn + * @param feeStatus + */ + public LoanDetails(String id, Date createdOn, FeeStatus feeStatus) { + this.id = id; + this.createdOn = createdOn; + this.feeStatus = feeStatus; + } + + /** + * Complete constructor. + * + * @param id + * @param loan + * @param peopleType + * @param paymentAmount + * @param loanDetailsType + * @param comments + * @param createdBy + * @param createdOn + */ + public LoanDetails(String id, Loan loan, PeopleType peopleType, BigDecimal paymentAmount, LoanDetailsType loanDetailsType, String comments, String createdBy, Date createdOn) { + this.id = id; + this.loan = loan; + this.peopleType = peopleType; + this.paymentAmount = paymentAmount; + this.loanDetailsType = loanDetailsType; + this.comments = comments; + this.createdBy = createdBy; + this.createdOn = createdOn; + } + + /** + * + * @param id + * @param loan + * @param user + * @param peopleType + * @param referenceNumber + * @param paymentAmount + * @param loanDetailsType + * @param comments + * @param createdBy + * @param createdOn + */ + public LoanDetails(String id, Loan loan, User user, PeopleType peopleType, Integer referenceNumber, BigDecimal paymentAmount, LoanDetailsType loanDetailsType, String comments, String createdBy, Date createdOn) { + this.id = id; + this.loan = loan; + this.user = user; + this.peopleType = peopleType; + this.referenceNumber = referenceNumber; + this.paymentAmount = paymentAmount; + this.loanDetailsType = loanDetailsType; + this.comments = comments; + this.createdBy = createdBy; + this.createdOn = createdOn; + } + + /** + * Add new amount. + * + * @param loan + * @param user + * @param peopleType + * @param paymentAmount + * @param referenceNumber + * @param loanDetailsType + * @param createdBy + * @param createdOn + * @param comments + */ + public LoanDetails(Loan loan, User user, PeopleType peopleType, BigDecimal paymentAmount, Integer referenceNumber, LoanDetailsType loanDetailsType, String createdBy, Date createdOn, String comments) { + this.loan = loan; + this.user = user; + this.peopleType = peopleType; + this.paymentAmount = paymentAmount; + this.referenceNumber = referenceNumber; + this.loanDetailsType = loanDetailsType; + this.createdBy = createdBy; + this.createdOn = createdOn; + this.comments = comments; + } + + /** + * + * @param loan + * @param user + * @param peopleType + * @param paymentAmount + * @param referenceNumber + * @param loanDetailsType + * @param createdBy + * @param createdOn + * @param comments + * @param transferNumber + * @param transferStatus + */ + public LoanDetails(Loan loan, User user, PeopleType peopleType, BigDecimal paymentAmount, Integer referenceNumber, LoanDetailsType loanDetailsType, String createdBy, Date createdOn, String comments, String transferNumber, TransferStatus transferStatus) { + this.loan = loan; + this.user = user; + this.peopleType = peopleType; + this.paymentAmount = paymentAmount; + this.referenceNumber = referenceNumber; + this.loanDetailsType = loanDetailsType; + this.createdBy = createdBy; + this.createdOn = createdOn; + this.comments = comments; + this.transferNumber = transferNumber; + this.transferStatus = transferStatus; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Loan getLoan() { + return loan; + } + + public void setLoan(Loan loan) { + this.loan = loan; + } + + public PeopleType getPeopleType() { + return peopleType; + } + + public void setPeopleType(PeopleType peopleType) { + this.peopleType = peopleType; + } + + public BigDecimal getPaymentAmount() { + return paymentAmount; + } + + public void setPaymentAmount(BigDecimal paymentAmount) { + this.paymentAmount = paymentAmount; + } + + public Integer getReferenceNumber() { + return referenceNumber; + } + + public void setReferenceNumber(Integer referenceNumber) { + this.referenceNumber = referenceNumber; + } + + public LoanDetailsType getLoanDetailsType() { + return loanDetailsType; + } + + public void setLoanDetailsType(LoanDetailsType loanDetailsType) { + this.loanDetailsType = loanDetailsType; + } + + public String getComments() { + return comments; + } + + public void setComments(String comments) { + this.comments = comments; + } + + public FeeStatus getFeeStatus() { + return feeStatus; + } + + public void setFeeStatus(FeeStatus feeStatus) { + this.feeStatus = feeStatus; + } + + public TransferStatus getTransferStatus() { + return transferStatus; + } + + public void setTransferStatus(TransferStatus transferStatus) { + this.transferStatus = transferStatus; + } + + public String getTransferNumber() { + return transferNumber; + } + + public void setTransferNumber(String transferNumber) { + this.transferNumber = transferNumber; + } + + 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 User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } + + public BigDecimal getSaldoInsoluto() { + return saldoInsoluto; + } + + public void setSaldoInsoluto(BigDecimal saldoInsoluto) { + this.saldoInsoluto = saldoInsoluto; + } + + public Double getAbonoD() { + return getPaymentAmount().doubleValue(); + } + + @Override + public String toString() { + return "LoanDetails{" + "referenceNumber=" + referenceNumber + ", comments=" + comments + ", createdBy=" + createdBy + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/loan/LoanFeeNotification.java b/ace-model/src/main/java/com/arrebol/apc/model/loan/LoanFeeNotification.java new file mode 100644 index 0000000..d696d61 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/loan/LoanFeeNotification.java @@ -0,0 +1,139 @@ +/* + * 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.loan; + +import com.arrebol.apc.model.core.User; +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Table(name = "APC_LOAN_FEE_NOTIFICATION") +public class LoanFeeNotification implements Serializable { + + private static final long serialVersionUID = -6178422651111540801L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_loan", + referencedColumnName = "id", + nullable = false + ) + private Loan loan; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_user", + referencedColumnName = "id", + nullable = false + ) + private User user; + + @Column(name = "notification_number", nullable = false, length = 36) + private Integer notificationNumber; + + @Column(name = "created_by", nullable = false, length = 36) + private String createdBy; + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "created_on", length = 19) + private Date createdOn; + + public LoanFeeNotification() { + } + + /** + * + * @param loan + * @param user + * @param notificationNumber + * @param createdBy + * @param createdOn + */ + public LoanFeeNotification(Loan loan, User user, Integer notificationNumber, String createdBy, Date createdOn) { + this.loan = loan; + this.user = user; + this.notificationNumber = notificationNumber; + this.createdBy = createdBy; + this.createdOn = createdOn; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Loan getLoan() { + return loan; + } + + public void setLoan(Loan loan) { + this.loan = loan; + } + + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } + + public Integer getNotificationNumber() { + return notificationNumber; + } + + public void setNotificationNumber(Integer notificationNumber) { + this.notificationNumber = notificationNumber; + } + + 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; + } + + @Override + public String toString() { + return "LoanFeeNotification{" + "notificationNumber=" + notificationNumber + ", createdBy=" + createdBy + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/loan/LoanType.java b/ace-model/src/main/java/com/arrebol/apc/model/loan/LoanType.java new file mode 100644 index 0000000..8cae39c --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/loan/LoanType.java @@ -0,0 +1,391 @@ +/* + * 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.loan; + +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.enums.DaysInWeekend; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Table(name = "APC_LOAN_TYPE") +public class LoanType implements Serializable { + + private static final long serialVersionUID = 1286109384972738375L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @Column(name = "loan_type_name", length = 50, nullable = false) + private String loanTypeName; + + @Column(name = "total_days", nullable = false) + private Integer totalDays; + + @Column(name = "loan_fee", nullable = false) + private BigDecimal fee; + + @Column(name = "opening_fee", nullable = false) + private Integer openingFee; + + @Column(name = "payment", nullable = false) + private BigDecimal payment; + + @Column(name = "payment_daily", nullable = false) + private BigDecimal paymentDaily; + + @Column(name = "payment_total", nullable = false) + private BigDecimal paymentTotal; + + @Enumerated(EnumType.STRING) + @Column(name = "payment_monday") + private DaysInWeekend monday; + + @Enumerated(EnumType.STRING) + @Column(name = "payment_tuesday") + private DaysInWeekend tuesday; + + @Enumerated(EnumType.STRING) + @Column(name = "payment_wednesday") + private DaysInWeekend wednesday; + + @Enumerated(EnumType.STRING) + @Column(name = "payment_thursday") + private DaysInWeekend thursday; + + @Enumerated(EnumType.STRING) + @Column(name = "payment_friday") + private DaysInWeekend friday; + + @Enumerated(EnumType.STRING) + @Column(name = "payment_saturday") + private DaysInWeekend saturday; + + @Enumerated(EnumType.STRING) + @Column(name = "payment_sunday") + private DaysInWeekend sunday; + + @Enumerated(EnumType.STRING) + @Column(name = "convenio", nullable = false) + private ActiveStatus convenio; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_office", + referencedColumnName = "id", + nullable = false + ) + private Office office; + + @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; + + @OneToMany( + mappedBy = "loanType", + cascade = CascadeType.ALL, + fetch = FetchType.LAZY, + orphanRemoval = true + ) + private List loans; + + public LoanType() { + } + + /** + * + * @param id + */ + public LoanType(String id) { + this.id = id; + } + + /** + * Complete constructor. + * + * @param id + * @param loanTypeName + * @param totalDays + * @param fee + * @param paymentDaily + * @param paymentTotal + * @param monday + * @param tuesday + * @param wednesday + * @param thursday + * @param friday + * @param saturday + * @param sunday + * @param office + * @param createdBy + * @param createdOn + * @param lastUpdatedBy + * @param lastUpdatedOn + * @param loans + */ + public LoanType(String id, String loanTypeName, Integer totalDays, BigDecimal fee, BigDecimal paymentDaily, BigDecimal paymentTotal, DaysInWeekend monday, DaysInWeekend tuesday, DaysInWeekend wednesday, DaysInWeekend thursday, DaysInWeekend friday, DaysInWeekend saturday, DaysInWeekend sunday, Office office, String createdBy, Date createdOn, String lastUpdatedBy, Date lastUpdatedOn, List loans) { + this.id = id; + this.loanTypeName = loanTypeName; + this.totalDays = totalDays; + this.fee = fee; + this.paymentDaily = paymentDaily; + this.paymentTotal = paymentTotal; + this.monday = monday; + this.tuesday = tuesday; + this.wednesday = wednesday; + this.thursday = thursday; + this.friday = friday; + this.saturday = saturday; + this.sunday = sunday; + this.office = office; + this.createdBy = createdBy; + this.createdOn = createdOn; + this.lastUpdatedBy = lastUpdatedBy; + this.lastUpdatedOn = lastUpdatedOn; + this.loans = loans; + } + + /** + * + * @param id + * @param payment + */ + public LoanType(String id, BigDecimal payment) { + this.id = id; + this.payment = payment; + } + + /** + * + * @param id + * @param payment + * @param loanTypeName + */ + public LoanType(String id, BigDecimal payment, String loanTypeName) { + this.id = id; + this.payment = payment; + this.loanTypeName = loanTypeName; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getLoanTypeName() { + return loanTypeName; + } + + public void setLoanTypeName(String loanTypeName) { + this.loanTypeName = loanTypeName; + } + + public Integer getTotalDays() { + return totalDays; + } + + public void setTotalDays(Integer totalDays) { + this.totalDays = totalDays; + } + + public BigDecimal getFee() { + return fee; + } + + public void setFee(BigDecimal fee) { + this.fee = fee; + } + + public Integer getOpeningFee() { + return openingFee; + } + + public void setOpeningFee(Integer openingFee) { + this.openingFee = openingFee; + } + + public BigDecimal getPayment() { + return payment; + } + + public void setPayment(BigDecimal payment) { + this.payment = payment; + } + + public BigDecimal getPaymentDaily() { + return paymentDaily; + } + + public void setPaymentDaily(BigDecimal paymentDaily) { + this.paymentDaily = paymentDaily; + } + + public BigDecimal getPaymentTotal() { + return paymentTotal; + } + + public void setPaymentTotal(BigDecimal paymentTotal) { + this.paymentTotal = paymentTotal; + } + + public DaysInWeekend getMonday() { + return monday; + } + + public void setMonday(DaysInWeekend monday) { + this.monday = monday; + } + + public DaysInWeekend getTuesday() { + return tuesday; + } + + public void setTuesday(DaysInWeekend tuesday) { + this.tuesday = tuesday; + } + + public DaysInWeekend getWednesday() { + return wednesday; + } + + public void setWednesday(DaysInWeekend wednesday) { + this.wednesday = wednesday; + } + + public DaysInWeekend getThursday() { + return thursday; + } + + public void setThursday(DaysInWeekend thursday) { + this.thursday = thursday; + } + + public DaysInWeekend getFriday() { + return friday; + } + + public void setFriday(DaysInWeekend friday) { + this.friday = friday; + } + + public DaysInWeekend getSaturday() { + return saturday; + } + + public void setSaturday(DaysInWeekend saturday) { + this.saturday = saturday; + } + + public DaysInWeekend getSunday() { + return sunday; + } + + public void setSunday(DaysInWeekend sunday) { + this.sunday = sunday; + } + + public Office getOffice() { + return office; + } + + public void setOffice(Office office) { + this.office = office; + } + + 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 List getLoans() { + return loans; + } + + public void setLoans(List loans) { + this.loans = loans; + } + + public ActiveStatus getConvenio() { + return convenio; + } + + public void setConvenio(ActiveStatus convenio) { + this.convenio = convenio; + } + + @Override + public String toString() { + return "LoanType{" + "loanTypeName=" + loanTypeName + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/mobile/access/MobileUser.java b/ace-model/src/main/java/com/arrebol/apc/model/mobile/access/MobileUser.java new file mode 100644 index 0000000..1de0578 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/mobile/access/MobileUser.java @@ -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.mobile.access; + +import com.arrebol.apc.model.enums.ActiveStatus; +import java.io.Serializable; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.Id; +import javax.persistence.Table; +import org.hibernate.annotations.Immutable; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Immutable +@Table(name = "APC_SECURITY_AUTHENTICATION_MOBILE") +public class MobileUser implements Serializable { + + private static final long serialVersionUID = -6025180801746858060L; + + @Id + @Column(name = "id", length = 36) + private String id; + + @Column(name = "user_name", length = 36) + private String userName; + + @Column(name = "pwd", length = 100) + private String password; + + @Column(name = "avatar", length = 150) + private String avatar; + + @Column(name = "id_office", length = 36) + private String officeId; + + @Column(name = "id_route", length = 36) + private String routeId; + + @Column(name = "certifier", length = 25) + private String certifier; + + @Enumerated(EnumType.STRING) + @Column(name = "management", nullable = false) + private ActiveStatus management; + + public MobileUser() { + } + + public MobileUser(String userName, String password) { + this.userName = userName; + this.password = password; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getAvatar() { + return avatar; + } + + public void setAvatar(String avatar) { + this.avatar = avatar; + } + + public String getOfficeId() { + return officeId; + } + + public void setOfficeId(String officeId) { + this.officeId = officeId; + } + + public String getRouteId() { + return routeId; + } + + public void setRouteId(String routeId) { + this.routeId = routeId; + } + + public String getCertifier() { + return certifier; + } + + public void setCertifier(String certifier) { + this.certifier = certifier; + } + + public ActiveStatus getManagement() { + return management; + } + + public void setManagement(ActiveStatus management) { + this.management = management; + } + + @Override + public String toString() { + return "Authentication{" + "userName=" + userName + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/mobile/preference/UserMobilePreference.java b/ace-model/src/main/java/com/arrebol/apc/model/mobile/preference/UserMobilePreference.java new file mode 100644 index 0000000..6ae13bd --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/mobile/preference/UserMobilePreference.java @@ -0,0 +1,186 @@ +/* + * 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.mobile.preference; + +import com.arrebol.apc.model.core.User; +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.UniqueConstraint; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Table(name = "APC_USER_MOBILE_PREFERECE", + uniqueConstraints = { + @UniqueConstraint( + columnNames = {"id_user", "preference_name"}, + name = "apc_user_mobile_preference_uk") + } +) +public class UserMobilePreference implements Serializable { + + private static final long serialVersionUID = -7248171471566169076L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_user", + referencedColumnName = "id", + nullable = false + ) + private User user; + + @Column(name = "preference_name", nullable = false, length = 25) + private String preferenceName; + + @Column(name = "preference_value", nullable = false, length = 25) + private String preferenceValue; + + @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; + + public UserMobilePreference() { + } + + /** + * Complete constructor. + * + * @param id + * @param user + * @param preferenceName + * @param preferenceValue + * @param createdBy + * @param createdOn + * @param lastUpdatedBy + * @param lastUpdatedOn + */ + public UserMobilePreference(String id, User user, String preferenceName, String preferenceValue, String createdBy, Date createdOn, String lastUpdatedBy, Date lastUpdatedOn) { + this.id = id; + this.user = user; + this.preferenceName = preferenceName; + this.preferenceValue = preferenceValue; + this.createdBy = createdBy; + this.createdOn = createdOn; + this.lastUpdatedBy = lastUpdatedBy; + this.lastUpdatedOn = lastUpdatedOn; + } + + /** + * + * @param user + * @param preferenceName + * @param preferenceValue + * @param createdBy + */ + public UserMobilePreference(User user, String preferenceName, String preferenceValue, String createdBy) { + this.user = user; + this.preferenceName = preferenceName; + this.preferenceValue = preferenceValue; + this.createdBy = createdBy; + this.createdOn = new Date(); + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } + + public String getPreferenceName() { + return preferenceName; + } + + public void setPreferenceName(String preferenceName) { + this.preferenceName = preferenceName; + } + + public String getPreferenceValue() { + return preferenceValue; + } + + public void setPreferenceValue(String preferenceValue) { + this.preferenceValue = preferenceValue; + } + + 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; + } + + @Override + public String toString() { + return "UserMobilePreference{" + "user=" + user + ", preferenceName=" + preferenceName + ", preferenceValue=" + preferenceValue + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/payroll/Payroll.java b/ace-model/src/main/java/com/arrebol/apc/model/payroll/Payroll.java new file mode 100644 index 0000000..fd8a0eb --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/payroll/Payroll.java @@ -0,0 +1,392 @@ +/* + * 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.payroll; + +import com.arrebol.apc.model.admin.ExpenseCompany; +import com.arrebol.apc.model.core.HumanResource; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.enums.ActiveStatus; +import java.io.Serializable; +import java.math.BigDecimal; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Entity +@Table(name = "APC_PAYROLL") +public class Payroll implements Serializable { + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_human_resource", + referencedColumnName = "id", + nullable = false + ) + private HumanResource humanResource; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_office", + referencedColumnName = "id", + nullable = false + ) + private Office office; + + @Enumerated(EnumType.STRING) + @Column(name = "active_status", nullable = false) + private ActiveStatus activeStatus; + + @Column(name = "salary", nullable = false) + private BigDecimal salary; + + @Column(name = "imss", nullable = false) + private BigDecimal imss; + + @Column(name = "advance", nullable = false) + private BigDecimal advance; + + @Column(name = "total_bonus_new_customer", nullable = false) + private BigDecimal totalBonusNewCustomer; + + @Column(name = "total_bonus_colocation", nullable = false) + private BigDecimal totalBonusColocation; + + @Column(name = "total_bonus_mora", nullable = false) + private BigDecimal totalBonusMora; + + @Column(name = "discounts", nullable = false) + private BigDecimal discounts; + + @Column(name = "increases", nullable = false) + private BigDecimal increases; + + @Column(name = "total_payment", nullable = false) + private BigDecimal totalPayment; + + @Column(name = "total_days_salary", nullable = false) + private Integer totalDaysSalary; + + @Column(name = "total_days_bonus", nullable = false) + private Integer totalDaysBonus; + + @Column(name = "comments_discounts", length = 200) + private String commentsDiscounts; + + @Column(name = "comments_increases", length = 200) + private String commentsIncreases; + + @Column(name = "observation", length = 200) + private String observation; + + @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; + + @Column(name = "boxed", nullable = false) + private BigDecimal boxed; + + @Column(name = "saving", nullable = false) + private BigDecimal saving; + + @Column(name = "payment_to_debt", nullable = false) + private BigDecimal paymentToDebt; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "created_by", + referencedColumnName = "id", + insertable = false, + updatable = false, + nullable = false + ) + private User user; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public HumanResource getHumanResource() { + return humanResource; + } + + public void setHumanResource(HumanResource humanResource) { + this.humanResource = humanResource; + } + + public Office getOffice() { + return office; + } + + public void setOffice(Office office) { + this.office = office; + } + + public ActiveStatus getActiveStatus() { + return activeStatus; + } + + public void setActiveStatus(ActiveStatus activeStatus) { + this.activeStatus = activeStatus; + } + + public BigDecimal getSalary() { + return salary; + } + + public void setSalary(BigDecimal salary) { + this.salary = salary; + } + + public BigDecimal getImss() { + return imss; + } + + public void setImss(BigDecimal imss) { + this.imss = imss; + } + + public BigDecimal getAdvance() { + return advance; + } + + public void setAdvance(BigDecimal advance) { + this.advance = advance; + } + + public BigDecimal getTotalBonusNewCustomer() { + return totalBonusNewCustomer; + } + + public void setTotalBonusNewCustomer(BigDecimal totalBonusNewCustomer) { + this.totalBonusNewCustomer = totalBonusNewCustomer; + } + + public BigDecimal getTotalBonusColocation() { + return totalBonusColocation; + } + + public void setTotalBonusColocation(BigDecimal totalBonusColocation) { + this.totalBonusColocation = totalBonusColocation; + } + + public BigDecimal getTotalBonusMora() { + return totalBonusMora; + } + + public void setTotalBonusMora(BigDecimal totalBonusMora) { + this.totalBonusMora = totalBonusMora; + } + + public BigDecimal getDiscounts() { + return discounts; + } + + public void setDiscounts(BigDecimal discounts) { + this.discounts = discounts; + } + + public BigDecimal getIncreases() { + return increases; + } + + public void setIncreases(BigDecimal increases) { + this.increases = increases; + } + + public BigDecimal getTotalPayment() { + return totalPayment; + } + + public void setTotalPayment(BigDecimal totalPayment) { + this.totalPayment = totalPayment; + } + + public Integer getTotalDaysSalary() { + return totalDaysSalary; + } + + public void setTotalDaysSalary(Integer totalDaysSalary) { + this.totalDaysSalary = totalDaysSalary; + } + + public Integer getTotalDaysBonus() { + return totalDaysBonus; + } + + public void setTotalDaysBonus(Integer totalDaysBonus) { + this.totalDaysBonus = totalDaysBonus; + } + + public String getCommentsDiscounts() { + return commentsDiscounts; + } + + public void setCommentsDiscounts(String commentsDiscounts) { + this.commentsDiscounts = commentsDiscounts; + } + + public String getCommentsIncreases() { + return commentsIncreases; + } + + public void setCommentsIncreases(String commentsIncreases) { + this.commentsIncreases = commentsIncreases; + } + + public String getObservation() { + return observation; + } + + public void setObservation(String observation) { + this.observation = observation; + } + + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public Date getCreatedOn() { + return createdOn; + } + + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } + + + + public boolean getAction(Date lastStableGeneralBox) { + Date date = createdOn; + boolean action = true; + try { + SimpleDateFormat dt1 = new SimpleDateFormat("yyyy-MM-dd"); + + String dateStr = dt1.format(date); + date = dt1.parse(dateStr); + + action = date.after(lastStableGeneralBox); + + } catch (ParseException ex) { + Logger.getLogger(ExpenseCompany.class.getName()).log(Level.SEVERE, null, ex); + } + return action; + } + + 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 BigDecimal getBoxed() { + return boxed; + } + + public void setBoxed(BigDecimal boxed) { + this.boxed = boxed; + } + + public BigDecimal getSaving() { + return saving; + } + + public void setSaving(BigDecimal saving) { + this.saving = saving; + } + + public BigDecimal getPaymentToDebt() { + return paymentToDebt; + } + + public void setPaymentToDebt(BigDecimal paymentToDebt) { + this.paymentToDebt = paymentToDebt; + } + + public BigDecimal summaryPerceptions() { + return salary.add(totalBonusNewCustomer).add(totalBonusColocation).add(totalBonusMora).add(increases); + } + + public String conditionEnabled() { + if (getActiveStatus() == ActiveStatus.DISABLED) { + return "grayRow"; + } else { + return null; + } + } + + public boolean getActive() { + if (activeStatus == ActiveStatus.ENEBLED) { + return true; + } else { + return false; + } + + } +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/payroll/TotalExpectedPaymentDailyByUser.java b/ace-model/src/main/java/com/arrebol/apc/model/payroll/TotalExpectedPaymentDailyByUser.java new file mode 100644 index 0000000..29140e3 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/payroll/TotalExpectedPaymentDailyByUser.java @@ -0,0 +1,169 @@ +/* + * 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.payroll; + +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.enums.ActiveStatus; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author Oscar Vargas + */ +@Entity +@Table(name = "APC_TOTAL_EXPECTED_PAYMENT_DAILY_BY_USER") +public class TotalExpectedPaymentDailyByUser implements Serializable { + + private static final long serialVersionUID = -4380548310735493011L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_user", + referencedColumnName = "id", + nullable = false + ) + private User user; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_office", + referencedColumnName = "id", + nullable = false + ) + private Office office; + + @Column(name = "total_expected", nullable = false) + private BigDecimal totalExpected; + + @Column(name = "total_expected_payment") + private BigDecimal totalExpectedPayment; + + @Enumerated(EnumType.STRING) + @Column(name = "active_status", nullable = false) + private ActiveStatus activeStatus; + + @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; + + public TotalExpectedPaymentDailyByUser() { + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } + + public Office getOffice() { + return office; + } + + public void setOffice(Office office) { + this.office = office; + } + + public BigDecimal getTotalExpected() { + return totalExpected; + } + + public void setTotalExpected(BigDecimal totalExpected) { + this.totalExpected = totalExpected; + } + + public ActiveStatus getActiveStatus() { + return activeStatus; + } + + public void setActiveStatus(ActiveStatus activeStatus) { + this.activeStatus = activeStatus; + } + + 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 BigDecimal getTotalExpectedPayment() { + return totalExpectedPayment; + } + + public void setTotalExpectedPayment(BigDecimal totalExpectedPayment) { + this.totalExpectedPayment = totalExpectedPayment; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/payroll/constance/PayRollCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/payroll/constance/PayRollCfg.java new file mode 100644 index 0000000..d4067c0 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/payroll/constance/PayRollCfg.java @@ -0,0 +1,40 @@ +/* + * 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.payroll.constance; + +import com.arrebol.apc.model.core.constance.GenericCfg; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public interface PayRollCfg extends GenericCfg { + + String QUERY_SUM_ALL_ADVANCE_BY_USER = "totalAdvanceForDatesByUser"; + String QUERY_COUNT_NEW_CUSTOMER_FOR_LOANS_BY_USER = "totalNewCustomerLoansByUser"; + String QUERY_SUM_FOR_LOANS_BY_USER = "totalLoansByUserForDates"; + String QUERY_FIND_GOAL_BY_DATES = "getGoalByDates"; + String QUERY_FIND_LAST_GOAL = "getLastGoal"; + String QUERY_SUM_LOAN_DETAILS_PAYMENT_BY_USER = "getLoanDetailsByUserForDates"; + String QUERY_SUM_LOAN_DETAILS_FEE_BY_USER = "getFeeByUserForDates"; + String QUERY_FIND_PAYROLL_BY_OFFICE = "findAllPayrollByOffice"; + String QUERY_FIND_PAYROLL_BY_OFFICE_BETWEEN_DATES = "findAllPayrollByOfficeBetweenDates"; + String QUERY_UPDATE_PAYROLL_BY_STATUS = "updatePayrollByStatus"; + String QUERY_SUM_DIFERENCES_BETWEEN_CLOSING_DAY_BY_USER = "getDiscountByUserThisWeek"; + String QUERY_SUM_DIFERENCES_BY_USER = "sumAllDiferencesByUser"; + String QUERY_SUM_OPENING_FEE_BY_USER = "totalComisionAperturaByUserForDates"; + String QUERY_SUM_TOTAL_EXPECTED_FOR_WEEK_BY_USER = "totalExpectedWeekByUser"; + + String FIELD_OFFICE = "office"; + String FIELD_USER = "user"; + String FIELD_USER_ID = "idUser"; + String FIELD_ACTIVE_STATUS = "activeStatus"; + String FIELD_HUMAN_RESOURCE = "humanResource"; + String FIELD_DATE_INIT = "dateInit"; + String FIELD_DATE_END = "dateEnd"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/payroll/constance/TotalExpectedPaymentDailyByUserCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/payroll/constance/TotalExpectedPaymentDailyByUserCfg.java new file mode 100644 index 0000000..6111ba3 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/payroll/constance/TotalExpectedPaymentDailyByUserCfg.java @@ -0,0 +1,25 @@ +/* + * 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.payroll.constance; + +import com.arrebol.apc.model.core.constance.GenericCfg; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public interface TotalExpectedPaymentDailyByUserCfg extends GenericCfg{ + + String QUERY_FIND_ALL_BY_OFFICE = "findAllTotalExpectedPaymentDailyByUserByOffice"; + String QUERY_UPDATE_BY_STATUS = "updateTotalExpectedPaymentDailyByUserByStatus"; + String QUERY_SELECT_MAX_DATE_BY_CURDATE = "verifyTotalExpectedPaymentDailyByUserCreatedByOffice"; + + String FIELD_OFFICE = "office"; + String FIELD_ACTIVE_STATUS = "activeStatus"; + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/reports/UserWeekReport.java b/ace-model/src/main/java/com/arrebol/apc/model/reports/UserWeekReport.java new file mode 100644 index 0000000..b217e94 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/reports/UserWeekReport.java @@ -0,0 +1,129 @@ +/* + * 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.reports; + +import java.io.Serializable; +import java.util.Objects; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; +import org.hibernate.annotations.Immutable; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Immutable +@Table(name = "APC_USER_WEEK_REPORT_VIEW") +public class UserWeekReport implements Serializable { + + private static final long serialVersionUID = -1257291916093653466L; + + @Id + @Column(name = "id_user", length = 36) + private String id; + + @Column(name = "payment_week") + private Double paymentWeek; + + @Column(name = "total_new_customer_currweek") + private Integer totalNewCustomerCurrweek; + + @Column(name = "debit_week") + private Double debitWeek; + + @Column(name = "total_approved_loan") + private Long totalApprovedLoan; + + @Column(name = "total_to_delivery_loan") + private Long totalToDeliveryLoan; + + public UserWeekReport() { + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Double getPaymentWeek() { + return paymentWeek; + } + + public void setPaymentWeek(Double paymentWeek) { + this.paymentWeek = paymentWeek; + } + + public Integer getTotalNewCustomerCurrweek() { + return totalNewCustomerCurrweek; + } + + public void setTotalNewCustomerCurrweek(Integer totalNewCustomerCurrweek) { + this.totalNewCustomerCurrweek = totalNewCustomerCurrweek; + } + + public Double getDebitWeek() { + return debitWeek; + } + + public void setDebitWeek(Double debitWeek) { + this.debitWeek = debitWeek; + } + + public Long getTotalApprovedLoan() { + return totalApprovedLoan; + } + + public void setTotalApprovedLoan(Long totalApprovedLoan) { + this.totalApprovedLoan = totalApprovedLoan; + } + + public Long getTotalToDeliveryLoan() { + return totalToDeliveryLoan; + } + + public void setTotalToDeliveryLoan(Long totalToDeliveryLoan) { + this.totalToDeliveryLoan = totalToDeliveryLoan; + } + + @Override + public String toString() { + return "UserWeekReport{" + "id=" + id + '}'; + } + + @Override + public int hashCode() { + int hash = 7; + hash = 89 * hash + Objects.hashCode(this.id); + return hash; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final UserWeekReport other = (UserWeekReport) obj; + if (!Objects.equals(this.id, other.id)) { + return false; + } + return true; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/reports/constance/UserWeekReportCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/reports/constance/UserWeekReportCfg.java new file mode 100644 index 0000000..8c523e9 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/reports/constance/UserWeekReportCfg.java @@ -0,0 +1,19 @@ +/* + * 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.reports.constance; + +import com.arrebol.apc.model.core.constance.GenericCfg; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface UserWeekReportCfg extends GenericCfg { + + String QUERY_FIND_USER_WEEK_REPORT_BY_USER = "findUserWeekReportDetailsByUser"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/system/logs/Bitacora.java b/ace-model/src/main/java/com/arrebol/apc/model/system/logs/Bitacora.java new file mode 100644 index 0000000..b87f7f7 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/system/logs/Bitacora.java @@ -0,0 +1,155 @@ +/* + * 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.system.logs; + +import com.arrebol.apc.model.core.Office; +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Entity +@Table(name = "APC_BITACORA") +public class Bitacora implements Serializable{ + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_office", + referencedColumnName = "id", + nullable = false + ) + private Office office; + + @Column(name = "comments_user", length = 300) + private String commentsUser; + + @Column(name = "action", length = 50) + private String action; + + @Column(name = "description", length = 300) + private String description; + + @Column(name = "name_user", length = 200) + private String nameUser; + + @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; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Office getOffice() { + return office; + } + + public void setOffice(Office office) { + this.office = office; + } + + public String getCommentsUser() { + return commentsUser; + } + + public void setCommentsUser(String commentsUser) { + this.commentsUser = commentsUser; + } + + public String getAction() { + return action; + } + + public void setAction(String action) { + this.action = action; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getNameUser() { + return nameUser; + } + + public void setNameUser(String nameUser) { + this.nameUser = nameUser; + } + + 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; + } + + + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/system/logs/ErrorAppLog.java b/ace-model/src/main/java/com/arrebol/apc/model/system/logs/ErrorAppLog.java new file mode 100644 index 0000000..d3fb40f --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/system/logs/ErrorAppLog.java @@ -0,0 +1,122 @@ +/* + * 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.system.logs; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.NamedQueries; +import org.hibernate.annotations.NamedQuery; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Table(name = "APC_ERROR_APP_LOG") +@NamedQueries({ + @NamedQuery(name = "get_all_error_app_log", query = "FROM ErrorAppLog") +}) +public class ErrorAppLog implements Serializable { + + private static final long serialVersionUID = -9099186680609371679L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id_log", length = 36) + private String id; + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "log_entry_date", length = 19) + private Date logEntryDate; + + @Column(name = "log_logger", length = 100) + private String logLogger; + + @Column(name = "log_level", length = 100) + private String logLevel; + + @Column(name = "log_message", length = 250) + private String logMessage; + + @Column(name = "log_exception", length = 4000) + private String logException; + + public ErrorAppLog() { + } + + public ErrorAppLog(String id, Date logEntryDate, String logLogger, String logLevel, String logMessage, String logException) { + this.id = id; + this.logEntryDate = logEntryDate; + this.logLogger = logLogger; + this.logLevel = logLevel; + this.logMessage = logMessage; + this.logException = logException; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Date getLogEntryDate() { + return logEntryDate; + } + + public void setLogEntryDate(Date logEntryDate) { + this.logEntryDate = logEntryDate; + } + + public String getLogLogger() { + return logLogger; + } + + public void setLogLogger(String logLogger) { + this.logLogger = logLogger; + } + + public String getLogLevel() { + return logLevel; + } + + public void setLogLevel(String logLevel) { + this.logLevel = logLevel; + } + + public String getLogMessage() { + return logMessage; + } + + public void setLogMessage(String logMessage) { + this.logMessage = logMessage; + } + + public String getLogException() { + return logException; + } + + public void setLogException(String logException) { + this.logException = logException; + } + + @Override + public String toString() { + return "ErrorAppLog{" + "id=" + id + ", logEntryDate=" + logEntryDate + ", logLogger=" + logLogger + ", logLevel=" + logLevel + ", logMessage=" + logMessage + ", logException=" + logException + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/AdministrationPersonSerchView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/AdministrationPersonSerchView.java new file mode 100644 index 0000000..ca979e7 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/AdministrationPersonSerchView.java @@ -0,0 +1,198 @@ +/* + * 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 com.arrebol.apc.model.enums.PeopleType; +import java.io.Serializable; +import java.util.Objects; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.Id; +import javax.persistence.Table; +import org.hibernate.annotations.Immutable; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Immutable +@Table(name = "APC_ADMINISTRATION_PERSON_SEARCH_VIEW") +public class AdministrationPersonSerchView implements Serializable { + + private static final long serialVersionUID = 3055231364366461069L; + + @Id + @Column(name = "id", length = 36) + private String id; + + @Column(name = "phone_home", length = 15) + private String phoneHome; + + @Column(name = "address_home", length = 150) + private String addressHome; + + @Enumerated(EnumType.STRING) + @Column(name = "people_type") + private PeopleType peopleType; + + @Column(name = "id_route", length = 36) + private String idRoute; + + @Column(name = "route_name", length = 25) + private String routeName; + + @Column(name = "id_office", length = 36) + private String idOffice; + + @Column(name = "office_name", length = 100) + private String officeName; + + @Column(name = "person_search", length = 103) + private String personSearch; + + public AdministrationPersonSerchView() { + } + + /** + * + * @param id + */ + public AdministrationPersonSerchView(String id) { + this.id = id; + } + + /** + * + * @param id + * @param phoneHome + * @param addressHome + * @param peopleType + * @param idRoute + * @param routeName + * @param idOffice + * @param officeName + * @param personSearch + */ + public AdministrationPersonSerchView(String id, String phoneHome, String addressHome, PeopleType peopleType, String idRoute, String routeName, String idOffice, String officeName, String personSearch) { + this.id = id; + this.phoneHome = phoneHome; + this.addressHome = addressHome; + this.peopleType = peopleType; + this.idRoute = idRoute; + this.routeName = routeName; + this.idOffice = idOffice; + this.officeName = officeName; + this.personSearch = personSearch; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getPhoneHome() { + return phoneHome; + } + + public void setPhoneHome(String phoneHome) { + this.phoneHome = phoneHome; + } + + public String getAddressHome() { + return addressHome; + } + + public void setAddressHome(String addressHome) { + this.addressHome = addressHome; + } + + public PeopleType getPeopleType() { + return peopleType; + } + + public void setPeopleType(PeopleType peopleType) { + this.peopleType = peopleType; + } + + public String getIdRoute() { + return idRoute; + } + + public void setIdRoute(String idRoute) { + this.idRoute = idRoute; + } + + public String getRouteName() { + return routeName; + } + + public void setRouteName(String routeName) { + this.routeName = routeName; + } + + public String getIdOffice() { + return idOffice; + } + + public void setIdOffice(String idOffice) { + this.idOffice = idOffice; + } + + public String getOfficeName() { + return officeName; + } + + public void setOfficeName(String officeName) { + this.officeName = officeName; + } + + public String getPersonSearch() { + return personSearch; + } + + public void setPersonSearch(String personSearch) { + this.personSearch = personSearch; + } + + @Override + public int hashCode() { + int hash = 7; + hash = 79 * hash + Objects.hashCode(this.id); + return hash; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final AdministrationPersonSerchView other = (AdministrationPersonSerchView) obj; + if (!Objects.equals(this.id, other.id)) { + return false; + } + return true; + } + + @Override + public String toString() { + return "AdministrationPersonSerchView{" + "routeName=" + routeName + ", officeName=" + officeName + ", personSearch=" + personSearch + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/AdvanceUserDailyDetail.java b/ace-model/src/main/java/com/arrebol/apc/model/views/AdvanceUserDailyDetail.java new file mode 100644 index 0000000..98a0ad5 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/AdvanceUserDailyDetail.java @@ -0,0 +1,188 @@ +/* + * 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.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 + */ +@Entity +@Immutable +@Table(name = "APC_ADVANCE_USER_DAILY_DETAIL_VIEW") +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; + + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getIdUser() { + return idUser; + } + + public void setIdUser(String idUser) { + this.idUser = idUser; + } + + public String getCustomerName() { + return customerName; + } + + public void setCustomerName(String customerName) { + this.customerName = customerName; + } + + public String getPaymentAmount() { + return paymentAmount; + } + + public void setPaymentAmount(String paymentAmount) { + this.paymentAmount = paymentAmount; + } + + public Date getCreatedOn() { + return createdOn; + } + + public void setCreatedOn(Date createdOn) { + this.createdOn = createdOn; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getTypePayment() { + return typePayment; + } + + public void setTypePayment(String typePayment) { + this.typePayment = typePayment; + } + + 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 String getSaldoInsoluto() { + return saldoInsoluto; + } + + public void setSaldoInsoluto(String saldoInsoluto) { + this.saldoInsoluto = saldoInsoluto; + } + + public String getAmountLoan() { + return amountLoan; + } + + public void setAmountLoan(String amountLoan) { + this.amountLoan = amountLoan; + } + + + + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/AdvanceUserDailyView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/AdvanceUserDailyView.java new file mode 100644 index 0000000..0e7b8f3 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/AdvanceUserDailyView.java @@ -0,0 +1,229 @@ +/* + * 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 com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.User; +import java.io.Serializable; +import java.math.BigDecimal; +import java.math.RoundingMode; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Transient; +import org.hibernate.annotations.Immutable; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Entity +@Immutable +@Table(name = "APC_ADVANCE_USER_DAILY_DASHBOARD_VIEW") +public class AdvanceUserDailyView implements Serializable{ + + private static final long serialVersionUID = 3055231364366461069L; + + @Id + @Column(name = "id", length = 36) + private String id; + + @Column(name = "user_name") + private String userName; + + @Column(name = "total_expected") + private Integer totalExpected; + + @Column(name = "total_now") + private Integer totalNow; + + @Column(name = "porcentaje") + private BigDecimal porcentaje; + + @Column(name = "faltante") + private BigDecimal faltante; + + @Column(name = "total_expected_week") + private BigDecimal totalExpectedWeek; + + @Column(name = "total_reported_week") + private BigDecimal totalReportedWeek; + + @Column(name = "total_reported_renovation_week") + private BigDecimal totalReportedRenovationWeek; + + @Column(name = "total_comision_fee") + private BigDecimal totalComisionFee; + + @Column(name = "colocation_approved") + private BigDecimal colocationApproved; + + @Column(name = "colocation_to_delivery") + private BigDecimal colocationToDelivery; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_user", + referencedColumnName = "id", + nullable = false + ) + private User user; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_office", + referencedColumnName = "id", + nullable = false + ) + private Office office; + + @Transient + private BigDecimal diferencePaymentWeek; + + @Transient + private BigDecimal porcentajePaymentWeek; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public Integer getTotalExpected() { + return totalExpected; + } + + public void setTotalExpected(Integer totalExpected) { + this.totalExpected = totalExpected; + } + + public Integer getTotalNow() { + return totalNow; + } + + public void setTotalNow(Integer totalNow) { + this.totalNow = totalNow; + } + + public BigDecimal getPorcentaje() { + return porcentaje; + } + + public void setPorcentaje(BigDecimal porcentaje) { + this.porcentaje = porcentaje; + } + + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } + + public Office getOffice() { + return office; + } + + public void setOffice(Office office) { + this.office = office; + } + + public BigDecimal getTotalExpectedWeek() { + return totalExpectedWeek; + } + + public void setTotalExpectedWeek(BigDecimal totalExpectedWeek) { + this.totalExpectedWeek = totalExpectedWeek; + } + + public BigDecimal getTotalReportedWeek() { + return totalReportedWeek.add(totalReportedRenovationWeek).add(totalComisionFee); + } + + public void setTotalReportedWeek(BigDecimal totalReportedWeek) { + this.totalReportedWeek = totalReportedWeek; + } + + public BigDecimal getColocationApproved() { + return colocationApproved; + } + + public void setColocationApproved(BigDecimal colocationApproved) { + this.colocationApproved = colocationApproved; + } + + public BigDecimal getColocationToDelivery() { + return colocationToDelivery; + } + + public void setColocationToDelivery(BigDecimal colocationToDelivery) { + this.colocationToDelivery = colocationToDelivery; + } + + public BigDecimal getDiferencePaymentWeek() { + diferencePaymentWeek = (totalReportedWeek.add(totalReportedRenovationWeek).add(totalComisionFee)).subtract(totalExpectedWeek); + return diferencePaymentWeek; + } + + public void setDiferencePaymentWeek(BigDecimal diferencePaymentWeek) { + this.diferencePaymentWeek = diferencePaymentWeek; + } + + public BigDecimal getPorcentajePaymentWeek() { + if(totalReportedWeek.compareTo(BigDecimal.ZERO) == 1) + porcentajePaymentWeek = (faltante + .multiply(new BigDecimal(100))).divide(totalReportedWeek, 2, RoundingMode.HALF_UP); + else + porcentajePaymentWeek = BigDecimal.ZERO; + return porcentajePaymentWeek; + } + + public void setPorcentajePaymentWeek(BigDecimal porcentajePaymentWeek) { + this.porcentajePaymentWeek = porcentajePaymentWeek; + } + + public BigDecimal getTotalReportedRenovationWeek() { + return totalReportedRenovationWeek; + } + + public void setTotalReportedRenovationWeek(BigDecimal totalReportedRenovationWeek) { + this.totalReportedRenovationWeek = totalReportedRenovationWeek; + } + + public BigDecimal getTotalComisionFee() { + return totalComisionFee; + } + + public void setTotalComisionFee(BigDecimal totalComisionFee) { + this.totalComisionFee = totalComisionFee; + } + + public BigDecimal getFaltante() { + return faltante; + } + + public void setFaltante(BigDecimal faltante) { + this.faltante = faltante; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/AvailableCustomersView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/AvailableCustomersView.java new file mode 100644 index 0000000..c7da83a --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/AvailableCustomersView.java @@ -0,0 +1,70 @@ +/* + * 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 javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; +import org.hibernate.annotations.Immutable; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Immutable +@Table(name = "APC_AVAILABLE_CUSTOMERS_VIEW") +public class AvailableCustomersView implements Serializable { + + private static final long serialVersionUID = 6772440079893425786L; + + @Id + @Column(name = "id", length = 36) + private String id; + + @Column(name = "available_person", length = 103) + private String availablePerson; + + @Column(name = "cross_signature", length = 36) + private String crossSignature; + + public AvailableCustomersView() { + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getAvailablePerson() { + return availablePerson; + } + + public void setAvailablePerson(String availablePerson) { + this.availablePerson = availablePerson; + } + + public String getCrossSignature() { + return crossSignature; + } + + public void setCrossSignature(String crossSignature) { + this.crossSignature = crossSignature; + } + + @Override + public String toString() { + return "AvailableCustomersView{" + "availablePerson=" + availablePerson + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/AvailableEndorsementsView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/AvailableEndorsementsView.java new file mode 100644 index 0000000..649fabb --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/AvailableEndorsementsView.java @@ -0,0 +1,70 @@ +/* + * 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 javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; +import org.hibernate.annotations.Immutable; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Immutable +@Table(name = "APC_AVAILABLE_ENDORSEMENTS_VIEW") +public class AvailableEndorsementsView implements Serializable { + + private static final long serialVersionUID = -8420465639155493835L; + + @Id + @Column(name = "id", length = 36) + private String id; + + @Column(name = "available_person", length = 103) + private String availablePerson; + + @Column(name = "cross_signature", length = 36) + private String crossSignature; + + public AvailableEndorsementsView() { + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getAvailablePerson() { + return availablePerson; + } + + public void setAvailablePerson(String availablePerson) { + this.availablePerson = availablePerson; + } + + public String getCrossSignature() { + return crossSignature; + } + + public void setCrossSignature(String crossSignature) { + this.crossSignature = crossSignature; + } + + @Override + public String toString() { + return "AvailableEndorsementsView{" + "availablePerson=" + availablePerson + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/AvailablesOwnersView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/AvailablesOwnersView.java new file mode 100644 index 0000000..bbc12a5 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/AvailablesOwnersView.java @@ -0,0 +1,96 @@ +/* + * 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 javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; +import org.hibernate.annotations.Immutable; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Immutable +@Table(name = "APC_AVAILABLES_OWNERS_VIEW") +public class AvailablesOwnersView implements Serializable { + + private static final long serialVersionUID = -7094684754461793727L; + + @Id + @Column(name = "id_user", length = 36) + private String userId; + + @Column(name = "id_office", length = 36) + private String officeId; + + @Column(name = "user_name", length = 100) + private String userName; + + @Column(name = "full_name", length = 103) + private String fullName; + + public AvailablesOwnersView() { + } + + /** + * Complete constructor. + * + * @param userId + * @param officeId + * @param userName + * @param fullName + */ + public AvailablesOwnersView(String userId, String officeId, String userName, String fullName) { + this.userId = userId; + this.officeId = officeId; + this.userName = userName; + this.fullName = fullName; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getOfficeId() { + return officeId; + } + + public void setOfficeId(String officeId) { + this.officeId = officeId; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getFullName() { + return fullName; + } + + public void setFullName(String fullName) { + this.fullName = fullName; + } + + @Override + public String toString() { + return "AvailablesOwnersView{" + "userName=" + userName + ", fullName=" + fullName + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/CashRegisterCurdateByUserView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/CashRegisterCurdateByUserView.java new file mode 100644 index 0000000..24399f4 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/CashRegisterCurdateByUserView.java @@ -0,0 +1,89 @@ +/* + * 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 org.hibernate.annotations.Immutable; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Immutable +@Table(name = "APC_CASH_REGISTER_CURDATE_BY_USER_VIEW") +public class CashRegisterCurdateByUserView implements Serializable { + + private static final long serialVersionUID = -3932800670151972950L; + + @Id + @Column(name = "id", length = 36) + private String id; + + @Column(name = "payment") + private BigDecimal payment; + + @Column(name = "customer_name", length = 51) + private String customerName; + + @Column(name = "id_user", length = 36) + private String userId; + + public CashRegisterCurdateByUserView() { + } + + public CashRegisterCurdateByUserView(String id, BigDecimal payment, String customerName, String userId) { + this.id = id; + this.payment = payment; + this.customerName = customerName; + this.userId = userId; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public BigDecimal getPayment() { + return payment; + } + + public void setPayment(BigDecimal payment) { + this.payment = payment; + } + + public String getCustomerName() { + return customerName; + } + + public void setCustomerName(String customerName) { + this.customerName = customerName; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + @Override + public String toString() { + return "CashRegisterCurdateByUserView{" + "customerName=" + customerName + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/ClosingDailyDetailFromUserByCurdateView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/ClosingDailyDetailFromUserByCurdateView.java new file mode 100644 index 0000000..9c57c0a --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/ClosingDailyDetailFromUserByCurdateView.java @@ -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 + */ +@Entity +@Immutable +@Table(name = "APC_CLOSING_DAILY_DETAIL_FROM_USER_BY_CURDATE_VIEW") +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(){ + + } + + 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; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/CobranzaLastWeekByUserView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/CobranzaLastWeekByUserView.java new file mode 100644 index 0000000..819f0c2 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/CobranzaLastWeekByUserView.java @@ -0,0 +1,150 @@ +/* + * 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 com.arrebol.apc.model.core.Office; +import java.io.Serializable; +import java.math.BigDecimal; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import org.hibernate.annotations.Immutable; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Entity +@Immutable +@Table(name = "APC_COBRANZA_LAST_WEEK_BY_USER_VIEW") +public class CobranzaLastWeekByUserView implements Serializable{ + + private static final long serialVersionUID = 3055231364366461069L; + + @Id + @Column(name = "id", length = 36) + private String id; + + @Column(name = "username") + private String userName; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_office", + referencedColumnName = "id", + nullable = false + ) + private Office office; + + @Column(name = "cobranza_monday") + private BigDecimal cobranzaMonday; + + @Column(name = "cobranza_tuesday") + private BigDecimal cobranzaTuesday; + + @Column(name = "cobranza_wednesday") + private BigDecimal cobranzaWednesday; + + @Column(name = "cobranza_thursday") + private BigDecimal cobranzaThursday; + + @Column(name = "cobranza_friday") + private BigDecimal cobranzaFriday; + + @Column(name = "cobranza_saturday") + private BigDecimal cobranzaSaturday; + + @Column(name = "cobranza_total") + private BigDecimal cobranzaTotal; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public Office getOffice() { + return office; + } + + public void setOffice(Office office) { + this.office = office; + } + + public BigDecimal getCobranzaMonday() { + return cobranzaMonday; + } + + public void setCobranzaMonday(BigDecimal cobranzaMonday) { + this.cobranzaMonday = cobranzaMonday; + } + + public BigDecimal getCobranzaTuesday() { + return cobranzaTuesday; + } + + public void setCobranzaTuesday(BigDecimal cobranzaTuesday) { + this.cobranzaTuesday = cobranzaTuesday; + } + + public BigDecimal getCobranzaWednesday() { + return cobranzaWednesday; + } + + public void setCobranzaWednesday(BigDecimal cobranzaWednesday) { + this.cobranzaWednesday = cobranzaWednesday; + } + + public BigDecimal getCobranzaThursday() { + return cobranzaThursday; + } + + public void setCobranzaThursday(BigDecimal cobranzaThursday) { + this.cobranzaThursday = cobranzaThursday; + } + + public BigDecimal getCobranzaFriday() { + return cobranzaFriday; + } + + public void setCobranzaFriday(BigDecimal cobranzaFriday) { + this.cobranzaFriday = cobranzaFriday; + } + + public BigDecimal getCobranzaSaturday() { + return cobranzaSaturday; + } + + public void setCobranzaSaturday(BigDecimal cobranzaSaturday) { + this.cobranzaSaturday = cobranzaSaturday; + } + + public BigDecimal getCobranzaTotal() { + return cobranzaTotal; + } + + public void setCobranzaTotal(BigDecimal cobranzaTotal) { + this.cobranzaTotal = cobranzaTotal; + } + + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/CobranzaWeekByUserView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/CobranzaWeekByUserView.java new file mode 100644 index 0000000..927cf50 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/CobranzaWeekByUserView.java @@ -0,0 +1,150 @@ +/* + * 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 com.arrebol.apc.model.core.Office; +import java.io.Serializable; +import java.math.BigDecimal; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import org.hibernate.annotations.Immutable; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Entity +@Immutable +@Table(name = "APC_COBRANZA_WEEK_BY_USER_VIEW") +public class CobranzaWeekByUserView implements Serializable{ + + private static final long serialVersionUID = 3055231364366461069L; + + @Id + @Column(name = "id", length = 36) + private String id; + + @Column(name = "username") + private String userName; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_office", + referencedColumnName = "id", + nullable = false + ) + private Office office; + + @Column(name = "cobranza_monday") + private BigDecimal cobranzaMonday; + + @Column(name = "cobranza_tuesday") + private BigDecimal cobranzaTuesday; + + @Column(name = "cobranza_wednesday") + private BigDecimal cobranzaWednesday; + + @Column(name = "cobranza_thursday") + private BigDecimal cobranzaThursday; + + @Column(name = "cobranza_friday") + private BigDecimal cobranzaFriday; + + @Column(name = "cobranza_saturday") + private BigDecimal cobranzaSaturday; + + @Column(name = "cobranza_total") + private BigDecimal cobranzaTotal; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public Office getOffice() { + return office; + } + + public void setOffice(Office office) { + this.office = office; + } + + public BigDecimal getCobranzaMonday() { + return cobranzaMonday; + } + + public void setCobranzaMonday(BigDecimal cobranzaMonday) { + this.cobranzaMonday = cobranzaMonday; + } + + public BigDecimal getCobranzaTuesday() { + return cobranzaTuesday; + } + + public void setCobranzaTuesday(BigDecimal cobranzaTuesday) { + this.cobranzaTuesday = cobranzaTuesday; + } + + public BigDecimal getCobranzaWednesday() { + return cobranzaWednesday; + } + + public void setCobranzaWednesday(BigDecimal cobranzaWednesday) { + this.cobranzaWednesday = cobranzaWednesday; + } + + public BigDecimal getCobranzaThursday() { + return cobranzaThursday; + } + + public void setCobranzaThursday(BigDecimal cobranzaThursday) { + this.cobranzaThursday = cobranzaThursday; + } + + public BigDecimal getCobranzaFriday() { + return cobranzaFriday; + } + + public void setCobranzaFriday(BigDecimal cobranzaFriday) { + this.cobranzaFriday = cobranzaFriday; + } + + public BigDecimal getCobranzaSaturday() { + return cobranzaSaturday; + } + + public void setCobranzaSaturday(BigDecimal cobranzaSaturday) { + this.cobranzaSaturday = cobranzaSaturday; + } + + public BigDecimal getCobranzaTotal() { + return cobranzaTotal; + } + + public void setCobranzaTotal(BigDecimal cobranzaTotal) { + this.cobranzaTotal = cobranzaTotal; + } + + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/ColocationLastWeekByUserView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/ColocationLastWeekByUserView.java new file mode 100644 index 0000000..aa4ccc0 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/ColocationLastWeekByUserView.java @@ -0,0 +1,149 @@ +/* + * 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 com.arrebol.apc.model.core.Office; +import java.io.Serializable; +import java.math.BigDecimal; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import org.hibernate.annotations.Immutable; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Entity +@Immutable +@Table(name = "APC_COLOCATION_LAST_WEEK_BY_USER_VIEW") +public class ColocationLastWeekByUserView implements Serializable{ + + private static final long serialVersionUID = 3055231364366461069L; + + @Id + @Column(name = "id", length = 36) + private String id; + + @Column(name = "username") + private String userName; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_office", + referencedColumnName = "id", + nullable = false + ) + private Office office; + + @Column(name = "colocation_monday") + private BigDecimal colocationMonday; + + @Column(name = "colocation_tuesday") + private BigDecimal colocationTuesday; + + @Column(name = "colocation_wednesday") + private BigDecimal colocationWednesday; + + @Column(name = "colocation_thursday") + private BigDecimal colocationThursday; + + @Column(name = "colocation_friday") + private BigDecimal colocationFriday; + + @Column(name = "colocation_saturday") + private BigDecimal colocationSaturday; + + @Column(name = "colocation_total") + private BigDecimal colocationTotal; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public BigDecimal getColocationMonday() { + return colocationMonday; + } + + public void setColocationMonday(BigDecimal colocationMonday) { + this.colocationMonday = colocationMonday; + } + + public BigDecimal getColocationTuesday() { + return colocationTuesday; + } + + public void setColocationTuesday(BigDecimal colocationTuesday) { + this.colocationTuesday = colocationTuesday; + } + + public BigDecimal getColocationWednesday() { + return colocationWednesday; + } + + public void setColocationWednesday(BigDecimal colocationWednesday) { + this.colocationWednesday = colocationWednesday; + } + + public BigDecimal getColocationThursday() { + return colocationThursday; + } + + public void setColocationThursday(BigDecimal colocationThursday) { + this.colocationThursday = colocationThursday; + } + + public BigDecimal getColocationFriday() { + return colocationFriday; + } + + public void setColocationFriday(BigDecimal colocationFriday) { + this.colocationFriday = colocationFriday; + } + + public BigDecimal getColocationSaturday() { + return colocationSaturday; + } + + public void setColocationSaturday(BigDecimal colocationSaturday) { + this.colocationSaturday = colocationSaturday; + } + + public Office getOffice() { + return office; + } + + public void setOffice(Office office) { + this.office = office; + } + + public BigDecimal getColocationTotal() { + return colocationTotal; + } + + public void setColocationTotal(BigDecimal colocationTotal) { + this.colocationTotal = colocationTotal; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/ColocationWeekByUserView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/ColocationWeekByUserView.java new file mode 100644 index 0000000..d310536 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/ColocationWeekByUserView.java @@ -0,0 +1,149 @@ +/* + * 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 com.arrebol.apc.model.core.Office; +import java.io.Serializable; +import java.math.BigDecimal; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import org.hibernate.annotations.Immutable; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Entity +@Immutable +@Table(name = "APC_COLOCATION_WEEK_BY_USER_VIEW") +public class ColocationWeekByUserView implements Serializable{ + + private static final long serialVersionUID = 3055231364366461069L; + + @Id + @Column(name = "id", length = 36) + private String id; + + @Column(name = "username") + private String userName; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_office", + referencedColumnName = "id", + nullable = false + ) + private Office office; + + @Column(name = "colocation_monday") + private BigDecimal colocationMonday; + + @Column(name = "colocation_tuesday") + private BigDecimal colocationTuesday; + + @Column(name = "colocation_wednesday") + private BigDecimal colocationWednesday; + + @Column(name = "colocation_thursday") + private BigDecimal colocationThursday; + + @Column(name = "colocation_friday") + private BigDecimal colocationFriday; + + @Column(name = "colocation_saturday") + private BigDecimal colocationSaturday; + + @Column(name = "colocation_total") + private BigDecimal colocationTotal; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public BigDecimal getColocationMonday() { + return colocationMonday; + } + + public void setColocationMonday(BigDecimal colocationMonday) { + this.colocationMonday = colocationMonday; + } + + public BigDecimal getColocationTuesday() { + return colocationTuesday; + } + + public void setColocationTuesday(BigDecimal colocationTuesday) { + this.colocationTuesday = colocationTuesday; + } + + public BigDecimal getColocationWednesday() { + return colocationWednesday; + } + + public void setColocationWednesday(BigDecimal colocationWednesday) { + this.colocationWednesday = colocationWednesday; + } + + public BigDecimal getColocationThursday() { + return colocationThursday; + } + + public void setColocationThursday(BigDecimal colocationThursday) { + this.colocationThursday = colocationThursday; + } + + public BigDecimal getColocationFriday() { + return colocationFriday; + } + + public void setColocationFriday(BigDecimal colocationFriday) { + this.colocationFriday = colocationFriday; + } + + public BigDecimal getColocationSaturday() { + return colocationSaturday; + } + + public void setColocationSaturday(BigDecimal colocationSaturday) { + this.colocationSaturday = colocationSaturday; + } + + public Office getOffice() { + return office; + } + + public void setOffice(Office office) { + this.office = office; + } + + public BigDecimal getColocationTotal() { + return colocationTotal; + } + + public void setColocationTotal(BigDecimal colocationTotal) { + this.colocationTotal = colocationTotal; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/CurrentCustomerByLoanView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/CurrentCustomerByLoanView.java new file mode 100644 index 0000000..1cda077 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/CurrentCustomerByLoanView.java @@ -0,0 +1,168 @@ +/* + * 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 com.arrebol.apc.model.enums.LoanStatus; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import org.hibernate.annotations.Immutable; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Immutable +@Table(name = "APC_CURRENT_CUSTOMER_BY_LOAN_VIEW") +public class CurrentCustomerByLoanView implements Serializable { + + private static final long serialVersionUID = 1867076380925130820L; + + @Id + @Column(name = "id_loan", length = 36) + private String loanId; + + @Column(name = "id_user", length = 36) + private String userId; + + @Column(name = "id_office", length = 36) + private String officeId; + + @Column(name = "payment", nullable = false) + private BigDecimal payment; + + @Column(name = "customer_name", length = 100) + private String customerName; + + @Column(name = "endorsement_name", length = 103) + private String endorsementName; + + @Enumerated(EnumType.STRING) + @Column(name = "loan_status") + private LoanStatus loanStatus; + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "created_on", length = 19) + private Date createdOn; + + @Column(name = "route_name", length = 25) + private String route; + + public CurrentCustomerByLoanView() { + } + + /** + * Complete Constructor. + * + * @param loanId + * @param userId + * @param officeId + * @param payment + * @param customerName + * @param endorsementName + * @param loanStatus + * @param createdOn + */ + public CurrentCustomerByLoanView(String loanId, String userId, String officeId, BigDecimal payment, String customerName, String endorsementName, LoanStatus loanStatus, Date createdOn) { + this.loanId = loanId; + this.userId = userId; + this.officeId = officeId; + this.payment = payment; + this.customerName = customerName; + this.endorsementName = endorsementName; + this.loanStatus = loanStatus; + this.createdOn = createdOn; + } + + public String getLoanId() { + return loanId; + } + + public void setLoanId(String loanId) { + this.loanId = loanId; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getOfficeId() { + return officeId; + } + + public void setOfficeId(String officeId) { + this.officeId = officeId; + } + + public BigDecimal getPayment() { + return payment; + } + + public void setPayment(BigDecimal payment) { + this.payment = payment; + } + + public String getCustomerName() { + return customerName; + } + + public void setCustomerName(String customerName) { + this.customerName = customerName; + } + + public String getEndorsementName() { + return endorsementName; + } + + public void setEndorsementName(String endorsementName) { + this.endorsementName = endorsementName; + } + + public LoanStatus getLoanStatus() { + return loanStatus; + } + + public void setLoanStatus(LoanStatus loanStatus) { + this.loanStatus = loanStatus; + } + + 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; + } + + @Override + public String toString() { + return "CurrentCustomerByLoanView{" + "customerName=" + customerName + ", endorsementName=" + endorsementName + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/CustomerView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/CustomerView.java new file mode 100644 index 0000000..66d43c8 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/CustomerView.java @@ -0,0 +1,197 @@ +/* + * 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 com.arrebol.apc.model.enums.CustomerClassification; +import com.arrebol.apc.model.enums.PeopleType; +import java.io.Serializable; +import java.util.Objects; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.Id; +import javax.persistence.Table; +import org.hibernate.annotations.Immutable; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Immutable +@Table(name = "APC_CUSTOMER_VIEW") +public class CustomerView implements Serializable { + + @Id + @Column(name = "id", length = 36) + private String id; + + @Column(name = "full_name", length = 103) + private String fullName; + + @Column(name = "company_name", length = 150) + private String companyName; + + @Column(name = "address_home", length = 150) + private String addressHome; + + @Column(name = "address_business", length = 150) + private String addressBusiness; + + @Column(name = "route_name", length = 25) + private String routeName; + + @Enumerated(EnumType.STRING) + @Column(name = "people_type", nullable = false) + private PeopleType peopleType; + + @Column(name = "str_people_type", length = 14) + private String strPeopleType; + + @Enumerated(EnumType.STRING) + @Column(name = "classification", nullable = false) + private CustomerClassification classification; + + @Column(name = "office_name", length = 100) + private String officeName; + + @Column(name = "total_of_loan") + private Integer totalOfLoan; + + public CustomerView() { + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getFullName() { + return fullName; + } + + public void setFullName(String fullName) { + this.fullName = fullName; + } + + public String getCompanyName() { + return companyName; + } + + public void setCompanyName(String companyName) { + this.companyName = companyName; + } + + public String getAddressHome() { + return addressHome; + } + + public void setAddressHome(String addressHome) { + this.addressHome = addressHome; + } + + public String getAddressBusiness() { + return addressBusiness; + } + + public void setAddressBusiness(String addressBusiness) { + this.addressBusiness = addressBusiness; + } + + public String getRouteName() { + return routeName; + } + + public void setRouteName(String routeName) { + this.routeName = routeName; + } + + public PeopleType getPeopleType() { + return peopleType; + } + + public void setPeopleType(PeopleType peopleType) { + this.peopleType = peopleType; + } + + public String getStrPeopleType() { + return strPeopleType; + } + + public void setStrPeopleType(String strPeopleType) { + this.strPeopleType = strPeopleType; + } + + public String getOfficeName() { + return officeName; + } + + public void setOfficeName(String officeName) { + this.officeName = officeName; + } + + public Integer getTotalOfLoan() { + return totalOfLoan; + } + + public void setTotalOfLoan(Integer totalOfLoan) { + this.totalOfLoan = totalOfLoan; + } + + @Override + public int hashCode() { + int hash = 7; + hash = 97 * hash + Objects.hashCode(this.id); + return hash; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final CustomerView other = (CustomerView) obj; + if (!Objects.equals(this.id, other.id)) { + return false; + } + return true; + } + + public CustomerClassification getClassification() { + return classification; + } + + public void setClassification(CustomerClassification classification) { + this.classification = classification; + } + + public String conditionStyle() + { + if(getClassification().equals(classification.RED)) + return "redRow"; + else if(getClassification().equals(classification.YELLOW)) + return "yellowRow"; + return null; + } + + @Override + public String toString() { + return "CustomerView{" + "fullName=" + fullName + ", routeName=" + routeName + ", officeName=" + officeName + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/CustomerWithoutRenovationView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/CustomerWithoutRenovationView.java new file mode 100644 index 0000000..06ac9aa --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/CustomerWithoutRenovationView.java @@ -0,0 +1,226 @@ +/* + * 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 com.arrebol.apc.model.core.Office; +import java.io.Serializable; +import java.util.Date; +import java.util.Objects; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import org.hibernate.annotations.Immutable; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Entity +@Immutable +@Table(name = "APC_CUSTOMERS_WITHOUT_RENOVATION_VIEW") +public class CustomerWithoutRenovationView implements Serializable { + + private static final long serialVersionUID = 3731003393000465083L; + + @Id + @Column(name = "id", length = 36) + private String id; + + @Column(name = "available_person") + private String personName; + + @Column(name = "route_name") + private String routeName; + + @Column(name = "last_loan") + @Temporal(javax.persistence.TemporalType.DATE) + private Date lastLoan; + + @Column(name = "amount_paid") + private String amountPaid; + + @Column(name = "amount_to_pay") + private String amountToPay; + + @Column(name = "saldo_insoluto") + private String saldoInsoluto; + + @Column(name = "action_number") + private String actionNumber; + + @Column(name = "num_fee") + private String numFee; + + @Column(name = "address_home") + private String addressHome; + + @Column(name = "address_business") + private String addressBusiness; + + @Column(name = "company_name") + private String companyName; + + + + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_office", + referencedColumnName = "id", + nullable = false + ) + private Office office; + + @Column(name = "str_payment_date", length = 22) + private String strPaymentDate; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getPersonName() { + return personName; + } + + public void setPersonName(String personName) { + this.personName = personName; + } + + public String getRouteName() { + return routeName; + } + + public void setRouteName(String routeName) { + this.routeName = routeName; + } + + public Date getLastLoan() { + return lastLoan; + } + + public void setLastLoan(Date lastLoan) { + this.lastLoan = lastLoan; + } + + public Office getOffice() { + return office; + } + + public void setOffice(Office office) { + this.office = office; + } + + public String getStrPaymentDate() { + return strPaymentDate; + } + + public void setStrPaymentDate(String strPaymentDate) { + this.strPaymentDate = strPaymentDate; + } + + 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 getSaldoInsoluto() { + return saldoInsoluto; + } + + public void setSaldoInsoluto(String saldoInsoluto) { + this.saldoInsoluto = saldoInsoluto; + } + + public String getActionNumber() { + return actionNumber; + } + + public void setActionNumber(String actionNumber) { + this.actionNumber = actionNumber; + } + + public String getNumFee() { + return numFee; + } + + public void setNumFee(String numFee) { + this.numFee = numFee; + } + + public String getAddressHome() { + return addressHome; + } + + public void setAddressHome(String addressHome) { + this.addressHome = addressHome; + } + + public String getAddressBusiness() { + return addressBusiness; + } + + public void setAddressBusiness(String addressBusiness) { + this.addressBusiness = addressBusiness; + } + + public String getCompanyName() { + return companyName; + } + + public void setCompanyName(String companyName) { + this.companyName = companyName; + } + + + + @Override + public int hashCode() { + int hash = 7; + hash = 61 * hash + Objects.hashCode(this.id); + return hash; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final CustomerWithoutRenovationView other = (CustomerWithoutRenovationView) obj; + if (!Objects.equals(this.id, other.id)) { + return false; + } + return true; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/EnabledUserDetailsView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/EnabledUserDetailsView.java new file mode 100644 index 0000000..40246f8 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/EnabledUserDetailsView.java @@ -0,0 +1,89 @@ +/* + * 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.util.Objects; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; +import org.hibernate.annotations.Immutable; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Immutable +@Table(name = "APC_ENABLED_USER_DETAILS_VIEW") +public class EnabledUserDetailsView implements Serializable { + + @Id + @Column(name = "id_user", length = 36) + private String idUser; + + @Column(name = "full_name", length = 103) + private String fullName; + + @Column(name = "id_office", length = 36) + private String idOffice; + + public EnabledUserDetailsView() { + } + + public String getIdUser() { + return idUser; + } + + public void setIdUser(String idUser) { + this.idUser = idUser; + } + + public String getFullName() { + return fullName; + } + + public void setFullName(String fullName) { + this.fullName = fullName; + } + + public String getIdOffice() { + return idOffice; + } + + public void setIdOffice(String idOffice) { + this.idOffice = idOffice; + } + + @Override + public int hashCode() { + int hash = 7; + hash = 43 * hash + Objects.hashCode(this.idUser); + return hash; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final EnabledUserDetailsView other = (EnabledUserDetailsView) obj; + if (!Objects.equals(this.idUser, other.idUser)) { + return false; + } + return true; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/ExchangeEnebledUsersView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/ExchangeEnebledUsersView.java new file mode 100644 index 0000000..93a3720 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/ExchangeEnebledUsersView.java @@ -0,0 +1,70 @@ +/* + * 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 javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; +import org.hibernate.annotations.Immutable; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Immutable +@Table(name = "APC_EXCHANGE_ENEBLED_USERS_VIEW") +public class ExchangeEnebledUsersView implements Serializable { + + private static final long serialVersionUID = -1257291916093653466L; + + @Id + @Column(name = "id_user", length = 36) + private String userId; + + @Column(name = "user_name", length = 51) + private String userName; + + @Column(name = "id_office", length = 36) + private String officeId; + + public ExchangeEnebledUsersView() { + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getOfficeId() { + return officeId; + } + + public void setOfficeId(String officeId) { + this.officeId = officeId; + } + + @Override + public String toString() { + return "ExchangeEnebledUsersView{" + "userName=" + userName + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/FaltanteInDates.java b/ace-model/src/main/java/com/arrebol/apc/model/views/FaltanteInDates.java new file mode 100644 index 0000000..d012219 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/FaltanteInDates.java @@ -0,0 +1,170 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.model.views; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * + * @author Oscar + */ +public class FaltanteInDates implements Serializable { + + private static final long serialVersionUID = 3731003393000465083L; + + private String id; + private String idUser; + private String userName; + private String customerName; + private String routeName; + private BigDecimal amountPaid; + private BigDecimal amountToPay; + private BigDecimal amountToPayNoFee; + private BigDecimal paymentDaily; + private BigDecimal expectedPayment; + private BigDecimal amountPaidDetails; + private BigDecimal fee; + private Long feeNumber; + private Long numPagosAll; + private Date lastDate; + private Date createdOn; + + public FaltanteInDates() { + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getIdUser() { + return idUser; + } + + public void setIdUser(String idUser) { + this.idUser = idUser; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getCustomerName() { + return customerName; + } + + public void setCustomerName(String customerName) { + this.customerName = customerName; + } + + public String getRouteName() { + return routeName; + } + + public void setRouteName(String routeName) { + this.routeName = routeName; + } + + public BigDecimal getAmountPaid() { + return amountPaid; + } + + public void setAmountPaid(BigDecimal amountPaid) { + this.amountPaid = amountPaid; + } + + public BigDecimal getAmountToPay() { + return amountToPay; + } + + public void setAmountToPay(BigDecimal amountToPay) { + this.amountToPay = amountToPay; + } + + public BigDecimal getAmountToPayNoFee() { + return amountToPayNoFee; + } + + public void setAmountToPayNoFee(BigDecimal amountToPayNoFee) { + this.amountToPayNoFee = amountToPayNoFee; + } + + public BigDecimal getPaymentDaily() { + return paymentDaily; + } + + public void setPaymentDaily(BigDecimal paymentDaily) { + this.paymentDaily = paymentDaily; + } + + public BigDecimal getExpectedPayment() { + return expectedPayment; + } + + public void setExpectedPayment(BigDecimal expectedPayment) { + this.expectedPayment = expectedPayment; + } + + public BigDecimal getAmountPaidDetails() { + return amountPaidDetails; + } + + public void setAmountPaidDetails(BigDecimal amountPaidDetails) { + this.amountPaidDetails = amountPaidDetails; + } + + public BigDecimal getFee() { + return fee; + } + + public void setFee(BigDecimal fee) { + this.fee = fee; + } + + public Long getFeeNumber() { + return feeNumber; + } + + public void setFeeNumber(Long feeNumber) { + this.feeNumber = feeNumber; + } + + public Long getNumPagosAll() { + return numPagosAll; + } + + public void setNumPagosAll(Long numPagosAll) { + this.numPagosAll = numPagosAll; + } + + public Date getLastDate() { + return lastDate; + } + + public void setLastDate(Date lastDate) { + this.lastDate = lastDate; + } + + public Date getCreatedOn() { + return createdOn; + } + + public void setCreatedOn(Date createdOn) { + this.createdOn = createdOn; + } + + + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/FeesView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/FeesView.java new file mode 100644 index 0000000..361c33b --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/FeesView.java @@ -0,0 +1,137 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.model.views; + +import com.arrebol.apc.model.enums.FeeStatus; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author David Rodriguez + */ +@Entity +@Table(name = "APC_FEES_VIEW") +public class FeesView implements Serializable { + + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @Column(name = "id_user", length = 36) + private String idUser; + + @Column(name = "name") + private String userName; + + @Column(name = "id_route", length = 36) + private String idRoute; + + @Column(name = "route_name") + private String routeName; + + @Column(name = "total_fees") + private BigDecimal totalFees; + + @Enumerated(EnumType.STRING) + @Column(name = "fee_status") + FeeStatus feeStatus; + + @Column(name = "created_on") + private Date createdOn; + + @Column(name = "total_fee_paid") + private BigDecimal totalFeePaid; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Date getCreatedOn() { + return createdOn; + } + + public void setCreatedOn(Date createdOn) { + this.createdOn = createdOn; + } + + public String getIdUser() { + return idUser; + } + + public void setIdUser(String idUser) { + this.idUser = idUser; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public BigDecimal getTotalFees() { + return totalFees; + } + + public void setTotalFees(BigDecimal totalFees) { + this.totalFees = totalFees; + } + public String getIdRoute() { + return idRoute; + } + + public void setIdRoute(String idRoute) { + this.idRoute = idRoute; + } + + public String getRouteName() { + return routeName; + } + + public void setRouteName(String routeName) { + this.routeName = routeName; + } + + public FeeStatus getFeeStatus() { + return feeStatus; + } + + public void setFeeStatus(FeeStatus feeStatus) { + this.feeStatus = feeStatus; + } + + public BigDecimal getTotalFeePaid() { + return totalFeePaid; + } + + public void setTotalFeePaid(BigDecimal totalFeePaid) { + this.totalFeePaid = totalFeePaid; + } + + @Override + public String toString() { + return "FeesView{" + "idUser=" + idUser + ", userName=" + userName + ", totalFees=" + totalFees + ", createdOn=" + createdOn + '}'; + } +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/GeneralBoxView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/GeneralBoxView.java new file mode 100644 index 0000000..20f5f15 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/GeneralBoxView.java @@ -0,0 +1,97 @@ +/* + * 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 + */ +@Entity +@Immutable +@Table(name = "APC_GENERAL_BOX_VIEW") +public class GeneralBoxView implements Serializable{ + + private static final long serialVersionUID = 5393585318267139926L; + + @Id + @Column(name = "id", length = 36) + private String id; + + @Column(name = "office") + private String office; + + @Column(name = "comments") + private String comments; + + @Column(name = "fecha") + private Date fecha; + + @Column(name = "amount") + private BigDecimal amount; + + @Column(name = "type") + private String type; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getOffice() { + return office; + } + + public void setOffice(String office) { + this.office = office; + } + + public String getComments() { + return comments; + } + + public void setComments(String comments) { + this.comments = comments; + } + + public Date getFecha() { + return fecha; + } + + public void setFecha(Date fecha) { + this.fecha = fecha; + } + + 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; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/HistoryLoanView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/HistoryLoanView.java new file mode 100644 index 0000000..e0a001c --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/HistoryLoanView.java @@ -0,0 +1,183 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +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 + */ +@Entity +@Immutable +@Table(name = "APC_HISTORY_LOAN_VIEW") +public class HistoryLoanView implements Serializable{ + + @Id + @Column(name = "id", length = 36) + private String id; + + @Column(name = "customerName") + private String customerName; + + @Column(name = "endorsementName") + private String endorsementName; + + @Column(name = "routeName") + private String routeName; + + @Column(name = "officeName") + private String officeName; + + @Column(name = "montoPrestado") + private String montoPrestado; + + @Column(name = "montoAPagar") + private BigDecimal montoAPagar; + + @Column(name = "montoPagado") + private BigDecimal montoPagado; + + @Column(name = "saldoInsoluto") + private BigDecimal saldoInsoluto; + + @Column(name = "numMultas") + private long numMultas; + + @Column(name = "estatusPrestamo") + private String estatusPrestamo; + + @Column(name = "fecha") + private Date fecha; + + @Column(name = "juridical_date") + private Date fechaJuridico; + + @Column(name = "nombreUsuario") + private String nombreUsuario; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getCustomerName() { + return customerName; + } + + public void setCustomerName(String customerName) { + this.customerName = customerName; + } + + public String getEndorsementName() { + return endorsementName; + } + + public void setEndorsementName(String endorsementName) { + this.endorsementName = endorsementName; + } + + public String getRouteName() { + return routeName; + } + + public void setRouteName(String routeName) { + this.routeName = routeName; + } + + public String getOfficeName() { + return officeName; + } + + public void setOfficeName(String officeName) { + this.officeName = officeName; + } + + public String getMontoPrestado() { + return montoPrestado; + } + + public void setMontoPrestado(String montoPrestado) { + this.montoPrestado = montoPrestado; + } + + public BigDecimal getMontoAPagar() { + return montoAPagar; + } + + public void setMontoAPagar(BigDecimal montoAPagar) { + this.montoAPagar = montoAPagar; + } + + public BigDecimal getMontoPagado() { + return montoPagado; + } + + public void setMontoPagado(BigDecimal montoPagado) { + this.montoPagado = montoPagado; + } + + public BigDecimal getSaldoInsoluto() { + return saldoInsoluto; + } + + public void setSaldoInsoluto(BigDecimal saldoInsoluto) { + this.saldoInsoluto = saldoInsoluto; + } + + public long getNumMultas() { + return numMultas; + } + + public void setNumMultas(long numMultas) { + this.numMultas = numMultas; + } + + public String getEstatusPrestamo() { + return estatusPrestamo; + } + + public void setEstatusPrestamo(String estatusPrestamo) { + this.estatusPrestamo = estatusPrestamo; + } + + public Date getFecha() { + return fecha; + } + + public void setFecha(Date fecha) { + this.fecha = fecha; + } + + public Date getFechaJuridico() { + return fechaJuridico; + } + + public void setFechaJuridico(Date fechaJuridico) { + this.fechaJuridico = fechaJuridico; + } + + public String getNombreUsuario() { + return nombreUsuario; + } + + public void setNombreUsuario(String nombreUsuario) { + this.nombreUsuario = nombreUsuario; + } + + + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/InformationLoanLastWeekView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/InformationLoanLastWeekView.java new file mode 100644 index 0000000..00ff8e7 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/InformationLoanLastWeekView.java @@ -0,0 +1,751 @@ +/* + * 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 com.arrebol.apc.model.enums.ActiveStatus; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.Date; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.Id; +import javax.persistence.Table; +import org.hibernate.annotations.Immutable; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Entity +@Immutable +@Table(name = "APC_INFORMATION_LOAN_LAST_WEEK_VIEW") +public class InformationLoanLastWeekView implements Serializable{ + + private static final long serialVersionUID = -6384789811291615117L; + + @Id + @Column(name = "id", length = 36) + private String id; + + @Column(name = "loan_type_name") + private String loanTypeName; + + @Column(name = "id_office") + private String idOffice; + + @Column(name = "id_user") + private String idUser; + + @Column(name = "estatus_prestamo") + private String estatusPrestamo; + + @Column(name = "fecha") + private Date fecha; + + @Column(name = "apoyos") + private BigDecimal apoyos; + + @Column(name = "apoyos_total") + private BigDecimal apoyosTotal; + + @Column(name = "comision_apertura") + private BigDecimal comisionApertura; + + @Column(name = "aval") + private String aval; + + @Column(name = "customer") + private String customer; + + @Column(name = "documento_por") + private BigDecimal documentoPor; + + @Column(name = "abono_diario") + private BigDecimal abonoDiario; + + @Column(name = "amount_paid") + private BigDecimal amountPaid; + + @Column(name = "saldo_insoluto") + private BigDecimal saldoInsoluto; + + @Column(name = "route_name") + private String routeName; + + @Column(name = "asesor") + private String asesor; + + @Column(name = "num_fee") + private int numFee; + + @Column(name = "payment_monday") + private BigDecimal paymentMonday; + + @Column(name = "fee_monday") + private BigDecimal feeMonday; + + @Column(name = "payment_tuesday") + private BigDecimal paymentTuesday; + + @Column(name = "fee_tuesday") + private BigDecimal feeTuesday; + + @Column(name = "payment_wednesday") + private BigDecimal paymentWednesday; + + @Column(name = "fee_wednesday") + private BigDecimal feeWednesday; + + @Column(name = "payment_thursday") + private BigDecimal paymentThursday; + + @Column(name = "fee_thursday") + private BigDecimal feeThursday; + + @Column(name = "payment_friday") + private BigDecimal paymentFriday; + + @Column(name = "fee_friday") + private BigDecimal feeFriday; + + @Column(name = "payment_saturday") + private BigDecimal paymentSaturday; + + @Column(name = "fee_saturday") + private BigDecimal feeSaturday; + + @Column(name = "faltante") + private BigDecimal faltante; + + @Column(name = "new_customer") + private String newCustomer; + + @Column(name = "renovation") + private String renovation; + + @Column(name = "abono_semana_actual") + private BigDecimal abonoSemanaActual; + + @Column(name = "fee_semana_actual") + private BigDecimal feeSemanaActual; + + @Column(name = "num_pagos_all") + private BigDecimal numPagosAll; + + @Column(name = "num_pagos_week") + private BigDecimal numPagosWeek; + + @Column(name = "fee_todos") + private BigDecimal feeTodos; + + @Enumerated(EnumType.STRING) + @Column(name = "frozen") + private ActiveStatus frozen; + + public ActiveStatus getFrozen() { + if (frozen == null) { + frozen = ActiveStatus.DISABLED; + } + return frozen; + } + + public void setFrozen(ActiveStatus frozen) { + this.frozen = frozen; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getLoanTypeName() { + return loanTypeName; + } + + public void setLoanTypeName(String loanTypeName) { + this.loanTypeName = loanTypeName; + } + + public String getEstatusPrestamo() { + return estatusPrestamo; + } + + public void setEstatusPrestamo(String estatusPrestamo) { + this.estatusPrestamo = estatusPrestamo; + } + + public String getIdOffice() { + return idOffice; + } + + public String getIdUser() { + return idUser; + } + + public void setIdUser(String idUser) { + this.idUser = idUser; + } + + public void setIdOffice(String idOffice) { + this.idOffice = idOffice; + } + + public Date getFecha() { + return fecha; + } + + public void setFecha(Date fecha) { + this.fecha = fecha; + } + + public BigDecimal getApoyos() { + return apoyos; + } + + public void setApoyos(BigDecimal apoyos) { + this.apoyos = apoyos; + } + + public BigDecimal getApoyosTotal() { + return apoyosTotal; + } + + public void setApoyosTotal(BigDecimal apoyosTotal) { + this.apoyosTotal = apoyosTotal; + } + + public BigDecimal getComisionApertura() { + return comisionApertura; + } + + public void setComisionApertura(BigDecimal comisionApertura) { + this.comisionApertura = comisionApertura; + } + + public String getAval() { + return aval; + } + + public void setAval(String aval) { + this.aval = aval; + } + + public String getCustomer() { + return customer; + } + + public void setCustomer(String customer) { + this.customer = customer; + } + + public BigDecimal getDocumentoPor() { + return documentoPor.subtract(feeSemanaActual); + } + + public void setDocumentoPor(BigDecimal documentoPor) { + this.documentoPor = documentoPor; + } + + public BigDecimal getAbonoDiario() { + return abonoDiario; + } + + public void setAbonoDiario(BigDecimal abonoDiario) { + this.abonoDiario = abonoDiario; + } + + public BigDecimal getAmountPaid() { + return amountPaid.subtract(abonoSemanaActual); + } + + public void setAmountPaid(BigDecimal amountPaid) { + this.amountPaid = amountPaid; + } + + public BigDecimal getSaldoInsoluto() { + return (documentoPor.subtract(feeSemanaActual)).subtract((amountPaid.subtract(abonoSemanaActual))); + } + + public void setSaldoInsoluto(BigDecimal saldoInsoluto) { + this.saldoInsoluto = saldoInsoluto; + } + + public String getRouteName() { + return routeName; + } + + public void setRouteName(String routeName) { + this.routeName = routeName; + } + + public String getAsesor() { + return asesor; + } + + public void setAsesor(String asesor) { + this.asesor = asesor; + } + + public int getNumFee() { + return numFee; + } + + public void setNumFee(int numFee) { + this.numFee = numFee; + } + + public BigDecimal getPaymentMonday() { + return paymentMonday; + } + + public void setPaymentMonday(BigDecimal paymentMonday) { + this.paymentMonday = paymentMonday; + } + + public BigDecimal getFeeMonday() { + return feeMonday; + } + + public void setFeeMonday(BigDecimal feeMonday) { + this.feeMonday = feeMonday; + } + + public BigDecimal getPaymentTuesday() { + return paymentTuesday; + } + + public void setPaymentTuesday(BigDecimal paymentTuesday) { + this.paymentTuesday = paymentTuesday; + } + + public BigDecimal getFeeTuesday() { + return feeTuesday; + } + + public void setFeeTuesday(BigDecimal feeTuesday) { + this.feeTuesday = feeTuesday; + } + + public BigDecimal getPaymentWednesday() { + return paymentWednesday; + } + + public void setPaymentWednesday(BigDecimal paymentWednesday) { + this.paymentWednesday = paymentWednesday; + } + + public BigDecimal getFeeWednesday() { + return feeWednesday; + } + + public void setFeeWednesday(BigDecimal feeWednesday) { + this.feeWednesday = feeWednesday; + } + + public BigDecimal getPaymentThursday() { + return paymentThursday; + } + + public void setPaymentThursday(BigDecimal paymentThursday) { + this.paymentThursday = paymentThursday; + } + + public BigDecimal getFeeThursday() { + return feeThursday; + } + + public void setFeeThursday(BigDecimal feeThursday) { + this.feeThursday = feeThursday; + } + + public BigDecimal getPaymentFriday() { + return paymentFriday; + } + + public void setPaymentFriday(BigDecimal paymentFriday) { + this.paymentFriday = paymentFriday; + } + + public BigDecimal getFeeFriday() { + return feeFriday; + } + + public void setFeeFriday(BigDecimal feeFriday) { + this.feeFriday = feeFriday; + } + + public BigDecimal getPaymentSaturday() { + return paymentSaturday; + } + + public void setPaymentSaturday(BigDecimal paymentSaturday) { + this.paymentSaturday = paymentSaturday; + } + + public BigDecimal getFeeSaturday() { + return feeSaturday; + } + + public void setFeeSaturday(BigDecimal feeSaturday) { + this.feeSaturday = feeSaturday; + } + + public BigDecimal getFeeTodos() { + return feeTodos; + } + + public void setFeeTodos(BigDecimal feeTodos) { + this.feeTodos = feeTodos; + } + + public BigDecimal getFaltante() { + + BigDecimal montoPagadoTotalEsperado = (numPagosAll.subtract(numPagosWeek)).multiply(abonoDiario); + + BigDecimal montoPagadoSemana = paymentFriday.add(paymentMonday).add(paymentSaturday).add(paymentThursday).add(paymentTuesday).add(paymentWednesday); + BigDecimal montoPagadoTotal = getAmountPaid().subtract(montoPagadoSemana); + + BigDecimal faltanteAcomulado = (montoPagadoTotalEsperado.add(feeTodos)).subtract(montoPagadoTotal); + + + BigDecimal montoEsperadoSemana = numPagosWeek.multiply(abonoDiario); + + BigDecimal feeSemana = feeFriday.add(feeMonday).add(feeSaturday).add(feeThursday).add(feeTuesday).add(feeWednesday); + + //RN1 + //Si el pago esperado por semana es igual al total de abonos en la semana, entonces faltante 0 + if(montoPagadoSemana.compareTo(montoEsperadoSemana) == 0) + { + return BigDecimal.ZERO; + } + + // RN4 + if(renovation.equalsIgnoreCase("Si") && faltante.compareTo(BigDecimal.ZERO) > 0){ + return BigDecimal.ZERO; + } + + // RN5 + if (numPagosAll.compareTo(BigDecimal.valueOf(22)) > 0 && faltante.compareTo(BigDecimal.ZERO) > 0) { + return BigDecimal.ZERO; + } + + // RN6 + if (loanTypeName.toLowerCase().contains("con") || loanTypeName.toLowerCase().contains("conv") + || loanTypeName.toLowerCase().contains("conve") || loanTypeName.toLowerCase().contains("convenio")) { + return BigDecimal.ZERO; + } + + //RN7 + if(getFrozen().equals(ActiveStatus.ENEBLED)){ + return BigDecimal.ZERO; + } + + if(numPagosAll.compareTo(BigDecimal.valueOf(22)) > 0) + { + if((numPagosAll.subtract(numPagosWeek)).compareTo(BigDecimal.valueOf(22)) > 0) + { + return montoPagadoSemana.negate(); + } + BigDecimal temp = numPagosAll.subtract(BigDecimal.valueOf(22)); + if(temp.compareTo(BigDecimal.ONE) == 0) + { + return (paymentFriday.add(paymentSaturday)).negate(); + } + if(temp.compareTo(BigDecimal.valueOf(2)) == 0) + { + return (paymentFriday.add(paymentSaturday).add(paymentThursday)).negate(); + } + if(temp.compareTo(BigDecimal.valueOf(3)) == 0) + { + return (paymentFriday.add(paymentSaturday).add(paymentThursday).add(paymentWednesday)).negate(); + } + if(temp.compareTo(BigDecimal.valueOf(4)) == 0) + { + return (paymentFriday.add(paymentSaturday).add(paymentThursday).add(paymentWednesday).add(paymentTuesday)).negate(); + } + } + + //RN2 + //Si el total de abonos por semana es menor al total de abonos esperado, entonces se muestra la diferencia + if(montoPagadoSemana.compareTo(montoEsperadoSemana) < 0) + { + if(getSaldoInsoluto().compareTo(BigDecimal.ZERO) == 0) + { + if(apoyosTotal.compareTo(getAmountPaid()) < 0) + { + BigDecimal esperadoAntesDe = (numPagosAll.subtract(numPagosWeek)).multiply(abonoDiario); + BigDecimal pagadoAntesDe = getAmountPaid().subtract(montoPagadoSemana); + BigDecimal faltanteAntesDe = feeTodos.subtract(feeSemana); + BigDecimal faltanteAcomuladoAntesDe = (esperadoAntesDe.add(faltanteAntesDe)).subtract(pagadoAntesDe); + if(faltanteAcomuladoAntesDe.compareTo(BigDecimal.ZERO) > 0) + { + if(faltanteAcomuladoAntesDe.compareTo(montoPagadoSemana) == 0) + { + return montoPagadoSemana.negate(); + } + if(faltanteAcomuladoAntesDe.compareTo(montoPagadoSemana) < 0) + { + return faltanteAcomuladoAntesDe.negate(); + } + if(faltanteAcomuladoAntesDe.compareTo(montoPagadoSemana) > 0) + { + return montoPagadoSemana.negate(); + } + } + } + return BigDecimal.ZERO; + } + if(faltanteAcomulado.compareTo(BigDecimal.ZERO) < 0) + { + if(faltanteAcomulado.abs().compareTo((montoEsperadoSemana.subtract(montoPagadoSemana))) == 0) + { + return BigDecimal.ZERO; + } + if(faltanteAcomulado.abs().compareTo((montoEsperadoSemana.subtract(montoPagadoSemana))) < 0) + { + return (montoEsperadoSemana.subtract(montoPagadoSemana)).subtract(faltanteAcomulado.abs()); + } + if(faltanteAcomulado.abs().compareTo((montoEsperadoSemana.subtract(montoPagadoSemana))) > 0) + { + return BigDecimal.ZERO; + } + } + + if(getSaldoInsoluto().compareTo((montoEsperadoSemana.subtract(montoPagadoSemana))) == 0) + { + return montoEsperadoSemana.subtract(montoPagadoSemana); + } + + if(getSaldoInsoluto().compareTo((montoEsperadoSemana.subtract(montoPagadoSemana))) < 0) + { + return getSaldoInsoluto(); + } + + if(getSaldoInsoluto().compareTo((montoEsperadoSemana.subtract(montoPagadoSemana))) > 0) + { + return montoEsperadoSemana.subtract(montoPagadoSemana); + } + } + + //RN3 + //Si el total de abonos por semana es mayor al total de abonos esperado, + if(montoPagadoSemana.compareTo(montoEsperadoSemana) > 0) + { + if(faltanteAcomulado.compareTo(BigDecimal.ZERO) < 0) + { + return BigDecimal.ZERO; + } + + if(faltanteAcomulado.compareTo(BigDecimal.ZERO) == 0) + { + if(feeSemana.compareTo(BigDecimal.ZERO) > 0) + { + if(feeSemana.compareTo(montoPagadoSemana.subtract(montoEsperadoSemana)) > 0) + { + return (montoPagadoSemana.subtract(montoEsperadoSemana)).negate(); + } + else + { + return feeSemana.negate(); + } + } + return BigDecimal.ZERO; + } + + if(faltanteAcomulado.compareTo(BigDecimal.ZERO) > 0) + { + if(faltanteAcomulado.compareTo((montoPagadoSemana.subtract(montoEsperadoSemana))) == 0) + { + return faltanteAcomulado.negate(); + } + if(faltanteAcomulado.compareTo((montoPagadoSemana.subtract(montoEsperadoSemana))) > 0) + { + return (montoPagadoSemana.subtract(montoEsperadoSemana)).negate(); + } + if(faltanteAcomulado.compareTo((montoPagadoSemana.subtract(montoEsperadoSemana))) < 0) + { + return faltanteAcomulado.negate(); + } + } + } + return faltante; + } + + public void setFaltante(BigDecimal faltante) { + this.faltante = faltante; + } + + public String getNewCustomer() { + return newCustomer; + } + + public void setNewCustomer(String newCustomer) { + this.newCustomer = newCustomer; + } + + public String getRenovation() { + return renovation; + } + + public void setRenovation(String renovation) { + this.renovation = renovation; + } + + public BigDecimal getAbonoSemanaActual() { + return abonoSemanaActual; + } + + public void setAbonoSemanaActual(BigDecimal abonoSemanaActual) { + this.abonoSemanaActual = abonoSemanaActual; + } + + public BigDecimal getFeeSemanaActual() { + return feeSemanaActual; + } + + public void setFeeSemanaActual(BigDecimal feeSemanaActual) { + this.feeSemanaActual = feeSemanaActual; + } + + public BigDecimal getNumPagosAll() { + return numPagosAll; + } + + public void setNumPagosAll(BigDecimal numPagosAll) { + this.numPagosAll = numPagosAll; + } + + public BigDecimal getNumPagosWeek() { + return numPagosWeek; + } + + public void setNumPagosWeek(BigDecimal numPagosWeek) { + this.numPagosWeek = numPagosWeek; + } + + public String getConditionLunes() { + if(feeMonday.compareTo(BigDecimal.ZERO) > 0) + return "redRow"; + else if(paymentMonday.compareTo(BigDecimal.ZERO) == 0 && feeMonday.compareTo(BigDecimal.ZERO) == 0) + return "greenRow"; + else if(feeMonday.compareTo(BigDecimal.ZERO) == 0 && paymentMonday.compareTo(BigDecimal.ZERO) > 0 && (paymentMonday.compareTo(abonoDiario) < 0)) + return "yellowRow"; + else if(feeMonday.compareTo(BigDecimal.ZERO) == 0 && paymentMonday.compareTo(BigDecimal.ZERO) > 0 && (paymentMonday.compareTo(abonoDiario) > 0)) + return "blueRow"; + else + return null; + } + + public String getConditionMartes() { + if(feeTuesday.compareTo(BigDecimal.ZERO) > 0) + return "redRow"; + else if(paymentTuesday.compareTo(BigDecimal.ZERO) == 0 && feeTuesday.compareTo(BigDecimal.ZERO) == 0) + return "greenRow"; + else if(feeTuesday.compareTo(BigDecimal.ZERO) == 0 && paymentTuesday.compareTo(BigDecimal.ZERO) > 0 && (paymentTuesday.compareTo(abonoDiario) < 0)) + return "yellowRow"; + else if(feeTuesday.compareTo(BigDecimal.ZERO) == 0 && paymentTuesday.compareTo(BigDecimal.ZERO) > 0 && (paymentTuesday.compareTo(abonoDiario) > 0)) + return "blueRow"; + else + return null; + } + + public String getConditionMiercoles() { + if(feeWednesday.compareTo(BigDecimal.ZERO) > 0) + return "redRow"; + else if(paymentWednesday.compareTo(BigDecimal.ZERO) == 0 && feeWednesday.compareTo(BigDecimal.ZERO) == 0) + return "greenRow"; + else if(feeWednesday.compareTo(BigDecimal.ZERO) == 0 && paymentWednesday.compareTo(BigDecimal.ZERO) > 0 && (paymentWednesday.compareTo(abonoDiario) < 0)) + return "yellowRow"; + else if(feeWednesday.compareTo(BigDecimal.ZERO) == 0 && paymentWednesday.compareTo(BigDecimal.ZERO) > 0 && (paymentWednesday.compareTo(abonoDiario) > 0)) + return "blueRow"; + else + return null; + } + + public String getConditionJueves() { + if(feeThursday.compareTo(BigDecimal.ZERO) > 0) + return "redRow"; + else if(paymentThursday.compareTo(BigDecimal.ZERO) == 0 && feeThursday.compareTo(BigDecimal.ZERO) == 0) + return "greenRow"; + else if(feeThursday.compareTo(BigDecimal.ZERO) == 0 && paymentThursday.compareTo(BigDecimal.ZERO) > 0 && (paymentThursday.compareTo(abonoDiario) < 0)) + return "yellowRow"; + else if(feeThursday.compareTo(BigDecimal.ZERO) == 0 && paymentThursday.compareTo(BigDecimal.ZERO) > 0 && (paymentThursday.compareTo(abonoDiario) > 0)) + return "blueRow"; + else + return null; + } + + public String getConditionViernes() { + if(feeFriday.compareTo(BigDecimal.ZERO) > 0) + return "redRow"; + else if(paymentFriday.compareTo(BigDecimal.ZERO) == 0 && feeFriday.compareTo(BigDecimal.ZERO) == 0) + return "greenRow"; + else if(feeFriday.compareTo(BigDecimal.ZERO) == 0 && paymentFriday.compareTo(BigDecimal.ZERO) > 0 && (paymentFriday.compareTo(abonoDiario) < 0)) + return "yellowRow"; + else if(feeFriday.compareTo(BigDecimal.ZERO) == 0 && paymentFriday.compareTo(BigDecimal.ZERO) > 0 && (paymentFriday.compareTo(abonoDiario) > 0)) + return "blueRow"; + else + return null; + } + + public String getConditionSabado() { + if(feeSaturday.compareTo(BigDecimal.ZERO) > 0) + return "redRow"; + else if(paymentSaturday.compareTo(BigDecimal.ZERO) == 0 && feeSaturday.compareTo(BigDecimal.ZERO) == 0) + return "greenRow"; + else if(feeSaturday.compareTo(BigDecimal.ZERO) == 0 && paymentSaturday.compareTo(BigDecimal.ZERO) > 0 && (paymentSaturday.compareTo(abonoDiario) < 0)) + return "yellowRow"; + else if(feeSaturday.compareTo(BigDecimal.ZERO) == 0 && paymentSaturday.compareTo(BigDecimal.ZERO) > 0 && (paymentSaturday.compareTo(abonoDiario) > 0)) + return "blueRow"; + else + return null; + } + + public String getConditionNewCustomer() { + if(newCustomer.equalsIgnoreCase("Si")) + return "greenRow"; + else + return null; + } + + public String getConditionRenovation() { + if (getFrozen().equals(ActiveStatus.ENEBLED)) { + return "blueLightRow"; + } + if (newCustomer.equalsIgnoreCase("Si")) + return "orangeRow"; + else if(renovation.equalsIgnoreCase("Si")) + return "greenLigthRow"; + else if(getSaldoInsoluto().compareTo(BigDecimal.ZERO) == 0) + return "greenStrongRow"; + else + return null; + } + + public int getWeekLoanDate() { + Calendar c2 = Calendar.getInstance(); + c2.setTime(getFecha()); + int weekLoanDate = c2.get(Calendar.WEEK_OF_YEAR); + + return weekLoanDate; + } + + public int getWeekCurrentDate() { + Calendar c2 = Calendar.getInstance(); + int weekCurrentDate = c2.get(Calendar.WEEK_OF_YEAR); + weekCurrentDate = weekCurrentDate - 1; + return weekCurrentDate; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/InformationLoanWeekView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/InformationLoanWeekView.java new file mode 100644 index 0000000..cce9f16 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/InformationLoanWeekView.java @@ -0,0 +1,1150 @@ +/* + * 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 com.arrebol.apc.model.enums.ActiveStatus; +import java.io.Serializable; +import java.math.BigDecimal; +import java.math.MathContext; +import java.util.Calendar; +import java.util.Date; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Transient; +import org.hibernate.annotations.Immutable; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Entity +@Immutable +@Table(name = "APC_INFORMATION_LOAN_WEEK_VIEW") +public class InformationLoanWeekView implements Serializable { + + private static final long serialVersionUID = -6384789811291615117L; + + @Id + @Column(name = "id", length = 36) + private String id; + + @Column(name = "id_office") + private String idOffice; + + @Column(name = "loan_type_name") + private String loanTypeName; + + @Column(name = "id_user") + private String idUser; + + @Column(name = "estatus_prestamo") + private String estatusPrestamo; + + @Column(name = "fecha") + private Date fecha; + + @Column(name = "apoyos") + private BigDecimal apoyos; + + @Column(name = "apoyos_total") + private BigDecimal apoyosTotal; + + @Column(name = "comision_apertura") + private BigDecimal comisionApertura; + + @Column(name = "aval") + private String aval; + + @Column(name = "customer") + private String customer; + + @Column(name = "documento_por") + private BigDecimal documentoPor; + + @Column(name = "abono_diario") + private BigDecimal abonoDiario; + + @Column(name = "amount_paid") + private BigDecimal amountPaid; + + @Column(name = "saldo_insoluto") + private BigDecimal saldoInsoluto; + + @Column(name = "route_name") + private String routeName; + + @Column(name = "asesor") + private String asesor; + + @Column(name = "num_fee") + private int numFee; + + @Column(name = "payment_monday") + private BigDecimal paymentMonday; + + @Column(name = "fee_monday") + private BigDecimal feeMonday; + + @Column(name = "payment_tuesday") + private BigDecimal paymentTuesday; + + @Column(name = "fee_tuesday") + private BigDecimal feeTuesday; + + @Column(name = "payment_wednesday") + private BigDecimal paymentWednesday; + + @Column(name = "fee_wednesday") + private BigDecimal feeWednesday; + + @Column(name = "payment_thursday") + private BigDecimal paymentThursday; + + @Column(name = "fee_thursday") + private BigDecimal feeThursday; + + @Column(name = "payment_friday") + private BigDecimal paymentFriday; + + @Column(name = "fee_friday") + private BigDecimal feeFriday; + + @Column(name = "payment_saturday") + private BigDecimal paymentSaturday; + + @Column(name = "fee_saturday") + private BigDecimal feeSaturday; + + @Column(name = "faltante") + private BigDecimal faltante; + + @Column(name = "new_customer") + private String newCustomer; + + @Column(name = "renovation") + private String renovation; + + @Column(name = "num_pagos_all") + private BigDecimal numPagosAll; + + @Column(name = "num_pagos_week") + private BigDecimal numPagosWeek; + + @Column(name = "fee_todos") + private BigDecimal feeTodos; + + @Enumerated(EnumType.STRING) + @Column(name = "frozen") + private ActiveStatus frozen; + + @Transient + private BigDecimal totalPaid; + + @Transient + private BigDecimal numPagosLoanType; + + @Transient + private String movimientosMonday; + + @Transient + private String movimientosTuesday; + + @Transient + private String movimientosWednesday; + + @Transient + private String movimientosThursday; + + @Transient + private String movimientosFriday; + + @Transient + private String movimientosSaturday; + + @Transient + private String renovationMonday; + + @Transient + private String renovationTuesday; + + @Transient + private String renovationWednesday; + + @Transient + private String renovationThursday; + + @Transient + private String renovationFriday; + + @Transient + private String renovationSaturday; + + @Transient + private String reactivation; + + @Transient + private String weekOfCreation; + + private BigDecimal faltanteHistorico; + + private BigDecimal recuperado; + + private BigDecimal faltanteSemana; + + private BigDecimal feeSemana; + + public ActiveStatus getFrozen() { + if (frozen == null) { + frozen = ActiveStatus.DISABLED; + } + return frozen; + } + + public void setFrozen(ActiveStatus frozen) { + this.frozen = frozen; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getLoanTypeName() { + return loanTypeName; + } + + public void setLoanTypeName(String loanTypeName) { + this.loanTypeName = loanTypeName; + } + + public String getEstatusPrestamo() { + return estatusPrestamo; + } + + public void setEstatusPrestamo(String estatusPrestamo) { + this.estatusPrestamo = estatusPrestamo; + } + + public String getIdOffice() { + return idOffice; + } + + public void setIdOffice(String idOffice) { + this.idOffice = idOffice; + } + + public String getIdUser() { + return idUser; + } + + public void setIdUser(String idUser) { + this.idUser = idUser; + } + + public Date getFecha() { + return fecha; + } + + public void setFecha(Date fecha) { + this.fecha = fecha; + } + + public BigDecimal getApoyos() { + return apoyos; + } + + public void setApoyos(BigDecimal apoyos) { + this.apoyos = apoyos; + } + + public BigDecimal getApoyosTotal() { + return apoyosTotal; + } + + public void setApoyosTotal(BigDecimal apoyosTotal) { + this.apoyosTotal = apoyosTotal; + } + + public BigDecimal getComisionApertura() { + return comisionApertura; + } + + public void setComisionApertura(BigDecimal comisionApertura) { + this.comisionApertura = comisionApertura; + } + + public String getAval() { + return aval; + } + + public void setAval(String aval) { + this.aval = aval; + } + + public String getCustomer() { + return customer; + } + + public void setCustomer(String customer) { + this.customer = customer; + } + + public BigDecimal getDocumentoPor() { + return documentoPor; + } + + public void setDocumentoPor(BigDecimal documentoPor) { + this.documentoPor = documentoPor; + } + + public BigDecimal getAbonoDiario() { + return abonoDiario; + } + + public void setAbonoDiario(BigDecimal abonoDiario) { + this.abonoDiario = abonoDiario; + } + + public BigDecimal getAmountPaid() { + return amountPaid; + } + + public void setAmountPaid(BigDecimal amountPaid) { + this.amountPaid = amountPaid; + } + + public BigDecimal getSaldoInsoluto() { + return saldoInsoluto; + } + + public void setSaldoInsoluto(BigDecimal saldoInsoluto) { + this.saldoInsoluto = saldoInsoluto; + } + + public String getRouteName() { + return routeName; + } + + public void setRouteName(String routeName) { + this.routeName = routeName; + } + + public String getAsesor() { + return asesor; + } + + public void setAsesor(String asesor) { + this.asesor = asesor; + } + + public int getNumFee() { + return numFee; + } + + public void setNumFee(int numFee) { + this.numFee = numFee; + } + + public BigDecimal getPaymentMonday() { + return paymentMonday; + } + + public void setPaymentMonday(BigDecimal paymentMonday) { + this.paymentMonday = paymentMonday; + } + + public BigDecimal getFeeMonday() { + return feeMonday; + } + + public void setFeeMonday(BigDecimal feeMonday) { + this.feeMonday = feeMonday; + } + + public BigDecimal getPaymentTuesday() { + return paymentTuesday; + } + + public void setPaymentTuesday(BigDecimal paymentTuesday) { + this.paymentTuesday = paymentTuesday; + } + + public BigDecimal getFeeTuesday() { + return feeTuesday; + } + + public void setFeeTuesday(BigDecimal feeTuesday) { + this.feeTuesday = feeTuesday; + } + + public BigDecimal getPaymentWednesday() { + return paymentWednesday; + } + + public void setPaymentWednesday(BigDecimal paymentWednesday) { + this.paymentWednesday = paymentWednesday; + } + + public BigDecimal getFeeWednesday() { + return feeWednesday; + } + + public void setFeeWednesday(BigDecimal feeWednesday) { + this.feeWednesday = feeWednesday; + } + + public BigDecimal getPaymentThursday() { + return paymentThursday; + } + + public void setPaymentThursday(BigDecimal paymentThursday) { + this.paymentThursday = paymentThursday; + } + + public BigDecimal getFeeThursday() { + return feeThursday; + } + + public void setFeeThursday(BigDecimal feeThursday) { + this.feeThursday = feeThursday; + } + + public BigDecimal getPaymentFriday() { + return paymentFriday; + } + + public void setPaymentFriday(BigDecimal paymentFriday) { + this.paymentFriday = paymentFriday; + } + + public BigDecimal getFeeFriday() { + return feeFriday; + } + + public void setFeeFriday(BigDecimal feeFriday) { + this.feeFriday = feeFriday; + } + + public BigDecimal getPaymentSaturday() { + return paymentSaturday; + } + + public void setPaymentSaturday(BigDecimal paymentSaturday) { + this.paymentSaturday = paymentSaturday; + } + + public BigDecimal getFeeSaturday() { + return feeSaturday; + } + + public void setFeeSaturday(BigDecimal feeSaturday) { + this.feeSaturday = feeSaturday; + } + + public BigDecimal getNumPagosAll() { + return numPagosAll; + } + + public void setNumPagosAll(BigDecimal numPagosAll) { + this.numPagosAll = numPagosAll; + } + + public BigDecimal getNumPagosWeek() { + return numPagosWeek; + } + + public void setNumPagosWeek(BigDecimal numPagosWeek) { + this.numPagosWeek = numPagosWeek; + } + + public BigDecimal getFeeTodos() { + return feeTodos; + } + + public void setFeeTodos(BigDecimal feeTodos) { + this.feeTodos = feeTodos; + } + + public BigDecimal getTotalPaid() { + return totalPaid; + } + + public void setTotalPaid(BigDecimal totalPaid) { + this.totalPaid = totalPaid; + } + + public BigDecimal getNumPagosLoanType() { + return numPagosLoanType; + } + + public void setNumPagosLoanType(BigDecimal numPagosLoanType) { + this.numPagosLoanType = numPagosLoanType; + } + + public BigDecimal getFaltante() { + + //if(id.equals("f911ef4c-b6f2-4ecf-91b6-3d6d6bcf9faa")){ + BigDecimal montoPagadoTotalEsperado = (numPagosAll.subtract(numPagosWeek)).multiply(abonoDiario); + + if (numPagosAll.subtract(numPagosWeek).compareTo(numPagosLoanType) >= 0) { + + montoPagadoTotalEsperado = (numPagosLoanType).multiply(abonoDiario); + } + + BigDecimal montoPagadoSemana = paymentFriday.add(paymentMonday).add(paymentSaturday).add(paymentThursday).add(paymentTuesday).add(paymentWednesday); + + BigDecimal montoPagadoTotalPasado = totalPaid.subtract(montoPagadoSemana); + + BigDecimal faltanteAcomulado = (montoPagadoTotalEsperado.add(feeTodos)).subtract(montoPagadoTotalPasado); + + BigDecimal faltanteSemanaCalculo = getFaltanteSemana(); + + BigDecimal recuperadoSemana = getRecuperado(); + + BigDecimal montoEsperadoSemana = numPagosWeek.multiply(abonoDiario); + + BigDecimal feeSemana = feeFriday.add(feeMonday).add(feeSaturday).add(feeThursday).add(feeTuesday).add(feeWednesday); + + //montoPagadoTotalEsperado.add(feeSemana).add(feeTodos); + //RN1 + //Si el pago esperado por semana es igual al total de abonos en la semana, entonces faltante 0 + if (montoPagadoSemana.compareTo(montoEsperadoSemana) == 0) { + return BigDecimal.ZERO; + } + + // RN4 + /*if(renovation.equalsIgnoreCase("Si") && faltante.compareTo(BigDecimal.ZERO) > 0){ + return BigDecimal.ZERO; + }*/ + if (renovationMonday.equalsIgnoreCase("Si") || renovationTuesday.equalsIgnoreCase("Si") + || renovationThursday.equalsIgnoreCase("Si") || renovationWednesday.equalsIgnoreCase("Si") + || renovationFriday.equalsIgnoreCase("Si") || renovationSaturday.equalsIgnoreCase("Si")) { + + if (faltanteAcomulado.compareTo(BigDecimal.ZERO) <= 0) { + return BigDecimal.ZERO; + } + + return faltanteAcomulado.negate(); + } + + // RN5 + // if (numPagosAll.compareTo(BigDecimal.valueOf(22)) > 0 && faltante.compareTo(BigDecimal.ZERO) > 0) { + // return BigDecimal.ZERO; + //} + // RN6 + if (loanTypeName.toLowerCase().contains("con") || loanTypeName.toLowerCase().contains("conv") + || loanTypeName.toLowerCase().contains("conve") || loanTypeName.toLowerCase().contains("convenio")) { + return BigDecimal.ZERO; + } + + //RN7 + if (getFrozen().equals(ActiveStatus.ENEBLED)) { + return BigDecimal.ZERO; + } + + if (numPagosAll.compareTo(BigDecimal.valueOf(22)) > 0) { + + return montoPagadoSemana.negate(); + + } + + //RN2 + //Si el total de abonos por semana es menor al total de abonos esperado, entonces se muestra la diferencia + if (montoPagadoSemana.compareTo(montoEsperadoSemana) < 0) { + if (faltanteAcomulado.compareTo(BigDecimal.ZERO) < 0) { + + faltanteAcomulado = faltanteAcomulado.negate(); + + switch ((faltanteAcomulado).compareTo(faltanteSemanaCalculo)) { + case (-1): + return montoEsperadoSemana.subtract(montoPagadoSemana).subtract(faltanteAcomulado); + case (0): + return BigDecimal.ZERO; + case (1): + return BigDecimal.ZERO; + } + + } + + return montoEsperadoSemana.subtract(montoPagadoSemana); + + } + + //RN3 + //Si el total de abonos por semana es mayor al total de abonos esperado, + if (montoPagadoSemana.compareTo(montoEsperadoSemana) > 0) { + if (faltanteAcomulado.compareTo(BigDecimal.ZERO) < 0) { + return BigDecimal.ZERO; + } + + if (faltanteAcomulado.compareTo(BigDecimal.ZERO) > 0) { + if (faltanteAcomulado.compareTo((recuperadoSemana)) == 0) { + + return faltanteAcomulado.negate(); + } + if (faltanteAcomulado.compareTo(recuperadoSemana) > 0) { + return montoPagadoSemana.subtract(montoEsperadoSemana).negate(); + } + if (faltanteAcomulado.compareTo(recuperadoSemana) < 0) { + + if ((feeSemana).compareTo(BigDecimal.ZERO) == 0) { + return faltanteAcomulado.negate(); + } + + switch ((faltanteAcomulado.add(feeSemana)).compareTo((recuperadoSemana))) { + case (-1): + return (feeSemana.add(faltanteAcomulado)).negate(); + case (0): + return BigDecimal.ZERO; + case (1): + return (montoPagadoSemana.subtract(montoEsperadoSemana)).negate(); + } + + } + } + } + //return faltante; + //} + + return BigDecimal.ZERO; + } + + public void setFaltante(BigDecimal faltante) { + this.faltante = faltante; + } + + public BigDecimal getFaltanteHistorico() { + BigDecimal montoPagadoTotalEsperado = (numPagosAll.subtract(numPagosWeek)).multiply(abonoDiario); + + if (numPagosAll.subtract(numPagosWeek).compareTo(numPagosLoanType) >= 0) { + + montoPagadoTotalEsperado = (numPagosLoanType).multiply(abonoDiario); + } + BigDecimal montoPagadoSemana = paymentFriday.add(paymentMonday).add(paymentSaturday).add(paymentThursday).add(paymentTuesday).add(paymentWednesday); + BigDecimal montoPagadoTotal = totalPaid; + BigDecimal montoPagadoTotalPasado = montoPagadoTotal.subtract(montoPagadoSemana); + + return montoPagadoTotalEsperado.add(feeTodos).subtract(montoPagadoTotalPasado); + } + + public void setFaltanteHistorico(BigDecimal faltanteHistorico) { + this.faltanteHistorico = faltanteHistorico; + } + + public BigDecimal getRecuperado() { + BigDecimal recuperadoSemanaPorDia = BigDecimal.ZERO; + + //if(id.equals("4177c7d0-46ee-4862-aa5f-d0526798cc41")){ + if ((numPagosAll.subtract(numPagosWeek)).compareTo(BigDecimal.valueOf(22)) >= 0) { + + return paymentMonday.add(paymentThursday).add(paymentWednesday).add(paymentTuesday).add(paymentFriday).add(paymentSaturday); + + } + + /*if(getFaltanteHistorico().compareTo(BigDecimal.ZERO)<0) + { + return BigDecimal.ZERO; + }*/ + if (renovationMonday.equalsIgnoreCase("Si")) { + return recuperadoSemanaPorDia; + + } + + if (movimientosMonday.equalsIgnoreCase("Si")) { + recuperadoSemanaPorDia = ((paymentMonday.subtract(abonoDiario).compareTo(BigDecimal.ZERO)) > 0) ? recuperadoSemanaPorDia.add(paymentMonday.subtract(abonoDiario)) : recuperadoSemanaPorDia; + } + + if (renovationTuesday.equalsIgnoreCase("Si")) { + return recuperadoSemanaPorDia; + + } + + if (movimientosTuesday.equalsIgnoreCase("Si")) { + recuperadoSemanaPorDia = ((paymentTuesday.subtract(abonoDiario).compareTo(BigDecimal.ZERO)) > 0) ? recuperadoSemanaPorDia.add(paymentTuesday.subtract(abonoDiario)) : recuperadoSemanaPorDia; + } + + if (renovationWednesday.equalsIgnoreCase("Si")) { + return recuperadoSemanaPorDia; + + } + if (movimientosWednesday.equalsIgnoreCase("Si")) { + recuperadoSemanaPorDia = ((paymentWednesday.subtract(abonoDiario).compareTo(BigDecimal.ZERO)) > 0) ? recuperadoSemanaPorDia.add(paymentWednesday.subtract(abonoDiario)) : recuperadoSemanaPorDia; + + } + + if (renovationThursday.equalsIgnoreCase("Si")) { + return recuperadoSemanaPorDia; + + } + + if (movimientosThursday.equalsIgnoreCase("Si")) { + recuperadoSemanaPorDia = ((paymentThursday.subtract(abonoDiario).compareTo(BigDecimal.ZERO)) > 0) ? recuperadoSemanaPorDia.add(paymentThursday.subtract(abonoDiario)) : recuperadoSemanaPorDia; + + } + + if (renovationFriday.equalsIgnoreCase("Si")) { + return recuperadoSemanaPorDia; + + } + + if (movimientosFriday.equalsIgnoreCase("Si")) { + recuperadoSemanaPorDia = ((paymentFriday.subtract(abonoDiario).compareTo(BigDecimal.ZERO)) > 0) ? recuperadoSemanaPorDia.add(paymentFriday.subtract(abonoDiario)) : recuperadoSemanaPorDia; + + } + + if (renovationSaturday.equalsIgnoreCase("Si")) { + return recuperadoSemanaPorDia; + + } + + if (movimientosSaturday.equalsIgnoreCase("Si")) { + recuperadoSemanaPorDia = ((paymentSaturday.subtract(abonoDiario).compareTo(BigDecimal.ZERO)) > 0) ? recuperadoSemanaPorDia.add(paymentSaturday.subtract(abonoDiario)) : recuperadoSemanaPorDia; + + } + //} + + BigDecimal faltanteTotal = getFaltanteHistorico().add(getFaltanteSemana()); + + if (faltanteTotal.compareTo(BigDecimal.ZERO) > 0) { + + switch (recuperadoSemanaPorDia.compareTo(faltanteTotal)) { + case (-1): + return recuperadoSemanaPorDia; + case (0): + return recuperadoSemanaPorDia; + case (1): + return faltanteTotal; + + } + } else { + return BigDecimal.ZERO; + } + + return recuperadoSemanaPorDia; + + } + + public void setRecuperado(BigDecimal recuperado) { + this.recuperado = recuperado; + } + + public BigDecimal getFaltanteSemana() { + getId(); + + BigDecimal faltanteSemanaPorDia = BigDecimal.ZERO; + //if(id.equals("93ad8123-9b0d-4087-a85b-3216af2bacbf")){ + + if ((numPagosAll.subtract(numPagosWeek)).compareTo(BigDecimal.valueOf(22)) >= 0) { + + return faltanteSemanaPorDia; + + } + + if (renovationMonday.equalsIgnoreCase("Si")) { + return faltanteSemanaPorDia; + + } + if ((numPagosAll.subtract(numPagosWeek).add(BigDecimal.valueOf(1))).compareTo(BigDecimal.valueOf(22)) <= 0) { + if (movimientosMonday.equalsIgnoreCase("Si")) { + + if (feeMonday.compareTo(BigDecimal.ZERO) > 0) { + faltanteSemanaPorDia = ((abonoDiario.subtract(paymentMonday).compareTo(BigDecimal.ZERO)) > 0) ? faltanteSemanaPorDia.add(abonoDiario.subtract(paymentMonday)) : faltanteSemanaPorDia; + + } else if (paymentMonday.compareTo(BigDecimal.ZERO) == 0) { + + } else { + faltanteSemanaPorDia = ((abonoDiario.subtract(paymentMonday).compareTo(BigDecimal.ZERO)) > 0) ? faltanteSemanaPorDia.add(abonoDiario.subtract(paymentMonday)) : faltanteSemanaPorDia; + } + + } + } + + if (renovationTuesday.equalsIgnoreCase("Si")) { + return faltanteSemanaPorDia; + + } + + if ((numPagosAll.subtract(numPagosWeek).add(BigDecimal.valueOf(2))).compareTo(BigDecimal.valueOf(22)) <= 0) { + if (movimientosTuesday.equalsIgnoreCase("Si")) { + + if (feeTuesday.compareTo(BigDecimal.ZERO) > 0) { + faltanteSemanaPorDia = ((abonoDiario.subtract(paymentTuesday).compareTo(BigDecimal.ZERO)) > 0) ? faltanteSemanaPorDia.add(abonoDiario.subtract(paymentTuesday)) : faltanteSemanaPorDia; + + } else if (paymentTuesday.compareTo(BigDecimal.ZERO) == 0) { + + } else { + faltanteSemanaPorDia = ((abonoDiario.subtract(paymentTuesday).compareTo(BigDecimal.ZERO)) > 0) ? faltanteSemanaPorDia.add(abonoDiario.subtract(paymentTuesday)) : faltanteSemanaPorDia; + } + + } + } + + if (renovationWednesday.equalsIgnoreCase("Si")) { + return faltanteSemanaPorDia; + + } + if ((numPagosAll.subtract(numPagosWeek).add(BigDecimal.valueOf(3))).compareTo(BigDecimal.valueOf(22)) <= 0) { + if (movimientosWednesday.equalsIgnoreCase("Si")) { + + if (feeWednesday.compareTo(BigDecimal.ZERO) > 0) { + faltanteSemanaPorDia = ((abonoDiario.subtract(paymentWednesday).compareTo(BigDecimal.ZERO)) > 0) ? faltanteSemanaPorDia.add(abonoDiario.subtract(paymentWednesday)) : faltanteSemanaPorDia; + + } else if (paymentWednesday.compareTo(BigDecimal.ZERO) == 0) { + + } else { + faltanteSemanaPorDia = ((abonoDiario.subtract(paymentWednesday).compareTo(BigDecimal.ZERO)) > 0) ? faltanteSemanaPorDia.add(abonoDiario.subtract(paymentWednesday)) : faltanteSemanaPorDia; + } + + } + } + + if (renovationThursday.equalsIgnoreCase("Si")) { + return faltanteSemanaPorDia; + + } + if ((numPagosAll.subtract(numPagosWeek).add(BigDecimal.valueOf(4))).compareTo(BigDecimal.valueOf(22)) <= 0) { + if (movimientosThursday.equalsIgnoreCase("Si")) { + + if (feeThursday.compareTo(BigDecimal.ZERO) > 0) { + faltanteSemanaPorDia = ((abonoDiario.subtract(paymentThursday).compareTo(BigDecimal.ZERO)) > 0) ? faltanteSemanaPorDia.add(abonoDiario.subtract(paymentThursday)) : faltanteSemanaPorDia; + + } else if (paymentThursday.compareTo(BigDecimal.ZERO) == 0) { + + } else { + faltanteSemanaPorDia = ((abonoDiario.subtract(paymentThursday).compareTo(BigDecimal.ZERO)) > 0) ? faltanteSemanaPorDia.add(abonoDiario.subtract(paymentThursday)) : faltanteSemanaPorDia; + } + } + } + + if (renovationFriday.equalsIgnoreCase("Si")) { + return faltanteSemanaPorDia; + + } + if ((numPagosAll.subtract(numPagosWeek).add(BigDecimal.valueOf(5))).compareTo(BigDecimal.valueOf(22)) <= 0) { + if (movimientosFriday.equalsIgnoreCase("Si")) { + + if (feeFriday.compareTo(BigDecimal.ZERO) > 0) { + faltanteSemanaPorDia = ((abonoDiario.subtract(paymentFriday).compareTo(BigDecimal.ZERO)) > 0) ? faltanteSemanaPorDia.add(abonoDiario.subtract(paymentFriday)) : faltanteSemanaPorDia; + + } else if (paymentFriday.compareTo(BigDecimal.ZERO) == 0) { + + } else { + faltanteSemanaPorDia = ((abonoDiario.subtract(paymentFriday).compareTo(BigDecimal.ZERO)) > 0) ? faltanteSemanaPorDia.add(abonoDiario.subtract(paymentFriday)) : faltanteSemanaPorDia; + } + } + } + + if (renovationSaturday.equalsIgnoreCase("Si")) { + return faltanteSemanaPorDia; + + } + if ((numPagosAll.subtract(numPagosWeek).add(BigDecimal.valueOf(6))).compareTo(BigDecimal.valueOf(22)) <= 0) { + if (movimientosSaturday.equalsIgnoreCase("Si")) { + + if (feeSaturday.compareTo(BigDecimal.ZERO) > 0) { + faltanteSemanaPorDia = ((abonoDiario.subtract(paymentSaturday).compareTo(BigDecimal.ZERO)) > 0) ? faltanteSemanaPorDia.add(abonoDiario.subtract(paymentSaturday)) : faltanteSemanaPorDia; + + } else if (paymentSaturday.compareTo(BigDecimal.ZERO) == 0) { + + } else { + faltanteSemanaPorDia = ((abonoDiario.subtract(paymentSaturday).compareTo(BigDecimal.ZERO)) > 0) ? faltanteSemanaPorDia.add(abonoDiario.subtract(paymentSaturday)) : faltanteSemanaPorDia; + } + } + } + // } + + /* + if(getFaltanteHistorico().compareTo(BigDecimal.ZERO)<0) + { + BigDecimal faltanteHistoricoAbsoluto = getFaltanteHistorico().abs(); + switch(faltanteHistoricoAbsoluto.compareTo(faltanteSemanaPorDia)){ + case (-1): return faltanteSemanaPorDia.subtract(faltanteHistoricoAbsoluto); + case (0): return BigDecimal.ZERO; + case (1): return BigDecimal.ZERO; + } + }*/ + return faltanteSemanaPorDia; + } + + public void setFaltanteSemana(BigDecimal faltanteSemana) { + this.faltanteSemana = faltanteSemana; + } + + public String getNewCustomer() { + return newCustomer; + } + + public void setNewCustomer(String newCustomer) { + this.newCustomer = newCustomer; + } + + public String getRenovation() { + return renovation; + } + + public void setRenovation(String renovation) { + this.renovation = renovation; + } + + public String getConditionLunes() { + if (feeMonday.compareTo(BigDecimal.ZERO) > 0) { + return "redRow"; + } else if (paymentMonday.compareTo(BigDecimal.ZERO) == 0 && feeMonday.compareTo(BigDecimal.ZERO) == 0) { + return "greenRow"; + } else if (feeMonday.compareTo(BigDecimal.ZERO) == 0 && paymentMonday.compareTo(BigDecimal.ZERO) > 0 && (paymentMonday.compareTo(abonoDiario) < 0)) { + return "yellowRow"; + } else if (feeMonday.compareTo(BigDecimal.ZERO) == 0 && paymentMonday.compareTo(BigDecimal.ZERO) > 0 && (paymentMonday.compareTo(abonoDiario) > 0)) { + return "blueRow"; + } else { + return null; + } + } + + public String getConditionMartes() { + if (feeTuesday.compareTo(BigDecimal.ZERO) > 0) { + return "redRow"; + } else if (paymentTuesday.compareTo(BigDecimal.ZERO) == 0 && feeTuesday.compareTo(BigDecimal.ZERO) == 0) { + return "greenRow"; + } else if (feeTuesday.compareTo(BigDecimal.ZERO) == 0 && paymentTuesday.compareTo(BigDecimal.ZERO) > 0 && (paymentTuesday.compareTo(abonoDiario) < 0)) { + return "yellowRow"; + } else if (feeTuesday.compareTo(BigDecimal.ZERO) == 0 && paymentTuesday.compareTo(BigDecimal.ZERO) > 0 && (paymentTuesday.compareTo(abonoDiario) > 0)) { + return "blueRow"; + } else { + return null; + } + } + + public String getConditionMiercoles() { + if (feeWednesday.compareTo(BigDecimal.ZERO) > 0) { + return "redRow"; + } else if (paymentWednesday.compareTo(BigDecimal.ZERO) == 0 && feeWednesday.compareTo(BigDecimal.ZERO) == 0) { + return "greenRow"; + } else if (feeWednesday.compareTo(BigDecimal.ZERO) == 0 && paymentWednesday.compareTo(BigDecimal.ZERO) > 0 && (paymentWednesday.compareTo(abonoDiario) < 0)) { + return "yellowRow"; + } else if (feeWednesday.compareTo(BigDecimal.ZERO) == 0 && paymentWednesday.compareTo(BigDecimal.ZERO) > 0 && (paymentWednesday.compareTo(abonoDiario) > 0)) { + return "blueRow"; + } else { + return null; + } + } + + public String getConditionJueves() { + if (feeThursday.compareTo(BigDecimal.ZERO) > 0) { + return "redRow"; + } else if (paymentThursday.compareTo(BigDecimal.ZERO) == 0 && feeThursday.compareTo(BigDecimal.ZERO) == 0) { + return "greenRow"; + } else if (feeThursday.compareTo(BigDecimal.ZERO) == 0 && paymentThursday.compareTo(BigDecimal.ZERO) > 0 && (paymentThursday.compareTo(abonoDiario) < 0)) { + return "yellowRow"; + } else if (feeThursday.compareTo(BigDecimal.ZERO) == 0 && paymentThursday.compareTo(BigDecimal.ZERO) > 0 && (paymentThursday.compareTo(abonoDiario) > 0)) { + return "blueRow"; + } else { + return null; + } + } + + public String getConditionViernes() { + if (feeFriday.compareTo(BigDecimal.ZERO) > 0) { + return "redRow"; + } else if (paymentFriday.compareTo(BigDecimal.ZERO) == 0 && feeFriday.compareTo(BigDecimal.ZERO) == 0) { + return "greenRow"; + } else if (feeFriday.compareTo(BigDecimal.ZERO) == 0 && paymentFriday.compareTo(BigDecimal.ZERO) > 0 && (paymentFriday.compareTo(abonoDiario) < 0)) { + return "yellowRow"; + } else if (feeFriday.compareTo(BigDecimal.ZERO) == 0 && paymentFriday.compareTo(BigDecimal.ZERO) > 0 && (paymentFriday.compareTo(abonoDiario) > 0)) { + return "blueRow"; + } else if (feeSaturday.compareTo(BigDecimal.ZERO) == 0 && paymentSaturday.compareTo(BigDecimal.ZERO) > 0 && (paymentSaturday.compareTo(abonoDiario) > 0)) { + return "blueRow"; + } else { + return null; + } + } + + public String getConditionSabado() { + if (feeSaturday.compareTo(BigDecimal.ZERO) > 0) { + return "redRow"; + } else if (paymentSaturday.compareTo(BigDecimal.ZERO) == 0 && feeSaturday.compareTo(BigDecimal.ZERO) == 0) { + return "greenRow"; + } else if (feeSaturday.compareTo(BigDecimal.ZERO) == 0 && paymentSaturday.compareTo(BigDecimal.ZERO) > 0 && (paymentSaturday.compareTo(abonoDiario) < 0)) { + return "yellowRow"; + } else { + return null; + } + } + + public String getConditionNewCustomer() { + if (newCustomer.equalsIgnoreCase("Si")) { + return "greenRow"; + } else { + return null; + } + } + + public String getConditionRenovation() { + if (getFrozen().equals(ActiveStatus.ENEBLED)) { + return "blueLightRow"; + } + + if (newCustomer.equalsIgnoreCase("Si")) { + return "orangeRow"; + } else if (renovation.equalsIgnoreCase("Si")) { + return "greenLigthRow"; + } else if (getReactivation().equalsIgnoreCase("Si") && getWeekOfCreation().equalsIgnoreCase("Si")) { + return "limeGreenRow"; + } else if (getSaldoInsoluto().compareTo(BigDecimal.ZERO) == 0) { + return "greenStrongRow"; + } else { + return null; + } + + } + + public int getWeekLoanDate() { + Calendar c2 = Calendar.getInstance(); + c2.setTime(getFecha()); + int weekLoanDate = c2.get(Calendar.WEEK_OF_YEAR); + + return weekLoanDate; + } + + public int getWeekCurrentDate() { + Calendar c2 = Calendar.getInstance(); + int weekCurrentDate = c2.get(Calendar.WEEK_OF_YEAR); + + return weekCurrentDate; + } + + public BigDecimal getFeeSemana() { + + feeSemana = feeMonday.add(feeThursday).add(feeWednesday).add(feeTuesday).add(feeFriday).add(feeSaturday); + return feeSemana; + } + + public void setFeeSemana(BigDecimal feeSemana) { + this.feeSemana = feeSemana; + } + + public String getMovimientosMonday() { + return movimientosMonday; + } + + public void setMovimientosMonday(String movimientosMonday) { + this.movimientosMonday = movimientosMonday; + } + + public String getMovimientosTuesday() { + return movimientosTuesday; + } + + public void setMovimientosTuesday(String movimientosTuesday) { + this.movimientosTuesday = movimientosTuesday; + } + + public String getMovimientosWednesday() { + return movimientosWednesday; + } + + public void setMovimientosWednesday(String movimientosWednesday) { + this.movimientosWednesday = movimientosWednesday; + } + + public String getMovimientosThursday() { + return movimientosThursday; + } + + public void setMovimientosThursday(String movimientosThursday) { + this.movimientosThursday = movimientosThursday; + } + + public String getMovimientosFriday() { + return movimientosFriday; + } + + public void setMovimientosFriday(String movimientosFriday) { + this.movimientosFriday = movimientosFriday; + } + + public String getMovimientosSaturday() { + return movimientosSaturday; + } + + public void setMovimientosSaturday(String movimientosSaturday) { + this.movimientosSaturday = movimientosSaturday; + } + + public String getRenovationMonday() { + return renovationMonday; + } + + public void setRenovationMonday(String renovationMonday) { + this.renovationMonday = renovationMonday; + } + + public String getRenovationTuesday() { + return renovationTuesday; + } + + public void setRenovationTuesday(String renovationTuesday) { + this.renovationTuesday = renovationTuesday; + } + + public String getRenovationWednesday() { + return renovationWednesday; + } + + public void setRenovationWednesday(String renovationWednesday) { + this.renovationWednesday = renovationWednesday; + } + + public String getRenovationThursday() { + return renovationThursday; + } + + public void setRenovationThursday(String renovationThursday) { + this.renovationThursday = renovationThursday; + } + + public String getRenovationFriday() { + return renovationFriday; + } + + public void setRenovationFriday(String renovationFriday) { + this.renovationFriday = renovationFriday; + } + + public String getRenovationSaturday() { + return renovationSaturday; + } + + public void setRenovationSaturday(String renovationSaturday) { + this.renovationSaturday = renovationSaturday; + } + + public String getReactivation() { + + return reactivation; + } + + public void setReactivation(String reactivation) { + this.reactivation = reactivation; + } + + public String getWeekOfCreation() { + return weekOfCreation; + } + + public void setWeekOfCreation(String weekOfCreation) { + this.weekOfCreation = weekOfCreation; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/LoanApprovedDetailView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/LoanApprovedDetailView.java new file mode 100644 index 0000000..f9bba34 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/LoanApprovedDetailView.java @@ -0,0 +1,82 @@ +/* + * 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 org.hibernate.annotations.Immutable; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Immutable +@Table(name = "APC_LOAN_APPROVED_DETAIL_VIEW") +public class LoanApprovedDetailView implements Serializable { + + private static final long serialVersionUID = 2303382936160293905L; + + @Id + @Column(name = "id", length = 36) + private String id; + + @Column(name = "total_to_pay") + private BigDecimal totalToPay; + + @Column(name = "loan_amount_to_pay") + private BigDecimal loanAmountToPay; + + @Column(name = "total_fee") + private BigDecimal totalFee; + + public LoanApprovedDetailView() { + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public BigDecimal getTotalToPay() { + return totalToPay; + } + + public void setTotalToPay(BigDecimal totalToPay) { + this.totalToPay = totalToPay; + } + + public BigDecimal getLoanAmountToPay() { + return loanAmountToPay; + } + + public void setLoanAmountToPay(BigDecimal loanAmountToPay) { + this.loanAmountToPay = loanAmountToPay; + } + + public BigDecimal getTotalFee() { + return totalFee; + } + + public void setTotalFee(BigDecimal totalFee) { + this.totalFee = totalFee; + } + + @Override + public String toString() { + return "LoanApprovedDetailView{" + "totalToPay=" + totalToPay + ", loanAmountToPay=" + loanAmountToPay + ", totalFee=" + totalFee + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/LoanByUserOrderPreferenceView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/LoanByUserOrderPreferenceView.java new file mode 100644 index 0000000..c946334 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/LoanByUserOrderPreferenceView.java @@ -0,0 +1,108 @@ +/* + * 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 javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; +import org.hibernate.annotations.Immutable; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Immutable +@Table(name = "APC_LOAN_BY_USER_ORDER_PREFERENCE_VIEW") +public class LoanByUserOrderPreferenceView implements Serializable { + + private static final long serialVersionUID = -349196411929756764L; + + @Id + @Column(name = "id", length = 72) + private String id; + + @Column(name = "user_id", length = 36) + private String userId; + + @Column(name = "customer_name") + private String customerName; + + @Column(name = "customer_address_home", length = 150) + private String customerAddressHome; + + @Column(name = "customer_address_business", length = 150) + private String customerAddressBusiness; + + @Column(name = "order_in_list") + private Integer orderInList; + + public LoanByUserOrderPreferenceView() { + } + + public LoanByUserOrderPreferenceView(String customerName, Integer orderInList) { + this.customerName = customerName; + this.orderInList = orderInList; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getCustomerName() { + return customerName; + } + + public void setCustomerName(String customerName) { + this.customerName = customerName; + } + + public String getCustomerAddressHome() { + return customerAddressHome; + } + + public void setCustomerAddressHome(String customerAddressHome) { + this.customerAddressHome = customerAddressHome; + } + + public String getCustomerAddressBusiness() { + return customerAddressBusiness; + } + + public void setCustomerAddressBusiness(String customerAddressBusiness) { + this.customerAddressBusiness = customerAddressBusiness; + } + + public Integer getOrderInList() { + return orderInList; + } + + public void setOrderInList(Integer orderInList) { + this.orderInList = orderInList; + } + + @Override + public String toString() { + return "LoanByUserOrderPreferenceView{" + "customerName=" + customerName + ", orderInList=" + orderInList + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/LoanByUserPaymentZeroView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/LoanByUserPaymentZeroView.java new file mode 100644 index 0000000..6d84967 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/LoanByUserPaymentZeroView.java @@ -0,0 +1,90 @@ +/* + * 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 com.arrebol.apc.model.catalog.People; +import com.arrebol.apc.model.core.User; +import java.io.Serializable; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import org.hibernate.annotations.Immutable; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Entity +@Immutable +@Table(name = "APC_LOAN_BY_USER_PAYMENT_ZERO_VIEW") +public class LoanByUserPaymentZeroView implements Serializable{ + + private static final long serialVersionUID = -6446049391530159926L; + + @Id + @Column(name = "id", length = 36) + private String id; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_user", + referencedColumnName = "id", + nullable = false + ) + private User user; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_customer", + referencedColumnName = "id", + nullable = false + ) + private People customer; + + @Column(name = "loan_comments") + private String comments; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } + + public People getCustomer() { + return customer; + } + + public void setCustomer(People customer) { + this.customer = customer; + } + + public String getComments() { + return comments; + } + + public void setComments(String comments) { + this.comments = comments; + } + + + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/LoanByUserView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/LoanByUserView.java new file mode 100644 index 0000000..2210dfa --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/LoanByUserView.java @@ -0,0 +1,322 @@ +/* + * 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 + */ +@Entity +@Immutable +@Table(name = "APC_LOAN_BY_USER_VIEW") +public class LoanByUserView implements Serializable { + + private static final long serialVersionUID = -6868707427254694418L; + + @Id + @Column(name = "id", length = 72) + private String id; + + @Column(name = "user_id", length = 36) + private String userId; + + @Column(name = "customer_name") + private String customerName; + + @Column(name = "customer_address_home", length = 150) + private String customerAddressHome; + + @Column(name = "customer_address_business", length = 150) + private String customerAddressBusiness; + + @Column(name = "company_name", length = 150) + private String companyName; + + @Column(name = "customer_thumbnail", length = 250) + private String customerThumbnail; + + @Column(name = "endorsement_name") + private String endorsementName; + + @Column(name = "endorsement_address_home", length = 150) + private String endorsementAddressHome; + + @Column(name = "endorsement_thumbnail", length = 250) + private String endorsementThumbnail; + + @Column(name = "endorsement_phone_home", length = 15) + private String endorsementPhoneHome; + + @Column(name = "payment_daily") + private BigDecimal paymentDaily; + + @Column(name = "loan_fee") + private BigDecimal loanFee; + + @Column(name = "order_in_list") + private Integer orderInList; + + @Column(name = "notification_number") + private Integer notificationNumber; + + @Column(name = "renovation") + private String renovation; + + @Column(name = "max_amount_to_pay") + private BigDecimal maxAmountToPay; + + @Column(name = "customer_phone_home", length = 15) + private String customerPhoneHome; + + @Transient + private boolean hasPaymentToday; + + @Transient + private String loanId; + + @Transient + private String currentOwner; + + @Transient + private boolean result; + + public LoanByUserView() { + } + + /** + * + * @param customerName + * @param customerAddressHome + * @param customerAddressBusiness + * @param companyName + * @param customerThumbnail + * @param endorsementName + * @param endorsementAddressHome + * @param endorsementThumbnail + * @param endorsementPhoneHome + * @param paymentDaily + * @param loanFee + * @param notificationNumber + * @param renovation + * @param maxAmountToPay + * @param hasPaymentToday + * @param loanId + * @param currentOwner + */ + public LoanByUserView(String customerName, String customerAddressHome, String customerAddressBusiness, String companyName, String customerThumbnail, String endorsementName, String endorsementAddressHome, String endorsementThumbnail, String endorsementPhoneHome, BigDecimal paymentDaily, BigDecimal loanFee, Integer notificationNumber, String renovation, BigDecimal maxAmountToPay, boolean hasPaymentToday, String loanId, String currentOwner) { + this.customerName = customerName; + this.customerAddressHome = customerAddressHome; + this.customerAddressBusiness = customerAddressBusiness; + this.companyName = companyName; + this.customerThumbnail = customerThumbnail; + this.endorsementName = endorsementName; + this.endorsementAddressHome = endorsementAddressHome; + this.endorsementThumbnail = endorsementThumbnail; + this.endorsementPhoneHome = endorsementPhoneHome; + this.paymentDaily = paymentDaily; + this.loanFee = loanFee; + this.notificationNumber = notificationNumber; + this.renovation = renovation; + this.maxAmountToPay = maxAmountToPay; + this.hasPaymentToday = hasPaymentToday; + this.result = true; + this.loanId = loanId; + this.currentOwner = currentOwner; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getCustomerName() { + return customerName; + } + + public void setCustomerName(String customerName) { + this.customerName = customerName; + } + + public String getCustomerAddressHome() { + return customerAddressHome; + } + + public void setCustomerAddressHome(String customerAddressHome) { + this.customerAddressHome = customerAddressHome; + } + + public String getCustomerAddressBusiness() { + return customerAddressBusiness; + } + + public void setCustomerAddressBusiness(String customerAddressBusiness) { + this.customerAddressBusiness = customerAddressBusiness; + } + + public String getCompanyName() { + return companyName; + } + + public void setCompanyName(String companyName) { + this.companyName = companyName; + } + + public String getCustomerThumbnail() { + return customerThumbnail; + } + + public void setCustomerThumbnail(String customerThumbnail) { + this.customerThumbnail = customerThumbnail; + } + + public String getEndorsementName() { + return endorsementName; + } + + public void setEndorsementName(String endorsementName) { + this.endorsementName = endorsementName; + } + + public String getEndorsementAddressHome() { + return endorsementAddressHome; + } + + public void setEndorsementAddressHome(String endorsementAddressHome) { + this.endorsementAddressHome = endorsementAddressHome; + } + + public String getEndorsementThumbnail() { + return endorsementThumbnail; + } + + public void setEndorsementThumbnail(String endorsementThumbnail) { + this.endorsementThumbnail = endorsementThumbnail; + } + + public String getEndorsementPhoneHome() { + return endorsementPhoneHome; + } + + public void setEndorsementPhoneHome(String endorsementPhoneHome) { + this.endorsementPhoneHome = endorsementPhoneHome; + } + + public BigDecimal getPaymentDaily() { + return paymentDaily; + } + + public void setPaymentDaily(BigDecimal paymentDaily) { + this.paymentDaily = paymentDaily; + } + + public BigDecimal getLoanFee() { + return loanFee; + } + + public void setLoanFee(BigDecimal loanFee) { + this.loanFee = loanFee; + } + + public Integer getOrderInList() { + return orderInList; + } + + public void setOrderInList(Integer orderInList) { + this.orderInList = orderInList; + } + + public Integer getNotificationNumber() { + return notificationNumber; + } + + public void setNotificationNumber(Integer notificationNumber) { + this.notificationNumber = notificationNumber; + } + + public String getRenovation() { + return renovation; + } + + public void setRenovation(String renovation) { + this.renovation = renovation; + } + + public BigDecimal getMaxAmountToPay() { + return maxAmountToPay; + } + + public void setMaxAmountToPay(BigDecimal maxAmountToPay) { + this.maxAmountToPay = maxAmountToPay; + } + + public boolean isHasPaymentToday() { + return hasPaymentToday; + } + + public void setHasPaymentToday(boolean hasPaymentToday) { + this.hasPaymentToday = hasPaymentToday; + } + + public String getLoanId() { + return loanId; + } + + public void setLoanId(String loanId) { + this.loanId = loanId; + } + + public String getCurrentOwner() { + return currentOwner; + } + + public void setCurrentOwner(String currentOwner) { + this.currentOwner = currentOwner; + } + + public boolean isResult() { + return result; + } + + public void setResult(boolean result) { + this.result = result; + } + + public String getCustomerPhoneHome() { + return customerPhoneHome; + } + + public void setCustomerPhoneHome(String customerPhoneHome) { + this.customerPhoneHome = customerPhoneHome; + } + + @Override + public String toString() { + return "LoanByUserView{" + "customerName=" + customerName + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/LoanDetailZeroView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/LoanDetailZeroView.java new file mode 100644 index 0000000..eb6a93f --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/LoanDetailZeroView.java @@ -0,0 +1,127 @@ +/* + * 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.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author David RodrĆ­guez Huaracha + */ +@Entity +@Table(name = "APC_LOAN_DETAIL_ZERO_VIEW") +public class LoanDetailZeroView implements Serializable { + + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @Column(name = "customer_name", length = 300) + private String customerName; + + @Column(name = "address_home", length = 300) + private String addressHome; + + @Column(name = "user_name", length = 300) + private String userName; + + @Column(name = "amount_to_pay", nullable = true) + private BigDecimal amountToPay; + + @Column(name = "id_loan_type", length = 36) + private String loanType; + + @Column(name = "payment", nullable = true) + private BigDecimal payment; + + @Column(name = "loan_comments", length = 200) + private String loanComments; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getLoanType() { + return loanType; + } + + public void setLoanType(String loanType) { + this.loanType = loanType; + } + + public BigDecimal getPayment() { + return payment; + } + + public void setPayment(BigDecimal payment) { + this.payment = payment; + } + + public BigDecimal getAmountToPay() { + return amountToPay; + } + + public void setAmountToPay(BigDecimal amountToPay) { + this.amountToPay = amountToPay; + } + + public String getCustomerName() { + return customerName; + } + + public void setCustomerName(String customerName) { + this.customerName = customerName; + } + + public String getAddressHome() { + return addressHome; + } + + public void setAddressHome(String addressHome) { + this.addressHome = addressHome; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getLoanComments() { + return loanComments; + } + + public void setLoanComments(String loanComments) { + this.loanComments = loanComments; + } + + + + @Override + public String toString() { + return ""; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/LoanDiferencesByUserLastWeekView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/LoanDiferencesByUserLastWeekView.java new file mode 100644 index 0000000..bf37a9a --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/LoanDiferencesByUserLastWeekView.java @@ -0,0 +1,63 @@ +/* + * 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 org.hibernate.annotations.Immutable; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Entity +@Immutable +@Table(name = "APC_LOAN_DIFERENCES_BY_USER_LAST_WEEK_VIEW") +public class LoanDiferencesByUserLastWeekView implements Serializable { + + private static final long serialVersionUID = -8442702932177478721L; + + @Id + @Column(name = "id", length = 36) + private String id; + + @Column(name = "id_user") + private String idUser; + + @Column(name = "faltante") + private BigDecimal faltante; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getIdUser() { + return idUser; + } + + public void setIdUser(String idUser) { + this.idUser = idUser; + } + + public BigDecimal getFaltante() { + return faltante; + } + + public void setFaltante(BigDecimal faltante) { + this.faltante = faltante; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/LoanEmployeeAllDataView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/LoanEmployeeAllDataView.java new file mode 100644 index 0000000..639ba15 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/LoanEmployeeAllDataView.java @@ -0,0 +1,143 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.model.views; + +import com.arrebol.apc.model.enums.ActiveStatus; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author Administrador + */ +@Entity +@Table(name = "APC_LOAN_EMPLOYEE_ALL_DATA_VIEW") +public class LoanEmployeeAllDataView implements Serializable { + + private static final long serialVersionUID = 1L; + + public LoanEmployeeAllDataView() { + } + + public LoanEmployeeAllDataView(String id, String name, String idUser, BigDecimal amountLoan, BigDecimal amountToPay, BigDecimal balance, Date createdOn) { + this.id = id; + this.name = name; + this.amountLoan = amountLoan; + this.amountToPay = amountToPay; + this.balance = balance; + this.createdOn = createdOn; + this.idUser = idUser; + } + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @Column(name = "name") + private String name; + + @Column(name = "id_user", length = 36) + private String idUser; + + @Column(name = "amount_loan", nullable = false) + private BigDecimal amountLoan; + + @Column(name = "amount_to_pay", nullable = false) + private BigDecimal amountToPay; + + @Column(name = "balance", nullable = false) + private BigDecimal balance; + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "created_on", length = 19) + private Date createdOn; + + @Enumerated(EnumType.STRING) + @Column(name = "loan_employee_status", nullable = false) + private ActiveStatus loanEmployeeStatus; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getIdUser() { + return idUser; + } + + public void setIdIser(String idUser) { + this.idUser = idUser; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public BigDecimal getAmountLoan() { + return amountLoan; + } + + public void setAmountLoan(BigDecimal amountLoan) { + this.amountLoan = amountLoan; + } + + public BigDecimal getAmountToPay() { + return amountToPay; + } + + public void setAmountToPay(BigDecimal amountToPay) { + this.amountToPay = amountToPay; + } + + public BigDecimal getBalance() { + return balance; + } + + public void setBalance(BigDecimal balance) { + this.balance = balance; + } + + public Date getCreatedOn() { + return createdOn; + } + + public void setCreatedOn(Date createdOn) { + this.createdOn = createdOn; + } + + public ActiveStatus getLoanEmployeeStatus() { + return loanEmployeeStatus; + } + + public void setLoanEmployeeStatus(ActiveStatus loanEmployeeStatus) { + this.loanEmployeeStatus = loanEmployeeStatus; + } + + @Override + public String toString() { + return "LoanEmployeeView{" + "id=" + id + ", name=" + name + "idUser=" + idUser + ", amountLoan=" + amountLoan + ", amountToPay=" + amountToPay + ", balance=" + balance + ", createdOn=" + createdOn + ", loanEmployeeStatus=" + loanEmployeeStatus + '}'; + } +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/LoanEmployeeDetailAllDataView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/LoanEmployeeDetailAllDataView.java new file mode 100644 index 0000000..3ec0bc6 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/LoanEmployeeDetailAllDataView.java @@ -0,0 +1,114 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.model.views; + +import com.arrebol.apc.model.enums.ActiveStatus; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author Administrador + */ +@Entity +@Table(name = "APC_LOAN_EMPLOYEE_DETAIL_ALL_DATA_VIEW") +public class LoanEmployeeDetailAllDataView implements Serializable { + + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @Column(name = "id_loan", length = 36) + private String idLoan; + + @Column(name = "id_user", length = 36) + private String idUser; + + @Column(name = "payment_amount", nullable = false) + private BigDecimal paymentAmount; + + @Column(name = "reference_number", nullable = false) + private int referenceNumber; + + @Enumerated(EnumType.STRING) + @Column(name = "loan_employee_detail_status", nullable = false) + private ActiveStatus loanEmployeeDetailStatus; + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "created_on", length = 19) + private Date createdOn; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getIdLoan() { + return idLoan; + } + + public void setIdLoan(String idLoan) { + this.idLoan = idLoan; + } + + public String getIdUser() { + return idUser; + } + + public void setIdUser(String idUser) { + this.idUser = idUser; + } + + public BigDecimal getPaymentAmount() { + return paymentAmount; + } + + public void setPaymentAmount(BigDecimal paymentAmount) { + this.paymentAmount = paymentAmount; + } + + public int getReferenceNumber() { + return referenceNumber; + } + + public void setReferenceNumber(int referenceNumber) { + this.referenceNumber = referenceNumber; + } + + public ActiveStatus getLoanEmployeeDetailStatus() { + return loanEmployeeDetailStatus; + } + + public void setLoanEmployeeDetailStatus(ActiveStatus loanEmployeeDetailStatus) { + this.loanEmployeeDetailStatus = loanEmployeeDetailStatus; + } + + public Date getCreatedOn() { + return createdOn; + } + + public void setCreatedOn(Date createdOn) { + this.createdOn = createdOn; + } +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/LoanEmployeeView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/LoanEmployeeView.java new file mode 100644 index 0000000..52051e6 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/LoanEmployeeView.java @@ -0,0 +1,217 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.model.views; + +import com.arrebol.apc.model.admin.ExpenseCompany; +import com.arrebol.apc.model.enums.ActiveStatus; +import java.io.Serializable; +import java.math.BigDecimal; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author Administrador + */ +@Entity +@Table(name = "APC_LOAN_EMPLOYEE_VIEW") +public class LoanEmployeeView implements Serializable { + + private static final long serialVersionUID = 1L; + + public LoanEmployeeView() { + } + + public LoanEmployeeView(String id, String name, String createdByName, String idUser, BigDecimal amountLoan, BigDecimal amountToPay, BigDecimal balance, BigDecimal totalAmountToPay, Date createdOn, int referenceNumber) { + this.id = id; + this.name = name; + this.amountLoan = amountLoan; + this.amountToPay = amountToPay; + this.balance = balance; + this.totalAmountToPay = totalAmountToPay; + this.createdOn = createdOn; + this.idUser = idUser; + this.referenceNumber = referenceNumber; + this.createdByName = createdByName; + } + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @Column(name = "name") + private String name; + + @Column(name = "created_by_name") + private String createdByName; + + @Column(name = "id_user", length = 36) + private String idUser; + + @Column(name = "amount_loan", nullable = false) + private BigDecimal amountLoan; + + @Column(name = "amount_to_pay", nullable = false) + private BigDecimal amountToPay; + + @Column(name = "balance", nullable = false) + private BigDecimal balance; + + @Column(name = "total_amount_to_pay", nullable = false) + private BigDecimal totalAmountToPay; + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "created_on", length = 19) + private Date createdOn; + + @Column(name = "reference_number") + private int referenceNumber; + + @Enumerated(EnumType.STRING) + @Column(name = "loan_employee_status", nullable = false) + private ActiveStatus loanEmployeeStatus; + + public ActiveStatus getLoanEmployeeStatus() { + return loanEmployeeStatus; + } + + public void setLoanEmployeeStatus(ActiveStatus loanEmployeeStatus) { + this.loanEmployeeStatus = loanEmployeeStatus; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getIdUser() { + return idUser; + } + + public void setIdIser(String idUser) { + this.idUser = idUser; + } + + public String getCreatedByName() { + return createdByName; + } + + public void setCreatedByName(String createdByName) { + this.createdByName = createdByName; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public BigDecimal getAmountLoan() { + return amountLoan; + } + + public void setAmountLoan(BigDecimal amountLoan) { + this.amountLoan = amountLoan; + } + + public BigDecimal getAmountToPay() { + return amountToPay; + } + + public void setAmountToPay(BigDecimal amountToPay) { + this.amountToPay = amountToPay; + } + + public BigDecimal getBalance() { + return balance; + } + + public void setBalance(BigDecimal balance) { + this.balance = balance; + } + + public BigDecimal getTotalAmountToPay() { + return totalAmountToPay; + } + + public void setTotalAmountToPay(BigDecimal totalAmountToPay) { + this.totalAmountToPay = totalAmountToPay; + } + + public Date getCreatedOn() { + return createdOn; + } + + public void setCreatedOn(Date createdOn) { + this.createdOn = createdOn; + } + + public int getReferenceNumber() { + return referenceNumber; + } + + public void setReferenceNumber(int referenceNumber) { + this.referenceNumber = referenceNumber; + } + + public String conditionEnabled() { + if (getLoanEmployeeStatus() == ActiveStatus.DISABLED) { + return "grayRow"; + } else { + return null; + } + } + + public boolean getActive() { + if (loanEmployeeStatus == ActiveStatus.ENEBLED) { + return true; + } else { + return false; + } + } + + public boolean getAction(Date lastStableGeneralBox) { + Date date = createdOn; + boolean action = true; + try { + SimpleDateFormat dt1 = new SimpleDateFormat("yyyy-MM-dd"); + + String dateStr = dt1.format(date); + date = dt1.parse(dateStr); + + action = date.after(lastStableGeneralBox); + + } catch (ParseException ex) { + Logger.getLogger(ExpenseCompany.class.getName()).log(Level.SEVERE, null, ex); + } + return action; + } + + @Override + public String toString() { + return "LoanEmployeeView{" + "id=" + id + ", name=" + name + "idUser=" + idUser + ", amountLoan=" + amountLoan + ", amountToPay=" + amountToPay + ", balance=" + balance + ", createdOn=" + createdOn + ", referenceNumber=" + referenceNumber + '}'; + } +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/LoanFinishedView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/LoanFinishedView.java new file mode 100644 index 0000000..409fc92 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/LoanFinishedView.java @@ -0,0 +1,168 @@ +/* + * 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 com.arrebol.apc.model.enums.CustomerClassification; +import java.io.Serializable; +import java.math.BigDecimal; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author David RodrĆ­guez Huaracha + */ +@Entity +@Table(name = "APC_LOAN_FINISHED_VIEW") +public class LoanFinishedView implements Serializable { + + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @Column(name = "customer_id", length = 36) + private String customerId; + + @Column(name = "customer_name", length = 300) + private String customerName; + + @Column(name = "address_home", length = 300) + private String addressHome; + + @Column(name = "classification", length = 10) + private String classification; + + @Column(name = "user_name", length = 300) + private String userName; + + @Column(name = "amount_to_pay", nullable = true) + private BigDecimal amountToPay; + + @Column(name = "loan_status", length = 10) + private String loan_status; + + @Column(name = "id_loan_type", length = 36) + private String loanType; + + @Column(name = "payment", nullable = true) + private BigDecimal payment; + + @Column(name = "comments", length = 200) + private String loanComments; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getLoanType() { + return loanType; + } + + public void setLoanType(String loanType) { + this.loanType = loanType; + } + + public BigDecimal getPayment() { + return payment; + } + + public void setPayment(BigDecimal payment) { + this.payment = payment; + } + + public BigDecimal getAmountToPay() { + return amountToPay; + } + + public void setAmountToPay(BigDecimal amountToPay) { + this.amountToPay = amountToPay; + } + + public String getCustomerName() { + return customerName; + } + + public void setCustomerName(String customerName) { + this.customerName = customerName; + } + + public String getAddressHome() { + return addressHome; + } + + public void setAddressHome(String addressHome) { + this.addressHome = addressHome; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getLoanComments() { + return loanComments; + } + + public void setLoanComments(String loanComments) { + this.loanComments = loanComments; + } + + public String getCustomerId() { + return customerId; + } + + public void setCustomerId(String customerId) { + this.customerId = customerId; + } + + public String getClassification() { + return classification; + } + + public void setClassification(String classification) { + this.classification = classification; + } + + public String getLoan_status() { + return loan_status; + } + + public void setLoan_status(String loan_status) { + this.loan_status = loan_status; + } + + @Override + public String toString() { + return ""; + } + + public String conditionStyle() + { + if(getClassification().equals(CustomerClassification.RED.getValue())) + return "redRow"; + else if(getClassification().equals(CustomerClassification.YELLOW.getValue())) + return "yellowRow"; + return null; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/LoanInPendingStatusToDeliveryView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/LoanInPendingStatusToDeliveryView.java new file mode 100644 index 0000000..183096b --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/LoanInPendingStatusToDeliveryView.java @@ -0,0 +1,162 @@ +/* + * 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.util.Date; +import java.util.Objects; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import org.hibernate.annotations.Immutable; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Immutable +@Table(name = "APC_LOAN_IN_PENDING_STATUS_TO_DELIVERY_VIEW") +public class LoanInPendingStatusToDeliveryView implements Serializable { + + private static final long serialVersionUID = 6435962914845336418L; + + @Id + @Column(name = "id_loan", length = 36) + private String idLoan; + + @Column(name = "payment") + private Double payment; + + @Column(name = "str_created_on", length = 22) + private String strCreatedOn; + + @Column(name = "customer_name", length = 103) + private String customerName; + + @Column(name = "endorsement_name", length = 103) + private String endorsementName; + + @Column(name = "user_name", length = 103) + private String userName; + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "created_on", length = 19) + private Date createdOn; + + /** + * + */ + public LoanInPendingStatusToDeliveryView() { + } + + /** + * + * @param idLoan + * @param payment + * @param strCreatedOn + * @param customerName + * @param endorsementName + * @param userName + * @param createdOn + */ + public LoanInPendingStatusToDeliveryView(String idLoan, Double payment, String strCreatedOn, String customerName, String endorsementName, String userName, Date createdOn) { + this.idLoan = idLoan; + this.payment = payment; + this.strCreatedOn = strCreatedOn; + this.customerName = customerName; + this.endorsementName = endorsementName; + this.userName = userName; + this.createdOn = createdOn; + } + + public String getIdLoan() { + return idLoan; + } + + public void setIdLoan(String idLoan) { + this.idLoan = idLoan; + } + + public Double getPayment() { + return payment; + } + + public void setPayment(Double payment) { + this.payment = payment; + } + + public String getStrCreatedOn() { + return strCreatedOn; + } + + public void setStrCreatedOn(String strCreatedOn) { + this.strCreatedOn = strCreatedOn; + } + + public String getCustomerName() { + return customerName; + } + + public void setCustomerName(String customerName) { + this.customerName = customerName; + } + + public String getEndorsementName() { + return endorsementName; + } + + public void setEndorsementName(String endorsementName) { + this.endorsementName = endorsementName; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public Date getCreatedOn() { + return createdOn; + } + + public void setCreatedOn(Date createdOn) { + this.createdOn = createdOn; + } + + @Override + public int hashCode() { + int hash = 5; + hash = 41 * hash + Objects.hashCode(this.idLoan); + return hash; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final LoanInPendingStatusToDeliveryView other = (LoanInPendingStatusToDeliveryView) obj; + if (!Objects.equals(this.idLoan, other.idLoan)) { + return false; + } + return true; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/LoanRenovationDeliveryWeeklyView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/LoanRenovationDeliveryWeeklyView.java new file mode 100644 index 0000000..7798b39 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/LoanRenovationDeliveryWeeklyView.java @@ -0,0 +1,221 @@ +/* + * 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 com.arrebol.apc.model.core.Office; +import java.io.Serializable; +import java.util.Date; +import java.util.Objects; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import org.hibernate.annotations.Immutable; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Entity +@Immutable +@Table(name = "APC_LOAN_RENOVATION_DELIVERY_WEEKLY_VIEW") +public class LoanRenovationDeliveryWeeklyView implements Serializable { + + private static final long serialVersionUID = 3731003393000465083L; + + @Id + @Column(name = "id", length = 36) + private String id; + + @Column(name = "id_user", length = 36) + private String id_user; + + @Column(name = "user_name") + private String userName; + + @Column(name = "customer_name") + private String customerName; + + @Column(name = "loan_status") + private String loasStatus; + + @Column(name = "amount_loan") + private String amountLoan; + + @Column(name = "amount_to_pay") + private String amountToPay; + + @Column(name = "amount_paid") + private String amountPaid; + + @Column(name = "saldo_insoluto") + private String saldoInsoluto; + + @Column(name = "route_name") + private String routeName; + + @Column(name = "payment_daily") + private String paymentDaily; + + @Column(name = "num_pagos_all") + private String numPagosAll; + + @Column(name = "num_fee") + private String numFee; + + @Column(name = "renovation") + private String renovation; + + + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getId_user() { + return id_user; + } + + public void setId_user(String id_user) { + this.id_user = id_user; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getCustomerName() { + return customerName; + } + + public void setCustomerName(String customerName) { + this.customerName = customerName; + } + + public String getLoasStatus() { + return loasStatus; + } + + public void setLoasStatus(String loasStatus) { + this.loasStatus = loasStatus; + } + + public String getAmountToPay() { + return amountToPay; + } + + public void setAmountToPay(String amountToPay) { + this.amountToPay = amountToPay; + } + + public String getAmountPaid() { + return amountPaid; + } + + public void setAmountPaid(String amountPaid) { + this.amountPaid = amountPaid; + } + + public String getSaldoInsoluto() { + return saldoInsoluto; + } + + public void setSaldoInsoluto(String saldoInsoluto) { + this.saldoInsoluto = saldoInsoluto; + } + + public String getRouteName() { + return routeName; + } + + public void setRouteName(String routeName) { + this.routeName = routeName; + } + + public String getPaymentDaily() { + return paymentDaily; + } + + public void setPaymentDaily(String paymentDaily) { + this.paymentDaily = paymentDaily; + } + + public String getNumPagosAll() { + return numPagosAll; + } + + public void setNumPagosAll(String numPagosAll) { + this.numPagosAll = numPagosAll; + } + + public String getNumFee() { + return numFee; + } + + public void setNumFee(String numFee) { + this.numFee = numFee; + } + + public String getAmountLoan() { + return amountLoan; + } + + public void setAmountLoan(String amountLoan) { + this.amountLoan = amountLoan; + } + + public String getRenovation() { + return renovation; + } + + public void setRenovation(String renovation) { + this.renovation = renovation; + } + + + + + + @Override + public int hashCode() { + int hash = 7; + hash = 61 * hash + Objects.hashCode(this.id); + return hash; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final LoanRenovationDeliveryWeeklyView other = (LoanRenovationDeliveryWeeklyView) obj; + if (!Objects.equals(this.id, other.id)) { + return false; + } + return true; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/LoanToDeliveryByCertifierView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/LoanToDeliveryByCertifierView.java new file mode 100644 index 0000000..33ec5ac --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/LoanToDeliveryByCertifierView.java @@ -0,0 +1,197 @@ +/* + * 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.Objects; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; +import org.hibernate.annotations.Immutable; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Immutable +@Table(name = "APC_LOAN_TO_DELIVERY_BY_CERTIFIER_VIEW") +public class LoanToDeliveryByCertifierView implements Serializable { + + private static final long serialVersionUID = 8450662914845336486L; + + @Id + @Column(name = "id_loan", length = 36) + private String id; + + @Id + @Column(name = "id_old_loan", length = 36) + private String idOldLoan; + + @Column(name = "id_user", length = 36) + private String userId; + + @Column(name = "customer_name", length = 51) + private String customerName; + + @Column(name = "customer_address", length = 150) + private String customerAddress; + + @Column(name = "thumbnail", length = 250) + private String thumbnail; + + @Column(name = "icon", length = 5) + private String icon; + + @Column(name = "amount_to_delivery") + private BigDecimal amountToDelivery; + + @Column(name = "discount") + private BigDecimal discount; + + @Column(name = "opening") + private Integer opening; + + @Column(name = "payment") + private BigDecimal payment; + + @Column(name = "total_last_loan") + private BigDecimal totalLastLoan; + + public LoanToDeliveryByCertifierView() { + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getIdOldLoan() { + return idOldLoan; + } + + public void setIdOldLoan(String idOldLoan) { + this.idOldLoan = idOldLoan; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getCustomerName() { + return customerName; + } + + public void setCustomerName(String customerName) { + this.customerName = customerName; + } + + public String getCustomerAddress() { + return customerAddress; + } + + public void setCustomerAddress(String customerAddress) { + this.customerAddress = customerAddress; + } + + public String getThumbnail() { + return thumbnail; + } + + public void setThumbnail(String thumbnail) { + this.thumbnail = thumbnail; + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public BigDecimal getAmountToDelivery() { + return amountToDelivery; + } + + public void setAmountToDelivery(BigDecimal amountToDelivery) { + this.amountToDelivery = amountToDelivery; + } + + public BigDecimal getDiscount() { + return discount; + } + + public void setDiscount(BigDecimal discount) { + this.discount = discount; + } + + public Integer getOpening() { + return opening; + } + + public void setOpening(Integer opening) { + this.opening = opening; + } + + public BigDecimal getPayment() { + return payment; + } + + public void setPayment(BigDecimal payment) { + this.payment = payment; + } + + public BigDecimal getTotalLastLoan() { + return totalLastLoan; + } + + public void setTotalLastLoan(BigDecimal totalLastLoan) { + this.totalLastLoan = totalLastLoan; + } + + @Override + public int hashCode() { + int hash = 7; + hash = 59 * hash + Objects.hashCode(this.id); + return hash; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final LoanToDeliveryByCertifierView other = (LoanToDeliveryByCertifierView) obj; + if (!Objects.equals(this.id, other.id)) { + return false; + } + return true; + } + + @Override + public String toString() { + return "LoanToDeliveryByCertifierView{" + "customerName=" + customerName + ", icon=" + icon + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/MoneyDailyByUserCertifier.java b/ace-model/src/main/java/com/arrebol/apc/model/views/MoneyDailyByUserCertifier.java new file mode 100644 index 0000000..bb2fc97 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/MoneyDailyByUserCertifier.java @@ -0,0 +1,88 @@ +/* + * 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 org.hibernate.annotations.Immutable; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Entity +@Immutable +@Table(name = "APC_MONEY_DAILY_BY_USER_CERTIFIER_VIEW") +public class MoneyDailyByUserCertifier implements Serializable{ + + private static final long serialVersionUID = -6757597615364853923L; + + @Id + @Column(name = "id", length = 36) + private String id; + + @Column(name = "id_office") + private String idOffice; + + @Column(name = "user_name") + private String userName; + + @Column(name = "employee") + private String employee; + + @Column(name = "amount") + private BigDecimal amount; + + public MoneyDailyByUserCertifier() { + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getIdOffice() { + return idOffice; + } + + public void setIdOffice(String idOffice) { + this.idOffice = idOffice; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getEmployee() { + return employee; + } + + public void setEmployee(String employee) { + this.employee = employee; + } + + public BigDecimal getAmount() { + return amount; + } + + public void setAmount(BigDecimal amount) { + this.amount = amount; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/PaymentDetailFromUserByCurdateView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/PaymentDetailFromUserByCurdateView.java new file mode 100644 index 0000000..19a7312 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/PaymentDetailFromUserByCurdateView.java @@ -0,0 +1,97 @@ +/* + * 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 com.arrebol.apc.model.enums.LoanDetailsType; +import java.io.Serializable; +import java.math.BigDecimal; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.Id; +import javax.persistence.Table; +import org.hibernate.annotations.Immutable; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Immutable +@Table(name = "APC_PAYMENT_DETAILS_FROM_USER_BY_CURDATE_VIEW") +public class PaymentDetailFromUserByCurdateView implements Serializable { + + private static final long serialVersionUID = 7069230798097192215L; + + @Id + @Column(name = "id_loan_detail", length = 36) + private String id; + + @Column(name = "customer_name", length = 103) + private String customerName; + + @Column(name = "payment_amount") + private BigDecimal amount; + + @Enumerated(EnumType.STRING) + @Column(name = "loan_details_type") + private LoanDetailsType loanDetailsType; + + @Column(name = "user_id", length = 36) + private String userId; + + public PaymentDetailFromUserByCurdateView() { + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getCustomerName() { + return customerName; + } + + public void setCustomerName(String customerName) { + this.customerName = customerName; + } + + public BigDecimal getAmount() { + return amount; + } + + public void setAmount(BigDecimal amount) { + this.amount = amount; + } + + public LoanDetailsType getLoanDetailsType() { + return loanDetailsType; + } + + public void setLoanDetailsType(LoanDetailsType loanDetailsType) { + this.loanDetailsType = loanDetailsType; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + @Override + public String toString() { + return "PaymentDetailFromUserByCurdateView{" + "customerName=" + customerName + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/PersonSearchDetailView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/PersonSearchDetailView.java new file mode 100644 index 0000000..1a5acf2 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/PersonSearchDetailView.java @@ -0,0 +1,81 @@ +/* + * 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 javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; +import org.hibernate.annotations.Immutable; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Immutable +@Table(name = "APC_PERSON_SEARCH_DETAIL_VIEW") +public class PersonSearchDetailView implements Serializable { + + private static final long serialVersionUID = 4608137238616026580L; + + @Id + @Column(name = "id", length = 36) + private String id; + + @Column(name = "person_search", length = 103) + private String personSearch; + + @Column(name = "thumbnail", length = 250) + private String thumbnail; + + @Column(name = "loanStatus", length = 8) + private String loanStatus; + + public PersonSearchDetailView() { + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getPersonSearch() { + return personSearch; + } + + public void setPersonSearch(String personSearch) { + this.personSearch = personSearch; + } + + public String getThumbnail() { + return thumbnail; + } + + public void setThumbnail(String thumbnail) { + this.thumbnail = thumbnail; + } + + public String getLoanStatus() { + return loanStatus; + } + + public void setLoanStatus(String loanStatus) { + this.loanStatus = loanStatus; + } + + @Override + public String toString() { + return "PersonSearchDetailView{" + "personSearch=" + personSearch + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/PersonSearchHistoricalDetailsView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/PersonSearchHistoricalDetailsView.java new file mode 100644 index 0000000..4f7165a --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/PersonSearchHistoricalDetailsView.java @@ -0,0 +1,147 @@ +/* + * 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 javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; +import org.hibernate.annotations.Immutable; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Immutable +@Table(name = "APC_PERSON_SEARCH_HISTORICAL_DETAILS_VIEW") +public class PersonSearchHistoricalDetailsView implements Serializable { + + private static final long serialVersionUID = 6263674846643349142L; + + @Id + @Column(name = "id", length = 36) + private String id; + + @Column(name = "id_person_search", length = 36) + private String personSearchId; + + @Column(name = "format_date", length = 10) + private String createdOn; + + @Column(name = "person_type", length = 7) + private String personType; + + @Column(name = "relationship", length = 51) + private String relationShip; + + @Column(name = "loan") + private Double loan; + + @Column(name = "payment_number", length = 8) + private String paymentNumber; + + @Column(name = "amount_to_pay") + private Double amountToPay; + + @Column(name = "total_fees", length = 2) + private String totalFees; + + @Column(name = "loan_status", length = 25) + private String status; + + public PersonSearchHistoricalDetailsView() { + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getPersonSearchId() { + return personSearchId; + } + + public void setPersonSearchId(String personSearchId) { + this.personSearchId = personSearchId; + } + + public String getCreatedOn() { + return createdOn; + } + + public void setCreatedOn(String createdOn) { + this.createdOn = createdOn; + } + + public String getPersonType() { + return personType; + } + + public void setPersonType(String personType) { + this.personType = personType; + } + + public String getRelationShip() { + return relationShip; + } + + public void setRelationShip(String relationShip) { + this.relationShip = relationShip; + } + + public Double getLoan() { + return loan; + } + + public void setLoan(Double loan) { + this.loan = loan; + } + + public String getPaymentNumber() { + return paymentNumber; + } + + public void setPaymentNumber(String paymentNumber) { + this.paymentNumber = paymentNumber; + } + + public Double getAmountToPay() { + return amountToPay; + } + + public void setAmountToPay(Double amountToPay) { + this.amountToPay = amountToPay; + } + + public String getTotalFees() { + return totalFees; + } + + public void setTotalFees(String totalFees) { + this.totalFees = totalFees; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + @Override + public String toString() { + return "PersonSearchHistoricalDetailsView{" + "createdOn=" + createdOn + ", personType=" + personType + ", status=" + status + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/PersonSearchView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/PersonSearchView.java new file mode 100644 index 0000000..6c56924 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/PersonSearchView.java @@ -0,0 +1,64 @@ +/* + * 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 javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; +import org.hibernate.annotations.Immutable; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Immutable +@Table(name = "APC_PERSON_SEARCH_VIEW") +public class PersonSearchView implements Serializable { + + private static final long serialVersionUID = 8659713229201178299L; + + @Id + @Column(name = "id", length = 36) + private String id; + + @Column(name = "person_search", length = 103) + private String personSearch; + + public PersonSearchView() { + } + + public PersonSearchView(String id, String personSearch) { + this.id = id; + this.personSearch = personSearch; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getPersonSearch() { + return personSearch; + } + + public void setPersonSearch(String personSearch) { + this.personSearch = personSearch; + } + + @Override + public String toString() { + return "PersonSearchView{" + "personSearch=" + personSearch + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/ResumeNewCustomerLastWeekView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/ResumeNewCustomerLastWeekView.java new file mode 100644 index 0000000..ad593d6 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/ResumeNewCustomerLastWeekView.java @@ -0,0 +1,73 @@ +/* + * 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 org.hibernate.annotations.Immutable; + +/** + * + * @author David RodrĆ­guez Huaracha + */ +@Entity +@Immutable +@Table(name = "APC_LOAN_NEW_CUSTOMER_LAST_WEEK_VIEW") +public class ResumeNewCustomerLastWeekView implements Serializable{ + + private static final long serialVersionUID = -6384789811291615117L; + + @Id + @Column(name = "id", length = 36) + private String id; + + @Column(name = "name") + private String name; + + @Column(name = "new_customer") + private int newCustomer; + + @Column(name = "total_new_customer") + private BigDecimal totalNewCustomer; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public int getNewCustomer() { + return newCustomer; + } + + public void setNewCustomer(int newCustomer) { + this.newCustomer = newCustomer; + } + + public BigDecimal getTotalNewCustomer() { + return totalNewCustomer; + } + + public void setTotalNewCustomer(BigDecimal totalNewCustomer) { + this.totalNewCustomer = totalNewCustomer; + } +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/ResumeNewCustomerWeekView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/ResumeNewCustomerWeekView.java new file mode 100644 index 0000000..a96cd3d --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/ResumeNewCustomerWeekView.java @@ -0,0 +1,73 @@ +/* + * 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 org.hibernate.annotations.Immutable; + +/** + * + * @author David RodrĆ­guez Huaracha + */ +@Entity +@Immutable +@Table(name = "APC_LOAN_NEW_CUSTOMER_WEEK_VIEW") +public class ResumeNewCustomerWeekView implements Serializable{ + + private static final long serialVersionUID = -6384789811291615117L; + + @Id + @Column(name = "id", length = 36) + private String id; + + @Column(name = "name") + private String name; + + @Column(name = "new_customer") + private int newCustomer; + + @Column(name = "total_new_customer") + private BigDecimal totalNewCustomer; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public int getNewCustomer() { + return newCustomer; + } + + public void setNewCustomer(int newCustomer) { + this.newCustomer = newCustomer; + } + + public BigDecimal getTotalNewCustomer() { + return totalNewCustomer; + } + + public void setTotalNewCustomer(BigDecimal totalNewCustomer) { + this.totalNewCustomer = totalNewCustomer; + } +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/ResumenInOutLastWeekByUserView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/ResumenInOutLastWeekByUserView.java new file mode 100644 index 0000000..0a728b8 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/ResumenInOutLastWeekByUserView.java @@ -0,0 +1,285 @@ +/* + * 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 com.arrebol.apc.model.core.Office; +import java.io.Serializable; +import java.math.BigDecimal; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import org.hibernate.annotations.Immutable; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Entity +@Immutable +@Table(name = "APC_RESUMEN_IN_OUT_LAST_WEEK_BY_USER_VIEW") +public class ResumenInOutLastWeekByUserView implements Serializable{ + + private static final long serialVersionUID = 3055231364366461069L; + + @Id + @Column(name = "id", length = 36) + private String id; + + @Column(name = "username") + private String userName; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_office", + referencedColumnName = "id", + nullable = false + ) + private Office office; + + @Column(name = "closing_monday") + private BigDecimal closingMonday; + + @Column(name = "expense_monday") + private BigDecimal expenseMonday; + + @Column(name = "money_daily_today_monday") + private BigDecimal moneyDailyTodayMonday; + + @Column(name = "closing_tuesday") + private BigDecimal closingTuesday; + + @Column(name = "expense_tuesday") + private BigDecimal expenseTuesday; + + @Column(name = "money_daily_today_tuesday") + private BigDecimal moneyDailyTodayTuesday; + + @Column(name = "closing_wednesday") + private BigDecimal closingWednesday; + + @Column(name = "expense_wednesday") + private BigDecimal expenseWednesday; + + @Column(name = "money_daily_today_wednesday") + private BigDecimal moneyDailyTodayWednesday; + + @Column(name = "closing_thursday") + private BigDecimal closingThursday; + + @Column(name = "expense_thursday") + private BigDecimal expenseThursday; + + @Column(name = "money_daily_today_thursday") + private BigDecimal moneyDailyTodayThursday; + + @Column(name = "closing_friday") + private BigDecimal closingFriday; + + @Column(name = "expense_friday") + private BigDecimal expenseFriday; + + @Column(name = "money_daily_today_friday") + private BigDecimal moneyDailyTodayFriday; + + @Column(name = "closing_saturday") + private BigDecimal closingSaturday; + + @Column(name = "expense_saturday") + private BigDecimal expenseSaturday; + + @Column(name = "money_daily_today_saturday") + private BigDecimal moneyDailyTodaySaturday; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public Office getOffice() { + return office; + } + + public void setOffice(Office office) { + this.office = office; + } + + public BigDecimal getClosingMonday() { + return closingMonday; + } + + public void setClosingMonday(BigDecimal closingMonday) { + this.closingMonday = closingMonday; + } + + public BigDecimal getExpenseMonday() { + return expenseMonday; + } + + public void setExpenseMonday(BigDecimal expenseMonday) { + this.expenseMonday = expenseMonday; + } + + public BigDecimal getMoneyDailyTodayMonday() { + return moneyDailyTodayMonday; + } + + public void setMoneyDailyTodayMonday(BigDecimal moneyDailyTodayMonday) { + this.moneyDailyTodayMonday = moneyDailyTodayMonday; + } + + public BigDecimal getClosingTuesday() { + return closingTuesday; + } + + public void setClosingTuesday(BigDecimal closingTuesday) { + this.closingTuesday = closingTuesday; + } + + public BigDecimal getExpenseTuesday() { + return expenseTuesday; + } + + public void setExpenseTuesday(BigDecimal expenseTuesday) { + this.expenseTuesday = expenseTuesday; + } + + public BigDecimal getMoneyDailyTodayTuesday() { + return moneyDailyTodayTuesday; + } + + public void setMoneyDailyTodayTuesday(BigDecimal moneyDailyTodayTuesday) { + this.moneyDailyTodayTuesday = moneyDailyTodayTuesday; + } + + public BigDecimal getClosingWednesday() { + return closingWednesday; + } + + public void setClosingWednesday(BigDecimal closingWednesday) { + this.closingWednesday = closingWednesday; + } + + public BigDecimal getExpenseWednesday() { + return expenseWednesday; + } + + public void setExpenseWednesday(BigDecimal expenseWednesday) { + this.expenseWednesday = expenseWednesday; + } + + public BigDecimal getMoneyDailyTodayWednesday() { + return moneyDailyTodayWednesday; + } + + public void setMoneyDailyTodayWednesday(BigDecimal moneyDailyTodayWednesday) { + this.moneyDailyTodayWednesday = moneyDailyTodayWednesday; + } + + public BigDecimal getClosingThursday() { + return closingThursday; + } + + public void setClosingThursday(BigDecimal closingThursday) { + this.closingThursday = closingThursday; + } + + public BigDecimal getExpenseThursday() { + return expenseThursday; + } + + public void setExpenseThursday(BigDecimal expenseThursday) { + this.expenseThursday = expenseThursday; + } + + public BigDecimal getMoneyDailyTodayThursday() { + return moneyDailyTodayThursday; + } + + public void setMoneyDailyTodayThursday(BigDecimal moneyDailyTodayThursday) { + this.moneyDailyTodayThursday = moneyDailyTodayThursday; + } + + public BigDecimal getClosingFriday() { + return closingFriday; + } + + public void setClosingFriday(BigDecimal closingFriday) { + this.closingFriday = closingFriday; + } + + public BigDecimal getExpenseFriday() { + return expenseFriday; + } + + public void setExpenseFriday(BigDecimal expenseFriday) { + this.expenseFriday = expenseFriday; + } + + public BigDecimal getMoneyDailyTodayFriday() { + return moneyDailyTodayFriday; + } + + public void setMoneyDailyTodayFriday(BigDecimal moneyDailyTodayFriday) { + this.moneyDailyTodayFriday = moneyDailyTodayFriday; + } + + public BigDecimal getClosingSaturday() { + return closingSaturday; + } + + public void setClosingSaturday(BigDecimal closingSaturday) { + this.closingSaturday = closingSaturday; + } + + public BigDecimal getExpenseSaturday() { + return expenseSaturday; + } + + public void setExpenseSaturday(BigDecimal expenseSaturday) { + this.expenseSaturday = expenseSaturday; + } + + public BigDecimal getMoneyDailyTodaySaturday() { + return moneyDailyTodaySaturday; + } + + public void setMoneyDailyTodaySaturday(BigDecimal moneyDailyTodaySaturday) { + this.moneyDailyTodaySaturday = moneyDailyTodaySaturday; + } + + public BigDecimal getTotalInicios() { + return moneyDailyTodayMonday.add(moneyDailyTodayThursday).add(moneyDailyTodayWednesday). + add(moneyDailyTodayTuesday).add(moneyDailyTodayFriday).add(moneyDailyTodaySaturday); + } + + public BigDecimal getTotalGastos() { + return expenseMonday.add(expenseThursday).add(expenseWednesday). + add(expenseTuesday).add(expenseFriday).add(expenseSaturday); + } + + public BigDecimal getTotalCortes() { + return closingMonday.add(closingThursday).add(closingWednesday). + add(closingTuesday).add(closingFriday).add(closingSaturday); + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/ResumenInOutWeekByUserView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/ResumenInOutWeekByUserView.java new file mode 100644 index 0000000..940c1b2 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/ResumenInOutWeekByUserView.java @@ -0,0 +1,284 @@ +/* + * 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 com.arrebol.apc.model.core.Office; +import java.io.Serializable; +import java.math.BigDecimal; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import org.hibernate.annotations.Immutable; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Entity +@Immutable +@Table(name = "APC_RESUMEN_IN_OUT_WEEK_BY_USER_VIEW") +public class ResumenInOutWeekByUserView implements Serializable{ + + private static final long serialVersionUID = 3055231364366461069L; + + @Id + @Column(name = "id", length = 36) + private String id; + + @Column(name = "username") + private String userName; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_office", + referencedColumnName = "id", + nullable = false + ) + private Office office; + + @Column(name = "closing_monday") + private BigDecimal closingMonday; + + @Column(name = "expense_monday") + private BigDecimal expenseMonday; + + @Column(name = "money_daily_today_monday") + private BigDecimal moneyDailyTodayMonday; + + @Column(name = "closing_tuesday") + private BigDecimal closingTuesday; + + @Column(name = "expense_tuesday") + private BigDecimal expenseTuesday; + + @Column(name = "money_daily_today_tuesday") + private BigDecimal moneyDailyTodayTuesday; + + @Column(name = "closing_wednesday") + private BigDecimal closingWednesday; + + @Column(name = "expense_wednesday") + private BigDecimal expenseWednesday; + + @Column(name = "money_daily_today_wednesday") + private BigDecimal moneyDailyTodayWednesday; + + @Column(name = "closing_thursday") + private BigDecimal closingThursday; + + @Column(name = "expense_thursday") + private BigDecimal expenseThursday; + + @Column(name = "money_daily_today_thursday") + private BigDecimal moneyDailyTodayThursday; + + @Column(name = "closing_friday") + private BigDecimal closingFriday; + + @Column(name = "expense_friday") + private BigDecimal expenseFriday; + + @Column(name = "money_daily_today_friday") + private BigDecimal moneyDailyTodayFriday; + + @Column(name = "closing_saturday") + private BigDecimal closingSaturday; + + @Column(name = "expense_saturday") + private BigDecimal expenseSaturday; + + @Column(name = "money_daily_today_saturday") + private BigDecimal moneyDailyTodaySaturday; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public Office getOffice() { + return office; + } + + public void setOffice(Office office) { + this.office = office; + } + + public BigDecimal getClosingMonday() { + return closingMonday; + } + + public void setClosingMonday(BigDecimal closingMonday) { + this.closingMonday = closingMonday; + } + + public BigDecimal getExpenseMonday() { + return expenseMonday; + } + + public void setExpenseMonday(BigDecimal expenseMonday) { + this.expenseMonday = expenseMonday; + } + + public BigDecimal getMoneyDailyTodayMonday() { + return moneyDailyTodayMonday; + } + + public void setMoneyDailyTodayMonday(BigDecimal moneyDailyTodayMonday) { + this.moneyDailyTodayMonday = moneyDailyTodayMonday; + } + + public BigDecimal getClosingTuesday() { + return closingTuesday; + } + + public void setClosingTuesday(BigDecimal closingTuesday) { + this.closingTuesday = closingTuesday; + } + + public BigDecimal getExpenseTuesday() { + return expenseTuesday; + } + + public void setExpenseTuesday(BigDecimal expenseTuesday) { + this.expenseTuesday = expenseTuesday; + } + + public BigDecimal getMoneyDailyTodayTuesday() { + return moneyDailyTodayTuesday; + } + + public void setMoneyDailyTodayTuesday(BigDecimal moneyDailyTodayTuesday) { + this.moneyDailyTodayTuesday = moneyDailyTodayTuesday; + } + + public BigDecimal getClosingWednesday() { + return closingWednesday; + } + + public void setClosingWednesday(BigDecimal closingWednesday) { + this.closingWednesday = closingWednesday; + } + + public BigDecimal getExpenseWednesday() { + return expenseWednesday; + } + + public void setExpenseWednesday(BigDecimal expenseWednesday) { + this.expenseWednesday = expenseWednesday; + } + + public BigDecimal getMoneyDailyTodayWednesday() { + return moneyDailyTodayWednesday; + } + + public void setMoneyDailyTodayWednesday(BigDecimal moneyDailyTodayWednesday) { + this.moneyDailyTodayWednesday = moneyDailyTodayWednesday; + } + + public BigDecimal getClosingThursday() { + return closingThursday; + } + + public void setClosingThursday(BigDecimal closingThursday) { + this.closingThursday = closingThursday; + } + + public BigDecimal getExpenseThursday() { + return expenseThursday; + } + + public void setExpenseThursday(BigDecimal expenseThursday) { + this.expenseThursday = expenseThursday; + } + + public BigDecimal getMoneyDailyTodayThursday() { + return moneyDailyTodayThursday; + } + + public void setMoneyDailyTodayThursday(BigDecimal moneyDailyTodayThursday) { + this.moneyDailyTodayThursday = moneyDailyTodayThursday; + } + + public BigDecimal getClosingFriday() { + return closingFriday; + } + + public void setClosingFriday(BigDecimal closingFriday) { + this.closingFriday = closingFriday; + } + + public BigDecimal getExpenseFriday() { + return expenseFriday; + } + + public void setExpenseFriday(BigDecimal expenseFriday) { + this.expenseFriday = expenseFriday; + } + + public BigDecimal getMoneyDailyTodayFriday() { + return moneyDailyTodayFriday; + } + + public void setMoneyDailyTodayFriday(BigDecimal moneyDailyTodayFriday) { + this.moneyDailyTodayFriday = moneyDailyTodayFriday; + } + + public BigDecimal getClosingSaturday() { + return closingSaturday; + } + + public void setClosingSaturday(BigDecimal closingSaturday) { + this.closingSaturday = closingSaturday; + } + + public BigDecimal getExpenseSaturday() { + return expenseSaturday; + } + + public void setExpenseSaturday(BigDecimal expenseSaturday) { + this.expenseSaturday = expenseSaturday; + } + + public BigDecimal getMoneyDailyTodaySaturday() { + return moneyDailyTodaySaturday; + } + + public void setMoneyDailyTodaySaturday(BigDecimal moneyDailyTodaySaturday) { + this.moneyDailyTodaySaturday = moneyDailyTodaySaturday; + } + + public BigDecimal getTotalInicios() { + return moneyDailyTodayMonday.add(moneyDailyTodayThursday).add(moneyDailyTodayWednesday). + add(moneyDailyTodayTuesday).add(moneyDailyTodayFriday).add(moneyDailyTodaySaturday); + } + + public BigDecimal getTotalGastos() { + return expenseMonday.add(expenseThursday).add(expenseWednesday). + add(expenseTuesday).add(expenseFriday).add(expenseSaturday); + } + + public BigDecimal getTotalCortes() { + return closingMonday.add(closingThursday).add(closingWednesday). + add(closingTuesday).add(closingFriday).add(closingSaturday); + } +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/ResumenTotalLastWeekView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/ResumenTotalLastWeekView.java new file mode 100644 index 0000000..9f7bca7 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/ResumenTotalLastWeekView.java @@ -0,0 +1,162 @@ +/* + * 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 org.hibernate.annotations.Immutable; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Entity +@Immutable +@Table(name = "APC_RESUMEN_TOTAL_LAST_WEEK_VIEW") +public class ResumenTotalLastWeekView implements Serializable{ + + private static final long serialVersionUID = -6384789811291615117L; + + @Id + @Column(name = "id", length = 36) + private String id; + + @Column(name = "office_name") + private String officeName; + + @Column(name = "closing__day_total") + private BigDecimal closingDayTotal; + + @Column(name = "money_daily_today_total") + private BigDecimal moneyDailyTodayTotal; + + @Column(name = "subtotal_total") + private BigDecimal subtotalTotal; + + @Column(name = "opening_fee_total") + private BigDecimal openingFeeTotal; + + @Column(name = "cobranza_today") + private BigDecimal cobranzaToday; + + @Column(name = "colocation_total") + private BigDecimal colocationTotal; + + @Column(name = "nomina_total") + private BigDecimal nominaTotal; + + @Column(name = "adelantos_total") + private BigDecimal adelantosTotal; + + @Column(name = "entradas_total") + private BigDecimal entradasTotal; + + @Column(name = "gastos_admon_total") + private BigDecimal gastosAdmonTotal; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getOfficeName() { + return officeName; + } + + public void setOfficeName(String officeName) { + this.officeName = officeName; + } + + public BigDecimal getClosingDayTotal() { + return closingDayTotal; + } + + public void setClosingDayTotal(BigDecimal closingDayTotal) { + this.closingDayTotal = closingDayTotal; + } + + public BigDecimal getMoneyDailyTodayTotal() { + return moneyDailyTodayTotal; + } + + public void setMoneyDailyTodayTotal(BigDecimal moneyDailyTodayTotal) { + this.moneyDailyTodayTotal = moneyDailyTodayTotal; + } + + public BigDecimal getSubtotalTotal() { + return subtotalTotal; + } + + public void setSubtotalTotal(BigDecimal subtotalTotal) { + this.subtotalTotal = subtotalTotal; + } + + public BigDecimal getOpeningFeeTotal() { + return openingFeeTotal; + } + + public void setOpeningFeeTotal(BigDecimal openingFeeTotal) { + this.openingFeeTotal = openingFeeTotal; + } + + public BigDecimal getCobranzaToday() { + return cobranzaToday; + } + + public void setCobranzaToday(BigDecimal cobranzaToday) { + this.cobranzaToday = cobranzaToday; + } + + public BigDecimal getColocationTotal() { + return colocationTotal; + } + + public void setColocationTotal(BigDecimal colocationTotal) { + this.colocationTotal = colocationTotal; + } + + public BigDecimal getNominaTotal() { + return nominaTotal; + } + + public void setNominaTotal(BigDecimal nominaTotal) { + this.nominaTotal = nominaTotal; + } + + public BigDecimal getAdelantosTotal() { + return adelantosTotal; + } + + public void setAdelantosTotal(BigDecimal adelantosTotal) { + this.adelantosTotal = adelantosTotal; + } + + public BigDecimal getEntradasTotal() { + return entradasTotal; + } + + public void setEntradasTotal(BigDecimal entradasTotal) { + this.entradasTotal = entradasTotal; + } + + public BigDecimal getGastosAdmonTotal() { + return gastosAdmonTotal; + } + + public void setGastosAdmonTotal(BigDecimal gastosAdmonTotal) { + this.gastosAdmonTotal = gastosAdmonTotal; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/ResumenTotalWeekView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/ResumenTotalWeekView.java new file mode 100644 index 0000000..61d0501 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/ResumenTotalWeekView.java @@ -0,0 +1,162 @@ +/* + * 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 org.hibernate.annotations.Immutable; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Entity +@Immutable +@Table(name = "APC_RESUMEN_TOTAL_WEEK_VIEW") +public class ResumenTotalWeekView implements Serializable{ + + private static final long serialVersionUID = -6384789811291615117L; + + @Id + @Column(name = "id", length = 36) + private String id; + + @Column(name = "office_name") + private String officeName; + + @Column(name = "closing__day_total") + private BigDecimal closingDayTotal; + + @Column(name = "money_daily_today_total") + private BigDecimal moneyDailyTodayTotal; + + @Column(name = "subtotal_total") + private BigDecimal subtotalTotal; + + @Column(name = "opening_fee_total") + private BigDecimal openingFeeTotal; + + @Column(name = "cobranza_today") + private BigDecimal cobranzaToday; + + @Column(name = "colocation_total") + private BigDecimal colocationTotal; + + @Column(name = "nomina_total") + private BigDecimal nominaTotal; + + @Column(name = "adelantos_total") + private BigDecimal adelantosTotal; + + @Column(name = "entradas_total") + private BigDecimal entradasTotal; + + @Column(name = "gastos_admon_total") + private BigDecimal gastosAdmonTotal; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getOfficeName() { + return officeName; + } + + public void setOfficeName(String officeName) { + this.officeName = officeName; + } + + public BigDecimal getClosingDayTotal() { + return closingDayTotal; + } + + public void setClosingDayTotal(BigDecimal closingDayTotal) { + this.closingDayTotal = closingDayTotal; + } + + public BigDecimal getMoneyDailyTodayTotal() { + return moneyDailyTodayTotal; + } + + public void setMoneyDailyTodayTotal(BigDecimal moneyDailyTodayTotal) { + this.moneyDailyTodayTotal = moneyDailyTodayTotal; + } + + public BigDecimal getSubtotalTotal() { + return subtotalTotal; + } + + public void setSubtotalTotal(BigDecimal subtotalTotal) { + this.subtotalTotal = subtotalTotal; + } + + public BigDecimal getOpeningFeeTotal() { + return openingFeeTotal; + } + + public void setOpeningFeeTotal(BigDecimal openingFeeTotal) { + this.openingFeeTotal = openingFeeTotal; + } + + public BigDecimal getCobranzaToday() { + return cobranzaToday; + } + + public void setCobranzaToday(BigDecimal cobranzaToday) { + this.cobranzaToday = cobranzaToday; + } + + public BigDecimal getColocationTotal() { + return colocationTotal; + } + + public void setColocationTotal(BigDecimal colocationTotal) { + this.colocationTotal = colocationTotal; + } + + public BigDecimal getNominaTotal() { + return nominaTotal; + } + + public void setNominaTotal(BigDecimal nominaTotal) { + this.nominaTotal = nominaTotal; + } + + public BigDecimal getAdelantosTotal() { + return adelantosTotal; + } + + public void setAdelantosTotal(BigDecimal adelantosTotal) { + this.adelantosTotal = adelantosTotal; + } + + public BigDecimal getEntradasTotal() { + return entradasTotal; + } + + public void setEntradasTotal(BigDecimal entradasTotal) { + this.entradasTotal = entradasTotal; + } + + public BigDecimal getGastosAdmonTotal() { + return gastosAdmonTotal; + } + + public void setGastosAdmonTotal(BigDecimal gastosAdmonTotal) { + this.gastosAdmonTotal = gastosAdmonTotal; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/StatsAdvancesView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/StatsAdvancesView.java new file mode 100644 index 0000000..7e2040f --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/StatsAdvancesView.java @@ -0,0 +1,90 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +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.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author David Rodriguez + */ +@Entity +@Table(name = "APC_STATS_ADVANCE_VIEW") +public class StatsAdvancesView implements Serializable { + + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @Column(name = "id_route", length = 36) + private String idRoute; + + @Column(name = "name") + private String routeName; + + @Column(name = "total_advances") + private BigDecimal totalAdvances; + + @Column(name = "created_on") + private Date createdOn; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Date getCreatedOn() { + return createdOn; + } + + public void setCreatedOn(Date createdOn) { + this.createdOn = createdOn; + } + + public String getIdRoute() { + return idRoute; + } + + public void setIdRoute(String idRoute) { + this.idRoute = idRoute; + } + + public String getRouteName() { + return routeName; + } + + public void setRouteName(String routeName) { + this.routeName = routeName; + } + + public BigDecimal getTotalAdvances() { + return totalAdvances; + } + + public void setTotalAdvances(BigDecimal totalAdvances) { + this.totalAdvances = totalAdvances; + } + + @Override + public String toString() { + return "AdvancesView{" + "idRoute=" + idRoute + ", routeName=" + routeName + ", totalAdvances=" + totalAdvances + ", createdOn=" + createdOn + '}'; + } +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/StatsClosingDayView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/StatsClosingDayView.java new file mode 100644 index 0000000..ec0c55c --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/StatsClosingDayView.java @@ -0,0 +1,101 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +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.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author David Rodriguez + */ +@Entity +@Table(name = "APC_CLOSING_DAY_VIEW") +public class StatsClosingDayView implements Serializable { + + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @Column(name = "id_user", length = 36) + private String idUser; + + @Column(name = "name") + private String userName; + + @Column(name = "total_closing") + private BigDecimal totalClosingDay; + + @Column(name = "created_on") + private Date createdOn; + + @Column(name = "route_name") + private String routeName; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Date getCreatedOn() { + return createdOn; + } + + public void setCreatedOn(Date createdOn) { + this.createdOn = createdOn; + } + + public String getIdUser() { + return idUser; + } + + public void setIdUser(String idUser) { + this.idUser = idUser; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public BigDecimal getTotalClosingDay() { + return totalClosingDay; + } + + public void setTotalClosingDay(BigDecimal totalClosingDay) { + this.totalClosingDay = totalClosingDay; + } + + public String getRouteName() { + return routeName; + } + + public void setRouteName(String routeName) { + this.routeName = routeName; + } + + @Override + public String toString() { + return "FeesView{" + "idUser=" + idUser + ", userName=" + userName + ", totalClosingDay=" + totalClosingDay + ", createdOn=" + createdOn + '}'; + } +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/StatsDepositsView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/StatsDepositsView.java new file mode 100644 index 0000000..c0f5347 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/StatsDepositsView.java @@ -0,0 +1,145 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +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.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author David Rodriguez + */ +@Entity +@Table(name = "APC_STATS_DEPOSITS_VIEW") +public class StatsDepositsView implements Serializable { + + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @Column(name = "id_user", length = 36) + private String idUser; + + @Column(name = "id_customer", length = 36) + private String idCustomer; + + @Column(name ="coment") + private String coment; + + @Column(name="transfer_number") + private String transferNumber; + + @Column(name = "name") + private String userName; + + @Column(name = "name_customer") + private String customerName; + + @Column(name = "total_deposits") + private BigDecimal totalDeposits; + + @Column(name = "created_on") + private Date createdOn; + + @Column(name = "route_name") + private String routeName; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getComent() { + return coment; + } + + public void setComent(String coment) { + this.coment = coment; + } + + public String getTransferNumber() { + return transferNumber; + } + + public void setTransferNumber(String transferNumber) { + this.transferNumber = transferNumber; + } + + public Date getCreatedOn() { + return createdOn; + } + + public void setCreatedOn(Date createdOn) { + this.createdOn = createdOn; + } + + public String getIdUser() { + return idUser; + } + + public void setIdUser(String idUser) { + this.idUser = idUser; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public BigDecimal getTotalDeposits() { + return totalDeposits; + } + + public void setTotalDeposits(BigDecimal totalDeposits) { + this.totalDeposits = totalDeposits; + } + + public String getRouteName() { + return routeName; + } + + public void setRouteName(String routeName) { + this.routeName = routeName; + } + + public String getIdCustomer() { + return idCustomer; + } + + public void setIdCustomer(String idCustomer) { + this.idCustomer = idCustomer; + } + + public String getCustomerName() { + return customerName; + } + + public void setCustomerName(String customerName) { + this.customerName = customerName; + } + + @Override + public String toString() { + return "Deposits{" + "idUser=" + idUser + ", userName=" + userName + ", totalDeposits=" + totalDeposits + ", createdOn=" + createdOn + '}'; + } +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/StatsEmployeeSavingView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/StatsEmployeeSavingView.java new file mode 100644 index 0000000..f3d5147 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/StatsEmployeeSavingView.java @@ -0,0 +1,126 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.model.views; + +import com.arrebol.apc.model.enums.EmployeeSavingType; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author David Rodriguez + */ +@Entity +@Table(name = "APC_STATS_EMPLOYEE_SAVING_VIEW") +public class StatsEmployeeSavingView implements Serializable { + + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @Column(name = "id_user", length = 36) + private String idUser; + + @Column(name = "name") + private String userName; + + @Column(name = "employee_saving") + private BigDecimal employeeSaving; + + @Column(name = "created_on") + private Date createdOn; + + @Column(name = "route_name") + private String routeName; + + public String getId() { + return id; + } + + @Enumerated(EnumType.STRING) + @Column(name = "type") + private EmployeeSavingType type; + + public String getTypeText() { + if(getType().equals(EmployeeSavingType.DISPOSAL)) + return "DisposiciĆ³n de ahorro"; + else if(getType().equals(EmployeeSavingType.CANCEL)){ + return "Ahorro Cancelado";} + else{ + return "Ahorro"; + } + } + + public EmployeeSavingType getType() { + return type; + } + + public void setType(EmployeeSavingType type) { + this.type = type; + } + + public void setId(String id) { + this.id = id; + } + + public Date getCreatedOn() { + return createdOn; + } + + public void setCreatedOn(Date createdOn) { + this.createdOn = createdOn; + } + + public String getIdUser() { + return idUser; + } + + public void setIdUser(String idUser) { + this.idUser = idUser; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public BigDecimal getEmployeeSaving() { + return employeeSaving; + } + + public void setEmployeeSaving(BigDecimal employeeSaving) { + this.employeeSaving = employeeSaving; + } + + public String getRouteName() { + return routeName; + } + + public void setRouteName(String routeName) { + this.routeName = routeName; + } + + @Override + public String toString() { + return "EmployeeSaving{" + "idUser=" + idUser + ", userName=" + userName + ", employeeSaving=" + employeeSaving + ", createdOn=" + createdOn + '}'; + } +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/StatsGasolineView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/StatsGasolineView.java new file mode 100644 index 0000000..1bdbb22 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/StatsGasolineView.java @@ -0,0 +1,158 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.model.views; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author David Rodriguez + */ +@Entity +@Table(name = "APC_STATS_GASOLINE_VIEW") +public class StatsGasolineView implements Serializable { + + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @Column(name = "id_user", length = 36) + private String idUser; + + @Column(name = "id_route", length = 36) + private String idRoute; + + @Column(name = "route_name") + private String routeName; + + @Column(name = "user_name") + private String userName; + + @Column(name = "km_old") + private Double kmOld; + + @Column(name = "km_new") + private Double kmNew; + + @Column(name = "total_gasoline") + private Double totalGasoline; + + @Column(name = "description", length = 36) + private String description; + + @Column(name = "created_on") + private Date createdOn; + + @Column(name = "quantity") + private Double quantity; + + public Double getQuantity() { + return quantity; + } + + public void setQuantity(Double quantity) { + this.quantity = quantity; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getIdUser() { + return idUser; + } + + public void setIdUser(String idUser) { + this.idUser = idUser; + } + + public String getIdRoute() { + return idRoute; + } + + public void setIdRoute(String idRoute) { + this.idRoute = idRoute; + } + + public String getRouteName() { + return routeName; + } + + public void setRouteName(String routeName) { + this.routeName = routeName; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public Double getKmOld() { + return kmOld; + } + + public void setKmOld(Double kmOld) { + this.kmOld = kmOld; + } + + public Double getKmNew() { + return kmNew; + } + + public void setKmNew(Double kmNew) { + this.kmNew = kmNew; + } + + public Double getTotalGasoline() { + return totalGasoline; + } + + public void setTotalGasoline(Double totalGasoline) { + this.totalGasoline = totalGasoline; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Date getCreatedOn() { + return createdOn; + } + + public void setCreatedOn(Date createdOn) { + this.createdOn = createdOn; + } + + public Double getKmRecorridos(){ + return getKmNew() - (getKmOld() != null ? getKmOld() : 0D ); + } + + public Double getRendimiento(){ + return getKmRecorridos()/getQuantity(); + } +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/StatsOpeningFeesView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/StatsOpeningFeesView.java new file mode 100644 index 0000000..f631d7e --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/StatsOpeningFeesView.java @@ -0,0 +1,101 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +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.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author David Rodriguez + */ +@Entity +@Table(name = "APC_OPENING_FEES_VIEW") +public class StatsOpeningFeesView implements Serializable { + + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @Column(name = "id_user", length = 36) + private String idUser; + + @Column(name = "name") + private String userName; + + @Column(name = "opening_fee") + private BigDecimal totalOpeningFees; + + @Column(name = "created_on") + private Date createdOn; + + @Column(name = "route_name") + private String routeName; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Date getCreatedOn() { + return createdOn; + } + + public void setCreatedOn(Date createdOn) { + this.createdOn = createdOn; + } + + public String getIdUser() { + return idUser; + } + + public void setIdUser(String idUser) { + this.idUser = idUser; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public BigDecimal getTotalOpeningFees() { + return totalOpeningFees; + } + + public void setTotaltotalOpeningFees(BigDecimal totalOpeningFees) { + this.totalOpeningFees = totalOpeningFees; + } + + public String getRouteName() { + return routeName; + } + + public void setRouteName(String routeName) { + this.routeName = routeName; + } + + @Override + public String toString() { + return "FeesView{" + "idUser=" + idUser + ", userName=" + userName + ", totalOpeningFees=" + totalOpeningFees + ", createdOn=" + createdOn + '}'; + } +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/StatsPaymentRenovationView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/StatsPaymentRenovationView.java new file mode 100644 index 0000000..b3192d9 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/StatsPaymentRenovationView.java @@ -0,0 +1,112 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +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.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author David Rodriguez + */ +@Entity +@Table(name = "APC_STATS_PAYMENT_RENOVATION_VIEW") +public class StatsPaymentRenovationView implements Serializable { + + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @Column(name = "id_user", length = 36) + private String idUser; + + @Column(name = "employee_name") + private String userName; + + @Column(name = "id_customer", length = 36) + private String idCustomer; + + @Column(name = "customer_name") + private String customerName; + + @Column(name = "total_payment") + private BigDecimal totalPayment; + + @Column(name = "created_on") + private Date createdOn; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Date getCreatedOn() { + return createdOn; + } + + public void setCreatedOn(Date createdOn) { + this.createdOn = createdOn; + } + + public String getIdUser() { + return idUser; + } + + public void setIdUser(String idUser) { + this.idUser = idUser; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getIdCustomer() { + return idCustomer; + } + + public void setIdCustomer(String idCustomer) { + this.idCustomer = idCustomer; + } + + public String getCustomerName() { + return customerName; + } + + public void setCustomerName(String customerName) { + this.customerName = customerName; + } + + public BigDecimal getTotalPayment() { + return totalPayment; + } + + public void setTotalPayment(BigDecimal totalPayment) { + this.totalPayment = totalPayment; + } + + @Override + public String toString() { + return "FeesView{" + "idUser=" + idUser + ", userName=" + userName + ", totalPayment=" + totalPayment + ", createdOn=" + createdOn + '}'; + } +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/StatsPaymentRouteView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/StatsPaymentRouteView.java new file mode 100644 index 0000000..1bdb0d7 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/StatsPaymentRouteView.java @@ -0,0 +1,123 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +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.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author David Rodriguez + */ +@Entity +@Table(name = "APC_PAYMENT_ROUTE_VIEW") +public class StatsPaymentRouteView implements Serializable { + + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @Column(name = "id_loan", length = 36) + private String idLoan; + + @Column(name = "id_route", length = 36) + private String idRoute; + + @Column(name = "name") + private String routeName; + + @Column(name = "user_name") + private String userName; + + @Column(name = "total_payment") + private BigDecimal totalPayment; + + @Column(name = "opening_fee") + private BigDecimal openingFee; + + @Column(name = "created_on") + private Date createdOn; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Date getCreatedOn() { + return createdOn; + } + + public void setCreatedOn(Date createdOn) { + this.createdOn = createdOn; + } + + public String getIdRoute() { + return idRoute; + } + + public void setIdRoute(String idRoute) { + this.idRoute = idRoute; + } + + public String getRouteName() { + return routeName; + } + + public void setRouteName(String routeName) { + this.routeName = routeName; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public BigDecimal getTotalPayment() { + return totalPayment; + } + + public void setTotalPayment(BigDecimal totalPayment) { + this.totalPayment = totalPayment; + } + + public BigDecimal getOpeningFee() { + return openingFee; + } + + public void setOpeningFee(BigDecimal openingFee) { + this.openingFee = openingFee; + } + + public String getIdLoan() { + return idLoan; + } + + public void setIdLoan(String idLoan) { + this.idLoan = idLoan; + } + + @Override + public String toString() { + return "FeesView{" + "idRoute=" + idRoute + ", routeName=" + routeName + ", totalPayment=" + totalPayment + ", createdOn=" + createdOn + '}'; + } +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/StatsPaymentView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/StatsPaymentView.java new file mode 100644 index 0000000..b657f0e --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/StatsPaymentView.java @@ -0,0 +1,123 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +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.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author David Rodriguez + */ +@Entity +@Table(name = "APC_PAYMENT_VIEW") +public class StatsPaymentView implements Serializable { + + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @Column(name = "id_loan", length = 36) + private String idLoan; + + @Column(name = "id_user", length = 36) + private String idUser; + + @Column(name = "name") + private String userName; + + @Column(name = "route_name") + private String routeName; + + @Column(name = "total_payment") + private BigDecimal totalPayment; + + @Column(name = "opening_fee") + private BigDecimal openingFee; + + @Column(name = "created_on") + private Date createdOn; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Date getCreatedOn() { + return createdOn; + } + + public void setCreatedOn(Date createdOn) { + this.createdOn = createdOn; + } + + public String getIdUser() { + return idUser; + } + + public void setIdUser(String idUser) { + this.idUser = idUser; + } + + public String getIdLoan() { + return idLoan; + } + + public void setIdLoan(String idLoan) { + this.idLoan = idLoan; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getRouteName() { + return routeName; + } + + public void setRouteName(String routeName) { + this.routeName = routeName; + } + + public BigDecimal getTotalPayment() { + return totalPayment; + } + + public void setTotalPayment(BigDecimal totalPayment) { + this.totalPayment = totalPayment; + } + + public BigDecimal getOpeningFee() { + return openingFee; + } + + public void setOpeningFee(BigDecimal openingFee) { + this.openingFee = openingFee; + } + + @Override + public String toString() { + return "FeesView{" + "idUser=" + idUser + ", userName=" + userName + ", totalPayment=" + totalPayment + ", createdOn=" + createdOn + '}'; + } +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/StatsPayrollView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/StatsPayrollView.java new file mode 100644 index 0000000..16155f7 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/StatsPayrollView.java @@ -0,0 +1,90 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +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.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author David Rodriguez + */ +@Entity +@Table(name = "APC_PAYROLL_STATS_VIEW") +public class StatsPayrollView implements Serializable { + + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @Column(name = "id_user", length = 36) + private String idUser; + + @Column(name = "name") + private String userName; + + @Column(name = "total_payroll") + private BigDecimal totalPayroll; + + @Column(name = "created_on") + private Date createdOn; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Date getCreatedOn() { + return createdOn; + } + + public void setCreatedOn(Date createdOn) { + this.createdOn = createdOn; + } + + public String getIdUser() { + return idUser; + } + + public void setIdUser(String idUser) { + this.idUser = idUser; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public BigDecimal getTotalPayroll() { + return totalPayroll; + } + + public void setTotalPayroll(BigDecimal totalPayroll) { + this.totalPayroll = totalPayroll; + } + + @Override + public String toString() { + return "FeesView{" + "idUser=" + idUser + ", userName=" + userName + ", totalPayroll=" + totalPayroll + ", createdOn=" + createdOn + '}'; + } +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/StatsSummaryView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/StatsSummaryView.java new file mode 100644 index 0000000..00bc3d1 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/StatsSummaryView.java @@ -0,0 +1,168 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.model.views; + +import java.io.Serializable; +import java.math.BigDecimal; +import javax.persistence.Column; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author David Rodriguez + */ +// @Entity +// @Table(name = "APC_PAYROLL_STATS_VIEW") +public class StatsSummaryView implements Serializable { + + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @Column(name = "id_user", length = 36) + private String idUser; + + @Column(name = "Name") + private String userName; + + @Column(name = "opening_fee") + private BigDecimal openingFee; + + @Column(name = "deposits") + private BigDecimal deposits; + + @Column(name = "payment") + private BigDecimal payment; + + @Column(name = "payroll") + private BigDecimal payroll; + + @Column(name = "gasoline") + private BigDecimal gasoline; + + @Column(name = "advances") + private BigDecimal advances; + + @Column(name = "expenses") + private BigDecimal expenses; + + @Column(name = "trasfer_transmitter") + private BigDecimal trasferTransmitter; + + @Column(name = "trasfer_receiver") + private BigDecimal trasferReceiver; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public BigDecimal getOpeningFee() { + return openingFee; + } + + public void setOpeningFee(BigDecimal openingFee) { + this.openingFee = openingFee; + } + + public BigDecimal getDeposits() { + return deposits; + } + + public void setDeposits(BigDecimal deposits) { + this.deposits = deposits; + } + + public BigDecimal getPayment() { + return payment; + } + + public void setPayment(BigDecimal payment) { + this.payment = payment; + } + + public BigDecimal getPayroll() { + return payroll; + } + + public void setPayroll(BigDecimal payroll) { + this.payroll = payroll; + } + + public BigDecimal getGasoline() { + return gasoline; + } + + public void setGasoline(BigDecimal gasoline) { + this.gasoline = gasoline; + } + + public BigDecimal getAdvances() { + return advances; + } + + public void setAdvances(BigDecimal advances) { + this.advances = advances; + } + + public BigDecimal getExpenses() { + return expenses; + } + + public void setExpenses(BigDecimal expenses) { + this.expenses = expenses; + } + + public BigDecimal getTrasferTransmitter() { + return trasferTransmitter; + } + + public void setTrasferTransmitter(BigDecimal trasferTransmitter) { + this.trasferTransmitter = trasferTransmitter; + } + + public BigDecimal getTrasferReceiver() { + return trasferReceiver; + } + + public void setTrasferReceiver(BigDecimal trasferReceiver) { + this.trasferReceiver = trasferReceiver; + } + + public String getIdUser() { + return idUser; + } + + public void setIdUser(String idUser) { + this.idUser = idUser; + } + + public BigDecimal getTotalCobros(){ + return advances.add(payment).add(deposits).add(openingFee); + } + + @Override + public String toString() { + return ""; + } +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/StatsZeroPaymentsView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/StatsZeroPaymentsView.java new file mode 100644 index 0000000..edd6808 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/StatsZeroPaymentsView.java @@ -0,0 +1,101 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +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.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author David Rodriguez + */ +@Entity +@Table(name = "APC_STATS_ZERO_PAYMENTS_VIEW") +public class StatsZeroPaymentsView implements Serializable { + + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @Column(name = "id_user", length = 36) + private String idUser; + + @Column(name = "name") + private String userName; + + @Column(name = "total_zeroPayments") + private BigDecimal totalZeroPayments; + + @Column(name = "created_on") + private Date createdOn; + + @Column(name = "route_name") + private String routeName; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Date getCreatedOn() { + return createdOn; + } + + public void setCreatedOn(Date createdOn) { + this.createdOn = createdOn; + } + + public String getIdUser() { + return idUser; + } + + public void setIdUser(String idUser) { + this.idUser = idUser; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public BigDecimal getTotalZeroPayments() { + return totalZeroPayments; + } + + public void setTotalZeroPayments(BigDecimal totalZeroPayments) { + this.totalZeroPayments = totalZeroPayments; + } + + public String getRouteName() { + return routeName; + } + + public void setRouteName(String routeName) { + this.routeName = routeName; + } + + @Override + public String toString() { + return "ZeroPayments{" + "idUser=" + idUser + ", userName=" + userName + ", totalZeroPayments=" + totalZeroPayments + ", createdOn=" + createdOn + '}'; + } +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/SubtotalLastWeekByUserView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/SubtotalLastWeekByUserView.java new file mode 100644 index 0000000..c486fd8 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/SubtotalLastWeekByUserView.java @@ -0,0 +1,252 @@ +/* + * 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 com.arrebol.apc.model.core.Office; +import java.io.Serializable; +import java.math.BigDecimal; +import java.math.RoundingMode; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Transient; +import org.hibernate.annotations.Immutable; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Entity +@Immutable +@Table(name = "APC_SUBTOTAL_LAST_WEEK_BY_USER_VIEW") +public class SubtotalLastWeekByUserView implements Serializable{ + + private static final long serialVersionUID = 3055231364366461069L; + + @Id + @Column(name = "id", length = 36) + private String id; + + @Column(name = "username") + private String userName; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_office", + referencedColumnName = "id", + nullable = false + ) + private Office office; + + @Column(name = "subtotal_monday") + private BigDecimal subtotalMonday; + + @Column(name = "subtotal_tuesday") + private BigDecimal subtotalTuesday; + + @Column(name = "subtotal_wednesday") + private BigDecimal subtotalWednesday; + + @Column(name = "subtotal_thursday") + private BigDecimal subtotalThursday; + + @Column(name = "subtotal_friday") + private BigDecimal subtotalFriday; + + @Column(name = "subtotal_saturday") + private BigDecimal subtotalSaturday; + + @Column(name = "subtotal_total") + private BigDecimal subtotalTotal; + + @Column(name = "opening_fee_monday") + private BigDecimal openingFeeMonday; + + @Column(name = "opening_fee_tuesday") + private BigDecimal openingFeeTuesday; + + @Column(name = "opening_fee_wednesday") + private BigDecimal openingFeeWednesday; + + @Column(name = "opening_fee_thursday") + private BigDecimal openingFeeThursday; + + @Column(name = "opening_fee_friday") + private BigDecimal openingFeeFriday; + + @Column(name = "opening_fee_saturday") + private BigDecimal openingFeeSaturday; + + @Column(name = "opening_fee_total") + private BigDecimal openingFeeTotal; + + @Column(name = "faltante") + private BigDecimal faltante; + + @Transient + private BigDecimal porcentajeFaltante; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public Office getOffice() { + return office; + } + + public void setOffice(Office office) { + this.office = office; + } + + public BigDecimal getSubtotalMonday() { + return subtotalMonday; + } + + public void setSubtotalMonday(BigDecimal subtotalMonday) { + this.subtotalMonday = subtotalMonday; + } + + public BigDecimal getSubtotalTuesday() { + return subtotalTuesday; + } + + public void setSubtotalTuesday(BigDecimal subtotalTuesday) { + this.subtotalTuesday = subtotalTuesday; + } + + public BigDecimal getSubtotalWednesday() { + return subtotalWednesday; + } + + public void setSubtotalWednesday(BigDecimal subtotalWednesday) { + this.subtotalWednesday = subtotalWednesday; + } + + public BigDecimal getSubtotalThursday() { + return subtotalThursday; + } + + public void setSubtotalThursday(BigDecimal subtotalThursday) { + this.subtotalThursday = subtotalThursday; + } + + public BigDecimal getSubtotalFriday() { + return subtotalFriday; + } + + public void setSubtotalFriday(BigDecimal subtotalFriday) { + this.subtotalFriday = subtotalFriday; + } + + public BigDecimal getSubtotalSaturday() { + return subtotalSaturday; + } + + public void setSubtotalSaturday(BigDecimal subtotalSaturday) { + this.subtotalSaturday = subtotalSaturday; + } + + public BigDecimal getSubtotalTotal() { + return subtotalTotal; + } + + public void setSubtotalTotal(BigDecimal subtotalTotal) { + this.subtotalTotal = subtotalTotal; + } + + public BigDecimal getOpeningFeeMonday() { + return openingFeeMonday; + } + + public void setOpeningFeeMonday(BigDecimal openingFeeMonday) { + this.openingFeeMonday = openingFeeMonday; + } + + public BigDecimal getOpeningFeeTuesday() { + return openingFeeTuesday; + } + + public void setOpeningFeeTuesday(BigDecimal openingFeeTuesday) { + this.openingFeeTuesday = openingFeeTuesday; + } + + public BigDecimal getOpeningFeeWednesday() { + return openingFeeWednesday; + } + + public void setOpeningFeeWednesday(BigDecimal openingFeeWednesday) { + this.openingFeeWednesday = openingFeeWednesday; + } + + public BigDecimal getOpeningFeeThursday() { + return openingFeeThursday; + } + + public void setOpeningFeeThursday(BigDecimal openingFeeThursday) { + this.openingFeeThursday = openingFeeThursday; + } + + public BigDecimal getOpeningFeeFriday() { + return openingFeeFriday; + } + + public void setOpeningFeeFriday(BigDecimal openingFeeFriday) { + this.openingFeeFriday = openingFeeFriday; + } + + public BigDecimal getOpeningFeeSaturday() { + return openingFeeSaturday; + } + + public void setOpeningFeeSaturday(BigDecimal openingFeeSaturday) { + this.openingFeeSaturday = openingFeeSaturday; + } + + public BigDecimal getOpeningFeeTotal() { + return openingFeeTotal; + } + + public void setOpeningFeeTotal(BigDecimal openingFeeTotal) { + this.openingFeeTotal = openingFeeTotal; + } + + public BigDecimal getFaltante() { + return faltante; + } + + public void setFaltante(BigDecimal faltante) { + this.faltante = faltante; + } + + public BigDecimal getPorcentajeFaltante() { + BigDecimal totalReportedWeek = openingFeeTotal.add(subtotalTotal); + if(totalReportedWeek.compareTo(BigDecimal.ZERO) == 1) + porcentajeFaltante = (faltante + .multiply(new BigDecimal(100))).divide(totalReportedWeek, 2, RoundingMode.HALF_UP); + else + porcentajeFaltante = BigDecimal.ZERO; + return porcentajeFaltante; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/SubtotalWeekByUserView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/SubtotalWeekByUserView.java new file mode 100644 index 0000000..9eabbad --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/SubtotalWeekByUserView.java @@ -0,0 +1,227 @@ +/* + * 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 com.arrebol.apc.model.core.Office; +import java.io.Serializable; +import java.math.BigDecimal; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import org.hibernate.annotations.Immutable; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Entity +@Immutable +@Table(name = "APC_SUBTOTAL_WEEK_BY_USER_VIEW") +public class SubtotalWeekByUserView implements Serializable{ + + private static final long serialVersionUID = 3055231364366461069L; + + @Id + @Column(name = "id", length = 36) + private String id; + + @Column(name = "username") + private String userName; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn( + name = "id_office", + referencedColumnName = "id", + nullable = false + ) + private Office office; + + @Column(name = "subtotal_monday") + private BigDecimal subtotalMonday; + + @Column(name = "subtotal_tuesday") + private BigDecimal subtotalTuesday; + + @Column(name = "subtotal_wednesday") + private BigDecimal subtotalWednesday; + + @Column(name = "subtotal_thursday") + private BigDecimal subtotalThursday; + + @Column(name = "subtotal_friday") + private BigDecimal subtotalFriday; + + @Column(name = "subtotal_saturday") + private BigDecimal subtotalSaturday; + + @Column(name = "subtotal_total") + private BigDecimal subtotalTotal; + + @Column(name = "opening_fee_monday") + private BigDecimal openingFeeMonday; + + @Column(name = "opening_fee_tuesday") + private BigDecimal openingFeeTuesday; + + @Column(name = "opening_fee_wednesday") + private BigDecimal openingFeeWednesday; + + @Column(name = "opening_fee_thursday") + private BigDecimal openingFeeThursday; + + @Column(name = "opening_fee_friday") + private BigDecimal openingFeeFriday; + + @Column(name = "opening_fee_saturday") + private BigDecimal openingFeeSaturday; + + @Column(name = "opening_fee_total") + private BigDecimal openingFeeTotal; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public Office getOffice() { + return office; + } + + public void setOffice(Office office) { + this.office = office; + } + + public BigDecimal getSubtotalMonday() { + return subtotalMonday; + } + + public void setSubtotalMonday(BigDecimal subtotalMonday) { + this.subtotalMonday = subtotalMonday; + } + + public BigDecimal getSubtotalTuesday() { + return subtotalTuesday; + } + + public void setSubtotalTuesday(BigDecimal subtotalTuesday) { + this.subtotalTuesday = subtotalTuesday; + } + + public BigDecimal getSubtotalWednesday() { + return subtotalWednesday; + } + + public void setSubtotalWednesday(BigDecimal subtotalWednesday) { + this.subtotalWednesday = subtotalWednesday; + } + + public BigDecimal getSubtotalThursday() { + return subtotalThursday; + } + + public void setSubtotalThursday(BigDecimal subtotalThursday) { + this.subtotalThursday = subtotalThursday; + } + + public BigDecimal getSubtotalFriday() { + return subtotalFriday; + } + + public void setSubtotalFriday(BigDecimal subtotalFriday) { + this.subtotalFriday = subtotalFriday; + } + + public BigDecimal getSubtotalSaturday() { + return subtotalSaturday; + } + + public void setSubtotalSaturday(BigDecimal subtotalSaturday) { + this.subtotalSaturday = subtotalSaturday; + } + + public BigDecimal getSubtotalTotal() { + return subtotalTotal; + } + + public void setSubtotalTotal(BigDecimal subtotalTotal) { + this.subtotalTotal = subtotalTotal; + } + + public BigDecimal getOpeningFeeMonday() { + return openingFeeMonday; + } + + public void setOpeningFeeMonday(BigDecimal openingFeeMonday) { + this.openingFeeMonday = openingFeeMonday; + } + + public BigDecimal getOpeningFeeTuesday() { + return openingFeeTuesday; + } + + public void setOpeningFeeTuesday(BigDecimal openingFeeTuesday) { + this.openingFeeTuesday = openingFeeTuesday; + } + + public BigDecimal getOpeningFeeWednesday() { + return openingFeeWednesday; + } + + public void setOpeningFeeWednesday(BigDecimal openingFeeWednesday) { + this.openingFeeWednesday = openingFeeWednesday; + } + + public BigDecimal getOpeningFeeThursday() { + return openingFeeThursday; + } + + public void setOpeningFeeThursday(BigDecimal openingFeeThursday) { + this.openingFeeThursday = openingFeeThursday; + } + + public BigDecimal getOpeningFeeFriday() { + return openingFeeFriday; + } + + public void setOpeningFeeFriday(BigDecimal openingFeeFriday) { + this.openingFeeFriday = openingFeeFriday; + } + + public BigDecimal getOpeningFeeSaturday() { + return openingFeeSaturday; + } + + public void setOpeningFeeSaturday(BigDecimal openingFeeSaturday) { + this.openingFeeSaturday = openingFeeSaturday; + } + + public BigDecimal getOpeningFeeTotal() { + return openingFeeTotal; + } + + public void setOpeningFeeTotal(BigDecimal openingFeeTotal) { + this.openingFeeTotal = openingFeeTotal; + } + + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/TotalCashByCurdateDashboardView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/TotalCashByCurdateDashboardView.java new file mode 100644 index 0000000..728547e --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/TotalCashByCurdateDashboardView.java @@ -0,0 +1,173 @@ +/* + * 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 + */ +@Entity +@Immutable +@Table(name = "APC_TOTAL_CASH_BY_CURDATE_DASHBOARD_VIEW") +public class TotalCashByCurdateDashboardView 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 TotalCashByCurdateDashboardView() { + } + + 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(getDepositDaily()) + .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 + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/TotalCashByCurdateView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/TotalCashByCurdateView.java new file mode 100644 index 0000000..6bc7379 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/TotalCashByCurdateView.java @@ -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 + */ +@Entity +@Immutable +@Table(name = "APC_TOTAL_CASH_BY_CURDATE_VIEW") +public class TotalCashByCurdateView 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 TotalCashByCurdateView() { + } + + 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 + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/TotalClosingDayByCurdateView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/TotalClosingDayByCurdateView.java new file mode 100644 index 0000000..102bcea --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/TotalClosingDayByCurdateView.java @@ -0,0 +1,71 @@ +/* + * 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 org.hibernate.annotations.Immutable; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Immutable +@Table(name = "APC_TOTAL_CLOSING_DAY_BY_CURDATE_VIEW") +public class TotalClosingDayByCurdateView implements Serializable { + + private static final long serialVersionUID = -2806905948351437216L; + + @Id + @Column(name = "id", length = 36) + private String id; + + @Column(name = "id_office") + private String idOffice; + + @Column(name = "amount_paid") + private BigDecimal amountPaid; + + public TotalClosingDayByCurdateView() { + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public BigDecimal getAmountPaid() { + return amountPaid; + } + + public void setAmountPaid(BigDecimal amountPaid) { + this.amountPaid = amountPaid; + } + + public String getIdOffice() { + return idOffice; + } + + public void setIdOffice(String idOffice) { + this.idOffice = idOffice; + } + + @Override + public String toString() { + return "TotalClosingDayByCurdateView{" + "id=" + id + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/TotalLoansApprovedByOfficeView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/TotalLoansApprovedByOfficeView.java new file mode 100644 index 0000000..e17c18a --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/TotalLoansApprovedByOfficeView.java @@ -0,0 +1,64 @@ +/* + * 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 org.hibernate.annotations.Immutable; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Entity +@Immutable +@Table(name = "APC_TOTAL_LOANS_APPROVED_BY_OFFICE") +public class TotalLoansApprovedByOfficeView implements Serializable{ + + private static final long serialVersionUID = -6505276469507406194L; + + @Id + @Column(name = "id", length = 36) + private String id; + + @Column(name = "id_office") + private String idOffice; + + @Column(name = "payment_daily") + private BigDecimal payment; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getIdOffice() { + return idOffice; + } + + public void setIdOffice(String idOffice) { + this.idOffice = idOffice; + } + + public BigDecimal getPayment() { + return payment; + } + + public void setPayment(BigDecimal payment) { + this.payment = payment; + } + + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/TotalLoansByOfficeView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/TotalLoansByOfficeView.java new file mode 100644 index 0000000..086efa2 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/TotalLoansByOfficeView.java @@ -0,0 +1,114 @@ +/* + * 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 com.arrebol.apc.model.enums.LoanStatus; +import java.io.Serializable; +import java.math.BigDecimal; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.Id; +import javax.persistence.Table; +import org.hibernate.annotations.Immutable; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Entity +@Immutable +@Table(name = "APC_TOTAL_LOANS_BY_OFFICE") +public class TotalLoansByOfficeView implements Serializable{ + + private static final long serialVersionUID = 1072887428747040106L; + + @Id + @Column(name = "id", length = 36) + private String id; + + @Column(name = "id_office") + private String idOffice; + + @Enumerated(EnumType.STRING) + @Column(name = "loan_status") + private LoanStatus loanStatus; + + @Column(name = "id_route") + private String idRoute; + + @Column(name = "route_name") + private String routeName; + + @Column(name = "amount_to_pay") + private BigDecimal amountToPay; + + @Column(name = "amount_paid") + private BigDecimal amountPaid; + + public TotalLoansByOfficeView() { + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getIdOffice() { + return idOffice; + } + + public void setIdOffice(String idOffice) { + this.idOffice = idOffice; + } + + public LoanStatus getLoanStatus() { + return loanStatus; + } + + public void setLoanStatus(LoanStatus loanStatus) { + this.loanStatus = loanStatus; + } + + public String getIdRoute() { + return idRoute; + } + + public void setIdRoute(String idRoute) { + this.idRoute = idRoute; + } + + public String getRouteName() { + return routeName; + } + + public void setRouteName(String routeName) { + this.routeName = routeName; + } + + public BigDecimal getAmountToPay() { + return amountToPay; + } + + public void setAmountToPay(BigDecimal amountToPay) { + this.amountToPay = amountToPay; + } + + public BigDecimal getAmountPaid() { + return amountPaid; + } + + public void setAmountPaid(BigDecimal amountPaid) { + this.amountPaid = amountPaid; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/TransferInPendingStatusView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/TransferInPendingStatusView.java new file mode 100644 index 0000000..4ddc8e4 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/TransferInPendingStatusView.java @@ -0,0 +1,175 @@ +/* + * 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.util.Date; +import java.util.Objects; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import org.hibernate.annotations.Immutable; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Immutable +@Table(name = "APC_TRANSFER_IN_PENDING_STATUS_VIEW") +public class TransferInPendingStatusView implements Serializable { + + private static final long serialVersionUID = 7430662914845336484L; + + @Id + @Column(name = "id_loan_detail", length = 36) + private String idLoanDetail; + + @Column(name = "payment_amount") + private Double paymentAmount; + + @Column(name = "str_created_on", length = 22) + private String strCreatedOn; + + @Column(name = "customer_name", length = 103) + private String customerName; + + @Column(name = "endorsement_name", length = 103) + private String endorsementName; + + @Column(name = "user_name", length = 103) + private String userName; + + @Column(name = "loan_comments", length = 150) + private String loanComments; + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "created_on", length = 19) + private Date createdOn; + + /** + * + */ + public TransferInPendingStatusView() { + } + + /** + * + * @param idLoanDetail + * @param paymentAmount + * @param strCreatedOn + * @param customerName + * @param endorsementName + * @param userName + * @param loanComments + * @param createdOn + */ + public TransferInPendingStatusView(String idLoanDetail, Double paymentAmount, String strCreatedOn, String customerName, String endorsementName, String userName, String loanComments, Date createdOn) { + this.idLoanDetail = idLoanDetail; + this.paymentAmount = paymentAmount; + this.strCreatedOn = strCreatedOn; + this.customerName = customerName; + this.endorsementName = endorsementName; + this.userName = userName; + this.loanComments = loanComments; + this.createdOn = createdOn; + } + + public String getIdLoanDetail() { + return idLoanDetail; + } + + public void setIdLoanDetail(String idLoanDetail) { + this.idLoanDetail = idLoanDetail; + } + + public Double getPaymentAmount() { + return paymentAmount; + } + + public void setPaymentAmount(Double paymentAmount) { + this.paymentAmount = paymentAmount; + } + + public String getStrCreatedOn() { + return strCreatedOn; + } + + public void setStrCreatedOn(String strCreatedOn) { + this.strCreatedOn = strCreatedOn; + } + + public String getCustomerName() { + return customerName; + } + + public void setCustomerName(String customerName) { + this.customerName = customerName; + } + + public String getEndorsementName() { + return endorsementName; + } + + public void setEndorsementName(String endorsementName) { + this.endorsementName = endorsementName; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getLoanComments() { + return loanComments; + } + + public void setLoanComments(String loanComments) { + this.loanComments = loanComments; + } + + public Date getCreatedOn() { + return createdOn; + } + + public void setCreatedOn(Date createdOn) { + this.createdOn = createdOn; + } + + @Override + public int hashCode() { + int hash = 7; + hash = 61 * hash + Objects.hashCode(this.idLoanDetail); + return hash; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final TransferInPendingStatusView other = (TransferInPendingStatusView) obj; + if (!Objects.equals(this.idLoanDetail, other.idLoanDetail)) { + return false; + } + return true; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/TransferView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/TransferView.java new file mode 100644 index 0000000..0f75817 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/TransferView.java @@ -0,0 +1,219 @@ +/* + * 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 com.arrebol.apc.model.enums.ActionStatus; +import com.arrebol.apc.model.enums.ActiveStatus; +import java.io.Serializable; +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Objects; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import org.hibernate.annotations.Immutable; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Immutable +@Table(name = "APC_TRANSFER_VIEW") +public class TransferView implements Serializable { + + @Id + @Column(name = "id", length = 36) + private String id; + + @Id + @Column(name = "id_office", length = 36) + private String idOffice; + + @Column(name = "full_name_transmitter", length = 103) + private String fullNameTransmitter; + + @Column(name = "transmitter_routes") + private String transmitterRoutes; + + @Column(name = "full_name_receiver", length = 103) + private String fullNameReceiver; + + @Column(name = "receiver_routes") + private String receiverRoutes; + + @Column(name = "amount_to_transfer") + private BigDecimal amountToTransfer; + + @Enumerated(EnumType.STRING) + @Column(name = "action_status") + private ActionStatus actionStatus; + + @Column(name = "str_action_status", length = 9) + private String strActionStatus; + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "created_on", length = 19) + private Date createdOn; + + @Column(name = "str_created_on", length = 22) + private String strCreatedOn; + + @Column(name = "style_class", length = 7) + private String styleClass; + + public TransferView() { + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getIdOffice() { + return idOffice; + } + + public void setIdOffice(String idOffice) { + this.idOffice = idOffice; + } + + public String getFullNameTransmitter() { + return fullNameTransmitter; + } + + public void setFullNameTransmitter(String fullNameTransmitter) { + this.fullNameTransmitter = fullNameTransmitter; + } + + public String getTransmitterRoutes() { + return transmitterRoutes; + } + + public void setTransmitterRoutes(String transmitterRoutes) { + this.transmitterRoutes = transmitterRoutes; + } + + public String getFullNameReceiver() { + return fullNameReceiver; + } + + public void setFullNameReceiver(String fullNameReceiver) { + this.fullNameReceiver = fullNameReceiver; + } + + public String getReceiverRoutes() { + return receiverRoutes; + } + + public void setReceiverRoutes(String receiverRoutes) { + this.receiverRoutes = receiverRoutes; + } + + public BigDecimal getAmountToTransfer() { + return amountToTransfer; + } + + public void setAmountToTransfer(BigDecimal amountToTransfer) { + this.amountToTransfer = amountToTransfer; + } + + public ActionStatus getActionStatus() { + return actionStatus; + } + + public void setActionStatus(ActionStatus actionStatus) { + this.actionStatus = actionStatus; + } + + public String getStrActionStatus() { + return strActionStatus; + } + + public void setStrActionStatus(String strActionStatus) { + this.strActionStatus = strActionStatus; + } + + public Date getCreatedOn() { + return createdOn; + } + + public void setCreatedOn(Date createdOn) { + this.createdOn = createdOn; + } + + public String getStrCreatedOn() { + return strCreatedOn; + } + + public void setStrCreatedOn(String strCreatedOn) { + this.strCreatedOn = strCreatedOn; + } + + public String getStyleClass() { + return styleClass; + } + + public void setStyleClass(String styleClass) { + this.styleClass = styleClass; + } + + public boolean getActive() { + return null == getStyleClass(); + } + + public boolean getAction(Date lastStableSmallBox) { + Date date = createdOn; + boolean action = true; + try { + SimpleDateFormat dt1 = new SimpleDateFormat("yyyy-MM-dd"); + + String dateStr = dt1.format(date); + date = dt1.parse(dateStr); + + action = date.after(lastStableSmallBox); + } catch (Exception ex) { + } + return action; + } + + @Override + public int hashCode() { + int hash = 5; + hash = 79 * hash + Objects.hashCode(this.id); + return hash; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final TransferView other = (TransferView) obj; + if (!Objects.equals(this.id, other.id)) { + return false; + } + return true; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/UserByRouteView.java b/ace-model/src/main/java/com/arrebol/apc/model/views/UserByRouteView.java new file mode 100644 index 0000000..e6e01f3 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/UserByRouteView.java @@ -0,0 +1,81 @@ +/* + * 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 javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; +import org.hibernate.annotations.Immutable; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Immutable +@Table(name = "APC_USER_BY_ROUTE_VIEW") +public class UserByRouteView implements Serializable { + + private static final long serialVersionUID = -4547463041660221310L; + + @Id + @Column(name = "id", length = 72) + private String id; + + @Column(name = "id_user", length = 36) + private String idUser; + + @Column(name = "id_route", length = 36) + private String idRoute; + + @Column(name = "employee_name", length = 103) + private String employeeName; + + public UserByRouteView() { + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getIdUser() { + return idUser; + } + + public void setIdUser(String idUser) { + this.idUser = idUser; + } + + public String getIdRoute() { + return idRoute; + } + + public void setIdRoute(String idRoute) { + this.idRoute = idRoute; + } + + public String getEmployeeName() { + return employeeName; + } + + public void setEmployeeName(String employeeName) { + this.employeeName = employeeName; + } + + @Override + public String toString() { + return "UserByRouteView{" + "employeeName=" + employeeName + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/constance/AdministrationPersonSerchViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/AdministrationPersonSerchViewCfg.java new file mode 100644 index 0000000..f191b53 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/AdministrationPersonSerchViewCfg.java @@ -0,0 +1,24 @@ +/* + * 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; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface AdministrationPersonSerchViewCfg { + + String QUERY_FIND_PERSON_BY_TYPE_ROUTE_OFFICE = "findPersonByPersonTypeAndRouteAndOffice"; + String QUERY_LIKE_PERSON_NAME_IN_PERSON_TYPE_IN_ROUTES_AND_OFFICE = "likePersonNameInPersonTypeInRoutesAndOffice"; + String QUERY_LIKE_PERSON_NAME_IN_PERSON_TYPE_ALL_ROUTES_BY_OFFICE = "likePersonNameInPersonTypeAllRoutesByOffice"; + + String FIELD_PEOPLE_TYPE = "peopleType"; + String FIELD_ID_ROUTE = "idRoute"; + String FIELD_ID_OFFICE = "idOffice"; + String FIELD_PERSON_SEARCH = "personSearch"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/constance/AdvanceUserDailyDetailViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/AdvanceUserDailyDetailViewCfg.java new file mode 100644 index 0000000..22e32b9 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/AdvanceUserDailyDetailViewCfg.java @@ -0,0 +1,22 @@ +/* + * 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 + */ +public interface AdvanceUserDailyDetailViewCfg extends GenericCfg { + + String QUERY_FIND_ALL_ADVANCE_USER_DAILY_DETAIL_BY_USER = "findAllAdvancesUserDailyDetailByUser"; + + String FIELD_VIEW_USER = "idUser"; + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/constance/AdvanceUserDailyViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/AdvanceUserDailyViewCfg.java new file mode 100644 index 0000000..55f6da1 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/AdvanceUserDailyViewCfg.java @@ -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 + */ +public interface AdvanceUserDailyViewCfg extends GenericCfg { + + String QUERY_FIND_ALL_ADVANCE_USER_DAILY_BY_OFFICE = "findAllAdvancesUserDailyByOffice"; + String QUERY_PAYMENT_TRACKING_BY_IDS = "findPaymentTrackingByIds"; + + String FIELD_VIEW_USER = "user"; + String FIELD_VIEW_OFFICE = "office"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/constance/AvailablesOwnersViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/AvailablesOwnersViewCfg.java new file mode 100644 index 0000000..4cfa2b3 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/AvailablesOwnersViewCfg.java @@ -0,0 +1,22 @@ +/* + * 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 Carlos Janitzio Zavala Lopez + */ +public interface AvailablesOwnersViewCfg extends GenericCfg { + + String QUERY_FIND_ALL_CURRENT_OWNERS = "findAllCurrentOwners"; + String QUERY_FIND_ALL_NEW_OWNERS = "findAllNewOwners"; + + String USER_ID = "userId"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/constance/ClosingDailyDetailFromUserByCurdateCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/ClosingDailyDetailFromUserByCurdateCfg.java new file mode 100644 index 0000000..a4efa98 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/ClosingDailyDetailFromUserByCurdateCfg.java @@ -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 + */ +public interface ClosingDailyDetailFromUserByCurdateCfg extends GenericCfg{ + + String QUERY_FIND_ALL_DETAILS = "findAllClosingDailyDetailFromUserByCurdateView"; + String QUERY_FIND_ALL_DETAILS_CERTIFIER = "findAllClosingDailyDetailFromUserCertifierByCurdateView"; + + String FIELD_VIEW_USER = "idUser"; + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/constance/CurrentCustomerByLoanViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/CurrentCustomerByLoanViewCfg.java new file mode 100644 index 0000000..0854c43 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/CurrentCustomerByLoanViewCfg.java @@ -0,0 +1,21 @@ +/* + * 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 Carlos Janitzio Zavala Lopez + */ +public interface CurrentCustomerByLoanViewCfg extends GenericCfg { + + String QUERY_FIND_ALL_LOANS_BY_CURRENT_OWNER = "findAllLoansByCurrentOwner"; + + String USER_ID = "userId"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/constance/CustomerWithoutRenovationViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/CustomerWithoutRenovationViewCfg.java new file mode 100644 index 0000000..8373fbb --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/CustomerWithoutRenovationViewCfg.java @@ -0,0 +1,21 @@ +/* + * 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 + */ +public interface CustomerWithoutRenovationViewCfg extends GenericCfg{ + + String QUERY_FIND_ALL_CUSTOMER_WITHOUT_RENOVATION_BY_OFFICE = "findAllCustomerWithOutRenovationByOffice"; + + String FIELD_VIEW_OFFICE = "office"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/constance/EnabledUserDetailsViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/EnabledUserDetailsViewCfg.java new file mode 100644 index 0000000..fb889c8 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/EnabledUserDetailsViewCfg.java @@ -0,0 +1,20 @@ +/* + * 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 Carlos Janitzio Zavala Lopez + */ +public interface EnabledUserDetailsViewCfg extends GenericCfg{ + + String QUERY_FIND_ENABLED_USERS_BY_OFFICE = "findEnabledUsersByOffice"; + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/constance/FeesViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/FeesViewCfg.java new file mode 100644 index 0000000..375ff31 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/FeesViewCfg.java @@ -0,0 +1,24 @@ +/* + * 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 David Rodriguez + */ +public interface FeesViewCfg extends GenericCfg{ + + String QUERY_FIND_ALL_FEES_BETWEEN_DATES = "findAllFeesBetweenDates"; + String QUERY_FIND_ALL_FEES_BETWEEN_DATES_USER = "findAllFeesBetweenDatesUser"; + String QUERY_FIND_ALL_FEES_BETWEEN_DATES_ROUTE = "findAllFeesBetweenDatesRoute"; + + String FIELD_USER = "user"; + String FIELD_ROUTE = "route"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/constance/GeneralBoxViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/GeneralBoxViewCfg.java new file mode 100644 index 0000000..586055f --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/GeneralBoxViewCfg.java @@ -0,0 +1,22 @@ +/* + * 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 + */ +public interface GeneralBoxViewCfg extends GenericCfg{ + + String QUERY_FIND_ALL_DETAILS = "findAllGeneralBoxByOffice"; + + String FIELD_OFFICE = "office"; + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/constance/InformationLoanWeekViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/InformationLoanWeekViewCfg.java new file mode 100644 index 0000000..34acdae --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/InformationLoanWeekViewCfg.java @@ -0,0 +1,36 @@ +/* + * 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 + */ +public interface InformationLoanWeekViewCfg extends GenericCfg{ + + String QUERY_FIND_ALL_LOANS_THIS_WEEK_BY_OFFICE = "findAllLoanInformationThisWeekByOffice"; + String QUERY_FIND_ALL_LOANS_LAST_WEEK_BY_OFFICE = "findAllLoanInformationLastWeekByOffice"; + + String QUERY_FIND_ALL_COLOCATION_WEEK_BY_OFFICE = "findAllColocationThisWeekByOffice"; + String QUERY_FIND_ALL_COLOCATION_LAST_WEEK_BY_OFFICE = "findAllColocationLastWeekByOffice"; + + String QUERY_FIND_ALL_SUBTOTAL_WEEK_BY_OFFICE = "findAllSubtotalThisWeekByOffice"; + String QUERY_FIND_ALL_SUBTOTAL_LAST_WEEK_BY_OFFICE = "findAllSubtotalLastWeekByOffice"; + + String QUERY_FIND_ALL_RESUMEN_IN_OUT_WEEK_BY_OFFICE = "findAllResumenInOutThisWeekByOffice"; + String QUERY_FIND_ALL_RESUMEN_IN_OUT_LAST_WEEK_BY_OFFICE = "findAllResumenInOutLastWeekByOffice"; + + String QUERY_FIND_ALL_COBRANZA_WEEK_BY_OFFICE = "findAllCobranzaThisWeekByOffice"; + String QUERY_FIND_ALL_COBRANZA_LAST_WEEK_BY_OFFICE = "findAllCobranzaLastWeekByOffice"; + + String FIELD_VIEW_OFFICE = "idOffice"; + String FIELD_VIEW_OFFICE_COLOCATION = "office"; + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/constance/LoanByUserPaymentZeroViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/LoanByUserPaymentZeroViewCfg.java new file mode 100644 index 0000000..a59e9cf --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/LoanByUserPaymentZeroViewCfg.java @@ -0,0 +1,22 @@ +/* + * 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 + */ +public interface LoanByUserPaymentZeroViewCfg extends GenericCfg{ + + String QUERY_FIND_ALL_LOANS_PAYMENT_ZERO_BY_USER = "findAllLoansByUserPaymentZero"; + + String FIELD_VIEW_USER = "user"; + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/constance/LoanEmployeeAllDataCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/LoanEmployeeAllDataCfg.java new file mode 100644 index 0000000..4a362b3 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/LoanEmployeeAllDataCfg.java @@ -0,0 +1,22 @@ +/* + * 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 David Rodriguez + */ +public interface LoanEmployeeAllDataCfg extends GenericCfg{ + + String QUERY_FIND_ALL_LOAN_EMPLOYEE_BY_ID = "findAllLoanEmployeeById"; + String QUERY_UPDATE_LOAN_EMPLOYEE_BY_STATUS = "updateLoanEmployeeByStatus"; + String FIELD_ID_LOAN = "idLoanEmployee"; + String FIELD_ACTIVE_STATUS = "loanEmployeeStatus"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/constance/LoanEmployeeDetailAllDataViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/LoanEmployeeDetailAllDataViewCfg.java new file mode 100644 index 0000000..6188d18 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/LoanEmployeeDetailAllDataViewCfg.java @@ -0,0 +1,29 @@ +/* + * 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 David Rodriguez + */ +public interface LoanEmployeeDetailAllDataViewCfg extends GenericCfg{ + + String QUERY_FIND_ALL_LOAN_EMPLOYEE_DETAIL_BY_ID_LOAN = "findAllLoanEmployeeDetailByIdLoan"; + String QUERY_UPDATE_LOAN_EMPLOYEE_DETAIL_BY_STATUS = "updateLoanEmployeeDetailByStatus"; + String QUERY_FIND_LOAN_DETAL_TO_UPDATE = "findLoanDetailToUpdate"; + String FIELD_ID_LOAN = "idLoanEmployee"; + String FIELD_ACTIVE_STATUS = "loanEmployeeDetailStatus"; + + //LoanDetail Delete + + String FIELD_ID_USER = "idUser"; + String FIELD_CREATED_ON = "createdOn"; + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/constance/LoanEmployeeViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/LoanEmployeeViewCfg.java new file mode 100644 index 0000000..f2eabd5 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/LoanEmployeeViewCfg.java @@ -0,0 +1,22 @@ +/* + * 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 David Rodriguez + */ +public interface LoanEmployeeViewCfg extends GenericCfg{ + + String QUERY_FIND_ALL_LOAN_EMPLOYEE_HIST = "findAllLoanEmployeeHist"; + String QUERY_FIND_ALL_LOAN_EMPLOYEE_BY_ID = "findAllLoanEmployeeByIdEmp"; + + String FIEL_LOAN_EMPLOYEE_USERID = "idUser"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/constance/LoanInPendingStatusToDeliveryViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/LoanInPendingStatusToDeliveryViewCfg.java new file mode 100644 index 0000000..dd877d9 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/LoanInPendingStatusToDeliveryViewCfg.java @@ -0,0 +1,17 @@ +/* + * 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; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface LoanInPendingStatusToDeliveryViewCfg { + + String QUERY_FIND_ALL_LOAN_IN_PENDING_STATUS_TO_DELIVERY_VIEW = "findAllLoanInPendingStatusToDeliveryView"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/constance/LoanRenovationDeliveryWeeklyViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/LoanRenovationDeliveryWeeklyViewCfg.java new file mode 100644 index 0000000..1aa07bd --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/LoanRenovationDeliveryWeeklyViewCfg.java @@ -0,0 +1,21 @@ +/* + * 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; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface LoanRenovationDeliveryWeeklyViewCfg { + + String QUERY_FIND_LOAN_RENOVATION_DELIVERY_WEEKLY = "findAllLoanRenovationDeliveryWeekly"; + String QUERY_FIND_LOAN_RENOVATION_TOTAL_RENOVATION = "findAllLoanRenovationDeliveryWeeklyTotalRenovable"; + String QUERY_FIND_LOAN_RENOVATION_TOTAL_RENOVATION_AMOUNT = "findAllLoanRenovationDeliveryWeeklyTotalRenovableAmount"; + + String FIELD_RENOVATION= "renovation"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/constance/MoneyDailyByUserCertifierViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/MoneyDailyByUserCertifierViewCfg.java new file mode 100644 index 0000000..9529fcf --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/MoneyDailyByUserCertifierViewCfg.java @@ -0,0 +1,22 @@ +/* + * 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 + */ +public interface MoneyDailyByUserCertifierViewCfg extends GenericCfg{ + + String QUERY_FIND_ALL_MONEY_DAILY_BY_CERTIFIER_BY_OFFICE = "findAllAmountByUserCertifierView"; + + String FIELD_VIEW_OFFICE = "idOffice"; + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/constance/ResumenNewCustomerLastWeekViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/ResumenNewCustomerLastWeekViewCfg.java new file mode 100644 index 0000000..b928c29 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/ResumenNewCustomerLastWeekViewCfg.java @@ -0,0 +1,22 @@ +/* + * 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 David RodrĆ­guez Huaracha + */ +public interface ResumenNewCustomerLastWeekViewCfg extends GenericCfg{ + + String QUERY_FIND_ALL_RESUMEN_NEW_CUSTOMER = "findAllResumenNewCustomerLastWeek"; + + String FIELD_VIEW_OFFICE = "idOffice"; + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/constance/ResumenNewCustomerWeekViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/ResumenNewCustomerWeekViewCfg.java new file mode 100644 index 0000000..78e96b0 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/ResumenNewCustomerWeekViewCfg.java @@ -0,0 +1,22 @@ +/* + * 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 David RodrĆ­guez Huaracha + */ +public interface ResumenNewCustomerWeekViewCfg extends GenericCfg{ + + String QUERY_FIND_ALL_RESUMEN_NEW_CUSTOMER = "findAllResumenNewCustomerWeek"; + + String FIELD_VIEW_OFFICE = "idOffice"; + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/constance/ResumenTotalLastWeekViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/ResumenTotalLastWeekViewCfg.java new file mode 100644 index 0000000..e531688 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/ResumenTotalLastWeekViewCfg.java @@ -0,0 +1,22 @@ +/* + * 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 + */ +public interface ResumenTotalLastWeekViewCfg extends GenericCfg{ + + String QUERY_FIND_ALL_RESUMEN_TOTAL = "findAllResumenTotalLastWeek"; + + String FIELD_VIEW_OFFICE = "idOffice"; + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/constance/ResumenTotalWeekViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/ResumenTotalWeekViewCfg.java new file mode 100644 index 0000000..91bd882 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/ResumenTotalWeekViewCfg.java @@ -0,0 +1,22 @@ +/* + * 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 + */ +public interface ResumenTotalWeekViewCfg extends GenericCfg{ + + String QUERY_FIND_ALL_RESUMEN_TOTAL = "findAllResumenTotalWeek"; + + String FIELD_VIEW_OFFICE = "idOffice"; + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/constance/StatsAdvancesViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/StatsAdvancesViewCfg.java new file mode 100644 index 0000000..9b25416 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/StatsAdvancesViewCfg.java @@ -0,0 +1,22 @@ +/* + * 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 David Rodriguez + */ +public interface StatsAdvancesViewCfg extends GenericCfg{ + + String QUERY_FIND_ALL_ADVANCES_BETWEEN_DATES = "findAllAdvancesBetweenDates"; + String QUERY_FIND_ALL_ADVANCES_BETWEEN_DATES_ROUTE = "findAllAdvancesBetweenDatesRoute"; + + String FIELD_ROUTE = "route"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/constance/StatsClosingDayViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/StatsClosingDayViewCfg.java new file mode 100644 index 0000000..4fa52ed --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/StatsClosingDayViewCfg.java @@ -0,0 +1,22 @@ +/* + * 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 David Rodriguez + */ +public interface StatsClosingDayViewCfg extends GenericCfg{ + + String QUERY_FIND_ALL_CLOSING_DAY_BETWEEN_DATES = "findAllClosingDayBetweenDates"; + String QUERY_FIND_ALL_CLOSING_DAY_BETWEEN_DATES_USER = "findAllClosingDayBetweenDatesUser"; + + String FIELD_USER = "user"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/constance/StatsDepositsViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/StatsDepositsViewCfg.java new file mode 100644 index 0000000..a5a2deb --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/StatsDepositsViewCfg.java @@ -0,0 +1,21 @@ +/* + * 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 David Rodriguez + */ +public interface StatsDepositsViewCfg extends GenericCfg{ + + String QUERY_FIND_ALL_DEPOSITS_BETWEEN_DATES = "findAllDepositsBetweenDates"; + String QUERY_FIND_ALL_DEPOSITS_BETWEEN_DATES_USER = "findAllDepositsBetweenDatesUser"; + String FIELD_USER = "user"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/constance/StatsEmployeeSavingViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/StatsEmployeeSavingViewCfg.java new file mode 100644 index 0000000..bce608f --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/StatsEmployeeSavingViewCfg.java @@ -0,0 +1,22 @@ +/* + * 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 David Rodriguez + */ +public interface StatsEmployeeSavingViewCfg extends GenericCfg{ + + String QUERY_FIND_ALL_EMPLOYEE_SAVING_BETWEEN_DATES = "findAllEmployeeSavingBetweenDates"; + String QUERY_FIND_ALL_EMPLOYEE_SAVING_BY_ID_BETWEEN_DATES = "findAllEmployeeSavingByIdBetweenDates"; + + String USER_ID = "idUser"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/constance/StatsGasolineViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/StatsGasolineViewCfg.java new file mode 100644 index 0000000..1c79834 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/StatsGasolineViewCfg.java @@ -0,0 +1,19 @@ +/* + * 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 David Rodriguez + */ +public interface StatsGasolineViewCfg extends GenericCfg{ + + String QUERY_FIND_ALL_GASOLINE_BETWEEN_DATES = "findAllGasolineBetweenDates"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/constance/StatsOpeningFeesViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/StatsOpeningFeesViewCfg.java new file mode 100644 index 0000000..5f3287a --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/StatsOpeningFeesViewCfg.java @@ -0,0 +1,21 @@ +/* + * 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 David Rodriguez + */ +public interface StatsOpeningFeesViewCfg extends GenericCfg{ + + String QUERY_FIND_ALL_OPENING_FEES_BETWEEN_DATES = "findAllOpeningFeesBetweenDates"; + String QUERY_FIND_ALL_OPENING_FEES_BETWEEN_DATES_USER = "findAllOpeningFeesBetweenDatesUser"; + String FIELD_USER = "user"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/constance/StatsPaymentRenovationViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/StatsPaymentRenovationViewCfg.java new file mode 100644 index 0000000..2974203 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/StatsPaymentRenovationViewCfg.java @@ -0,0 +1,21 @@ +/* + * 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 David Rodriguez + */ +public interface StatsPaymentRenovationViewCfg extends GenericCfg{ + + String QUERY_FIND_ALL_PAYMENT_RENOVATION_BETWEEN_DATES = "findAllPaymentRenovationBetweenDates"; + String QUERY_FIND_ALL_PAYMENT_RENOVATION_BETWEEN_DATES_USER = "findAllPaymentRenovationBetweenDatesUser"; + String FIELD_USER = "user"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/constance/StatsPaymentRouteViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/StatsPaymentRouteViewCfg.java new file mode 100644 index 0000000..b0b0c73 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/StatsPaymentRouteViewCfg.java @@ -0,0 +1,22 @@ +/* + * 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 David Rodriguez + */ +public interface StatsPaymentRouteViewCfg extends GenericCfg{ + + String QUERY_FIND_ALL_PAYMENT_ROUTE_BETWEEN_DATES = "findAllPaymentRouteBetweenDates"; + String QUERY_FIND_ALL_PAYMENT_ROUTE_BETWEEN_DATES_ROUTE = "findAllPaymentRouteBetweenDatesRoute"; + + String FIELD_ROUTE = "route"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/constance/StatsPaymentViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/StatsPaymentViewCfg.java new file mode 100644 index 0000000..484fb7a --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/StatsPaymentViewCfg.java @@ -0,0 +1,22 @@ +/* + * 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 David Rodriguez + */ +public interface StatsPaymentViewCfg extends GenericCfg{ + + String QUERY_FIND_ALL_PAYMENT_BETWEEN_DATES = "findAllPaymentBetweenDates"; + String QUERY_FIND_ALL_PAYMENT_BETWEEN_DATES_USER = "findAllPaymentBetweenDatesUser"; + + String FIELD_USER = "user"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/constance/StatsPayrollViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/StatsPayrollViewCfg.java new file mode 100644 index 0000000..125a917 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/StatsPayrollViewCfg.java @@ -0,0 +1,22 @@ +/* + * 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 David Rodriguez + */ +public interface StatsPayrollViewCfg extends GenericCfg{ + + String QUERY_FIND_ALL_PAYROLL_BETWEEN_DATES = "findAllPayrollBetweenDates"; + String QUERY_FIND_ALL_PAYROLL_BETWEEN_DATES_USER = "findAllPayrollBetweenDatesUser"; + + String FIELD_USER = "user"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/constance/StatsVehicleCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/StatsVehicleCfg.java new file mode 100644 index 0000000..34fa452 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/StatsVehicleCfg.java @@ -0,0 +1,19 @@ +/* + * 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 David Rodriguez + */ +public interface StatsVehicleCfg extends GenericCfg{ + + String QUERY_FIND_ALL_VEHICLES = "findAllVehicles"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/constance/StatsZeroPaymentsViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/StatsZeroPaymentsViewCfg.java new file mode 100644 index 0000000..cae2d8f --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/StatsZeroPaymentsViewCfg.java @@ -0,0 +1,21 @@ +/* + * 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 David Rodriguez + */ +public interface StatsZeroPaymentsViewCfg extends GenericCfg{ + + String QUERY_FIND_ALL_ZERO_PAYMENTS_BETWEEN_DATES = "findAllZeroPaymentsBetweenDates"; + String QUERY_FIND_ALL_ZERO_PAYMENTS_BETWEEN_DATES_USER = "findAllZeroPaymentsBetweenDatesUser"; + String FIELD_USER = "user"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/constance/TotalLoansApprovedByOfficeViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/TotalLoansApprovedByOfficeViewCfg.java new file mode 100644 index 0000000..98cdfc2 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/TotalLoansApprovedByOfficeViewCfg.java @@ -0,0 +1,22 @@ +/* + * 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 + */ +public interface TotalLoansApprovedByOfficeViewCfg extends GenericCfg{ + + String QUERY_SUM_ALL_LOANS_BY_OFFICE = "sumLoansApprovedByOffice"; + + String FIELD_VIEW_OFFICE = "idOffice"; + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/constance/TotalLoansByOfficeViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/TotalLoansByOfficeViewCfg.java new file mode 100644 index 0000000..02de056 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/TotalLoansByOfficeViewCfg.java @@ -0,0 +1,25 @@ +/* + * 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 + */ +public interface TotalLoansByOfficeViewCfg extends GenericCfg{ + + String QUERY_FIND_ALL_LOANS_BY_OFFICE = "findAllLoansByOfficeView"; + String QUERY_FIND_ALL_LOANS_BY_USER = "findAllLoansByUserIdSumPaymentDaily"; + String QUERY_COUNT_ALL_LOANS_BY_USER = "countAllLoansByUserIdDaily"; + + String FIELD_VIEW_OFFICE = "idOffice"; + String FIELD_VIEW_USER = "userId"; + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/views/constance/TransferInPendingStatusViewCfg.java b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/TransferInPendingStatusViewCfg.java new file mode 100644 index 0000000..a8049c2 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/views/constance/TransferInPendingStatusViewCfg.java @@ -0,0 +1,17 @@ +/* + * 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; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public interface TransferInPendingStatusViewCfg { + + String QUERY_FIND_ALL_TRANSFER_IN_PENDING_STATUS = "findAllTransferInPendingStatus"; +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/AmountJaxb.java b/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/AmountJaxb.java new file mode 100644 index 0000000..4b9ab4a --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/AmountJaxb.java @@ -0,0 +1,54 @@ +/* + * 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.ws.parsed; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@XmlRootElement(name = "amount") +public class AmountJaxb { + + private String customerName; + private Double payment; + + public AmountJaxb() { + } + + public AmountJaxb(String customerName, Double payment) { + this.customerName = customerName; + this.payment = payment; + } + + @XmlElement(name = "customerName") + public String getCustomerName() { + return customerName; + } + + public void setCustomerName(String customerName) { + this.customerName = customerName; + } + + @XmlElement(name = "payment") + public Double getPayment() { + return payment; + } + + public void setPayment(Double payment) { + this.payment = payment; + } + + @Override + public String toString() { + return "AmountJaxb{" + "customerName=" + customerName + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/CashRegisterJaxb.java b/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/CashRegisterJaxb.java new file mode 100644 index 0000000..5edeec9 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/CashRegisterJaxb.java @@ -0,0 +1,55 @@ +/* + * 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.ws.parsed; + +import java.util.List; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@XmlRootElement(name = "cashRegister") +public class CashRegisterJaxb { + + private Double totalCash; + private List amounts; + + public CashRegisterJaxb() { + } + + public CashRegisterJaxb(Double totalCash, List amounts) { + this.totalCash = totalCash; + this.amounts = amounts; + } + + @XmlElement(name = "totalCash") + public Double getTotalCash() { + return totalCash; + } + + public void setTotalCash(Double totalCash) { + this.totalCash = totalCash; + } + + @XmlElement(name = "amounts") + public List getAmounts() { + return amounts; + } + + public void setAmounts(List amounts) { + this.amounts = amounts; + } + + @Override + public String toString() { + return "CashRegisterJaxb{" + "amounts=" + amounts + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/ConfigurationJaxb.java b/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/ConfigurationJaxb.java new file mode 100644 index 0000000..00101d5 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/ConfigurationJaxb.java @@ -0,0 +1,39 @@ +/* + * 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.ws.parsed; + +import java.io.Serializable; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@XmlRootElement(name = "configuration") +public class ConfigurationJaxb implements Serializable { + + private static final long serialVersionUID = -9152601421411768287L; + + private boolean activeButton; + + public ConfigurationJaxb() { + } + + public ConfigurationJaxb(boolean activeButton) { + this.activeButton = activeButton; + } + + public boolean isActiveButton() { + return activeButton; + } + + public void setActiveButton(boolean activeButton) { + this.activeButton = activeButton; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/Exchange.java b/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/Exchange.java new file mode 100644 index 0000000..02c578f --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/Exchange.java @@ -0,0 +1,65 @@ +/* + * 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.ws.parsed; + +import java.math.BigDecimal; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class Exchange { + + private String id; + private boolean owner; + private BigDecimal amount; + private String action; + + public Exchange() { + } + + public Exchange(String id, boolean owner, BigDecimal amount, String action) { + this.id = id; + this.owner = owner; + this.amount = amount; + this.action = action; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public boolean isOwner() { + return owner; + } + + public void setOwner(boolean owner) { + this.owner = owner; + } + + public BigDecimal getAmount() { + return amount; + } + + public void setAmount(BigDecimal amount) { + this.amount = amount; + } + + public String getAction() { + return action; + } + + public void setAction(String action) { + this.action = action; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/ExchangeJaxb.java b/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/ExchangeJaxb.java new file mode 100644 index 0000000..a430a14 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/ExchangeJaxb.java @@ -0,0 +1,65 @@ +/* + * 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.ws.parsed; + +import java.math.BigDecimal; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@XmlRootElement(name = "exchange") +public class ExchangeJaxb { + + private String senderId; + private String receiverId; + private String officeId; + private BigDecimal amount; + + public ExchangeJaxb() { + } + + @XmlElement(name = "senderId") + public String getSenderId() { + return senderId; + } + + public void setSenderId(String senderId) { + this.senderId = senderId; + } + + @XmlElement(name = "receiverId") + public String getReceiverId() { + return receiverId; + } + + public void setReceiverId(String receiverId) { + this.receiverId = receiverId; + } + + @XmlElement(name = "officeId") + public String getOfficeId() { + return officeId; + } + + public void setOfficeId(String officeId) { + this.officeId = officeId; + } + + @XmlElement(name = "amount") + public BigDecimal getAmount() { + return amount; + } + + public void setAmount(BigDecimal amount) { + this.amount = amount; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/FeeToPayRequestJaxb.java b/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/FeeToPayRequestJaxb.java new file mode 100644 index 0000000..eb77471 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/FeeToPayRequestJaxb.java @@ -0,0 +1,44 @@ +/* + * 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.ws.parsed; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@XmlRootElement(name = "feeToPay") +public class FeeToPayRequestJaxb { + + String id; + String strDateToPay; + + public FeeToPayRequestJaxb() { + } + + @XmlElement(name = "id") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + @XmlElement(name = "strDateToPay") + public String getStrDateToPay() { + return strDateToPay; + } + + public void setStrDateToPay(String strDateToPay) { + this.strDateToPay = strDateToPay; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/FeesToPayByLoanRequestJaxb.java b/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/FeesToPayByLoanRequestJaxb.java new file mode 100644 index 0000000..f72070f --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/FeesToPayByLoanRequestJaxb.java @@ -0,0 +1,55 @@ +/* + * 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.ws.parsed; + +import java.util.List; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@XmlRootElement(name = "feesToPayByLoan") +public class FeesToPayByLoanRequestJaxb { + + String idLoan; + String idUser; + List feeToPayList; + + public FeesToPayByLoanRequestJaxb() { + } + + @XmlElement(name = "idLoan") + public String getIdLoan() { + return idLoan; + } + + public void setIdLoan(String idLoan) { + this.idLoan = idLoan; + } + + @XmlElement(name = "idUser") + public String getIdUser() { + return idUser; + } + + public void setIdUser(String idUser) { + this.idUser = idUser; + } + + @XmlElement(name = "feeToPayList") + public List getFeeToPayList() { + return feeToPayList; + } + + public void setFeeToPayList(List feeToPayList) { + this.feeToPayList = feeToPayList; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/LoanDetailJaxb.java b/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/LoanDetailJaxb.java new file mode 100644 index 0000000..1743a64 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/LoanDetailJaxb.java @@ -0,0 +1,122 @@ +/* + * 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.ws.parsed; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@XmlRootElement(name = "loanDetail") +public class LoanDetailJaxb { + + private String paymentDate; + private double paymentOfDay; + private double toPay; + private boolean payment; + private String comment; + private String paymentType; + + public LoanDetailJaxb() { + } + + /** + * Created for add transfer accoutn payments. + * + * @param paymentDate + * @param paymentOfDay + * @param toPay + * @param comment + * @param paymentType + */ + public LoanDetailJaxb(String paymentDate, double paymentOfDay, double toPay, String comment, String paymentType) { + this.paymentDate = paymentDate; + this.paymentOfDay = paymentOfDay; + this.toPay = toPay; + this.comment = comment; + this.paymentType = paymentType; + } + + /** + * + * @param paymentDate + * @param paymentOfDay + * @param toPay + * @param payment true eq payment, false eq fee. + * @param comment + */ + public LoanDetailJaxb(String paymentDate, double paymentOfDay, double toPay, boolean payment, String comment) { + this.paymentDate = paymentDate; + this.paymentOfDay = paymentOfDay; + this.toPay = toPay; + this.payment = payment; + this.comment = comment; + } + + @XmlElement(name = "paymentDate") + public String getPaymentDate() { + return paymentDate; + } + + public void setPaymentDate(String paymentDate) { + this.paymentDate = paymentDate; + } + + @XmlElement(name = "paymentOfDay") + public double getPaymentOfDay() { + return paymentOfDay; + } + + public void setPaymentOfDay(double paymentOfDay) { + this.paymentOfDay = paymentOfDay; + } + + @XmlElement(name = "toPay") + public double getToPay() { + return toPay; + } + + public void setToPay(double toPay) { + this.toPay = toPay; + } + + @XmlElement(name = "payment") + public boolean isPayment() { + return payment; + } + + public void setPayment(boolean payment) { + this.payment = payment; + } + + @XmlElement(name = "comment") + public String getComment() { + return comment; + } + + public void setComment(String comment) { + this.comment = comment; + } + + @XmlElement(name = "paymentType") + public String getPaymentType() { + return paymentType; + } + + public void setPaymentType(String paymentType) { + this.paymentType = paymentType; + } + + @Override + public String toString() { + return "LoanDetailJaxb{" + "paymentDate=" + paymentDate + ", paymentOfDay=" + paymentOfDay + ", toPay=" + toPay + ", payment=" + payment + '}'; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/LoanJaxb.java b/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/LoanJaxb.java new file mode 100644 index 0000000..36dfdc9 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/LoanJaxb.java @@ -0,0 +1,44 @@ +/* + * 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.ws.parsed; + +import java.util.List; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@XmlRootElement(name = "loan") +public class LoanJaxb { + + private List loanDetails; + + public LoanJaxb() { + } + + public LoanJaxb(List loanDetails) { + this.loanDetails = loanDetails; + } + + @XmlElement(name = "loanDetails") + public List getLoanDetails() { + return loanDetails; + } + + public void setLoanDetails(List loanDetails) { + this.loanDetails = loanDetails; + } + + @Override + public String toString() { + return "LoanJaxb{" + "loanDetails=" + loanDetails + '}'; + } +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/LoanRequestedJaxb.java b/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/LoanRequestedJaxb.java new file mode 100644 index 0000000..0baa5f9 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/LoanRequestedJaxb.java @@ -0,0 +1,112 @@ +/* + * 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.ws.parsed; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@XmlRootElement(name = "loanRequested") +public class LoanRequestedJaxb { + + private String loanTypeId; + private String officeId; + private String userId; + private String routeId; + private PersonJaxb customer; + private PersonJaxb endorsement; + private String strDate; + private String routeIdNewClient; + + public LoanRequestedJaxb() { + } + + @XmlElement(name = "loanTypeId") + public String getLoanTypeId() { + return loanTypeId; + } + + public void setLoanTypeId(String loanTypeId) { + this.loanTypeId = loanTypeId; + } + + @XmlElement(name = "officeId") + public String getOfficeId() { + return officeId; + } + + public void setOfficeId(String officeId) { + this.officeId = officeId; + } + + @XmlElement(name = "userId") + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + @XmlElement(name = "routeId") + public String getRouteId() { + return routeId; + } + + public void setRouteId(String routeId) { + this.routeId = routeId; + } + + @XmlElement(name = "customer") + public PersonJaxb getCustomer() { + return customer; + } + + public void setCustomer(PersonJaxb customer) { + this.customer = customer; + } + + @XmlElement(name = "endorsement") + public PersonJaxb getEndorsement() { + return endorsement; + } + + public void setEndorsement(PersonJaxb endorsement) { + this.endorsement = endorsement; + } + + @XmlElement(name = "strDate") + public String getStrDate() { + return strDate; + } + + public void setStrDate(String strDate) { + this.strDate = strDate; + } + + @XmlElement(name = "routeIdNewClient") + public String getRouteIdNewClient() { + return routeIdNewClient; + } + + public String chooseRouteId() { + try { + return null == getRouteIdNewClient() || "".equals(getRouteIdNewClient()) ? getRouteId() : getRouteIdNewClient(); + } catch (Exception e) { + return getRouteId(); + } + } + + public void setRouteIdNewClient(String routeIdNewClient) { + this.routeIdNewClient = routeIdNewClient; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/NewAmountJaxb.java b/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/NewAmountJaxb.java new file mode 100644 index 0000000..6b0b013 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/NewAmountJaxb.java @@ -0,0 +1,118 @@ +/* + * 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.ws.parsed; + +import java.math.BigDecimal; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@XmlRootElement(name = "newAmount") +public class NewAmountJaxb { + + private String loanId; + private String userId; + private String officeId; + private boolean customer; + private BigDecimal amount; + private String strDate; + private boolean fee; + private String comments; + private Boolean manager; + + public NewAmountJaxb() { + } + + @XmlAttribute(name = "loanId") + public String getLoanId() { + return loanId; + } + + public void setLoanId(String loanId) { + this.loanId = loanId; + } + + @XmlAttribute(name = "userId") + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + @XmlAttribute(name = "officeId") + public String getOfficeId() { + return officeId; + } + + public void setOfficeId(String officeId) { + this.officeId = officeId; + } + + @XmlAttribute(name = "customer") + public boolean isCustomer() { + return customer; + } + + public void setCustomer(boolean customer) { + this.customer = customer; + } + + @XmlAttribute(name = "amount") + public BigDecimal getAmount() { + return amount; + } + + public void setAmount(BigDecimal amount) { + this.amount = amount; + } + + @XmlAttribute(name = "strDate") + public String getStrDate() { + return strDate; + } + + public void setStrDate(String strDate) { + this.strDate = strDate; + } + + @XmlAttribute(name = "fee") + public boolean isFee() { + return fee; + } + + public void setFee(boolean fee) { + this.fee = fee; + } + + @XmlAttribute(name = "comments") + public String getComments() { + return comments; + } + + public void setComments(String comments) { + this.comments = comments; + } + + @XmlAttribute(name = "manager") + public Boolean getManager() { + if (null == manager) { + manager = false; + } + return manager; + } + + public void setManager(Boolean manager) { + this.manager = manager; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/NewTransferAccountJaxb.java b/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/NewTransferAccountJaxb.java new file mode 100644 index 0000000..a765d16 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/NewTransferAccountJaxb.java @@ -0,0 +1,98 @@ +/* + * 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.ws.parsed; + +import java.math.BigDecimal; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@XmlRootElement(name = "newTransferAccount") +public class NewTransferAccountJaxb { + + private String loanId; + private String userId; + private String officeId; + private BigDecimal amount; + private String comments; + private String transferReference; + private Boolean manager; + + public NewTransferAccountJaxb() { + } + + @XmlAttribute(name = "loanId") + public String getLoanId() { + return loanId; + } + + public void setLoanId(String loanId) { + this.loanId = loanId; + } + + @XmlAttribute(name = "userId") + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + @XmlAttribute(name = "officeId") + public String getOfficeId() { + return officeId; + } + + public void setOfficeId(String officeId) { + this.officeId = officeId; + } + + @XmlAttribute(name = "amount") + public BigDecimal getAmount() { + return amount; + } + + public void setAmount(BigDecimal amount) { + this.amount = amount; + } + + @XmlAttribute(name = "comments") + public String getComments() { + return comments; + } + + public void setComments(String comments) { + this.comments = comments; + } + + @XmlAttribute(name = "transferReference") + public String getTransferReference() { + return transferReference; + } + + public void setTransferReference(String transferReference) { + this.transferReference = transferReference; + } + + @XmlAttribute(name = "manager") + public Boolean getManager() { + if (null == manager) { + manager = false; + } + return manager; + } + + public void setManager(Boolean manager) { + this.manager = manager; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/PersonJaxb.java b/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/PersonJaxb.java new file mode 100644 index 0000000..679ce08 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/PersonJaxb.java @@ -0,0 +1,144 @@ +/* + * 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.ws.parsed; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@XmlRootElement(name = "person") +public class PersonJaxb { + + private String id; + private String firstName; + private String secondName; + private String lastName; + private String middleName; + private String addressHome; + private String addressWork; + private String phoneHome; + private String phoneWork; + private String thumbnail; + private String companyName; + private boolean createPerson; + + public PersonJaxb() { + } + + @XmlElement(name = "id") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + @XmlElement(name = "firstName") + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + @XmlElement(name = "secondName") + public String getSecondName() { + return secondName; + } + + public void setSecondName(String secondName) { + this.secondName = secondName; + } + + @XmlElement(name = "lastName") + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + @XmlElement(name = "middleName") + public String getMiddleName() { + return middleName; + } + + public void setMiddleName(String middleName) { + this.middleName = middleName; + } + + @XmlElement(name = "addressHome") + public String getAddressHome() { + return addressHome; + } + + public void setAddressHome(String addressHome) { + this.addressHome = addressHome; + } + + @XmlElement(name = "addressWork") + public String getAddressWork() { + return addressWork; + } + + public void setAddressWork(String addressWork) { + this.addressWork = addressWork; + } + + @XmlElement(name = "phoneHome") + public String getPhoneHome() { + return phoneHome; + } + + public void setPhoneHome(String phoneHome) { + this.phoneHome = phoneHome; + } + + @XmlElement(name = "phoneWork") + public String getPhoneWork() { + return phoneWork; + } + + public void setPhoneWork(String phoneWork) { + this.phoneWork = phoneWork; + } + + @XmlElement(name = "thumbnail") + public String getThumbnail() { + return thumbnail; + } + + public void setThumbnail(String thumbnail) { + this.thumbnail = thumbnail; + } + + @XmlElement(name = "companyName") + public String getCompanyName() { + return companyName; + } + + public void setCompanyName(String companyName) { + this.companyName = companyName; + } + + @XmlElement(name = "createPerson") + public boolean isCreatePerson() { + return createPerson; + } + + public void setCreatePerson(boolean createPerson) { + this.createPerson = createPerson; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/RenovationWithEndorsementJaxb.java b/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/RenovationWithEndorsementJaxb.java new file mode 100644 index 0000000..8be9909 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/RenovationWithEndorsementJaxb.java @@ -0,0 +1,104 @@ +/* + * 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.ws.parsed; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@XmlRootElement(name = "renovationWithEndorsement") +public class RenovationWithEndorsementJaxb { + + private String loan; + private String credit; + private String user; + private String office; + private double amount; + private String currentOwner; + private PersonJaxb endorsement; + private boolean hasPaymentToday; + + public RenovationWithEndorsementJaxb() { + } + + @XmlElement(name = "loan") + public String getLoan() { + return loan; + } + + public void setLoan(String loan) { + this.loan = loan; + } + + @XmlElement(name = "credit") + public String getCredit() { + return credit; + } + + public void setCredit(String credit) { + this.credit = credit; + } + + @XmlElement(name = "user") + public String getUser() { + return user; + } + + public void setUser(String user) { + this.user = user; + } + + @XmlElement(name = "office") + public String getOffice() { + return office; + } + + public void setOffice(String office) { + this.office = office; + } + + @XmlElement(name = "amount") + public double getAmount() { + return amount; + } + + public void setAmount(double amount) { + this.amount = amount; + } + + @XmlElement(name = "currentOwner") + public String getCurrentOwner() { + return currentOwner; + } + + public void setCurrentOwner(String currentOwner) { + this.currentOwner = currentOwner; + } + + @XmlElement(name = "endorsement") + public PersonJaxb getEndorsement() { + return endorsement; + } + + public void setEndorsement(PersonJaxb endorsement) { + this.endorsement = endorsement; + } + + @XmlElement(name = "hasPaymentToday") + public boolean isHasPaymentToday() { + return hasPaymentToday; + } + + public void setHasPaymentToday(boolean hasPaymentToday) { + this.hasPaymentToday = hasPaymentToday; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/ThumbnailJaxb.java b/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/ThumbnailJaxb.java new file mode 100644 index 0000000..fc29062 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/model/ws/parsed/ThumbnailJaxb.java @@ -0,0 +1,48 @@ +/* + * 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.ws.parsed; + +import java.io.InputStream; +import java.io.Serializable; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@XmlRootElement(name = "thumbnail") +public class ThumbnailJaxb implements Serializable { + + private static final long serialVersionUID = -2300144785732796661L; + + private String name; + private InputStream file; + + public ThumbnailJaxb() { + } + + @XmlElement(name = "name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @XmlElement(name = "file") + public InputStream getFile() { + return file; + } + + public void setFile(InputStream file) { + this.file = file; + } + +} diff --git a/ace-model/src/main/java/com/arrebol/apc/test/ArrebolTest.java b/ace-model/src/main/java/com/arrebol/apc/test/ArrebolTest.java new file mode 100644 index 0000000..dd64d12 --- /dev/null +++ b/ace-model/src/main/java/com/arrebol/apc/test/ArrebolTest.java @@ -0,0 +1,82 @@ +/* + * 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.test; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import org.hibernate.annotations.GenericGenerator; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Entity +@Table(name = "ARREBOL_TEST") +public class ArrebolTest implements Serializable { + + private static final long serialVersionUID = -4942816498584779625L; + + @Id + @GeneratedValue(generator = "uuid") + @GenericGenerator(name = "uuid", strategy = "uuid2") + @Column(name = "id", length = 36) + private String id; + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "created_on", length = 19) + private Date createdOn; + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "last_updated_on", length = 19) + private Date lastUpdatedOn; + + public ArrebolTest() { + } + + public ArrebolTest(Date createdOn, Date lastUpdatedOn) { + this.createdOn = createdOn; + this.lastUpdatedOn = lastUpdatedOn; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Date getCreatedOn() { + return createdOn; + } + + public void setCreatedOn(Date createdOn) { + this.createdOn = createdOn; + } + + public Date getLastUpdatedOn() { + return lastUpdatedOn; + } + + public void setLastUpdatedOn(Date lastUpdatedOn) { + this.lastUpdatedOn = lastUpdatedOn; + } + + @Override + public String toString() { + return "ArrebolTest{" + "id=" + id + ", createdOn=" + createdOn + ", lastUpdatedOn=" + lastUpdatedOn + '}'; + } + +} diff --git a/ace-model/src/main/resources/apc.cfg.xml b/ace-model/src/main/resources/apc.cfg.xml new file mode 100644 index 0000000..aad54c8 --- /dev/null +++ b/ace-model/src/main/resources/apc.cfg.xml @@ -0,0 +1,230 @@ + + + + + org.hibernate.dialect.MySQLDialect + com.mysql.cj.jdbc.Driver + ${hibernate.connection.url} + ${hibernate.connection.username} + ${hibernate.connection.password} + ${hibernate.connection.min_size} + ${hibernate.connection.max_size} + ${hibernate.connection.timeout} + ${hibernate.connection.max_statements} + 3000 + false + false + true + thread + ${hibernate.connection.noAccessToProcedureBodies} + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/catalog/queries/people.queries.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/catalog/queries/people.queries.hbm.xml new file mode 100644 index 0000000..52cf937 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/catalog/queries/people.queries.hbm.xml @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/catalog/queries/roles.queries.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/catalog/queries/roles.queries.hbm.xml new file mode 100644 index 0000000..7c1fb14 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/catalog/queries/roles.queries.hbm.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/catalog/queries/routes.queries.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/catalog/queries/routes.queries.hbm.xml new file mode 100644 index 0000000..01f6252 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/catalog/queries/routes.queries.hbm.xml @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/admin/advance.queries.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/admin/advance.queries.hbm.xml new file mode 100644 index 0000000..c593942 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/admin/advance.queries.hbm.xml @@ -0,0 +1,41 @@ + + + + + + + + + + = DATE(:startDate) AND + DATE(:endDate) >= DATE(createdOn) + ORDER BY createdOn + ]]> + + + + + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/admin/bitacora.queries.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/admin/bitacora.queries.hbm.xml new file mode 100644 index 0000000..c2bf3e5 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/admin/bitacora.queries.hbm.xml @@ -0,0 +1,28 @@ + + + + + + + + + + = DATE(:startDate) + AND DATE(:endDate) >= DATE(created_on) + ORDER BY createdOn DESC + ]]> + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/admin/bonus.queries.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/admin/bonus.queries.hbm.xml new file mode 100644 index 0000000..c18cce4 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/admin/bonus.queries.hbm.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + = DATE(:startDate) AND + DATE(:endDate) >= DATE(b.createdOn) + ORDER BY b.createdOn + ]]> + + + + + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/admin/closing.day.detail.queries.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/admin/closing.day.detail.queries.hbm.xml new file mode 100644 index 0000000..c4f6ed0 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/admin/closing.day.detail.queries.hbm.xml @@ -0,0 +1,16 @@ + + + + + + + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/admin/closing_day.queries.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/admin/closing_day.queries.hbm.xml new file mode 100644 index 0000000..96cc9ba --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/admin/closing_day.queries.hbm.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/admin/expense.company.queries.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/admin/expense.company.queries.hbm.xml new file mode 100644 index 0000000..418c214 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/admin/expense.company.queries.hbm.xml @@ -0,0 +1,43 @@ + + + + + + + + + + = DATE(:startDate) AND + DATE(:endDate) >= DATE(createdOn) + ORDER BY createdOn DESC + ]]> + + + + + + + \ No newline at end of file diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/admin/goal.queries.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/admin/goal.queries.hbm.xml new file mode 100644 index 0000000..e6a9f5a --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/admin/goal.queries.hbm.xml @@ -0,0 +1,42 @@ + + + + + + + + + + = DATE(:startDate) AND + DATE(:endDate) >= DATE(createdOn) + ORDER BY createdOn + ]]> + + + + + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/admin/money.daily.queries.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/admin/money.daily.queries.hbm.xml new file mode 100644 index 0000000..d080173 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/admin/money.daily.queries.hbm.xml @@ -0,0 +1,43 @@ + + + + + + + + + + = DATE(:startDate) AND + DATE(:endDate) >= DATE(m.createdOn) + ORDER BY m.createdOn DESC + ]]> + + + + = DATE(:startDate) AND + DATE(:endDate) >= DATE(m.createdOn) AND + m.user = :user + ORDER BY m.createdOn DESC + ]]> + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/admin/other.expense.queries.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/admin/other.expense.queries.hbm.xml new file mode 100644 index 0000000..ae3183a --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/admin/other.expense.queries.hbm.xml @@ -0,0 +1,43 @@ + + + + + + + + + + = DATE(:startDate) AND + DATE(:endDate) >= DATE(e.createdOn) + ORDER BY e.createdOn DESC + ]]> + + + + = DATE(:startDate) AND + DATE(:endDate) >= DATE(e.createdOn) AND + user = :user + ORDER BY e.createdOn DESC + ]]> + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/admin/stable.general.box.queries.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/admin/stable.general.box.queries.hbm.xml new file mode 100644 index 0000000..b4aee08 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/admin/stable.general.box.queries.hbm.xml @@ -0,0 +1,92 @@ + + + + + + + + + + = DATE(:startDate) AND + DATE(:endDate) >= DATE(createdOn) AND + active_status = 'ENEBLED' + ORDER BY createdOn DESC + ]]> + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/admin/stable.small.box.queries.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/admin/stable.small.box.queries.hbm.xml new file mode 100644 index 0000000..3552dc6 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/admin/stable.small.box.queries.hbm.xml @@ -0,0 +1,80 @@ + + + + + + + + + + = DATE(:startDate) AND + DATE(:endDate) >= DATE(createdOn) + ORDER BY createdOn DESC + ]]> + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/admin/transfer.queries.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/admin/transfer.queries.hbm.xml new file mode 100644 index 0000000..fe07a98 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/admin/transfer.queries.hbm.xml @@ -0,0 +1,100 @@ + + + + + + + + + + = DATE(:startDate) AND + DATE(:endDate) >= DATE(createdOn) + ORDER BY createdOn + ]]> + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/core/human.resource.queries.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/core/human.resource.queries.hbm.xml new file mode 100644 index 0000000..2dd9a27 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/core/human.resource.queries.hbm.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/core/mobile.user.queries.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/core/mobile.user.queries.hbm.xml new file mode 100644 index 0000000..620a689 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/core/mobile.user.queries.hbm.xml @@ -0,0 +1,17 @@ + + + + + + + + + \ No newline at end of file diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/core/office.queries.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/core/office.queries.hbm.xml new file mode 100644 index 0000000..1e299d7 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/core/office.queries.hbm.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/core/permission.queries.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/core/permission.queries.hbm.xml new file mode 100644 index 0000000..0b4d8c7 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/core/permission.queries.hbm.xml @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/core/user.by.office.has.permission.queries.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/core/user.by.office.has.permission.queries.hbm.xml new file mode 100644 index 0000000..8841c93 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/core/user.by.office.has.permission.queries.hbm.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/core/user.by.office.queries.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/core/user.by.office.queries.hbm.xml new file mode 100644 index 0000000..446e1fa --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/core/user.by.office.queries.hbm.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/core/user.queries.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/core/user.queries.hbm.xml new file mode 100644 index 0000000..bf1475a --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/core/user.queries.hbm.xml @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/loan/delivery.queries.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/loan/delivery.queries.hbm.xml new file mode 100644 index 0000000..5093589 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/loan/delivery.queries.hbm.xml @@ -0,0 +1,6 @@ + + + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/loan/loan.by.renovation.queries.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/loan/loan.by.renovation.queries.hbm.xml new file mode 100644 index 0000000..a47c73a --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/loan/loan.by.renovation.queries.hbm.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/loan/loan.by.user.queries.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/loan/loan.by.user.queries.hbm.xml new file mode 100644 index 0000000..0fbf585 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/loan/loan.by.user.queries.hbm.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/loan/loan.details.queries.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/loan/loan.details.queries.hbm.xml new file mode 100644 index 0000000..8e4ad9d --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/loan/loan.details.queries.hbm.xml @@ -0,0 +1,221 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/loan/loan.employee.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/loan/loan.employee.hbm.xml new file mode 100644 index 0000000..2ecd466 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/loan/loan.employee.hbm.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/loan/loan.fee.notification.queries.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/loan/loan.fee.notification.queries.hbm.xml new file mode 100644 index 0000000..8f7f2d2 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/loan/loan.fee.notification.queries.hbm.xml @@ -0,0 +1,16 @@ + + + + + + + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/loan/loan.queries.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/loan/loan.queries.hbm.xml new file mode 100644 index 0000000..7b85383 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/loan/loan.queries.hbm.xml @@ -0,0 +1,495 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + 30 + AND l.loanStatus = 'APPROVED' + AND (l.amountToPay - l.amountPaid) > 0 + ORDER BY + l.createdOn + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + = DATE(:startDate) AND + DATE(:endDate) >= DATE(l.fecha) + ORDER BY l.fecha + ]]> + + + + = DATE(:startDate) AND + DATE(:endDate) >= DATE(l.fechaJuridico) + ORDER BY l.fecha + ]]> + + + + + + + + + + + + + + + + + + + + = lt.paymentDaily + THEN + lt.paymentDaily + ELSE + (l.amountToPay - l.amountPaid) + END + )AS paymentDaily, + lt.fee AS fee, + (SELECT count(notificationNumber) FROM LoanFeeNotification WHERE loan = l.id) AS notificationNumber, + ( + CASE + WHEN + l.amountPaid >= (SELECT FLOOR(lt.paymentTotal * .6364) FROM LoanType WHERE id = l.loanType) + THEN + CASE + WHEN + (SELECT COUNT(notificationNumber) as total + FROM LoanFeeNotification + WHERE loan = l.id + ) < 4 + THEN 'ENEBLED' + WHEN + (SELECT count(notificationNumber) as total + FROM LoanFeeNotification + WHERE loan = l.id + ) BETWEEN 4 AND 5 + AND + (SELECT COUNT(lt_inner.id) + FROM Loan l_inner + INNER JOIN LoanType lt_inner ON l_inner.loanType = lt_inner.id + WHERE l_inner.id = l.id AND + lt.payment <= lt_inner.payment - 1000) > 0 + THEN 'ENEBLED' + ELSE 'DISABLED' + END + ELSE + 'DISABLED' + END + ) AS renovation, + (SELECT amountToPay - amountPaid FROM Loan WHERE id = l.id) AS maxAmountToPay, + ( + CASE + WHEN + (SELECT COUNT(count_ld.id) FROM LoanDetails count_ld WHERE count_ld.loan = l.id AND DATE(count_ld.createdOn) = CURDATE()) > 0 + THEN + 1 + ELSE + 0 + END + ) AS hasPaymentToday, + l.id AS loanId, + ( + SELECT + inner_lby.user.id + FROM + LoanByUser inner_lby + INNER JOIN + Loan inner_l ON inner_lby.loan = inner_l.id + WHERE + inner_l.loanStatus = 'APPROVED' AND + inner_lby.ownerLoan = 'CURRENT_OWNER' AND + inner_lby.loan = l.id + ) AS currentOwner + FROM + LoanByUser lbu + INNER JOIN Loan l ON lbu.loan = l.id + INNER JOIN LoanType lt ON l.loanType = lt.id + INNER JOIN People cstmr ON l.customer = cstmr.id + INNER JOIN People ndrsmnt ON l.endorsement = ndrsmnt.id + WHERE + l.customer = :customer AND + l.loanStatus = 'APPROVED' AND + 1 = (CASE + WHEN + (SELECT COUNT(case_l.id) AS TOTAL + FROM Loan case_l + INNER JOIN LoanByUser case_lbu ON case_l.id = case_lbu.loan + WHERE + case_l.customer = :customer AND + case_l.loanStatus = 'APPROVED' AND + case_lbu.ownerLoan = 'CURRENT_OWNER' AND + case_lbu.user = :user + + ) = 1 + THEN + 1 + WHEN + l.routeCtlg IN (SELECT case_hrhr.routeCtlg + FROM HumanResourceHasRoute case_hrhr + INNER JOIN User case_u ON case_hrhr.humanResource = case_u.humanResource + WHERE + case_u.id = :id AND + case_u.certifier = 'ENEBLED') + THEN + 1 + ELSE + 0 + END) + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/loan/loan.type.queries.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/loan/loan.type.queries.hbm.xml new file mode 100644 index 0000000..8b96da1 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/loan/loan.type.queries.hbm.xml @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/gasoline/gasoline.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/gasoline/gasoline.hbm.xml new file mode 100644 index 0000000..33242f8 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/gasoline/gasoline.hbm.xml @@ -0,0 +1,23 @@ + + + + + + + + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/preference/user.mobile.preference.queries.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/preference/user.mobile.preference.queries.hbm.xml new file mode 100644 index 0000000..cd593c7 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/preference/user.mobile.preference.queries.hbm.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/reports/user.week.report.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/reports/user.week.report.hbm.xml new file mode 100644 index 0000000..296a849 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/reports/user.week.report.hbm.xml @@ -0,0 +1,20 @@ + + + + + + + + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/available.customers.view.queries.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/available.customers.view.queries.hbm.xml new file mode 100644 index 0000000..9284cb4 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/available.customers.view.queries.hbm.xml @@ -0,0 +1,16 @@ + + + + + + + + + \ No newline at end of file diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/available.endorsements.view.queries.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/available.endorsements.view.queries.hbm.xml new file mode 100644 index 0000000..8a471bf --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/available.endorsements.view.queries.hbm.xml @@ -0,0 +1,16 @@ + + + + + + + + + \ No newline at end of file diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/availables.owners.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/availables.owners.view.hbm.xml new file mode 100644 index 0000000..9e7c932 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/availables.owners.view.hbm.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/cash.register.curdate.by.user.view.queries.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/cash.register.curdate.by.user.view.queries.hbm.xml new file mode 100644 index 0000000..492081d --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/cash.register.curdate.by.user.view.queries.hbm.xml @@ -0,0 +1,16 @@ + + + + + + + + + \ No newline at end of file diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/current.customer.by.loan.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/current.customer.by.loan.view.hbm.xml new file mode 100644 index 0000000..4794c46 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/current.customer.by.loan.view.hbm.xml @@ -0,0 +1,19 @@ + + + + + + + + + \ No newline at end of file diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/exchange.enebled.users.view.queries.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/exchange.enebled.users.view.queries.hbm.xml new file mode 100644 index 0000000..c928e43 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/exchange.enebled.users.view.queries.hbm.xml @@ -0,0 +1,18 @@ + + + + + + + + + \ No newline at end of file diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/loan.approved.detail.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/loan.approved.detail.view.hbm.xml new file mode 100644 index 0000000..8ec52b2 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/loan.approved.detail.view.hbm.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/loan.by.user.order.preference.view.queries.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/loan.by.user.order.preference.view.queries.hbm.xml new file mode 100644 index 0000000..57c4acf --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/loan.by.user.order.preference.view.queries.hbm.xml @@ -0,0 +1,18 @@ + + + + + + + + + + \ No newline at end of file diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/loan.by.user.view.queries.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/loan.by.user.view.queries.hbm.xml new file mode 100644 index 0000000..7846824 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/loan.by.user.view.queries.hbm.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/loan.in.pending.status.to.delivery.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/loan.in.pending.status.to.delivery.view.hbm.xml new file mode 100644 index 0000000..23b43dc --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/loan.in.pending.status.to.delivery.view.hbm.xml @@ -0,0 +1,20 @@ + + + + + + + + + + \ No newline at end of file diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/loan.to.delivery.by.ciertifier.view.queries.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/loan.to.delivery.by.ciertifier.view.queries.hbm.xml new file mode 100644 index 0000000..2a0f54e --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/loan.to.delivery.by.ciertifier.view.queries.hbm.xml @@ -0,0 +1,17 @@ + + + + + + + + + \ No newline at end of file diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/person.search.detail.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/person.search.detail.view.hbm.xml new file mode 100644 index 0000000..5093589 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/person.search.detail.view.hbm.xml @@ -0,0 +1,6 @@ + + + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/person.search.historical.details.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/person.search.historical.details.view.hbm.xml new file mode 100644 index 0000000..4fe154a --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/person.search.historical.details.view.hbm.xml @@ -0,0 +1,16 @@ + + + + + + + + + \ No newline at end of file diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/person.search.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/person.search.view.hbm.xml new file mode 100644 index 0000000..cf19b32 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/person.search.view.hbm.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/total.cash.by.curdate.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/total.cash.by.curdate.view.hbm.xml new file mode 100644 index 0000000..a227b3c --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/mobile/views/total.cash.by.curdate.view.hbm.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/payroll/payroll.queries.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/payroll/payroll.queries.hbm.xml new file mode 100644 index 0000000..f89e04f --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/payroll/payroll.queries.hbm.xml @@ -0,0 +1,201 @@ + + + + + + + + + + = DATE(:startDate) AND + DATE(:endDate) >= DATE(createdOn) + ORDER BY createdOn DESC + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/payroll/total.expected.payment.daily.by.user.queries.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/payroll/total.expected.payment.daily.by.user.queries.hbm.xml new file mode 100644 index 0000000..03052b9 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/payroll/total.expected.payment.daily.by.user.queries.hbm.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/administration.person.serch.view.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/administration.person.serch.view.xml new file mode 100644 index 0000000..c92cf67 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/administration.person.serch.view.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/advance.user.daily.detail.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/advance.user.daily.detail.view.hbm.xml new file mode 100644 index 0000000..f2e5cf0 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/advance.user.daily.detail.view.hbm.xml @@ -0,0 +1,15 @@ + + + + + + + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/advance.user.daily.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/advance.user.daily.view.hbm.xml new file mode 100644 index 0000000..468b34b --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/advance.user.daily.view.hbm.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/customer.without.renovation.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/customer.without.renovation.view.hbm.xml new file mode 100644 index 0000000..5cbfc4a --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/customer.without.renovation.view.hbm.xml @@ -0,0 +1,15 @@ + + + + + + + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/enabled.user.details.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/enabled.user.details.view.hbm.xml new file mode 100644 index 0000000..fb1e0df --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/enabled.user.details.view.hbm.xml @@ -0,0 +1,24 @@ + + + + + + + + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/general.box.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/general.box.view.hbm.xml new file mode 100644 index 0000000..633fc1a --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/general.box.view.hbm.xml @@ -0,0 +1,15 @@ + + + + + + + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/information.loan.last.week.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/information.loan.last.week.view.hbm.xml new file mode 100644 index 0000000..805147d --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/information.loan.last.week.view.hbm.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/information.loan.week.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/information.loan.week.view.hbm.xml new file mode 100644 index 0000000..f7d3ed3 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/information.loan.week.view.hbm.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/loan.by.user.payment.zero.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/loan.by.user.payment.zero.view.hbm.xml new file mode 100644 index 0000000..54e0c6a --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/loan.by.user.payment.zero.view.hbm.xml @@ -0,0 +1,15 @@ + + + + + + + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/loan.employee.detail.all.data.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/loan.employee.detail.all.data.view.hbm.xml new file mode 100644 index 0000000..13b1f75 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/loan.employee.detail.all.data.view.hbm.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/loan.employee.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/loan.employee.view.hbm.xml new file mode 100644 index 0000000..65cc817 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/loan.employee.view.hbm.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/loan.renovation.devilery.weekly.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/loan.renovation.devilery.weekly.view.hbm.xml new file mode 100644 index 0000000..a168f2f --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/loan.renovation.devilery.weekly.view.hbm.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/money.daily.by.user.certifier.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/money.daily.by.user.certifier.view.hbm.xml new file mode 100644 index 0000000..26bc378 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/money.daily.by.user.certifier.view.hbm.xml @@ -0,0 +1,15 @@ + + + + + + + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/payment.detail.from.user.by.curdate.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/payment.detail.from.user.by.curdate.view.hbm.xml new file mode 100644 index 0000000..f45b768 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/payment.detail.from.user.by.curdate.view.hbm.xml @@ -0,0 +1,6 @@ + + + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/resumen.new.customer.last.week.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/resumen.new.customer.last.week.view.hbm.xml new file mode 100644 index 0000000..d790893 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/resumen.new.customer.last.week.view.hbm.xml @@ -0,0 +1,14 @@ + + + + + + + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/resumen.new.customer.week.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/resumen.new.customer.week.view.hbm.xml new file mode 100644 index 0000000..0386697 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/resumen.new.customer.week.view.hbm.xml @@ -0,0 +1,14 @@ + + + + + + + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/resumen.total.last.week.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/resumen.total.last.week.view.hbm.xml new file mode 100644 index 0000000..6f1ae3e --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/resumen.total.last.week.view.hbm.xml @@ -0,0 +1,15 @@ + + + + + + + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/resumen.total.week.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/resumen.total.week.view.hbm.xml new file mode 100644 index 0000000..ca6c87e --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/resumen.total.week.view.hbm.xml @@ -0,0 +1,15 @@ + + + + + + + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/stats.advances.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/stats.advances.view.hbm.xml new file mode 100644 index 0000000..375cf45 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/stats.advances.view.hbm.xml @@ -0,0 +1,31 @@ + + + + + + = DATE(:startDate) AND + DATE(:endDate) >= DATE(created_on) + ORDER BY created_on DESC + ]]> + + + + = DATE(:startDate) AND + DATE(:endDate) >= DATE(created_on) AND + idRoute = :route + ORDER BY created_on DESC + ]]> + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/stats.closing.day.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/stats.closing.day.view.hbm.xml new file mode 100644 index 0000000..93853cb --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/stats.closing.day.view.hbm.xml @@ -0,0 +1,31 @@ + + + + + + = DATE(:startDate) AND + DATE(:endDate) >= DATE(created_on) + ORDER BY created_on DESC + ]]> + + + + = DATE(:startDate) AND + DATE(:endDate) >= DATE(created_on) AND + idUser = :user + ORDER BY created_on DESC + ]]> + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/stats.deposits.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/stats.deposits.view.hbm.xml new file mode 100644 index 0000000..73d9254 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/stats.deposits.view.hbm.xml @@ -0,0 +1,31 @@ + + + + + + = DATE(:startDate) AND + DATE(:endDate) >= DATE(created_on) + ORDER BY created_on DESC + ]]> + + + + = DATE(:startDate) AND + DATE(:endDate) >= DATE(created_on) AND + idUser = :user + ORDER BY created_on DESC + ]]> + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/stats.employee.saving.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/stats.employee.saving.view.hbm.xml new file mode 100644 index 0000000..c51338c --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/stats.employee.saving.view.hbm.xml @@ -0,0 +1,31 @@ + + + + + + = DATE(:startDate) AND + DATE(:endDate) >= DATE(created_on) + ORDER BY created_on DESC + ]]> + + + + = DATE(:startDate) AND + DATE(:endDate) >= DATE(created_on) + AND id_user = :idUser + ORDER BY created_on DESC + ]]> + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/stats.fees.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/stats.fees.view.hbm.xml new file mode 100644 index 0000000..b56a963 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/stats.fees.view.hbm.xml @@ -0,0 +1,44 @@ + + + + + + = DATE(:startDate) AND + DATE(:endDate) >= DATE(created_on) + ORDER BY created_on DESC + ]]> + + + + = DATE(:startDate) AND + DATE(:endDate) >= DATE(created_on) AND + idUser = :user + ORDER BY created_on DESC + ]]> + + + + = DATE(:startDate) AND + DATE(:endDate) >= DATE(created_on) AND + idRoute = :route + ORDER BY created_on DESC + ]]> + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/stats.gasoline.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/stats.gasoline.view.hbm.xml new file mode 100644 index 0000000..8939642 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/stats.gasoline.view.hbm.xml @@ -0,0 +1,18 @@ + + + + + + = DATE(:startDate) AND + DATE(:endDate) >= DATE(created_on) + ORDER BY created_on DESC + ]]> + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/stats.opening.fees.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/stats.opening.fees.view.hbm.xml new file mode 100644 index 0000000..1b4f5d4 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/stats.opening.fees.view.hbm.xml @@ -0,0 +1,31 @@ + + + + + + = DATE(:startDate) AND + DATE(:endDate) >= DATE(created_on) + ORDER BY created_on DESC + ]]> + + + + = DATE(:startDate) AND + DATE(:endDate) >= DATE(created_on) AND + idUser = :user + ORDER BY created_on DESC + ]]> + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/stats.payment.renovation.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/stats.payment.renovation.view.hbm.xml new file mode 100644 index 0000000..481d931 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/stats.payment.renovation.view.hbm.xml @@ -0,0 +1,31 @@ + + + + + + = DATE(:startDate) AND + DATE(:endDate) >= DATE(created_on) + ORDER BY created_on DESC + ]]> + + + + = DATE(:startDate) AND + DATE(:endDate) >= DATE(created_on) AND + idUser = :user + ORDER BY created_on DESC + ]]> + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/stats.payment.route.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/stats.payment.route.view.hbm.xml new file mode 100644 index 0000000..3f0f1a0 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/stats.payment.route.view.hbm.xml @@ -0,0 +1,31 @@ + + + + + + = DATE(:startDate) AND + DATE(:endDate) >= DATE(created_on) + ORDER BY created_on DESC + ]]> + + + + = DATE(:startDate) AND + DATE(:endDate) >= DATE(created_on) AND + idRoute = :route + ORDER BY created_on DESC + ]]> + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/stats.payment.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/stats.payment.view.hbm.xml new file mode 100644 index 0000000..9d30582 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/stats.payment.view.hbm.xml @@ -0,0 +1,31 @@ + + + + + + = DATE(:startDate) AND + DATE(:endDate) >= DATE(created_on) + ORDER BY created_on DESC + ]]> + + + + = DATE(:startDate) AND + DATE(:endDate) >= DATE(created_on) AND + idUser = :user + ORDER BY created_on DESC + ]]> + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/stats.payroll.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/stats.payroll.view.hbm.xml new file mode 100644 index 0000000..cdf5d4b --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/stats.payroll.view.hbm.xml @@ -0,0 +1,31 @@ + + + + + + = DATE(:startDate) AND + DATE(:endDate) >= DATE(created_on) + ORDER BY created_on DESC + ]]> + + + + = DATE(:startDate) AND + DATE(:endDate) >= DATE(created_on) AND + idUser = :user + ORDER BY created_on DESC + ]]> + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/stats.vehicle.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/stats.vehicle.view.hbm.xml new file mode 100644 index 0000000..9f5a1f8 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/stats.vehicle.view.hbm.xml @@ -0,0 +1,15 @@ + + + + + + + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/stats.zero.payments.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/stats.zero.payments.view.hbm.xml new file mode 100644 index 0000000..e45d6f4 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/stats.zero.payments.view.hbm.xml @@ -0,0 +1,31 @@ + + + + + + = DATE(:startDate) AND + DATE(:endDate) >= DATE(created_on) + ORDER BY created_on DESC + ]]> + + + + = DATE(:startDate) AND + DATE(:endDate) >= DATE(created_on) AND + idUser = :user + ORDER BY created_on DESC + ]]> + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/total.closing.daily.detail.from.user.by.curdate.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/total.closing.daily.detail.from.user.by.curdate.view.hbm.xml new file mode 100644 index 0000000..0cd4796 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/total.closing.daily.detail.from.user.by.curdate.view.hbm.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/total.closing.day.by.curdate.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/total.closing.day.by.curdate.view.hbm.xml new file mode 100644 index 0000000..525bcf0 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/total.closing.day.by.curdate.view.hbm.xml @@ -0,0 +1,15 @@ + + + + + + + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/total.loans.approved.by.office.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/total.loans.approved.by.office.view.hbm.xml new file mode 100644 index 0000000..74dbe53 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/total.loans.approved.by.office.view.hbm.xml @@ -0,0 +1,15 @@ + + + + + + + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/total.loans.by.office.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/total.loans.by.office.view.hbm.xml new file mode 100644 index 0000000..35ebd64 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/total.loans.by.office.view.hbm.xml @@ -0,0 +1,15 @@ + + + + + + + + + diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/transfer.in.pending.status.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/transfer.in.pending.status.view.hbm.xml new file mode 100644 index 0000000..7a1a1e8 --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/transfer.in.pending.status.view.hbm.xml @@ -0,0 +1,20 @@ + + + + + + + + + + \ No newline at end of file diff --git a/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/user.by.route.view.hbm.xml b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/user.by.route.view.hbm.xml new file mode 100644 index 0000000..5ecc37e --- /dev/null +++ b/ace-model/src/main/resources/com/arrebol/apc/model/queries/view/user.by.route.view.hbm.xml @@ -0,0 +1,15 @@ + + + + + + + + + diff --git a/ace-security/nb-configuration.xml b/ace-security/nb-configuration.xml new file mode 100644 index 0000000..a65c451 --- /dev/null +++ b/ace-security/nb-configuration.xml @@ -0,0 +1,18 @@ + + + + + + JDK_1.8 + + diff --git a/ace-security/pom.xml b/ace-security/pom.xml new file mode 100644 index 0000000..4cbf081 --- /dev/null +++ b/ace-security/pom.xml @@ -0,0 +1,58 @@ + + + 4.0.0 + com.arrebol + ace-security + 1.0.0 + jar + + UTF-8 + 1.8 + 1.8 + 2.17.0 + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12.4 + + true + + + + + + + + org.apache.logging.log4j + log4j-api + ${log4j.version} + + + org.apache.logging.log4j + log4j-core + ${log4j.version} + + + + junit + junit + 4.12 + test + + + ace-security + \ No newline at end of file diff --git a/ace-security/src/main/java/com/arrebol/apc/security/APCSecure.java b/ace-security/src/main/java/com/arrebol/apc/security/APCSecure.java new file mode 100644 index 0000000..177acb6 --- /dev/null +++ b/ace-security/src/main/java/com/arrebol/apc/security/APCSecure.java @@ -0,0 +1,68 @@ +package com.arrebol.apc.security; + +import java.nio.charset.Charset; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.xml.bind.DatatypeConverter; + +/** + * + * @author Picasso + */ +public class APCSecure { + + private static final String DIGEST_METHOD = "SHA-256"; + private static final String ENCODING = "UTF-8"; + private static final String[] SECRET = {"Capoeira", "CaperucitaRoja", "Guardian"}; + + private final String app; + private String password; + + public APCSecure(String app, String password) { + this.app = app; + this.password = password; + } + + public String getPassword() { + MessageDigest md = null; + StringBuilder builder = new StringBuilder().append(SECRET[0].charAt(SECRET[0].length() - 2)); + + try { + md = MessageDigest.getInstance(DIGEST_METHOD); + + builder.append(password.charAt(1)); + builder.append(password.charAt(password.length() - 2)); + builder.append(password); + builder.append(SECRET[1]); + builder.append(password.charAt(0)); + builder.append(password.charAt(password.length() - 1)); + + for (int i = app.length(); i > 0; i--) { + builder.append(app.charAt(i - 1)); + } + + for (int i = SECRET[0].length(); i > 0; i--) { + builder.append(SECRET[0].charAt(i - 1)); + } + + for (int i = password.length(); i > 0; i--) { + builder.append(password.charAt(i - 1)); + } + + for (int i = 0; i < SECRET[2].length(); i++) { + builder.append(SECRET[2].charAt(i)); + } + + byte[] digest = md.digest(builder.toString().getBytes(Charset.forName(ENCODING))); + + return this.password = DatatypeConverter.printHexBinary(digest).toUpperCase(); + + } catch (NoSuchAlgorithmException ex) { + Logger.getLogger(APCSecure.class.getName()).log(Level.SEVERE, null, ex); + return ""; + } + } + +} diff --git a/ace-security/src/main/resources/log4j2.xml b/ace-security/src/main/resources/log4j2.xml new file mode 100644 index 0000000..4b01a88 --- /dev/null +++ b/ace-security/src/main/resources/log4j2.xml @@ -0,0 +1,19 @@ + + + + + + %d{dd-MM-yyyy HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n + + + + + + + + + + + + + \ No newline at end of file diff --git a/ace-security/src/test/java/com/arrebol/apc/security/APCSecureTest.java b/ace-security/src/test/java/com/arrebol/apc/security/APCSecureTest.java new file mode 100644 index 0000000..d39de3a --- /dev/null +++ b/ace-security/src/test/java/com/arrebol/apc/security/APCSecureTest.java @@ -0,0 +1,40 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.security; + +import org.junit.Before; +import org.junit.Test; +import static org.junit.Assert.*; + +/** + * + * @author Picasso + */ +public class APCSecureTest { + + private static final String APP_NAME = "ApoyoAProyectosComerciales"; + private static final String PASSWORD = "12345678"; + private APCSecure apcSecure; + + public APCSecureTest() { + } + + @Before + public void setUp() { + this.apcSecure = new APCSecure(APP_NAME, PASSWORD); + } + + @Test + public void getPassword() { + try { + String pwd = apcSecure.getPassword(); + System.out.println(pwd); + assertNotNull(pwd); + } catch (Exception e) { + } + } + +} diff --git a/ace-web/faces-config.NavData b/ace-web/faces-config.NavData new file mode 100644 index 0000000..298bfc5 --- /dev/null +++ b/ace-web/faces-config.NavData @@ -0,0 +1,6 @@ + + + + + + diff --git a/ace-web/faces-config_old.NavData b/ace-web/faces-config_old.NavData new file mode 100644 index 0000000..e69de29 diff --git a/ace-web/nb-configuration.xml b/ace-web/nb-configuration.xml new file mode 100644 index 0000000..1dab374 --- /dev/null +++ b/ace-web/nb-configuration.xml @@ -0,0 +1,22 @@ + + + + + + 1.8-web + Tomcat + true + JDK_1.8 + JSP + + diff --git a/ace-web/pom.xml b/ace-web/pom.xml new file mode 100644 index 0000000..7a485f4 --- /dev/null +++ b/ace-web/pom.xml @@ -0,0 +1,220 @@ + + + 4.0.0 + + com.arrebol + ace-web + 1.0.0 + war + + ace-web + + + ${project.build.directory}/endorsed + UTF-8 + 2.17.0 + + + + + com.amazonaws + aws-java-sdk-ses + 1.12.460 + jar + + + javax + javaee-api + 8.0 + provided + + + + org.apache.tomcat + tomcat-dbcp + 8.5.35 + + + + org.apache.poi + poi + 4.0.1 + + + + org.apache.logging.log4j + log4j-api + ${log4j.version} + + + org.apache.logging.log4j + log4j-core + ${log4j.version} + + + org.apache.logging.log4j + log4j-slf4j-impl + ${log4j.version} + + + + com.arrebol + ace-layout + 1.0.0 + jar + + + com.arrebol + ace-controller + 1.0.0 + jar + + + com.arrebol + ace-security + 1.0.0 + jar + + + org.apache.logging.log4j + log4j-api + + + org.apache.logging.log4j + log4j-core + + + + + + com.itextpdf + itextpdf + 5.5.13.3 + + + + com.twilio.sdk + twilio + 9.0.0-rc.2 + + + + + + AWS-EC2 + + jdbc:mysql://localhost:3306/apo_pro_com_april_ten?serverTimezone=UTC + root + Saladeespera2_ + false + /var/log/tomcat/cardriver.log + + + + Localhost + + jdbc:mysql://localhost:3306/apo_pro_com_april_ten?serverTimezone=GMT-5 + apoprocomlocalhost + Yj$2Da0z! + + + + Amazon-Web-Services + + jdbc:mysql://3.143.107.236:3306/apo_pro_com_april_ten?serverTimezone=GMT-6 + ace_remoto + Saladeespera2_ + + + + Amazon-Web-Services-Test + + jdbc:mysql://apc.clwlkknfqkjh.us-east-2.rds.amazonaws.com:3306/apo_pro_com_april_ten + apoprocom + Yj$2Da0z! + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.8 + 1.8 + + ${endorsed.dir} + + + + + org.apache.maven.plugins + maven-war-plugin + 2.3 + + + + src/main/webapp/META-INF + true + META-INF + + + false + + + + org.apache.maven.plugins + maven-dependency-plugin + 2.6 + + + validate + + copy + + + ${endorsed.dir} + true + + + javax + javaee-api + 8.0 + jar + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12.4 + + true + + + + + + diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/Datatable.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/Datatable.java new file mode 100644 index 0000000..d43e57d --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/Datatable.java @@ -0,0 +1,30 @@ +/* + * 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.web.beans; + +import java.util.List; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +public interface Datatable { + + public void editRow(RowEditEvent event); + + public void onRowCancel(RowEditEvent event); + + public void onRowReorder(ReorderEvent event); + + public void addRow(); + + public void deleteRow(); + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/GenericBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/GenericBean.java new file mode 100644 index 0000000..3b071f4 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/GenericBean.java @@ -0,0 +1,209 @@ +/* + * 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.web.beans; + +import com.arrebol.apc.controller.util.DateWrapper; +import com.arrebol.apc.model.core.UserByOffice; +import java.text.MessageFormat; +import java.text.NumberFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.ResourceBundle; +import javax.faces.application.FacesMessage; +import javax.faces.context.ExternalContext; +import javax.faces.context.FacesContext; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public abstract class GenericBean { + + /** + * It Shows messages in xhtml. + * + * @param success True shows info, False shows warn, null shows fatal. + */ + public void testActionButtom(Boolean success) { + try { + if (success) { + showMessage(FacesMessage.SEVERITY_INFO, + getBundlePropertyFile().getString("generic.title"), + getBundlePropertyFile().getString("generic.true")); + } else { + showMessage(FacesMessage.SEVERITY_WARN, + getBundlePropertyFile().getString("generic.title"), + getBundlePropertyFile().getString("generic.false")); + } + } catch (Exception e) { + showMessage(FacesMessage.SEVERITY_FATAL, + getBundlePropertyFile().getString("generic.title"), + getBundlePropertyFile().getString("generic.exception")); + } + + } + + /** + * + * @param field + * @param value + */ + public void initStartAndEndDates(int field, int value) { + try { + Calendar starDateCalendar = Calendar.getInstance(); + + starDateCalendar.setTime(DateWrapper.getTodayMXTime()); + starDateCalendar.set(field, value); + + setStarDate(starDateCalendar.getTime()); + setEndDate(DateWrapper.getTodayMXTime()); + } catch (Exception e) { + + } + } + + public void initOneWeekBeforeToCurrdate() { + try { + Calendar start = Calendar.getInstance(); + + start.set(Calendar.WEEK_OF_YEAR, start.get(Calendar.WEEK_OF_YEAR) - 1); + start.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY); + + setStarDate(start.getTime()); + setEndDate(DateWrapper.getTodayMXTime()); + } catch (Exception e) { + + } + } + + public void initThisWeekToCurrdate() { + try { + Calendar start = Calendar.getInstance(); + + //start.set(Calendar.WEEK_OF_YEAR, start.get(Calendar.WEEK_OF_YEAR) - 1); + start.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY); + setStarDate(start.getTime()); + + setEndDate(DateWrapper.getTodayMXTime()); + } catch (Exception e) { + + } + } + + /** + * + * @return + */ + protected synchronized FacesContext facesContext() { + return FacesContext.getCurrentInstance(); + } + + /** + * + * @return + */ + protected synchronized ExternalContext externalContext() { + return facesContext().getExternalContext(); + } + + /** + * + * @return + */ + public synchronized UserByOffice getLoggedUser() { + return (UserByOffice) externalContext().getSessionMap().get(APC_SESSION); + } + + /** + * + * @param userByOffice + */ + protected synchronized void setLoggedUser(UserByOffice userByOffice) { + externalContext().getSessionMap().put(APC_SESSION, userByOffice); + } + + /** + * + * @param severity + * @param title + * @param details + */ + protected void showMessage(FacesMessage.Severity severity, String title, String details) { + facesContext().addMessage(null, new FacesMessage(severity, title, details)); + } + + /** + * + * @param number Must be numeric (BigDecimal, Double, Float or Integer) + * @return + */ + public String currencyFormatNumber(Object number) { + String currency; + try { + NumberFormat defaultFormat = NumberFormat.getCurrencyInstance(); + currency = defaultFormat.format(number); + } catch (Exception e) { + currency = "$0.00"; + } + return currency; + } + + /** + * Construye y envia el mensaje de notification del resultado de la accion + * ejecutada. + * + * @param params argumentos {0},{1}, etc. + * @param msg mesage que se sustituira lo {0},{1}, etc. + * @param severity Solo se permiten INFO, WARN or FATAL. + * @param title Titulo que aparece en message + */ + protected void buildAndSendMessage(Object[] params, String msg, + FacesMessage.Severity severity, String title) { + MessageFormat mf = new MessageFormat(msg); + + facesContext().addMessage(null, new FacesMessage(severity, title, mf.format(params))); + } + + protected static final String APP = "ApoyoAProyectosComerciales"; + + protected static final String APC_SESSION = "APCAuthorization"; + private ResourceBundle bundlePropertyFile; + private final String PROPERTY_FILE = "com.arrebol.apc.i18n.app_background"; + private final int pwdMaxlength = 15; + private Date starDate; + private Date endDate; + + public ResourceBundle getBundlePropertyFile() { + return bundlePropertyFile; + } + + public void loadBundlePropertyFile() { + this.bundlePropertyFile = ResourceBundle.getBundle(PROPERTY_FILE); + } + + public int getPwdMaxlength() { + return pwdMaxlength; + } + + public Date getStarDate() { + return starDate; + } + + public void setStarDate(Date starDate) { + this.starDate = starDate; + } + + public Date getEndDate() { + return endDate; + } + + public void setEndDate(Date endDate) { + this.endDate = endDate; + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/SendMSN.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/SendMSN.java new file mode 100644 index 0000000..a1509a3 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/SendMSN.java @@ -0,0 +1,49 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.web.beans; + +import com.twilio.Twilio; +import com.twilio.rest.api.v2010.account.Message; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * + * @author Oscar + */ +public class SendMSN { + + public static final String ACCOUNT_SID = "AC3f21ebff784532f98229abfd8bc0e227"; + public static final String AUTH_TOKEN = "08e8c76db40ea5cc9ed772671909f292"; + private String text = ""; + private String phone = ""; + + public SendMSN(String aMessage, String aPhone) { + text = aMessage; + phone = aPhone; + } + + public void sendMessage() { + Twilio.init(ACCOUNT_SID, AUTH_TOKEN); + Message message = Message.creator( + new com.twilio.type.PhoneNumber(phone), + new com.twilio.type.PhoneNumber("+18504076816"), + text) + .create(); + + System.out.println(message.getSid()); + } + + public static boolean validarMovil(String movil) { + Pattern p = Pattern.compile("^\\d{10}$"); + Matcher m = p.matcher(movil); + return (m.matches()); + } + + public static String getNumberPhoneFormat(String movil) { + return "+52" + movil.trim(); + } +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/AdvanceBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/AdvanceBean.java new file mode 100644 index 0000000..b63d32d --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/AdvanceBean.java @@ -0,0 +1,252 @@ +/* + * 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.web.beans.admin; + +import com.arrebol.apc.controller.BitacoraController; +import com.arrebol.apc.controller.GenericController; +import com.arrebol.apc.controller.GenericValidationController; +import com.arrebol.apc.controller.admin.AdvanceController; +import com.arrebol.apc.model.admin.Advance; +import com.arrebol.apc.model.admin.ExpenseCompany; +import com.arrebol.apc.model.core.HumanResource; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.system.logs.Bitacora; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.context.FacesContext; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Named("advanceManager") +@ViewScoped +public class AdvanceBean 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 { + setAdvance(fillDatatableAdvance()); + } + } catch (Exception e) { + } + } + + public List fillDatatableAdvance() { + + return getAdvanceCtrl().fillAdvanceDatatable(getLoggedUser().getOffice().getId(), getStarDate(), getEndDate()); + } + + public List getHr() { + + return genericCtrl.getAllHRByOffice(getLoggedUser().getOffice().getId()); + } + + @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 onRowReorder(ReorderEvent event) { + showMessage(FacesMessage.SEVERITY_INFO, "Registro Movido", "De columna: " + (event.getFromIndex() + 1) + " a columna: " + (event.getToIndex() + 1)); + } + + @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 adelantos porque ya se existe un cuadre de caja general de hoy."); + return; + } + + if(new BigDecimal(amount).compareTo(BigDecimal.ZERO)==0){ + + showMessage(FacesMessage.SEVERITY_WARN, "Adelanto Incorrecta", "No se pueden dar adelantos de 0"); + return; + + } + + if(new BigDecimal(amount).compareTo(BigDecimal.ZERO)<0){ + + showMessage(FacesMessage.SEVERITY_WARN, "Adelanto Incorrecto", "No se puede dar adelanto de un numero negativo"); + return; + + } + + Advance advanceSave = new Advance(); + advanceSave.setActiveStatus(ActiveStatus.ENEBLED); + advanceSave.setAmount(new BigDecimal(amount)); + advanceSave.setHumanResource(new HumanResource(humanResourceId)); + advanceSave.setOffice(new Office(getLoggedUser().getOffice().getId())); + advanceSave.setCreatedOn(date); + advanceSave.setCreatedBy(getLoggedUser().getId()); + advanceCtrl.saveAdvance(advanceSave); + advance.clear(); + advance = fillDatatableAdvance(); + humanResourceId = ""; + amount = ""; + FacesMessage msg = new FacesMessage("Nuevo adelanto", "Se agregĆ³ correctamente"); + FacesContext.getCurrentInstance().addMessage(null, msg); + + } + + @Override + public void deleteRow() { + if (genericCtrl.existStableGeneralBoxByCreatedOn(selectedAdvance.getCreatedOn())) { + showMessage(FacesMessage.SEVERITY_WARN, "Adelanto", "No se puede borrar porque ya se realizo el cuadre de caja general del dĆ­a."); + } else { + advanceCtrl.updateAdvanceByStatus(ActiveStatus.DISABLED, selectedAdvance.getId(), getLoggedUser().getUser().getId()); + Bitacora bitacora = new Bitacora(); + bitacora.setAction("Eliminar adelanto"); + 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 adelanto con monto $" + + selectedAdvance.getAmount() + " y fecha " + selectedAdvance.getCreatedOn()); + + searchHistoricalAction(); + bitacoraCtrl.saveBitacora(bitacora); + commentsBitacora = ""; + //advance.remove(selectedAdvance); + selectedAdvance = null; + showMessage(FacesMessage.SEVERITY_INFO, "Adelanto Eliminado", "Se eliminĆ³ correctamente."); + } + } + + public AdvanceController getAdvanceCtrl() { + return advanceCtrl; + } + + public void setAdvanceCtrl(AdvanceController advanceCtrl) { + this.advanceCtrl = advanceCtrl; + } + + public GenericController getGenericCtrl() { + return genericCtrl; + } + + public void setGenericCtrl(GenericController genericCtrl) { + this.genericCtrl = genericCtrl; + } + + public List getAdvance() { + return advance; + } + + public void setAdvance(List advance) { + this.advance = advance; + } + + public List getHumanResource() { + return humanResource; + } + + public void setHumanResource(List humanResource) { + this.humanResource = humanResource; + } + + public String getHumanResourceId() { + return humanResourceId; + } + + public void setHumanResourceId(String humanResourceId) { + this.humanResourceId = humanResourceId; + } + + public Advance getSelectedAdvance() { + return selectedAdvance; + } + + public void setSelectedAdvance(Advance selectedAdvance) { + this.selectedAdvance = selectedAdvance; + } + + public String getAmount() { + return amount; + } + + public void setAmount(String amount) { + this.amount = amount; + } + + 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; + } + + public String getCommentsBitacora() { + return commentsBitacora; + } + + public void setCommentsBitacora(String commentsBitacora) { + this.commentsBitacora = commentsBitacora; + } + + private AdvanceController advanceCtrl; + private GenericController genericCtrl; + private BitacoraController bitacoraCtrl; + private GenericValidationController genericValidateController; + private Date lastStableGeneralBox; + private String commentsBitacora; + + private List advance; + private List humanResource; + + private String humanResourceId; + private Advance selectedAdvance; + private String amount; + + @PostConstruct + public void init() { + loadBundlePropertyFile(); + initOneWeekBeforeToCurrdate(); + + advanceCtrl = new AdvanceController(); + genericCtrl = new GenericController(); + bitacoraCtrl = new BitacoraController(); + setGenericValidateController(new GenericValidationController()); + setLastStableGeneralBox(getGenericValidateController().lastStableGeneralBoxByDate(getLoggedUser().getUser())); + commentsBitacora = ""; + advance = fillDatatableAdvance(); + humanResource = getHr(); + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/BonusBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/BonusBean.java new file mode 100644 index 0000000..b3dade8 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/BonusBean.java @@ -0,0 +1,158 @@ +/* + * 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.web.beans.admin; + +import com.arrebol.apc.controller.admin.BonusController; +import com.arrebol.apc.model.admin.Bonus; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.context.FacesContext; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ + +@Named("bonusManager") +@ViewScoped +public class BonusBean 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 { + setBonus(getBonusCtrl().fillBonusDatatable(getLoggedUser().getOffice().getId(), getStarDate(), getEndDate())); + } + } catch (Exception e) { + } + } + + public List fillDatatableBonus() { + + return getBonusCtrl().fillBonusDatatable(getLoggedUser().getOffice().getId(), getStarDate(), getEndDate()); + } + + @Override + public void editRow(RowEditEvent event) { + Bonus bonus = (Bonus) event.getObject(); + if (bonus != null) { + bonusCtrl.updateByBonusId(bonus); + showMessage(FacesMessage.SEVERITY_INFO, "Registro Editado", "Se hizo el cambio correctamente."); + } + } + + @Override + public void onRowCancel(RowEditEvent event) { + showMessage(FacesMessage.SEVERITY_INFO, "EdiciĆ³n Cancelada", ((Bonus) event.getObject()).getName().toString()); + } + + @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() { + if (administrative) { + saveBonus.setAdministrative(ActiveStatus.ENEBLED); + } else { + saveBonus.setAdministrative(ActiveStatus.DISABLED); + } + saveBonus.setActiveStatus(ActiveStatus.ENEBLED); + saveBonus.setCreatedBy(getLoggedUser().getId()); + saveBonus.setOffice(new Office(getLoggedUser().getOffice().getId())); + saveBonus.setCreatedOn(new Date()); + if (bonusCtrl.saveBonus(saveBonus)) { + saveBonus = new Bonus(); + administrative = false; + bonus.clear(); + bonus = fillDatatableBonus(); + FacesMessage msg = new FacesMessage("Nuevo bono", "Se agregĆ³ correctamente"); + FacesContext.getCurrentInstance().addMessage(null, msg); + } + } + + @Override + public void deleteRow() { + bonusCtrl.updateBonusByStatus(ActiveStatus.DISABLED, selectedBonus.getId(), getLoggedUser().getUser().getId()); + bonus.remove(selectedBonus); + selectedBonus = null; + showMessage(FacesMessage.SEVERITY_INFO, "Bono Eliminado", "Se eliminĆ³ correctamente."); + } + + public BonusController getBonusCtrl() { + return bonusCtrl; + } + + public void setBonusCtrl(BonusController bonusCtrl) { + this.bonusCtrl = bonusCtrl; + } + + public List getBonus() { + return bonus; + } + + public void setBonus(List bonus) { + this.bonus = bonus; + } + + public Bonus getSelectedBonus() { + return selectedBonus; + } + + public void setSelectedBonus(Bonus selectedBonus) { + this.selectedBonus = selectedBonus; + } + + public Bonus getSaveBonus() { + return saveBonus; + } + + public void setSaveBonus(Bonus saveBonus) { + this.saveBonus = saveBonus; + } + + public boolean isAdministrative() { + return administrative; + } + + public void setAdministrative(boolean administrative) { + this.administrative = administrative; + } + + private BonusController bonusCtrl; + private List bonus; + private Bonus selectedBonus; + private Bonus saveBonus; + private boolean administrative; + + @PostConstruct + public void init() { + loadBundlePropertyFile(); + initOneWeekBeforeToCurrdate(); + + bonusCtrl = new BonusController(); + bonus = fillDatatableBonus(); + saveBonus = new Bonus(); + administrative = false; + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/ChangeOwnerBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/ChangeOwnerBean.java new file mode 100644 index 0000000..92c8240 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/ChangeOwnerBean.java @@ -0,0 +1,241 @@ +/* + * 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.web.beans.admin; + +import com.arrebol.apc.controller.admin.ChangeOwnerController; +import com.arrebol.apc.model.loan.Loan; +import com.arrebol.apc.model.views.AvailablesOwnersView; +import com.arrebol.apc.model.views.CurrentCustomerByLoanView; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.primefaces.model.DualListModel; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Named() +@ViewScoped +public class ChangeOwnerBean extends GenericBean implements Serializable { + + /** + * + */ + public void onCurrentOwnerChange() { + logger.debug("onCurrentOwnerChange"); + try { + setNewOwners(getController().findAllNewOwners(getLoggedUser().getOffice().getId(), getCurrentOwner())); + + setLoansByCurrentOwner( + new DualListModel<>( + getController().findAllLoansByCurrentOwner(getLoggedUser().getOffice().getId(), getCurrentOwner()), + new ArrayList<>() + ) + ); + + AvailablesOwnersView owner = getCurrentOwners() + .stream() + .filter(value -> getCurrentOwner().equals(value.getUserId())) + .findAny() + .orElse(null); + + setCurrentOwnerFullName(null == owner ? "Error" : owner.getFullName()); + + setNewOwner(null); + setNewOwnerFullName(""); + } catch (Exception e) { + logger.error("onCurrentOwnerChange", e); + + setNewOwner(null); + setNewOwnerFullName(""); + setNewOwners(new ArrayList<>()); + setLoansByCurrentOwner(new DualListModel<>(new ArrayList<>(), new ArrayList<>())); + setCurrentOwners(new ArrayList<>()); + } + } + + /** + * + */ + public void onNewOwnerChange() { + logger.debug("onNewOwnerChange"); + try { + setLoansByCurrentOwner( + new DualListModel<>( + getController().findAllLoansByCurrentOwner(getLoggedUser().getOffice().getId(), getCurrentOwner()), + new ArrayList<>() + ) + ); + + AvailablesOwnersView owner = getNewOwners() + .stream() + .filter(value -> getNewOwner().equals(value.getUserId())) + .findAny() + .orElse(null); + + setNewOwnerFullName(null == owner ? "Error" : owner.getFullName()); + } catch (Exception e) { + logger.error("onNewOwnerChange", e); + + setNewOwners(new ArrayList<>()); + setLoansByCurrentOwner(new DualListModel<>(new ArrayList<>(), new ArrayList<>())); + } + } + + /** + * + */ + public void changeLoansBetweenUsers() { + logger.debug("changeLoansBetweenUsers"); + + try { + FacesMessage.Severity severity = FacesMessage.SEVERITY_WARN; + String messafeFormat = getBundlePropertyFile().getString("message.format.failure"); + String messageTitle = getBundlePropertyFile().getString("change.owner.upper"); + String messageAction = getBundlePropertyFile().getString("updated"); + + List loans = new ArrayList<>(); + + getLoansByCurrentOwner().getTarget().forEach((loanView) -> { + loans.add(new Loan(loanView.getLoanId())); + }); + + if (getController().changeLoansBetweenUsers(getNewOwner(), loans)) { + setCurrentOwner(null); + setCurrentOwnerFullName(""); + setCurrentOwners(getController().findAllCurrentOwners(getLoggedUser().getOffice().getId())); + setNewOwner(null); + setNewOwnerFullName(""); + setNewOwners(new ArrayList<>()); + setLoansByCurrentOwner(new DualListModel<>(new ArrayList<>(), new ArrayList<>())); + + severity = FacesMessage.SEVERITY_INFO; + messafeFormat = getBundlePropertyFile().getString("message.format.sucess"); + } + + Object[] param = {messageTitle, messageAction}; + + buildAndSendMessage(param, messafeFormat, severity, messageTitle); + } catch (Exception e) { + logger.error("changeLoansBetweenUsers", e); + Object[] param = {getBundlePropertyFile().getString("change.owner.upper")}; + + buildAndSendMessage( + param, + getBundlePropertyFile().getString("message.format.fatal"), + FacesMessage.SEVERITY_FATAL, + getBundlePropertyFile().getString("change.owner") + ); + } + } + + @PostConstruct + public void init() { + try { + loadBundlePropertyFile(); + + setController(new ChangeOwnerController()); + setCurrentOwners(getController().findAllCurrentOwners(getLoggedUser().getOffice().getId())); + + setLoansByCurrentOwner( + new DualListModel<>( + new ArrayList<>(), + new ArrayList<>() + ) + ); + } catch (Exception e) { + logger.error("init", e); + } + } + + private static final long serialVersionUID = -7947550003483328090L; + final Logger logger = LogManager.getLogger(getClass().getName()); + + private ChangeOwnerController controller; + private List currentOwners; + private List newOwners; + private DualListModel loansByCurrentOwner; + + private String currentOwner; + private String newOwner; + private String currentOwnerFullName; + private String newOwnerFullName; + + public ChangeOwnerController getController() { + return controller; + } + + public void setController(ChangeOwnerController controller) { + this.controller = controller; + } + + public List getCurrentOwners() { + return currentOwners; + } + + public void setCurrentOwners(List currentOwners) { + this.currentOwners = currentOwners; + } + + public List getNewOwners() { + return newOwners; + } + + public void setNewOwners(List newOwners) { + this.newOwners = newOwners; + } + + public DualListModel getLoansByCurrentOwner() { + return loansByCurrentOwner; + } + + public void setLoansByCurrentOwner(DualListModel loansByCurrentOwner) { + this.loansByCurrentOwner = loansByCurrentOwner; + } + + public String getCurrentOwner() { + return currentOwner; + } + + public void setCurrentOwner(String currentOwner) { + this.currentOwner = currentOwner; + } + + public String getNewOwner() { + return newOwner; + } + + public void setNewOwner(String newOwner) { + this.newOwner = newOwner; + } + + public String getCurrentOwnerFullName() { + return currentOwnerFullName; + } + + public void setCurrentOwnerFullName(String currentOwnerFullName) { + this.currentOwnerFullName = currentOwnerFullName; + } + + public String getNewOwnerFullName() { + return newOwnerFullName; + } + + public void setNewOwnerFullName(String newOwnerFullName) { + this.newOwnerFullName = newOwnerFullName; + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/ClosingDayBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/ClosingDayBean.java new file mode 100644 index 0000000..772eef3 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/ClosingDayBean.java @@ -0,0 +1,1277 @@ +/* + * 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.web.beans.admin; + +import com.arrebol.apc.controller.BitacoraController; +import com.arrebol.apc.controller.GenericController; +import com.arrebol.apc.controller.admin.ClosingDayController; +import com.arrebol.apc.controller.admin.LoanController; +import com.arrebol.apc.model.admin.ClosingDay; +import com.arrebol.apc.model.admin.ClosingDayDetail; +import com.arrebol.apc.model.catalog.RouteCtlg; +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.system.logs.Bitacora; +import com.arrebol.apc.model.views.ClosingDailyDetailFromUserByCurdateView; +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.TotalClosingDayByCurdateView; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import com.itextpdf.text.BaseColor; +import com.itextpdf.text.Chunk; +import com.itextpdf.text.Document; +import com.itextpdf.text.Element; +import com.itextpdf.text.FontFactory; +import com.itextpdf.text.Image; +import com.itextpdf.text.PageSize; +import com.itextpdf.text.Paragraph; +import com.itextpdf.text.pdf.PdfPCell; +import com.itextpdf.text.pdf.PdfPTable; +import com.itextpdf.text.pdf.PdfWriter; +import java.awt.Font; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.Serializable; +import java.math.BigDecimal; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.time.ZoneId; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.TimeZone; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.context.FacesContext; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import javax.servlet.ServletContext; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Named("closingDayManager") +@ViewScoped +public class ClosingDayBean 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 { + setClosingDay(getClosingDayCtrl().fillClosingDayDatatable(getLoggedUser().getOffice().getId(), getStarDate(), getEndDate())); + } + } catch (Exception e) { + } + } + + public List fillDatatableClosingDay() { + + return getClosingDayCtrl().fillClosingDayDatatable(getLoggedUser().getOffice().getId(), getStarDate(), getEndDate()); + } + + /** + * + * @param outcome + * @return + */ + public String detailClosingDay(String outcome) { + return outcome; + } + + public List getUsers() { + + return genericCtrl.getAllUsersByOffice(getLoggedUser().getOffice().getId()); + } + + public List fillDatatableClosingDetails(String idUser) { + + return closingDayCtrl.findAllClosingDailyDetailFromUserByCurdateView(idUser); + } + + public List getLoansPaymentZeroByUser(String idUser) { + + return closingDayCtrl.getLoansPaymentZeroByUser(idUser); + } + + public void getResumen() { + + List listTotal = closingDayCtrl.getAllTotalCashByCurdateDashboardView(getLoggedUser().getOffice().getId()); + totalAmount = BigDecimal.ZERO; + totalTransferSender = BigDecimal.ZERO; + totalTransferReceiver = BigDecimal.ZERO; + totalMoneyDaily = BigDecimal.ZERO; + totalDelivery = BigDecimal.ZERO; + totalFinal = BigDecimal.ZERO; + totalCaja = BigDecimal.ZERO; + totalOtherExpense = BigDecimal.ZERO; + deposit = BigDecimal.ZERO; + + for (TotalCashByCurdateDashboardView temp : listTotal) { + totalAmount = totalAmount.add(temp.getPaymentDaily()); + totalTransferSender = totalTransferSender.add(temp.getTransferSender()); + totalTransferReceiver = totalTransferReceiver.add(temp.getTransferReceiver()); + totalMoneyDaily = totalMoneyDaily.add(temp.getMoneyDaily()); + totalDelivery = totalDelivery.add(temp.getDelivery()); + deposit = deposit.add(temp.getDepositDaily()); + totalFinal = totalFinal.add(temp.getTotal()); + totalOtherExpense = totalOtherExpense.add(temp.getOtherExpense()); + } + + List closingTotal = closingDayCtrl.findAllClosingDayByCurdate(getLoggedUser().getOffice().getId()); + if (closingTotal != null && !closingTotal.isEmpty()) { + for (TotalClosingDayByCurdateView temp : closingTotal) { + totalCaja = totalCaja.add(temp.getAmountPaid()); + } + } + + } + + public void getCashTotal() { + + if (userId.equalsIgnoreCase("")) { + FacesMessage msg = new FacesMessage("ERROR", "Debes de elegir un usuario para poder ver sus totales"); + FacesContext.getCurrentInstance().addMessage(null, msg); + imprimirStatus = true; + userId = ""; + return; + } + if (loanCtrl.countLoanDetailsAuthorize(userId) > 0) { + FacesMessage msg = new FacesMessage("Depositos pendientes", "No se puede realizar el corte de caja, autorice todas los depositos pendientes"); + FacesContext.getCurrentInstance().addMessage(null, msg); + userId = ""; + return; + } + + if (closingDayCtrl.getClosingDayCurdateByUserId(userId, getLoggedUser().getOffice().getId()) > 0) { + FacesMessage msg = new FacesMessage("Corte encontrado", "El usuario ya tiene un corte registrado el dĆ­a de hoy."); + FacesContext.getCurrentInstance().addMessage(null, msg); + userId = ""; + return; + } + totales = new TotalCashByCurdateView(); + totales.setMoneyDaily(BigDecimal.ZERO); + totales.setPaymentDaily(BigDecimal.ZERO); + totales.setTransferReceiver(BigDecimal.ZERO); + totales.setTransferSender(BigDecimal.ZERO); + totales.setDelivery(BigDecimal.ZERO); + totales.setTransferPending(BigDecimal.ZERO); + totales.setOtherExpense(BigDecimal.ZERO); + totales.setDepositDaily(BigDecimal.ZERO); + total = BigDecimal.ZERO.toString(); + totalCustomerWithOutAction = new Long(0); + comments = ""; + TotalCashByCurdateView temp; + temp = closingDayCtrl.getTotalCashByCurdateViewById(userId); + if (temp != null) { + totales = temp; + total = temp.getTotal().toString(); + } + + if (closingDetail != null && !closingDetail.isEmpty()) { + closingDetail.clear(); + } + + User userObj = closingDayCtrl.getUserById(userId); + + if (userObj.getCertifier().equals(ActiveStatus.DISABLED)) { + closingDetail = fillDatatableClosingDetails(userId); + } else { + closingDetail = closingDayCtrl.findAllClosingDailyDetailFromUserCertifierByCurdateView(userId); + } + + totalCustomerWithOutAction = closingDayCtrl.getLoansCountDailyByUser(userId); + paymentoZeroDetail = getLoansPaymentZeroByUser(userId); + + imprimirStatus = false; + // imprimirStatus(); + } + + public void imprimir() { + if (userId.equalsIgnoreCase("")) { + FacesMessage msg = new FacesMessage("ERROR", "Debes de elegir un usuario para poder imprimir el corte."); + FacesContext.getCurrentInstance().addMessage(null, msg); + userId = ""; + imprimirStatus = true; + return; + } + Document document = new Document(PageSize.LETTER); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + try { + PdfWriter.getInstance(document, baos); + List results = new ArrayList<>(); + results = closingDayCtrl.findDetailsFromClosingDayCurDate(userId); + document.open(); + + DateFormat formatter = new SimpleDateFormat("dd/MM/yy"); + DateFormat formatter2 = new SimpleDateFormat("dd/MM/yyyy HH:mm:SS"); + formatter2.setTimeZone(TimeZone.getTimeZone("GMT-6")); + + Paragraph printDate = new Paragraph("Fecha de impresiĆ³n: " + formatter.format(new Date()), FontFactory.getFont("arial", 10, Font.BOLD, BaseColor.DARK_GRAY)); + printDate.setAlignment(Element.ALIGN_RIGHT); + document.add(printDate); + + ServletContext servletContext = (ServletContext) FacesContext.getCurrentInstance().getExternalContext().getContext(); + String carpetaImagen = (String) servletContext.getRealPath("resources/serenity-layout/images"); + + Image imagen = Image.getInstance(carpetaImagen + "/ace_logo.jpg"); + imagen.scalePercent(4f); + imagen.setAlignment(Element.ALIGN_CENTER); + document.add(imagen); + + Paragraph title = new Paragraph("Corte del dĆ­a", FontFactory.getFont("arial", 18, Font.BOLD, BaseColor.DARK_GRAY)); + title.setAlignment(Element.ALIGN_CENTER); + document.add(title); + + document.add(Chunk.NEWLINE); + + Object[] res = (Object[]) results.get(0); + BigDecimal totalesRep = BigDecimal.ZERO; + BigDecimal recuperado = BigDecimal.ZERO; + BigDecimal transEnv = BigDecimal.ZERO; + BigDecimal transRec = BigDecimal.ZERO; + BigDecimal inicio = BigDecimal.ZERO; + BigDecimal gastos = BigDecimal.ZERO; + BigDecimal depositos = BigDecimal.ZERO; + BigDecimal entrPrestamos = BigDecimal.ZERO; + + PdfPTable tableGen = new PdfPTable(4); + tableGen.setWidthPercentage(100); + tableGen.setTotalWidth(new float[]{100f, 170f, 140f, 150f}); + tableGen.setLockedWidth(true); + + PdfPCell cellGen = new PdfPCell(new Paragraph("Asesor: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + cellGen = new PdfPCell(new Paragraph(res[8] == null ? "" : res[8].toString(), + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(3); + tableGen.addCell(cellGen); + + cellGen = new PdfPCell(new Paragraph("Monto recuperado: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + recuperado = new BigDecimal(res[9] == null ? "0.0" : res[9].toString()); + cellGen = new PdfPCell(new Paragraph(res[9] != null ? "$" + res[9].toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + cellGen = new PdfPCell(new Paragraph("Monto enviado por transferencia: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + transEnv = new BigDecimal(res[11] == null ? "0.0" : res[11].toString()); + cellGen = new PdfPCell(new Paragraph(res[11] != null ? "$" + res[11].toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + + cellGen = new PdfPCell(new Paragraph("Monto de inicio: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + inicio = new BigDecimal(res[13] == null ? "0.0" : res[13].toString()); + cellGen = new PdfPCell(new Paragraph(res[13] != null ? "$" + res[13].toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + cellGen = new PdfPCell(new Paragraph("Monto recibido por transferencia: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + transRec = new BigDecimal(res[12] == null ? "0.0" : res[12].toString()); + cellGen = new PdfPCell(new Paragraph(res[12] != null ? "$" + res[12].toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + + cellGen = new PdfPCell(new Paragraph("Entrega de prĆ©stamos: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + entrPrestamos = new BigDecimal(res[15] == null ? "0.0" : res[15].toString()); + cellGen = new PdfPCell(new Paragraph(res[15] != null ? "$" + res[15].toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + cellGen = new PdfPCell(new Paragraph("Gastos: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + gastos = new BigDecimal(res[14] == null ? "0.0" : res[14].toString()); + cellGen = new PdfPCell(new Paragraph(res[14] != null ? "$" + res[14].toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + + cellGen = new PdfPCell(new Paragraph("DepĆ³sitos: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + depositos = new BigDecimal(res[10] == null ? "0.0" : res[10].toString()); + cellGen = new PdfPCell(new Paragraph(res[10] != null ? "$" + res[10].toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + totalesRep = totalesRep.add(recuperado).subtract(transEnv).add(transRec).add(inicio).subtract(gastos).subtract(entrPrestamos); + cellGen = new PdfPCell(new Paragraph("Total: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + cellGen = new PdfPCell(new Paragraph(totalesRep != null ? "$" + totalesRep.toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + + cellGen = new PdfPCell(new Paragraph("Monto Esperado: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + cellGen = new PdfPCell(new Paragraph(totales.getTotal() != null ? "$" + totales.getTotal().toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + cellGen = new PdfPCell(new Paragraph("Monto Entregado: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + cellGen = new PdfPCell(new Paragraph(new BigDecimal(total) != null ? "$" + new BigDecimal(total).toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + + document.add(tableGen); + document.add(Chunk.NEWLINE); + + PdfPTable table = new PdfPTable(7); + table.setTotalWidth(new float[]{60, 60, 60, 60, 170, 60, 100}); + + table.setLockedWidth(true); + PdfPCell cell = new PdfPCell(new Paragraph("Detalles del corte", + FontFactory.getFont("arial", 10, Font.BOLD, BaseColor.WHITE))); + + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setBackgroundColor(new BaseColor(41, 171, 225)); + cell.setColspan(7); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("Detalle", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setColspan(1); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("P. anterior", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setColspan(1); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("C. apertura", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setColspan(1); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("Monto", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setColspan(1); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("Saldo insoluto", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setColspan(1); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("Tipo", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setColspan(1); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("Fecha", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setColspan(1); + table.addCell(cell); + + for (Object result : results) { + Object[] tmp = (Object[]) result; + // Detalle + cell = new PdfPCell(new Paragraph(tmp[0] == null ? "" : tmp[0].toString(), + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_LEFT); + cell.setColspan(1); + table.addCell(cell); + //PrĆ©stamo anterior + cell = new PdfPCell(new Paragraph(tmp[6] != null ? "$" + tmp[6].toString() : "$0.00", + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_LEFT); + cell.setColspan(1); + table.addCell(cell); + // ComisiĆ³n por apertura + cell = new PdfPCell(new Paragraph(tmp[5] != null ? "$" + tmp[5].toString() : "$0.00", + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_LEFT); + cell.setColspan(1); + table.addCell(cell); + // Monto + cell = new PdfPCell(new Paragraph(tmp[1] != null ? "$" + tmp[1].toString() : "$0.00", + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_LEFT); + cell.setColspan(1); + table.addCell(cell); + // Saldo insoluto + cell = new PdfPCell(new Paragraph(tmp[3] != null ? "$" + tmp[3].toString() : "$0.00", + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_LEFT); + cell.setColspan(1); + table.addCell(cell); + // Tipo + cell = new PdfPCell(new Paragraph(tmp[2] == null ? "" : tmp[2].toString(), + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_LEFT); + cell.setColspan(1); + table.addCell(cell); + // Fecha + cell = new PdfPCell(new Paragraph(tmp[4] == null ? "" : formatter2.format((Date) tmp[4]), + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_LEFT); + cell.setColspan(1); + table.addCell(cell); + } + + document.add(table); + + document.add(Chunk.NEWLINE); + document.add(Chunk.NEWLINE); + document.add(Chunk.NEWLINE); + document.add(Chunk.NEWLINE); + + document.add(new Paragraph(" __________________________ __________________________")); + document.add(new Paragraph(" Firma Nombre y firma cajero responsable")); + document.add(new Paragraph(" " + res[8] == null ? "" : res[8].toString())); + + } catch (Exception e) { + System.out.print("Error 1: " + e.getMessage()); + } + + document.close(); + FacesContext context = FacesContext.getCurrentInstance(); + Object response = context.getExternalContext().getResponse(); + if (response instanceof HttpServletResponse) { + HttpServletResponse hrs = (HttpServletResponse) response; + hrs.setContentType("application/pdf"); + //hrs.setHeader("Content-disposition", "attachment"); + hrs.setHeader("Content-disposition", "attachment;filename=corte_del_dĆ­a.pdf"); + hrs.setContentLength(baos.size()); + try { + ServletOutputStream out = hrs.getOutputStream(); + baos.writeTo(out); + out.flush(); + + } catch (IOException e) { + System.out.print("Error 2: " + e.getMessage()); + } + context.responseComplete(); + } + } + + public void imprimirHistory() { + + Document document = new Document(PageSize.LETTER); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + try { + PdfWriter.getInstance(document, baos); + List results = new ArrayList<>(); + results = closingDayCtrl.findDetailsFromClosingDayHisotry(selectedClosingDay.getId()); + document.open(); + DateFormat formatter2 = new SimpleDateFormat("dd/MM/yyyy HH:mm:SS"); + formatter2.setTimeZone(TimeZone.getTimeZone("GMT-6")); + + Object[] res = (Object[]) results.get(0); + BigDecimal totalesRep = BigDecimal.ZERO; + BigDecimal recuperado = BigDecimal.ZERO; + BigDecimal transEnv = BigDecimal.ZERO; + BigDecimal transRec = BigDecimal.ZERO; + BigDecimal inicio = BigDecimal.ZERO; + BigDecimal gastos = BigDecimal.ZERO; + BigDecimal depositos = BigDecimal.ZERO; + BigDecimal entrPrestamos = BigDecimal.ZERO; + + Paragraph printDate = new Paragraph("Fecha de impresiĆ³n: " + res[3], FontFactory.getFont("arial", 10, Font.BOLD, BaseColor.DARK_GRAY)); + printDate.setAlignment(Element.ALIGN_RIGHT); + document.add(printDate); + + ServletContext servletContext = (ServletContext) FacesContext.getCurrentInstance().getExternalContext().getContext(); + String carpetaImagen = (String) servletContext.getRealPath("resources/serenity-layout/images"); + + Image imagen = Image.getInstance(carpetaImagen + "/ace_logo.jpg"); + imagen.scalePercent(4f); + imagen.setAlignment(Element.ALIGN_CENTER); + document.add(imagen); + + Paragraph title = new Paragraph("Corte del dĆ­a", FontFactory.getFont("arial", 18, Font.BOLD, BaseColor.DARK_GRAY)); + title.setAlignment(Element.ALIGN_CENTER); + document.add(title); + + document.add(Chunk.NEWLINE); + + PdfPTable tableGen = new PdfPTable(4); + tableGen.setWidthPercentage(100); + tableGen.setTotalWidth(new float[]{100f, 170f, 140f, 150f}); + tableGen.setLockedWidth(true); + + PdfPCell cellGen = new PdfPCell(new Paragraph("Asesor: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + cellGen = new PdfPCell(new Paragraph(res[6] == null ? "" : res[6].toString(), + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(3); + tableGen.addCell(cellGen); + + cellGen = new PdfPCell(new Paragraph("Monto recuperado: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + recuperado = new BigDecimal(res[7] == null ? "0.0" : res[7].toString()); + cellGen = new PdfPCell(new Paragraph(res[7] != null ? "$" + res[7].toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + cellGen = new PdfPCell(new Paragraph("Monto enviado por transferencia: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + transEnv = new BigDecimal(res[9] == null ? "0.0" : res[9].toString()); + cellGen = new PdfPCell(new Paragraph(res[9] != null ? "$" + res[9].toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + + cellGen = new PdfPCell(new Paragraph("Monto de inicio: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + inicio = new BigDecimal(res[10] == null ? "0.0" : res[11].toString()); + cellGen = new PdfPCell(new Paragraph(res[11] != null ? "$" + res[11].toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + cellGen = new PdfPCell(new Paragraph("Monto recibido por transferencia: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + transRec = new BigDecimal(res[10] == null ? "0.0" : res[10].toString()); + cellGen = new PdfPCell(new Paragraph(res[10] != null ? "$" + res[10].toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + + cellGen = new PdfPCell(new Paragraph("Entrega de prĆ©stamos: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + entrPrestamos = new BigDecimal(res[13] == null ? "0.0" : res[13].toString()); + cellGen = new PdfPCell(new Paragraph(res[13] != null ? "$" + res[13].toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + cellGen = new PdfPCell(new Paragraph("Gastos: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + gastos = new BigDecimal(res[12] == null ? "0.0" : res[12].toString()); + cellGen = new PdfPCell(new Paragraph(res[12] != null ? "$" + res[12].toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + + cellGen = new PdfPCell(new Paragraph("DepĆ³sitos: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + depositos = new BigDecimal(res[8] == null ? "0.0" : res[8].toString()); + cellGen = new PdfPCell(new Paragraph(res[8] != null ? "$" + res[8].toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + totalesRep = totalesRep.add(recuperado).subtract(transEnv).add(transRec).add(inicio).subtract(gastos).subtract(entrPrestamos); + cellGen = new PdfPCell(new Paragraph("Total: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + cellGen = new PdfPCell(new Paragraph(totalesRep != null ? "$" + totalesRep.toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + + cellGen = new PdfPCell(new Paragraph("Monto Esperado: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + cellGen = new PdfPCell(new Paragraph(res[4] != null ? "$" + res[4].toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + cellGen = new PdfPCell(new Paragraph("Monto Entregado: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + cellGen = new PdfPCell(new Paragraph(res[5] != null ? "$" + res[5].toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + + document.add(tableGen); + document.add(Chunk.NEWLINE); + + PdfPTable table = new PdfPTable(7); + table.setTotalWidth(new float[]{60, 60, 60, 60, 170, 60, 100}); + + table.setLockedWidth(true); + PdfPCell cell = new PdfPCell(new Paragraph("Detalles del corte", + FontFactory.getFont("arial", 10, Font.BOLD, BaseColor.WHITE))); + + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setBackgroundColor(new BaseColor(41, 171, 225)); + cell.setColspan(7); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("Detalle", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setColspan(1); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("P. anterior", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setColspan(1); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("C. apertura", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setColspan(1); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("Monto", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setColspan(1); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("Saldo insoluto", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setColspan(1); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("Tipo", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setColspan(1); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("Fecha", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setColspan(1); + table.addCell(cell); + + for (Object result : results) { + Object[] tmp = (Object[]) result; + // Detalle + cell = new PdfPCell(new Paragraph(tmp[0] == null ? "" : tmp[0].toString(), + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_LEFT); + cell.setColspan(1); + table.addCell(cell); + cell = new PdfPCell(new Paragraph("", + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_LEFT); + cell.setColspan(1); + table.addCell(cell); + cell = new PdfPCell(new Paragraph("", + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_LEFT); + cell.setColspan(1); + table.addCell(cell); + + // Monto + cell = new PdfPCell(new Paragraph(tmp[1] != null ? "$" + tmp[1].toString() : "$0.00", + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_LEFT); + cell.setColspan(1); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("", + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_LEFT); + cell.setColspan(1); + table.addCell(cell); + + // Tipo + cell = new PdfPCell(new Paragraph(tmp[2] == null ? "" : tmp[2].toString(), + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_LEFT); + cell.setColspan(1); + table.addCell(cell); + // Fecha + cell = new PdfPCell(new Paragraph(tmp[15] == null ? "" : formatter2.format((Date) tmp[15]), + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_LEFT); + cell.setColspan(1); + table.addCell(cell); + } + + document.add(table); + + document.add(Chunk.NEWLINE); + document.add(Chunk.NEWLINE); + document.add(Chunk.NEWLINE); + document.add(Chunk.NEWLINE); + + document.add(new Paragraph(" __________________________ __________________________")); + document.add(new Paragraph(" Firma Nombre y firma cajero responsable")); + document.add(new Paragraph(" " + res[6] == null ? "" : res[6].toString())); + + } catch (Exception e) { + System.out.print("Error 1: " + e.getMessage()); + } + + document.close(); + FacesContext context = FacesContext.getCurrentInstance(); + Object response = context.getExternalContext().getResponse(); + if (response instanceof HttpServletResponse) { + HttpServletResponse hrs = (HttpServletResponse) response; + hrs.setContentType("application/pdf"); + //hrs.setHeader("Content-disposition", "attachment"); + hrs.setHeader("Content-disposition", "attachment;filename=corte_del_dĆ­a.pdf"); + hrs.setContentLength(baos.size()); + try { + ServletOutputStream out = hrs.getOutputStream(); + baos.writeTo(out); + out.flush(); + + } catch (IOException e) { + System.out.print("Error 2: " + e.getMessage()); + } + context.responseComplete(); + } + } + + @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 onRowReorder(ReorderEvent event) { + showMessage(FacesMessage.SEVERITY_INFO, "Registro Movido", "De columna: " + (event.getFromIndex() + 1) + " a columna: " + (event.getToIndex() + 1)); + } + + @Override + public void addRow() { + if (userId.equalsIgnoreCase("")) { + FacesMessage msg = new FacesMessage("ERROR", "Debes de elegir un usuario para poder generar el corte."); + FacesContext.getCurrentInstance().addMessage(null, msg); + imprimirStatus = true; + userId = ""; + return; + } + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); + calendar.set(Calendar.HOUR_OF_DAY, 12); + calendar.set(Calendar.MINUTE, 0); + calendar.set(Calendar.SECOND, 0); + calendar.set(Calendar.MILLISECOND, 0); + int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK); + + 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."); + FacesContext.getCurrentInstance().addMessage(null, msg); + return; + } + } + + if (totales.getTotal().compareTo(new BigDecimal(total)) != 0) { + if (comments == null || comments.trim().equals("")) { + FacesMessage msg = new FacesMessage("ERROR", "Es necesario capturar las observaciones."); + FacesContext.getCurrentInstance().addMessage(null, msg); + return; + } + } + + User userData = null; + for (User us : user) { + if (us.getId().equalsIgnoreCase(userId)) { + userData = us; + break; + } + } + + ClosingDay closingSave = new ClosingDay(); + closingSave.setActiveStatus(ActiveStatus.ENEBLED); + closingSave.setAmountExpected(totales.getTotal()); + closingSave.setAmountPaid(new BigDecimal(total)); + closingSave.setOffice(new Office(getLoggedUser().getOffice().getId())); + closingSave.setUser(new User(userId)); + closingSave.setCreatedBy(getLoggedUser()); + closingSave.setCreatedOn(new Date()); + closingSave.setComments(comments); + closingSave.setRouteCtlg(userData.getHumanResource().getHumanResourceHasRoutes().get(0).getRouteCtlg()); + if (closingDayCtrl.saveClosingDay(closingSave)) { + if (closingDetail != null && !closingDetail.isEmpty()) { + List detail = new ArrayList(); + + for (ClosingDailyDetailFromUserByCurdateView info : closingDetail) { + ClosingDayDetail detailInfo = new ClosingDayDetail(); + detailInfo.setAmount(info.getAmount()); + detailInfo.setClosingDay(closingSave); + detailInfo.setComments(info.getComments()); + detailInfo.setCreatedBy(getLoggedUser().getId()); + detailInfo.setCreatedOn(new Date()); + detailInfo.setDateDetail(info.getCreatedOn()); + detailInfo.setType(info.getType()); + detail.add(detailInfo); + } + closingDayCtrl.saveClosingDayDetail(detail); + } + + } + getResumen(); + totales = new TotalCashByCurdateView(); + totales.setMoneyDaily(BigDecimal.ZERO); + totales.setPaymentDaily(BigDecimal.ZERO); + totales.setTransferReceiver(BigDecimal.ZERO); + totales.setTransferSender(BigDecimal.ZERO); + totales.setDelivery(BigDecimal.ZERO); + totales.setTotal(BigDecimal.ZERO); + totales.setTransferPending(BigDecimal.ZERO); + totales.setOtherExpense(BigDecimal.ZERO); + totales.setDepositDaily(BigDecimal.ZERO); + total = BigDecimal.ZERO.toString(); + totalBox = BigDecimal.ZERO; + totalCustomerWithOutAction = new Long(0); + totalBox = genericCtrl.findAllSmallBox(getLoggedUser().getOffice().getId()); + comments = ""; + closingDetail.clear(); + paymentoZeroDetail.clear(); + FacesMessage msg = new FacesMessage("Nuevo corte registrado", "Se agregĆ³ correctamente"); + FacesContext.getCurrentInstance().addMessage(null, msg); + } + + @Override + public void deleteRow() { + try { + if (closingDayCtrl.existStableSmallBoxByCreatedOn(selectedClosingDay.getCreatedOn())) { + showMessage(FacesMessage.SEVERITY_WARN, "Corte del dĆ­a", "No se puede borrar porque ya se realizo el cuadre de caja chica del dĆ­a."); + } else { + boolean delete = true; + delete = selectedClosingDay.getActiveStatus() == ActiveStatus.ENEBLED ? true : false; + + if (delete) { + Bitacora bitacora = new Bitacora(); + ClosingDay closing = closingDayCtrl.getClosingDayById(selectedClosingDay.getId()); + bitacora.setAction("Eliminar corte del dĆ­a"); + 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 corte del asesor " + closing.getUser().getUserName() + " con monto $" + + selectedClosingDay.getAmountPaid() + " y fecha " + closing.getCreatedOn()); + closingDayCtrl.updateClosingDayByStatus(ActiveStatus.DISABLED, selectedClosingDay.getId(), getLoggedUser().getUser().getId()); + //closingDay.remove(selectedClosingDay); + searchHistoricalAction(); + bitacoraCtrl.saveBitacora(bitacora); + commentsBitacora = ""; + selectedClosingDay = null; + showMessage(FacesMessage.SEVERITY_INFO, "Corte del dĆ­a", "Se eliminĆ³ correctamente."); + } + } + } catch (Exception e) { + } + } + + public ClosingDayController getClosingDayCtrl() { + return closingDayCtrl; + } + + public void setClosingDayCtrl(ClosingDayController closingDayCtrl) { + this.closingDayCtrl = closingDayCtrl; + } + + public List getClosingDay() { + return closingDay; + } + + public void setClosingDay(List closingDay) { + this.closingDay = closingDay; + } + + public List getUser() { + return user; + } + + public void setUser(List user) { + this.user = user; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getAmount() { + return amount; + } + + public void setAmount(String amount) { + this.amount = amount; + } + + public ClosingDay getSelectedClosingDay() { + return selectedClosingDay; + } + + public void setSelectedClosingDay(ClosingDay selectedClosingDay) { + this.selectedClosingDay = selectedClosingDay; + } + + public TotalCashByCurdateView getTotales() { + return totales; + } + + public void setTotales(TotalCashByCurdateView totales) { + this.totales = totales; + } + + public String getTotal() { + return total; + } + + public void setTotal(String total) { + this.total = total; + } + + public BigDecimal getTotalAmount() { + return totalAmount; + } + + public void setTotalAmount(BigDecimal totalAmount) { + this.totalAmount = totalAmount; + } + + public BigDecimal getTotalTransferSender() { + return totalTransferSender; + } + + public void setTotalTransferSender(BigDecimal totalTransferSender) { + this.totalTransferSender = totalTransferSender; + } + + public BigDecimal getTotalTransferReceiver() { + return totalTransferReceiver; + } + + public void setTotalTransferReceiver(BigDecimal totalTransferReceiver) { + this.totalTransferReceiver = totalTransferReceiver; + } + + public BigDecimal getTotalMoneyDaily() { + return totalMoneyDaily; + } + + public void setTotalMoneyDaily(BigDecimal totalMoneyDaily) { + this.totalMoneyDaily = totalMoneyDaily; + } + + public BigDecimal getTotalDelivery() { + return totalDelivery; + } + + public void setTotalDelivery(BigDecimal totalDelivery) { + this.totalDelivery = totalDelivery; + } + + public BigDecimal getTotalFinal() { + return totalFinal; + } + + public void setTotalFinal(BigDecimal totalFinal) { + this.totalFinal = totalFinal; + } + + public BigDecimal getTotalCaja() { + return totalCaja; + } + + public void setTotalCaja(BigDecimal totalCaja) { + this.totalCaja = totalCaja; + } + + public BigDecimal getTotalOtherExpense() { + return totalOtherExpense; + } + + public void setTotalOtherExpense(BigDecimal totalOtherExpense) { + this.totalOtherExpense = totalOtherExpense; + } + + public String getComments() { + return comments; + } + + public void setComments(String comments) { + this.comments = comments; + } + + public GenericController getGenericCtrl() { + return genericCtrl; + } + + public void setGenericCtrl(GenericController genericCtrl) { + this.genericCtrl = genericCtrl; + } + + public List getClosingDetail() { + return closingDetail; + } + + public void setClosingDetail(List closingDetail) { + this.closingDetail = closingDetail; + } + + public BigDecimal getTotalBox() { + return totalBox; + } + + public void setTotalBox(BigDecimal totalBox) { + this.totalBox = totalBox; + } + + public Long getTotalCustomerWithOutAction() { + return totalCustomerWithOutAction; + } + + public void setTotalCustomerWithOutAction(Long totalCustomerWithOutAction) { + this.totalCustomerWithOutAction = totalCustomerWithOutAction; + } + + public List getPaymentoZeroDetail() { + return paymentoZeroDetail; + } + + public void setPaymentoZeroDetail(List paymentoZeroDetail) { + this.paymentoZeroDetail = paymentoZeroDetail; + } + + public BigDecimal getDeposit() { + return deposit; + } + + public void setDeposit(BigDecimal deposit) { + this.deposit = deposit; + } + + public String getCommentsBitacora() { + return commentsBitacora; + } + + public void setCommentsBitacora(String commentsBitacora) { + this.commentsBitacora = commentsBitacora; + } + + public LoanController getLoanCtrl() { + return loanCtrl; + } + + public void setLoanCtrl(LoanController loanCtrl) { + this.loanCtrl = loanCtrl; + } + + public boolean getImprimirStatus() { + return imprimirStatus; + } + + public void setImprimirStatus(boolean imprimirStatus) { + this.imprimirStatus = imprimirStatus; + } + + private ClosingDayController closingDayCtrl; + private GenericController genericCtrl; + private BitacoraController bitacoraCtrl; + private LoanController loanCtrl; + + private List closingDay; + private List user; + + private String userId; + private String amount; + private String total; + + private BigDecimal totalAmount; + private BigDecimal totalTransferSender; + private BigDecimal totalTransferReceiver; + private BigDecimal totalMoneyDaily; + private BigDecimal totalDelivery; + private BigDecimal totalFinal; + private BigDecimal totalCaja; + private BigDecimal totalOtherExpense; + private BigDecimal totalBox; + private Long totalCustomerWithOutAction; + private BigDecimal deposit; + + private String commentsBitacora; + + private String comments; + private boolean imprimirStatus; + + private TotalCashByCurdateView totales; + + private ClosingDay selectedClosingDay; + + private List closingDetail; + private List paymentoZeroDetail; + + @PostConstruct + public void init() { + loadBundlePropertyFile(); + + loanCtrl = new LoanController(); + closingDayCtrl = new ClosingDayController(); + bitacoraCtrl = new BitacoraController(); + genericCtrl = new GenericController(); + + //initOneWeekBeforeToCurrdate(); + initThisWeekToCurrdate(); + + imprimirStatus = true; + closingDay = fillDatatableClosingDay(); + commentsBitacora = ""; + user = getUsers(); + getResumen(); + comments = ""; + totalBox = genericCtrl.findAllSmallBox(getLoggedUser().getOffice().getId()); + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/ClosingDayBean.java.bak b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/ClosingDayBean.java.bak new file mode 100644 index 0000000..c5733cc --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/ClosingDayBean.java.bak @@ -0,0 +1,1281 @@ +/* + * 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.web.beans.admin; + +import com.arrebol.apc.controller.BitacoraController; +import com.arrebol.apc.controller.GenericController; +import com.arrebol.apc.controller.admin.ClosingDayController; +import com.arrebol.apc.controller.admin.LoanController; +import com.arrebol.apc.model.admin.ClosingDay; +import com.arrebol.apc.model.admin.ClosingDayDetail; +import com.arrebol.apc.model.catalog.RouteCtlg; +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.system.logs.Bitacora; +import com.arrebol.apc.model.views.ClosingDailyDetailFromUserByCurdateView; +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.TotalClosingDayByCurdateView; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import com.itextpdf.text.BaseColor; +import com.itextpdf.text.Chunk; +import com.itextpdf.text.Document; +import com.itextpdf.text.Element; +import com.itextpdf.text.FontFactory; +import com.itextpdf.text.Image; +import com.itextpdf.text.PageSize; +import com.itextpdf.text.Paragraph; +import com.itextpdf.text.pdf.PdfPCell; +import com.itextpdf.text.pdf.PdfPTable; +import com.itextpdf.text.pdf.PdfWriter; +import java.awt.Font; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.Serializable; +import java.math.BigDecimal; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.time.ZoneId; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.TimeZone; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.context.FacesContext; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Named("closingDayManager") +@ViewScoped +public class ClosingDayBean 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 { + setClosingDay(getClosingDayCtrl().fillClosingDayDatatable(getLoggedUser().getOffice().getId(), getStarDate(), getEndDate())); + } + } catch (Exception e) { + } + } + + public List fillDatatableClosingDay() { + + return getClosingDayCtrl().fillClosingDayDatatable(getLoggedUser().getOffice().getId(), getStarDate(), getEndDate()); + } + + /** + * + * @param outcome + * @return + */ + public String detailClosingDay(String outcome) { + return outcome; + } + + public List getUsers() { + + return genericCtrl.getAllUsersByOffice(getLoggedUser().getOffice().getId()); + } + + public List fillDatatableClosingDetails(String idUser) { + + return closingDayCtrl.findAllClosingDailyDetailFromUserByCurdateView(idUser); + } + + public List getLoansPaymentZeroByUser(String idUser) { + + return closingDayCtrl.getLoansPaymentZeroByUser(idUser); + } + + public void getResumen() { + + List listTotal = closingDayCtrl.getAllTotalCashByCurdateDashboardView(getLoggedUser().getOffice().getId()); + totalAmount = BigDecimal.ZERO; + totalTransferSender = BigDecimal.ZERO; + totalTransferReceiver = BigDecimal.ZERO; + totalMoneyDaily = BigDecimal.ZERO; + totalDelivery = BigDecimal.ZERO; + totalFinal = BigDecimal.ZERO; + totalCaja = BigDecimal.ZERO; + totalOtherExpense = BigDecimal.ZERO; + deposit = BigDecimal.ZERO; + + for (TotalCashByCurdateDashboardView temp : listTotal) { + totalAmount = totalAmount.add(temp.getPaymentDaily()); + totalTransferSender = totalTransferSender.add(temp.getTransferSender()); + totalTransferReceiver = totalTransferReceiver.add(temp.getTransferReceiver()); + totalMoneyDaily = totalMoneyDaily.add(temp.getMoneyDaily()); + totalDelivery = totalDelivery.add(temp.getDelivery()); + deposit = deposit.add(temp.getDepositDaily()); + totalFinal = totalFinal.add(temp.getTotal()); + totalOtherExpense = totalOtherExpense.add(temp.getOtherExpense()); + } + + List closingTotal = closingDayCtrl.findAllClosingDayByCurdate(getLoggedUser().getOffice().getId()); + if (closingTotal != null && !closingTotal.isEmpty()) { + for (TotalClosingDayByCurdateView temp : closingTotal) { + totalCaja = totalCaja.add(temp.getAmountPaid()); + } + } + + } + + public void getCashTotal() { + + + if(userId.equalsIgnoreCase("")){ + FacesMessage msg = new FacesMessage("ERROR", "Debes de elegir un usuario para poder ver sus totales"); + FacesContext.getCurrentInstance().addMessage(null, msg); + imprimirStatus = true; + userId = ""; + return; + } + if(loanCtrl.countLoanDetailsAuthorize(userId)>0){ + FacesMessage msg = new FacesMessage("Depositos pendientes", "No se puede realizar el corte de caja, autorice todas los depositos pendientes"); + FacesContext.getCurrentInstance().addMessage(null, msg); + userId = ""; + return; + } + + if (closingDayCtrl.getClosingDayCurdateByUserId(userId, getLoggedUser().getOffice().getId()) > 0) { + FacesMessage msg = new FacesMessage("Corte encontrado", "El usuario ya tiene un corte registrado el dĆ­a de hoy."); + FacesContext.getCurrentInstance().addMessage(null, msg); + userId = ""; + return; + } + totales = new TotalCashByCurdateView(); + totales.setMoneyDaily(BigDecimal.ZERO); + totales.setPaymentDaily(BigDecimal.ZERO); + totales.setTransferReceiver(BigDecimal.ZERO); + totales.setTransferSender(BigDecimal.ZERO); + totales.setDelivery(BigDecimal.ZERO); + totales.setTransferPending(BigDecimal.ZERO); + totales.setOtherExpense(BigDecimal.ZERO); + totales.setDepositDaily(BigDecimal.ZERO); + total = BigDecimal.ZERO.toString(); + totalCustomerWithOutAction = new Long(0); + comments = ""; + TotalCashByCurdateView temp; + temp = closingDayCtrl.getTotalCashByCurdateViewById(userId); + if (temp != null) { + totales = temp; + total = temp.getTotal().toString(); + } + + if (closingDetail != null && !closingDetail.isEmpty()) { + closingDetail.clear(); + } + + User userObj = closingDayCtrl.getUserById(userId); + + + if (userObj.getCertifier().equals(ActiveStatus.DISABLED)) { + closingDetail = fillDatatableClosingDetails(userId); + } else { + closingDetail = closingDayCtrl.findAllClosingDailyDetailFromUserCertifierByCurdateView(userId); + } + + totalCustomerWithOutAction = closingDayCtrl.getLoansCountDailyByUser(userId); + paymentoZeroDetail = getLoansPaymentZeroByUser(userId); + + imprimirStatus = false; + // imprimirStatus(); + } + + public void imprimir() { + if (userId.equalsIgnoreCase("")) { + FacesMessage msg = new FacesMessage("ERROR", "Debes de elegir un usuario para poder imprimir el corte."); + FacesContext.getCurrentInstance().addMessage(null, msg); + userId = ""; + imprimirStatus = true; + return; + } + Document document = new Document(PageSize.LETTER); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + try { + PdfWriter.getInstance(document, baos); + List results = new ArrayList<>(); + results = closingDayCtrl.findDetailsFromClosingDayCurDate(userId); + document.open(); + + DateFormat formatter = new SimpleDateFormat("dd/MM/yy"); + DateFormat formatter2 = new SimpleDateFormat("dd/MM/yyyy HH:mm:SS"); + formatter2.setTimeZone(TimeZone.getTimeZone("GMT-6")); + + Paragraph printDate = new Paragraph("Fecha de impresiĆ³n: " + formatter.format(new Date()), FontFactory.getFont("arial", 10, Font.BOLD, BaseColor.DARK_GRAY)); + printDate.setAlignment(Element.ALIGN_RIGHT); + document.add(printDate); + +// Image imagen = Image.getInstance("other sources/resources/serenity-layout/images/ace_logo.jpg"); +// imagen.scaleAbsoluteWidth(100f); +// document.add(imagen); + + Paragraph title = new Paragraph("Corte del dĆ­a", FontFactory.getFont("arial", 18, Font.BOLD, BaseColor.DARK_GRAY)); + title.setAlignment(Element.ALIGN_CENTER); + document.add(title); + + document.add(Chunk.NEWLINE); + + Object[] res = (Object[]) results.get(0); + BigDecimal totalesRep = BigDecimal.ZERO; + BigDecimal recuperado = BigDecimal.ZERO; + BigDecimal transEnv = BigDecimal.ZERO; + BigDecimal transRec = BigDecimal.ZERO; + BigDecimal inicio = BigDecimal.ZERO; + BigDecimal gastos = BigDecimal.ZERO; + BigDecimal depositos = BigDecimal.ZERO; + BigDecimal entrPrestamos = BigDecimal.ZERO; + + + PdfPTable tableGen = new PdfPTable(4); + tableGen.setWidthPercentage(100); + tableGen.setTotalWidth(new float[]{100f, 170f, 140f, 150f}); + tableGen.setLockedWidth(true); + + PdfPCell cellGen = new PdfPCell(new Paragraph("Asesor: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + cellGen = new PdfPCell(new Paragraph(res[8] == null ? "" : res[8].toString(), + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(3); + tableGen.addCell(cellGen); + + cellGen = new PdfPCell(new Paragraph("Monto recuperado: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + recuperado = new BigDecimal(res[9] == null ? "0.0" : res[9].toString()); + cellGen = new PdfPCell(new Paragraph(res[9] != null ? "$" + res[9].toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + cellGen = new PdfPCell(new Paragraph("Monto enviado por transferencia: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + transEnv = new BigDecimal(res[11] == null ? "0.0" : res[11].toString()); + cellGen = new PdfPCell(new Paragraph(res[11] != null ? "$" + res[11].toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + + cellGen = new PdfPCell(new Paragraph("Monto de inicio: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + inicio = new BigDecimal(res[13] == null ? "0.0" : res[13].toString()); + cellGen = new PdfPCell(new Paragraph(res[13] != null ? "$" + res[13].toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + cellGen = new PdfPCell(new Paragraph("Monto recibido por transferencia: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + transRec = new BigDecimal(res[12] == null ? "0.0" : res[12].toString()); + cellGen = new PdfPCell(new Paragraph(res[12] != null ? "$" + res[12].toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + + cellGen = new PdfPCell(new Paragraph("Entrega de prĆ©stamos: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + entrPrestamos = new BigDecimal(res[15] == null ? "0.0" : res[15].toString()); + cellGen = new PdfPCell(new Paragraph(res[15] != null ? "$" + res[15].toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + cellGen = new PdfPCell(new Paragraph("Gastos: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + gastos = new BigDecimal(res[14] == null ? "0.0" : res[14].toString()); + cellGen = new PdfPCell(new Paragraph(res[14] != null ? "$" + res[14].toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + + cellGen = new PdfPCell(new Paragraph("DepĆ³sitos: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + depositos = new BigDecimal(res[10] == null ? "0.0" : res[10].toString()); + cellGen = new PdfPCell(new Paragraph(res[10] != null ? "$" + res[10].toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + totalesRep = totalesRep.add(recuperado).subtract(transEnv).add(transRec).add(inicio).subtract(gastos).subtract(entrPrestamos); + cellGen = new PdfPCell(new Paragraph("Total: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + cellGen = new PdfPCell(new Paragraph(totalesRep != null ? "$" + totalesRep.toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + + + + cellGen = new PdfPCell(new Paragraph("Monto Esperado: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + cellGen = new PdfPCell(new Paragraph(totales.getTotal() != null ? "$" + totales.getTotal().toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + cellGen = new PdfPCell(new Paragraph("Monto Entregado: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + cellGen = new PdfPCell(new Paragraph(new BigDecimal(total) != null ? "$" + new BigDecimal(total).toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + + document.add(tableGen); + document.add(Chunk.NEWLINE); + + PdfPTable table = new PdfPTable(7); + table.setTotalWidth(new float[]{60, 60, 60, 60, 170, 60, 100}); + + table.setLockedWidth(true); + PdfPCell cell = new PdfPCell(new Paragraph("Detalles del corte", + FontFactory.getFont("arial", 10, Font.BOLD, BaseColor.WHITE))); + + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setBackgroundColor(new BaseColor( 41, 171, 225 )); + cell.setColspan(7); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("Detalle", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setColspan(1); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("P. anterior", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setColspan(1); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("C. apertura", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setColspan(1); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("Monto", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setColspan(1); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("Saldo insoluto", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setColspan(1); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("Tipo", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setColspan(1); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("Fecha", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setColspan(1); + table.addCell(cell); + + for(Object result : results){ + Object[] tmp = (Object[]) result; + // Detalle + cell = new PdfPCell(new Paragraph(tmp[0] == null ? "" : tmp[0].toString(), + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_LEFT); + cell.setColspan(1); + table.addCell(cell); + //PrĆ©stamo anterior + cell = new PdfPCell(new Paragraph(tmp[6] != null ? "$" + tmp[6].toString() : "$0.00", + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_LEFT); + cell.setColspan(1); + table.addCell(cell); + // ComisiĆ³n por apertura + cell = new PdfPCell(new Paragraph(tmp[5] != null ? "$" + tmp[5].toString() : "$0.00", + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_LEFT); + cell.setColspan(1); + table.addCell(cell); + // Monto + cell = new PdfPCell(new Paragraph(tmp[1] != null ? "$" + tmp[1].toString() : "$0.00", + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_LEFT); + cell.setColspan(1); + table.addCell(cell); + // Saldo insoluto + cell = new PdfPCell(new Paragraph(tmp[3] != null ? "$" + tmp[3].toString() : "$0.00", + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_LEFT); + cell.setColspan(1); + table.addCell(cell); + // Tipo + cell = new PdfPCell(new Paragraph(tmp[2] == null ? "" : tmp[2].toString(), + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_LEFT); + cell.setColspan(1); + table.addCell(cell); + // Fecha + cell = new PdfPCell(new Paragraph(tmp[4] == null ? "" : formatter2.format((Date) tmp[4]), + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_LEFT); + cell.setColspan(1); + table.addCell(cell); + } + + document.add(table); + + document.add(Chunk.NEWLINE); + document.add(Chunk.NEWLINE); + document.add(Chunk.NEWLINE); + document.add(Chunk.NEWLINE); + + document.add(new Paragraph(" __________________________ __________________________")); + document.add(new Paragraph(" Firma Nombre y firma cajero responsable")); + document.add(new Paragraph(" " + res[8] == null ? "" : res[8].toString())); + + } catch (Exception e) { + System.out.print("Error 1: " + e.getMessage()); + } + + document.close(); + FacesContext context = FacesContext.getCurrentInstance(); + Object response = context.getExternalContext().getResponse(); + if (response instanceof HttpServletResponse) { + HttpServletResponse hrs = (HttpServletResponse) response; + hrs.setContentType("application/pdf"); + //hrs.setHeader("Content-disposition", "attachment"); + hrs.setHeader("Content-disposition", "attachment;filename=corte_del_dĆ­a.pdf"); + hrs.setContentLength(baos.size()); + try { + ServletOutputStream out = hrs.getOutputStream(); + baos.writeTo(out); + out.flush(); + + } catch (IOException e) { + System.out.print("Error 2: " + e.getMessage()); + } + context.responseComplete(); + } + } + + public void imprimirHistory() { + + Document document = new Document(PageSize.LETTER); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + try { + PdfWriter.getInstance(document, baos); + List results = new ArrayList<>(); + results = closingDayCtrl.findDetailsFromClosingDayHisotry(selectedClosingDay.getId()); + document.open(); + DateFormat formatter2 = new SimpleDateFormat("dd/MM/yyyy HH:mm:SS"); + formatter2.setTimeZone(TimeZone.getTimeZone("GMT-6")); + + Object[] res = (Object[]) results.get(0); + BigDecimal totalesRep = BigDecimal.ZERO; + BigDecimal recuperado = BigDecimal.ZERO; + BigDecimal transEnv = BigDecimal.ZERO; + BigDecimal transRec = BigDecimal.ZERO; + BigDecimal inicio = BigDecimal.ZERO; + BigDecimal gastos = BigDecimal.ZERO; + BigDecimal depositos = BigDecimal.ZERO; + BigDecimal entrPrestamos = BigDecimal.ZERO; + + Paragraph printDate = new Paragraph("Fecha de impresiĆ³n: " +res[3], FontFactory.getFont("arial", 10, Font.BOLD, BaseColor.DARK_GRAY)); + printDate.setAlignment(Element.ALIGN_RIGHT); + document.add(printDate); + +// Image imagen = Image.getInstance("other sources/resources/serenity-layout/images/apc_card.png"); +// imagen.scaleAbsoluteWidth(100f); +// document.add(imagen); + + Paragraph title = new Paragraph("Corte del dĆ­a", FontFactory.getFont("arial", 18, Font.BOLD, BaseColor.DARK_GRAY)); + title.setAlignment(Element.ALIGN_CENTER); + document.add(title); + + document.add(Chunk.NEWLINE); + + + + + PdfPTable tableGen = new PdfPTable(4); + tableGen.setWidthPercentage(100); + tableGen.setTotalWidth(new float[]{100f, 170f, 140f, 150f}); + tableGen.setLockedWidth(true); + + PdfPCell cellGen = new PdfPCell(new Paragraph("Asesor: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + cellGen = new PdfPCell(new Paragraph(res[6] == null ? "" : res[6].toString(), + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(3); + tableGen.addCell(cellGen); + + cellGen = new PdfPCell(new Paragraph("Monto recuperado: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + recuperado = new BigDecimal(res[7] == null ? "0.0" : res[7].toString()); + cellGen = new PdfPCell(new Paragraph(res[7] != null ? "$" + res[7].toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + cellGen = new PdfPCell(new Paragraph("Monto enviado por transferencia: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + transEnv = new BigDecimal(res[11] == null ? "0.0" : res[11].toString()); + cellGen = new PdfPCell(new Paragraph(res[11] != null ? "$" + res[11].toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + + cellGen = new PdfPCell(new Paragraph("Monto de inicio: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + inicio = new BigDecimal(res[10] == null ? "0.0" : res[10].toString()); + cellGen = new PdfPCell(new Paragraph(res[10] != null ? "$" + res[10].toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + cellGen = new PdfPCell(new Paragraph("Monto recibido por transferencia: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + transRec = new BigDecimal(res[11] == null ? "0.0" : res[11].toString()); + cellGen = new PdfPCell(new Paragraph(res[11] != null ? "$" + res[11].toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + + cellGen = new PdfPCell(new Paragraph("Entrega de prĆ©stamos: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + entrPrestamos = new BigDecimal(res[13] == null ? "0.0" : res[13].toString()); + cellGen = new PdfPCell(new Paragraph(res[13] != null ? "$" + res[13].toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + cellGen = new PdfPCell(new Paragraph("Gastos: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + gastos = new BigDecimal(res[12] == null ? "0.0" : res[12].toString()); + cellGen = new PdfPCell(new Paragraph(res[12] != null ? "$" + res[12].toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + + cellGen = new PdfPCell(new Paragraph("DepĆ³sitos: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + depositos = new BigDecimal(res[8] == null ? "0.0" : res[8].toString()); + cellGen = new PdfPCell(new Paragraph(res[8] != null ? "$" + res[8].toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + totalesRep = totalesRep.add(recuperado).subtract(transEnv).add(transRec).add(inicio).subtract(gastos).subtract(entrPrestamos); + cellGen = new PdfPCell(new Paragraph("Total: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + cellGen = new PdfPCell(new Paragraph(totalesRep != null ? "$" + totalesRep.toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + + + + cellGen = new PdfPCell(new Paragraph("Monto Esperado: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + cellGen = new PdfPCell(new Paragraph(res[4] != null ? "$" + res[4].toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + cellGen = new PdfPCell(new Paragraph("Monto Entregado: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + cellGen = new PdfPCell(new Paragraph(res[5] != null ? "$" + res[5].toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + + document.add(tableGen); + document.add(Chunk.NEWLINE); + + PdfPTable table = new PdfPTable(7); + table.setTotalWidth(new float[]{60, 60, 60, 60, 170, 60, 100}); + + table.setLockedWidth(true); + PdfPCell cell = new PdfPCell(new Paragraph("Detalles del corte", + FontFactory.getFont("arial", 10, Font.BOLD, BaseColor.WHITE))); + + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setBackgroundColor(new BaseColor( 41, 171, 225 )); + cell.setColspan(7); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("Detalle", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setColspan(1); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("P. anterior", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setColspan(1); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("C. apertura", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setColspan(1); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("Monto", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setColspan(1); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("Saldo insoluto", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setColspan(1); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("Tipo", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setColspan(1); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("Fecha", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setColspan(1); + table.addCell(cell); + + for(Object result : results){ + Object[] tmp = (Object[]) result; + // Detalle + cell = new PdfPCell(new Paragraph(tmp[0] == null ? "" : tmp[0].toString(), + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_LEFT); + cell.setColspan(1); + table.addCell(cell); + cell = new PdfPCell(new Paragraph( "", + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_LEFT); + cell.setColspan(1); + table.addCell(cell); + cell = new PdfPCell(new Paragraph( "", + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_LEFT); + cell.setColspan(1); + table.addCell(cell); + + + // Monto + cell = new PdfPCell(new Paragraph(tmp[1] != null ? "$" + tmp[1].toString() : "$0.00", + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_LEFT); + cell.setColspan(1); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph( "", + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_LEFT); + cell.setColspan(1); + table.addCell(cell); + + // Tipo + cell = new PdfPCell(new Paragraph(tmp[2] == null ? "" : tmp[2].toString(), + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_LEFT); + cell.setColspan(1); + table.addCell(cell); + // Fecha + cell = new PdfPCell(new Paragraph(tmp[15] == null ? "" : formatter2.format((Date) tmp[15]), + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_LEFT); + cell.setColspan(1); + table.addCell(cell); + } + + document.add(table); + + document.add(Chunk.NEWLINE); + document.add(Chunk.NEWLINE); + document.add(Chunk.NEWLINE); + document.add(Chunk.NEWLINE); + + document.add(new Paragraph(" __________________________ __________________________")); + document.add(new Paragraph(" Firma Nombre y firma cajero responsable")); + document.add(new Paragraph(" " + res[6] == null ? "" : res[6].toString())); + + } catch (Exception e) { + System.out.print("Error 1: " + e.getMessage()); + } + + document.close(); + FacesContext context = FacesContext.getCurrentInstance(); + Object response = context.getExternalContext().getResponse(); + if (response instanceof HttpServletResponse) { + HttpServletResponse hrs = (HttpServletResponse) response; + hrs.setContentType("application/pdf"); + //hrs.setHeader("Content-disposition", "attachment"); + hrs.setHeader("Content-disposition", "attachment;filename=corte_del_dĆ­a.pdf"); + hrs.setContentLength(baos.size()); + try { + ServletOutputStream out = hrs.getOutputStream(); + baos.writeTo(out); + out.flush(); + + } catch (IOException e) { + System.out.print("Error 2: " + e.getMessage()); + } + context.responseComplete(); + } + } + + @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 onRowReorder(ReorderEvent event) { + showMessage(FacesMessage.SEVERITY_INFO, "Registro Movido", "De columna: " + (event.getFromIndex() + 1) + " a columna: " + (event.getToIndex() + 1)); + } + + @Override + public void addRow() { + if (userId.equalsIgnoreCase("")) { + FacesMessage msg = new FacesMessage("ERROR", "Debes de elegir un usuario para poder generar el corte."); + FacesContext.getCurrentInstance().addMessage(null, msg); + imprimirStatus = true; + userId = ""; + return; + } + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); + calendar.set(Calendar.HOUR_OF_DAY, 12); + calendar.set(Calendar.MINUTE, 0); + calendar.set(Calendar.SECOND, 0); + calendar.set(Calendar.MILLISECOND, 0); + int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK); + + 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."); + FacesContext.getCurrentInstance().addMessage(null, msg); + return; + } + } + + if (totales.getTotal().compareTo(new BigDecimal(total)) != 0) { + if (comments == null || comments.trim().equals("")) { + FacesMessage msg = new FacesMessage("ERROR", "Es necesario capturar las observaciones."); + FacesContext.getCurrentInstance().addMessage(null, msg); + return; + } + } + + User userData = null; + for(User us : user){ + if(us.getId().equalsIgnoreCase(userId)){ + userData = us; + break; + } + } + + ClosingDay closingSave = new ClosingDay(); + closingSave.setActiveStatus(ActiveStatus.ENEBLED); + closingSave.setAmountExpected(totales.getTotal()); + closingSave.setAmountPaid(new BigDecimal(total)); + closingSave.setOffice(new Office(getLoggedUser().getOffice().getId())); + closingSave.setUser(new User(userId)); + closingSave.setCreatedBy(getLoggedUser().getId()); + closingSave.setCreatedOn(new Date()); + closingSave.setComments(comments); + closingSave.setRouteCtlg(userData.getHumanResource().getHumanResourceHasRoutes().get(0).getRouteCtlg()); + if (closingDayCtrl.saveClosingDay(closingSave)) { + if (closingDetail != null && !closingDetail.isEmpty()) { + List detail = new ArrayList(); + + for (ClosingDailyDetailFromUserByCurdateView info : closingDetail) { + ClosingDayDetail detailInfo = new ClosingDayDetail(); + detailInfo.setAmount(info.getAmount()); + detailInfo.setClosingDay(closingSave); + detailInfo.setComments(info.getComments()); + detailInfo.setCreatedBy(getLoggedUser().getId()); + detailInfo.setCreatedOn(new Date()); + detailInfo.setDateDetail(info.getCreatedOn()); + detailInfo.setType(info.getType()); + detail.add(detailInfo); + } + closingDayCtrl.saveClosingDayDetail(detail); + } + + } + getResumen(); + totales = new TotalCashByCurdateView(); + totales.setMoneyDaily(BigDecimal.ZERO); + totales.setPaymentDaily(BigDecimal.ZERO); + totales.setTransferReceiver(BigDecimal.ZERO); + totales.setTransferSender(BigDecimal.ZERO); + totales.setDelivery(BigDecimal.ZERO); + totales.setTotal(BigDecimal.ZERO); + totales.setTransferPending(BigDecimal.ZERO); + totales.setOtherExpense(BigDecimal.ZERO); + totales.setDepositDaily(BigDecimal.ZERO); + total = BigDecimal.ZERO.toString(); + totalBox = BigDecimal.ZERO; + totalCustomerWithOutAction = new Long(0); + totalBox = genericCtrl.findAllSmallBox(getLoggedUser().getOffice().getId()); + comments = ""; + closingDetail.clear(); + paymentoZeroDetail.clear(); + FacesMessage msg = new FacesMessage("Nuevo corte registrado", "Se agregĆ³ correctamente"); + FacesContext.getCurrentInstance().addMessage(null, msg); + } + + @Override + public void deleteRow() { + try { + if (closingDayCtrl.existStableSmallBoxByCreatedOn(selectedClosingDay.getCreatedOn())) { + showMessage(FacesMessage.SEVERITY_WARN, "Corte del dĆ­a", "No se puede borrar porque ya se realizo el cuadre de caja chica del dĆ­a."); + } else { + boolean delete = true; + delete = selectedClosingDay.getActiveStatus() == ActiveStatus.ENEBLED ? true : false; + + if (delete) { + Bitacora bitacora = new Bitacora(); + ClosingDay closing = closingDayCtrl.getClosingDayById(selectedClosingDay.getId()); + bitacora.setAction("Eliminar corte del dĆ­a"); + 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 corte del asesor " + closing.getUser().getUserName() + " con monto $" + + selectedClosingDay.getAmountPaid() + " y fecha " + closing.getCreatedOn()); + closingDayCtrl.updateClosingDayByStatus(ActiveStatus.DISABLED, selectedClosingDay.getId(), getLoggedUser().getUser().getId()); + //closingDay.remove(selectedClosingDay); + searchHistoricalAction(); + bitacoraCtrl.saveBitacora(bitacora); + commentsBitacora = ""; + selectedClosingDay = null; + showMessage(FacesMessage.SEVERITY_INFO, "Corte del dĆ­a", "Se eliminĆ³ correctamente."); + } + } + } catch (Exception e) { + } + } + + public ClosingDayController getClosingDayCtrl() { + return closingDayCtrl; + } + + public void setClosingDayCtrl(ClosingDayController closingDayCtrl) { + this.closingDayCtrl = closingDayCtrl; + } + + public List getClosingDay() { + return closingDay; + } + + public void setClosingDay(List closingDay) { + this.closingDay = closingDay; + } + + public List getUser() { + return user; + } + + public void setUser(List user) { + this.user = user; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getAmount() { + return amount; + } + + public void setAmount(String amount) { + this.amount = amount; + } + + public ClosingDay getSelectedClosingDay() { + return selectedClosingDay; + } + + public void setSelectedClosingDay(ClosingDay selectedClosingDay) { + this.selectedClosingDay = selectedClosingDay; + } + + public TotalCashByCurdateView getTotales() { + return totales; + } + + public void setTotales(TotalCashByCurdateView totales) { + this.totales = totales; + } + + public String getTotal() { + return total; + } + + public void setTotal(String total) { + this.total = total; + } + + public BigDecimal getTotalAmount() { + return totalAmount; + } + + public void setTotalAmount(BigDecimal totalAmount) { + this.totalAmount = totalAmount; + } + + public BigDecimal getTotalTransferSender() { + return totalTransferSender; + } + + public void setTotalTransferSender(BigDecimal totalTransferSender) { + this.totalTransferSender = totalTransferSender; + } + + public BigDecimal getTotalTransferReceiver() { + return totalTransferReceiver; + } + + public void setTotalTransferReceiver(BigDecimal totalTransferReceiver) { + this.totalTransferReceiver = totalTransferReceiver; + } + + public BigDecimal getTotalMoneyDaily() { + return totalMoneyDaily; + } + + public void setTotalMoneyDaily(BigDecimal totalMoneyDaily) { + this.totalMoneyDaily = totalMoneyDaily; + } + + public BigDecimal getTotalDelivery() { + return totalDelivery; + } + + public void setTotalDelivery(BigDecimal totalDelivery) { + this.totalDelivery = totalDelivery; + } + + public BigDecimal getTotalFinal() { + return totalFinal; + } + + public void setTotalFinal(BigDecimal totalFinal) { + this.totalFinal = totalFinal; + } + + public BigDecimal getTotalCaja() { + return totalCaja; + } + + public void setTotalCaja(BigDecimal totalCaja) { + this.totalCaja = totalCaja; + } + + public BigDecimal getTotalOtherExpense() { + return totalOtherExpense; + } + + public void setTotalOtherExpense(BigDecimal totalOtherExpense) { + this.totalOtherExpense = totalOtherExpense; + } + + public String getComments() { + return comments; + } + + public void setComments(String comments) { + this.comments = comments; + } + + public GenericController getGenericCtrl() { + return genericCtrl; + } + + public void setGenericCtrl(GenericController genericCtrl) { + this.genericCtrl = genericCtrl; + } + + public List getClosingDetail() { + return closingDetail; + } + + public void setClosingDetail(List closingDetail) { + this.closingDetail = closingDetail; + } + + public BigDecimal getTotalBox() { + return totalBox; + } + + public void setTotalBox(BigDecimal totalBox) { + this.totalBox = totalBox; + } + + public Long getTotalCustomerWithOutAction() { + return totalCustomerWithOutAction; + } + + public void setTotalCustomerWithOutAction(Long totalCustomerWithOutAction) { + this.totalCustomerWithOutAction = totalCustomerWithOutAction; + } + + public List getPaymentoZeroDetail() { + return paymentoZeroDetail; + } + + public void setPaymentoZeroDetail(List paymentoZeroDetail) { + this.paymentoZeroDetail = paymentoZeroDetail; + } + + public BigDecimal getDeposit() { + return deposit; + } + + public void setDeposit(BigDecimal deposit) { + this.deposit = deposit; + } + + public String getCommentsBitacora() { + return commentsBitacora; + } + + public void setCommentsBitacora(String commentsBitacora) { + this.commentsBitacora = commentsBitacora; + } + + public LoanController getLoanCtrl() { + return loanCtrl; + } + + public void setLoanCtrl(LoanController loanCtrl) { + this.loanCtrl = loanCtrl; + } + + public boolean getImprimirStatus() { + return imprimirStatus; + } + + public void setImprimirStatus(boolean imprimirStatus) { + this.imprimirStatus = imprimirStatus; + } + + + + private ClosingDayController closingDayCtrl; + private GenericController genericCtrl; + private BitacoraController bitacoraCtrl; + private LoanController loanCtrl; + + private List closingDay; + private List user; + + private String userId; + private String amount; + private String total; + + private BigDecimal totalAmount; + private BigDecimal totalTransferSender; + private BigDecimal totalTransferReceiver; + private BigDecimal totalMoneyDaily; + private BigDecimal totalDelivery; + private BigDecimal totalFinal; + private BigDecimal totalCaja; + private BigDecimal totalOtherExpense; + private BigDecimal totalBox; + private Long totalCustomerWithOutAction; + private BigDecimal deposit; + + private String commentsBitacora; + + private String comments; + private boolean imprimirStatus; + + private TotalCashByCurdateView totales; + + private ClosingDay selectedClosingDay; + + private List closingDetail; + private List paymentoZeroDetail; + + @PostConstruct + public void init() { + loadBundlePropertyFile(); + + loanCtrl = new LoanController(); + closingDayCtrl = new ClosingDayController(); + bitacoraCtrl = new BitacoraController(); + genericCtrl = new GenericController(); + + //initOneWeekBeforeToCurrdate(); + initThisWeekToCurrdate(); + + imprimirStatus = true; + closingDay = fillDatatableClosingDay(); + commentsBitacora = ""; + user = getUsers(); + getResumen(); + comments = ""; + totalBox = genericCtrl.findAllSmallBox(getLoggedUser().getOffice().getId()); + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/ClosingDayDetailBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/ClosingDayDetailBean.java new file mode 100644 index 0000000..6e94c08 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/ClosingDayDetailBean.java @@ -0,0 +1,100 @@ +/* + * 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.web.beans.admin; + +import com.arrebol.apc.controller.admin.ClosingDayController; +import com.arrebol.apc.model.admin.ClosingDay; +import com.arrebol.apc.model.admin.ClosingDayDetail; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Named("closingDayDetailManager") +@ViewScoped +public class ClosingDayDetailBean extends GenericBean implements Serializable, Datatable{ + + @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 onRowReorder(ReorderEvent event) { + 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. + } + + public ClosingDayController getClosingDayCtrl() { + return closingDayCtrl; + } + + public void setClosingDayCtrl(ClosingDayController closingDayCtrl) { + this.closingDayCtrl = closingDayCtrl; + } + + public String getClosingDayId() { + return closingDayId; + } + + public void setClosingDayId(String closingDayId) { + this.closingDayId = closingDayId; + } + + public ClosingDay getClosingDay() { + return closingDay; + } + + public void setClosingDay(ClosingDay closingDay) { + this.closingDay = closingDay; + } + + public List getClosingDayDetail() { + return closingDayDetail; + } + + public void setClosingDayDetail(List closingDayDetail) { + this.closingDayDetail = closingDayDetail; + } + + private ClosingDayController closingDayCtrl; + private String closingDayId; + private ClosingDay closingDay; + private List closingDayDetail; + + @PostConstruct + public void init() { + closingDayCtrl = new ClosingDayController(); + setClosingDayId(externalContext().getRequestParameterMap().get("form:dtClosingDay_selection")); + setClosingDay(closingDayCtrl.getClosingDayById(closingDayId)); + setClosingDayDetail(closingDayCtrl.getClosingDayDetailByIdClosingDay(getClosingDayId())); + } +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/CustomerBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/CustomerBean.java new file mode 100644 index 0000000..d409dcd --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/CustomerBean.java @@ -0,0 +1,169 @@ +/* + * 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.web.beans.admin; + +import com.arrebol.apc.controller.admin.CustomerController; +import com.arrebol.apc.controller.catalog.RouteController; +import com.arrebol.apc.model.catalog.People; +import com.arrebol.apc.model.catalog.RouteCtlg; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.enums.PeopleType; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Named("customerManager") +@ViewScoped +public class CustomerBean extends GenericBean implements Serializable, Datatable{ + + public List fillDatatableCustomer() { + + return customerCtrl.fillCustomersDatatable(getLoggedUser().getOffice().getId()); + } + + public void changeRoute(){ + if(!routeId.isEmpty()){ + if(customerCtrl.updateRouteById(new RouteCtlg(routeId), selectedCustomer.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."); + } + + } + } + + @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 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 deleteRow() { + customerCtrl.updatePeopleByStatus(ActiveStatus.DISABLED, selectedCustomer.getId(), getLoggedUser().getUser().getId()); + customer.remove(selectedCustomer); + selectedCustomer = null; + showMessage(FacesMessage.SEVERITY_INFO, "Cliente Eliminado", "Se eliminĆ³ correctamente."); + } + + public void updatePeopleTypeById() { + if(selectedCustomer.getPeopleType().equals(PeopleType.BOTH)) + { + showMessage(FacesMessage.SEVERITY_INFO, "Advertencia", "El cliente ya se encuentra como Aval."); + return; + } + customerCtrl.updatePeopleTypeById(PeopleType.BOTH, selectedCustomer.getId(), getLoggedUser().getUser().getId()); + customer = null; + selectedCustomer = null; + customer = fillDatatableCustomer(); + showMessage(FacesMessage.SEVERITY_INFO, "Cliente modificado", "Se modificĆ³ correctamente."); + } + + /** + * + * @param outcome + * @return + */ + public String detailCustomer(String outcome) { + return outcome; + } + + public CustomerController getCustomerCtrl() { + return customerCtrl; + } + + public void setCustomerCtrl(CustomerController customerCtrl) { + this.customerCtrl = customerCtrl; + } + + public List getCustomer() { + return customer; + } + + public void setCustomer(List customer) { + this.customer = customer; + } + + public People getSelectedCustomer() { + return selectedCustomer; + } + + public void setSelectedCustomer(People selectedCustomer) { + this.selectedCustomer = selectedCustomer; + } + + public String getRouteId() { + return routeId; + } + + public void setRouteId(String routeId) { + this.routeId = routeId; + } + + public RouteController getRouteCtrl() { + return routeCtrl; + } + + public void setRouteCtrl(RouteController routeCtrl) { + this.routeCtrl = routeCtrl; + } + + public List getRoute() { + return route; + } + + public void setRoute(List route) { + this.route = route; + } + + private CustomerController customerCtrl; + private RouteController routeCtrl; + + private List customer; + private List route; + + private People selectedCustomer; + private String routeId; + + @PostConstruct + public void init() { + customerCtrl = new CustomerController(); + routeCtrl = new RouteController(); + customer = fillDatatableCustomer(); + route = routeCtrl.fillRoutesDatatable(getLoggedUser().getOffice().getId()); + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/CustomerDetailBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/CustomerDetailBean.java new file mode 100644 index 0000000..1f44911 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/CustomerDetailBean.java @@ -0,0 +1,175 @@ +/* + * 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.web.beans.admin; + +import com.arrebol.apc.controller.admin.CustomerController; +import com.arrebol.apc.controller.admin.LoanController; +import com.arrebol.apc.model.catalog.People; +import com.arrebol.apc.model.loan.Loan; +import com.arrebol.apc.model.loan.LoanDetails; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Named("customerDetailManager") +@ViewScoped +public class CustomerDetailBean extends GenericBean implements Serializable, Datatable { + + public List getDetails(String id) { + try { + loanDetails = loanCtrl.getLoanDetailsbyId(id); + + } catch (Exception e) { + } + return null == loanDetails ? new ArrayList<>() : loanDetails; + } + + public People getCustomerDetail(String peopleId){ + return customerCtrl.findPeopleById(peopleId); + } + + public List getLoanByPeople(String peopleId){ + return customerCtrl.findLoanByCustomer(peopleId); + } + + public void editPeople() + { + if(customer.getBirthdate() == null){ + showMessage(FacesMessage.SEVERITY_FATAL, "Campo obligatorio", "La fecha de cumpleaƱos es obligatoria"); + return; + } + if(customer.getFirstName() == null){ + showMessage(FacesMessage.SEVERITY_FATAL, "Campo obligatorio", "El primer nombre es obligatoria"); + return; + } + if(customer.getLastName() == null){ + showMessage(FacesMessage.SEVERITY_FATAL, "Campo obligatorio", "El apellido paterno es obligatoria"); + return; + } + if(customer.getMiddleName() == null){ + showMessage(FacesMessage.SEVERITY_FATAL, "Campo obligatorio", "El apellido materno es obligatoria"); + return; + } + if(customer.getPhoneHome()== null){ + showMessage(FacesMessage.SEVERITY_FATAL, "Campo obligatorio", "El telĆ©fono de casa es obligatoria"); + return; + } + if(customer.getAddressHome()== null){ + showMessage(FacesMessage.SEVERITY_FATAL, "Campo obligatorio", "El domicilio personal es obligatoria"); + return; + } + if(customerCtrl.updateByPeopleId(customer)) + { + showMessage(FacesMessage.SEVERITY_INFO, "Cliente modificado", "Se modificĆ³ correctamente."); + } + } + + @Override + public void editRow(RowEditEvent event) { + + + } + + @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 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. + } + + public CustomerController getCustomerCtrl() { + return customerCtrl; + } + + public void setCustomerCtrl(CustomerController customerCtrl) { + this.customerCtrl = customerCtrl; + } + + public People getCustomer() { + return customer; + } + + public void setCustomer(People customer) { + this.customer = customer; + } + + public String getCustomerId() { + return customerId; + } + + public void setCustomerId(String customerId) { + this.customerId = customerId; + } + + public List getLoan() { + return loan; + } + + public void setLoan(List loan) { + this.loan = loan; + } + + public LoanController getLoanCtrl() { + return loanCtrl; + } + + public void setLoanCtrl(LoanController loanCtrl) { + this.loanCtrl = loanCtrl; + } + + public List getLoanDetails() { + return loanDetails; + } + + public void setLoanDetails(List loanDetails) { + this.loanDetails = loanDetails; + } + + private CustomerController customerCtrl; + private LoanController loanCtrl; + private People customer; + private String customerId; + private List loan; + private List loanDetails; + + @PostConstruct + public void init() { + customerCtrl = new CustomerController(); + loanCtrl = new LoanController(); + setCustomerId(externalContext().getRequestParameterMap().get("form:dtCustomer_selection")); + customer = getCustomerDetail(getCustomerId()); + loan = getLoanByPeople(getCustomerId()); + + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/EmployeeListBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/EmployeeListBean.java new file mode 100644 index 0000000..2b74d92 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/EmployeeListBean.java @@ -0,0 +1,100 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.web.beans.admin; + +import com.arrebol.apc.controller.system.employee.EmployeeController; +import com.arrebol.apc.model.core.HumanResource; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.enums.HumanResourceStatus; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author Oscar + */ +@Named("employeeListManager") +@ViewScoped +public class EmployeeListBean extends GenericBean implements Serializable, Datatable { + + + + + public List fillDatatableEmployee() { + return getController().findEmployeesByType( + getLoggedUser().getOffice(), + HumanResourceStatus.ENEBLED, + getLoggedUser().getUser().getHumanResource().getId()); + } + + + @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 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 deleteRow() { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + public EmployeeController getController() { + return controller; + } + + public void setController(EmployeeController controller) { + this.controller = controller; + } + + public List getHumanResource() { + return humanResource; + } + + public void setHumanResource(List humanResource) { + this.humanResource = humanResource; + } + + + private EmployeeController controller; + + private List humanResource; + + + @PostConstruct() + public void init() { + loadBundlePropertyFile(); + + controller = new EmployeeController(); + + + setHumanResource(fillDatatableEmployee()); + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/EndorsementBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/EndorsementBean.java new file mode 100644 index 0000000..14aaf0d --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/EndorsementBean.java @@ -0,0 +1,178 @@ +/* + * 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.web.beans.admin; + +import com.arrebol.apc.controller.admin.AdministrationPersonSearchViewController; +import com.arrebol.apc.controller.admin.EndorsementController; +import com.arrebol.apc.model.catalog.People; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.enums.PeopleType; +import com.arrebol.apc.model.views.AdministrationPersonSerchView; +import com.sun.javafx.scene.control.skin.VirtualFlow; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Named("endorsementManager") +@ViewScoped +public class EndorsementBean extends GenericPersonSearchBean implements Serializable { + + public List autoCompleteSearchByName(String nameToSearch) { + List results; + try { + results = executeAutoComplete(nameToSearch, PeopleType.ENDORSEMENT); + } catch (Exception e) { + results = new ArrayList<>(); + + logger.error("autoCompleteSearchByName", e); + } + return results; + } + + public void searchPersonAction() { + try { + if ((null == getSearchPersonName() || "".equals(getSearchPersonName().trim())) && getRouteId().equals("All")) { + showMessage(FacesMessage.SEVERITY_WARN, "Ingresar nombre de persona a buscar", "Para hacer una busqueda general en las rutas debes propocionar el nombre de la persona a buscar-"); + } else { + if (getRouteId().equals("All")) { + executeQueryLike(true, PeopleType.ENDORSEMENT); + } else if (null != getSearchPersonName() && !"".equals(getSearchPersonName().trim())) { + boolean allRoutes = false; + + if (getRouteId().equals("All")) { + allRoutes = true; + } + + executeQueryLike(allRoutes, PeopleType.ENDORSEMENT); + } else if (null == getSearchPersonName() || "".equals(getSearchPersonName().trim())) { + fillPersonList(PeopleType.ENDORSEMENT); + } + } + } catch (Exception e) { + logger.error("searchPersonAction", e); + setPersonList(new ArrayList<>()); + } + } + + public List fillDatatableEndorsement() { + return endorsementCtrl.fillEndorsementsDatatable(getLoggedUser().getOffice().getId()); + } + + @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 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 deleteRow() { + getEndorsementCtrl().updatePeopleByStatus(ActiveStatus.DISABLED, getSelectedPerson().getId(), getLoggedUser().getUser().getId()); + cleaningView(); + + showMessage(FacesMessage.SEVERITY_INFO, "Aval Eliminado", "Se eliminĆ³ correctamente."); + } + + public void updatePeopleTypeById() { + if (selectedEndorsement.getPeopleType().equals(PeopleType.BOTH)) { + showMessage(FacesMessage.SEVERITY_INFO, "Advertencia", "El aval ya se encuentra como cliente."); + return; + } + //endorsementCtrl.updatePeopleTypeById(PeopleType.BOTH, selectedEndorsement.getId(), getLoggedUser().getUser().getId()); + //endorsement = null; + //endorsement = fillDatatableEndorsement(); + //selectedEndorsement = null; + + getEndorsementCtrl().updatePeopleTypeById(PeopleType.BOTH, getSelectedPerson().getId(), getLoggedUser().getUser().getId()); + cleaningView(); + + showMessage(FacesMessage.SEVERITY_INFO, "Aval modificado", "Se modificĆ³ correctamente."); + } + + private void cleaningView() { + getPersonList().remove(getSelectedPerson()); + setSelectedPerson(null); + } + + final Logger logger = LogManager.getLogger(getClass()); + + private EndorsementController endorsementCtrl; + private List endorsement; + private People selectedEndorsement; + + @PostConstruct + public void init() { + try { + loadBundlePropertyFile(); + + endorsementCtrl = new EndorsementController(); + setAdminSearchController(new AdministrationPersonSearchViewController()); + + setRoutes(getAdminSearchController().findAllActiveRoutesByOfficce(getLoggedUser().getOffice().getId())); + } catch (Exception e) { + } + } + + /** + * + * @param outcome + * @return + */ + public String detailEndorsement(String outcome) { + return outcome; + } + + public EndorsementController getEndorsementCtrl() { + return endorsementCtrl; + } + + public void setEndorsementCtrl(EndorsementController endorsementCtrl) { + this.endorsementCtrl = endorsementCtrl; + } + + public List getEndorsement() { + return endorsement; + } + + public void setEndorsement(List endorsement) { + this.endorsement = endorsement; + } + + public People getSelectedEndorsement() { + return selectedEndorsement; + } + + public void setSelectedEndorsement(People selectedEndorsement) { + this.selectedEndorsement = selectedEndorsement; + } +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/EndorsementDetailBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/EndorsementDetailBean.java new file mode 100644 index 0000000..96ba33f --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/EndorsementDetailBean.java @@ -0,0 +1,143 @@ +/* + * 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.web.beans.admin; + +import com.arrebol.apc.controller.admin.EndorsementController; +import com.arrebol.apc.model.catalog.People; +import com.arrebol.apc.model.loan.Loan; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Named("endorsementDetailManager") +@ViewScoped +public class EndorsementDetailBean extends GenericBean implements Serializable, Datatable { + + public People getEndorsementDetail(String peopleId){ + return endorsementCtrl.findPeopleById(peopleId); + } + + public List getLoanByPeople(String peopleId){ + return endorsementCtrl.findLoanByEndorsement(peopleId); + } + + public void editPeople() + { + if(endorsement.getBirthdate() == null){ + showMessage(FacesMessage.SEVERITY_FATAL, "Campo obligatorio", "La fecha de cumpleaƱos es obligatoria"); + return; + } + if(endorsement.getFirstName() == null){ + showMessage(FacesMessage.SEVERITY_FATAL, "Campo obligatorio", "El primer nombre es obligatoria"); + return; + } + if(endorsement.getLastName() == null){ + showMessage(FacesMessage.SEVERITY_FATAL, "Campo obligatorio", "El apellido paterno es obligatoria"); + return; + } + if(endorsement.getMiddleName() == null){ + showMessage(FacesMessage.SEVERITY_FATAL, "Campo obligatorio", "El apellido materno es obligatoria"); + return; + } + if(endorsement.getPhoneHome()== null){ + showMessage(FacesMessage.SEVERITY_FATAL, "Campo obligatorio", "El telĆ©fono de casa es obligatoria"); + return; + } + if(endorsement.getAddressHome()== null){ + showMessage(FacesMessage.SEVERITY_FATAL, "Campo obligatorio", "El domicilio personal es obligatoria"); + return; + } + if(endorsementCtrl.updateByPeopleId(endorsement)) + { + showMessage(FacesMessage.SEVERITY_INFO, "Aval modificado", "Se modificĆ³ correctamente."); + } + } + + @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 onRowReorder(ReorderEvent event) { + 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. + } + + public EndorsementController getCustomerCtrl() { + return endorsementCtrl; + } + + public void setEndorsementCtrl(EndorsementController endorsementCtrl) { + this.endorsementCtrl = endorsementCtrl; + } + + public People getEndorsement() { + return endorsement; + } + + public void setEndorsement(People endorsement) { + this.endorsement = endorsement; + } + + public String getEndorsementId() { + return endorsementId; + } + + public void setEndorsementId(String endorsementId) { + this.endorsementId = endorsementId; + } + + public List getLoan() { + return loan; + } + + public void setLoan(List loan) { + this.loan = loan; + } + + private EndorsementController endorsementCtrl; + private People endorsement; + private String endorsementId; + private List loan; + + @PostConstruct + public void init() { + endorsementCtrl = new EndorsementController(); + setEndorsementId(externalContext().getRequestParameterMap().get("form:dtEndorsement_selection")); + endorsement = getEndorsementDetail(getEndorsementId()); + loan = getLoanByPeople(getEndorsementId()); + + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/ExpenseCompanyInBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/ExpenseCompanyInBean.java new file mode 100644 index 0000000..eb3942f --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/ExpenseCompanyInBean.java @@ -0,0 +1,239 @@ +/* + * 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.web.beans.admin; + +import com.arrebol.apc.controller.BitacoraController; +import com.arrebol.apc.controller.GenericController; +import com.arrebol.apc.controller.GenericValidationController; +import com.arrebol.apc.controller.admin.ExpenseCompanyController; +import com.arrebol.apc.controller.admin.StableGeneralBoxController; +import com.arrebol.apc.model.admin.ExpenseCompany; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.enums.ExpenseCompanyType; +import com.arrebol.apc.model.system.logs.Bitacora; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.context.FacesContext; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Named("expenseCompanyInManager") +@ViewScoped +public class ExpenseCompanyInBean 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 { + setExpenseCompany(fillDatatableExpenseCompany()); + } + } catch (Exception e) { + } + } + + public List fillDatatableExpenseCompany() { + + return getExpenseCompanyCtrl().fillxpenseCompanyInDatatable(getLoggedUser().getOffice().getId(), 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 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 addRow() { + Date date = new Date(); + if (genericCtrl.existStableGeneralBoxByCreatedOn(date)) { + showMessage(FacesMessage.SEVERITY_WARN, "DĆ­a cerrado", "No se pueden agregar mĆ”s entradas porque ya se existe un cuadre de caja general de hoy."); + return; + } + + ExpenseCompany expense = new ExpenseCompany(); + expense.setActiveStatus(ActiveStatus.ENEBLED); + expense.setExpenseCompanyType(ExpenseCompanyType.PAYMENT_IN); + expense.setOffice(new Office(getLoggedUser().getOffice().getId())); + expense.setAmount(new BigDecimal(amount)); + expense.setDescription(comments); + expense.setCreatedOn(new Date()); + expense.setCreatedBy(getLoggedUser().getId()); + expenseCompanyCtrl.saveExpenseCompany(expense); + expenseCompany.clear(); + expenseCompany = fillDatatableExpenseCompany(); + amount = ""; + comments = ""; + FacesMessage msg = new FacesMessage("Nueva entrada", "Se agregĆ³ correctamente"); + FacesContext.getCurrentInstance().addMessage(null, msg); + } + + @Override + public void deleteRow() { + if (genericCtrl.existStableGeneralBoxByCreatedOn(selectedExpenseCompany.getCreatedOn())) { + showMessage(FacesMessage.SEVERITY_WARN, "Entradas", "No se puede borrar porque ya se realizo el cuadre de caja general del dĆ­a."); + } else { + boolean delete = true; + delete = selectedExpenseCompany.getActiveStatus() == ActiveStatus.ENEBLED ? true : false; + + if (delete) { + Bitacora bitacora = new Bitacora(); + ExpenseCompany expenseIn = expenseCompanyCtrl.getExpenseById(selectedExpenseCompany.getId()); + bitacora.setAction("Eliminar entrada"); + 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 entrada con monto $" + + expenseIn.getAmount() + " y fecha " + expenseIn.getCreatedOn()); + + expenseCompanyCtrl.updateExpenseCompanyByStatus(ActiveStatus.DISABLED, selectedExpenseCompany.getId(), getLoggedUser().getUser().getId()); + //expenseCompany.remove(selectedExpenseCompany); + searchHistoricalAction(); + bitacoraCtrl.saveBitacora(bitacora); + commentsBitacora = ""; + selectedExpenseCompany = null; + showMessage(FacesMessage.SEVERITY_INFO, "Entrada Eliminada", "Se eliminĆ³ correctamente."); + } + } + } + + public ExpenseCompanyController getExpenseCompanyCtrl() { + return expenseCompanyCtrl; + } + + public void setExpenseCompanyCtrl(ExpenseCompanyController expenseCompanyCtrl) { + this.expenseCompanyCtrl = expenseCompanyCtrl; + } + + public List getExpenseCompany() { + return expenseCompany; + } + + public void setExpenseCompany(List expenseCompany) { + this.expenseCompany = expenseCompany; + } + + public String getAmount() { + return amount; + } + + public void setAmount(String amount) { + this.amount = amount; + } + + public String getComments() { + return comments; + } + + public void setComments(String comments) { + this.comments = comments; + } + + public ExpenseCompany getSelectedExpenseCompany() { + return selectedExpenseCompany; + } + + public void setSelectedExpenseCompany(ExpenseCompany selectedExpenseCompany) { + this.selectedExpenseCompany = selectedExpenseCompany; + } + + public String getCommentsBitacora() { + return commentsBitacora; + } + + public void setCommentsBitacora(String commentsBitacora) { + this.commentsBitacora = commentsBitacora; + } + + public BitacoraController getBitacoraCtrl() { + return bitacoraCtrl; + } + + public void setBitacoraCtrl(BitacoraController bitacoraCtrl) { + this.bitacoraCtrl = bitacoraCtrl; + } + + public GenericController getGenericCtrl() { + return genericCtrl; + } + + public void setGenericCtrl(GenericController genericCtrl) { + this.genericCtrl = genericCtrl; + } + + 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; + } + + private ExpenseCompanyController expenseCompanyCtrl; + private BitacoraController bitacoraCtrl; + private GenericController genericCtrl; + private GenericValidationController genericValidateController; + private Date lastStableGeneralBox; + + private List expenseCompany; + + private String amount; + private String comments; + + private ExpenseCompany selectedExpenseCompany; + + private String commentsBitacora; + + @PostConstruct + public void init() { + loadBundlePropertyFile(); + initOneWeekBeforeToCurrdate(); + + expenseCompanyCtrl = new ExpenseCompanyController(); + bitacoraCtrl = new BitacoraController(); + genericCtrl = new GenericController(); + setGenericValidateController(new GenericValidationController()); + setLastStableGeneralBox(getGenericValidateController().lastStableGeneralBoxByDate(getLoggedUser().getUser())); + expenseCompany = fillDatatableExpenseCompany(); + commentsBitacora = ""; + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/ExpenseCompanyOutBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/ExpenseCompanyOutBean.java new file mode 100644 index 0000000..eafadd4 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/ExpenseCompanyOutBean.java @@ -0,0 +1,248 @@ +/* + * 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.web.beans.admin; + +import com.arrebol.apc.controller.BitacoraController; +import com.arrebol.apc.controller.GenericController; +import com.arrebol.apc.controller.GenericValidationController; +import com.arrebol.apc.controller.admin.ExpenseCompanyController; +import com.arrebol.apc.controller.admin.StableGeneralBoxController; +import com.arrebol.apc.model.admin.ExpenseCompany; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.enums.ExpenseCompanyType; +import com.arrebol.apc.model.system.logs.Bitacora; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.context.FacesContext; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Named("expenseCompanyOutManager") +@ViewScoped +public class ExpenseCompanyOutBean 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 { + setExpenseCompany(fillDatatableExpenseCompany()); + } + } catch (Exception e) { + } + } + + public List fillDatatableExpenseCompany() { + return getExpenseCompanyCtrl().fillxpenseCompanyOutDatatable(getLoggedUser().getOffice().getId(), 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 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 addRow() { + Date date = new Date(); + if (genericCtrl.existStableGeneralBoxByCreatedOn(date)) { + showMessage(FacesMessage.SEVERITY_WARN, "DĆ­a cerrado", "No se pueden agregar mĆ”s gastos administrativos porque ya se existe un cuadre de caja general de hoy."); + return; + } + if(stableGeneralBoxCtrl.getTotalBox().compareTo(new BigDecimal(amount))>=0){ + ExpenseCompany expense = new ExpenseCompany(); + expense.setActiveStatus(ActiveStatus.ENEBLED); + expense.setExpenseCompanyType(ExpenseCompanyType.PAYMENT_OUT); + expense.setOffice(new Office(getLoggedUser().getOffice().getId())); + expense.setAmount(new BigDecimal(amount)); + expense.setDescription(comments); + expense.setCreatedOn(new Date()); + expense.setCreatedBy(getLoggedUser().getUser().getId()); + expenseCompanyCtrl.saveExpenseCompany(expense); + expenseCompany.clear(); + + amount = ""; + comments = ""; + totalCaja= stableGeneralBoxCtrl.getTotalBox(); + FacesMessage msg = new FacesMessage("Nueva Salida", "Se agregĆ³ correctamente"); + + setExpenseCompany(fillDatatableExpenseCompany()); + FacesContext.getCurrentInstance().addMessage(null, msg);} + else{ + showMessage(FacesMessage.SEVERITY_WARN, "Salida incorrecta", "No se pueden generar la salida porque es mas grande que la cantidad en caja general."); + } + } + + @Override + public void deleteRow() { + if (genericCtrl.existStableGeneralBoxByCreatedOn(selectedExpenseCompany.getCreatedOn())) { + showMessage(FacesMessage.SEVERITY_WARN, "Gasto administrativo", "No se puede borrar porque ya se realizo el cuadre de caja general del dĆ­a."); + } else { + boolean delete = true; + delete = selectedExpenseCompany.getActiveStatus() == ActiveStatus.ENEBLED ? true : false; + + if (delete) { + Bitacora bitacora = new Bitacora(); + ExpenseCompany expenseOut = expenseCompanyCtrl.getExpenseById(selectedExpenseCompany.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 gasto administrativo con monto $" + + expenseOut.getAmount() + " y fecha " + expenseOut.getCreatedOn()); + + expenseCompanyCtrl.updateExpenseCompanyByStatus(ActiveStatus.DISABLED, selectedExpenseCompany.getId(), getLoggedUser().getUser().getId()); + // expenseCompany.remove(selectedExpenseCompany); + searchHistoricalAction(); + bitacoraCtrl.saveBitacora(bitacora); + commentsBitacora = ""; + selectedExpenseCompany = null; + showMessage(FacesMessage.SEVERITY_INFO, "Gasto administrativo eliminado", "Se eliminĆ³ correctamente."); + } + } + } + + public ExpenseCompanyController getExpenseCompanyCtrl() { + return expenseCompanyCtrl; + } + + public void setExpenseCompanyCtrl(ExpenseCompanyController expenseCompanyCtrl) { + this.expenseCompanyCtrl = expenseCompanyCtrl; + } + + public List getExpenseCompany() { + return expenseCompany; + } + + public void setExpenseCompany(List expenseCompany) { + this.expenseCompany = expenseCompany; + } + + public String getAmount() { + return amount; + } + + public void setAmount(String amount) { + this.amount = amount; + } + + public String getComments() { + return comments; + } + + public void setComments(String comments) { + this.comments = comments; + } + + public ExpenseCompany getSelectedExpenseCompany() { + return selectedExpenseCompany; + } + + public void setSelectedExpenseCompany(ExpenseCompany selectedExpenseCompany) { + this.selectedExpenseCompany = selectedExpenseCompany; + } + + public BitacoraController getBitacoraCtrl() { + return bitacoraCtrl; + } + + public void setBitacoraCtrl(BitacoraController bitacoraCtrl) { + this.bitacoraCtrl = bitacoraCtrl; + } + + 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 BigDecimal getTotalCaja() { + return totalCaja; + } + + public void setTotalCaja(BigDecimal totalCaja) { + this.totalCaja = totalCaja; + } + + public void setLastStableGeneralBox(Date lastStableGeneralBox) { + this.lastStableGeneralBox = lastStableGeneralBox; + } + + private ExpenseCompanyController expenseCompanyCtrl; + private BitacoraController bitacoraCtrl; + private GenericController genericCtrl; + private StableGeneralBoxController stableGeneralBoxCtrl; + + private GenericValidationController genericValidateController; + private Date lastStableGeneralBox; + + private List expenseCompany; + + private String amount; + private String comments; + + private BigDecimal totalCaja; + private ExpenseCompany selectedExpenseCompany; + private String commentsBitacora; + + @PostConstruct + public void init() { + loadBundlePropertyFile(); + initOneWeekBeforeToCurrdate(); + + expenseCompanyCtrl = new ExpenseCompanyController(); + stableGeneralBoxCtrl = new StableGeneralBoxController(); + totalCaja= stableGeneralBoxCtrl.getTotalBox(); + bitacoraCtrl = new BitacoraController(); + genericCtrl = new GenericController(); + setGenericValidateController(new GenericValidationController()); + setLastStableGeneralBox(getGenericValidateController().lastStableGeneralBoxByDate(getLoggedUser().getUser())); + commentsBitacora = ""; + expenseCompany = fillDatatableExpenseCompany(); + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/FeesBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/FeesBean.java new file mode 100644 index 0000000..c79c92e --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/FeesBean.java @@ -0,0 +1,212 @@ +package com.arrebol.apc.web.beans.admin; + +import com.arrebol.apc.controller.GenericController; +import com.arrebol.apc.controller.admin.FeesController; +import com.arrebol.apc.controller.catalog.RouteController; +import com.arrebol.apc.model.catalog.RouteCtlg; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.views.FeesView; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +/** + * + * @author David Rodriguez + */ +@Named("feesManager") +@ViewScoped +public class FeesBean 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 { + setFees(fillDatatableFees()); + setTotalValue(); + } + } catch (Exception e) { + } + } + + public void searchHistoricalActionByRoute() { + try { + if (getStarDate().after(getEndDate())) { + showMessage(FacesMessage.SEVERITY_ERROR, getBundlePropertyFile().getString("generic.start.date"), getBundlePropertyFile().getString("generic.end.date.error")); + } else { + setFees(fillDatatableFeesByRoute()); + setTotalValue(); + } + } catch (Exception e) { + } + } + + public BigDecimal searchTotalFeesAction() { + try { + if (getStarDate().after(getEndDate())) { + showMessage(FacesMessage.SEVERITY_ERROR, getBundlePropertyFile().getString("generic.start.date"), getBundlePropertyFile().getString("generic.end.date.error")); + } else { + setTotalValue(); + } + } catch (Exception e) { + } + return getTotalFees(); + } + + public FeesController getFeesCtrl() { + return feesCtrl; + } + + public void setFeesCtrl(FeesController feesCtrl) { + this.feesCtrl = feesCtrl; + } + + public GenericController getGenericCtrl() { + return genericCtrl; + } + + public void setGenericCtrl(GenericController genericCtrl) { + this.genericCtrl = genericCtrl; + } + + public List fillDatatableFees() { + return getFeesCtrl().fillFeesDataTable(getStarDate(), getEndDate(), getUserSelectedId()); + } + + public List fillDatatableFeesByRoute() { + return getFeesCtrl().fillFeesDataTableByRoute(getStarDate(), getEndDate(), getRouteSelectedId()); + } + + public BigDecimal fillTotalFees() { + return getFeesCtrl().fillTotalFees(getStarDate(), getEndDate()); + } + + public List getFees() { + return fees; + } + + public void setFees(List fees) { + this.fees = fees; + } + + public FeesView getSelectedFees() { + return selectedFees; + } + + public void setSelectedFees(FeesView selectedFees) { + this.selectedFees = selectedFees; + } + + public BigDecimal getTotalFees() { + return totalFees; + } + + public void setTotalFees(BigDecimal totalFees) { + this.totalFees = totalFees; + } + + public List getUsers() { + return genericCtrl.getAllUsersByOffice(getLoggedUser().getOffice().getId()); + } + + public String getUserSelectedId() { + return userSelectedId; + } + + public void setUserSelectedId(String userSelectedId) { + this.userSelectedId = userSelectedId; + } + + public List getRoutes() { + return routes; + } + + public RouteController getRouteCtrl() { + return routeCtrl; + } + + public void setRouteCtrl(RouteController routeCtrl) { + this.routeCtrl = routeCtrl; + } + + public String getRouteSelectedId() { + return routeSelectedId; + } + + public void setRouteSelectedId(String routeSelectedId) { + this.routeSelectedId = routeSelectedId; + } + + private FeesController feesCtrl; + private GenericController genericCtrl; + private List fees; + private FeesView selectedFees; + private BigDecimal totalFees; + + private RouteController routeCtrl; + private List routes; + private String routeSelectedId; + + private List users; + private String userSelectedId; + + @PostConstruct + public void init() { + loadBundlePropertyFile(); + initOneWeekBeforeToCurrdate(); + + feesCtrl = new FeesController(); + genericCtrl = new GenericController(); + routeCtrl = new RouteController(); + fees = fillDatatableFees(); + setTotalValue(); + routes = routeCtrl.fillRoutesDatatable(getLoggedUser().getOffice().getId()); + } + + private void setTotalValue() { + if (fees != null && !fees.isEmpty()) { + setTotalFees(fees.stream().map(FeesView::getTotalFees).reduce(BigDecimal::add).get()); + } else { + setTotalFees(BigDecimal.ZERO); + } + } + + @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 onRowReorder(ReorderEvent event) { + 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. + } +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/GenericPersonSearchBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/GenericPersonSearchBean.java new file mode 100644 index 0000000..537e543 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/GenericPersonSearchBean.java @@ -0,0 +1,193 @@ +/* + * 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.web.beans.admin; + +import com.arrebol.apc.controller.admin.AdministrationPersonSearchViewController; +import com.arrebol.apc.model.catalog.RouteCtlg; +import com.arrebol.apc.model.enums.PeopleType; +import com.arrebol.apc.model.views.AdministrationPersonSerchView; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.util.ArrayList; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.primefaces.event.SelectEvent; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public abstract class GenericPersonSearchBean extends GenericBean implements Datatable { + + public void onSearchSinglePersonByNameItemSelect(SelectEvent event) { + try { + getPersonList().clear(); + getPersonList().add(getAdminSearchController().administrationPersonSerchViewById(((AdministrationPersonSerchView) event.getObject()).getId())); + } catch (Exception e) { + logger.error("onItemSelect", e); + } + } + + /** + * + * @param type + */ + protected void fillPersonList(PeopleType type) { + try { + setPersonList(getAdminSearchController().findPersonByTypeAndRouteAndOffice(type, getRouteId(), getLoggedUser().getOffice().getId())); + } catch (Exception e) { + setPersonList(new ArrayList<>()); + logger.error("fillPersonList", e); + } + } + + /** + * + * @param nameToSearch + * @param type + * @return + */ + protected List executeAutoComplete(String nameToSearch, PeopleType type) { + List results; + try { + results = getAdminSearchController().likePersonNameInPersonTypeAllRoutesByOffice("%" + nameToSearch + "%", type, getLoggedUser().getOffice().getId()); + } catch (Exception e) { + results = new ArrayList<>(); + + logger.error("executeAutoComplete", e); + } + return results; + } + + /** + * + * @param isAll + * @param peopleType + */ + protected void executeQueryLike(boolean isAll, PeopleType peopleType) { + try { + cleanAndPrepareRoutesDetails(isAll); + fillPersonListLikePersonName(peopleType); + } catch (Exception e) { + logger.error("executeQueryLike", e); + } + } + + /** + * + * @param type + */ + private void fillPersonListLikePersonName(PeopleType type) { + try { + setPersonList(getAdminSearchController().likePersonNameInPersonTypeInRoutesAndOffice("%" + getSearchPersonName() + "%", type, getIdRoutes(), getLoggedUser().getOffice().getId())); + } catch (Exception e) { + setPersonList(new ArrayList<>()); + logger.error("fillPersonListLikePersonName", e); + } + } + + /** + * + * @param isAll + */ + private void cleanAndPrepareRoutesDetails(boolean isAll) { + getIdRoutes().clear(); + + if (isAll) { + getRoutes().forEach((t) -> { + getIdRoutes().add(t.getId()); + }); + } else { + getIdRoutes().add(getRouteId()); + } + + } + + final Logger logger = LogManager.getLogger(getClass()); + + private AdministrationPersonSearchViewController adminSearchController; + private List personList; + private List routes; + private List idRoutes; + private String routeId; + private AdministrationPersonSerchView selectedPerson; + private String searchPersonName; + private AdministrationPersonSerchView searchSinglePersonByName; + + public AdministrationPersonSearchViewController getAdminSearchController() { + return adminSearchController; + } + + public void setAdminSearchController(AdministrationPersonSearchViewController adminSearchController) { + this.adminSearchController = adminSearchController; + } + + public List getPersonList() { + if (null == personList) { + personList = new ArrayList<>(); + } + return personList; + } + + public void setPersonList(List personList) { + this.personList = personList; + } + + public List getRoutes() { + return routes; + } + + public void setRoutes(List routes) { + this.routes = routes; + } + + public List getIdRoutes() { + if (null == idRoutes) { + idRoutes = new ArrayList<>(); + } + return idRoutes; + } + + public void setIdRoutes(List idRoutes) { + this.idRoutes = idRoutes; + } + + public String getRouteId() { + return routeId; + } + + public void setRouteId(String routeId) { + this.routeId = routeId; + } + + public AdministrationPersonSerchView getSelectedPerson() { + return selectedPerson; + } + + public void setSelectedPerson(AdministrationPersonSerchView selectedPerson) { + this.selectedPerson = selectedPerson; + } + + public String getSearchPersonName() { + return searchPersonName; + } + + public void setSearchPersonName(String searchPersonName) { + this.searchPersonName = searchPersonName; + } + + public AdministrationPersonSerchView getSearchSinglePersonByName() { + return searchSinglePersonByName; + } + + public void setSearchSinglePersonByName(AdministrationPersonSerchView searchSinglePersonByName) { + this.searchSinglePersonByName = searchSinglePersonByName; + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/GoalBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/GoalBean.java new file mode 100644 index 0000000..2251cfa --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/GoalBean.java @@ -0,0 +1,155 @@ +/* + * 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.web.beans.admin; + +import com.arrebol.apc.controller.admin.GoalController; +import com.arrebol.apc.model.admin.Goal; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; + +import javax.faces.context.FacesContext; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Named("goalManager") +@ViewScoped +public class GoalBean 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 { + setGoal(getGoalCtrl().fillGoalDatatable(getLoggedUser().getOffice().getId(), getStarDate(), getEndDate())); + } + } catch (Exception e) { + } + } + + public List fillDatatableGoal() { + + return getGoalCtrl().fillGoalDatatable(getLoggedUser().getOffice().getId(), getStarDate(), getEndDate()); + } + + @Override + public void editRow(RowEditEvent event) { + Goal goal = (Goal) event.getObject(); + if (goal != null) { + goalCtrl.updateByGoalId(goal); + showMessage(FacesMessage.SEVERITY_INFO, "Registro Editado", "Se hizo el cambio correctamente."); + } + } + + @Override + public void onRowCancel(RowEditEvent event) { + showMessage(FacesMessage.SEVERITY_INFO, "EdiciĆ³n Cancelada", ((Goal) event.getObject()).getAmount().toString()); + } + + @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() { + goalSave.setActiveStatus(ActiveStatus.ENEBLED); + goalSave.setAmount(new BigDecimal(amount)); + goalSave.setOffice(new Office(getLoggedUser().getOffice().getId())); + goalSave.setCreatedOn(new Date()); + goalSave.setCreatedBy(getLoggedUser().getId()); + goalCtrl.saveGoal(goalSave); + goalSave = new Goal(); + goal.clear(); + goal = fillDatatableGoal(); + amount = ""; + FacesMessage msg = new FacesMessage("Nueva meta", "Se agregĆ³ correctamente"); + FacesContext.getCurrentInstance().addMessage(null, msg); + } + + @Override + public void deleteRow() { + goalCtrl.updateGoalByStatus(ActiveStatus.DISABLED, selectedGoal.getId(), getLoggedUser().getUser().getId()); + goal.remove(selectedGoal); + selectedGoal = null; + showMessage(FacesMessage.SEVERITY_INFO, "Meta Eliminada", "Se eliminĆ³ correctamente."); + } + + public GoalController getGoalCtrl() { + return goalCtrl; + } + + public void setGoalCtrl(GoalController goalCtrl) { + this.goalCtrl = goalCtrl; + } + + public List getGoal() { + return goal; + } + + public void setGoal(List goal) { + this.goal = goal; + } + + public Goal getSelectedGoal() { + return selectedGoal; + } + + public void setSelectedGoal(Goal selectedGoal) { + this.selectedGoal = selectedGoal; + } + + public String getAmount() { + return amount; + } + + public void setAmount(String amount) { + this.amount = amount; + } + + public Goal getGoalSave() { + return goalSave; + } + + public void setGoalSave(Goal goalSave) { + this.goalSave = goalSave; + } + + private GoalController goalCtrl; + + private List goal; + + private Goal selectedGoal; + private String amount; + + private Goal goalSave; + + @PostConstruct + public void init() { + loadBundlePropertyFile(); + initOneWeekBeforeToCurrdate(); + + goalCtrl = new GoalController(); + goal = fillDatatableGoal(); + goalSave = new Goal(); + } +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/LoanDetailTransferBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/LoanDetailTransferBean.java new file mode 100644 index 0000000..3accefd --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/LoanDetailTransferBean.java @@ -0,0 +1,332 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.web.beans.admin; + +import com.arrebol.apc.controller.GenericController; +import com.arrebol.apc.controller.admin.LoanController; +import com.arrebol.apc.controller.catalog.LoanTypeController; +import com.arrebol.apc.controller.catalog.RouteController; +import com.arrebol.apc.controller.util.DateWrapper; +import com.arrebol.apc.model.catalog.RouteCtlg; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.enums.FeeStatus; +import com.arrebol.apc.model.enums.LoanDetailsType; +import com.arrebol.apc.model.enums.LoanStatus; +import com.arrebol.apc.model.enums.PeopleType; +import com.arrebol.apc.model.enums.TransferStatus; +import com.arrebol.apc.model.loan.Loan; +import com.arrebol.apc.model.loan.LoanDetails; +import com.arrebol.apc.model.loan.LoanFeeNotification; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author Oscar + */ + +@Named("loanDetailTransferManager") +@ViewScoped +public class LoanDetailTransferBean extends GenericBean implements Serializable, Datatable { + + + public List fillDatatableLoan() { + return getLoanCtrl().fillAllTransfersLoanDetails(); + } + + + public void authorizeLoanDetail(){ + getLoanCtrl().updateAuthorizeLoanDetailById(selectedLoanDetails.getId()); + + showMessage(FacesMessage.SEVERITY_INFO, "Deposito validado", "El depostio fue autorizado."); + setLoanDetails(fillDatatableLoan()); + + } + + + public void rejectLoanDetail(){ + + + showMessage(FacesMessage.SEVERITY_INFO, "Deposito validado", "El depostio fue rechazado."); + + + LoanDetails detail = new LoanDetails(); + Loan loan = selectedLoanDetails.getLoan(); + detail.setComments("Transferencia cancelada"); + detail.setCreatedBy(getLoggedUser().getUser().getId()); + detail.setCreatedOn(new Date()); + detail.setLoan(loan); + detail.setLoanDetailsType(LoanDetailsType.FEE); + detail.setTransferStatus(TransferStatus.AUTHORIZED); + detail.setTransferNumber("N/A"); + detail.setFeeStatus(FeeStatus.TO_PAY); + detail.setPaymentAmount(loan.getLoanType().getFee()); + detail.setPeopleType(PeopleType.CUSTOMER); + detail.setReferenceNumber(selectedLoanDetails.getLoan().getLastReferenceNumber() + 1); + detail.setUser(selectedLoanDetails.getUser()); + if (loanCtrl.saveLoanDetail(detail)) { + Loan loanUpdate = loanCtrl.getLoanById(loan.getId()); + loanUpdate.setAmountToPay(loanUpdate.getAmountToPay().add(loan.getLoanType().getFee())); + loanUpdate.setAmountPaid(loanUpdate.getAmountPaid().subtract(selectedLoanDetails.getPaymentAmount())); + loanUpdate.setLastUpdatedOn(new Date()); + loanUpdate.setLastUpdatedBy(getLoggedUser().getUser().getId()); + loanUpdate.setLastReferenceNumber(loanUpdate.getLastReferenceNumber() + 1); + loanCtrl.updateLoan(loanUpdate); + + LoanFeeNotification notification = new LoanFeeNotification(); + notification.setCreatedBy(getLoggedUser().getUser().getId()); + notification.setCreatedOn(new Date()); + notification.setLoan(loanUpdate); + notification.setUser(selectedLoanDetails.getUser()); + notification.setNotificationNumber(loanUpdate.getTotalFeeByLoan() + 1); + loanCtrl.saveLoanNotificationFee(notification); + + + showMessage(FacesMessage.SEVERITY_INFO, "Multa creada", "Se creo la multa de forma correcta."); + } + loanCtrl.deleteLoanDetails(selectedLoanDetails); + setLoanDetails(fillDatatableLoan()); + + } + 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()); + 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()); + 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() { + + /*if (selectedLoan.getLoanStatus() == LoanStatus.APPROVED || selectedLoan.getLoanStatus() == LoanStatus.PENDING_RENOVATION) { + + List details = loanCtrl.getLoanDetailsCurdatebyIdLoan(selectedLoan.getId()); + if (details != null && !details.isEmpty()) { + Loan loanUpdate = loanCtrl.getLoanById(selectedLoan.getId()); + for (LoanDetails detail : details) { + loanUpdate.setAmountPaid(loanUpdate.getAmountPaid().subtract(detail.getPaymentAmount())); + loanUpdate.setLastReferenceNumber(loanUpdate.getLastReferenceNumber() - 1); + } + if (loanCtrl.deleteLoanDetailsByLoanCurdate(selectedLoan)) { + loanCtrl.updateLoan(loanUpdate); + loan.clear(); + loan = fillDatatableLoan(); + selectedLoan = null; + showMessage(FacesMessage.SEVERITY_INFO, "Abonos eliminados", "Se eliminƃĀ³ el/los abonos del dƃĀ­a de hoy correctamente."); + } + } else { + showMessage(FacesMessage.SEVERITY_WARN, "Advertencia", "El prƃĀ©stamo no tiene registrado abonos el dƃĀ­a de hoy"); + } + } + 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; + }*/ + } + + @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 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 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; + } + + public LoanController getLoanCtrl() { + return loanCtrl; + } + + public void setLoanCtrl(LoanController loanCtrl) { + this.loanCtrl = loanCtrl; + } + + public List getLoanDetails() { + return loanDetails; + } + + public void setLoanDetails(List loanDetails) { + this.loanDetails = loanDetails; + } + + public LoanDetails getSelectedLoanDetails() { + return selectedLoanDetails; + } + + public void setSelectedLoanDetails(LoanDetails selectedLoanDetails) { + this.selectedLoanDetails = selectedLoanDetails; + } + + + + public String getComments() { + return comments; + } + + public void setComments(String comments) { + this.comments = comments; + } + + public GenericController getGenericCtrl() { + return genericCtrl; + } + + public void setGenericCtrl(GenericController genericCtrl) { + this.genericCtrl = genericCtrl; + } + + public List getUsers() { + return users; + } + + public void setUsers(List users) { + this.users = users; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public BigDecimal getPayment() { + return payment; + } + + public void setPayment(BigDecimal payment) { + this.payment = payment; + } + + public BigDecimal getFee() { + return fee; + } + + public void setFee(BigDecimal fee) { + this.fee = fee; + } + + public LoanTypeController getLoanTypeCtrl() { + return loanTypeCtrl; + } + + public void setLoanTypeCtrl(LoanTypeController loanTypeCtrl) { + this.loanTypeCtrl = loanTypeCtrl; + } + + public String getLoanTypeId() { + return loanTypeId; + } + + public void setLoanTypeId(String loanTypeId) { + this.loanTypeId = loanTypeId; + } + + public String getRouteId() { + return routeId; + } + + public void setRouteId(String routeId) { + this.routeId = routeId; + } + + public RouteController getRouteCtrl() { + return routeCtrl; + } + + public void setRouteCtrl(RouteController routeCtrl) { + this.routeCtrl = routeCtrl; + } + + private LoanController loanCtrl; + private LoanTypeController loanTypeCtrl; + private GenericController genericCtrl; + private RouteController routeCtrl; + + private List loanDetails; + private List users; + private LoanDetails selectedLoanDetails; + private String comments; + private String userId; + private BigDecimal payment; + private BigDecimal fee; + private String loanTypeId; + private String routeId; + + @PostConstruct + public void init() { + loadBundlePropertyFile(); + + loanCtrl = new LoanController(); + genericCtrl = new GenericController(); + loanTypeCtrl = new LoanTypeController(); + routeCtrl = new RouteController(); + users = genericCtrl.getAllUsersByOffice(getLoggedUser().getOffice().getId()); + + setLoanDetails(fillDatatableLoan()); + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/LoanEmployeeListBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/LoanEmployeeListBean.java new file mode 100644 index 0000000..2a8f406 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/LoanEmployeeListBean.java @@ -0,0 +1,411 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.web.beans.admin; + +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.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author Administrador + */ +@Named("loanEmployeeListBean") +@ViewScoped +public class LoanEmployeeListBean extends GenericBean implements Serializable, Datatable { + + public List 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 getTotalAmountLoan(); + } + + 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 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 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())); + } + + 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)); + + 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"); + } + + } + + @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; + delete = selectedLoan.getLoanEmployeeStatus() == ActiveStatus.ENEBLED ? true : false; + + if (delete) { + 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()); + + /* + List 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."); + } + } + else{ + showMessage(FacesMessage.SEVERITY_INFO, "PrĆ©stamo tiene abonos agregados", "No se puede borrar un prĆ©stamo con abonos."); + } + + } + } + + private LoanEmployeeController controller; + private GenericController genericCtrl; + private List loanEmployeeView; + private List loanEmployeeDetails; + private LoanEmployeeView selectedLoan; + private List 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; + } + + public void setTotalAmountLoan(BigDecimal totalAmountLoan) { + this.totalAmountLoan = totalAmountLoan; + } + + public BigDecimal getAmountLoan() { + return amountLoan; + } + + public void setAmountLoan(BigDecimal amountLoan) { + this.amountLoan = amountLoan; + } + + public BigDecimal getLoanDetailAmount() { + return loanDetailAmount; + } + + public void setLoanDetailAmount(BigDecimal loanDetailAmount) { + this.loanDetailAmount = loanDetailAmount; + } + + public BigDecimal getAmountToPay() { + return amountToPay; + } + + public void setAmountToPay(BigDecimal amountToPay) { + this.amountToPay = amountToPay; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public GenericController getGenericCtrl() { + return genericCtrl; + } + + public void setGenericCtrl(GenericController genericCtrl) { + this.genericCtrl = genericCtrl; + } + + public List getUsers() { + return users; + } + + public void setUsers(List users) { + this.users = users; + } + + public List getLoanEmployeeView() { + return loanEmployeeView; + } + + public void setLoanEmployeeView(List loanEmployeeView) { + this.loanEmployeeView = loanEmployeeView; + } + + public LoanEmployeeView getSelectedLoan() { + return selectedLoan; + } + + public void setSelectedLoan(LoanEmployeeView selectedLoan) { + this.selectedLoan = selectedLoan; + } + + public LoanEmployeeController getController() { + return controller; + } + + public void setController(LoanEmployeeController controller) { + this.controller = controller; + } + + public List getLoanEmployee() { + return loanEmployeeView; + } + + public void setLoanEmployee(List loanEmployee) { + this.loanEmployeeView = loanEmployee; + } + + public List getLoanEmployeeDetails() { + return loanEmployeeDetails; + } + + public void setLoanEmployeeDetails(List loanEmployeeDetails) { + this.loanEmployeeDetails = loanEmployeeDetails; + } + + 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) { + } + } +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/LoanHistoryBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/LoanHistoryBean.java new file mode 100644 index 0000000..574408d --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/LoanHistoryBean.java @@ -0,0 +1,546 @@ +/* + * 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.web.beans.admin; + +import com.arrebol.apc.controller.GenericController; +import com.arrebol.apc.controller.admin.LoanController; +import com.arrebol.apc.controller.catalog.LoanTypeController; +import com.arrebol.apc.controller.catalog.RouteController; +import com.arrebol.apc.controller.util.DateWrapper; +import com.arrebol.apc.model.catalog.RouteCtlg; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.enums.LoanStatus; +import com.arrebol.apc.model.loan.Loan; +import com.arrebol.apc.model.loan.LoanType; +import com.arrebol.apc.model.views.HistoryLoanView; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Named("loanHistoryManager") +@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 List fillDatatableLoan() { + return getLoanCtrl().fillAllLoansViewDatatable(getStarDate(), getEndDate()); + } + + 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."); + } + + 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."); + } + + public void deleteFeeLoan() { + + /* if (selectedLoan.getEstatusPrestamo()== LoanStatus.APPROVED.getValue() || selectedLoan.getEstatusPrestamo() == LoanStatus.PENDING_RENOVATION.getValue()) { + + List details = loanCtrl.getLoanDetailsFeeCurdatebyIdLoan(selectedLoan.getId()); + if (details != null && !details.isEmpty()) { + Loan loanUpdate = loanCtrl.getLoanById(selectedLoan.getId()); + for (LoanDetails detail : details) { + loanUpdate.setAmountToPay(loanUpdate.getAmountToPay().subtract(detail.getPaymentAmount())); + } + if (loanCtrl.deleteLoanDetailsFeeByLoanCurdate(selectedLoan)) { + loanCtrl.deleteLoanFeeNotificationByLoanCurdate(selectedLoan); + loanCtrl.updateLoan(loanUpdate); + loan.clear(); + loan = fillDatatableLoan(); + selectedLoan = null; + showMessage(FacesMessage.SEVERITY_INFO, "Multas eliminadas", "Se eliminĆ³ el/las multas del dĆ­a de hoy correctamente."); + } + } else { + showMessage(FacesMessage.SEVERITY_WARN, "Advertencia", "El prĆ©stamo no tiene registrado multas el dĆ­a de hoy"); + } + } + 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 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()); + 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()); + 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() { + + /*if (selectedLoan.getLoanStatus() == LoanStatus.APPROVED || selectedLoan.getLoanStatus() == LoanStatus.PENDING_RENOVATION) { + + List details = loanCtrl.getLoanDetailsCurdatebyIdLoan(selectedLoan.getId()); + if (details != null && !details.isEmpty()) { + Loan loanUpdate = loanCtrl.getLoanById(selectedLoan.getId()); + for (LoanDetails detail : details) { + loanUpdate.setAmountPaid(loanUpdate.getAmountPaid().subtract(detail.getPaymentAmount())); + loanUpdate.setLastReferenceNumber(loanUpdate.getLastReferenceNumber() - 1); + } + if (loanCtrl.deleteLoanDetailsByLoanCurdate(selectedLoan)) { + loanCtrl.updateLoan(loanUpdate); + loan.clear(); + loan = fillDatatableLoan(); + selectedLoan = null; + showMessage(FacesMessage.SEVERITY_INFO, "Abonos eliminados", "Se eliminĆ³ el/los abonos del dĆ­a de hoy correctamente."); + } + } else { + showMessage(FacesMessage.SEVERITY_WARN, "Advertencia", "El prĆ©stamo no tiene registrado abonos el dĆ­a de hoy"); + } + } + 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; + }*/ + } + + @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) { + LoanDetails detail = new LoanDetails(); + detail.setComments(comments); + detail.setCreatedBy(getLoggedUser().getUser().getId()); + detail.setCreatedOn(new Date()); + detail.setLoan(selectedLoan); + detail.setLoanDetailsType(LoanDetailsType.PAYMENT); + detail.setPaymentAmount(payment); + detail.setPeopleType(PeopleType.CUSTOMER); + detail.setReferenceNumber(selectedLoan.getLastReferenceNumber() + 1); + detail.setUser(new User(userId)); + if (loanCtrl.saveLoanDetail(detail)) { + Loan loanUpdate = loanCtrl.getLoanById(selectedLoan.getId()); + loanUpdate.setAmountPaid(loanUpdate.getAmountPaid().add(payment)); + loanUpdate.setLastReferenceNumber(loanUpdate.getLastReferenceNumber() + 1); + if (loanUpdate.getAmountToPay().compareTo(loanUpdate.getAmountPaid()) == 0) { + + LoanByUser loanByUser = loanCtrl.getLoanByUserByIdLoan(loanUpdate); + loanByUser.setLoanByUserStatus(LoanStatus.FINISH); + if (loanCtrl.updateLoanByUser(loanByUser)) { + loanUpdate.setLoanStatus(LoanStatus.FINISH); + } + } + loanCtrl.updateLoan(loanUpdate); + loan.clear(); + loan = fillDatatableLoan(); + selectedLoan = null; + userId = ""; + comments = ""; + payment = BigDecimal.ZERO; + showMessage(FacesMessage.SEVERITY_INFO, "Agregar abono", "Se agregĆ³ el abono de forma correcta."); + } + } else { + selectedLoan = null; + userId = ""; + comments = ""; + payment = BigDecimal.ZERO; + showMessage(FacesMessage.SEVERITY_WARN, "No se puede abonar", "Solo puedes abonar prĆ©stamos en estatus Aprobados o Pendientes por renovaciĆ³n"); + return; + }*/ + + } + + public void addFee() { + /*if (selectedLoan.getLoanStatus() != LoanStatus.APPROVED) { + selectedLoan = null; + userId = ""; + comments = ""; + fee = BigDecimal.ZERO; + showMessage(FacesMessage.SEVERITY_WARN, "No se puede multar", "Solo puedes multar prĆ©stamos en estatus Aprobados"); + return; + } + LoanDetails detail = new LoanDetails(); + detail.setComments(comments); + detail.setCreatedBy(getLoggedUser().getUser().getId()); + detail.setCreatedOn(new Date()); + detail.setLoan(selectedLoan); + detail.setLoanDetailsType(LoanDetailsType.FEE); + detail.setPaymentAmount(fee); + detail.setPeopleType(PeopleType.CUSTOMER); + detail.setReferenceNumber(selectedLoan.getLastReferenceNumber() + 1); + detail.setUser(new User(userId)); + if (loanCtrl.saveLoanDetail(detail)) { + Loan loanUpdate = loanCtrl.getLoanById(selectedLoan.getId()); + loanUpdate.setAmountToPay(loanUpdate.getAmountToPay().add(fee)); + loanUpdate.setLastReferenceNumber(loanUpdate.getLastReferenceNumber() + 1); + loanCtrl.updateLoan(loanUpdate); + + LoanFeeNotification notification = new LoanFeeNotification(); + notification.setCreatedBy(getLoggedUser().getUser().getId()); + notification.setCreatedOn(new Date()); + notification.setLoan(loanUpdate); + notification.setUser(new User(userId)); + notification.setNotificationNumber(loanUpdate.getTotalFeeByLoan() + 1); + loanCtrl.saveLoanNotificationFee(notification); + + loan.clear(); + loan = fillDatatableLoan(); + selectedLoan = null; + userId = ""; + comments = ""; + fee = BigDecimal.ZERO; + showMessage(FacesMessage.SEVERITY_INFO, "Agregar multa", "Se agregĆ³ la multa de forma correcta."); + }*/ + } + + 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"); + return; + } + LoanByUser old = new LoanByUser(); + old = loanCtrl.getLoanByUserByIdLoan(selectedLoan); + + LoanByUser loanByUser = new LoanByUser(); + LoanByUserId idRelation = new LoanByUserId(); + + idRelation.setIdLoan(selectedLoan.getId()); + idRelation.setIdUser(userId); + + loanByUser.setId(idRelation); + loanByUser.setComments(old.getComments()); + loanByUser.setCreatedBy(old.getCreatedBy()); + loanByUser.setLoanByUserStatus(old.getLoanByUserStatus()); + loanByUser.setLoan(selectedLoan); + loanByUser.setOrderInList(old.getOrderInList()); + loanByUser.setOwnerLoan(OwnerLoan.CURRENT_OWNER); + loanByUser.setUser(new User(userId)); + if (loanCtrl.deleteLoanByUser(old)) { + loanCtrl.saveLoanByUser(loanByUser); + selectedLoan = null; + userId = ""; + loan.clear(); + loan = fillDatatableLoan(); + showMessage(FacesMessage.SEVERITY_INFO, "Cambio de propietario", "Se reasignĆ³ el prĆ©stamo de forma correcta."); + } else { + 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(); + + starDateCalendar.setTime(DateWrapper.getTodayMXTime()); + starDateCalendar.add(Calendar.MONTH, -1); + + 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. + } + + @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 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. + } + + /** + * + * @param outcome + * @return + */ + public String detailLoan(String outcome) { + return outcome; + } + + public LoanController getLoanCtrl() { + return loanCtrl; + } + + public void setLoanCtrl(LoanController loanCtrl) { + this.loanCtrl = loanCtrl; + } + + public List getLoan() { + return loan; + } + + public void setLoan(List loan) { + this.loan = loan; + } + + public HistoryLoanView getSelectedLoan() { + return selectedLoan; + } + + public void setSelectedLoan(HistoryLoanView selectedLoan) { + this.selectedLoan = selectedLoan; + } + + public String getComments() { + return comments; + } + + public void setComments(String comments) { + this.comments = comments; + } + + public GenericController getGenericCtrl() { + return genericCtrl; + } + + public void setGenericCtrl(GenericController genericCtrl) { + this.genericCtrl = genericCtrl; + } + + public List getUsers() { + return users; + } + + public void setUsers(List users) { + this.users = users; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public BigDecimal getPayment() { + return payment; + } + + public void setPayment(BigDecimal payment) { + this.payment = payment; + } + + public BigDecimal getFee() { + return fee; + } + + public void setFee(BigDecimal fee) { + this.fee = fee; + } + + public LoanTypeController getLoanTypeCtrl() { + return loanTypeCtrl; + } + + public void setLoanTypeCtrl(LoanTypeController loanTypeCtrl) { + this.loanTypeCtrl = loanTypeCtrl; + } + + public List getLoanType() { + return loanType; + } + + public void setLoanType(List loanType) { + this.loanType = loanType; + } + + public String getLoanTypeId() { + return loanTypeId; + } + + public void setLoanTypeId(String loanTypeId) { + this.loanTypeId = loanTypeId; + } + + public String getRouteId() { + return routeId; + } + + public void setRouteId(String routeId) { + this.routeId = routeId; + } + + public RouteController getRouteCtrl() { + return routeCtrl; + } + + public void setRouteCtrl(RouteController routeCtrl) { + this.routeCtrl = routeCtrl; + } + + public List getRoute() { + return route; + } + + public void setRoute(List route) { + this.route = route; + } + + public Date getStarDate() { + return starDate; + } + + public void setStarDate(Date starDate) { + this.starDate = starDate; + } + + public Date getEndDate() { + return endDate; + } + + public void setEndDate(Date endDate) { + this.endDate = endDate; + } + + private LoanController loanCtrl; + private LoanTypeController loanTypeCtrl; + private GenericController genericCtrl; + private RouteController routeCtrl; + + private List loan; + private List users; + private List loanType; + private List 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; + + @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()); + + setLoan(fillDatatableLoan()); + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/LoanHistoryDetailBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/LoanHistoryDetailBean.java new file mode 100644 index 0000000..ec8c5bf --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/LoanHistoryDetailBean.java @@ -0,0 +1,220 @@ +/* + * 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.web.beans.admin; + +import com.arrebol.apc.controller.admin.CustomerController; +import com.arrebol.apc.controller.admin.EndorsementController; +import com.arrebol.apc.controller.admin.LoanController; +import com.arrebol.apc.model.catalog.People; +import com.arrebol.apc.model.enums.LoanStatus; +import com.arrebol.apc.model.loan.Loan; +import com.arrebol.apc.model.loan.LoanDetails; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Named("loanHistoryDetailManager") +@ViewScoped +public class LoanHistoryDetailBean extends GenericBean implements Serializable, Datatable { + + public List getDetails(String id) { + try { + loanDetails = loanCtrl.getLoanDetailsbyId(id); + + } catch (Exception e) { + } + return null == loanDetails ? new ArrayList<>() : loanDetails; + } + + public People getCustomerDetail(String peopleId){ + return customerCtrl.findPeopleById(peopleId); + } + + public List getLoanByCustomer(String peopleId){ + return customerCtrl.findLoanByCustomer(peopleId); + } + + public List getLoanByEndorsement(String peopleId){ + return endorsementCtrl.findLoanByEndorsement(peopleId); + } + + @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 onRowReorder(ReorderEvent event) { + 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. + } + + public CustomerController getCustomerCtrl() { + return customerCtrl; + } + + public void setCustomerCtrl(CustomerController customerCtrl) { + this.customerCtrl = customerCtrl; + } + + public People getCustomer() { + return customer; + } + + public void setCustomer(People customer) { + this.customer = customer; + } + + public List getLoanCustomer() { + return loanCustomer; + } + + public void setLoanCustomer(List loanCustomer) { + this.loanCustomer = loanCustomer; + } + + public String getCustomerId() { + return customerId; + } + + public void setCustomerId(String customerId) { + this.customerId = customerId; + } + + public LoanController getLoanCtrl() { + return loanCtrl; + } + + public void setLoanCtrl(LoanController loanCtrl) { + this.loanCtrl = loanCtrl; + } + + public String getLoanId() { + return loanId; + } + + public void setLoanId(String loanId) { + this.loanId = loanId; + } + + public Loan getLoan() { + return loan; + } + + public void setLoan(Loan loan) { + this.loan = loan; + } + + public EndorsementController getEndorsementCtrl() { + return endorsementCtrl; + } + + public void setEndorsementCtrl(EndorsementController endorsementCtrl) { + this.endorsementCtrl = endorsementCtrl; + } + + public People getEndorsement() { + return endorsement; + } + + public void setEndorsement(People endorsement) { + this.endorsement = endorsement; + } + + public String getEndorsementId() { + return endorsementId; + } + + public void setEndorsementId(String endorsementId) { + this.endorsementId = endorsementId; + } + + public List getLoanEndorsement() { + return loanEndorsement; + } + + public void setLoanEndorsement(List loanEndorsement) { + this.loanEndorsement = loanEndorsement; + } + + public Loan getSelectedLoanCustomer() { + return selectedLoanCustomer; + } + + public void setSelectedLoanCustomer(Loan selectedLoanCustomer) { + this.selectedLoanCustomer = selectedLoanCustomer; + } + + public List getLoanDetails() { + return loanDetails; + } + + public void setLoanDetails(List loanDetails) { + this.loanDetails = loanDetails; + } + + private CustomerController customerCtrl; + private LoanController loanCtrl; + private EndorsementController endorsementCtrl; + + private People customer; + private Loan loan; + private People endorsement; + + private String customerId; + private String loanId; + private String endorsementId; + + private List loanEndorsement; + private List loanCustomer; + private Loan selectedLoanCustomer; + + private List loanDetails; + + @PostConstruct + public void init() { + loadBundlePropertyFile(); + customerCtrl = new CustomerController(); + loanCtrl = new LoanController(); + endorsementCtrl = new EndorsementController(); + + setLoanId(externalContext().getRequestParameterMap().get("form:dtLoan_selection")); + loan = loanCtrl.getLoanById(getLoanId()); + customer = loan.getCustomer(); + endorsement = loan.getEndorsement(); + loanEndorsement = getLoanByEndorsement(loan.getEndorsement().getId()); + loanCustomer = getLoanByCustomer(loan.getCustomer().getId()); + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/LoanHistoryJuridicalBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/LoanHistoryJuridicalBean.java new file mode 100644 index 0000000..6d39ef0 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/LoanHistoryJuridicalBean.java @@ -0,0 +1,546 @@ +/* + * 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.web.beans.admin; + +import com.arrebol.apc.controller.GenericController; +import com.arrebol.apc.controller.admin.LoanController; +import com.arrebol.apc.controller.catalog.LoanTypeController; +import com.arrebol.apc.controller.catalog.RouteController; +import com.arrebol.apc.controller.util.DateWrapper; +import com.arrebol.apc.model.catalog.RouteCtlg; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.enums.LoanStatus; +import com.arrebol.apc.model.loan.Loan; +import com.arrebol.apc.model.loan.LoanType; +import com.arrebol.apc.model.views.HistoryLoanView; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Named("loanHistoryJuridicalManager") +@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 List fillDatatableLoan() { + return getLoanCtrl().fillAllLoansJuridicalViewDatatable(getStarDate(), getEndDate()); + } + + 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."); + } + + 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."); + } + + public void deleteFeeLoan() { + + /* if (selectedLoan.getEstatusPrestamo()== LoanStatus.APPROVED.getValue() || selectedLoan.getEstatusPrestamo() == LoanStatus.PENDING_RENOVATION.getValue()) { + + List details = loanCtrl.getLoanDetailsFeeCurdatebyIdLoan(selectedLoan.getId()); + if (details != null && !details.isEmpty()) { + Loan loanUpdate = loanCtrl.getLoanById(selectedLoan.getId()); + for (LoanDetails detail : details) { + loanUpdate.setAmountToPay(loanUpdate.getAmountToPay().subtract(detail.getPaymentAmount())); + } + if (loanCtrl.deleteLoanDetailsFeeByLoanCurdate(selectedLoan)) { + loanCtrl.deleteLoanFeeNotificationByLoanCurdate(selectedLoan); + loanCtrl.updateLoan(loanUpdate); + loan.clear(); + loan = fillDatatableLoan(); + selectedLoan = null; + showMessage(FacesMessage.SEVERITY_INFO, "Multas eliminadas", "Se eliminĆ³ el/las multas del dĆ­a de hoy correctamente."); + } + } else { + showMessage(FacesMessage.SEVERITY_WARN, "Advertencia", "El prĆ©stamo no tiene registrado multas el dĆ­a de hoy"); + } + } + 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 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()); + 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()); + 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() { + + /*if (selectedLoan.getLoanStatus() == LoanStatus.APPROVED || selectedLoan.getLoanStatus() == LoanStatus.PENDING_RENOVATION) { + + List details = loanCtrl.getLoanDetailsCurdatebyIdLoan(selectedLoan.getId()); + if (details != null && !details.isEmpty()) { + Loan loanUpdate = loanCtrl.getLoanById(selectedLoan.getId()); + for (LoanDetails detail : details) { + loanUpdate.setAmountPaid(loanUpdate.getAmountPaid().subtract(detail.getPaymentAmount())); + loanUpdate.setLastReferenceNumber(loanUpdate.getLastReferenceNumber() - 1); + } + if (loanCtrl.deleteLoanDetailsByLoanCurdate(selectedLoan)) { + loanCtrl.updateLoan(loanUpdate); + loan.clear(); + loan = fillDatatableLoan(); + selectedLoan = null; + showMessage(FacesMessage.SEVERITY_INFO, "Abonos eliminados", "Se eliminĆ³ el/los abonos del dĆ­a de hoy correctamente."); + } + } else { + showMessage(FacesMessage.SEVERITY_WARN, "Advertencia", "El prĆ©stamo no tiene registrado abonos el dĆ­a de hoy"); + } + } + 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; + }*/ + } + + @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) { + LoanDetails detail = new LoanDetails(); + detail.setComments(comments); + detail.setCreatedBy(getLoggedUser().getUser().getId()); + detail.setCreatedOn(new Date()); + detail.setLoan(selectedLoan); + detail.setLoanDetailsType(LoanDetailsType.PAYMENT); + detail.setPaymentAmount(payment); + detail.setPeopleType(PeopleType.CUSTOMER); + detail.setReferenceNumber(selectedLoan.getLastReferenceNumber() + 1); + detail.setUser(new User(userId)); + if (loanCtrl.saveLoanDetail(detail)) { + Loan loanUpdate = loanCtrl.getLoanById(selectedLoan.getId()); + loanUpdate.setAmountPaid(loanUpdate.getAmountPaid().add(payment)); + loanUpdate.setLastReferenceNumber(loanUpdate.getLastReferenceNumber() + 1); + if (loanUpdate.getAmountToPay().compareTo(loanUpdate.getAmountPaid()) == 0) { + + LoanByUser loanByUser = loanCtrl.getLoanByUserByIdLoan(loanUpdate); + loanByUser.setLoanByUserStatus(LoanStatus.FINISH); + if (loanCtrl.updateLoanByUser(loanByUser)) { + loanUpdate.setLoanStatus(LoanStatus.FINISH); + } + } + loanCtrl.updateLoan(loanUpdate); + loan.clear(); + loan = fillDatatableLoan(); + selectedLoan = null; + userId = ""; + comments = ""; + payment = BigDecimal.ZERO; + showMessage(FacesMessage.SEVERITY_INFO, "Agregar abono", "Se agregĆ³ el abono de forma correcta."); + } + } else { + selectedLoan = null; + userId = ""; + comments = ""; + payment = BigDecimal.ZERO; + showMessage(FacesMessage.SEVERITY_WARN, "No se puede abonar", "Solo puedes abonar prĆ©stamos en estatus Aprobados o Pendientes por renovaciĆ³n"); + return; + }*/ + + } + + public void addFee() { + /*if (selectedLoan.getLoanStatus() != LoanStatus.APPROVED) { + selectedLoan = null; + userId = ""; + comments = ""; + fee = BigDecimal.ZERO; + showMessage(FacesMessage.SEVERITY_WARN, "No se puede multar", "Solo puedes multar prĆ©stamos en estatus Aprobados"); + return; + } + LoanDetails detail = new LoanDetails(); + detail.setComments(comments); + detail.setCreatedBy(getLoggedUser().getUser().getId()); + detail.setCreatedOn(new Date()); + detail.setLoan(selectedLoan); + detail.setLoanDetailsType(LoanDetailsType.FEE); + detail.setPaymentAmount(fee); + detail.setPeopleType(PeopleType.CUSTOMER); + detail.setReferenceNumber(selectedLoan.getLastReferenceNumber() + 1); + detail.setUser(new User(userId)); + if (loanCtrl.saveLoanDetail(detail)) { + Loan loanUpdate = loanCtrl.getLoanById(selectedLoan.getId()); + loanUpdate.setAmountToPay(loanUpdate.getAmountToPay().add(fee)); + loanUpdate.setLastReferenceNumber(loanUpdate.getLastReferenceNumber() + 1); + loanCtrl.updateLoan(loanUpdate); + + LoanFeeNotification notification = new LoanFeeNotification(); + notification.setCreatedBy(getLoggedUser().getUser().getId()); + notification.setCreatedOn(new Date()); + notification.setLoan(loanUpdate); + notification.setUser(new User(userId)); + notification.setNotificationNumber(loanUpdate.getTotalFeeByLoan() + 1); + loanCtrl.saveLoanNotificationFee(notification); + + loan.clear(); + loan = fillDatatableLoan(); + selectedLoan = null; + userId = ""; + comments = ""; + fee = BigDecimal.ZERO; + showMessage(FacesMessage.SEVERITY_INFO, "Agregar multa", "Se agregĆ³ la multa de forma correcta."); + }*/ + } + + 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"); + return; + } + LoanByUser old = new LoanByUser(); + old = loanCtrl.getLoanByUserByIdLoan(selectedLoan); + + LoanByUser loanByUser = new LoanByUser(); + LoanByUserId idRelation = new LoanByUserId(); + + idRelation.setIdLoan(selectedLoan.getId()); + idRelation.setIdUser(userId); + + loanByUser.setId(idRelation); + loanByUser.setComments(old.getComments()); + loanByUser.setCreatedBy(old.getCreatedBy()); + loanByUser.setLoanByUserStatus(old.getLoanByUserStatus()); + loanByUser.setLoan(selectedLoan); + loanByUser.setOrderInList(old.getOrderInList()); + loanByUser.setOwnerLoan(OwnerLoan.CURRENT_OWNER); + loanByUser.setUser(new User(userId)); + if (loanCtrl.deleteLoanByUser(old)) { + loanCtrl.saveLoanByUser(loanByUser); + selectedLoan = null; + userId = ""; + loan.clear(); + loan = fillDatatableLoan(); + showMessage(FacesMessage.SEVERITY_INFO, "Cambio de propietario", "Se reasignĆ³ el prĆ©stamo de forma correcta."); + } else { + 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(); + + starDateCalendar.setTime(DateWrapper.getTodayMXTime()); + starDateCalendar.add(Calendar.MONTH, -1); + + 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. + } + + @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 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. + } + + /** + * + * @param outcome + * @return + */ + public String detailLoan(String outcome) { + return outcome; + } + + public LoanController getLoanCtrl() { + return loanCtrl; + } + + public void setLoanCtrl(LoanController loanCtrl) { + this.loanCtrl = loanCtrl; + } + + public List getLoan() { + return loan; + } + + public void setLoan(List loan) { + this.loan = loan; + } + + public HistoryLoanView getSelectedLoan() { + return selectedLoan; + } + + public void setSelectedLoan(HistoryLoanView selectedLoan) { + this.selectedLoan = selectedLoan; + } + + public String getComments() { + return comments; + } + + public void setComments(String comments) { + this.comments = comments; + } + + public GenericController getGenericCtrl() { + return genericCtrl; + } + + public void setGenericCtrl(GenericController genericCtrl) { + this.genericCtrl = genericCtrl; + } + + public List getUsers() { + return users; + } + + public void setUsers(List users) { + this.users = users; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public BigDecimal getPayment() { + return payment; + } + + public void setPayment(BigDecimal payment) { + this.payment = payment; + } + + public BigDecimal getFee() { + return fee; + } + + public void setFee(BigDecimal fee) { + this.fee = fee; + } + + public LoanTypeController getLoanTypeCtrl() { + return loanTypeCtrl; + } + + public void setLoanTypeCtrl(LoanTypeController loanTypeCtrl) { + this.loanTypeCtrl = loanTypeCtrl; + } + + public List getLoanType() { + return loanType; + } + + public void setLoanType(List loanType) { + this.loanType = loanType; + } + + public String getLoanTypeId() { + return loanTypeId; + } + + public void setLoanTypeId(String loanTypeId) { + this.loanTypeId = loanTypeId; + } + + public String getRouteId() { + return routeId; + } + + public void setRouteId(String routeId) { + this.routeId = routeId; + } + + public RouteController getRouteCtrl() { + return routeCtrl; + } + + public void setRouteCtrl(RouteController routeCtrl) { + this.routeCtrl = routeCtrl; + } + + public List getRoute() { + return route; + } + + public void setRoute(List route) { + this.route = route; + } + + public Date getStarDate() { + return starDate; + } + + public void setStarDate(Date starDate) { + this.starDate = starDate; + } + + public Date getEndDate() { + return endDate; + } + + public void setEndDate(Date endDate) { + this.endDate = endDate; + } + + private LoanController loanCtrl; + private LoanTypeController loanTypeCtrl; + private GenericController genericCtrl; + private RouteController routeCtrl; + + private List loan; + private List users; + private List loanType; + private List 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; + + @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()); + + setLoan(fillDatatableLoan()); + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/LoanPendingBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/LoanPendingBean.java new file mode 100644 index 0000000..a29a339 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/LoanPendingBean.java @@ -0,0 +1,478 @@ +/* + * 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.web.beans.admin; + +import com.arrebol.apc.controller.BitacoraController; +import com.arrebol.apc.controller.GenericController; +import com.arrebol.apc.controller.admin.CustomerController; +import com.arrebol.apc.controller.admin.EndorsementController; +import com.arrebol.apc.controller.admin.LoanController; +import com.arrebol.apc.controller.catalog.LoanTypeController; +import com.arrebol.apc.model.catalog.People; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.enums.LoanDetailsType; +import com.arrebol.apc.model.enums.LoanRenovationStatus; +import com.arrebol.apc.model.enums.LoanStatus; +import com.arrebol.apc.model.enums.OwnerLoan; +import com.arrebol.apc.model.enums.PeopleType; +import com.arrebol.apc.model.loan.Loan; +import com.arrebol.apc.model.loan.LoanByRenovation; +import com.arrebol.apc.model.loan.LoanByUser; +import com.arrebol.apc.model.loan.LoanByUserId; +import com.arrebol.apc.model.loan.LoanDetails; +import com.arrebol.apc.model.loan.LoanType; +import com.arrebol.apc.model.system.logs.Bitacora; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.context.FacesContext; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Named("loanPendingManager") +@ViewScoped +public class LoanPendingBean extends GenericBean implements Serializable, Datatable{ + + public List fillDatatableLoan() { + + return loanCtrl.fillLoanByStatusPendingDatatable(getLoggedUser().getOffice().getId()); + } + + @Override + public void editRow(RowEditEvent event) { + + } + + public void calculationFunction() + { + if(loanTypeId != null && !loanTypeId.isEmpty()) + total = loanTypeCtrl.getLoanTypeById(loanTypeId).getPaymentTotal().add(totalFee).subtract(totalPayment); + else + total = BigDecimal.ZERO; + } + + public void approvedLoan() { + loanCtrl.updateLoanByStatus(LoanStatus.TO_DELIVERY, selectedLoan.getId(), getLoggedUser().getUser().getId()); + loanCtrl.updateLoanByUserByStatus(LoanStatus.TO_DELIVERY, selectedLoan); + loan.remove(selectedLoan); + selectedLoan = null; + selectedLoan = null; + + showMessage(FacesMessage.SEVERITY_INFO, "Cambio de estatus", "El prĆ©stamo se cambiĆ³ a estatus 'A conciliar' de forma correcta."); + } + + @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 addRow() { + Loan loanSave = new Loan(); + loanSave.setComments(comments); + loanSave.setCustomer(new People(customerId)); + loanSave.setEndorsement(new People(endorsementId)); + loanSave.setLoanType(new LoanType(loanTypeId)); + if(aprobado) + loanSave.setLoanStatus(LoanStatus.APPROVED); + else if(terminado) + loanSave.setLoanStatus(LoanStatus.FINISH); + else + loanSave.setLoanStatus(LoanStatus.PENDING); + loanSave.setAmountPaid(totalPayment); + loanSave.setRouteCtlg(customerCtrl.findPeopleById(customerId).getRouteCtlg()); + if(totalPayment.compareTo(BigDecimal.ZERO) == 0 && totalFee.compareTo(BigDecimal.ZERO) == 0) + loanSave.setLastReferenceNumber(0); + if(totalPayment.compareTo(BigDecimal.ZERO) > 0 && totalFee.compareTo(BigDecimal.ZERO) == 0) + loanSave.setLastReferenceNumber(1); + if(totalPayment.compareTo(BigDecimal.ZERO) == 0 && totalFee.compareTo(BigDecimal.ZERO) > 0) + loanSave.setLastReferenceNumber(1); + if(totalPayment.compareTo(BigDecimal.ZERO) > 0 && totalFee.compareTo(BigDecimal.ZERO) > 0) + loanSave.setLastReferenceNumber(2); + loanSave.setAmountToPay(loanTypeCtrl.getLoanTypeById(loanTypeId).getPaymentTotal().add(totalFee)); + loanSave.setCreatedBy(userId); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(createdOn); + calendar.set(Calendar.HOUR_OF_DAY, 12); + calendar.set(Calendar.MINUTE, 0); + calendar.set(Calendar.SECOND, 0); + calendar.set(Calendar.MILLISECOND, 0); + loanSave.setCreatedOn(new Date()); + loanSave.setLastUpdatedOn(new Date()); + + if(loanCtrl.saveLoan(loanSave)) + { + Loan temp = loanCtrl.getLoanById(loanSave.getId()); + String userName = ""; + for(User user : users){ + if (user.getId().equalsIgnoreCase(userId)) { + userName = user.getHumanResource().getFirstName() + " " + + user.getHumanResource().getLastName(); + break; + } + } + Calendar fechaAct = Calendar.getInstance(); + if (fechaAct.before(calendar)) { + Bitacora bitacora = new Bitacora(); + bitacora.setAction("PrĆ©stamo 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() + + ", con cantidad de $" + temp.getLoanType().getPayment() + " al dĆ­a " + temp.getCreatedOn()); + bitacora.setNameUser(getLoggedUser().getUser().getUserName()); + bitacora.setOffice(new Office(getLoggedUser().getOffice().getId())); + bitacoraCtrl.saveBitacora(bitacora); + } + + LoanByUser loanByUser = new LoanByUser(); + LoanByUserId idRelation = new LoanByUserId(); + + idRelation.setIdLoan(loanSave.getId()); + idRelation.setIdUser(userId); + + loanByUser.setId(idRelation); + loanByUser.setComments(comments); + loanByUser.setCreatedBy(getLoggedUser().getUser().getId()); + if(aprobado) + loanByUser.setLoanByUserStatus(LoanStatus.APPROVED); + else if(terminado) + loanByUser.setLoanByUserStatus(LoanStatus.FINISH); + else + loanByUser.setLoanByUserStatus(LoanStatus.PENDING); + loanByUser.setLoan(loanSave); + loanByUser.setOrderInList(0); + loanByUser.setOwnerLoan(OwnerLoan.CURRENT_OWNER); + loanByUser.setUser(new User(userId)); + loanCtrl.saveLoanByUser(loanByUser); + + int contador = 1; + if(totalPayment.compareTo(BigDecimal.ZERO) > 0) + { + LoanDetails detail = new LoanDetails(); + detail.setComments(comments); + detail.setCreatedBy(getLoggedUser().getUser().getId()); + detail.setCreatedOn(createdOn); + detail.setLoan(loanSave); + detail.setLoanDetailsType(LoanDetailsType.PAYMENT); + detail.setPaymentAmount(totalPayment); + detail.setPeopleType(PeopleType.CUSTOMER); + detail.setReferenceNumber(contador); + detail.setUser(new User(userId)); + if(loanCtrl.saveLoanDetail(detail)){ + contador++; + } + } + if(totalFee.compareTo(BigDecimal.ZERO) > 0) + { + LoanDetails detail = new LoanDetails(); + detail.setComments(comments); + detail.setCreatedBy(getLoggedUser().getUser().getId()); + detail.setCreatedOn(createdOn); + detail.setLoan(loanSave); + detail.setLoanDetailsType(LoanDetailsType.FEE); + detail.setPaymentAmount(totalFee); + detail.setPeopleType(PeopleType.CUSTOMER); + detail.setReferenceNumber(contador); + detail.setUser(new User(userId)); + if(loanCtrl.saveLoanDetail(detail)){ + contador++; + } + } + + } + loan.clear(); + createdOn = new Date(); + comments = ""; + customerId = ""; + endorsementId = ""; + loanTypeId = ""; + userId = ""; + total = BigDecimal.ZERO; + totalFee = BigDecimal.ZERO; + totalPayment = BigDecimal.ZERO; + aprobado = false; + terminado = false; + loan = fillDatatableLoan(); + FacesMessage msg = new FacesMessage("Nuevo prĆ©stamo", "Se agregĆ³ correctamente"); + FacesContext.getCurrentInstance().addMessage(null, msg); + } + + @Override + public void deleteRow() { + loanCtrl.updateLoanByStatus(LoanStatus.REJECTED, selectedLoan.getId(), getLoggedUser().getUser().getId()); + loanCtrl.updateLoanByUserByStatus(LoanStatus.REJECTED, selectedLoan); + + LoanByRenovation renovation; + renovation = loanCtrl.getLoanByRenovationByIdLoanNew(selectedLoan); + if(renovation != null) + { + loanCtrl.updateLoanByRenovationByStatus(LoanRenovationStatus.REJECTED, selectedLoan, getLoggedUser().getUser().getId()); + loanCtrl.updateLoanByStatus(LoanStatus.APPROVED, renovation.getLoanOld().getId(), getLoggedUser().getUser().getId()); + loanCtrl.updateLoanByUserByStatus(LoanStatus.APPROVED, renovation.getLoanOld()); + } + loan.remove(selectedLoan); + selectedLoan = null; + showMessage(FacesMessage.SEVERITY_INFO, "Cambio de estatus", "El prĆ©stamo se cambiĆ³ a estatus 'Rechazado' de forma correcta."); + } + + /** + * + * @param outcome + * @return + */ + public String detailLoan(String outcome) { + return outcome; + } + + public LoanController getLoanCtrl() { + return loanCtrl; + } + + public void setLoanCtrl(LoanController loanCtrl) { + this.loanCtrl = loanCtrl; + } + + public List getLoan() { + return loan; + } + + public void setLoan(List loan) { + this.loan = loan; + } + + public Loan getSelectedLoan() { + return selectedLoan; + } + + public void setSelectedLoan(Loan selectedLoan) { + this.selectedLoan = selectedLoan; + } + + public CustomerController getCustomerCtrl() { + return customerCtrl; + } + + public void setCustomerCtrl(CustomerController customerCtrl) { + this.customerCtrl = customerCtrl; + } + + public EndorsementController getEndorsementCtrl() { + return endorsementCtrl; + } + + public void setEndorsementCtrl(EndorsementController endorsementCtrl) { + this.endorsementCtrl = endorsementCtrl; + } + + public LoanTypeController getLoanTypeCtrl() { + return loanTypeCtrl; + } + + public void setLoanTypeCtrl(LoanTypeController loanTypeCtrl) { + this.loanTypeCtrl = loanTypeCtrl; + } + + public List getCustomer() { + return customer; + } + + public void setCustomer(List customer) { + this.customer = customer; + } + + public List getEndorsement() { + return endorsement; + } + + public void setEndorsement(List endorsement) { + this.endorsement = endorsement; + } + + public List getLoanType() { + return loanType; + } + + public void setLoanType(List loanType) { + this.loanType = loanType; + } + + public String getCustomerId() { + return customerId; + } + + public void setCustomerId(String customerId) { + this.customerId = customerId; + } + + public String getEndorsementId() { + return endorsementId; + } + + public void setEndorsementId(String endorsementId) { + this.endorsementId = endorsementId; + } + + public String getLoanTypeId() { + return loanTypeId; + } + + public void setLoanTypeId(String loanTypeId) { + this.loanTypeId = loanTypeId; + } + + public String getComments() { + return comments; + } + + public void setComments(String comments) { + this.comments = comments; + } + + public List getUsers() { + return users; + } + + public void setUsers(List users) { + this.users = users; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public GenericController getGenericCtrl() { + return genericCtrl; + } + + public void setGenericCtrl(GenericController genericCtrl) { + this.genericCtrl = genericCtrl; + } + + public Date getCreatedOn() { + return createdOn; + } + + public void setCreatedOn(Date createdOn) { + this.createdOn = createdOn; + } + + public BigDecimal getTotalPayment() { + return totalPayment; + } + + public void setTotalPayment(BigDecimal totalPayment) { + this.totalPayment = totalPayment; + } + + public BigDecimal getTotalFee() { + return totalFee; + } + + public void setTotalFee(BigDecimal totalFee) { + this.totalFee = totalFee; + } + + public BigDecimal getTotal() { + return total; + } + + public void setTotal(BigDecimal total) { + this.total = total; + } + + public boolean isAprobado() { + return aprobado; + } + + public void setAprobado(boolean aprobado) { + this.aprobado = aprobado; + } + + public boolean isTerminado() { + return terminado; + } + + public void setTerminado(boolean terminado) { + this.terminado = terminado; + } + + private LoanController loanCtrl; + private CustomerController customerCtrl; + private EndorsementController endorsementCtrl; + private LoanTypeController loanTypeCtrl; + private GenericController genericCtrl; + + private List loan; + private Loan selectedLoan; + private String comments; + + private List customer; + private List endorsement; + private List loanType; + private List users; + + private String customerId; + private String endorsementId; + private String loanTypeId; + private String userId; + + private Date createdOn; + private BigDecimal totalPayment; + private BigDecimal totalFee; + private BigDecimal total; + private boolean aprobado; + private boolean terminado; + + private BitacoraController bitacoraCtrl; + + @PostConstruct + public void init() { + loanCtrl = new LoanController(); + customerCtrl = new CustomerController(); + endorsementCtrl = new EndorsementController(); + loanTypeCtrl = new LoanTypeController(); + genericCtrl = new GenericController(); + totalPayment = BigDecimal.ZERO; + totalFee = BigDecimal.ZERO; + total = BigDecimal.ZERO; + aprobado = false; + terminado = false; + bitacoraCtrl = new BitacoraController(); + + customer = customerCtrl.fillCustomersDatatable(getLoggedUser().getOffice().getId()); + endorsement = endorsementCtrl.fillEndorsementsDatatable(getLoggedUser().getOffice().getId()); + loanType = loanTypeCtrl.fillLoanTypeDatatable(getLoggedUser().getOffice().getId()); + users = genericCtrl.getAllUsersByOffice(getLoggedUser().getOffice().getId()); + + loan = fillDatatableLoan(); + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/LoanPendingDetailBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/LoanPendingDetailBean.java new file mode 100644 index 0000000..ba9b59a --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/LoanPendingDetailBean.java @@ -0,0 +1,333 @@ +/* + * 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.web.beans.admin; + +import com.arrebol.apc.controller.GenericController; +import com.arrebol.apc.controller.admin.CustomerController; +import com.arrebol.apc.controller.admin.EndorsementController; +import com.arrebol.apc.controller.admin.LoanController; +import com.arrebol.apc.controller.catalog.LoanTypeController; +import com.arrebol.apc.model.catalog.People; +import com.arrebol.apc.model.enums.LoanRenovationStatus; +import com.arrebol.apc.model.enums.LoanStatus; +import com.arrebol.apc.model.loan.Loan; +import com.arrebol.apc.model.loan.LoanByRenovation; +import com.arrebol.apc.model.loan.LoanDetails; +import com.arrebol.apc.model.loan.LoanType; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Named("loanPendingDetailManager") +@ViewScoped +public class LoanPendingDetailBean extends GenericBean implements Serializable, Datatable { + + public void changeLoanType(){ + 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"); + } + + } + + public void changeDateAndApprovedLoan(){ + loan.setCreatedOn(createdOn); + loan.setComments(comments); + if(loanCtrl.updateLoan(loan)){ + approvedLoan(); + } + + } + + public List getDetails(String id) { + try { + loanDetails = loanCtrl.getLoanDetailsbyId(id); + + } catch (Exception e) { + } + return null == loanDetails ? new ArrayList<>() : loanDetails; + } + + public People getCustomerDetail(String peopleId){ + return customerCtrl.findPeopleById(peopleId); + } + + public List getLoanByCustomer(String peopleId){ + return customerCtrl.findLoanByCustomer(peopleId); + } + + public List getLoanByEndorsement(String peopleId){ + return endorsementCtrl.findLoanByEndorsement(peopleId); + } + + public void rejectedLoan() { + loanCtrl.updateLoanByStatus(LoanStatus.REJECTED, loan.getId(), getLoggedUser().getUser().getId()); + loanCtrl.updateLoanByUserByStatus(LoanStatus.REJECTED, loan); + + LoanByRenovation renovation; + renovation = loanCtrl.getLoanByRenovationByIdLoanNew(loan); + if(renovation != null) + { + loanCtrl.updateLoanByRenovationByStatus(LoanRenovationStatus.REJECTED, loan, getLoggedUser().getUser().getId()); + loanCtrl.updateLoanByStatus(LoanStatus.APPROVED, renovation.getLoanOld().getId(), getLoggedUser().getUser().getId()); + loanCtrl.updateLoanByUserByStatus(LoanStatus.APPROVED, renovation.getLoanOld()); + } + + showMessage(FacesMessage.SEVERITY_INFO, "Cambio de estatus", "El prĆ©stamo 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."); + } + + @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 onRowReorder(ReorderEvent event) { + 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. + } + + public CustomerController getCustomerCtrl() { + return customerCtrl; + } + + public void setCustomerCtrl(CustomerController customerCtrl) { + this.customerCtrl = customerCtrl; + } + + public People getCustomer() { + return customer; + } + + public void setCustomer(People customer) { + this.customer = customer; + } + + public List getLoanCustomer() { + return loanCustomer; + } + + public void setLoanCustomer(List loanCustomer) { + this.loanCustomer = loanCustomer; + } + + public String getCustomerId() { + return customerId; + } + + public void setCustomerId(String customerId) { + this.customerId = customerId; + } + + public LoanController getLoanCtrl() { + return loanCtrl; + } + + public void setLoanCtrl(LoanController loanCtrl) { + this.loanCtrl = loanCtrl; + } + + public String getLoanId() { + return loanId; + } + + public void setLoanId(String loanId) { + this.loanId = loanId; + } + + public Loan getLoan() { + return loan; + } + + public void setLoan(Loan loan) { + this.loan = loan; + } + + public EndorsementController getEndorsementCtrl() { + return endorsementCtrl; + } + + public void setEndorsementCtrl(EndorsementController endorsementCtrl) { + this.endorsementCtrl = endorsementCtrl; + } + + public People getEndorsement() { + return endorsement; + } + + public void setEndorsement(People endorsement) { + this.endorsement = endorsement; + } + + public String getEndorsementId() { + return endorsementId; + } + + public void setEndorsementId(String endorsementId) { + this.endorsementId = endorsementId; + } + + public List getLoanEndorsement() { + return loanEndorsement; + } + + public void setLoanEndorsement(List loanEndorsement) { + this.loanEndorsement = loanEndorsement; + } + + public Loan getSelectedLoanCustomer() { + return selectedLoanCustomer; + } + + public void setSelectedLoanCustomer(Loan selectedLoanCustomer) { + this.selectedLoanCustomer = selectedLoanCustomer; + } + + public List getLoanDetails() { + return loanDetails; + } + + public void setLoanDetails(List loanDetails) { + this.loanDetails = loanDetails; + } + + public String getTypeLoanId() { + return typeLoanId; + } + + public void setTypeLoanId(String typeLoanId) { + this.typeLoanId = typeLoanId; + } + + public LoanTypeController getLoanTypeCtrl() { + return loanTypeCtrl; + } + + public void setLoanTypeCtrl(LoanTypeController loanTypeCtrl) { + this.loanTypeCtrl = loanTypeCtrl; + } + + public List getLoanType() { + return loanType; + } + + public void setLoanType(List loanType) { + this.loanType = loanType; + } + + public Date getCreatedOn() { + return createdOn; + } + + public void setCreatedOn(Date createdOn) { + this.createdOn = createdOn; + } + + public String getComments() { + return comments; + } + + public void setComments(String comments) { + this.comments = comments; + } + + public List getCustomers() { + return customers; + } + + public void setCustomers(List customers) { + this.customers = customers; + } + + public String getCustomerTest() { + return customerTest; + } + + public void setCustomerTest(String customerTest) { + this.customerTest = customerTest; + } + + private CustomerController customerCtrl; + private LoanController loanCtrl; + private EndorsementController endorsementCtrl; + private LoanTypeController loanTypeCtrl; + + private People customer; + private Loan loan; + private People endorsement; + + private String customerId; + private String loanId; + private String endorsementId; + private String typeLoanId; + private String customerTest; + + private List loanEndorsement; + private List loanCustomer; + private Loan selectedLoanCustomer; + private List loanType; + private List customers; + + private List loanDetails; + + private Date createdOn; + private String comments; + + @PostConstruct + public void init() { + loadBundlePropertyFile(); + customerCtrl = new CustomerController(); + loanCtrl = new LoanController(); + endorsementCtrl = new EndorsementController(); + loanTypeCtrl = new LoanTypeController(); + + setLoanId(externalContext().getRequestParameterMap().get("form:dtLoanPending_selection")); + loan = loanCtrl.getLoanById(getLoanId()); + customer = loan.getCustomer(); + endorsement = loan.getEndorsement(); + loanEndorsement = getLoanByEndorsement(loan.getEndorsement().getId()); + loanCustomer = getLoanByCustomer(loan.getCustomer().getId()); + loanType = loanTypeCtrl.fillLoanTypeDatatable(getLoggedUser().getOffice().getId()); + customers = customerCtrl.fillCustomersDatatable(getLoggedUser().getOffice().getId()); + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/LoanRenovationDeliveryWeeklyBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/LoanRenovationDeliveryWeeklyBean.java new file mode 100644 index 0000000..312ea95 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/LoanRenovationDeliveryWeeklyBean.java @@ -0,0 +1,138 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.web.beans.admin; + +import com.arrebol.apc.controller.admin.LoanRenovationDeliveryWeeklyController; +import com.arrebol.apc.model.views.LoanRenovationDeliveryWeeklyView; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author Oscar + */ +@Named("loanRenovationWeeklyManager") +@ViewScoped +public class LoanRenovationDeliveryWeeklyBean extends GenericBean implements Serializable, Datatable { + + + public List fillDatatableLoan() { + return getLoanRenovationController().fillLoanRenovationDatatable(); + } + + public int getTotalRenovation() { + int quantity = 0; + for(LoanRenovationDeliveryWeeklyView p : loan) { + if(p.getRenovation().equals("Renovable")){ + quantity++; + } + + } + return quantity; + } + + + public Double getTotalRenovationAmount() { + Double quantity = 0.0; + for(LoanRenovationDeliveryWeeklyView p : loan) { + if(p.getRenovation().equals("Renovable")){ + quantity = quantity + Double.valueOf(p.getAmountLoan()); + } + + } + return quantity; + } + @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 onRowReorder(ReorderEvent event) { + 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. + } + + + private LoanRenovationDeliveryWeeklyController LoanRenovationController; + + private List loan; + + private int totalRenovable; + private Double totalRenovableAmount; + + public LoanRenovationDeliveryWeeklyController getLoanRenovationController() { + return LoanRenovationController; + } + + public void setLoanRenovationController(LoanRenovationDeliveryWeeklyController LoanRenovationController) { + this.LoanRenovationController = LoanRenovationController; + } + + public List getLoan() { + return loan; + } + + public void setLoan(List loan) { + this.loan = loan; + } + + public int getTotalRenovable() { + return totalRenovable; + } + + public void setTotalRenovable(int totalRenovable) { + this.totalRenovable = totalRenovable; + } + + public Double getTotalRenovableAmount() { + return totalRenovableAmount; + } + + public void setTotalRenovableAmount(Double totalRenovableAmount) { + this.totalRenovableAmount = totalRenovableAmount; + } + + + + + + + @PostConstruct + public void init() { + loadBundlePropertyFile(); + + LoanRenovationController = new LoanRenovationDeliveryWeeklyController(); + + setLoan(fillDatatableLoan()); + setTotalRenovable(getTotalRenovation()); + setTotalRenovableAmount(getTotalRenovationAmount()); + } + + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/MoneyDailyBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/MoneyDailyBean.java new file mode 100644 index 0000000..a0a3265 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/MoneyDailyBean.java @@ -0,0 +1,327 @@ +/* + * 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.web.beans.admin; + +import com.arrebol.apc.controller.BitacoraController; +import com.arrebol.apc.controller.GenericController; +import com.arrebol.apc.controller.GenericValidationController; +import com.arrebol.apc.controller.admin.MoneyDailyController; +import com.arrebol.apc.controller.admin.StableGeneralBoxController; +import com.arrebol.apc.model.admin.MoneyDaily; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.system.logs.Bitacora; +import com.arrebol.apc.model.views.MoneyDailyByUserCertifier; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.context.FacesContext; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Named("moneyDailyManager") +@ViewScoped +public class MoneyDailyBean 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 { + setMoneyDaily(getMoneyDailyCtrl().fillMoneyDailyDatatable(getLoggedUser().getOffice().getId(), getStarDate(), getEndDate(), getUserSelectedId())); + setTotalValue(); + } + } catch (Exception e) { + } + } + + public List fillDatatableMoneyDaily() { + + return getMoneyDailyCtrl().fillMoneyDailyDatatable(getLoggedUser().getOffice().getId(), getStarDate(), getEndDate(), getUserSelectedId()); + } + + public List getUsers() { + + return genericCtrl.getAllUsersByOffice(getLoggedUser().getOffice().getId()); + } + + public String getUserSelectedId() { + return userSelectedId; + } + + public void setUserSelectedId(String userSelectedId) { + this.userSelectedId = userSelectedId; + } + + public BigDecimal getTotal() { + return total; + } + + public void setTotal(BigDecimal total) { + this.total = total; + } + + @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 onRowReorder(ReorderEvent event) { + showMessage(FacesMessage.SEVERITY_INFO, "Registro Movido", "De columna: " + (event.getFromIndex() + 1) + " a columna: " + (event.getToIndex() + 1)); + } + + @Override + public void addRow() { + /*if(!genericCtrl.verifyStableGeneralBoxVsClosingDay(getLoggedUser().getOffice().getId())) + { + FacesMessage msg = new FacesMessage("DĆ­a laborable no cuadrado.", "Falta de realizar un cuadre de caja general en el Ćŗltimo dĆ­a laborable."); + FacesContext.getCurrentInstance().addMessage(null, msg); + return; + }*/ + Date date = new Date(); + if (genericCtrl.existStableGeneralBoxByCreatedOn(date)) { + showMessage(FacesMessage.SEVERITY_WARN, "DĆ­a cerrado", "No se pueden agregar mĆ”s inicios porque ya se existe un cuadre de caja general de hoy."); + return; + } + + if(stableGeneralBoxCtrl.getTotalBox().compareTo(new BigDecimal(amount))>=0){ + MoneyDaily money = new MoneyDaily(); + money.setMoneyDailyDate(new Date()); + money.setOffice(new Office(getLoggedUser().getOffice().getId())); + money.setAmount(new BigDecimal(amount)); + money.setUser(new User(userId)); + money.setCreatedOn(new Date()); + money.setCreatedBy(getLoggedUser().getId()); + moneyDailyCtrl.saveMoneyDaily(money); + moneyDaily.clear(); + moneyDaily = fillDatatableMoneyDaily(); + setTotalValue(); + totalCaja= stableGeneralBoxCtrl.getTotalBox(); + amount = ""; + userId = ""; + FacesMessage msg = new FacesMessage("Nueva entrega de dinero", "Se agregĆ³ correctamente"); + FacesContext.getCurrentInstance().addMessage(null, msg); + }else{ + showMessage(FacesMessage.SEVERITY_WARN, "Incicio incorrecto", "No se pueden agregar el inicio porque es mas grande que la cantidad en caja general."); + } + + } + + @Override + public void deleteRow() { + + if (genericCtrl.existStableSmallBoxByCreatedOn(selectedMoneyDaily.getCreatedOn())) { + showMessage(FacesMessage.SEVERITY_WARN, "Inicio", "No se puede borrar porque ya se realizo el cuadre de caja chica del dĆ­a."); + } else { + Bitacora bitacora = new Bitacora(); + MoneyDaily money = moneyDailyCtrl.getMoneyDailyById(selectedMoneyDaily.getId()); + bitacora.setAction("Eliminar inicio"); + 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 inicio del asesor " + money.getUser().getUserName() + " con monto $" + + money.getAmount() + " y fecha " + money.getCreatedOn()); + moneyDailyCtrl.deleteMoneyDaily(selectedMoneyDaily); + bitacoraCtrl.saveBitacora(bitacora); + commentsBitacora = ""; + selectedMoneyDaily = null; + moneyDaily.clear(); + moneyDaily = fillDatatableMoneyDaily(); + setTotalValue(); + FacesMessage msg = new FacesMessage("EliminaciĆ³n de inicio", "Se eliminĆ³ correctamente"); + FacesContext.getCurrentInstance().addMessage(null, msg); + } + + } + + public MoneyDailyController getMoneyDailyCtrl() { + return moneyDailyCtrl; + } + + public void setMoneyDailyCtrl(MoneyDailyController moneyDailyCtrl) { + this.moneyDailyCtrl = moneyDailyCtrl; + } + + public List getMoneyDaily() { + return moneyDaily; + } + + public void setMoneyDaily(List moneyDaily) { + this.moneyDaily = moneyDaily; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getAmount() { + return amount; + } + + public void setAmount(String amount) { + this.amount = amount; + } + + public MoneyDaily getSelectedMoneyDaily() { + return selectedMoneyDaily; + } + + public void setSelectedMoneyDaily(MoneyDaily selectedMoneyDaily) { + this.selectedMoneyDaily = selectedMoneyDaily; + } + + public GenericController getGenericCtrl() { + return genericCtrl; + } + + public void setGenericCtrl(GenericController genericCtrl) { + this.genericCtrl = genericCtrl; + } + + public List getMoneyDailyCertifier() { + return moneyDailyCertifier; + } + + public void setMoneyDailyCertifier(List moneyDailyCertifier) { + this.moneyDailyCertifier = moneyDailyCertifier; + } + + public MoneyDaily getSelectedMoneyDailyCertifier() { + return selectedMoneyDailyCertifier; + } + + public void setSelectedMoneyDailyCertifier(MoneyDaily selectedMoneyDailyCertifier) { + this.selectedMoneyDailyCertifier = selectedMoneyDailyCertifier; + } + + public BitacoraController getBitacoraCtrl() { + return bitacoraCtrl; + } + + public void setBitacoraCtrl(BitacoraController bitacoraCtrl) { + this.bitacoraCtrl = bitacoraCtrl; + } + + 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; + } + + public StableGeneralBoxController getStableGeneralBoxCtrl() { + return stableGeneralBoxCtrl; + } + + public void setStableGeneralBoxCtrl(StableGeneralBoxController stableGeneralBoxCtrl) { + this.stableGeneralBoxCtrl = stableGeneralBoxCtrl; + } + + public BigDecimal getTotalCaja() { + return totalCaja; + } + + public void setTotalCaja(BigDecimal totalCaja) { + this.totalCaja = totalCaja; + } + + + + private MoneyDailyController moneyDailyCtrl; + private GenericController genericCtrl; + private BitacoraController bitacoraCtrl; + private GenericValidationController genericValidateController; + private StableGeneralBoxController stableGeneralBoxCtrl; + private Date lastStableGeneralBox; + + private List moneyDaily; + private List moneyDailyCertifier; + private List users; + private String userSelectedId; + private BigDecimal total; + private BigDecimal totalCaja; + + private String userId; + private String amount; + private String commentsBitacora; + + private MoneyDaily selectedMoneyDaily; + private MoneyDaily selectedMoneyDailyCertifier; + + @PostConstruct + public void init() { + loadBundlePropertyFile(); + + stableGeneralBoxCtrl = new StableGeneralBoxController(); + + moneyDailyCtrl = new MoneyDailyController(); + genericCtrl = new GenericController(); + bitacoraCtrl = new BitacoraController(); + setGenericValidateController(new GenericValidationController()); + setLastStableGeneralBox(getGenericValidateController().lastStableGeneralBoxByDate(getLoggedUser().getUser())); + + initOneWeekBeforeToCurrdate(); + + totalCaja= stableGeneralBoxCtrl.getTotalBox(); + moneyDaily = fillDatatableMoneyDaily(); + setTotalValue(); + moneyDailyCertifier = moneyDailyCtrl.findAllAmountByUserCertifierView(getLoggedUser().getOffice().getId()); + users = getUsers(); + commentsBitacora = ""; + + } + + private void setTotalValue() { + if (moneyDaily != null && !moneyDaily.isEmpty()) { + setTotal(moneyDaily.stream().map(MoneyDaily::getAmount).reduce(BigDecimal::add).get()); + } else { + setTotal(BigDecimal.ZERO); + } + } +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/OtherExpenseBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/OtherExpenseBean.java new file mode 100644 index 0000000..f2c03c5 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/OtherExpenseBean.java @@ -0,0 +1,294 @@ +/* + * 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.web.beans.admin; + +import com.arrebol.apc.controller.BitacoraController; +import com.arrebol.apc.controller.GenericController; +import com.arrebol.apc.controller.GenericValidationController; +import com.arrebol.apc.controller.admin.OtherExpenseController; +import com.arrebol.apc.model.admin.ClosingDay; +import com.arrebol.apc.model.admin.OtherExpense; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.system.logs.Bitacora; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.context.FacesContext; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Named("otherExpenseManager") +@ViewScoped +public class OtherExpenseBean 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 { + setOtherExpense(getOtherExpenseCtrl().fillOtherExpenseDatatable(getLoggedUser().getOffice().getId(), getStarDate(), getEndDate(), getUserSelectedId())); + setTotalValue(); + } + } catch (Exception e) { + } + } + + public List fillDatatableOtherExpense() { + + return getOtherExpenseCtrl().fillOtherExpenseDatatable(getLoggedUser().getOffice().getId(), getStarDate(), getEndDate(), getUserSelectedId()); + } + + public List getUsers() { + + return genericCtrl.getAllUsersByOffice(getLoggedUser().getOffice().getId()); + } + + @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 onRowReorder(ReorderEvent event) { + showMessage(FacesMessage.SEVERITY_INFO, "Registro Movido", "De columna: " + (event.getFromIndex() + 1) + " a columna: " + (event.getToIndex() + 1)); + } + + @Override + public void addRow() { + Date date = new Date(); + if (genericCtrl.existStableSmallBoxByCreatedOn(date)) { + showMessage(FacesMessage.SEVERITY_WARN, "DĆ­a cerrado", "No se pueden agregar mĆ”s gastos porque ya se existe un cuadre de caja chica de hoy."); + return; + } + OtherExpense saveOtherExpense = new OtherExpense(); + saveOtherExpense.setDescription(comments); + saveOtherExpense.setCreatedBy(getLoggedUser().getUser().getId()); + saveOtherExpense.setCreatedOn(new Date()); + saveOtherExpense.setExpense(new BigDecimal(amount)); + saveOtherExpense.setUser(new User(userId)); + saveOtherExpense.setOffice(new Office(getLoggedUser().getOffice().getId())); + otherExpenseCtrl.saveOtherExpense(saveOtherExpense); + otherExpense.clear(); + otherExpense = fillDatatableOtherExpense(); + setTotalValue(); + comments = ""; + userId = ""; + amount = ""; + fecha = new Date(); + FacesMessage msg = new FacesMessage("Nuevo gasto", "Se agregĆ³ correctamente"); + FacesContext.getCurrentInstance().addMessage(null, msg); + } + + @Override + public void deleteRow() { + if (selectedOtherExpense != null) { + + otherExpenseCtrl.deleteOtherExpense(selectedOtherExpense); + Bitacora bitacora = new Bitacora(); + bitacora.setAction("Eliminar gasto"); + bitacora.setCommentsUser(getCommentsBitacora()); + 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Ć³ correctamente el gasto con fecha: " + selectedOtherExpense.getCreatedOn() + ", con monto $" + + selectedOtherExpense.getExpense()); + bitacoraCtrl.saveBitacora(bitacora); + selectedOtherExpense = null; + otherExpense.clear(); + otherExpense = fillDatatableOtherExpense(); + setTotalValue(); + commentsBitacora = ""; + + FacesMessage msg = new FacesMessage("EliminaciĆ³n de gasto", "Se eliminĆ³ correctamente"); + FacesContext.getCurrentInstance().addMessage(null, msg); + + } + } + + public OtherExpenseController getOtherExpenseCtrl() { + return otherExpenseCtrl; + } + + public void setOtherExpenseCtrl(OtherExpenseController otherExpenseCtrl) { + this.otherExpenseCtrl = otherExpenseCtrl; + } + + public List getOtherExpense() { + return otherExpense; + } + + public void setOtherExpense(List otherExpense) { + this.otherExpense = otherExpense; + } + + public OtherExpense getSelectedOtherExpense() { + return selectedOtherExpense; + } + + public void setSelectedOtherExpense(OtherExpense selectedOtherExpense) { + this.selectedOtherExpense = selectedOtherExpense; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getUserSelectedId() { + return userSelectedId; + } + + public void setUserSelectedId(String userSelectedId) { + this.userSelectedId = userSelectedId; + } + + public BigDecimal getTotal() { + return total; + } + + public void setTotal(BigDecimal total) { + this.total = total; + } + + public String getComments() { + return comments; + } + + public void setComments(String comments) { + this.comments = comments; + } + + public String getAmount() { + return amount; + } + + public void setAmount(String amount) { + this.amount = amount; + } + + public Date getFecha() { + return fecha; + } + + public void setFecha(Date fecha) { + this.fecha = fecha; + } + + public GenericController getGenericCtrl() { + return genericCtrl; + } + + public void setGenericCtrl(GenericController genericCtrl) { + this.genericCtrl = genericCtrl; + } + + public GenericValidationController getGenericValidateController() { + return genericValidateController; + } + + public void setGenericValidateController(GenericValidationController genericController) { + this.genericValidateController = genericController; + } + + public Date getLastStableSmallBox() { + return lastStableSmallBox; + } + + public void setLastStableSmallBox(Date lastStableSmallBox) { + this.lastStableSmallBox = lastStableSmallBox; + } + + public BitacoraController getBitacoraCtrl() { + return bitacoraCtrl; + } + + public void setBitacoraCtrl(BitacoraController bitacoraCtrl) { + this.bitacoraCtrl = bitacoraCtrl; + } + + public String getCommentsBitacora() { + return commentsBitacora; + } + + public void setCommentsBitacora(String commentsBitacora) { + this.commentsBitacora = commentsBitacora; + } + + public List getClosingDayToday() { + return closingDayToday; + } + + public void setClosingDayToday(List closingDayToday) { + this.closingDayToday = closingDayToday; + } + + private OtherExpenseController otherExpenseCtrl; + private GenericController genericCtrl; + private List otherExpense; + private OtherExpense selectedOtherExpense; + private List users; + private String userId; + private String userSelectedId; + private BigDecimal total; + private String comments; + private String amount; + private Date fecha; + + private BitacoraController bitacoraCtrl; + private String commentsBitacora; + private GenericValidationController genericValidateController; + private Date lastStableSmallBox; + private List closingDayToday; + + @PostConstruct + public void init() { + loadBundlePropertyFile(); + + otherExpenseCtrl = new OtherExpenseController(); + genericCtrl = new GenericController(); + bitacoraCtrl = new BitacoraController(); + setGenericValidateController(new GenericValidationController()); + setLastStableSmallBox(getGenericValidateController().lastStableSmallBoxByDate(getLoggedUser().getUser())); + setClosingDayToday(getGenericValidateController().allClosingDayByDate()); + + initOneWeekBeforeToCurrdate(); + + otherExpense = fillDatatableOtherExpense(); + setTotalValue(); + users = getUsers(); + } + + private void setTotalValue() { + if (otherExpense != null && !otherExpense.isEmpty()) { + setTotal(otherExpense.stream().map(OtherExpense::getExpense).reduce(BigDecimal::add).get()); + } else { + setTotal(BigDecimal.ZERO); + } + } +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/PayRollBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/PayRollBean.java new file mode 100644 index 0000000..7d19cbf --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/PayRollBean.java @@ -0,0 +1,953 @@ +/* + * 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.web.beans.admin; + +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.controller.admin.PayRollController; +import com.arrebol.apc.controller.drive.DriverController; +import com.arrebol.apc.model.admin.EmployeeSaving; +import com.arrebol.apc.model.admin.Goal; +import com.arrebol.apc.model.admin.LoanEmployee; +import com.arrebol.apc.model.admin.LoanEmployeeDetails; +import com.arrebol.apc.model.admin.StableGeneralBox; +import com.arrebol.apc.model.core.HumanResource; +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.enums.EmployeeSavingType; +import com.arrebol.apc.model.loan.Loan; +import com.arrebol.apc.model.payroll.Payroll; +import com.arrebol.apc.model.system.logs.Bitacora; +import com.arrebol.apc.model.views.InformationLoanLastWeekView; +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; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.math.RoundingMode; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.context.FacesContext; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Named("payrollManager") +@ViewScoped +public class PayRollBean 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 { + setPayroll(getPayrollCtrl().fillPayrollDatatable(getLoggedUser().getOffice().getId(), getStarDate(), getEndDate())); + } + } catch (Exception e) { + } + } + + public List getUsers() { + + return genericCtrl.getAllUsersByOffice(getLoggedUser().getOffice().getId()); + } + + public void calculationFunction() { + total = BigDecimal.ZERO; + BigDecimal moraDiscount = BonusMora.divide(new BigDecimal(5)).multiply(new BigDecimal(daysBonus)); + BigDecimal colocationDiscount = bonusColocation.divide(new BigDecimal(5)).multiply(new BigDecimal(daysBonus)); + BigDecimal salaryDiscount = salary.divide(new BigDecimal(5)).multiply(new BigDecimal(daysSalary)); + granTotalDeducciones = imss.add(advances).add(discounts).add(boxed).add(saving).add(paymentToDebt); + total = total.add(salaryDiscount).add(moraDiscount).add(colocationDiscount).add(newCustomer) + .subtract(imss).subtract(advances).subtract(discounts).subtract(boxed).subtract(saving).subtract(paymentToDebt).add(increases); + } + + public void getResumenByUser() { + + salary = BigDecimal.ZERO; + imss = BigDecimal.ZERO; + advances = BigDecimal.ZERO; + newCustomer = BigDecimal.ZERO; + bonusColocation = BigDecimal.ZERO; + BonusMora = BigDecimal.ZERO; + granTotal = BigDecimal.ZERO; + granTotalDeducciones = BigDecimal.ZERO; + total = BigDecimal.ZERO; + discounts = BigDecimal.ZERO; + increases = BigDecimal.ZERO; + metaInfo = BigDecimal.ZERO; + newCustomerInfo = BigDecimal.ZERO; + toalColocadoInfo = BigDecimal.ZERO; + toalPaymentInfo = BigDecimal.ZERO; + toalFeeInfo = BigDecimal.ZERO; + saldoInsoluto = BigDecimal.ZERO; + bonusNewCustomerInfo = BigDecimal.ZERO; + bonusColocationInfo = BigDecimal.ZERO; + bonusMoraInfo = BigDecimal.ZERO; + tipoBonusInfo = ""; + commentsDiscounts = ""; + commentsIncreases = ""; + commentsIncreases = ""; + boxed = BigDecimal.ZERO; + saving = BigDecimal.ZERO; + paymentToDebt = BigDecimal.ZERO; + BigDecimal divider; + + if (userId == null || userId.isEmpty()) { + showMessage(FacesMessage.SEVERITY_WARN, "Empleado obligatorio", "Debes seleccionar un empleado para calcular la nĆ³mina"); + userId = ""; + return; + } + + if (dateInit == null || dateEnd == null) { + showMessage(FacesMessage.SEVERITY_WARN, "Fechas obligatorias", "Debes seleccionar las fechas para calcular la nĆ³mina"); + userId = ""; + return; + } + + User userPayRoll = payrollCtrl.getUserById(userId); + if (userPayRoll != null) { + if (userPayRoll.getHumanResource().getBonus() == null) { + showMessage(FacesMessage.SEVERITY_WARN, "Usuario incompleto", "El empleado no tiene un bono registrado, es obligatorio tenerlo registrado"); + userId = ""; + return; + } + //obtengo salario del empleado + salary = userPayRoll.getHumanResource().getPayment(); + //obtengo imss del empleado + imss = userPayRoll.getHumanResource().getImss(); + //Lleno la informaciĆ³n de los bonos *** INFORMATIVO + bonusColocationInfo = userPayRoll.getHumanResource().getBonus().getLoanBonus(); + bonusMoraInfo = userPayRoll.getHumanResource().getBonus().getMoraBonus(); + bonusNewCustomerInfo = userPayRoll.getHumanResource().getBonus().getNewCustomerBonus(); + tipoBonusInfo = userPayRoll.getHumanResource().getBonus().getAdministrative() == ActiveStatus.ENEBLED ? "Administrativo" : "Operativo"; + //Obtengo todos los adelantos que tuvo el usuario en las fechas dadas y que esten activos. + Date fechaAdvance = new Date(); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(fechaAdvance); // Configuramos la fecha que se recibe + calendar.add(Calendar.DAY_OF_YEAR, -6); + + advances = payrollCtrl.getSumAdvanceByUser(userPayRoll.getHumanResource().getId(), getLoggedUser().getOffice().getId(), calendar.getTime(), fechaAdvance); + + if (saving.compareTo(BigDecimal.ZERO) == 0) { + saving = userPayRoll.getHumanResource().getEmployeeSaving(); + } + + if (advances == null) { + advances = BigDecimal.ZERO; + } + + //Valido que el bono del usuario no sea administrativo, ya que el bono de clientes nuevos solo se paga a asesores y certificadores, de + //lo contrario va en 0 + if (userPayRoll.getHumanResource().getBonus().getAdministrative() == ActiveStatus.DISABLED) { + //Obtengo cuantos prestamos con clientes nuevos dio de alta el asesor en esas fechas y lo multiplico por el valor del bono de clientes nuevos + List loansNew = payrollCtrl.getTotalNewCustomerLoansByUser(userId, dateInit, dateEnd); + int contador = 0; + for (Loan loan : loansNew) { + newCustomer = newCustomer.add((loan.getLoanType().getPayment().divide(new BigDecimal(1000))).multiply(userPayRoll.getHumanResource().getBonus().getNewCustomerBonus())); + contador++; + } + newCustomerInfo = newCustomerInfo.add(new BigDecimal(contador)); + } + + //Obtengo la meta que consta de esas fechas + //goal = payrollCtrl.getGoalByDates(getLoggedUser().getOffice().getId(), dateInit, dateEnd); + // La meta se obtiene de la Ćŗltima capturada + goal = payrollCtrl.getLastGoal(getLoggedUser().getOffice().getId()); + metaInfo = goal.getAmount(); + + // Se llena el control de abono a deuda + List loanEmployeeList = payrollCtrl.getPaymentToDebtByUser(userPayRoll.getHumanResource().getId()); + if (loanEmployeeList != null && !loanEmployeeList.isEmpty()) { + loanEmployeeList.forEach((loanEmployee) -> { + saldoInsoluto = saldoInsoluto.add(loanEmployee.getBalance()); + if(loanEmployee.getBalance().compareTo(loanEmployee.getAmountToPay()) < 0){ + if (loanEmployee.getBalance().compareTo(BigDecimal.ZERO) > 0) { + paymentToDebt = paymentToDebt.add(loanEmployee.getBalance()); + } + }else{ + paymentToDebt = paymentToDebt.add(loanEmployee.getAmountToPay()); + } + }); + } + + //********Bono de colocaciĆ³n********* + //Obtengo el total del monto colocado por usuario en esas fechas. + BigDecimal amountColocationByUser = payrollCtrl.getTotalLoansByUserForDates(userId, dateInit, dateEnd); + toalColocadoInfo = amountColocationByUser; + + //Valido que si halla obtenido una meta y que el bono del empleado no sea administrativo para calcular el bono por colocacion. + if (goal != null && amountColocationByUser != null && userPayRoll.getHumanResource().getBonus().getAdministrative() == ActiveStatus.DISABLED) { + BigDecimal maxPorcentaje = new BigDecimal(100); + BigDecimal minPorcentaje = new BigDecimal(80); + BigDecimal porcentaje = (amountColocationByUser.multiply(maxPorcentaje)).divide(goal.getAmount(), 2, RoundingMode.HALF_UP); + + if (porcentaje != null) { + if (porcentaje.compareTo(minPorcentaje) == -1) { + bonusColocation = BigDecimal.ZERO; + } + if (porcentaje.compareTo(minPorcentaje.subtract(BigDecimal.ONE)) == 1 && porcentaje.compareTo(maxPorcentaje) == -1) { + bonusColocation = ((goal.getAmount().multiply(userPayRoll.getHumanResource().getBonus().getLoanBonus())).divide(maxPorcentaje)).divide(new BigDecimal(2)); + } + if (porcentaje.compareTo(maxPorcentaje) == 0 || porcentaje.compareTo(maxPorcentaje) == 1) { + bonusColocation = (goal.getAmount().multiply(userPayRoll.getHumanResource().getBonus().getLoanBonus())).divide(maxPorcentaje); + } + } + + } + if (userPayRoll.getHumanResource().getBonus().getAdministrative() == ActiveStatus.ENEBLED) { + bonusColocation = userPayRoll.getHumanResource().getBonus().getLoanBonus(); + } + + //********Bono de mora********* + //Obtengo todos los abonos por usuario en ese rango de fechas + BigDecimal amountPayments = payrollCtrl.getLoanDetailsByUserForDates(userId, dateInit, dateEnd); + Long openingFee = payrollCtrl.getTotalOpeningFeeByUser(userId, dateInit, dateEnd); + + //Obtengo todas las multas por usuario en ese rango de fechas + //BigDecimal amountFee = payrollCtrl.getFeeByUserForDates(userId, dateInit, dateEnd); + //************************** + Double sumFaltante = data.stream().filter(p -> p.getIdUser().equalsIgnoreCase(userId)).mapToDouble(h -> h.getFaltante().doubleValue()).sum(); + BigDecimal amountFee = BigDecimal.valueOf(sumFaltante); + //************************** + + if (openingFee == null) { + openingFee = 0L; + } + if (amountPayments == null) { + amountPayments = BigDecimal.ZERO; + } + if (amountFee == null) { + amountFee = BigDecimal.ZERO; + } + amountPayments = amountPayments.add(BigDecimal.valueOf(openingFee)); + toalPaymentInfo = amountPayments; + toalFeeInfo = amountFee; + + if (userPayRoll.getHumanResource().getBonus().getAdministrative() == ActiveStatus.ENEBLED) { + BonusMora = userPayRoll.getHumanResource().getBonus().getMoraBonus(); + } else { + if (amountPayments.compareTo(BigDecimal.ZERO) == 1) { + BigDecimal totalPorcentaje = new BigDecimal(100); + BigDecimal maxPorcentaje = new BigDecimal(2); + BigDecimal middlePorcentaje = new BigDecimal(1); + if (amountFee.compareTo(BigDecimal.ZERO) == 0 || amountFee.compareTo(BigDecimal.ZERO) < 0) { + BonusMora = (amountPayments.multiply(userPayRoll.getHumanResource().getBonus().getMoraBonus())); + } else { + + if(payrollCtrl.getTotalExpectedWeekByUser(userId)==null){ + + divider = BigDecimal.ONE; + }else{ + divider = payrollCtrl.getTotalExpectedWeekByUser(userId); + } + + + BigDecimal porcentaje = (amountFee.multiply(totalPorcentaje)).divide(divider, 2, RoundingMode.HALF_UP); + if (porcentaje.compareTo(maxPorcentaje) == 0 || porcentaje.compareTo(maxPorcentaje) == 1) { + BonusMora = BigDecimal.ZERO; + } + if ((porcentaje.compareTo(BigDecimal.ZERO) == 0) || (porcentaje.compareTo(BigDecimal.ZERO) == 1 && porcentaje.compareTo(middlePorcentaje) == -1)) { + BonusMora = (amountPayments.multiply(userPayRoll.getHumanResource().getBonus().getMoraBonus())); + } + if ((porcentaje.compareTo(middlePorcentaje) == 0) || (porcentaje.compareTo(middlePorcentaje) == 1 && porcentaje.compareTo(maxPorcentaje) == -1)) { + BonusMora = (amountPayments.multiply(userPayRoll.getHumanResource().getBonus().getMoraBonus())).divide(maxPorcentaje); + } + } + + } + } + boxed = payrollCtrl.getDiscountByUserThisWeek(userId); + if (boxed == null || boxed.compareTo(BigDecimal.ZERO) < 0) { + boxed = BigDecimal.ZERO; + } + /* Se comenta debido a que el campo cajeado toma el valor + else { + commentsDiscounts = "Descuentos por cajeado en cortes del dĆ­a"; + }*/ + granTotal = salary.add(BonusMora).add(bonusColocation).add(newCustomer).subtract(advances); + granTotalDeducciones = imss.add(advances).add(discounts).add(boxed).add(saving).add(paymentToDebt); + total = granTotal.subtract(boxed).subtract(imss).subtract(saving).subtract(paymentToDebt); + } + } + + @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 onRowReorder(ReorderEvent event) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + public void addRow() { + if (userId == null || userId.isEmpty()) { + showMessage(FacesMessage.SEVERITY_WARN, "Empleado obligatorio", "Debes seleccionar un empleado para calcular la nĆ³mina"); + userId = ""; + return; + } + + if (dateInit == null || dateEnd == null) { + showMessage(FacesMessage.SEVERITY_WARN, "Fechas obligatorias", "Debes seleccionar las fechas para calcular la nĆ³mina"); + userId = ""; + return; + } + + + if (genericCtrl.existStableGeneralBoxByCreatedOn(new Date())) { + showMessage(FacesMessage.SEVERITY_WARN, "DĆ­a cerrado", "No se pueden crear mas nominas porque ya se existe un cuadre de caja general de hoy."); + return; + } + + + Payroll payroll = new Payroll(); + + User userPayRoll = payrollCtrl.getUserById(userId); + + payroll.setActiveStatus(ActiveStatus.ENEBLED); + payroll.setAdvance(advances); + payroll.setCommentsDiscounts(commentsDiscounts); + payroll.setCommentsIncreases(commentsIncreases); + payroll.setCreatedBy(getLoggedUser().getUser().getId()); + payroll.setCreatedOn(new Date()); + payroll.setDiscounts(discounts); + payroll.setHumanResource(userPayRoll.getHumanResource()); + payroll.setImss(imss); + payroll.setIncreases(increases); + payroll.setObservation(comments); + payroll.setOffice(new Office(getLoggedUser().getOffice().getId())); + payroll.setSalary(salary); + payroll.setTotalBonusColocation(bonusColocation); + payroll.setTotalBonusMora(BonusMora); + payroll.setTotalBonusNewCustomer(newCustomer); + payroll.setTotalDaysBonus(daysBonus); + payroll.setTotalDaysSalary(daysSalary); + payroll.setTotalPayment(total); + payroll.setBoxed(boxed); + payroll.setSaving(saving); + payroll.setPaymentToDebt(paymentToDebt); + + // ADD new Fields values + + if (payrollCtrl.savePayroll(payroll)) { + createPaymentLoanEmployee(userPayRoll.getHumanResource()); + // Guarda el registro en la tabla de ahorro + if (saving.compareTo(BigDecimal.ZERO) > 0) { + createEmployeeSaving(userPayRoll.getHumanResource()); + } + + FacesMessage msg = new FacesMessage("NĆ³mina creada.", "Se registrĆ³ la nĆ³mina correctamente."); + FacesContext.getCurrentInstance().addMessage(null, msg); + salary = BigDecimal.ZERO; + imss = BigDecimal.ZERO; + advances = BigDecimal.ZERO; + newCustomer = BigDecimal.ZERO; + bonusColocation = BigDecimal.ZERO; + BonusMora = BigDecimal.ZERO; + granTotal = BigDecimal.ZERO; + granTotalDeducciones = BigDecimal.ZERO; + total = BigDecimal.ZERO; + discounts = BigDecimal.ZERO; + increases = BigDecimal.ZERO; + metaInfo = BigDecimal.ZERO; + newCustomerInfo = BigDecimal.ZERO; + toalColocadoInfo = BigDecimal.ZERO; + toalPaymentInfo = BigDecimal.ZERO; + toalFeeInfo = BigDecimal.ZERO; + saldoInsoluto = BigDecimal.ZERO; + bonusNewCustomerInfo = BigDecimal.ZERO; + bonusColocationInfo = BigDecimal.ZERO; + bonusMoraInfo = BigDecimal.ZERO; + tipoBonusInfo = ""; + commentsDiscounts = ""; + commentsIncreases = ""; + comments = ""; + userId = ""; + boxed = BigDecimal.ZERO; + saving = BigDecimal.ZERO; + paymentToDebt = BigDecimal.ZERO; + } + + } + + private void createPaymentLoanEmployee(HumanResource humanResource) { + List loanEmployeeList = payrollCtrl.getPaymentToDebtByUser(humanResource.getId()); + BigDecimal paymentToDebtResp = paymentToDebt; + if (loanEmployeeList != null && !loanEmployeeList.isEmpty()) { + for (LoanEmployeeView loan : loanEmployeeList) { + BigDecimal detailPay = loan.getAmountToPay(); + if (paymentToDebtResp.compareTo(BigDecimal.ZERO) == 1) { + LoanEmployeeDetails loanDetail = new LoanEmployeeDetails(); + loanDetail.setIdLoan(loan.getId()); + loanDetail.setIdUser(loan.getIdUser()); + loanDetail.setPaymentAmount(detailPay); + loanDetail.setReferenceNumber(loan.getReferenceNumber() + 1); + loanDetail.setCreatedOn(new Date()); + loanDetail.setCreatedBy(getLoggedUser().getId()); + loanDetail.setLoanEmployeeDetailStatus(ActiveStatus.ENEBLED); + loanDetail.setPayroll(ActiveStatus.ENEBLED); + + humanResource.setBalance(humanResource.getBalance().subtract(detailPay)); + LoanEmployee loanE = payrollCtrl.getLoanEmployeeById(loan.getId()); + if(loanE.getBalance().compareTo(detailPay) < 0 || detailPay.compareTo(loanE.getBalance()) == 0){ + paymentToDebtResp.subtract(loanE.getBalance()); + loanDetail.setPaymentAmount(loanE.getBalance()); + loanE.setBalance(BigDecimal.ZERO); + }else{ + loanE.setBalance(loanE.getBalance().subtract(detailPay)); + paymentToDebtResp.subtract(detailPay); + } + + + payrollCtrl.saveLoanEmployeeDetail(loanDetail, humanResource, loanE); + } + } + } + } + + private void createEmployeeSaving(HumanResource humanResource) { + EmployeeSaving employeeSaving = new EmployeeSaving(); + employeeSaving.setIdUser(humanResource.getId()); + employeeSaving.setEmployeeSaving(saving); + employeeSaving.setCreatedOn(new Date()); + employeeSaving.setCreatedBy(getLoggedUser().getId()); + employeeSaving.setType(EmployeeSavingType.SAVING); + humanResource.setEmployeeSaving(saving); + payrollCtrl.saveEmployeeSaving(employeeSaving, humanResource); + } + + private void cancelEmployeeSaving(Payroll payroll) { + EmployeeSaving employeeSaving = new EmployeeSaving(); + employeeSaving.setIdUser(payroll.getHumanResource().getId()); + employeeSaving.setEmployeeSaving(payroll.getSaving()); + employeeSaving.setCreatedOn(new Date()); + employeeSaving.setCreatedBy(getLoggedUser().getId()); + employeeSaving.setType(EmployeeSavingType.CANCEL); + payrollCtrl.saveEmployeeSaving(employeeSaving, payroll.getHumanResource()); + } + + @Override + public void deleteRow() { + boolean delete = true; + delete = selectedPayroll.getActiveStatus() == ActiveStatus.ENEBLED ? true : false; + + + + if (delete) { + + List listGeneralBox = payrollCtrl.getStableGeneralBoxByDate(getLoggedUser().getOffice().getId(), + selectedPayroll.getCreatedOn(), selectedPayroll.getCreatedOn()); + if (listGeneralBox == null || listGeneralBox.isEmpty()) { + payrollCtrl.updatePayrollByStatus(ActiveStatus.DISABLED, selectedPayroll.getId(), getLoggedUser().getUser().getId()); + + List loanEmployeeList = loanEmployeeController.findLoanDetailToUpdate(selectedPayroll.getHumanResource().getId(),selectedPayroll.getCreatedOn()); + + for(LoanEmployeeDetails loanDetail: loanEmployeeList){ + + LoanEmployee loan = payrollCtrl.getLoanEmployeeById(loanDetail.getIdLoan()); + + loan.setBalance(loan.getBalance().add(loanDetail.getPaymentAmount())); + loan.setLastUpdatedBy(getLoggedUser().getId()); + loan.setLastUpdatedOn(new Date()); + + + loanEmployeeController.updateLoanEmployee(loan); + + } + + loanEmployeeController.updateLoanEmployeeDetailByStatus(selectedPayroll.getHumanResource().getId(),selectedPayroll.getCreatedOn()); + cancelEmployeeSaving(selectedPayroll); + searchHistoricalAction(); + + Bitacora bitacora = new Bitacora(); + bitacora.setAction("Eliminar nĆ³mina"); + bitacora.setCommentsUser(getComments()); + 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Ć³ correctamente la nĆ³mina con fecha: " + selectedPayroll.getCreatedOn() + ", con monto $" + + selectedPayroll.getTotalPayment()); + bitacoraCtrl.saveBitacora(bitacora); + comments = ""; + selectedPayroll = null; + showMessage(FacesMessage.SEVERITY_INFO, "NĆ³mina eliminada", "Se eliminĆ³ correctamente."); + } + else{ + showMessage(FacesMessage.SEVERITY_ERROR, "Error", "La nĆ³mina no se pudo eliminar porque existe un corte de caja general con esa fecha."); + } + } + } + + public GenericController getGenericCtrl() { + return genericCtrl; + } + + public void setGenericCtrl(GenericController genericCtrl) { + this.genericCtrl = genericCtrl; + } + + public List getUser() { + return user; + } + + public void setUser(List user) { + this.user = user; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public Date getDateInit() { + return dateInit; + } + + public void setDateInit(Date dateInit) { + this.dateInit = dateInit; + } + + public Date getDateEnd() { + return dateEnd; + } + + public void setDateEnd(Date dateEnd) { + this.dateEnd = dateEnd; + } + + public PayRollController getPayrollCtrl() { + return payrollCtrl; + } + + public void setPayrollCtrl(PayRollController payrollCtrl) { + this.payrollCtrl = payrollCtrl; + } + + public BigDecimal getSalary() { + return salary; + } + + public void setSalary(BigDecimal salary) { + this.salary = salary; + } + + public BigDecimal getImss() { + return imss; + } + + public void setImss(BigDecimal imss) { + this.imss = imss; + } + + public BigDecimal getAdvances() { + return advances; + } + + public void setAdvances(BigDecimal advances) { + this.advances = advances; + } + + public BigDecimal getNewCustomer() { + return newCustomer; + } + + public void setNewCustomer(BigDecimal newCustomer) { + this.newCustomer = newCustomer; + } + + public BigDecimal getBonusColocation() { + return bonusColocation; + } + + public void setBonusColocation(BigDecimal bonusColocation) { + this.bonusColocation = bonusColocation; + } + + public BigDecimal getBonusMora() { + return BonusMora; + } + + public void setBonusMora(BigDecimal BonusMora) { + this.BonusMora = BonusMora; + } + + public Goal getGoal() { + return goal; + } + + public void setGoal(Goal goal) { + this.goal = goal; + } + + public String getComments() { + return comments; + } + + public void setComments(String comments) { + this.comments = comments; + } + + public BigDecimal getGranTotal() { + return granTotal; + } + + public void setGranTotal(BigDecimal granTotal) { + this.granTotal = granTotal; + } + + public BigDecimal getGranTotalDeducciones() { + return granTotalDeducciones; + } + + public void setGranTotalDeducciones(BigDecimal granTotalDeducciones) { + this.granTotalDeducciones = granTotalDeducciones; + } + + public BigDecimal getDiscounts() { + return discounts; + } + + public void setDiscounts(BigDecimal discounts) { + this.discounts = discounts; + } + + public String getCommentsDiscounts() { + return commentsDiscounts; + } + + public void setCommentsDiscounts(String commentsDiscounts) { + this.commentsDiscounts = commentsDiscounts; + } + + public BigDecimal getIncreases() { + return increases; + } + + public void setIncreases(BigDecimal increases) { + this.increases = increases; + } + + public String getCommentsIncreases() { + return commentsIncreases; + } + + public void setCommentsIncreases(String commentsIncreases) { + this.commentsIncreases = commentsIncreases; + } + + public BigDecimal getTotal() { + return total; + } + + public void setTotal(BigDecimal total) { + this.total = total; + } + + public BigDecimal getMetaInfo() { + return metaInfo; + } + + public void setMetaInfo(BigDecimal metaInfo) { + this.metaInfo = metaInfo; + } + + public BigDecimal getNewCustomerInfo() { + return newCustomerInfo; + } + + public void setNewCustomerInfo(BigDecimal newCustomerInfo) { + this.newCustomerInfo = newCustomerInfo; + } + + public BigDecimal getToalColocadoInfo() { + return toalColocadoInfo; + } + + public void setToalColocadoInfo(BigDecimal toalColocadoInfo) { + this.toalColocadoInfo = toalColocadoInfo; + } + + public BigDecimal getToalPaymentInfo() { + return toalPaymentInfo; + } + + public void setToalPaymentInfo(BigDecimal toalPaymentInfo) { + this.toalPaymentInfo = toalPaymentInfo; + } + + public BigDecimal getToalFeeInfo() { + return toalFeeInfo; + } + + public void setToalFeeInfo(BigDecimal toalFeeInfo) { + this.toalFeeInfo = toalFeeInfo; + } + public BigDecimal getSaldoInsoluto() { + return saldoInsoluto; + } + + public void setSaldoInsoluto(BigDecimal saldoInsoluto) { + this.saldoInsoluto = saldoInsoluto; + } + + public BigDecimal getBonusNewCustomerInfo() { + return bonusNewCustomerInfo; + } + + public void setBonusNewCustomerInfo(BigDecimal bonusNewCustomerInfo) { + this.bonusNewCustomerInfo = bonusNewCustomerInfo; + } + + public BigDecimal getBonusColocationInfo() { + return bonusColocationInfo; + } + + public void setBonusColocationInfo(BigDecimal bonusColocationInfo) { + this.bonusColocationInfo = bonusColocationInfo; + } + + public BigDecimal getBonusMoraInfo() { + return bonusMoraInfo; + } + + public void setBonusMoraInfo(BigDecimal bonusMoraInfo) { + this.bonusMoraInfo = bonusMoraInfo; + } + + public String getTipoBonusInfo() { + return tipoBonusInfo; + } + + public void setTipoBonusInfo(String tipoBonusInfo) { + this.tipoBonusInfo = tipoBonusInfo; + } + + public Integer getDaysSalary() { + return daysSalary; + } + + public void setDaysSalary(Integer daysSalary) { + this.daysSalary = daysSalary; + } + + public Integer getDaysBonus() { + return daysBonus; + } + + public void setDaysBonus(Integer daysBonus) { + this.daysBonus = daysBonus; + } + + public List getPayroll() { + return payroll; + } + + public void setPayroll(List payroll) { + this.payroll = payroll; + } + + public Payroll getSelectedPayroll() { + return selectedPayroll; + } + + public void setSelectedPayroll(Payroll selectedPayroll) { + this.selectedPayroll = selectedPayroll; + } + + public DriverController getDriverCtrl() { + return driverCtrl; + } + + public void setDriverCtrl(DriverController driverCtrl) { + this.driverCtrl = driverCtrl; + } + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public BigDecimal getBoxed() { + return boxed; + } + + public void setBoxed(BigDecimal boxed) { + this.boxed = boxed; + } + + public BigDecimal getSaving() { + return saving; + } + + public void setSaving(BigDecimal saving) { + this.saving = saving; + } + + public BigDecimal getPaymentToDebt() { + return paymentToDebt; + } + + public void setPaymentToDebt(BigDecimal paymentToDebt) { + this.paymentToDebt = paymentToDebt; + } + + 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; + } + + private GenericController genericCtrl; + private PayRollController payrollCtrl; + private BitacoraController bitacoraCtrl; + private GenericValidationController genericValidateController; + private LoanEmployeeController loanEmployeeController; + + private Date lastStableGeneralBox; + private List user; + private List payroll; + private Payroll selectedPayroll; + + private String userId; + private Date dateInit; + private Date dateEnd; + private String comments; + + private BigDecimal salary; + private BigDecimal imss; + private BigDecimal advances; + private BigDecimal newCustomer; + private BigDecimal bonusColocation; + private BigDecimal BonusMora; + private Goal goal; + private BigDecimal granTotal; + private BigDecimal granTotalDeducciones; + private BigDecimal discounts; + private String commentsDiscounts; + private BigDecimal increases; + private String commentsIncreases; + private BigDecimal total; + + private BigDecimal metaInfo; + private BigDecimal newCustomerInfo; + private BigDecimal toalColocadoInfo; + private BigDecimal toalPaymentInfo; + private BigDecimal toalFeeInfo; + private BigDecimal saldoInsoluto; + + private BigDecimal bonusNewCustomerInfo; + private BigDecimal bonusColocationInfo; + private BigDecimal bonusMoraInfo; + private String tipoBonusInfo; + private Integer daysSalary; + private Integer daysBonus; + private DriverController driverCtrl; + private List data; + + private BigDecimal boxed; + private BigDecimal saving; + private BigDecimal paymentToDebt; + + @PostConstruct + public void init() { + loadBundlePropertyFile(); + initOneWeekBeforeToCurrdate(); + + genericCtrl = new GenericController(); + payrollCtrl = new PayRollController(); + driverCtrl = new DriverController(); + bitacoraCtrl = new BitacoraController(); + loanEmployeeController = new LoanEmployeeController(); + data = driverCtrl.getAllLoanLastWeekByOffice(getLoggedUser().getOffice().getId()); + payroll = payrollCtrl.fillPayrollDatatable(getLoggedUser().getOffice().getId(), getStarDate(), getEndDate()); + setGenericValidateController(new GenericValidationController()); + setLastStableGeneralBox(getGenericValidateController().lastStableGeneralBoxByDate(getLoggedUser().getUser())); + user = getUsers(); + salary = BigDecimal.ZERO; + imss = BigDecimal.ZERO; + advances = BigDecimal.ZERO; + newCustomer = BigDecimal.ZERO; + bonusColocation = BigDecimal.ZERO; + BonusMora = BigDecimal.ZERO; + granTotal = BigDecimal.ZERO; + granTotalDeducciones = BigDecimal.ZERO; + total = BigDecimal.ZERO; + discounts = BigDecimal.ZERO; + increases = BigDecimal.ZERO; + metaInfo = BigDecimal.ZERO; + newCustomerInfo = BigDecimal.ZERO; + toalColocadoInfo = BigDecimal.ZERO; + toalPaymentInfo = BigDecimal.ZERO; + toalFeeInfo = BigDecimal.ZERO; + saldoInsoluto = BigDecimal.ZERO; + bonusNewCustomerInfo = BigDecimal.ZERO; + bonusColocationInfo = BigDecimal.ZERO; + bonusMoraInfo = BigDecimal.ZERO; + tipoBonusInfo = ""; + commentsDiscounts = ""; + commentsIncreases = ""; + daysBonus = 5; + daysSalary = 5; + + boxed = BigDecimal.ZERO; + saving = BigDecimal.ZERO; + paymentToDebt = BigDecimal.ZERO; + + Calendar c = Calendar.getInstance(); + if(c.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY){ + c.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY); + dateInit = new Date(c.getTimeInMillis()); + c.set(Calendar.DAY_OF_WEEK, Calendar.SATURDAY); + dateEnd = new Date(c.getTimeInMillis()); + } + else{ + c.add(Calendar.DAY_OF_WEEK, -7); + c.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY); + dateInit = new Date(c.getTimeInMillis()); + c.set(Calendar.DAY_OF_WEEK, Calendar.SATURDAY); + dateEnd = new Date(c.getTimeInMillis()); + } + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/PeopleBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/PeopleBean.java new file mode 100644 index 0000000..6d6e1b3 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/PeopleBean.java @@ -0,0 +1,162 @@ +/* + * 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.web.beans.admin; + +import com.arrebol.apc.controller.admin.PeopleController; +import com.arrebol.apc.controller.catalog.RouteController; +import com.arrebol.apc.model.catalog.People; +import com.arrebol.apc.model.catalog.RouteCtlg; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.enums.PeopleType; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.util.Date; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Named("peopleManager") +@ViewScoped +public class PeopleBean extends GenericBean implements Serializable{ + + public void addPeople() { + try + { + logger.debug("addPeople"); + getSavePeople().setCreatedBy(getLoggedUser().getUser().getId()); + getSavePeople().setCreatedOn(new Date()); + getSavePeople().setOffice(new Office(getLoggedUser().getOffice().getId())); + getSavePeople().setActiveStatus(ActiveStatus.ENEBLED); + getSavePeople().setRouteCtlg(new RouteCtlg(routeId)); + getSavePeople().setThumbnail(""); + + if(isCustomer == true && isEndorsement == false) + getSavePeople().setPeopleType(PeopleType.CUSTOMER); + if(isCustomer == true && isEndorsement == true) + getSavePeople().setPeopleType(PeopleType.BOTH); + if(isCustomer == false && isEndorsement == true) + getSavePeople().setPeopleType(PeopleType.ENDORSEMENT); + if(isCustomer == false && isEndorsement == false) + getSavePeople().setPeopleType(PeopleType.BOTH); + + + String messafeFormat = getBundlePropertyFile().getString("message.format.failure"); + FacesMessage.Severity severity = FacesMessage.SEVERITY_WARN; + + if(getPeopleCtrl().savePeople(getSavePeople())){ + setSavePeople(new People()); + isCustomer = false; + isEndorsement = false; + messafeFormat = getBundlePropertyFile().getString("message.format.sucess"); + severity = FacesMessage.SEVERITY_INFO; + } + + Object[] param = {getBundlePropertyFile().getString("people"), getBundlePropertyFile().getString("created")}; + + buildAndSendMessage(param, messafeFormat, severity, getBundlePropertyFile().getString("people")); + + }catch(Exception e) + { + logger.error("savePeople", e); + Object[] param = {getBundlePropertyFile().getString("created")}; + + buildAndSendMessage( + param, + getBundlePropertyFile().getString("message.format.fatal"), + FacesMessage.SEVERITY_FATAL, + getBundlePropertyFile().getString("people") + ); + } + } + + public PeopleController getPeopleCtrl() { + return peopleCtrl; + } + + public void setPeopleCtrl(PeopleController peopleCtrl) { + this.peopleCtrl = peopleCtrl; + } + + public boolean isIsCustomer() { + return isCustomer; + } + + public void setIsCustomer(boolean isCustomer) { + this.isCustomer = isCustomer; + } + + public boolean isIsEndorsement() { + return isEndorsement; + } + + public void setIsEndorsement(boolean isEndorsement) { + this.isEndorsement = isEndorsement; + } + + public People getSavePeople() { + return savePeople; + } + + public void setSavePeople(People savePeople) { + this.savePeople = savePeople; + } + + public String getRouteId() { + return routeId; + } + + public void setRouteId(String routeId) { + this.routeId = routeId; + } + + public List getRoutes() { + return routes; + } + + public void setRoutes(List routes) { + this.routes = routes; + } + + public RouteController getRouteCtrl() { + return routeCtrl; + } + + public void setRouteCtrl(RouteController routeCtrl) { + this.routeCtrl = routeCtrl; + } + + final Logger logger = LogManager.getLogger(PeopleBean.class); + + private PeopleController peopleCtrl; + private RouteController routeCtrl; + boolean isCustomer; + boolean isEndorsement; + private People savePeople; + String routeId; + List routes; + + @PostConstruct + public void init() { + loadBundlePropertyFile(); + peopleCtrl = new PeopleController(); + routeCtrl = new RouteController(); + setSavePeople(new People()); + isCustomer = false; + isEndorsement = false; + routes = routeCtrl.fillRoutesDatatable(getLoggedUser().getOffice().getId()); + } +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StableGeneralBoxBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StableGeneralBoxBean.java new file mode 100644 index 0000000..b34e3cd --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StableGeneralBoxBean.java @@ -0,0 +1,1247 @@ +/* + * 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.web.beans.admin; + +import com.amazonaws.AmazonServiceException; +import com.amazonaws.auth.AWSStaticCredentialsProvider; +import com.amazonaws.auth.BasicAWSCredentials; +import com.amazonaws.services.simpleemail.AmazonSimpleEmailService; +import com.amazonaws.services.simpleemail.AmazonSimpleEmailServiceClientBuilder; +import com.amazonaws.services.simpleemail.model.Body; +import com.amazonaws.services.simpleemail.model.Content; +import com.amazonaws.services.simpleemail.model.Destination; +import com.amazonaws.services.simpleemail.model.Message; +import com.amazonaws.services.simpleemail.model.SendEmailRequest; +import com.amazonaws.services.simpleemail.model.SendEmailResult; +import com.arrebol.apc.controller.BitacoraController; +import com.arrebol.apc.controller.GenericController; +import com.arrebol.apc.controller.GenericValidationController; +import com.arrebol.apc.controller.admin.StableGeneralBoxController; +import com.arrebol.apc.model.admin.Advance; +import com.arrebol.apc.model.admin.ClosingDay; +import com.arrebol.apc.model.admin.ExpenseCompany; +import com.arrebol.apc.model.admin.MoneyDaily; +import com.arrebol.apc.model.admin.StableGeneralBox; +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.enums.ExpenseCompanyType; +import com.arrebol.apc.model.loan.LoanDetails; +import com.arrebol.apc.model.payroll.Payroll; +import com.arrebol.apc.model.system.logs.Bitacora; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import com.arrebol.apc.web.beans.SendMSN; +import com.itextpdf.text.BaseColor; +import com.itextpdf.text.Chunk; +import com.itextpdf.text.Document; +import com.itextpdf.text.Element; +import com.itextpdf.text.FontFactory; +import com.itextpdf.text.Image; +import com.itextpdf.text.PageSize; +import com.itextpdf.text.Paragraph; +import com.itextpdf.text.pdf.PdfPCell; +import com.itextpdf.text.pdf.PdfPTable; +import com.itextpdf.text.pdf.PdfWriter; +import java.awt.Font; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.Serializable; +import java.math.BigDecimal; +import java.text.DateFormat; +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.context.FacesContext; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import javax.servlet.ServletContext; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import static org.hibernate.annotations.common.util.impl.LoggerFactory.logger; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Named("stableGeneralBoxManager") +@ViewScoped +public class StableGeneralBoxBean 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 { + setStableGeneralBox(fillDatatableStableGeneralBox()); + } + } catch (Exception e) { + } + } + + public List fillDatatableStableGeneralBox() { + + return getStableGeneralBoxCtrl().fillStableGeneralBoxDatatable(getLoggedUser().getOffice().getId(), getStarDate(), getEndDate()); + } + + public void calculationFunction() { + total = sobres.add(efectivo).add(monedas); + total = total.subtract(totalBox); + } + + @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 onRowReorder(ReorderEvent event) { + showMessage(FacesMessage.SEVERITY_INFO, "Registro Movido", "De columna: " + (event.getFromIndex() + 1) + " a columna: " + (event.getToIndex() + 1)); + } + + @Override + public void addRow() { + if (createdOn == null) { + FacesMessage msg = new FacesMessage("Datos incorrectos", "La fecha es obligatoria"); + FacesContext.getCurrentInstance().addMessage(null, msg); + return; + } + // BigDecimal totalBoxTemp = genericCtrl.findAllGeneralBox(getLoggedUser().getOffice().getId()); + BigDecimal totalBoxTemp = stableGeneralBoxCtrl.getTotalBox(); + + if (totalBox.compareTo(totalBoxTemp) != 0) { + FacesMessage msg = new FacesMessage("Advertencia", "Otros usuarios han movido la informaciĆ³n de caja general, por lo cual cambio el monto. Favor de refrescar la pĆ”gina."); + FacesContext.getCurrentInstance().addMessage(null, msg); + return; + } + Calendar calendar = Calendar.getInstance(); + calendar.setTime(createdOn); + calendar.set(Calendar.HOUR_OF_DAY, 12); + calendar.set(Calendar.MINUTE, 0); + calendar.set(Calendar.SECOND, 0); + calendar.set(Calendar.MILLISECOND, 0); + + if (stableGeneralBoxCtrl.getCountStableGeneralBoxByOfficeAndDate(calendar.getTime(), getLoggedUser().getOffice().getId()) > 0) { + FacesMessage msg = new FacesMessage("Cuadre de caja encontrado.", "Ya se encuentra registrado un cuadre de caja general para ese dĆ­a."); + FacesContext.getCurrentInstance().addMessage(null, msg); + return; + } + + if (stableGeneralBoxCtrl.getPendingByClosingDay(getLoggedUser().getOffice().getId()).compareTo(BigDecimal.ZERO) > 0) { + FacesMessage msg = new FacesMessage("ATENCION - CORTES FALTANTES.", "Falta hacer cortes del dia."); + FacesContext.getCurrentInstance().addMessage(null, msg); + return; + } + + StableGeneralBox box = new StableGeneralBox(); + box.setActiveStatus(ActiveStatus.ENEBLED); + box.setDescription(description); + box.setOffice(new Office(getLoggedUser().getOffice().getId())); + box.setTotalGeneralBox(totalBox); + box.setTotalBankNote(efectivo); + box.setTotalEnvelope(sobres); + box.setTotalCoin(monedas); + BigDecimal temp = sobres.add(efectivo).add(monedas); + box.setTotalStable(temp.subtract(totalBox)); + + box.setCreatedOn(new Date()); + box.setCreatedBy(getLoggedUser().getUser().getId()); + stableGeneralBoxCtrl.saveStableGeneralBox(box); + + + if (total.compareTo(BigDecimal.ZERO) > 0) { + Calendar calendarDate = calendar; + calendarDate.add(Calendar.DAY_OF_YEAR, 1); + Date date = calendarDate.getTime(); + + ExpenseCompany expense = new ExpenseCompany(); + expense.setActiveStatus(ActiveStatus.ENEBLED); + expense.setExpenseCompanyType(ExpenseCompanyType.PAYMENT_IN); + expense.setOffice(new Office(getLoggedUser().getOffice().getId())); + expense.setAmount(total); + expense.setDescription("Entrada automĆ”tica por sobrante de caja general"); + expense.setCreatedOn(date); + expense.setCreatedBy(box.getCreatedBy()); + + stableGeneralBoxCtrl.autoSaveEntry(expense); + } + + + box.setUser(getLoggedUser().getUser()); + setEmail(box); + + efectivo = BigDecimal.ZERO; + sobres = BigDecimal.ZERO; + monedas = BigDecimal.ZERO; + total = BigDecimal.ZERO; + description = ""; + FacesMessage msg = new FacesMessage("Nuevo cuadre de caja general", "Se agregĆ³ correctamente"); + FacesContext.getCurrentInstance().addMessage(null, msg); + } + + private boolean setEmail(StableGeneralBox sgb) { + + String ACCESS_KEY = getBundlePropertyFile().getString("aws.access.key"); + String SECRET_KEY = getBundlePropertyFile().getString("aws.secret.access.key"); + // se valida si la locasion tiene un correo asociado + + // Remitente y destinatario + String sender = "crov.technology.services@gmail.com"; + //String recipient = getLoggedUser().getLocation().getMail(); + String recipient = "camposbueno77@gmail.com"; + + // Configurar credenciales de AWS + BasicAWSCredentials awsCredentials = new BasicAWSCredentials(ACCESS_KEY, SECRET_KEY); + AmazonSimpleEmailService client = AmazonSimpleEmailServiceClientBuilder.standard() + .withCredentials(new AWSStaticCredentialsProvider(awsCredentials)) + .withRegion(getBundlePropertyFile().getString("aws.region")) // Cambia la regiĆ³n segĆŗn tus necesidades + .build(); + + String SUBJECT = "ACE Caja General"; + BigDecimal temp = sgb.getTotalEnvelope().add(sgb.getTotalCoin()).add(sgb.getTotalBankNote()); + String HTMLBODY = "" + + "" + + "" + + "" + + "" + + "

Cuadre de caja general ACE

" + + "

ACE - Caja general

" + + "

Por entregar: " + currencyFormatNumber(sgb.getTotalGeneralBox()) + "

" + + "

Entregado: " + currencyFormatNumber(temp) + "

" + + "

Diferencia: " + currencyFormatNumber(sgb.getTotalStable()) + "

" + + "

Comentario: " + sgb.getDescription() + "

" + + "

Cuadre realizado por: " + sgb.getUser().getHumanResource().getFirstName()+" "+sgb.getUser().getHumanResource().getLastName()+"

" + + "" + + ""; + + + String TEXTBODY = "Este mensaje ha sido enviado automĆ”ticamente desde ACE.\n\n"; + + // Crear el mensaje + SendEmailRequest request = new SendEmailRequest() + .withDestination(new Destination().withToAddresses(recipient)) + .withMessage(new Message() + .withBody(new Body() + .withHtml(new Content() + .withCharset("UTF-8").withData(HTMLBODY)) + .withText(new Content() + .withCharset("UTF-8").withData(TEXTBODY))) + .withSubject(new Content() + .withCharset("UTF-8").withData(SUBJECT))) + .withSource(sender); + + // Enviar el correo + try { + SendEmailResult result = client.sendEmail(request); + showMessage(FacesMessage.SEVERITY_INFO, "El correo se ha enviado correctamente", "El correo se ha enviado correctamente"); + + return true; + } catch (AmazonServiceException ex) { + showMessage(FacesMessage.SEVERITY_ERROR, "Error al enviar el correo", "Error al enviar el correo"); + + return false; + } + + } + + @Override + public void deleteRow() { + try { + if (stableGeneralBoxCtrl.existNextPaidStableGeneralBoxByCreatedOn(selectedStableGeneralBox.getCreatedOn())) { + showMessage(FacesMessage.SEVERITY_WARN, "Historial cadre de caja general", "No se puede borrar porque existe un cuadre de caja posterior."); + } else { + boolean delete = true; + delete = selectedStableGeneralBox.getActiveStatus() == ActiveStatus.ENEBLED ? true : false; + + if (delete) { + stableGeneralBoxCtrl.updateStableGeneralBoxByStatus(ActiveStatus.DISABLED, selectedStableGeneralBox.getId(), getLoggedUser().getUser().getId()); + searchHistoricalAction(); + Bitacora bitacora = new Bitacora(); + bitacora.setAction("Eliminar corte de caja general"); + bitacora.setCommentsUser(getComments()); + 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 corte de caja general con total en caja " + currencyFormatNumber(getSelectedStableGeneralBox().getTotalGeneralBox()) + + ", total sobre " + currencyFormatNumber(getSelectedStableGeneralBox().getTotalEnvelope()) + + ", total monedas " + currencyFormatNumber(getSelectedStableGeneralBox().getTotalCoin()) + + ", total efectivo " + currencyFormatNumber(getSelectedStableGeneralBox().getTotalBankNote()) + + ", diferencia de " + currencyFormatNumber(getSelectedStableGeneralBox().getTotalGeneralBox().subtract(getSelectedStableGeneralBox().getTotalEnvelope()).subtract(getSelectedStableGeneralBox().getTotalCoin()).subtract(getSelectedStableGeneralBox().getTotalBankNote())) + + " y fecha " + getSelectedStableGeneralBox().getCreatedOn()); + bitacoraCtrl.saveBitacora(bitacora); + comments = ""; + selectedStableGeneralBox = null; + showMessage(FacesMessage.SEVERITY_INFO, "Historial cadre de caja general", "Se eliminĆ³ correctamente."); + } + } + } catch (Exception e) { + } + } + + public StableGeneralBoxController getStableGeneralBoxCtrl() { + return stableGeneralBoxCtrl; + } + + public void setStableGeneralBoxCtrl(StableGeneralBoxController stableGeneralBoxCtrl) { + this.stableGeneralBoxCtrl = stableGeneralBoxCtrl; + } + + public List getStableGeneralBox() { + return stableGeneralBox; + } + + public void setStableGeneralBox(List stableGeneralBox) { + this.stableGeneralBox = stableGeneralBox; + } + + public StableGeneralBox getSelectedStableGeneralBox() { + return selectedStableGeneralBox; + } + + public void setSelectedStableGeneralBox(StableGeneralBox selectedStableGeneralBox) { + this.selectedStableGeneralBox = selectedStableGeneralBox; + } + + public BigDecimal getTotalBox() { + return totalBox; + } + + public void setTotalBox(BigDecimal totalBox) { + this.totalBox = totalBox; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public BigDecimal getSobres() { + return sobres; + } + + public void setSobres(BigDecimal sobres) { + this.sobres = sobres; + } + + public BigDecimal getEfectivo() { + return efectivo; + } + + public void setEfectivo(BigDecimal efectivo) { + this.efectivo = efectivo; + } + + public BigDecimal getMonedas() { + return monedas; + } + + public void setMonedas(BigDecimal monedas) { + this.monedas = monedas; + } + + public GenericController getGenericCtrl() { + return genericCtrl; + } + + public void setGenericCtrl(GenericController genericCtrl) { + this.genericCtrl = genericCtrl; + } + + public Date getCreatedOn() { + return createdOn; + } + + public void setCreatedOn(Date createdOn) { + this.createdOn = createdOn; + } + + public BigDecimal getTotal() { + return total; + } + + public void setTotal(BigDecimal total) { + this.total = total; + } + + public String getComments() { + return comments; + } + + public void setComments(String comments) { + this.comments = comments; + } + + 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; + } + + public void imprimir() { + Document document = new Document(PageSize.LETTER); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + try { + + PdfWriter.getInstance(document, baos); + + List resultsClosing = new ArrayList<>(); + List resultsExpenseIn = new ArrayList<>(); + List resultsExpenseOut = new ArrayList<>(); + List resultsExpenseAll = new ArrayList<>(); + List resultsPayroll = new ArrayList<>(); + List resultsMoneyDaily = new ArrayList<>(); + List resultsAdelantos = new ArrayList<>(); + List resultsDepositos = new ArrayList<>(); + + + Double totalCortes = 0D; + Double totalExpenseIn = 0D; + Double totalExpenseOut = 0D; + Double totalPayroll = 0D; + Double totalInicios = 0D; + Double totalAdelantos = 0D; + Double totalDepositos = 0D; + + + List results = new ArrayList<>(); + + + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(selectedStableGeneralBox.getCreatedOn()); + calendar.add(Calendar.HOUR_OF_DAY, -6); + Date fecha = calendar.getTime(); + + + Calendar calendarImpresion = Calendar.getInstance(); + calendarImpresion.setTime(new Date()); + calendarImpresion.add(Calendar.HOUR_OF_DAY, -6); + + BigDecimal lastStable = BigDecimal.ZERO; + + resultsClosing = getStableGeneralBoxCtrl().findClosingDailyListByStableGeneralBox(fecha); + resultsExpenseIn = getStableGeneralBoxCtrl().findExpenseCompanyInListByStableGeneralBox(fecha); + resultsExpenseOut = getStableGeneralBoxCtrl().findExpenseCompanyOutListByStableGeneralBox(fecha); + resultsExpenseAll = getStableGeneralBoxCtrl().findExpenseCompanyAllListByStableGeneralBox(fecha); + resultsPayroll = getStableGeneralBoxCtrl().findPayrollListByStableGeneralBox(fecha); + resultsMoneyDaily = getStableGeneralBoxCtrl().findIniciosListByStableGeneralBox(fecha); + resultsAdelantos = getStableGeneralBoxCtrl().findAdelantosListByStableGeneralBox(fecha); + resultsDepositos = getStableGeneralBoxCtrl().findLoanDetailsDepositByStableGeneralBox(fecha); + + lastStable = getStableGeneralBoxCtrl().getLastStableGeneralBox(fecha); + + DecimalFormat df2 = new DecimalFormat( "#,###,###,##0.00" ); + + results = stableGeneralBoxCtrl.getDataReport(fecha); + document.open(); + + DateFormat formatter = new SimpleDateFormat("dd/MM/yy"); + + Paragraph printDate = new Paragraph("Fecha de impresiĆ³n: " + formatter.format(calendarImpresion.getTime()), FontFactory.getFont("arial", 10, Font.BOLD, BaseColor.DARK_GRAY)); + printDate.setAlignment(Element.ALIGN_RIGHT); + document.add(printDate); + + ServletContext servletContext = (ServletContext) FacesContext.getCurrentInstance().getExternalContext().getContext(); + String carpetaImagen = (String) servletContext.getRealPath("resources/serenity-layout/images"); + + Image imagen = Image.getInstance(carpetaImagen + "/ace_logo.jpg"); + imagen.scalePercent(4f); + imagen.setAlignment(Element.ALIGN_CENTER); + document.add(imagen); + + Paragraph title = new Paragraph("CUADRE CAJA GENERAL", FontFactory.getFont("arial", 18, Font.BOLD, BaseColor.DARK_GRAY)); + title.setAlignment(Element.ALIGN_CENTER); + document.add(title); + + document.add(Chunk.NEWLINE); + + Object[] res = (Object[]) results.get(0); + BigDecimal sobresCajaChica = BigDecimal.ZERO; + BigDecimal efectivoCajaChica = BigDecimal.ZERO; + BigDecimal monedasCajaChica = BigDecimal.ZERO; + BigDecimal totalCajaChica = BigDecimal.ZERO; + + BigDecimal sobresCajaGral = BigDecimal.ZERO; + BigDecimal efectivoCajaGral = BigDecimal.ZERO; + BigDecimal monedasCajaGral = BigDecimal.ZERO; + BigDecimal totalCajaGral = BigDecimal.ZERO; + + PdfPTable tableGen = new PdfPTable(3); + tableGen.setWidthPercentage(100); + tableGen.setTotalWidth(new float[]{150f, 205f, 205f}); + tableGen.setLockedWidth(true); + + + + PdfPTable table = new PdfPTable(7); + table.setTotalWidth(new float[]{100, 60, 60, 60, 80, 100, 100}); + + table.setLockedWidth(true); + PdfPCell cell = new PdfPCell(new Paragraph("Cortes del dia", + FontFactory.getFont("arial", 10, Font.BOLD, BaseColor.WHITE))); + + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setBackgroundColor(new BaseColor(41, 171, 225)); + cell.setColspan(7); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("Usuario", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setColspan(1); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("Monto a reportar", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setColspan(1); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("Monto reportado", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setColspan(1); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("Diferencia", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setColspan(1); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("Fecha", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setColspan(1); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("Comentarios", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setColspan(1); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("Creado por", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setColspan(1); + table.addCell(cell); + + if (resultsClosing != null && !resultsClosing.isEmpty()) { + for (ClosingDay tmp : resultsClosing) { + totalCortes = totalCortes + tmp.getAmountPaid().doubleValue(); + cell = new PdfPCell(new Paragraph(tmp.getUser().getHumanResource().getFirstName() + " " + tmp.getUser().getHumanResource().getLastName(), + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_LEFT); + cell.setColspan(1); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph(df2.format(tmp.getAmountExpected().doubleValue()) + "", + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_LEFT); + cell.setColspan(1); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph(df2.format(tmp.getAmountPaid().doubleValue()) + "", + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_LEFT); + cell.setColspan(1); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph(df2.format((tmp.getAmountPaid().subtract(tmp.getAmountExpected())).doubleValue()) + "", + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_LEFT); + cell.setColspan(1); + table.addCell(cell); + + Calendar calendarClosing = Calendar.getInstance(); + calendarClosing.setTime(tmp.getCreatedOn()); + calendarClosing.add(Calendar.HOUR_OF_DAY, -6); + + + cell = new PdfPCell(new Paragraph(formatter.format(calendarClosing.getTime()), + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_LEFT); + cell.setColspan(1); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph(tmp.getComments(), + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_LEFT); + cell.setColspan(1); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph(tmp.getCreatedBy().getUser().getHumanResource().getFirstName() + " " + tmp.getCreatedBy().getUser().getHumanResource().getLastName(), + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cell.setHorizontalAlignment(Element.ALIGN_LEFT); + cell.setColspan(1); + table.addCell(cell); + } + document.add(table); + + document.add(Chunk.createWhitespace("")); + } + + PdfPTable tableExpenseIn = new PdfPTable(3); + tableExpenseIn.setTotalWidth(new float[]{100, 100, 100}); + + tableExpenseIn.setLockedWidth(true); + PdfPCell cellExpenseIn = new PdfPCell(new Paragraph("Entradas/Gastos administrativos", + FontFactory.getFont("arial", 10, Font.BOLD, BaseColor.WHITE))); + + cellExpenseIn.setHorizontalAlignment(Element.ALIGN_CENTER); + cellExpenseIn.setBackgroundColor(new BaseColor(41, 171, 225)); + cellExpenseIn.setColspan(4); + tableExpenseIn.addCell(cellExpenseIn); + + cellExpenseIn = new PdfPCell(new Paragraph("Monto", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellExpenseIn.setHorizontalAlignment(Element.ALIGN_CENTER); + cellExpenseIn.setColspan(1); + tableExpenseIn.addCell(cellExpenseIn); + + cellExpenseIn = new PdfPCell(new Paragraph("Tipo", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellExpenseIn.setHorizontalAlignment(Element.ALIGN_CENTER); + cellExpenseIn.setColspan(1); + tableExpenseIn.addCell(cellExpenseIn); + + cellExpenseIn = new PdfPCell(new Paragraph("DescripciĆ³n", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellExpenseIn.setHorizontalAlignment(Element.ALIGN_CENTER); + cellExpenseIn.setColspan(1); + tableExpenseIn.addCell(cellExpenseIn); + + /*cellExpenseIn = new PdfPCell(new Paragraph("Usuario", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellExpenseIn.setHorizontalAlignment(Element.ALIGN_CENTER); + cellExpenseIn.setColspan(1); + tableExpenseIn.addCell(cellExpenseIn);*/ + + if (resultsExpenseAll != null && !resultsExpenseAll.isEmpty()) { + for (ExpenseCompany tmp : resultsExpenseAll) { + cellExpenseIn = new PdfPCell(new Paragraph(df2.format(tmp.getAmount().doubleValue()) + "", + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cellExpenseIn.setHorizontalAlignment(Element.ALIGN_LEFT); + cellExpenseIn.setColspan(1); + tableExpenseIn.addCell(cellExpenseIn); + + cellExpenseIn = new PdfPCell(new Paragraph(tmp.getExpenseCompanyType().getLabel(), + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cellExpenseIn.setHorizontalAlignment(Element.ALIGN_LEFT); + cellExpenseIn.setColspan(1); + tableExpenseIn.addCell(cellExpenseIn); + + cellExpenseIn = new PdfPCell(new Paragraph(tmp.getDescription(), + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cellExpenseIn.setHorizontalAlignment(Element.ALIGN_LEFT); + cellExpenseIn.setColspan(1); + tableExpenseIn.addCell(cellExpenseIn); + + /*cellExpenseIn = new PdfPCell(new Paragraph(tmp.getUser().getUser().getHumanResource().getFirstName() + " " + tmp.getUser().getUser().getHumanResource().getLastName(), + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cellExpenseIn.setHorizontalAlignment(Element.ALIGN_LEFT); + cellExpenseIn.setColspan(1); + tableExpenseIn.addCell(cellExpenseIn);*/ + } + document.add(tableExpenseIn); + + document.add(Chunk.NEWLINE); + } + + if (resultsExpenseIn != null && !resultsExpenseIn.isEmpty()) { + for (ExpenseCompany tmp : resultsExpenseIn) { + totalExpenseIn = totalExpenseIn + tmp.getAmount().doubleValue(); + + } + } + + if (resultsExpenseOut != null && !resultsExpenseOut.isEmpty()) { + for (ExpenseCompany tmp : resultsExpenseOut) { + totalExpenseOut = totalExpenseOut + tmp.getAmount().doubleValue(); + + } + } + + PdfPTable tablePayroll = new PdfPTable(3); + tablePayroll.setTotalWidth(new float[]{100, 100, 100}); + + tablePayroll.setLockedWidth(true); + PdfPCell cellPayroll = new PdfPCell(new Paragraph("NĆ³minas", + FontFactory.getFont("arial", 10, Font.BOLD, BaseColor.WHITE))); + + cellPayroll.setHorizontalAlignment(Element.ALIGN_CENTER); + cellPayroll.setBackgroundColor(new BaseColor(41, 171, 225)); + cellPayroll.setColspan(3); + tablePayroll.addCell(cellPayroll); + + cellPayroll = new PdfPCell(new Paragraph("Monto", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellPayroll.setHorizontalAlignment(Element.ALIGN_CENTER); + cellPayroll.setColspan(1); + tablePayroll.addCell(cellPayroll); + + cellPayroll = new PdfPCell(new Paragraph("Empleado", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellPayroll.setHorizontalAlignment(Element.ALIGN_CENTER); + cellPayroll.setColspan(1); + tablePayroll.addCell(cellPayroll); + + cellPayroll = new PdfPCell(new Paragraph("Usuario creaciĆ³n", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellPayroll.setHorizontalAlignment(Element.ALIGN_CENTER); + cellPayroll.setColspan(1); + tablePayroll.addCell(cellPayroll); + + if (resultsPayroll != null && !resultsPayroll.isEmpty()) { + for (Payroll tmp : resultsPayroll) { + totalPayroll = totalPayroll + tmp.getTotalPayment().doubleValue(); + cellPayroll = new PdfPCell(new Paragraph(df2.format(tmp.getTotalPayment())+ "", + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cellPayroll.setHorizontalAlignment(Element.ALIGN_LEFT); + cellPayroll.setColspan(1); + tablePayroll.addCell(cellPayroll); + + cellPayroll = new PdfPCell(new Paragraph(tmp.getHumanResource().getFirstName() + " " + tmp.getHumanResource().getLastName(), + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cellPayroll.setHorizontalAlignment(Element.ALIGN_LEFT); + cellPayroll.setColspan(1); + tablePayroll.addCell(cellPayroll); + + cellPayroll = new PdfPCell(new Paragraph(tmp.getUser().getHumanResource().getFirstName() + " " + tmp.getUser().getHumanResource().getLastName(), + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cellPayroll.setHorizontalAlignment(Element.ALIGN_LEFT); + cellPayroll.setColspan(1); + tablePayroll.addCell(cellPayroll); + } + document.add(tablePayroll); + + document.add(Chunk.NEWLINE); + } + + PdfPTable tableInicios = new PdfPTable(2); + tableInicios.setTotalWidth(new float[]{150,150}); + + + PdfPCell cellInicios = new PdfPCell(new Paragraph("Inicios", + FontFactory.getFont("arial", 10, Font.BOLD, BaseColor.WHITE))); + + cellInicios.setHorizontalAlignment(Element.ALIGN_CENTER); + cellInicios.setBackgroundColor(new BaseColor(41, 171, 225)); + cellInicios.setColspan(3); + tableInicios.addCell(cellInicios); + + cellInicios = new PdfPCell(new Paragraph("Monto", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellInicios.setHorizontalAlignment(Element.ALIGN_CENTER); + cellInicios.setColspan(1); + tableInicios.addCell(cellInicios); + + + + cellInicios = new PdfPCell(new Paragraph("Usuario", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellInicios.setHorizontalAlignment(Element.ALIGN_CENTER); + cellInicios.setColspan(1); + tableInicios.addCell(cellInicios); + + if (resultsMoneyDaily != null && !resultsMoneyDaily.isEmpty()) { + for (MoneyDaily tmp : resultsMoneyDaily) { + totalInicios = totalInicios + tmp.getAmount().doubleValue(); + cellInicios = new PdfPCell(new Paragraph(df2.format(tmp.getAmount()) + "", + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cellInicios.setHorizontalAlignment(Element.ALIGN_LEFT); + cellInicios.setColspan(1); + tableInicios.addCell(cellInicios); + + + + cellInicios = new PdfPCell(new Paragraph(tmp.getUser().getHumanResource().getFirstName() + " " + tmp.getUser().getHumanResource().getLastName(), + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cellInicios.setHorizontalAlignment(Element.ALIGN_LEFT); + cellInicios.setColspan(1); + tableInicios.addCell(cellInicios); + } + document.add(tableInicios); + + document.add(Chunk.NEWLINE); + } + + PdfPTable tableAdelantos = new PdfPTable(4); + tableAdelantos.setTotalWidth(new float[]{100, 100, 100, 100}); + + tableAdelantos.setLockedWidth(true); + PdfPCell cellAdelantos = new PdfPCell(new Paragraph("Adelantos", + FontFactory.getFont("arial", 10, Font.BOLD, BaseColor.WHITE))); + + cellAdelantos.setHorizontalAlignment(Element.ALIGN_CENTER); + cellAdelantos.setBackgroundColor(BaseColor.BLUE); + cellAdelantos.setColspan(4); + tableAdelantos.addCell(cellAdelantos); + + cellAdelantos = new PdfPCell(new Paragraph("Empleado", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellAdelantos.setHorizontalAlignment(Element.ALIGN_CENTER); + cellAdelantos.setColspan(1); + tableAdelantos.addCell(cellAdelantos); + + cellAdelantos = new PdfPCell(new Paragraph("Monto", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellAdelantos.setHorizontalAlignment(Element.ALIGN_CENTER); + cellAdelantos.setColspan(1); + tableAdelantos.addCell(cellAdelantos); + + cellAdelantos = new PdfPCell(new Paragraph("DescripciĆ³n", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellAdelantos.setHorizontalAlignment(Element.ALIGN_CENTER); + cellAdelantos.setColspan(1); + tableAdelantos.addCell(cellAdelantos); + + cellAdelantos = new PdfPCell(new Paragraph("Usuario creaciĆ³n", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellAdelantos.setHorizontalAlignment(Element.ALIGN_CENTER); + cellAdelantos.setColspan(1); + tableAdelantos.addCell(cellAdelantos); + + if (resultsAdelantos != null && !resultsAdelantos.isEmpty()) { + for (Advance tmp : resultsAdelantos) { + totalAdelantos = totalAdelantos + tmp.getAmount().doubleValue(); + cellAdelantos = new PdfPCell(new Paragraph(tmp.getHumanResource().getFirstName() + " " + tmp.getHumanResource().getLastName(), + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cellAdelantos.setHorizontalAlignment(Element.ALIGN_LEFT); + cellAdelantos.setColspan(1); + tableAdelantos.addCell(cellAdelantos); + + cellAdelantos = new PdfPCell(new Paragraph(df2.format(tmp.getAmount()) + "", + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cellAdelantos.setHorizontalAlignment(Element.ALIGN_LEFT); + cellAdelantos.setColspan(1); + tableAdelantos.addCell(cellAdelantos); + + + cellAdelantos = new PdfPCell(new Paragraph(tmp.getUser().getHumanResource().getFirstName() + " " + tmp.getUser().getHumanResource().getLastName(), + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cellAdelantos.setHorizontalAlignment(Element.ALIGN_LEFT); + cellAdelantos.setColspan(1); + tableAdelantos.addCell(cellAdelantos); + } + document.add(tableAdelantos); + + document.add(Chunk.NEWLINE); + } + + PdfPTable tableSaleDeposit = new PdfPTable(4); + tableSaleDeposit.setTotalWidth(new float[]{100, 100, 100, 100}); + + tableSaleDeposit.setLockedWidth(true); + PdfPCell cellSaleDeposit = new PdfPCell(new Paragraph("Depositos", + FontFactory.getFont("arial", 10, Font.BOLD, BaseColor.WHITE))); + + cellSaleDeposit.setHorizontalAlignment(Element.ALIGN_CENTER); + cellSaleDeposit.setBackgroundColor(new BaseColor(41, 171, 225)); + cellSaleDeposit.setColspan(4); + tableSaleDeposit.addCell(cellSaleDeposit); + + cellSaleDeposit = new PdfPCell(new Paragraph("Monto", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellSaleDeposit.setHorizontalAlignment(Element.ALIGN_CENTER); + cellSaleDeposit.setColspan(1); + tableSaleDeposit.addCell(cellSaleDeposit); + + cellSaleDeposit = new PdfPCell(new Paragraph("Cliente", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellSaleDeposit.setHorizontalAlignment(Element.ALIGN_CENTER); + cellSaleDeposit.setColspan(1); + tableSaleDeposit.addCell(cellSaleDeposit); + + cellSaleDeposit = new PdfPCell(new Paragraph("Fecha", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellSaleDeposit.setHorizontalAlignment(Element.ALIGN_CENTER); + cellSaleDeposit.setColspan(1); + tableSaleDeposit.addCell(cellSaleDeposit); + + cellSaleDeposit = new PdfPCell(new Paragraph("Usuario creaciĆ³n", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellSaleDeposit.setHorizontalAlignment(Element.ALIGN_CENTER); + cellSaleDeposit.setColspan(1); + tableSaleDeposit.addCell(cellSaleDeposit); + + if (resultsDepositos != null && !resultsDepositos.isEmpty()) { + for (LoanDetails tmp : resultsDepositos) { + + + cellSaleDeposit = new PdfPCell(new Paragraph(df2.format(tmp.getPaymentAmount()) + "", + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cellSaleDeposit.setHorizontalAlignment(Element.ALIGN_LEFT); + cellSaleDeposit.setColspan(1); + tableSaleDeposit.addCell(cellSaleDeposit); + + cellSaleDeposit = new PdfPCell(new Paragraph(tmp.getLoan().getCustomer().getFirstName() + " "+ tmp.getLoan().getCustomer().getLastName() , + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cellSaleDeposit.setHorizontalAlignment(Element.ALIGN_LEFT); + cellSaleDeposit.setColspan(1); + tableSaleDeposit.addCell(cellSaleDeposit); + + cellSaleDeposit = new PdfPCell(new Paragraph(tmp.getCreatedOn() + "", + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cellSaleDeposit.setHorizontalAlignment(Element.ALIGN_LEFT); + cellSaleDeposit.setColspan(1); + tableSaleDeposit.addCell(cellSaleDeposit); + + cellSaleDeposit = new PdfPCell(new Paragraph(tmp.getUser().getHumanResource().getFirstName() + " "+ tmp.getUser().getHumanResource().getLastName() , + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cellSaleDeposit.setHorizontalAlignment(Element.ALIGN_LEFT); + cellSaleDeposit.setColspan(1); + tableSaleDeposit.addCell(cellSaleDeposit); + } + document.add(tableSaleDeposit); + + document.add(Chunk.NEWLINE); + } + + PdfPTable tableTotal = new PdfPTable(7); + tableTotal.setTotalWidth(new float[]{60, 45, 45, 55, 50, 45, 45}); + + tableTotal.setLockedWidth(true); + PdfPCell cellTotal = new PdfPCell(new Paragraph("Totales", + FontFactory.getFont("arial", 10, Font.BOLD, BaseColor.WHITE))); + + cellTotal.setHorizontalAlignment(Element.ALIGN_CENTER); + cellTotal.setBackgroundColor(new BaseColor(41, 171, 225)); + cellTotal.setColspan(7); + tableTotal.addCell(cellTotal); + + cellTotal = new PdfPCell(new Paragraph("Cuadre anterior", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellTotal.setHorizontalAlignment(Element.ALIGN_CENTER); + cellTotal.setColspan(1); + tableTotal.addCell(cellTotal); + + cellTotal = new PdfPCell(new Paragraph("Cortes", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellTotal.setHorizontalAlignment(Element.ALIGN_CENTER); + cellTotal.setColspan(1); + tableTotal.addCell(cellTotal); + + cellTotal = new PdfPCell(new Paragraph("Entradas", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellTotal.setHorizontalAlignment(Element.ALIGN_CENTER); + cellTotal.setColspan(1); + tableTotal.addCell(cellTotal); + + cellTotal = new PdfPCell(new Paragraph("Gastos admon.", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellTotal.setHorizontalAlignment(Element.ALIGN_CENTER); + cellTotal.setColspan(1); + tableTotal.addCell(cellTotal); + + cellTotal = new PdfPCell(new Paragraph("NĆ³minas", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellTotal.setHorizontalAlignment(Element.ALIGN_CENTER); + cellTotal.setColspan(1); + tableTotal.addCell(cellTotal); + + + + cellTotal = new PdfPCell(new Paragraph("Inicios", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellTotal.setHorizontalAlignment(Element.ALIGN_CENTER); + cellTotal.setColspan(1); + tableTotal.addCell(cellTotal); + + + + cellTotal = new PdfPCell(new Paragraph("Adelantos", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellTotal.setHorizontalAlignment(Element.ALIGN_CENTER); + cellTotal.setColspan(1); + tableTotal.addCell(cellTotal); + + + + cellTotal = new PdfPCell(new Paragraph(df2.format(lastStable.doubleValue()) + "", + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cellTotal.setHorizontalAlignment(Element.ALIGN_LEFT); + cellTotal.setColspan(1); + tableTotal.addCell(cellTotal); + + cellTotal = new PdfPCell(new Paragraph(df2.format(totalCortes) + "", + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cellTotal.setHorizontalAlignment(Element.ALIGN_LEFT); + cellTotal.setColspan(1); + tableTotal.addCell(cellTotal); + + cellTotal = new PdfPCell(new Paragraph(df2.format(totalExpenseIn) + "", + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cellTotal.setHorizontalAlignment(Element.ALIGN_LEFT); + cellTotal.setColspan(1); + tableTotal.addCell(cellTotal); + + cellTotal = new PdfPCell(new Paragraph(df2.format(totalExpenseOut) + "", + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cellTotal.setHorizontalAlignment(Element.ALIGN_LEFT); + cellTotal.setColspan(1); + tableTotal.addCell(cellTotal); + + cellTotal = new PdfPCell(new Paragraph(df2.format(totalPayroll) + "", + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cellTotal.setHorizontalAlignment(Element.ALIGN_LEFT); + cellTotal.setColspan(1); + tableTotal.addCell(cellTotal); + + + + cellTotal = new PdfPCell(new Paragraph(df2.format(totalInicios) + "", + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cellTotal.setHorizontalAlignment(Element.ALIGN_LEFT); + cellTotal.setColspan(1); + tableTotal.addCell(cellTotal); + + + + cellTotal = new PdfPCell(new Paragraph(df2.format(totalAdelantos) + "", + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cellTotal.setHorizontalAlignment(Element.ALIGN_LEFT); + cellTotal.setColspan(1); + tableTotal.addCell(cellTotal); + + + + document.add(tableTotal); + + document.add(Chunk.NEWLINE); + + + + User userTmp = selectedStableGeneralBox.getUser(); + PdfPTable tableStable = new PdfPTable(8); + tableStable.setTotalWidth(new float[]{50, 50, 60, 60, 50, 50, 65, 100}); + + tableStable.setLockedWidth(true); + PdfPCell cellStable = new PdfPCell(new Paragraph("Cuadre de caja general", + FontFactory.getFont("arial", 10, Font.BOLD, BaseColor.WHITE))); + + cellStable.setHorizontalAlignment(Element.ALIGN_CENTER); + cellStable.setBackgroundColor(new BaseColor(41, 171, 225)); + cellStable.setColspan(8); + tableStable.addCell(cellStable); + + cellStable = new PdfPCell(new Paragraph("Fecha creaciĆ³n", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellStable.setHorizontalAlignment(Element.ALIGN_CENTER); + cellStable.setColspan(1); + tableStable.addCell(cellStable); + + cellStable = new PdfPCell(new Paragraph("Usuario", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellStable.setHorizontalAlignment(Element.ALIGN_CENTER); + cellStable.setColspan(1); + tableStable.addCell(cellStable); + + cellStable = new PdfPCell(new Paragraph("Total en caja", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellStable.setHorizontalAlignment(Element.ALIGN_CENTER); + cellStable.setColspan(1); + tableStable.addCell(cellStable); + + + + cellStable = new PdfPCell(new Paragraph("Deje en sobres", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellStable.setHorizontalAlignment(Element.ALIGN_CENTER); + cellStable.setColspan(1); + tableStable.addCell(cellStable); + + cellStable = new PdfPCell(new Paragraph("Efectivo", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellStable.setHorizontalAlignment(Element.ALIGN_CENTER); + cellStable.setColspan(1); + tableStable.addCell(cellStable); + + cellStable = new PdfPCell(new Paragraph("Monedas", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellStable.setHorizontalAlignment(Element.ALIGN_CENTER); + cellStable.setColspan(1); + tableStable.addCell(cellStable); + + cellStable = new PdfPCell(new Paragraph("Diferencia", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellStable.setHorizontalAlignment(Element.ALIGN_CENTER); + cellStable.setColspan(1); + tableStable.addCell(cellStable); + + cellStable = new PdfPCell(new Paragraph("DescripciĆ³n", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellStable.setHorizontalAlignment(Element.ALIGN_CENTER); + cellStable.setColspan(1); + tableStable.addCell(cellStable); + + Calendar calendarCreatedOn = Calendar.getInstance(); + calendarCreatedOn.setTime(selectedStableGeneralBox.getCreatedOn()); + calendarCreatedOn.add(Calendar.HOUR_OF_DAY, -6); + + String date = formatter.format(calendarCreatedOn.getTime()); + + cellStable = new PdfPCell(new Paragraph(date, + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cellStable.setHorizontalAlignment(Element.ALIGN_LEFT); + cellStable.setColspan(1); + tableStable.addCell(cellStable); + + cellStable = new PdfPCell(new Paragraph(userTmp.getHumanResource().getFirstName() + " " + userTmp.getHumanResource().getLastName(), + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cellStable.setHorizontalAlignment(Element.ALIGN_LEFT); + cellStable.setColspan(1); + tableStable.addCell(cellStable); + + cellStable = new PdfPCell(new Paragraph(df2.format(selectedStableGeneralBox.getTotalGeneralBox()), + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cellStable.setHorizontalAlignment(Element.ALIGN_LEFT); + cellStable.setColspan(1); + tableStable.addCell(cellStable); + + + + cellStable = new PdfPCell(new Paragraph(df2.format(selectedStableGeneralBox.getTotalEnvelope()), + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cellStable.setHorizontalAlignment(Element.ALIGN_LEFT); + cellStable.setColspan(1); + tableStable.addCell(cellStable); + + cellStable = new PdfPCell(new Paragraph(df2.format(selectedStableGeneralBox.getTotalBankNote()), + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cellStable.setHorizontalAlignment(Element.ALIGN_LEFT); + cellStable.setColspan(1); + tableStable.addCell(cellStable); + + cellStable = new PdfPCell(new Paragraph(df2.format(selectedStableGeneralBox.getTotalCoin()), + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cellStable.setHorizontalAlignment(Element.ALIGN_LEFT); + cellStable.setColspan(1); + tableStable.addCell(cellStable); + + cellStable = new PdfPCell(new Paragraph(df2.format((selectedStableGeneralBox.getTotalGeneralBox().subtract(selectedStableGeneralBox.getTotalBankNote().add(selectedStableGeneralBox.getTotalEnvelope()).add(selectedStableGeneralBox.getTotalCoin())))), + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cellStable.setHorizontalAlignment(Element.ALIGN_LEFT); + cellStable.setColspan(1); + tableStable.addCell(cellStable); + + cellStable = new PdfPCell(new Paragraph(selectedStableGeneralBox.getDescription(), + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cellStable.setHorizontalAlignment(Element.ALIGN_LEFT); + cellStable.setColspan(1); + tableStable.addCell(cellStable); + + document.add(tableStable); + + + + + + document.add(Chunk.NEWLINE); + document.add(Chunk.NEWLINE); + + document.add(new Paragraph(" __________________________ __________________________")); + document.add(new Paragraph(" Firma Nombre y firma del revisor")); + document.add(new Paragraph(" "+ userTmp.getHumanResource().getFirstName() + " " + userTmp.getHumanResource().getLastName() +"")); + //document.add(new Paragraph(" " + res[8] == null ? "" : res[8].toString())); + + } catch (Exception e) { + System.out.print("Error 1: " + e.getMessage()); + } + + document.close(); + FacesContext context = FacesContext.getCurrentInstance(); + Object response = context.getExternalContext().getResponse(); + if (response instanceof HttpServletResponse) { + HttpServletResponse hrs = (HttpServletResponse) response; + hrs.setContentType("application/pdf"); + hrs.setHeader("Content-disposition", "attachment;filename=caja_general.pdf"); + hrs.setContentLength(baos.size()); + try { + ServletOutputStream out = hrs.getOutputStream(); + baos.writeTo(out); + out.flush(); + + } catch (IOException e) { + System.out.print("Error 2: " + e.getMessage()); + } + context.responseComplete(); + } + } + + private StableGeneralBoxController stableGeneralBoxCtrl; + private GenericController genericCtrl; + private BitacoraController bitacoraCtrl; + private GenericValidationController genericValidateController; + private Date lastStableGeneralBox; + private String comments; + + private List stableGeneralBox; + + private StableGeneralBox selectedStableGeneralBox; + + private BigDecimal totalBox; + + private String description; + private BigDecimal sobres; + private BigDecimal efectivo; + private BigDecimal monedas; + private Date createdOn; + private BigDecimal total; + + @PostConstruct + public void init() { + loadBundlePropertyFile(); + initOneWeekBeforeToCurrdate(); + + stableGeneralBoxCtrl = new StableGeneralBoxController(); + genericCtrl = new GenericController(); + bitacoraCtrl = new BitacoraController(); + setGenericValidateController(new GenericValidationController()); + setLastStableGeneralBox(getGenericValidateController().lastStableGeneralBoxByDate(getLoggedUser().getUser())); + stableGeneralBox = fillDatatableStableGeneralBox(); + // totalBox = genericCtrl.findAllGeneralBox(getLoggedUser().getOffice().getId()); + totalBox = stableGeneralBoxCtrl.getTotalBox(); + efectivo = BigDecimal.ZERO; + monedas = BigDecimal.ZERO; + sobres = BigDecimal.ZERO; + total = totalBox; + createdOn=new Date(); + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StableSmallBoxBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StableSmallBoxBean.java new file mode 100644 index 0000000..93fcacf --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StableSmallBoxBean.java @@ -0,0 +1,770 @@ +/* + * 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.web.beans.admin; + +import com.amazonaws.AmazonServiceException; +import com.amazonaws.auth.AWSStaticCredentialsProvider; +import com.amazonaws.auth.BasicAWSCredentials; +import com.amazonaws.services.simpleemail.AmazonSimpleEmailService; +import com.amazonaws.services.simpleemail.AmazonSimpleEmailServiceClientBuilder; +import com.amazonaws.services.simpleemail.model.Body; +import com.amazonaws.services.simpleemail.model.Content; +import com.amazonaws.services.simpleemail.model.Destination; +import com.amazonaws.services.simpleemail.model.Message; +import com.amazonaws.services.simpleemail.model.SendEmailRequest; +import com.amazonaws.services.simpleemail.model.SendEmailResult; +import com.arrebol.apc.controller.BitacoraController; +import com.arrebol.apc.controller.GenericController; +import com.arrebol.apc.controller.GenericValidationController; +import com.arrebol.apc.controller.admin.StableSmallBoxController; +import com.arrebol.apc.model.admin.OtherExpense; +import com.arrebol.apc.model.admin.StableSmallBox; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.system.logs.Bitacora; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import com.arrebol.apc.web.beans.SendMSN; +import com.itextpdf.text.BaseColor; +import com.itextpdf.text.Chunk; +import com.itextpdf.text.Document; +import com.itextpdf.text.Element; +import com.itextpdf.text.FontFactory; +import com.itextpdf.text.Image; +import com.itextpdf.text.PageSize; +import com.itextpdf.text.Paragraph; +import com.itextpdf.text.pdf.PdfPCell; +import com.itextpdf.text.pdf.PdfPTable; +import com.itextpdf.text.pdf.PdfWriter; +import java.awt.Font; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.Serializable; +import java.math.BigDecimal; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.context.FacesContext; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import javax.servlet.ServletContext; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Named("stableSmallBoxManager") +@ViewScoped +public class StableSmallBoxBean 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 { + setStableSmallBox(fillDatatableStableSmallBox()); + } + } catch (Exception e) { + } + } + + public List fillDatatableStableSmallBox() { + return getStableSmallBoxCtrl().fillStableSmallBoxDatatable(getLoggedUser().getOffice().getId(), getStarDate(), getEndDate()); + } + + public void calculationFunction() { + total = sobres.add(efectivo).add(monedas); + total = total.subtract(totalBox); + } + + @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 onRowReorder(ReorderEvent event) { + showMessage(FacesMessage.SEVERITY_INFO, "Registro Movido", "De columna: " + (event.getFromIndex() + 1) + " a columna: " + (event.getToIndex() + 1)); + } + + @Override + public void addRow() { + if (createdOn == null) { + FacesMessage msg = new FacesMessage("Datos incorrectos", "La fecha es obligatoria"); + FacesContext.getCurrentInstance().addMessage(null, msg); + return; + } + + BigDecimal totalBoxTemp = genericCtrl.findAllSmallBoxByLastSmallBox(getLoggedUser().getOffice().getId(), getLastSmallBox());; + + + if (totalBox.compareTo(totalBoxTemp) != 0) { + FacesMessage msg = new FacesMessage("Advertencia", "Otros usuarios han movido la informaciĆ³n de caja chica, por lo cual cambio el monto. Favor de refrescar la pĆ”gina."); + FacesContext.getCurrentInstance().addMessage(null, msg); + return; + } + Calendar calendar = Calendar.getInstance(); + calendar.setTime(createdOn); + calendar.set(Calendar.HOUR_OF_DAY, 12); + calendar.set(Calendar.MINUTE, 0); + calendar.set(Calendar.SECOND, 0); + calendar.set(Calendar.MILLISECOND, 0); + + if (stableSmallBoxCtrl.getCountStableSmallBoxByOfficeAndDate(calendar.getTime(), getLoggedUser().getOffice().getId()) > 0) { + FacesMessage msg = new FacesMessage("Cuadre de caja chica encontrado.", "Ya se encuentra registrado un cuadre de caja chica para ese dĆ­a."); + FacesContext.getCurrentInstance().addMessage(null, msg); + return; + } + + if (stableSmallBoxCtrl.getPendingByClosingDay(getLoggedUser().getOffice().getId()).compareTo(BigDecimal.ZERO) > 0) { + FacesMessage msg = new FacesMessage("ATENCION - CORTES FALTANTES.", "Falta hacer cortes del dia."); + FacesContext.getCurrentInstance().addMessage(null, msg); + return; + } + + Date date = new Date(); + if (genericCtrl.existStableGeneralBoxByCreatedOn(date)) { + showMessage(FacesMessage.SEVERITY_WARN, "DĆ­a cerrado", "No se pueden agregar mĆ”s cortes de caja chica porque ya se existe un cuadre de caja general de hoy."); + return; + } + StableSmallBox box = new StableSmallBox(); + box.setActiveStatus(ActiveStatus.ENEBLED); + box.setDescription(description); + box.setOffice(new Office(getLoggedUser().getOffice().getId())); + box.setTotalSmallBox(totalBox); + box.setTotalBankNote(efectivo); + box.setTotalEnvelope(sobres); + box.setTotalCoin(monedas); + BigDecimal temp = sobres.add(efectivo).add(monedas); + box.setTotalStable(temp.subtract(totalBox)); + + + + box.setCreatedOn(new Date()); + box.setCreatedBy(getLoggedUser().getUser().getId()); + stableSmallBoxCtrl.saveStableSmallBox(box); + + box.setUser(getLoggedUser().getUser()); + setEmail(box); + efectivo = BigDecimal.ZERO; + sobres = BigDecimal.ZERO; + monedas = BigDecimal.ZERO; + total = BigDecimal.ZERO; + description = ""; + FacesMessage msg = new FacesMessage("Nuevo cuadre de caja chica", "Se agregĆ³ correctamente"); + FacesContext.getCurrentInstance().addMessage(null, msg); + } + + private boolean setEmail(StableSmallBox ssb) { + + + String ACCESS_KEY = getBundlePropertyFile().getString("aws.access.key"); + String SECRET_KEY = getBundlePropertyFile().getString("aws.secret.access.key"); + // se valida si la locasion tiene un correo asociado + + // Remitente y destinatario + String sender = "crov.technology.services@gmail.com"; + //String recipient = getLoggedUser().getLocation().getMail(); + String recipient = "camposbueno77@gmail.com"; + + + // Configurar credenciales de AWS + BasicAWSCredentials awsCredentials = new BasicAWSCredentials(ACCESS_KEY, SECRET_KEY); + AmazonSimpleEmailService client = AmazonSimpleEmailServiceClientBuilder.standard() + .withCredentials(new AWSStaticCredentialsProvider(awsCredentials)) + .withRegion(getBundlePropertyFile().getString("aws.region")) // Cambia la regiĆ³n segĆŗn tus necesidades + .build(); + + String SUBJECT = "ACE Caja Chica"; + BigDecimal temp = ssb.getTotalEnvelope().add(ssb.getTotalCoin()).add(ssb.getTotalBankNote()); + String HTMLBODY = "" + + "" + + "" + + "" + + "" + + "

Cuadre de caja chica ACE

" + + "

ACE - Caja chica

" + + "

Por entregar: " + currencyFormatNumber(ssb.getTotalSmallBox()) + "

" + + "

Entregado: " + currencyFormatNumber(temp) + "

" + + "

Diferencia: " + currencyFormatNumber(ssb.getTotalStable()) + "

" + + "

Comentario: " + ssb.getDescription() + "

" + + "

Cuadre realizado por: " + ssb.getUser().getHumanResource().getFirstName()+" "+ssb.getUser().getHumanResource().getLastName()+ "

" + + "" + + ""; + + + String TEXTBODY = "Este mensaje ha sido enviado automĆ”ticamente desde ACE.\n\n"; + + // Crear el mensaje + SendEmailRequest request = new SendEmailRequest() + .withDestination(new Destination().withToAddresses(recipient)) + .withMessage(new Message() + .withBody(new Body() + .withHtml(new Content() + .withCharset("UTF-8").withData(HTMLBODY)) + .withText(new Content() + .withCharset("UTF-8").withData(TEXTBODY))) + .withSubject(new Content() + .withCharset("UTF-8").withData(SUBJECT))) + .withSource(sender); + + // Enviar el correo + try { + SendEmailResult result = client.sendEmail(request); + showMessage(FacesMessage.SEVERITY_INFO, "El correo se ha enviado correctamente", "El correo se ha enviado correctamente"); + + return true; + } catch (AmazonServiceException ex) { + showMessage(FacesMessage.SEVERITY_ERROR, "Error al enviar el correo", "Error al enviar el correo"); + + return false; + } + + } + @Override + public void deleteRow() { + try { + if (stableSmallBoxCtrl.existStableGeneralBoxByCreatedOn(selectedStableSmallBox.getCreatedOn())) { + showMessage(FacesMessage.SEVERITY_WARN, "Cuadre Caja chica", "No se puede borrar porque ya se realizo el cuadre de caja general del dĆ­a."); + } else { + if (stableSmallBoxCtrl.existNextPaidStableSmallBoxByCreatedOn(selectedStableSmallBox.getCreatedOn())) { + showMessage(FacesMessage.SEVERITY_WARN, "Cuadre Caja chica", "No se puede borrar porque existe un cuadre de caja chica posterior"); + } else { + boolean delete = true; + delete = selectedStableSmallBox.getActiveStatus() == ActiveStatus.ENEBLED ? true : false; + + if (delete) { + + stableSmallBoxCtrl.updateStableSmallBoxByStatus(ActiveStatus.DISABLED, selectedStableSmallBox.getId(), getLoggedUser().getUser().getId()); + Bitacora bitacora = new Bitacora(); + bitacora.setAction("Eliminar corte de caja general"); + bitacora.setCommentsUser(getComments()); + 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 corte de caja chica con total en caja " + currencyFormatNumber(getSelectedStableSmallBox().getTotalSmallBox()) + + ", total sobre " + currencyFormatNumber(getSelectedStableSmallBox().getTotalEnvelope()) + + ", total monedas " + currencyFormatNumber(getSelectedStableSmallBox().getTotalCoin()) + + ", total efectivo " + currencyFormatNumber(getSelectedStableSmallBox().getTotalBankNote()) + + ", diferencia de " + currencyFormatNumber(getSelectedStableSmallBox().getTotalSmallBox().subtract(getSelectedStableSmallBox().getTotalEnvelope()).subtract(getSelectedStableSmallBox().getTotalCoin()).subtract(getSelectedStableSmallBox().getTotalBankNote())) + + " y fecha " + getSelectedStableSmallBox().getCreatedOn()); + bitacoraCtrl.saveBitacora(bitacora); + comments = ""; + + searchHistoricalAction(); + selectedStableSmallBox = null; + showMessage(FacesMessage.SEVERITY_INFO, "Cuadre Caja chica", "Se eliminĆ³ correctamente."); + } + } + } + + } catch (Exception e) { + } + } + + public StableSmallBoxController getStableSmallBoxCtrl() { + return stableSmallBoxCtrl; + } + + public void setStableSmallBoxCtrl(StableSmallBoxController stableSmallBoxCtrl) { + this.stableSmallBoxCtrl = stableSmallBoxCtrl; + } + + public List getStableSmallBox() { + return stableSmallBox; + } + + public void setStableSmallBox(List stableSmallBox) { + this.stableSmallBox = stableSmallBox; + } + + public StableSmallBox getSelectedStableSmallBox() { + return selectedStableSmallBox; + } + + public void setSelectedStableSmallBox(StableSmallBox selectedStableSmallBox) { + this.selectedStableSmallBox = selectedStableSmallBox; + } + + public BigDecimal getTotalBox() { + return totalBox; + } + + public void setTotalBox(BigDecimal totalBox) { + this.totalBox = totalBox; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public BigDecimal getSobres() { + return sobres; + } + + public void setSobres(BigDecimal sobres) { + this.sobres = sobres; + } + + public BigDecimal getEfectivo() { + return efectivo; + } + + public void setEfectivo(BigDecimal efectivo) { + this.efectivo = efectivo; + } + + public BigDecimal getMonedas() { + return monedas; + } + + public void setMonedas(BigDecimal monedas) { + this.monedas = monedas; + } + + public GenericController getGenericCtrl() { + return genericCtrl; + } + + public void setGenericCtrl(GenericController genericCtrl) { + this.genericCtrl = genericCtrl; + } + + public Date getCreatedOn() { + return createdOn; + } + + public void setCreatedOn(Date createdOn) { + this.createdOn = createdOn; + } + + public BigDecimal getTotal() { + return total; + } + + public void setTotal(BigDecimal total) { + this.total = total; + } + public String getComments() { + return comments; + } + + public void setComments(String comments) { + this.comments = comments; + } + + 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; + } + + public Date getLastSmallBox() { + return lastSmallBox; + } + + public void setLastSmallBox(Date lastSmallBox) { + this.lastSmallBox = lastSmallBox; + } + + + + public void imprimir() { + Document document = new Document(PageSize.LETTER); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + try { + PdfWriter.getInstance(document, baos); + List results = new ArrayList<>(); + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(selectedStableSmallBox.getCreatedOn()); + calendar.add(Calendar.HOUR_OF_DAY, -6); + Date fecha = calendar.getTime(); + + results = stableSmallBoxCtrl.getDataReport(fecha); + List gastos = stableSmallBoxCtrl.fillOtherExpenseDatatable(getLoggedUser().getOffice().getId(), selectedStableSmallBox.getCreatedOn(), selectedStableSmallBox.getCreatedOn()); + document.open(); + + DateFormat formatter = new SimpleDateFormat("dd/MM/yy"); + + Paragraph printDate = new Paragraph("Fecha de impresiĆ³n: " + formatter.format(fecha), FontFactory.getFont("arial", 10, Font.BOLD, BaseColor.DARK_GRAY)); + printDate.setAlignment(Element.ALIGN_RIGHT); + document.add(printDate); + + ServletContext servletContext = (ServletContext)FacesContext.getCurrentInstance().getExternalContext().getContext(); + String carpetaImagen=(String)servletContext.getRealPath("resources/serenity-layout/images"); + + Image imagen = Image.getInstance(carpetaImagen+"/ace_logo.jpg"); + imagen.scalePercent(4f); + imagen.setAlignment(Element.ALIGN_CENTER); + document.add(imagen); + + Paragraph title = new Paragraph("CORTE DE CAJA CHICA", FontFactory.getFont("arial", 18, Font.BOLD, BaseColor.DARK_GRAY)); + title.setAlignment(Element.ALIGN_CENTER); + document.add(title); + + document.add(Chunk.NEWLINE); + + Object[] res = (Object[]) results.get(0); + BigDecimal sobresC = BigDecimal.ZERO; + BigDecimal efectivoC = BigDecimal.ZERO; + BigDecimal monedasC = BigDecimal.ZERO; + BigDecimal totalC = BigDecimal.ZERO; + BigDecimal dif = BigDecimal.ZERO; + + PdfPTable tableGen = new PdfPTable(5); + tableGen.setWidthPercentage(100); + tableGen.setTotalWidth(new float[]{100f, 100f, 110f, 110f, 120f}); + tableGen.setLockedWidth(true); + + PdfPCell cellGen = new PdfPCell(new Paragraph("Detalle de cortes del dĆ­a", + FontFactory.getFont("arial", 10, Font.BOLD, BaseColor.WHITE))); + cellGen.setHorizontalAlignment(Element.ALIGN_CENTER); + cellGen.setBackgroundColor(new BaseColor(41, 171, 225)); + cellGen.setColspan(5); + tableGen.addCell(cellGen); + + cellGen = new PdfPCell(new Paragraph("Asesor", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_CENTER); + //cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + cellGen = new PdfPCell(new Paragraph("Ruta", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_CENTER); + //cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + cellGen = new PdfPCell(new Paragraph("Monto esperado", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_CENTER); + //cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + cellGen = new PdfPCell(new Paragraph("Monto reportado", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_CENTER); + //cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + cellGen = new PdfPCell(new Paragraph("Comentarios", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_CENTER); + //cellGen.setBorder(0); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + + for (Object result : results) { + Object[] tmp = (Object[]) result; + // Detalle + cellGen = new PdfPCell(new Paragraph(tmp[0] == null ? "" : tmp[0].toString(), + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + //PrĆ©stamo anterior + cellGen = new PdfPCell(new Paragraph(tmp[1] != null ? tmp[1].toString() : "", + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + // ComisiĆ³n por apertura + cellGen = new PdfPCell(new Paragraph(tmp[2] != null ? "$" + tmp[2].toString() : "$0.00", + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_CENTER); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + // Monto + cellGen = new PdfPCell(new Paragraph(tmp[3] != null ? "$" + tmp[3].toString() : "$0.00", + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_CENTER); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + // Saldo insoluto + cellGen = new PdfPCell(new Paragraph(tmp[4] != null ? "$" + tmp[4].toString() : "$0.00", + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cellGen.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGen.setColspan(1); + tableGen.addCell(cellGen); + } + document.add(tableGen); + document.add(new Paragraph(" ", FontFactory.getFont("arial", 10, Font.BOLD, BaseColor.DARK_GRAY))); + + PdfPTable tableGastos = new PdfPTable(4); + tableGastos.setWidthPercentage(100); + tableGastos.setTotalWidth(new float[]{130f, 130f, 140f, 140f}); + tableGastos.setLockedWidth(true); + + PdfPCell cellGastos = new PdfPCell(new Paragraph("Detalle de gastos", + FontFactory.getFont("arial", 10, Font.BOLD, BaseColor.WHITE))); + cellGastos.setHorizontalAlignment(Element.ALIGN_CENTER); + cellGastos.setBackgroundColor(new BaseColor(41, 171, 225)); + cellGastos.setColspan(5); + tableGastos.addCell(cellGastos); + cellGastos = new PdfPCell(new Paragraph("Asesor", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGastos.setHorizontalAlignment(Element.ALIGN_CENTER); + //cellGen.setBorder(0); + cellGastos.setColspan(1); + tableGastos.addCell(cellGastos); + cellGastos = new PdfPCell(new Paragraph("Ruta", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGastos.setHorizontalAlignment(Element.ALIGN_CENTER); + //cellGen.setBorder(0); + cellGastos.setColspan(1); + tableGastos.addCell(cellGastos); + cellGastos = new PdfPCell(new Paragraph("Monto", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGastos.setHorizontalAlignment(Element.ALIGN_CENTER); + //cellGen.setBorder(0); + cellGastos.setColspan(1); + tableGastos.addCell(cellGastos); + cellGastos = new PdfPCell(new Paragraph("Comentarios", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellGastos.setHorizontalAlignment(Element.ALIGN_CENTER); + //cellGen.setBorder(0); + cellGastos.setColspan(1); + tableGastos.addCell(cellGastos); + + for (OtherExpense datoGasto : gastos) { + // usuario + cellGastos = new PdfPCell(new Paragraph(datoGasto == null ? "" : datoGasto.getUser().getHumanResource().getFirstName() + " " + datoGasto.getUser().getHumanResource().getLastName(), + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cellGastos.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGastos.setColspan(1); + tableGastos.addCell(cellGastos); + //rutas + cellGastos = new PdfPCell(new Paragraph(datoGasto != null ? datoGasto.getUserRoutes() : "", + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cellGastos.setHorizontalAlignment(Element.ALIGN_LEFT); + cellGastos.setColspan(1); + tableGastos.addCell(cellGastos); + // monto + cellGastos = new PdfPCell(new Paragraph(datoGasto != null ? "$" + datoGasto.getExpense() : "$0.00", + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cellGastos.setHorizontalAlignment(Element.ALIGN_CENTER); + cellGastos.setColspan(1); + tableGastos.addCell(cellGastos); + // comentarios + cellGastos = new PdfPCell(new Paragraph(datoGasto != null ? datoGasto.getDescription() : "", + FontFactory.getFont("arial", 6, Font.PLAIN, BaseColor.BLACK))); + cellGastos.setHorizontalAlignment(Element.ALIGN_CENTER); + cellGastos.setColspan(1); + tableGastos.addCell(cellGastos); + } + + document.add(tableGastos); + document.add(new Paragraph(" ", FontFactory.getFont("arial", 10, Font.BOLD, BaseColor.DARK_GRAY))); + + PdfPTable tableRes = new PdfPTable(2); + tableRes.setTotalWidth(new float[]{100f, 440f}); + + tableRes.setLockedWidth(true); + PdfPCell cellRes = new PdfPCell(new Paragraph("Detalle del cuadre de caja chica", + FontFactory.getFont("arial", 10, Font.BOLD, BaseColor.WHITE))); + cellRes.setHorizontalAlignment(Element.ALIGN_CENTER); + cellRes.setBackgroundColor(new BaseColor(41, 171, 225)); + cellRes.setColspan(2); + tableRes.addCell(cellRes); + + cellRes = new PdfPCell(new Paragraph("Total caja: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellRes.setHorizontalAlignment(Element.ALIGN_LEFT); + cellRes.setBorder(0); + cellRes.setColspan(1); + tableRes.addCell(cellRes); + cellRes = new PdfPCell(new Paragraph(res[5] != null ? "$" + res[5].toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellRes.setHorizontalAlignment(Element.ALIGN_LEFT); + cellRes.setBorder(0); + cellRes.setColspan(1); + tableRes.addCell(cellRes); + totalC = new BigDecimal(res[5] == null ? "0.0" : res[5].toString()); + + cellRes = new PdfPCell(new Paragraph("Total sobres: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellRes.setHorizontalAlignment(Element.ALIGN_LEFT); + cellRes.setBorder(0); + cellRes.setColspan(1); + tableRes.addCell(cellRes); + cellRes = new PdfPCell(new Paragraph(res[6] != null ? "$" + res[6].toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellRes.setHorizontalAlignment(Element.ALIGN_LEFT); + cellRes.setBorder(0); + cellRes.setColspan(1); + tableRes.addCell(cellRes); + sobresC = new BigDecimal(res[6] == null ? "0.0" : res[6].toString()); + + cellRes = new PdfPCell(new Paragraph("Total efectivo: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellRes.setHorizontalAlignment(Element.ALIGN_LEFT); + cellRes.setBorder(0); + cellRes.setColspan(1); + tableRes.addCell(cellRes); + cellRes = new PdfPCell(new Paragraph(res[7] != null ? "$" + res[7].toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellRes.setHorizontalAlignment(Element.ALIGN_LEFT); + cellRes.setBorder(0); + cellRes.setColspan(1); + tableRes.addCell(cellRes); + efectivoC = new BigDecimal(res[7] == null ? "0.0" : res[7].toString()); + + cellRes = new PdfPCell(new Paragraph("Total monedas: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellRes.setHorizontalAlignment(Element.ALIGN_LEFT); + cellRes.setBorder(0); + cellRes.setColspan(1); + tableRes.addCell(cellRes); + cellRes = new PdfPCell(new Paragraph(res[8] != null ? "$" + res[8].toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellRes.setHorizontalAlignment(Element.ALIGN_LEFT); + cellRes.setBorder(0); + cellRes.setColspan(1); + tableRes.addCell(cellRes); + monedasC = new BigDecimal(res[8] == null ? "0.0" : res[8].toString()); + + cellRes = new PdfPCell(new Paragraph("Diferencia: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellRes.setHorizontalAlignment(Element.ALIGN_LEFT); + cellRes.setBorder(0); + cellRes.setColspan(1); + tableRes.addCell(cellRes); + dif = sobresC.add(efectivoC).add(monedasC).subtract(totalC); + cellRes = new PdfPCell(new Paragraph(dif != null ? "$" + dif.toString() : "$0.00", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellRes.setHorizontalAlignment(Element.ALIGN_LEFT); + cellRes.setBorder(0); + cellRes.setColspan(1); + tableRes.addCell(cellRes); + + cellRes = new PdfPCell(new Paragraph("Comentarios: ", + FontFactory.getFont("arial", 8, Font.BOLD, BaseColor.BLACK))); + cellRes.setHorizontalAlignment(Element.ALIGN_LEFT); + cellRes.setBorder(0); + cellRes.setColspan(1); + tableRes.addCell(cellRes); + cellRes = new PdfPCell(new Paragraph(res[10] != null ? res[10].toString() : "", + FontFactory.getFont("arial", 8, Font.PLAIN, BaseColor.BLACK))); + cellRes.setHorizontalAlignment(Element.ALIGN_LEFT); + cellRes.setBorder(0); + cellRes.setColspan(1); + tableRes.addCell(cellRes); + + document.add(tableRes); + + document.add(Chunk.NEWLINE); + document.add(Chunk.NEWLINE); + document.add(Chunk.NEWLINE); + document.add(Chunk.NEWLINE); + + document.add(new Paragraph(" __________________________ __________________________")); + document.add(new Paragraph(" Firma Nombre y firma cajero responsable")); +// document.add(new Paragraph(" " + res[8] == null ? "" : res[8].toString())); + + } catch (Exception e) { + System.out.print("Error 1: " + e.getMessage()); + } + + document.close(); + FacesContext context = FacesContext.getCurrentInstance(); + Object response = context.getExternalContext().getResponse(); + if (response instanceof HttpServletResponse) { + HttpServletResponse hrs = (HttpServletResponse) response; + hrs.setContentType("application/pdf"); + hrs.setHeader("Content-disposition", "attachment"); + hrs.setContentLength(baos.size()); + try { + ServletOutputStream out = hrs.getOutputStream(); + baos.writeTo(out); + out.flush(); + + } catch (IOException e) { + System.out.print("Error 2: " + e.getMessage()); + } + context.responseComplete(); + } + } + + private StableSmallBoxController stableSmallBoxCtrl; + private GenericController genericCtrl; + private BitacoraController bitacoraCtrl; + private GenericValidationController genericValidateController; + private Date lastStableGeneralBox; + private String comments; + + private List stableSmallBox; + + private StableSmallBox selectedStableSmallBox; + + private BigDecimal totalBox; + + private String description; + private BigDecimal sobres; + private BigDecimal efectivo; + private BigDecimal monedas; + private Date createdOn; + private BigDecimal total; + + private Date lastSmallBox; + @PostConstruct + public void init() { + loadBundlePropertyFile(); + initOneWeekBeforeToCurrdate(); + + stableSmallBoxCtrl = new StableSmallBoxController(); + genericCtrl = new GenericController(); + bitacoraCtrl = new BitacoraController(); + setGenericValidateController(new GenericValidationController()); + setLastStableGeneralBox(getGenericValidateController().lastStableGeneralBoxByDate(getLoggedUser().getUser())); + stableSmallBox = fillDatatableStableSmallBox(); + + setLastSmallBox(getStableSmallBoxCtrl().getLastSmallBox(getLoggedUser().getOffice().getId())); + totalBox = genericCtrl.findAllSmallBoxByLastSmallBox(getLoggedUser().getOffice().getId(), getLastSmallBox()); + if(totalBox == null){ + totalBox = BigDecimal.ZERO; + } + efectivo = BigDecimal.ZERO; + monedas = BigDecimal.ZERO; + sobres = BigDecimal.ZERO; + total = totalBox; + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StatsAdvancesBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StatsAdvancesBean.java new file mode 100644 index 0000000..2338ec9 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StatsAdvancesBean.java @@ -0,0 +1,180 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.web.beans.admin; + +import com.arrebol.apc.controller.GenericController; +import com.arrebol.apc.controller.admin.StatsAdvancesController; +import com.arrebol.apc.controller.catalog.RouteController; +import com.arrebol.apc.model.catalog.RouteCtlg; +import com.arrebol.apc.model.views.StatsAdvancesView; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author David Rodriguez + */ +@Named("statsAdvancesManager") +@ViewScoped +public class StatsAdvancesBean 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 { + setAdvances(fillDatatableAdvances()); + setTotalValue(); + } + } catch (Exception e) { + } + } + + public BigDecimal searchTotalAdvancesAction() { + try { + if (getStarDate().after(getEndDate())) { + showMessage(FacesMessage.SEVERITY_ERROR, getBundlePropertyFile().getString("generic.start.date"), getBundlePropertyFile().getString("generic.end.date.error")); + } else { + setTotalValue(); + } + } catch (Exception e) { + } + return getTotalAdvances(); + } + + public StatsAdvancesController getAdvancesCtrl() { + return advancesCtrl; + } + + public void setAdvancesCtrl(StatsAdvancesController advancesCtrl) { + this.advancesCtrl = advancesCtrl; + } + + public GenericController getGenericCtrl() { + return genericCtrl; + } + + public void setGenericCtrl(GenericController genericCtrl) { + this.genericCtrl = genericCtrl; + } + + public List fillDatatableAdvances() { + return getAdvancesCtrl().fillAdvancesDataTable(getStarDate(), getEndDate(), getRouteSelectedId()); + } + + public BigDecimal fillTotalAdvances() { + return getAdvancesCtrl().fillTotalAdvances(getStarDate(), getEndDate()); + } + + public List getAdvances() { + return advances; + } + + public void setAdvances(List advances) { + this.advances = advances; + } + + public StatsAdvancesView getSelectedAdvances() { + return selectedAdvances; + } + + public void setSelectedAdvances(StatsAdvancesView selectedAdvances) { + this.selectedAdvances = selectedAdvances; + } + + public BigDecimal getTotalAdvances() { + return totalAdvances; + } + + public void setTotalAdvances(BigDecimal totalAdvances) { + this.totalAdvances = totalAdvances; + } + + public List getRoutes() { + return routes; + } + + public RouteController getRouteCtrl() { + return routeCtrl; + } + + public void setRouteCtrl(RouteController routeCtrl) { + this.routeCtrl = routeCtrl; + } + + public String getRouteSelectedId() { + return routeSelectedId; + } + + public void setRouteSelectedId(String routeSelectedId) { + this.routeSelectedId = routeSelectedId; + } + + private StatsAdvancesController advancesCtrl; + private GenericController genericCtrl; + private RouteController routeCtrl; + private List advances; + private StatsAdvancesView selectedAdvances; + private BigDecimal totalAdvances; + private List routes; + private String routeSelectedId; + + @PostConstruct + public void init() { + loadBundlePropertyFile(); + initStartAndEndDates(Calendar.DAY_OF_WEEK, 2); + + advancesCtrl = new StatsAdvancesController(); + genericCtrl = new GenericController(); + routeCtrl = new RouteController(); + advances = fillDatatableAdvances(); + setTotalValue(); + routes = routeCtrl.fillRoutesDatatable(getLoggedUser().getOffice().getId()); + } + + @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 onRowReorder(ReorderEvent event) { + 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. + } + + private void setTotalValue() { + if (advances != null && !advances.isEmpty()) { + setTotalAdvances(advances.stream().map(StatsAdvancesView::getTotalAdvances).reduce(BigDecimal::add).get()); + } else { + setTotalAdvances(BigDecimal.ZERO); + } + } +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StatsClosingDayBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StatsClosingDayBean.java new file mode 100644 index 0000000..5006f76 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StatsClosingDayBean.java @@ -0,0 +1,169 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.web.beans.admin; + +import com.arrebol.apc.controller.GenericController; +import com.arrebol.apc.controller.admin.StatsClosingDayController; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.views.StatsClosingDayView; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author David Rodriguez + */ +@Named("statsClosingDayManager") +@ViewScoped +public class StatsClosingDayBean 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 { + setClosingDay(fillDatatableClosingDay()); + setTotalValue(); + } + } catch (Exception e) { + } + } + + public BigDecimal searchTotalClosingDayAction() { + try { + if (getStarDate().after(getEndDate())) { + showMessage(FacesMessage.SEVERITY_ERROR, getBundlePropertyFile().getString("generic.start.date"), getBundlePropertyFile().getString("generic.end.date.error")); + } else { + setTotalValue(); + } + } catch (Exception e) { + } + return getTotalClosingDay(); + } + + public StatsClosingDayController getClosingDayCtrl() { + return closingDayCtrl; + } + + public void setClosingDayCtrl(StatsClosingDayController closingDayCtrl) { + this.closingDayCtrl = closingDayCtrl; + } + + public GenericController getGenericCtrl() { + return genericCtrl; + } + + public void setGenericCtrl(GenericController genericCtrl) { + this.genericCtrl = genericCtrl; + } + + public List fillDatatableClosingDay() { + return getClosingDayCtrl().fillClosingDayDataTable(getStarDate(), getEndDate(), getUserSelectedId()); + } + + public BigDecimal fillTotalClosingDay() { + return getClosingDayCtrl().fillTotalClosingDay(getStarDate(), getEndDate()); + } + + public List getClosingDay() { + return closingDay; + } + + public void setClosingDay(List closingDay) { + this.closingDay = closingDay; + } + + public StatsClosingDayView getSelectedClosingDay() { + return selectedClosingDay; + } + + public void setSelectedClosingDay(StatsClosingDayView selectedClosingDay) { + this.selectedClosingDay = selectedClosingDay; + } + + public BigDecimal getTotalClosingDay() { + return totalClosingDay; + } + + public void setTotalClosingDay(BigDecimal totalClosingDay) { + this.totalClosingDay = totalClosingDay; + } + + public List getUsers() { + return genericCtrl.getAllUsersByOffice(getLoggedUser().getOffice().getId()); + } + + public String getUserSelectedId() { + return userSelectedId; + } + + public void setUserSelectedId(String userSelectedId) { + this.userSelectedId = userSelectedId; + } + + private StatsClosingDayController closingDayCtrl; + private GenericController genericCtrl; + private List closingDay; + private StatsClosingDayView selectedClosingDay; + private BigDecimal totalClosingDay; + private List users; + private String userSelectedId; + + @PostConstruct + public void init() { + loadBundlePropertyFile(); + initStartAndEndDates(Calendar.DAY_OF_WEEK, 2); + + closingDayCtrl = new StatsClosingDayController(); + genericCtrl = new GenericController(); + closingDay = fillDatatableClosingDay(); + setTotalValue(); + users = getUsers(); + } + + @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 onRowReorder(ReorderEvent event) { + 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. + } + + private void setTotalValue() { + if (closingDay != null && !closingDay.isEmpty()) { + setTotalClosingDay(closingDay.stream().map(StatsClosingDayView::getTotalClosingDay).reduce(BigDecimal::add).get()); + } else { + setTotalClosingDay(BigDecimal.ZERO); + } + } +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StatsDepositsBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StatsDepositsBean.java new file mode 100644 index 0000000..393ea37 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StatsDepositsBean.java @@ -0,0 +1,169 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.web.beans.admin; + +import com.arrebol.apc.controller.GenericController; +import com.arrebol.apc.controller.admin.StatsDepositsController; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.views.StatsDepositsView; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author David Rodriguez + */ +@Named("statsDepositsManager") +@ViewScoped +public class StatsDepositsBean 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 { + setDeposits(fillDatatableDeposits()); + setTotalValue(); + } + } catch (Exception e) { + } + } + + public BigDecimal searchTotalDepositsAction() { + try { + if (getStarDate().after(getEndDate())) { + showMessage(FacesMessage.SEVERITY_ERROR, getBundlePropertyFile().getString("generic.start.date"), getBundlePropertyFile().getString("generic.end.date.error")); + } else { + setTotalValue(); + } + } catch (Exception e) { + } + return getTotalDeposits(); + } + + public StatsDepositsController getDepositsCtrl() { + return depositsCtrl; + } + + public void setDepositsCtrl(StatsDepositsController depositsCtrl) { + this.depositsCtrl = depositsCtrl; + } + + public GenericController getGenericCtrl() { + return genericCtrl; + } + + public void setGenericCtrl(GenericController genericCtrl) { + this.genericCtrl = genericCtrl; + } + + public List fillDatatableDeposits() { + return getDepositsCtrl().fillDepositsDataTable(getStarDate(), getEndDate(), getUserSelectedId()); + } + + public BigDecimal fillTotalDeposits() { + return getDepositsCtrl().fillTotalDeposits(getStarDate(), getEndDate()); + } + + public List getDeposits() { + return deposits; + } + + public void setDeposits(List deposits) { + this.deposits = deposits; + } + + public StatsDepositsView getSelectedDeposits() { + return selectedDeposits; + } + + public void setSelectedDeposits(StatsDepositsView selectedDeposits) { + this.selectedDeposits = selectedDeposits; + } + + public BigDecimal getTotalDeposits() { + return totalDeposits; + } + + public void setTotalDeposits(BigDecimal totalDeposits) { + this.totalDeposits = totalDeposits; + } + + public List getUsers() { + return genericCtrl.getAllUsersByOffice(getLoggedUser().getOffice().getId()); + } + + public String getUserSelectedId() { + return userSelectedId; + } + + public void setUserSelectedId(String userSelectedId) { + this.userSelectedId = userSelectedId; + } + + private StatsDepositsController depositsCtrl; + private GenericController genericCtrl; + private List deposits; + private StatsDepositsView selectedDeposits; + private BigDecimal totalDeposits; + private List users; + private String userSelectedId; + + @PostConstruct + public void init() { + loadBundlePropertyFile(); + initStartAndEndDates(Calendar.DAY_OF_WEEK, 2); + + depositsCtrl = new StatsDepositsController(); + genericCtrl = new GenericController(); + deposits = fillDatatableDeposits(); + setTotalValue(); + users = getUsers(); + } + + @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 onRowReorder(ReorderEvent event) { + 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. + } + + private void setTotalValue() { + if (deposits != null && !deposits.isEmpty()) { + setTotalDeposits(deposits.stream().map(StatsDepositsView::getTotalDeposits).reduce(BigDecimal::add).get()); + } else { + setTotalDeposits(BigDecimal.ZERO); + } + } +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StatsEmployeeSavingBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StatsEmployeeSavingBean.java new file mode 100644 index 0000000..7826915 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StatsEmployeeSavingBean.java @@ -0,0 +1,264 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.web.beans.admin; + +import com.arrebol.apc.controller.GenericController; +import com.arrebol.apc.controller.admin.StatsEmployeeSavingController; +import com.arrebol.apc.controller.util.DateWrapper; +import com.arrebol.apc.model.admin.EmployeeSaving; +import com.arrebol.apc.model.core.HumanResource; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.enums.EmployeeSavingType; +import com.arrebol.apc.model.views.StatsEmployeeSavingView; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author David Rodriguez + */ +@Named("statsEmployeeSavingManager") +@ViewScoped +public class StatsEmployeeSavingBean 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 { + setEmployeeSaving(fillDatatableEmployeeSaving()); + setTotalEmployeeSaving(fillTotalEmployeeSaving()); + } + } catch (Exception e) { + } + } + + public BigDecimal searchTotalEmployeeSavingAction() { + try { + if (getStarDate().after(getEndDate())) { + showMessage(FacesMessage.SEVERITY_ERROR, getBundlePropertyFile().getString("generic.start.date"), getBundlePropertyFile().getString("generic.end.date.error")); + } else { + setTotalEmployeeSaving(fillTotalEmployeeSaving()); + } + } catch (Exception e) { + } + return getTotalEmployeeSaving(); + } + + public List getDetails(String idUser) { + try { + setEmployeeSavingDetails(getEmployeeSavingCtrl().getEmployeeSavingById(getStarDate(), getEndDate(), idUser)); + } catch (Exception e) { + } + return null == employeeSavingsDetails ? new ArrayList<>() : employeeSavingsDetails; + } + + public StatsEmployeeSavingController getEmployeeSavingCtrl() { + return employeeSavingCtrl; + } + + public void setEmployeeSavingCtrl(StatsEmployeeSavingController employeeSavingCtrl) { + this.employeeSavingCtrl = employeeSavingCtrl; + } + + public GenericController getGenericCtrl() { + return genericCtrl; + } + + public void setGenericCtrl(GenericController genericCtrl) { + this.genericCtrl = genericCtrl; + } + + public List fillDatatableEmployeeSaving() { + return getEmployeeSavingCtrl().fillEmployeeSavingDataTable(getStarDate(), getEndDate()); + } + + public BigDecimal fillTotalEmployeeSaving() { + return getEmployeeSavingCtrl().fillTotalEmployeeSaving(getStarDate(), getEndDate()); + } + + public List getEmployeeSaving() { + return employeeSavings; + } + + public void setEmployeeSaving(List employeeSaving) { + this.employeeSavings = employeeSaving; + } + + public List getEmployeeSavingDetails() { + return employeeSavingsDetails; + } + + public void setEmployeeSavingDetails(List employeeSavingsDetails) { + this.employeeSavingsDetails = employeeSavingsDetails; + } + + public StatsEmployeeSavingView getSelectedEmployeeSaving() { + return selectedEmployeeSaving; + } + + public void setSelectedEmployeeSaving(StatsEmployeeSavingView selectedEmployeeSaving) { + this.selectedEmployeeSaving = selectedEmployeeSaving; + } + + public BigDecimal getTotalEmployeeSaving() { + return totalEmployeeSaving; + } + + public void setTotalEmployeeSaving(BigDecimal totalEmployeeSaving) { + this.totalEmployeeSaving = totalEmployeeSaving; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public BigDecimal getDisposal() { + return disposal; + } + + public void setDisposal(BigDecimal disposal) { + this.disposal = disposal; + } + + public List getUsers() { + return genericCtrl.getAllUsersByOffice(getLoggedUser().getOffice().getId()); + } + + public String getUserSelectedId() { + return userSelectedId; + } + + public void setUserSelectedId(String userSelectedId) { + this.userSelectedId = userSelectedId; + } + + private StatsEmployeeSavingController employeeSavingCtrl; + private GenericController genericCtrl; + private List employeeSavings; + private List employeeSavingsDetails; + private StatsEmployeeSavingView selectedEmployeeSaving; + private BigDecimal totalEmployeeSaving; + private String userId; + private BigDecimal disposal; + private List users; + private String userSelectedId; + + public void createEmployeeSaving() { + User userPayRoll = employeeSavingCtrl.getUserById(userSelectedId); + + getDetails(userPayRoll.getHumanResource().getId()); + + if(disposal.compareTo(BigDecimal.ZERO)==0){ + + showMessage(FacesMessage.SEVERITY_WARN, "DisposiciĆ³n Incorrecta", "No se puede disponer de 0"); + return; + + } + + if(disposal.compareTo(BigDecimal.ZERO)<0){ + + showMessage(FacesMessage.SEVERITY_WARN, "DisposiciĆ³n Incorrecta", "No se puede disponer de un numero negativo"); + return; + + } + + if (genericCtrl.existStableGeneralBoxByCreatedOn(new Date())) { + showMessage(FacesMessage.SEVERITY_WARN, "DĆ­a cerrado", "No se pueden hacer mas disposiciones de ahorro porque ya se existe un cuadre de caja general de hoy."); + return; + } + + BigDecimal totalEmployeeSavingDetail = BigDecimal.ZERO; + for (StatsEmployeeSavingView employeeSaving : employeeSavingsDetails) { + if (employeeSaving.getType().equals(EmployeeSavingType.SAVING)) { + totalEmployeeSavingDetail = totalEmployeeSavingDetail.add(employeeSaving.getEmployeeSaving()); + }else{ + totalEmployeeSavingDetail = totalEmployeeSavingDetail.subtract(employeeSaving.getEmployeeSaving()); + } + } + + if(disposal.compareTo(totalEmployeeSavingDetail)<=0){ + EmployeeSaving employeeSaving = new EmployeeSaving(); + employeeSaving.setIdUser(userPayRoll.getHumanResource().getId()); + employeeSaving.setEmployeeSaving(disposal); + employeeSaving.setCreatedOn(new Date()); + employeeSaving.setCreatedBy(getLoggedUser().getId()); + employeeSaving.setType(EmployeeSavingType.DISPOSAL); + + employeeSavingCtrl.saveEmployeeSaving(employeeSaving); + showMessage(FacesMessage.SEVERITY_INFO, "DisposiciĆ³n de ahorro", "Se guardĆ³ correctamente"); + setEmployeeSaving(fillDatatableEmployeeSaving()); + setTotalEmployeeSaving(fillTotalEmployeeSaving()); + } + + else{ + showMessage(FacesMessage.SEVERITY_INFO, "DisposiciĆ³n de ahorro fallida", "No se puede disponer mĆ”s efectivo del ahorro de esta persona"); + } + + } + + @PostConstruct + public void init() { + loadBundlePropertyFile(); + + Calendar cal = Calendar.getInstance(); + + cal.set(Calendar.DAY_OF_YEAR, 1); + Date start = cal.getTime(); + + setStarDate(start); + setEndDate(DateWrapper.getTodayMXTime()); + + employeeSavingCtrl = new StatsEmployeeSavingController(); + genericCtrl = new GenericController(); + employeeSavings = fillDatatableEmployeeSaving(); + totalEmployeeSaving = fillTotalEmployeeSaving(); + users = getUsers(); + + disposal = BigDecimal.ZERO; + } + + @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 onRowReorder(ReorderEvent event) { + 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. + } +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StatsGasolineBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StatsGasolineBean.java new file mode 100644 index 0000000..e2ec866 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StatsGasolineBean.java @@ -0,0 +1,144 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.web.beans.admin; + +import com.arrebol.apc.controller.GenericController; +import com.arrebol.apc.controller.admin.StatsGasolineController; +import com.arrebol.apc.model.views.StatsGasolineView; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.util.Calendar; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author David Rodriguez + */ +@Named("statsGasolineManager") +@ViewScoped +public class StatsGasolineBean 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 { + setGasoline(fillDatatableGasoline()); + setTotalGasoline(fillTotalGasoline()); + } + } catch (Exception e) { + } + } + + public Double searchTotalGasolineAction() { + try { + if (getStarDate().after(getEndDate())) { + showMessage(FacesMessage.SEVERITY_ERROR, getBundlePropertyFile().getString("generic.start.date"), getBundlePropertyFile().getString("generic.end.date.error")); + } else { + setTotalGasoline(fillTotalGasoline()); + } + } catch (Exception e) { + } + return getTotalGasoline(); + } + + public StatsGasolineController getGasolineCtrl() { + return gasolineCtrl; + } + + public void setGasolineCtrl(StatsGasolineController gasolineCtrl) { + this.gasolineCtrl = gasolineCtrl; + } + + public GenericController getGenericCtrl() { + return genericCtrl; + } + + public void setGenericCtrl(GenericController genericCtrl) { + this.genericCtrl = genericCtrl; + } + + public List fillDatatableGasoline() { + return getGasolineCtrl().fillGasolineDataTable(getStarDate(), getEndDate()); + } + + public Double fillTotalGasoline() { + return getGasolineCtrl().fillTotalGasoline(getStarDate(), getEndDate()); + } + + public List getGasoline() { + return gasoline; + } + + public void setGasoline(List gasoline) { + this.gasoline = gasoline; + } + + public StatsGasolineView getSelectedGasoline() { + return selectedGasoline; + } + + public void setSelectedGasoline(StatsGasolineView selectedGasoline) { + this.selectedGasoline = selectedGasoline; + } + + public Double getTotalGasoline() { + return totalGasoline; + } + + public void setTotalGasoline(Double totalGasoline) { + this.totalGasoline = totalGasoline; + } + + private StatsGasolineController gasolineCtrl; + private GenericController genericCtrl; + private List gasoline; + private StatsGasolineView selectedGasoline; + private Double totalGasoline; + + @PostConstruct + public void init() { + loadBundlePropertyFile(); + initStartAndEndDates(Calendar.DAY_OF_WEEK, 2); + + gasolineCtrl = new StatsGasolineController(); + genericCtrl = new GenericController(); + gasoline = fillDatatableGasoline(); + totalGasoline = fillTotalGasoline(); + } + + @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 onRowReorder(ReorderEvent event) { + 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. + } +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StatsOpeningFeesBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StatsOpeningFeesBean.java new file mode 100644 index 0000000..9c095ea --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StatsOpeningFeesBean.java @@ -0,0 +1,168 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.web.beans.admin; + +import com.arrebol.apc.controller.GenericController; +import com.arrebol.apc.controller.admin.StatsOpeningFeesController; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.views.StatsOpeningFeesView; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author David Rodriguez + */ +@Named("statsOpeningFeesManager") +@ViewScoped +public class StatsOpeningFeesBean 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 { + setOpeningFees(fillDatatableOpeningFees()); + setTotalValue(); + } + } catch (Exception e) { + } + } + + public BigDecimal searchTotalOpeningFeesAction() { + try { + if (getStarDate().after(getEndDate())) { + showMessage(FacesMessage.SEVERITY_ERROR, getBundlePropertyFile().getString("generic.start.date"), getBundlePropertyFile().getString("generic.end.date.error")); + } else { + setTotalValue(); + } + } catch (Exception e) { + } + return getTotalOpeningFees(); + } + + public StatsOpeningFeesController getOpeningFeesCtrl() { + return openingFeesCtrl; + } + + public void setOpeningFeesCtrl(StatsOpeningFeesController openingFeesCtrl) { + this.openingFeesCtrl = openingFeesCtrl; + } + + public GenericController getGenericCtrl() { + return genericCtrl; + } + + public void setGenericCtrl(GenericController genericCtrl) { + this.genericCtrl = genericCtrl; + } + + public List fillDatatableOpeningFees() { + return getOpeningFeesCtrl().fillOpeningFeesDataTable(getStarDate(), getEndDate(), getUserSelectedId()); + } + + public BigDecimal fillTotalOpeningFees() { + return getOpeningFeesCtrl().fillTotalOpeningFees(getStarDate(), getEndDate()); + } + + public List getopeningFees() { + return openingFees; + } + + public void setOpeningFees(List openingFees) { + this.openingFees = openingFees; + } + + public StatsOpeningFeesView getSelectedOpeningFees() { + return selectedOpeningFees; + } + + public void setSelectedOpeningFees(StatsOpeningFeesView selectedOpeningFees) { + this.selectedOpeningFees = selectedOpeningFees; + } + + public BigDecimal getTotalOpeningFees() { + return totalOpeningFees; + } + + public void setTotalOpeningFees(BigDecimal totalOpeningFees) { + this.totalOpeningFees = totalOpeningFees; + } + + public List getUsers() { + return genericCtrl.getAllUsersByOffice(getLoggedUser().getOffice().getId()); + } + + public String getUserSelectedId() { + return userSelectedId; + } + + public void setUserSelectedId(String userSelectedId) { + this.userSelectedId = userSelectedId; + } + + private StatsOpeningFeesController openingFeesCtrl; + private GenericController genericCtrl; + private List openingFees; + private StatsOpeningFeesView selectedOpeningFees; + private BigDecimal totalOpeningFees; + private List users; + private String userSelectedId; + + @PostConstruct + public void init() { + loadBundlePropertyFile(); + initStartAndEndDates(Calendar.DAY_OF_WEEK, 2); + + openingFeesCtrl = new StatsOpeningFeesController(); + genericCtrl = new GenericController(); + openingFees = fillDatatableOpeningFees(); + setTotalValue(); + } + + @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 onRowReorder(ReorderEvent event) { + 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. + } + + private void setTotalValue() { + if (openingFees != null && !openingFees.isEmpty()) { + setTotalOpeningFees(openingFees.stream().map(StatsOpeningFeesView::getTotalOpeningFees).reduce(BigDecimal::add).get()); + } else { + setTotalOpeningFees(BigDecimal.ZERO); + } + } +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StatsPaymentBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StatsPaymentBean.java new file mode 100644 index 0000000..79d9efc --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StatsPaymentBean.java @@ -0,0 +1,169 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.web.beans.admin; + +import com.arrebol.apc.controller.GenericController; +import com.arrebol.apc.controller.admin.StatsPaymentController; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.views.StatsPaymentView; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author David Rodriguez + */ +@Named("statsPaymentManager") +@ViewScoped +public class StatsPaymentBean 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 { + setPayment(fillDatatablePayment()); + setTotalValue(); + } + } catch (Exception e) { + } + } + + public BigDecimal searchTotalPaymentAction() { + try { + if (getStarDate().after(getEndDate())) { + showMessage(FacesMessage.SEVERITY_ERROR, getBundlePropertyFile().getString("generic.start.date"), getBundlePropertyFile().getString("generic.end.date.error")); + } else { + setTotalValue(); + } + } catch (Exception e) { + } + return getTotalPayment(); + } + + public StatsPaymentController getPaymentCtrl() { + return paymentCtrl; + } + + public void setPaymentCtrl(StatsPaymentController paymentCtrl) { + this.paymentCtrl = paymentCtrl; + } + + public GenericController getGenericCtrl() { + return genericCtrl; + } + + public void setGenericCtrl(GenericController genericCtrl) { + this.genericCtrl = genericCtrl; + } + + public List fillDatatablePayment() { + return getPaymentCtrl().fillPaymentDataTable(getStarDate(), getEndDate(), getUserSelectedId()); + } + + public BigDecimal fillTotalPayment() { + return getPaymentCtrl().fillTotalPayment(getStarDate(), getEndDate()); + } + + public List getPayment() { + return payment; + } + + public void setPayment(List payment) { + this.payment = payment; + } + + public StatsPaymentView getSelectedPayment() { + return selectedPayment; + } + + public void setSelectedPayment(StatsPaymentView selectedPayment) { + this.selectedPayment = selectedPayment; + } + + public BigDecimal getTotalPayment() { + return totalPayment; + } + + public void setTotalPayment(BigDecimal totalPayment) { + this.totalPayment = totalPayment; + } + + public List getUsers() { + return genericCtrl.getAllUsersByOffice(getLoggedUser().getOffice().getId()); + } + + public String getUserSelectedId() { + return userSelectedId; + } + + public void setUserSelectedId(String userSelectedId) { + this.userSelectedId = userSelectedId; + } + + private StatsPaymentController paymentCtrl; + private GenericController genericCtrl; + private List payment; + private StatsPaymentView selectedPayment; + private BigDecimal totalPayment; + private List users; + private String userSelectedId; + + @PostConstruct + public void init() { + loadBundlePropertyFile(); + initStartAndEndDates(Calendar.DAY_OF_WEEK, 2); + + paymentCtrl = new StatsPaymentController(); + genericCtrl = new GenericController(); + payment = fillDatatablePayment(); + setTotalValue(); + users = getUsers(); + } + + @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 onRowReorder(ReorderEvent event) { + 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. + } + + private void setTotalValue() { + if (payment != null && !payment.isEmpty()) { + setTotalPayment(payment.stream().map(StatsPaymentView::getTotalPayment).reduce(BigDecimal::add).get()); + } else { + setTotalPayment(BigDecimal.ZERO); + } + } +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StatsPaymentRenovationBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StatsPaymentRenovationBean.java new file mode 100644 index 0000000..4dc97f1 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StatsPaymentRenovationBean.java @@ -0,0 +1,168 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.web.beans.admin; + +import com.arrebol.apc.controller.GenericController; +import com.arrebol.apc.controller.admin.StatsPaymentRenovationController; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.views.StatsPaymentRenovationView; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author David Rodriguez + */ +@Named("statsPaymentRenovationManager") +@ViewScoped +public class StatsPaymentRenovationBean 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 { + setPaymentRenovation(fillDatatablePayment()); + setTotalValue(); + } + } catch (Exception e) { + } + } + + public BigDecimal searchTotalPaymentAction() { + try { + if (getStarDate().after(getEndDate())) { + showMessage(FacesMessage.SEVERITY_ERROR, getBundlePropertyFile().getString("generic.start.date"), getBundlePropertyFile().getString("generic.end.date.error")); + } else { + setTotalValue(); + } + } catch (Exception e) { + } + return getTotalPayment(); + } + + public StatsPaymentRenovationController getPaymentCtrl() { + return paymentCtrl; + } + + public void setPaymentCtrl(StatsPaymentRenovationController paymentCtrl) { + this.paymentCtrl = paymentCtrl; + } + + public GenericController getGenericCtrl() { + return genericCtrl; + } + + public void setGenericCtrl(GenericController genericCtrl) { + this.genericCtrl = genericCtrl; + } + + public List fillDatatablePayment() { + return getPaymentCtrl().fillPaymentDataTable(getStarDate(), getEndDate(), getUserSelectedId()); + } + + public BigDecimal fillTotalPayment() { + return getPaymentCtrl().fillTotalPayment(getStarDate(), getEndDate()); + } + + public List getPaymentRenovation() { + return paymentRenovation; + } + + public void setPaymentRenovation(List payment) { + this.paymentRenovation = payment; + } + + public StatsPaymentRenovationView getSelectedPaymentRenovation() { + return selectedPaymentRenovation; + } + + public void setSelectedPaymentRenovation(StatsPaymentRenovationView selectedPayment) { + this.selectedPaymentRenovation = selectedPayment; + } + + public BigDecimal getTotalPayment() { + return totalPayment; + } + + public void setTotalPayment(BigDecimal totalPayment) { + this.totalPayment = totalPayment; + } + + public List getUsers() { + return genericCtrl.getAllUsersByOffice(getLoggedUser().getOffice().getId()); + } + + public String getUserSelectedId() { + return userSelectedId; + } + + public void setUserSelectedId(String userSelectedId) { + this.userSelectedId = userSelectedId; + } + + private StatsPaymentRenovationController paymentCtrl; + private GenericController genericCtrl; + private List paymentRenovation; + private StatsPaymentRenovationView selectedPaymentRenovation; + private BigDecimal totalPayment; + private List users; + private String userSelectedId; + + @PostConstruct + public void init() { + loadBundlePropertyFile(); + initStartAndEndDates(Calendar.DAY_OF_WEEK, 2); + + paymentCtrl = new StatsPaymentRenovationController(); + genericCtrl = new GenericController(); + paymentRenovation = fillDatatablePayment(); + setTotalValue(); + users = getUsers(); + } + + @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 onRowReorder(ReorderEvent event) { + 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. + } + private void setTotalValue() { + if (paymentRenovation != null && !paymentRenovation.isEmpty()) { + setTotalPayment(paymentRenovation.stream().map(StatsPaymentRenovationView::getTotalPayment).reduce(BigDecimal::add).get()); + } else { + setTotalPayment(BigDecimal.ZERO); + } + } +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StatsPaymentRouteBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StatsPaymentRouteBean.java new file mode 100644 index 0000000..2c5ff53 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StatsPaymentRouteBean.java @@ -0,0 +1,180 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.web.beans.admin; + +import com.arrebol.apc.controller.GenericController; +import com.arrebol.apc.controller.admin.StatsPaymentRouteController; +import com.arrebol.apc.controller.catalog.RouteController; +import com.arrebol.apc.model.catalog.RouteCtlg; +import com.arrebol.apc.model.views.StatsPaymentRouteView; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author David Rodriguez + */ +@Named("statsPaymentRouteManager") +@ViewScoped +public class StatsPaymentRouteBean 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 { + setPayment(fillDatatablePayment()); + setTotalValue(); + } + } catch (Exception e) { + } + } + + public BigDecimal searchTotalPaymentAction() { + try { + if (getStarDate().after(getEndDate())) { + showMessage(FacesMessage.SEVERITY_ERROR, getBundlePropertyFile().getString("generic.start.date"), getBundlePropertyFile().getString("generic.end.date.error")); + } else { + setTotalValue(); + } + } catch (Exception e) { + } + return getTotalPayment(); + } + + public StatsPaymentRouteController getPaymentCtrl() { + return paymentCtrl; + } + + public void setPaymentCtrl(StatsPaymentRouteController paymentCtrl) { + this.paymentCtrl = paymentCtrl; + } + + public GenericController getGenericCtrl() { + return genericCtrl; + } + + public void setGenericCtrl(GenericController genericCtrl) { + this.genericCtrl = genericCtrl; + } + + public List fillDatatablePayment() { + return getPaymentCtrl().fillPaymentDataTable(getStarDate(), getEndDate(), getRouteSelectedId()); + } + + public BigDecimal fillTotalPayment() { + return getPaymentCtrl().fillTotalPayment(getStarDate(), getEndDate()); + } + + public List getPayment() { + return payment; + } + + public void setPayment(List payment) { + this.payment = payment; + } + + public StatsPaymentRouteView getSelectedPayment() { + return selectedPayment; + } + + public void setSelectedPayment(StatsPaymentRouteView selectedPayment) { + this.selectedPayment = selectedPayment; + } + + public BigDecimal getTotalPayment() { + return totalPayment; + } + + public void setTotalPayment(BigDecimal totalPayment) { + this.totalPayment = totalPayment; + } + + public List getRoutes() { + return routes; + } + + public RouteController getRouteCtrl() { + return routeCtrl; + } + + public void setRouteCtrl(RouteController routeCtrl) { + this.routeCtrl = routeCtrl; + } + + public String getRouteSelectedId() { + return routeSelectedId; + } + + public void setRouteSelectedId(String routeSelectedId) { + this.routeSelectedId = routeSelectedId; + } + + private StatsPaymentRouteController paymentCtrl; + private GenericController genericCtrl; + private RouteController routeCtrl; + private List payment; + private StatsPaymentRouteView selectedPayment; + private BigDecimal totalPayment; + private List routes; + private String routeSelectedId; + + @PostConstruct + public void init() { + loadBundlePropertyFile(); + initStartAndEndDates(Calendar.DAY_OF_WEEK, 2); + + paymentCtrl = new StatsPaymentRouteController(); + genericCtrl = new GenericController(); + routeCtrl = new RouteController(); + payment = fillDatatablePayment(); + setTotalValue(); + routes = routeCtrl.fillRoutesDatatable(getLoggedUser().getOffice().getId()); + } + + @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 onRowReorder(ReorderEvent event) { + 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. + } + + private void setTotalValue() { + if (payment != null && !payment.isEmpty()) { + setTotalPayment(payment.stream().map(StatsPaymentRouteView::getTotalPayment).reduce(BigDecimal::add).get()); + } else { + setTotalPayment(BigDecimal.ZERO); + } + } +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StatsPayrollBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StatsPayrollBean.java new file mode 100644 index 0000000..2e39402 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StatsPayrollBean.java @@ -0,0 +1,169 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.web.beans.admin; + +import com.arrebol.apc.controller.GenericController; +import com.arrebol.apc.controller.admin.StatsPayrollController; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.views.StatsPayrollView; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author David Rodriguez + */ +@Named("statsPayrollManager") +@ViewScoped +public class StatsPayrollBean 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 { + setPayroll(fillDatatablePayroll()); + setTotalValue(); + } + } catch (Exception e) { + } + } + + public BigDecimal searchTotalPayrollAction() { + try { + if (getStarDate().after(getEndDate())) { + showMessage(FacesMessage.SEVERITY_ERROR, getBundlePropertyFile().getString("generic.start.date"), getBundlePropertyFile().getString("generic.end.date.error")); + } else { + setTotalValue(); + } + } catch (Exception e) { + } + return getTotalPayroll(); + } + + public StatsPayrollController getPayrollCtrl() { + return payrollCtrl; + } + + public void setPayrollCtrl(StatsPayrollController payrollCtrl) { + this.payrollCtrl = payrollCtrl; + } + + public GenericController getGenericCtrl() { + return genericCtrl; + } + + public void setGenericCtrl(GenericController genericCtrl) { + this.genericCtrl = genericCtrl; + } + + public List fillDatatablePayroll() { + return getPayrollCtrl().fillPayrollDataTable(getStarDate(), getEndDate(), getUserSelectedId()); + } + + public BigDecimal fillTotalPayroll() { + return getPayrollCtrl().fillTotalPayroll(getStarDate(), getEndDate()); + } + + public List getPayroll() { + return payroll; + } + + public void setPayroll(List payroll) { + this.payroll = payroll; + } + + public StatsPayrollView getSelectedPayroll() { + return selectedPayroll; + } + + public void setSelectedPayroll(StatsPayrollView selectedPayroll) { + this.selectedPayroll = selectedPayroll; + } + + public BigDecimal getTotalPayroll() { + return totalPayroll; + } + + public void setTotalPayroll(BigDecimal totalPayroll) { + this.totalPayroll = totalPayroll; + } + + public List getUsers() { + return genericCtrl.getAllUsersByOffice(getLoggedUser().getOffice().getId()); + } + + public String getUserSelectedId() { + return userSelectedId; + } + + public void setUserSelectedId(String userSelectedId) { + this.userSelectedId = userSelectedId; + } + + private StatsPayrollController payrollCtrl; + private GenericController genericCtrl; + private List payroll; + private StatsPayrollView selectedPayroll; + private BigDecimal totalPayroll; + private List users; + private String userSelectedId; + + @PostConstruct + public void init() { + loadBundlePropertyFile(); + initStartAndEndDates(Calendar.DAY_OF_WEEK, 2); + + payrollCtrl = new StatsPayrollController(); + genericCtrl = new GenericController(); + payroll = fillDatatablePayroll(); + setTotalValue(); + users = getUsers(); + } + + @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 onRowReorder(ReorderEvent event) { + 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. + } + + private void setTotalValue() { + if (payroll != null && !payroll.isEmpty()) { + setTotalPayroll(payroll.stream().map(StatsPayrollView::getTotalPayroll).reduce(BigDecimal::add).get()); + } else { + setTotalPayroll(BigDecimal.ZERO); + } + } +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StatsSummaryBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StatsSummaryBean.java new file mode 100644 index 0000000..b3754ab --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StatsSummaryBean.java @@ -0,0 +1,145 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.web.beans.admin; + +import com.arrebol.apc.controller.GenericController; +import com.arrebol.apc.controller.admin.StatsSummaryController; +import com.arrebol.apc.model.views.StatsSummaryView; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author David Rodriguez + */ +@Named("statsSummaryManager") +@ViewScoped +public class StatsSummaryBean 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 { + setSummary(fillDatatableSummary()); + setTotalSummary(fillTotalSummary()); + } + } catch (Exception e) { + } + } + + public BigDecimal searchTotalSummaryAction() { + try { + if (getStarDate().after(getEndDate())) { + showMessage(FacesMessage.SEVERITY_ERROR, getBundlePropertyFile().getString("generic.start.date"), getBundlePropertyFile().getString("generic.end.date.error")); + } else { + setTotalSummary(fillTotalSummary()); + } + } catch (Exception e) { + } + return getTotalSummary(); + } + + public StatsSummaryController getSummaryCtrl() { + return summaryCtrl; + } + + public void setSummaryCtrl(StatsSummaryController summaryCtrl) { + this.summaryCtrl = summaryCtrl; + } + + public GenericController getGenericCtrl() { + return genericCtrl; + } + + public void setGenericCtrl(GenericController genericCtrl) { + this.genericCtrl = genericCtrl; + } + + public List fillDatatableSummary() { + return getSummaryCtrl().fillSummaryDataTable(getStarDate(), getEndDate()); + } + + public BigDecimal fillTotalSummary() { + return getSummaryCtrl().fillTotalSummary(getStarDate(), getEndDate()); + } + + public List getSummary() { + return summary; + } + + public void setSummary(List summary) { + this.summary = summary; + } + + public StatsSummaryView getSelectedSummary() { + return selectedSummary; + } + + public void setSelectedSummary(StatsSummaryView selectedSummary) { + this.selectedSummary = selectedSummary; + } + + public BigDecimal getTotalSummary() { + return totalSummary; + } + + public void setTotalSummary(BigDecimal totalSummary) { + this.totalSummary = totalSummary; + } + + private StatsSummaryController summaryCtrl; + private GenericController genericCtrl; + private List summary; + private StatsSummaryView selectedSummary; + private BigDecimal totalSummary; + + @PostConstruct + public void init() { + loadBundlePropertyFile(); + initStartAndEndDates(Calendar.DAY_OF_WEEK, 2); + + summaryCtrl = new StatsSummaryController(); + genericCtrl = new GenericController(); + summary = fillDatatableSummary(); + totalSummary = fillTotalSummary(); + } + + @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 onRowReorder(ReorderEvent event) { + 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. + } +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StatsVehicleBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StatsVehicleBean.java new file mode 100644 index 0000000..e02eb6c --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StatsVehicleBean.java @@ -0,0 +1,117 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.web.beans.admin; + +import com.arrebol.apc.controller.GenericController; +import com.arrebol.apc.controller.admin.StatsVehicleController; +import com.arrebol.apc.model.catalog.Vehicle; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.util.Calendar; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author David Rodriguez + */ +@Named("statsVehicleManager") +@ViewScoped +public class StatsVehicleBean 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 { + setVehicle(fillDatatableVehicle()); + } + } catch (Exception e) { + } + } + + public StatsVehicleController getVehicleCtrl() { + return vehicleCtrl; + } + + public void setVehicleCtrl(StatsVehicleController gasolineCtrl) { + this.vehicleCtrl = gasolineCtrl; + } + + public GenericController getGenericCtrl() { + return genericCtrl; + } + + public void setGenericCtrl(GenericController genericCtrl) { + this.genericCtrl = genericCtrl; + } + + public List fillDatatableVehicle() { + return getVehicleCtrl().fillVehicleDataTable(getStarDate(), getEndDate()); + } + + public List getVehicle() { + return vehicle; + } + + public void setVehicle(List vehicle) { + this.vehicle = vehicle; + } + + public Vehicle getSelectedVehicle() { + return selectedVehicle; + } + + public void setSelectedVehicle(Vehicle selectedVehicle) { + this.selectedVehicle = selectedVehicle; + } + + private StatsVehicleController vehicleCtrl; + private GenericController genericCtrl; + private List vehicle; + private Vehicle selectedVehicle; + + @PostConstruct + public void init() { + loadBundlePropertyFile(); + initStartAndEndDates(Calendar.DAY_OF_WEEK, 2); + + vehicleCtrl = new StatsVehicleController(); + genericCtrl = new GenericController(); + vehicle = fillDatatableVehicle(); + } + + @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 onRowReorder(ReorderEvent event) { + 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. + } +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StatsZeroPaymentsBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StatsZeroPaymentsBean.java new file mode 100644 index 0000000..4d32c28 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/StatsZeroPaymentsBean.java @@ -0,0 +1,168 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.web.beans.admin; + +import com.arrebol.apc.controller.GenericController; +import com.arrebol.apc.controller.admin.StatsZeroPaymentsController; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.views.StatsZeroPaymentsView; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.util.Calendar; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author David Rodriguez + */ +@Named("statsZeroPaymentsManager") +@ViewScoped +public class StatsZeroPaymentsBean 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 { + setZeroPayments(fillDatatableZeroPayments()); + setTotalValue(); + } + } catch (Exception e) { + } + } + + public int searchTotalZeroPaymentsAction() { + try { + if (getStarDate().after(getEndDate())) { + showMessage(FacesMessage.SEVERITY_ERROR, getBundlePropertyFile().getString("generic.start.date"), getBundlePropertyFile().getString("generic.end.date.error")); + } else { + setTotalValue(); + } + } catch (Exception e) { + } + return getTotalZeroPayments(); + } + + public StatsZeroPaymentsController getZeroPaymentsCtrl() { + return zeroPaymentsCtrl; + } + + public void setZeroPaymentsCtrl(StatsZeroPaymentsController zeroPaymentsCtrl) { + this.zeroPaymentsCtrl = zeroPaymentsCtrl; + } + + public GenericController getGenericCtrl() { + return genericCtrl; + } + + public void setGenericCtrl(GenericController genericCtrl) { + this.genericCtrl = genericCtrl; + } + + public List fillDatatableZeroPayments() { + return getZeroPaymentsCtrl().fillZeroPaymentsDataTable(getStarDate(), getEndDate(), getUserSelectedId()); + } + + public int fillTotalZeroPayments() { + return getZeroPaymentsCtrl().fillTotalZeroPayments(getStarDate(), getEndDate()); + } + + public List getZeroPayments() { + return zeroPayments; + } + + public void setZeroPayments(List zeroPayments) { + this.zeroPayments = zeroPayments; + } + + public StatsZeroPaymentsView getSelectedZeroPayments() { + return selectedZeroPayments; + } + + public void setSelectedZeroPayments(StatsZeroPaymentsView selectedZeroPayments) { + this.selectedZeroPayments = selectedZeroPayments; + } + + public int getTotalZeroPayments() { + return totalZeroPayments; + } + + public void setTotalZeroPayments(int totalZeroPayments) { + this.totalZeroPayments = totalZeroPayments; + } + + public List getUsers() { + return genericCtrl.getAllUsersByOffice(getLoggedUser().getOffice().getId()); + } + + public String getUserSelectedId() { + return userSelectedId; + } + + public void setUserSelectedId(String userSelectedId) { + this.userSelectedId = userSelectedId; + } + + private StatsZeroPaymentsController zeroPaymentsCtrl; + private GenericController genericCtrl; + private List zeroPayments; + private StatsZeroPaymentsView selectedZeroPayments; + private int totalZeroPayments; + private List users; + private String userSelectedId; + + @PostConstruct + public void init() { + loadBundlePropertyFile(); + initStartAndEndDates(Calendar.DAY_OF_WEEK, 2); + + zeroPaymentsCtrl = new StatsZeroPaymentsController(); + genericCtrl = new GenericController(); + zeroPayments = fillDatatableZeroPayments(); + setTotalValue(); + users = getUsers(); + } + + @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 onRowReorder(ReorderEvent event) { + 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. + } + + private void setTotalValue() { + if (zeroPayments != null) { + setTotalZeroPayments(zeroPayments.size()); + } else { + setTotalZeroPayments(0); + } + } +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/TransferBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/TransferBean.java new file mode 100644 index 0000000..21e4bad --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/TransferBean.java @@ -0,0 +1,263 @@ +/* + * 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.web.beans.admin; + +import com.arrebol.apc.controller.BitacoraController; +import com.arrebol.apc.controller.GenericController; +import com.arrebol.apc.controller.GenericValidationController; +import com.arrebol.apc.controller.admin.TransferController; +import com.arrebol.apc.model.admin.Transfer; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.enums.ActionStatus; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.system.logs.Bitacora; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.context.FacesContext; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Named("transferManager") +@ViewScoped +public class TransferBean 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 { + setTransfer(getTransferCtrl().fillTransferDatatable(getLoggedUser().getOffice().getId(), getStarDate(), getEndDate())); + } + } catch (Exception e) { + } + } + + public List fillDatatableTransfer() { + + return getTransferCtrl().fillTransferDatatable(getLoggedUser().getOffice().getId(), getStarDate(), getEndDate()); + } + + public List getUsers() { + + return genericCtrl.getAllUsersByOffice(getLoggedUser().getOffice().getId()); + } + + @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 onRowReorder(ReorderEvent event) { + showMessage(FacesMessage.SEVERITY_INFO, "Registro Movido", "De columna: " + (event.getFromIndex() + 1) + " a columna: " + (event.getToIndex() + 1)); + } + + @Override + public void addRow() { + Date date = new Date(); + if (genericCtrl.existStableSmallBoxByCreatedOn(date)) { + showMessage(FacesMessage.SEVERITY_WARN, "DĆ­a cerrado", "No se pueden agregar mĆ”s transferencias porque ya se existe un cuadre de caja chica de hoy."); + return; + } + + Transfer saveTransfer = new Transfer(); + saveTransfer.setActionStatus(ActionStatus.PENDING); + saveTransfer.setActiveStatus(ActiveStatus.ENEBLED); + saveTransfer.setOffice(new Office(getLoggedUser().getOffice().getId())); + saveTransfer.setUserReceiver(new User(userReceiveId)); + saveTransfer.setUserTransmitter(new User(userSendId)); + saveTransfer.setAmountToTransfer(new BigDecimal(amountToTransfer)); + saveTransfer.setCreatedBy(getLoggedUser().getId()); + saveTransfer.setCreatedOn(new Date()); + transferCtrl.saveTransfer(saveTransfer); + transfer.clear(); + transfer = fillDatatableTransfer(); + amountToTransfer = ""; + userReceiveId = ""; + userSendId = ""; + FacesMessage msg = new FacesMessage("Nueva transferencia", "Se agregĆ³ correctamente"); + FacesContext.getCurrentInstance().addMessage(null, msg); + } + + @Override + public void deleteRow() { + transferCtrl.updateTransferByStatus(ActiveStatus.DISABLED, selectedTransfer.getId(), getLoggedUser().getUser().getId()); + searchHistoricalAction(); + Bitacora bitacora = new Bitacora(); + bitacora.setAction("Eliminar transferencia"); + bitacora.setCommentsUser(getCommentsBitacora()); + 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Ć³ correctamente la transferencia con fecha: " + selectedTransfer.getCreatedOn() + ", con monto $" + + selectedTransfer.getAmountToTransfer()); + bitacoraCtrl.saveBitacora(bitacora); + selectedTransfer = null; + commentsBitacora = ""; + showMessage(FacesMessage.SEVERITY_INFO, "Transferencia Eliminada", "Se eliminĆ³ correctamente."); + } + + public TransferController getTransferCtrl() { + return transferCtrl; + } + + public void setTransferCtrl(TransferController transferCtrl) { + this.transferCtrl = transferCtrl; + } + + public List getTransfer() { + return transfer; + } + + public void setTransfer(List transfer) { + this.transfer = transfer; + } + + public Transfer getSelectedTransfer() { + return selectedTransfer; + } + + public void setSelectedTransfer(Transfer selectedTransfer) { + this.selectedTransfer = selectedTransfer; + } + + public List getUserSend() { + return userSend; + } + + public void setUserSend(List userSend) { + this.userSend = userSend; + } + + public List getUserReceive() { + return userReceive; + } + + public void setUserReceive(List userReceive) { + this.userReceive = userReceive; + } + + public String getUserSendId() { + return userSendId; + } + + public void setUserSendId(String userSendId) { + this.userSendId = userSendId; + } + + public String getUserReceiveId() { + return userReceiveId; + } + + public void setUserReceiveId(String userReceiveId) { + this.userReceiveId = userReceiveId; + } + + public String getAmountToTransfer() { + return amountToTransfer; + } + + public void setAmountToTransfer(String amountToTransfer) { + this.amountToTransfer = amountToTransfer; + } + + public GenericController getGenericCtrl() { + return genericCtrl; + } + + public void setGenericCtrl(GenericController genericCtrl) { + this.genericCtrl = genericCtrl; + } + + public GenericValidationController getGenericValidateController() { + return genericValidateController; + } + + public void setGenericValidateController(GenericValidationController genericController) { + this.genericValidateController = genericController; + } + + public Date getLastStableSmallBox() { + return lastStableSmallBox; + } + + public void setLastStableSmallBox(Date lastStableSmallBox) { + this.lastStableSmallBox = lastStableSmallBox; + } + + public BitacoraController getBitacoraCtrl() { + return bitacoraCtrl; + } + + public void setBitacoraCtrl(BitacoraController bitacoraCtrl) { + this.bitacoraCtrl = bitacoraCtrl; + } + + public String getCommentsBitacora() { + return commentsBitacora; + } + + public void setCommentsBitacora(String commentsBitacora) { + this.commentsBitacora = commentsBitacora; + } + + private TransferController transferCtrl; + private GenericController genericCtrl; + private BitacoraController bitacoraCtrl; + private String commentsBitacora; + private GenericValidationController genericValidateController; + private Date lastStableSmallBox; + + private List transfer; + private List userSend; + private List userReceive; + + private String userSendId; + private String userReceiveId; + private String amountToTransfer; + + private Transfer selectedTransfer; + + @PostConstruct + public void init() { + loadBundlePropertyFile(); + + transferCtrl = new TransferController(); + genericCtrl = new GenericController(); + bitacoraCtrl = new BitacoraController(); + setGenericValidateController(new GenericValidationController()); + setLastStableSmallBox(getGenericValidateController().lastStableSmallBoxByDate(getLoggedUser().getUser())); + + initOneWeekBeforeToCurrdate(); + + transfer = fillDatatableTransfer(); + userSend = getUsers(); + userReceive = getUsers(); + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/TransferUpgradeBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/TransferUpgradeBean.java new file mode 100644 index 0000000..579ee72 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/TransferUpgradeBean.java @@ -0,0 +1,268 @@ +/* + * 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.web.beans.admin; + +import com.arrebol.apc.model.admin.Transfer; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.enums.ActionStatus; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.system.logs.Bitacora; +import com.arrebol.apc.model.views.EnabledUserDetailsView; +import com.arrebol.apc.model.views.TransferView; +import com.arrebol.apc.service.BitacoraService; +import com.arrebol.apc.service.GenericValidationService; +import com.arrebol.apc.service.admin.TransferService; +import com.arrebol.apc.service.views.EnabledUserDetailsViewService; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.context.FacesContext; +import javax.faces.view.ViewScoped; +import javax.inject.Inject; +import javax.inject.Named; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.primefaces.model.LazyDataModel; +import org.primefaces.model.SortOrder; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Named(value = "transferUpgradeBean") +@ViewScoped +public class TransferUpgradeBean extends GenericBean implements Serializable { + + /** + * + */ + public void addRow() { + Date date = new Date(); + if (genericValidationService.existStableSmallBoxByCreatedOn(date)) { + showMessage(FacesMessage.SEVERITY_WARN, "DĆ­a cerrado", "No se pueden agregar mĆ”s transferencias porque ya se existe un cuadre de caja chica de hoy."); + return; + } + + try { + Transfer saveTransfer = new Transfer(); + saveTransfer.setActionStatus(ActionStatus.PENDING); + saveTransfer.setActiveStatus(ActiveStatus.ENEBLED); + saveTransfer.setOffice(new Office(getLoggedUser().getOffice().getId())); + saveTransfer.setUserReceiver(new User(userReceiveId)); + saveTransfer.setUserTransmitter(new User(userSendId)); + saveTransfer.setAmountToTransfer(new BigDecimal(amountToTransfer)); + saveTransfer.setCreatedBy(getLoggedUser().getId()); + saveTransfer.setCreatedOn(new Date()); + transferService.saveTransfer(saveTransfer); + + setAmountToTransfer(""); + setUserReceiveId(""); + setUserSendId(""); + + showMessage(FacesMessage.SEVERITY_INFO, "Transferencia", "No se agrego correctamente la transferencia"); + } catch (Exception e) { + logger.error("addRow", e); + showMessage(FacesMessage.SEVERITY_ERROR, "Transferencia", "No se agrego correctamente la transferencia"); + } + + } + + /** + * + */ + public void deleteRow() { + try { + transferService.updateTransferByStatus(ActiveStatus.DISABLED, getSelectedTransfer().getId(), getLoggedUser().getUser().getId()); + + Bitacora bitacora = new Bitacora(); + bitacora.setAction("Eliminar transferencia"); + bitacora.setCommentsUser(getCommentsBitacora()); + 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Ć³ correctamente la transferencia con fecha: " + getSelectedTransfer().getStrCreatedOn() + ", con monto $" + + selectedTransfer.getAmountToTransfer()); + bitacoraService.saveBitacora(bitacora); + setSelectedTransfer(null); + setCommentsBitacora(""); + showMessage(FacesMessage.SEVERITY_INFO, "Transferencia", "Se eliminĆ³ correctamente la transferencia"); + } catch (Exception e) { + logger.error("deleteRow", e); + showMessage(FacesMessage.SEVERITY_ERROR, "Transferencia", "No se eliminĆ³ correctamente la transferencia"); + } + + } + + /** + * + */ + private void loadingLazyDataTable() { + try { + setTransfers(new LazyDataModel() { + private List lazyEntityList; + + @Override + public List load(int first, int pageSize, String sortField, SortOrder sortOrder, Map filterBy) { + try { + Long total = transferService.countPaginator(filterBy, getLoggedUser().getOffice().getId(), getStarDate(), getEndDate()); + + setRowCount(total.intValue()); + + lazyEntityList = transferService.lazyEntityListPaginator(first, pageSize, sortField, sortOrder, filterBy, getLoggedUser().getOffice().getId(), getStarDate(), getEndDate()); + + return lazyEntityList; + } catch (Exception e) { + logger.error("lazy Entity List", e); + setRowCount(0); + return new ArrayList<>(); + } + } + + @Override + public String getRowKey(TransferView row) { + return row.getId(); + } + + @Override + public TransferView getRowData(String rowKey) { + return lazyEntityList + .stream() + .filter(row -> rowKey.equals(row.getId())) + .findFirst() + .orElse(null); + } + } + ); + } catch (Exception e) { + logger.error("Lazy Data Model Customer View ", e); + } + } + + /** + * + */ + private void fillUsersComboBoxes() { + setUserSend(enabledUserDetailsViewService.findEnabledUsersByOffice(getLoggedUser().getOffice().getId())); + setUserReceive(getUserSend()); + } + + @PostConstruct + public void init() { + try { + loadBundlePropertyFile(); + initOneWeekBeforeToCurrdate(); + setLastStableSmallBox(genericValidationService.lastStableSmallBoxByDate(getLoggedUser().getUser())); + loadingLazyDataTable(); + fillUsersComboBoxes(); + } catch (Exception e) { + logger.error("TransferUpgradeBean init", e); + } + } + + final Logger logger = LogManager.getLogger(getClass()); + + @Inject + private TransferService transferService; + @Inject + private GenericValidationService genericValidationService; + @Inject + private BitacoraService bitacoraService; + @Inject + private EnabledUserDetailsViewService enabledUserDetailsViewService; + + private Date lastStableSmallBox; + private LazyDataModel transfers; + private TransferView selectedTransfer; + private String commentsBitacora; + private List userSend; + private List userReceive; + private String userSendId; + private String userReceiveId; + private String amountToTransfer; + + public Date getLastStableSmallBox() { + return lastStableSmallBox; + } + + public void setLastStableSmallBox(Date lastStableSmallBox) { + this.lastStableSmallBox = lastStableSmallBox; + } + + public LazyDataModel getTransfers() { + return transfers; + } + + public void setTransfers(LazyDataModel transfers) { + this.transfers = transfers; + } + + public TransferView getSelectedTransfer() { + return selectedTransfer; + } + + public void setSelectedTransfer(TransferView selectedTransfer) { + this.selectedTransfer = selectedTransfer; + } + + public String getCommentsBitacora() { + return commentsBitacora; + } + + public void setCommentsBitacora(String commentsBitacora) { + this.commentsBitacora = commentsBitacora; + } + + public List getUserSend() { + return userSend; + } + + public void setUserSend(List userSend) { + this.userSend = userSend; + } + + public List getUserReceive() { + return userReceive; + } + + public void setUserReceive(List userReceive) { + this.userReceive = userReceive; + } + + public String getUserSendId() { + return userSendId; + } + + public void setUserSendId(String userSendId) { + this.userSendId = userSendId; + } + + public String getUserReceiveId() { + return userReceiveId; + } + + public void setUserReceiveId(String userReceiveId) { + this.userReceiveId = userReceiveId; + } + + public String getAmountToTransfer() { + return amountToTransfer; + } + + public void setAmountToTransfer(String amountToTransfer) { + this.amountToTransfer = amountToTransfer; + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/VehicleBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/VehicleBean.java new file mode 100644 index 0000000..c69daed --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/VehicleBean.java @@ -0,0 +1,613 @@ +/* + * 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.web.beans.admin; + +import com.arrebol.apc.controller.admin.VehicleController; +import com.arrebol.apc.web.beans.system.employee.*; +import com.arrebol.apc.model.admin.Bonus; +import com.arrebol.apc.model.catalog.RoleCtlg; +import com.arrebol.apc.model.catalog.Vehicle; +import com.arrebol.apc.model.core.HumanResource; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.enums.HumanResourceStatus; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.annotation.PreDestroy; +import javax.faces.application.FacesMessage; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Named +@ViewScoped +public class VehicleBean extends GenericBean implements Serializable { + + public void saveVehicleRow() { + logger.debug("saveVehicle"); + try { + getSaveVehicle().setCreatedBy(getLoggedUser().getUser().getId()); + getSaveVehicle().setCreatedOn(new Date()); + getSaveVehicle().setVehicleStatus(ActiveStatus.ENEBLED); + getSaveVehicle().setIdDriver(getUpdateId()); + + String messafeFormat = getBundlePropertyFile().getString("message.format.failure"); + FacesMessage.Severity severity = FacesMessage.SEVERITY_WARN; + + if (getController().saveVehicle(getSaveVehicle())) { + setSaveVehicle(new Vehicle()); + + messafeFormat = getBundlePropertyFile().getString("message.format.sucess"); + severity = FacesMessage.SEVERITY_INFO; + + refreshDropBox(); + } + Object[] param = {"Vehicle", getBundlePropertyFile().getString("created")}; + + buildAndSendMessage(param, messafeFormat, severity, "Vehicle"); + } catch (Exception e) { + logger.error("saveVehicle", e); + Object[] param = {getBundlePropertyFile().getString("created")}; + + buildAndSendMessage( + param, + getBundlePropertyFile().getString("message.format.fatal"), + FacesMessage.SEVERITY_FATAL, + "Vehicle" + ); + } + } + + /** + * + * @param action 1 = TO DISABLED, 2 = TO ENEBLED, 3 = TO DELETED, 4 NOT + * ALLOWED + */ + public void actionDropBox(int action) { + logger.debug("actionDropBox"); + try { + String messageTitle = getBundlePropertyFile().getString("employee"); + String actionUserIdSelected = null; + String messageAction = null; + + HumanResourceStatus status = null; + + switch (action) { + case 1: + actionUserIdSelected = getEnebledId(); + messageAction = getBundlePropertyFile().getString("disabled"); + status = HumanResourceStatus.DISABLED; + break; + case 2: + actionUserIdSelected = getDisabledId(); + messageAction = getBundlePropertyFile().getString("enebled"); + status = HumanResourceStatus.ENEBLED; + break; + case 3: + actionUserIdSelected = getDeletedId(); + messageAction = getBundlePropertyFile().getString("deleted"); + status = HumanResourceStatus.DELETED; + break; + default: + throw new Exception(action + " is NOT valid a option"); + } + + if (executeAction(status, actionUserIdSelected, messageTitle, messageAction)) { + refreshDropBox(); + } + } catch (Exception e) { + logger.error("actionDropBox", e); + Object[] param = {getBundlePropertyFile().getString("employee")}; + + buildAndSendMessage( + param, + getBundlePropertyFile().getString("message.format.fatal"), + FacesMessage.SEVERITY_FATAL, + getBundlePropertyFile().getString("process") + ); + } + } + + public void updateSlctBtnHRAction() { +// logger.debug("updateHR"); +// try { +// getUpdateHumanResource().setLastUpdatedBy(getLoggedUser().getUser().getId()); +// getUpdateHumanResource().setLastUpdatedOn(new Date()); +// getUpdateHumanResource().setRoleCtlg(new RoleCtlg(roleUpdate)); +// +// if (getUpdateHumanResource().getEmployeeSaving() == null) { +// getUpdateHumanResource().setEmployeeSaving(BigDecimal.ZERO); +// } +// +// String messafeFormat = getBundlePropertyFile().getString("message.format.failure"); +// FacesMessage.Severity severity = FacesMessage.SEVERITY_WARN; +// +// if (null != getBonusId() && getBonusId().length() == 36) { +// getUpdateHumanResource().setBonus(new Bonus(getBonusId())); +// } +// +// if (getController().updateByHumanResourceId(getUpdateHumanResource(), false)) { +// messafeFormat = getBundlePropertyFile().getString("message.format.sucess"); +// severity = FacesMessage.SEVERITY_INFO; +// } +// +// Object[] param = {getBundlePropertyFile().getString("employee"), getBundlePropertyFile().getString("updated")}; +// +// buildAndSendMessage(param, messafeFormat, severity, getBundlePropertyFile().getString("employee")); +// } catch (Exception e) { +// logger.error("updateSlctBtnHRActionListener", e); +// Object[] param = {getBundlePropertyFile().getString("updated")}; +// +// buildAndSendMessage( +// param, +// getBundlePropertyFile().getString("message.format.fatal"), +// FacesMessage.SEVERITY_FATAL, +// getBundlePropertyFile().getString("employee") +// ); +// } + } + + public void loadVehicleToUpdate() { +// try { +// setUpdateHumanResource(getController().findHumanResourceById(getUpdateId())); +// setRoleUpdate(getUpdateHumanResource().getBonus().getId()); +// updateBonusId = getRoleUpdate(); +// } catch (Exception e) { +// logger.error("updateSlctBtnHRActionListener", e); +// Object[] param = {getBundlePropertyFile().getString("searching")}; +// +// buildAndSendMessage( +// param, +// getBundlePropertyFile().getString("message.format.fatal"), +// FacesMessage.SEVERITY_FATAL, +// getBundlePropertyFile().getString("employee") +// ); +// } + } + + /** + * + * @param option 1 = to disabled, 2 = to enebled, 4 = to updated + */ + public void enebledDisabledDropBoxListener(int option) { +// logger.debug("enebledDisabledDropBoxListener"); +// try { +// HumanResourceStatus status = HumanResourceStatus.ENEBLED; +// +// boolean goAHead = false; +// +// switch (option) { +// case 1: +// if (isEnebledHR()) { +// goAHead = isEnebledHR(); +// } else { +// setEnebledHumanResourcesLst(null); +// } +// break; +// case 2: +// if (isDisabledHR()) { +// goAHead = isDisabledHR(); +// } else { +// setDeletedHumanResourcesLst(null); +// } +// break; +// case 4: +// if (isSelectedUpdateHR()) { +// goAHead = isSelectedUpdateHR(); +// } else { +// setUpdateHumanResourcesLst(null); +// setUpdateVehicle(new Vehicle()); +// } +// break; +// } +// +// if (goAHead) { +// if (2 == option) { +// status = HumanResourceStatus.DISABLED; +// } +// +// List results = getController().findEmployeesByType( +// new Office(getLoggedUser().getOffice().getId()), +// status, +// getLoggedUser().getUser().getHumanResource().getId() +// ); +// +// switch (option) { +// case 1: +// setEnebledHumanResourcesLst(results); +// break; +// case 2: +// setDisabledHumanResourcesLst(results); +// break; +// case 4: +// setUpdateHumanResourcesLst(results); +// setUpdateHumanResource(new HumanResource()); +// break; +// } +// } +// } catch (Exception e) { +// logger.error("enebledDisabledDropBoxListener"); +// +// Object[] param = {getBundlePropertyFile().getString("searching")}; +// +// buildAndSendMessage( +// param, +// getBundlePropertyFile().getString("message.format.fatal"), +// FacesMessage.SEVERITY_FATAL, +// getBundlePropertyFile().getString("employee") +// ); +// } + } + + public void deletedHRListener() { +// try { +// if (isDeletedHR()) { +// List statusLst = new ArrayList<>(); +// +// statusLst.add(HumanResourceStatus.ENEBLED); +// statusLst.add(HumanResourceStatus.DISABLED); +// +// setDeletedHumanResourcesLst( +// getController().findEmployeesInType( +// new Office(getLoggedUser().getOffice().getId()), +// statusLst, +// getLoggedUser().getUser().getHumanResource().getId() +// ) +// ); +// } else { +// setDeletedHumanResourcesLst(null); +// } +// } catch (Exception e) { +// logger.error("deletedHRListener", e); +// Object[] param = {getBundlePropertyFile().getString("searching")}; +// +// buildAndSendMessage( +// param, +// getBundlePropertyFile().getString("message.format.fatal"), +// FacesMessage.SEVERITY_FATAL, +// getBundlePropertyFile().getString("employee") +// ); +// } + } + + /** + * + * @param status + * @param userIdSelected + * @param msgTitle + * @param msgAction + */ + private boolean executeAction(HumanResourceStatus status, String userIdSelected, String msgTitle, String msgAction) { + logger.debug("executeAction"); + + boolean success = false; + + try { + String messafeFormat = getBundlePropertyFile().getString("message.format.failure"); + FacesMessage.Severity severity = FacesMessage.SEVERITY_WARN; + + success = getController().updateHRByStatus(status, userIdSelected, getLoggedUser().getUser().getId()); + + if (success) { + logger.debug("executeAction"); + + messafeFormat = getBundlePropertyFile().getString("message.format.sucess"); + severity = FacesMessage.SEVERITY_INFO; + } + + Object[] param = {msgTitle, msgAction}; + + buildAndSendMessage(param, messafeFormat, severity, msgTitle); + } catch (Exception e) { + logger.error("executeAction", e); + Object[] param = {msgTitle}; + + buildAndSendMessage( + param, + getBundlePropertyFile().getString("message.format.fatal"), + FacesMessage.SEVERITY_FATAL, + msgTitle + ); + } + return success; + } + + private void refreshDropBox() { + try { + if (isEnebledHR()) { + enebledDisabledDropBoxListener(1); + } + if (isDisabledHR()) { + enebledDisabledDropBoxListener(2); + } + + if (isDeletedHR()) { + deletedHRListener(); + } + + if (isSelectedUpdateVehicle()) { + enebledDisabledDropBoxListener(4); + } + } catch (Exception e) { + logger.error("executeAction", e); + } + } + + private static final long serialVersionUID = 2969985354193657703L; + final Logger logger = LogManager.getLogger(EmployeeBean.class); + + private VehicleController controller; + + private Vehicle saveVehicle; + private Vehicle updateVehicle; + + private String role; + private List roles; + + private boolean selectedUpdateVehicle; + private String updateId; + + private String roleUpdate; + private List updateHumanResourcesLst; + private List typeLst; + + private boolean enebledHR; + private String enebledId; + private List enebledHumanResourcesLst; + + private boolean disabledHR; + private String disabledId; + private List disabledHumanResourcesLst; + + private boolean deletedHR; + private String deletedId; + private List deletedHumanResourcesLst; + + private String bonusId; + private List bonuses; + private String updateBonusId; + + private List vehicleType; + + @PostConstruct() + public void init() { + try { + loadBundlePropertyFile(); + setController(new VehicleController()); + setSaveVehicle(new Vehicle()); + setUpdateVehicle(new Vehicle()); + + List results = getController().findEmployeesByType( + new Office(getLoggedUser().getOffice().getId()), + HumanResourceStatus.ENEBLED, + getLoggedUser().getUser().getHumanResource().getId() + ); + + setUpdateHumanResourcesLst(results); + + vehicleType = new ArrayList<>(); + vehicleType.add("AutomĆ³vil"); + vehicleType.add("Motocicleta"); + } catch (Exception e) { + logger.error("init", e); + } + } + + @PreDestroy + public void finish() { + try { + setSaveVehicle(new Vehicle()); + setUpdateVehicle(new Vehicle()); + setController(null); + } catch (Exception e) { + logger.error("finish", e); + } + } + + public VehicleController getController() { + return controller; + } + + public void setController(VehicleController controller) { + this.controller = controller; + } + + public Vehicle getSaveVehicle() { + return saveVehicle; + } + + public void setSaveVehicle(Vehicle saveVehicle) { + this.saveVehicle = saveVehicle; + } + + public Vehicle getUpdateVehicle() { + return updateVehicle; + } + + public void setUpdateVehicle(Vehicle updateVehicle) { + this.updateVehicle = updateVehicle; + } + + public String getRole() { + return role; + } + + public void setRole(String role) { + this.role = role; + } + + public List getRoles() { + if (null == roles) { + /* + roles = Stream.of( + HumanResourceType.values()) + .map(Enum::name) + .collect(Collectors.toList() + ); + */ + } + return roles; + } + + public void setRoles(List roles) { + this.roles = roles; + } + + public boolean isSelectedUpdateVehicle() { + return selectedUpdateVehicle; + } + + public void setSelectedUpdateVehicle(boolean selectedUpdateVehicle) { + this.selectedUpdateVehicle = selectedUpdateVehicle; + } + + public String getUpdateId() { + return updateId; + } + + public void setUpdateId(String updateId) { + this.updateId = updateId; + } + + public String getRoleUpdate() { + return roleUpdate; + } + + public void setRoleUpdate(String roleUpdate) { + this.roleUpdate = roleUpdate; + } + + public List getUpdateHumanResourcesLst() { + return updateHumanResourcesLst; + } + + public void setUpdateHumanResourcesLst(List updateHumanResourcesLst) { + this.updateHumanResourcesLst = updateHumanResourcesLst; + } + + public List getTypeLst() { + return typeLst; + } + + public void setTypeLst(List typeLst) { + this.typeLst = typeLst; + } + + public boolean isEnebledHR() { + return enebledHR; + } + + public void setEnebledHR(boolean enebledHR) { + this.enebledHR = enebledHR; + } + + public String getEnebledId() { + return enebledId; + } + + public void setEnebledId(String enebledId) { + this.enebledId = enebledId; + } + + public List getEnebledHumanResourcesLst() { + return enebledHumanResourcesLst; + } + + public void setEnebledHumanResourcesLst(List enebledHumanResourcesLst) { + this.enebledHumanResourcesLst = enebledHumanResourcesLst; + } + + public boolean isDisabledHR() { + return disabledHR; + } + + public void setDisabledHR(boolean disabledHR) { + this.disabledHR = disabledHR; + } + + public String getDisabledId() { + return disabledId; + } + + public void setDisabledId(String disabledId) { + this.disabledId = disabledId; + } + + public List getDisabledHumanResourcesLst() { + return disabledHumanResourcesLst; + } + + public void setDisabledHumanResourcesLst(List disabledHumanResourcesLst) { + this.disabledHumanResourcesLst = disabledHumanResourcesLst; + } + + public boolean isDeletedHR() { + return deletedHR; + } + + public void setDeletedHR(boolean deletedHR) { + this.deletedHR = deletedHR; + } + + public String getDeletedId() { + return deletedId; + } + + public void setDeletedId(String deletedId) { + this.deletedId = deletedId; + } + + public List getDeletedHumanResourcesLst() { + return deletedHumanResourcesLst; + } + + public void setDeletedHumanResourcesLst(List deletedHumanResourcesLst) { + this.deletedHumanResourcesLst = deletedHumanResourcesLst; + } + + public String getBonusId() { + return bonusId; + } + + public void setBonusId(String bonusId) { + this.bonusId = bonusId; + } + + public List getBonuses() { + return bonuses; + } + + public void setBonuses(List bonuses) { + this.bonuses = bonuses; + } + + public String getUpdateBonusId() { + return updateBonusId; + } + + public void setUpdateBonusId(String updateBonusId) { + this.updateBonusId = updateBonusId; + } + + public List getVehicleType() { + return vehicleType; + } + + public void setVehicleType(List vehicleType) { + this.vehicleType = vehicleType; + } +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/people/PersonCustomerBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/people/PersonCustomerBean.java new file mode 100644 index 0000000..d1d919b --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/admin/people/PersonCustomerBean.java @@ -0,0 +1,648 @@ +/* + * 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.web.beans.admin.people; + +import com.arrebol.apc.model.catalog.People; +import com.arrebol.apc.model.catalog.RouteCtlg; +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.enums.CustomerClassification; +import com.arrebol.apc.model.enums.LoanDetailsType; +import com.arrebol.apc.model.enums.LoanStatus; +import com.arrebol.apc.model.enums.OwnerLoan; +import com.arrebol.apc.model.enums.PeopleType; +import com.arrebol.apc.model.loan.Loan; +import com.arrebol.apc.model.loan.LoanByUser; +import com.arrebol.apc.model.loan.LoanByUserId; +import com.arrebol.apc.model.loan.LoanDetails; +import com.arrebol.apc.model.loan.LoanType; +import com.arrebol.apc.model.system.logs.Bitacora; +import com.arrebol.apc.model.views.CustomerView; +import com.arrebol.apc.service.BitacoraService; +import com.arrebol.apc.service.admin.CustomerService; +import com.arrebol.apc.service.admin.PeopleService; +import com.arrebol.apc.service.catalog.LoanService; +import com.arrebol.apc.service.catalog.LoanTypeService; +import com.arrebol.apc.service.catalog.PeopleAutoCompleteService; +import com.arrebol.apc.service.catalog.RouteService; +import com.arrebol.apc.service.core.UserService; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.Map; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.view.ViewScoped; +import javax.inject.Inject; +import javax.inject.Named; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.primefaces.model.LazyDataModel; +import org.primefaces.model.SortOrder; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Named(value = "personCustomerBean") +@ViewScoped +public class PersonCustomerBean extends GenericBean implements Serializable { + + /** + * + * @param query + * @return + */ + public List completeCustomer(String query) { + return peopleAutoCompleteService.findCustomersLike(query.trim()); + } + + /** + * + * @param query + * @return + */ + public List completeEndorsement(String query) { + return peopleAutoCompleteService.findEndorsementsLike(query.trim()); + } + + /** + * + */ + public void changeRoute() { + if (!getRouteId().isEmpty()) { + if (customerService.updateRouteById(new RouteCtlg(getRouteId()), getSelectedCustomerView().getId(), getLoggedUser().getUser().getId())) { + showMessage(FacesMessage.SEVERITY_INFO, "Cliente", "Se modificĆ³ la ruta del cliente correctamente."); + } else { + showMessage(FacesMessage.SEVERITY_WARN, "Cliente", "OcurriĆ³ un error durante el proceso de modificacipon de la ruta del cliente."); + } + } + } + + /** + * + */ + public void deleteRow() { + try { + customerService.updatePeopleByStatus(ActiveStatus.DISABLED, getSelectedCustomerView().getId(), getLoggedUser().getUser().getId()); + + setSelectedCustomerView(null); + showMessage(FacesMessage.SEVERITY_INFO, "Cliente", "Se eliminĆ³ correctamente."); + } catch (Exception e) { + showMessage(FacesMessage.SEVERITY_ERROR, "Cliente", "No se eliminĆ³ correctamente."); + } + } + + /** + * + */ + public void updatePeopleTypeById() { + if (getSelectedCustomerView().getPeopleType().equals(PeopleType.BOTH)) { + showMessage(FacesMessage.SEVERITY_WARN, "Advertencia", "El cliente ya se encuentra como Aval."); + return; + } + try { + customerService.updatePeopleTypeById(PeopleType.BOTH, getSelectedCustomerView().getId(), getLoggedUser().getUser().getId()); + setSelectedCustomerView(null); + // TODO cargar de nuevo el lazy data model para poder actualizar la datatable + showMessage(FacesMessage.SEVERITY_INFO, "Cliente", "Se modificĆ³ correctamente."); + } catch (Exception e) { + logger.error("updatePeopleTypeById", e); + showMessage(FacesMessage.SEVERITY_INFO, "Cliente", "No se modificĆ³ correctamente."); + } + } + + /** + * + * @param outcome + * @return + */ + public String detailCustomer(String outcome) { + return outcome; + } + + /** + * + */ + public void calculationFunction() { + if (loanTypeId != null && !loanTypeId.isEmpty()) { + total = loanTypeService.getLoanTypeById(loanTypeId).getPaymentTotal().add(totalFee).subtract(totalPayment); + } else { + total = BigDecimal.ZERO; + } + } + + /** + * + */ + public void addRow() { + try { + Loan loanSave = new Loan(); + loanSave.setComments(getComments()); + loanSave.setCustomer(getAutoCompleteCustomer()); + loanSave.setEndorsement(getAutoCompleteEndorsement()); + loanSave.setLoanType(new LoanType(getLoanTypeId())); + if (isAprobado()) { + loanSave.setLoanStatus(LoanStatus.APPROVED); + } else if (isTerminado()) { + loanSave.setLoanStatus(LoanStatus.FINISH); + } else { + loanSave.setLoanStatus(LoanStatus.PENDING); + } + loanSave.setAmountPaid(getTotalPayment()); + loanSave.setRouteCtlg(peopleService.findPeopleById(getAutoCompleteCustomer().getId()).getRouteCtlg()); + if (getTotalPayment().compareTo(BigDecimal.ZERO) == 0 && getTotalFee().compareTo(BigDecimal.ZERO) == 0) { + loanSave.setLastReferenceNumber(0); + } + if (getTotalPayment().compareTo(BigDecimal.ZERO) > 0 && getTotalFee().compareTo(BigDecimal.ZERO) == 0) { + loanSave.setLastReferenceNumber(1); + } + if (getTotalPayment().compareTo(BigDecimal.ZERO) == 0 && getTotalFee().compareTo(BigDecimal.ZERO) > 0) { + loanSave.setLastReferenceNumber(1); + } + if (getTotalPayment().compareTo(BigDecimal.ZERO) > 0 && getTotalFee().compareTo(BigDecimal.ZERO) > 0) { + loanSave.setLastReferenceNumber(2); + } + loanSave.setAmountToPay(loanTypeService.getLoanTypeById(getLoanTypeId()).getPaymentTotal().add(getTotalFee())); + loanSave.setCreatedBy(getUserId()); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(getCreatedOn()); + calendar.set(Calendar.HOUR_OF_DAY, 12); + calendar.set(Calendar.MINUTE, 0); + calendar.set(Calendar.SECOND, 0); + calendar.set(Calendar.MILLISECOND, 0); + loanSave.setCreatedOn(new Date()); + loanSave.setLastUpdatedOn(new Date()); + + if (loanService.saveLoan(loanSave)) { + Loan temp = loanService.getLoanById(loanSave.getId()); + String userName = ""; + for (User user : getUsers()) { + if (user.getId().equalsIgnoreCase(getUserId())) { + userName = user.getHumanResource().getFirstName() + " " + + user.getHumanResource().getLastName(); + break; + } + } + Calendar fechaAct = Calendar.getInstance(); + if (fechaAct.before(calendar)) { + Bitacora bitacora = new Bitacora(); + bitacora.setAction("PrĆ©stamo 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() + + ", con cantidad de $" + temp.getLoanType().getPayment() + " al dĆ­a " + temp.getCreatedOn()); + bitacora.setNameUser(getLoggedUser().getUser().getUserName()); + bitacora.setOffice(new Office(getLoggedUser().getOffice().getId())); + bitacoraService.saveBitacora(bitacora); + } + + LoanByUser loanByUser = new LoanByUser(); + LoanByUserId idRelation = new LoanByUserId(); + + idRelation.setIdLoan(loanSave.getId()); + idRelation.setIdUser(getUserId()); + + loanByUser.setId(idRelation); + loanByUser.setComments(getComments()); + loanByUser.setCreatedBy(getLoggedUser().getUser().getId()); + if (isAprobado()) { + loanByUser.setLoanByUserStatus(LoanStatus.APPROVED); + } else if (isTerminado()) { + loanByUser.setLoanByUserStatus(LoanStatus.FINISH); + } else { + loanByUser.setLoanByUserStatus(LoanStatus.PENDING); + } + loanByUser.setLoan(loanSave); + loanByUser.setOrderInList(0); + loanByUser.setOwnerLoan(OwnerLoan.CURRENT_OWNER); + loanByUser.setUser(new User(getUserId())); + loanService.saveLoanByUser(loanByUser); + + int contador = 1; + if (getTotalPayment().compareTo(BigDecimal.ZERO) > 0) { + LoanDetails detail = new LoanDetails(); + detail.setComments(getComments()); + detail.setCreatedBy(getLoggedUser().getUser().getId()); + detail.setCreatedOn(getCreatedOn()); + detail.setLoan(loanSave); + detail.setLoanDetailsType(LoanDetailsType.PAYMENT); + detail.setPaymentAmount(getTotalPayment()); + detail.setPeopleType(PeopleType.CUSTOMER); + detail.setReferenceNumber(contador); + detail.setUser(new User(getUserId())); + if (loanService.saveLoanDetail(detail)) { + contador++; + } + } + if (getTotalFee().compareTo(BigDecimal.ZERO) > 0) { + LoanDetails detail = new LoanDetails(); + detail.setComments(getComments()); + detail.setCreatedBy(getLoggedUser().getUser().getId()); + detail.setCreatedOn(getCreatedOn()); + detail.setLoan(loanSave); + detail.setLoanDetailsType(LoanDetailsType.FEE); + detail.setPaymentAmount(getTotalFee()); + detail.setPeopleType(PeopleType.CUSTOMER); + detail.setReferenceNumber(contador); + detail.setUser(new User(getUserId())); + if (loanService.saveLoanDetail(detail)) { + contador++; + } + } + + } + //loan.clear(); + setCreatedOn(new Date()); + setComments(""); + //customerId = ""; + //endorsementId = ""; + setLoanTypeId(""); + setUserId(""); + setTotal(BigDecimal.ZERO); + setTotalFee(BigDecimal.ZERO); + setTotalPayment(BigDecimal.ZERO); + setAprobado(false); + setTerminado(false); + setAutoCompleteCustomer(null); + setAutoCompleteEndorsement(null); + //loan = fillDatatableLoan(); + showMessage(FacesMessage.SEVERITY_INFO, "Cliente", "Se agrego el prestamo al cliente correctamente."); + } catch (Exception e) { + logger.error("", e); + + showMessage(FacesMessage.SEVERITY_INFO, "Cliente", "No se agrego el nuevo prestamos al cliente."); + } + } + + /** + * + */ + public void addPeople() { + try { + logger.debug("addPeople"); + + getSavePeople().setCreatedBy(getLoggedUser().getUser().getId()); + getSavePeople().setOffice(new Office(getLoggedUser().getOffice().getId())); + getSavePeople().setActiveStatus(ActiveStatus.ENEBLED); + getSavePeople().setRouteCtlg(new RouteCtlg(routeId)); + getSavePeople().setThumbnail(""); + getSavePeople().setClassification(CustomerClassification.WHITE); + + if (isCustomer() == true && isEndorsement() == false) { + getSavePeople().setPeopleType(PeopleType.CUSTOMER); + } + if (isCustomer() == true && isEndorsement() == true) { + getSavePeople().setPeopleType(PeopleType.BOTH); + } + if (isCustomer() == false && isEndorsement() == true) { + getSavePeople().setPeopleType(PeopleType.ENDORSEMENT); + } + if (isCustomer() == false && isEndorsement() == false) { + getSavePeople().setPeopleType(PeopleType.BOTH); + } + + String messafeFormat = getBundlePropertyFile().getString("message.format.failure"); + FacesMessage.Severity severity = FacesMessage.SEVERITY_WARN; + + if (peopleService.savePeople(getSavePeople())) { + setSavePeople(new People()); + setCustomer(false); + setEndorsement(false); + messafeFormat = getBundlePropertyFile().getString("message.format.sucess"); + severity = FacesMessage.SEVERITY_INFO; + } + + Object[] param = {getBundlePropertyFile().getString("people"), getBundlePropertyFile().getString("created")}; + + buildAndSendMessage(param, messafeFormat, severity, getBundlePropertyFile().getString("people")); + + } catch (Exception e) { + logger.error("savePeople", e); + Object[] param = {getBundlePropertyFile().getString("created")}; + + buildAndSendMessage( + param, + getBundlePropertyFile().getString("message.format.fatal"), + FacesMessage.SEVERITY_FATAL, + getBundlePropertyFile().getString("people") + ); + } + } + + /** + * + */ + private void loadingLazyDataTable() { + try { + setCustomerViews(new LazyDataModel() { + private List lazyEntityList; + + @Override + public List load(int first, int pageSize, String sortField, SortOrder sortOrder, Map filterBy) { + try { + Long total = customerService.countPaginator(filterBy); + + setRowCount(total.intValue()); + + lazyEntityList = customerService.lazyEntityListPaginator(first, pageSize, sortField, sortOrder, filterBy); + + return lazyEntityList; + } catch (Exception e) { + logger.error("lazy Entity List", e); + setRowCount(0); + return new ArrayList<>(); + } + } + + @Override + public String getRowKey(CustomerView row) { + return row.getId(); + } + + @Override + public CustomerView getRowData(String rowKey) { + return lazyEntityList + .stream() + .filter(row -> rowKey.equals(row.getId())) + .findFirst() + .orElse(null); + } + } + ); + } catch (Exception e) { + logger.error("Lazy Data Model Customer View ", e); + } + } + + public void CustomerClassification(String colorClassification) + { + try { + customerService.updatePeopleByClassification( CustomerClassification.valueOf(colorClassification), getSelectedCustomerView().getId(), getLoggedUser().getUser().getId()); + + setSelectedCustomerView(null); + showMessage(FacesMessage.SEVERITY_INFO, "Cliente", "Se clasificĆ³ correctamente."); + } catch (Exception e) { + showMessage(FacesMessage.SEVERITY_ERROR, "Cliente", "No se clasificĆ³ correctamente."); + } + } + + @PostConstruct + public void init() { + try { + loadBundlePropertyFile(); + loadingLazyDataTable(); + setRoutes(routeService.fillRoutesDatatable(getLoggedUser().getOffice().getId())); + setLoanType(loanTypeService.fillLoanTypeDatatable(getLoggedUser().getOffice().getId())); + setUsers(userService.getAllUsersByOffice(getLoggedUser().getOffice().getId())); + setTotalPayment(BigDecimal.ZERO); + setTotalFee(BigDecimal.ZERO); + setTotal(BigDecimal.ZERO); + setSavePeople(new People()); + } catch (Exception e) { + logger.error("PersonCustomerBean init", e); + } + } + + final Logger logger = LogManager.getLogger(getClass()); + + @Inject + private CustomerService customerService; + @Inject + private PeopleService peopleService; + @Inject + private RouteService routeService; + @Inject + private LoanTypeService loanTypeService; + @Inject + private LoanService loanService; + @Inject + private BitacoraService bitacoraService; + @Inject + private UserService userService; + @Inject + private PeopleAutoCompleteService peopleAutoCompleteService; + + private LazyDataModel customerViews; + private CustomerView selectedCustomerView; + private List customers; + private List routes; + private String routeId; + private String comments; + + private People autoCompleteCustomer; + private People autoCompleteEndorsement; + private People savePeople; + private List loanType; + private List users; + + private String customerId; + private String endorsementId; + private String loanTypeId; + private String userId; + + private Date createdOn; + private BigDecimal totalPayment; + private BigDecimal totalFee; + private BigDecimal total; + private boolean aprobado; + private boolean terminado; + boolean customer; + boolean endorsement; + + public LazyDataModel getCustomerViews() { + return customerViews; + } + + public void setCustomerViews(LazyDataModel customerViews) { + this.customerViews = customerViews; + } + + public CustomerView getSelectedCustomerView() { + return selectedCustomerView; + } + + public void setSelectedCustomerView(CustomerView selectedCustomerView) { + this.selectedCustomerView = selectedCustomerView; + } + + public List getCustomers() { + return customers; + } + + public void setCustomers(List customers) { + this.customers = customers; + } + + public List getRoutes() { + return routes; + } + + public void setRoutes(List routes) { + this.routes = routes; + } + + public String getRouteId() { + return routeId; + } + + public void setRouteId(String routeId) { + this.routeId = routeId; + } + + public String getComments() { + return comments; + } + + public void setComments(String comments) { + this.comments = comments; + } + + public List getLoanType() { + return loanType; + } + + public void setLoanType(List loanType) { + this.loanType = loanType; + } + + public List getUsers() { + return users; + } + + public void setUsers(List users) { + this.users = users; + } + + public String getCustomerId() { + return customerId; + } + + public void setCustomerId(String customerId) { + this.customerId = customerId; + } + + public String getEndorsementId() { + return endorsementId; + } + + public void setEndorsementId(String endorsementId) { + this.endorsementId = endorsementId; + } + + public String getLoanTypeId() { + return loanTypeId; + } + + public void setLoanTypeId(String loanTypeId) { + this.loanTypeId = loanTypeId; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public Date getCreatedOn() { + return createdOn; + } + + public void setCreatedOn(Date createdOn) { + this.createdOn = createdOn; + } + + public BigDecimal getTotalPayment() { + return totalPayment; + } + + public void setTotalPayment(BigDecimal totalPayment) { + this.totalPayment = totalPayment; + } + + public BigDecimal getTotalFee() { + return totalFee; + } + + public void setTotalFee(BigDecimal totalFee) { + this.totalFee = totalFee; + } + + public BigDecimal getTotal() { + return total; + } + + public void setTotal(BigDecimal total) { + this.total = total; + } + + public boolean isAprobado() { + return aprobado; + } + + public void setAprobado(boolean aprobado) { + this.aprobado = aprobado; + } + + public boolean isTerminado() { + return terminado; + } + + public void setTerminado(boolean terminado) { + this.terminado = terminado; + } + + public People getAutoCompleteCustomer() { + return autoCompleteCustomer; + } + + public void setAutoCompleteCustomer(People autoCompleteCustomer) { + this.autoCompleteCustomer = autoCompleteCustomer; + } + + public People getAutoCompleteEndorsement() { + return autoCompleteEndorsement; + } + + public void setAutoCompleteEndorsement(People autoCompleteEndorsement) { + this.autoCompleteEndorsement = autoCompleteEndorsement; + } + + public People getSavePeople() { + return savePeople; + } + + public void setSavePeople(People savePeople) { + this.savePeople = savePeople; + } + + public boolean isCustomer() { + return customer; + } + + public void setCustomer(boolean customer) { + this.customer = customer; + } + + public boolean isEndorsement() { + return endorsement; + } + + public void setEndorsement(boolean endorsement) { + this.endorsement = endorsement; + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/catalog/LoanTypeBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/catalog/LoanTypeBean.java new file mode 100644 index 0000000..339bcd5 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/catalog/LoanTypeBean.java @@ -0,0 +1,293 @@ +/* + * 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.web.beans.catalog; + +import com.arrebol.apc.controller.catalog.LoanTypeController; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.enums.DaysInWeekend; +import com.arrebol.apc.model.loan.LoanType; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Named("loanTypeManager") +@ViewScoped +public class LoanTypeBean extends GenericBean implements Serializable, Datatable{ + + public List fillDatatableLoanType() { + + return loanTypeCtrl.fillLoanTypeDatatable(getLoggedUser().getOffice().getId()); + } + + @Override + public void editRow(RowEditEvent event) { + LoanType loanType = (LoanType) event.getObject(); + if (loanType != null) { + loanTypeCtrl.updateByLoanTypeId(loanType); + showMessage(FacesMessage.SEVERITY_INFO, "Registro Editado", "Se hizo el cambio correctamente."); + } + } + + @Override + public void onRowCancel(RowEditEvent event) { + showMessage(FacesMessage.SEVERITY_INFO, "EdiciĆ³n Cancelada", ((LoanType) event.getObject()).getLoanTypeName()); + } + + @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() { + try + { + logger.debug("addRowLoanType"); + getSaveLoanType().setCreatedBy(getLoggedUser().getUser().getId()); + getSaveLoanType().setOffice(new Office(getLoggedUser().getOffice().getId())); + BigDecimal total = getSaveLoanType().getPaymentDaily().multiply(new BigDecimal(getSaveLoanType().getTotalDays())); + getSaveLoanType().setPaymentTotal(total); + + if(isMonday() == true) + getSaveLoanType().setMonday(DaysInWeekend.MONDAY); + else + getSaveLoanType().setMonday(null); + + if(isTuesday()== true) + getSaveLoanType().setTuesday(DaysInWeekend.TUESDAY); + else + getSaveLoanType().setTuesday(null); + + if(isWednesday()== true) + getSaveLoanType().setWednesday(DaysInWeekend.WEDNESDAY); + else + getSaveLoanType().setWednesday(null); + + if(isThrusday()== true) + getSaveLoanType().setThursday(DaysInWeekend.THURSDAY); + else + getSaveLoanType().setThursday(null); + + if(isFriday()== true) + getSaveLoanType().setFriday(DaysInWeekend.FRIDAY); + else + getSaveLoanType().setFriday(null); + + if(isSaturday()== true) + getSaveLoanType().setSaturday(DaysInWeekend.SATURDAY); + else + getSaveLoanType().setSaturday(null); + + if(isSunday()== true) + getSaveLoanType().setSunday(DaysInWeekend.SUNDAY); + else + getSaveLoanType().setSunday(null); + + if(isConvenio()== true) + getSaveLoanType().setConvenio(ActiveStatus.ENEBLED); + else + getSaveLoanType().setConvenio(ActiveStatus.DISABLED); + + String messafeFormat = getBundlePropertyFile().getString("message.format.failure"); + FacesMessage.Severity severity = FacesMessage.SEVERITY_WARN; + + if(getLoanTypeCtrl().saveLoanType(getSaveLoanType())){ + setSaveLoanType(new LoanType()); + messafeFormat = getBundlePropertyFile().getString("message.format.sucess"); + severity = FacesMessage.SEVERITY_INFO; + } + + Object[] param = {getBundlePropertyFile().getString("loanType"), getBundlePropertyFile().getString("created")}; + + buildAndSendMessage(param, messafeFormat, severity, getBundlePropertyFile().getString("loanType")); + + }catch(Exception e) + { + logger.error("saveLoanType", e); + Object[] param = {getBundlePropertyFile().getString("created")}; + + buildAndSendMessage( + param, + getBundlePropertyFile().getString("message.format.fatal"), + FacesMessage.SEVERITY_FATAL, + getBundlePropertyFile().getString("loanType") + ); + } + } + + @Override + public void deleteRow() { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + public LoanTypeController getLoanTypeCtrl() { + return loanTypeCtrl; + } + + public void setLoanTypeCtrl(LoanTypeController loanTypeCtrl) { + this.loanTypeCtrl = loanTypeCtrl; + } + + public List getLoanType() { + return loanType; + } + + public void setLoanType(List loanType) { + this.loanType = loanType; + } + + public LoanType getSelectedLoanType() { + return selectedLoanType; + } + + public void setSelectedLoanType(LoanType selectedLoanType) { + this.selectedLoanType = selectedLoanType; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public LoanType getSaveLoanType() { + return saveLoanType; + } + + public void setSaveLoanType(LoanType saveLoanType) { + this.saveLoanType = saveLoanType; + } + + public boolean isMonday() { + return monday; + } + + public void setMonday(boolean monday) { + this.monday = monday; + } + + public boolean isTuesday() { + return tuesday; + } + + public void setTuesday(boolean tuesday) { + this.tuesday = tuesday; + } + + public boolean isWednesday() { + return wednesday; + } + + public void setWednesday(boolean wednesday) { + this.wednesday = wednesday; + } + + public boolean isThrusday() { + return thrusday; + } + + public void setThrusday(boolean thrusday) { + this.thrusday = thrusday; + } + + public boolean isFriday() { + return friday; + } + + public void setFriday(boolean friday) { + this.friday = friday; + } + + public boolean isSaturday() { + return saturday; + } + + public void setSaturday(boolean saturday) { + this.saturday = saturday; + } + + public boolean isSunday() { + return sunday; + } + + public void setSunday(boolean sunday) { + this.sunday = sunday; + } + + public boolean isConvenio() { + return convenio; + } + + public void setConvenio(boolean convenio) { + this.convenio = convenio; + } + + private LoanTypeController loanTypeCtrl; + + private List loanType; + + private LoanType selectedLoanType; + + private LoanType saveLoanType; + + private String id; + private String name; + + final Logger logger = LogManager.getLogger(LoanTypeBean.class); + + boolean monday; + boolean tuesday; + boolean wednesday; + boolean thrusday; + boolean friday; + boolean saturday; + boolean sunday; + boolean convenio; + + @PostConstruct + public void init() { + loadBundlePropertyFile(); + loanTypeCtrl = new LoanTypeController(); + setSaveLoanType(new LoanType()); + loanType = fillDatatableLoanType(); + monday = false; + tuesday = false; + wednesday = false; + thrusday = false; + friday = false; + saturday = false; + sunday = false; + convenio = false; + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/catalog/RoleBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/catalog/RoleBean.java new file mode 100644 index 0000000..21624f7 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/catalog/RoleBean.java @@ -0,0 +1,132 @@ +/* + * 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.web.beans.catalog; + +import com.arrebol.apc.controller.catalog.RoleController; +import com.arrebol.apc.model.catalog.RoleCtlg; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.context.FacesContext; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Named("roleManager") +@ViewScoped +public class RoleBean extends GenericBean implements Serializable, Datatable { + + public List fillDatatableRole() { + + return roleCtrl.fillRolesDatatable(); + } + + @Override + public void editRow(RowEditEvent event) { + RoleCtlg role = (RoleCtlg) event.getObject(); + if (role != null) { + roleCtrl.updateByRoleId(role); + showMessage(FacesMessage.SEVERITY_INFO, "Registro Editado", "Se hizo el cambio correctamente."); + } + } + + @Override + public void addRow() { + RoleCtlg roleObj = new RoleCtlg(); + roleObj.setRole(name); + roleObj.setActiveStatus(ActiveStatus.ENEBLED); + roleObj.setCreatedBy(getLoggedUser().getUser().getId()); + + roleCtrl.saveRoles(roleObj); + role.add(roleObj); + FacesMessage msg = new FacesMessage("Nuevo puesto", "Se agregĆ³ correctamente"); + FacesContext.getCurrentInstance().addMessage(null, msg); + } + + @Override + public void deleteRow() { + roleCtrl.updateRoleByStatus(ActiveStatus.DISABLED, selectedRole.getId(), getLoggedUser().getUser().getId()); + role.remove(selectedRole); + selectedRole = null; + showMessage(FacesMessage.SEVERITY_INFO, "Puesto Eliminado", "Se eliminĆ³ correctamente."); + } + + @Override + public void onRowCancel(RowEditEvent event) { + showMessage(FacesMessage.SEVERITY_INFO, "EdiciĆ³n Cancelada", ((RoleCtlg) event.getObject()).getRole()); + } + + @Override + public void onRowReorder(ReorderEvent event) { + showMessage(FacesMessage.SEVERITY_INFO, "Registro Movido", "De columna: " + (event.getFromIndex() + 1) + " a columna: " + (event.getToIndex() + 1)); + } + + public RoleController getRoleCtrl() { + return roleCtrl; + } + + public void setRoleCtrl(RoleController roleCtrl) { + this.roleCtrl = roleCtrl; + } + + public List getRole() { + return role; + } + + public void setRole(List role) { + this.role = role; + } + + public RoleCtlg getSelectedRole() { + return selectedRole; + } + + public void setSelectedRole(RoleCtlg selectedRole) { + this.selectedRole = selectedRole; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + private RoleController roleCtrl; + + private List role; + + private RoleCtlg selectedRole; + + private String id; + private String name; + + @PostConstruct + public void init() { + roleCtrl = new RoleController(); + role = fillDatatableRole(); + } +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/catalog/RouteBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/catalog/RouteBean.java new file mode 100644 index 0000000..92394c5 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/catalog/RouteBean.java @@ -0,0 +1,135 @@ +/* + * 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.web.beans.catalog; + +import com.arrebol.apc.controller.catalog.RouteController; +import com.arrebol.apc.model.catalog.RouteCtlg; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.context.FacesContext; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Named("routeManager") +@ViewScoped +public class RouteBean extends GenericBean implements Serializable, Datatable{ + + public List fillDatatableRoute() { + + return routeCtrl.fillRoutesDatatable(getLoggedUser().getOffice().getId()); + } + + @Override + public void editRow(RowEditEvent event) { + RouteCtlg route = (RouteCtlg) event.getObject(); + if (route != null) { + routeCtrl.updateByRouteId(route); + showMessage(FacesMessage.SEVERITY_INFO, "Registro Editado", "Se hizo el cambio correctamente."); + } + } + + @Override + public void onRowCancel(RowEditEvent event) { + showMessage(FacesMessage.SEVERITY_INFO, "EdiciĆ³n Cancelada", ((RouteCtlg) event.getObject()).getRoute()); + } + + @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() { + RouteCtlg routeObj = new RouteCtlg(); + routeObj.setRoute(name); + routeObj.setOffice(new Office(getLoggedUser().getOffice().getId())); + routeObj.setActiveStatus(ActiveStatus.ENEBLED); + routeObj.setCreatedBy(getLoggedUser().getUser().getId()); + + routeCtrl.saveRoute(routeObj); + route.add(routeObj); + FacesMessage msg = new FacesMessage("Nueva ruta", "Se agregĆ³ correctamente"); + FacesContext.getCurrentInstance().addMessage(null, msg); + } + + @Override + public void deleteRow() { + routeCtrl.updateRouteByStatus(ActiveStatus.DISABLED, selectedRoute.getId(), getLoggedUser().getUser().getId()); + route.remove(selectedRoute); + selectedRoute = null; + showMessage(FacesMessage.SEVERITY_INFO, "Ruta Eliminada", "Se eliminĆ³ correctamente."); + } + + public RouteController getRouteCtrl() { + return routeCtrl; + } + + public void setRouteCtrl(RouteController routeCtrl) { + this.routeCtrl = routeCtrl; + } + + public List getRoute() { + return route; + } + + public void setRoute(List route) { + this.route = route; + } + + public RouteCtlg getSelectedRoute() { + return selectedRoute; + } + + public void setSelectedRoute(RouteCtlg selectedRoute) { + this.selectedRoute = selectedRoute; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + private RouteController routeCtrl; + + private List route; + + private RouteCtlg selectedRoute; + + private String id; + private String name; + + @PostConstruct + public void init() { + routeCtrl = new RouteController(); + route = fillDatatableRoute(); + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/dashboard/CustomerWithoutLoanDetailBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/dashboard/CustomerWithoutLoanDetailBean.java new file mode 100644 index 0000000..1600091 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/dashboard/CustomerWithoutLoanDetailBean.java @@ -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.web.beans.dashboard; + +import com.arrebol.apc.controller.admin.CustomerController; +import com.arrebol.apc.controller.admin.LoanController; +import com.arrebol.apc.model.catalog.People; +import com.arrebol.apc.model.loan.Loan; +import com.arrebol.apc.model.loan.LoanDetails; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Named(value = "customerWithoutLoanDetailManager") +@ViewScoped +public class CustomerWithoutLoanDetailBean extends GenericBean implements Serializable, Datatable { + + public List getDetails(String id) { + try { + loanDetails = loanCtrl.getLoanDetailsbyId(id); + + } catch (Exception e) { + } + return null == loanDetails ? new ArrayList<>() : loanDetails; + } + + public People getCustomerDetail(String peopleId) { + return customerCtrl.findPeopleById(peopleId); + } + + public List getLoanByPeople(String peopleId) { + return customerCtrl.findLoanByCustomer(peopleId); + } + + public void editPeople() { + if (customer.getBirthdate() == null) { + showMessage(FacesMessage.SEVERITY_FATAL, "Campo obligatorio", "La fecha de cumpleaƱos es obligatoria"); + return; + } + if (customer.getFirstName() == null) { + showMessage(FacesMessage.SEVERITY_FATAL, "Campo obligatorio", "El primer nombre es obligatoria"); + return; + } + if (customer.getLastName() == null) { + showMessage(FacesMessage.SEVERITY_FATAL, "Campo obligatorio", "El apellido paterno es obligatoria"); + return; + } + if (customer.getMiddleName() == null) { + showMessage(FacesMessage.SEVERITY_FATAL, "Campo obligatorio", "El apellido materno es obligatoria"); + return; + } + if (customer.getPhoneHome() == null) { + showMessage(FacesMessage.SEVERITY_FATAL, "Campo obligatorio", "El telĆ©fono de casa es obligatoria"); + return; + } + if (customer.getAddressHome() == null) { + showMessage(FacesMessage.SEVERITY_FATAL, "Campo obligatorio", "El domicilio personal es obligatoria"); + return; + } + if (customerCtrl.updateByPeopleId(customer)) { + showMessage(FacesMessage.SEVERITY_INFO, "Cliente modificado", "Se modificĆ³ correctamente."); + } + } + + @Override + public void editRow(RowEditEvent event) { + + } + + @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 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. + } + + public CustomerController getCustomerCtrl() { + return customerCtrl; + } + + public void setCustomerCtrl(CustomerController customerCtrl) { + this.customerCtrl = customerCtrl; + } + + public People getCustomer() { + return customer; + } + + public void setCustomer(People customer) { + this.customer = customer; + } + + public String getCustomerId() { + return customerId; + } + + public void setCustomerId(String customerId) { + this.customerId = customerId; + } + + public List getLoan() { + return loan; + } + + public void setLoan(List loan) { + this.loan = loan; + } + + public LoanController getLoanCtrl() { + return loanCtrl; + } + + public void setLoanCtrl(LoanController loanCtrl) { + this.loanCtrl = loanCtrl; + } + + public List getLoanDetails() { + return loanDetails; + } + + public void setLoanDetails(List loanDetails) { + this.loanDetails = loanDetails; + } + + private CustomerController customerCtrl; + private LoanController loanCtrl; + private People customer; + private String customerId; + private List loan; + private List loanDetails; + + @PostConstruct + public void init() { + customerCtrl = new CustomerController(); + loanCtrl = new LoanController(); + setCustomerId(externalContext().getRequestParameterMap().get("selectedId")); + customer = getCustomerDetail(getCustomerId()); + loan = getLoanByPeople(getCustomerId()); + + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/dashboard/DashboardBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/dashboard/DashboardBean.java new file mode 100644 index 0000000..50482c9 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/dashboard/DashboardBean.java @@ -0,0 +1,1483 @@ +/* + * 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.web.beans.dashboard; + +import com.arrebol.apc.controller.BitacoraController; +import com.arrebol.apc.controller.GenericController; +import com.arrebol.apc.controller.GenericValidationController; +import com.arrebol.apc.controller.admin.ClosingDayController; +import com.arrebol.apc.controller.admin.CustomerController; +import com.arrebol.apc.controller.admin.EndorsementController; +import com.arrebol.apc.controller.admin.LoanController; +import com.arrebol.apc.controller.catalog.LoanTypeController; +import com.arrebol.apc.controller.catalog.RouteController; +import com.arrebol.apc.controller.dashboard.CustomerWithoutRenovationViewService; +import com.arrebol.apc.controller.dashboard.DashboardController; +import com.arrebol.apc.model.catalog.People; +import com.arrebol.apc.model.catalog.RouteCtlg; +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.enums.CustomerClassification; +import com.arrebol.apc.model.enums.FeeStatus; +import com.arrebol.apc.model.enums.LoanDetailsType; +import com.arrebol.apc.model.enums.LoanStatus; +import com.arrebol.apc.model.enums.OwnerLoan; +import com.arrebol.apc.model.enums.PeopleType; +import com.arrebol.apc.model.enums.TransferStatus; +import com.arrebol.apc.model.enums.UserType; +import com.arrebol.apc.model.loan.Loan; +import com.arrebol.apc.model.loan.LoanByUser; +import com.arrebol.apc.model.loan.LoanByUserId; +import com.arrebol.apc.model.views.LoanDetailZeroView; +import com.arrebol.apc.model.loan.LoanDetails; +import com.arrebol.apc.model.loan.LoanFeeNotification; +import com.arrebol.apc.model.loan.LoanType; +import com.arrebol.apc.model.payroll.TotalExpectedPaymentDailyByUser; +import com.arrebol.apc.model.system.logs.Bitacora; +import com.arrebol.apc.model.views.AdvanceUserDailyDetail; +import com.arrebol.apc.model.views.AdvanceUserDailyView; +import com.arrebol.apc.model.views.CustomerWithoutRenovationView; +import com.arrebol.apc.model.views.LoanFinishedView; +import com.arrebol.apc.model.views.TotalCashByCurdateDashboardView; +import com.arrebol.apc.model.views.TotalClosingDayByCurdateView; +import com.arrebol.apc.service.admin.CustomerService; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.math.RoundingMode; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.Map; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.view.ViewScoped; +import javax.inject.Inject; +import javax.inject.Named; +import org.primefaces.model.LazyDataModel; +import org.primefaces.model.SortOrder; +import org.primefaces.model.chart.BarChartModel; +import org.primefaces.model.chart.PieChartModel; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Named(value = "dashboardManager") +@ViewScoped +public class DashboardBean extends GenericBean implements Serializable { + + public String detailCustomer(String outcome) { + return outcome; + } + + public void deleteFeeLoan() { + + if (selectedLoan.getLoanStatus() == LoanStatus.APPROVED || selectedLoan.getLoanStatus() == LoanStatus.PENDING_RENOVATION) { + + List details = loanCtrl.getLoanDetailsFeeCurdatebyIdLoan(selectedLoan.getId()); + if (details != null && !details.isEmpty()) { + Loan loanUpdate = loanCtrl.getLoanById(selectedLoan.getId()); + Bitacora bitacora = new Bitacora(); + bitacora.setAction("Eliminar multa"); + bitacora.setCommentsUser(commentsBitacora); + bitacora.setCreatedBy(getLoggedUser().getUser().getId()); + bitacora.setCreatedOn(new Date()); + bitacora.setNameUser(getLoggedUser().getUser().getUserName()); + bitacora.setOffice(new Office(getLoggedUser().getOffice().getId())); + BigDecimal tempMonto = BigDecimal.ZERO; + for (LoanDetails detail : details) { + loanUpdate.setAmountToPay(loanUpdate.getAmountToPay().subtract(detail.getPaymentAmount())); + tempMonto = tempMonto.add(detail.getPaymentAmount()); + } + bitacora.setDescription("El prĆ©stamo del cliente " + loanUpdate.getCustomer().getFullName() + " del asesor " + loanUpdate.getAsesor() + " con monto a prestar de $" + loanUpdate.getLoanType().getPayment() + " " + + "se eliminĆ³ una multa de $" + tempMonto.toString()); + if (loanCtrl.deleteLoanDetailsFeeByLoanCurdate(selectedLoan)) { + loanCtrl.deleteLoanFeeNotificationByLoanCurdate(selectedLoan); + + Date date = new Date(); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.add(Calendar.DAY_OF_YEAR, -1); + date = calendar.getTime(); + loanUpdate.setLastUpdatedOn(date); + + loanCtrl.updateLoan(loanUpdate); + loan.clear(); + loan = customerCtrl.findLoanByCustomer(customerId); + bitacoraCtrl.saveBitacora(bitacora); + commentsBitacora = ""; + selectedLoan = null; + showMessage(FacesMessage.SEVERITY_INFO, "Multas eliminadas", "Se eliminĆ³ el/las multas del dĆ­a de hoy correctamente."); + } + } else { + showMessage(FacesMessage.SEVERITY_WARN, "Advertencia", "El prĆ©stamo no tiene registrado multas el dĆ­a de hoy"); + } + } 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."); + if (loanCtrl.updatePeopleRoute(new RouteCtlg(routeId), selectedLoan.getCustomer())) { + showMessage(FacesMessage.SEVERITY_INFO, "Cliente modificado", "Se modificĆ³ correctamente."); + } + if (loanCtrl.updatePeopleRoute(new RouteCtlg(routeId), selectedLoan.getEndorsement())) { + showMessage(FacesMessage.SEVERITY_INFO, "Aval modificado", "Se modificĆ³ correctamente."); + } + } else { + showMessage(FacesMessage.SEVERITY_WARN, "Ruta modificada", "OcurriĆ³ un error durante el proceso."); + } + + } + } + + /** + * + * @param outcome + * @return + */ + public String detailLoan(String outcome) { + return outcome; + } + + /** + * + * @param outcome + * @return + */ + public String detailLoanEndorsement(String outcome) { + return outcome; + } + + public List fillAdvanceUserDaily() { + return dashboardCtrl.fillAllAdvanceUserDailyByOffice(getLoggedUser().getOffice().getId()); + } + + public void getAdvanceDetailsByUser() { + advancesDetail = dashboardCtrl.findAllAdvancesUserDailyDetailByUser(userId); + } + + public void getLoansByCustomer() { + loan = customerCtrl.findLoanByCustomer(customerId); + } + + public void getLoansJuridical() { + String idUser = "aad0c673-eb93-11ea-b7e1-02907d0fb4e6"; + loanJuridical = customerCtrl.findLoanJuridical(idUser); + } + + public void getLoansZero() { + loanZero = customerCtrl.findLoanZero(); + } + + public void getLoansFinished() { + loanFinished = customerCtrl.findLoanFinished(); + } + + public void getLoansByEndorsement() { + loanEndorsement = endorsementCtrl.findLoanByEndorsement(endorsementId); + } + + public List findAllCustomerWithOutRenovationByOffice() { + return dashboardCtrl.findAllCustomerWithOutRenovationByOffice(getLoggedUser().getOffice().getId()); + } + + public void getPaymentDailyExpectByUser() { + List usersTmp = genericCtrl.getAllUsersByOffice(getLoggedUser().getOffice().getId()); + if (usersTmp != null && !usersTmp.isEmpty()) { + usersTmp.stream().filter(user -> (user.getUserType() == UserType.MOBILE && user.getCertifier() == ActiveStatus.DISABLED)).map(user -> { + BigDecimal amountByUser = BigDecimal.valueOf(dashboardCtrl.getLoansSumPaymentDailyByUser(user.getId())); + BigDecimal amountMoneyByUser = dashboardCtrl.getLoansSumPaymentDailyByUserMoney(user.getId()); + TotalExpectedPaymentDailyByUser expectedToday = new TotalExpectedPaymentDailyByUser(); + expectedToday.setActiveStatus(ActiveStatus.ENEBLED); + expectedToday.setOffice(new Office(getLoggedUser().getOffice().getId())); + expectedToday.setCreatedBy(getLoggedUser().getUser().getId()); + expectedToday.setCreatedOn(new Date()); + if (amountByUser != null) { + expectedToday.setTotalExpected(amountByUser); + } else { + expectedToday.setTotalExpected(BigDecimal.ZERO); + } + if (amountMoneyByUser != null) { + expectedToday.setTotalExpectedPayment(amountMoneyByUser); + } else { + expectedToday.setTotalExpectedPayment(BigDecimal.ZERO); + } + expectedToday.setUser(new User(user.getId())); + return expectedToday; + }).map(expectedToday -> { + expectedToday.setLastUpdatedOn(new Date()); + return expectedToday; + }).forEachOrdered(expectedToday -> { + dashboardCtrl.saveTotalExpectedPaymentDailyByUser(expectedToday); + }); + } + } + + public void getResumenLoans() { + + totalExpectedToday = new BigDecimal(BigInteger.ONE); + totalExpectedToday = dashboardCtrl.sumLoansApprovedByOffice(getLoggedUser().getOffice().getId()); + if (totalExpectedToday == null || totalExpectedToday == BigDecimal.ZERO) { + totalExpectedToday = new BigDecimal(BigInteger.ONE); + } + + } + + public void getResumenDaily() { + + List listTotal = closingDayCtrl.getAllTotalCashByCurdateDashboardView(getLoggedUser().getOffice().getId()); + totalAmountDaily = BigDecimal.ZERO; + totalTransferSenderDaily = BigDecimal.ZERO; + totalTransferReceiverDaily = BigDecimal.ZERO; + totalMoneyDailyDaily = BigDecimal.ZERO; + totalDeliveryDaily = BigDecimal.ZERO; + totalDepositDaily = BigDecimal.ZERO; + totalFinalDaily = BigDecimal.ZERO; + totalCajaDaily = BigDecimal.ZERO; + totalOtherExpenseDaily = BigDecimal.ZERO; + + for (TotalCashByCurdateDashboardView temp : listTotal) { + totalAmountDaily = totalAmountDaily.add(temp.getPaymentDaily()); + totalTransferSenderDaily = totalTransferSenderDaily.add(temp.getTransferSender()); + totalTransferReceiverDaily = totalTransferReceiverDaily.add(temp.getTransferReceiver()); + totalMoneyDailyDaily = totalMoneyDailyDaily.add(temp.getMoneyDaily()); + totalDeliveryDaily = totalDeliveryDaily.add(temp.getDelivery()); + totalDepositDaily = totalDepositDaily.add(temp.getDepositDaily()); + totalFinalDaily = totalFinalDaily.add(temp.getTotal()); + totalOtherExpenseDaily = totalOtherExpenseDaily.add(temp.getOtherExpense()); + } + + List closingTotal = closingDayCtrl.findAllClosingDayByCurdate(getLoggedUser().getOffice().getId()); + if (closingTotal != null && !closingTotal.isEmpty()) { + for (TotalClosingDayByCurdateView temp : closingTotal) { + totalCajaDaily = totalCajaDaily.add(temp.getAmountPaid()); + } + } + + } + + public void deletePaymentLoan() { + + if (selectedLoan.getLoanStatus() == LoanStatus.APPROVED || selectedLoan.getLoanStatus() == LoanStatus.PENDING_RENOVATION) { + + List details = loanCtrl.getLoanDetailsCurdatebyIdLoan(selectedLoan.getId()); + if (details != null && !details.isEmpty()) { + Loan loanUpdate = loanCtrl.getLoanById(selectedLoan.getId()); + Bitacora bitacora = new Bitacora(); + bitacora.setAction("Eliminar abono"); + bitacora.setCommentsUser(commentsBitacora); + bitacora.setCreatedBy(getLoggedUser().getUser().getId()); + bitacora.setCreatedOn(new Date()); + bitacora.setNameUser(getLoggedUser().getUser().getUserName()); + bitacora.setOffice(new Office(getLoggedUser().getOffice().getId())); + BigDecimal tempMonto = BigDecimal.ZERO; + for (LoanDetails detail : details) { + loanUpdate.setAmountPaid(loanUpdate.getAmountPaid().subtract(detail.getPaymentAmount())); + loanUpdate.setLastReferenceNumber(loanUpdate.getLastReferenceNumber() - 1); + tempMonto = tempMonto.add(detail.getPaymentAmount()); + } + bitacora.setDescription("El prĆ©stamo del cliente " + loanUpdate.getCustomer().getFullName() + " del asesor " + loanUpdate.getAsesor() + " con monto a prestar de $" + loanUpdate.getLoanType().getPayment() + " " + + "se eliminĆ³ un abono de $" + tempMonto.toString()); + if (loanCtrl.deleteLoanDetailsByLoanCurdate(selectedLoan)) { + Date date = new Date(); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.add(Calendar.DAY_OF_YEAR, -1); + date = calendar.getTime(); + loanUpdate.setLastUpdatedOn(date); + + loanCtrl.updateLoan(loanUpdate); + loan.clear(); + loan = customerCtrl.findLoanByCustomer(customerId); + selectedLoan = null; + bitacoraCtrl.saveBitacora(bitacora); + commentsBitacora = ""; + showMessage(FacesMessage.SEVERITY_INFO, "Abonos eliminados", "Se eliminĆ³ el/los abonos del dĆ­a de hoy correctamente."); + } + } else { + showMessage(FacesMessage.SEVERITY_WARN, "Advertencia", "El prĆ©stamo no tiene registrado abonos el dĆ­a de hoy"); + } + } 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; + } + + } + + public void deleteLoan() { + Bitacora bitacora = new Bitacora(); + Loan temp = loanCtrl.getLoanById(selectedLoan.getId()); + bitacora.setAction("Eliminar prĆ©stamo"); + bitacora.setCommentsUser(commentsBitacora); + bitacora.setCreatedBy(getLoggedUser().getUser().getId()); + bitacora.setCreatedOn(new Date()); + bitacora.setDescription("El prĆ©stamo del cliente " + temp.getCustomer().getFullName() + " del asesor " + temp.getAsesor() + " con monto a prestar de $" + temp.getLoanType().getPayment() + " se cambiĆ³ a estatus 'Eliminado' "); + bitacora.setNameUser(getLoggedUser().getUser().getUserName()); + bitacora.setOffice(new Office(getLoggedUser().getOffice().getId())); + loanCtrl.updateLoanByStatusWeb(LoanStatus.DELETED, selectedLoan.getId(), getLoggedUser().getUser().getId()); + loanCtrl.updateLoanByUserByStatus(LoanStatus.DELETED, selectedLoan); + loan.remove(selectedLoan); + selectedLoan = null; + bitacoraCtrl.saveBitacora(bitacora); + commentsBitacora = ""; + + showMessage(FacesMessage.SEVERITY_INFO, "Cambio de estatus", "El prĆ©stamo se cambiĆ³ a estatus 'Eliminado' de forma correcta."); + } + + public void changeApprovedStatus() { + Loan loanUpdate = loanCtrl.getLoanById(selectedLoan.getId()); + Bitacora bitacora = new Bitacora(); + bitacora.setAction("Cambio de estatus a aprobado"); + bitacora.setCommentsUser(commentsBitacora); + bitacora.setCreatedBy(getLoggedUser().getUser().getId()); + bitacora.setCreatedOn(new Date()); + bitacora.setDescription("El prĆ©stamo del cliente " + loanUpdate.getCustomer().getFullName() + " del asesor " + loanUpdate.getAsesor() + " con monto a prestar de $" + loanUpdate.getLoanType().getPayment() + " " + + "se cambia a estatus Aprobado"); + bitacora.setNameUser(getLoggedUser().getUser().getUserName()); + bitacora.setOffice(new Office(getLoggedUser().getOffice().getId())); + loanCtrl.updateLoanByStatusWeb(LoanStatus.APPROVED, selectedLoan.getId(), getLoggedUser().getUser().getId()); + loanCtrl.updateLoanByUserByStatus(LoanStatus.APPROVED, selectedLoan); + loan.clear(); + bitacoraCtrl.saveBitacora(bitacora); + commentsBitacora = ""; + loan = customerCtrl.findLoanByCustomer(customerId); + selectedLoan = null; + + showMessage(FacesMessage.SEVERITY_INFO, "Cambio de estatus", "El prĆ©stamo se cambiĆ³ a estatus 'Aprobado' de forma correcta."); + } + + public void changeBonusNewCustomer() { + loanCtrl.updateBonusNewCustomer(ActiveStatus.ENEBLED, selectedLoan.getId(), getLoggedUser().getUser().getId()); + loan.clear(); + loan = customerCtrl.findLoanByCustomer(customerId); + selectedLoan = null; + + showMessage(FacesMessage.SEVERITY_INFO, "Cambio de bono", "El prĆ©stamo empezĆ³ a contar como bono de cliente nuevo."); + } + + public void removeBonusNewCustomer() { + loanCtrl.updateBonusNewCustomer(ActiveStatus.DISABLED, selectedLoan.getId(), getLoggedUser().getUser().getId()); + loan.clear(); + loan = customerCtrl.findLoanByCustomer(customerId); + selectedLoan = null; + + showMessage(FacesMessage.SEVERITY_INFO, "Cambio de bono", "El prĆ©stamo ya no contarĆ” como bono de cliente nuevo."); + } + + public void updateReleaseDate() { + SimpleDateFormat sdf = new SimpleDateFormat("dd-MMM-yyyy"); + Date date = new Date(); + Loan loanUpdate = loanCtrl.getLoanById(selectedLoan.getId()); + loanUpdate.setCreatedOn(date); + loanCtrl.updateLoan(loanUpdate); + Bitacora bitacora = new Bitacora(); + bitacora.setAction("Cambio de fecha de liberaciĆ³n a " + sdf.format(date)); + bitacora.setCommentsUser(commentsBitacora); + bitacora.setCreatedBy(getLoggedUser().getUser().getId()); + bitacora.setCreatedOn(date); + bitacora.setDescription("El prĆ©stamo del cliente " + loanUpdate.getCustomer().getFullName() + + " del asesor " + loanUpdate.getAsesor() + + " con monto a prestar de $" + loanUpdate.getLoanType().getPayment() + + " cambia a fecha de liberaciĆ³n del dĆ­a de hoy " + sdf.format(date)); + bitacora.setNameUser(getLoggedUser().getUser().getUserName()); + bitacora.setOffice(new Office(getLoggedUser().getOffice().getId())); + loan.clear(); + loan = customerCtrl.findLoanByCustomer(customerId); + selectedLoan = null; + + showMessage(FacesMessage.SEVERITY_INFO, "Fecha de liberaciĆ³n", "Se actualizĆ³ la fecha de liberaciĆ³n al dĆ­a de hoy " + sdf.format(date)); + } + + public void allowRenew() { + Loan loanUpdate = loanCtrl.getLoanById(selectedLoan.getId()); + loanCtrl.deleteLoanFeeNotificationByLoan(loanUpdate); + Bitacora bitacora = new Bitacora(); + bitacora.setAction("Se eliminan las multas del prĆ©stamo " + selectedLoan.getId()); + bitacora.setCommentsUser(commentsBitacora); + bitacora.setCreatedBy(getLoggedUser().getUser().getId()); + bitacora.setCreatedOn(new Date()); + bitacora.setDescription("El prĆ©stamo del cliente " + loanUpdate.getCustomer().getFullName() + + " del asesor " + loanUpdate.getAsesor() + + " con monto a prestar de $" + loanUpdate.getLoanType().getPayment() + + " se eliminaron las multas"); + bitacora.setNameUser(getLoggedUser().getUser().getUserName()); + bitacora.setOffice(new Office(getLoggedUser().getOffice().getId())); + loan.clear(); + loan = customerCtrl.findLoanByCustomer(customerId); + selectedLoan = null; + + showMessage(FacesMessage.SEVERITY_INFO, "Multas eliminadas", "Se eliminĆ³ la/las multas del prĆ©stamo correctamente."); + } + + public void changeFrozenStatus(boolean freeze) { + Loan loanUpdate = loanCtrl.getLoanById(selectedLoan.getId()); + Bitacora bitacora = new Bitacora(); + if (freeze) { + bitacora.setAction("Cambio de estatus a congelado"); + bitacora.setCommentsUser(commentsBitacora); + bitacora.setCreatedBy(getLoggedUser().getUser().getId()); + bitacora.setCreatedOn(new Date()); + bitacora.setDescription("El prĆ©stamo del cliente " + loanUpdate.getCustomer().getFullName() + " del asesor " + loanUpdate.getAsesor() + " con monto a prestar de $" + loanUpdate.getLoanType().getPayment() + " " + + "se cambia a estatus Congelado"); + bitacora.setNameUser(getLoggedUser().getUser().getUserName()); + bitacora.setOffice(new Office(getLoggedUser().getOffice().getId())); + + loanUpdate.setFrozen(ActiveStatus.ENEBLED); + loanCtrl.updateLoan(loanUpdate); + + showMessage(FacesMessage.SEVERITY_INFO, "Cambio de estatus", "El prĆ©stamo se cambiĆ³ a estatus 'Congelado' de forma correcta."); + } else { + bitacora.setAction("Cambio de estatus a descongelado"); + bitacora.setCommentsUser(commentsBitacora); + bitacora.setCreatedBy(getLoggedUser().getUser().getId()); + bitacora.setCreatedOn(new Date()); + bitacora.setDescription("El prĆ©stamo del cliente " + loanUpdate.getCustomer().getFullName() + " del asesor " + loanUpdate.getAsesor() + " con monto a prestar de $" + loanUpdate.getLoanType().getPayment() + " " + + "se cambia a estatus Desongelado"); + bitacora.setNameUser(getLoggedUser().getUser().getUserName()); + bitacora.setOffice(new Office(getLoggedUser().getOffice().getId())); + + loanUpdate.setFrozen(ActiveStatus.DISABLED); + loanCtrl.updateLoan(loanUpdate); + + showMessage(FacesMessage.SEVERITY_INFO, "Cambio de estatus", "El prĆ©stamo se cambiĆ³ a estatus 'Descongelado' de forma correcta."); + } + + loan.clear(); + bitacoraCtrl.saveBitacora(bitacora); + commentsBitacora = ""; + loan = customerCtrl.findLoanByCustomer(customerId); + selectedLoan = null; + } + + public void changeFinishStatus() { + Loan loanUpdate = loanCtrl.getLoanById(selectedLoan.getId()); + Bitacora bitacora = new Bitacora(); + bitacora.setAction("Cambio de estatus a finalizado"); + bitacora.setCommentsUser(commentsBitacora); + bitacora.setCreatedBy(getLoggedUser().getUser().getId()); + bitacora.setCreatedOn(new Date()); + bitacora.setDescription("El prĆ©stamo del cliente " + loanUpdate.getCustomer().getFullName() + " del asesor " + loanUpdate.getAsesor() + " con monto a prestar de $" + loanUpdate.getLoanType().getPayment() + " " + + "se cambia a estatus Finalizado"); + bitacora.setNameUser(getLoggedUser().getUser().getUserName()); + bitacora.setOffice(new Office(getLoggedUser().getOffice().getId())); + loanCtrl.updateLoanByStatusWeb(LoanStatus.FINISH, selectedLoan.getId(), getLoggedUser().getUser().getId()); + loanCtrl.updateLoanByUserByStatus(LoanStatus.FINISH, selectedLoan); + loan.clear(); + bitacoraCtrl.saveBitacora(bitacora); + commentsBitacora = ""; + loan = customerCtrl.findLoanByCustomer(customerId); + selectedLoan = null; + + showMessage(FacesMessage.SEVERITY_INFO, "Cambio de estatus", "El prĆ©stamo se cambiĆ³ a estatus 'Terminado' de forma correcta."); + } + + 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"); + return; + }*/ + LoanByUser old = new LoanByUser(); + old = loanCtrl.getLoanByUserByIdLoan(selectedLoan); + + LoanByUser loanByUser = new LoanByUser(); + LoanByUserId idRelation = new LoanByUserId(); + + idRelation.setIdLoan(selectedLoan.getId()); + idRelation.setIdUser(userId); + + loanByUser.setId(idRelation); + loanByUser.setComments(old.getComments()); + loanByUser.setCreatedBy(old.getCreatedBy()); + loanByUser.setLoanByUserStatus(old.getLoanByUserStatus()); + loanByUser.setLoan(selectedLoan); + loanByUser.setCreatedOn(new Date()); + loanByUser.setOrderInList(old.getOrderInList()); + loanByUser.setOwnerLoan(OwnerLoan.CURRENT_OWNER); + loanByUser.setUser(new User(userId)); + if (loanCtrl.deleteLoanByUser(old)) { + loanCtrl.saveLoanByUser(loanByUser); + selectedLoan = null; + userId = ""; + loan.clear(); + loan = customerCtrl.findLoanByCustomer(customerId); + showMessage(FacesMessage.SEVERITY_INFO, "Cambio de propietario", "Se reasignĆ³ el prĆ©stamo de forma correcta."); + } else { + selectedLoan = null; + showMessage(FacesMessage.SEVERITY_ERROR, "Cambio de propietario", "OcurriĆ³ un error al intentar hacer el cambio de propietario."); + } + } + + public void changeOwnerToJuridical(){ + // Id de usuario laura.marquez + String idUser = "aad0c673-eb93-11ea-b7e1-02907d0fb4e6"; +// String idUser = "3338ce43-24fc-4d35-b51e-d8ec848937fc"; + + Loan loanUpdate = selectedLoanJuridical; + loanUpdate.setJuridicalDate(new Date()); + + loanCtrl.updateLoan(loanUpdate); + + LoanByUser old = new LoanByUser(); + old = loanCtrl.getLoanByUserByIdLoan(selectedLoanJuridical); + + LoanByUser loanByUser = new LoanByUser(); + LoanByUserId idRelation = new LoanByUserId(); + + idRelation.setIdLoan(selectedLoanJuridical.getId()); + idRelation.setIdUser(idUser); + + loanByUser.setId(idRelation); + loanByUser.setComments(old.getComments()); + loanByUser.setCreatedBy(old.getCreatedBy()); + loanByUser.setLoanByUserStatus(old.getLoanByUserStatus()); + loanByUser.setLoan(selectedLoanJuridical); + loanByUser.setCreatedOn(new Date()); + loanByUser.setOrderInList(old.getOrderInList()); + loanByUser.setOwnerLoan(OwnerLoan.CURRENT_OWNER); + loanByUser.setUser(new User(idUser)); + if (loanCtrl.deleteLoanByUser(old)) { + loanCtrl.saveLoanByUser(loanByUser); + selectedLoanJuridical = null; + loanJuridical.clear(); + getLoansJuridical(); + showMessage(FacesMessage.SEVERITY_INFO, "Cambio de propietario", "Se mandĆ³ el prĆ©stamo a jurĆ­dico."); + } else { + selectedLoan = null; + showMessage(FacesMessage.SEVERITY_ERROR, "Cambio de propietario", "OcurriĆ³ un error al intentar hacer el cambio de propietario."); + } + + + selectedLoanJuridical = null; + } + + 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()); + detail.setCreatedOn(new Date()); + detail.setLoan(selectedLoan); + detail.setLoanDetailsType(LoanDetailsType.PAYMENT); + detail.setPaymentAmount(payment); + detail.setPeopleType(PeopleType.CUSTOMER); + detail.setTransferStatus(TransferStatus.AUTHORIZED); + detail.setTransferNumber("N/A"); + detail.setReferenceNumber(selectedLoan.getLastReferenceNumber() + 1); + detail.setUser(new User(userId)); + if (loanCtrl.saveLoanDetail(detail)) { + Loan loanUpdate = loanCtrl.getLoanById(selectedLoan.getId()); + loanUpdate.setAmountPaid(loanUpdate.getAmountPaid().add(payment)); + loanUpdate.setLastReferenceNumber(loanUpdate.getLastReferenceNumber() + 1); + if (loanUpdate.getAmountToPay().compareTo(loanUpdate.getAmountPaid()) == 0) { + + LoanByUser loanByUser = loanCtrl.getLoanByUserByIdLoan(loanUpdate); + loanByUser.setLoanByUserStatus(LoanStatus.FINISH); + if (loanCtrl.updateLoanByUser(loanByUser)) { + loanUpdate.setLoanStatus(LoanStatus.FINISH); + } + } + loanCtrl.updateLoan(loanUpdate); + loan.clear(); + loan = customerCtrl.findLoanByCustomer(customerId); + selectedLoan = null; + userId = ""; + comments = ""; + payment = BigDecimal.ZERO; + showMessage(FacesMessage.SEVERITY_INFO, "Agregar abono", "Se agregĆ³ el abono de forma correcta."); + } + } else { + selectedLoan = null; + userId = ""; + comments = ""; + payment = BigDecimal.ZERO; + showMessage(FacesMessage.SEVERITY_WARN, "No se puede abonar", "Solo puedes abonar prĆ©stamos en estatus Aprobados o Pendientes por renovaciĆ³n"); + return; + } + + } + + public void addDeposit() { + if (selectedLoan.getLoanStatus() == LoanStatus.APPROVED || selectedLoan.getLoanStatus() == LoanStatus.PENDING_RENOVATION) { + LoanDetails detail = new LoanDetails(); + BigDecimal amountWithoutIVA = payment.divide(new BigDecimal(1.16),RoundingMode.FLOOR); + + amountWithoutIVA = amountWithoutIVA.setScale(2, RoundingMode.FLOOR); + + StringBuilder commentsTemp = new StringBuilder(comments); + + commentsTemp.append(". Monto de transferencia con IVA: $"); + commentsTemp.append(payment); + commentsTemp.append(", monto de transferencia sin IVA: $"); + commentsTemp.append(amountWithoutIVA); + + detail.setComments(comments); + detail.setCreatedBy(getLoggedUser().getUser().getId()); + detail.setCreatedOn(new Date()); + detail.setLoan(selectedLoan); + detail.setLoanDetailsType(LoanDetailsType.TRANSFER); + detail.setPaymentAmount(amountWithoutIVA); + detail.setPeopleType(PeopleType.CUSTOMER); + detail.setTransferStatus(TransferStatus.PENDING); + detail.setTransferNumber("N/A"); + detail.setReferenceNumber(selectedLoan.getLastReferenceNumber() + 1); + detail.setUser(new User(userId)); + if (loanCtrl.saveLoanDetail(detail)) { + Loan loanUpdate = loanCtrl.getLoanById(selectedLoan.getId()); + loanUpdate.setAmountPaid(loanUpdate.getAmountPaid().add(payment)); + loanUpdate.setLastReferenceNumber(loanUpdate.getLastReferenceNumber() + 1); + if (loanUpdate.getAmountToPay().compareTo(loanUpdate.getAmountPaid()) == 0) { + + LoanByUser loanByUser = loanCtrl.getLoanByUserByIdLoan(loanUpdate); + loanByUser.setLoanByUserStatus(LoanStatus.FINISH); + if (loanCtrl.updateLoanByUser(loanByUser)) { + loanUpdate.setLoanStatus(LoanStatus.FINISH); + } + } + loanCtrl.updateLoan(loanUpdate); + loan.clear(); + loan = customerCtrl.findLoanByCustomer(customerId); + selectedLoan = null; + userId = ""; + comments = ""; + payment = BigDecimal.ZERO; + showMessage(FacesMessage.SEVERITY_INFO, "Agregar depĆ³sito", "Se agregĆ³ el depĆ³sito de forma correcta."); + } + } else { + selectedLoan = null; + userId = ""; + comments = ""; + payment = BigDecimal.ZERO; + showMessage(FacesMessage.SEVERITY_WARN, "No se puede abonar", "Solo puedes abonar prĆ©stamos en estatus Aprobados o Pendientes por renovaciĆ³n"); + return; + } + + } + + public void addFee() { + if (selectedLoan.getLoanStatus() != LoanStatus.APPROVED) { + selectedLoan = null; + userId = ""; + comments = ""; + fee = BigDecimal.ZERO; + showMessage(FacesMessage.SEVERITY_WARN, "No se puede multar", "Solo puedes multar prĆ©stamos en estatus Aprobados"); + return; + } + LoanDetails detail = new LoanDetails(); + detail.setComments(comments); + detail.setCreatedBy(getLoggedUser().getUser().getId()); + detail.setCreatedOn(new Date()); + detail.setLoan(selectedLoan); + detail.setLoanDetailsType(LoanDetailsType.FEE); + detail.setPaymentAmount(fee); + detail.setPeopleType(PeopleType.CUSTOMER); + detail.setTransferStatus(TransferStatus.AUTHORIZED); + detail.setTransferNumber("N/A"); + detail.setFeeStatus(FeeStatus.TO_PAY); + detail.setReferenceNumber(selectedLoan.getLastReferenceNumber() + 1); + detail.setUser(new User(userId)); + if (loanCtrl.saveLoanDetail(detail)) { + Loan loanUpdate = loanCtrl.getLoanById(selectedLoan.getId()); + loanUpdate.setAmountToPay(loanUpdate.getAmountToPay().add(fee)); + loanUpdate.setLastReferenceNumber(loanUpdate.getLastReferenceNumber() + 1); + loanCtrl.updateLoan(loanUpdate); + + LoanFeeNotification notification = new LoanFeeNotification(); + notification.setCreatedBy(getLoggedUser().getUser().getId()); + notification.setCreatedOn(new Date()); + notification.setLoan(loanUpdate); + notification.setUser(new User(userId)); + notification.setNotificationNumber(loanUpdate.getTotalFeeByLoan() + 1); + loanCtrl.saveLoanNotificationFee(notification); + + loan.clear(); + loan = customerCtrl.findLoanByCustomer(customerId); + selectedLoan = null; + userId = ""; + comments = ""; + fee = BigDecimal.ZERO; + showMessage(FacesMessage.SEVERITY_INFO, "Agregar multa", "Se agregĆ³ la multa de forma correcta."); + } + } + + public void changeLoanType() { + if (selectedLoan.getLoanStatus() != LoanStatus.TO_DELIVERY && selectedLoan.getLoanStatus() != LoanStatus.APPROVED) { + 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()); + LoanType loanTypeUpdate = loanTypeCtrl.getLoanTypeById(loanTypeId); + Bitacora bitacora = new Bitacora(); + bitacora.setAction("Cambio de monto de prĆ©stamo"); + bitacora.setCommentsUser(commentsBitacora); + bitacora.setCreatedBy(getLoggedUser().getUser().getId()); + bitacora.setCreatedOn(new Date()); + bitacora.setDescription("El prĆ©stamo del cliente " + loanUpdate.getCustomer().getFullName() + " del asesor " + loanUpdate.getAsesor() + " con monto a prestar de $" + loanUpdate.getLoanType().getPayment() + " " + + "se cambia a monto de prĆ©stamo por " + loanTypeUpdate.getLoanTypeName()); + bitacora.setNameUser(getLoggedUser().getUser().getUserName()); + bitacora.setOffice(new Office(getLoggedUser().getOffice().getId())); + + loanUpdate.setLoanType(new LoanType(loanTypeId)); + loanUpdate.setAmountToPay(loanTypeUpdate.getPaymentTotal()); + if (loanCtrl.updateLoan(loanUpdate)) { + loan.clear(); + loan = customerCtrl.findLoanByCustomer(customerId); + loanTypeId = ""; + bitacoraCtrl.saveBitacora(bitacora); + commentsBitacora = ""; + selectedLoan = null; + showMessage(FacesMessage.SEVERITY_INFO, "Cambio de tipo de prĆ©stamo", "El prĆ©stamo se cambiĆ³ correctamente"); + } + + } + + public void CustomerClassification(String colorClassification) + { + try { + customerService.updatePeopleByClassification( CustomerClassification.valueOf(colorClassification), getSelectedLoanFinished().getCustomerId(), getLoggedUser().getUser().getId()); + + showMessage(FacesMessage.SEVERITY_INFO, "Cliente", "Se clasificĆ³ correctamente."); + } catch (Exception e) { + showMessage(FacesMessage.SEVERITY_ERROR, "Cliente", "No se clasificĆ³ correctamente."); + } + } + + public ClosingDayController getClosingDayCtrl() { + return closingDayCtrl; + } + + public void setClosingDayCtrl(ClosingDayController closingDayCtrl) { + this.closingDayCtrl = closingDayCtrl; + } + + public DashboardController getDashboardCtrl() { + return dashboardCtrl; + } + + public void setDashboardCtrl(DashboardController dashboardCtrl) { + this.dashboardCtrl = dashboardCtrl; + } + + public BigDecimal getTotalAmountDaily() { + return totalAmountDaily; + } + + public void setTotalAmountDaily(BigDecimal totalAmountDaily) { + this.totalAmountDaily = totalAmountDaily; + } + + public BigDecimal getTotalTransferSenderDaily() { + return totalTransferSenderDaily; + } + + public void setTotalTransferSenderDaily(BigDecimal totalTransferSenderDaily) { + this.totalTransferSenderDaily = totalTransferSenderDaily; + } + + public BigDecimal getTotalTransferReceiverDaily() { + return totalTransferReceiverDaily; + } + + public void setTotalTransferReceiverDaily(BigDecimal totalTransferReceiverDaily) { + this.totalTransferReceiverDaily = totalTransferReceiverDaily; + } + + public BigDecimal getTotalMoneyDailyDaily() { + return totalMoneyDailyDaily; + } + + public void setTotalMoneyDailyDaily(BigDecimal totalMoneyDailyDaily) { + this.totalMoneyDailyDaily = totalMoneyDailyDaily; + } + + public BigDecimal getTotalDeliveryDaily() { + return totalDeliveryDaily; + } + + public void setTotalDeliveryDaily(BigDecimal totalDeliveryDaily) { + this.totalDeliveryDaily = totalDeliveryDaily; + } + + public BigDecimal getTotalFinalDaily() { + return totalFinalDaily; + } + + public void setTotalFinalDaily(BigDecimal totalFinalDaily) { + this.totalFinalDaily = totalFinalDaily; + } + + public BigDecimal getTotalCajaDaily() { + return totalCajaDaily; + } + + public void setTotalCajaDaily(BigDecimal totalCajaDaily) { + this.totalCajaDaily = totalCajaDaily; + } + + public int getNumPending() { + return numPending; + } + + public void setNumPending(int numPending) { + this.numPending = numPending; + } + + public int getNumApproved() { + return numApproved; + } + + public void setNumApproved(int numApproved) { + this.numApproved = numApproved; + } + + public int getNumFinish() { + return numFinish; + } + + public void setNumFinish(int numFinish) { + this.numFinish = numFinish; + } + + public int getNumRejected() { + return numRejected; + } + + public void setNumRejected(int numRejected) { + this.numRejected = numRejected; + } + + public int getNumToDelivery() { + return numToDelivery; + } + + public void setNumToDelivery(int numToDelivery) { + this.numToDelivery = numToDelivery; + } + + public BigDecimal getTotalExpectedToday() { + return totalExpectedToday; + } + + public void setTotalExpectedToday(BigDecimal totalExpectedToday) { + this.totalExpectedToday = totalExpectedToday; + } + + public LoanController getLoanCtrl() { + return loanCtrl; + } + + public void setLoanCtrl(LoanController loanCtrl) { + this.loanCtrl = loanCtrl; + } + + public PieChartModel getLivePieModel() { + + livePieModel.getData().put("Total cobrado", totalAmountDaily); + livePieModel.getData().put("Total esperado por cobro", totalExpectedToday.subtract(totalAmountDaily)); + + livePieModel.setTitle("GrĆ”fica de recuperaciĆ³n diaria"); + livePieModel.setLegendPosition("ne"); + + return livePieModel; + } + + public void setLivePieModel(PieChartModel livePieModel) { + this.livePieModel = livePieModel; + } + + public PieChartModel getPieResumenCaja() { + pieResumenCaja.getData().put("Total del dĆ­a", totalFinalDaily.subtract(totalCajaDaily)); + pieResumenCaja.getData().put("Total en caja", totalCajaDaily); + + pieResumenCaja.setTitle("GrĆ”fica de recuperaciĆ³n en caja"); + pieResumenCaja.setLegendPosition("ne"); + + return pieResumenCaja; + } + + public void setPieResumenCaja(PieChartModel pieResumenCaja) { + this.pieResumenCaja = pieResumenCaja; + } + + public BarChartModel getBarResumenLoans() { + return barResumenLoans; + } + + public void setBarResumenLoans(BarChartModel barResumenLoans) { + this.barResumenLoans = barResumenLoans; + } + + public BigDecimal getTotalOtherExpenseDaily() { + return totalOtherExpenseDaily; + } + + public void setTotalOtherExpenseDaily(BigDecimal totalOtherExpenseDaily) { + this.totalOtherExpenseDaily = totalOtherExpenseDaily; + } + + public GenericController getGenericCtrl() { + return genericCtrl; + } + + public void setGenericCtrl(GenericController genericCtrl) { + this.genericCtrl = genericCtrl; + } + + public List getAdvances() { + return advances; + } + + public void setAdvances(List advances) { + this.advances = advances; + } + + public List getCustomersWithoutRenovation() { + return customersWithoutRenovation; + } + + public void setCustomersWithoutRenovation(List customersWithoutRenovation) { + this.customersWithoutRenovation = customersWithoutRenovation; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public List getAdvancesDetail() { + return advancesDetail; + } + + public void setAdvancesDetail(List advancesDetail) { + this.advancesDetail = advancesDetail; + } + + public List getUsers() { + return users; + } + + public void setUsers(List users) { + this.users = users; + } + + public CustomerController getCustomerCtrl() { + return customerCtrl; + } + + public void setCustomerCtrl(CustomerController customerCtrl) { + this.customerCtrl = customerCtrl; + } + + public String getCustomerId() { + return customerId; + } + + public void setCustomerId(String customerId) { + this.customerId = customerId; + } + + public List getCustomers() { + return customers; + } + + public void setCustomers(List customers) { + this.customers = customers; + } + + public List getLoan() { + return loan; + } + + public void setLoan(List loan) { + this.loan = loan; + } + + public List getLoanJuridical() { + return loanJuridical; + } + + public void setLoanJuridical(List loanJuridical) { + this.loanJuridical = loanJuridical; + } + + public List getLoanZero() { + return loanZero; + } + + public void setLoanZero(List loanZero) { + this.loanZero = loanZero; + } + + public List getLoanFinished() { + return loanFinished; + } + + public void setLoanFinished(List loanFinished) { + this.loanFinished = loanFinished; + } + + public Loan getSelectedLoan() { + return selectedLoan; + } + + public void setSelectedLoan(Loan selectedLoan) { + this.selectedLoan = selectedLoan; + } + + public Loan getSelectedLoanJuridical() { + return selectedLoanJuridical; + } + + public void setSelectedLoanJuridical(Loan selectedLoanJuridical) { + this.selectedLoanJuridical = selectedLoanJuridical; + } + + public LoanDetailZeroView getSelectedLoanZero() { + return selectedLoanZero; + } + + public void setSelectedLoanZero(LoanDetailZeroView selectedLoanZero) { + this.selectedLoanZero = selectedLoanZero; + } + + public LoanFinishedView getSelectedLoanFinished() { + return selectedLoanFinished; + } + + public void setSelectedLoanFinished(LoanFinishedView selectedLoanFinished) { + this.selectedLoanFinished = selectedLoanFinished; + } + + public BigDecimal getPayment() { + return payment; + } + + public void setPayment(BigDecimal payment) { + this.payment = payment; + } + + public String getComments() { + return comments; + } + + public void setComments(String comments) { + this.comments = comments; + } + + public BigDecimal getFee() { + return fee; + } + + public void setFee(BigDecimal fee) { + this.fee = fee; + } + + public String getLoanTypeId() { + return loanTypeId; + } + + public void setLoanTypeId(String loanTypeId) { + this.loanTypeId = loanTypeId; + } + + public LoanTypeController getLoanTypeCtrl() { + return loanTypeCtrl; + } + + public void setLoanTypeCtrl(LoanTypeController loanTypeCtrl) { + this.loanTypeCtrl = loanTypeCtrl; + } + + public List getLoanType() { + return loanType; + } + + public void setLoanType(List loanType) { + this.loanType = loanType; + } + + public RouteController getRouteCtrl() { + return routeCtrl; + } + + public void setRouteCtrl(RouteController routeCtrl) { + this.routeCtrl = routeCtrl; + } + + public String getRouteId() { + return routeId; + } + + public void setRouteId(String routeId) { + this.routeId = routeId; + } + + public List getRoute() { + return route; + } + + public void setRoute(List route) { + this.route = route; + } + + public BigDecimal getTotalDepositDaily() { + return totalDepositDaily; + } + + public void setTotalDepositDaily(BigDecimal totalDepositDaily) { + this.totalDepositDaily = totalDepositDaily; + } + + public BigDecimal getTotalColocationApproved() { + return totalColocationApproved; + } + + public void setTotalColocationApproved(BigDecimal totalColocationApproved) { + this.totalColocationApproved = totalColocationApproved; + } + + public BigDecimal getTotalColocationToDelivery() { + return totalColocationToDelivery; + } + + public void setTotalColocationToDelivery(BigDecimal totalColocationToDelivery) { + this.totalColocationToDelivery = totalColocationToDelivery; + } + + public BigDecimal getTotalDiference() { + return totalDiference; + } + + public void setTotalDiference(BigDecimal totalDiference) { + this.totalDiference = totalDiference; + } + + public BigDecimal getTotalPorcentajeDiference() { + return totalPorcentajeDiference; + } + + public void setTotalPorcentajeDiference(BigDecimal totalPorcentajeDiference) { + this.totalPorcentajeDiference = totalPorcentajeDiference; + } + + public BigDecimal getGeneralExpectedWeek() { + return GeneralExpectedWeek; + } + + public void setGeneralExpectedWeek(BigDecimal GeneralExpectedWeek) { + this.GeneralExpectedWeek = GeneralExpectedWeek; + } + + public BigDecimal getGeneralReportedWeek() { + return generalReportedWeek; + } + + public void setGeneralReportedWeek(BigDecimal generalReportedWeek) { + this.generalReportedWeek = generalReportedWeek; + } + + public List getEndorsement() { + return endorsement; + } + + public void setEndorsement(List endorsement) { + this.endorsement = endorsement; + } + + public EndorsementController getEndorsementCtrl() { + return endorsementCtrl; + } + + public void setEndorsementCtrl(EndorsementController endorsementCtrl) { + this.endorsementCtrl = endorsementCtrl; + } + + public String getEndorsementId() { + return endorsementId; + } + + public void setEndorsementId(String endorsementId) { + this.endorsementId = endorsementId; + } + + public List getLoanEndorsement() { + return loanEndorsement; + } + + public void setLoanEndorsement(List loanEndorsement) { + this.loanEndorsement = loanEndorsement; + } + + public Loan getSelectedLoanEndorsement() { + return selectedLoanEndorsement; + } + + public void setSelectedLoanEndorsement(Loan selectedLoanEndorsement) { + this.selectedLoanEndorsement = selectedLoanEndorsement; + } + + public BitacoraController getBitacoraCtrl() { + return bitacoraCtrl; + } + + public void setBitacoraCtrl(BitacoraController bitacoraCtrl) { + this.bitacoraCtrl = bitacoraCtrl; + } + + public String getCommentsBitacora() { + return commentsBitacora; + } + + public void setCommentsBitacora(String commentsBitacora) { + this.commentsBitacora = commentsBitacora; + } + + public LazyDataModel getCustomersWithoutRenovationPaginator() { + return customersWithoutRenovationPaginator; + } + + public void setCustomersWithoutRenovationPaginator(LazyDataModel customersWithoutRenovationPaginator) { + this.customersWithoutRenovationPaginator = customersWithoutRenovationPaginator; + } + + public GenericValidationController getGenericValidateController() { + return genericValidateController; + } + + public void setGenericValidateController(GenericValidationController genericController) { + this.genericValidateController = genericController; + } + + public Date getLastStableSmallBox() { + return lastStableSmallBox; + } + + public void setLastStableSmallBox(Date lastStableSmallBox) { + this.lastStableSmallBox = lastStableSmallBox; + } + + @Inject + private CustomerWithoutRenovationViewService customerWithoutRenovationViewService; + + private ClosingDayController closingDayCtrl; + private DashboardController dashboardCtrl; + private LoanController loanCtrl; + private GenericController genericCtrl; + private CustomerController customerCtrl; + private EndorsementController endorsementCtrl; + private LoanTypeController loanTypeCtrl; + private RouteController routeCtrl; + private BitacoraController bitacoraCtrl; + + private BigDecimal totalAmountDaily; + private BigDecimal totalTransferSenderDaily; + private BigDecimal totalTransferReceiverDaily; + private BigDecimal totalMoneyDailyDaily; + private BigDecimal totalDeliveryDaily; + private BigDecimal totalFinalDaily; + private BigDecimal totalCajaDaily; + private BigDecimal totalOtherExpenseDaily; + private BigDecimal totalDepositDaily; + + private BigDecimal totalExpectedToday; + + private BigDecimal payment; + private BigDecimal fee; + + private int numPending; + private int numApproved; + private int numFinish; + private int numRejected; + private int numToDelivery; + private String userId; + private String customerId; + private String endorsementId; + private String comments; + private String loanTypeId; + private String routeId; + private String commentsBitacora; + private List users; + private List customers; + private List endorsement; + private List route; + + private PieChartModel livePieModel; + private PieChartModel pieResumenCaja; + private BarChartModel barResumenLoans; + + private List advances; + private List customersWithoutRenovation; + private LazyDataModel customersWithoutRenovationPaginator; + private List advancesDetail; + private List loan; + private List loanJuridical; + private List loanZero; + private List loanFinished; + private List loanEndorsement; + private List loanType; + + private BigDecimal totalColocationApproved; + private BigDecimal totalColocationToDelivery; + private BigDecimal totalDiference; + private BigDecimal totalPorcentajeDiference; + private BigDecimal GeneralExpectedWeek; + private BigDecimal generalReportedWeek; + + private Loan selectedLoan; + private Loan selectedLoanJuridical; + private LoanDetailZeroView selectedLoanZero; + private LoanFinishedView selectedLoanFinished; + private Loan selectedLoanEndorsement; + + private GenericValidationController genericValidateController; + private Date lastStableSmallBox; + private boolean stableSmallBoxToday; + + @Inject + private CustomerService customerService; + + @PostConstruct + public void init() { + livePieModel = new PieChartModel(); + pieResumenCaja = new PieChartModel(); + closingDayCtrl = new ClosingDayController(); + dashboardCtrl = new DashboardController(); + loanCtrl = new LoanController(); + genericCtrl = new GenericController(); + customerCtrl = new CustomerController(); + endorsementCtrl = new EndorsementController(); + loanTypeCtrl = new LoanTypeController(); + routeCtrl = new RouteController(); + bitacoraCtrl = new BitacoraController(); + commentsBitacora = ""; + setGenericValidateController(new GenericValidationController()); + setLastStableSmallBox(getGenericValidateController().lastStableSmallBoxByDate(getLoggedUser().getUser())); + + if (dashboardCtrl.verifyTotalExpectedPaymentDailyByUserCreatedByOffice(getLoggedUser().getOffice().getId()) == 0) { + getPaymentDailyExpectByUser(); + } + advances = fillAdvanceUserDaily(); + totalColocationApproved = BigDecimal.ZERO; + totalColocationToDelivery = BigDecimal.ZERO; + GeneralExpectedWeek = BigDecimal.ZERO; + generalReportedWeek = BigDecimal.ZERO; + totalDiference = BigDecimal.ZERO; + totalPorcentajeDiference = BigDecimal.ZERO; + + if (advances != null && !advances.isEmpty()) { + for (AdvanceUserDailyView advance : advances) { + totalColocationApproved = totalColocationApproved.add(advance.getColocationApproved()); + totalColocationToDelivery = totalColocationToDelivery.add(advance.getColocationToDelivery()); + GeneralExpectedWeek = GeneralExpectedWeek.add(advance.getTotalExpectedWeek()); + generalReportedWeek = generalReportedWeek.add(advance.getTotalReportedWeek()); + + } + totalDiference = generalReportedWeek.subtract(GeneralExpectedWeek); + if (GeneralExpectedWeek.compareTo(BigDecimal.ZERO) == 1) { + totalPorcentajeDiference = ((GeneralExpectedWeek.subtract(generalReportedWeek)).multiply(new BigDecimal(100))).divide(GeneralExpectedWeek, 2, RoundingMode.HALF_UP); + } else { + totalPorcentajeDiference = BigDecimal.ZERO; + } + + } + customersWithoutRenovation = findAllCustomerWithOutRenovationByOffice(); + listenerCustomerWithoutRenovationView(); + users = genericCtrl.getAllUsersByOffice(getLoggedUser().getOffice().getId()); + customers = customerCtrl.fillCustomersDatatable(getLoggedUser().getOffice().getId()); + endorsement = endorsementCtrl.fillEndorsementsDatatable(getLoggedUser().getOffice().getId()); + loanType = loanTypeCtrl.fillLoanTypeDatatable(getLoggedUser().getOffice().getId()); + route = routeCtrl.fillRoutesDatatable(getLoggedUser().getOffice().getId()); + getResumenDaily(); + getResumenLoans(); + getLoansJuridical(); + getLoansZero(); + } + + public boolean getAction( ) { + Date date = new Date(); + System.out.println("Fecha: " + date); + if (genericCtrl.existStableSmallBoxByCreatedOn(date)) { + return false; + } + return true; + } + + private void listenerCustomerWithoutRenovationView() { + try { + setCustomersWithoutRenovationPaginator( + new LazyDataModel() { + + private List listOfData; + + @Override + public List load(int first, int pageSize, String sortField, SortOrder sortOrder, Map filterBy) { + String generalSearch = (null != filterBy && !filterBy.isEmpty() && null != filterBy.get("globalFilter") && !filterBy.get("globalFilter").toString().equals("")) + ? "%" + filterBy.get("globalFilter").toString() + "%" + : ""; + + if (null != filterBy) { + filterBy.remove("globalFilter"); + } + + Long total = customerWithoutRenovationViewService + .countAllCustomerWithOutRenovationByOfficePaginator( + getLoggedUser().getOffice().getId(), + generalSearch, + filterBy); + + setRowCount(total.intValue()); + + listOfData = customerWithoutRenovationViewService + .findAllCustomerWithOutRenovationByOfficePaginator( + getLoggedUser().getOffice().getId(), + first, + pageSize, + generalSearch, + sortField, + sortOrder.toString().equals("ASCENDING") ? "ASC" : "DESC", + filterBy); + + return listOfData; + } + + @Override + public String getRowKey(CustomerWithoutRenovationView selectedRow) { + return selectedRow.getId(); + } + + @Override + public CustomerWithoutRenovationView getRowData(String rowKey) { + return listOfData + .stream() + .filter(rowData -> rowKey.equals(rowData.getId())) + .findFirst() + .orElse(null); + } + + }); + } catch (Exception e) { + } + } + + } diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/dashboard/LoanDetailBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/dashboard/LoanDetailBean.java new file mode 100644 index 0000000..292b363 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/dashboard/LoanDetailBean.java @@ -0,0 +1,245 @@ +/* + * 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.web.beans.dashboard; + +import com.arrebol.apc.controller.admin.CustomerController; +import com.arrebol.apc.controller.admin.EndorsementController; +import com.arrebol.apc.controller.admin.LoanController; +import com.arrebol.apc.model.catalog.People; +import com.arrebol.apc.model.enums.LoanDetailsType; +import com.arrebol.apc.model.loan.Loan; +import com.arrebol.apc.model.loan.LoanDetails; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Named(value = "loanDetailManager") +@ViewScoped +public class LoanDetailBean extends GenericBean implements Serializable, Datatable { + + public List getDetails(String id) { + try { + loanDetails = loanCtrl.getLoanDetailsbyId(id); + getSaldoInsolutoAbono(); + } catch (Exception e) { + } + return null == loanDetails ? new ArrayList<>() : loanDetails; + } + + public void getSaldoInsolutoAbono( ) { + Double sumaAbonosAnteriores; + Double totalAPagar; + Double saldoInsoluto; + Double saldoMultas; + // + for (LoanDetails detail : loanDetails) { + sumaAbonosAnteriores = loanDetails.stream().filter(p -> p.getReferenceNumber() <= detail.getReferenceNumber() && !p.getLoanDetailsType().equals(LoanDetailsType.FEE) ) + .mapToDouble(LoanDetails::getAbonoD) + .sum(); + saldoMultas = loanDetails.stream().filter(p -> p.getReferenceNumber() <= detail.getReferenceNumber() && p.getLoanDetailsType().equals(LoanDetailsType.FEE)) + .mapToDouble(LoanDetails::getAbonoD) + .sum(); + + totalAPagar = detail.getLoan().getLoanType().getPaymentTotal().doubleValue(); + saldoInsoluto = totalAPagar - sumaAbonosAnteriores + saldoMultas; + + detail.setSaldoInsoluto(new BigDecimal(saldoInsoluto)); + } + } + + public People getCustomerDetail(String peopleId) { + return customerCtrl.findPeopleById(peopleId); + } + + public List getLoanByCustomer(String peopleId) { + return customerCtrl.findLoanByCustomer(peopleId); + } + + public List getLoanByEndorsement(String peopleId) { + return endorsementCtrl.findLoanByEndorsement(peopleId); + } + + @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 onRowReorder(ReorderEvent event) { + 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. + } + + public CustomerController getCustomerCtrl() { + return customerCtrl; + } + + public void setCustomerCtrl(CustomerController customerCtrl) { + this.customerCtrl = customerCtrl; + } + + public People getCustomer() { + return customer; + } + + public void setCustomer(People customer) { + this.customer = customer; + } + + public List getLoanCustomer() { + return loanCustomer; + } + + public void setLoanCustomer(List loanCustomer) { + this.loanCustomer = loanCustomer; + } + + public String getCustomerId() { + return customerId; + } + + public void setCustomerId(String customerId) { + this.customerId = customerId; + } + + public LoanController getLoanCtrl() { + return loanCtrl; + } + + public void setLoanCtrl(LoanController loanCtrl) { + this.loanCtrl = loanCtrl; + } + + public String getLoanId() { + return loanId; + } + + public void setLoanId(String loanId) { + this.loanId = loanId; + } + + public Loan getLoan() { + return loan; + } + + public void setLoan(Loan loan) { + this.loan = loan; + } + + public EndorsementController getEndorsementCtrl() { + return endorsementCtrl; + } + + public void setEndorsementCtrl(EndorsementController endorsementCtrl) { + this.endorsementCtrl = endorsementCtrl; + } + + public People getEndorsement() { + return endorsement; + } + + public void setEndorsement(People endorsement) { + this.endorsement = endorsement; + } + + public String getEndorsementId() { + return endorsementId; + } + + public void setEndorsementId(String endorsementId) { + this.endorsementId = endorsementId; + } + + public List getLoanEndorsement() { + return loanEndorsement; + } + + public void setLoanEndorsement(List loanEndorsement) { + this.loanEndorsement = loanEndorsement; + } + + public Loan getSelectedLoanCustomer() { + return selectedLoanCustomer; + } + + public void setSelectedLoanCustomer(Loan selectedLoanCustomer) { + this.selectedLoanCustomer = selectedLoanCustomer; + } + + public List getLoanDetails() { + return loanDetails; + } + + public void setLoanDetails(List loanDetails) { + this.loanDetails = loanDetails; + } + + private CustomerController customerCtrl; + private LoanController loanCtrl; + private EndorsementController endorsementCtrl; + + private People customer; + private Loan loan; + private People endorsement; + + private String customerId; + private String loanId; + private String endorsementId; + + private List loanEndorsement; + private List loanCustomer; + private Loan selectedLoanCustomer; + + private List loanDetails; + + @PostConstruct + public void init() { + loadBundlePropertyFile(); + customerCtrl = new CustomerController(); + loanCtrl = new LoanController(); + endorsementCtrl = new EndorsementController(); + + setLoanId(externalContext().getRequestParameterMap().get("selectedId")); + loan = loanCtrl.getLoanById(getLoanId()); + customer = loan.getCustomer(); + endorsement = loan.getEndorsement(); + loanEndorsement = getLoanByEndorsement(loan.getEndorsement().getId()); + loanCustomer = getLoanByCustomer(loan.getCustomer().getId()); + + if(loanCustomer.size() > 2){ + loanCustomer = getLoanByCustomer(loan.getCustomer().getId()).subList(0, 2); + } + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/dashboard/LoanDetailEndorsementBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/dashboard/LoanDetailEndorsementBean.java new file mode 100644 index 0000000..41a7e1d --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/dashboard/LoanDetailEndorsementBean.java @@ -0,0 +1,218 @@ +/* + * 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.web.beans.dashboard; + +import com.arrebol.apc.controller.admin.CustomerController; +import com.arrebol.apc.controller.admin.EndorsementController; +import com.arrebol.apc.controller.admin.LoanController; +import com.arrebol.apc.model.catalog.People; +import com.arrebol.apc.model.loan.Loan; +import com.arrebol.apc.model.loan.LoanDetails; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Named(value = "loanDetailEndorsementManager") +@ViewScoped +public class LoanDetailEndorsementBean extends GenericBean implements Serializable, Datatable { + + public List getDetails(String id) { + try { + loanDetails = loanCtrl.getLoanDetailsbyId(id); + + } catch (Exception e) { + } + return null == loanDetails ? new ArrayList<>() : loanDetails; + } + + public People getCustomerDetail(String peopleId){ + return customerCtrl.findPeopleById(peopleId); + } + + public List getLoanByCustomer(String peopleId){ + return customerCtrl.findLoanByCustomer(peopleId); + } + + public List getLoanByEndorsement(String peopleId){ + return endorsementCtrl.findLoanByEndorsement(peopleId); + } + + @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 onRowReorder(ReorderEvent event) { + 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. + } + + public CustomerController getCustomerCtrl() { + return customerCtrl; + } + + public void setCustomerCtrl(CustomerController customerCtrl) { + this.customerCtrl = customerCtrl; + } + + public People getCustomer() { + return customer; + } + + public void setCustomer(People customer) { + this.customer = customer; + } + + public List getLoanCustomer() { + return loanCustomer; + } + + public void setLoanCustomer(List loanCustomer) { + this.loanCustomer = loanCustomer; + } + + public String getCustomerId() { + return customerId; + } + + public void setCustomerId(String customerId) { + this.customerId = customerId; + } + + public LoanController getLoanCtrl() { + return loanCtrl; + } + + public void setLoanCtrl(LoanController loanCtrl) { + this.loanCtrl = loanCtrl; + } + + public String getLoanId() { + return loanId; + } + + public void setLoanId(String loanId) { + this.loanId = loanId; + } + + public Loan getLoan() { + return loan; + } + + public void setLoan(Loan loan) { + this.loan = loan; + } + + public EndorsementController getEndorsementCtrl() { + return endorsementCtrl; + } + + public void setEndorsementCtrl(EndorsementController endorsementCtrl) { + this.endorsementCtrl = endorsementCtrl; + } + + public People getEndorsement() { + return endorsement; + } + + public void setEndorsement(People endorsement) { + this.endorsement = endorsement; + } + + public String getEndorsementId() { + return endorsementId; + } + + public void setEndorsementId(String endorsementId) { + this.endorsementId = endorsementId; + } + + public List getLoanEndorsement() { + return loanEndorsement; + } + + public void setLoanEndorsement(List loanEndorsement) { + this.loanEndorsement = loanEndorsement; + } + + public Loan getSelectedLoanCustomer() { + return selectedLoanCustomer; + } + + public void setSelectedLoanCustomer(Loan selectedLoanCustomer) { + this.selectedLoanCustomer = selectedLoanCustomer; + } + + public List getLoanDetails() { + return loanDetails; + } + + public void setLoanDetails(List loanDetails) { + this.loanDetails = loanDetails; + } + + private CustomerController customerCtrl; + private LoanController loanCtrl; + private EndorsementController endorsementCtrl; + + private People customer; + private Loan loan; + private People endorsement; + + private String customerId; + private String loanId; + private String endorsementId; + + private List loanEndorsement; + private List loanCustomer; + private Loan selectedLoanCustomer; + + private List loanDetails; + + @PostConstruct + public void init() { + loadBundlePropertyFile(); + customerCtrl = new CustomerController(); + loanCtrl = new LoanController(); + endorsementCtrl = new EndorsementController(); + + setLoanId(externalContext().getRequestParameterMap().get("selectedId")); + loan = loanCtrl.getLoanById(getLoanId()); + customer = loan.getCustomer(); + endorsement = loan.getEndorsement(); + loanEndorsement = getLoanByEndorsement(loan.getEndorsement().getId()); + loanCustomer = getLoanByCustomer(loan.getCustomer().getId()); + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/login/LoginBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/login/LoginBean.java new file mode 100644 index 0000000..961068c --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/login/LoginBean.java @@ -0,0 +1,220 @@ +/* + * 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.web.beans.login; + +import com.arrebol.apc.controller.login.LoginService; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.web.beans.GenericBean; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.core.UserByOffice; +import com.arrebol.apc.security.APCSecure; +import java.io.IOException; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.annotation.PreDestroy; +import javax.enterprise.context.SessionScoped; +import javax.faces.application.FacesMessage; +import javax.faces.context.ExternalContext; +import javax.faces.context.FacesContext; +import javax.inject.Inject; +import javax.inject.Named; +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Named +@SessionScoped +public class LoginBean extends GenericBean implements Serializable { + + /** + * Authentication and authorization user. + * + * @throws IOException from {@link ExternalContext#redirect(String)} + */ + public void login() throws IOException { + ExternalContext externalContext = externalContext(); + HttpServletRequest request = (HttpServletRequest) externalContext.getRequest(); + + try { + logger.info("User: " + getUsername()); + request.login(getUsername() + getOfficeId(), getPassword()); + + User user = new User("", getUsername()); + Office office = new Office(getOfficeId(), getOfficeName()); + + setLoggedUser(loginService.findUserLoggedController(new UserByOffice(user, office))); + + externalContext.redirect(forwardUrl); + + } catch (ServletException | IOException e) { + logger.error("Login() - " + e, e); + //logout(); + showMessage(FacesMessage.SEVERITY_ERROR, getBundlePropertyFile().getString("error.access.title"), getBundlePropertyFile().getString("error.access.details")); + //showMessage(FacesMessage.SEVERITY_ERROR, "Ā”Acceso denegado!", "Verifica tus datos de ingreso."); + } catch (Exception e) { + logger.error("Login() - " + e, e); + //logout(); + showMessage(FacesMessage.SEVERITY_FATAL, getBundlePropertyFile().getString("fatal.access.title"), getBundlePropertyFile().getString("fatal.access.details")); + //showMessage(FacesMessage.SEVERITY_ERROR, "Ā”Acceso denegado!", "Por favor contacta a tu administrador."); + } + } + + /** + * Remove current user from session. + * + * @throws IOException from {@link ExternalContext#redirect(String)} + */ + public void logout() throws IOException { + try { + ExternalContext externalContext = externalContext(); + + externalContext.invalidateSession(); + externalContext.redirect(externalContext.getRequestContextPath() + LOGIN); + } catch (IOException e) { + logger.error("logout() - " + e, e); + } + } + + /** + * Check if currently user has the given role. + * + * @param role Role to be search. + * @return true if user has given role otherwise false.. + */ + public boolean isUserInRole(String role) { + FacesContext context = facesContext(); + ExternalContext externalContext = context.getExternalContext(); + + return externalContext.isUserInRole(role); + } + + /** + * + * @return + */ + private String extractRequestedUrlBeforeLogin() { + ExternalContext externalContext = externalContext(); + + String requestedUrl = (String) externalContext.getRequestMap().get(RequestDispatcher.FORWARD_REQUEST_URI); + if (null == requestedUrl) { + return externalContext.getRequestContextPath() + LOGIN; + } + + String queryString = (String) externalContext.getRequestMap().get(RequestDispatcher.FORWARD_QUERY_STRING); + + return requestedUrl + (queryString == null ? "" : "?" + queryString); + } + + /** + * Class contants. + */ + private static final long serialVersionUID = -6130715794722525144L; + + private static final String LOGIN = "/"; + + final Logger logger = LogManager.getLogger(LoginBean.class); + + /** + * Class variables. + */ + @Inject + private LoginService loginService; + + private String forwardUrl; + private String password; + private String username; + private String officeName; + private String officeId; + //private LoginController controller; + List offices; + + /** + * Contructors and pre/post contructors. + */ + @PostConstruct + public void init() { + try { + loadBundlePropertyFile(); + this.forwardUrl = extractRequestedUrlBeforeLogin(); + setOffices(loginService.getAllActiveOfficeController()); + } catch (Exception e) { + logger.error(e.getClass() + " --> " + e.getMessage(), e); + } + } + + @PreDestroy + public void finish() { + try { + logout(); + } catch (Exception e) { + logger.error(e.getClass() + " --> " + e.getMessage(), e); + } + } + + /** + * Getters and Setters. + * + * @return + */ + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = new APCSecure(APP, password).getPassword(); + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getOfficeName() { + try { + int index = offices.indexOf(new Office(officeId)); + officeName = offices.get(index).getOfficeName(); + } catch (Exception e) { + } + return officeName; + } + + public void setOfficeName(String officeName) { + this.officeName = officeName; + } + + public String getOfficeId() { + return officeId; + } + + public void setOfficeId(String officeId) { + this.officeId = officeId; + } + + public List getOffices() { + if (null == offices) { + offices = new ArrayList<>(); + } + return offices; + } + + public void setOffices(List offices) { + this.offices = offices; + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/system/bitacora/BitacoraBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/system/bitacora/BitacoraBean.java new file mode 100644 index 0000000..fe6a465 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/system/bitacora/BitacoraBean.java @@ -0,0 +1,127 @@ +/* + * 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.web.beans.system.bitacora; + +import com.arrebol.apc.controller.BitacoraController; + +import com.arrebol.apc.model.system.logs.Bitacora; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.util.Calendar; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Named("bitacoraManager") +@ViewScoped +public class BitacoraBean 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 { + setBitacora(fillDatatableBitacoraByDate()); + } + } catch (Exception e) { + } + } + + public void searchAllAction() { + try { + if (getStarDate().after(getEndDate())) { + showMessage(FacesMessage.SEVERITY_ERROR, getBundlePropertyFile().getString("generic.start.date"), getBundlePropertyFile().getString("generic.end.date.error")); + } else { + setBitacora(fillDatatableBitacora()); + } + } catch (Exception e) { + } + } + + public List fillDatatableBitacora() { + + return bitacoraCtrl.fillBitacoraDatatable(getLoggedUser().getOffice().getId()); + } + + public List fillDatatableBitacoraByDate() { + + return bitacoraCtrl.fillBitacoraDatatableByDate(getLoggedUser().getOffice().getId(), 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 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 addRow() { + } + + @Override + public void deleteRow() { + + } + + public BitacoraController getBitacoraCtrl() { + return bitacoraCtrl; + } + + public void setBitacoraCtrl(BitacoraController bitacoraCtrl) { + this.bitacoraCtrl = bitacoraCtrl; + } + + public List getBitacora() { + return bitacora; + } + + public void setBitacora(List bitacora) { + this.bitacora = bitacora; + } + + public Bitacora getSelectedBitacora() { + return selectedBitacora; + } + + public void setSelectedBitacora(Bitacora selectedBitacora) { + this.selectedBitacora = selectedBitacora; + } + + private BitacoraController bitacoraCtrl; + + private List bitacora; + + private Bitacora selectedBitacora; + + @PostConstruct + public void init() { + loadBundlePropertyFile(); + initStartAndEndDates(Calendar.DAY_OF_WEEK, 2); + bitacoraCtrl = new BitacoraController(); + bitacora = fillDatatableBitacora(); + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/system/employee/EmployeeBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/system/employee/EmployeeBean.java new file mode 100644 index 0000000..0b10e19 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/system/employee/EmployeeBean.java @@ -0,0 +1,622 @@ +/* + * 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.web.beans.system.employee; + +import com.arrebol.apc.controller.catalog.RoleController; +import com.arrebol.apc.controller.system.employee.EmployeeController; +import com.arrebol.apc.model.admin.Bonus; +import com.arrebol.apc.model.catalog.RoleCtlg; +import com.arrebol.apc.model.core.HumanResource; +import com.arrebol.apc.model.core.HumanResourceByOffice; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.enums.ApplicationOwner; +import com.arrebol.apc.model.enums.HumanResourceStatus; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.annotation.PreDestroy; +import javax.faces.application.FacesMessage; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Named +@ViewScoped +public class EmployeeBean extends GenericBean implements Serializable { + + public void saveHR() { + logger.debug("saveHR"); + try { + getSaveHumanResource().setAvatar("images/avatar.png"); + getSaveHumanResource().setRoleCtlg(new RoleCtlg(role)); + getSaveHumanResource().setHumanResourceStatus(HumanResourceStatus.ENEBLED); + getSaveHumanResource().setCreatedBy(getLoggedUser().getUser().getId()); + getSaveHumanResource().setBalance(BigDecimal.ZERO); + + if (getSaveHumanResource().getEmployeeSaving() == null) { + getSaveHumanResource().setEmployeeSaving(BigDecimal.ZERO); + } + + String messafeFormat = getBundlePropertyFile().getString("message.format.failure"); + FacesMessage.Severity severity = FacesMessage.SEVERITY_WARN; + + HumanResourceByOffice humanResourceByOffice = new HumanResourceByOffice( + new Office(getLoggedUser().getOffice().getId()), + getLoggedUser().getUser().getId(), + new Date(), + ApplicationOwner.APP_USER + ); + + if (null != getBonusId() && getBonusId().length() == 36) { + getSaveHumanResource().setBonus(new Bonus(getBonusId())); + } + + if (getController().saveHRController(humanResourceByOffice, getSaveHumanResource())) { + setSaveHumanResource(new HumanResource()); + + messafeFormat = getBundlePropertyFile().getString("message.format.sucess"); + severity = FacesMessage.SEVERITY_INFO; + + refreshDropBox(); + } + Object[] param = {getBundlePropertyFile().getString("employee"), getBundlePropertyFile().getString("created")}; + + buildAndSendMessage(param, messafeFormat, severity, getBundlePropertyFile().getString("employee")); + } catch (Exception e) { + logger.error("saveHR", e); + Object[] param = {getBundlePropertyFile().getString("created")}; + + buildAndSendMessage( + param, + getBundlePropertyFile().getString("message.format.fatal"), + FacesMessage.SEVERITY_FATAL, + getBundlePropertyFile().getString("employee") + ); + } + } + + /** + * + * @param action 1 = TO DISABLED, 2 = TO ENEBLED, 3 = TO DELETED, 4 NOT + * ALLOWED + */ + public void actionDropBox(int action) { + logger.debug("actionDropBox"); + try { + String messageTitle = getBundlePropertyFile().getString("employee"); + String actionUserIdSelected = null; + String messageAction = null; + + HumanResourceStatus status = null; + + switch (action) { + case 1: + actionUserIdSelected = getEnebledId(); + messageAction = getBundlePropertyFile().getString("disabled"); + status = HumanResourceStatus.DISABLED; + break; + case 2: + actionUserIdSelected = getDisabledId(); + messageAction = getBundlePropertyFile().getString("enebled"); + status = HumanResourceStatus.ENEBLED; + break; + case 3: + actionUserIdSelected = getDeletedId(); + messageAction = getBundlePropertyFile().getString("deleted"); + status = HumanResourceStatus.DELETED; + break; + default: + throw new Exception(action + " is NOT valid a option"); + } + + if (executeAction(status, actionUserIdSelected, messageTitle, messageAction)) { + refreshDropBox(); + } + } catch (Exception e) { + logger.error("actionDropBox", e); + Object[] param = {getBundlePropertyFile().getString("employee")}; + + buildAndSendMessage( + param, + getBundlePropertyFile().getString("message.format.fatal"), + FacesMessage.SEVERITY_FATAL, + getBundlePropertyFile().getString("process") + ); + } + } + + public void updateSlctBtnHRAction() { + logger.debug("updateHR"); + try { + getUpdateHumanResource().setLastUpdatedBy(getLoggedUser().getUser().getId()); + getUpdateHumanResource().setLastUpdatedOn(new Date()); + getUpdateHumanResource().setRoleCtlg(new RoleCtlg(roleUpdate)); + + if (getUpdateHumanResource().getEmployeeSaving() == null) { + getUpdateHumanResource().setEmployeeSaving(BigDecimal.ZERO); + } + + String messafeFormat = getBundlePropertyFile().getString("message.format.failure"); + FacesMessage.Severity severity = FacesMessage.SEVERITY_WARN; + + if (null != getBonusId() && getBonusId().length() == 36) { + getUpdateHumanResource().setBonus(new Bonus(getBonusId())); + } + + if (getController().updateByHumanResourceId(getUpdateHumanResource(), false)) { + messafeFormat = getBundlePropertyFile().getString("message.format.sucess"); + severity = FacesMessage.SEVERITY_INFO; + } + + Object[] param = {getBundlePropertyFile().getString("employee"), getBundlePropertyFile().getString("updated")}; + + buildAndSendMessage(param, messafeFormat, severity, getBundlePropertyFile().getString("employee")); + } catch (Exception e) { + logger.error("updateSlctBtnHRActionListener", e); + Object[] param = {getBundlePropertyFile().getString("updated")}; + + buildAndSendMessage( + param, + getBundlePropertyFile().getString("message.format.fatal"), + FacesMessage.SEVERITY_FATAL, + getBundlePropertyFile().getString("employee") + ); + } + } + + public void loadUserToUpdate() { + try { + setUpdateHumanResource(getController().findHumanResourceById(getUpdateId())); + setRoleUpdate(getUpdateHumanResource().getBonus().getId()); + updateBonusId = getRoleUpdate(); + } catch (Exception e) { + logger.error("updateSlctBtnHRActionListener", e); + Object[] param = {getBundlePropertyFile().getString("searching")}; + + buildAndSendMessage( + param, + getBundlePropertyFile().getString("message.format.fatal"), + FacesMessage.SEVERITY_FATAL, + getBundlePropertyFile().getString("employee") + ); + } + } + + /** + * + * @param option 1 = to disabled, 2 = to enebled, 4 = to updated + */ + public void enebledDisabledDropBoxListener(int option) { + logger.debug("enebledDisabledDropBoxListener"); + try { + HumanResourceStatus status = HumanResourceStatus.ENEBLED; + + boolean goAHead = false; + + switch (option) { + case 1: + if (isEnebledHR()) { + goAHead = isEnebledHR(); + } else { + setEnebledHumanResourcesLst(null); + } + break; + case 2: + if (isDisabledHR()) { + goAHead = isDisabledHR(); + } else { + setDeletedHumanResourcesLst(null); + } + break; + case 4: + if (isSelectedUpdateHR()) { + goAHead = isSelectedUpdateHR(); + } else { + setUpdateHumanResourcesLst(null); + setUpdateHumanResource(new HumanResource()); + setRoleUpdate("N/A"); + } + break; + } + + if (goAHead) { + if (2 == option) { + status = HumanResourceStatus.DISABLED; + } + + List results = getController().findEmployeesByType( + new Office(getLoggedUser().getOffice().getId()), + status, + getLoggedUser().getUser().getHumanResource().getId() + ); + + switch (option) { + case 1: + setEnebledHumanResourcesLst(results); + break; + case 2: + setDisabledHumanResourcesLst(results); + break; + case 4: + setUpdateHumanResourcesLst(results); + setUpdateHumanResource(new HumanResource()); + break; + } + } + } catch (Exception e) { + logger.error("enebledDisabledDropBoxListener"); + + Object[] param = {getBundlePropertyFile().getString("searching")}; + + buildAndSendMessage( + param, + getBundlePropertyFile().getString("message.format.fatal"), + FacesMessage.SEVERITY_FATAL, + getBundlePropertyFile().getString("employee") + ); + } + } + + public void deletedHRListener() { + try { + if (isDeletedHR()) { + List statusLst = new ArrayList<>(); + + statusLst.add(HumanResourceStatus.ENEBLED); + statusLst.add(HumanResourceStatus.DISABLED); + + setDeletedHumanResourcesLst( + getController().findEmployeesInType( + new Office(getLoggedUser().getOffice().getId()), + statusLst, + getLoggedUser().getUser().getHumanResource().getId() + ) + ); + } else { + setDeletedHumanResourcesLst(null); + } + } catch (Exception e) { + logger.error("deletedHRListener", e); + Object[] param = {getBundlePropertyFile().getString("searching")}; + + buildAndSendMessage( + param, + getBundlePropertyFile().getString("message.format.fatal"), + FacesMessage.SEVERITY_FATAL, + getBundlePropertyFile().getString("employee") + ); + } + } + + /** + * + * @param status + * @param userIdSelected + * @param msgTitle + * @param msgAction + */ + private boolean executeAction(HumanResourceStatus status, String userIdSelected, String msgTitle, String msgAction) { + logger.debug("executeAction"); + + boolean success = false; + + try { + String messafeFormat = getBundlePropertyFile().getString("message.format.failure"); + FacesMessage.Severity severity = FacesMessage.SEVERITY_WARN; + + success = getController().updateHRByStatus(status, userIdSelected, getLoggedUser().getUser().getId()); + + if (success) { + logger.debug("executeAction"); + + messafeFormat = getBundlePropertyFile().getString("message.format.sucess"); + severity = FacesMessage.SEVERITY_INFO; + } + + Object[] param = {msgTitle, msgAction}; + + buildAndSendMessage(param, messafeFormat, severity, msgTitle); + } catch (Exception e) { + logger.error("executeAction", e); + Object[] param = {msgTitle}; + + buildAndSendMessage( + param, + getBundlePropertyFile().getString("message.format.fatal"), + FacesMessage.SEVERITY_FATAL, + msgTitle + ); + } + return success; + } + + private void refreshDropBox() { + try { + if (isEnebledHR()) { + enebledDisabledDropBoxListener(1); + } + if (isDisabledHR()) { + enebledDisabledDropBoxListener(2); + } + + if (isDeletedHR()) { + deletedHRListener(); + } + + if (isSelectedUpdateHR()) { + enebledDisabledDropBoxListener(4); + } + } catch (Exception e) { + logger.error("executeAction", e); + } + } + + private static final long serialVersionUID = 2969985354193657703L; + final Logger logger = LogManager.getLogger(EmployeeBean.class); + + private EmployeeController controller; + private RoleController roleCtrl; + + private HumanResource saveHumanResource; + private HumanResource updateHumanResource; + + private String role; + private List roles; + + private boolean selectedUpdateHR; + private String updateId; + + private String roleUpdate; + private List updateHumanResourcesLst; + private List typeLst; + + private boolean enebledHR; + private String enebledId; + private List enebledHumanResourcesLst; + + private boolean disabledHR; + private String disabledId; + private List disabledHumanResourcesLst; + + private boolean deletedHR; + private String deletedId; + private List deletedHumanResourcesLst; + + private String bonusId; + private List bonuses; + private String updateBonusId; + + @PostConstruct() + public void init() { + try { + loadBundlePropertyFile(); + setController(new EmployeeController()); + setRoleCtrl(new RoleController()); + setSaveHumanResource(new HumanResource()); + setUpdateHumanResource(new HumanResource()); + roles = getRoleCtrl().fillRolesDatatable(); + setBonuses(getController().findAllActiveBonus(getLoggedUser().getOffice().getId())); + } catch (Exception e) { + logger.error("init", e); + } + } + + @PreDestroy + public void finish() { + try { + setSaveHumanResource(new HumanResource()); + setUpdateHumanResource(new HumanResource()); + setController(null); + } catch (Exception e) { + logger.error("finish", e); + } + } + + public RoleController getRoleCtrl() { + return roleCtrl; + } + + public void setRoleCtrl(RoleController roleCtrl) { + this.roleCtrl = roleCtrl; + } + + public EmployeeController getController() { + return controller; + } + + public void setController(EmployeeController controller) { + this.controller = controller; + } + + public HumanResource getSaveHumanResource() { + return saveHumanResource; + } + + public void setSaveHumanResource(HumanResource saveHumanResource) { + this.saveHumanResource = saveHumanResource; + } + + public HumanResource getUpdateHumanResource() { + return updateHumanResource; + } + + public void setUpdateHumanResource(HumanResource updateHumanResource) { + this.updateHumanResource = updateHumanResource; + } + + public String getRole() { + return role; + } + + public void setRole(String role) { + this.role = role; + } + + public List getRoles() { + if (null == roles) { + /* + roles = Stream.of( + HumanResourceType.values()) + .map(Enum::name) + .collect(Collectors.toList() + ); + */ + } + return roles; + } + + public void setRoles(List roles) { + this.roles = roles; + } + + public boolean isSelectedUpdateHR() { + return selectedUpdateHR; + } + + public void setSelectedUpdateHR(boolean selectedUpdateHR) { + this.selectedUpdateHR = selectedUpdateHR; + } + + public String getUpdateId() { + return updateId; + } + + public void setUpdateId(String updateId) { + this.updateId = updateId; + } + + public String getRoleUpdate() { + return roleUpdate; + } + + public void setRoleUpdate(String roleUpdate) { + this.roleUpdate = roleUpdate; + } + + public List getUpdateHumanResourcesLst() { + return updateHumanResourcesLst; + } + + public void setUpdateHumanResourcesLst(List updateHumanResourcesLst) { + this.updateHumanResourcesLst = updateHumanResourcesLst; + } + + public List getTypeLst() { + return typeLst; + } + + public void setTypeLst(List typeLst) { + this.typeLst = typeLst; + } + + public boolean isEnebledHR() { + return enebledHR; + } + + public void setEnebledHR(boolean enebledHR) { + this.enebledHR = enebledHR; + } + + public String getEnebledId() { + return enebledId; + } + + public void setEnebledId(String enebledId) { + this.enebledId = enebledId; + } + + public List getEnebledHumanResourcesLst() { + return enebledHumanResourcesLst; + } + + public void setEnebledHumanResourcesLst(List enebledHumanResourcesLst) { + this.enebledHumanResourcesLst = enebledHumanResourcesLst; + } + + public boolean isDisabledHR() { + return disabledHR; + } + + public void setDisabledHR(boolean disabledHR) { + this.disabledHR = disabledHR; + } + + public String getDisabledId() { + return disabledId; + } + + public void setDisabledId(String disabledId) { + this.disabledId = disabledId; + } + + public List getDisabledHumanResourcesLst() { + return disabledHumanResourcesLst; + } + + public void setDisabledHumanResourcesLst(List disabledHumanResourcesLst) { + this.disabledHumanResourcesLst = disabledHumanResourcesLst; + } + + public boolean isDeletedHR() { + return deletedHR; + } + + public void setDeletedHR(boolean deletedHR) { + this.deletedHR = deletedHR; + } + + public String getDeletedId() { + return deletedId; + } + + public void setDeletedId(String deletedId) { + this.deletedId = deletedId; + } + + public List getDeletedHumanResourcesLst() { + return deletedHumanResourcesLst; + } + + public void setDeletedHumanResourcesLst(List deletedHumanResourcesLst) { + this.deletedHumanResourcesLst = deletedHumanResourcesLst; + } + + public String getBonusId() { + return bonusId; + } + + public void setBonusId(String bonusId) { + this.bonusId = bonusId; + } + + public List getBonuses() { + return bonuses; + } + + public void setBonuses(List bonuses) { + this.bonuses = bonuses; + } + + public String getUpdateBonusId() { + return updateBonusId; + } + + public void setUpdateBonusId(String updateBonusId) { + this.updateBonusId = updateBonusId; + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/system/office/OfficeBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/system/office/OfficeBean.java new file mode 100644 index 0000000..028d8dd --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/system/office/OfficeBean.java @@ -0,0 +1,142 @@ +/* + * 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.web.beans.system.office; + +import com.arrebol.apc.controller.system.office.OfficeController; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.enums.OfficeStatus; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.context.FacesContext; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Named("officeManager") +@ViewScoped +public class OfficeBean extends GenericBean implements Serializable, Datatable{ + + public List fillDatatableOffice() { + + return officeCtrl.fillOfficeDatatable(); + } + + @Override + public void editRow(RowEditEvent event) { + Office office = (Office) event.getObject(); + if (office != null) { + officeCtrl.updateByOfficeId(office); + showMessage(FacesMessage.SEVERITY_INFO, "Registro Editado", "Se hizo el cambio correctamente."); + } } + + @Override + public void onRowCancel(RowEditEvent event) { + showMessage(FacesMessage.SEVERITY_INFO, "EdiciĆ³n Cancelada", ((Office) event.getObject()).getOfficeName()); + } + + @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() { + Office officeObj = new Office(); + officeObj.setOfficeName(name); + officeObj.setAddress(address); + officeObj.setOfficeStatus(OfficeStatus.ENEBLED); + officeObj.setCreatedBy(getLoggedUser().getUser().getId()); + + officeCtrl.saveOffice(officeObj); + office.add(officeObj); + FacesMessage msg = new FacesMessage("Nueva oficina", "Se agregĆ³ correctamente"); + FacesContext.getCurrentInstance().addMessage(null, msg); + } + + @Override + public void deleteRow() { + officeCtrl.updateOfficeByStatus(OfficeStatus.DISABLED, selectedOffice.getId(), getLoggedUser().getUser().getId()); + office.remove(selectedOffice); + selectedOffice = null; + showMessage(FacesMessage.SEVERITY_INFO, "Oficina eliminada", "Se eliminĆ³ correctamente."); + } + + public OfficeController getOfficeCtrl() { + return officeCtrl; + } + + public void setOfficeCtrl(OfficeController officeCtrl) { + this.officeCtrl = officeCtrl; + } + + public List getOffice() { + return office; + } + + public void setOffice(List office) { + this.office = office; + } + + public Office getSelectedOffice() { + return selectedOffice; + } + + public void setSelectedOffice(Office selectedOffice) { + this.selectedOffice = selectedOffice; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + private OfficeController officeCtrl; + + private List office; + + private Office selectedOffice; + + private String id; + private String name; + private String address; + + @PostConstruct + public void init() { + officeCtrl = new OfficeController(); + office = fillDatatableOffice(); + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/system/user/UserAccessBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/system/user/UserAccessBean.java new file mode 100644 index 0000000..5a32052 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/system/user/UserAccessBean.java @@ -0,0 +1,195 @@ +/* + * 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.web.beans.system.user; + +import com.arrebol.apc.controller.system.user.UserAccessController; +import com.arrebol.apc.model.core.HumanResource; +import com.arrebol.apc.model.core.Permission; +import com.arrebol.apc.model.core.UserByOffice; +import com.arrebol.apc.model.enums.UserStatus; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.primefaces.model.DualListModel; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Named +@ViewScoped +public class UserAccessBean extends GenericBean implements Serializable { + + public void dropBoxOnchange() { + try { + List source = new ArrayList<>(); + List target = new ArrayList<>(); + + setHr(new HumanResource()); + setDualPermissionLst(new DualListModel<>(source, target)); + setUpdateForm(false); + } catch (Exception e) { + logger.error("saveHR", e); + Object[] param = {getBundlePropertyFile().getString("searching")}; + + buildAndSendMessage( + param, + getBundlePropertyFile().getString("message.format.fatal"), + FacesMessage.SEVERITY_FATAL, + getBundlePropertyFile().getString("user") + ); + } + } + + public void loadUserByOfficePermissionLst() { + try { + UserByOffice loadUserByOffice = new UserByOffice(getUserByOfficeId()); + + List source = getController().loadUserByOfficePermissionLst(loadUserByOffice, true); + List target = getController().loadUserByOfficePermissionLst(loadUserByOffice, false); + + int index = getUserByOfficeLst().indexOf(loadUserByOffice); + + setHr(getUserByOfficeLst().get(index).getUser().getHumanResource()); + setDualPermissionLst(new DualListModel<>(source, target)); + setUpdateForm(true); + } catch (Exception e) { + logger.error("saveHR", e); + Object[] param = {getBundlePropertyFile().getString("searching")}; + + buildAndSendMessage( + param, + getBundlePropertyFile().getString("message.format.fatal"), + FacesMessage.SEVERITY_FATAL, + getBundlePropertyFile().getString("user") + ); + } + } + + public void savePermission() { + logger.debug("savePermission"); + + String messafeFormat = getBundlePropertyFile().getString("message.format.fatal"); + String messageTitle = getBundlePropertyFile().getString("user"); + String messageAction = getBundlePropertyFile().getString("updated"); + + FacesMessage.Severity severity = FacesMessage.SEVERITY_FATAL; + try { + if (getController().updatePermissionsController(dualPermissionLst.getTarget(), getUserByOfficeId(), getLoggedUser().getUser().getId())) { + messafeFormat = getBundlePropertyFile().getString("message.format.sucess"); + severity = FacesMessage.SEVERITY_INFO; + } else { + messafeFormat = getBundlePropertyFile().getString("message.format.failure"); + severity = FacesMessage.SEVERITY_WARN; + } + + Object[] param = {messageTitle, messageAction}; + + buildAndSendMessage(param, messafeFormat, severity, messageTitle); + } catch (Exception e) { + logger.error("savePermission", e); + Object[] param = {messageAction}; + + buildAndSendMessage(param, messafeFormat, severity, messageTitle); + } + } + + private static final long serialVersionUID = 6738057461247413139L; + final Logger logger = LogManager.getLogger(UserAccessBean.class); + + private UserAccessController controller; + private String userByOfficeId; + private List userByOfficeLst; + private DualListModel dualPermissionLst; + private HumanResource hr; + private boolean updateForm; + + @PostConstruct + public void init() { + try { + loadBundlePropertyFile(); + + setController(new UserAccessController()); + + List statuses = new ArrayList<>(); + + statuses.add(UserStatus.ENEBLED); + + setUserByOfficeLst( + getController().findUsersInOfficeInStatuses( + statuses, + getLoggedUser().getOffice().getId(), + getLoggedUser().getUser().getId() + ) + ); + + List source = new ArrayList<>(); + List target = new ArrayList<>(); + + setDualPermissionLst(new DualListModel<>(source, target)); + } catch (Exception e) { + logger.error("init", e); + } + } + + public UserAccessController getController() { + return controller; + } + + public void setController(UserAccessController controller) { + this.controller = controller; + } + + public String getUserByOfficeId() { + return userByOfficeId; + } + + public void setUserByOfficeId(String userByOfficeId) { + this.userByOfficeId = userByOfficeId; + } + + public List getUserByOfficeLst() { + return userByOfficeLst; + } + + public void setUserByOfficeLst(List userByOfficeLst) { + this.userByOfficeLst = userByOfficeLst; + } + + public DualListModel getDualPermissionLst() { + return dualPermissionLst; + } + + public void setDualPermissionLst(DualListModel dualPermissionLst) { + this.dualPermissionLst = dualPermissionLst; + } + + public HumanResource getHr() { + return hr; + } + + public void setHr(HumanResource hr) { + this.hr = hr; + } + + public boolean isUpdateForm() { + return updateForm; + } + + public void setUpdateForm(boolean updateForm) { + this.updateForm = updateForm; + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/system/user/UserAdminBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/system/user/UserAdminBean.java new file mode 100644 index 0000000..decbbc5 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/system/user/UserAdminBean.java @@ -0,0 +1,567 @@ +/* + * 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.web.beans.system.user; + +import com.arrebol.apc.controller.system.user.UserAdminController; +import com.arrebol.apc.model.catalog.RouteCtlg; +import com.arrebol.apc.model.core.UserByOffice; +import com.arrebol.apc.model.enums.UserStatus; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.primefaces.model.DualListModel; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Named +@ViewScoped +public class UserAdminBean extends GenericBean implements Serializable { + + /** + * + * @param option 1 = enebled,2 = disabled, 3 = deleted, 4 = username, 5 = + * password, 6 = avatar, 7 = routes + */ + public void enebledDisabledListener(int option) { + try { + boolean goAHead = false; + + List statuses = new ArrayList<>(); + + switch (option) { + case 1: + if (isEnebled()) { + goAHead = true; + statuses.add(UserStatus.ENEBLED); + } else { + setEnebledLst(null); + } + break; + case 2: + if (isDisabled()) { + goAHead = true; + statuses.add(UserStatus.DISABLED); + } else { + setDisabledLst(null); + } + break; + case 3: + if (isDeleted()) { + goAHead = true; + statuses.add(UserStatus.ENEBLED); + statuses.add(UserStatus.DISABLED); + } else { + setDeletedLst(null); + } + break; + case 4: + if (isUsername()) { + goAHead = true; + statuses.add(UserStatus.ENEBLED); + } else { + setUserNameLst(null); + } + break; + case 5: + if (isPwd()) { + goAHead = true; + statuses.add(UserStatus.ENEBLED); + } else { + setPwdLst(null); + } + break; + case 6: + if (isAvatar()) { + goAHead = true; + statuses.add(UserStatus.ENEBLED); + } else { + setAvatarLst(null); + } + case 7: + if (isRoute()) { + goAHead = true; + statuses.add(UserStatus.ENEBLED); + } else { + setRouteLst(null); + } + break; + } + + if (goAHead) { + loadDropBoxData(statuses, option); + } + } catch (Exception e) { + logger.error("enebledDisabledListener", e); + Object[] param = {getBundlePropertyFile().getString("searching")}; + + buildAndSendMessage( + param, + getBundlePropertyFile().getString("message.format.fatal"), + FacesMessage.SEVERITY_FATAL, + getBundlePropertyFile().getString("user") + ); + } + } + + /** + * + * @param option 1 = enebled, 2 = disabled, 3 = deleted, 4 = username, 5 = + * password, 6 = avatar: + */ + public void dropBoxListener(int option) { + switch (option) { + case 1: + setEnebledSelected(getEnebledLst().get(getEnebledLst().indexOf(new UserByOffice(getEnebledId())))); + break; + case 2: + setDisabledSelected(getDisabledLst().get(getDisabledLst().indexOf(new UserByOffice(getDisabledId())))); + break; + case 3: + setDeletedSelected(getDeletedLst().get(getDeletedLst().indexOf(new UserByOffice(getDeletedId())))); + break; + case 4: + setUserNameSelected(getUserNameLst().get(getUserNameLst().indexOf(new UserByOffice(getUsernameId())))); + break; + case 5: + setPwdSelected(getPwdLst().get(getPwdLst().indexOf(new UserByOffice(getPwdId())))); + break; + case 6: + setAvatarSelect(getAvatarLst().get(getAvatarLst().indexOf(new UserByOffice(getAvatarId())))); + break; + case 7: + setRouteSelect(getRouteLst().get(getRouteLst().indexOf(new UserByOffice(getRouteId())))); + // getRouteId() = user selected id + + break; + } + } + + /** + * + */ + public void onUserTypeSlctChange() { + if (null == getUserType() || getUserType().equals("WEB") || getUserType().equals("N/A")) { + setCertifier(false); + setRouteCtlgLst(new ArrayList<>()); + setDualRouteCtlgLst(new DualListModel<>(new ArrayList<>(), new ArrayList<>())); + } else if (getUserType().equals("BOTH") || getUserType().equals("MOBILE")) { + try { + setRouteCtlgLst(getController().findRoutesByOffice(getLoggedUser().getOffice().getId())); + setDualRouteCtlgLst(new DualListModel<>(getController().findRoutesWithNoCertifierUser(getLoggedUser().getOffice().getId()), new ArrayList<>())); + } catch (Exception ex) { + logger.error("onUserTypeSlctChange", ex); + } + } + } + + /** + * + */ + public void onCertifiedChange() { + try { + if (isCertifier()) { + setDualRouteCtlgLst( + new DualListModel<>( + getController().findRoutesWithNoCertifierUser(getLoggedUser().getOffice().getId()), + new ArrayList<>() + ) + ); + setRouteCtlgLst(new ArrayList<>()); + } else { + setDualRouteCtlgLst(new DualListModel<>(new ArrayList<>(), new ArrayList<>())); + setRouteCtlgLst(getController().findRoutesByOffice(getLoggedUser().getOffice().getId())); + } + } catch (Exception e) { + logger.error("onCertifiedChange", e); + } + } + + /** + * + * @param option 1 = enebled, 2 = disabled, 3 = deleted, 4 = username, 5 = + * password, 6 = avatar: + */ + private void loadDropBoxData(List statuses, int option) { + try { + + List retults = getController().findUsersInOfficeInStatuses(statuses, getLoggedUser().getOffice().getId(), getLoggedUser().getUser().getId()); + + switch (option) { + case 1: + setEnebledLst(retults); + break; + case 2: + setDisabledLst(retults); + break; + case 3: + setDeletedLst(retults); + break; + case 4: + setUserNameLst(retults); + break; + case 5: + setPwdLst(retults); + break; + case 6: + setAvatarLst(retults); + break; + case 7: + setRouteLst(retults); + break; + } + } catch (Exception e) { + logger.error("loadDropBoxData", e); + throw e; + } + } + + private static final long serialVersionUID = -2325684946201829629L; + final Logger logger = LogManager.getLogger(UserAdminBean.class); + + private UserAdminController controller; + + private List enebledLst; + private List disabledLst; + private List deletedLst; + private List userNameLst; + private List pwdLst; + private List avatarLst; + private List routeLst; + + private UserByOffice enebledSelected; + private UserByOffice disabledSelected; + private UserByOffice deletedSelected; + private UserByOffice userNameSelected; + private UserByOffice pwdSelected; + private UserByOffice avatarSelect; + private UserByOffice routeSelect; + + private String enebledId; + private String disabledId; + private String deletedId; + private String usernameId; + private String pwdId; + private String avatarId; + private String routeId; + + private boolean enebled; + private boolean disabled; + private boolean deleted; + private boolean username; + private boolean pwd; + private boolean avatar; + private boolean route; + + private String userType; + private boolean certifier; + private boolean enebledGrants; + private String routeSelectedId; + private List routeCtlgLst; + private DualListModel dualRouteCtlgLst; + + @PostConstruct + public void init() { + try { + loadBundlePropertyFile(); + + setController(new UserAdminController()); + } catch (Exception e) { + logger.error("init", e); + } + } + + public UserAdminController getController() { + return controller; + } + + public void setController(UserAdminController controller) { + this.controller = controller; + } + + public List getEnebledLst() { + return enebledLst; + } + + public void setEnebledLst(List enebledLst) { + this.enebledLst = enebledLst; + } + + public List getDisabledLst() { + return disabledLst; + } + + public void setDisabledLst(List disabledLst) { + this.disabledLst = disabledLst; + } + + public List getDeletedLst() { + return deletedLst; + } + + public void setDeletedLst(List deletedLst) { + this.deletedLst = deletedLst; + } + + public List getUserNameLst() { + return userNameLst; + } + + public void setUserNameLst(List userNameLst) { + this.userNameLst = userNameLst; + } + + public List getPwdLst() { + return pwdLst; + } + + public void setPwdLst(List pwdLst) { + this.pwdLst = pwdLst; + } + + public List getAvatarLst() { + return avatarLst; + } + + public void setAvatarLst(List avatarLst) { + this.avatarLst = avatarLst; + } + + public List getRouteLst() { + return routeLst; + } + + public void setRouteLst(List routeLst) { + this.routeLst = routeLst; + } + + public UserByOffice getEnebledSelected() { + return enebledSelected; + } + + public void setEnebledSelected(UserByOffice enebledSelected) { + this.enebledSelected = enebledSelected; + } + + public UserByOffice getDisabledSelected() { + return disabledSelected; + } + + public void setDisabledSelected(UserByOffice disabledSelected) { + this.disabledSelected = disabledSelected; + } + + public UserByOffice getDeletedSelected() { + return deletedSelected; + } + + public void setDeletedSelected(UserByOffice deletedSelected) { + this.deletedSelected = deletedSelected; + } + + public UserByOffice getUserNameSelected() { + return userNameSelected; + } + + public void setUserNameSelected(UserByOffice userNameSelected) { + this.userNameSelected = userNameSelected; + } + + public UserByOffice getPwdSelected() { + return pwdSelected; + } + + public void setPwdSelected(UserByOffice pwdSelected) { + this.pwdSelected = pwdSelected; + } + + public UserByOffice getAvatarSelect() { + return avatarSelect; + } + + public void setAvatarSelect(UserByOffice avatarSelect) { + this.avatarSelect = avatarSelect; + } + + public UserByOffice getRouteSelect() { + return routeSelect; + } + + public void setRouteSelect(UserByOffice routeSelect) { + this.routeSelect = routeSelect; + } + + public String getEnebledId() { + return enebledId; + } + + public void setEnebledId(String enebledId) { + this.enebledId = enebledId; + } + + public String getDisabledId() { + return disabledId; + } + + public void setDisabledId(String disabledId) { + this.disabledId = disabledId; + } + + public String getDeletedId() { + return deletedId; + } + + public void setDeletedId(String deletedId) { + this.deletedId = deletedId; + } + + public String getUsernameId() { + return usernameId; + } + + public void setUsernameId(String usernameId) { + this.usernameId = usernameId; + } + + public String getPwdId() { + return pwdId; + } + + public void setPwdId(String pwdId) { + this.pwdId = pwdId; + } + + public String getAvatarId() { + return avatarId; + } + + public void setAvatarId(String avatarId) { + this.avatarId = avatarId; + } + + public String getRouteId() { + return routeId; + } + + public void setRouteId(String routeId) { + this.routeId = routeId; + } + + public boolean isEnebled() { + return enebled; + } + + public void setEnebled(boolean enebled) { + this.enebled = enebled; + } + + public boolean isDisabled() { + return disabled; + } + + public void setDisabled(boolean disabled) { + this.disabled = disabled; + } + + public boolean isDeleted() { + return deleted; + } + + public void setDeleted(boolean deleted) { + this.deleted = deleted; + } + + public boolean isUsername() { + return username; + } + + public void setUsername(boolean username) { + this.username = username; + } + + public boolean isPwd() { + return pwd; + } + + public void setPwd(boolean pwd) { + this.pwd = pwd; + } + + public boolean isAvatar() { + return avatar; + } + + public void setAvatar(boolean avatar) { + this.avatar = avatar; + } + + public boolean isRoute() { + return route; + } + + public void setRoute(boolean route) { + this.route = route; + } + + public String getUserType() { + return userType; + } + + public void setUserType(String userType) { + this.userType = userType; + } + + public boolean isCertifier() { + return certifier; + } + + public void setCertifier(boolean certifier) { + this.certifier = certifier; + } + + public boolean isEnebledGrants() { + return enebledGrants; + } + + public void setEnebledGrants(boolean enebledGrants) { + this.enebledGrants = enebledGrants; + } + + public String getRouteSelectedId() { + return routeSelectedId; + } + + public void setRouteSelectedId(String routeSelectedId) { + this.routeSelectedId = routeSelectedId; + } + + public List getRouteCtlgLst() { + return routeCtlgLst; + } + + public void setRouteCtlgLst(List routeCtlgLst) { + this.routeCtlgLst = routeCtlgLst; + } + + public DualListModel getDualRouteCtlgLst() { + return dualRouteCtlgLst; + } + + public void setDualRouteCtlgLst(DualListModel dualRouteCtlgLst) { + this.dualRouteCtlgLst = dualRouteCtlgLst; + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/system/user/UserCreateBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/system/user/UserCreateBean.java new file mode 100644 index 0000000..997eb9e --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/system/user/UserCreateBean.java @@ -0,0 +1,428 @@ +/* + * 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.web.beans.system.user; + +import com.arrebol.apc.controller.system.user.UserCreateController; +import com.arrebol.apc.model.catalog.RouteCtlg; +import com.arrebol.apc.model.core.HumanResource; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.Permission; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.core.UserByOffice; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.enums.ApplicationOwner; +import com.arrebol.apc.model.enums.HumanResourceStatus; +import com.arrebol.apc.model.enums.UserByOfficeStatus; +import com.arrebol.apc.model.enums.UserStatus; +import com.arrebol.apc.model.enums.UserType; +import com.arrebol.apc.security.APCSecure; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.annotation.PreDestroy; +import javax.faces.application.FacesMessage; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.primefaces.model.DualListModel; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Named +@ViewScoped +public class UserCreateBean extends GenericBean implements Serializable { + + /** + * 1) Verifica que el usuario aun este disponible 2) Verifica que tipo de + * usuario se va a crear y en todos los casos se debera de guardar usuario y + * oficina mĆ”s las carecteristicas propias de cada tipo de usuario: A) WEB + * debe guardar permisos B) MOBILE debe guardar rutas C) BOTH debe guardar + * rutas y permisos. + */ + public void saveUser() { + logger.debug("saveUser"); + + try { + FacesMessage.Severity severity = FacesMessage.SEVERITY_WARN; + String messafeFormat = getBundlePropertyFile().getString("message.format.failure"); + String messageTitle = getBundlePropertyFile().getString("user"); + String messageAction = getBundlePropertyFile().getString("available"); + + if (null != getUserType() && (getUserType().equals("MOBILE") || getUserType().equals("BOTH"))) { + getUser().setCertifier(isCertifier() ? ActiveStatus.ENEBLED : ActiveStatus.DISABLED); + getUser().setManagement(isManagement()? ActiveStatus.ENEBLED : ActiveStatus.DISABLED); + } else { + getUser().setCertifier(ActiveStatus.DISABLED); + getUser().setManagement(ActiveStatus.DISABLED); + } + + getUser().setPassword(new APCSecure(APP, getPwdConfirm()).getPassword()); + getUser().setHumanResource(new HumanResource(getIdHRSelected())); + getUser().setApplicationOwner(ApplicationOwner.APP_USER); + getUser().setUserStatus(UserStatus.ENEBLED); + getUser().setUserType(UserType.valueOf(getUserType())); + getUser().setCreatedBy(getLoggedUser().getUser().getId()); + + List selectedRoutes = new ArrayList<>(); + List selectedPermissions = new ArrayList<>(); + + if (UserType.MOBILE.equals(getUser().getUserType()) + || UserType.BOTH.equals(getUser().getUserType())) { + selectedRoutes.addAll(getDualRouteCtlgLst().getTarget()); + } + + if (UserType.WEB.equals(getUser().getUserType()) + || UserType.BOTH.equals(getUser().getUserType())) { + selectedPermissions.addAll(getDualPermissionLst().getTarget()); + } + + if (isAvailableUserName()) { + messageAction = getBundlePropertyFile().getString("created"); + + setUserByOffice( + new UserByOffice( + new Office(getLoggedUser().getOffice().getId()), + UserByOfficeStatus.ENEBLED, + ApplicationOwner.APP_USER, + getLoggedUser().getUser().getId(), + new Date() + ) + ); + + if (getController().saveUserController(getUser(), getUserByOffice(), selectedRoutes, selectedPermissions)) { + messafeFormat = getBundlePropertyFile().getString("message.format.sucess"); + severity = FacesMessage.SEVERITY_INFO; + cleanForm(); + } else { + severity = FacesMessage.SEVERITY_WARN; + } + } + + Object[] param = {messageTitle, messageAction}; + + buildAndSendMessage(param, messafeFormat, severity, messageTitle); + } catch (Exception e) { + logger.error("saveUser", e); + Object[] param = {getBundlePropertyFile().getString("created")}; + + buildAndSendMessage( + param, + getBundlePropertyFile().getString("message.format.fatal"), + FacesMessage.SEVERITY_FATAL, + getBundlePropertyFile().getString("user") + ); + } + } + + /** + * + */ + private void savePermission() { + logger.debug("savePermission"); + + String messafeFormat = getBundlePropertyFile().getString("message.format.fatal"); + String messageTitle = getBundlePropertyFile().getString("user"); + String messageAction = getBundlePropertyFile().getString("updated"); + + FacesMessage.Severity severity = FacesMessage.SEVERITY_FATAL; + try { + if (!isUpdatePermissions()) { + if (getController().saveManyController(dualPermissionLst.getTarget(), getUserByOffice().getId(), getLoggedUser().getUser().getId())) { + setUpdatePermissions(true); + + messafeFormat = getBundlePropertyFile().getString("message.format.sucess"); + severity = FacesMessage.SEVERITY_INFO; + } else { + messafeFormat = getBundlePropertyFile().getString("message.format.failure"); + severity = FacesMessage.SEVERITY_WARN; + } + } else { + if (getController().updatePermissionsController(dualPermissionLst.getTarget(), getUserByOffice().getId(), getLoggedUser().getUser().getId())) { + setUpdatePermissions(true); + + messafeFormat = getBundlePropertyFile().getString("message.format.sucess"); + severity = FacesMessage.SEVERITY_INFO; + } else { + messafeFormat = getBundlePropertyFile().getString("message.format.failure"); + severity = FacesMessage.SEVERITY_WARN; + } + } + Object[] param = {messageTitle, messageAction}; + + buildAndSendMessage(param, messafeFormat, severity, messageTitle); + } catch (Exception e) { + logger.error("savePermission", e); + Object[] param = {messageAction}; + + buildAndSendMessage(param, messafeFormat, severity, messageTitle); + } + } + + /** + * + */ + public void isUsernameAvailable() { + logger.debug("isUsernameAvailable"); + try { + if (null != getUser().getUserName() + && getUser().getUserName().trim().length() >= 5 + && getController().isUsernameAvailableController(getUser().getUserName(), getLoggedUser().getOffice().getId())) { + setAvailableUserName(true); + } else { + setAvailableUserName(false); + } + } catch (Exception e) { + logger.error("isUsernameAvailable", e); + Object[] param = {getBundlePropertyFile().getString("searching")}; + + buildAndSendMessage( + param, + getBundlePropertyFile().getString("message.format.fatal"), + FacesMessage.SEVERITY_FATAL, + getBundlePropertyFile().getString("user")); + } + } + + /** + * SE TIENE QUE ACTUALIZAR A SOLO MOSTRAR TODAS LAS RUTAS + */ + public void onUserTypeSlctChange() { + if (null == getUserType() || getUserType().equals("WEB") || getUserType().equals("N/A")) { + setCertifier(false); + setManagement(false); + setDualRouteCtlgLst(new DualListModel<>(new ArrayList<>(), new ArrayList<>())); + } else if (getUserType().equals("BOTH") || getUserType().equals("MOBILE")) { + try { + setDualRouteCtlgLst(new DualListModel<>(controller.findRoutesByOffice(getLoggedUser().getOffice().getId()), new ArrayList<>())); + } catch (Exception ex) { + setDualRouteCtlgLst(new DualListModel<>(new ArrayList<>(), new ArrayList<>())); + logger.error("onUserTypeSlctChange", ex); + } + } + } + + private void cleanForm() { + logger.info("cleanForm"); + try { + setIdHRSelected(null); + setUser(null); + setCertifier(false); + setManagement(false); + setUserType("N/A"); + setPwdConfirm(""); + List source = getController().getAllActivePermissionController(); + List target = new ArrayList<>(); + + setDualPermissionLst(new DualListModel<>(source, target)); + + loadHumanResourcesAvailables(); + setDualRouteCtlgLst(new DualListModel<>(new ArrayList<>(), new ArrayList<>())); + } catch (Exception e) { + logger.error("cleanForm", e); + } + } + + private void loadHumanResourcesAvailables() { + try { + setHumanResourcesAvailables( + getController().findAllHRsWithoutUser( + new Office(getLoggedUser().getOffice().getId()), + HumanResourceStatus.ENEBLED + ) + ); + } catch (Exception e) { + logger.error("loadHumanResourcesAvailables", e); + } + } + + private static final long serialVersionUID = 1501878035779416819L; + final Logger logger = LogManager.getLogger(UserCreateBean.class); + + private UserCreateController controller; + private User user; + private List roles; + private String pwdConfirm; + private boolean availableUserName; + private String role; + private DualListModel dualPermissionLst; + private boolean updatePermissions; + private List humanResourcesAvailables; + private String idHRSelected; + private UserByOffice userByOffice; + private String userType; + private boolean certifier; + private boolean management; + + private DualListModel dualRouteCtlgLst; + + @PostConstruct + public void init() { + try { + loadBundlePropertyFile(); + + setController(new UserCreateController()); + + List source = getController().getAllActivePermissionController(); + List target = new ArrayList<>(); + + setDualPermissionLst(new DualListModel<>(source, target)); + + loadHumanResourcesAvailables(); + setDualRouteCtlgLst(new DualListModel<>(new ArrayList<>(), new ArrayList<>())); + } catch (Exception e) { + logger.error("init", e); + } + } + + @PreDestroy + public void finish() { + setUser(null); + setHumanResourcesAvailables(null); + setDualPermissionLst(null); + setController(null); + } + + public UserCreateController getController() { + return controller; + } + + public void setController(UserCreateController controller) { + this.controller = controller; + } + + public User getUser() { + if (null == user) { + user = new User(); + } + return user; + } + + public void setUser(User user) { + this.user = user; + } + + public List getRoles() { + if (null == roles) { + /* + roles = Stream.of( + HumanResourceType.values()) + .map(Enum::name) + .collect(Collectors.toList() + ); + */ + } + return roles; + } + + public void setRoles(List roles) { + this.roles = roles; + } + + public String getPwdConfirm() { + return pwdConfirm; + } + + public void setPwdConfirm(String pwdConfirm) { + this.pwdConfirm = pwdConfirm; + } + + public boolean isAvailableUserName() { + return availableUserName; + } + + public void setAvailableUserName(boolean availableUserName) { + this.availableUserName = availableUserName; + } + + public String getRole() { + return role; + } + + public void setRole(String role) { + this.role = role; + } + + public DualListModel getDualPermissionLst() { + return dualPermissionLst; + } + + public void setDualPermissionLst(DualListModel dualPermissionLst) { + this.dualPermissionLst = dualPermissionLst; + } + + public boolean isUpdatePermissions() { + return updatePermissions; + } + + public void setUpdatePermissions(boolean updatePermissions) { + this.updatePermissions = updatePermissions; + } + + public List getHumanResourcesAvailables() { + return humanResourcesAvailables; + } + + public void setHumanResourcesAvailables(List humanResourcesAvailables) { + this.humanResourcesAvailables = humanResourcesAvailables; + } + + public String getIdHRSelected() { + return idHRSelected; + } + + public void setIdHRSelected(String idHRSelected) { + this.idHRSelected = idHRSelected; + } + + public UserByOffice getUserByOffice() { + return userByOffice; + } + + public void setUserByOffice(UserByOffice userByOffice) { + this.userByOffice = userByOffice; + } + + public String getUserType() { + return userType; + } + + public void setUserType(String userType) { + this.userType = userType; + } + + public boolean isCertifier() { + return certifier; + } + + public void setCertifier(boolean certifier) { + this.certifier = certifier; + } + + public boolean isManagement() { + return management; + } + + public void setManagement(boolean management) { + this.management = management; + } + + public DualListModel getDualRouteCtlgLst() { + return dualRouteCtlgLst; + } + + public void setDualRouteCtlgLst(DualListModel dualRouteCtlgLst) { + this.dualRouteCtlgLst = dualRouteCtlgLst; + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/system/user/UserUpdateBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/system/user/UserUpdateBean.java new file mode 100644 index 0000000..e7a2632 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/system/user/UserUpdateBean.java @@ -0,0 +1,663 @@ +/* + * 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.web.beans.system.user; + +import com.arrebol.apc.controller.system.user.UserUpdateController; +import com.arrebol.apc.model.catalog.RouteCtlg; +import com.arrebol.apc.model.core.Permission; +import com.arrebol.apc.model.core.UserByOffice; +import com.arrebol.apc.model.enums.ActiveStatus; +import com.arrebol.apc.model.enums.PermissionType; +import com.arrebol.apc.model.enums.UserStatus; +import com.arrebol.apc.model.enums.UserType; +import com.arrebol.apc.security.APCSecure; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.primefaces.model.DualListModel; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Named +@ViewScoped +public class UserUpdateBean extends GenericBean implements Serializable { + + public void onClickUpdateUserBtn() { + logger.info("onClickUpdateUserBtn"); + try { + FacesMessage.Severity severity = FacesMessage.SEVERITY_WARN; + + String messafeFormat = getBundlePropertyFile().getString("message.format.failure"); + String messageTitle = getBundlePropertyFile().getString("user"); + String messageAction = getBundlePropertyFile().getString("updated"); + + UserType userType = UserType.valueOf(getIdUserType()); + getUserByOfficeUpdateSelected().setCreatedBy(getLoggedUser().getUser().getId()); + + List routes = new ArrayList<>(); + List permissions = new ArrayList<>(); + ActiveStatus certifierUser = ActiveStatus.DISABLED; + ActiveStatus managementUser = ActiveStatus.DISABLED; + + + switch (userType) { + case WEB: + permissions.addAll(getGeneralPublicPermissionLst()); + permissions.addAll(getDualPermissionLst().getTarget()); + break; + case MOBILE: + routes = getDualRouteCtlgLst().getTarget(); + certifierUser = isCertifier() ? ActiveStatus.ENEBLED : ActiveStatus.DISABLED; + managementUser = isManagment() ? ActiveStatus.ENEBLED : ActiveStatus.DISABLED; + break; + case BOTH: + permissions.addAll(getGeneralPublicPermissionLst()); + permissions.addAll(getDualPermissionLst().getTarget()); + + routes = getDualRouteCtlgLst().getTarget(); + certifierUser = isCertifier() ? ActiveStatus.ENEBLED : ActiveStatus.DISABLED; + managementUser = isManagment() ? ActiveStatus.ENEBLED : ActiveStatus.DISABLED; + break; + } + + if (getController().updateUser(userType, getUserByOfficeUpdateSelected(), routes, permissions, certifierUser,managementUser)) { + severity = FacesMessage.SEVERITY_INFO; + messafeFormat = getBundlePropertyFile().getString("message.format.sucess"); + + cleanFormFields(); + refreshUserEnebledLst(); + } + + Object[] param = {messageTitle, messageAction}; + setAllowU(true); + + buildAndSendMessage(param, messafeFormat, severity, messageTitle); + } catch (Exception e) { + logger.error("onClickUpdateUserBtn", e); + Object[] param = {getBundlePropertyFile().getString("updated")}; + + buildAndSendMessage( + param, + getBundlePropertyFile().getString("message.format.fatal"), + FacesMessage.SEVERITY_FATAL, + getBundlePropertyFile().getString("user") + ); + } + } + + /** + * + */ + public void onClickOtherActionsBtn() { + logger.info("onClickUpdateUserBtn"); + try { + FacesMessage.Severity severity = FacesMessage.SEVERITY_WARN; + + String messafeFormat = getBundlePropertyFile().getString("message.format.failure"); + String messageTitle = getBundlePropertyFile().getString("user"); + String messageAction = getBundlePropertyFile().getString("updated"); + boolean goAhead = false; + UserStatus userStatus = null; + + switch (getAction()) { + case "N/A": + break; + case "pwd": + setPwd(new APCSecure(APP, getPwdConfirm()).getPassword()); + goAhead = true; + break; + case "usr": + isUsernameAvailable(); + goAhead = isAvailableUserName(); + break; + default: + userStatus = UserStatus.valueOf(getAction().toUpperCase()); + goAhead = true; + break; + } + + if (goAhead + && getController().updateUserOtherActions( + getAction(), + getUsrOtherActionSelected().getUser().getId(), + userStatus, getPwd(), + getUserName(), + getLoggedUser().getUser().getId() + )) { + severity = FacesMessage.SEVERITY_INFO; + messafeFormat = getBundlePropertyFile().getString("message.format.sucess"); + + cleanOtherActionsFormFields(); + refreshUserEnebledLst(); + } + + Object[] param = {messageTitle, messageAction}; + + buildAndSendMessage(param, messafeFormat, severity, messageTitle); + } catch (Exception e) { + logger.error("onClickOtherActionsBtn", e); + Object[] param = {getBundlePropertyFile().getString("updated")}; + + buildAndSendMessage( + param, + getBundlePropertyFile().getString("message.format.fatal"), + FacesMessage.SEVERITY_FATAL, + getBundlePropertyFile().getString("user") + ); + } + } + + /** + * + */ + public void onUsrEnebledSlctChange() { + logger.info("onUsrEnebledSlctChange"); + if(getUserByOfficeUpdateSelected()==null){ + cleanFormFields(); + setAllowU(true); + return; + } + try { + cleanFormFields(); + setIdUserType(getUserByOfficeUpdateSelected().getUser().getUserType().toString()); + fillUBOData(); + } catch (Exception e) { + logger.error("onUsrEnebledSlctChange", e); + } + } + + /** + * + */ + public void onUserTypeSlctChange() { + logger.info("onUserTypeSlctChange"); + try { + fillUBOData(); + + switch (getUserByOfficeUpdateSelected().getUser().getUserType()) { + //Si USUARIO es WEB y selecciona tipo web no se debe hacer nada + //Si USUARIO es WEB y selecciona tipo mobile, se deberĆ” cargar rutas + //Si USUARIO es WEB y seleccion tipo both, se deberĆ  cargar rutas + case WEB: + if ("MOBILE".equals(getIdUserType()) + || "BOTH".equals(getIdUserType())) { + setDualRouteCtlgLst(new DualListModel<>(getGeneralRouteCtlgLst(), new ArrayList<>())); + } + break; + //Si USUARIO es MOBILE y selecciona tipo web, se debe cargar permisos privados + //Si USUARIO es MOBILE y selecciona tipo mobile, hacer nada + //Si USUARIO es MOBILE y seleccion tipo both, se debe cargar permisos privados + case MOBILE: + if ("WEB".equals(getIdUserType()) + || "BOTH".equals(getIdUserType())) { + setDualPermissionLst(new DualListModel<>(getGeneralPrivatePermissionLst(), new ArrayList<>())); + } + break; + } + } catch (Exception e) { + logger.error("onUserTypeSlctChange", e); + } + } + + /** + * + */ + public void onSelectedOtherUserAction() { + try { + boolean goAhead = true; + + List statuses = new ArrayList<>(); + + switch (getAction()) { + case "pwd": + statuses.add(UserStatus.ENEBLED); + statuses.add(UserStatus.DISABLED); + break; + case "usr": + statuses.add(UserStatus.ENEBLED); + statuses.add(UserStatus.DISABLED); + break; + case "enebled": + statuses.add(UserStatus.DISABLED); + break; + case "disabled": + statuses.add(UserStatus.ENEBLED); + break; + case "deleted": + statuses.add(UserStatus.ENEBLED); + statuses.add(UserStatus.DISABLED); + break; + default: + goAhead = false; + break; + } + + if (goAhead) { + setPwd(null); + setPwdConfirm(null); + setUserName(null); + setUsrOtherActionSelected(null); + setUsrOtherActionLst( + getController().findUsersInOfficeInStatuses( + statuses, + getLoggedUser().getOffice().getId(), + getLoggedUser().getUser().getId() + ) + ); + } else { + setUsrOtherActionLst(new ArrayList<>()); + } + } catch (Exception e) { + logger.error("enebledDisabledListener", e); + Object[] param = {getBundlePropertyFile().getString("searching")}; + + setUsrOtherActionLst(new ArrayList<>()); + buildAndSendMessage( + param, + getBundlePropertyFile().getString("message.format.fatal"), + FacesMessage.SEVERITY_FATAL, + getBundlePropertyFile().getString("user") + ); + } + } + + /** + * + */ + public void isUsernameAvailable() { + logger.debug("isUsernameAvailable"); + try { + if (null != getUserName() + && getUserName().trim().length() >= 5 + && getController().isUsernameAvailableController(getUserName(), getLoggedUser().getOffice().getId())) { + setAvailableUserName(true); + } else { + setAvailableUserName(false); + } + } catch (Exception e) { + logger.error("isUsernameAvailable", e); + Object[] param = {getBundlePropertyFile().getString("searching")}; + + buildAndSendMessage( + param, + getBundlePropertyFile().getString("message.format.fatal"), + FacesMessage.SEVERITY_FATAL, + getBundlePropertyFile().getString("user")); + } + } + + /** + * + */ + private void refreshUserEnebledLst() { + logger.info("refreshUserEnebledLst"); + try { + List statuses = new ArrayList<>(); + statuses.add(UserStatus.ENEBLED); + + setUserByOfficeUpdateSelected(null); + setUserEnebledLst( + getController().findUsersInOfficeInStatuses( + statuses, + getLoggedUser().getOffice().getId(), + getLoggedUser().getUser().getId() + ) + ); + } catch (Exception e) { + logger.error("refreshUserEnebledLst", e); + setUserEnebledLst(new ArrayList<>()); + } + } + + /** + * + */ + private void fillUBOData() { + logger.debug("fillUBOData"); + try { + switch (getUserByOfficeUpdateSelected().getUser().getUserType()) { + // Bring all grants + case WEB: + setDualPermissionLst( + new DualListModel<>( + findAllPermissionsByUBO(false, false, getUserByOfficeUpdateSelected().getId()), + findAllPermissionsByUBO(false, true, getUserByOfficeUpdateSelected().getId()) + ) + ); + setCertifier(false); + break; + //Bring all routes + case MOBILE: + setDualRouteCtlgLst( + new DualListModel<>( + findAllRoutesByHRHR(true, false, getUserByOfficeUpdateSelected().getUser().getHumanResource().getId(), getLoggedUser().getOffice().getId()), + findAllRoutesByHRHR(true, true, getUserByOfficeUpdateSelected().getUser().getHumanResource().getId(), getLoggedUser().getOffice().getId()) + ) + ); + setCertifier(ActiveStatus.ENEBLED.equals(getUserByOfficeUpdateSelected().getUser().getCertifier())); + setManagment(ActiveStatus.ENEBLED.equals(getUserByOfficeUpdateSelected().getUser().getManagement())); + break; + // Bring all grants and routes + case BOTH: + setDualPermissionLst( + new DualListModel<>( + findAllPermissionsByUBO(false, false, getUserByOfficeUpdateSelected().getId()), + findAllPermissionsByUBO(false, true, getUserByOfficeUpdateSelected().getId()) + ) + ); + setDualRouteCtlgLst( + new DualListModel<>( + findAllRoutesByHRHR(true, false, getUserByOfficeUpdateSelected().getUser().getHumanResource().getId(), getLoggedUser().getOffice().getId()), + findAllRoutesByHRHR(true, true, getUserByOfficeUpdateSelected().getUser().getHumanResource().getId(), getLoggedUser().getOffice().getId()) + ) + ); + setCertifier(ActiveStatus.ENEBLED.equals(getUserByOfficeUpdateSelected().getUser().getCertifier())); + setManagment(ActiveStatus.ENEBLED.equals(getUserByOfficeUpdateSelected().getUser().getManagement())); + break; + } + + setAllowU(false); + } catch (Exception e) { + logger.error("fillUBOData", e); + } + } + + /** + * Find all permissions that has assigned the User By Office selected. + * + * @param uboId User By Office Identification number. + * @return + */ + private List findAllPermissionsByUBO(boolean isRuoute, boolean in, String uboId) { + logger.info("findAllPermissionsByUBO"); + List results = new ArrayList<>(); + + try { + results = getController().findList(isRuoute, in, uboId, null, null); + } catch (Exception e) { + logger.error("findAllPermissionsByUBO", e); + } + return results; + } + + /** + * Find all routes that has assigned the User By Office selected. + * + * @param hrhrId Human Resources Has Route Identification number. + * @param officeId + * @return + */ + private List findAllRoutesByHRHR(boolean isRuoute, boolean in, String hrhrId, String officeId) { + logger.info("findAllRoutesByHRHR"); + List results = new ArrayList<>(); + + try { + results = getController().findList(isRuoute, in, null, hrhrId, officeId); + } catch (Exception e) { + logger.error("findAllRoutesByHRHR", e); + } + return results; + } + + /** + * Clean all forms fields values + */ + private void cleanFormFields() { + logger.info("clean"); + try { + setIdUserType("N/A"); + setCertifier(false); + setDualPermissionLst(new DualListModel<>(new ArrayList<>(), new ArrayList<>())); + setDualRouteCtlgLst(new DualListModel<>(new ArrayList<>(), new ArrayList<>())); + } catch (Exception e) { + logger.error("clean", e); + } + } + + /** + * + */ + private void cleanOtherActionsFormFields() { + logger.info("cleanOtherActionsFormFields"); + try { + setAction("N/A"); + setUsrOtherActionSelected(null); + setUserName(null); + setPwd(null); + setPwdConfirm(null); + } catch (Exception e) { + logger.error("cleanOtherActionsFormFields", e); + } + } + + private static final long serialVersionUID = -3695498920999228355L; + final Logger logger = LogManager.getLogger(UserUpdateBean.class); + + @PostConstruct + public void init() { + try { + loadBundlePropertyFile(); + + List statuses = new ArrayList<>(); + List types = new ArrayList<>(); + + types.add(PermissionType.PRIVATE); + statuses.add(UserStatus.ENEBLED); + + setController(new UserUpdateController()); + setUserEnebledLst(getController().findUsersInOfficeInStatuses(statuses, getLoggedUser().getOffice().getId(), getLoggedUser().getUser().getId())); + setGeneralRouteCtlgLst(getController().findGeneralList(true, null, getLoggedUser().getOffice().getId())); + setGeneralPrivatePermissionLst(getController().findGeneralList(false, types, null)); + + types.clear(); + types.add(PermissionType.PUBLIC); + + setGeneralPublicPermissionLst(getController().findGeneralList(false, types, null)); + + cleanFormFields(); + + allowU=true; + } catch (Exception e) { + logger.error("init", e); + } + } + + private UserUpdateController controller; + private List userEnebledLst; + private UserByOffice userByOfficeUpdateSelected; + private DualListModel dualPermissionLst; + private DualListModel dualRouteCtlgLst; + private boolean refresh; + private String idUserType; + private boolean certifier; + private boolean managment; + private boolean allowU; + private List generalPrivatePermissionLst; + private List generalPublicPermissionLst; + private List generalRouteCtlgLst; + private String action; + private List usrOtherActionLst; + private UserByOffice usrOtherActionSelected; + private boolean availableUserName; + private String userName; + private String pwd; + private String pwdConfirm; + + public UserUpdateController getController() { + return controller; + } + + public void setController(UserUpdateController controller) { + this.controller = controller; + } + + public List getUserEnebledLst() { + return userEnebledLst; + } + + public void setUserEnebledLst(List userEnebledLst) { + this.userEnebledLst = userEnebledLst; + } + + public UserByOffice getUserByOfficeUpdateSelected() { + return userByOfficeUpdateSelected; + } + + public void setUserByOfficeUpdateSelected(UserByOffice userByOfficeUpdateSelected) { + this.userByOfficeUpdateSelected = userByOfficeUpdateSelected; + } + + public DualListModel getDualPermissionLst() { + return dualPermissionLst; + } + + public void setDualPermissionLst(DualListModel dualPermissionLst) { + this.dualPermissionLst = dualPermissionLst; + } + + public DualListModel getDualRouteCtlgLst() { + return dualRouteCtlgLst; + } + + public void setDualRouteCtlgLst(DualListModel dualRouteCtlgLst) { + this.dualRouteCtlgLst = dualRouteCtlgLst; + } + + public boolean isRefresh() { + return refresh; + } + + public void setRefresh(boolean refresh) { + this.refresh = refresh; + } + + public String getIdUserType() { + return idUserType; + } + + public void setIdUserType(String idUserType) { + this.idUserType = idUserType; + } + + public boolean isCertifier() { + return certifier; + } + + public void setCertifier(boolean certifier) { + this.certifier = certifier; + } + + public boolean isManagment() { + return managment; + } + + public void setManagment(boolean managment) { + this.managment = managment; + } + + public boolean isAllowU() { + return allowU; + } + + public void setAllowU(boolean allowU) { + this.allowU = allowU; + } + + + + + public List getGeneralPrivatePermissionLst() { + return generalPrivatePermissionLst; + } + + public void setGeneralPrivatePermissionLst(List generalPrivatePermissionLst) { + this.generalPrivatePermissionLst = generalPrivatePermissionLst; + } + + public List getGeneralPublicPermissionLst() { + return generalPublicPermissionLst; + } + + public void setGeneralPublicPermissionLst(List generalPublicPermissionLst) { + this.generalPublicPermissionLst = generalPublicPermissionLst; + } + + public List getGeneralRouteCtlgLst() { + return generalRouteCtlgLst; + } + + public void setGeneralRouteCtlgLst(List generalRouteCtlgLst) { + this.generalRouteCtlgLst = generalRouteCtlgLst; + } + + public String getAction() { + return action; + } + + public void setAction(String action) { + this.action = action; + } + + public List getUsrOtherActionLst() { + return usrOtherActionLst; + } + + public void setUsrOtherActionLst(List usrOtherActionLst) { + this.usrOtherActionLst = usrOtherActionLst; + } + + public UserByOffice getUsrOtherActionSelected() { + return usrOtherActionSelected; + } + + public void setUsrOtherActionSelected(UserByOffice usrOtherActionSelected) { + this.usrOtherActionSelected = usrOtherActionSelected; + } + + public boolean isAvailableUserName() { + return availableUserName; + } + + public void setAvailableUserName(boolean availableUserName) { + this.availableUserName = availableUserName; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getPwd() { + return pwd; + } + + public void setPwd(String pwd) { + this.pwd = pwd; + } + + public String getPwdConfirm() { + return pwdConfirm; + } + + public void setPwdConfirm(String pwdConfirm) { + this.pwdConfirm = pwdConfirm; + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/topbar/PrivacyBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/topbar/PrivacyBean.java new file mode 100644 index 0000000..5a9bfb2 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/topbar/PrivacyBean.java @@ -0,0 +1,119 @@ +/* + * 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.web.beans.topbar; + +import com.arrebol.apc.controller.topbar.PrivacyController; +import com.arrebol.apc.security.APCSecure; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Named +@ViewScoped +public class PrivacyBean extends GenericBean implements Serializable { + + /** + * + */ + public void updatePassword() { + String messafeFormat = getBundlePropertyFile().getString("message.format.fatal"); + String messageTitle = getBundlePropertyFile().getString("user"); + String messageAction = getBundlePropertyFile().getString("modified"); + + FacesMessage.Severity severity = FacesMessage.SEVERITY_FATAL; + try { + if (validatePwd() && getController().updatePasswordByUserId(new APCSecure(APP, getPwd()).getPassword(), getLoggedUser().getUser().getId())) { + + messageTitle = getBundlePropertyFile().getString("password"); + messafeFormat = getBundlePropertyFile().getString("message.format.sucess"); + severity = FacesMessage.SEVERITY_INFO; + } else { + messageTitle = getBundlePropertyFile().getString("password"); + messafeFormat = getBundlePropertyFile().getString("message.format.failure"); + severity = FacesMessage.SEVERITY_WARN; + } + + Object[] param = {messageTitle, messageAction}; + + buildAndSendMessage(param, messafeFormat, severity, messageTitle); + } catch (Exception e) { + logger.error("savePermission", e); + Object[] param = {messageAction}; + + buildAndSendMessage(param, messafeFormat, severity, messageTitle); + } + } + + @PostConstruct + public void init() { + try { + loadBundlePropertyFile(); + setController(new PrivacyController()); + } catch (Exception e) { + logger.error("init", e); + } + } + + /** + * + * @return + */ + private boolean validatePwd() { + boolean isValidPwd = false; + try { + if (getPwd().trim().length() > 4) { + isValidPwd = true; + } + } catch (Exception e) { + logger.error("validatePwd", e); + } + return isValidPwd; + } + + private static final long serialVersionUID = 9192662395164473848L; + + final Logger logger = LogManager.getLogger(PrivacyBean.class); + + private PrivacyController controller; + private String pwd; + private String confirmPwd; + + public PrivacyController getController() { + return controller; + } + + public void setController(PrivacyController controller) { + this.controller = controller; + } + + public String getPwd() { + return pwd; + } + + public void setPwd(String pwd) { + this.pwd = pwd; + } + + public String getConfirmPwd() { + return confirmPwd; + } + + public void setConfirmPwd(String confirmPwd) { + this.confirmPwd = confirmPwd; + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/beans/topbar/TopBarBean.java b/ace-web/src/main/java/com/arrebol/apc/web/beans/topbar/TopBarBean.java new file mode 100644 index 0000000..06082f2 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/beans/topbar/TopBarBean.java @@ -0,0 +1,64 @@ +/* + * 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.web.beans.topbar; + +import com.arrebol.apc.controller.topbar.TopBarController; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Named +@ViewScoped +public class TopBarBean extends GenericBean implements Serializable { + + private static final long serialVersionUID = -410735400441974978L; + final Logger logger = LogManager.getLogger(TopBarBean.class); + + private TopBarController controller; + private List offices; + + @PostConstruct + public void init() { + try { + loadBundlePropertyFile(); + + setController(new TopBarController()); + //setLoggedUser(getController().findUserLogged(userByOffice)); + setOffices(getController().findAllOfficesByUserController(getLoggedUser().getUser().getId())); + } catch (Exception e) { + logger.error("Topbar init", e); + } + } + + public TopBarController getController() { + return controller; + } + + public void setController(TopBarController controller) { + this.controller = controller; + } + + public List getOffices() { + return offices; + } + + public void setOffices(List offices) { + this.offices = offices; + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/converters/GenericConverter.java b/ace-web/src/main/java/com/arrebol/apc/web/converters/GenericConverter.java new file mode 100644 index 0000000..280e1c5 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/converters/GenericConverter.java @@ -0,0 +1,41 @@ +package com.arrebol.apc.web.converters; + +import javax.faces.component.UIComponent; +import javax.faces.context.FacesContext; +import javax.faces.convert.Converter; +import javax.faces.convert.FacesConverter; +import org.primefaces.component.picklist.PickList; +import org.primefaces.model.DualListModel; + +/** + * + * @author Carlos Janitzio Zavala Lopez. + */ +@FacesConverter("genericConverter") +public class GenericConverter implements Converter { + + @Override + public Object getAsObject(FacesContext facesContext, UIComponent component, String submittedValue) { + PickList p = (PickList) component; + DualListModel dl = (DualListModel) p.getValue(); + for (int i = 0; i < dl.getSource().size(); i++) { + if (dl.getSource().get(i).toString().contentEquals(submittedValue)) { + return dl.getSource().get(i); + } + } + for (int i = 0; i < dl.getTarget().size(); i++) { + if (dl.getTarget().get(i).toString().contentEquals(submittedValue)) { + return dl.getTarget().get(i); + } + } + return null; + } + + @Override + public String getAsString(FacesContext facesContext, UIComponent component, Object value) { + PickList p = (PickList) component; + DualListModel dl = (DualListModel) p.getValue(); + return value.toString(); + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/converters/PeopleConverter.java b/ace-web/src/main/java/com/arrebol/apc/web/converters/PeopleConverter.java new file mode 100644 index 0000000..ad50c9a --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/converters/PeopleConverter.java @@ -0,0 +1,44 @@ +/* + * 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.web.converters; + +import com.arrebol.apc.model.catalog.People; +import javax.faces.application.FacesMessage; +import javax.faces.component.UIComponent; +import javax.faces.context.FacesContext; +import javax.faces.convert.Converter; +import javax.faces.convert.ConverterException; +import javax.faces.convert.FacesConverter; +import javax.inject.Named; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Named +@FacesConverter(value = "peopleConverter", managed = true) +public class PeopleConverter implements Converter { + + @Override + public People getAsObject(FacesContext context, UIComponent component, String id) { + try { + return new People(id); + } catch (Exception e) { + throw new ConverterException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Error en bĆŗsqueda", "No se pudo obtener los datos de la persona bĆŗscada.")); + } + } + + @Override + public String getAsString(FacesContext context, UIComponent component, People value) { + if (value != null) { + return value.getId(); + } else { + return null; + } + } +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/converters/PerseonSearchConverter.java b/ace-web/src/main/java/com/arrebol/apc/web/converters/PerseonSearchConverter.java new file mode 100644 index 0000000..c509405 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/converters/PerseonSearchConverter.java @@ -0,0 +1,42 @@ +/* + * 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.web.converters; + +import com.arrebol.apc.model.views.AdministrationPersonSerchView; +import javax.faces.application.FacesMessage; +import javax.faces.component.UIComponent; +import javax.faces.context.FacesContext; +import javax.faces.convert.Converter; +import javax.faces.convert.ConverterException; +import javax.faces.convert.FacesConverter; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@FacesConverter("perseonSearchConverter") +public class PerseonSearchConverter implements Converter { + + @Override + public AdministrationPersonSerchView getAsObject(FacesContext context, UIComponent component, String id) { + try { + return new AdministrationPersonSerchView(id); + } catch (Exception e) { + throw new ConverterException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Error en bĆŗsqueda", "No se pudo obtener los datos de la persona bĆŗscada.")); + } + } + + @Override + public String getAsString(FacesContext context, UIComponent component, AdministrationPersonSerchView value) { + if (value != null) { + return value.getId(); + } else { + return null; + } + } +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/converters/UserByOfficeConverter.java b/ace-web/src/main/java/com/arrebol/apc/web/converters/UserByOfficeConverter.java new file mode 100644 index 0000000..0b6f589 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/converters/UserByOfficeConverter.java @@ -0,0 +1,82 @@ +/* + * 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.web.converters; + +import com.arrebol.apc.model.core.UserByOffice; +import java.util.List; +import javax.faces.application.FacesMessage; +import javax.faces.component.UIComponent; +import javax.faces.component.UISelectItem; +import javax.faces.component.UISelectItems; +import javax.faces.context.FacesContext; +import javax.faces.convert.Converter; +import javax.faces.convert.ConverterException; +import javax.faces.convert.FacesConverter; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@FacesConverter("userByOfficeConverter") +public class UserByOfficeConverter implements Converter { + + @Override + public Object getAsObject(FacesContext facesContext, UIComponent component, String submittedValue) { + try { + + if (!component.getChildren().isEmpty()) { + + for (final UIComponent chidren : component.getChildren()) { + if (chidren instanceof UISelectItems) { + return convertFromSelect(chidren, submittedValue); + } + } + } + return null; + } catch (Exception e) { + throw new ConverterException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Error", "Usuario/s no validos")); + } + } + + @Override + public String getAsString(FacesContext fc, UIComponent uic, Object object) { + if (object != null) { + return String.valueOf(((UserByOffice) object).getId()); + } else { + return null; + } + } + + /** + * + * @param component + * @param submittedValue + * @return + */ + private Object convertFromSelect(UIComponent component, String submittedValue) { + if (component instanceof UISelectItem) { + final UISelectItem item = (UISelectItem) component; + final UserByOffice value = (UserByOffice) item.getValue(); + if (submittedValue.equals(value.getId())) { + return value; + } + } + if (component instanceof UISelectItems) { + UISelectItems items = (UISelectItems) component; + List elements = (List) items.getValue(); + + for (UserByOffice element : elements) { + if (submittedValue.equals(element.getId())) { + return element; + } + } + } + return null; + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/drive/DriverBean.java b/ace-web/src/main/java/com/arrebol/apc/web/drive/DriverBean.java new file mode 100644 index 0000000..3d6bacf --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/drive/DriverBean.java @@ -0,0 +1,589 @@ +/* + * 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.web.drive; + +import com.arrebol.apc.controller.drive.DriverController; +import com.arrebol.apc.model.views.CobranzaWeekByUserView; +import com.arrebol.apc.model.views.ColocationWeekByUserView; +import com.arrebol.apc.model.views.InformationLoanWeekView; +import com.arrebol.apc.model.views.ResumeNewCustomerLastWeekView; +import com.arrebol.apc.model.views.ResumeNewCustomerWeekView; +import com.arrebol.apc.model.views.ResumenInOutWeekByUserView; +import com.arrebol.apc.model.views.ResumenTotalWeekView; +import com.arrebol.apc.model.views.SubtotalWeekByUserView; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.apache.poi.hssf.usermodel.HSSFCell; +import org.apache.poi.hssf.usermodel.HSSFCellStyle; +import org.apache.poi.hssf.usermodel.HSSFFont; +import org.apache.poi.hssf.usermodel.HSSFRow; +import org.apache.poi.hssf.usermodel.HSSFSheet; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.hssf.util.HSSFColor; +import org.apache.poi.ss.usermodel.BorderStyle; +import org.apache.poi.ss.usermodel.CellType; +import org.apache.poi.ss.usermodel.FillPatternType; +import org.apache.poi.ss.usermodel.IndexedColors; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Named("driverManager") +@ViewScoped +public class DriverBean extends GenericBean implements Serializable, Datatable { + + @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 onRowReorder(ReorderEvent event) { + 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. + } + + public DriverController getDriverCtrl() { + return driverCtrl; + } + + public void setDriverCtrl(DriverController driverCtrl) { + this.driverCtrl = driverCtrl; + } + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public InformationLoanWeekView getSelectedData() { + return selectedData; + } + + public void setSelectedData(InformationLoanWeekView selectedData) { + this.selectedData = selectedData; + } + + public List getDataColocation() { + return dataColocation; + } + + public void setDataColocation(List dataColocation) { + this.dataColocation = dataColocation; + } + + public ColocationWeekByUserView getSelectedColocation() { + return selectedColocation; + } + + public void setSelectedColocation(ColocationWeekByUserView selectedColocation) { + this.selectedColocation = selectedColocation; + } + + public List getDataSubtotal() { + return dataSubtotal; + } + + public void setDataSubtotal(List dataSubtotal) { + this.dataSubtotal = dataSubtotal; + } + + public SubtotalWeekByUserView getSelectedSubtotal() { + return selectedSubtotal; + } + + public void setSelectedSubtotal(SubtotalWeekByUserView selectedSubtotal) { + this.selectedSubtotal = selectedSubtotal; + } + + public List getDataResumen() { + return dataResumen; + } + + public void setDataResumen(List dataResumen) { + this.dataResumen = dataResumen; + } + + public ResumenInOutWeekByUserView getSelectedResumen() { + return selectedResumen; + } + + public void setSelectedResumen(ResumenInOutWeekByUserView selectedResumen) { + this.selectedResumen = selectedResumen; + } + + public List getDataCobranza() { + return dataCobranza; + } + + public void setDataCobranza(List dataCobranza) { + this.dataCobranza = dataCobranza; + } + + public CobranzaWeekByUserView getSelectedCobranza() { + return selectedCobranza; + } + + public void setSelectedCobranza(CobranzaWeekByUserView selectedCobranza) { + this.selectedCobranza = selectedCobranza; + } + + public List getDataTotal() { + return dataTotal; + } + + public void setDataTotal(List dataTotal) { + this.dataTotal = dataTotal; + } + + public ResumenTotalWeekView getSelectedTotal() { + return selectedTotal; + } + + public void setSelectedTotal(ResumenTotalWeekView selectedTotal) { + this.selectedTotal = selectedTotal; + } + + public List getDataCtesNvos() { + return dataCtesNvos; + } + + public void setDataCtesNvos(List dataCtesNvos) { + this.dataCtesNvos = dataCtesNvos; + } + + public ResumeNewCustomerWeekView getSelectedCtesNvos() { + return selectedCtesNvos; + } + + public void setSelectedCtesNvos(ResumeNewCustomerWeekView selectedCtesNvos) { + this.selectedCtesNvos = selectedCtesNvos; + } + + public void paintDataXLS(Object document) { + HSSFWorkbook wb = (HSSFWorkbook) document; + HSSFSheet sheet = wb.getSheetAt(0); + HSSFRow header = sheet.getRow(0); + HSSFCellStyle cellStyle = wb.createCellStyle(); + HSSFFont font = wb.createFont(); + font.setBold(true); + cellStyle.setFont(font); + cellStyle.setBorderTop(BorderStyle.DOUBLE); + cellStyle.setBorderBottom(BorderStyle.DOUBLE); + cellStyle.setBorderLeft(BorderStyle.DOUBLE); + cellStyle.setBorderRight(BorderStyle.DOUBLE); + cellStyle.setFillForegroundColor(HSSFColor.HSSFColorPredefined.LEMON_CHIFFON.getIndex()); + cellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); + + short dataFormat = wb.createDataFormat().getFormat("$#,##0.00"); + + initCellStyle(wb); + + for (int i = 0; i < header.getPhysicalNumberOfCells(); i++) { + HSSFCell cell = header.getCell(i); + cell.setCellStyle(cellStyle); + } + + String aux = ""; + for (int i = 1; i < sheet.getPhysicalNumberOfRows(); i++) { + HSSFRow row = sheet.getRow(i); + InformationLoanWeekView loanWeekData = data.get(i - 1); + HSSFCell cell; + String rowRenov = loanWeekData.getConditionRenovation(); + //cellStyleRow = getCellStyle(rowRenov); + // Row General + for (int j = 0; j < row.getPhysicalNumberOfCells(); j++) { + cell = row.getCell(j); + cell.setCellStyle(getCellStyle(rowRenov)); + + if ((j >= 7 && j <= 22) || (j == 2 || j == 3)) { + cell.getCellStyle().setDataFormat(dataFormat); + aux = cell.getStringCellValue().replace("$", ""); + aux = aux.replace(",", ""); + cell.setCellValue(Double.parseDouble(aux)); + cell.setCellType(CellType.NUMERIC); + } + } + + // Lunes + cell = row.getCell(10); + cell.setCellStyle(getCellStyle(loanWeekData.getConditionLunes())); + cell.getCellStyle().setDataFormat(dataFormat); + cell = row.getCell(11); + cell.setCellStyle(getCellStyle(loanWeekData.getConditionLunes())); + cell.getCellStyle().setDataFormat(dataFormat); + + // Martes + cell = row.getCell(12); + cell.setCellStyle(getCellStyle(loanWeekData.getConditionMartes())); + cell.getCellStyle().setDataFormat(dataFormat); + cell = row.getCell(13); + cell.setCellStyle(getCellStyle(loanWeekData.getConditionMartes())); + cell.getCellStyle().setDataFormat(dataFormat); + + // MiĆ©rcoles + cell = row.getCell(14); + cell.setCellStyle(getCellStyle(loanWeekData.getConditionMiercoles())); + cell.getCellStyle().setDataFormat(dataFormat); + cell = row.getCell(15); + cell.setCellStyle(getCellStyle(loanWeekData.getConditionMiercoles())); + cell.getCellStyle().setDataFormat(dataFormat); + + // Jueves + cell = row.getCell(16); + cell.setCellStyle(getCellStyle(loanWeekData.getConditionJueves())); + cell.getCellStyle().setDataFormat(dataFormat); + cell = row.getCell(17); + cell.setCellStyle(getCellStyle(loanWeekData.getConditionJueves())); + cell.getCellStyle().setDataFormat(dataFormat); + + // Viernes + cell = row.getCell(18); + cell.setCellStyle(getCellStyle(loanWeekData.getConditionViernes())); + cell.getCellStyle().setDataFormat(dataFormat); + cell = row.getCell(19); + cell.setCellStyle(getCellStyle(loanWeekData.getConditionViernes())); + cell.getCellStyle().setDataFormat(dataFormat); + + // SĆ”bado + cell = row.getCell(20); + cell.setCellStyle(getCellStyle(loanWeekData.getConditionSabado())); + cell.getCellStyle().setDataFormat(dataFormat); + cell = row.getCell(21); + cell.setCellStyle(getCellStyle(loanWeekData.getConditionSabado())); + cell.getCellStyle().setDataFormat(dataFormat); + } + + String ruta = data.get(0).getRouteName(); + int regInsertados = 0; + + for (int i = 1; i < sheet.getPhysicalNumberOfRows(); i++) { + //HSSFRow row = sheet.getRow(i); + //InformationLoanWeekView loanWeekData = data.get(i - 1 - regInsertados); + + if (!ruta.equalsIgnoreCase(data.get(i - 1 - regInsertados).getRouteName())) { + creaRegistroTotales(ruta, sheet, dataFormat, false, i); + ruta = data.get(i - 1 - regInsertados).getRouteName(); + regInsertados++; + } + } + creaRegistroTotales(ruta, sheet, dataFormat, true, sheet.getPhysicalNumberOfRows() + 1); + } + + private void creaRegistroTotales(String ruta, HSSFSheet sheet, short dataFormat, boolean lastRow, int i) { + HSSFRow r; + HSSFCell cellNew; + String rutaAux = ruta; + if (lastRow) { + r = sheet.createRow(sheet.getPhysicalNumberOfRows() + 1); + } else { + sheet.shiftRows(i, sheet.getLastRowNum(), 1, true, false); + r = sheet.createRow(i); + } + + // Apoyos + cellNew = r.createCell(3); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + BigDecimal suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux) && p.getWeekLoanDate() == p.getWeekCurrentDate())).map((py) -> py.getApoyos()).reduce(BigDecimal::add).isPresent() + ? data.stream().filter((p) -> (p.getRouteName().equals(rutaAux) && p.getWeekLoanDate() == p.getWeekCurrentDate())).map((py) -> py.getApoyos()).reduce(BigDecimal::add).get() + : BigDecimal.ZERO; + cellNew.setCellValue(suma.doubleValue()); + // Comsion por apertura + cellNew = r.createCell(4); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux) && p.getWeekLoanDate() == p.getWeekCurrentDate())).map((py) -> py.getComisionApertura()).reduce(BigDecimal::add).isPresent() + ? data.stream().filter((p) -> (p.getRouteName().equals(rutaAux) && p.getWeekLoanDate() == p.getWeekCurrentDate())).map((py) -> py.getComisionApertura()).reduce(BigDecimal::add).get() + : BigDecimal.ZERO; + cellNew.setCellValue(suma.doubleValue()); + + //Totales + cellNew = r.createCell(9); + cellNew.setCellType(CellType.STRING); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.setCellValue("TOTALES: "); + // Lunes + cellNew = r.createCell(10); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).map((py) -> py.getPaymentMonday()).reduce(BigDecimal::add).get(); + cellNew.setCellValue(suma.doubleValue()); + cellNew = r.createCell(11); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).map((py) -> py.getFeeMonday()).reduce(BigDecimal::add).get(); + cellNew.setCellValue(suma.doubleValue()); + // Martes + cellNew = r.createCell(12); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).map((py) -> py.getPaymentTuesday()).reduce(BigDecimal::add).get(); + cellNew.setCellValue(suma.doubleValue()); + cellNew = r.createCell(13); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).map((py) -> py.getFeeTuesday()).reduce(BigDecimal::add).get(); + cellNew.setCellValue(suma.doubleValue()); + // MiĆ©rcoles + cellNew = r.createCell(14); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).map((py) -> py.getPaymentWednesday()).reduce(BigDecimal::add).get(); + cellNew.setCellValue(suma.doubleValue()); + cellNew = r.createCell(15); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).map((py) -> py.getFeeWednesday()).reduce(BigDecimal::add).get(); + cellNew.setCellValue(suma.doubleValue()); + // Jueves + cellNew = r.createCell(16); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).map((py) -> py.getPaymentThursday()).reduce(BigDecimal::add).get(); + cellNew.setCellValue(suma.doubleValue()); + cellNew = r.createCell(17); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).map((py) -> py.getFeeThursday()).reduce(BigDecimal::add).get(); + cellNew.setCellValue(suma.doubleValue()); + // Viernes + cellNew = r.createCell(18); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).map((py) -> py.getPaymentFriday()).reduce(BigDecimal::add).get(); + cellNew.setCellValue(suma.doubleValue()); + cellNew = r.createCell(19); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).map((py) -> py.getFeeFriday()).reduce(BigDecimal::add).get(); + cellNew.setCellValue(suma.doubleValue()); + // SĆ”bado + cellNew = r.createCell(20); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).map((py) -> py.getPaymentSaturday()).reduce(BigDecimal::add).get(); + cellNew.setCellValue(suma.doubleValue()); + cellNew = r.createCell(21); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).map((py) -> py.getFeeSaturday()).reduce(BigDecimal::add).get(); + cellNew.setCellValue(suma.doubleValue()); + // Faltante + cellNew = r.createCell(22); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).map((py) -> py.getFaltante()).reduce(BigDecimal::add).get(); + cellNew.setCellValue(suma.doubleValue()); + } + + private HSSFCellStyle getCellStyle(String cellStyleColor) { + if (cellStyleColor == null) { + cellStyleColor = "White"; + } + + switch (cellStyleColor) { + case "redRow": + return cellStyleRed; + case "greenRow": + return cellStyleGreen; + case "yellowRow": + return cellStyleYellow; + case "blueRow": + return cellStyleBlue; + case "blueLightRow": + return cellStyleBlueLight; + case "greenLigthRow": + return cellStyleGreenLight; + case "greenStrongRow": + return cellStyleGreenStrong; + case "greyRow": + return cellStyleGrey; + case "orangeRow": + return cellStyleOrange; + default: + return cellStyleWhite; + } + } + + private void initCellStyle(HSSFWorkbook wb) { + // MULTA + fontRed = wb.createFont(); + cellStyleRed = wb.createCellStyle(); + fontRed.setColor(HSSFColor.HSSFColorPredefined.GREY_25_PERCENT.getIndex()); + cellStyleRed.setFillPattern(FillPatternType.SOLID_FOREGROUND); + cellStyleRed.setFillForegroundColor(IndexedColors.RED.getIndex()); + //cellStyleRed.setFont(fontRed); + + // ABONO 0 + fontGreen = wb.createFont(); + cellStyleGreen = wb.createCellStyle(); + fontGreen.setColor(HSSFColor.HSSFColorPredefined.GREY_25_PERCENT.getIndex()); + cellStyleGreen.setFillPattern(FillPatternType.SOLID_FOREGROUND); + cellStyleGreen.setFillForegroundColor(IndexedColors.SEA_GREEN.getIndex()); + //cellStyleGreen.setFont(fontGreen); + + // ABONƓ MENOS + fontYellow = wb.createFont(); + cellStyleYellow = wb.createCellStyle(); + fontYellow.setColor(HSSFColor.HSSFColorPredefined.GREY_25_PERCENT.getIndex()); + cellStyleYellow.setFillPattern(FillPatternType.SOLID_FOREGROUND); + cellStyleYellow.setFillForegroundColor(IndexedColors.LIGHT_YELLOW.getIndex()); + //cellStyleYellow.setFont(fontYellow); + + // ABONƓ DE MƁS + fontBlue = wb.createFont(); + cellStyleBlue = wb.createCellStyle(); + fontBlue.setColor(HSSFColor.HSSFColorPredefined.GREY_25_PERCENT.getIndex()); + cellStyleBlue.setFillPattern(FillPatternType.SOLID_FOREGROUND); + //cellStyleBlue.setFillForegroundColor(HSSFColor.HSSFColorPredefined.BLUE.getIndex()); + cellStyleBlue.setFillForegroundColor(IndexedColors.TURQUOISE.getIndex()); + //cellStyleBlue.setFont(fontBlue); + + // PAGO CONGELADO + fontBlueLight = wb.createFont(); + cellStyleBlueLight = wb.createCellStyle(); + fontBlueLight.setColor(HSSFColor.HSSFColorPredefined.GREY_25_PERCENT.getIndex()); + cellStyleBlueLight.setFillPattern(FillPatternType.SOLID_FOREGROUND); + cellStyleBlueLight.setFillForegroundColor(IndexedColors.LIGHT_BLUE.getIndex()); + + // RENOVƓ + fontGreenLight = wb.createFont(); + cellStyleGreenLight = wb.createCellStyle(); + fontGreenLight.setColor(HSSFColor.HSSFColorPredefined.GREY_25_PERCENT.getIndex()); + cellStyleGreenLight.setFillPattern(FillPatternType.SOLID_FOREGROUND); + cellStyleGreenLight.setFillForegroundColor(IndexedColors.BRIGHT_GREEN.getIndex()); + //cellStyleGreenLight.setFont(fontGreenLight); + + // getSaldoInsoluto == 0 + fontGreenStrong = wb.createFont(); + cellStyleGreenStrong = wb.createCellStyle(); + fontGreenStrong.setColor(HSSFColor.HSSFColorPredefined.GREY_25_PERCENT.getIndex()); + cellStyleGreenStrong.setFillPattern(FillPatternType.SOLID_FOREGROUND); + cellStyleGreenStrong.setFillForegroundColor(IndexedColors.GREEN.getIndex()); + //cellStyleGreenStrong.setFont(fontGreenStrong); + + // CLIENTE NUEVO + fontOrange = wb.createFont(); + cellStyleOrange = wb.createCellStyle(); + fontOrange.setColor(HSSFColor.HSSFColorPredefined.GREY_25_PERCENT.getIndex()); + cellStyleOrange.setFillPattern(FillPatternType.SOLID_FOREGROUND); + cellStyleOrange.setFillForegroundColor(IndexedColors.ORANGE.getIndex()); + //cellStyleGreenLight.setFont(fontGreenLight); + + // Totales + fontGrey = wb.createFont(); + cellStyleGrey = wb.createCellStyle(); + fontGrey.setColor(HSSFColor.HSSFColorPredefined.WHITE.getIndex()); + cellStyleGrey.setFillPattern(FillPatternType.SOLID_FOREGROUND); + cellStyleGrey.setFillForegroundColor(IndexedColors.GREY_50_PERCENT.getIndex()); + cellStyleGrey.setFont(fontGrey); + + cellStyleWhite = wb.createCellStyle(); + cellStyleWhite.setFillPattern(FillPatternType.SOLID_FOREGROUND); + cellStyleWhite.setFillForegroundColor(HSSFColor.HSSFColorPredefined.WHITE.getIndex()); + } + + private DriverController driverCtrl; + private List data; + private InformationLoanWeekView selectedData; + + private List dataColocation; + private ColocationWeekByUserView selectedColocation; + + private List dataSubtotal; + private SubtotalWeekByUserView selectedSubtotal; + + private List dataResumen; + private ResumenInOutWeekByUserView selectedResumen; + + private List dataCobranza; + private CobranzaWeekByUserView selectedCobranza; + + private List dataTotal; + private ResumenTotalWeekView selectedTotal; + + private List dataCtesNvos; + private ResumeNewCustomerWeekView selectedCtesNvos; + + // Datos para pintar las celdas + HSSFCellStyle cellStyleRed; + HSSFFont fontRed; + HSSFCellStyle cellStyleGreen; + HSSFFont fontGreen; + HSSFCellStyle cellStyleYellow; + HSSFFont fontYellow; + HSSFCellStyle cellStyleBlue; + HSSFFont fontBlue; + HSSFCellStyle cellStyleBlueLight; + HSSFFont fontBlueLight; + HSSFCellStyle cellStyleGreenLight; + HSSFFont fontGreenLight; + HSSFCellStyle cellStyleGreenStrong; + HSSFFont fontGreenStrong; + HSSFCellStyle cellStyleOrange; + HSSFFont fontOrange; + HSSFCellStyle cellStyleWhite; + HSSFCellStyle cellStyleGrey; + HSSFFont fontGrey; + + @PostConstruct + public void init() { + driverCtrl = new DriverController(); + data = driverCtrl.getAllLoanThisWeekByOffice(getLoggedUser().getOffice().getId()); + dataColocation = driverCtrl.getAllColocationWeekByOffice(getLoggedUser().getOffice().getId()); + dataSubtotal = driverCtrl.getAllSubtotalThisWeekByOffice(getLoggedUser().getOffice().getId()); + dataResumen = driverCtrl.getAllResumenInOutThisWeekByOffice(getLoggedUser().getOffice().getId()); + dataCobranza = driverCtrl.getAllCobranzaThisWeekByOffice(getLoggedUser().getOffice().getId()); + dataTotal = driverCtrl.getAllResumenTotalWeekByOffice(getLoggedUser().getOffice().getId()); + + dataCtesNvos = driverCtrl.getAllResumenNewCustomerWeekByOffice(); + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/drive/DriverDateBean.java b/ace-web/src/main/java/com/arrebol/apc/web/drive/DriverDateBean.java new file mode 100644 index 0000000..b6812a3 --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/drive/DriverDateBean.java @@ -0,0 +1,871 @@ +/* + * 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.web.drive; + +import com.arrebol.apc.controller.GenericController; +import com.arrebol.apc.controller.admin.LoanController; +import com.arrebol.apc.controller.drive.DriverController; +import com.arrebol.apc.model.enums.LoanDetailsType; +import com.arrebol.apc.model.loan.LoanDetails; +import com.arrebol.apc.model.views.CobranzaWeekByUserView; +import com.arrebol.apc.model.views.ColocationWeekByUserView; +import com.arrebol.apc.model.views.InformationLoanWeekView; +import com.arrebol.apc.model.views.ResumenInOutWeekByUserView; +import com.arrebol.apc.model.views.ResumenTotalWeekView; +import com.arrebol.apc.model.views.SubtotalWeekByUserView; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; +import java.util.stream.Stream; +import javax.annotation.PostConstruct; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.apache.poi.hssf.usermodel.HSSFCell; +import org.apache.poi.hssf.usermodel.HSSFCellStyle; +import org.apache.poi.hssf.usermodel.HSSFFont; +import org.apache.poi.hssf.usermodel.HSSFRow; +import org.apache.poi.hssf.usermodel.HSSFSheet; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.hssf.util.HSSFColor; +import org.apache.poi.ss.usermodel.BorderStyle; +import org.apache.poi.ss.usermodel.CellType; +import org.apache.poi.ss.usermodel.FillPatternType; +import org.apache.poi.ss.usermodel.IndexedColors; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Named("driverDateManager") +@ViewScoped +public class DriverDateBean extends GenericBean implements Serializable, Datatable { + + public void searchLoanWeekByDate() { + try { + setData(fillDataTable()); + searchResumenDataWeekByDate(); + } catch (Exception e) { + } + } + + public List getDetails(String id) { + try { + loanDetails = loanCtrl.getLoanDetailsbyId(id); + getSaldoInsolutoAbono(); + } catch (Exception e) { + } + return null == loanDetails ? new ArrayList<>() : loanDetails; + } + + public void getSaldoInsolutoAbono( ) { + Double sumaAbonosAnteriores; + Double totalAPagar; + Double saldoInsoluto; + Double saldoMultas; + // + for (LoanDetails detail : loanDetails) { + sumaAbonosAnteriores = loanDetails.stream().filter(p -> p.getReferenceNumber() <= detail.getReferenceNumber() && !p.getLoanDetailsType().equals(LoanDetailsType.FEE) ) + .mapToDouble(LoanDetails::getAbonoD) + .sum(); + saldoMultas = loanDetails.stream().filter(p -> p.getReferenceNumber() <= detail.getReferenceNumber() && p.getLoanDetailsType().equals(LoanDetailsType.FEE)) + .mapToDouble(LoanDetails::getAbonoD) + .sum(); + + totalAPagar = detail.getLoan().getLoanType().getPaymentTotal().doubleValue(); + saldoInsoluto = totalAPagar - sumaAbonosAnteriores + saldoMultas; + + detail.setSaldoInsoluto(new BigDecimal(saldoInsoluto)); + } + } + + public void searchResumenDataWeekByDate() { + try { + SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd"); + String date = DATE_FORMAT.format(getStarDate()); + + dataColocation = driverCtrl.getAllColocationWeekByOfficeMySQLQuery(date, getLoggedUser().getOffice().getId()); + dataSubtotal = driverCtrl.getAllSubtotalThisWeekByOfficeMySQLQuery(date, getLoggedUser().getOffice().getId()); + dataResumen = driverCtrl.getAllResumenInOutThisWeekByOfficeMySQLQuery(date, getLoggedUser().getOffice().getId()); + dataCobranza = driverCtrl.getAllCobranzaThisWeekByOfficeMySQLQuery(date, getLoggedUser().getOffice().getId()); + dataTotal = driverCtrl.getAllResumenTotalWeekByOfficeMySQLQuery(date, getLoggedUser().getOffice().getId()); + } catch (Exception e) { + } + } + + public List fillDataTable() { + SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd"); + String starDate = ""; + if (getStarDate() != null) { + starDate = DATE_FORMAT.format(getStarDate()); + } + return getDriverCtrl().getAllLoanWeekByOfficeMySQLQuery(starDate, getLoggedUser().getOffice().getId()); + } + + @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 onRowReorder(ReorderEvent event) { + 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. + } + + public DriverController getDriverCtrl() { + return driverCtrl; + } + + public void setDriverCtrl(DriverController driverCtrl) { + this.driverCtrl = driverCtrl; + } + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public InformationLoanWeekView getSelectedData() { + return selectedData; + } + + public void setSelectedData(InformationLoanWeekView selectedData) { + this.selectedData = selectedData; + } + + public List getDataColocation() { + return dataColocation; + } + + public void setDataColocation(List dataColocation) { + this.dataColocation = dataColocation; + } + + public ColocationWeekByUserView getSelectedColocation() { + return selectedColocation; + } + + public void setSelectedColocation(ColocationWeekByUserView selectedColocation) { + this.selectedColocation = selectedColocation; + } + + public List getDataSubtotal() { + return dataSubtotal; + } + + public void setDataSubtotal(List dataSubtotal) { + this.dataSubtotal = dataSubtotal; + } + + public SubtotalWeekByUserView getSelectedSubtotal() { + return selectedSubtotal; + } + + public void setSelectedSubtotal(SubtotalWeekByUserView selectedSubtotal) { + this.selectedSubtotal = selectedSubtotal; + } + + public List getDataResumen() { + return dataResumen; + } + + public void setDataResumen(List dataResumen) { + this.dataResumen = dataResumen; + } + + public ResumenInOutWeekByUserView getSelectedResumen() { + return selectedResumen; + } + + public void setSelectedResumen(ResumenInOutWeekByUserView selectedResumen) { + this.selectedResumen = selectedResumen; + } + + public List getDataCobranza() { + return dataCobranza; + } + + public void setDataCobranza(List dataCobranza) { + this.dataCobranza = dataCobranza; + } + + public CobranzaWeekByUserView getSelectedCobranza() { + return selectedCobranza; + } + + public void setSelectedCobranza(CobranzaWeekByUserView selectedCobranza) { + this.selectedCobranza = selectedCobranza; + } + + public List getDataTotal() { + return dataTotal; + } + + public void setDataTotal(List dataTotal) { + this.dataTotal = dataTotal; + } + + public ResumenTotalWeekView getSelectedTotal() { + return selectedTotal; + } + + public void setSelectedTotal(ResumenTotalWeekView selectedTotal) { + this.selectedTotal = selectedTotal; + } + + public GenericController getGenericCtrl() { + return genericCtrl; + } + + public void setGenericCtrl(GenericController genericCtrl) { + this.genericCtrl = genericCtrl; + } + + public void paintDataXLS(Object document) { + HSSFWorkbook wb = (HSSFWorkbook) document; + HSSFSheet sheet = wb.getSheetAt(0); + HSSFRow header = sheet.getRow(0); + HSSFCellStyle cellStyle = wb.createCellStyle(); + HSSFFont font = wb.createFont(); + font.setBold(true); + cellStyle.setFont(font); + cellStyle.setBorderTop(BorderStyle.DOUBLE); + cellStyle.setBorderBottom(BorderStyle.DOUBLE); + cellStyle.setBorderLeft(BorderStyle.DOUBLE); + cellStyle.setBorderRight(BorderStyle.DOUBLE); + cellStyle.setFillForegroundColor(HSSFColor.HSSFColorPredefined.LEMON_CHIFFON.getIndex()); + cellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); + + short dataFormat = wb.createDataFormat().getFormat("$#,##0.00"); + + initCellStyle(wb); + HSSFCell cellNew; + + + for (int i = 0; i < header.getPhysicalNumberOfCells(); i++) { + HSSFCell cell = header.getCell(i); + cell.setCellStyle(cellStyle); + } + + String aux = ""; + for (int i = 1; i < sheet.getPhysicalNumberOfRows(); i++) { + HSSFRow row = sheet.getRow(i); + InformationLoanWeekView loanWeekData = data.get(i - 1); + HSSFCell cell; + String rowRenov = loanWeekData.getConditionRenovation(); + //cellStyleRow = getCellStyle(rowRenov); + // Row General + for (int j = 0; j < row.getPhysicalNumberOfCells(); j++) { + cell = row.getCell(j); + cell.setCellStyle(getCellStyle(rowRenov)); + + if ((j >= 5 && j <= 23) || (j == 2) || (j==3)) { + cell.getCellStyle().setDataFormat(dataFormat); + aux = cell.getStringCellValue().replace("$", ""); + aux = aux.replace(",", ""); + cell.setCellValue(Double.parseDouble(aux)); + cell.setCellType(CellType.NUMERIC); + } + } + + // Lunes + cell = row.getCell(9); + cell.setCellStyle(getCellStyle(loanWeekData.getConditionLunes())); + cell.getCellStyle().setDataFormat(dataFormat); + cell = row.getCell(10); + cell.setCellStyle(getCellStyle(loanWeekData.getConditionLunes())); + cell.getCellStyle().setDataFormat(dataFormat); + + // Martes + cell = row.getCell(11); + cell.setCellStyle(getCellStyle(loanWeekData.getConditionMartes())); + cell.getCellStyle().setDataFormat(dataFormat); + cell = row.getCell(12); + cell.setCellStyle(getCellStyle(loanWeekData.getConditionMartes())); + cell.getCellStyle().setDataFormat(dataFormat); + + // MiĆ©rcoles + cell = row.getCell(13); + cell.setCellStyle(getCellStyle(loanWeekData.getConditionMiercoles())); + cell.getCellStyle().setDataFormat(dataFormat); + cell = row.getCell(14); + cell.setCellStyle(getCellStyle(loanWeekData.getConditionMiercoles())); + cell.getCellStyle().setDataFormat(dataFormat); + + // Jueves + cell = row.getCell(15); + cell.setCellStyle(getCellStyle(loanWeekData.getConditionJueves())); + cell.getCellStyle().setDataFormat(dataFormat); + cell = row.getCell(16); + cell.setCellStyle(getCellStyle(loanWeekData.getConditionJueves())); + cell.getCellStyle().setDataFormat(dataFormat); + + // Viernes + cell = row.getCell(17); + cell.setCellStyle(getCellStyle(loanWeekData.getConditionViernes())); + cell.getCellStyle().setDataFormat(dataFormat); + cell = row.getCell(18); + cell.setCellStyle(getCellStyle(loanWeekData.getConditionViernes())); + cell.getCellStyle().setDataFormat(dataFormat); + + // SĆ”bado + cell = row.getCell(19); + cell.setCellStyle(getCellStyle(loanWeekData.getConditionSabado())); + cell.getCellStyle().setDataFormat(dataFormat); + cell = row.getCell(20); + cell.setCellStyle(getCellStyle(loanWeekData.getConditionSabado())); + cell.getCellStyle().setDataFormat(dataFormat); + + /* cell = row.createCell(24); + BigDecimal suma = loanWeekData.getPaymentMonday().add(loanWeekData.getPaymentTuesday().add(loanWeekData.getPaymentWednesday() + .add(loanWeekData.getPaymentThursday().add(loanWeekData.getPaymentFriday().add(loanWeekData.getPaymentSaturday()))))); + if (suma.compareTo(suma.subtract(loanWeekData.getFaltante())) != 0) { + cell.setCellStyle(getCellStyle("difRow")); + } + cell.setCellType(CellType.NUMERIC); + cell.setCellValue(suma.doubleValue()); + cell.getCellStyle().setDataFormat(dataFormat); + + cell = row.createCell(25); + if (suma.compareTo(suma.subtract(loanWeekData.getFaltante())) != 0) { + cell.setCellStyle(getCellStyle("difRow")); + } + cell.setCellType(CellType.NUMERIC); + BigDecimal dif = suma.subtract(loanWeekData.getFaltante()); + cell.setCellValue(dif.doubleValue()); + cell.getCellStyle().setDataFormat(dataFormat);*/ + } + + String ruta = data.get(0).getRouteName(); + int regInsertados = 0; + int regSize = sheet.getPhysicalNumberOfRows(); + + for (int i = 1; i < regSize; i++) { + if (!ruta.equalsIgnoreCase(data.get(i - 1 - regInsertados).getRouteName())) { + //creaRegistroTotalesGeneral(ruta, sheet, dataFormat, false, i); + creaRegistroTotales(ruta, sheet, dataFormat, false, i); + ruta = data.get(i - 1 - regInsertados).getRouteName(); + regInsertados++; + } + } + + ruta = data.get(0).getRouteName(); + regInsertados = 0; + int recorrido= 1; + for (int i = 1; i < regSize; i++) { + if (!ruta.equalsIgnoreCase(data.get(i - 1 - regInsertados).getRouteName())) { + creaRegistroTotalesGeneral(ruta, sheet, dataFormat, false, i+recorrido); + //creaRegistroTotales(ruta, sheet, dataFormat, false, i); + ruta = data.get(i - 1 - regInsertados).getRouteName(); + regInsertados++; + recorrido++; + } + } + + creaRegistroTotales(ruta, sheet, dataFormat, true, sheet.getPhysicalNumberOfRows() + 1); + creaRegistroTotalesGeneral(ruta, sheet, dataFormat, true, sheet.getPhysicalNumberOfRows() + 1); + + + } + + private void creaRegistroTotales(String ruta, HSSFSheet sheet, short dataFormat, boolean lastRow, int i) { + HSSFRow r; + HSSFCell cellNew; + String rutaAux = ruta; + if (lastRow) { + r = sheet.createRow(sheet.getPhysicalNumberOfRows() + 1); + } else { + sheet.shiftRows(i, sheet.getLastRowNum(), 1, true, false); + r = sheet.createRow(i); + } + + Calendar c2 = Calendar.getInstance(); + c2.setTime(getStarDate()); + int weekDate = c2.get(Calendar.WEEK_OF_YEAR); + + // Apoyos + cellNew = r.createCell(2); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + BigDecimal suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux) && p.getWeekLoanDate() == weekDate)).map((py) -> py.getApoyos()).reduce(BigDecimal::add).isPresent() + ? data.stream().filter((p) -> (p.getRouteName().equals(rutaAux) && p.getWeekLoanDate() == weekDate)).map((py) -> py.getApoyos()).reduce(BigDecimal::add).get() + : BigDecimal.ZERO; + cellNew.setCellValue(suma.doubleValue()); + // Comsion por apertura + /*cellNew = r.createCell(3); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux) && p.getWeekLoanDate() == weekDate)).map((py) -> py.getComisionApertura()).reduce(BigDecimal::add).isPresent() + ? data.stream().filter((p) -> (p.getRouteName().equals(rutaAux) && p.getWeekLoanDate() == weekDate)).map((py) -> py.getComisionApertura()).reduce(BigDecimal::add).get() + : BigDecimal.ZERO; + cellNew.setCellValue(suma.doubleValue());*/ + + //Totales + cellNew = r.createCell(7); + cellNew.setCellType(CellType.STRING); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.setCellValue("TOTALES: "); + // Lunes + cellNew = r.createCell(9); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).map((py) -> py.getPaymentMonday()).reduce(BigDecimal::add).get(); + cellNew.setCellValue(suma.doubleValue()); + cellNew = r.createCell(10); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).map((py) -> py.getFeeMonday()).reduce(BigDecimal::add).get(); + cellNew.setCellValue(suma.doubleValue()); + // Martes + cellNew = r.createCell(11); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).map((py) -> py.getPaymentTuesday()).reduce(BigDecimal::add).get(); + cellNew.setCellValue(suma.doubleValue()); + cellNew = r.createCell(12); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).map((py) -> py.getFeeTuesday()).reduce(BigDecimal::add).get(); + cellNew.setCellValue(suma.doubleValue()); + // MiĆ©rcoles + cellNew = r.createCell(13); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).map((py) -> py.getPaymentWednesday()).reduce(BigDecimal::add).get(); + cellNew.setCellValue(suma.doubleValue()); + cellNew = r.createCell(14); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).map((py) -> py.getFeeWednesday()).reduce(BigDecimal::add).get(); + cellNew.setCellValue(suma.doubleValue()); + // Jueves + cellNew = r.createCell(15); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).map((py) -> py.getPaymentThursday()).reduce(BigDecimal::add).get(); + cellNew.setCellValue(suma.doubleValue()); + cellNew = r.createCell(16); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).map((py) -> py.getFeeThursday()).reduce(BigDecimal::add).get(); + cellNew.setCellValue(suma.doubleValue()); + // Viernes + cellNew = r.createCell(17); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).map((py) -> py.getPaymentFriday()).reduce(BigDecimal::add).get(); + cellNew.setCellValue(suma.doubleValue()); + cellNew = r.createCell(18); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).map((py) -> py.getFeeFriday()).reduce(BigDecimal::add).get(); + cellNew.setCellValue(suma.doubleValue()); + // SĆ”bado + cellNew = r.createCell(19); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).map((py) -> py.getPaymentSaturday()).reduce(BigDecimal::add).get(); + cellNew.setCellValue(suma.doubleValue()); + cellNew = r.createCell(20); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).map((py) -> py.getFeeSaturday()).reduce(BigDecimal::add).get(); + cellNew.setCellValue(suma.doubleValue()); + // Faltante + cellNew = r.createCell(22); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).map((py) -> py.getFaltante()).reduce(BigDecimal::add).get(); + cellNew.setCellValue(suma.doubleValue()); + + + } + + private void creaRegistroTotalesGeneral(String ruta, HSSFSheet sheet, short dataFormat, boolean lastRow, int i) { + HSSFRow r; + HSSFCell cellNew; + String rutaAux = ruta; + if (lastRow) { + r = sheet.createRow(sheet.getPhysicalNumberOfRows() + 1); + } else { + sheet.shiftRows(i, sheet.getLastRowNum(), 1, true, false); + r = sheet.createRow(i); + } + + Calendar calendar = Calendar.getInstance(); + Calendar calendarFor = Calendar.getInstance(); + calendar.setTime(getStarDate()); + int numberWeekOfYear = calendar.get(Calendar.WEEK_OF_YEAR); + + // Falta sacar el calculo + + Entrego = BigDecimal.ZERO; + ComisionAp = BigDecimal.ZERO; + AbonosSemana = BigDecimal.ZERO; + Presto = BigDecimal.ZERO; + data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).forEach(py -> { + calendarFor.setTime(py.getFecha()); + + if (numberWeekOfYear == calendarFor.get(Calendar.WEEK_OF_YEAR)) { + setComisionAp(py.getComisionApertura()); + setAbonosSemana(py.getPaymentMonday()); + setAbonosSemana(py.getPaymentTuesday()); + setAbonosSemana(py.getPaymentWednesday()); + setAbonosSemana(py.getPaymentThursday()); + setAbonosSemana(py.getPaymentFriday()); + setAbonosSemana(py.getPaymentSaturday()); + setPresto(py.getApoyos()); + } + }); + Entrego = Entrego.add(ComisionAp.add(AbonosSemana)); + + Long BonosNuevos = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).filter((py) -> (py.getNewCustomer().equalsIgnoreCase("Si"))).count(); + BigDecimal sumaAbonosSemana = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).map((py) -> py.getPaymentMonday().add(py.getPaymentTuesday() + .add(py.getPaymentWednesday().add(py.getPaymentThursday().add(py.getPaymentFriday().add(py.getPaymentSaturday())))))).reduce(BigDecimal::add).get(); + BigDecimal sumaFaltante = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).map((py) -> py.getFaltante()).reduce(BigDecimal::add).get(); + BigDecimal faltanteReal = sumaAbonosSemana.subtract(sumaFaltante); + + //(FALTANTE REAL* 100) / ENTREGO + BigDecimal porcentajeReal = faltanteReal.multiply(BigDecimal.valueOf(100.0)); + double entr = Entrego.doubleValue(); + double porcReal = porcentajeReal.doubleValue(); + + if (Entrego.compareTo(BigDecimal.ZERO) > 0 && porcentajeReal.compareTo(BigDecimal.ZERO) != 0) { + porcentajeReal = new BigDecimal(porcReal/entr); + } + else{ + porcentajeReal = BigDecimal.ZERO; + } + + //Totales + cellNew = r.createCell(1); + cellNew.setCellType(CellType.STRING); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.setCellValue("TOTALES GENERAL: "); + + //EntregĆ³ + cellNew = r.createCell(2); + cellNew.setCellType(CellType.STRING); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.setCellValue("EntregĆ³: "); + cellNew = r.createCell(3); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + cellNew.setCellValue(Entrego.doubleValue()); + + //PrestĆ³ + cellNew = r.createCell(4); + cellNew.setCellType(CellType.STRING); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.setCellValue("PrestĆ³: "); + cellNew = r.createCell(5); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + cellNew.setCellValue(Presto.doubleValue()); + + //Faltante Real + cellNew = r.createCell(6); + cellNew.setCellType(CellType.STRING); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.setCellValue("Faltante Real: "); + cellNew = r.createCell(7); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + cellNew.setCellValue(faltanteReal.doubleValue()); + + //Porcentaje Real + cellNew = r.createCell(8); + cellNew.setCellType(CellType.STRING); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.setCellValue("Porcentaje Real: "); + cellNew = r.createCell(9); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + cellNew.setCellValue(porcentajeReal.doubleValue()); + + //Bonos Nuevos + cellNew = r.createCell(10); + cellNew.setCellType(CellType.STRING); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.setCellValue("Bonos Nuevos: "); + cellNew = r.createCell(11); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.setCellValue(BonosNuevos); + + } + // Se calcula el campo Entrego y Presto + BigDecimal Entrego = BigDecimal.ZERO; + BigDecimal ComisionAp = BigDecimal.ZERO; + BigDecimal AbonosSemana = BigDecimal.ZERO; + BigDecimal Presto = BigDecimal.ZERO; + + public BigDecimal getComisionAp() { + return ComisionAp; + } + + public void setComisionAp(BigDecimal ComisionAp) { + this.ComisionAp = this.ComisionAp.add(ComisionAp); + } + + public BigDecimal getAbonosSemana() { + return AbonosSemana; + } + + public void setAbonosSemana(BigDecimal AbonosSemana) { + this.AbonosSemana = this.AbonosSemana.add(AbonosSemana); + } + + public BigDecimal getPresto() { + return Presto; + } + + public void setPresto(BigDecimal Presto) { + this.Presto = this.Presto.add(Presto); + } + + private HSSFCellStyle getCellStyle(String cellStyleColor) { + if (cellStyleColor == null) { + cellStyleColor = "White"; + } + + switch (cellStyleColor) { + case "redRow": + return cellStyleRed; + case "greenRow": + return cellStyleGreen; + case "yellowRow": + return cellStyleYellow; + case "blueRow": + return cellStyleBlue; + case "blueLightRow": + return cellStyleBlueLight; + case "greenLigthRow": + return cellStyleGreenLight; + case "greenStrongRow": + return cellStyleGreenStrong; + case "greyRow": + return cellStyleGrey; + case "orangeRow": + return cellStyleOrange; + case "difRow": + return cellStyleDif; + case "whiteRow": + return cellStyleWhite; + case "limeGreenRow": + return cellStyleLimeGreen; + default: + return cellStyleWhite; + } + } + + private void initCellStyle(HSSFWorkbook wb) { + // MULTA + fontRed = wb.createFont(); + cellStyleRed = wb.createCellStyle(); + fontRed.setColor(HSSFColor.HSSFColorPredefined.GREY_25_PERCENT.getIndex()); + cellStyleRed.setFillPattern(FillPatternType.SOLID_FOREGROUND); + cellStyleRed.setFillForegroundColor(IndexedColors.RED.getIndex()); + //cellStyleRed.setFont(fontRed); + + // ABONO 0 + fontGreen = wb.createFont(); + cellStyleGreen = wb.createCellStyle(); + fontGreen.setColor(HSSFColor.HSSFColorPredefined.GREY_25_PERCENT.getIndex()); + cellStyleGreen.setFillPattern(FillPatternType.SOLID_FOREGROUND); + cellStyleGreen.setFillForegroundColor(IndexedColors.SEA_GREEN.getIndex()); + //cellStyleGreen.setFont(fontGreen); + + // ABONƓ MENOS + fontYellow = wb.createFont(); + cellStyleYellow = wb.createCellStyle(); + fontYellow.setColor(HSSFColor.HSSFColorPredefined.GREY_25_PERCENT.getIndex()); + cellStyleYellow.setFillPattern(FillPatternType.SOLID_FOREGROUND); + cellStyleYellow.setFillForegroundColor(IndexedColors.LIGHT_YELLOW.getIndex()); + //cellStyleYellow.setFont(fontYellow); + + // ABONƓ DE MƁS + fontBlue = wb.createFont(); + cellStyleBlue = wb.createCellStyle(); + fontBlue.setColor(HSSFColor.HSSFColorPredefined.GREY_25_PERCENT.getIndex()); + cellStyleBlue.setFillPattern(FillPatternType.SOLID_FOREGROUND); + //cellStyleBlue.setFillForegroundColor(HSSFColor.HSSFColorPredefined.BLUE.getIndex()); + cellStyleBlue.setFillForegroundColor(IndexedColors.TURQUOISE.getIndex()); + //cellStyleBlue.setFont(fontBlue); + + // PAGO CONGELADO + fontBlueLight = wb.createFont(); + cellStyleBlueLight = wb.createCellStyle(); + fontBlueLight.setColor(HSSFColor.HSSFColorPredefined.GREY_25_PERCENT.getIndex()); + cellStyleBlueLight.setFillPattern(FillPatternType.SOLID_FOREGROUND); + cellStyleBlueLight.setFillForegroundColor(IndexedColors.LIGHT_BLUE.getIndex()); + + // RENOVƓ + fontGreenLight = wb.createFont(); + cellStyleGreenLight = wb.createCellStyle(); + fontGreenLight.setColor(HSSFColor.HSSFColorPredefined.GREY_25_PERCENT.getIndex()); + cellStyleGreenLight.setFillPattern(FillPatternType.SOLID_FOREGROUND); + cellStyleGreenLight.setFillForegroundColor(IndexedColors.BRIGHT_GREEN.getIndex()); + //cellStyleGreenLight.setFont(fontGreenLight); + + // getSaldoInsoluto == 0 + fontGreenStrong = wb.createFont(); + cellStyleGreenStrong = wb.createCellStyle(); + fontGreenStrong.setColor(HSSFColor.HSSFColorPredefined.GREY_25_PERCENT.getIndex()); + cellStyleGreenStrong.setFillPattern(FillPatternType.SOLID_FOREGROUND); + cellStyleGreenStrong.setFillForegroundColor(IndexedColors.GREEN.getIndex()); + //cellStyleGreenStrong.setFont(fontGreenStrong); + + //Reactivacion + fontLimeGreen= wb.createFont(); + cellStyleLimeGreen = wb.createCellStyle(); + fontLimeGreen.setColor(HSSFColor.HSSFColorPredefined.GREY_25_PERCENT.getIndex()); + cellStyleLimeGreen.setFillPattern(FillPatternType.SOLID_FOREGROUND); + cellStyleLimeGreen.setFillForegroundColor(IndexedColors.LIME.getIndex()); + + // CLIENTE NUEVO + fontOrange = wb.createFont(); + cellStyleOrange = wb.createCellStyle(); + fontOrange.setColor(HSSFColor.HSSFColorPredefined.GREY_25_PERCENT.getIndex()); + cellStyleOrange.setFillPattern(FillPatternType.SOLID_FOREGROUND); + cellStyleOrange.setFillForegroundColor(IndexedColors.ORANGE.getIndex()); + //cellStyleGreenLight.setFont(fontGreenLight); + + // Totales + fontGrey = wb.createFont(); + cellStyleGrey = wb.createCellStyle(); + fontGrey.setColor(HSSFColor.HSSFColorPredefined.WHITE.getIndex()); + cellStyleGrey.setFillPattern(FillPatternType.SOLID_FOREGROUND); + cellStyleGrey.setFillForegroundColor(IndexedColors.GREY_50_PERCENT.getIndex()); + cellStyleGrey.setFont(fontGrey); + + // Totales + fontDif = wb.createFont(); + cellStyleDif = wb.createCellStyle(); + fontDif.setColor(HSSFColor.HSSFColorPredefined.RED.getIndex()); + //cellStyleDif.setFillPattern(FillPatternType.SOLID_FOREGROUND); + //cellStyleDif.setFillForegroundColor(IndexedColors.WHITE.getIndex()); + cellStyleDif.setFont(fontDif); + + cellStyleWhite = wb.createCellStyle(); + cellStyleWhite.setFillPattern(FillPatternType.SOLID_FOREGROUND); + cellStyleWhite.setFillForegroundColor(HSSFColor.HSSFColorPredefined.WHITE.getIndex()); + } + + private DriverController driverCtrl; + private GenericController genericCtrl; + private List data; + private InformationLoanWeekView selectedData; + private LoanController loanCtrl; + + private List dataColocation; + private ColocationWeekByUserView selectedColocation; + + private List dataSubtotal; + private SubtotalWeekByUserView selectedSubtotal; + + private List dataResumen; + private ResumenInOutWeekByUserView selectedResumen; + + private List dataCobranza; + private CobranzaWeekByUserView selectedCobranza; + + private List dataTotal; + private ResumenTotalWeekView selectedTotal; + + private List loanDetails; + + // Datos para pintar las celdas + HSSFCellStyle cellStyleRed; + HSSFFont fontRed; + HSSFCellStyle cellStyleGreen; + HSSFFont fontGreen; + HSSFCellStyle cellStyleYellow; + HSSFFont fontYellow; + HSSFCellStyle cellStyleBlue; + HSSFFont fontBlue; + HSSFCellStyle cellStyleBlueLight; + HSSFFont fontBlueLight; + HSSFCellStyle cellStyleGreenLight; + HSSFFont fontGreenLight; + HSSFCellStyle cellStyleGreenStrong; + HSSFFont fontGreenStrong; + HSSFCellStyle cellStyleOrange; + HSSFFont fontOrange; + HSSFCellStyle cellStyleWhite; + HSSFCellStyle cellStyleGrey; + HSSFFont fontGrey; + HSSFCellStyle cellStyleDif; + HSSFFont fontDif; + HSSFCellStyle cellStyleLimeGreen; + HSSFFont fontLimeGreen; + + + @PostConstruct + public void init() { + SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd"); + loadBundlePropertyFile(); + initStartAndEndDates(Calendar.DAY_OF_WEEK, 2); + String date = DATE_FORMAT.format(getStarDate()); + + driverCtrl = new DriverController(); + genericCtrl = new GenericController(); + loanCtrl = new LoanController(); + data = fillDataTable(); + dataColocation = driverCtrl.getAllColocationWeekByOfficeMySQLQuery(date, getLoggedUser().getOffice().getId()); + dataSubtotal = driverCtrl.getAllSubtotalThisWeekByOfficeMySQLQuery(date, getLoggedUser().getOffice().getId()); + dataResumen = driverCtrl.getAllResumenInOutThisWeekByOfficeMySQLQuery(date, getLoggedUser().getOffice().getId()); + dataCobranza = driverCtrl.getAllCobranzaThisWeekByOfficeMySQLQuery(date, getLoggedUser().getOffice().getId()); + dataTotal = driverCtrl.getAllResumenTotalWeekByOfficeMySQLQuery(date, getLoggedUser().getOffice().getId()); + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/drive/DriverLastBean.java b/ace-web/src/main/java/com/arrebol/apc/web/drive/DriverLastBean.java new file mode 100644 index 0000000..3ccf22a --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/drive/DriverLastBean.java @@ -0,0 +1,593 @@ +/* + * 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.web.drive; + +import com.arrebol.apc.controller.drive.DriverController; +import com.arrebol.apc.model.views.CobranzaLastWeekByUserView; +import com.arrebol.apc.model.views.ColocationLastWeekByUserView; +import com.arrebol.apc.model.views.InformationLoanLastWeekView; +import com.arrebol.apc.model.views.ResumeNewCustomerLastWeekView; +import com.arrebol.apc.model.views.ResumenInOutLastWeekByUserView; +import com.arrebol.apc.model.views.ResumenTotalLastWeekView; +import com.arrebol.apc.model.views.SubtotalLastWeekByUserView; +import com.arrebol.apc.web.beans.Datatable; +import com.arrebol.apc.web.beans.GenericBean; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import org.apache.poi.hssf.usermodel.HSSFCell; +import org.apache.poi.hssf.usermodel.HSSFCellStyle; +import org.apache.poi.hssf.usermodel.HSSFFont; +import org.apache.poi.hssf.usermodel.HSSFRow; +import org.apache.poi.hssf.usermodel.HSSFSheet; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.hssf.util.HSSFColor; +import org.apache.poi.ss.usermodel.BorderStyle; +import org.apache.poi.ss.usermodel.CellType; +import org.apache.poi.ss.usermodel.FillPatternType; +import org.apache.poi.ss.usermodel.IndexedColors; +import org.primefaces.event.ReorderEvent; +import org.primefaces.event.RowEditEvent; + +/** + * + * @author Oscar Armando Vargas Cardenas + */ +@Named("driverLastManager") +@ViewScoped +public class DriverLastBean extends GenericBean implements Serializable, Datatable{ + + @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 onRowReorder(ReorderEvent event) { + 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. + } + + public DriverController getDriverCtrl() { + return driverCtrl; + } + + public void setDriverCtrl(DriverController driverCtrl) { + this.driverCtrl = driverCtrl; + } + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public InformationLoanLastWeekView getSelectedData() { + return selectedData; + } + + public void setSelectedData(InformationLoanLastWeekView selectedData) { + this.selectedData = selectedData; + } + + public List getDataColocation() { + return dataColocation; + } + + public void setDataColocation(List dataColocation) { + this.dataColocation = dataColocation; + } + + public ColocationLastWeekByUserView getSelectedColocation() { + return selectedColocation; + } + + public void setSelectedColocation(ColocationLastWeekByUserView selectedColocation) { + this.selectedColocation = selectedColocation; + } + + public List getDataSubtotal() { + return dataSubtotal; + } + + public void setDataSubtotal(List dataSubtotal) { + this.dataSubtotal = dataSubtotal; + } + + public SubtotalLastWeekByUserView getSelectedSubtotal() { + return selectedSubtotal; + } + + public void setSelectedSubtotal(SubtotalLastWeekByUserView selectedSubtotal) { + this.selectedSubtotal = selectedSubtotal; + } + + public List getDataResumen() { + return dataResumen; + } + + public void setDataResumen(List dataResumen) { + this.dataResumen = dataResumen; + } + + public ResumenInOutLastWeekByUserView getSelectedResumen() { + return selectedResumen; + } + + public void setSelectedResumen(ResumenInOutLastWeekByUserView selectedResumen) { + this.selectedResumen = selectedResumen; + } + + public List getDataCobranza() { + return dataCobranza; + } + + public void setDataCobranza(List dataCobranza) { + this.dataCobranza = dataCobranza; + } + + public CobranzaLastWeekByUserView getSelectedCobranza() { + return selectedCobranza; + } + + public void setSelectedCobranza(CobranzaLastWeekByUserView selectedCobranza) { + this.selectedCobranza = selectedCobranza; + } + + public List getDataTotal() { + return dataTotal; + } + + public void setDataTotal(List dataTotal) { + this.dataTotal = dataTotal; + } + + public ResumenTotalLastWeekView getSelectedTotal() { + return selectedTotal; + } + + public void setSelectedTotal(ResumenTotalLastWeekView selectedTotal) { + this.selectedTotal = selectedTotal; + } + + public List getDataCtesNvos() { + return dataCtesNvos; + } + + public void setDataCtesNvos(List dataCtesNvos) { + this.dataCtesNvos = dataCtesNvos; + } + + public ResumeNewCustomerLastWeekView getSelectedCtesNvos() { + return selectedCtesNvos; + } + + public void setSelectedCtesNvos(ResumeNewCustomerLastWeekView selectedCtesNvos) { + this.selectedCtesNvos = selectedCtesNvos; + } + + public void paintDataXLS(Object document) { + HSSFWorkbook wb = (HSSFWorkbook) document; + HSSFSheet sheet = wb.getSheetAt(0); + HSSFRow header = sheet.getRow(0); + HSSFCellStyle cellStyle = wb.createCellStyle(); + HSSFFont font = wb.createFont(); + font.setBold(true); + cellStyle.setFont(font); + cellStyle.setBorderTop(BorderStyle.DOUBLE); + cellStyle.setBorderBottom(BorderStyle.DOUBLE); + cellStyle.setBorderLeft(BorderStyle.DOUBLE); + cellStyle.setBorderRight(BorderStyle.DOUBLE); + cellStyle.setFillForegroundColor(HSSFColor.HSSFColorPredefined.LEMON_CHIFFON.getIndex()); + cellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); + + short dataFormat = wb.createDataFormat().getFormat("$#,##0.00"); + + initCellStyle(wb); + + for (int i = 0; i < header.getPhysicalNumberOfCells(); i++) { + HSSFCell cell = header.getCell(i); + cell.setCellStyle(cellStyle); + } + + String aux = ""; + for (int i = 1; i < sheet.getPhysicalNumberOfRows(); i++) { + HSSFRow row = sheet.getRow(i); + InformationLoanLastWeekView loanWeekData = data.get(i-1); + HSSFCell cell; + String rowRenov = loanWeekData.getConditionRenovation(); + //cellStyleRow = getCellStyle(rowRenov); + // Row General + for (int j = 0; j < row.getPhysicalNumberOfCells(); j++) { + cell = row.getCell(j); + cell.setCellStyle(getCellStyle(rowRenov)); + + if((j >= 7 && j <= 22) || (j == 2 || j == 3)){ + cell.getCellStyle().setDataFormat(dataFormat); + aux = cell.getStringCellValue().replace("$", ""); + aux = aux.replace(",", ""); + cell.setCellValue(Double.parseDouble(aux)); + cell.setCellType(CellType.NUMERIC); + } + } + + // Lunes + cell = row.getCell(10); + cell.setCellStyle(getCellStyle(loanWeekData.getConditionLunes())); + cell.getCellStyle().setDataFormat(dataFormat); + cell = row.getCell(11); + cell.setCellStyle(getCellStyle(loanWeekData.getConditionLunes())); + cell.getCellStyle().setDataFormat(dataFormat); + + // Martes + cell = row.getCell(12); + cell.setCellStyle(getCellStyle(loanWeekData.getConditionMartes())); + cell.getCellStyle().setDataFormat(dataFormat); + cell = row.getCell(13); + cell.setCellStyle(getCellStyle(loanWeekData.getConditionMartes())); + cell.getCellStyle().setDataFormat(dataFormat); + + // MiĆ©rcoles + cell = row.getCell(14); + cell.setCellStyle(getCellStyle(loanWeekData.getConditionMiercoles())); + cell.getCellStyle().setDataFormat(dataFormat); + cell = row.getCell(15); + cell.setCellStyle(getCellStyle(loanWeekData.getConditionMiercoles())); + cell.getCellStyle().setDataFormat(dataFormat); + + // Jueves + cell = row.getCell(16); + cell.setCellStyle(getCellStyle(loanWeekData.getConditionJueves())); + cell.getCellStyle().setDataFormat(dataFormat); + cell = row.getCell(17); + cell.setCellStyle(getCellStyle(loanWeekData.getConditionJueves())); + cell.getCellStyle().setDataFormat(dataFormat); + + // Viernes + cell = row.getCell(18); + cell.setCellStyle(getCellStyle(loanWeekData.getConditionViernes())); + cell.getCellStyle().setDataFormat(dataFormat); + cell = row.getCell(19); + cell.setCellStyle(getCellStyle(loanWeekData.getConditionViernes())); + cell.getCellStyle().setDataFormat(dataFormat); + + // SĆ”bado + cell = row.getCell(20); + cell.setCellStyle(getCellStyle(loanWeekData.getConditionSabado())); + cell.getCellStyle().setDataFormat(dataFormat); + cell = row.getCell(21); + cell.setCellStyle(getCellStyle(loanWeekData.getConditionSabado())); + cell.getCellStyle().setDataFormat(dataFormat); + } + + String ruta = data.get(0).getRouteName(); + int regInsertados = 0; + + for (int i = 1; i < sheet.getPhysicalNumberOfRows(); i++) { + HSSFRow row = sheet.getRow(i); + InformationLoanLastWeekView loanWeekData = data.get(i-1-regInsertados); + + if(!ruta.equalsIgnoreCase(data.get(i-1-regInsertados).getRouteName())){ + creaRegistroTotales(ruta, sheet, dataFormat, false, i); + ruta = data.get(i-1-regInsertados).getRouteName(); + regInsertados++; + } + } + creaRegistroTotales(ruta, sheet, dataFormat, true, sheet.getPhysicalNumberOfRows()+1); + } + + private void creaRegistroTotales(String ruta, HSSFSheet sheet, short dataFormat, boolean lastRow, int i){ + HSSFRow r; + HSSFCell cellNew; + String rutaAux = ruta; + if (lastRow) { + r = sheet.createRow(sheet.getPhysicalNumberOfRows() + 1); + } else { + sheet.shiftRows(i, sheet.getLastRowNum(), 1, true, false); + r = sheet.createRow(i); + } + + // Apoyos + cellNew = r.createCell(3); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + BigDecimal suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux) && p.getWeekLoanDate() == p.getWeekCurrentDate())).map((py) -> py.getApoyos()).reduce(BigDecimal::add).isPresent() + ? data.stream().filter((p) -> (p.getRouteName().equals(rutaAux) && p.getWeekLoanDate() == p.getWeekCurrentDate())).map((py) -> py.getApoyos()).reduce(BigDecimal::add).get() + : BigDecimal.ZERO; + cellNew.setCellValue(suma.doubleValue()); + // Comsion por apertura + cellNew = r.createCell(4); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux) && p.getWeekLoanDate() == p.getWeekCurrentDate())).map((py) -> py.getComisionApertura()).reduce(BigDecimal::add).isPresent() + ? data.stream().filter((p) -> (p.getRouteName().equals(rutaAux) && p.getWeekLoanDate() == p.getWeekCurrentDate())).map((py) -> py.getComisionApertura()).reduce(BigDecimal::add).get() + : BigDecimal.ZERO; + cellNew.setCellValue(suma.doubleValue()); + + //Totales + cellNew = r.createCell(9); + cellNew.setCellType(CellType.STRING); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.setCellValue("TOTALES: "); + // Lunes + cellNew = r.createCell(10); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).map((py) -> py.getPaymentMonday()).reduce(BigDecimal::add).get(); + cellNew.setCellValue(suma.doubleValue()); + cellNew = r.createCell(11); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).map((py) -> py.getFeeMonday()).reduce(BigDecimal::add).get(); + cellNew.setCellValue(suma.doubleValue()); + // Martes + cellNew = r.createCell(12); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).map((py) -> py.getPaymentTuesday()).reduce(BigDecimal::add).get(); + cellNew.setCellValue(suma.doubleValue()); + cellNew = r.createCell(13); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).map((py) -> py.getFeeTuesday()).reduce(BigDecimal::add).get(); + cellNew.setCellValue(suma.doubleValue()); + // MiĆ©rcoles + cellNew = r.createCell(14); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).map((py) -> py.getPaymentWednesday()).reduce(BigDecimal::add).get(); + cellNew.setCellValue(suma.doubleValue()); + cellNew = r.createCell(15); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).map((py) -> py.getFeeWednesday()).reduce(BigDecimal::add).get(); + cellNew.setCellValue(suma.doubleValue()); + // Jueves + cellNew = r.createCell(16); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).map((py) -> py.getPaymentThursday()).reduce(BigDecimal::add).get(); + cellNew.setCellValue(suma.doubleValue()); + cellNew = r.createCell(17); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).map((py) -> py.getFeeThursday()).reduce(BigDecimal::add).get(); + cellNew.setCellValue(suma.doubleValue()); + // Viernes + cellNew = r.createCell(18); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).map((py) -> py.getPaymentFriday()).reduce(BigDecimal::add).get(); + cellNew.setCellValue(suma.doubleValue()); + cellNew = r.createCell(19); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).map((py) -> py.getFeeFriday()).reduce(BigDecimal::add).get(); + cellNew.setCellValue(suma.doubleValue()); + // SĆ”bado + cellNew = r.createCell(20); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).map((py) -> py.getPaymentSaturday()).reduce(BigDecimal::add).get(); + cellNew.setCellValue(suma.doubleValue()); + cellNew = r.createCell(21); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).map((py) -> py.getFeeSaturday()).reduce(BigDecimal::add).get(); + cellNew.setCellValue(suma.doubleValue()); + // Faltante + cellNew = r.createCell(22); + cellNew.setCellType(CellType.NUMERIC); + cellNew.setCellStyle(getCellStyle("greyRow")); + cellNew.getCellStyle().setDataFormat(dataFormat); + suma = data.stream().filter((p) -> (p.getRouteName().equals(rutaAux))).map((py) -> py.getFaltante()).reduce(BigDecimal::add).get(); + cellNew.setCellValue(suma.doubleValue()); + } + + private HSSFCellStyle getCellStyle (String cellStyleColor){ + if(cellStyleColor == null){ + cellStyleColor = "White"; + } + + switch(cellStyleColor){ + case "redRow": + return cellStyleRed; + case "greenRow": + return cellStyleGreen; + case "yellowRow": + return cellStyleYellow; + case "blueRow": + return cellStyleBlue; + case "blueLightRow": + return cellStyleBlueLight; + case "greenLigthRow": + return cellStyleGreenLight; + case "greenStrongRow": + return cellStyleGreenStrong; + case "greyRow": + return cellStyleGrey; + case "orangeRow": + return cellStyleOrange; + default: + return cellStyleWhite; + } + } + + private void initCellStyle(HSSFWorkbook wb){ + // MULTA + fontRed = wb.createFont(); + cellStyleRed = wb.createCellStyle(); + fontRed.setColor(HSSFColor.HSSFColorPredefined.GREY_25_PERCENT.getIndex()); + cellStyleRed.setFillPattern(FillPatternType.SOLID_FOREGROUND); + cellStyleRed.setFillForegroundColor(IndexedColors.RED.getIndex()); + //cellStyleRed.setFont(fontRed); + + // ABONO 0 + fontGreen = wb.createFont(); + cellStyleGreen = wb.createCellStyle(); + fontGreen.setColor(HSSFColor.HSSFColorPredefined.GREY_25_PERCENT.getIndex()); + cellStyleGreen.setFillPattern(FillPatternType.SOLID_FOREGROUND); + cellStyleGreen.setFillForegroundColor(IndexedColors.SEA_GREEN.getIndex()); + //cellStyleGreen.setFont(fontGreen); + + // ABONƓ MENOS + fontYellow = wb.createFont(); + cellStyleYellow = wb.createCellStyle(); + fontYellow.setColor(HSSFColor.HSSFColorPredefined.GREY_25_PERCENT.getIndex()); + cellStyleYellow.setFillPattern(FillPatternType.SOLID_FOREGROUND); + cellStyleYellow.setFillForegroundColor(IndexedColors.LIGHT_YELLOW.getIndex()); + //cellStyleYellow.setFont(fontYellow); + + // ABONƓ DE MƁS + fontBlue = wb.createFont(); + cellStyleBlue = wb.createCellStyle(); + fontBlue.setColor(HSSFColor.HSSFColorPredefined.GREY_25_PERCENT.getIndex()); + cellStyleBlue.setFillPattern(FillPatternType.SOLID_FOREGROUND); + //cellStyleBlue.setFillForegroundColor(HSSFColor.HSSFColorPredefined.BLUE.getIndex()); + cellStyleBlue.setFillForegroundColor(IndexedColors.TURQUOISE.getIndex()); + //cellStyleBlue.setFont(fontBlue); + + // PAGO CONGELADO + fontBlueLight = wb.createFont(); + cellStyleBlueLight = wb.createCellStyle(); + fontBlueLight.setColor(HSSFColor.HSSFColorPredefined.GREY_25_PERCENT.getIndex()); + cellStyleBlueLight.setFillPattern(FillPatternType.SOLID_FOREGROUND); + cellStyleBlueLight.setFillForegroundColor(IndexedColors.LIGHT_BLUE.getIndex()); + + // RENOVƓ + fontGreenLight = wb.createFont(); + cellStyleGreenLight = wb.createCellStyle(); + fontGreenLight.setColor(HSSFColor.HSSFColorPredefined.GREY_25_PERCENT.getIndex()); + cellStyleGreenLight.setFillPattern(FillPatternType.SOLID_FOREGROUND); + cellStyleGreenLight.setFillForegroundColor(IndexedColors.BRIGHT_GREEN.getIndex()); + //cellStyleGreenLight.setFont(fontGreenLight); + + // getSaldoInsoluto == 0 + fontGreenStrong = wb.createFont(); + cellStyleGreenStrong = wb.createCellStyle(); + fontGreenStrong.setColor(HSSFColor.HSSFColorPredefined.GREY_25_PERCENT.getIndex()); + cellStyleGreenStrong.setFillPattern(FillPatternType.SOLID_FOREGROUND); + cellStyleGreenStrong.setFillForegroundColor(IndexedColors.GREEN.getIndex()); + //cellStyleGreenStrong.setFont(fontGreenStrong); + + // CLIENTE NUEVO + fontOrange = wb.createFont(); + cellStyleOrange = wb.createCellStyle(); + fontOrange.setColor(HSSFColor.HSSFColorPredefined.GREY_25_PERCENT.getIndex()); + cellStyleOrange.setFillPattern(FillPatternType.SOLID_FOREGROUND); + cellStyleOrange.setFillForegroundColor(IndexedColors.ORANGE.getIndex()); + //cellStyleGreenLight.setFont(fontGreenLight); + + // Totales + fontGrey = wb.createFont(); + cellStyleGrey = wb.createCellStyle(); + fontGrey.setColor(HSSFColor.HSSFColorPredefined.WHITE.getIndex()); + cellStyleGrey.setFillPattern(FillPatternType.SOLID_FOREGROUND); + cellStyleGrey.setFillForegroundColor(IndexedColors.GREY_50_PERCENT.getIndex()); + cellStyleGrey.setFont(fontGrey); + + cellStyleWhite = wb.createCellStyle(); + cellStyleWhite.setFillPattern(FillPatternType.SOLID_FOREGROUND); + cellStyleWhite.setFillForegroundColor(HSSFColor.HSSFColorPredefined.WHITE.getIndex()); + } + + private DriverController driverCtrl; + private List data; + private InformationLoanLastWeekView selectedData; + + private List dataColocation; + private ColocationLastWeekByUserView selectedColocation; + + private List dataSubtotal; + private SubtotalLastWeekByUserView selectedSubtotal; + + private List dataResumen; + private ResumenInOutLastWeekByUserView selectedResumen; + + private List dataCobranza; + private CobranzaLastWeekByUserView selectedCobranza; + + private List dataTotal; + private ResumenTotalLastWeekView selectedTotal; + + private List dataCtesNvos; + private ResumeNewCustomerLastWeekView selectedCtesNvos; + + // Datos para pintar las celdas + HSSFCellStyle cellStyleRed; + HSSFFont fontRed; + HSSFCellStyle cellStyleGreen; + HSSFFont fontGreen; + HSSFCellStyle cellStyleYellow; + HSSFFont fontYellow; + HSSFCellStyle cellStyleBlue; + HSSFFont fontBlue; + HSSFCellStyle cellStyleBlueLight; + HSSFFont fontBlueLight; + HSSFCellStyle cellStyleGreenLight; + HSSFFont fontGreenLight; + HSSFCellStyle cellStyleGreenStrong; + HSSFFont fontGreenStrong; + HSSFCellStyle cellStyleOrange; + HSSFFont fontOrange; + HSSFCellStyle cellStyleWhite; + HSSFCellStyle cellStyleGrey; + HSSFFont fontGrey; + + @PostConstruct + public void init() { + driverCtrl = new DriverController(); + data = driverCtrl.getAllLoanLastWeekByOffice(getLoggedUser().getOffice().getId()); + dataColocation = driverCtrl.getAllColocationLastWeekByOffice(getLoggedUser().getOffice().getId()); + dataSubtotal = driverCtrl.getAllSubtotalLastWeekByOffice(getLoggedUser().getOffice().getId()); + dataResumen = driverCtrl.getAllResumenInOutLastWeekByOffice(getLoggedUser().getOffice().getId()); + dataCobranza = driverCtrl.getAllCobranzaLastWeekByOffice(getLoggedUser().getOffice().getId()); + dataTotal = driverCtrl.getAllResumenTotalLastWeekByOffice(getLoggedUser().getOffice().getId()); + dataCtesNvos = driverCtrl.getAllResumenNewCustomerLastWeekByOffice(); + + for(SubtotalLastWeekByUserView subtotal : dataSubtotal) + { + Double sumFaltante = data.stream().filter(p -> p.getIdUser().equalsIgnoreCase(subtotal.getId())).mapToDouble(h -> h.getFaltante().doubleValue()).sum(); + subtotal.setFaltante(new BigDecimal(sumFaltante)); + } + } + +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/validators/GenericValidator.java b/ace-web/src/main/java/com/arrebol/apc/web/validators/GenericValidator.java new file mode 100644 index 0000000..406713e --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/validators/GenericValidator.java @@ -0,0 +1,42 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.arrebol.apc.web.validators; + +import java.util.ResourceBundle; +import javax.faces.application.FacesMessage; +import javax.faces.validator.ValidatorException; + +/** + * + * @author Picasso + */ +public abstract class GenericValidator { + + /** + * Raise a message with SEVERITY_ERROR.s + * + * @param message + * @throws ValidatorException + */ + protected void errorSeverity(String message) throws ValidatorException { + FacesMessage msg = new FacesMessage(message); + + msg.setSeverity(FacesMessage.SEVERITY_ERROR); + + throw new ValidatorException(msg); + } + + protected ResourceBundle bundlePropertyFile; + private final String PROPERTY_FILE = "com.arrebol.apc.i18n.app_background"; + + public ResourceBundle getBundlePropertyFile() { + return bundlePropertyFile; + } + + public synchronized void loadBundlePropertyFile() { + this.bundlePropertyFile = ResourceBundle.getBundle(PROPERTY_FILE); + } +} diff --git a/ace-web/src/main/java/com/arrebol/apc/web/validators/SelectOneMenuValidator.java b/ace-web/src/main/java/com/arrebol/apc/web/validators/SelectOneMenuValidator.java new file mode 100644 index 0000000..813e8bb --- /dev/null +++ b/ace-web/src/main/java/com/arrebol/apc/web/validators/SelectOneMenuValidator.java @@ -0,0 +1,27 @@ +package com.arrebol.apc.web.validators; + +import javax.faces.component.UIComponent; +import javax.faces.context.FacesContext; +import javax.faces.validator.FacesValidator; +import javax.faces.validator.Validator; +import javax.faces.validator.ValidatorException; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@FacesValidator("selectOneMenuValidator") +public class SelectOneMenuValidator extends GenericValidator implements Validator { + + @Override + public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException { + loadBundlePropertyFile(); + + if (null == value + || "".equals(value.toString()) + || "N/A".equals(value.toString())) { + errorSeverity(getBundlePropertyFile().getString("validator.select.one.menu.invalid.option")); + } + } + +} diff --git a/ace-web/src/main/resources/com/arrebol/apc/i18n/app.properties b/ace-web/src/main/resources/com/arrebol/apc/i18n/app.properties new file mode 100644 index 0000000..a0d6329 --- /dev/null +++ b/ace-web/src/main/resources/com/arrebol/apc/i18n/app.properties @@ -0,0 +1,599 @@ +project.short.name=ACE +project.complete.name=ACE Guadalajara +arrebol.reserved=Todos los Derechos Reservados. +############### +# ERROR PAGES # +############### +error.title=Ha ocurrido un error +error.return.dashboard=Regresar al tablero +error.contact.admin=Por favor contacte al administrador +error.forbidden=Acceso denegado +error.not.found=P\u00e1gina no encontrada +######### +# Login # +######### +user=Usuario +password=Contrase\u00f1a +confirm=Confirmar +sign.in=Iniciar sesi\u00f3n +sign.out=Cerrar sesi\u00f3n +password.reset=Restablecer contrase\u00f1a +remember.me=\u00bfRecordarme? +new.account=\u00bfNo tienes una cuenta? +now=ahora +sign.up=Reg\u00edstrate +require.msg.user.empty=Ingrese el usuario. +require.msg.password.empty=Ingrese la contrase\u00f1a. +############# +# Dashboard # +############# +dashboard.title=Tablero +########## +# System # +########## +system.title=Sistema +system.users=Usuarios +system.users.add=Alta +system.users.setting=Actualizaci\u00f3n +system.users.permission=Accesos +user.create=Crear usuario +user.update=Actualizar usuario +user.add.access=Asignar accesos +user.update.access=Asignar accesos +user.update.routes=Actualizar ruta de usuario +access.from=Permisos disponibles +access.to=Permisos asignados +access.updte=Modificar accesos +permission.add=Agregar permisos +permission.update=Actualizar permisos +user.disable=Deshabilitar usuarios +user.disable.btn=Deshabilitar usuario +user.eneble=Habilitar usuarios +user.eneble.btn=Habilitar usuario +user.delete=Borrar usuarios +user.delete.btn=Borrar usuario +user.update.pwd=Actualizaci\u00f3n de contrase\u00f1a +user.update.pwd.btn=Actualizar contrase\u00f1a +user.update.username.btn=Modificar nombre de usuario +select.user=Elegir usuario +load.user.access=Cargar accesos del usuario +user.confirm.header=Datos del usuario +user.confirm.question=\u00bfLos datos del usuario son correctos? +user.are.you.sure.enebled=\u00bfEstas seguro de habilitar al usuario? +user.are.you.sure.disabled=\u00bfEstas seguro deshabilitar al usuario? +user.are.you.sure.deleted=\u00bfEstas seguro de eliminar al usuario? +user.are.you.sure.username=\u00bfEstas seguro de modificar el nombre de usuario? +user.are.you.sure.pwd=\u00bfEstas seguro de modificar la contrase\u00f1a? +user.are.you.sure.avatar=\u00bfEstas seguro de modificar la imagen del usuario? +system.office=Oficina +system.office.datatable.empty=No hay oficina para mostrar +system.office.datatable.column.name=Nombre +system.office.datatable.column.address=Domicilio +system.office.dialog.require.msg.name.empty=El nombre de la oficina es obligatorio +system.office.dialog.require.msg.address.empty=La direcci\u00f3n de la oficina es obligatorio +system.bitacora=Bit\u00e1cora +system.bitacoras.datatable.empty=No hay registros por mostrar +system.bitacoras.datatable.column.action=Acci\u00f3n +system.bitacoras.datatable.column.description=Descripci\u00f3n +system.bitacoras.datatable.column.commentsUser=Comentarios del usuario +system.bitacoras.datatable.column.user=Usuario +system.bitacoras.datatable.column.createdOn=Fecha +################## +# Human Resource # +################## +hr=Empleado +add.hr=Alta empleado +first.name=Nombre +second.name=Segundo nombre +last.name=Apellido paterno +middle.name=Apellido materno +date.birthdate=Fecha de nacimiento +date.addmission=Fecha de ingreso +role=Puesto +role.choose=Seleccione el puesto +SECRETARY=Secretaria +CEO=Director ejecutivo +ADVISER=Supervisor +hr.create.btn=Crear empleado +hr.update.btn=Actualizar empleado +first.name.required=Nombre obligatorio +last.name.required=Apellido paterno obligatorio +middle.name.required=Apellido materno obligatoio +role.choose.required=Puesto es obligatorio +user.type.required=Tipo usuario es obligatorio +hr.confirm.header=Datos del empleado +hr.confirm.question=\u00bfLos datos del empleado son correctos? +employee.disable=Deshabilitar empleados +employee.disable.btn=Deshabilitar empleado +employee.eneble=Habilitar empleados +employee.eneble.btn=Habilitar empleado +employee.delete=Borrar empleados +employee.delete.btn=Borrar empleado +employee.update.load.btn=Cargar datos del empleado +employee.update.pwd=Actualizaci\u00f3n de contrase\u00f1a +employee.update.pwd.btn=Actualizar contrase\u00f1a +select.employee=Elegir empleado +select.employee.required=Empleado es obligatorio +########### +# Catalog # +########### +catalog.title=Cat\u00e1logos +catalog.roles=Puestos +catalog.typeLoan=Tipo de prestamos +catalog.route=Rutas +catalog.roles.datatable.empty=No hay puestos para mostrar +catalog.roles.datatable.column.name=Nombre +catalog.roles.dialog.title=Puesto +catalog.roles.dialog.require.msg.color.empty=El nombre del puesto es obligatorio +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.column.name=Nombre +catalog.loanTypes.datatable.column.totalDays=Total d\u00edas +catalog.loanTypes.datatable.column.fee=Multa +catalog.loanTypes.datatable.column.payment=Pr\u00e9stamo +catalog.loanTypes.datatable.column.paymentDaily=Abono diario +catalog.loanTypes.datatable.column.paymentTotal=Total a pagar +catalog.loanTypes.datatable.column.openingFee=Comisi\u00f3n por apertura +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.title=Importe a prestar +catalog.loanTypes.dialog.fee.require.msg.empty=El valor de la multa es obligatorio +catalog.loanTypes.dialog.fee.title=Multa +catalog.loanTypes.dialog.paymentDaily.require.msg.empty=El valor del abono diario es obligatorio +catalog.loanTypes.dialog.paymentDaily.title=Abono diario +catalog.loanTypes.dialog.openingFee.require.msg.empty=La comisi\u00f3n por apertura es obligatoria +catalog.loanTypes.dialog.openingFee.title=Comisi\u00f3n por apertura +catalog.loanTypes.dialog.monday.title=Lunes +catalog.loanTypes.dialog.tuesday.title=Martes +catalog.loanTypes.dialog.wednesday.title=Miercoles +catalog.loanTypes.dialog.thursday.title=Jueves +catalog.loanTypes.dialog.friday.title=Viernes +catalog.loanTypes.dialog.saturday.title=Sabado +catalog.loanTypes.dialog.sunday.title=Domingo +########### +# Admin # +########### +admin.title=Administraci\u00f3n +admin.people.title=Clientes/Avales +admin.customer=Clientes +admin.endorsement=Avales +admin.people.add=Crear cliente/aval +admin.loan=Pr\u00e9stamos +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.financial=Financiero +admin.financial.transfer=Transferencias +admin.financial.moneyDaily=Inicios +admin.financial.closingDay=Corte del d\u00eda +admin.financial.closingDayHistory=Historial de cortes +admin.financial.otherExpense=Gastos +admin.payroll=N\u00f3mina +admin.payroll.goals=Metas +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.stats.fees=Multas +admin.stats.closingday=Corte caja chica +admin.stats.openingfee=Comisi\u00f3n por apertura +admin.stats.payment=Cobro de cartera +admin.stats.paymentroute=Cobro de cartera por ruta +admin.stats.paymentrenovation=Pagos renovados +admin.stats.payroll=N\u00f3mina +admin.stats.summary=Res\u00famen asesor +admin.general.box=Caja general +admin.stats.deposits=Dep\u00f3sitos bancarios +admin.stats.zeropayments=Abonos en cero +admin.stats.employeesaving=Ahorro empleados +admin.stats.advances=Adelantos +admin.stats.gasoline=Gasolinas +admin.stats.vehicle=Veh\u00edculos +admin.general.box.expenseCompanyIn=Entradas +admin.general.box.expenseCompanyOut=Gastos administrativos +admin.general.box.expense.company.in=Entradas +admin.general.box.expense.company.out=Gastos administrativos +admin.general.box.stable=Cuadre de caja +admin.general.box.stable.history=Historial de cuadre de caja +admin.customers.datatable.empty=No hay clientes para mostrar +admin.customers.datatable.column.name=Nombre +admin.customers.datatable.column.companyName=Negocio +admin.customers.datatable.column.addressBusiness=Direcci\u00f3n negocio +admin.customers.datatable.column.addressPersonal=Direcci\u00f3n personal +admin.customers.datatable.column.routeCtlg=Ruta +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.detail.field.name=Nombre +admin.customers.detail.field.firstName=Primer nombre +admin.customers.detail.field.secondName=Segundo nombre +admin.customers.detail.field.lastName=Apellido paterno +admin.customers.detail.field.middleName=Apellido materno +admin.customers.detail.field.birthdate=Fecha de nacimiento +admin.customers.detail.field.phoneHome=Tel\u00e9fono de casa +admin.customers.detail.field.addressHome=Domicilio personal +admin.customers.detail.field.peopleType=Tipo +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.column.endorsement=Aval +admin.customers.detail.datatable.column.loanStatus=Estatus +admin.customers.detail.datatable.column.amountToPay=Monto a pagar +admin.customers.detail.datatable.column.amountPaid=Monto pagado +admin.customers.detail.datatable.column.createdOn=Fecha +admin.customers.detail.datatable.column.routeCtlg=Ruta +admin.customers.detail.datatable.column.comments=Observaciones +admin.customers.detail.datatable.column.totalFee=No. de multas +admin.endorsements.datatable.empty=No hay avales para mostrar +admin.endorsements.datatable.column.name=Nombre +admin.endorsements.datatable.column.phoneHome=Tel\u00e9fono +admin.endorsements.datatable.column.addressHome=Domicilio personal +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.detail.field.name=Nombre +admin.endorsements.detail.field.birthdate=Fecha de nacimiento +admin.endorsements.detail.field.phoneHome=Tel\u00e9fono de casa +admin.endorsements.detail.field.addressHome=Domicilio personal +admin.endorsements.detail.field.peopleType=Tipo +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.column.customer=Cliente +admin.endorsements.detail.datatable.column.loanStatus=Estatus +admin.endorsements.detail.datatable.column.amountToPay=Monto a pagar +admin.endorsements.detail.datatable.column.amountPaid=Monto pagado +admin.endorsements.detail.datatable.column.createdOn=Fecha +admin.endorsements.detail.datatable.column.routeCtlg=Ruta +admin.endorsements.detail.datatable.column.comments=Observaciones +admin.endorsements.detail.datatable.column.totalFee=No. de multas +admin.people.form.firstName.require.msg.empty=El primer nombre es obligatorio +admin.people.dialog.firstName.title=Primer nombre +admin.people.dialog.secondName.title=Segundo +admin.people.form.lastName.require.msg.empty=El apellido paterno es obligatorio +admin.people.dialog.lastName.title=Apellido paterno +admin.people.form.middleName.require.msg.empty=El apellido materno es obligatorio +admin.people.dialog.middleName.title=Apellido materno +admin.people.dialog.isCustomer.title=Es cliente +admin.people.dialog.isEndorsement.title=Es aval +admin.people.form.phoneHome.require.msg.empty=El tel\u00e9fono personal es obligatorio +admin.people.dialog.phoneHome.title=Tel\u00e9fono personal +admin.people.form.addressHome.require.msg.empty=El domicilio particular es obligatorio +admin.people.dialog.addressHome.title=Domicilio particular +admin.people.form.phoneBusiness.require.msg.empty=El tel\u00e9fono del negocio es obligatorio +admin.people.dialog.phoneBusiness.title=Tel\u00e9fono del negocio +admin.people.form.addressBusiness.require.msg.empty=El domicilio del negocio es obligatorio +admin.people.dialog.addressBusiness.title=Domicilio del negocio +admin.people.form.companyName.require.msg.empty=El nombre del negocio es obligatorio +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.column.customer=Cliente +admin.loans.datatable.column.routeCtlg=Ruta +admin.loans.datatable.column.endorsement=Aval +admin.loans.datatable.column.amountPaid=Monto a prestar +admin.loans.datatable.column.loan.amountPaid=Monto pagado +admin.loans.datatable.column.loan.amountToPaid=Monto a pagar +admin.loans.datatable.column.loan.saldo=Saldo insoluto +admin.loans.datatable.column.loanFeeNotifications=No. de multas +admin.loans.datatable.column.asesor=Asesor +admin.loans.datatable.column.createdOn=Fecha +admin.loans.datatable.column.loanStatus=Estatus +admin.loans.datatable.column.comments=Comentarios +admin.loans.datatable.column.office=Sucursal +admin.loan.form.typeLoan.require.msg.empty=El tipo de pr\u00e9stamo es obligatorio +admin.loan.form.customer.require.msg.empty=El cliente es obligatorio +admin.loan.form.endorsement.require.msg.empty=El aval es obligatorio +admin.loan.form.user.require.msg.empty=El asesor es obligatorio +admin.loan.form.loanStatus.require.msg.empty=El estatus es obligatorio +admin.loan.form.field.comments=Comentarios +admin.loan.form.field.createdOn=Fecha +admin.loan.form.field.totalPayment=Total abonado +admin.loan.form.field.totalFee=Total en multas +admin.transfers.datatable.empty=No hay transferencias por mostrar +admin.transfers.datatable.column.userTransmitter=Asesor emisor +admin.transfers.datatable.column.userReceiver=Asesor receptor +admin.transfers.datatable.column.amountToTransfer=Monto +admin.transfers.datatable.column.actionStatus=Estatus +admin.transfer.form.userSend.require.msg.empty=El usuario emisor es obligatorio +admin.transfer.form.userReceive.require.msg.empty=El usuario receptor es obligatorio +admin.transfer.form.field.amountToTransfer=Monto a transferir +admin.moneyDailys.datatable.empty=No hay registros por mostrar +admin.moneyDailys.datatable.column.moneyDailyDate=Fecha +admin.moneyDailys.datatable.column.amount=Monto +admin.moneyDailys.datatable.column.user=Empleado +admin.moneyDaily.form.user.require.msg.empty=El empleado es obligatorio +admin.moneyDaily.form.field.amount=Monto +admin.closingDays.datatable.empty=No hay registros por mostrar +admin.closingDays.datatable.column.user=Usuario +admin.closingDays.datatable.column.amountPaid=Monto reportado +admin.closingDays.datatable.column.amountExpected=Monto a reportar +admin.closingDays.datatable.column.createdOn=Fecha +admin.closingDays.datatable.column.comments=Comentarios +admin.closingDays.form.user.require.msg.empty=El usuario es obligatorio +admin.closingDays.dialog.paymentDaily.title=Monto recuperado +admin.closingDays.dialog.transferSender.title=Monto enviado por transferencia +admin.closingDays.dialog.transferReceiver.title=Monto recibido por transferencia +admin.closingDays.dialog.moneyDaily.title=Monto de inicio +admin.closingDays.dialog.delivery.title=Entrega de prestamos +admin.closingDays.dialog.otherExpense.title=Gastos +admin.closingDays.dialog.total.title=Total +admin.closingDays.dialog.transferPending.title=Transferencias sin autorizar +admin.otherExpenses.datatable.empty=No hay gastos por mostrar +admin.otherExpenses.datatable.column.user=Usuario +admin.otherExpenses.datatable.column.expense=Monto +admin.otherExpenses.datatable.column.description=Comentarios +admin.otherExpense.form.user.require.msg.empty=Debes seleccionar un usuario +admin.otherExpense.form.field.expense=Monto +admin.otherExpense.form.field.description=Descripci\u00f3n +admin.advances.datatable.empty=No hay registros por mostrar. +admin.gasoline.datatable.empty=No hay registros por mostrar. +admin.advances.datatable.column.humanResource=Empleado +admin.advances.datatable.column.amount=Monto +admin.advance.form.humanResource.require.msg.empty=El empleado es obligatorio +admin.advance.form.field.amount=Monto +admin.goals.datatable.empty=No hay registros por mostrar. +admin.goals.datatable.column.startDate=Fecha inicial +admin.goals.datatable.column.endDate=Fecha final +admin.goals.datatable.column.amount=Monto +admin.goal.form.startDate.require.msg.empty=La fecha inicial es obligatoria. +admin.goal.dialog.startDate.title=Fecha inicial +admin.goal.form.endDate.require.msg.empty=La fecha final es obligatoria. +admin.goal.dialog.endDate.title=Fecha final +admin.goal.form.field.amount=Monto +admin.fees.datatable.column.startDate=Fecha inicial +admin.fees.datatable.column.endDate=Fecha final +admin.closingday.datatable.column.startDate=Fecha inicial +admin.closingday.datatable.column.endDate=Fecha final +admin.openingfees.datatable.column.startDate=Fecha inicial +admin.openingfees.datatable.column.endDate=Fecha final +admin.payment.datatable.column.startDate=Fecha inicial +admin.payment.datatable.column.endDate=Fecha final +admin.payroll.datatable.column.startDate=Fecha inicial +admin.payroll.datatable.column.endDate=Fecha final +admin.payroll.datatable.empty=No hay registros por mostrar. +admin.deposits.datatable.column.startDate=Fecha inicial +admin.deposits.datatable.column.endDate=Fecha final +admin.zeropayments.datatable.column.startDate=Fecha inicial +admin.zeropayments.datatable.column.endDate=Fecha final +admin.employeesaving.datatable.column.startDate=Fecha inicial +admin.employeesaving.datatable.column.endDate=Fecha final +admin.advances.datatable.column.startDate=Fecha inicial +admin.advances.datatable.column.endDate=Fecha final +admin.gasoline.datatable.column.startDate=Fecha inicial +admin.gasoline.datatable.column.endDate=Fecha final +admin.expenseCompany.datatable.empty=No hay registros por mostrar +admin.expenseCompany.datatable.column.createdOn=Fecha +admin.expenseCompany.datatable.column.amount=Monto +admin.expenseCompany.datatable.column.description=Motivo +admin.expenseCompany.form.field.amount=Monto +admin.expenseCompany.form.field.comments=Motivo +admin.stableGeneralBox.datatable.empty=No hay registros por mostrar +admin.stableGeneralBox.datatable.column.createdOn=Fecha +admin.stableGeneralBox.datatable.column.totalGeneralBox=Total en caja +admin.stableGeneralBox.datatable.column.totalEnvelope=Deje en sobres +admin.stableGeneralBox.datatable.column.totalBankNote=Efectivo +admin.stableGeneralBox.datatable.column.totalCoin=Monedas +admin.stableGeneralBox.datatable.column.totalStable=Diferencia +admin.stableGeneralBox.datatable.column.description=Descripci\u00f3n +admin.stableSmallBox.datatable.empty=No hay registros por mostrar +admin.stableSmallBox.datatable.column.createdOn=Fecha +admin.stableSmallBox.datatable.column.totalSmallBox=Total en caja chica +admin.stableSmallBox.datatable.column.totalEnvelope=Deje en sobres +admin.stableSmallBox.datatable.column.totalBankNote=Efectivo +admin.stableSmallBox.datatable.column.totalCoin=Monedas +admin.stableSmallBox.datatable.column.totalStable=Diferencia +admin.stableSmallBox.datatable.column.description=Descripci\u00f3n +admin.bonuss.datatable.empty=No hay registros por mostrar +admin.bonuss.datatable.column.name=Nombre +admin.bonuss.datatable.column.loanBonus=Porcentaje/Monto por colocaci\u00f3n +admin.bonuss.datatable.column.moraBonus=Porcentaje/Monto por mora +admin.bonuss.datatable.column.newCustomerBonus=Porcentaje/Monto por nuevos clientes +admin.bonuss.datatable.column.administrative=Administrativo +admin.payroll.form.user.require.msg.empty=El usuario es requerido +admin.payroll.form.field.dateInit=Fecha inicial +admin.payroll.form.field.dateEnd=Fecha final +admin.payroll.dialog.salary.title=Salario +admin.payroll.dialog.imss.title=IMSS +admin.payroll.dialog.advances.title=Adelantos +admin.payroll.dialog.bonusColocation.title=Bono de colocaci\u00f3n +admin.payroll.dialog.newCustomer.title=Bono por clientes nuevos +admin.payroll.dialog.bonusMora.title=Bono por mora +admin.payroll.dialog.granTotal.title=Total +admin.payrolls.datatable.empty=Sin registros que mostrar +admin.payrolls.datatable.column.hr=Empleado +admin.payrolls.datatable.column.salary=Salario +admin.payrolls.datatable.column.imss=Imss +admin.payrolls.datatable.column.advance=Adelantos +admin.payrolls.datatable.column.totalBonusNewCustomer=Bono por clientes nuevos +admin.payrolls.datatable.column.totalBonusColocation=Bono por colocaci\u00f3n +admin.payrolls.datatable.column.totalBonusMora=Bono por mora +admin.payrolls.datatable.column.discounts=Descuentos +admin.payrolls.datatable.column.commentsDiscounts=Comentarios por descuentos +admin.payrolls.datatable.column.increases=Incremento extra +admin.payrolls.datatable.column.commentsIncreases=Comentarios por incremento +admin.payrolls.datatable.column.totalPayment=Total n\u00f3mina +admin.payrolls.datatable.column.totalDaysSalary=D\u00edas para salario +admin.payrolls.datatable.column.totalDaysBonus=D\u00edas para bonos +admin.payrolls.datatable.column.observation=Observaciones +admin.payrolls.datatable.column.createdOn=Fecha +############ +# Outcomes # +############ +outcome.dashboard=/dashboard +outcome.system.user.add=/app/system/user/add/main +outcome.system.user.setting=/app/system/user/setting/main +outcome.system.user.access=/app/system/user/access/main +outcome.system.log=/app/system/log/main +outcome.system.office=/app/system/office/index +outcome.employee=/app/system/employee/main +outcome.employee.employeeList=/app/system/employee/employeeList +outcome.catalog.role=/app/catalog/role/index +outcome.catalog.typeLoan=/app/catalog/loanType/index +outcome.catalog.typeLoan.add=/app/catalog/loanType/add +outcome.catalog.route=/app/catalog/route/index +outcome.admin.customer=/app/admin/customer/index +outcome.admin.customer.detail=/app/admin/customer/detail +outcome.admin.endorsement=/app/admin/endorsement/index +outcome.admin.endorsement.detail=/app/admin/endorsement/detail +outcome.admin.endorsement.customer.add=/app/admin/customer/add +outcome.admin.loan.pending=/app/admin/loan/index +outcome.admin.loan.pending.detail=/app/admin/loan/detail +outcome.admin.loan.history=/app/admin/loan/history +outcome.admin.loan.loanDetailTransfer=/app/admin/loan/loanDetailTransfer +outcome.admin.loan.historyJuridical=/app/admin/loan/historyJuridical +outcome.admin.loan.drive=/app/admin/loan/drive +outcome.admin.loan.renovation=/app/admin/loan/loanRenovationWeekly +outcome.admin.loan.drive.last=/app/admin/loan/driveLast +outcome.admin.loan.drive.date=/app/admin/loan/driveDate +outcome.admin.loan.history.detail=/app/admin/loan/historyDetail +outcome.admin.loan.change.owner=/app/admin/loan/changeOwner +outcome.admin.financial.transfer=/app/admin/transfer/index +outcome.admin.financial.moneyDaily=/app/admin/moneyDaily/index +outcome.admin.financial.closingDay=/app/admin/closingDay/index +outcome.admin.financial.closingDayHistory=/app/admin/closingDay/history +outcome.admin.financial.closingDayHistory.detail=/app/admin/closingDay/detail +outcome.admin.financial.stableSmallBox=/app/admin/stableSmallBox/index +outcome.admin.financial.stableSmallBoxHistory=/app/admin/stableSmallBox/history +outcome.admin.financial.otherExpense=/app/admin/otherExpense/index +outcome.admin.payroll.goal=/app/payroll/goal/index +outcome.admin.payroll.bonus=/app/payroll/bonus/index +outcome.admin.payroll.advance=/app/payroll/advance/index +outcome.admin.payroll.create=/app/payroll/createPayroll/index +outcome.admin.payroll.history=/app/payroll/history +outcome.admin.vehicles.addvehicle=/app/admin/vehicles/main +outcome.admin.fees.fees=/app/stats/feesByRoute/index +outcome.admin.stats.fees=/app/stats/fees/index +outcome.admin.stats.closingday=/app/stats/closingDay/index +outcome.admin.stats.openingfee=/app/stats/openingFee/index +outcome.admin.stats.payment=/app/stats/payment/index +outcome.admin.stats.paymentroute=/app/stats/paymentRoute/index +outcome.admin.stats.payroll=/app/stats/payroll/index +outcome.admin.stats.deposits=/app/stats/deposits/index +outcome.admin.stats.zeropayments=/app/stats/zeroPayments/index +outcome.admin.stats.employeesaving=/app/stats/employeeSaving/index +outcome.admin.stats.advances=/app/stats/advances/index +outcome.admin.stats.paymentrenovation=/app/stats/paymentRenovation/index +outcome.admin.stats.gasoline=/app/stats/gasoline/index +outcome.admin.stats.vehicle=/app/stats/vehicles/index +outcome.admin.stats.summary=/app/stats/summary/index +outcome.payroll.loanemployee=/app/payroll/loanEmployee/index +outcome.admin.general.box.expense.company.in=/app/generalBox/expenseCompanyIn/index +outcome.admin.general.box.expense.company.out=/app/generalBox/expenseCompanyOut/index +outcome.admin.general.box.stable=/app/generalBox/stableGeneralBox/index +outcome.admin.general.box.history=/app/generalBox/stableGeneralBox/history +outcome.privacy=/app/topbar/privacy +outcome.admin.customer.without.loan.detail=/customerWithoutLoanDetail +outcome.dashboard.loan.detail=/loanDetail +outcome.dashboard.loan.detailEndorsement=/loanDetailEndorsement +outcome.system.bitacora=/app/system/bitacora/index +########### +# General # +########### +profile=Perfil +privacy=Privacidad +setting=Configuraci\u00f3n +logout=Salir +choose.office=Seleccione la sucursal +office=Sucursal +office.selected=Sucursal {0} +photo.add=Agregar imagen +select=Seleccionar +upload=Cargar +cancel=Cancelar +add=Agregar +add.all=Agregar todos +remove=Quitar +remove.all=Quitar todos +arrebol.reserved=Todos los Derechos Reservados. +validator.select.office=Oficina no v\u00e1lida. +office.confirm.header=Cambiar de sucursal +office.confirm.question=\u00bfEstas seguro que deseas cambiar de sucursal? +pwd.promptLabel=Introduce tu contrase\u00f1a +pwd.weakLabel=Contrase\u00f1a d\u00e9bil +pwd.goodLabel=Contrase segura +pwd.strongLabel=Contrase\u00f1a s\u00faper segura +pwd.promptLabel.confirm=Confirma tu contrase\u00f1a +pwd.match.passwords=Las contrase\u00f1as son diferentes. +pattern.date=dd - MMMM - yyyy +pick.down=Bajar +pick.up=Subir +pick.bottom=Mover al fondo +pick.top=Mover al inicio +pick.add=Agregar +pick.add.all=Agregar todos +pick.remove=Remover +pick.remove.all=Remover todos +dual.list.permissions.required=Seleccione al menos un permiso +dual.list.permissions.available=Permisos disponibles +dual.list.permissions.taken=Permisos asignados +dual.list.routes.required=Seleccione al menos una ruta +dual.list.routes.available=Rutas disponibles +dual.list.routes.taken=Rutas asignadas +permission.add.btn=Asisgar permisos +permission.update.btn=Actualizar permisos +permission.confirm.header=Datos del trabajador +permission.confirm.question=\u00bfLos datos del trabajador son correctos? +permission=Permiso +screen=Pantalla +confirm.yes=Aceptar +confirm.no=Rechazar +invalid.file=Imagen no v\u00e1lida. +invalid.size=Imagen muy grande. +user.required=Usuario requerido. +user.load.permission=\u00bfQuiere buscar los permisos del usuario? +button.add=Agregar +general.search=Buscar +button.edit=Editar +button.save=Guardar +button.authorize=Autorizar +general.confirm.header=Validaci\u00f3n de informaci\u00f3n +general.confirm.confirm=\u00bfEst\u00e1s seguro de continuar con la acci\u00f3n? +salario=Salario +imss=IMSS +payment.required=Salario obligatorio +imss.required=IMSS obligatorio +other.actions=Otras acciones +choose.action=Elegir acci\u00f3n +execute.action=Ejecutar acci\u00f3n +change.owner=Cambiar asesor +change.owner.of.loans=Cambiar los prestamos al asesor destino +current.owner.select=Elegir asesor origen +current.owner.select.name=Nombre del asesor origen +new.owner.select=Elegir asesor destino +new.owner.select.name=Nombre del asesor destino +current.owner.from=Prestamos asesor origen +current.owner.to=Prestamos asesor destino +dual.list.current.owner.required=Seleccione al menos un presamo a cambiar de asesor +change.owner.confirm.question=\u00bfDesea cambiar los prestamos al asesor destino? +stats.closingday=Corte +stats.openingFees=Comisi\u00f3n por apertura +stats.openingFees.comisiones=Comisiones +stats.payment=Cobro de cartera +stats.paymentrenovation=Pagos renovados +stats.paymentroute=Cobro de cartera por ruta +stats.payment.cobros=Cobros +stats.payroll=N\u00f3mina +stats.deposits=Dep\u00f3sitos +stats.zeropayments=Abonos en cero +stats.employeesaving=Ahorro empleados +stats.advances=Adelantos +stats.gasoline=Gasolinas \ No newline at end of file diff --git a/ace-web/src/main/resources/com/arrebol/apc/i18n/app.properties.bak b/ace-web/src/main/resources/com/arrebol/apc/i18n/app.properties.bak new file mode 100644 index 0000000..1c9d69f --- /dev/null +++ b/ace-web/src/main/resources/com/arrebol/apc/i18n/app.properties.bak @@ -0,0 +1,599 @@ +project.short.name=ACE +project.complete.name=APOYO A COMERCIOS EMPRESARIALES +arrebol.reserved=Todos los Derechos Reservados. +############### +# ERROR PAGES # +############### +error.title=Ha ocurrido un error +error.return.dashboard=Regresar al tablero +error.contact.admin=Por favor contacte al administrador +error.forbidden=Acceso denegado +error.not.found=P\u00e1gina no encontrada +######### +# Login # +######### +user=Usuario +password=Contrase\u00f1a +confirm=Confirmar +sign.in=Iniciar sesi\u00f3n +sign.out=Cerrar sesi\u00f3n +password.reset=Restablecer contrase\u00f1a +remember.me=\u00bfRecordarme? +new.account=\u00bfNo tienes una cuenta? +now=ahora +sign.up=Reg\u00edstrate +require.msg.user.empty=Ingrese el usuario. +require.msg.password.empty=Ingrese la contrase\u00f1a. +############# +# Dashboard # +############# +dashboard.title=Tablero +########## +# System # +########## +system.title=Sistema +system.users=Usuarios +system.users.add=Alta +system.users.setting=Actualizaci\u00f3n +system.users.permission=Accesos +user.create=Crear usuario +user.update=Actualizar usuario +user.add.access=Asignar accesos +user.update.access=Asignar accesos +user.update.routes=Actualizar ruta de usuario +access.from=Permisos disponibles +access.to=Permisos asignados +access.updte=Modificar accesos +permission.add=Agregar permisos +permission.update=Actualizar permisos +user.disable=Deshabilitar usuarios +user.disable.btn=Deshabilitar usuario +user.eneble=Habilitar usuarios +user.eneble.btn=Habilitar usuario +user.delete=Borrar usuarios +user.delete.btn=Borrar usuario +user.update.pwd=Actualizaci\u00f3n de contrase\u00f1a +user.update.pwd.btn=Actualizar contrase\u00f1a +user.update.username.btn=Modificar nombre de usuario +select.user=Elegir usuario +load.user.access=Cargar accesos del usuario +user.confirm.header=Datos del usuario +user.confirm.question=\u00bfLos datos del usuario son correctos? +user.are.you.sure.enebled=\u00bfEstas seguro de habilitar al usuario? +user.are.you.sure.disabled=\u00bfEstas seguro deshabilitar al usuario? +user.are.you.sure.deleted=\u00bfEstas seguro de eliminar al usuario? +user.are.you.sure.username=\u00bfEstas seguro de modificar el nombre de usuario? +user.are.you.sure.pwd=\u00bfEstas seguro de modificar la contrase\u00f1a? +user.are.you.sure.avatar=\u00bfEstas seguro de modificar la imagen del usuario? +system.office=Oficina +system.office.datatable.empty=No hay oficina para mostrar +system.office.datatable.column.name=Nombre +system.office.datatable.column.address=Domicilio +system.office.dialog.require.msg.name.empty=El nombre de la oficina es obligatorio +system.office.dialog.require.msg.address.empty=La direcci\u00f3n de la oficina es obligatorio +system.bitacora=Bit\u00e1cora +system.bitacoras.datatable.empty=No hay registros por mostrar +system.bitacoras.datatable.column.action=Acci\u00f3n +system.bitacoras.datatable.column.description=Descripci\u00f3n +system.bitacoras.datatable.column.commentsUser=Comentarios del usuario +system.bitacoras.datatable.column.user=Usuario +system.bitacoras.datatable.column.createdOn=Fecha +################## +# Human Resource # +################## +hr=Empleado +add.hr=Alta empleado +first.name=Nombre +second.name=Segundo nombre +last.name=Apellido paterno +middle.name=Apellido materno +date.birthdate=Fecha de nacimiento +date.addmission=Fecha de ingreso +role=Puesto +role.choose=Seleccione el puesto +SECRETARY=Secretaria +CEO=Director ejecutivo +ADVISER=Supervisor +hr.create.btn=Crear empleado +hr.update.btn=Actualizar empleado +first.name.required=Nombre obligatorio +last.name.required=Apellido paterno obligatorio +middle.name.required=Apellido materno obligatoio +role.choose.required=Puesto es obligatorio +user.type.required=Tipo usuario es obligatorio +hr.confirm.header=Datos del empleado +hr.confirm.question=\u00bfLos datos del empleado son correctos? +employee.disable=Deshabilitar empleados +employee.disable.btn=Deshabilitar empleado +employee.eneble=Habilitar empleados +employee.eneble.btn=Habilitar empleado +employee.delete=Borrar empleados +employee.delete.btn=Borrar empleado +employee.update.load.btn=Cargar datos del empleado +employee.update.pwd=Actualizaci\u00f3n de contrase\u00f1a +employee.update.pwd.btn=Actualizar contrase\u00f1a +select.employee=Elegir empleado +select.employee.required=Empleado es obligatorio +########### +# Catalog # +########### +catalog.title=Cat\u00e1logos +catalog.roles=Puestos +catalog.typeLoan=Tipo de prestamos +catalog.route=Rutas +catalog.roles.datatable.empty=No hay puestos para mostrar +catalog.roles.datatable.column.name=Nombre +catalog.roles.dialog.title=Puesto +catalog.roles.dialog.require.msg.color.empty=El nombre del puesto es obligatorio +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.column.name=Nombre +catalog.loanTypes.datatable.column.totalDays=Total d\u00edas +catalog.loanTypes.datatable.column.fee=Multa +catalog.loanTypes.datatable.column.payment=Pr\u00e9stamo +catalog.loanTypes.datatable.column.paymentDaily=Abono diario +catalog.loanTypes.datatable.column.paymentTotal=Total a pagar +catalog.loanTypes.datatable.column.openingFee=Comisi\u00f3n por apertura +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.title=Importe a prestar +catalog.loanTypes.dialog.fee.require.msg.empty=El valor de la multa es obligatorio +catalog.loanTypes.dialog.fee.title=Multa +catalog.loanTypes.dialog.paymentDaily.require.msg.empty=El valor del abono diario es obligatorio +catalog.loanTypes.dialog.paymentDaily.title=Abono diario +catalog.loanTypes.dialog.openingFee.require.msg.empty=La comisi\u00f3n por apertura es obligatoria +catalog.loanTypes.dialog.openingFee.title=Comisi\u00f3n por apertura +catalog.loanTypes.dialog.monday.title=Lunes +catalog.loanTypes.dialog.tuesday.title=Martes +catalog.loanTypes.dialog.wednesday.title=Miercoles +catalog.loanTypes.dialog.thursday.title=Jueves +catalog.loanTypes.dialog.friday.title=Viernes +catalog.loanTypes.dialog.saturday.title=Sabado +catalog.loanTypes.dialog.sunday.title=Domingo +########### +# Admin # +########### +admin.title=Administraci\u00f3n +admin.people.title=Clientes/Avales +admin.customer=Clientes +admin.endorsement=Avales +admin.people.add=Crear cliente/aval +admin.loan=Pr\u00e9stamos +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.financial=Financiero +admin.financial.transfer=Transferencias +admin.financial.moneyDaily=Inicios +admin.financial.closingDay=Corte del d\u00eda +admin.financial.closingDayHistory=Historial de cortes +admin.financial.otherExpense=Gastos +admin.payroll=N\u00f3mina +admin.payroll.goals=Metas +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.stats.fees=Multas +admin.stats.closingday=Corte caja chica +admin.stats.openingfee=Comisi\u00f3n por apertura +admin.stats.payment=Cobro de cartera +admin.stats.paymentroute=Cobro de cartera por ruta +admin.stats.paymentrenovation=Pagos renovados +admin.stats.payroll=N\u00f3mina +admin.stats.summary=Res\u00famen asesor +admin.general.box=Caja general +admin.stats.deposits=Dep\u00f3sitos bancarios +admin.stats.zeropayments=Abonos en cero +admin.stats.employeesaving=Ahorro empleados +admin.stats.advances=Adelantos +admin.stats.gasoline=Gasolinas +admin.stats.vehicle=Veh\u00edculos +admin.general.box.expenseCompanyIn=Entradas +admin.general.box.expenseCompanyOut=Gastos administrativos +admin.general.box.expense.company.in=Entradas +admin.general.box.expense.company.out=Gastos administrativos +admin.general.box.stable=Cuadre de caja +admin.general.box.stable.history=Historial de cuadre de caja +admin.customers.datatable.empty=No hay clientes para mostrar +admin.customers.datatable.column.name=Nombre +admin.customers.datatable.column.companyName=Negocio +admin.customers.datatable.column.addressBusiness=Direcci\u00f3n negocio +admin.customers.datatable.column.addressPersonal=Direcci\u00f3n personal +admin.customers.datatable.column.routeCtlg=Ruta +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.detail.field.name=Nombre +admin.customers.detail.field.firstName=Primer nombre +admin.customers.detail.field.secondName=Segundo nombre +admin.customers.detail.field.lastName=Apellido paterno +admin.customers.detail.field.middleName=Apellido materno +admin.customers.detail.field.birthdate=Fecha de nacimiento +admin.customers.detail.field.phoneHome=Tel\u00e9fono de casa +admin.customers.detail.field.addressHome=Domicilio personal +admin.customers.detail.field.peopleType=Tipo +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.column.endorsement=Aval +admin.customers.detail.datatable.column.loanStatus=Estatus +admin.customers.detail.datatable.column.amountToPay=Monto a pagar +admin.customers.detail.datatable.column.amountPaid=Monto pagado +admin.customers.detail.datatable.column.createdOn=Fecha +admin.customers.detail.datatable.column.routeCtlg=Ruta +admin.customers.detail.datatable.column.comments=Observaciones +admin.customers.detail.datatable.column.totalFee=No. de multas +admin.endorsements.datatable.empty=No hay avales para mostrar +admin.endorsements.datatable.column.name=Nombre +admin.endorsements.datatable.column.phoneHome=Tel\u00e9fono +admin.endorsements.datatable.column.addressHome=Domicilio personal +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.detail.field.name=Nombre +admin.endorsements.detail.field.birthdate=Fecha de nacimiento +admin.endorsements.detail.field.phoneHome=Tel\u00e9fono de casa +admin.endorsements.detail.field.addressHome=Domicilio personal +admin.endorsements.detail.field.peopleType=Tipo +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.column.customer=Cliente +admin.endorsements.detail.datatable.column.loanStatus=Estatus +admin.endorsements.detail.datatable.column.amountToPay=Monto a pagar +admin.endorsements.detail.datatable.column.amountPaid=Monto pagado +admin.endorsements.detail.datatable.column.createdOn=Fecha +admin.endorsements.detail.datatable.column.routeCtlg=Ruta +admin.endorsements.detail.datatable.column.comments=Observaciones +admin.endorsements.detail.datatable.column.totalFee=No. de multas +admin.people.form.firstName.require.msg.empty=El primer nombre es obligatorio +admin.people.dialog.firstName.title=Primer nombre +admin.people.dialog.secondName.title=Segundo +admin.people.form.lastName.require.msg.empty=El apellido paterno es obligatorio +admin.people.dialog.lastName.title=Apellido paterno +admin.people.form.middleName.require.msg.empty=El apellido materno es obligatorio +admin.people.dialog.middleName.title=Apellido materno +admin.people.dialog.isCustomer.title=Es cliente +admin.people.dialog.isEndorsement.title=Es aval +admin.people.form.phoneHome.require.msg.empty=El tel\u00e9fono personal es obligatorio +admin.people.dialog.phoneHome.title=Tel\u00e9fono personal +admin.people.form.addressHome.require.msg.empty=El domicilio particular es obligatorio +admin.people.dialog.addressHome.title=Domicilio particular +admin.people.form.phoneBusiness.require.msg.empty=El tel\u00e9fono del negocio es obligatorio +admin.people.dialog.phoneBusiness.title=Tel\u00e9fono del negocio +admin.people.form.addressBusiness.require.msg.empty=El domicilio del negocio es obligatorio +admin.people.dialog.addressBusiness.title=Domicilio del negocio +admin.people.form.companyName.require.msg.empty=El nombre del negocio es obligatorio +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.column.customer=Cliente +admin.loans.datatable.column.routeCtlg=Ruta +admin.loans.datatable.column.endorsement=Aval +admin.loans.datatable.column.amountPaid=Monto a prestar +admin.loans.datatable.column.loan.amountPaid=Monto pagado +admin.loans.datatable.column.loan.amountToPaid=Monto a pagar +admin.loans.datatable.column.loan.saldo=Saldo insoluto +admin.loans.datatable.column.loanFeeNotifications=No. de multas +admin.loans.datatable.column.asesor=Asesor +admin.loans.datatable.column.createdOn=Fecha +admin.loans.datatable.column.loanStatus=Estatus +admin.loans.datatable.column.comments=Comentarios +admin.loans.datatable.column.office=Sucursal +admin.loan.form.typeLoan.require.msg.empty=El tipo de pr\u00e9stamo es obligatorio +admin.loan.form.customer.require.msg.empty=El cliente es obligatorio +admin.loan.form.endorsement.require.msg.empty=El aval es obligatorio +admin.loan.form.user.require.msg.empty=El asesor es obligatorio +admin.loan.form.loanStatus.require.msg.empty=El estatus es obligatorio +admin.loan.form.field.comments=Comentarios +admin.loan.form.field.createdOn=Fecha +admin.loan.form.field.totalPayment=Total abonado +admin.loan.form.field.totalFee=Total en multas +admin.transfers.datatable.empty=No hay transferencias por mostrar +admin.transfers.datatable.column.userTransmitter=Asesor emisor +admin.transfers.datatable.column.userReceiver=Asesor receptor +admin.transfers.datatable.column.amountToTransfer=Monto +admin.transfers.datatable.column.actionStatus=Estatus +admin.transfer.form.userSend.require.msg.empty=El usuario emisor es obligatorio +admin.transfer.form.userReceive.require.msg.empty=El usuario receptor es obligatorio +admin.transfer.form.field.amountToTransfer=Monto a transferir +admin.moneyDailys.datatable.empty=No hay registros por mostrar +admin.moneyDailys.datatable.column.moneyDailyDate=Fecha +admin.moneyDailys.datatable.column.amount=Monto +admin.moneyDailys.datatable.column.user=Empleado +admin.moneyDaily.form.user.require.msg.empty=El empleado es obligatorio +admin.moneyDaily.form.field.amount=Monto +admin.closingDays.datatable.empty=No hay registros por mostrar +admin.closingDays.datatable.column.user=Usuario +admin.closingDays.datatable.column.amountPaid=Monto reportado +admin.closingDays.datatable.column.amountExpected=Monto a reportar +admin.closingDays.datatable.column.createdOn=Fecha +admin.closingDays.datatable.column.comments=Comentarios +admin.closingDays.form.user.require.msg.empty=El usuario es obligatorio +admin.closingDays.dialog.paymentDaily.title=Monto recuperado +admin.closingDays.dialog.transferSender.title=Monto enviado por transferencia +admin.closingDays.dialog.transferReceiver.title=Monto recibido por transferencia +admin.closingDays.dialog.moneyDaily.title=Monto de inicio +admin.closingDays.dialog.delivery.title=Entrega de prestamos +admin.closingDays.dialog.otherExpense.title=Gastos +admin.closingDays.dialog.total.title=Total +admin.closingDays.dialog.transferPending.title=Transferencias sin autorizar +admin.otherExpenses.datatable.empty=No hay gastos por mostrar +admin.otherExpenses.datatable.column.user=Usuario +admin.otherExpenses.datatable.column.expense=Monto +admin.otherExpenses.datatable.column.description=Comentarios +admin.otherExpense.form.user.require.msg.empty=Debes seleccionar un usuario +admin.otherExpense.form.field.expense=Monto +admin.otherExpense.form.field.description=Descripci\u00f3n +admin.advances.datatable.empty=No hay registros por mostrar. +admin.gasoline.datatable.empty=No hay registros por mostrar. +admin.advances.datatable.column.humanResource=Empleado +admin.advances.datatable.column.amount=Monto +admin.advance.form.humanResource.require.msg.empty=El empleado es obligatorio +admin.advance.form.field.amount=Monto +admin.goals.datatable.empty=No hay registros por mostrar. +admin.goals.datatable.column.startDate=Fecha inicial +admin.goals.datatable.column.endDate=Fecha final +admin.goals.datatable.column.amount=Monto +admin.goal.form.startDate.require.msg.empty=La fecha inicial es obligatoria. +admin.goal.dialog.startDate.title=Fecha inicial +admin.goal.form.endDate.require.msg.empty=La fecha final es obligatoria. +admin.goal.dialog.endDate.title=Fecha final +admin.goal.form.field.amount=Monto +admin.fees.datatable.column.startDate=Fecha inicial +admin.fees.datatable.column.endDate=Fecha final +admin.closingday.datatable.column.startDate=Fecha inicial +admin.closingday.datatable.column.endDate=Fecha final +admin.openingfees.datatable.column.startDate=Fecha inicial +admin.openingfees.datatable.column.endDate=Fecha final +admin.payment.datatable.column.startDate=Fecha inicial +admin.payment.datatable.column.endDate=Fecha final +admin.payroll.datatable.column.startDate=Fecha inicial +admin.payroll.datatable.column.endDate=Fecha final +admin.payroll.datatable.empty=No hay registros por mostrar. +admin.deposits.datatable.column.startDate=Fecha inicial +admin.deposits.datatable.column.endDate=Fecha final +admin.zeropayments.datatable.column.startDate=Fecha inicial +admin.zeropayments.datatable.column.endDate=Fecha final +admin.employeesaving.datatable.column.startDate=Fecha inicial +admin.employeesaving.datatable.column.endDate=Fecha final +admin.advances.datatable.column.startDate=Fecha inicial +admin.advances.datatable.column.endDate=Fecha final +admin.gasoline.datatable.column.startDate=Fecha inicial +admin.gasoline.datatable.column.endDate=Fecha final +admin.expenseCompany.datatable.empty=No hay registros por mostrar +admin.expenseCompany.datatable.column.createdOn=Fecha +admin.expenseCompany.datatable.column.amount=Monto +admin.expenseCompany.datatable.column.description=Motivo +admin.expenseCompany.form.field.amount=Monto +admin.expenseCompany.form.field.comments=Motivo +admin.stableGeneralBox.datatable.empty=No hay registros por mostrar +admin.stableGeneralBox.datatable.column.createdOn=Fecha +admin.stableGeneralBox.datatable.column.totalGeneralBox=Total en caja +admin.stableGeneralBox.datatable.column.totalEnvelope=Deje en sobres +admin.stableGeneralBox.datatable.column.totalBankNote=Efectivo +admin.stableGeneralBox.datatable.column.totalCoin=Monedas +admin.stableGeneralBox.datatable.column.totalStable=Diferencia +admin.stableGeneralBox.datatable.column.description=Descripci\u00f3n +admin.stableSmallBox.datatable.empty=No hay registros por mostrar +admin.stableSmallBox.datatable.column.createdOn=Fecha +admin.stableSmallBox.datatable.column.totalSmallBox=Total en caja chica +admin.stableSmallBox.datatable.column.totalEnvelope=Deje en sobres +admin.stableSmallBox.datatable.column.totalBankNote=Efectivo +admin.stableSmallBox.datatable.column.totalCoin=Monedas +admin.stableSmallBox.datatable.column.totalStable=Diferencia +admin.stableSmallBox.datatable.column.description=Descripci\u00f3n +admin.bonuss.datatable.empty=No hay registros por mostrar +admin.bonuss.datatable.column.name=Nombre +admin.bonuss.datatable.column.loanBonus=Porcentaje/Monto por colocaci\u00f3n +admin.bonuss.datatable.column.moraBonus=Porcentaje/Monto por mora +admin.bonuss.datatable.column.newCustomerBonus=Porcentaje/Monto por nuevos clientes +admin.bonuss.datatable.column.administrative=Administrativo +admin.payroll.form.user.require.msg.empty=El usuario es requerido +admin.payroll.form.field.dateInit=Fecha inicial +admin.payroll.form.field.dateEnd=Fecha final +admin.payroll.dialog.salary.title=Salario +admin.payroll.dialog.imss.title=IMSS +admin.payroll.dialog.advances.title=Adelantos +admin.payroll.dialog.bonusColocation.title=Bono de colocaci\u00f3n +admin.payroll.dialog.newCustomer.title=Bono por clientes nuevos +admin.payroll.dialog.bonusMora.title=Bono por mora +admin.payroll.dialog.granTotal.title=Total +admin.payrolls.datatable.empty=Sin registros que mostrar +admin.payrolls.datatable.column.hr=Empleado +admin.payrolls.datatable.column.salary=Salario +admin.payrolls.datatable.column.imss=Imss +admin.payrolls.datatable.column.advance=Adelantos +admin.payrolls.datatable.column.totalBonusNewCustomer=Bono por clientes nuevos +admin.payrolls.datatable.column.totalBonusColocation=Bono por colocaci\u00f3n +admin.payrolls.datatable.column.totalBonusMora=Bono por mora +admin.payrolls.datatable.column.discounts=Descuentos +admin.payrolls.datatable.column.commentsDiscounts=Comentarios por descuentos +admin.payrolls.datatable.column.increases=Incremento extra +admin.payrolls.datatable.column.commentsIncreases=Comentarios por incremento +admin.payrolls.datatable.column.totalPayment=Total n\u00f3mina +admin.payrolls.datatable.column.totalDaysSalary=D\u00edas para salario +admin.payrolls.datatable.column.totalDaysBonus=D\u00edas para bonos +admin.payrolls.datatable.column.observation=Observaciones +admin.payrolls.datatable.column.createdOn=Fecha +############ +# Outcomes # +############ +outcome.dashboard=/dashboard +outcome.system.user.add=/app/system/user/add/main +outcome.system.user.setting=/app/system/user/setting/main +outcome.system.user.access=/app/system/user/access/main +outcome.system.log=/app/system/log/main +outcome.system.office=/app/system/office/index +outcome.employee=/app/system/employee/main +outcome.employee.employeeList=/app/system/employee/employeeList +outcome.catalog.role=/app/catalog/role/index +outcome.catalog.typeLoan=/app/catalog/loanType/index +outcome.catalog.typeLoan.add=/app/catalog/loanType/add +outcome.catalog.route=/app/catalog/route/index +outcome.admin.customer=/app/admin/customer/index +outcome.admin.customer.detail=/app/admin/customer/detail +outcome.admin.endorsement=/app/admin/endorsement/index +outcome.admin.endorsement.detail=/app/admin/endorsement/detail +outcome.admin.endorsement.customer.add=/app/admin/customer/add +outcome.admin.loan.pending=/app/admin/loan/index +outcome.admin.loan.pending.detail=/app/admin/loan/detail +outcome.admin.loan.history=/app/admin/loan/history +outcome.admin.loan.loanDetailTransfer=/app/admin/loan/loanDetailTransfer +outcome.admin.loan.historyJuridical=/app/admin/loan/historyJuridical +outcome.admin.loan.drive=/app/admin/loan/drive +outcome.admin.loan.renovation=/app/admin/loan/loanRenovationWeekly +outcome.admin.loan.drive.last=/app/admin/loan/driveLast +outcome.admin.loan.drive.date=/app/admin/loan/driveDate +outcome.admin.loan.history.detail=/app/admin/loan/historyDetail +outcome.admin.loan.change.owner=/app/admin/loan/changeOwner +outcome.admin.financial.transfer=/app/admin/transfer/index +outcome.admin.financial.moneyDaily=/app/admin/moneyDaily/index +outcome.admin.financial.closingDay=/app/admin/closingDay/index +outcome.admin.financial.closingDayHistory=/app/admin/closingDay/history +outcome.admin.financial.closingDayHistory.detail=/app/admin/closingDay/detail +outcome.admin.financial.stableSmallBox=/app/admin/stableSmallBox/index +outcome.admin.financial.stableSmallBoxHistory=/app/admin/stableSmallBox/history +outcome.admin.financial.otherExpense=/app/admin/otherExpense/index +outcome.admin.payroll.goal=/app/payroll/goal/index +outcome.admin.payroll.bonus=/app/payroll/bonus/index +outcome.admin.payroll.advance=/app/payroll/advance/index +outcome.admin.payroll.create=/app/payroll/createPayroll/index +outcome.admin.payroll.history=/app/payroll/history +outcome.admin.vehicles.addvehicle=/app/admin/vehicles/main +outcome.admin.fees.fees=/app/stats/feesByRoute/index +outcome.admin.stats.fees=/app/stats/fees/index +outcome.admin.stats.closingday=/app/stats/closingDay/index +outcome.admin.stats.openingfee=/app/stats/openingFee/index +outcome.admin.stats.payment=/app/stats/payment/index +outcome.admin.stats.paymentroute=/app/stats/paymentRoute/index +outcome.admin.stats.payroll=/app/stats/payroll/index +outcome.admin.stats.deposits=/app/stats/deposits/index +outcome.admin.stats.zeropayments=/app/stats/zeroPayments/index +outcome.admin.stats.employeesaving=/app/stats/employeeSaving/index +outcome.admin.stats.advances=/app/stats/advances/index +outcome.admin.stats.paymentrenovation=/app/stats/paymentRenovation/index +outcome.admin.stats.gasoline=/app/stats/gasoline/index +outcome.admin.stats.vehicle=/app/stats/vehicles/index +outcome.admin.stats.summary=/app/stats/summary/index +outcome.payroll.loanemployee=/app/payroll/loanEmployee/index +outcome.admin.general.box.expense.company.in=/app/generalBox/expenseCompanyIn/index +outcome.admin.general.box.expense.company.out=/app/generalBox/expenseCompanyOut/index +outcome.admin.general.box.stable=/app/generalBox/stableGeneralBox/index +outcome.admin.general.box.history=/app/generalBox/stableGeneralBox/history +outcome.privacy=/app/topbar/privacy +outcome.admin.customer.without.loan.detail=/customerWithoutLoanDetail +outcome.dashboard.loan.detail=/loanDetail +outcome.dashboard.loan.detailEndorsement=/loanDetailEndorsement +outcome.system.bitacora=/app/system/bitacora/index +########### +# General # +########### +profile=Perfil +privacy=Privacidad +setting=Configuraci\u00f3n +logout=Salir +choose.office=Seleccione la sucursal +office=Sucursal +office.selected=Sucursal {0} +photo.add=Agregar imagen +select=Seleccionar +upload=Cargar +cancel=Cancelar +add=Agregar +add.all=Agregar todos +remove=Quitar +remove.all=Quitar todos +arrebol.reserved=Todos los Derechos Reservados. +validator.select.office=Oficina no v\u00e1lida. +office.confirm.header=Cambiar de sucursal +office.confirm.question=\u00bfEstas seguro que deseas cambiar de sucursal? +pwd.promptLabel=Introduce tu contrase\u00f1a +pwd.weakLabel=Contrase\u00f1a d\u00e9bil +pwd.goodLabel=Contrase segura +pwd.strongLabel=Contrase\u00f1a s\u00faper segura +pwd.promptLabel.confirm=Confirma tu contrase\u00f1a +pwd.match.passwords=Las contrase\u00f1as son diferentes. +pattern.date=dd - MMMM - yyyy +pick.down=Bajar +pick.up=Subir +pick.bottom=Mover al fondo +pick.top=Mover al inicio +pick.add=Agregar +pick.add.all=Agregar todos +pick.remove=Remover +pick.remove.all=Remover todos +dual.list.permissions.required=Seleccione al menos un permiso +dual.list.permissions.available=Permisos disponibles +dual.list.permissions.taken=Permisos asignados +dual.list.routes.required=Seleccione al menos una ruta +dual.list.routes.available=Rutas disponibles +dual.list.routes.taken=Rutas asignadas +permission.add.btn=Asisgar permisos +permission.update.btn=Actualizar permisos +permission.confirm.header=Datos del trabajador +permission.confirm.question=\u00bfLos datos del trabajador son correctos? +permission=Permiso +screen=Pantalla +confirm.yes=Aceptar +confirm.no=Rechazar +invalid.file=Imagen no v\u00e1lida. +invalid.size=Imagen muy grande. +user.required=Usuario requerido. +user.load.permission=\u00bfQuiere buscar los permisos del usuario? +button.add=Agregar +general.search=Buscar +button.edit=Editar +button.save=Guardar +button.authorize=Autorizar +general.confirm.header=Validaci\u00f3n de informaci\u00f3n +general.confirm.confirm=\u00bfEst\u00e1s seguro de continuar con la acci\u00f3n? +salario=Salario +imss=IMSS +payment.required=Salario obligatorio +imss.required=IMSS obligatorio +other.actions=Otras acciones +choose.action=Elegir acci\u00f3n +execute.action=Ejecutar acci\u00f3n +change.owner=Cambiar asesor +change.owner.of.loans=Cambiar los prestamos al asesor destino +current.owner.select=Elegir asesor origen +current.owner.select.name=Nombre del asesor origen +new.owner.select=Elegir asesor destino +new.owner.select.name=Nombre del asesor destino +current.owner.from=Prestamos asesor origen +current.owner.to=Prestamos asesor destino +dual.list.current.owner.required=Seleccione al menos un presamo a cambiar de asesor +change.owner.confirm.question=\u00bfDesea cambiar los prestamos al asesor destino? +stats.closingday=Corte +stats.openingFees=Comisi\u00f3n por apertura +stats.openingFees.comisiones=Comisiones +stats.payment=Cobro de cartera +stats.paymentrenovation=Pagos renovados +stats.paymentroute=Cobro de cartera por ruta +stats.payment.cobros=Cobros +stats.payroll=N\u00f3mina +stats.deposits=Dep\u00f3sitos +stats.zeropayments=Abonos en cero +stats.employeesaving=Ahorro empleados +stats.advances=Adelantos +stats.gasoline=Gasolinas \ No newline at end of file diff --git a/ace-web/src/main/resources/com/arrebol/apc/i18n/app_background.properties b/ace-web/src/main/resources/com/arrebol/apc/i18n/app_background.properties new file mode 100644 index 0000000..61c7edb --- /dev/null +++ b/ace-web/src/main/resources/com/arrebol/apc/i18n/app_background.properties @@ -0,0 +1,50 @@ +############################ +# Login and Recovery forms # +############################ +error.access.title=\u00a1Acceso denegado! +error.access.details=Verifica tus datos de ingreso. +fatal.access.title=\u00a1APC fuera de l\u00ednea! +fatal.access.details=Por favor contacta a tu administrador. +############## +# Validators # +############## +validators.email=Correo no v\u00e1lido. +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 +people=Persona +prmssn.update.title=Actualizaci\u00f3n de Permisos +prmssn.add.true=Se asignaron los permisos al usuario. +prmssn.add.false=No asignaron los permisos al usuario. +prmssn.add.exception=Grave error al asignar los permisos al usuario. +############## +# generic # +############## +updated=actualizado +deleted=borrado +created=creado +enebled=habilitado +disabled=deshabilitado +searching=cargado de datos +available=disponible +process=procesamiento +password=contrase\u00f1a +modified=modificada +change.owner.upper=Cambio de Asesor +change.owner=Cambio de asesor +message.format.sucess=\u00a1{0} {1}! +message.format.failure=\u00a1{0} no {1}! +message.format.fatal=Grave error en el {0} +generic.title=APC +generic.true=\u00a1Operaci\u00f3n exitosa! +generic.false=\u00a1No se pudo realizar la operac\u00f3n! +generic.exception=\u00a1Error! Contacte al administrado. +generic.start.date=Fecha inicio +generic.end.date.error=La fecha de inicio no puede ser mayor a la fecha final + + +aws.access.key=AKIA2VMOWRI77XODNEUN +aws.secret.access.key=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 +aws.region=us-east-2 \ No newline at end of file diff --git a/ace-web/src/main/resources/com/arrebol/apc/i18n/app_permission.properties b/ace-web/src/main/resources/com/arrebol/apc/i18n/app_permission.properties new file mode 100644 index 0000000..e2274da --- /dev/null +++ b/ace-web/src/main/resources/com/arrebol/apc/i18n/app_permission.properties @@ -0,0 +1,357 @@ +################## +# DASHBOARD Menu # +################## +public.access=Acceso Publico +############### +# SYSTEM Menu # +############### +#Add users +system.employee=Empleado +system.employee.description=Men\u00fa empleado. +system.employee.path=Sistema / Empleado + +system.employee.add=Crear empleado +system.employee.add.description=Permite crear empleados. +system.employee.add.path=Sistema / Empleado (crear) + +system.employee.enebled=Habilitar empleado +system.employee.enebled.description=Permite habilitar empleados. +system.employee.enebled.path=Sistema / Empleado (Habilitar) + +system.employee.disabled=Deshabilitar empleado +system.employee.disabled.description=Permite deshabilitar empleados. +system.employee.disabled.path=Sistema / Empleado (Deshabilitar) + +system.employee.deleted=Borrar empleado +system.employee.deleted.description=Permite borrar empleados. +system.employee.deleted.path=Sistema / Empleado (Borrar) + +system.employee.updated=Actualizar empleado +system.employee.updated.description=Permite actualizar empleados. +system.employee.updated.path=Sistema / Empleado (Actualizar) +#Add users +system.user.create=Crear usuarios +system.user.create.description=Permite agregar Usuarios. +system.user.create.path=Sistema / Usuarios / Alta + +system.user.create.permission=Asignar permisos +system.user.create.permission.description=Permite asignar permisos a usuarios nuevos. +system.user.create.permission.path=Sistema / Usuarios / Alta (Asignar permisos) +#Settings users +system.user.admin=Actualizaci\u00f3n +system.user.admin.description=Permite la actualizaci\u00f3n de los usuarios del sistema. +system.user.admin.path=Sistema / Usuarios / Actualizaci\u00f3n + +system.user.admin.enebled=Habilitar usuarios +system.user.admin.enebled.description=Permite habilitar usuarios. +system.user.admin.enebled.path=Sistema / Usuarios / Actualizaci\u00f3n (Habilitar) + +system.user.admin.disabled=Deshabilitar usuarios +system.user.admin.disabled.description=Permite deshabilitar usuarios. +system.user.admin.disabled.path=Sistema / Usuarios / Actualizaci\u00f3n (Deshabilitar) + +system.user.admin.deleted=Borrar usuarios +system.user.admin.deleted.description=Permite borrar usuarios. +system.user.admin.deleted.path=Sistema / Usuarios / Actualizaci\u00f3n (Borrar) + +system.user.admin.updated=Cambiar nombre de usuarios +system.user.admin.updated.description=Permite cambiar nombre de usuarios. +system.user.admin.updated.path=Sistema / Usuarios / Actualizaci\u00f3n (Nombre de usuario) + +system.user.admin.pwd=Modificar contrase\u00f1a de usuarios +system.user.admin.pwd.description=Permite modificar contrase\u00f1a de usuarios. +system.user.admin.pwd.path=Sistema / Usuarios / Actualizaci\u00f3n (Modificar Contrase\u00f1a) + +system.user.admin.avatar=Cargar imagen de usuarios +system.user.admin.avatar.description=Permite cargar imagen de usuarios. +system.user.admin.avatar.path=Sistema / Usuarios / Actualizaci\u00f3n (Cargar imagen) +#Access users +system.user.access=Acceso +system.user.access.description=Permite agregar/eliminar accesos a los usuairos del sistema. +system.user.access.path=Sistema / Usuarios / Acceso +#Office +system.office=Oficina +system.office.description=Men\u00fa oficina. +system.office.path=Sistema / Oficina + +system.office.add=Crear oficina +system.office.add.description=Permite crear una oficina. +system.office.add.path=Sistema / Oficina / Alta + +system.office.updated=Editar oficina +system.office.updated.description=Permite editar una oficina. +system.office.updated.path=Sistema / Oficina / Editar + +system.office.deleted=Eliminar oficina +system.office.deleted.description=Permite eliminar una oficina. +system.office.deleted.path=Sistema / Oficina / Eliminar + +############### +# CATALOG Menu # +############### +#Puestos +catalog.role=Puesto +catalog.role.description=Men\u00fa puesto. +catalog.role.path=Cat\u00e1logo / Puesto + +catalog.role.add=Crear puesto +catalog.role.add.description=Men\u00fa puesto. +catalog.role.add.path=Cat\u00e1logo / Puesto (crear) + +catalog.role.updated=Editar puesto +catalog.role.updated.description=Permite editar puesto. +catalog.role.updated.path=Cat\u00e1logo / Puesto (editar) + +catalog.role.deleted=Eliminar puesto +catalog.role.deleted.description=Permite eliminar puesto. +catalog.role.deleted.path=Cat\u00e1logo / Puesto (eliminar) +#Tipo prestamo +catalog.typeLoan=Tipo de pr\u00e9stamos +catalog.typeLoan.description=Men\u00fa tipo de pr\u00e9stamos. +catalog.typeLoan.path=Cat\u00e1logo / Tipo de pr\u00e9stamos + +catalog.typeLoan.add=Crear tipo de pr\u00e9stamos +catalog.typeLoan.add.description=Men\u00fa tipo de pr\u00e9stamos. +catalog.typeLoan.add.path=Cat\u00e1logo / Tipo de pr\u00e9stamos (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.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) +#Rutas +catalog.route=Rutas +catalog.route.description=Men\u00fa de rutas. +catalog.route.path=Cat\u00e1logo / Rutas + +catalog.route.add=Crear rutas +catalog.route.add.description=Men\u00fa rutas. +catalog.route.add.path=Cat\u00e1logo / Rutas (crear) + +catalog.route.updated=Editar rutas +catalog.route.updated.description=Permite editar rutas. +catalog.route.updated.path=Cat\u00e1logo / Rutas (editar) + +catalog.route.deleted=Eliminar rutas +catalog.route.deleted.description=Permite eliminar rutas. +catalog.route.deleted.path=Cat\u00e1logo / Rutas (eliminar) +#Clientes +admin.customer=Clientes +admin.customer.description=Men\u00fa de clientes. +admin.customer.path=Administraci\u00f3n / Clientes + +admin.customer.add=Crear clientes +admin.customer.add.description=Men\u00fa de clientes. +admin.customer.add.path=Administraci\u00f3n / Clientes (crear) + +admin.customer.updated=Editar clientes +admin.customer.updated.description=Permite editar clientes. +admin.customer.updated.path=Administraci\u00f3n / Clientes (editar) + +admin.customer.deleted=Eliminar clientes +admin.customer.deleted.description=Permite eliminar clientes. +admin.customer.deleted.path=Administraci\u00f3n / Clientes (eliminar) +#Avales +admin.endorsement=Avales +admin.endorsement.description=Men\u00fa de avales. +admin.endorsement.path=Administraci\u00f3n / Avales + +admin.endorsement.add=Crear avales +admin.endorsement.add.description=Men\u00fa de avales. +admin.endorsement.add.path=Administraci\u00f3n / Avales (crear) + +admin.endorsement.updated=Editar avales +admin.endorsement.updated.description=Permite editar avales. +admin.endorsement.updated.path=Administraci\u00f3n / Avales (editar) + +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.add=Crear pr\u00e9stamos +admin.loan.add.description=Men\u00fa de pr\u00e9stamos. +admin.loan.add.path=Administraci\u00f3n / Pr\u00e9stamos (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.deleted=Eliminar pr\u00e9stamos +admin.loan.deleted.description=Permite eliminar pr\u00e9stamos. +admin.loan.deleted.path=Administraci\u00f3n / Pr\u00e9stamos (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.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) +#Transferencias +admin.transfer=Transferencias +admin.transfer.description=Men\u00fa de transferencias. +admin.transfer.path=Administraci\u00f3n / Transferencias + +admin.transfer.add=Crear transferencias +admin.transfer.add.description=Men\u00fa de transferencias. +admin.transfer.add.path=Administraci\u00f3n / Transferencias (crear) + +admin.transfer.updated=Editar transferencias +admin.transfer.updated.description=Permite editar transferencias. +admin.transfer.updated.path=Administraci\u00f3n / Transferencias (editar) + +admin.transfer.deleted=Eliminar transferencias +admin.transfer.deleted.description=Permite eliminar transferencias. +admin.transfer.deleted.path=Administraci\u00f3n / Transferencias (eliminar) +#Entregas diarias +admin.moneyDaily=Entregas diarias +admin.moneyDaily.description=Men\u00fa de entregas diarias. +admin.moneyDaily.path=Administraci\u00f3n / Entregas diarias + +admin.moneyDaily.add=Crear entregas diarias +admin.moneyDaily.add.description=Men\u00fa de entregas diarias. +admin.moneyDaily.add.path=Administraci\u00f3n / Entregas diarias (crear) + +admin.moneyDaily.updated=Editar entregas diarias +admin.moneyDaily.updated.description=Permite editar entregas diarias. +admin.moneyDaily.updated.path=Administraci\u00f3n / Entregas diarias (editar) + +admin.moneyDaily.deleted=Eliminar entregas diarias +admin.moneyDaily.deleted.description=Permite eliminar entregas diarias. +admin.moneyDaily.deleted.path=Administraci\u00f3n / Entregas diarias (eliminar) +#Cierre del dia +admin.closingDay=Corte del d\u00eda +admin.closingDay.description=Men\u00fa del corte del d\u00eda. +admin.closingDay.path=Administraci\u00f3n / Corte del d\u00eda + +admin.closingDay.add=Crear del corte del d\u00eda +admin.closingDay.add.description=Men\u00fa del corte del d\u00eda. +admin.closingDay.add.path=Administraci\u00f3n / Corte del d\u00eda (crear) + +admin.closingDay.updated=Editar el corte del d\u00eda +admin.closingDay.updated.description=Permite editar el corte del d\u00eda. +admin.closingDay.updated.path=Administraci\u00f3n / Corte del d\u00eda (editar) + +admin.closingDay.deleted=Eliminar el corte del d\u00eda +admin.closingDay.deleted.description=Permite eliminar el corte del d\u00eda. +admin.closingDay.deleted.path=Administraci\u00f3n / Corte del d\u00eda (eliminar) +#Otros gastos +admin.otherExpense=Gastos +admin.otherExpense.description=Men\u00fa de gastos. +admin.otherExpense.path=Administraci\u00f3n / Gastos + +admin.otherExpense.add=Crear gastos +admin.otherExpense.add.description=Men\u00fa de gastos. +admin.otherExpense.add.path=Administraci\u00f3n / Gastos (crear) + +admin.otherExpense.updated=Editar gastos +admin.otherExpense.updated.description=Permite editar gastos. +admin.otherExpense.updated.path=Administraci\u00f3n / Gastos (editar) + +admin.otherExpense.deleted=Eliminar gastos +admin.otherExpense.deleted.description=Permite eliminar gastos. +admin.otherExpense.deleted.path=Administraci\u00f3n / Gastos (eliminar) +#Metas +admin.goal=Metas +admin.goal.description=Men\u00fa de metas. +admin.goal.path=Administraci\u00f3n / Metas + +admin.goal.add=Crear metas +admin.goal.add.description=Men\u00fa de metas. +admin.goal.add.path=Administraci\u00f3n / Metas (crear) + +admin.goal.updated=Editar metas +admin.goal.updated.description=Permite editar metas. +admin.goal.updated.path=Administraci\u00f3n / Metas (editar) + +admin.goal.deleted=Eliminar metas +admin.goal.deleted.description=Permite eliminar metas. +admin.goal.deleted.path=Administraci\u00f3n / Metas (eliminar) +#Bonos +admin.bonus=Bonos +admin.bonus.description=Men\u00fa de bonos. +admin.bonus.path=Administraci\u00f3n / Bonos + +admin.bonus.add=Crear bonos +admin.bonus.add.description=Men\u00fa de bonos. +admin.bonus.add.path=Administraci\u00f3n / Bonos (crear) + +admin.bonus.updated=Editar bonos +admin.bonus.updated.description=Permite editar bonos. +admin.bonus.updated.path=Administraci\u00f3n / Bonos (editar) + +admin.bonus.deleted=Eliminar bonos +admin.bonus.deleted.description=Permite eliminar bonos. +admin.bonus.deleted.path=Administraci\u00f3n / Bonos (eliminar) +#Adelantos +admin.advance=Adelantos +admin.advance.description=Men\u00fa de adelantos. +admin.advance.path=Administraci\u00f3n / Adelantos + +admin.advance.add=Crear adelantos +admin.advance.add.description=Men\u00fa de adelantos. +admin.advance.add.path=Administraci\u00f3n / Adelantos (crear) + +admin.advance.updated=Editar adelantos +admin.advance.updated.description=Permite editar adelantos. +admin.advance.updated.path=Administraci\u00f3n / Adelantos (editar) + +admin.advance.deleted=Eliminar adelantos +admin.advance.deleted.description=Permite eliminar adelantos. +admin.advance.deleted.path=Administraci\u00f3n / Adelantos (eliminar) +#Entradas caja general +admin.expenseCompanyIn=Entradas +admin.expenseCompanyIn.description=Men\u00fa de entradas. +admin.expenseCompanyIn.path=Administraci\u00f3n / Entradas + +admin.expenseCompanyIn.add=Crear entradas +admin.expenseCompanyIn.add.description=Men\u00fa de entradas. +admin.expenseCompanyIn.add.path=Administraci\u00f3n / Entradas (crear) + +admin.expenseCompanyIn.updated=Editar entradas +admin.expenseCompanyIn.updated.description=Permite editar entradas. +admin.expenseCompanyIn.updated.path=Administraci\u00f3n / Entradas (editar) + +admin.expenseCompanyIn.deleted=Eliminar entradas +admin.expenseCompanyIn.deleted.description=Permite eliminar entradas. +admin.expenseCompanyIn.deleted.path=Administraci\u00f3n / Entradas (eliminar) +#Salidas caja general +admin.expenseCompanyOut=Salidas +admin.expenseCompanyOut.description=Men\u00fa de salidas. +admin.expenseCompanyOut.path=Administraci\u00f3n / Salidas + +admin.expenseCompanyOut.add=Crear salidas +admin.expenseCompanyOut.add.description=Men\u00fa de salidas. +admin.expenseCompanyOut.add.path=Administraci\u00f3n / Salidas (crear) + +admin.expenseCompanyOut.updated=Editar salidas +admin.expenseCompanyOut.updated.description=Permite editar salidas. +admin.expenseCompanyOut.updated.path=Administraci\u00f3n / Salidas (editar) + +admin.expenseCompanyOut.deleted=Eliminar salidas +admin.expenseCompanyOut.deleted.description=Permite eliminar salidas. +admin.expenseCompanyOut.deleted.path=Administraci\u00f3n / Salidas (eliminar) +#Cuadres caja general +admin.stableGeneralBox=Cuadre de caja +admin.stableGeneralBox.description=Men\u00fa de cuadre de caja. +admin.stableGeneralBox.path=Administraci\u00f3n / Cuadre de caja + +admin.stableGeneralBox.add=Crear cuadre de caja +admin.stableGeneralBox.add.description=Men\u00fa de cuadre de caja. +admin.stableGeneralBox.add.path=Administraci\u00f3n / Cuadre de caja (crear) + +admin.stableGeneralBox.updated=Editar cuadre de caja +admin.stableGeneralBox.updated.description=Permite editar cuadre de caja. +admin.stableGeneralBox.updated.path=Administraci\u00f3n / Cuadre de caja (editar) + +admin.stableGeneralBox.deleted=Eliminar cuadre de caja +admin.stableGeneralBox.deleted.description=Permite eliminar cuadre de caja. +admin.stableGeneralBox.deleted.path=Administraci\u00f3n / Cuadre de caja (eliminar) +#Estad\u00edsticas/Multas +admin.fees=Multas \ No newline at end of file diff --git a/ace-web/src/main/resources/log4j2.xml b/ace-web/src/main/resources/log4j2.xml new file mode 100644 index 0000000..fc24817 --- /dev/null +++ b/ace-web/src/main/resources/log4j2.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + %d{dd-MM-yyyy HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ace-web/src/main/webapp/META-INF/context.xml b/ace-web/src/main/webapp/META-INF/context.xml new file mode 100644 index 0000000..4e79863 --- /dev/null +++ b/ace-web/src/main/webapp/META-INF/context.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + diff --git a/ace-web/src/main/webapp/WEB-INF/error-pages/access.xhtml b/ace-web/src/main/webapp/WEB-INF/error-pages/access.xhtml new file mode 100644 index 0000000..0d4e1e2 --- /dev/null +++ b/ace-web/src/main/webapp/WEB-INF/error-pages/access.xhtml @@ -0,0 +1,37 @@ + + + + + + + + + + + + #{i18n['project.short.name']} + + + +
+
+ +
+ +
+
+ +
+

#{i18n['error.forbidden']}

+

#{i18n['error.contact.admin']}

+ +
+
+ + +
+ + \ No newline at end of file diff --git a/ace-web/src/main/webapp/WEB-INF/error-pages/error.xhtml b/ace-web/src/main/webapp/WEB-INF/error-pages/error.xhtml new file mode 100644 index 0000000..31fbba2 --- /dev/null +++ b/ace-web/src/main/webapp/WEB-INF/error-pages/error.xhtml @@ -0,0 +1,38 @@ + + + + + + + + + + + + #{i18n['project.short.name']} + + + +
+
+ +
+ +
+ +
+ +
+

#{i18n['error.title']}

+

#{i18n['error.contact.admin']}

+ +
+
+ + +
+ + diff --git a/ace-web/src/main/webapp/WEB-INF/error-pages/notfound.xhtml b/ace-web/src/main/webapp/WEB-INF/error-pages/notfound.xhtml new file mode 100644 index 0000000..72b9bb4 --- /dev/null +++ b/ace-web/src/main/webapp/WEB-INF/error-pages/notfound.xhtml @@ -0,0 +1,37 @@ + + + + + + + + + + + #{i18n['project.short.name']} + + + +
+
+ +
+ +
+ +
+ +
+

#{i18n['error.not.found']}

+

#{i18n['error.contact.admin']}

+ +
+
+ + +
+ + \ No newline at end of file diff --git a/ace-web/src/main/webapp/WEB-INF/faces-config.xml b/ace-web/src/main/webapp/WEB-INF/faces-config.xml new file mode 100644 index 0000000..ca7d5d9 --- /dev/null +++ b/ace-web/src/main/webapp/WEB-INF/faces-config.xml @@ -0,0 +1,46 @@ + + + + + + + + com.arrebol.apc.i18n.app + i18n + + + com.arrebol.apc.i18n.app_permission + permission + + + + com.arrebol.apc.i18n.app_background + + + + taxiservicios + + + org.primefaces.component.SerenityMenu + org.primefaces.serenity.component.SerenityMenu + + + + + org.primefaces.component + org.primefaces.component.SerenityMenuRenderer + org.primefaces.serenity.component.SerenityMenuRenderer + + + \ No newline at end of file diff --git a/ace-web/src/main/webapp/WEB-INF/footer.xhtml b/ace-web/src/main/webapp/WEB-INF/footer.xhtml new file mode 100644 index 0000000..aff3f44 --- /dev/null +++ b/ace-web/src/main/webapp/WEB-INF/footer.xhtml @@ -0,0 +1,15 @@ + + + + \ No newline at end of file diff --git a/ace-web/src/main/webapp/WEB-INF/primefaces-serenity.taglib.xml b/ace-web/src/main/webapp/WEB-INF/primefaces-serenity.taglib.xml new file mode 100644 index 0000000..6fa2673 --- /dev/null +++ b/ace-web/src/main/webapp/WEB-INF/primefaces-serenity.taglib.xml @@ -0,0 +1,66 @@ + + + + http://primefaces.org/serenity + + + + menu + + org.primefaces.component.SerenityMenu + org.primefaces.component.SerenityMenuRenderer + + + + id + false + java.lang.String + + + + rendered + false + java.lang.Boolean + + + + binding + false + javax.faces.component.UIComponent + + + + widgetVar + false + java.lang.String + + + + model + false + org.primefaces.model.menu.MenuModel + + + + style + false + java.lang.String + + + + styleClass + false + java.lang.String + + + + closeDelay + false + java.lang.Integer + 250 + + + \ No newline at end of file diff --git a/ace-web/src/main/webapp/WEB-INF/sidebar.xhtml b/ace-web/src/main/webapp/WEB-INF/sidebar.xhtml new file mode 100644 index 0000000..bc80050 --- /dev/null +++ b/ace-web/src/main/webapp/WEB-INF/sidebar.xhtml @@ -0,0 +1,417 @@ + + +
+ + +
+ +
+
+ +
diff --git a/ace-web/src/main/webapp/WEB-INF/template.xhtml b/ace-web/src/main/webapp/WEB-INF/template.xhtml new file mode 100644 index 0000000..e9782a0 --- /dev/null +++ b/ace-web/src/main/webapp/WEB-INF/template.xhtml @@ -0,0 +1,71 @@ + + + + + + + + + + + <ui:insert name="title">#{i18n['project.short.name']}</ui:insert> + + + + + + + +
+ + +
+ + +
+
    +
  • +
  • /
  • + +
+ +
+ + + + + +
+
+ +
+ +
+ + + +
+
+
+ + + + + + + + + + + + + + +
+ + \ No newline at end of file diff --git a/ace-web/src/main/webapp/WEB-INF/topbar.xhtml b/ace-web/src/main/webapp/WEB-INF/topbar.xhtml new file mode 100644 index 0000000..eb2432b --- /dev/null +++ b/ace-web/src/main/webapp/WEB-INF/topbar.xhtml @@ -0,0 +1,109 @@ + + +
+ + + + + + + + + + + + +
+ + + + +
+
+ +
\ No newline at end of file diff --git a/ace-web/src/main/webapp/WEB-INF/web.xml b/ace-web/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..199d61a --- /dev/null +++ b/ace-web/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,241 @@ + + + + + + 120 + + + dashboard.jsf + + + javax.faces.STATE_SAVING_METHOD + server + + + javax.faces.PROJECT_STAGE + Development + + + primefaces.THEME + serenity-green + + + primefaces.FONT_AWESOME + true + + + javax.faces.FACELETS_LIBRARIES + /WEB-INF/primefaces-serenity.taglib.xml + + + + org.apache.webbeans.servlet.WebBeansConfigurationListener + + + com.sun.faces.config.ConfigureListener + + + Character Encoding Filter + org.primefaces.serenity.filter.CharacterEncodingFilter + + + Character Encoding Filter + Faces Servlet + + + Faces Servlet + javax.faces.webapp.FacesServlet + + + Faces Servlet + *.jsf + + + ttf + application/font-sfnt + + + woff + application/font-woff + + + png + image/png + + + woff2 + application/font-woff2 + + + eot + application/vnd.ms-fontobject + + + eot?#iefix + application/vnd.ms-fontobject + + + svg + image/svg+xml + + + svg#exosemibold + image/svg+xml + + + svg#exobolditalic + image/svg+xml + + + svg#exomedium + image/svg+xml + + + svg#exoregular + image/svg+xml + + + svg#fontawesomeregular + image/svg+xml + + + + FORM + + /login.jsf + /WEB-INF/error-pages/access.jsf + + + + + + + Views only available when logged has a DASHBOARD grant + /dashboard.jsf + + + Views only available when user has a PROFILE/PRIVACY/SETTINGS grant + /app/topbar/* + + + public.access + + + + + + Views only available when logged has a EMPLOYEE grant + /app/system/employee/main.jsf + + + system.employee + + + + + Views only available when logged has a USER CREATE grant + /app/system/user/add/main.jsf + + + system.user.create + + + + + Views only available when logged has a USER SETTINGS grant + /app/system/user/setting/main.jsf + + + system.user.admin + + + + + Views only available when logged has a USER ACCESS grant + /app/system/user/access/main.jsf + + + system.user.access + + + + + Views only available when logged has a CHANGE LOANS BETWEEN USER grant + /app/admin/loan/changeOwner.jsf + + + admin.loan.change.owner + + + + + + + + public.access + + + + system.employee + + + system.user.create + + + system.user.admin + + + system.user.access + + + admin.loan.change.owner + + + + 403 + /WEB-INF/error-pages/access.jsf + + + 404 + /WEB-INF/error-pages/notfound.jsf + + + 500 + /WEB-INF/error-pages/error.jsf + + + + DB Connection + jdbc/apcAuth + javax.sql.DataSource + Container + + \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/admin/closingDay/detail.xhtml b/ace-web/src/main/webapp/app/admin/closingDay/detail.xhtml new file mode 100644 index 0000000..2dbd2c7 --- /dev/null +++ b/ace-web/src/main/webapp/app/admin/closingDay/detail.xhtml @@ -0,0 +1,145 @@ + + + + + + #{i18n['project.short.name']} - #{permission['admin.closingDay']} + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{i18n['admin.financial.closingDayHistory']}
  • +
  • /
  • +
  • Detalle del corte
  • +
    + + +
    +
    + + +
    +
    + + + +

    InformaciĆ³n del corte

    +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +

    Detalle del corte

    +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/admin/closingDay/history.xhtml b/ace-web/src/main/webapp/app/admin/closingDay/history.xhtml new file mode 100644 index 0000000..faf8a3c --- /dev/null +++ b/ace-web/src/main/webapp/app/admin/closingDay/history.xhtml @@ -0,0 +1,170 @@ + + #{i18n['project.short.name']} - #{permission['admin.closingDay']} + + + + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{i18n['admin.financial.closingDayHistory']}
  • +
    + + +
    +
    +
    +

    #{i18n['admin.financial.closingDayHistory']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + +

    + + + + + + +

    +
    + +
    +
    +
    +
    +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/admin/closingDay/index.xhtml b/ace-web/src/main/webapp/app/admin/closingDay/index.xhtml new file mode 100644 index 0000000..3a4266e --- /dev/null +++ b/ace-web/src/main/webapp/app/admin/closingDay/index.xhtml @@ -0,0 +1,372 @@ + + + + + + #{i18n['project.short.name']} - #{permission['admin.closingDay.add']} + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{permission['admin.closingDay.add']}
  • +
    + + +
    +
    + +
    +
    + + +

    #{permission['admin.closingDay.add']}

    + + + + + + + + + + + + + + +
    + + +
    +
    +
    + + + + + +

    Totales

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +



    + +

    Detalle del corte

    + + + +
    + + + + +
    + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    +
    + +
    +
    +

    Abonos en ceros

    + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +

    Resumen del dĆ­a

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +

    Caja chica

    + + + + + + + +
    +
    + +
    +
    +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/admin/customer/add.xhtml b/ace-web/src/main/webapp/app/admin/customer/add.xhtml new file mode 100644 index 0000000..56f0f04 --- /dev/null +++ b/ace-web/src/main/webapp/app/admin/customer/add.xhtml @@ -0,0 +1,225 @@ + + + + + + #{i18n['project.short.name']} - #{i18n['admin.people.add']} + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{i18n['admin.people.add']}
  • +
    + + +
    +
    +
    + +
    +
    + + + + +

    #{i18n['admin.people.add']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #{i18n['admin.people.dialog.isCustomer.title']} + + + + + #{i18n['admin.people.dialog.isEndorsement.title']} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + + + + + + +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/admin/customer/detail.xhtml b/ace-web/src/main/webapp/app/admin/customer/detail.xhtml new file mode 100644 index 0000000..c211331 --- /dev/null +++ b/ace-web/src/main/webapp/app/admin/customer/detail.xhtml @@ -0,0 +1,315 @@ + + + + + + #{i18n['project.short.name']} - #{permission['admin.customer']} + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{permission['admin.customer']}
  • +
  • /
  • +
  • #{i18n['admin.customers.detail.title']}
  • +
    + + +
    +
    + +
    +
    + + + + +

    #{i18n['admin.customers.detail.title']}

    +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + + +

    #{i18n['admin.customers.company.title']}

    +

    + + + + + + +



    + + + + +



    + + + + + + + + + + + +
    +
    +
    +
    +
    + + + +

    InformaciĆ³n adicional

    +

    + + + + + +



    + + + + + +
    +
    +
    +
    + +
    + +
    +
    + +

    #{i18n['admin.customers.loan.title']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    +
    + + + + Detalle de pagos + + + + Fecha + Pago + Tipo + No. Referencia + Comentarios + + + + + + + + + + + + + + + + + + #{detail.loanDetailsType.value} + #{detail.referenceNumber} + #{detail.comments} + + + + + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/admin/customer/index.xhtml b/ace-web/src/main/webapp/app/admin/customer/index.xhtml new file mode 100644 index 0000000..4d306fb --- /dev/null +++ b/ace-web/src/main/webapp/app/admin/customer/index.xhtml @@ -0,0 +1,494 @@ + + #{i18n['project.short.name']} - #{permission['admin.customer']} + + + + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{permission['admin.customer']}
  • +
    + + +
    +
    +
    +

    #{i18n['admin.customer']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +

    + + + + + + + +

    +
    + +
    +
    +
    + + + + +

    + + + + + + +

    + + + + + + + + + +

    + + + + + + +

    + + + + + + +

    + + + + + + + +

    +

    + + + + + + + + +

    + + + + + + + + +

    + + + + + + +

    + + + + + + +

    + + Cambiar a estatus Aprobado + + + +

    + + Cambiar a estatus Terminado + + + + + + + + + + + + + +
    +
    + + + + +

    + +

    #{i18n['admin.people.add']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #{i18n['admin.people.dialog.isCustomer.title']} + + + + + #{i18n['admin.people.dialog.isEndorsement.title']} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/admin/customer/index_old.xhtml b/ace-web/src/main/webapp/app/admin/customer/index_old.xhtml new file mode 100644 index 0000000..a2b1604 --- /dev/null +++ b/ace-web/src/main/webapp/app/admin/customer/index_old.xhtml @@ -0,0 +1,431 @@ + + #{i18n['project.short.name']} - #{permission['admin.customer']} + + + + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{permission['admin.customer']}
  • +
    + + +
    +
    +
    +

    #{i18n['admin.customer']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +- + + + + + + + + + + + + + + + + + + +
    +
    + + + + +

    + + + + + + + +

    +
    + +
    +
    +
    + + + + +

    + + + + + + +

    + + + + + + + + + +

    + + + + + + + +

    + + + + + + + +

    + + + + + + + +

    +

    + + + + + + + + +

    + + + + + + + + +

    + + + + + + +

    + + + + + + +

    + + Cambiar a estatus Aprobado + + + +

    + + Cambiar a estatus Terminado + + + +

    +
    + +
    +
    +
    + + + + +

    + +

    #{i18n['admin.people.add']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #{i18n['admin.people.dialog.isCustomer.title']} + + + + + #{i18n['admin.people.dialog.isEndorsement.title']} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/admin/endorsement/detail.xhtml b/ace-web/src/main/webapp/app/admin/endorsement/detail.xhtml new file mode 100644 index 0000000..5736a8a --- /dev/null +++ b/ace-web/src/main/webapp/app/admin/endorsement/detail.xhtml @@ -0,0 +1,258 @@ + + + + + + #{i18n['project.short.name']} - #{permission['admin.endorsement']} + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{permission['admin.endorsement']}
  • +
  • /
  • +
  • #{i18n['admin.endorsements.detail.title']}
  • +
    + + +
    +
    + +
    +
    + + + + +

    #{i18n['admin.endorsements.detail.title']}

    +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + + + +

    #{i18n['admin.endorsements.company.title']}

    +

    + + + + + + +



    + + + + +



    + + + + + + + + + + +
    +
    +
    +
    +
    + + + +

    InformaciĆ³n adicional

    +

    + + + + + +



    + + + + + +
    +
    +
    +
    + +
    + +
    +
    + +

    #{i18n['admin.endorsements.loan.title']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/admin/endorsement/index.xhtml b/ace-web/src/main/webapp/app/admin/endorsement/index.xhtml new file mode 100644 index 0000000..cf0caa1 --- /dev/null +++ b/ace-web/src/main/webapp/app/admin/endorsement/index.xhtml @@ -0,0 +1,162 @@ + + #{i18n['project.short.name']} - #{permission['admin.endorsement']} + + + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{permission['admin.endorsement']}
  • +
    + + +
    +
    +
    +

    #{i18n['admin.endorsement']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/admin/loan/changeOwner.xhtml b/ace-web/src/main/webapp/app/admin/loan/changeOwner.xhtml new file mode 100644 index 0000000..004b88d --- /dev/null +++ b/ace-web/src/main/webapp/app/admin/loan/changeOwner.xhtml @@ -0,0 +1,212 @@ + + + + + + #{i18n['project.short.name']} - #{permission['admin.loan.change.owner']} + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{permission['admin.loan']}
  • +
  • /
  • +
  • #{permission['admin.loan.change.owner']}
  • +
    + + +
    +
    +
    + + + + +

    + + + +

    +

    + #{permission['admin.loan.change.owner']} +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #{i18n['current.owner.from']} + + + + + #{i18n['current.owner.to']} + + + + + + + #{i18n['admin.endorsements.detail.datatable.column.customer']}: + + + + + + #{i18n['admin.loans.datatable.column.endorsement']}: + + + + + + #{i18n['admin.loans.datatable.column.amountPaid']}: + + + + + + + + #{i18n['admin.payrolls.datatable.column.createdOn']} (dd-mm-yyyy): + + + + + + + + #{i18n['admin.customers.datatable.column.routeCtlg']}: + + + + + + + + + + + + + + + + +
    +
    +
    + + + + + + + + +
    +
    +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/admin/loan/detail.xhtml b/ace-web/src/main/webapp/app/admin/loan/detail.xhtml new file mode 100644 index 0000000..6203ee8 --- /dev/null +++ b/ace-web/src/main/webapp/app/admin/loan/detail.xhtml @@ -0,0 +1,641 @@ + + + + + + #{i18n['project.short.name']} - #{permission['admin.loan']} + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{permission['admin.loan']}
  • +
  • /
  • +
  • #{i18n['admin.loan.detail.title']}
  • +
    + + + + +
    +
    + +
    +
    + + + +

    #{i18n['admin.customers.detail.title']}

    +

    + + + + + + +



    + + + + +



    + + + + +



    + + + + +



    + + + + +



    + + + + + +
    +
    +
    +
    +
    + + + +

    #{i18n['admin.customers.company.title']}

    +

    + + + + + + +



    + + + + +



    + + + + +



    +

    Buscador de clientes

    + + + + + + + + +
    +
    +
    +
    + +
    + +
    +
    + +

    #{i18n['admin.customers.loan.title']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    +
    + + + + Detalle de pagos + + + + Fecha + Pago + Tipo + No. Referencia + Comentarios + + + + + + + + + + + + + + + + + + #{detail.loanDetailsType.value} + #{detail.referenceNumber} + #{detail.comments} + + + + + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + + + +

    #{i18n['admin.endorsements.detail.title']}

    +

    + + + + + + +



    + + + + +



    + + + + +



    + + + + +



    + + + + +



    + + + + + +
    +
    +
    +
    +
    + + + +

    #{i18n['admin.endorsements.company.title']}

    +

    + + + + + + +



    + + + + +



    + + + + + +
    +
    +
    +
    + +
    + +
    +
    + +

    #{i18n['admin.endorsements.loan.title']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    + + + +

    PrƩstamo

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +

    +

    Modificar el tipo de prƩstamo

    + + + + + + + + + + + + + + + +

    +

    +

    Modificar fecha de entrega

    + + + + + + + + + + + + + +

    + + + + + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    + +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/admin/loan/drive.xhtml b/ace-web/src/main/webapp/app/admin/loan/drive.xhtml new file mode 100644 index 0000000..7864507 --- /dev/null +++ b/ace-web/src/main/webapp/app/admin/loan/drive.xhtml @@ -0,0 +1,902 @@ + + #{i18n['project.short.name']} - Google Drive semana actual + + + + +
  • #{i18n['admin.title']}
  • +
    + + + + +
    +
    +
    +

    Semana actual

    + + + + + + + +
    + + + + +
    + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +

    ColocaciĆ³n

    + + + + + +
    + + + + +
    + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +

    Subtotales de cobros y comisiĆ³n por apertura por cartera de asesor

    + + + + + +
    + + + + +
    + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + +

    PrƩstamos enviados a Cobranza

    + + + + + +
    + + + + +
    + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + +

    Resumen de cortes

    + + + + + +
    + + + + +
    + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + +

    Resumen de gastos

    + + + + + +
    + + + + +
    + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + +

    Resumen de inicios

    + + + + + +
    + + + + +
    + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + +

    Clientes nuevos

    + + + + + +
    + + + + +
    + + + + + + + + +
    + + + + + + + + + + + + + + + +
    +
    + +

    Resumen total de la semana

    + + + + + +
    + + + + +
    + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/admin/loan/driveDate.xhtml b/ace-web/src/main/webapp/app/admin/loan/driveDate.xhtml new file mode 100644 index 0000000..3a41278 --- /dev/null +++ b/ace-web/src/main/webapp/app/admin/loan/driveDate.xhtml @@ -0,0 +1,1035 @@ + + #{i18n['project.short.name']} - Google Drive + + + + + +
  • #{i18n['admin.title']}
  • +
    + + + + +
    +
    +
    +

    Google Drive

    + + + + + + + + + + + + + + + + + + + +
    + + + + +
    + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    +
    + + + + Detalles + + + + Cantidad Pagada Actual + Tipo de Prestamo + Abono Diario + ComisiĆ³n por Apertura + Cliente Nuevo + Numero de accion + Multas Acumuladas + Multas Semana + + + + + + + + + + + + + + #{driver.loanTypeName} + + + + + + + + + + + #{driver.newCustomer} + #{driver.numPagosAll} + + + + + + + + + + + + + + + + + + + + + Detalle de pagos + + + + Fecha + Pago + Saldo insoluto + Tipo + No. Referencia + Comentarios + + + + + + + + + + + + + + + + + + + + + + + #{detail.loanDetailsType.value} + #{detail.referenceNumber} + #{detail.comments} + + + + +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +

    ColocaciĆ³n

    + + + + + +
    + + + + +
    + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +

    Subtotales de cobros y comisiĆ³n por apertura por cartera de asesor

    + + + + + +
    + + + + +
    + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + +

    PrƩstamos enviados a Cobranza

    + + + + + +
    + + + + +
    + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + +

    Resumen de cortes

    + + + + + +
    + + + + +
    + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + +

    Resumen de gastos

    + + + + + +
    + + + + +
    + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + +

    Resumen de inicios

    + + + + + +
    + + + + +
    + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + +

    Resumen total de la semana

    + + + + + +
    + + + + +
    + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/admin/loan/driveLast.xhtml b/ace-web/src/main/webapp/app/admin/loan/driveLast.xhtml new file mode 100644 index 0000000..ed72318 --- /dev/null +++ b/ace-web/src/main/webapp/app/admin/loan/driveLast.xhtml @@ -0,0 +1,898 @@ + + #{i18n['project.short.name']} - Google Drive semana anterior + + + + +
  • #{i18n['admin.title']}
  • +
    + + + + +
    +
    +
    +

    Semana anterior

    + + + + + + + +
    + + + + +
    + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +

    ColocaciĆ³n

    + + + + + +
    + + + + +
    + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + +

    Subtotales de cobros y comisiĆ³n por apertura por cartera de asesor

    + + + + + +
    + + + + +
    + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + +

    PrƩstamos enviados a Cobranza

    + + + + + +
    + + + + +
    + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + +

    Resumen de cortes

    + + + + + +
    + + + + +
    + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + +

    Resumen de gastos

    + + + + + +
    + + + + +
    + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + +

    Resumen de inicios

    + + + + + +
    + + + + +
    + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + +

    Clientes nuevos

    + + + + + +
    + + + + +
    + + + + + + + + +
    + + + + + + + + + + + + + + + +
    +
    + +

    Resumen total de la semana

    + + + + + +
    + + + + +
    + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/admin/loan/history.xhtml b/ace-web/src/main/webapp/app/admin/loan/history.xhtml new file mode 100644 index 0000000..14e5f8e --- /dev/null +++ b/ace-web/src/main/webapp/app/admin/loan/history.xhtml @@ -0,0 +1,299 @@ + + #{i18n['project.short.name']} - #{permission['admin.loan']} + + + + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{permission['admin.loan']}
  • +
    + + +
    +
    +
    +

    #{i18n['admin.loan.history']}

    + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + +
    + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + +
    +
    +
    + + + + +

    + + + + + + + +

    +
    + +
    +
    +
    + + + + +

    + + + + + + +

    + + + + + + + +

    + + + + + + +

    +
    + +
    +
    +
    + + + + +

    + + + + + + +

    + + + + + + + +

    + + + + + + +

    +
    + +
    +
    +
    + + + + +

    + + + + + + + +

    +
    + +
    +
    +
    + + + + +

    + + + + + + + +

    +
    + +
    +
    +
    +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/admin/loan/historyDetail.xhtml b/ace-web/src/main/webapp/app/admin/loan/historyDetail.xhtml new file mode 100644 index 0000000..536ecfe --- /dev/null +++ b/ace-web/src/main/webapp/app/admin/loan/historyDetail.xhtml @@ -0,0 +1,523 @@ + + + + + + #{i18n['project.short.name']} - #{permission['admin.loan']} + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{permission['admin.loan']}
  • +
  • /
  • +
  • #{i18n['admin.loan.detail.title']}
  • +
    + + + + +
    +
    + +
    +
    + + + +

    #{i18n['admin.customers.detail.title']}

    +

    + + + + + + +



    + + + + +



    + + + + +



    + + + + +



    + + + + +



    + + + + + +
    +
    +
    +
    +
    + + + +

    #{i18n['admin.customers.company.title']}

    +

    + + + + + + +



    + + + + +



    + + + + + +
    +
    +
    +
    + +
    + +
    +
    + +

    #{i18n['admin.customers.loan.title']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    +
    + + + + Detalle de pagos + + + + Fecha + Pago + Tipo + No. Referencia + Comentarios + + + + + + + + + + + + + + + + + + #{detail.loanDetailsType.value} + #{detail.referenceNumber} + #{detail.comments} + + + + + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + + + +

    #{i18n['admin.endorsements.detail.title']}

    +

    + + + + + + +



    + + + + +



    + + + + +



    + + + + +



    + + + + +



    + + + + + +
    +
    +
    +
    +
    + + + +

    #{i18n['admin.endorsements.company.title']}

    +

    + + + + + + +



    + + + + +



    + + + + + +
    +
    +
    +
    + +
    + +
    +
    + +

    #{i18n['admin.endorsements.loan.title']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    + + + +

    PrƩstamo

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + +
    +
    +
    + +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/admin/loan/historyJuridical.xhtml b/ace-web/src/main/webapp/app/admin/loan/historyJuridical.xhtml new file mode 100644 index 0000000..fd737c3 --- /dev/null +++ b/ace-web/src/main/webapp/app/admin/loan/historyJuridical.xhtml @@ -0,0 +1,144 @@ + + #{i18n['project.short.name']} - #{permission['admin.loan']} + + + + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{permission['admin.loan']}
  • +
    + + +
    +
    +
    +

    #{i18n['admin.loan.history']}

    + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + +
    + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +
    +
    +
    +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/admin/loan/index.xhtml b/ace-web/src/main/webapp/app/admin/loan/index.xhtml new file mode 100644 index 0000000..b55fb71 --- /dev/null +++ b/ace-web/src/main/webapp/app/admin/loan/index.xhtml @@ -0,0 +1,220 @@ + + #{i18n['project.short.name']} - #{permission['admin.loan']} + + + + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{permission['admin.loan']}
  • +
    + + +
    +
    +
    +

    #{i18n['admin.loan.to.approve']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + +
    +
    + + + +

    + + + + + + +

    + + + + + + + + + +

    + + + + + + + +

    + + + + + + + +

    + + + + + + + +

    +

    + + + + + + + + +

    + + + + + + + + +

    + + + + + + +

    + + + + + + +

    + + Cambiar a estatus Aprobado + + + +

    + + Cambiar a estatus Terminado + + + +

    +
    + +
    +
    +
    +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/admin/loan/loanDetailTransfer.xhtml b/ace-web/src/main/webapp/app/admin/loan/loanDetailTransfer.xhtml new file mode 100644 index 0000000..a1fa280 --- /dev/null +++ b/ace-web/src/main/webapp/app/admin/loan/loanDetailTransfer.xhtml @@ -0,0 +1,112 @@ + + #{i18n['project.short.name']} - #{permission['admin.loan']} + + + + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{permission['admin.loan']}
  • +
    + + +
    +
    +
    +

    Confirmacion de Trasnferencias

    + + + + + + + + + + + + +
    + + + + +
    + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    +
    +
    + + + +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/admin/loan/loanRenovationWeekly.xhtml b/ace-web/src/main/webapp/app/admin/loan/loanRenovationWeekly.xhtml new file mode 100644 index 0000000..d2ac398 --- /dev/null +++ b/ace-web/src/main/webapp/app/admin/loan/loanRenovationWeekly.xhtml @@ -0,0 +1,118 @@ + + #{i18n['project.short.name']} - #{permission['admin.loan']} + + + + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • ColocaciĆ³n de RenovaciĆ³n
  • +
    + + +
    +
    +
    +

    ColocaciĆ³n de RenovaciĆ³n

    + + + + + + + + + + +
    + + + + +
    + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    +
    +
    + + +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/admin/moneyDaily/index.xhtml b/ace-web/src/main/webapp/app/admin/moneyDaily/index.xhtml new file mode 100644 index 0000000..3aa2e2a --- /dev/null +++ b/ace-web/src/main/webapp/app/admin/moneyDaily/index.xhtml @@ -0,0 +1,245 @@ + + #{i18n['project.short.name']} - #{permission['admin.moneyDaily']} + + + + + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{permission['admin.moneyDaily']}
  • +
    + + +
    +
    +
    +
    +

    #{i18n['admin.financial.moneyDaily']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    + + + + + + +

    +
    + +
    +
    +
    + +
    + +
    +
    +
    +

    Inicio propuesto para certificadores

    + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + + +

    + + + + + + + +

    + + + + + + +

    +
    + +
    +
    +
    + + +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/admin/otherExpense/index.xhtml b/ace-web/src/main/webapp/app/admin/otherExpense/index.xhtml new file mode 100644 index 0000000..90db859 --- /dev/null +++ b/ace-web/src/main/webapp/app/admin/otherExpense/index.xhtml @@ -0,0 +1,214 @@ + + #{i18n['project.short.name']} - #{permission['admin.otherExpense']} + + + + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{permission['admin.otherExpense']}
  • +
    + + +
    +
    +
    +

    #{i18n['admin.financial.otherExpense']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    + + + + + + +

    +
    + +
    +
    +
    + + + + +

    + + + + + + + +

    + + + + + + +

    + + + + + + +

    +
    + +
    +
    +
    +
    +
    +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/admin/stableSmallBox/history.xhtml b/ace-web/src/main/webapp/app/admin/stableSmallBox/history.xhtml new file mode 100644 index 0000000..b80ce7d --- /dev/null +++ b/ace-web/src/main/webapp/app/admin/stableSmallBox/history.xhtml @@ -0,0 +1,189 @@ + + #{i18n['project.short.name']} - Caja chica + + + + + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • Historia cuadre caja chica
  • +
    + + +
    +
    +
    +

    Historial cuadre caja chica

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    + + + + + + +

    +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/admin/stableSmallBox/index.xhtml b/ace-web/src/main/webapp/app/admin/stableSmallBox/index.xhtml new file mode 100644 index 0000000..144da2f --- /dev/null +++ b/ace-web/src/main/webapp/app/admin/stableSmallBox/index.xhtml @@ -0,0 +1,141 @@ + + + + + + #{i18n['project.short.name']} - Caja chica + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • Cuadre de caja chica
  • +
    + + +
    +
    +
    + +
    +
    + +

    Cuadre de caja chica

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/admin/transfer/index.xhtml b/ace-web/src/main/webapp/app/admin/transfer/index.xhtml new file mode 100644 index 0000000..6ffe588 --- /dev/null +++ b/ace-web/src/main/webapp/app/admin/transfer/index.xhtml @@ -0,0 +1,216 @@ + + #{i18n['project.short.name']} - #{permission['admin.transfer']} + + + + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{permission['admin.transfer']}
  • +
    + + +
    +
    +
    +

    #{i18n['admin.financial.transfer']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    + + + + + + +

    +
    + +
    +
    +
    + + + +

    + + + + + + + +

    + + + + + + + +

    + + + + + + +

    +
    + +
    +
    +
    +
    +
    +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/admin/transfer/index_backup.xhtml b/ace-web/src/main/webapp/app/admin/transfer/index_backup.xhtml new file mode 100644 index 0000000..b714974 --- /dev/null +++ b/ace-web/src/main/webapp/app/admin/transfer/index_backup.xhtml @@ -0,0 +1,208 @@ + + #{i18n['project.short.name']} - #{permission['admin.transfer']} + + + + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{permission['admin.transfer']}
  • +
    + + +
    +
    +
    +

    #{i18n['admin.financial.transfer']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    + + + + + + +

    +
    + +
    +
    +
    + + + +

    + + + + + + + +

    + + + + + + + +

    + + + + + + +

    +
    + +
    +
    +
    +
    +
    +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/admin/vehicles/main.xhtml b/ace-web/src/main/webapp/app/admin/vehicles/main.xhtml new file mode 100644 index 0000000..9557f20 --- /dev/null +++ b/ace-web/src/main/webapp/app/admin/vehicles/main.xhtml @@ -0,0 +1,278 @@ + + + + + + #{i18n['project.short.name']} - #{permission['system.employee']} + + +
  • #{i18n['system.title']}
  • +
  • /
  • +
  • #{i18n['system.users']}
  • +
  • /
  • +
  • #{permission['system.employee']}
  • +
    + + +
    + + +
    +
    + + + +

    + + + +

    +

    Alta vehĆ­culo

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GPS + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + + + + + + + + + +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/catalog/loanType/add.xhtml b/ace-web/src/main/webapp/app/catalog/loanType/add.xhtml new file mode 100644 index 0000000..0e818d2 --- /dev/null +++ b/ace-web/src/main/webapp/app/catalog/loanType/add.xhtml @@ -0,0 +1,195 @@ + + + + + + #{i18n['project.short.name']} - #{permission['catalog.typeLoan.add']} + + +
  • #{i18n['catalog.title']}
  • +
  • /
  • +
  • #{permission['catalog.typeLoan']}
  • +
  • /
  • +
  • #{permission['catalog.typeLoan.add']}
  • +
    + + +
    +
    +
    + +
    +
    + + + + +

    #{permission['catalog.typeLoan.add']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Convenio

    + + + Convenio + + + + +

    DĆ­as de cobro

    + + + #{i18n['catalog.loanTypes.dialog.monday.title']} + + + + + #{i18n['catalog.loanTypes.dialog.tuesday.title']} + + + + + #{i18n['catalog.loanTypes.dialog.wednesday.title']} + + + + + #{i18n['catalog.loanTypes.dialog.thursday.title']} + + + + + #{i18n['catalog.loanTypes.dialog.friday.title']} + + + + + #{i18n['catalog.loanTypes.dialog.saturday.title']} + + + + + #{i18n['catalog.loanTypes.dialog.sunday.title']} + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + + + + + + +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/catalog/loanType/index.xhtml b/ace-web/src/main/webapp/app/catalog/loanType/index.xhtml new file mode 100644 index 0000000..f6a2113 --- /dev/null +++ b/ace-web/src/main/webapp/app/catalog/loanType/index.xhtml @@ -0,0 +1,116 @@ + + #{i18n['project.short.name']} - #{permission['catalog.typeLoan']} + + + + +
  • #{i18n['catalog.title']}
  • +
  • /
  • +
  • #{permission['catalog.typeLoan']}
  • +
    + + +
    +
    +
    +

    #{i18n['catalog.typeLoan']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/catalog/role/index.xhtml b/ace-web/src/main/webapp/app/catalog/role/index.xhtml new file mode 100644 index 0000000..7ad9b95 --- /dev/null +++ b/ace-web/src/main/webapp/app/catalog/role/index.xhtml @@ -0,0 +1,90 @@ + + #{i18n['project.short.name']} - #{permission['catalog.role']} + + + + +
  • #{i18n['catalog.title']}
  • +
  • /
  • +
  • #{permission['catalog.role']}
  • +
    + + +
    +
    +
    +

    #{i18n['catalog.roles']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + +

    + + + + + + +

    +
    + +
    +
    +
    +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/catalog/route/index.xhtml b/ace-web/src/main/webapp/app/catalog/route/index.xhtml new file mode 100644 index 0000000..7f69ce5 --- /dev/null +++ b/ace-web/src/main/webapp/app/catalog/route/index.xhtml @@ -0,0 +1,90 @@ + + #{i18n['project.short.name']} - #{permission['catalog.route']} + + + + +
  • #{i18n['catalog.title']}
  • +
  • /
  • +
  • #{permission['catalog.route']}
  • +
    + + +
    +
    +
    +

    #{i18n['catalog.route']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + +

    + + + + + + +

    +
    + +
    +
    +
    +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/generalBox/expenseCompanyIn/index.xhtml b/ace-web/src/main/webapp/app/generalBox/expenseCompanyIn/index.xhtml new file mode 100644 index 0000000..8bc0479 --- /dev/null +++ b/ace-web/src/main/webapp/app/generalBox/expenseCompanyIn/index.xhtml @@ -0,0 +1,182 @@ + + #{i18n['project.short.name']} - #{permission['admin.expenseCompanyIn']} + + + + + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{permission['admin.expenseCompanyIn']}
  • +
    + + +
    +
    +
    +

    #{i18n['admin.general.box.expenseCompanyIn']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + +

    + + + + + + +

    + + + + + + +

    +
    + +
    +
    +
    + + + + + + + + + + + + +

    + + + + + + +

    +
    + +
    +
    +
    +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/generalBox/expenseCompanyOut/index.xhtml b/ace-web/src/main/webapp/app/generalBox/expenseCompanyOut/index.xhtml new file mode 100644 index 0000000..b1defe2 --- /dev/null +++ b/ace-web/src/main/webapp/app/generalBox/expenseCompanyOut/index.xhtml @@ -0,0 +1,189 @@ + + #{i18n['project.short.name']} - #{permission['admin.expenseCompanyOut']} + + + + + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{permission['admin.expenseCompanyOut']}
  • +
    + + +
    +
    +
    +

    #{i18n['admin.general.box.expenseCompanyOut']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + +

    + + + + + + +

    + + + + + + +

    +
    + +
    +
    +
    + + + + + + + + + + + +

    + + + + + + +

    +
    + +
    +
    +
    +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/generalBox/stableGeneralBox/history.xhtml b/ace-web/src/main/webapp/app/generalBox/stableGeneralBox/history.xhtml new file mode 100644 index 0000000..a1aa101 --- /dev/null +++ b/ace-web/src/main/webapp/app/generalBox/stableGeneralBox/history.xhtml @@ -0,0 +1,188 @@ + + #{i18n['project.short.name']} - #{permission['admin.stableGeneralBox']} + + + + + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{permission['admin.stableGeneralBox']}
  • +
    + + +
    +
    +
    +

    #{i18n['admin.general.box.stable.history']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    + + + + + + +

    +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/generalBox/stableGeneralBox/index.xhtml b/ace-web/src/main/webapp/app/generalBox/stableGeneralBox/index.xhtml new file mode 100644 index 0000000..6d3c4a0 --- /dev/null +++ b/ace-web/src/main/webapp/app/generalBox/stableGeneralBox/index.xhtml @@ -0,0 +1,142 @@ + + + + + + #{i18n['project.short.name']} - #{permission['admin.stableGeneralBox.add']} + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{permission['admin.stableGeneralBox.add']}
  • +
    + + +
    +
    +
    + +
    +
    + +

    #{permission['admin.stableGeneralBox.add']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/payroll/advance/index.xhtml b/ace-web/src/main/webapp/app/payroll/advance/index.xhtml new file mode 100644 index 0000000..c08900b --- /dev/null +++ b/ace-web/src/main/webapp/app/payroll/advance/index.xhtml @@ -0,0 +1,184 @@ + + #{i18n['project.short.name']} - #{permission['admin.advance']} + + + + + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{permission['admin.advance']}
  • +
    + + +
    +
    +
    +

    #{i18n['admin.payroll.advance']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    + + + + + + +

    +
    + +
    +
    +
    +
    +
    + + + +

    + + + + + + + +

    + + + + + + +

    +
    + +
    +
    +
    +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/payroll/bonus/index.xhtml b/ace-web/src/main/webapp/app/payroll/bonus/index.xhtml new file mode 100644 index 0000000..b74713d --- /dev/null +++ b/ace-web/src/main/webapp/app/payroll/bonus/index.xhtml @@ -0,0 +1,168 @@ + + #{i18n['project.short.name']} - #{permission['admin.bonus']} + + + + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{permission['admin.bonus']}
  • +
    + + +
    +
    +
    +

    #{i18n['admin.payroll.bonus']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + +

    + + + + + + +

    + + + + + + +

    + + + + + + +

    + + + + + + +

    + + Administrativo + + + +

    +

    Cuando un bono no es administrativo, los valores que pones en bono de mora y colocaciĆ³n se toman como porcentaje, de lo contrario como un monto.

    +
    + +
    +
    +
    +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/payroll/createPayroll/index.xhtml b/ace-web/src/main/webapp/app/payroll/createPayroll/index.xhtml new file mode 100644 index 0000000..2dc0b4d --- /dev/null +++ b/ace-web/src/main/webapp/app/payroll/createPayroll/index.xhtml @@ -0,0 +1,432 @@ + + + + + + #{i18n['project.short.name']} - #{i18n['admin.payroll.create']} + + +
  • #{i18n['admin.payroll']}
  • +
  • /
  • +
  • #{i18n['admin.payroll.create']}
  • +
    + + +
    +
    + +
    +
    + +

    #{i18n['admin.payroll.create']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Resumen de nĆ³mina - percepciones

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Resumen nĆ³mina - deducciones

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Registro

    + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +

    Meta

    + + + + + + + + +

    Bono

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Detalles

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/payroll/goal/index.xhtml b/ace-web/src/main/webapp/app/payroll/goal/index.xhtml new file mode 100644 index 0000000..6569d28 --- /dev/null +++ b/ace-web/src/main/webapp/app/payroll/goal/index.xhtml @@ -0,0 +1,164 @@ + + #{i18n['project.short.name']} - #{permission['admin.goal']} + + + + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{permission['admin.goal']}
  • +
    + + +
    +
    +
    +

    #{i18n['admin.payroll.goals']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + +

    + + + + + + +

    + + + + + + +

    + + + + + + +

    +
    + +
    +
    +
    +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/payroll/history.xhtml b/ace-web/src/main/webapp/app/payroll/history.xhtml new file mode 100644 index 0000000..1634dbe --- /dev/null +++ b/ace-web/src/main/webapp/app/payroll/history.xhtml @@ -0,0 +1,232 @@ + + #{i18n['project.short.name']} - #{i18n['admin.payroll.history']} + + + + + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{i18n['admin.payroll.history']}
  • +
    + + +
    +
    +
    +

    #{i18n['admin.payroll.history']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    + + + + + + +

    +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/payroll/loanEmployee/index.xhtml b/ace-web/src/main/webapp/app/payroll/loanEmployee/index.xhtml new file mode 100644 index 0000000..c6136de --- /dev/null +++ b/ace-web/src/main/webapp/app/payroll/loanEmployee/index.xhtml @@ -0,0 +1,262 @@ + + PrƩstamos a empleados + + + + + +
  • #{grant['admin.name']}
  • +
  • /
  • +
  • PrĆ©stamos empleados
  • +
    + + +
    +
    +
    +

    PrƩstamos de empleados

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + Total #{fn:length(loanEmployeeListBean.loanEmployeeView)} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Abonos + + + + Fecha + Monto + NĆŗmero + + + + + + + + + + + + + #{detailDetail.paymentAmount} + #{detailDetail.referenceNumber} + + + + + + + + + + + + + + + + + + + + + + + + + +

    + + + + + + +

    +
    + +
    +
    +
    + + + + +

    + + + + + + + +

    +

    + + + + + + +

    + + + + + + +
    + +
    +
    +
    + + + + +

    + + + + + + +
    + +
    +
    +
    +
    +
    +
    +
    + +
    diff --git a/ace-web/src/main/webapp/app/stats/advances/index.xhtml b/ace-web/src/main/webapp/app/stats/advances/index.xhtml new file mode 100644 index 0000000..70ed097 --- /dev/null +++ b/ace-web/src/main/webapp/app/stats/advances/index.xhtml @@ -0,0 +1,109 @@ + + + #{i18n['project.short.name']} + + + + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{i18n['admin.stats.advances']}
  • +
    + +
    +
    +
    +

    #{i18n['admin.stats.advances']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/stats/closingDay/index.xhtml b/ace-web/src/main/webapp/app/stats/closingDay/index.xhtml new file mode 100644 index 0000000..655b239 --- /dev/null +++ b/ace-web/src/main/webapp/app/stats/closingDay/index.xhtml @@ -0,0 +1,114 @@ + + + #{i18n['project.short.name']} + + + + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{i18n['admin.stats.closingday']}
  • +
    + +
    +
    +
    +

    #{i18n['admin.stats.closingday']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/stats/deposits/index.xhtml b/ace-web/src/main/webapp/app/stats/deposits/index.xhtml new file mode 100644 index 0000000..18c5fc8 --- /dev/null +++ b/ace-web/src/main/webapp/app/stats/deposits/index.xhtml @@ -0,0 +1,138 @@ + + + #{i18n['project.short.name']} + + + + + + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{i18n['admin.stats.deposits']}
  • +
    + +
    +
    +
    +

    #{i18n['admin.stats.deposits']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + +
    + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/stats/employeeSaving/index.xhtml b/ace-web/src/main/webapp/app/stats/employeeSaving/index.xhtml new file mode 100644 index 0000000..1a19507 --- /dev/null +++ b/ace-web/src/main/webapp/app/stats/employeeSaving/index.xhtml @@ -0,0 +1,184 @@ + + + #{i18n['project.short.name']} + + + + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{i18n['admin.stats.employeesaving']}
  • +
    + +
    +
    +
    +

    #{i18n['admin.stats.employeesaving']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Ahorros + + + + Fecha + Monto + Tipo + + + + + + + + + + + + + #{employeeSaving.employeeSaving} + #{employeeSaving.typeText} + + + + + + + + + + + + + + +

    + + + + + + +

    +

    + + + + + + + +

    +
    + +
    +
    + +
    + +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/stats/fees/index.xhtml b/ace-web/src/main/webapp/app/stats/fees/index.xhtml new file mode 100644 index 0000000..c7af0aa --- /dev/null +++ b/ace-web/src/main/webapp/app/stats/fees/index.xhtml @@ -0,0 +1,116 @@ + + + #{i18n['project.short.name']} + + + + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{permission['admin.fees']}
  • +
    + +
    +
    +
    +

    #{i18n['admin.stats.fees']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/stats/feesByRoute/index.xhtml b/ace-web/src/main/webapp/app/stats/feesByRoute/index.xhtml new file mode 100644 index 0000000..c9e9dae --- /dev/null +++ b/ace-web/src/main/webapp/app/stats/feesByRoute/index.xhtml @@ -0,0 +1,111 @@ + + + #{i18n['project.short.name']} + + + + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{permission['admin.fees']}
  • +
    + +
    +
    +
    +

    #{i18n['admin.stats.fees']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/stats/gasoline/index.xhtml b/ace-web/src/main/webapp/app/stats/gasoline/index.xhtml new file mode 100644 index 0000000..ff7be2f --- /dev/null +++ b/ace-web/src/main/webapp/app/stats/gasoline/index.xhtml @@ -0,0 +1,119 @@ + + + #{i18n['project.short.name']} + + + + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{i18n['admin.stats.gasoline']}
  • +
    + +
    +
    +
    +

    #{i18n['admin.stats.gasoline']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/stats/openingFee/index.xhtml b/ace-web/src/main/webapp/app/stats/openingFee/index.xhtml new file mode 100644 index 0000000..63c4bb1 --- /dev/null +++ b/ace-web/src/main/webapp/app/stats/openingFee/index.xhtml @@ -0,0 +1,113 @@ + + + #{i18n['project.short.name']} + + + + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{i18n['admin.stats.openingfee']}
  • +
    + +
    +
    +
    +

    #{i18n['admin.stats.openingfee']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/stats/payment/index.xhtml b/ace-web/src/main/webapp/app/stats/payment/index.xhtml new file mode 100644 index 0000000..aca0658 --- /dev/null +++ b/ace-web/src/main/webapp/app/stats/payment/index.xhtml @@ -0,0 +1,113 @@ + + + #{i18n['project.short.name']} + + + + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{i18n['admin.stats.payment']}
  • +
    + +
    +
    +
    +

    #{i18n['admin.stats.payment']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/stats/paymentRenovation/index.xhtml b/ace-web/src/main/webapp/app/stats/paymentRenovation/index.xhtml new file mode 100644 index 0000000..b9669f1 --- /dev/null +++ b/ace-web/src/main/webapp/app/stats/paymentRenovation/index.xhtml @@ -0,0 +1,112 @@ + + + #{i18n['project.short.name']} + + + + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{i18n['admin.stats.paymentrenovation']}
  • +
    + +
    +
    +
    +

    #{i18n['admin.stats.paymentrenovation']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/stats/paymentRoute/index.xhtml b/ace-web/src/main/webapp/app/stats/paymentRoute/index.xhtml new file mode 100644 index 0000000..5da2410 --- /dev/null +++ b/ace-web/src/main/webapp/app/stats/paymentRoute/index.xhtml @@ -0,0 +1,114 @@ + + + #{i18n['project.short.name']} + + + + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{i18n['admin.stats.paymentroute']}
  • +
    + +
    +
    +
    +

    #{i18n['admin.stats.paymentroute']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/stats/payroll/index.xhtml b/ace-web/src/main/webapp/app/stats/payroll/index.xhtml new file mode 100644 index 0000000..42de611 --- /dev/null +++ b/ace-web/src/main/webapp/app/stats/payroll/index.xhtml @@ -0,0 +1,110 @@ + + + #{i18n['project.short.name']} + + + + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{i18n['admin.stats.payroll']}
  • +
    + +
    +
    +
    +

    #{i18n['admin.stats.payroll']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/stats/summary/index.xhtml b/ace-web/src/main/webapp/app/stats/summary/index.xhtml new file mode 100644 index 0000000..e354976 --- /dev/null +++ b/ace-web/src/main/webapp/app/stats/summary/index.xhtml @@ -0,0 +1,145 @@ + + + #{i18n['project.short.name']} + + + + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{i18n['admin.stats.summary']}
  • +
    + +
    +
    +
    +

    #{i18n['admin.stats.summary']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/stats/vehicles/index.xhtml b/ace-web/src/main/webapp/app/stats/vehicles/index.xhtml new file mode 100644 index 0000000..76433ad --- /dev/null +++ b/ace-web/src/main/webapp/app/stats/vehicles/index.xhtml @@ -0,0 +1,93 @@ + + + #{i18n['project.short.name']} + + + + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{i18n['admin.stats.vehicle']}
  • +
    + +
    +
    +
    +

    #{i18n['admin.stats.vehicle']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/stats/zeroPayments/index.xhtml b/ace-web/src/main/webapp/app/stats/zeroPayments/index.xhtml new file mode 100644 index 0000000..c670c22 --- /dev/null +++ b/ace-web/src/main/webapp/app/stats/zeroPayments/index.xhtml @@ -0,0 +1,112 @@ + + + #{i18n['project.short.name']} + + + + + +
  • #{i18n['admin.title']}
  • +
  • /
  • +
  • #{i18n['admin.stats.zeropayments']}
  • +
    + +
    +
    +
    +

    #{i18n['admin.stats.zeropayments']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/system/bitacora/index.xhtml b/ace-web/src/main/webapp/app/system/bitacora/index.xhtml new file mode 100644 index 0000000..63a242c --- /dev/null +++ b/ace-web/src/main/webapp/app/system/bitacora/index.xhtml @@ -0,0 +1,104 @@ + + #{i18n['project.short.name']} - BitƔcora} + + + + + +
  • #{i18n['system.title']}
  • +
  • /
  • +
  • BitĆ”cora
  • +
    + + +
    +
    +
    +

    #{i18n['system.bitacora']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/system/employee/employeeList.xhtml b/ace-web/src/main/webapp/app/system/employee/employeeList.xhtml new file mode 100644 index 0000000..8d66337 --- /dev/null +++ b/ace-web/src/main/webapp/app/system/employee/employeeList.xhtml @@ -0,0 +1,95 @@ + + + + + + #{i18n['project.short.name']} - #{permission['system.employee']} + + +
  • #{i18n['system.title']}
  • +
  • /
  • +
  • #{i18n['system.users']}
  • +
  • /
  • +
  • #{permission['system.employee']}
  • +
    + + +
    + + +
    +
    +

    + + + +

    + + + + + + + + + + + + + +
    + + + + +
    + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    +
    +
    + + + + +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/system/employee/main.xhtml b/ace-web/src/main/webapp/app/system/employee/main.xhtml new file mode 100644 index 0000000..cf88d1d --- /dev/null +++ b/ace-web/src/main/webapp/app/system/employee/main.xhtml @@ -0,0 +1,621 @@ + + + + + + #{i18n['project.short.name']} - #{permission['system.employee']} + + +
  • #{i18n['system.title']}
  • +
  • /
  • +
  • #{i18n['system.users']}
  • +
  • /
  • +
  • #{permission['system.employee']}
  • +
    + + +
    + + +
    +
    + + + +

    + + + +

    +

    #{i18n['add.hr']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + +
    +
    + + + +

    + + + +

    +

    + #{i18n['employee.disable']} + + + +

    + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + +
    +
    + + + +

    + + + +

    +

    + #{i18n['employee.eneble']} + + + +

    + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + +
    +
    + + + +

    + + + +

    +

    #{i18n['employee.delete']} + + + +

    + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + +
    +
    + + + +

    + + + +

    +

    + #{i18n['hr.update.btn']} + + + +

    +
    + + + +
    + + + + + + + + + + + + + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + + + +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/system/log/main.xhtml b/ace-web/src/main/webapp/app/system/log/main.xhtml new file mode 100644 index 0000000..1b60134 --- /dev/null +++ b/ace-web/src/main/webapp/app/system/log/main.xhtml @@ -0,0 +1,25 @@ + + #{i18n.project} - #{grant['system.submenu.log.name']} + + +
  • #{grant['system.menu.name']}
  • +
  • /
  • +
  • #{grant['system.submenu.log.name']}
  • +
    + + +
    +
    +
    +

    DASHBOARD

    +
    +
    +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/system/office/index.xhtml b/ace-web/src/main/webapp/app/system/office/index.xhtml new file mode 100644 index 0000000..d871bef --- /dev/null +++ b/ace-web/src/main/webapp/app/system/office/index.xhtml @@ -0,0 +1,104 @@ + + #{i18n['project.short.name']} - #{permission['system.office']} + + + + +
  • #{i18n['system.title']}
  • +
  • /
  • +
  • #{permission['system.office']}
  • +
    + + +
    +
    +
    +

    #{i18n['system.office']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + +

    + + + + + + +

    + + + + + + +

    +
    + +
    +
    +
    +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/system/user/access/main.xhtml b/ace-web/src/main/webapp/app/system/user/access/main.xhtml new file mode 100644 index 0000000..d6975a6 --- /dev/null +++ b/ace-web/src/main/webapp/app/system/user/access/main.xhtml @@ -0,0 +1,172 @@ + + + #{i18n['project.short.name']} - #{i18n['system.users']} + + +
  • #{i18n['system.title']}
  • +
  • /
  • +
  • #{i18n['system.users']}
  • +
  • /
  • +
  • #{permission['system.user.access']}
  • +
    + + +
    +
    +
    + + +

    + + + +

    +

    #{i18n['access.updte']}

    + +
    + + + + + + + + + + + + + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + #{i18n['dual.list.permissions.available']} + + + + + #{i18n['dual.list.permissions.taken']} + + + + + + + #{i18n.screen}: + + + + + + #{i18n.permission}: + + + + + + + + + + + + + + + + +
    +
    + + + + + + + + +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/system/user/add/main.xhtml b/ace-web/src/main/webapp/app/system/user/add/main.xhtml new file mode 100644 index 0000000..9a27e2b --- /dev/null +++ b/ace-web/src/main/webapp/app/system/user/add/main.xhtml @@ -0,0 +1,275 @@ + + + + + + #{i18n['project.short.name']} - #{i18n['system.users']} + + +
  • #{i18n['system.title']}
  • +
  • /
  • +
  • #{i18n['system.users']}
  • +
  • /
  • +
  • #{permission['system.user.create']}
  • +
    + + + +
    + + +
    +
    + + +

    + + + +

    +

    #{i18n['user.create']}

    + + + + + + + + + + + + + + + + + + + + + + + + Certificador + + + + + Gerencia + + + + + +
    + + + + + + + + + + #{userCreateBean.user.userName eq null or userCreateBean.user.userName.trim() eq "" ? 'thumbs_up_down' : (userCreateBean.availableUserName ? 'thumb_up': 'thumb_down')} + + +
    + +
    + + + + + + + + + + + + +
    + + + + + + + #{i18n['dual.list.permissions.available']} + + + + + #{i18n['dual.list.permissions.taken']} + + + + + + + #{i18n.screen}: + + + + + + #{i18n.permission}: + + + + + + + + + + + + + + + #{i18n['dual.list.routes.available']} + + + + + #{i18n['dual.list.routes.taken']} + + + + + + + + + + + + + + +
    +
    +
    + + + + + + + + +
    +
    + +
    diff --git a/ace-web/src/main/webapp/app/system/user/setting/main.xhtml b/ace-web/src/main/webapp/app/system/user/setting/main.xhtml new file mode 100644 index 0000000..d82fadd --- /dev/null +++ b/ace-web/src/main/webapp/app/system/user/setting/main.xhtml @@ -0,0 +1,450 @@ + + + #{i18n['project.short.name']} - #{i18n['system.users']} + + +
  • #{i18n['system.title']}
  • +
  • /
  • +
  • #{i18n['system.users']}
  • +
  • /
  • +
  • #{permission['system.user.admin']}
  • +
    + + +
    + + +
    +
    + + + + +

    + + + +

    +

    + #{i18n['user.update']} +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Certificador + + + + + Gerencia + + + + + + + + + #{i18n['dual.list.permissions.available']} + + + + + #{i18n['dual.list.permissions.taken']} + + + + + + + #{i18n.screen}: + + + + + + #{i18n.permission}: + + + + + + + + + + + + + + + #{i18n['dual.list.routes.available']} + + + + + #{i18n['dual.list.routes.taken']} + + + + + + + + + + + + + + +
    +
    +
    + + +
    +
    + + + + +

    + + + +

    +

    + #{i18n['other.actions']} + + + +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + #{userUpdateBean.userName eq null or userUpdateBean.userName.trim() eq "" ? 'thumbs_up_down' : (userUpdateBean.availableUserName ? 'thumb_up': 'thumb_down')} + + +
    + +
    +
    + + + + + + + + + +
    +
    +
    + + + + + + + + +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/system/user/setting/main_1.xhtml b/ace-web/src/main/webapp/app/system/user/setting/main_1.xhtml new file mode 100644 index 0000000..d23c57c --- /dev/null +++ b/ace-web/src/main/webapp/app/system/user/setting/main_1.xhtml @@ -0,0 +1,663 @@ + + + #{i18n['project.short.name']} - #{i18n['system.users']} + + +
  • #{i18n['system.title']}
  • +
  • /
  • +
  • #{i18n['system.users']}
  • +
  • /
  • +
  • #{permission['system.user.admin']}
  • +
    + + +
    + + +
    +
    + + + + +

    + + + +

    +

    + #{i18n['user.disable']} + + + +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + +
    +
    + + + + +

    + + + +

    +

    + #{i18n['user.eneble']} + + + +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + +
    +
    + + + + +

    + + + +

    +

    + #{i18n['user.delete']} + + + +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + +
    +
    + + + + +

    + + + +

    +

    + #{i18n['user.update']} + + + +

    + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + #{userCreateBean.user.userName eq null or userCreateBean.user.userName.trim() eq "" ? 'thumbs_up_down' : (userCreateBean.availableUserName ? 'thumb_up': 'thumb_down')} + + +
    + +
    +
    + + + + + + + + + +
    +
    +
    + + + + + + + + + + +
    +
    + + + + +

    + + + +

    +

    + #{i18n['user.update.routes']} + + + +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Certificador + + + + + + + + + + + + + + + + + + + #{i18n['dual.list.routes.available']} + + + + + #{i18n['dual.list.routes.taken']} + + + + + + + + + + + + + + + +
    +
    +
    + + + + + + + + + + + +
    +
    + + + + +

    + + + +

    +

    + #{i18n['user.update.pwd.btn']} + + + +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + +
    +
    + + +

    + + + +

    +

    #{i18n['photo.add']}

    + + +
    +
    +
    + + + + + + + + +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/app/topbar/privacy.xhtml b/ace-web/src/main/webapp/app/topbar/privacy.xhtml new file mode 100644 index 0000000..4641532 --- /dev/null +++ b/ace-web/src/main/webapp/app/topbar/privacy.xhtml @@ -0,0 +1,87 @@ + + #{i18n['project.short.name']} - #{i18n['user.update.pwd']} + + +
  • #{i18n['user.update.pwd']}
  • +
    + + +
    +
    +
    + + + + +

    + #{i18n['user.update.pwd']} +

    + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + + + + + + + +
    +
    + +
    diff --git a/ace-web/src/main/webapp/customerWithoutLoanDetail.xhtml b/ace-web/src/main/webapp/customerWithoutLoanDetail.xhtml new file mode 100644 index 0000000..1d34e1d --- /dev/null +++ b/ace-web/src/main/webapp/customerWithoutLoanDetail.xhtml @@ -0,0 +1,311 @@ + + + + + + #{i18n['project.short.name']} - #{permission['admin.customer']} + + +
  • #{i18n['admin.customers.detail.title']}
  • +
    + + +
    +
    + +
    +
    + + + + +

    #{i18n['admin.customers.detail.title']}

    +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + + +

    #{i18n['admin.customers.company.title']}

    +

    + + + + + + +



    + + + + +



    + + + + + + + + + + + +
    +
    +
    +
    +
    + + + +

    InformaciĆ³n adicional

    +

    + + + + + +



    + + + + + +
    +
    +
    +
    + +
    + +
    +
    + +

    #{i18n['admin.customers.loan.title']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    +
    + + + + Detalle de pagos + + + + Fecha + Pago + Tipo + No. Referencia + Comentarios + + + + + + + + + + + + + + + + + + #{detail.loanDetailsType.value} + #{detail.referenceNumber} + #{detail.comments} + + + + + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/dashboard.xhtml b/ace-web/src/main/webapp/dashboard.xhtml new file mode 100644 index 0000000..6d0e0b6 --- /dev/null +++ b/ace-web/src/main/webapp/dashboard.xhtml @@ -0,0 +1,1109 @@ + + + + + +
  • #{i18n['dashboard.title']}
  • +
    + + +
    +
    + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Detalle de avance del dĆ­a por asesor

    + + + + + + + + + + + + + + + + + + + + +
    + + + + +
    + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +

    + +

    Clientes sin renovar

    + + + + + +
    + + + + +
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    + +

    PrƩstamos jurƭdico

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +

    Historial de prƩstamos por cliente

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Historial de prƩstamos por Aval

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Corte del dĆ­a

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +

    Abonos en ceros del dĆ­a

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +

    PrƩstamos terminados del dƭa

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    InformaciĆ³n faltante del dĆ­a

    + + + + + + + + + + + + + + + + + + + + + + + + + +

    Resumen semanal de colocaciĆ³n y faltante general

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + +
    + + + + +

    + + + + + + + +

    +
    + +
    +
    +
    + + + + +

    + + + + + + +

    + + + + + + + +

    + + + + + + +

    +
    + +
    +
    +
    + + + + +

    + + + + + + +

    + + + + + + + +

    + + + + + + +

    +
    + +
    +
    +
    + + + + +

    + + + + + + + +

    + + + + + + +

    +
    + +
    +
    +
    + + + + +

    + + + + + + + +

    +
    + +
    +
    +
    + + + + +

    + + + + + + +

    + + + + + + + +

    + + + + + + +

    +
    + +
    +
    +
    + + + + +

    + + + + + + +

    +
    + +
    +
    +
    + + + + +

    + + + + + + +

    +
    + +
    +
    +
    + + + + +

    + + + + + + +

    +
    + +
    +
    +
    + + + + +

    + + + + + + +

    +
    + +
    +
    +
    + + + + +

    + + + + + + +

    +
    + +
    +
    +
    +
    +
    +
    + +
    diff --git a/ace-web/src/main/webapp/loanDetail.xhtml b/ace-web/src/main/webapp/loanDetail.xhtml new file mode 100644 index 0000000..95c6450 --- /dev/null +++ b/ace-web/src/main/webapp/loanDetail.xhtml @@ -0,0 +1,530 @@ + + + + + + #{i18n['project.short.name']} - #{permission['admin.loan']} + + +
  • #{i18n['admin.loan.detail.title']}
  • +
    + + + + +
    +
    + +
    +
    + + + +

    #{i18n['admin.customers.detail.title']}

    +

    + + + + + + +



    + + + + +



    + + + + +



    + + + + +



    + + + + +



    + + + + + +
    +
    +
    +
    +
    + + + +

    #{i18n['admin.customers.company.title']}

    +

    + + + + + + +



    + + + + +



    + + + + + +
    +
    +
    +
    + +
    + +
    +
    + +

    #{i18n['admin.customers.loan.title']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    +
    + + + + Detalle de pagos + + + + Fecha + Pago + Saldo insoluto + Tipo + No. Referencia + Comentarios + + + + + + + + + + + + + + + + + + + + + + + #{detail.loanDetailsType.value} + #{detail.referenceNumber} + #{detail.comments} + + + + + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + + + +

    #{i18n['admin.endorsements.detail.title']}

    +

    + + + + + + +



    + + + + +



    + + + + +



    + + + + +



    + + + + +



    + + + + + +
    +
    +
    +
    +
    + + + +

    #{i18n['admin.endorsements.company.title']}

    +

    + + + + + + +



    + + + + +



    + + + + + +
    +
    +
    +
    + +
    + +
    +
    + +

    #{i18n['admin.endorsements.loan.title']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    + + + +

    PrƩstamo

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + +
    +
    +
    + +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/loanDetailEndorsement.xhtml b/ace-web/src/main/webapp/loanDetailEndorsement.xhtml new file mode 100644 index 0000000..c29797f --- /dev/null +++ b/ace-web/src/main/webapp/loanDetailEndorsement.xhtml @@ -0,0 +1,524 @@ + + + + + + #{i18n['project.short.name']} - #{permission['admin.loan']} + + +
  • #{i18n['admin.loan.detail.title']}
  • +
    + + + + +
    +
    + +
    +
    + + + +

    #{i18n['admin.customers.detail.title']}

    +

    + + + + + + +



    + + + + +



    + + + + +



    + + + + +



    + + + + +



    + + + + + +
    +
    +
    +
    +
    + + + +

    #{i18n['admin.customers.company.title']}

    +

    + + + + + + +



    + + + + +



    + + + + + +
    +
    +
    +
    + +
    + +
    +
    + +

    #{i18n['admin.customers.loan.title']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    +
    + + + + Detalle de pagos + + + + Fecha + Pago + Tipo + No. Referencia + Comentarios + + + + + + + + + + + + + + + + + + #{detail.loanDetailsType.value} + #{detail.referenceNumber} + #{detail.comments} + + + + + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + + + +

    #{i18n['admin.endorsements.detail.title']}

    +

    + + + + + + +



    + + + + +



    + + + + +



    + + + + +



    + + + + +



    + + + + + +
    +
    +
    +
    +
    + + + +

    #{i18n['admin.endorsements.company.title']}

    +

    + + + + + + +



    + + + + +



    + + + + + +
    +
    +
    +
    + +
    + +
    +
    + +

    #{i18n['admin.endorsements.loan.title']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    + + + +

    PrƩstamo

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + +
    +
    +
    + +
    + +
    \ No newline at end of file diff --git a/ace-web/src/main/webapp/login.xhtml b/ace-web/src/main/webapp/login.xhtml new file mode 100644 index 0000000..45e0042 --- /dev/null +++ b/ace-web/src/main/webapp/login.xhtml @@ -0,0 +1,85 @@ + + + + + + + + + + + #{i18n['project.short.name']} + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ace-web/src/main/webapp/resources/js/scriptGeneric/bitacora.js b/ace-web/src/main/webapp/resources/js/scriptGeneric/bitacora.js new file mode 100644 index 0000000..1473bb9 --- /dev/null +++ b/ace-web/src/main/webapp/resources/js/scriptGeneric/bitacora.js @@ -0,0 +1,7 @@ +function deleteEventBitacora(xhr, status, args) { + if (undefined === args.validationFailed || false === args.validationFailed) { + PF('deleteEventBitacora').hide(); + } else { + PF('deleteEventBitacora').show(); + } +} \ No newline at end of file diff --git a/ace-web/src/main/webapp/resources/js/scriptGeneric/dialogGeneric.js b/ace-web/src/main/webapp/resources/js/scriptGeneric/dialogGeneric.js new file mode 100644 index 0000000..5bd74b9 --- /dev/null +++ b/ace-web/src/main/webapp/resources/js/scriptGeneric/dialogGeneric.js @@ -0,0 +1,96 @@ +function validNewObjectGeneric(xhr, status, args) { + if (undefined === args.validationFailed || false === args.validationFailed) { + PF('dlg2').hide(); + } else { + PF('dlg2').show(); + } +} + +function validNewObjectGeneric2(xhr, status, args) { + if (undefined === args.validationFailed || false === args.validationFailed) { + PF('dlg3').hide(); + } else { + PF('dlg3').show(); + } +} + +function validNewObjectGeneric3(xhr, status, args) { + if (undefined === args.validationFailed || false === args.validationFailed) { + PF('dlg4').hide(); + } else { + PF('dlg4').show(); + } +} + +function validNewObjectGeneric4(xhr, status, args) { + if (undefined === args.validationFailed || false === args.validationFailed) { + PF('dlg5').hide(); + } else { + PF('dlg5').show(); + } +} + +function validNewObjectGeneric5(xhr, status, args) { + if (undefined === args.validationFailed || false === args.validationFailed) { + PF('dlg6').hide(); + } else { + PF('dlg6').show(); + } +} + +function validNewObjectGeneric6(xhr, status, args) { + if (undefined === args.validationFailed || false === args.validationFailed) { + PF('dlg7').hide(); + } else { + PF('dlg7').show(); + } +} + +function validNewObjectGeneric7(xhr, status, args) { + if (undefined === args.validationFailed || false === args.validationFailed) { + PF('dlg8').hide(); + } else { + PF('dlg8').show(); + } +} + +function validNewObjectGeneric8(xhr, status, args) { + if (undefined === args.validationFailed || false === args.validationFailed) { + PF('dlg9').hide(); + } else { + PF('dlg9').show(); + } +} + +function validNewObjectGeneric9(xhr, status, args) { + if (undefined === args.validationFailed || false === args.validationFailed) { + PF('dlg10').hide(); + } else { + PF('dlg10').show(); + } +} + +function validNewObjectGeneric10(xhr, status, args) { + if (undefined === args.validationFailed || false === args.validationFailed) { + PF('dlg11').hide(); + } else { + PF('dlg11').show(); + } +} + +function validNewObjectGeneric11(xhr, status, args) { + if (undefined === args.validationFailed || false === args.validationFailed) { + PF('dlg12').hide(); + } else { + PF('dlg12').show(); + } +} + +function deleteEventBitacora(xhr, status, args) { + if (undefined === args.validationFailed || false === args.validationFailed) { + PF('deleteEventBitacora').hide(); + } else { + PF('deleteEventBitacora').show(); + } +} +; diff --git a/ace-web/src/main/webapp/resources/primefaces-serenity-green/theme.css b/ace-web/src/main/webapp/resources/primefaces-serenity-green/theme.css new file mode 100644 index 0000000..04aec8b --- /dev/null +++ b/ace-web/src/main/webapp/resources/primefaces-serenity-green/theme.css @@ -0,0 +1,7653 @@ +@charset "UTF-8"; +/******************************/ +/* Common */ +/******************************/ +/* Predefined Colors */ +body .ui-widget, +body .ui-widget .ui-widget { + font-family: "Roboto", "Helvetica Neue", sans-serif; + text-decoration: none; +} +body .ui-widget-content { + background-color: #ffffff; + border: 1px solid #d8d8d8; + padding: 8px 14px; +} +body .ui-widget-content .ui-icon { + color: #757575; +} +body .ui-widget-header { + background-color: #29ABE1; + color: #ffffff; + border: 1px solid #29ABE1; + padding: 8px 14px; +} +body .ui-widget-header .ui-icon { + color: #ffffff; +} +body .ui-state-active, body .ui-state-highlight { + background-color: #29ABE1; + color: #ffffff; +} +body .ui-state-active .ui-icon, body .ui-state-highlight .ui-icon { + color: #ffffff; +} +body .ui-state-disabled { + opacity: 0.35; + filter: Alpha(Opacity=35); + background-image: none; +} +body .ui-corner-all { + -moz-border-radius: 0px; + -webkit-border-radius: 0px; + border-radius: 0px; +} +body .ui-corner-top { + -moz-border-radius-topleft: 0px; + -webkit-border-top-left-radius: 0px; + border-top-left-radius: 0px; + -moz-border-radius-topright: 0px; + -webkit-border-top-right-radius: 0px; + border-top-right-radius: 0px; +} +body .ui-corner-bottom { + -moz-border-radius-bottomleft: 0px; + -webkit-border-bottom-left-radius: 0px; + border-bottom-left-radius: 0px; + -moz-border-radius-bottomright: 0px; + -webkit-border-bottom-right-radius: 0px; + border-bottom-right-radius: 0px; +} +body .ui-corner-left { + -moz-border-radius-topleft: 0px; + -webkit-border-top-left-radius: 0px; + border-top-left-radius: 0px; + -moz-border-radius-bottomleft: 0px; + -webkit-border-bottom-left-radius: 0px; + border-bottom-left-radius: 0px; +} +body .ui-corner-right { + -moz-border-radius-topright: 0px; + -webkit-border-top-right-radius: 0px; + border-top-right-radius: 0px; + -moz-border-radius-bottomright: 0px; + -webkit-border-bottom-right-radius: 0px; + border-bottom-right-radius: 0px; +} +body .ui-widget-overlay { + background-color: #58575c; + opacity: 0.8; + filter: alpha(opacity=80); +} +body .ui-icon { + font-family: "Material Icons"; + font-weight: normal; + font-style: normal; + font-size: 20px; + display: inline-block; + width: 20px; + height: 20px; + line-height: 1; + text-transform: none; + letter-spacing: normal; + word-wrap: normal; + white-space: nowrap; + direction: ltr; + text-indent: 0; + overflow: visible; + /* Support for all WebKit browsers. */ + -webkit-font-smoothing: antialiased; + /* Support for Safari and Chrome. */ + text-rendering: optimizeLegibility; + /* Support for Firefox. */ + -moz-osx-font-smoothing: grayscale; + /* Support for IE. */ + font-feature-settings: "liga"; +} +body .material-icons { + font-family: "Material Icons"; + font-weight: normal; + font-style: normal; + font-size: 24px; + /* Preferred icon size */ + display: inline-block; + width: 1em; + height: 1em; + line-height: 1; + text-transform: none; + letter-spacing: normal; + word-wrap: normal; + white-space: nowrap; + direction: ltr; + /* Support for all WebKit browsers. */ + -webkit-font-smoothing: antialiased; + /* Support for Safari and Chrome. */ + text-rendering: optimizeLegibility; + /* Support for Firefox. */ + -moz-osx-font-smoothing: grayscale; + /* Support for IE. */ + font-feature-settings: "liga"; +} +body .fa { + font-family: "FontAwesome"; +} +body a { + color: #29ABE1; + text-decoration: none; +} + +body .ui-inputfield { + background: white no-repeat; + background-image: linear-gradient(to bottom, #29ABE1, #29ABE1), linear-gradient(to bottom, #bdbdbd, #bdbdbd); + background-size: 0 2px, 100% 1px; + background-position: 50% 100%, 50% 100%; + transition: background-size 0.3s cubic-bezier(0.64, 0.09, 0.08, 1); + border-width: 0; + padding: 2px 2px 2px 2px; + font-size: 14px; + -moz-border-radius: 0px; + -webkit-border-radius: 0px; + border-radius: 0px; +} +body .ui-inputfield.ui-state-focus { + border-width: 0; + background-size: 100% 2px, 100% 1px; + outline: none; + padding-bottom: 2px; +} +body .ui-inputfield.ui-state-disabled { + border-bottom: 1px dotted; +} +body .ui-inputfield.ui-widget-content { + border-width: 1px; + background: transparent; + background-image: none; +} +body .ui-inputfield.ui-state-error { + border-color: #e62a10; +} +body .ui-inputfield:-webkit-autofill { + border-color: #bdbdbd; + border-style: solid; + border-width: 0px 0px 1px 0px; +} +body .ui-inputfield:-webkit-autofill.ui-state-focus { + padding-bottom: 0px; +} +body .md-inputfield { + display: block; + position: relative; +} +body .md-inputfield input:focus ~ label, +body .md-inputfield input.ui-state-filled ~ label, +body .md-inputfield textarea:focus ~ label, +body .md-inputfield textarea.ui-state-filled ~ label, +body .md-inputfield .md-inputwrapper-focus ~ label, +body .md-inputfield .md-inputwrapper-filled ~ label { + top: -20px; + font-size: 12px; + color: #29ABE1; +} +body .md-inputfield input:-webkit-autofill ~ label { + top: -20px; + font-size: 12px; + color: #29ABE1; +} +body .md-inputfield label { + color: #999; + font-weight: normal; + position: absolute; + pointer-events: none; + left: 5px; + top: 1px; + transition: 0.3s ease all; + -moz-transition: 0.3s ease all; + -webkit-transition: 0.3s ease all; +} +body .md-inputfield input.ui-state-error ~ label { + color: #e62a10; +} +body .ui-selectonelistbox { + background-color: #ffffff; + border: 0 none; + -moz-border-radius: 0px; + -webkit-border-radius: 0px; + border-radius: 0px; +} +body .ui-selectonelistbox.ui-inputfield { + padding: 0; +} +body .ui-selectonelistbox .ui-selectlistbox-list { + padding: 0; + border: 1px solid #d8d8d8; +} +body .ui-selectonelistbox .ui-selectlistbox-item { + overflow: hidden; + padding: 6px 10px; + margin: 0; + position: relative; + overflow: hidden; + -moz-transition: background-color 0.3s; + -o-transition: background-color 0.3s; + -webkit-transition: background-color 0.3s; + transition: background-color 0.3s; + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; +} +body .ui-selectonelistbox .ui-selectlistbox-item.ui-state-hover { + background-color: #e8e8e8; + color: #000000; +} +body .ui-selectonelistbox .ui-selectlistbox-filter-container { + margin: 0; + padding: 6px 10px; + background-color: #29ABE1; + -moz-border-radius-topleft: 0px; + -webkit-border-top-left-radius: 0px; + border-top-left-radius: 0px; + -moz-border-radius-topright: 0px; + -webkit-border-top-right-radius: 0px; + border-top-right-radius: 0px; +} +body .ui-selectonelistbox .ui-selectlistbox-filter-container .ui-inputfield { + border-color: #d9d9d9; + color: #ffffff; + width: 100%; + padding-left: 2px; + padding-right: 20px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +body .ui-selectonelistbox .ui-selectlistbox-filter-container .ui-inputfield.ui-state-focus { + border-color: #ffffff; +} +body .ui-selectonelistbox .ui-selectlistbox-filter-container .ui-icon { + color: #ffffff; + top: 6px; + right: 12px; +} +body .ui-multiselectlistbox .ui-multiselectlistbox-header { + padding: 6px 10px; + position: relative; + bottom: -1px; +} +body .ui-multiselectlistbox .ui-multiselectlistbox-list { + padding: 0; + background-color: #ffffff; +} +body .ui-multiselectlistbox li.ui-multiselectlistbox-item { + padding: 6px 10px; + margin: 0; + position: relative; + overflow: hidden; + -moz-transition: background-color 0.3s; + -o-transition: background-color 0.3s; + -webkit-transition: background-color 0.3s; + transition: background-color 0.3s; + -moz-border-radius: 0px; + -webkit-border-radius: 0px; + border-radius: 0px; +} +body .ui-multiselectlistbox li.ui-multiselectlistbox-item.ui-state-hover { + background-color: #e8e8e8; + color: #000000; +} +body .ui-button { + overflow: hidden; + background-color: #29ABE1; + color: #ffffff; + height: 30px; + padding: 0 14px; + border: 0 none; + -moz-box-shadow: 0 1px 2.5px 0 rgba(0, 0, 0, 0.26), 0 1px 5px 0 rgba(0, 0, 0, 0.16); + -webkit-box-shadow: 0 1px 2.5px 0 rgba(0, 0, 0, 0.26), 0 1px 5px 0 rgba(0, 0, 0, 0.16); + box-shadow: 0 1px 2.5px 0 rgba(0, 0, 0, 0.26), 0 1px 5px 0 rgba(0, 0, 0, 0.16); + -moz-transition: background-color 0.3s; + -o-transition: background-color 0.3s; + -webkit-transition: background-color 0.3s; + transition: background-color 0.3s; +} +body .ui-button.ui-state-hover { + background-color: #2341BB; +} +body .ui-button.ui-state-focus { + outline: 0 none; + background-color: #A8E1F7; +} +body .ui-button .ui-button-text { + padding: 0; + line-height: 30px; + font-size: 14px; +} +body .ui-button .ui-icon { + color: #ffffff; +} +body .ui-button.ui-button-icon-only { + -moz-border-radius: 50%; + -webkit-border-radius: 50%; + border-radius: 50%; + width: 30px; + height: 30px; +} +body .ui-button.ui-button-icon-only .ui-icon { + margin-top: -10px; + margin-left: -10px; +} +body .ui-button.ui-button-text-icon-left .ui-icon, body .ui-button.ui-button-text-icon-right .ui-icon { + margin-top: -10px; +} +body .ui-button.ui-button-text-icon-left { + padding-left: 36px; +} +body .ui-button.ui-button-text-icon-right { + padding-right: 36px; +} +body .ui-button.secondary-btn { + background-color: #29ABE1; + color: #ffffff; +} +body .ui-button.secondary-btn.ui-state-hover { + background-color: #2341BB; +} +body .ui-button.secondary-btn.ui-state-focus { + outline: 0 none; + background-color: #ddc061; +} +body .ui-button.secondary-btn .ui-icon { + color: #ffffff; +} +body .ui-button.blue-grey-btn { + background-color: #607D8B; +} +body .ui-button.blue-grey-btn.ui-state-hover { + background-color: #37474F; +} +body .ui-button.blue-grey-btn.ui-state-focus { + outline: 0 none; + background-color: #7b96a3; +} +body .ui-button.cyan-btn { + background-color: #00BCD4; +} +body .ui-button.cyan-btn.ui-state-hover { + background-color: #00838F; +} +body .ui-button.cyan-btn.ui-state-focus { + outline: 0 none; + background-color: #08e3ff; +} +body .ui-button.teal-btn { + background-color: #009688; +} +body .ui-button.teal-btn.ui-state-hover { + background-color: #00695C; +} +body .ui-button.teal-btn.ui-state-focus { + outline: 0 none; + background-color: #00c9b6; +} +body .ui-button.red-btn { + background-color: #F44336; +} +body .ui-button.red-btn.ui-state-hover { + background-color: #C62828; +} +body .ui-button.red-btn.ui-state-focus { + outline: 0 none; + background-color: #f77066; +} +body .ui-button.green-btn { + background-color: #29ABE1; +} +body .ui-button.green-btn.ui-state-hover { + background-color: #2341BB; +} +body .ui-button.green-btn.ui-state-focus { + outline: 0 none; + background-color: #A8E1F7; +} +body .ui-button.deep-orange-btn { + background-color: #FF5722; +} +body .ui-button.deep-orange-btn.ui-state-hover { + background-color: #D84315; +} +body .ui-button.deep-orange-btn.ui-state-focus { + outline: 0 none; + background-color: #ff7e55; +} +body .ui-button.purple-btn { + background-color: #673AB7; +} +body .ui-button.purple-btn.ui-state-hover { + background-color: #4527A0; +} +body .ui-button.purple-btn.ui-state-focus { + outline: 0 none; + background-color: #8259cb; +} +body .ui-button.pink-btn { + background-color: #E91E63; +} +body .ui-button.pink-btn.ui-state-hover { + background-color: #AD1457; +} +body .ui-button.pink-btn.ui-state-focus { + outline: 0 none; + background-color: #ee4c83; +} +body .ui-button.amber-btn { + background-color: #FFC107; + color: #212121; +} +body .ui-button.amber-btn.ui-state-hover { + background-color: #FF8F00; +} +body .ui-button.amber-btn.ui-state-focus { + outline: 0 none; + background-color: #ffce3a; +} +body .ui-button.orange-btn { + background-color: #FF9800; +} +body .ui-button.orange-btn.ui-state-hover { + background-color: #EF6C00; +} +body .ui-button.orange-btn.ui-state-focus { + outline: 0 none; + background-color: #ffad33; +} +body .ui-button.brown-btn { + background-color: #795548; +} +body .ui-button.brown-btn.ui-state-hover { + background-color: #4E342E; +} +body .ui-button.brown-btn.ui-state-focus { + outline: 0 none; + background-color: #996b5b; +} +body .ui-button.flat { + box-shadow: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; +} +body .ui-buttonset .ui-state-active { + background-color: #29ABE1; + color: #ffffff; +} +body .ui-splitbutton { + -moz-border-radius: 0px; + -webkit-border-radius: 0px; + border-radius: 0px; + -moz-box-shadow: 0 1px 2.5px 0 rgba(0, 0, 0, 0.26), 0 1px 5px 0 rgba(0, 0, 0, 0.16); + -webkit-box-shadow: 0 1px 2.5px 0 rgba(0, 0, 0, 0.26), 0 1px 5px 0 rgba(0, 0, 0, 0.16); + box-shadow: 0 1px 2.5px 0 rgba(0, 0, 0, 0.26), 0 1px 5px 0 rgba(0, 0, 0, 0.16); +} +body .ui-splitbutton > .ui-button { + box-shadow: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; +} +body .ui-splitbutton > .ui-button.ui-state-active { + background-color: #A8E1F7; +} +body .ui-splitbutton .ui-splitbutton-menubutton { + height: 30px; + -moz-border-radius-topleft: 0; + -webkit-border-top-left-radius: 0; + border-top-left-radius: 0; + -moz-border-radius-bottomleft: 0; + -webkit-border-bottom-left-radius: 0; + border-bottom-left-radius: 0; + -moz-border-radius-topright: 3px; + -webkit-border-top-right-radius: 3px; + border-top-right-radius: 3px; + -moz-border-radius-bottomright: 3px; + -webkit-border-bottom-right-radius: 3px; + border-bottom-right-radius: 3px; +} +body .ui-selectbooleanbutton.ui-state-active { + background-color: #29ABE1; + color: #ffffff; +} +body .ui-selectbooleanbutton.ui-state-active .ui-icon { + color: #ffffff; +} +body .ui-chkbox { + display: inline-block; + vertical-align: middle; + width: 18px; + height: 18px; + cursor: default; + margin: 0 4px 0 0; +} +body .ui-chkbox .ui-chkbox-box { + border: 2px solid #757575; + width: 14px; + height: 14px; + -moz-transition: background-color 0.3s; + -o-transition: background-color 0.3s; + -webkit-transition: background-color 0.3s; + transition: background-color 0.3s; +} +body .ui-chkbox .ui-chkbox-box .ui-chkbox-icon { + font-size: 18px; + margin-left: -2px; + margin-top: -2px; +} +body .ui-chkbox .ui-chkbox-box.ui-state-active { + border-color: #29ABE1; + background-color: #29ABE1; +} +body .ui-chkbox .ui-chkbox-box.ui-state-active .ui-chkbox-icon { + color: #ffffff; +} +body .ui-chkbox .ui-chkbox-box.ui-state-active.ui-state-focus .ui-chkbox-icon { + color: #ffffff; +} +body .ui-chkbox .ui-chkbox-box.ui-state-focus { + border-color: #29ABE1; + box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.14), 0 2px 1px -1px rgba(0, 0, 0, 0.12); + -webkit-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.14), 0 2px 1px -1px rgba(0, 0, 0, 0.12); + -moz-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.14), 0 2px 1px -1px rgba(0, 0, 0, 0.12); + -moz-transition: box-shadow 0.3s; + -o-transition: box-shadow 0.3s; + -webkit-transition: box-shadow 0.3s; + transition: box-shadow 0.3s; +} +body .ui-chkbox .ui-chkbox-box.ui-state-focus .ui-chkbox-icon { + color: #29ABE1; +} +body .ui-radiobutton { + position: relative; + margin: 0 4px 0 0; + display: inline-block; + vertical-align: middle; +} +body .ui-radiobutton .ui-radiobutton-box { + width: 14px -1px; + height: 14px -1px; + border: 2px solid #757575; + -moz-transition: box-shadow 0.3s; + -o-transition: box-shadow 0.3s; + -webkit-transition: box-shadow 0.3s; + transition: box-shadow 0.3s; + -moz-border-radius: 50%; + -webkit-border-radius: 50%; + border-radius: 50%; +} +body .ui-radiobutton .ui-radiobutton-box.ui-state-focus { + box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.14), 0 2px 1px -1px rgba(0, 0, 0, 0.12); + -webkit-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.14), 0 2px 1px -1px rgba(0, 0, 0, 0.12); + -moz-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.14), 0 2px 1px -1px rgba(0, 0, 0, 0.12); +} +body .ui-radiobutton .ui-radiobutton-box.ui-state-active { + border-color: #29ABE1; + background-color: transparent; +} +body .ui-radiobutton .ui-radiobutton-box .ui-radiobutton-icon { + top: 0; + left: 0; + width: 20px; + height: 20px; + display: block; + box-sizing: border-box; + position: absolute; + -moz-border-radius: 50%; + -webkit-border-radius: 50%; + border-radius: 50%; + transition: -webkit-transform ease 0.28s; + transition: transform ease 0.28s; + -webkit-transform: scale(0); + transform: scale(0); +} +body .ui-radiobutton .ui-radiobutton-box .ui-icon-bullet { + background-color: #29ABE1; + -webkit-transform: scale(0.5); + transform: scale(0.5); + margin-left: 0; +} +body .ui-selectmanycheckbox.ui-widget label, body .ui-selectoneradio.ui-widget label { + display: inline-block; + vertical-align: middle; + margin-top: 0; +} +body .ui-autocomplete-panel { + padding: 0; + border: 0 none; + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; +} +body .ui-autocomplete-panel.ui-shadow { + -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24); + -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24); + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24); +} +body .ui-autocomplete-panel .ui-autocomplete-list { + padding: 0; +} +body .ui-autocomplete-panel .ui-autocomplete-list .ui-autocomplete-item { + padding: 6px 10px; + margin: 0; + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; + -moz-transition: background-color 0.3s; + -o-transition: background-color 0.3s; + -webkit-transition: background-color 0.3s; + transition: background-color 0.3s; +} +body .ui-autocomplete-panel .ui-autocomplete-list .ui-autocomplete-item .ui-autocomplete-query { + font-weight: 700; +} +body .ui-autocomplete-panel .ui-autocomplete-list .ui-autocomplete-group { + padding: 6px 10px; +} +body .ui-autocomplete .ui-autocomplete-dropdown { + right: 0; + margin-right: 0; +} +body .ui-autocomplete .ui-autocomplete-dropdown.ui-button.ui-button-icon-only { + background-color: transparent; + box-shadow: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; + height: 20px; + width: 20px; + padding: 0; +} +body .ui-autocomplete .ui-autocomplete-dropdown.ui-button.ui-button-icon-only .ui-button-text { + display: none; +} +body .ui-autocomplete .ui-autocomplete-dropdown.ui-button.ui-button-icon-only .ui-icon { + color: #757575; +} +body .ui-autocomplete.ui-autocomplete-multiple .ui-autocomplete-multiple-container.ui-inputfield { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + padding: 2px 2px 1px 2px; +} +body .ui-autocomplete.ui-autocomplete-multiple .ui-autocomplete-multiple-container.ui-state-focus { + padding-bottom: 0; +} +body .ui-autocomplete.ui-autocomplete-multiple .ui-autocomplete-input-token { + float: none; + display: inline-block; + margin: 0 1px; + vertical-align: middle; +} +body .ui-autocomplete.ui-autocomplete-multiple .ui-autocomplete-input-token > input { + padding: 0; + font-size: 14px; + margin: 0; +} +body .ui-autocomplete.ui-autocomplete-multiple .ui-autocomplete-token { + display: inline-block; + float: none; + vertical-align: middle; +} +body .ui-autocomplete.ui-autocomplete-multiple .ui-autocomplete-token .ui-autocomplete-token-icon { + margin-top: -10px; +} +body .ui-selectonemenu { + border-width: 0; + background: white no-repeat; + background-image: linear-gradient(to bottom, #3F51B5, #3F51B5), linear-gradient(to bottom, #bdbdbd, #bdbdbd); + background-size: 0 2px, 100% 1px; + background-position: 50% 100%, 50% 100%; + transition: background-size 0.3s cubic-bezier(0.64, 0.09, 0.08, 1); + padding-bottom: 2px; + box-sizing: border-box; + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; +} +body .ui-selectonemenu.ui-state-focus { + border-width: 0; + background-size: 100% 2px, 100% 1px; + outline: none; + padding-bottom: 2px; +} +body .ui-selectonemenu .ui-selectonemenu-trigger { + height: 20px; + width: 20px; + font-size: 20px; + margin-top: 0; + padding: 0; + top: 0; + margin-right: 0; +} +body .ui-selectonemenu .ui-selectonemenu-trigger .ui-icon { + height: 20px; + width: 20px; + margin-top: 0; + color: #757575; +} +body .ui-selectonemenu .ui-selectonemenu-label.ui-inputfield { + background: none; + font-family: "Roboto", "Helvetica Neue", sans-serif; +} +body .ui-selectonemenu-panel { + padding: 0; + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; +} +body .ui-selectonemenu-panel .ui-selectonemenu-list { + padding: 0; +} +body .ui-selectonemenu-panel .ui-selectonemenu-item { + margin: 0; + padding: 6px 10px; + -moz-transition: background-color 0.3s; + -o-transition: background-color 0.3s; + -webkit-transition: background-color 0.3s; + transition: background-color 0.3s; + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; +} +body .ui-selectonemenu-panel .ui-selectonemenu-item.ui-state-hover { + background-color: #e8e8e8; + color: #000000; +} +body .ui-selectonemenu-panel .ui-selectonemenu-item-group { + padding: 8px; +} +body .ui-selectonemenu-panel.ui-shadow { + -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24); + -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24); + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24); +} +body .ui-selectonemenu-panel .ui-selectonemenu-filter-container .ui-icon { + top: 5px; + right: 8px; +} +body .ui-selectcheckboxmenu { + border-bottom: 1px solid #bdbdbd; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; +} +body .ui-selectcheckboxmenu .ui-selectcheckboxmenu-label-container { + display: block; +} +body .ui-selectcheckboxmenu .ui-selectcheckboxmenu-label-container .ui-selectcheckboxmenu-label { + padding-top: 2px; + padding-bottom: 1px; + padding-left: 2px; +} +body .ui-selectcheckboxmenu .ui-selectcheckboxmenu-trigger { + height: 20px; + width: 20px; + font-size: 20px; + padding: 0; +} +body .ui-selectcheckboxmenu .ui-selectcheckboxmenu-trigger .ui-icon { + height: 20px; + width: 20px; + margin-top: 0; + color: #757575; +} +body .ui-selectcheckboxmenu-panel { + padding: 0; + border: 0 none; + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; + -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24); + -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24); + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24); +} +body .ui-selectcheckboxmenu-panel .ui-selectcheckboxmenu-header { + padding: 6px 10px; + margin: 0; + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; +} +body .ui-selectcheckboxmenu-panel .ui-selectcheckboxmenu-header .ui-chkbox { + float: none; + margin: 0 8px 0 1px; +} +body .ui-selectcheckboxmenu-panel .ui-selectcheckboxmenu-header .ui-chkbox .ui-chkbox-box { + border-color: #ffffff; +} +body .ui-selectcheckboxmenu-panel .ui-selectcheckboxmenu-header .ui-chkbox .ui-chkbox-box .ui-chkbox-icon { + border-color: #ffffff; +} +body .ui-selectcheckboxmenu-panel .ui-selectcheckboxmenu-header .ui-chkbox .ui-chkbox-box.ui-state-active .ui-chkbox-icon { + border-color: #ffffff; +} +body .ui-selectcheckboxmenu-panel .ui-selectcheckboxmenu-header .ui-chkbox .ui-chkbox-box.ui-state-focus { + background-color: #8AD4F2; + -moz-transition: background-color 0.3s; + -o-transition: background-color 0.3s; + -webkit-transition: background-color 0.3s; + transition: background-color 0.3s; +} +body .ui-selectcheckboxmenu-panel .ui-selectcheckboxmenu-header .ui-selectcheckboxmenu-filter-container { + width: 70%; + display: inline-block; + vertical-align: middle; + float: none; +} +body .ui-selectcheckboxmenu-panel .ui-selectcheckboxmenu-header .ui-selectcheckboxmenu-filter-container .ui-icon { + top: -2px; + right: 0px; + color: #ffffff; +} +body .ui-selectcheckboxmenu-panel .ui-selectcheckboxmenu-header .ui-selectcheckboxmenu-filter-container .ui-inputfield { + border-color: #d9d9d9; + padding-right: 30px; + width: 100%; + border-color: #ffffff; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +body .ui-selectcheckboxmenu-panel .ui-selectcheckboxmenu-header .ui-selectcheckboxmenu-filter-container .ui-inputfield:focus { + border-color: #ffffff; +} +body .ui-selectcheckboxmenu-panel .ui-selectcheckboxmenu-header .ui-selectcheckboxmenu-close { + margin-right: -6px; +} +body .ui-selectcheckboxmenu-panel .ui-selectcheckboxmenu-header .ui-selectcheckboxmenu-close span { + color: #ffffff; + -moz-transition: color 0.3s; + -o-transition: color 0.3s; + -webkit-transition: color 0.3s; + transition: color 0.3s; +} +body .ui-selectcheckboxmenu-panel .ui-selectcheckboxmenu-header .ui-selectcheckboxmenu-close.ui-state-hover { + padding: 1px; +} +body .ui-selectcheckboxmenu-panel .ui-selectcheckboxmenu-header .ui-selectcheckboxmenu-close.ui-state-hover span { + color: #29ABE1; +} +body .ui-selectcheckboxmenu-panel .ui-selectcheckboxmenu-items-wrapper { + padding: 0; +} +body .ui-selectcheckboxmenu-panel .ui-selectcheckboxmenu-items-wrapper .ui-selectcheckboxmenu-items { + padding: 0; +} +body .ui-selectcheckboxmenu-panel .ui-selectcheckboxmenu-item { + padding: 6px 10px; +} +body .ui-selectcheckboxmenu-panel .ui-selectcheckboxmenu-item label { + vertical-align: middle; + display: inline-block; +} +body .ui-selectcheckboxmenu-panel .ui-selectcheckboxmenu-item .ui-chkbox { + margin-left: 2px; +} +body .ui-fluid .ui-selectonemenu .ui-selectonemenu-trigger { + width: 20px; + padding: 0; +} +body #keypad-div { + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; +} +body #keypad-div .keypad-key { + border: 0 none; + background-color: #ffffff; + font-size: 14px; + padding: 4px; + -moz-border-radius: 50%; + -webkit-border-radius: 50%; + border-radius: 50%; + -moz-transition: background-color 0.3s; + -o-transition: background-color 0.3s; + -webkit-transition: background-color 0.3s; + transition: background-color 0.3s; +} +body #keypad-div .keypad-key.ui-state-hover { + background-color: #e8e8e8; + color: #000000; +} +body #keypad-div .keypad-shift, body #keypad-div .keypad-enter, body #keypad-div .keypad-spacebar, body #keypad-div .keypad-back, body #keypad-div .keypad-close, body #keypad-div .keypad-clear { + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; + background-color: #29ABE1; + color: #ffffff; +} +body #keypad-div .keypad-shift.ui-state-hover, body #keypad-div .keypad-enter.ui-state-hover, body #keypad-div .keypad-spacebar.ui-state-hover, body #keypad-div .keypad-back.ui-state-hover, body #keypad-div .keypad-close.ui-state-hover, body #keypad-div .keypad-clear.ui-state-hover { + background-color: #2341BB; + color: #ffffff; +} +body #keypad-div.ui-shadow { + -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24); + -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24); + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24); +} +body .ui-selectmanymenu { + padding: 0; + background-color: #ffffff; + -moz-border-radius: 0px; + -webkit-border-radius: 0px; + border-radius: 0px; +} +body .ui-selectmanymenu .ui-selectlistbox-item { + padding: 6px 10px; + margin: 0; + position: relative; + overflow: hidden; + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; +} +body .ui-selectmanymenu .ui-selectlistbox-item.ui-state-hover { + background-color: #e8e8e8; + color: #000000; +} +body .ui-selectmanymenu .ui-selectlistbox-item .ui-chkbox { + background-color: transparent; + margin: -2px 8px 0 0; +} +body .ui-selectmanymenu .ui-selectlistbox-item .ui-chkbox .ui-chkbox-box.ui-state-active { + border-color: #ffffff; + background-color: #29ABE1; +} +body .ui-selectmanymenu .ui-selectlistbox-filter-container { + margin: 0; + padding: 6px 10px; + background-color: #29ABE1; + -moz-border-radius-topleft: 0px; + -webkit-border-top-left-radius: 0px; + border-top-left-radius: 0px; + -moz-border-radius-topright: 0px; + -webkit-border-top-right-radius: 0px; + border-top-right-radius: 0px; +} +body .ui-selectmanymenu .ui-selectlistbox-filter-container .ui-inputfield { + border-color: #d9d9d9; + color: #ffffff; + width: 100%; + padding-left: 2px; + padding-right: 20px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +body .ui-selectmanymenu .ui-selectlistbox-filter-container .ui-inputfield.ui-state-focus { + border-color: #ffffff; +} +body .ui-selectmanymenu .ui-selectlistbox-filter-container .ui-icon { + color: #ffffff; + top: 6px; + right: 12px; +} +body .ui-selectmanymenu tr.ui-selectlistbox-item td { + padding: 6px; +} +body .ui-spinner .ui-spinner-button { + width: 18px; + height: 10px; + padding: 0; + margin-right: 0; + background-color: transparent; + color: #212121; + z-index: auto; + box-shadow: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; +} +body .ui-spinner .ui-spinner-button .ui-icon-triangle-1-n { + color: #212121; +} +body .ui-spinner .ui-spinner-button .ui-icon-triangle-1-s { + color: #212121; +} +body .ui-spinner .ui-spinner-button .ui-icon { + top: 0px; + height: 12px; + color: #757575; +} +body .ui-spinner .ui-spinner-up .ui-icon { + top: 4px; +} +body .ui-spinner .ui-spinner-down .ui-icon { + top: 2px; +} +body .ui-spinner .ui-spinner-input { + padding-right: 30px; +} +body .ui-fluid .ui-spinner .ui-spinner-button { + width: 25px; + height: 10px; +} +body .ui-fluid .ui-spinner .ui-spinner-input { + padding-right: 30px; +} +body .ui-inputswitch { + height: 14px; + width: 34px !important; + overflow: visible; + background-color: #9e9e9e; + border-color: #9e9e9e; + padding: 0; + -moz-border-radius: 8px; + -webkit-border-radius: 8px; + border-radius: 8px; +} +body .ui-inputswitch .ui-inputswitch-handle { + top: -3px; + background-color: #ffffff; + -moz-border-radius: 50%; + -webkit-border-radius: 50%; + border-radius: 50%; + -moz-transition: background-color 0.3s; + -o-transition: background-color 0.3s; + -webkit-transition: background-color 0.3s; + transition: background-color 0.3s; + width: 20px !important; + height: 20px !important; + -webkit-box-shadow: rgba(0, 0, 0, 0.2) 0px 1px 3px 0px, rgba(0, 0, 0, 0.137255) 0px 1px 1px 0px, rgba(0, 0, 0, 0.117647) 0px 2px 1px -1px; + -moz-box-shadow: rgba(0, 0, 0, 0.2) 0px 1px 3px 0px, rgba(0, 0, 0, 0.137255) 0px 1px 1px 0px, rgba(0, 0, 0, 0.117647) 0px 2px 1px -1px; + box-shadow: rgba(0, 0, 0, 0.2) 0px 1px 3px 0px, rgba(0, 0, 0, 0.137255) 0px 1px 1px 0px, rgba(0, 0, 0, 0.117647) 0px 2px 1px -1px; +} +body .ui-inputswitch .ui-inputswitch-on { + visibility: hidden; +} +body .ui-inputswitch .ui-inputswitch-off span, body .ui-inputswitch .ui-inputswitch-on span { + visibility: hidden; +} +body .ui-inputswitch.ui-inputswitch-checked { + background-color: #8AD4F2; + border-color: #8AD4F2; +} +body .ui-inputswitch.ui-inputswitch-checked .ui-inputswitch-handle { + background-color: #29ABE1; + color: #ffffff; +} +body .ui-slider { + padding: 0; +} +body .ui-slider .ui-slider-handle { + background-color: #29ABE1; + color: #ffffff; + -moz-border-radius: 50%; + -webkit-border-radius: 50%; + border-radius: 50%; + width: 20px; + height: 20px; + transform: scale(0.7); + -moz-transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); + -o-transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); + -webkit-transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); + transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); +} +body .ui-slider .ui-slider-handle.ui-state-hover, body .ui-slider .ui-slider-handle.ui-state-focus { + transform: scale(1); +} +body .ui-slider .ui-slider-handle:focus { + outline: 0 none; +} +body .ui-slider.ui-slider-horizontal { + height: 2px; + border: 0 none; + background-color: #bdbdbd; +} +body .ui-slider.ui-slider-horizontal .ui-slider-handle { + top: -0.65em; +} +body .ui-slider.ui-slider-vertical { + width: 2px; + border: 0 none; + background-color: #bdbdbd; +} +body .ui-slider.ui-slider-vertical .ui-slider-handle { + left: -9px; +} +body .ui-slider .ui-slider-range { + padding: 0; + background-color: #29ABE1; + color: #ffffff; +} +body .ui-calendar .ui-datepicker-trigger { + top: 7px; + right: 28px; + background-color: transparent; + color: #212121; + height: 20px; + width: 20px; + box-shadow: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; +} +body .ui-calendar .ui-datepicker-trigger .ui-icon { + color: #757575; +} +body .ui-datepicker { + padding: 0; + width: 275px; +} +body .ui-datepicker.ui-shadow { + -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24); + -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24); + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24); +} +body .ui-datepicker .ui-datepicker-header { + padding: 8px 14px; + background: #2341BB; + border-color: #2341BB; + -moz-border-radius-topleft: 2px; + -webkit-border-top-left-radius: 2px; + border-top-left-radius: 2px; + -moz-border-radius-topright: 2px; + -webkit-border-top-right-radius: 2px; + border-top-right-radius: 2px; + -moz-border-radius-bottomleft: 0; + -webkit-border-bottom-left-radius: 0; + border-bottom-left-radius: 0; + -moz-border-radius-bottomright: 0; + -webkit-border-bottom-right-radius: 0; + border-bottom-right-radius: 0; +} +body .ui-datepicker .ui-datepicker-header .ui-datepicker-next { + cursor: pointer; + top: 8px; + font-size: 20px; + right: 8px; + color: #ffffff; + font-family: "Material Icons"; + font-weight: normal; + font-style: normal; + font-size: 24px; + /* Preferred icon size */ + display: inline-block; + width: 1em; + height: 1em; + line-height: 1; + text-transform: none; + letter-spacing: normal; + word-wrap: normal; + white-space: nowrap; + direction: ltr; + /* Support for all WebKit browsers. */ + -webkit-font-smoothing: antialiased; + /* Support for Safari and Chrome. */ + text-rendering: optimizeLegibility; + /* Support for Firefox. */ + -moz-osx-font-smoothing: grayscale; + /* Support for IE. */ + font-feature-settings: "liga"; +} +body .ui-datepicker .ui-datepicker-header .ui-datepicker-next:before { + content: "ī€¹"; +} +body .ui-datepicker .ui-datepicker-header .ui-datepicker-next .ui-icon { + display: none; +} +body .ui-datepicker .ui-datepicker-header .ui-datepicker-next.ui-datepicker-next-hover { + right: 8px; +} +body .ui-datepicker .ui-datepicker-header .ui-datepicker-prev { + cursor: pointer; + top: 8px; + font-size: 20px; + font-family: "Material Icons"; + font-weight: normal; + font-style: normal; + font-size: 24px; + /* Preferred icon size */ + display: inline-block; + width: 1em; + height: 1em; + line-height: 1; + text-transform: none; + letter-spacing: normal; + word-wrap: normal; + white-space: nowrap; + direction: ltr; + /* Support for all WebKit browsers. */ + -webkit-font-smoothing: antialiased; + /* Support for Safari and Chrome. */ + text-rendering: optimizeLegibility; + /* Support for Firefox. */ + -moz-osx-font-smoothing: grayscale; + /* Support for IE. */ + font-feature-settings: "liga"; + -webkit-transform: rotate(180deg); + -moz-transform: rotate(180deg); + -o-transform: rotate(180deg); + -ms-transform: rotate(180deg); + transform: rotate(180deg); + left: 8px; + color: #ffffff; +} +body .ui-datepicker .ui-datepicker-header .ui-datepicker-prev:before { + content: "ī€¹"; +} +body .ui-datepicker .ui-datepicker-header .ui-datepicker-prev .ui-icon { + display: none; +} +body .ui-datepicker .ui-datepicker-header .ui-datepicker-prev.ui-datepicker-prev-hover { + left: 8px; +} +body .ui-datepicker table { + table-layout: fixed; + border-spacing: 0; + border-collapse: collapse; +} +body .ui-datepicker thead tr { + color: #ffffff; + background: #29ABE1; +} +body .ui-datepicker tbody td { + padding: 2px; + box-sizing: border-box; +} +body .ui-datepicker tbody td a, body .ui-datepicker tbody td span { + padding: 0.2em; + margin: 0; + text-align: center; + color: #212121; + display: inline-block; + height: 28px; + width: 28px; + line-height: 28px; + -moz-border-radius: 50%; + -webkit-border-radius: 50%; + border-radius: 50%; +} +body .ui-datepicker tbody td a.ui-state-hover, body .ui-datepicker tbody td span.ui-state-hover { + background-color: #e8e8e8; + color: #000000; +} +body .ui-datepicker tbody td a.ui-state-active, body .ui-datepicker tbody td span.ui-state-active { + color: #ffffff; + background-color: #29ABE1; + color: #ffffff; +} +body .ui-datepicker tbody td.ui-datepicker-today a, body .ui-datepicker tbody td.ui-datepicker-today span { + color: #212121; + background-color: #ffffff; + border: 1px solid #29ABE1; +} +body .ui-datepicker tbody td.ui-datepicker-today a.ui-state-active, body .ui-datepicker tbody td.ui-datepicker-today span.ui-state-active { + color: #ffffff; + background-color: #29ABE1; + color: #ffffff; +} +body .ui-datepicker.ui-datepicker-multi .ui-datepicker-header { + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; +} +body .ui-datepicker.ui-datepicker-multi .ui-datepicker-group table { + width: 100%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +body .ui-datepicker .ui-timepicker-div .ui_tpicker_time input { + border-color: #bdbdbd; + -moz-transition: border-color 0.3s; + -o-transition: border-color 0.3s; + -webkit-transition: border-color 0.3s; + transition: border-color 0.3s; + width: 100%; + position: relative; + top: 5px; + left: -5px; +} +body .ui-datepicker .ui-timepicker-div .ui_tpicker_time input.ui-state-focus { + border-width: 0 0 2px 0; + border-color: #29ABE1; + padding-bottom: 0px; +} +body .ui-datepicker .ui-timepicker-div dl { + margin: -16px 0 40px 0; +} +body .ui-datepicker .ui-timepicker-div dl dt { + padding: 6px 10px; +} +body .ui-datepicker .ui-timepicker-div dl dd { + margin-top: 42px; +} +body .ui-fluid .ui-calendar .ui-datepicker-trigger.ui-button { + top: -4px; + width: 24px; +} +body .ui-rating .ui-rating-cancel { + text-indent: 0; +} +body .ui-rating .ui-rating-cancel a { + color: #757575; + background: none; + font-family: "Material Icons"; + font-weight: normal; + font-style: normal; + font-size: 24px; + /* Preferred icon size */ + display: inline-block; + width: 1em; + height: 1em; + line-height: 1; + text-transform: none; + letter-spacing: normal; + word-wrap: normal; + white-space: nowrap; + direction: ltr; + /* Support for all WebKit browsers. */ + -webkit-font-smoothing: antialiased; + /* Support for Safari and Chrome. */ + text-rendering: optimizeLegibility; + /* Support for Firefox. */ + -moz-osx-font-smoothing: grayscale; + /* Support for IE. */ + font-feature-settings: "liga"; + font-size: 20px; +} +body .ui-rating .ui-rating-cancel a:before { + content: "ī—‰"; +} +body .ui-rating .ui-rating-star { + text-indent: 0; +} +body .ui-rating .ui-rating-star a { + font-size: 20px; + color: #757575; + background: none; + font-family: "Material Icons"; + font-weight: normal; + font-style: normal; + font-size: 24px; + /* Preferred icon size */ + display: inline-block; + width: 1em; + height: 1em; + line-height: 1; + text-transform: none; + letter-spacing: normal; + word-wrap: normal; + white-space: nowrap; + direction: ltr; + /* Support for all WebKit browsers. */ + -webkit-font-smoothing: antialiased; + /* Support for Safari and Chrome. */ + text-rendering: optimizeLegibility; + /* Support for Firefox. */ + -moz-osx-font-smoothing: grayscale; + /* Support for IE. */ + font-feature-settings: "liga"; + font-size: 20px; +} +body .ui-rating .ui-rating-star a:before { + content: "ī ŗ"; +} +body .ui-rating .ui-rating-star.ui-rating-star-on a { + color: #29ABE1; + font-family: "Material Icons"; + font-weight: normal; + font-style: normal; + font-size: 24px; + /* Preferred icon size */ + display: inline-block; + width: 1em; + height: 1em; + line-height: 1; + text-transform: none; + letter-spacing: normal; + word-wrap: normal; + white-space: nowrap; + direction: ltr; + /* Support for all WebKit browsers. */ + -webkit-font-smoothing: antialiased; + /* Support for Safari and Chrome. */ + text-rendering: optimizeLegibility; + /* Support for Firefox. */ + -moz-osx-font-smoothing: grayscale; + /* Support for IE. */ + font-feature-settings: "liga"; + font-size: 20px; +} +body .ui-rating .ui-rating-star.ui-rating-star-on a:before { + content: "ī ø"; +} +body .ui-password-panel.ui-shadow { + -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24); + -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24); + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24); +} +body .ui-fileupload .ui-fileupload-buttonbar { + padding: 8px 14px; +} +body .ui-fileupload .ui-fileupload-buttonbar .ui-icon-arrowreturnthick-1-n:before { + content: "file_upload"; +} +body .ui-fileupload .ui-fileupload-buttonbar .ui-button { + background-color: #29ABE1; + color: #ffffff; + margin-right: 6px; +} +body .ui-fileupload .ui-fileupload-buttonbar .ui-button .ui-icon { + color: #ffffff; +} +body .ui-fileupload .ui-fileupload-buttonbar .ui-button.ui-state-hover { + background-color: #2341BB; +} +body .ui-fileupload .ui-fileupload-content .ui-messages-error .ui-icon { + color: #ffffff; +} +body .ui-editor.ui-widget-content { + padding: 0px; +} +body .ui-inputgroup { + height: 100%; +} +body .ui-inputgroup .ui-inputgroup-addon, +body .ui-inputgroup .ui-inputgroup-addon-checkbox { + padding: 2px 2px 1px 2px; + border-color: #bdbdbd; + background-color: transparent; + color: #757575; + min-width: 28px; + border-left: 0; + border-right: 0; + border-top: 0; +} +body .ui-inputgroup .ui-inputgroup-addon:first-child, +body .ui-inputgroup .ui-inputgroup-addon-checkbox:first-child { + -moz-border-radius-topleft: 0; + -webkit-border-top-left-radius: 0; + border-top-left-radius: 0; + -moz-border-radius-bottomleft: 0; + -webkit-border-bottom-left-radius: 0; + border-bottom-left-radius: 0; +} +body .ui-inputgroup .ui-inputgroup-addon:last-child, +body .ui-inputgroup .ui-inputgroup-addon-checkbox:last-child { + -moz-border-radius-topright: 0px; + -webkit-border-top-right-radius: 0px; + border-top-right-radius: 0px; + -moz-border-radius-bottomright: 0px; + -webkit-border-bottom-right-radius: 0px; + border-bottom-right-radius: 0px; +} +body .ui-inputgroup .ui-inputgroup-addon { + align-self: flex-end; +} +body .ui-inputgroup .ui-inputgroup-addon > i { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + align-self: flex-end; + font-size: 1.5em; +} +body .ui-inputgroup .ui-inputtext { + align-self: flex-end; +} +body .ui-inputgroup .md-inputfield { + -webkit-box-flex: 1; + -ms-flex: 1 1 auto; + flex: 1 1 auto; + width: 1%; + display: inherit; +} +body .ui-inputgroup .md-inputfield label { + top: 5px; +} +body .ui-inputgroup .ui-button .ui-button-text { + padding: 0; +} +body .ui-inputgroup .ui-inputgroup-addon-checkbox { + padding: 0; + position: relative; +} +body .ui-inputgroup .ui-inputgroup-addon-checkbox .ui-chkbox { + vertical-align: baseline; + position: absolute; + top: 50%; + left: 50%; + margin-top: -9px; + margin-left: -9px; +} +body .ui-fluid .ui-inputgroup .ui-button.ui-button-icon-only { + width: 1.643em; + height: 1.643em; + min-width: 0; + padding: 0; +} +body .ui-fluid .ui-inputgroup .ui-button.ui-button-icon-only .ui-button-icon-left { + margin-left: -0.45em; +} + +body .ui-paginator { + padding: 6px 10px; + background-color: #2341BB; +} +body .ui-paginator > a { + margin-top: -1px; + box-sizing: border-box; + color: #ffffff; +} +body .ui-paginator > a span { + display: none; +} +body .ui-paginator > a.ui-state-hover { + background-color: #8AD4F2; + -moz-border-radius: 50%; + -webkit-border-radius: 50%; + border-radius: 50%; + -moz-transition: background-color 0.3s; + -o-transition: background-color 0.3s; + -webkit-transition: background-color 0.3s; + transition: background-color 0.3s; +} +body .ui-paginator .ui-paginator-next { + padding: 0 6px; + vertical-align: middle; + font-family: "Material Icons"; + font-weight: normal; + font-style: normal; + font-size: 24px; + /* Preferred icon size */ + display: inline-block; + width: 1em; + height: 1em; + line-height: 1; + text-transform: none; + letter-spacing: normal; + word-wrap: normal; + white-space: nowrap; + direction: ltr; + /* Support for all WebKit browsers. */ + -webkit-font-smoothing: antialiased; + /* Support for Safari and Chrome. */ + text-rendering: optimizeLegibility; + /* Support for Firefox. */ + -moz-osx-font-smoothing: grayscale; + /* Support for IE. */ + font-feature-settings: "liga"; +} +body .ui-paginator .ui-paginator-next:before { + content: "ī‰"; +} +body .ui-paginator .ui-paginator-next:before { + position: relative; + left: -6px; +} +body .ui-paginator .ui-paginator-last { + padding: 0 6px; + vertical-align: middle; + font-family: "Material Icons"; + font-weight: normal; + font-style: normal; + font-size: 24px; + /* Preferred icon size */ + display: inline-block; + width: 1em; + height: 1em; + line-height: 1; + text-transform: none; + letter-spacing: normal; + word-wrap: normal; + white-space: nowrap; + direction: ltr; + /* Support for all WebKit browsers. */ + -webkit-font-smoothing: antialiased; + /* Support for Safari and Chrome. */ + text-rendering: optimizeLegibility; + /* Support for Firefox. */ + -moz-osx-font-smoothing: grayscale; + /* Support for IE. */ + font-feature-settings: "liga"; +} +body .ui-paginator .ui-paginator-last:before { + content: "ī—"; +} +body .ui-paginator .ui-paginator-last:before { + position: relative; + left: -6px; +} +body .ui-paginator .ui-paginator-prev { + padding: 0 6px; + vertical-align: middle; + font-family: "Material Icons"; + font-weight: normal; + font-style: normal; + font-size: 24px; + /* Preferred icon size */ + display: inline-block; + width: 1em; + height: 1em; + line-height: 1; + text-transform: none; + letter-spacing: normal; + word-wrap: normal; + white-space: nowrap; + direction: ltr; + /* Support for all WebKit browsers. */ + -webkit-font-smoothing: antialiased; + /* Support for Safari and Chrome. */ + text-rendering: optimizeLegibility; + /* Support for Firefox. */ + -moz-osx-font-smoothing: grayscale; + /* Support for IE. */ + font-feature-settings: "liga"; +} +body .ui-paginator .ui-paginator-prev:before { + content: "īˆ"; +} +body .ui-paginator .ui-paginator-prev:before { + position: relative; + left: -5px; +} +body .ui-paginator .ui-paginator-first { + padding: 0 6px; + vertical-align: middle; + font-family: "Material Icons"; + font-weight: normal; + font-style: normal; + font-size: 24px; + /* Preferred icon size */ + display: inline-block; + width: 1em; + height: 1em; + line-height: 1; + text-transform: none; + letter-spacing: normal; + word-wrap: normal; + white-space: nowrap; + direction: ltr; + /* Support for all WebKit browsers. */ + -webkit-font-smoothing: antialiased; + /* Support for Safari and Chrome. */ + text-rendering: optimizeLegibility; + /* Support for Firefox. */ + -moz-osx-font-smoothing: grayscale; + /* Support for IE. */ + font-feature-settings: "liga"; +} +body .ui-paginator .ui-paginator-first:before { + content: "ī—œ"; +} +body .ui-paginator .ui-paginator-first:before { + position: relative; + left: -5px; +} +body .ui-paginator .ui-paginator-pages { + vertical-align: middle; + margin: 0 6px 0 12px; + padding: 0; +} +body .ui-paginator .ui-paginator-pages a { + color: #ffffff; + padding: 0; + width: 24px; + height: 24px; + line-height: 24px; + -moz-border-radius: 50%; + -webkit-border-radius: 50%; + border-radius: 50%; + -moz-transition: background-color 0.3s; + -o-transition: background-color 0.3s; + -webkit-transition: background-color 0.3s; + transition: background-color 0.3s; +} +body .ui-paginator .ui-paginator-pages a.ui-state-active { + color: #ffffff; +} +body .ui-paginator .ui-paginator-pages a.ui-state-hover { + background-color: #8AD4F2; +} +body .ui-datagrid .ui-datagrid-header { + padding: 8px 14px; +} +body .ui-datagrid .ui-panel .ui-panel-titlebar { + background-color: #ffffff; + color: #212121; + border-color: #dbdbdb; +} +body .ui-datalist .ui-datalist-header { + padding: 8px 14px; +} +body .ui-datatable .ui-datatable-header, +body .ui-datatable .ui-datatable-footer { + padding: 8px 14px; +} +body .ui-datatable .ui-datatable-header .ui-inputfield, +body .ui-datatable .ui-datatable-footer .ui-inputfield { + color: #ffffff; +} +body .ui-datatable .ui-datatable-header .ui-inputfield:focus, +body .ui-datatable .ui-datatable-footer .ui-inputfield:focus { + border-color: #ffffff; +} +body .ui-datatable .ui-paginator { + padding: 6px 10px; +} +body .ui-datatable thead th { + padding: 6px 10px; + border: 0 none; + border-top: 1px solid #d8d8d8; + background-color: #ffffff; +} +body .ui-datatable thead th:first-child { + border-left: 1px solid #d8d8d8; +} +body .ui-datatable thead th:last-child { + border-right: 1px solid #d8d8d8; +} +body .ui-datatable thead th.ui-state-hover { + background-color: #e8e8e8; + color: #000000; +} +body .ui-datatable thead th .ui-sortable-column-icon { + vertical-align: middle; + margin: -4px 0 0 0; + color: #757575; +} +body .ui-datatable thead th .ui-sortable-column-icon.ui-icon-carat-2-n-s { + margin-left: 4px; +} +body .ui-datatable thead th .ui-column-resizer { + font-family: "Material Icons"; + font-weight: normal; + font-style: normal; + font-size: 24px; + /* Preferred icon size */ + display: inline-block; + width: 1em; + height: 1em; + line-height: 1; + text-transform: none; + letter-spacing: normal; + word-wrap: normal; + white-space: nowrap; + direction: ltr; + /* Support for all WebKit browsers. */ + -webkit-font-smoothing: antialiased; + /* Support for Safari and Chrome. */ + text-rendering: optimizeLegibility; + /* Support for Firefox. */ + -moz-osx-font-smoothing: grayscale; + /* Support for IE. */ + font-feature-settings: "liga"; + font-size: 16px; + color: #757575; +} +body .ui-datatable thead th .ui-column-resizer:before { + content: "ī”Æ"; +} +body .ui-datatable thead th.ui-state-active, body .ui-datatable thead th.ui-state-highlight { + background-color: #29ABE1; + color: #ffffff; + border-top-color: #29ABE1; +} +body .ui-datatable thead th.ui-state-active .ui-icon, body .ui-datatable thead th.ui-state-highlight .ui-icon { + color: #ffffff; +} +body .ui-datatable thead th.ui-state-active .ui-inputfield, body .ui-datatable thead th.ui-state-highlight .ui-inputfield { + color: #ffffff; +} +body .ui-datatable thead th.ui-state-active .ui-inputfield.ui-state-focus, body .ui-datatable thead th.ui-state-highlight .ui-inputfield.ui-state-focus { + border-color: #ffffff; +} +body .ui-datatable thead tr th { + border: 1px solid #d8d8d8; +} +body .ui-datatable tfoot td { + padding: 6px 10px; + border: 1px solid #d8d8d8; + background-color: #ffffff; +} +body .ui-datatable tbody tr.ui-datatable-even { + background-color: #f4f4f4; +} +body .ui-datatable tbody tr.ui-datatable-even.ui-state-hover { + background-color: #e8e8e8; + color: #000000; +} +body .ui-datatable tbody tr.ui-datatable-even.ui-state-highlight { + background-color: #29ABE1; + color: #ffffff; +} +body .ui-datatable tbody tr td { + border: 1px solid #d8d8d8; + padding: 6px 10px; +} +body .ui-datatable tbody tr td .ui-row-toggler { + display: inherit; +} +body .ui-datatable tbody tr td.ui-state-highlight .ui-inputfield { + color: #ffffff; + border-color: #ffffff; +} +body .ui-datatable tbody tr td.ui-state-highlight .ui-inputfield:focus { + border-color: #ffffff; +} +body .ui-datatable tbody tr td.ui-state-error { + background-color: #e62a10; + border-color: #e62a10; + color: #ffffff; +} +body .ui-datatable tbody tr.ui-widget-content { + border: 0 none; +} +body .ui-datatable tbody tr.ui-state-highlightĀ  { + background-color: #29ABE1; + color: #ffffff; +} +body .ui-datatable tbody tr .ui-cell-editor-input input { + color: #ffffff; +} +body .ui-datatable tbody tr.ui-state-hover { + background-color: #e8e8e8; + color: #000000; +} +body .ui-datatable tbody tr.ui-state-error { + background-color: #e62a10; + border-color: #e62a10; + color: #ffffff; +} +body .ui-datatable tbody tr.ui-state-error .ui-inputfield, +body .ui-datatable tbody tr.ui-state-error .ui-inputfield.ui-state-error { + border-color: #ffffff; +} +body .ui-datatable tbody tr.ui-state-highlight td { + border-right-color: #2341BB; +} +body .ui-datatable tbody tr.ui-state-highlight td:last-child { + border-right-color: #d8d8d8; +} +body .ui-datatable tbody tr.ui-state-highlight td.ui-selection-column .ui-radiobutton-box { + border-color: #ffffff; + background-color: transparent; +} +body .ui-datatable tbody tr.ui-state-highlight td.ui-selection-column .ui-radiobutton-box .ui-radiobutton-icon { + background-color: #ffffff; +} +body .ui-datatable tbody tr.ui-state-highlight td.ui-selection-column .ui-chkbox-box { + border-color: #ffffff; + background-color: transparent; +} +body .ui-datatable tbody tr.ui-state-highlight td.ui-selection-column .ui-chkbox-box .ui-chkbox-icon { + color: #ffffff; + margin-left: -3px; +} +body .ui-datatable tbody tr.ui-state-highlight .ui-inputfield { + color: #ffffff; + border-color: #ffffff; +} +body .ui-datatable tbody tr.ui-state-highlight .ui-inputfield:focus { + border-color: #ffffff; +} +body .ui-datatable > .ui-icon-arrowthick-1-s { + font-size: 18px; + color: #29ABE1; +} +body .ui-datatable > .ui-icon-arrowthick-1-n { + display: none !important; +} +body .ui-datatable.ui-datatable-scrollable .ui-datatable-scrollable-header, body .ui-datatable.ui-datatable-scrollable .ui-datatable-scrollable-footer { + border: 0 none; + background-color: transparent; + padding: 0px; +} +body .ui-datatable.ui-datatable-scrollable .ui-datatable-scrollable-header .ui-datatable-data tr.ui-widget-content, body .ui-datatable.ui-datatable-scrollable .ui-datatable-scrollable-footer .ui-datatable-data tr.ui-widget-content { + padding: 0px; +} +body .ui-datatable.ui-datatable-scrollable .ui-datatable-scrollable-header .ui-datatable-data td, body .ui-datatable.ui-datatable-scrollable .ui-datatable-scrollable-footer .ui-datatable-data td { + color: #212121; +} +body .ui-datatable.ui-datatable-scrollable thead tr th { + color: #212121; + font-size: 14px; +} +body .ui-datatable.ui-datatable-scrollable tfoot tr td { + color: #212121; + font-size: 14px; +} +body .ui-draggable-dragging.ui-state-default { + background-color: #29ABE1; +} +body .ui-picklist .ui-picklist-list { + padding: 0; +} +body .ui-picklist .ui-picklist-caption { + padding: 8px 14px; +} +body .ui-picklist li.ui-picklist-item { + padding: 6px 10px; + margin: 0; + -moz-border-radius: 0px; + -webkit-border-radius: 0px; + border-radius: 0px; +} +body .ui-picklist li.ui-picklist-item.ui-state-hover { + background-color: #e8e8e8; + color: #000000; +} +body .ui-picklist .ui-picklist-buttons { + width: 48px; +} +body .ui-picklist .ui-picklist-buttons .ui-button.ui-button-icon-only { + width: 32px; + margin-right: 0; + display: inline-block; + margin-bottom: 4px; +} +body .ui-picklist .ui-picklist-buttons-cell { + text-align: center; +} +body .ui-picklist .ui-picklist-filter-container { + margin-bottom: 4px; +} +body .ui-picklist .ui-picklist-filter-container .ui-picklist-filter { + width: 100%; +} +body .ui-picklist .ui-picklist-filter-container .ui-icon { + color: #757575; + top: 0px; +} +body .ui-picklist.ui-picklist-responsive .ui-picklist-buttons { + width: 48px; +} +body .ui-picklist.ui-picklist-responsive .ui-picklist-buttons .ui-button.ui-button-icon-only { + margin: 0 auto; + display: block; + margin-bottom: 8px; +} +body .ui-picklist.ui-picklist-responsive .ui-picklist-list .ui-picklist-item .ui-chkbox { + margin-right: 8px; + vertical-align: top; +} +body .ui-picklist.ui-picklist-responsive .ui-picklist-list .ui-picklist-item .ui-chkbox, body .ui-picklist.ui-picklist-responsive .ui-picklist-list .ui-picklist-item .ui-chkbox * { + box-sizing: content-box; +} +body .ui-picklist.ui-picklist-responsive .ui-chkbox-box { + width: 14px; + height: 14px; +} +body .ui-orderlist .ui-orderlist-caption { + padding: 8px 14px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +body .ui-orderlist .ui-orderlist-list { + padding: 0; + box-sizing: border-box; +} +body .ui-orderlist .ui-orderlist-list li.ui-orderlist-item { + padding: 6px 10px; + margin: 0; + -moz-border-radius: 0px; + -webkit-border-radius: 0px; + border-radius: 0px; +} +body .ui-orderlist .ui-orderlist-list li.ui-orderlist-item.ui-state-hover { + background-color: #e8e8e8; + color: #000000; +} +body .ui-orderlist .ui-orderlist-controls { + width: 60px; + text-align: center; +} +body .ui-orderlist .ui-orderlist-controls .ui-button.ui-button-icon-only { + width: 32px; + margin: 0 0 8px 0; + display: inline-block; +} +body .ui-carousel { + padding: 0; + border: 0 none; +} +body .ui-carousel .ui-carousel-header { + margin: 0; +} +body .ui-carousel .ui-carousel-header .ui-icon { + color: #ffffff; +} +body .ui-carousel .ui-carousel-header .ui-carousel-dropdown, +body .ui-carousel .ui-carousel-header .ui-carousel-mobile-dropdown { + margin: 5px 10px; +} +body .ui-carousel .ui-carousel-footer { + margin: 0; + padding: 8px 14px-2px; + font-size: 12px; +} +body .ui-carousel .ui-carousel-page-links { + margin-top: 2px; +} +body .ui-tree { + padding: 4px 7px; +} +body .ui-tree .ui-treenode-children { + padding-left: 28px; +} +body .ui-tree .ui-treenode-leaf-icon { + width: 23px; +} +body .ui-tree .ui-tree-container { + overflow: visible; +} +body .ui-tree .ui-treenode-content .ui-chkbox { + margin: 0 4px 0 4px; +} +body .ui-tree .ui-treenode-content .ui-chkbox .ui-icon { + color: #757575; +} +body .ui-tree .ui-treenode-content .ui-tree-toggler { + vertical-align: middle; +} +body .ui-tree .ui-treenode-content .ui-treenode-icon { + vertical-align: middle; + margin: 0 4px 0 4px; +} +body .ui-tree .ui-treenode-content .ui-treenode-label { + padding: 0 4px; + margin: 0; + vertical-align: middle; +} +body .ui-tree .ui-tree-droppoint.ui-state-hover { + background-color: #29ABE1; +} +body .ui-tree.ui-tree-horizontal { + padding-left: 0; + padding-right: 0; +} +body .ui-tree.ui-tree-horizontal .ui-treenode-content { + background-color: #ffffff; + border: 1px solid #d8d8d8; +} +body .ui-tree.ui-tree-horizontal .ui-treenode-content .ui-tree-toggler { + vertical-align: middle; +} +body .ui-tree.ui-tree-horizontal .ui-treenode-content .ui-treenode-icon { + vertical-align: middle; + margin-right: 4px; +} +body .ui-tree.ui-tree-horizontal .ui-treenode-content.ui-state-highlight { + background-color: #29ABE1; + color: #ffffff; +} +body .ui-tree.ui-tree-horizontal .ui-treenode-content.ui-state-highlight .ui-chkbox-box { + border-color: #ffffff; +} +body .ui-tree.ui-tree-horizontal .ui-treenode-content.ui-state-highlight .ui-chkbox-box .ui-chkbox-icon { + color: #ffffff; +} +body .ui-tree-draghelper { + border: 1px solid #29ABE1; +} +body .fc .fc-button-group .ui-icon { + margin-top: 3px; +} +body .fc .fc-button-group .ui-state-active { + background-color: #29ABE1; + color: #ffffff; +} +body .fc .fc-event { + background-color: #8AD4F2; + color: #ffffff; +} +body .fc table { + box-sizing: border-box; +} +body .fc div.ui-widget-content { + padding-left: 0px; + padding-right: 0px; +} +body .ui-treetable .ui-treetable-header, +body .ui-treetable .ui-treetable-footer { + padding: 8px 14px; +} +body .ui-treetable thead th { + background-color: #ffffff; + padding: 6px 10px; + border: 0 none; + border-top: 1px solid #d8d8d8; +} +body .ui-treetable thead th .ui-icon { + color: #757575; +} +body .ui-treetable thead th:first-child { + border-left: 1px solid #d8d8d8; +} +body .ui-treetable thead th:last-child { + border-right: 1px solid #d8d8d8; +} +body .ui-treetable thead th.ui-state-hover { + background-color: #e8e8e8; + color: #000000; +} +body .ui-treetable thead th .ui-sortable-column-icon { + vertical-align: middle; + margin: -4px 0 0 0; + color: #757575; +} +body .ui-treetable thead th .ui-sortable-column-icon.ui-icon-carat-2-n-s { + margin-left: 4px; +} +body .ui-treetable thead th.ui-state-active { + background-color: #29ABE1; + color: #ffffff; +} +body .ui-treetable thead th.ui-state-active .ui-icon { + color: #ffffff; +} +body .ui-treetable thead th .ui-column-resizer { + font-family: "Material Icons"; + font-weight: normal; + font-style: normal; + font-size: 24px; + /* Preferred icon size */ + display: inline-block; + width: 1em; + height: 1em; + line-height: 1; + text-transform: none; + letter-spacing: normal; + word-wrap: normal; + white-space: nowrap; + direction: ltr; + /* Support for all WebKit browsers. */ + -webkit-font-smoothing: antialiased; + /* Support for Safari and Chrome. */ + text-rendering: optimizeLegibility; + /* Support for Firefox. */ + -moz-osx-font-smoothing: grayscale; + /* Support for IE. */ + font-feature-settings: "liga"; + font-size: 16px; + color: #757575; +} +body .ui-treetable thead th .ui-column-resizer:before { + content: "ī”Æ"; +} +body .ui-treetable tr th { + border: 1px solid #d8d8d8; +} +body .ui-treetable tfoot td { + border: 0 none; + padding: 10px 14px; +} +body .ui-treetable tbody tr td { + border: 1px solid #d8d8d8; + padding: 6px 10px; +} +body .ui-treetable tbody tr td .ui-treetable-toggler { + display: inline-block; + vertical-align: middle; + margin: 0 4px; + float: none; +} +body .ui-treetable tbody tr td .ui-chkbox { + margin-right: 8px; +} +body .ui-treetable tbody tr td .ui-chkbox .ui-chkbox-icon { + color: #757575; +} +body .ui-treetable tbody tr.ui-state-hover { + background-color: #e8e8e8; + color: #000000; +} +body .ui-treetable tbody tr.ui-state-highlight .ui-chkbox .ui-chkbox-box { + border-color: #ffffff; +} +body .ui-treetable tbody tr.ui-state-highlight .ui-chkbox .ui-chkbox-box .ui-icon { + color: #ffffff; +} +body .ui-treetable.ui-treetable-scrollable .ui-treetable-scrollable-header, body .ui-treetable.ui-treetable-scrollable .ui-treetable-scrollable-footer { + background-color: transparent; + border: 0 none; + padding: 0px; +} +body .ui-treetable.ui-treetable-scrollable thead th { + background-color: #ffffff; + color: #212121; + border-bottom: 1px solid #dbdbdb; + border-top: 1px solid #dbdbdb; +} +body .ui-treetable.ui-treetable-scrollable thead th.ui-state-active { + background-color: #29ABE1; + color: #ffffff; +} +body .ui-treetable.ui-treetable-scrollable thead.ui-treetable-scrollable-theadclone th { + padding-bottom: 0px; + padding-top: 0px; + line-height: 0px; + border-top: 0 none; +} +body .ui-treetable.ui-treetable-scrollable tbody.ui-widget-content { + padding: 0px; +} +body .ui-treetable.ui-treetable-scrollable tbody tr.ui-widget-content { + padding: 0px; +} +body .ui-panelgrid tbody tr.ui-widget-content { + border: 1px solid #d8d8d8; +} + +body .ui-panel { + padding: 0; +} +body .ui-panel .ui-panel-titlebar { + border: 0 none; + padding: 8px 14px; + -moz-border-radius-topleft: 2px; + -webkit-border-top-left-radius: 2px; + border-top-left-radius: 2px; + -moz-border-radius-topright: 2px; + -webkit-border-top-right-radius: 2px; + border-top-right-radius: 2px; + -moz-border-radius-bottomleft: 0px; + -webkit-border-bottom-left-radius: 0px; + border-bottom-left-radius: 0px; + -moz-border-radius-bottomright: 0px; + -webkit-border-bottom-right-radius: 0px; + border-bottom-right-radius: 0px; +} +body .ui-panel .ui-panel-titlebar .ui-panel-title { + margin: 0; + line-height: 20px; +} +body .ui-panel .ui-panel-titlebar .ui-panel-titlebar-icon { + width: 20px; + height: 20px; + color: #ffffff; + margin: 0; + -moz-transition: background-color 0.3s; + -o-transition: background-color 0.3s; + -webkit-transition: background-color 0.3s; + transition: background-color 0.3s; + -moz-border-radius: 50%; + -webkit-border-radius: 50%; + border-radius: 50%; +} +body .ui-panel .ui-panel-titlebar .ui-panel-titlebar-icon:hover { + background-color: #8AD4F2; +} +body .ui-panel .ui-panel-content { + height: 100%; + box-sizing: border-box; + padding: 8px 14px; +} +body .ui-panel .ui-panel-footer { + padding: 8px 14px; + border: 0 none; + border-top: 1px solid #dbdbdb; + margin: 0; +} +body .ui-panel.ui-panel-collapsed-h .ui-panel-titlebar { + padding-left: 40px; +} +body .ui-fieldset { + padding: 8px 14px; +} +body .ui-fieldset .ui-fieldset-legend { + padding: 8px 14px; + padding-left: 2px; + padding-right: 8px; + color: #29ABE1; +} +body .ui-fieldset .ui-fieldset-legend .ui-fieldset-toggler { + padding: 8px; + background-color: #29ABE1; + color: #ffffff; + -moz-border-radius: 50%; + -webkit-border-radius: 50%; + border-radius: 50%; + -moz-transition: background-color 0.3s; + -o-transition: background-color 0.3s; + -webkit-transition: background-color 0.3s; + transition: background-color 0.3s; + margin-top: -10px; + margin-right: 8px; + box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.14), 0 2px 1px -1px rgba(0, 0, 0, 0.12); + -webkit-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.14), 0 2px 1px -1px rgba(0, 0, 0, 0.12); + -moz-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.14), 0 2px 1px -1px rgba(0, 0, 0, 0.12); +} +body .ui-fieldset .ui-fieldset-legend .ui-fieldset-toggler:hover { + background-color: #2341BB; +} +body .ui-fieldset .ui-fieldset-legend.ui-state-focus { + background-color: transparent; +} +body .ui-fieldset .ui-fieldset-legend.ui-state-active { + background-color: transparent; +} +body .ui-notificationbar { + background-color: #29ABE1; + color: #ffffff; +} +body .ui-panelgrid .ui-panelgrid-cell { + padding: 8px 14px; +} +body .ui-panelgrid .ui-panelgrid-header > .ui-widget-header, +body .ui-panelgrid .ui-panelgrid-footer > .ui-widget-header { + border-color: #2341BB; +} +body .ui-panelgrid tbody .ui-panelgrid-cell.ui-widget-header { + background-color: #8AD4F2; +} +body .ui-accordion .ui-accordion-header { + background-color: #29ABE1; + padding: 8px 14px; + padding-left: 36px; + font-size: 14px; + color: #ffffff; + -moz-transition: background-color 0.3s; + -o-transition: background-color 0.3s; + -webkit-transition: background-color 0.3s; + transition: background-color 0.3s; +} +body .ui-accordion .ui-accordion-header.ui-state-hover { + background-color: #2341BB; +} +body .ui-accordion .ui-accordion-header.ui-state-active { + background-color: #29ABE1; + color: #ffffff; +} +body .ui-accordion .ui-accordion-header.ui-state-active.ui-tabs-outline { + outline: 0 none; + background-color: #ddc061; +} +body .ui-accordion .ui-accordion-header .ui-icon-triangle-1-e { + margin-top: -10px; +} +body .ui-accordion .ui-accordion-header .ui-icon-triangle-1-s { + margin-top: -10px; +} +body .ui-accordion .ui-accordion-header.ui-tabs-outline { + background-color: #A8E1F7; +} +body .ui-accordion .ui-accordion-content { + padding: 8px 14px; + line-height: 18px; +} +body .ui-scrollpanel { + padding: 0; +} +body .ui-scrollpanel .ui-scrollpanel-track { + background-color: #ffffff; + border-color: transparent; + padding: 0; +} +body .ui-scrollpanel .ui-scrollpanel-drag { + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + background-color: #dbdbdb; +} +body .ui-toolbar { + background-color: #2341BB; + box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.14), 0 2px 1px -1px rgba(0, 0, 0, 0.12); + -webkit-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.14), 0 2px 1px -1px rgba(0, 0, 0, 0.12); + -moz-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.14), 0 2px 1px -1px rgba(0, 0, 0, 0.12); + padding: 10px; +} +body .ui-toolbar .ui-button { + margin-right: 6px; +} +body .ui-tabs { + padding: 0; +} +body .ui-tabs .ui-tabs-nav { + background-color: #ffffff; + border: 0 none; + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; +} +body .ui-tabs .ui-tabs-nav > li { + padding: 0; + -moz-transition: border-color 0.3s; + -o-transition: border-color 0.3s; + -webkit-transition: border-color 0.3s; + transition: border-color 0.3s; +} +body .ui-tabs .ui-tabs-nav > li > a { + padding: 8px 14px; +} +body .ui-tabs .ui-tabs-nav > li > a:focus { + outline: 0 none; +} +body .ui-tabs .ui-tabs-nav > li > .ui-icon-close { + margin: 7px 0 0 0; + -moz-transition: color 0.3s; + -o-transition: color 0.3s; + -webkit-transition: color 0.3s; + transition: color 0.3s; + color: #757575; +} +body .ui-tabs .ui-tabs-nav > li.ui-state-default a { + color: #757575; +} +body .ui-tabs .ui-tabs-nav > li.ui-state-hover { + background-color: #ffffff; +} +body .ui-tabs .ui-tabs-nav > li.ui-state-active { + background-color: #ffffff; + border-color: #29ABE1; + border-style: solid; +} +body .ui-tabs .ui-tabs-nav > li.ui-state-active a { + color: #29ABE1; + font-weight: 700; +} +body .ui-tabs .ui-tabs-nav > li.ui-state-active > .ui-icon-close { + color: #29ABE1; +} +body .ui-tabs .ui-tabs-nav > li.ui-tabs-outline { + outline: 0 none; + border-color: #8AD4F2; +} +body .ui-tabs .ui-tabs-panel { + padding: 8px 14px; +} +body .ui-tabs.ui-tabs-top > .ui-tabs-nav { + padding: 0; + margin: 0; + -moz-border-radius-topleft: 4px; + -webkit-border-top-left-radius: 4px; + border-top-left-radius: 4px; + -moz-border-radius-topright: 4px; + -webkit-border-top-right-radius: 4px; + border-top-right-radius: 4px; + border-bottom: 1px solid #dbdbdb; +} +body .ui-tabs.ui-tabs-top > .ui-tabs-nav > li { + border-style: solid; + border-width: 0 0 2px 0; +} +body .ui-tabs.ui-tabs-bottom > .ui-tabs-nav { + padding: 0; + margin: 0; + -moz-border-radius-bottomleft: 4px; + -webkit-border-bottom-left-radius: 4px; + border-bottom-left-radius: 4px; + -moz-border-radius-bottomright: 4px; + -webkit-border-bottom-right-radius: 4px; + border-bottom-right-radius: 4px; + border-top: 1px solid #dbdbdb; +} +body .ui-tabs.ui-tabs-bottom > .ui-tabs-nav > li { + border-width: 2px 0 0 0; +} +body .ui-tabs.ui-tabs-left > .ui-tabs-nav { + padding: 0; + margin: 0; + -moz-border-radius-topleft: 4px; + -webkit-border-top-left-radius: 4px; + border-top-left-radius: 4px; + -moz-border-radius-bottomleft: 4px; + -webkit-border-bottom-left-radius: 4px; + border-bottom-left-radius: 4px; + border-right: 1px solid #dbdbdb; +} +body .ui-tabs.ui-tabs-left > .ui-tabs-nav > li { + box-sizing: border-box; + border-width: 0 2px 0 0; +} +body .ui-tabs.ui-tabs-left > .ui-tabs-nav > li > a { + width: 100%; + box-sizing: border-box; +} +body .ui-tabs.ui-tabs-right > .ui-tabs-nav { + padding: 0; + -moz-border-radius-topright: 4px; + -webkit-border-top-right-radius: 4px; + border-top-right-radius: 4px; + -moz-border-radius-bottomright: 4px; + -webkit-border-bottom-right-radius: 4px; + border-bottom-right-radius: 4px; + border-left: 1px solid #dbdbdb; +} +body .ui-tabs.ui-tabs-right > .ui-tabs-nav > li { + box-sizing: border-box; + border-width: 0 0 0 2px; +} +body .ui-tabs.ui-tabs-right > .ui-tabs-nav > li > a { + width: 100%; + box-sizing: border-box; +} +body .ui-tabs.ui-tabs-right > .ui-tabs-nav > li.ui-state-active > a { + padding-left: 14px; +} +body .ui-tabs.ui-tabs-scrollable .ui-tabs-navscroller > .ui-tabs-navscroller-btn { + outline: 0 none; + width: 18px; + display: block; + height: 42px; + background-color: #ffffff; + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; + -moz-transition: background-color 0.3s; + -o-transition: background-color 0.3s; + -webkit-transition: background-color 0.3s; + transition: background-color 0.3s; +} +body .ui-tabs.ui-tabs-scrollable .ui-tabs-navscroller > .ui-tabs-navscroller-btn > span { + margin-top: 10px; +} +body .ui-tabs.ui-tabs-scrollable .ui-tabs-navscroller > .ui-tabs-navscroller-btn:hover { + background-color: #e8e8e8; + color: #000000; +} +body .ui-tabs.ui-tabs-scrollable .ui-tabs-navscroller > .ui-tabs-navscroller-btn-left { + z-index: 1; + left: 0; + border-right: 1px solid #dbdbdb; +} +body .ui-tabs.ui-tabs-scrollable .ui-tabs-navscroller > .ui-tabs-navscroller-btn-left > span:before { + position: relative; + left: -2px; +} +body .ui-tabs.ui-tabs-scrollable .ui-tabs-navscroller > .ui-tabs-navscroller-btn-right { + z-index: 1; + right: 0; + border-left: 1px solid #dbdbdb; +} +body .ui-tabs.ui-tabs-scrollable .ui-tabs-navscroller > .ui-tabs-navscroller-btn-right > span:before { + position: relative; + right: 2px; +} +body .ui-tabs.ui-tabs-scrollable .ui-tabs-navscroller .ui-tabs-nav > li { + margin: 0; +} +body .ui-tabs.ui-tabs-scrollable.ui-tabs-top .ui-tabs-navscroller > .ui-tabs-nav { + border-bottom: 1px solid #dbdbdb; +} +body .ui-tabs.ui-tabs-scrollable.ui-tabs-top .ui-tabs-navscroller > .ui-tabs-nav > li { + border-style: solid; + border-width: 0 0 2px 0; +} +body .ui-tabs.ui-tabs-scrollable.ui-tabs-top .ui-tabs-navscroller > .ui-tabs-navscroller-btn-left { + border-top: 0 none; + border-bottom: 1px solid #dbdbdb; +} +body .ui-tabs.ui-tabs-scrollable.ui-tabs-bottom .ui-tabs-navscroller > .ui-tabs-nav { + border-top: 1px solid #dbdbdb; +} +body .ui-tabs.ui-tabs-scrollable.ui-tabs-bottom .ui-tabs-navscroller > .ui-tabs-nav > li { + border-style: solid; + border-width: 2px 0 0 0; +} +body .ui-tabs.ui-tabs-scrollable.ui-tabs-bottom .ui-tabs-navscroller > .ui-tabs-navscroller-btn-left { + border-bottom: 0 none; + border-top: 1px solid #dbdbdb; +} +body .ui-tabs.ui-tabs-scrollable.ui-tabs-bottom .ui-tabs-navscroller > .ui-tabs-navscroller-btn-right { + border-top: 1px solid #dbdbdb; +} +body .ui-wizard .ui-wizard-step-titles { + background-color: #2341BB; + -moz-border-radius-topleft: 3px; + -webkit-border-top-left-radius: 3px; + border-top-left-radius: 3px; + -moz-border-radius-topright: 3px; + -webkit-border-top-right-radius: 3px; + border-top-right-radius: 3px; +} +body .ui-wizard .ui-wizard-step-titles > li { + padding: 8px 14px; + color: #ffffff; +} +body .ui-wizard .ui-wizard-step-titles > li.ui-state-highlight { + color: #ffffff; + background-color: transparent; + border-bottom: 2px solid #29ABE1; + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; +} +body .ui-wizard .ui-wizard-content { + margin: 0; +} +body .ui-wizard .ui-wizard-content .ui-panel .ui-panel-titlebar { + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; +} + +body .ui-breadcrumb a { + color: #ffffff; +} +body .ui-breadcrumb li:first-child a { + position: relative; + font-size: 20px; + margin-top: 0; +} +body .ui-breadcrumb li:first-child a span { + display: none; +} +body .ui-steps { + position: relative; +} +body .ui-steps .ui-steps-item { + background-color: transparent; +} +body .ui-steps .ui-steps-item.ui-state-disabled { + opacity: 1; + filter: alpha(opacity=100); +} +body .ui-steps .ui-steps-item .ui-menuitem-link { + display: inline-block; + text-align: left; + background-color: #ffffff; + overflow: hidden; +} +body .ui-steps .ui-steps-item .ui-menuitem-link .ui-steps-number { + display: inline-block; + background-color: #757575; + -moz-border-radius: 50%; + -webkit-border-radius: 50%; + border-radius: 50%; + padding: 4px 8px; + font-size: 16px; + color: #ffffff; +} +body .ui-steps .ui-steps-item .ui-menuitem-link .ui-steps-title { + display: inline; + margin-left: 10px; + color: #757575; +} +body .ui-steps .ui-steps-item.ui-state-highlight .ui-steps-number { + background-color: #29ABE1; +} +body .ui-steps .ui-steps-item.ui-state-highlight .ui-steps-title { + font-weight: 700; + color: #212121; +} +body .ui-steps .ui-steps-item:last-child .ui-menuitem-link { + display: block; +} +body .ui-steps:before { + content: " "; + border: 1px solid #dbdbdb; + width: 90%; + top: 45%; + left: 0; + display: block; + position: absolute; +} +body .ui-menu { + padding: 8px 0; +} +body .ui-menu .ui-shadow, body .ui-menu.ui-shadow { + -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24); + -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24); + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24); +} +body .ui-menu .ui-menu-list { + padding: 0; + margin: 0; +} +body .ui-menu .ui-menu-list li.ui-widget-header { + margin: 0 0 1px 0; + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; + border: 0 none; + width: 100%; + box-sizing: border-box; + padding: 0; +} +body .ui-menu .ui-menu-list li.ui-widget-header h3 { + display: block; + float: none; + font-size: 14px; + padding: 6px 10px; + font-weight: 400; +} +body .ui-menu .ui-menu-list li.ui-widget-header h3 .ui-icon.ui-icon-triangle-1-s, body .ui-menu .ui-menu-list li.ui-widget-header h3 .ui-icon.ui-icon-triangle-1-e { + margin: -12px 0 0 0; +} +body .ui-menu .ui-menu-list li.ui-menuitem { + margin: 0; + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; +} +body .ui-menu .ui-menu-list li.ui-menuitem.ui-state-hover { + background-color: #e8e8e8; + color: #000000; +} +body .ui-menu .ui-menu-list li.ui-menuitem .ui-menuitem-link { + border: 0 none; + padding: 6px 10px; + width: 100%; + min-height: 32px; + box-sizing: border-box; + color: #212121; + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; + position: relative; +} +body .ui-menu .ui-menu-list li.ui-menuitem .ui-menuitem-link.ui-state-hover { + background-color: #e8e8e8; + color: #000000; +} +body .ui-menu .ui-menu-list li.ui-menuitem .ui-menuitem-link .ui-menuitem-icon { + margin-right: 8px; + display: inline-block; + vertical-align: middle; + float: none; + font-size: 18px; + height: auto; +} +body .ui-menu .ui-menu-list li.ui-menuitem .ui-menuitem-link .ui-menuitem-text { + display: inline-block; + vertical-align: middle; + float: none; +} +body .ui-menu .ui-menu-list .ui-separator { + height: 1px; + background-color: #dbdbdb; + width: 100%; + box-sizing: border-box; +} +body .ui-menu.ui-menu-toggleable .ui-menu-list li.ui-widget-header { + padding-left: 30px; +} +body .ui-menu.ui-menu-toggleable .ui-menu-list li.ui-widget-header .ui-icon { + color: #ffffff; +} +body .ui-menu.ui-menu-toggleable .ui-menu-list li.ui-widget-header .ui-icon.ui-icon-triangle-1-s { + margin-top: -10px; +} +body .ui-menu.ui-menu-toggleable .ui-menu-list li.ui-widget-header .ui-icon.ui-icon-triangle-1-e { + margin-top: -10px; +} +body .ui-menu.ui-tieredmenu .ui-icon-triangle-1-e { + position: absolute; + right: 8px; + top: 6px; + float: none; +} +body .ui-menu.ui-tieredmenu .ui-menu-child { + padding: 8px 0; +} +body .ui-menu.ui-menubar { + padding: 0; +} +body .ui-menu.ui-menubar .ui-menu-child { + padding: 8px 0; +} +body .ui-menu.ui-menubar .ui-menubar-options { + padding: 0 10px; +} +body .ui-menu.ui-menubar.ui-megamenu.ui-megamenu-vertical > .ui-menu-list { + padding: 8px 0; +} +body .ui-menu.ui-slidemenu .ui-menu-parent .ui-menu-child { + padding: 0; + box-shadow: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; +} +body .ui-menu.ui-slidemenu .ui-slidemenu-backward { + width: 100%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; +} +body .ui-tabmenu { + padding: 0; +} +body .ui-tabmenu .ui-tabmenu-nav { + padding: 0; + background-color: #ffffff; + border: 0 none; + -moz-border-radius: 0px; + -webkit-border-radius: 0px; + border-radius: 0px; +} +body .ui-tabmenu .ui-tabmenu-nav > .ui-tabmenuitem { + top: auto; + margin: 0 4px 0 0; + padding: 0; + border-style: solid; + border-width: 0 0 2px 0; + -moz-transition: border-color 0.3s; + -o-transition: border-color 0.3s; + -webkit-transition: border-color 0.3s; + transition: border-color 0.3s; +} +body .ui-tabmenu .ui-tabmenu-nav > .ui-tabmenuitem > a { + padding: 8px 14px; +} +body .ui-tabmenu .ui-tabmenu-nav > .ui-tabmenuitem > a:focus { + outline: 0 none; +} +body .ui-tabmenu .ui-tabmenu-nav > .ui-tabmenuitem > a .ui-menuitem-icon, body .ui-tabmenu .ui-tabmenu-nav > .ui-tabmenuitem > a .ui-menuitem-text { + float: none; + display: inline-block; + vertical-align: middle; +} +body .ui-tabmenu .ui-tabmenu-nav > .ui-tabmenuitem > a .ui-menuitem-icon { + margin-right: 12px; +} +body .ui-tabmenu .ui-tabmenu-nav > .ui-tabmenuitem.ui-state-default a { + color: #757575; +} +body .ui-tabmenu .ui-tabmenu-nav > .ui-tabmenuitem.ui-state-default a .ui-icon { + color: #757575; +} +body .ui-tabmenu .ui-tabmenu-nav > .ui-tabmenuitem.ui-state-hover { + background-color: #ffffff; +} +body .ui-tabmenu .ui-tabmenu-nav > .ui-tabmenuitem.ui-state-active { + background-color: #ffffff; + border-color: #29ABE1; + border-style: solid; +} +body .ui-tabmenu .ui-tabmenu-nav > .ui-tabmenuitem.ui-state-active a { + color: #29ABE1; +} +body .ui-tabmenu .ui-tabmenu-nav > .ui-tabmenuitem.ui-state-active a .ui-icon { + color: #29ABE1; +} +body .ui-panelmenu .ui-panelmenu-header { + background-color: #29ABE1; + margin-bottom: 1px; +} +body .ui-panelmenu .ui-panelmenu-header a { + padding: 6px 10px 6px 36px; + color: #ffffff; + font-size: 14px; +} +body .ui-panelmenu .ui-panelmenu-header .ui-icon { + color: #ffffff; + margin-top: -10px; + font-size: 18px; + height: auto; +} +body .ui-panelmenu .ui-panelmenu-header.ui-state-active { + background-color: #29ABE1; + -moz-border-radius-bottomleft: 0; + -webkit-border-bottom-left-radius: 0; + border-bottom-left-radius: 0; + -moz-border-radius-bottomright: 0; + -webkit-border-bottom-right-radius: 0; + border-bottom-right-radius: 0; +} +body .ui-panelmenu .ui-panelmenu-header.ui-state-active a, body .ui-panelmenu .ui-panelmenu-header.ui-state-active .ui-icon { + color: #ffffff; +} +body .ui-panelmenu .ui-panelmenu-content { + padding: 0; +} +body .ui-panelmenu .ui-panelmenu-content .ui-menuitem { + margin: 0; +} +body .ui-panelmenu .ui-panelmenu-content .ui-menuitem .ui-menuitem-link { + border: 0 none; + padding: 6px 10px; + width: 100%; + min-height: 30px; + box-sizing: border-box; + color: #212121; + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; + position: relative; +} +body .ui-panelmenu .ui-panelmenu-content .ui-menuitem .ui-menuitem-link.ui-state-hover { + background-color: #e8e8e8; + color: #000000; +} +body .ui-panelmenu .ui-panelmenu-content .ui-menuitem .ui-menuitem-link .ui-menuitem-text { + display: inline-block; + vertical-align: middle; + float: none; +} +body .ui-panelmenu .ui-panelmenu-content .ui-menuitem .ui-menuitem-link .ui-icon { + position: static; + display: inline-block; + vertical-align: middle; + margin-right: 6px; + font-size: 18px; + height: auto; +} + +body { + /* Messages */ + /* Info */ + /* Error */ + /* Warn */ + /* Fatal */ +} +body .ui-messages > div { + padding: 10px 16px; +} +body .ui-messages ul { + display: inline-block; + margin-left: 0; +} +body .ui-messages .ui-messages-info { + background-color: #2196F3; + border-color: #2196F3; + color: #ffffff; +} +body .ui-messages .ui-messages-info .ui-messages-close:hover { + background-color: #6ab8f7; +} +body .ui-messages .ui-messages-warn { + background-color: #ffc107; + border-color: #ffc107; + color: #000000; +} +body .ui-messages .ui-messages-warn .ui-messages-close:hover { + background-color: #ffd454; +} +body .ui-messages .ui-messages-error { + background-color: #e62a10; + border-color: #e62a10; + color: #ffffff; +} +body .ui-messages .ui-messages-error .ui-messages-close:hover { + background-color: #f36450; +} +body .ui-messages .ui-messages-fatal { + background-color: #212121; + border-color: #212121; + color: #ffffff; +} +body .ui-messages .ui-messages-fatal .ui-messages-close:hover { + background-color: #474747; +} +body .ui-message { + padding: 4px 8px; +} +body .ui-message.ui-message-info { + background-color: #2196F3; + border-color: #2196F3; + color: #ffffff; +} +body .ui-message.ui-message-warn { + background-color: #ffc107; + border-color: #ffc107; + color: #ffffff; +} +body .ui-message.ui-message-error { + background-color: #e62a10; + border-color: #e62a10; + color: #ffffff; +} +body .ui-message.ui-message-fatal { + background-color: #212121; + border-color: #212121; + color: #ffffff; +} +body .ui-message.ui-message-icon-only { + text-align: center; +} +body .ui-message.ui-message-icon-only span { + float: none; + margin-top: -1px; + position: static; +} +body .ui-messages .ui-messages-info-icon, body .ui-message .ui-message-info-icon { + background: none; + font-family: "Material Icons"; + font-weight: normal; + font-style: normal; + font-size: 24px; + /* Preferred icon size */ + display: inline-block; + width: 1em; + height: 1em; + line-height: 1; + text-transform: none; + letter-spacing: normal; + word-wrap: normal; + white-space: nowrap; + direction: ltr; + /* Support for all WebKit browsers. */ + -webkit-font-smoothing: antialiased; + /* Support for Safari and Chrome. */ + text-rendering: optimizeLegibility; + /* Support for Firefox. */ + -moz-osx-font-smoothing: grayscale; + /* Support for IE. */ + font-feature-settings: "liga"; + font-size: 24px; + color: #fff; +} +body .ui-messages .ui-messages-info-icon:before, body .ui-message .ui-message-info-icon:before { + content: "ī¢Ž"; +} +body .ui-message .ui-message-info-icon { + margin-top: -1px; + font-size: 18px; + right: 1px; +} +body .ui-messages .ui-messages-error-icon, body .ui-message .ui-message-error-icon { + background: none; + font-family: "Material Icons"; + font-weight: normal; + font-style: normal; + font-size: 24px; + /* Preferred icon size */ + display: inline-block; + width: 1em; + height: 1em; + line-height: 1; + text-transform: none; + letter-spacing: normal; + word-wrap: normal; + white-space: nowrap; + direction: ltr; + /* Support for all WebKit browsers. */ + -webkit-font-smoothing: antialiased; + /* Support for Safari and Chrome. */ + text-rendering: optimizeLegibility; + /* Support for Firefox. */ + -moz-osx-font-smoothing: grayscale; + /* Support for IE. */ + font-feature-settings: "liga"; + font-size: 24px; + color: #fff; +} +body .ui-messages .ui-messages-error-icon:before, body .ui-message .ui-message-error-icon:before { + content: "ī€€"; +} +body .ui-message .ui-message-error-icon { + margin-top: -1px; + font-size: 18px; + right: 1px; +} +body .ui-messages .ui-messages-warn-icon, body .ui-message .ui-message-warn-icon { + background: none; + font-family: "Material Icons"; + font-weight: normal; + font-style: normal; + font-size: 24px; + /* Preferred icon size */ + display: inline-block; + width: 1em; + height: 1em; + line-height: 1; + text-transform: none; + letter-spacing: normal; + word-wrap: normal; + white-space: nowrap; + direction: ltr; + /* Support for all WebKit browsers. */ + -webkit-font-smoothing: antialiased; + /* Support for Safari and Chrome. */ + text-rendering: optimizeLegibility; + /* Support for Firefox. */ + -moz-osx-font-smoothing: grayscale; + /* Support for IE. */ + font-feature-settings: "liga"; + font-size: 24px; + color: #212121; +} +body .ui-messages .ui-messages-warn-icon:before, body .ui-message .ui-message-warn-icon:before { + content: "ī€‚"; +} +body .ui-messages .ui-messages-warn .ui-messages-close { + color: #212121; +} +body .ui-message .ui-message-warn-icon { + margin-top: -1px; + font-size: 18px; + right: 1px; +} +body .ui-messages .ui-messages-fatal-icon, body .ui-message .ui-message-fatal-icon { + background: none; + font-family: "Material Icons"; + font-weight: normal; + font-style: normal; + font-size: 24px; + /* Preferred icon size */ + display: inline-block; + width: 1em; + height: 1em; + line-height: 1; + text-transform: none; + letter-spacing: normal; + word-wrap: normal; + white-space: nowrap; + direction: ltr; + /* Support for all WebKit browsers. */ + -webkit-font-smoothing: antialiased; + /* Support for Safari and Chrome. */ + text-rendering: optimizeLegibility; + /* Support for Firefox. */ + -moz-osx-font-smoothing: grayscale; + /* Support for IE. */ + font-feature-settings: "liga"; + font-size: 24px; + color: #fff; +} +body .ui-messages .ui-messages-fatal-icon:before, body .ui-message .ui-message-fatal-icon:before { + content: "ī€€"; +} +body .ui-message .ui-message-fatal-icon { + margin-top: -1px; + font-size: 18px; +} +body .ui-messages-close { + text-decoration: none; + color: #fff; + width: 20px; + height: 20px; + margin-top: -2px; + -moz-border-radius: 50%; + -webkit-border-radius: 50%; + border-radius: 50%; + -moz-transition: background-color 0.3s; + -o-transition: background-color 0.3s; + -webkit-transition: background-color 0.3s; + transition: background-color 0.3s; +} +body .md-inputfield .ui-message.ui-message-error { + background-color: transparent; + border: 0 none; + margin: 0px; + color: #e62a10; + font-size: 11px; +} +body .md-inputfield .ui-message.ui-message-error .ui-message-error-icon { + color: #e62a10; + font-size: 13px; +} +body .ui-growl { + top: 90px; +} +body .ui-growl > .ui-growl-item-container { + opacity: 1; +} +body .ui-growl > .ui-growl-item-container.ui-growl-info { + background-color: #2196F3; +} +body .ui-growl > .ui-growl-item-container.ui-growl-warn { + background-color: #ffc107; +} +body .ui-growl > .ui-growl-item-container.ui-growl-error { + background-color: #e62a10; +} +body .ui-growl > .ui-growl-item-container.ui-growl-fatal { + background-color: #212121; +} +body .ui-growl > .ui-growl-item-container.ui-shadow { + -webkit-box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23); + -moz-box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23); + box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23); +} +body .ui-growl .ui-growl-item .ui-growl-image { + background: none; + color: #ffffff; + padding: 4px; +} +body .ui-growl .ui-growl-item .ui-growl-image.ui-growl-image-info { + font-family: "Material Icons"; + font-weight: normal; + font-style: normal; + font-size: 24px; + /* Preferred icon size */ + display: inline-block; + width: 1em; + height: 1em; + line-height: 1; + text-transform: none; + letter-spacing: normal; + word-wrap: normal; + white-space: nowrap; + direction: ltr; + /* Support for all WebKit browsers. */ + -webkit-font-smoothing: antialiased; + /* Support for Safari and Chrome. */ + text-rendering: optimizeLegibility; + /* Support for Firefox. */ + -moz-osx-font-smoothing: grayscale; + /* Support for IE. */ + font-feature-settings: "liga"; + font-size: 36px; +} +body .ui-growl .ui-growl-item .ui-growl-image.ui-growl-image-info:before { + content: "ī¢Ž"; +} +body .ui-growl .ui-growl-item .ui-growl-image.ui-growl-image-error { + font-family: "Material Icons"; + font-weight: normal; + font-style: normal; + font-size: 24px; + /* Preferred icon size */ + display: inline-block; + width: 1em; + height: 1em; + line-height: 1; + text-transform: none; + letter-spacing: normal; + word-wrap: normal; + white-space: nowrap; + direction: ltr; + /* Support for all WebKit browsers. */ + -webkit-font-smoothing: antialiased; + /* Support for Safari and Chrome. */ + text-rendering: optimizeLegibility; + /* Support for Firefox. */ + -moz-osx-font-smoothing: grayscale; + /* Support for IE. */ + font-feature-settings: "liga"; + font-size: 36px; +} +body .ui-growl .ui-growl-item .ui-growl-image.ui-growl-image-error:before { + content: "ī€€"; +} +body .ui-growl .ui-growl-item .ui-growl-image.ui-growl-image-warn { + font-family: "Material Icons"; + font-weight: normal; + font-style: normal; + font-size: 24px; + /* Preferred icon size */ + display: inline-block; + width: 1em; + height: 1em; + line-height: 1; + text-transform: none; + letter-spacing: normal; + word-wrap: normal; + white-space: nowrap; + direction: ltr; + /* Support for all WebKit browsers. */ + -webkit-font-smoothing: antialiased; + /* Support for Safari and Chrome. */ + text-rendering: optimizeLegibility; + /* Support for Firefox. */ + -moz-osx-font-smoothing: grayscale; + /* Support for IE. */ + font-feature-settings: "liga"; + font-size: 36px; +} +body .ui-growl .ui-growl-item .ui-growl-image.ui-growl-image-warn:before { + content: "ī€‚"; +} +body .ui-growl .ui-growl-item .ui-growl-image.ui-growl-image-fatal { + font-family: "Material Icons"; + font-weight: normal; + font-style: normal; + font-size: 24px; + /* Preferred icon size */ + display: inline-block; + width: 1em; + height: 1em; + line-height: 1; + text-transform: none; + letter-spacing: normal; + word-wrap: normal; + white-space: nowrap; + direction: ltr; + /* Support for all WebKit browsers. */ + -webkit-font-smoothing: antialiased; + /* Support for Safari and Chrome. */ + text-rendering: optimizeLegibility; + /* Support for Firefox. */ + -moz-osx-font-smoothing: grayscale; + /* Support for IE. */ + font-feature-settings: "liga"; + font-size: 36px; +} +body .ui-growl .ui-growl-item .ui-growl-image.ui-growl-image-fatal:before { + content: "ī€€"; +} +body .ui-growl .ui-growl-item .ui-growl-message { + color: #ffffff; +} +body .ui-growl .ui-growl-item .ui-growl-icon-close { + font-family: "Material Icons"; + font-weight: normal; + font-style: normal; + font-size: 24px; + /* Preferred icon size */ + display: inline-block; + width: 1em; + height: 1em; + line-height: 1; + text-transform: none; + letter-spacing: normal; + word-wrap: normal; + white-space: nowrap; + direction: ltr; + /* Support for all WebKit browsers. */ + -webkit-font-smoothing: antialiased; + /* Support for Safari and Chrome. */ + text-rendering: optimizeLegibility; + /* Support for Firefox. */ + -moz-osx-font-smoothing: grayscale; + /* Support for IE. */ + font-feature-settings: "liga"; + font-size: 24px; + color: #ffffff; +} +body .ui-growl .ui-growl-item .ui-growl-icon-close:before { + content: "ī—"; +} + +body .jqplot-target { + font-family: "Roboto", "Helvetica Neue", sans-serif; +} +body .ui-progressbar { + height: 16px; + padding: 0; + border-color: #d8d8d8; +} +body .ui-progressbar .ui-progressbar-value { + height: 16px; + padding: 0; +} +body .ui-progressbar .ui-progressbar-label { + color: #29ABE1; +} +body .ui-galleria { + padding: 0; +} +body .ui-galleria .ui-galleria-nav-prev { + left: 2px; +} +body .ui-galleria .ui-galleria-nav-next { + right: 2px; +} +body .ui-log .ui-log-header { + padding: 8px 14px; + height: auto; +} +body .ui-log .ui-log-header > .ui-log-button { + line-height: 16px; + position: static; + display: inline-block; + vertical-align: middle; + margin-right: 4px; + border: 1px solid transparent; + padding: 1px 3px; + -moz-border-radius: 50%; + -webkit-border-radius: 50%; + border-radius: 50%; + -moz-transition: background-color 0.3s; + -o-transition: background-color 0.3s; + -webkit-transition: background-color 0.3s; + transition: background-color 0.3s; +} +body .ui-log .ui-log-header > .ui-log-button.ui-state-hover { + background-color: #8AD4F2; +} +body .ui-tagcloud li { + margin: 4px 0px; +} +body .ui-tagcloud li a { + -moz-transition: background-color 0.3s; + -o-transition: background-color 0.3s; + -webkit-transition: background-color 0.3s; + transition: background-color 0.3s; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; +} +body .ui-tagcloud li a:hover { + background-color: #e8e8e8; + color: #000000; +} +body .timeline-frame .timeline-event { + border-color: #d8d8d8; + background-color: #ffffff; +} +body .timeline-frame .timeline-event.ui-state-active { + background-color: #29ABE1; + border-color: #29ABE1; + color: #ffffff; +} +body .timeline-frame .timeline-axis { + border-color: #dbdbdb; +} +body .timeline-frame .timeline-navigation { + height: 36px; +} + +body .ui-dialog.ui-shadow { + -webkit-box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23); + -moz-box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23); + box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23); +} +body .ui-dialog .ui-dialog-titlebar { + background-color: #ffffff; + color: #212121; + padding: 8px 14px; +} +body .ui-dialog .ui-dialog-titlebar .ui-dialog-title { + font-weight: 700; +} +body .ui-dialog .ui-dialog-titlebar .ui-dialog-titlebar-icon { + padding: 0; + -moz-border-radius: 50%; + -webkit-border-radius: 50%; + border-radius: 50%; + -moz-transition: background-color 0.3s; + -o-transition: background-color 0.3s; + -webkit-transition: background-color 0.3s; + transition: background-color 0.3s; +} +body .ui-dialog .ui-dialog-titlebar .ui-dialog-titlebar-icon.ui-state-hover, body .ui-dialog .ui-dialog-titlebar .ui-dialog-titlebar-icon.ui-state-focus { + background-color: #e8e8e8; + color: #000000; +} +body .ui-dialog .ui-dialog-titlebar .ui-dialog-titlebar-icon .ui-icon { + color: #757575; +} +body .ui-dialog .ui-dialog-titlebar .ui-dialog-titlebar-icon .ui-icon-extlink:before { + content: "fullscreen"; +} +body .ui-dialog .ui-dialog-titlebar .ui-dialog-titlebar-icon .ui-icon-newwin:before { + content: "fullscreen_exit"; +} +body .ui-dialog .ui-dialog-buttonpane, body .ui-dialog .ui-dialog-footer { + text-align: right; +} +body .ui-dialog .ui-dialog-buttonpane .ui-button, body .ui-dialog .ui-dialog-footer .ui-button { + background-color: #ffffff; + color: #212121; + box-shadow: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; +} +body .ui-dialog .ui-dialog-buttonpane .ui-button .ui-icon, body .ui-dialog .ui-dialog-footer .ui-button .ui-icon { + color: #757575; +} +body .ui-dialog .ui-dialog-buttonpane .ui-button.ui-state-hover, body .ui-dialog .ui-dialog-footer .ui-button.ui-state-hover { + background-color: #e8e8e8; + color: #000000; +} +body .ui-dialog .ui-confirm-dialog-severity { + margin: 0px 12px; +} +body .ui-sidebar .ui-sidebar-close:hover { + padding: 1px; +} +body .ui-sidebar .ui-button { + width: auto; +} +body .ui-lightbox.ui-shadow { + -webkit-box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23); + -moz-box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23); + box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23); +} +body .ui-lightbox .ui-lightbox-caption { + padding: 8px 14px; +} +body .ui-lightbox .ui-lightbox-caption .ui-lightbox-caption-text { + margin: 0; +} +body .ui-lightbox .ui-lightbox-caption .ui-lightbox-close { + -moz-border-radius: 50%; + -webkit-border-radius: 50%; + border-radius: 50%; + -moz-transition: background-color 0.3s; + -o-transition: background-color 0.3s; + -webkit-transition: background-color 0.3s; + transition: background-color 0.3s; + padding: 0; + margin: 0; + width: 20px; + height: 20px; +} +body .ui-lightbox .ui-lightbox-caption .ui-lightbox-close.ui-state-hover { + background-color: #8AD4F2; + color: #000000; + padding: 0; +} +body .ui-lightbox .ui-lightbox-content-wrapper .ui-lightbox-nav-right, body .ui-lightbox .ui-lightbox-content-wrapper .ui-lightbox-nav-left { + top: 40%; +} +body .ui-lightbox .ui-lightbox-content-wrapper .ui-lightbox-nav-right .ui-icon, body .ui-lightbox .ui-lightbox-content-wrapper .ui-lightbox-nav-left .ui-icon { + -moz-transition: color 0.3s; + -o-transition: color 0.3s; + -webkit-transition: color 0.3s; + transition: color 0.3s; + font-size: 48px; + color: #8AD4F2; +} +body .ui-lightbox .ui-lightbox-content-wrapper .ui-lightbox-nav-right:hover .ui-icon, body .ui-lightbox .ui-lightbox-content-wrapper .ui-lightbox-nav-left:hover .ui-icon { + color: #ffffff; +} +body .ui-lightbox .ui-lightbox-content-wrapper .ui-lightbox-nav-right { + right: 24px; +} +body .ui-overlaypanel.ui-shadow { + -webkit-box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23); + -moz-box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23); + box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23); +} +body .ui-overlaypanel .ui-overlaypanel-close { + background-color: #29ABE1; + -moz-border-radius: 50%; + -webkit-border-radius: 50%; + border-radius: 50%; + -moz-transition: background-color 0.3s; + -o-transition: background-color 0.3s; + -webkit-transition: background-color 0.3s; + transition: background-color 0.3s; + padding: 2px 4px; + right: -16px; + top: -16px; + box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.14), 0 2px 1px -1px rgba(0, 0, 0, 0.12); + -webkit-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.14), 0 2px 1px -1px rgba(0, 0, 0, 0.12); + -moz-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.14), 0 2px 1px -1px rgba(0, 0, 0, 0.12); +} +body .ui-overlaypanel .ui-overlaypanel-close span { + color: #ffffff; +} +body .ui-overlaypanel .ui-overlaypanel-close span:before { + position: relative; + top: 2px; +} +body .ui-overlaypanel .ui-overlaypanel-close.ui-state-hover { + background-color: #2341BB; +} +body .ui-tooltip { + opacity: 0.9; + filter: alpha(opacity=90); + font-size: 12px; +} +body .ui-tooltip .ui-tooltip-text { + background-color: #323232; + -webkit-box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23); + -moz-box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23); + box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23); +} +body .ui-tooltip.ui-tooltip-top .ui-tooltip-arrow { + border-top-color: #323232; +} +body .ui-tooltip.ui-tooltip-bottom .ui-tooltip-arrow { + border-bottom-color: #323232; +} +body .ui-tooltip.ui-tooltip-left .ui-tooltip-arrow { + border-left-color: #323232; +} +body .ui-tooltip.ui-tooltip-right .ui-tooltip-arrow { + border-right-color: #323232; +} +body .ui-state-error, +body .ui-widget.ui-state-error, +body .ui-widget-content .ui-state-error, +body .ui-widget-header .ui-state-error { + border-color: #e62a10; +} + +@media (max-width: 640px) { + body .ui-panelgrid .ui-grid-responsive .ui-grid-row { + border: 0 none; + } + body .ui-steps .ui-steps-item .ui-menuitem-link .ui-steps-title { + display: none; + } + body .ui-picklist.ui-picklist-responsive .ui-picklist-list-wrapper { + margin-bottom: 8px; + } + body .ui-picklist.ui-picklist-responsive .ui-picklist-buttons .ui-button.ui-button-icon-only { + display: inline-block; + margin-right: 4px; + } + body .ui-picklist.ui-picklist-responsive .ui-picklist-buttons .ui-icon-arrow-1-e { + -webkit-transform: rotate(90deg); + -moz-transform: rotate(90deg); + -o-transform: rotate(90deg); + -ms-transform: rotate(90deg); + transform: rotate(90deg); + } + body .ui-picklist.ui-picklist-responsive .ui-picklist-buttons .ui-icon-arrow-1-e:before { + content: "ī€·"; + } + body .ui-picklist.ui-picklist-responsive .ui-picklist-buttons .ui-icon-arrowstop-1-e { + -webkit-transform: rotate(-90deg); + -moz-transform: rotate(-90deg); + -o-transform: rotate(-90deg); + -ms-transform: rotate(-90deg); + transform: rotate(-90deg); + } + body .ui-picklist.ui-picklist-responsive .ui-picklist-buttons .ui-icon-arrowstop-1-e:before { + content: "ī…"; + } + body .ui-picklist.ui-picklist-responsive .ui-picklist-buttons .ui-icon-arrow-1-w { + -webkit-transform: rotate(-90deg); + -moz-transform: rotate(-90deg); + -o-transform: rotate(-90deg); + -ms-transform: rotate(-90deg); + transform: rotate(-90deg); + } + body .ui-picklist.ui-picklist-responsive .ui-picklist-buttons .ui-icon-arrow-1-w:before { + content: "ī€·"; + } + body .ui-picklist.ui-picklist-responsive .ui-picklist-buttons .ui-icon-arrowstop-1-w { + -webkit-transform: rotate(-90deg); + -moz-transform: rotate(-90deg); + -o-transform: rotate(-90deg); + -ms-transform: rotate(-90deg); + transform: rotate(-90deg); + } + body .ui-picklist.ui-picklist-responsive .ui-picklist-buttons .ui-icon-arrowstop-1-w:before { + content: "ī„"; + } + body .ui-orderlist.ui-grid-responsive .ui-orderlist-controls { + text-align: center; + width: auto; + margin-bottom: 8px; + } + body .ui-orderlist.ui-grid-responsive .ui-orderlist-controls .ui-button { + margin-right: 4px; + } + body .ui-buttonset > .ui-button { + display: block; + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; + } + body .ui-buttonset > .ui-button:first-child { + -moz-border-radius-topleft: 3px; + -webkit-border-top-left-radius: 3px; + border-top-left-radius: 3px; + -moz-border-radius-topright: 3px; + -webkit-border-top-right-radius: 3px; + border-top-right-radius: 3px; + } + body .ui-buttonset > .ui-button:last-child { + -moz-border-radius-bottomleft: 3px; + -webkit-border-bottom-left-radius: 3px; + border-bottom-left-radius: 3px; + -moz-border-radius-bottomright: 3px; + -webkit-border-bottom-right-radius: 3px; + border-bottom-right-radius: 3px; + } +} +.ui-icon-carat-2-n-s:before { + content: "ī…¤"; +} + +.ui-icon-triangle-1-n:before { + content: "īŒ–"; +} + +.ui-icon-triangle-1-e:before { + content: "īŒ•"; +} + +.ui-icon-triangle-1-s:before { + content: "īŒ“"; +} + +.ui-icon-triangle-1-w:before { + content: "īŒ”"; +} + +.ui-icon-carat-1-n:before { + content: "īŒ–"; +} + +.ui-icon-carat-1-e:before { + content: "īŒ•"; +} + +.ui-icon-carat-1-s:before { + content: "īŒ“"; +} + +.ui-icon-carat-1-w:before { + content: "īŒ”"; +} + +.ui-icon-arrow-1-n { + -webkit-transform: rotate(-90deg); + -moz-transform: rotate(-90deg); + -o-transform: rotate(-90deg); + -ms-transform: rotate(-90deg); + transform: rotate(-90deg); +} +.ui-icon-arrow-1-n:before { + content: "ī€·"; +} + +.ui-icon-arrowstop-1-n { + -webkit-transform: rotate(-90deg); + -moz-transform: rotate(-90deg); + -o-transform: rotate(-90deg); + -ms-transform: rotate(-90deg); + transform: rotate(-90deg); +} +.ui-icon-arrowstop-1-n:before { + content: "ī„"; +} + +.ui-icon-arrow-1-s { + -webkit-transform: rotate(90deg); + -moz-transform: rotate(90deg); + -o-transform: rotate(90deg); + -ms-transform: rotate(90deg); + transform: rotate(90deg); +} +.ui-icon-arrow-1-s:before { + content: "ī€·"; +} + +.ui-icon-arrowstop-1-s { + -webkit-transform: rotate(-90deg); + -moz-transform: rotate(-90deg); + -o-transform: rotate(-90deg); + -ms-transform: rotate(-90deg); + transform: rotate(-90deg); +} +.ui-icon-arrowstop-1-s:before { + content: "ī…"; +} + +.ui-icon-arrow-1-w { + -webkit-transform: rotate(180deg); + -moz-transform: rotate(180deg); + -o-transform: rotate(180deg); + -ms-transform: rotate(180deg); + transform: rotate(180deg); +} +.ui-icon-arrow-1-w:before { + content: "ī€·"; +} + +.ui-icon-arrowstop-1-w:before { + content: "ī€ "; +} + +.ui-icon-arrow-1-e:before { + content: "ī€·"; +} + +.ui-icon-arrowstop-1-e:before { + content: "ī€Ÿ"; +} + +.ui-icon-arrowthick-1-s { + -webkit-transform: rotate(90deg); + -moz-transform: rotate(90deg); + -o-transform: rotate(90deg); + -ms-transform: rotate(90deg); + transform: rotate(90deg); +} +.ui-icon-arrowthick-1-s:before { + content: "ī€·"; +} + +.ui-icon-arrowthick-1-n { + -webkit-transform: rotate(-90deg); + -moz-transform: rotate(-90deg); + -o-transform: rotate(-90deg); + -ms-transform: rotate(-90deg); + transform: rotate(-90deg); +} +.ui-icon-arrowthick-1-n:before { + content: "ī€·"; +} + +.ui-icon-circle-triangle-e:before { + content: "ī€¹"; +} + +.ui-icon-circle-triangle-w { + -webkit-transform: rotate(180deg); + -moz-transform: rotate(180deg); + -o-transform: rotate(180deg); + -ms-transform: rotate(180deg); + transform: rotate(180deg); +} +.ui-icon-circle-triangle-w:before { + content: "ī€¹"; +} + +.ui-icon-circle-triangle-s { + -webkit-transform: rotate(90deg); + -moz-transform: rotate(90deg); + -o-transform: rotate(90deg); + -ms-transform: rotate(90deg); + transform: rotate(90deg); +} +.ui-icon-circle-triangle-s:before { + content: "ī€¹"; +} + +.ui-icon-radio-off:before { + content: "ī ¶"; +} + +.ui-icon-radio-on:before { + content: "ī ·"; +} + +.ui-icon-folder-collapsed:before { + content: "ī‹‡"; +} + +.ui-icon-document:before { + content: "ī…"; +} + +.ui-icon-video:before { + content: "ī€¬"; +} + +.ui-icon-music:before { + content: "ī…"; +} + +.ui-icon-plus:before { + content: "ī……"; +} + +.ui-icon-minus:before { + content: "ī…›"; +} + +.ui-icon-plusthick:before { + content: "ī……"; +} + +.ui-icon-minusthick:before { + content: "ī…›"; +} + +.ui-icon-pencil:before { + content: "ī‰"; +} + +.ui-icon-closethick:before { + content: "ī—"; +} + +.ui-icon-circle-close:before { + content: "ī—‰"; +} + +.ui-icon-gear:before { + content: "ī¢ø"; +} + +.ui-icon-calendar:before { + content: "ī¤–"; +} + +.ui-icon-trash:before { + content: "ī¤«"; +} + +.ui-icon-notice:before { + content: "ī€"; +} + +.ui-icon-alert:before { + content: "ī€‚"; +} + +.ui-icon-circle-zoomin:before { + content: "ī£æ"; +} + +.ui-icon-circle-zoomout:before { + content: "ī¤€"; +} + +.ui-icon-circle-arrow-e:before { + content: "ī€¹"; +} + +.ui-icon-circle-arrow-w { + -webkit-transform: rotate(180deg); + -moz-transform: rotate(180deg); + -o-transform: rotate(180deg); + -ms-transform: rotate(180deg); + transform: rotate(180deg); +} +.ui-icon-circle-arrow-w:before { + content: "ī€¹"; +} + +.ui-icon-3d-rotation:before { + content: "ī”"; +} + +.ui-icon-ac-unit:before { + content: "ī¬»"; +} + +.ui-icon-access-alarm:before { + content: "ī†"; +} + +.ui-icon-access-alarms:before { + content: "ī†‘"; +} + +.ui-icon-access-time:before { + content: "ī†’"; +} + +.ui-icon-accessibility:before { + content: "ī”Ž"; +} + +.ui-icon-accessible:before { + content: "ī¤”"; +} + +.ui-icon-account-balance:before { + content: "ī”"; +} + +.ui-icon-account-balance-wallet:before { + content: "ī”"; +} + +.ui-icon-account-box:before { + content: "ī”‘"; +} + +.ui-icon-account-circle:before { + content: "ī”“"; +} + +.ui-icon-adb:before { + content: "ī˜Ž"; +} + +.ui-icon-add:before { + content: "ī……"; +} + +.ui-icon-add-a-photo:before { + content: "ī¹"; +} + +.ui-icon-add-alarm:before { + content: "ī†“"; +} + +.ui-icon-add-alert:before { + content: "ī€ƒ"; +} + +.ui-icon-add-box:before { + content: "ī…†"; +} + +.ui-icon-add-circle:before { + content: "ī…‡"; +} + +.ui-icon-add-circle-outline:before { + content: "ī…ˆ"; +} + +.ui-icon-add-location:before { + content: "ī•§"; +} + +.ui-icon-add-shopping-cart:before { + content: "ī””"; +} + +.ui-icon-add-to-photos:before { + content: "īŽ"; +} + +.ui-icon-add-to-queue:before { + content: "īœ"; +} + +.ui-icon-adjust:before { + content: "īŽž"; +} + +.ui-icon-airline-seat-flat:before { + content: "ī˜°"; +} + +.ui-icon-airline-seat-flat-angled:before { + content: "ī˜±"; +} + +.ui-icon-airline-seat-individual-suite:before { + content: "ī˜²"; +} + +.ui-icon-airline-seat-legroom-extra:before { + content: "ī˜³"; +} + +.ui-icon-airline-seat-legroom-normal:before { + content: "ī˜“"; +} + +.ui-icon-airline-seat-legroom-reduced:before { + content: "ī˜µ"; +} + +.ui-icon-airline-seat-recline-extra:before { + content: "ī˜¶"; +} + +.ui-icon-airline-seat-recline-normal:before { + content: "ī˜·"; +} + +.ui-icon-airplanemode-active:before { + content: "ī†•"; +} + +.ui-icon-airplanemode-inactive:before { + content: "ī†”"; +} + +.ui-icon-airplay:before { + content: "ī•"; +} + +.ui-icon-airport-shuttle:before { + content: "ī¬¼"; +} + +.ui-icon-alarm:before { + content: "ī”•"; +} + +.ui-icon-alarm-add:before { + content: "ī”–"; +} + +.ui-icon-alarm-off:before { + content: "ī”—"; +} + +.ui-icon-alarm-on:before { + content: "ī”˜"; +} + +.ui-icon-album:before { + content: "ī€™"; +} + +.ui-icon-all-inclusive:before { + content: "ī¬½"; +} + +.ui-icon-all-out:before { + content: "ī¤‹"; +} + +.ui-icon-android:before { + content: "ī”™"; +} + +.ui-icon-announcement:before { + content: "ī”š"; +} + +.ui-icon-apps:before { + content: "ī—ƒ"; +} + +.ui-icon-archive:before { + content: "ī…‰"; +} + +.ui-icon-arrow-back:before { + content: "ī—„"; +} + +.ui-icon-arrow-downward:before { + content: "ī—›"; +} + +.ui-icon-arrow-drop-down:before { + content: "ī—…"; +} + +.ui-icon-arrow-drop-down-circle:before { + content: "ī—†"; +} + +.ui-icon-arrow-drop-up:before { + content: "ī—‡"; +} + +.ui-icon-arrow-forward:before { + content: "ī—ˆ"; +} + +.ui-icon-arrow-upward:before { + content: "ī—˜"; +} + +.ui-icon-art-track:before { + content: "ī "; +} + +.ui-icon-aspect-ratio:before { + content: "ī”›"; +} + +.ui-icon-assessment:before { + content: "ī”œ"; +} + +.ui-icon-assignment:before { + content: "ī”"; +} + +.ui-icon-assignment-ind:before { + content: "ī”ž"; +} + +.ui-icon-assignment-late:before { + content: "ī”Ÿ"; +} + +.ui-icon-assignment-return:before { + content: "ī” "; +} + +.ui-icon-assignment-returned:before { + content: "ī””"; +} + +.ui-icon-assignment-turned-in:before { + content: "ī”¢"; +} + +.ui-icon-assistant:before { + content: "īŽŸ"; +} + +.ui-icon-assistant-photo:before { + content: "īŽ "; +} + +.ui-icon-attach-file:before { + content: "īˆ¦"; +} + +.ui-icon-attach-money:before { + content: "īˆ§"; +} + +.ui-icon-attachment:before { + content: "īŠ¼"; +} + +.ui-icon-audiotrack:before { + content: "īŽ”"; +} + +.ui-icon-autorenew:before { + content: "ī”£"; +} + +.ui-icon-av-timer:before { + content: "ī€›"; +} + +.ui-icon-backspace:before { + content: "ī…Š"; +} + +.ui-icon-backup:before { + content: "ī”¤"; +} + +.ui-icon-battery-alert:before { + content: "ī†œ"; +} + +.ui-icon-battery-charging-full:before { + content: "ī†£"; +} + +.ui-icon-battery-full:before { + content: "ī†¤"; +} + +.ui-icon-battery-std:before { + content: "ī†„"; +} + +.ui-icon-battery-unknown:before { + content: "ī†¦"; +} + +.ui-icon-beach-access:before { + content: "ī¬¾"; +} + +.ui-icon-beenhere:before { + content: "ī”­"; +} + +.ui-icon-block:before { + content: "ī…‹"; +} + +.ui-icon-bluetooth:before { + content: "ī†§"; +} + +.ui-icon-bluetooth-audio:before { + content: "ī˜"; +} + +.ui-icon-bluetooth-connected:before { + content: "ī†Ø"; +} + +.ui-icon-bluetooth-disabled:before { + content: "ī†©"; +} + +.ui-icon-bluetooth-searching:before { + content: "ī†Ŗ"; +} + +.ui-icon-blur-circular:before { + content: "īŽ¢"; +} + +.ui-icon-blur-linear:before { + content: "īŽ£"; +} + +.ui-icon-blur-off:before { + content: "īŽ¤"; +} + +.ui-icon-blur-on:before { + content: "īŽ„"; +} + +.ui-icon-book:before { + content: "ī”„"; +} + +.ui-icon-bookmark:before { + content: "ī”¦"; +} + +.ui-icon-bookmark-border:before { + content: "ī”§"; +} + +.ui-icon-border-all:before { + content: "īˆØ"; +} + +.ui-icon-border-bottom:before { + content: "īˆ©"; +} + +.ui-icon-border-clear:before { + content: "īˆŖ"; +} + +.ui-icon-border-color:before { + content: "īˆ«"; +} + +.ui-icon-border-horizontal:before { + content: "īˆ¬"; +} + +.ui-icon-border-inner:before { + content: "īˆ­"; +} + +.ui-icon-border-left:before { + content: "īˆ®"; +} + +.ui-icon-border-outer:before { + content: "īˆÆ"; +} + +.ui-icon-border-right:before { + content: "īˆ°"; +} + +.ui-icon-border-style:before { + content: "īˆ±"; +} + +.ui-icon-border-top:before { + content: "īˆ²"; +} + +.ui-icon-border-vertical:before { + content: "īˆ³"; +} + +.ui-icon-branding-watermark:before { + content: "ī«"; +} + +.ui-icon-brightness-1:before { + content: "īŽ¦"; +} + +.ui-icon-brightness-2:before { + content: "īŽ§"; +} + +.ui-icon-brightness-3:before { + content: "īŽØ"; +} + +.ui-icon-brightness-4:before { + content: "īŽ©"; +} + +.ui-icon-brightness-5:before { + content: "īŽŖ"; +} + +.ui-icon-brightness-6:before { + content: "īŽ«"; +} + +.ui-icon-brightness-7:before { + content: "īŽ¬"; +} + +.ui-icon-brightness-auto:before { + content: "ī†«"; +} + +.ui-icon-brightness-high:before { + content: "ī†¬"; +} + +.ui-icon-brightness-low:before { + content: "ī†­"; +} + +.ui-icon-brightness-medium:before { + content: "ī†®"; +} + +.ui-icon-broken-image:before { + content: "īŽ­"; +} + +.ui-icon-brush:before { + content: "īŽ®"; +} + +.ui-icon-bubble-chart:before { + content: "ī›"; +} + +.ui-icon-bug-report:before { + content: "ī”Ø"; +} + +.ui-icon-build:before { + content: "ī”©"; +} + +.ui-icon-burst-mode:before { + content: "ī¼"; +} + +.ui-icon-business:before { + content: "ī‚Æ"; +} + +.ui-icon-business-center:before { + content: "ī¬æ"; +} + +.ui-icon-cached:before { + content: "ī”Ŗ"; +} + +.ui-icon-cake:before { + content: "īŸ©"; +} + +.ui-icon-call:before { + content: "ī‚°"; +} + +.ui-icon-call-end:before { + content: "ī‚±"; +} + +.ui-icon-call-made:before { + content: "ī‚²"; +} + +.ui-icon-call-merge:before { + content: "ī‚³"; +} + +.ui-icon-call-missed:before { + content: "ī‚“"; +} + +.ui-icon-call-missed-outgoing:before { + content: "īƒ¤"; +} + +.ui-icon-call-received:before { + content: "ī‚µ"; +} + +.ui-icon-call-split:before { + content: "ī‚¶"; +} + +.ui-icon-call-to-action:before { + content: "ī¬"; +} + +.ui-icon-camera:before { + content: "īŽÆ"; +} + +.ui-icon-camera-alt:before { + content: "īŽ°"; +} + +.ui-icon-camera-enhance:before { + content: "ī£¼"; +} + +.ui-icon-camera-front:before { + content: "īŽ±"; +} + +.ui-icon-camera-rear:before { + content: "īŽ²"; +} + +.ui-icon-camera-roll:before { + content: "īŽ³"; +} + +.ui-icon-cancel:before { + content: "ī—‰"; +} + +.ui-icon-card-giftcard:before { + content: "ī£¶"; +} + +.ui-icon-card-membership:before { + content: "ī£·"; +} + +.ui-icon-card-travel:before { + content: "ī£ø"; +} + +.ui-icon-casino:before { + content: "ī­€"; +} + +.ui-icon-cast:before { + content: "īŒ‡"; +} + +.ui-icon-cast-connected:before { + content: "īŒˆ"; +} + +.ui-icon-center-focus-strong:before { + content: "īŽ“"; +} + +.ui-icon-center-focus-weak:before { + content: "īŽµ"; +} + +.ui-icon-change-history:before { + content: "ī”«"; +} + +.ui-icon-chat:before { + content: "ī‚·"; +} + +.ui-icon-chat-bubble:before { + content: "īƒŠ"; +} + +.ui-icon-chat-bubble-outline:before { + content: "īƒ‹"; +} + +.ui-icon-check:before { + content: "ī—Š"; +} + +.ui-icon-check-box:before { + content: "ī “"; +} + +.ui-icon-check-box-outline-blank:before { + content: "ī µ"; +} + +.ui-icon-check-circle:before { + content: "ī”¬"; +} + +.ui-icon-chevron-left:before { + content: "ī—‹"; +} + +.ui-icon-chevron-right:before { + content: "ī—Œ"; +} + +.ui-icon-child-care:before { + content: "ī­"; +} + +.ui-icon-child-friendly:before { + content: "ī­‚"; +} + +.ui-icon-chrome-reader-mode:before { + content: "ī”­"; +} + +.ui-icon-class:before { + content: "ī”®"; +} + +.ui-icon-clear:before { + content: "ī…Œ"; +} + +.ui-icon-clear-all:before { + content: "ī‚ø"; +} + +.ui-icon-close:before { + content: "ī—"; +} + +.ui-icon-closed-caption:before { + content: "ī€œ"; +} + +.ui-icon-cloud:before { + content: "īŠ½"; +} + +.ui-icon-cloud-circle:before { + content: "īŠ¾"; +} + +.ui-icon-cloud-done:before { + content: "īŠæ"; +} + +.ui-icon-cloud-download:before { + content: "ī‹€"; +} + +.ui-icon-cloud-off:before { + content: "ī‹"; +} + +.ui-icon-cloud-queue:before { + content: "ī‹‚"; +} + +.ui-icon-cloud-upload:before { + content: "ī‹ƒ"; +} + +.ui-icon-code:before { + content: "ī”Æ"; +} + +.ui-icon-collections:before { + content: "īŽ¶"; +} + +.ui-icon-collections-bookmark:before { + content: "ī±"; +} + +.ui-icon-color-lens:before { + content: "īŽ·"; +} + +.ui-icon-colorize:before { + content: "īŽø"; +} + +.ui-icon-comment:before { + content: "ī‚¹"; +} + +.ui-icon-compare:before { + content: "īŽ¹"; +} + +.ui-icon-compare-arrows:before { + content: "ī¤•"; +} + +.ui-icon-computer:before { + content: "īŒŠ"; +} + +.ui-icon-confirmation-number:before { + content: "ī˜ø"; +} + +.ui-icon-contact-mail:before { + content: "īƒ"; +} + +.ui-icon-contact-phone:before { + content: "īƒ"; +} + +.ui-icon-contacts:before { + content: "ī‚ŗ"; +} + +.ui-icon-content-copy:before { + content: "ī…"; +} + +.ui-icon-content-cut:before { + content: "ī…Ž"; +} + +.ui-icon-content-paste:before { + content: "ī…"; +} + +.ui-icon-control-point:before { + content: "īŽŗ"; +} + +.ui-icon-control-point-duplicate:before { + content: "īŽ»"; +} + +.ui-icon-copyright:before { + content: "ī¤Œ"; +} + +.ui-icon-create:before { + content: "ī…"; +} + +.ui-icon-create-new-folder:before { + content: "ī‹Œ"; +} + +.ui-icon-credit-card:before { + content: "ī”°"; +} + +.ui-icon-crop:before { + content: "īŽ¾"; +} + +.ui-icon-crop-16-9:before { + content: "īŽ¼"; +} + +.ui-icon-crop-3-2:before { + content: "īŽ½"; +} + +.ui-icon-crop-5-4:before { + content: "īŽæ"; +} + +.ui-icon-crop-7-5:before { + content: "ī€"; +} + +.ui-icon-crop-din:before { + content: "ī"; +} + +.ui-icon-crop-free:before { + content: "ī‚"; +} + +.ui-icon-crop-landscape:before { + content: "īƒ"; +} + +.ui-icon-crop-original:before { + content: "ī„"; +} + +.ui-icon-crop-portrait:before { + content: "ī…"; +} + +.ui-icon-crop-rotate:before { + content: "ī·"; +} + +.ui-icon-crop-square:before { + content: "ī†"; +} + +.ui-icon-dashboard:before { + content: "ī”±"; +} + +.ui-icon-data-usage:before { + content: "ī†Æ"; +} + +.ui-icon-date-range:before { + content: "ī¤–"; +} + +.ui-icon-dehaze:before { + content: "ī‡"; +} + +.ui-icon-delete:before { + content: "ī”²"; +} + +.ui-icon-delete-forever:before { + content: "ī¤«"; +} + +.ui-icon-delete-sweep:before { + content: "ī…¬"; +} + +.ui-icon-description:before { + content: "ī”³"; +} + +.ui-icon-desktop-mac:before { + content: "īŒ‹"; +} + +.ui-icon-desktop-windows:before { + content: "īŒŒ"; +} + +.ui-icon-details:before { + content: "īˆ"; +} + +.ui-icon-developer-board:before { + content: "īŒ"; +} + +.ui-icon-developer-mode:before { + content: "ī†°"; +} + +.ui-icon-device-hub:before { + content: "īŒµ"; +} + +.ui-icon-devices:before { + content: "ī†±"; +} + +.ui-icon-devices-other:before { + content: "īŒ·"; +} + +.ui-icon-dialer-sip:before { + content: "ī‚»"; +} + +.ui-icon-dialpad:before { + content: "ī‚¼"; +} + +.ui-icon-directions:before { + content: "ī”®"; +} + +.ui-icon-directions-bike:before { + content: "ī”Æ"; +} + +.ui-icon-directions-boat:before { + content: "ī”²"; +} + +.ui-icon-directions-bus:before { + content: "ī”°"; +} + +.ui-icon-directions-car:before { + content: "ī”±"; +} + +.ui-icon-directions-railway:before { + content: "ī”“"; +} + +.ui-icon-directions-run:before { + content: "ī•¦"; +} + +.ui-icon-directions-subway:before { + content: "ī”³"; +} + +.ui-icon-directions-transit:before { + content: "ī”µ"; +} + +.ui-icon-directions-walk:before { + content: "ī”¶"; +} + +.ui-icon-disc-full:before { + content: "ī˜"; +} + +.ui-icon-dns:before { + content: "ī”µ"; +} + +.ui-icon-do-not-disturb:before { + content: "ī˜’"; +} + +.ui-icon-do-not-disturb-alt:before { + content: "ī˜‘"; +} + +.ui-icon-do-not-disturb-off:before { + content: "ī™ƒ"; +} + +.ui-icon-do-not-disturb-on:before { + content: "ī™„"; +} + +.ui-icon-dock:before { + content: "īŒŽ"; +} + +.ui-icon-domain:before { + content: "īŸ®"; +} + +.ui-icon-done:before { + content: "ī”¶"; +} + +.ui-icon-done-all:before { + content: "ī”·"; +} + +.ui-icon-donut-large:before { + content: "ī¤—"; +} + +.ui-icon-donut-small:before { + content: "ī¤˜"; +} + +.ui-icon-drafts:before { + content: "ī…‘"; +} + +.ui-icon-drag-handle:before { + content: "ī‰"; +} + +.ui-icon-drive-eta:before { + content: "ī˜“"; +} + +.ui-icon-dvr:before { + content: "ī†²"; +} + +.ui-icon-edit:before { + content: "ī‰"; +} + +.ui-icon-edit-location:before { + content: "ī•Ø"; +} + +.ui-icon-eject:before { + content: "ī£»"; +} + +.ui-icon-email:before { + content: "ī‚¾"; +} + +.ui-icon-enhanced-encryption:before { + content: "ī˜æ"; +} + +.ui-icon-equalizer:before { + content: "ī€"; +} + +.ui-icon-error:before { + content: "ī€€"; +} + +.ui-icon-error-outline:before { + content: "ī€"; +} + +.ui-icon-euro-symbol:before { + content: "ī¤¦"; +} + +.ui-icon-ev-station:before { + content: "ī•­"; +} + +.ui-icon-event:before { + content: "ī”ø"; +} + +.ui-icon-event-available:before { + content: "ī˜”"; +} + +.ui-icon-event-busy:before { + content: "ī˜•"; +} + +.ui-icon-event-note:before { + content: "ī˜–"; +} + +.ui-icon-event-seat:before { + content: "ī¤ƒ"; +} + +.ui-icon-exit-to-app:before { + content: "ī”¹"; +} + +.ui-icon-expand-less:before { + content: "ī—Ž"; +} + +.ui-icon-expand-more:before { + content: "ī—"; +} + +.ui-icon-explicit:before { + content: "ī€ž"; +} + +.ui-icon-explore:before { + content: "ī”ŗ"; +} + +.ui-icon-exposure:before { + content: "īŠ"; +} + +.ui-icon-exposure-neg-1:before { + content: "ī‹"; +} + +.ui-icon-exposure-neg-2:before { + content: "īŒ"; +} + +.ui-icon-exposure-plus-1:before { + content: "ī"; +} + +.ui-icon-exposure-plus-2:before { + content: "īŽ"; +} + +.ui-icon-exposure-zero:before { + content: "ī"; +} + +.ui-icon-extension:before { + content: "ī”»"; +} + +.ui-icon-face:before { + content: "ī”¼"; +} + +.ui-icon-fast-forward:before { + content: "ī€Ÿ"; +} + +.ui-icon-fast-rewind:before { + content: "ī€ "; +} + +.ui-icon-favorite:before { + content: "ī”½"; +} + +.ui-icon-favorite-border:before { + content: "ī”¾"; +} + +.ui-icon-featured-play-list:before { + content: "ī­"; +} + +.ui-icon-featured-video:before { + content: "ī®"; +} + +.ui-icon-feedback:before { + content: "ī”æ"; +} + +.ui-icon-fiber-dvr:before { + content: "ī"; +} + +.ui-icon-fiber-manual-record:before { + content: "ī”"; +} + +.ui-icon-fiber-new:before { + content: "īž"; +} + +.ui-icon-fiber-pin:before { + content: "īŖ"; +} + +.ui-icon-fiber-smart-record:before { + content: "ī¢"; +} + +.ui-icon-file-download:before { + content: "ī‹„"; +} + +.ui-icon-file-upload:before { + content: "ī‹†"; +} + +.ui-icon-filter:before { + content: "ī“"; +} + +.ui-icon-filter-1:before { + content: "ī"; +} + +.ui-icon-filter-2:before { + content: "ī‘"; +} + +.ui-icon-filter-3:before { + content: "ī’"; +} + +.ui-icon-filter-4:before { + content: "ī”"; +} + +.ui-icon-filter-5:before { + content: "ī•"; +} + +.ui-icon-filter-6:before { + content: "ī–"; +} + +.ui-icon-filter-7:before { + content: "ī—"; +} + +.ui-icon-filter-8:before { + content: "ī˜"; +} + +.ui-icon-filter-9:before { + content: "ī™"; +} + +.ui-icon-filter-9-plus:before { + content: "īš"; +} + +.ui-icon-filter-b-and-w:before { + content: "ī›"; +} + +.ui-icon-filter-center-focus:before { + content: "īœ"; +} + +.ui-icon-filter-drama:before { + content: "ī"; +} + +.ui-icon-filter-frames:before { + content: "īž"; +} + +.ui-icon-filter-hdr:before { + content: "īŸ"; +} + +.ui-icon-filter-list:before { + content: "ī…’"; +} + +.ui-icon-filter-none:before { + content: "ī "; +} + +.ui-icon-filter-tilt-shift:before { + content: "ī¢"; +} + +.ui-icon-filter-vintage:before { + content: "ī£"; +} + +.ui-icon-find-in-page:before { + content: "ī¢€"; +} + +.ui-icon-find-replace:before { + content: "ī¢"; +} + +.ui-icon-fingerprint:before { + content: "ī¤"; +} + +.ui-icon-first-page:before { + content: "ī—œ"; +} + +.ui-icon-fitness-center:before { + content: "ī­ƒ"; +} + +.ui-icon-flag:before { + content: "ī…“"; +} + +.ui-icon-flare:before { + content: "ī¤"; +} + +.ui-icon-flash-auto:before { + content: "ī„"; +} + +.ui-icon-flash-off:before { + content: "ī¦"; +} + +.ui-icon-flash-on:before { + content: "ī§"; +} + +.ui-icon-flight:before { + content: "ī”¹"; +} + +.ui-icon-flight-land:before { + content: "ī¤„"; +} + +.ui-icon-flight-takeoff:before { + content: "ī¤…"; +} + +.ui-icon-flip:before { + content: "īØ"; +} + +.ui-icon-flip-to-back:before { + content: "ī¢‚"; +} + +.ui-icon-flip-to-front:before { + content: "ī¢ƒ"; +} + +.ui-icon-folder:before { + content: "ī‹‡"; +} + +.ui-icon-folder-open:before { + content: "ī‹ˆ"; +} + +.ui-icon-folder-shared:before { + content: "ī‹‰"; +} + +.ui-icon-folder-special:before { + content: "ī˜—"; +} + +.ui-icon-font-download:before { + content: "ī…§"; +} + +.ui-icon-format-align-center:before { + content: "īˆ“"; +} + +.ui-icon-format-align-justify:before { + content: "īˆµ"; +} + +.ui-icon-format-align-left:before { + content: "īˆ¶"; +} + +.ui-icon-format-align-right:before { + content: "īˆ·"; +} + +.ui-icon-format-bold:before { + content: "īˆø"; +} + +.ui-icon-format-clear:before { + content: "īˆ¹"; +} + +.ui-icon-format-color-fill:before { + content: "īˆŗ"; +} + +.ui-icon-format-color-reset:before { + content: "īˆ»"; +} + +.ui-icon-format-color-text:before { + content: "īˆ¼"; +} + +.ui-icon-format-indent-decrease:before { + content: "īˆ½"; +} + +.ui-icon-format-indent-increase:before { + content: "īˆ¾"; +} + +.ui-icon-format-italic:before { + content: "īˆæ"; +} + +.ui-icon-format-line-spacing:before { + content: "ī‰€"; +} + +.ui-icon-format-list-bulleted:before { + content: "ī‰"; +} + +.ui-icon-format-list-numbered:before { + content: "ī‰‚"; +} + +.ui-icon-format-paint:before { + content: "ī‰ƒ"; +} + +.ui-icon-format-quote:before { + content: "ī‰„"; +} + +.ui-icon-format-shapes:before { + content: "ī‰ž"; +} + +.ui-icon-format-size:before { + content: "ī‰…"; +} + +.ui-icon-format-strikethrough:before { + content: "ī‰†"; +} + +.ui-icon-format-textdirection-l-to-r:before { + content: "ī‰‡"; +} + +.ui-icon-format-textdirection-r-to-l:before { + content: "ī‰ˆ"; +} + +.ui-icon-format-underlined:before { + content: "ī‰‰"; +} + +.ui-icon-forum:before { + content: "ī‚æ"; +} + +.ui-icon-forward:before { + content: "ī…”"; +} + +.ui-icon-forward-10:before { + content: "ī–"; +} + +.ui-icon-forward-30:before { + content: "ī—"; +} + +.ui-icon-forward-5:before { + content: "ī˜"; +} + +.ui-icon-free-breakfast:before { + content: "ī­„"; +} + +.ui-icon-fullscreen:before { + content: "ī—"; +} + +.ui-icon-fullscreen-exit:before { + content: "ī—‘"; +} + +.ui-icon-functions:before { + content: "ī‰Š"; +} + +.ui-icon-g-translate:before { + content: "ī¤§"; +} + +.ui-icon-gamepad:before { + content: "īŒ"; +} + +.ui-icon-games:before { + content: "ī€”"; +} + +.ui-icon-gavel:before { + content: "ī¤Ž"; +} + +.ui-icon-gesture:before { + content: "ī…•"; +} + +.ui-icon-get-app:before { + content: "ī¢„"; +} + +.ui-icon-gif:before { + content: "ī¤ˆ"; +} + +.ui-icon-golf-course:before { + content: "ī­…"; +} + +.ui-icon-gps-fixed:before { + content: "ī†³"; +} + +.ui-icon-gps-not-fixed:before { + content: "ī†“"; +} + +.ui-icon-gps-off:before { + content: "ī†µ"; +} + +.ui-icon-grade:before { + content: "ī¢…"; +} + +.ui-icon-gradient:before { + content: "ī©"; +} + +.ui-icon-grain:before { + content: "īŖ"; +} + +.ui-icon-graphic-eq:before { + content: "ī†ø"; +} + +.ui-icon-grid-off:before { + content: "ī«"; +} + +.ui-icon-grid-on:before { + content: "ī¬"; +} + +.ui-icon-group:before { + content: "īŸÆ"; +} + +.ui-icon-group-add:before { + content: "īŸ°"; +} + +.ui-icon-group-work:before { + content: "ī¢†"; +} + +.ui-icon-hd:before { + content: "ī’"; +} + +.ui-icon-hdr-off:before { + content: "ī­"; +} + +.ui-icon-hdr-on:before { + content: "ī®"; +} + +.ui-icon-hdr-strong:before { + content: "ī±"; +} + +.ui-icon-hdr-weak:before { + content: "ī²"; +} + +.ui-icon-headset:before { + content: "īŒ"; +} + +.ui-icon-headset-mic:before { + content: "īŒ‘"; +} + +.ui-icon-healing:before { + content: "ī³"; +} + +.ui-icon-hearing:before { + content: "ī€£"; +} + +.ui-icon-help:before { + content: "ī¢‡"; +} + +.ui-icon-help-outline:before { + content: "ī£½"; +} + +.ui-icon-high-quality:before { + content: "ī€¤"; +} + +.ui-icon-highlight:before { + content: "ī‰Ÿ"; +} + +.ui-icon-highlight-off:before { + content: "ī¢ˆ"; +} + +.ui-icon-history:before { + content: "ī¢‰"; +} + +.ui-icon-home:before { + content: "ī¢Š"; +} + +.ui-icon-hot-tub:before { + content: "ī­†"; +} + +.ui-icon-hotel:before { + content: "ī”ŗ"; +} + +.ui-icon-hourglass-empty:before { + content: "ī¢‹"; +} + +.ui-icon-hourglass-full:before { + content: "ī¢Œ"; +} + +.ui-icon-http:before { + content: "ī¤‚"; +} + +.ui-icon-https:before { + content: "ī¢"; +} + +.ui-icon-image:before { + content: "ī“"; +} + +.ui-icon-image-aspect-ratio:before { + content: "īµ"; +} + +.ui-icon-import-contacts:before { + content: "īƒ "; +} + +.ui-icon-import-export:before { + content: "īƒƒ"; +} + +.ui-icon-important-devices:before { + content: "ī¤’"; +} + +.ui-icon-inbox:before { + content: "ī…–"; +} + +.ui-icon-indeterminate-check-box:before { + content: "ī¤‰"; +} + +.ui-icon-info:before { + content: "ī¢Ž"; +} + +.ui-icon-info-outline:before { + content: "ī¢"; +} + +.ui-icon-input:before { + content: "ī¢"; +} + +.ui-icon-insert-chart:before { + content: "ī‰‹"; +} + +.ui-icon-insert-comment:before { + content: "ī‰Œ"; +} + +.ui-icon-insert-drive-file:before { + content: "ī‰"; +} + +.ui-icon-insert-emoticon:before { + content: "ī‰Ž"; +} + +.ui-icon-insert-invitation:before { + content: "ī‰"; +} + +.ui-icon-insert-link:before { + content: "ī‰"; +} + +.ui-icon-insert-photo:before { + content: "ī‰‘"; +} + +.ui-icon-invert-colors:before { + content: "ī¢‘"; +} + +.ui-icon-invert-colors-off:before { + content: "īƒ„"; +} + +.ui-icon-iso:before { + content: "ī¶"; +} + +.ui-icon-keyboard:before { + content: "īŒ’"; +} + +.ui-icon-keyboard-arrow-down:before { + content: "īŒ“"; +} + +.ui-icon-keyboard-arrow-left:before { + content: "īŒ”"; +} + +.ui-icon-keyboard-arrow-right:before { + content: "īŒ•"; +} + +.ui-icon-keyboard-arrow-up:before { + content: "īŒ–"; +} + +.ui-icon-keyboard-backspace:before { + content: "īŒ—"; +} + +.ui-icon-keyboard-capslock:before { + content: "īŒ˜"; +} + +.ui-icon-keyboard-hide:before { + content: "īŒš"; +} + +.ui-icon-keyboard-return:before { + content: "īŒ›"; +} + +.ui-icon-keyboard-tab:before { + content: "īŒœ"; +} + +.ui-icon-keyboard-voice:before { + content: "īŒ"; +} + +.ui-icon-kitchen:before { + content: "ī­‡"; +} + +.ui-icon-label:before { + content: "ī¢’"; +} + +.ui-icon-label-outline:before { + content: "ī¢“"; +} + +.ui-icon-landscape:before { + content: "ī·"; +} + +.ui-icon-language:before { + content: "ī¢”"; +} + +.ui-icon-laptop:before { + content: "īŒž"; +} + +.ui-icon-laptop-chromebook:before { + content: "īŒŸ"; +} + +.ui-icon-laptop-mac:before { + content: "īŒ "; +} + +.ui-icon-laptop-windows:before { + content: "īŒ”"; +} + +.ui-icon-last-page:before { + content: "ī—"; +} + +.ui-icon-launch:before { + content: "ī¢•"; +} + +.ui-icon-layers:before { + content: "ī”»"; +} + +.ui-icon-layers-clear:before { + content: "ī”¼"; +} + +.ui-icon-leak-add:before { + content: "īø"; +} + +.ui-icon-leak-remove:before { + content: "ī¹"; +} + +.ui-icon-lens:before { + content: "īŗ"; +} + +.ui-icon-library-add:before { + content: "ī€®"; +} + +.ui-icon-library-books:before { + content: "ī€Æ"; +} + +.ui-icon-library-music:before { + content: "ī€°"; +} + +.ui-icon-lightbulb-outline:before { + content: "ī¤"; +} + +.ui-icon-line-style:before { + content: "ī¤™"; +} + +.ui-icon-line-weight:before { + content: "ī¤š"; +} + +.ui-icon-linear-scale:before { + content: "ī‰ "; +} + +.ui-icon-link:before { + content: "ī…—"; +} + +.ui-icon-linked-camera:before { + content: "īø"; +} + +.ui-icon-list:before { + content: "ī¢–"; +} + +.ui-icon-live-help:before { + content: "īƒ†"; +} + +.ui-icon-live-tv:before { + content: "ī˜¹"; +} + +.ui-icon-local-activity:before { + content: "ī”æ"; +} + +.ui-icon-local-airport:before { + content: "ī”½"; +} + +.ui-icon-local-atm:before { + content: "ī”¾"; +} + +.ui-icon-local-bar:before { + content: "ī•€"; +} + +.ui-icon-local-cafe:before { + content: "ī•"; +} + +.ui-icon-local-car-wash:before { + content: "ī•‚"; +} + +.ui-icon-local-convenience-store:before { + content: "ī•ƒ"; +} + +.ui-icon-local-dining:before { + content: "ī•–"; +} + +.ui-icon-local-drink:before { + content: "ī•„"; +} + +.ui-icon-local-florist:before { + content: "ī•…"; +} + +.ui-icon-local-gas-station:before { + content: "ī•†"; +} + +.ui-icon-local-grocery-store:before { + content: "ī•‡"; +} + +.ui-icon-local-hospital:before { + content: "ī•ˆ"; +} + +.ui-icon-local-hotel:before { + content: "ī•‰"; +} + +.ui-icon-local-laundry-service:before { + content: "ī•Š"; +} + +.ui-icon-local-library:before { + content: "ī•‹"; +} + +.ui-icon-local-mall:before { + content: "ī•Œ"; +} + +.ui-icon-local-movies:before { + content: "ī•"; +} + +.ui-icon-local-offer:before { + content: "ī•Ž"; +} + +.ui-icon-local-parking:before { + content: "ī•"; +} + +.ui-icon-local-pharmacy:before { + content: "ī•"; +} + +.ui-icon-local-phone:before { + content: "ī•‘"; +} + +.ui-icon-local-pizza:before { + content: "ī•’"; +} + +.ui-icon-local-play:before { + content: "ī•“"; +} + +.ui-icon-local-post-office:before { + content: "ī•”"; +} + +.ui-icon-local-printshop:before { + content: "ī••"; +} + +.ui-icon-local-see:before { + content: "ī•—"; +} + +.ui-icon-local-shipping:before { + content: "ī•˜"; +} + +.ui-icon-local-taxi:before { + content: "ī•™"; +} + +.ui-icon-location-city:before { + content: "īŸ±"; +} + +.ui-icon-location-disabled:before { + content: "ī†¶"; +} + +.ui-icon-location-off:before { + content: "īƒ‡"; +} + +.ui-icon-location-on:before { + content: "īƒˆ"; +} + +.ui-icon-location-searching:before { + content: "ī†·"; +} + +.ui-icon-lock:before { + content: "ī¢—"; +} + +.ui-icon-lock-open:before { + content: "ī¢˜"; +} + +.ui-icon-lock-outline:before { + content: "ī¢™"; +} + +.ui-icon-looks:before { + content: "ī¼"; +} + +.ui-icon-looks-3:before { + content: "ī»"; +} + +.ui-icon-looks-4:before { + content: "ī½"; +} + +.ui-icon-looks-5:before { + content: "ī¾"; +} + +.ui-icon-looks-6:before { + content: "īæ"; +} + +.ui-icon-looks-one:before { + content: "ī€"; +} + +.ui-icon-looks-two:before { + content: "ī"; +} + +.ui-icon-loop:before { + content: "ī€Ø"; +} + +.ui-icon-loupe:before { + content: "ī‚"; +} + +.ui-icon-low-priority:before { + content: "ī…­"; +} + +.ui-icon-loyalty:before { + content: "ī¢š"; +} + +.ui-icon-mail:before { + content: "ī…˜"; +} + +.ui-icon-mail-outline:before { + content: "īƒ”"; +} + +.ui-icon-map:before { + content: "ī•›"; +} + +.ui-icon-markunread:before { + content: "ī…™"; +} + +.ui-icon-markunread-mailbox:before { + content: "ī¢›"; +} + +.ui-icon-memory:before { + content: "īŒ¢"; +} + +.ui-icon-menu:before { + content: "ī—’"; +} + +.ui-icon-merge-type:before { + content: "ī‰’"; +} + +.ui-icon-message:before { + content: "īƒ‰"; +} + +.ui-icon-mic:before { + content: "ī€©"; +} + +.ui-icon-mic-none:before { + content: "ī€Ŗ"; +} + +.ui-icon-mic-off:before { + content: "ī€«"; +} + +.ui-icon-mms:before { + content: "ī˜˜"; +} + +.ui-icon-mode-comment:before { + content: "ī‰“"; +} + +.ui-icon-mode-edit:before { + content: "ī‰”"; +} + +.ui-icon-monetization-on:before { + content: "ī‰£"; +} + +.ui-icon-money-off:before { + content: "ī‰œ"; +} + +.ui-icon-monochrome-photos:before { + content: "īƒ"; +} + +.ui-icon-mood:before { + content: "īŸ²"; +} + +.ui-icon-mood-bad:before { + content: "īŸ³"; +} + +.ui-icon-more:before { + content: "ī˜™"; +} + +.ui-icon-more-horiz:before { + content: "ī—“"; +} + +.ui-icon-more-vert:before { + content: "ī—”"; +} + +.ui-icon-motorcycle:before { + content: "ī¤›"; +} + +.ui-icon-mouse:before { + content: "īŒ£"; +} + +.ui-icon-move-to-inbox:before { + content: "ī…Ø"; +} + +.ui-icon-movie:before { + content: "ī€¬"; +} + +.ui-icon-movie-creation:before { + content: "ī„"; +} + +.ui-icon-movie-filter:before { + content: "īŗ"; +} + +.ui-icon-multiline-chart:before { + content: "ī›Ÿ"; +} + +.ui-icon-music-note:before { + content: "ī…"; +} + +.ui-icon-music-video:before { + content: "ī£"; +} + +.ui-icon-my-location:before { + content: "ī•œ"; +} + +.ui-icon-nature:before { + content: "ī†"; +} + +.ui-icon-nature-people:before { + content: "ī‡"; +} + +.ui-icon-navigate-before:before { + content: "īˆ"; +} + +.ui-icon-navigate-next:before { + content: "ī‰"; +} + +.ui-icon-navigation:before { + content: "ī•"; +} + +.ui-icon-near-me:before { + content: "ī•©"; +} + +.ui-icon-network-cell:before { + content: "ī†¹"; +} + +.ui-icon-network-check:before { + content: "ī™€"; +} + +.ui-icon-network-locked:before { + content: "ī˜š"; +} + +.ui-icon-network-wifi:before { + content: "ī†ŗ"; +} + +.ui-icon-new-releases:before { + content: "ī€±"; +} + +.ui-icon-next-week:before { + content: "ī…Ŗ"; +} + +.ui-icon-nfc:before { + content: "ī†»"; +} + +.ui-icon-no-encryption:before { + content: "ī™"; +} + +.ui-icon-no-sim:before { + content: "īƒŒ"; +} + +.ui-icon-not-interested:before { + content: "ī€³"; +} + +.ui-icon-note:before { + content: "īÆ"; +} + +.ui-icon-note-add:before { + content: "ī¢œ"; +} + +.ui-icon-notifications:before { + content: "īŸ“"; +} + +.ui-icon-notifications-active:before { + content: "īŸ·"; +} + +.ui-icon-notifications-none:before { + content: "īŸµ"; +} + +.ui-icon-notifications-off:before { + content: "īŸ¶"; +} + +.ui-icon-notifications-paused:before { + content: "īŸø"; +} + +.ui-icon-offline-pin:before { + content: "ī¤Š"; +} + +.ui-icon-ondemand-video:before { + content: "ī˜ŗ"; +} + +.ui-icon-opacity:before { + content: "ī¤œ"; +} + +.ui-icon-open-in-browser:before { + content: "ī¢"; +} + +.ui-icon-open-in-new:before { + content: "ī¢ž"; +} + +.ui-icon-open-with:before { + content: "ī¢Ÿ"; +} + +.ui-icon-pages:before { + content: "īŸ¹"; +} + +.ui-icon-pageview:before { + content: "ī¢ "; +} + +.ui-icon-palette:before { + content: "īŠ"; +} + +.ui-icon-pan-tool:before { + content: "ī¤„"; +} + +.ui-icon-panorama:before { + content: "ī‹"; +} + +.ui-icon-panorama-fish-eye:before { + content: "īŒ"; +} + +.ui-icon-panorama-horizontal:before { + content: "ī"; +} + +.ui-icon-panorama-vertical:before { + content: "īŽ"; +} + +.ui-icon-panorama-wide-angle:before { + content: "ī"; +} + +.ui-icon-party-mode:before { + content: "īŸŗ"; +} + +.ui-icon-pause:before { + content: "ī€“"; +} + +.ui-icon-pause-circle-filled:before { + content: "ī€µ"; +} + +.ui-icon-pause-circle-outline:before { + content: "ī€¶"; +} + +.ui-icon-payment:before { + content: "ī¢”"; +} + +.ui-icon-people:before { + content: "īŸ»"; +} + +.ui-icon-people-outline:before { + content: "īŸ¼"; +} + +.ui-icon-perm-camera-mic:before { + content: "ī¢¢"; +} + +.ui-icon-perm-contact-calendar:before { + content: "ī¢£"; +} + +.ui-icon-perm-data-setting:before { + content: "ī¢¤"; +} + +.ui-icon-perm-device-information:before { + content: "ī¢„"; +} + +.ui-icon-perm-identity:before { + content: "ī¢¦"; +} + +.ui-icon-perm-media:before { + content: "ī¢§"; +} + +.ui-icon-perm-phone-msg:before { + content: "ī¢Ø"; +} + +.ui-icon-perm-scan-wifi:before { + content: "ī¢©"; +} + +.ui-icon-person:before { + content: "īŸ½"; +} + +.ui-icon-person-add:before { + content: "īŸ¾"; +} + +.ui-icon-person-outline:before { + content: "īŸæ"; +} + +.ui-icon-person-pin:before { + content: "ī•š"; +} + +.ui-icon-person-pin-circle:before { + content: "ī•Ŗ"; +} + +.ui-icon-personal-video:before { + content: "ī˜»"; +} + +.ui-icon-pets:before { + content: "ī¤"; +} + +.ui-icon-phone:before { + content: "īƒ"; +} + +.ui-icon-phone-android:before { + content: "īŒ¤"; +} + +.ui-icon-phone-bluetooth-speaker:before { + content: "ī˜›"; +} + +.ui-icon-phone-forwarded:before { + content: "ī˜œ"; +} + +.ui-icon-phone-in-talk:before { + content: "ī˜"; +} + +.ui-icon-phone-iphone:before { + content: "īŒ„"; +} + +.ui-icon-phone-locked:before { + content: "ī˜ž"; +} + +.ui-icon-phone-missed:before { + content: "ī˜Ÿ"; +} + +.ui-icon-phone-paused:before { + content: "ī˜ "; +} + +.ui-icon-phonelink:before { + content: "īŒ¦"; +} + +.ui-icon-phonelink-erase:before { + content: "īƒ›"; +} + +.ui-icon-phonelink-lock:before { + content: "īƒœ"; +} + +.ui-icon-phonelink-off:before { + content: "īŒ§"; +} + +.ui-icon-phonelink-ring:before { + content: "īƒ"; +} + +.ui-icon-phonelink-setup:before { + content: "īƒž"; +} + +.ui-icon-photo:before { + content: "ī"; +} + +.ui-icon-photo-album:before { + content: "ī‘"; +} + +.ui-icon-photo-camera:before { + content: "ī’"; +} + +.ui-icon-photo-filter:before { + content: "ī»"; +} + +.ui-icon-photo-library:before { + content: "ī“"; +} + +.ui-icon-photo-size-select-actual:before { + content: "ī²"; +} + +.ui-icon-photo-size-select-large:before { + content: "ī³"; +} + +.ui-icon-photo-size-select-small:before { + content: "ī“"; +} + +.ui-icon-picture-as-pdf:before { + content: "ī•"; +} + +.ui-icon-picture-in-picture:before { + content: "ī¢Ŗ"; +} + +.ui-icon-picture-in-picture-alt:before { + content: "ī¤‘"; +} + +.ui-icon-pie-chart:before { + content: "ī›„"; +} + +.ui-icon-pie-chart-outlined:before { + content: "ī›…"; +} + +.ui-icon-pin-drop:before { + content: "ī•ž"; +} + +.ui-icon-place:before { + content: "ī•Ÿ"; +} + +.ui-icon-play-arrow:before { + content: "ī€·"; +} + +.ui-icon-play-circle-filled:before { + content: "ī€ø"; +} + +.ui-icon-play-circle-outline:before { + content: "ī€¹"; +} + +.ui-icon-play-for-work:before { + content: "ī¤†"; +} + +.ui-icon-playlist-add:before { + content: "ī€»"; +} + +.ui-icon-playlist-add-check:before { + content: "ī„"; +} + +.ui-icon-playlist-play:before { + content: "īŸ"; +} + +.ui-icon-plus-one:before { + content: "ī €"; +} + +.ui-icon-poll:before { + content: "ī "; +} + +.ui-icon-polymer:before { + content: "ī¢«"; +} + +.ui-icon-pool:before { + content: "ī­ˆ"; +} + +.ui-icon-portable-wifi-off:before { + content: "īƒŽ"; +} + +.ui-icon-portrait:before { + content: "ī–"; +} + +.ui-icon-power:before { + content: "ī˜¼"; +} + +.ui-icon-power-input:before { + content: "īŒ¶"; +} + +.ui-icon-power-settings-new:before { + content: "ī¢¬"; +} + +.ui-icon-pregnant-woman:before { + content: "ī¤ž"; +} + +.ui-icon-present-to-all:before { + content: "īƒŸ"; +} + +.ui-icon-print:before { + content: "ī¢­"; +} + +.ui-icon-priority-high:before { + content: "ī™…"; +} + +.ui-icon-public:before { + content: "ī ‹"; +} + +.ui-icon-publish:before { + content: "ī‰•"; +} + +.ui-icon-query-builder:before { + content: "ī¢®"; +} + +.ui-icon-question-answer:before { + content: "ī¢Æ"; +} + +.ui-icon-queue:before { + content: "ī€¼"; +} + +.ui-icon-queue-music:before { + content: "ī€½"; +} + +.ui-icon-queue-play-next:before { + content: "ī¦"; +} + +.ui-icon-radio:before { + content: "ī€¾"; +} + +.ui-icon-radio-button-checked:before { + content: "ī ·"; +} + +.ui-icon-radio-button-unchecked:before { + content: "ī ¶"; +} + +.ui-icon-rate-review:before { + content: "ī• "; +} + +.ui-icon-receipt:before { + content: "ī¢°"; +} + +.ui-icon-recent-actors:before { + content: "ī€æ"; +} + +.ui-icon-record-voice-over:before { + content: "ī¤Ÿ"; +} + +.ui-icon-redeem:before { + content: "ī¢±"; +} + +.ui-icon-redo:before { + content: "ī…š"; +} + +.ui-icon-refresh:before { + content: "ī—•"; +} + +.ui-icon-remove:before { + content: "ī…›"; +} + +.ui-icon-remove-circle:before { + content: "ī…œ"; +} + +.ui-icon-remove-circle-outline:before { + content: "ī…"; +} + +.ui-icon-remove-from-queue:before { + content: "ī§"; +} + +.ui-icon-remove-red-eye:before { + content: "ī—"; +} + +.ui-icon-remove-shopping-cart:before { + content: "ī¤Ø"; +} + +.ui-icon-reorder:before { + content: "ī£¾"; +} + +.ui-icon-repeat:before { + content: "ī€"; +} + +.ui-icon-repeat-one:before { + content: "ī"; +} + +.ui-icon-replay:before { + content: "ī‚"; +} + +.ui-icon-replay-10:before { + content: "ī™"; +} + +.ui-icon-replay-30:before { + content: "īš"; +} + +.ui-icon-replay-5:before { + content: "ī›"; +} + +.ui-icon-reply:before { + content: "ī…ž"; +} + +.ui-icon-reply-all:before { + content: "ī…Ÿ"; +} + +.ui-icon-report:before { + content: "ī… "; +} + +.ui-icon-report-problem:before { + content: "ī¢²"; +} + +.ui-icon-restaurant:before { + content: "ī•¬"; +} + +.ui-icon-restaurant-menu:before { + content: "ī•”"; +} + +.ui-icon-restore:before { + content: "ī¢³"; +} + +.ui-icon-restore-page:before { + content: "ī¤©"; +} + +.ui-icon-ring-volume:before { + content: "īƒ‘"; +} + +.ui-icon-room:before { + content: "ī¢“"; +} + +.ui-icon-room-service:before { + content: "ī­‰"; +} + +.ui-icon-rotate-90-degrees-ccw:before { + content: "ī˜"; +} + +.ui-icon-rotate-left:before { + content: "ī™"; +} + +.ui-icon-rotate-right:before { + content: "īš"; +} + +.ui-icon-rounded-corner:before { + content: "ī¤ "; +} + +.ui-icon-router:before { + content: "īŒØ"; +} + +.ui-icon-rowing:before { + content: "ī¤”"; +} + +.ui-icon-rss-feed:before { + content: "īƒ„"; +} + +.ui-icon-rv-hookup:before { + content: "ī™‚"; +} + +.ui-icon-satellite:before { + content: "ī•¢"; +} + +.ui-icon-save:before { + content: "ī…”"; +} + +.ui-icon-scanner:before { + content: "īŒ©"; +} + +.ui-icon-schedule:before { + content: "ī¢µ"; +} + +.ui-icon-school:before { + content: "ī Œ"; +} + +.ui-icon-screen-lock-landscape:before { + content: "ī†¾"; +} + +.ui-icon-screen-lock-portrait:before { + content: "ī†æ"; +} + +.ui-icon-screen-lock-rotation:before { + content: "ī‡€"; +} + +.ui-icon-screen-rotation:before { + content: "ī‡"; +} + +.ui-icon-screen-share:before { + content: "īƒ¢"; +} + +.ui-icon-sd-card:before { + content: "ī˜£"; +} + +.ui-icon-sd-storage:before { + content: "ī‡‚"; +} + +.ui-icon-search:before { + content: "ī¢¶"; +} + +.ui-icon-security:before { + content: "īŒŖ"; +} + +.ui-icon-select-all:before { + content: "ī…¢"; +} + +.ui-icon-send:before { + content: "ī…£"; +} + +.ui-icon-sentiment-dissatisfied:before { + content: "ī ‘"; +} + +.ui-icon-sentiment-neutral:before { + content: "ī ’"; +} + +.ui-icon-sentiment-satisfied:before { + content: "ī “"; +} + +.ui-icon-sentiment-very-dissatisfied:before { + content: "ī ”"; +} + +.ui-icon-sentiment-very-satisfied:before { + content: "ī •"; +} + +.ui-icon-settings:before { + content: "ī¢ø"; +} + +.ui-icon-settings-applications:before { + content: "ī¢¹"; +} + +.ui-icon-settings-backup-restore:before { + content: "ī¢ŗ"; +} + +.ui-icon-settings-bluetooth:before { + content: "ī¢»"; +} + +.ui-icon-settings-brightness:before { + content: "ī¢½"; +} + +.ui-icon-settings-cell:before { + content: "ī¢¼"; +} + +.ui-icon-settings-ethernet:before { + content: "ī¢¾"; +} + +.ui-icon-settings-input-antenna:before { + content: "ī¢æ"; +} + +.ui-icon-settings-input-component:before { + content: "ī£€"; +} + +.ui-icon-settings-input-composite:before { + content: "ī£"; +} + +.ui-icon-settings-input-hdmi:before { + content: "ī£‚"; +} + +.ui-icon-settings-input-svideo:before { + content: "ī£ƒ"; +} + +.ui-icon-settings-overscan:before { + content: "ī£„"; +} + +.ui-icon-settings-phone:before { + content: "ī£…"; +} + +.ui-icon-settings-power:before { + content: "ī£†"; +} + +.ui-icon-settings-remote:before { + content: "ī£‡"; +} + +.ui-icon-settings-system-daydream:before { + content: "ī‡ƒ"; +} + +.ui-icon-settings-voice:before { + content: "ī£ˆ"; +} + +.ui-icon-share:before { + content: "ī "; +} + +.ui-icon-shop:before { + content: "ī£‰"; +} + +.ui-icon-shop-two:before { + content: "ī£Š"; +} + +.ui-icon-shopping-basket:before { + content: "ī£‹"; +} + +.ui-icon-shopping-cart:before { + content: "ī£Œ"; +} + +.ui-icon-short-text:before { + content: "ī‰”"; +} + +.ui-icon-show-chart:before { + content: "ī›”"; +} + +.ui-icon-shuffle:before { + content: "īƒ"; +} + +.ui-icon-signal-cellular-4-bar:before { + content: "ī‡ˆ"; +} + +.ui-icon-signal-cellular-connected-no-internet-4-bar:before { + content: "ī‡"; +} + +.ui-icon-signal-cellular-no-sim:before { + content: "ī‡Ž"; +} + +.ui-icon-signal-cellular-null:before { + content: "ī‡"; +} + +.ui-icon-signal-cellular-off:before { + content: "ī‡"; +} + +.ui-icon-signal-wifi-4-bar:before { + content: "ī‡˜"; +} + +.ui-icon-signal-wifi-4-bar-lock:before { + content: "ī‡™"; +} + +.ui-icon-signal-wifi-off:before { + content: "ī‡š"; +} + +.ui-icon-sim-card:before { + content: "īŒ«"; +} + +.ui-icon-sim-card-alert:before { + content: "ī˜¤"; +} + +.ui-icon-skip-next:before { + content: "ī„"; +} + +.ui-icon-skip-previous:before { + content: "ī…"; +} + +.ui-icon-slideshow:before { + content: "ī›"; +} + +.ui-icon-slow-motion-video:before { + content: "īØ"; +} + +.ui-icon-smartphone:before { + content: "īŒ¬"; +} + +.ui-icon-smoke-free:before { + content: "ī­Š"; +} + +.ui-icon-smoking-rooms:before { + content: "ī­‹"; +} + +.ui-icon-sms:before { + content: "ī˜„"; +} + +.ui-icon-sms-failed:before { + content: "ī˜¦"; +} + +.ui-icon-snooze:before { + content: "ī†"; +} + +.ui-icon-sort:before { + content: "ī…¤"; +} + +.ui-icon-sort-by-alpha:before { + content: "ī“"; +} + +.ui-icon-spa:before { + content: "ī­Œ"; +} + +.ui-icon-space-bar:before { + content: "ī‰–"; +} + +.ui-icon-speaker:before { + content: "īŒ­"; +} + +.ui-icon-speaker-group:before { + content: "īŒ®"; +} + +.ui-icon-speaker-notes:before { + content: "ī£"; +} + +.ui-icon-speaker-notes-off:before { + content: "ī¤Ŗ"; +} + +.ui-icon-speaker-phone:before { + content: "īƒ’"; +} + +.ui-icon-spellcheck:before { + content: "ī£Ž"; +} + +.ui-icon-star:before { + content: "ī ø"; +} + +.ui-icon-star-border:before { + content: "ī ŗ"; +} + +.ui-icon-star-half:before { + content: "ī ¹"; +} + +.ui-icon-stars:before { + content: "ī£"; +} + +.ui-icon-stay-current-landscape:before { + content: "īƒ“"; +} + +.ui-icon-stay-current-portrait:before { + content: "īƒ”"; +} + +.ui-icon-stay-primary-landscape:before { + content: "īƒ•"; +} + +.ui-icon-stay-primary-portrait:before { + content: "īƒ–"; +} + +.ui-icon-stop:before { + content: "ī‡"; +} + +.ui-icon-stop-screen-share:before { + content: "īƒ£"; +} + +.ui-icon-storage:before { + content: "ī‡›"; +} + +.ui-icon-store:before { + content: "ī£‘"; +} + +.ui-icon-store-mall-directory:before { + content: "ī•£"; +} + +.ui-icon-straighten:before { + content: "īœ"; +} + +.ui-icon-streetview:before { + content: "ī•®"; +} + +.ui-icon-strikethrough-s:before { + content: "ī‰—"; +} + +.ui-icon-style:before { + content: "ī"; +} + +.ui-icon-subdirectory-arrow-left:before { + content: "ī—™"; +} + +.ui-icon-subdirectory-arrow-right:before { + content: "ī—š"; +} + +.ui-icon-subject:before { + content: "ī£’"; +} + +.ui-icon-subscriptions:before { + content: "ī¤"; +} + +.ui-icon-subtitles:before { + content: "īˆ"; +} + +.ui-icon-subway:before { + content: "ī•Æ"; +} + +.ui-icon-supervisor-account:before { + content: "ī£“"; +} + +.ui-icon-surround-sound:before { + content: "ī‰"; +} + +.ui-icon-swap-calls:before { + content: "īƒ—"; +} + +.ui-icon-swap-horiz:before { + content: "ī£”"; +} + +.ui-icon-swap-vert:before { + content: "ī£•"; +} + +.ui-icon-swap-vertical-circle:before { + content: "ī£–"; +} + +.ui-icon-switch-camera:before { + content: "īž"; +} + +.ui-icon-switch-video:before { + content: "īŸ"; +} + +.ui-icon-sync:before { + content: "ī˜§"; +} + +.ui-icon-sync-disabled:before { + content: "ī˜Ø"; +} + +.ui-icon-sync-problem:before { + content: "ī˜©"; +} + +.ui-icon-system-update:before { + content: "ī˜Ŗ"; +} + +.ui-icon-system-update-alt:before { + content: "ī£—"; +} + +.ui-icon-tab:before { + content: "ī£˜"; +} + +.ui-icon-tab-unselected:before { + content: "ī£™"; +} + +.ui-icon-tablet:before { + content: "īŒÆ"; +} + +.ui-icon-tablet-android:before { + content: "īŒ°"; +} + +.ui-icon-tablet-mac:before { + content: "īŒ±"; +} + +.ui-icon-tag-faces:before { + content: "ī "; +} + +.ui-icon-tap-and-play:before { + content: "ī˜«"; +} + +.ui-icon-terrain:before { + content: "ī•¤"; +} + +.ui-icon-text-fields:before { + content: "ī‰¢"; +} + +.ui-icon-text-format:before { + content: "ī…„"; +} + +.ui-icon-textsms:before { + content: "īƒ˜"; +} + +.ui-icon-texture:before { + content: "ī”"; +} + +.ui-icon-theaters:before { + content: "ī£š"; +} + +.ui-icon-thumb-down:before { + content: "ī£›"; +} + +.ui-icon-thumb-up:before { + content: "ī£œ"; +} + +.ui-icon-thumbs-up-down:before { + content: "ī£"; +} + +.ui-icon-time-to-leave:before { + content: "ī˜¬"; +} + +.ui-icon-timelapse:before { + content: "ī¢"; +} + +.ui-icon-timeline:before { + content: "ī¤¢"; +} + +.ui-icon-timer:before { + content: "ī„"; +} + +.ui-icon-timer-10:before { + content: "ī£"; +} + +.ui-icon-timer-3:before { + content: "ī¤"; +} + +.ui-icon-timer-off:before { + content: "ī¦"; +} + +.ui-icon-title:before { + content: "ī‰¤"; +} + +.ui-icon-toc:before { + content: "ī£ž"; +} + +.ui-icon-today:before { + content: "ī£Ÿ"; +} + +.ui-icon-toll:before { + content: "ī£ "; +} + +.ui-icon-tonality:before { + content: "ī§"; +} + +.ui-icon-touch-app:before { + content: "ī¤“"; +} + +.ui-icon-toys:before { + content: "īŒ²"; +} + +.ui-icon-track-changes:before { + content: "ī£”"; +} + +.ui-icon-traffic:before { + content: "ī•„"; +} + +.ui-icon-train:before { + content: "ī•°"; +} + +.ui-icon-tram:before { + content: "ī•±"; +} + +.ui-icon-transfer-within-a-station:before { + content: "ī•²"; +} + +.ui-icon-transform:before { + content: "īØ"; +} + +.ui-icon-translate:before { + content: "ī£¢"; +} + +.ui-icon-trending-down:before { + content: "ī££"; +} + +.ui-icon-trending-flat:before { + content: "ī£¤"; +} + +.ui-icon-trending-up:before { + content: "ī£„"; +} + +.ui-icon-tune:before { + content: "ī©"; +} + +.ui-icon-turned-in:before { + content: "ī£¦"; +} + +.ui-icon-turned-in-not:before { + content: "ī£§"; +} + +.ui-icon-tv:before { + content: "īŒ³"; +} + +.ui-icon-unarchive:before { + content: "ī…©"; +} + +.ui-icon-undo:before { + content: "ī…¦"; +} + +.ui-icon-unfold-less:before { + content: "ī—–"; +} + +.ui-icon-unfold-more:before { + content: "ī——"; +} + +.ui-icon-update:before { + content: "ī¤£"; +} + +.ui-icon-usb:before { + content: "ī‡ "; +} + +.ui-icon-verified-user:before { + content: "ī£Ø"; +} + +.ui-icon-vertical-align-bottom:before { + content: "ī‰˜"; +} + +.ui-icon-vertical-align-center:before { + content: "ī‰™"; +} + +.ui-icon-vertical-align-top:before { + content: "ī‰š"; +} + +.ui-icon-vibration:before { + content: "ī˜­"; +} + +.ui-icon-video-call:before { + content: "ī°"; +} + +.ui-icon-video-label:before { + content: "ī±"; +} + +.ui-icon-video-library:before { + content: "īŠ"; +} + +.ui-icon-videocam:before { + content: "ī‹"; +} + +.ui-icon-videocam-off:before { + content: "īŒ"; +} + +.ui-icon-videogame-asset:before { + content: "īŒø"; +} + +.ui-icon-view-agenda:before { + content: "ī£©"; +} + +.ui-icon-view-array:before { + content: "ī£Ŗ"; +} + +.ui-icon-view-carousel:before { + content: "ī£«"; +} + +.ui-icon-view-column:before { + content: "ī£¬"; +} + +.ui-icon-view-comfy:before { + content: "īŖ"; +} + +.ui-icon-view-compact:before { + content: "ī«"; +} + +.ui-icon-view-day:before { + content: "ī£­"; +} + +.ui-icon-view-headline:before { + content: "ī£®"; +} + +.ui-icon-view-list:before { + content: "ī£Æ"; +} + +.ui-icon-view-module:before { + content: "ī£°"; +} + +.ui-icon-view-quilt:before { + content: "ī£±"; +} + +.ui-icon-view-stream:before { + content: "ī£²"; +} + +.ui-icon-view-week:before { + content: "ī£³"; +} + +.ui-icon-vignette:before { + content: "īµ"; +} + +.ui-icon-visibility:before { + content: "ī£“"; +} + +.ui-icon-visibility-off:before { + content: "ī£µ"; +} + +.ui-icon-voice-chat:before { + content: "ī˜®"; +} + +.ui-icon-voicemail:before { + content: "īƒ™"; +} + +.ui-icon-volume-down:before { + content: "ī"; +} + +.ui-icon-volume-mute:before { + content: "īŽ"; +} + +.ui-icon-volume-off:before { + content: "ī"; +} + +.ui-icon-volume-up:before { + content: "ī"; +} + +.ui-icon-vpn-key:before { + content: "īƒš"; +} + +.ui-icon-vpn-lock:before { + content: "ī˜Æ"; +} + +.ui-icon-wallpaper:before { + content: "ī†¼"; +} + +.ui-icon-warning:before { + content: "ī€‚"; +} + +.ui-icon-watch:before { + content: "īŒ“"; +} + +.ui-icon-watch-later:before { + content: "ī¤¤"; +} + +.ui-icon-wb-auto:before { + content: "ī¬"; +} + +.ui-icon-wb-cloudy:before { + content: "ī­"; +} + +.ui-icon-wb-incandescent:before { + content: "ī®"; +} + +.ui-icon-wb-iridescent:before { + content: "ī¶"; +} + +.ui-icon-wb-sunny:before { + content: "ī°"; +} + +.ui-icon-wc:before { + content: "ī˜½"; +} + +.ui-icon-web:before { + content: "ī‘"; +} + +.ui-icon-web-asset:before { + content: "ī©"; +} + +.ui-icon-weekend:before { + content: "ī…«"; +} + +.ui-icon-whatshot:before { + content: "ī Ž"; +} + +.ui-icon-widgets:before { + content: "ī†½"; +} + +.ui-icon-wifi:before { + content: "ī˜¾"; +} + +.ui-icon-wifi-lock:before { + content: "ī‡”"; +} + +.ui-icon-wifi-tethering:before { + content: "ī‡¢"; +} + +.ui-icon-work:before { + content: "ī£¹"; +} + +.ui-icon-wrap-text:before { + content: "ī‰›"; +} + +.ui-icon-youtube-searched-for:before { + content: "ī£ŗ"; +} + +.ui-icon-zoom-in:before { + content: "ī£æ"; +} + +.ui-icon-zoom-out:before { + content: "ī¤€"; +} + +.ui-icon-zoom-out-map:before { + content: "ī•«"; +} + +/* Add your customizations of theme here */ diff --git a/ace-web/src/main/webapp/resources/primefaces-serenity-green/theme.scss b/ace-web/src/main/webapp/resources/primefaces-serenity-green/theme.scss new file mode 100644 index 0000000..7028105 --- /dev/null +++ b/ace-web/src/main/webapp/resources/primefaces-serenity-green/theme.scss @@ -0,0 +1,11 @@ +$primaryColor:#29ABE1; +$primaryDarkColor:#2341BB; +$primaryLightColor:#8AD4F2; +$primaryLightestColor:#A8E1F7; +$primaryTextColor:#ffffff; +$accentColor:#29ABE1; +$accentDarkColor: #2341BB; +$accentLightColor: #8AD4F2; +$accentTextColor: #ffffff; + +@import '../sass/theme/_theme'; diff --git a/ace-web/src/main/webapp/resources/sass/_fonts.scss b/ace-web/src/main/webapp/resources/sass/_fonts.scss new file mode 100644 index 0000000..01221e2 --- /dev/null +++ b/ace-web/src/main/webapp/resources/sass/_fonts.scss @@ -0,0 +1,51 @@ +/* roboto-300 - latin */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 300; + src: url("\#{resource['serenity-layout:fonts/roboto-v15-latin-300.eot']}"); /* IE9 Compat Modes */ + src: local('Roboto Light'), local('Roboto-Light'), + url("\#{resource['serenity-layout:fonts/roboto-v15-latin-300.eot']}#iefix") format('embedded-opentype'), /* IE6-IE8 */ + url("\#{resource['serenity-layout:fonts/roboto-v15-latin-300.woff2']}") format('woff2'), /* Super Modern Browsers */ + url("\#{resource['serenity-layout:fonts/roboto-v15-latin-300.woff']}") format('woff'), /* Modern Browsers */ + url("\#{resource['serenity-layout:fonts/roboto-v15-latin-300.ttf']}") format('truetype'), /* Safari, Android, iOS */ + url("\#{resource['serenity-layout:fonts/roboto-v15-latin-300.svg']}#Roboto") format('svg'); /* Legacy iOS */ +} +/* roboto-regular - latin */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 400; + src: url("\#{resource['serenity-layout:fonts/roboto-v15-latin-regular.eot']}"); /* IE9 Compat Modes */ + src: local('Roboto'), local('Roboto-Regular'), + url("\#{resource['serenity-layout:fonts/roboto-v15-latin-regular.eot']}#iefix") format('embedded-opentype'), /* IE6-IE8 */ + url("\#{resource['serenity-layout:fonts/roboto-v15-latin-regular.woff2']}") format('woff2'), /* Super Modern Browsers */ + url("\#{resource['serenity-layout:fonts/roboto-v15-latin-regular.woff']}") format('woff'), /* Modern Browsers */ + url("\#{resource['serenity-layout:fonts/roboto-v15-latin-regular.ttf']}") format('truetype'), /* Safari, Android, iOS */ + url("\#{resource['serenity-layout:fonts/roboto-v15-latin-regular.svg']}#Roboto") format('svg'); /* Legacy iOS */ +} +/* roboto-700 - latin */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 700; + src: url("\#{resource['serenity-layout:fonts/roboto-v15-latin-700.eot']}"); /* IE9 Compat Modes */ + src: local('Roboto Bold'), local('Roboto-Bold'), + url("\#{resource['serenity-layout:fonts/roboto-v15-latin-700.eot']}#iefix") format('embedded-opentype'), /* IE6-IE8 */ + url("\#{resource['serenity-layout:fonts/roboto-v15-latin-700.woff2']}") format('woff2'), /* Super Modern Browsers */ + url("\#{resource['serenity-layout:fonts/roboto-v15-latin-700.woff']}") format('woff'), /* Modern Browsers */ + url("\#{resource['serenity-layout:fonts/roboto-v15-latin-700.ttf']}") format('truetype'), /* Safari, Android, iOS */ + url("\#{resource['serenity-layout:fonts/roboto-v15-latin-700.svg']}#Roboto") format('svg'); /* Legacy iOS */ +} + +@font-face { + font-family: 'Material Icons'; + font-style: normal; + font-weight: 400; + src: url("\#{resource['serenity-layout:fonts/MaterialIcons-Regular.eot']}"); /* For IE6-8 */ + src: local('Material Icons'), + local('MaterialIcons-Regular'), + url("\#{resource['serenity-layout:fonts/MaterialIcons-Regular.woff2']}") format('woff2'), + url("\#{resource['serenity-layout:fonts/MaterialIcons-Regular.woff']}") format('woff'), + url("\#{resource['serenity-layout:fonts/MaterialIcons-Regular.ttf']}") format('truetype'); +} \ No newline at end of file diff --git a/ace-web/src/main/webapp/resources/sass/_layout_styles.scss b/ace-web/src/main/webapp/resources/sass/_layout_styles.scss new file mode 100644 index 0000000..bff78a4 --- /dev/null +++ b/ace-web/src/main/webapp/resources/sass/_layout_styles.scss @@ -0,0 +1 @@ +/* Add your customizations of layout here */ \ No newline at end of file diff --git a/ace-web/src/main/webapp/resources/sass/_mixins.scss b/ace-web/src/main/webapp/resources/sass/_mixins.scss new file mode 100644 index 0000000..c726b8e --- /dev/null +++ b/ace-web/src/main/webapp/resources/sass/_mixins.scss @@ -0,0 +1,225 @@ +@mixin border-radius($val) { + -moz-border-radius: $val; + -webkit-border-radius: $val; + border-radius: $val; +} + +@mixin border-radius-right($val) { + -moz-border-radius-topright: $val; + -webkit-border-top-right-radius: $val; + border-top-right-radius: $val; + -moz-border-radius-bottomright: $val; + -webkit-border-bottom-right-radius: $val; + border-bottom-right-radius: $val; +} + +@mixin border-radius-left($val) { + -moz-border-radius-topleft: $val; + -webkit-border-top-left-radius: $val; + border-top-left-radius: $val; + -moz-border-radius-bottomleft: $val; + -webkit-border-bottom-left-radius: $val; + border-bottom-left-radius: $val; +} + +@mixin border-radius-top($val) { + -moz-border-radius-topleft: $val; + -webkit-border-top-left-radius: $val; + border-top-left-radius: $val; + -moz-border-radius-topright: $val; + -webkit-border-top-right-radius: $val; + border-top-right-radius: $val; +} + +@mixin border-radius-bottom($val) { + -moz-border-radius-bottomleft: $val; + -webkit-border-bottom-left-radius: $val; + border-bottom-left-radius: $val; + -moz-border-radius-bottomright: $val; + -webkit-border-bottom-right-radius: $val; + border-bottom-right-radius: $val; +} + +@mixin gradient($deg, $color1, $color2) { + background: -moz-linear-gradient($deg, $color1 0%, $color2 100%); /* ff3.6+ */ + background: -webkit-gradient(linear, left bottom, right top, color-stop(0%, $color1), color-stop(100%, $color2)); /* safari4+,chrome */ + background: -webkit-linear-gradient($deg, $color1 0%, $color2 100%); /* safari5.1+,chrome10+ */ + background: -o-linear-gradient($deg, $color1 0%, $color2 100%); /* opera 11.10+ */ + background: -ms-linear-gradient($deg, $color1 0%, $color2 100%); /* ie10+ */ + background: linear-gradient($deg, $color1 0%, $color2 100%); /* w3c */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#{$color1}', endColorstr='#{$color2}',GradientType=1 ); /* ie6-9 */ +} + +@mixin background-gradient-left2right($start-color, $end-color) { + background-color: $start-color; + background-image: -webkit-gradient(linear, left top, right top, from($start-color), to($end-color)); + background-image: -webkit-linear-gradient(left, $start-color, $end-color); + background-image: -moz-linear-gradient(left, $start-color, $end-color); + background-image: -ms-linear-gradient(left, $start-color, $end-color); + background-image: -o-linear-gradient(left, $start-color, $end-color); + background-image: linear-gradient(left, $start-color, $end-color); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$start-color}', endColorstr='#{$end-color}', gradientType='1'); +} + +@mixin background-gradient-top2bottom($start-color, $end-color) { + background-color: $start-color; + background-image: -webkit-gradient(linear, left top, left bottom, from($start-color), to($end-color)); + background-image: -webkit-linear-gradient(top, $start-color, $end-color); + background-image: -moz-linear-gradient(top, $start-color, $end-color); + background-image: -ms-linear-gradient(top, $start-color, $end-color); + background-image: -o-linear-gradient(top, $start-color, $end-color); + background-image: linear-gradient(to bottom, $start-color, $end-color); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$start-color}', endColorstr='#{$end-color}'); +} + +@mixin transition($transition...) { + -moz-transition: $transition; + -o-transition: $transition; + -webkit-transition: $transition; + transition: $transition; +} + +@mixin content-shadow() { + box-shadow: 0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12); + -webkit-box-shadow: 0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12); + -moz-box-shadow: 0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12) +} + +@mixin overlay-shadow { + -webkit-box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.3); + -moz-box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.3); + box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.3); +} + +@mixin overlay-content-shadow() { + -webkit-box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23); + -moz-box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23); + box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23); +} + +@mixin overlay-input-shadow() { + -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); + -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); + box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); +} + +@mixin no-shadow() { + box-shadow: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; +} + +@mixin shadow($value) { + -webkit-box-shadow: $value; + -moz-box-shadow: $value; + box-shadow: $value; +} + +@mixin multi-shadow($value1, $value2, $value3) { + -webkit-box-shadow: $value1, $value2, $value3; + -moz-box-shadow: $value1, $value2, $value3; + box-shadow: $value1, $value2, $value3; +} + +@mixin box-sizing($box-model) { + -webkit-box-sizing: $box-model; + -moz-box-sizing: $box-model; + box-sizing: $box-model; +} + +@mixin hover-element { + background-color: $hoverBgColor; + color: $hoverTextColor; +} + +@mixin hover-element-primary { + background-color: $primaryLightColor; + color: $hoverTextColor; +} + +@mixin opacity($opacity) { + opacity: $opacity; + $opacity-ie: $opacity * 100; + filter: alpha(opacity=$opacity-ie); +} + +@mixin icon-override($icon) { + &:before { + content: $icon; + } +} + +@mixin border-box-sizing() { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +@mixin material-icon($icon) { + font-family: 'Material Icons'; + font-weight: normal; + font-style: normal; + font-size: 24px; /* Preferred icon size */ + display: inline-block; + width: 1em; + height: 1em; + line-height: 1; + text-transform: none; + letter-spacing: normal; + word-wrap: normal; + white-space: nowrap; + direction: ltr; + + /* Support for all WebKit browsers. */ + -webkit-font-smoothing: antialiased; + /* Support for Safari and Chrome. */ + text-rendering: optimizeLegibility; + + /* Support for Firefox. */ + -moz-osx-font-smoothing: grayscale; + + /* Support for IE. */ + font-feature-settings: 'liga'; + + &:before { + content: $icon; + } +} + +@mixin rotate($deg) { + -webkit-transform: rotate($deg); + -moz-transform: rotate($deg); + -o-transform: rotate($deg); + -ms-transform: rotate($deg); + transform: rotate($deg); +} + +@mixin scale($deg) { + -webkit-transform: scale($deg); + -moz-transform: scale($deg); + -o-transform: scale($deg); + -ms-transform: scale($deg); + transform: scale($deg); +} + +@mixin rippleitem() { + position: relative; + overflow: hidden; +} + +@mixin clearfix() { + &:before, + &:after { + content: ""; + display: table; + } + &:after { + clear: both; + } +} + +@mixin flex() { + display: -webkit-box; + display: -ms-flexbox; + display: flex; +} \ No newline at end of file diff --git a/ace-web/src/main/webapp/resources/sass/_theme_styles.scss b/ace-web/src/main/webapp/resources/sass/_theme_styles.scss new file mode 100644 index 0000000..3b23bff --- /dev/null +++ b/ace-web/src/main/webapp/resources/sass/_theme_styles.scss @@ -0,0 +1 @@ +/* Add your customizations of theme here */ \ No newline at end of file diff --git a/ace-web/src/main/webapp/resources/sass/layout/_dashboard.scss b/ace-web/src/main/webapp/resources/sass/layout/_dashboard.scss new file mode 100644 index 0000000..92f13bc --- /dev/null +++ b/ace-web/src/main/webapp/resources/sass/layout/_dashboard.scss @@ -0,0 +1,768 @@ +.dashboard { + + .task-box { + @include multi-shadow(0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14)); + + .task-box-header { + @include clearfix(); + padding: 8px 14px; + + i { + float: right; + color: #ffffff; + } + } + + .task-box-content { + background-color: #ffffff; + padding: 8px 14px; + + h3 { + font-weight: bold; + font-size: $fontSize; + margin: 14px 0 7px 0; + padding: 0; + } + + p { + color: $textSecondaryColor; + margin: 0 0 28px 0; + padding: 0; + } + } + + .task-box-footer { + @include clearfix(); + background-color: #ffffff; + padding: 8px 14px; + + img { + width: 32px; + float: right; + margin-left: 4px; + } + + .task-status { + @include border-radius(9px); + padding: 2px 8px; + color: #ffffff; + } + } + + &.task-box-1 { + .task-box-header { + background-color: #e91e63; + } + + .task-box-footer { + .task-status { + background-color: #e91e63; + } + } + } + + &.task-box-2 { + .task-box-header { + background-color: #ffc107; + } + + .task-box-footer { + .task-status { + background-color: #ffc107; + } + } + } + + &.task-box-3 { + .task-box-header { + background-color: #00bcd4; + } + + .task-box-footer { + .task-status { + background-color: #00bcd4; + } + } + } + } + + .overview-box { + text-align: center; + color: #ffffff; + @include multi-shadow(0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14)); + + .overview-box-header { + height: 24px; + } + + .overview-box-content { + padding: 8px 14px 14px 14px; + + .overview-box-icon { + @include border-radius(50%); + width: 40px; + height: 40px; + line-height: 40px; + margin: 0 auto; + margin-top: -28px; + + i { + line-height: inherit; + font-size: 28px; + } + } + + .overview-box-title { + font-size: 16px; + } + + .overview-box-count { + font-size: 24px; + } + } + + &.overview-box-1 { + .overview-box-header { + background-color: #f06292; + } + + .overview-box-content { + background-color: #e91e63; + + .overview-box-icon { + background-color: #e91e63; + } + } + } + + &.overview-box-2 { + .overview-box-header { + background-color: #4dd0e1; + } + + .overview-box-content { + background-color: #00bcd4; + + .overview-box-icon { + background-color: #00bcd4; + } + } + } + + &.overview-box-3 { + .overview-box-header { + background-color: #ffd54f; + } + + .overview-box-content { + background-color: #ffc107; + + .overview-box-icon { + background-color: #ffc107; + } + } + } + + &.overview-box-4 { + .overview-box-header { + background-color: #9e9e9e; + } + + .overview-box-content { + background-color: #616161; + + .overview-box-icon { + background-color: #616161; + } + } + } + } + + .task-list { + overflow: hidden; + + > .ui-panel { + min-height: 340px; + border: 0 none; + @include multi-shadow(0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14)); + } + + .ui-panel-content { + padding: 10px 0 !important; + } + + button { + margin-top: -25px; + margin-right: 10px; + float: right; + } + + ul { + list-style-type: none; + margin: 0; + padding: 0; + + li { + padding: 9.76px 14px; + border-bottom: 1px solid #dbdbdb; + + &:first-child { + margin-top: 10px; + } + } + + .ui-chkbox { + vertical-align: middle; + margin-right: 5px; + } + + .task-name { + vertical-align: middle; + } + + i { + color: $textSecondaryColor; + float: right; + } + } + } + + .contact-form { + overflow: hidden; + + .ui-panel { + min-height: 340px; + border: 0 none; + @include multi-shadow(0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14)); + } + + .ui-g-12 { + padding: 16px 10px; + } + + .ui-button { + margin-top: 20px; + } + } + + .messages { + overflow: hidden; + + > .ui-panel { + min-height: 340px; + border: 0 none; + @include multi-shadow(0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14)); + } + + .ui-panel-content { + padding: 15px 0 10px 0 !important; + } + + ul { + list-style-type: none; + padding: 0; + margin: 0; + + li { + border-bottom: 1px solid #d8d8d8; + + a { + padding: 9px; + width: 100%; + box-sizing: border-box; + text-decoration: none; + position: relative; + display: block; + @include border-radius(2px); + @include transition(background-color .2s); + @include clearfix(); + + img { + float: left; + } + + > div { + float: left; + margin-left: 10px; + + .name { + font-size: 14px; + font-weight: 700; + display: block; + color: $textColor; + } + + .message { + font-size: 14px; + color: $textSecondaryColor; + } + } + + button { + position: absolute; + top: 15px; + + &.message-btn { + right: 20px; + } + + &.remove-btn { + right: 60px; + } + } + + &:hover { + cursor: pointer; + background-color: #e8e8e8; + } + } + + &:last-child { + border: 0; + } + } + } + } + + .chat { + .ui-panel { + border: 0 none; + @include multi-shadow(0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14)); + } + + .ui-panel-content { + padding: 0 !important; + } + + .ui-tabs { + border-color: transparent; + } + + ul { + padding: 12px; + margin: 0; + list-style-type: none; + + li { + padding: 6px 0; + @include clearfix(); + + img { + width: 36px; + float: left; + } + + span { + padding: 6px 12px; + float: left; + display: inline-block; + margin: 4px 0; + @include border-radius(10px); + } + + &.message-from { + img, span { + float: left; + } + + img { + margin-right: 8px; + } + + span { + background-color: #e8eaf6; + } + } + + &.message-own { + img, span { + float: right; + } + + img { + margin-left: 8px; + } + + span { + background: #c8e6c9; + color: #000000; + } + } + } + } + + .new-message { + height: 40px; + border-top: 1px solid #dce2e7; + color: #afafc0; + + .message-attachment { + display: inline-block; + border-right: 1px solid #dce2e7; + width: 40px; + line-height: 40px; + height: 100%; + text-align: center; + + i { + line-height: inherit; + font-size: 24px; + } + } + + .message-input { + position: relative; + top: -6px; + width: calc(100% - 100px); + display: inline-block; + + input { + border: 0 none; + font-size: 14px; + width: 100%; + background-color: transparent; + outline: 0 none; + color: $textSecondaryColor; + } + } + } + } + + .global-sales { + .header-helper { + float:right; + @include opacity(.7); + } + + .ui-panel { + border: 0 none; + @include multi-shadow(0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14)); + } + + .ui-panel-content { + padding: 14px 9px 0px 9px; + } + + table { + width: 100%; + border-collapse: collapse; + + th { + font-weight: 700; + text-align: left; + padding: 8px 5px; + } + + tbody { + tr { + border-top: 1px solid $dividerColor; + + img { + width: 36px; + height: 36px; + } + + td { + padding: 8px 5px; + + &:nth-child(1) { + font-weight: 700; + text-align: center; + } + + &:nth-child(3) { + font-weight: 700; + } + + &:nth-child(7) { + text-align: right; + + button { + margin-left: 10px; + } + } + + .up-arrow { + color: #cddc39; + } + + .down-arrow { + color: #e91e63; + } + } + } + } + } + } + + .status-bars { + ul { + margin: 0; + padding: 0; + list-style-type: none; + + li { + padding: 8px 14px; + position: relative; + + span { + position: absolute; + right: 36px; + top: 8px; + } + + i { + position: absolute; + right: 4px; + top: 4px; + } + } + } + + .status-bar { + height: 18px; + width: 75%; + background-color: #d8d8d8; + @include border-radius(6px); + + .status-bar-value { + height: 100%; + color: #ffffff; + text-align: right; + padding-right: 4px; + padding-top: 1px; + @include box-sizing(border-box); + @include border-radius(6px); + } + + &.status-bar-1 { + .status-bar-value { + background-color: #e91e63; + } + + ~ i { + color: #e91e63; + } + } + + &.status-bar-2 { + .status-bar-value { + background-color: #00bcd4; + } + + ~ i { + color: #00bcd4; + } + } + + &.status-bar-3 { + .status-bar-value { + background-color: #ffc107; + } + + ~ i { + color: #ffc107; + } + } + + &.status-bar-4 { + .status-bar-value { + background-color: #cddc39; + } + + ~ i { + color: #cddc39; + } + } + + &.status-bar-5 { + .status-bar-value { + background-color: #ff9800; + } + + ~ i { + color: #ff9800; + } + } + } + } + + .image-box { + .card { + padding: 0; + img { + width: 100%; + } + + .image-box-content { + padding: 16px; + + h3 { + font-weight: 700; + margin-top: 0; + } + + .image-box-tag { + width: 40px; + text-align: left; + color: #ffffff; + background-color: #e91e63; + padding: 0 8px; + @include border-radius(6px); + } + } + + .image-box-footer { + text-align: right; + } + } + } + + .user-card { + border:1px solid $dividerColor; + padding: 0; + @include border-radius($borderRadius); + + .user-card-header { + height: 100px; + overflow: hidden; + + img { + width: 100%; + } + } + + .user-card-content { + min-height: 340px; + background-color: #ffffff; + position: relative; + + img { + position: absolute; + top: -90px; + left: 24px; + } + + .ui-button { + position: absolute; + width: 36px; + height: 36px; + top: -18px; + right: 24px; + } + + .user-card-name { + font-size: 20px; + color: $textColor; + position: absolute; + top: -60px; + margin-left: 110px; + font-weight: 700; + white-space: nowrap; + } + + .user-detail { + text-align: left; + + ul { + padding: 0px 0 32px 0; + margin: 0; + list-style-type: none; + + li { + padding: 16px 24px; + border-top: 1px solid $dividerColor; + + &:last-child { + border-bottom: 1px solid $dividerColor; + } + + i { + font-size: 24px; + margin-right: 8px; + width: 32px; + vertical-align: middle; + } + + .project-title { + font-weight: 700; + margin-right: 8px; + } + + .project-detail { + color: $textSecondaryColor; + } + + .project-progressbar { + display: inline-block; + width: 100px; + background-color: $dividerColor; + float: right; + margin-top: 12px; + + .project-progressbar-value { + background-color: $primaryColor; + height: 4px; + } + } + } + } + } + } + } + + .map { + .ui-panel { + border: 0 none; + @include multi-shadow(0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14)); + + .ui-panel-content { + padding: 8px; + + img { + width: 100%; + } + } + } + } + + .schedule { + .ui-panel { + border: 0 none; + @include multi-shadow(0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14)); + + .fc-today-button { + display: none; + } + } + } +} + +@media (max-width: 640px) { + .dashboard { + .status-bars { + .status-bar { + width: 65%; + } + } + + .global-sales { + table { + tbody { + tr td:nth-child(7) { + text-align: left; + + button { + display: block; + margin-left: 0; + + &:first-child { + margin-bottom: 4px; + } + } + } + } + } + } + } +} diff --git a/ace-web/src/main/webapp/resources/sass/layout/_exception.scss b/ace-web/src/main/webapp/resources/sass/layout/_exception.scss new file mode 100644 index 0000000..2d36c76 --- /dev/null +++ b/ace-web/src/main/webapp/resources/sass/layout/_exception.scss @@ -0,0 +1,168 @@ +.exception-body { + height: 100%; + background-position: center; + background-repeat: no-repeat; + background-size: cover; + + &.error { + background-image: url("\#{resource['serenity-layout:images/exception/error-bg.jpg']}"); + + .exception-panel { + .exception-code { + background-color: #e91e63; + + img { + margin-left: -194px; + } + } + + .exception-icon { + background-color: #e91e63; + } + } + } + + &.notfound { + background-image: url("\#{resource['serenity-layout:images/exception/notfound-bg.jpg']}"); + + .exception-panel { + .exception-code { + background-color: #e91e63; + + img { + margin-left: -206px; + } + } + + .exception-icon { + background-color: #e91e63; + } + } + } + + &.accessdenied { + background-image: url("\#{resource['serenity-layout:images/exception/access-bg.jpg']}"); + + .exception-panel { + .exception-code { + background-color: #ffb300; + + img { + margin-left: -178px; + } + } + + .exception-icon { + background-color: #ffb300; + } + } + } + + .exception-panel { + width: 550px; + height: 480px; + background-color: #ffffff; + position: absolute; + left: 50%; + top: 50%; + margin-left: -275px; + margin-top: -240px; + padding: 0; + text-align: center; + @include border-radius(2px); + @include multi-shadow(0 3px 5px 0 rgba(0, 0, 0, 0.2), 0 1px 18px 0 rgba(0, 0, 0, 0.12), 0 6px 10px 0 rgba(0, 0, 0, 0.14)); + + .exception-code { + height: 240px; + position: relative; + + img { + position: absolute; + bottom: 0; + height: 190px; + left: 50%; + } + } + + .exception-detail { + height: 240px; + position: relative; + padding: 60px 0 0 0; + + .exception-icon { + width: 90px; + height: 90px; + line-height: 90px; + text-align: center; + display: inline-block; + z-index: 100; + position: absolute; + top: -45px; + left: 50%; + margin-left: -45px; + @include border-radius(50%); + @include multi-shadow(0 1px 2px 0 rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.12), 0 0 1px 0 rgba(0, 0, 0, 0.14)); + + i { + font-size: 45px; + line-height: inherit; + color: #ffffff; + } + } + + h1 { + font-size: 15px; + font-weight: bold; + margin: 10px 0 8px 0; + } + + p { + color: $textSecondaryColor; + margin: 0 0 60px 0; + } + } + } +} + +@media (max-width: 640px) { + .exception-body { + .exception-panel { + left: 0; + margin-left: 0; + width: 100%; + } + + &.error { + .exception-panel { + .exception-code { + img { + height: 150px; + margin-left: -150px; + } + } + } + } + + &.notfound { + .exception-panel { + .exception-code { + img { + height: 150px; + margin-left: -163px; + } + } + } + } + + &.accessdenied { + .exception-panel { + .exception-code { + img { + height: 150px; + margin-left: -141px; + } + } + } + } + } +} diff --git a/ace-web/src/main/webapp/resources/sass/layout/_horizontal.scss b/ace-web/src/main/webapp/resources/sass/layout/_horizontal.scss new file mode 100644 index 0000000..7e54e9e --- /dev/null +++ b/ace-web/src/main/webapp/resources/sass/layout/_horizontal.scss @@ -0,0 +1,453 @@ +@media (min-width: 1025px) { + .layout-wrapper { + &.layout-menu-horizontal { + + .layout-sidebar { + width: 100%; + height: auto; + top: 64px; + left: 0; + z-index: 99; + + @if variable-exists(horizontalMenuBgImageLight) { + background-image: url("\#{resource['serenity-layout:images/special/#{$horizontalMenuBgImageLight}']}"); + background-size: auto; + background-repeat: no-repeat; + background-color: $horizontalMenuBgColor; + } + + .sidebar-logo { + display: none; + } + + > .nano { + overflow: visible; + + > .nano-content { + margin-right: 0 !important; + display: inherit; + height: auto; + position: static; + overflow: visible; + overflow-x: visible; + + &.sidebar-scroll-content .layout-menu { + padding-bottom: 0; + } + } + + > .nano-pane { + display: none !important; + } + } + + .layout-menu { + margin: 0; + + > li { + width: auto; + padding: 0; + position: relative; + float: left; + + > a { + height: 44px; + padding-top: 12px; + @include box-sizing(border-box); + @include border-radius(0); + + &:hover { + background-color: $horizontalSubmenuitemHoverBgColor; + } + + .menuitem-text { + vertical-align: middle; + } + + i { + float: none; + position: static; + vertical-align: middle; + margin-top: 0; + top: auto; + right: auto; + margin-right: 5px; + + &.layout-submenu-toggler { + display: inline-block; + margin-top: 2px; + } + } + } + + &.active-menuitem { + > a { + color: $horizontalMenuActiveTextColor; + + i { + color: $horizontalMenuActiveTextColor; + } + + &:hover { + color: $horizontalMenuActiveHoverTextColor; + + i { + color: $horizontalMenuActiveHoverTextColor; + } + } + } + } + + > ul { + top: 44px; + left: 0; + width: 230px; + position: absolute; + padding: 0; + margin: 0; + z-index: 100; + overflow: auto; + max-height: 450px; + @include overlay-content-shadow(); + + li { + a { + padding-left: 40px; + + &:hover { + background-color: $horizontalSubmenuitemHoverBgColor; + } + + i { + float: none; + left: 10px; + + &:last-child { + right: 10px; + left: auto; + } + } + + .layout-submenu-toggler { + display: block; + left: auto; + right: 10px; + } + } + + ul { + li { + a { + padding-left: 50px; + + &:hover { + background-color: $horizontalSubmenuitemHoverBgColor; + } + + i:first-child { + left: 20px; + } + } + } + + ul { + li { + a { + padding-left: 60px; + + &:hover { + background-color: $horizontalSubmenuitemHoverBgColor; + } + + i:first-child { + left: 30px; + } + } + } + } + } + } + } + + &.active-menuitem { + > ul { + background-color: $horizontalSubmenuBgColor; + } + } + } + + li { + + a { + &:hover { + background-color: $horizontalSubmenuitemHoverBgColor; + color: $horizontalMenuActiveHoverTextColor; + i { + color: $horizontalMenuActiveHoverTextColor; + } + } + + .menuitem-badge { + left: 18px; + top: 15px; + display: block; + } + } + } + } + + &.layout-sidebar-dark { + background-color: $horizontalDarkSubmenuBgColor; + + @if variable-exists(horizontalMenuBgImageDark) { + background-image: url("\#{resource['serenity-layout:images/special/#{$horizontalMenuBgImageDark}']}"); + background-color: $horizontalDarkMenuBgColor; + } + + .layout-menu { + > li { + > a { + &:hover { + background-color: $horizontalSubmenuitemDarkHoverBgColor; + color: $horizontalSubmenuitemDarkHoverTextColor; + + i { + color:$horizontalDarkMenuActiveTextColor; + } + } + } + + > ul { + li { + a { + &:hover { + background-color: $horizontalSubmenuitemDarkHoverBgColor; + } + } + } + } + } + + li { + a { + &:hover { + color: $horizontalSubmenuitemDarkHoverTextColor; + + i { + color: $horizontalSubmenuitemDarkHoverTextColor; + } + } + } + + &.active-menuitem { + > a { + @if not variable-exists(horizontalMenuBgImageDark) { + color: lighten($primaryLightColor, 6%); + + i { + color: lighten($primaryLightColor, 6%); + } + } + + &:hover { + color: $horizontalDarkMenuActiveHoverTextColor; + + i { + color: $horizontalDarkMenuActiveHoverTextColor; + } + } + } + } + } + + > li { + &.active-menuitem { + > a { + color: $horizontalDarkMenuActiveTextColor; + + i { + color: $horizontalDarkMenuActiveTextColor; + } + } + + > ul { + background-color: $horizontalDarkSubmenuBgColor; + } + } + } + } + } + } + + .layout-main { + margin-left: 0px; + } + + .layout-topbar { + width: 100%; + + .topbar-logo { + float: left; + margin-top: -10px; + margin-right: 20px; + display: inline-block; + + img { + height: 56px; + vertical-align: middle; + } + + .app-name { + color: $primaryTextColor; + font-size: 26px; + } + } + + .layout-topbar-menu-wrapper { + .topbar-menu { + > li.profile-item { + float: right; + margin-left: 20px; + + > ul { + left: auto; + right: 105px; + + &:before { + left: 232px; + } + } + } + } + + } + } + + .layout-breadcrumb { + padding-top: 108px; + } + + &.layout-rtl { + .layout-main { + margin-right: 0px; + + .layout-topbar { + .layout-topbar-menu-wrapper { + .topbar-menu { + > li { + &.profile-item { + float: left; + margin-right: 20px; + margin-left: auto; + + > ul { + left: 105px; + right: auto; + + &:before { + left: auto; + right: 232px; + } + } + } + } + } + } + + .topbar-logo { + float: right; + margin-right: auto; + margin-left: 20px; + } + } + } + + .layout-sidebar { + @include transition(right 0s); + + .layout-menu { + > li { + float: right; + + > a { + i { + margin-right: auto; + margin-left: 5px; + } + } + + > ul { + left: auto; + + li { + a { + padding-right: 40px; + padding-left: 0px; + + i { + right: 10px; + left: auto; + + &:last-child { + left: 10px; + right: auto; + } + } + + .layout-submenu-toggler { + right: auto; + left: 10px; + } + } + + ul { + li { + a { + padding-right: 50px; + padding-left: 0px; + + i:first-child { + right: 20px; + left: auto; + } + } + } + + ul { + li { + a { + padding-right: 60px; + padding-left: 0px; + + i:first-child { + right: 30px; + left: auto; + } + } + } + } + } + } + } + } + + li { + a { + .menuitem-badge { + right: 18px; + left: auto; + } + + i { + &:last-child { + margin-right: 3px; + } + } + } + } + } + } + } + } + } + } diff --git a/ace-web/src/main/webapp/resources/sass/layout/_landing.scss b/ace-web/src/main/webapp/resources/sass/layout/_landing.scss new file mode 100644 index 0000000..e1ed1c0 --- /dev/null +++ b/ace-web/src/main/webapp/resources/sass/layout/_landing.scss @@ -0,0 +1,551 @@ +.landing-body { + background-color: $bodyBgColor; + + * { + @include border-box-sizing(); + } + + p { + line-height: 1.5; + } + + #header { + background-color: $bodyBgColor; + + > div { + width: 960px; + margin: 0 auto; + height: 90px; + padding: 15px 0; + + img { + height: 60px; + } + + #landing-menu { + float: right; + list-style-type: none; + padding: 0; + margin: 20px 0 0 0; + + > li { + display: inline-block; + + a { + border-bottom: 5px solid transparent; + color: #616161; + display: inline-block; + min-width: 80px; + text-align: center; + height: 55px; + font-size: 15px; + @include transition(border-color $transitionDuration); + } + + &:hover { + a { + color: #3f51b5; + border-color: #3f51b5; + } + } + } + } + + #landing-menu-button { + color: #3f51b5; + display: none; + float: right; + margin-right: 15px; + margin-top: 5px; + + i { + font-size: 48px; + } + } + } + } + + #introduction { + > div { + background: url("\#{resource['serenity-layout:images/landing/landing-header.png']}") no-repeat; + min-height: 400px; + color: #ffffff; + text-align: center; + padding-top: 120px; + background-size: cover; + + h1 { + padding: 0; + margin: 0 0 20px 0; + } + + p { + max-width: 400px; + margin: 0 auto; + margin-bottom: 40px; + } + + button { + min-width: 180px; + } + } + } + + #features { + > div { + width: 960px; + margin: 0 auto; + padding: 60px 0; + + .feature-box { + @include clearfix(); + padding: 30px 15px 30px 0; + + img { + float: left; + margin-right: 30px; + } + + > div { + padding: 16px 0; + + h3 { + font-size: 15px; + margin: 0; + } + + p { + color: $textSecondaryColor; + margin: 8px; + } + } + } + } + } + + #stats { + @include background-gradient-top2bottom(#212121, #424242); + + > div { + width: 960px; + margin: 0 auto; + padding: 40px 0; + + .ui-g-12 { + padding: 20px; + } + + .stat-box { + @include border-radius($borderRadius); + background-color: #ffffff; + @include multi-shadow(0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14)); + padding: 18px; + text-align: center; + color: #e91e63; + + h3 { + font-weight: 400; + margin: 0; + } + + p { + margin: 0; + } + + &.stat-box-active { + background-color: #e91e63; + color: #ffffff; + } + } + } + } + + #video { + @include multi-shadow(0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14)); + + > div { + width: 960px; + margin: 0 auto; + padding: 60px 0; + + .video-description { + padding-top: 80px; + padding-right: 50px; + + h3 { + font-weight: 400; + font-size: 24px; + margin: 0 0 12px 0; + } + + p { + margin: 0 0 24px 0; + } + } + } + } + + #pricing { + > div { + width: 960px; + margin: 0 auto; + padding: 60px 0; + text-align: center; + + > h2 { + font-size: 24px; + font-weight: normal; + margin: 0 0 12px 0; + } + + > p { + color: $textSecondaryColor; + margin: 0 0 40px 0; + } + + .pricing-box { + width: 100%; + text-align: left; + @include border-radius($borderRadius); + + .pricing-header { + background-color: #212121; + padding: 16px; + text-align: center; + + h3 { + margin: 0; + color: #ffffff; + font-size: 15px; + font-weight: 400; + padding-bottom: 4px; + border-bottom: 1px solid #a7a5a5; + } + + p { + color: #a7a5a5; + margin: 0; + padding: 4px 0 0 0; + } + } + + .pricing-content { + padding: 16px; + min-height: 350px; + position: relative; + @include multi-shadow(0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14)); + + ul { + list-style-type: none; + margin: 0; + padding: 0; + + + li { + padding: 8px 0; + + i { + color: #4caf50; + vertical-align: middle; + margin-right: 6px; + } + } + } + + button { + position: absolute; + min-width: 180px; + bottom: 20px; + left: 50%; + margin-left: -90px; + } + + .pricing-fee { + position: absolute; + top: -24px; + right: 14px; + margin-left: -90px; + text-align: center; + font-size: 16px; + width: 48px; + height: 48px; + line-height: 48px; + background-color: #e91e63; + color: #ffffff; + @include border-radius(50%); + @include multi-shadow(0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14)); + } + } + + &.pricing-box-pro { + .pricing-header { + background-color: #e91e63; + color: #ffffff; + + h3 { + border-bottom: 1px solid #ffffff; + } + + p { + color: #ffffff; + } + } + + .pricing-content { + .pricing-fee { + background-color: #212121; + color: #ffffff; + } + } + } + } + } + } + + #contact { + background-color: #424242; + + > div { + width: 960px; + margin: 0 auto; + padding: 60px 0; + text-align: center; + + > h2 { + font-size: 24px; + font-weight: normal; + margin: 0 0 12px 0; + color: #f5f5f5; + } + + > p { + margin: 0 0 40px 0; + color: #e0e0e0; + } + + .contact-form { + text-align: left; + + > div { + padding: 1em .5em; + } + + button { + width: auto; + min-width: 180px; + margin-left: 15px; + margin-top: 40px; + } + + .md-inputfield { + input:focus ~ label, + input.ui-state-filled ~ label, + textarea:focus ~ label, + textarea.ui-state-filled ~ label, + .md-inputwrapper-focus ~ label, + .md-inputwrapper-filled ~ label { + color:$primaryLightColor; + } + + input:-webkit-autofill ~ label { + color:$primaryLightColor; + } + + input:focus { + border-color: $primaryLightColor; + } + + input { + color: #ffffff; + } + } + } + } + } + + #footer { + background-color: #212121; + color: #ffffff; + + > div { + width: 960px; + margin: 0 auto; + padding: 30px 0; + + .footer-logo { + height: 54px; + float: left; + margin-right: 14px; + } + + h4 { + margin: 0 0 8px 0; + font-weight: 700; + } + + p { + margin: 0; + line-height: 1.5; + + &:last-child { + margin-top: 8px; + } + } + + i { + vertical-align: middle; + } + + .footer-social { + a { + margin-right: 14px; + @include opacity(.7); + + img { + width: 30px; + height: 30px; + } + + &:hover { + @include opacity(1); + } + } + } + } + } +} + +@media screen and (max-width: 64em) { + + .landing-body { + padding-top: 90px; + + #header { + position: fixed; + top: 0; + z-index: 100; + width: 100%; + @include multi-shadow(0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14)); + + > div { + width: 100%; + padding-left: 15px; + + #landing-menu-button { + display: block; + } + + #landing-menu { + -webkit-animation-duration: .5s; + -moz-animation-duration: .5s; + animation-duration: .5s; + display: none; + float: none; + width: 100%; + text-align: center; + background-color: $bodyBgColor; + position: fixed; + top: 70px; + left: 0; + @include multi-shadow(0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14)); + + li { + display: block; + + a { + height: auto; + border-bottom: 0 none; + padding: 15px; + } + } + + &.landing-menu-active { + display: block; + } + } + } + } + + #introduction { + width: 100%; + + > div { + h1, p { + padding-left: 15px; + padding-right: 15px; + } + } + } + + #features { + > div { + width: 100%; + padding-left: 15px; + } + } + + #stats { + > div { + width: 100%; + } + } + + #video { + > div { + width: 100%; + text-align: center; + padding-left: 15px; + padding-right: 15px; + + .video-description { + padding-top: 0; + padding-right: 0; + } + + iframe { + width: 300px; + height: 200px; + } + } + } + + #pricing { + > div { + width: 100%; + adding-left: 15px; + padding-right: 15px; + } + } + + #contact { + > div { + width: 100%; + text-align: center; + + .contact-map { + text-align: center; + + img { + width: 100%; + } + } + + .contact-form { + .ui-g-12 { + padding: 15px; + } + } + } + } + + #footer { + > div { + width: 100%; + + .ui-g-12 { + padding-top: 24px; + } + } + } + } +} diff --git a/ace-web/src/main/webapp/resources/sass/layout/_layout.scss b/ace-web/src/main/webapp/resources/sass/layout/_layout.scss new file mode 100644 index 0000000..148d6c2 --- /dev/null +++ b/ace-web/src/main/webapp/resources/sass/layout/_layout.scss @@ -0,0 +1,11 @@ +@import '../variables/_layout'; +@import '../_mixins'; +@import '../_fonts'; +@import './_utils'; +@import './_dashboard'; +@import './_login'; +@import './_exception'; +@import './_landing'; +@import './_main'; +@import './_horizontal'; +@import '../_layout_styles.scss'; \ No newline at end of file diff --git a/ace-web/src/main/webapp/resources/sass/layout/_login.scss b/ace-web/src/main/webapp/resources/sass/layout/_login.scss new file mode 100644 index 0000000..e8352d9 --- /dev/null +++ b/ace-web/src/main/webapp/resources/sass/layout/_login.scss @@ -0,0 +1,82 @@ +.login-body { + //background-image: url("\#{resource['serenity-layout:images/login/login-bg.jpg']}"); + height: 100%; + background-position: center; + background-repeat: no-repeat; + background-size: cover; + + .login-panel { + width: 550px; + height: 480px; + background-color: #ffffff; + position: absolute; + left: 50%; + top: 50%; + margin-left: -275px; + margin-top: -240px; + padding: 0; + @include border-radius(2px); + @include multi-shadow(0 3px 5px 0 rgba(0, 0, 0, 0.2), 0 1px 18px 0 rgba(0, 0, 0, 0.12), 0 6px 10px 0 rgba(0, 0, 0, 0.14)); + + .login-panel-header { + background-color: $accentColor; + text-align: center; + padding: 8px 14px; + + img { + vertical-align: middle; + width: 135px; + } + } + + .login-panel-content { + padding: 50px 100px; + + h1 { + font-size: 16px; + margin-top: 0; + margin-bottom: 16px; + text-align: center; + } + + .ui-g-12, .ui-g-6 { + padding: 1em; + + &:last-child { + text-align: center; + + a { + color: $accentColor; + } + } + } + + .password-reset { + text-align: right; + + a { + color: $textSecondaryColor; + } + } + + .ui-chkbox-label { + margin: 0 0 0 8px; + vertical-align: middle; + } + } + } +} + +@media (max-width: 640px) { + .login-body { + .login-panel { + left: 0; + margin-left: 0; + width: 100%; + + .login-panel-content { + padding: 50px 25px; + } + } + } +} diff --git a/ace-web/src/main/webapp/resources/sass/layout/_main.scss b/ace-web/src/main/webapp/resources/sass/layout/_main.scss new file mode 100644 index 0000000..9f8ed14 --- /dev/null +++ b/ace-web/src/main/webapp/resources/sass/layout/_main.scss @@ -0,0 +1,1399 @@ +html { + height: 100%; +} + +body { + font-family: $fontFamily; + font-size: $fontSize; + color: $textColor; + -webkit-font-smoothing: antialiased; + padding: 0; + margin: 0; + min-height: 100%; + background-color: $bodyBgColor; + + .ajax-loader { + font-size: 32px; + color: $accentColor; + } +} + +.layout-wrapper { + + .layout-sidebar { + width: 240px; + height: 100%; + position: fixed; + left: -180px; + top: 0; + -webkit-transition-timing-function: cubic-bezier(0.86, 0, 0.07, 1); + transition-timing-function: cubic-bezier(0.86, 0, 0.07, 1); + z-index: 999999; + background-color: $sidebarBgColor; + @include box-sizing(border-box); + @include transition(left $transitionDuration); + @include shadow(3px 0 6px rgba(0, 0, 0, 0.3)); + + @if variable-exists(menuBgImageLight) { + background-image: url("\#{resource['serenity-layout:images/special/#{$menuBgImageLight}']}"); + background-size: 240px 100%; + background-repeat: no-repeat; + } + + .sidebar-logo { + height: 64px; + background-color: $sidebarLogoBgColor; + padding-top: 8px; + @include box-sizing(border-box); + + img { + height: 48px; + margin-left: 12px; + vertical-align: middle; + } + + .sidebar-anchor { + display: none; + width: 18px; + height: 18px; + border: 2px solid $primaryTextColor; + background-color: $primaryColor; + vertical-align: middle; + float: right; + margin-right: 8px; + margin-top: 12px; + @include border-radius(50%); + @include transition(background-color $transitionDuration); + } + + .app-name { + color: $primaryTextColor; + vertical-align: middle; + font-size: 26px; + } + } + + .layout-menu { + list-style-type: none; + margin: 10px 0 0 0; + padding: 0; + + li { + padding: 4px 10px; + width: 100%; + @include box-sizing(border-box); + + &.active-menuitem { + > a { + color: $subMenuitemActiveTextColor; + + i { + color: $subMenuitemActiveIconTextColor; + } + + i.layout-submenu-toggler { + @include rotate(-180deg); + } + } + } + + > a { + color: $menuitemTextColor; + display: block; + padding: 10px 10px 10px 10px; + position: relative; + @include border-radius(0); + @include box-sizing(border-box); + @include transition(all $transitionDuration); + + &:hover { + background-color: $menuitemHoverBgColor; + color: $menuitemHoverTextColor; + + i { + color: $menuitemHoverIconTextColor; + } + } + + > .menuitem-text { + display: inline-block; + max-width: 145px; + word-break: break-all; + } + + i { + color: $menuitemIconTextColor; + float: right; + width: 20px; + height: 20px; + font-size: 20px; + position: absolute; + right: 10px; + top: 50%; + margin-top: -10px; + + &.layout-submenu-toggler { + @include transition(all $transitionDuration); + right: 34px; + display: none; + } + } + + .menuitem-badge { + display: none; + position: absolute; + right: 54px; + top: 50%; + margin-top: -8px; + } + } + + ul { + display: none; + list-style-type: none; + margin: 0; + padding: 0; + + li { + padding: 4px 0; + + a { + padding-left: 20px; + } + + ul { + li { + a { + padding-left: 30px; + } + + ul { + li { + a { + padding-left: 40px; + } + } + + ul { + li { + a { + padding-left: 50px; + } + } + + ul { + li { + a { + padding-left: 60px; + } + } + + ul { + li { + a { + padding-left: 70px; + } + } + + ul { + li { + a { + padding-left: 80px; + } + } + } + } + } + } + } + } + } + } + } + } + + > li { + > a { + @include border-radius(6px); + } + + &.active-menuitem { + > a { + color: $menuitemActiveTextColor; + background-color: $menuitemActiveBgColor; + @include border-radius(6px); + @include border-radius-bottom(0); + @include multi-shadow(0 4px 20px 0 rgba(0,0,0,.14), 0 7px 10px -5px rgba(60,72,88,.3),0 7px 10px -5px rgba(60,72,88,.1)); + + i { + color: $menuitemActiveIconTextColor; + } + } + + > ul { + background-color: $submenuBgColor; + @include border-radius-bottom(6px); + } + } + } + + .menuitem-badge { + float: right; + display: inline-block; + width: 16px; + height: 16px; + margin-right: 6px; + text-align: center; + background-color: $accentColor; + color: $accentTextColor; + font-size: $fontSize - 2; + font-weight: 700; + line-height: 16px; + @include border-radius(50%); + } + } + + &.layout-sidebar-active { + left: 0; + + .sidebar-logo { + img { + display: inline; + } + + .sidebar-anchor { + display: inline-block; + } + } + + .layout-menu { + li { + a { + i.layout-submenu-toggler { + display: inline-block; + } + + .menuitem-badge { + display: inline-block; + } + } + } + } + } + + .nano { + .sidebar-scroll-content { + display: block; + height: 100%; + position: relative; + + .layout-menu { + padding-bottom: 120px; + } + } + + .nano-pane .nano-slider { + background-color: $nanoSliderBgColor; + opacity: 0.3; + filter: alpha(opacity=30); + } + } + + &.layout-sidebar-dark { + background-color: $darkSidebarBgColor; + + @if variable-exists(menuBgImageDark) { + background-image: url("\#{resource['serenity-layout:images/special/#{$menuBgImageDark}']}"); + } + + .layout-menu { + li { + > a { + color: $darkMenuitemTextColor; + + &:hover { + background-color: $darkMenuitemHoverBgColor; + color: $darkMenuitemHoverTextColor; + + i { + color: $darkMenuitemHoverIconTextColor; + } + } + + i { + color: $darkMenuitemIconTextColor; + } + } + + &.active-menuitem { + > a { + color: $darksubMenuitemActiveTextColor; + + i { + color: $darksubMenuitemActiveIconTextColor; + } + } + } + } + + > li { + &.active-menuitem { + > a { + background-color: $darkMenuitemActiveBgColor; + color: $darkMenuitemActiveTextColor; + + i { + color: $darkMenuitemActiveIconTextColor; + } + } + + > ul { + background-color: $darkSubmenuBgColor; + } + } + } + } + } + } + + .layout-main { + margin-left: 60px; + @include transition(margin-left $transitionDuration); + @include box-sizing(border-box); + + .layout-topbar { + height: 64px; + background-color: $primaryColor; + padding: 16px 42px 16px 24px; + position: fixed; + width: calc(100% - 40px); + @include transition(width $transitionDuration); + @include multi-shadow(0 2px 4px 0 rgba(0, 0, 0, 0.2), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 4px 5px 0 rgba(0, 0, 0, 0.14)); + @include box-sizing(border-box); + z-index: 999997; + + .topbar-logo { + display: none; + } + + .menu-btn { + display: none; + color: $topbarIconColor; + float: left; + + i { + font-size: 32px; + } + } + + .topbar-menu-btn { + display: none; + color: $topbarIconColor; + float: right; + + i { + font-size: 32px; + } + } + + .mobile-logo { + display: none; + height: 48px; + margin-top: -8px; + } + + .layout-topbar-menu-wrapper { + .sidebar-logo { + display: none; + } + + .topbar-menu { + list-style-type: none; + margin: 0; + padding: 0; + vertical-align: middle; + margin: 0; + -webkit-animation-duration: 0s; + -moz-animation-duration: 0s; + animation-duration: 0s; + @include clearfix(); + + .topbar-badge { + width: 16px; + height: 16px; + text-align: center; + background-color: $accentColor; + color: $accentTextColor; + font-size: $fontSize - 2; + font-weight: 700; + line-height: 16px; + @include border-radius(50%); + } + + > li { + float: right; + position: relative; + margin-left: 20px; + + > a { + color: $topbarTextColor; + position: relative; + + .topbar-item-name { + display: none; + } + + i { + font-size: 32px; + color: $topbarTextColor; + @include transition(color $transitionDuration); + + &:hover { + color: darken($topbarTextColor, 10%); + } + } + + .topbar-badge { + position: absolute; + right: -4px; + top: -24px; + } + } + + &.profile-item { + float: left; + margin-left: 0; + padding-top: 4px; + + > a { + display: inline-block; + position: relative; + top: -10px; + color: $topbarTextColor; + + .profile-image-wrapper { + display: inline-block; + vertical-align: middle; + border: 2px solid transparent; + width: 40px; + height: 40px; + @include border-radius(50%); + @include transition(border-color $transitionDuration); + + img { + width: 40px; + height: 40px; + } + } + + .profile-name { + display: inline-block; + margin-left: 6px; + vertical-align: middle; + margin-top: -4px; + } + + &:hover { + .profile-image-wrapper { + border-color: $accentColor; + } + } + } + + > ul { + right: auto; + left: 5px; + + &:before { + left: 8px; + } + } + } + + &.search-item { + position: relative; + display: inline-block; + vertical-align: middle; + height: 40px; + @include box-sizing(border-box); + + input { + border: 0 none; + width: 150px; + padding: 6px 24px 6px 6px; + border-bottom: 1px solid $topbarTextColor; + @include transition(all $transitionDuration); + outline: 0 none; + color: $topbarTextColor; + + &:focus { + border-bottom-color: $primaryTextColor; + + label { + color: $topbarTextColor; + } + } + } + + i { + position: absolute; + right: 0; + top: 0; + color: $topbarTextColor; + font-size: 28px; + } + + label { + color: $topbarTextColor; + margin-top: 6px; + } + + input:focus ~ i { + color: $primaryTextColor; + } + } + + > ul { + position: absolute; + top: 60px; + right: 5px; + display: none; + width: 250px; + background-color: $topbarSubmenuBgColor; + -webkit-animation-duration: .5s; + -moz-animation-duration: .5s; + animation-duration: .5s; + list-style-type: none; + margin: 0; + padding: 8px 0; + border-top: 4px solid $primaryColor; + @include overlay-content-shadow(); + + a { + padding: 10px 10px 10px 10px; + display: block; + width: 100%; + box-sizing: border-box; + color: $textColor; + + i { + color: $textSecondaryColor; + margin-right: 8px; + } + + img { + margin-right: 8px; + } + + i,img,span { + vertical-align: middle; + display: inline-block; + } + + .topbar-submenuitem-badge { + background-color: $accentColor; + padding: 2px 4px; + display: block; + font-size: 12px; + @include border-radius($borderRadius); + color: $accentTextColor; + float: right; + } + + &:hover { + background-color: $topbarSubmenuHoverBgColor; + @include transition(background-color $transitionDuration); + + i { + color: $textColor; + } + } + } + + &:before { + width: 0; + height: 0; + border-left: 8px solid transparent; + border-right: 8px solid transparent; + border-bottom: 15px solid $primaryColor; + content: " "; + position: absolute; + top: -15px; + left: 232px; + } + } + + &.active-topmenuitem { + > ul { + display: block; + } + } + } + } + } + } + + .layout-breadcrumb { + background-color: $breadcrumbBgColor; + @include shadow(inset 0 -2px 4px 0 rgba(0, 0, 0, 0.14)); + min-height: 42px; + padding-top: 64px; + @include clearfix(); + + ul { + margin: 8px 0 0 0; + padding: 0 0 0 20px; + list-style: none; + color: $textSecondaryColor; + display: inline-block; + + li { + display: inline-block; + vertical-align: middle; + color: $textSecondaryColor; + + &:nth-child(even) { + font-size: 20px; + } + + &:first-child(even) { + color: $primaryColor; + } + + a { + color: $textSecondaryColor; + } + } + } + + .layout-breadcrumb-options { + float: right; + padding: 0px 20px 0 0; + height: 100%; + + a { + color: $textSecondaryColor; + display: inline-block; + width: 42px; + height: 42px; + line-height: 42px; + text-align: center; + @include transition(background-color $transitionDuration); + + &:hover { + background-color: $hoverBgColor; + } + + i { + line-height: inherit; + } + } + } + } + + .layout-content { + padding: 17px 17px 24px 17px; + } + + .layout-main-mask { + display: none; + } + + .layout-footer { + padding: 16px 24px; + border: 0 none; + border: 1px solid $dividerColor; + background: $footerBgColor; + + img { + margin-top: 5px; + width: 100px; + } + + .footer-text-right { + float: right; + margin-top: 10px; + + span { + vertical-align: middle; + } + } + } + } +} + +.layout-wrapper-static { + .layout-sidebar { + left: 0; + + .sidebar-logo { + .sidebar-anchor { + display: inline-block; + background-color: $primaryTextColor; + } + } + + .layout-menu { + li { + a { + i.layout-submenu-toggler { + display: inline-block; + } + + .menuitem-badge { + display: inline-block; + } + } + } + } + } + + .layout-main { + margin-left: 240px; + + .layout-topbar { + width: calc(100% - 240px); + } + } +} + +.layout-wrapper-static-restore { + .layout-sidebar { + @include transition(none); + } +} + +@media (max-width: $mobileBreakpoint) { + .layout-wrapper { + .layout-sidebar { + left: -240px; + + .sidebar-logo { + .sidebar-anchor { + display: none !important; + } + } + } + + .layout-main { + margin-left: 0; + left: 0; + @include transition(left $transitionDuration); + -webkit-transition-timing-function: cubic-bezier(0.86, 0, 0.07, 1); + transition-timing-function: cubic-bezier(0.86, 0, 0.07, 1); + + .layout-topbar { + width: 100%; + @include clearfix(); + text-align: center; + padding: 16px 24px; + + .menu-btn { + display: inline-block; + } + + .topbar-menu-btn { + display: inline-block; + } + + .mobile-logo { + display: inline; + } + + .layout-topbar-menu-wrapper { + + .topbar-menu { + display: none; + -webkit-animation-duration: .5s; + -moz-animation-duration: .5s; + animation-duration: .5s; + text-align: left; + @include overlay-shadow(); + + &:before { + width: 0; + height: 0; + border-left: 8px solid transparent; + border-right: 8px solid transparent; + border-bottom: 15px solid $primaryColor; + content: " "; + position: absolute; + top: -15px; + left: 232px; + } + + &.topbar-menu-active { + position: fixed; + top: 75px; + right: 30px; + width: 250px; + display: block; + padding: 8px 0; + background-color: $topbarMobileMenuBgColor; + border-top: 4px solid $primaryColor; + + > li { + float: none; + display: block; + margin: 0; + + > a { + padding: 8px 14px; + display: block; + color: $textColor; + + &:hover { + background-color: $hoverBgColor; + + i { + color: $textColor; + } + } + + i { + color: $textSecondaryColor; + display: inline-block; + vertical-align: middle; + margin-right: 8px; + } + + .topbar-item-name { + display: inline-block; + vertical-align: middle; + } + + .topbar-badge { + position: static; + float: right; + margin-top: 4px; + } + } + + > ul { + position: static; + @include no-shadow(); + padding: 0; + width: 100%; + border-top: 0 none; + @include box-sizing(border-box); + + &:before { + display: none; + } + + a { + padding-left: 28px; + } + } + + &.profile-item { + img { + width: 24px; + height: 24px; + } + } + } + } + + li { + a { + font-size: $fontSize; + + i { + font-size: 24px; + } + } + + &.search-item { + padding: 8px 14px; + + input { + padding: 2px 2px 1px 2px; + border-color: $textSecondaryColor; + border-width: 0 0 1px 0; + border-style: solid; + color: $textColor; + margin-left: 28px; + width: 85%; + + &:focus { + border-bottom-color: $primaryColor; + border-width: 0 0 2px 0; + width: 85%; + + ~ i { + color: $primaryColor; + } + + ~ label { + color: $primaryColor; + top: -15px; + } + } + } + + i { + color: $textSecondaryColor; + right: auto; + left: 0px; + } + + label { + color: $textSecondaryColor; + left: 32px; + margin-top: 0; + } + } + } + } + } + } + } + + &.layout-wrapper-active { + overflow: hidden; + + .layout-sidebar { + left: 0; + @include no-shadow(); + + .layout-menu { + li { + a { + i.layout-submenu-toggler { + display: inline-block; + } + + .menuitem-badge { + display: inline-block; + } + } + } + } + } + + .layout-main { + position: fixed; + left: 240px; + width: calc(100%); + @include shadow(inset 3px 0px 6px 1px rgba(0, 0, 0, 0.3)); + + .layout-topbar { + @include shadow(inset 3px 0px 6px 1px rgba(0, 0, 0, 0.3)); + } + + .layout-breadcrumb { + @include shadow(inset 3px 0px 6px 1px rgba(0, 0, 0, 0.3)); + + .layout-breadcrumb-options { + display: none; + } + } + } + + .layout-main-mask { + z-index: 999998; + position: absolute; + left: 0; + top: 0; + background-color: $contentMobileMaskBgColor; + display: block; + @include opacity(.5); + width: 100%; + height: 100%; + overflow: hidden; + } + } + } + + body { + &.hidden-overflow { + overflow: hidden; + } + } +} + +.layout-rtl { + + &.layout-wrapper { + + .layout-sidebar { + left: auto; + right: -180px; + @include transition(right .3s); + direction: rtl; + + .sidebar-logo { + direction: rtl; + + img { + margin-left: 0px; + margin-right: 12px; + } + + .sidebar-anchor { + float: left; + margin-right: 0px; + margin-left: 8px; + } + } + + .layout-menu { + direction: rtl; + + li { + > a { + i { + float: left; + right: auto; + left: 10px; + + &.layout-submenu-toggler { + right: auto; + left: 34px; + } + } + + .menuitem-badge { + right: auto; + left: 54px; + } + } + + ul { + li { + a { + padding-right: 20px; + padding-left: 0px; + } + + ul { + li { + a { + padding-right: 30px; + padding-left: 0px; + } + + ul { + li { + a { + padding-right: 40px; + padding-left: 0px; + } + } + + ul { + li { + a { + padding-right: 50px; + padding-left: 0px; + } + } + + ul { + li { + a { + padding-right: 60px; + padding-left: 0px; + } + } + + ul { + li { + a { + padding-right: 70px; + padding-left: 0px; + } + } + + ul { + li { + a { + padding-right: 80px; + padding-left: 0px; + } + } + } + } + } + } + } + } + } + } + } + } + + .menuitem-badge { + float: left; + margin-right: 0px; + margin-left: 6px; + } + } + + &.layout-sidebar-active { + left: auto; + right: 0px; + } + + .nano { + + .nano-pane { + right: auto; + left: 0; + } + } + } + + .layout-main { + margin-left: 0px; + margin-right: 60px; + @include transition(margin-right .3s); + + .layout-topbar { + .menu-btn { + float: right; + } + + .topbar-menu-btn { + float: left; + } + + .layout-topbar-menu-wrapper { + .topbar-menu { + > li { + float: left; + margin-left: 0px; + margin-right: 20px; + + > a { + .topbar-badge { + left: -4px; + right: auto; + } + } + + &.profile-item { + float: right; + margin-left: 0px; + margin-right: 0px; + + > a { + .profile-name { + margin-left: 0px; + margin-right: 6px; + margin-top: 13px; + float: left; + } + } + + > ul { + left: auto; + right: 5px; + direction: rtl; + text-align: right; + + &:before { + left: auto; + right: 8px; + } + } + } + + &.search-item { + direction: rtl; + + input { + padding: 6px 6px 6px 24px; + } + + i { + right: auto; + left: 0; + } + + label { + right: 5px; + left: auto; + } + } + + > ul { + left: 5px; + right: auto; + direction: rtl; + text-align: right; + + a { + i, img { + margin-right: 0px; + margin-left: 8px; + } + + .topbar-submenuitem-badge { + float: left; + } + } + + &:before { + left: auto; + right: 232px; + } + } + } + } + } + } + + .layout-breadcrumb { + direction: rtl; + + ul { + padding: 0 20px 0 0; + } + + .layout-breadcrumb-options { + float: left; + padding: 0px 0px 0 20px; + } + } + + .layout-footer { + direction: rtl; + + .footer-text-right { + float: left; + margin-top: 10px; + } + } + } + } + + &.layout-wrapper-static { + .layout-sidebar { + left: auto; + right: 0; + } + + .layout-main { + margin-left: 0px; + margin-right: 240px; + } + } + + &.layout-wrapper-static-restore { + .layout-sidebar { + @include transition(none); + } + } + + @media (max-width: $mobileBreakpoint) { + &.layout-wrapper { + .layout-sidebar { + left: auto; + right: -240px; + } + + .layout-main { + margin-right: 0px; + margin-left: 0px; + left: auto; + right: 0; + @include transition(right .3s); + + .layout-topbar { + + .layout-topbar-menu-wrapper { + + .topbar-menu { + direction: rtl; + text-align: right; + + &:before { + right: 232px; + left: auto; + } + + &.topbar-menu-active { + left: 30px; + right: auto; + + > li { + float: none; + margin: 0px; + + > a { + i { + margin-right: 0px; + margin-left: 8px; + } + + .topbar-badge { + float: left; + } + } + + > ul { + a { + padding-left: 0px; + padding-right: 28px; + } + } + } + } + + > li { + &.profile-item { + > a { + .profile-name { + float: none; + } + } + } + } + + li { + &.search-item { + input { + margin-left: 0px; + margin-right: 28px; + padding: 2px 2px 1px 2px; + } + + i { + left: auto; + right: 0px; + } + + label { + right: 32px; + left: auto; + } + } + } + } + } + } + } + + &.layout-wrapper-active { + .layout-sidebar { + right: 0; + left: auto; + } + + .layout-main { + left: auto; + right: 240px; + } + + .layout-main-mask { + left: auto; + right: 0; + } + } + } + } +} + + diff --git a/ace-web/src/main/webapp/resources/sass/layout/_utils.scss b/ace-web/src/main/webapp/resources/sass/layout/_utils.scss new file mode 100644 index 0000000..a0f5354 --- /dev/null +++ b/ace-web/src/main/webapp/resources/sass/layout/_utils.scss @@ -0,0 +1,169 @@ +/* Utils */ +.clearfix:after { + content:" "; + display:block; + clear:both; +} + +.card { + @include content-shadow(); + @include border-radius(2px); + background: #ffffff; + padding: 16px; + margin-bottom: 16px; + box-sizing: border-box; + + &.card-w-title { + padding-bottom: 32px; + } + + h1 { + font-size: 24px; + font-weight: 400; + margin: 24px 0; + + &:first-child { + margin-top: 16px; + } + } + + h2 { + font-size: 22px; + font-weight: 400; + } + + h3 { + font-size: 20px; + font-weight: 400; + } + + h4 { + font-size: 18px; + font-weight: 400; + } +} + +.nopad { + padding: 0; + + .ui-panel-content { + padding: 0; + } +} + +@-webkit-keyframes fadeInDown { + from { + opacity: 0; + -webkit-transform: translate3d(0, -20px, 0); + transform: translate3d(0, -20px, 0); + } + + to { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +@keyframes fadeInDown { + from { + opacity: 0; + transform: translate3d(0, -20px, 0); + } + + to { + opacity: 1; + transform: none; + } +} + +@-webkit-keyframes fadeOutUp { + from { + opacity: 1; + } + + to { + opacity: 0; + -webkit-transform: translate3d(0, -20px, 0); + transform: translate3d(0, -20px, 0); + } +} + +@keyframes fadeOutUp { + from { + opacity: 1; + } + + to { + opacity: 0; + -webkit-transform: translate3d(0, -20px, 0); + transform: translate3d(0, -20px, 0); + } +} + +.fadeInDown { + -webkit-animation: fadeInDown 5s; /* Safari 4.0 - 8.0 */ + animation: fadeInDown 5s; +} + +.fadeOutUp { + -webkit-animation: fadeOutUp $transitionDuration; /* Safari 4.0 - 8.0 */ + animation: fadeOutUp $transitionDuration; +} + +.ui-shadow-1 { + -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); + -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); + box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); +} + +.ui-shadow-2 { + -webkit-box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23); + -moz-box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23); + box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23); +} + +.ui-shadow-3 { + -webkit-box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23); + -moz-box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23); + box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23); +} + +.ui-shadow-4 { + -webkit-box-shadow: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22); + -moz-box-shadow: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22); + box-shadow: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22); +} + +.ui-shadow-5 { + -webkit-box-shadow: 0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22); + -moz-box-shadow: 0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22); + box-shadow: 0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22); +} + +.ui-g { + -ms-flex-wrap: wrap; + + &.form-group { + > div { + padding: 12px 16px; + } + } +} + +.ui-panelgrid { + &.form-group { + .ui-panelgrid-cell { + padding: 12px 16px; + } + } +} + +.ui-selectoneradio, .ui-selectmanycheckbox { + &.form-group { + .ui-grid-row > div { + padding: 8px 16px; + } + } +} + diff --git a/ace-web/src/main/webapp/resources/sass/theme/_common.scss b/ace-web/src/main/webapp/resources/sass/theme/_common.scss new file mode 100644 index 0000000..07144c4 --- /dev/null +++ b/ace-web/src/main/webapp/resources/sass/theme/_common.scss @@ -0,0 +1,138 @@ +body { + .ui-widget, + .ui-widget .ui-widget { + font-family:$fontFamily; + text-decoration: none; + } + + .ui-widget-content { + background-color: $contentBgColor; + border: 1px solid $contentBorderColor; + padding: $contentPadding; + + .ui-icon { + color: $textSecondaryColor; + } + } + + .ui-widget-header { + background-color: $primaryColor; + color: $headerTextColor; + border: 1px solid $primaryColor; + padding: $headerPadding; + + .ui-icon { + color: $headerTextColor; + } + } + + .ui-state-active, .ui-state-highlight { + background-color: $accentColor; + color: $accentTextColor; + + .ui-icon { + color: $accentTextColor; + } + } + + .ui-state-disabled { + opacity: .35; + filter: Alpha(Opacity=35); + background-image: none; + } + + .ui-corner-all { + @include border-radius($borderRadius); + } + + .ui-corner-top { + @include border-radius-top($borderRadius); + } + + .ui-corner-bottom { + @include border-radius-bottom($borderRadius); + } + + .ui-corner-left { + @include border-radius-left($borderRadius); + } + + .ui-corner-right { + @include border-radius-right($borderRadius); + } + + .ui-widget-overlay { + background-color: #58575c; + @include opacity(.8); + } + + .ui-shadow { + + } + + .ui-icon { + font-family: 'Material Icons'; + font-weight: normal; + font-style: normal; + font-size: $iconFontSize; + display: inline-block; + width: $iconWidth; + height: $iconHeight; + line-height: 1; + text-transform: none; + letter-spacing: normal; + word-wrap: normal; + white-space: nowrap; + direction: ltr; + text-indent: 0; + overflow: visible; + + /* Support for all WebKit browsers. */ + -webkit-font-smoothing: antialiased; + /* Support for Safari and Chrome. */ + text-rendering: optimizeLegibility; + + /* Support for Firefox. */ + -moz-osx-font-smoothing: grayscale; + + /* Support for IE. */ + font-feature-settings: 'liga'; + } + + .material-icons { + font-family: 'Material Icons'; + font-weight: normal; + font-style: normal; + font-size: 24px; /* Preferred icon size */ + display: inline-block; + width: 1em; + height: 1em; + line-height: 1; + text-transform: none; + letter-spacing: normal; + word-wrap: normal; + white-space: nowrap; + direction: ltr; + + /* Support for all WebKit browsers. */ + -webkit-font-smoothing: antialiased; + /* Support for Safari and Chrome. */ + text-rendering: optimizeLegibility; + + /* Support for Firefox. */ + -moz-osx-font-smoothing: grayscale; + + /* Support for IE. */ + font-feature-settings: 'liga'; + } + + .fa { + font-family: 'FontAwesome'; + } + + a { + color: $primaryColor; + text-decoration: none; + } + +} \ No newline at end of file diff --git a/ace-web/src/main/webapp/resources/sass/theme/_data.scss b/ace-web/src/main/webapp/resources/sass/theme/_data.scss new file mode 100644 index 0000000..82dc389 --- /dev/null +++ b/ace-web/src/main/webapp/resources/sass/theme/_data.scss @@ -0,0 +1,779 @@ +body { + .ui-paginator { + padding: $paginatorPadding; + background-color: $primaryDarkColor; + + > a { + margin-top: -1px; + box-sizing: border-box; + color: #ffffff; + + span { + display: none; + } + + &.ui-state-hover { + background-color: $primaryLightColor; + @include border-radius(50%); + @include transition(background-color $transitionDuration); + } + } + + .ui-paginator-next { + padding: 0 6px; + vertical-align: middle; + @include material-icon("\e409"); + + &:before { + position: relative; + left: -6px; + } + } + + .ui-paginator-last { + padding: 0 6px; + vertical-align: middle; + @include material-icon("\e5dd"); + + &:before { + position: relative; + left: -6px; + } + } + + .ui-paginator-prev { + padding: 0 6px; + vertical-align: middle; + @include material-icon("\e408"); + + &:before { + position: relative; + left: -5px; + } + } + + .ui-paginator-first { + padding: 0 6px; + vertical-align: middle; + @include material-icon("\e5dc"); + + &:before { + position: relative; + left: -5px; + } + } + + .ui-paginator-pages { + vertical-align: middle; + margin: 0 6px 0 12px; + padding: 0; + + a { + color: $headerTextColor; + padding: 0; + width: 24px; + height: 24px; + line-height: 24px; + @include border-radius(50%); + @include transition(background-color $transitionDuration); + + &.ui-state-active { + color: $accentTextColor; + } + + &.ui-state-hover { + background-color: $primaryLightColor; + } + } + } + } + + .ui-datagrid { + .ui-datagrid-header { + padding: $headerPadding; + } + + .ui-panel { + .ui-panel-titlebar { + background-color: #ffffff; + color: $textColor; + border-color: $dividerColor; + } + } + } + + .ui-datalist { + .ui-datalist-header { + padding: $headerPadding; + } + } + + .ui-datatable { + .ui-datatable-header, + .ui-datatable-footer { + padding: $headerPadding; + + .ui-inputfield { + color: $inputBgColor; + + &:focus { + border-color: $inputBgColor; + } + } + } + + .ui-paginator { + padding: $paginatorPadding; + } + + thead { + th { + padding: $listItemPadding; + border: 0 none; + border-top: 1px solid $contentBorderColor; + background-color: #ffffff; + + &:first-child { + border-left: 1px solid $contentBorderColor; + } + + &:last-child { + border-right: 1px solid $contentBorderColor; + } + + &.ui-state-hover { + @include hover-element(); + } + + .ui-sortable-column-icon { + vertical-align: middle; + margin: -4px 0 0 0; + color: $textSecondaryColor; + + &.ui-icon-carat-2-n-s { + margin-left: 4px; + } + } + + .ui-column-resizer { + @include material-icon("\e86f"); + font-size: $fontSize + 2; + color: $textSecondaryColor; + } + + &.ui-state-active,&.ui-state-highlight { + background-color: $accentColor; + color: $accentTextColor; + border-top-color: $accentColor; + + .ui-icon { + color: $accentTextColor; + } + + .ui-inputfield { + color: $accentTextColor; + + &.ui-state-focus { + border-color: $accentTextColor; + } + } + } + } + + tr { + th { + border: 1px solid $contentBorderColor; + } + } + } + + tfoot { + td { + padding: $listItemPadding; + border: 1px solid $contentBorderColor; + background-color: $contentBgColor; + } + } + + tbody { + tr.ui-datatable-even { + background-color: $dataTableRowBgColorEven; + + &.ui-state-hover { + @include hover-element(); + } + + &.ui-state-highlight { + background-color: $accentColor; + color: $accentTextColor; + } + } + + tr { + td { + border: 1px solid $contentBorderColor; + padding: $listItemPadding; + + .ui-row-toggler { + display: inherit; + } + + &.ui-state-highlight { + .ui-inputfield { + color: $inputBgColor; + border-color: $inputBgColor; + + &:focus { + border-color: $inputBgColor; + } + } + } + + &.ui-state-error { + background-color: #e62a10; + border-color: #e62a10; + color: #ffffff; + } + } + + &.ui-widget-content { + border: 0 none; + } + + &.ui-state-highlightĀ { + background-color: $accentColor; + color: $accentTextColor; + } + + .ui-cell-editor-input { + input { + color: $accentTextColor; + } + } + } + + tr.ui-state-hover { + @include hover-element(); + } + + tr.ui-state-error { + background-color: #e62a10; + border-color: #e62a10; + color: #ffffff; + + .ui-inputfield, + .ui-inputfield.ui-state-error { + border-color: #ffffff; + } + } + + tr.ui-state-highlight { + td { + border-right-color: $accentDarkColor; + + &:last-child { + border-right-color: $contentBorderColor; + } + + &.ui-selection-column { + .ui-radiobutton-box { + border-color: $accentTextColor; + background-color: transparent; + + .ui-radiobutton-icon { + background-color: $accentTextColor; + } + } + + .ui-chkbox-box { + border-color: $accentTextColor; + background-color: transparent; + + .ui-chkbox-icon { + color: $accentTextColor; + margin-left: -3px; + } + } + } + } + + .ui-inputfield { + color: $inputBgColor; + border-color: $inputBgColor; + + &:focus { + border-color: $inputBgColor; + } + } + } + } + + > .ui-icon-arrowthick-1-s { + font-size: 18px; + color: $accentColor; + } + + > .ui-icon-arrowthick-1-n { + display: none !important; + } + + &.ui-datatable-scrollable { + .ui-datatable-scrollable-header, .ui-datatable-scrollable-footer { + border: 0 none; + background-color: transparent; + padding: 0px; + + .ui-datatable-data { + tr { + &.ui-widget-content { + padding: 0px; + } + } + + td { + color: $textColor; + } + } + } + + thead { + tr { + th { + color: $textColor; + font-size: $fontSize; + } + } + } + + tfoot { + tr { + td { + color: $textColor; + font-size: $fontSize; + } + } + } + } + } + + .ui-draggable-dragging.ui-state-default { + background-color: $primaryColor; + } + + .ui-picklist { + .ui-picklist-list { + padding: 0; + } + + .ui-picklist-caption { + padding: $headerPadding; + } + + li.ui-picklist-item { + padding: $listItemPadding; + margin: 0; + @include border-radius(0px); + + &.ui-state-hover { + @include hover-element(); + } + } + + .ui-picklist-buttons { + width: 48px; + + .ui-button { + &.ui-button-icon-only { + width: 32px; + margin-right: 0; + display: inline-block; + margin-bottom: 4px; + } + } + } + + .ui-picklist-buttons-cell { + text-align: center; + } + + .ui-picklist-filter-container { + margin-bottom: 4px; + + .ui-picklist-filter { + width: 100%; + } + + .ui-icon { + color: $textSecondaryColor; + top: 0px; + } + } + + &.ui-picklist-responsive { + .ui-picklist-buttons { + width: 48px; + + .ui-button { + &.ui-button-icon-only { + margin: 0 auto; + display: block; + margin-bottom: 8px; + } + } + } + + .ui-picklist-list { + .ui-picklist-item { + .ui-chkbox { + margin-right: 8px; + vertical-align: top; + } + + .ui-chkbox,.ui-chkbox * { + box-sizing: content-box; + } + } + } + + .ui-chkbox-box { + width: $iconWidth - 6px; + height: $iconHeight - 6px; + } + } + } + + .ui-orderlist { + .ui-orderlist-caption { + padding: $headerPadding; + @include border-box-sizing(); + } + + .ui-orderlist-list { + padding: 0; + box-sizing: border-box; + + li.ui-orderlist-item { + padding: $listItemPadding; + margin: 0; + @include border-radius(0px); + + &.ui-state-hover { + @include hover-element(); + } + } + } + + .ui-orderlist-controls { + width: 60px; + text-align: center; + + .ui-button { + &.ui-button-icon-only { + width: 32px; + margin: 0 0 8px 0; + display: inline-block; + } + } + } + } + + .ui-carousel { + padding: 0; + border: 0 none; + + .ui-carousel-header { + margin: 0; + + .ui-icon { + color: $headerTextColor; + } + + .ui-carousel-dropdown, + .ui-carousel-mobile-dropdown { + margin: 5px 10px; + } + } + + .ui-carousel-footer { + margin: 0; + padding: $headerPadding - 2px; + font-size: $fontSize - 2px; + } + + .ui-carousel-page-links { + margin-top: 2px; + } + } + + .ui-tree { + padding: 4px 7px; + + .ui-treenode-children { + padding-left: 28px; + } + + .ui-treenode-leaf-icon { + width: 23px; + } + + .ui-tree-container { + overflow: visible; + } + + .ui-treenode-content { + + .ui-chkbox { + margin: 0 4px 0 4px; + + .ui-icon { + color: #757575; + } + } + + .ui-tree-toggler { + vertical-align: middle; + } + + .ui-treenode-icon { + vertical-align: middle; + margin: 0 4px 0 4px; + } + + .ui-treenode-label { + padding: 0 4px; + margin: 0; + vertical-align: middle; + } + } + + .ui-tree-droppoint.ui-state-hover { + background-color: $accentColor; + } + + &.ui-tree-horizontal { + padding-left: 0; + padding-right: 0; + + .ui-treenode-content { + background-color: $contentBgColor; + border: 1px solid $contentBorderColor; + + .ui-tree-toggler { + vertical-align: middle; + } + + .ui-treenode-icon { + vertical-align: middle; + margin-right: 4px; + } + + &.ui-state-highlight { + background-color: $accentColor; + color: $accentTextColor; + + .ui-chkbox-box { + border-color: $accentTextColor; + + .ui-chkbox-icon { + color: $accentTextColor; + } + } + } + } + } + } + + .ui-tree-draghelper { + border: 1px solid $primaryColor; + } + + .fc { + .fc-button-group { + .ui-icon { + margin-top: 3px; + } + + .ui-state-active { + background-color: $accentColor; + color: $accentTextColor; + } + } + + .fc-event { + background-color: $primaryLightColor; + color: $primaryTextColor; + } + + table { + box-sizing: border-box; + } + + div.ui-widget-content { + padding-left: 0px; + padding-right: 0px; + } + } + + .ui-treetable { + .ui-treetable-header, + .ui-treetable-footer { + padding: $headerPadding; + } + + thead { + th { + background-color: $contentBgColor; + padding: $listItemPadding; + border: 0 none; + border-top: 1px solid $contentBorderColor; + + .ui-icon { + color: $textSecondaryColor; + } + + &:first-child { + border-left: 1px solid $contentBorderColor; + } + + &:last-child { + border-right: 1px solid $contentBorderColor; + } + + &.ui-state-hover { + @include hover-element(); + } + + .ui-sortable-column-icon { + vertical-align: middle; + margin: -4px 0 0 0; + color: $textSecondaryColor; + + &.ui-icon-carat-2-n-s { + margin-left: 4px; + } + } + + &.ui-state-active { + background-color: $accentColor; + color: $accentTextColor; + + .ui-icon { + color: $accentTextColor; + } + } + + .ui-column-resizer { + @include material-icon("\e86f"); + font-size: 16px; + color: $textSecondaryColor; + } + } + } + + tr { + th { + border: 1px solid $contentBorderColor; + } + } + + tfoot { + td { + border: 0 none; + padding: 10px 14px; + } + } + + tbody { + tr { + td { + border: 1px solid $contentBorderColor; + padding: $listItemPadding; + + .ui-treetable-toggler { + display: inline-block; + vertical-align: middle; + margin: 0 4px; + float: none; + } + + .ui-chkbox { + margin-right: 8px; + + .ui-chkbox-icon { + color: $textSecondaryColor; + } + } + } + + &.ui-state-hover { + @include hover-element(); + } + + &.ui-state-highlight { + .ui-chkbox { + .ui-chkbox-box { + border-color: $accentTextColor; + + .ui-icon { + color: $accentTextColor; + } + } + } + } + } + } + + &.ui-treetable-scrollable { + .ui-treetable-scrollable-header, .ui-treetable-scrollable-footer { + background-color: transparent; + border: 0 none; + padding: 0px; + } + + thead { + th { + background-color: #ffffff; + color: $textColor; + border-bottom: 1px solid $dividerColor; + border-top: 1px solid $dividerColor; + + &.ui-state-active { + background-color: $accentColor; + color: $accentTextColor; + } + } + + &.ui-treetable-scrollable-theadclone { + th { + padding-bottom: 0px; + padding-top: 0px; + line-height: 0px; + border-top: 0 none; + } + } + } + + tbody { + &.ui-widget-content { + padding: 0px; + } + + tr { + &.ui-widget-content { + padding: 0px; + } + } + } + } + } + + .ui-panelgrid { + tbody { + tr { + &.ui-widget-content { + border: 1px solid #d8d8d8; + } + } + } + } +} \ No newline at end of file diff --git a/ace-web/src/main/webapp/resources/sass/theme/_forms.scss b/ace-web/src/main/webapp/resources/sass/theme/_forms.scss new file mode 100644 index 0000000..ca63a10 --- /dev/null +++ b/ace-web/src/main/webapp/resources/sass/theme/_forms.scss @@ -0,0 +1,1419 @@ +body { + .ui-inputfield { + background: white no-repeat; + background-image: linear-gradient(to bottom, #D4AF37, #D4AF37), linear-gradient(to bottom, #bdbdbd, #bdbdbd); + background-size: 0 2px, 100% 1px; + background-position: 50% 100%, 50% 100%; + transition: background-size 0.3s cubic-bezier(0.64, 0.09, 0.08, 1); + border-width: 0; + padding: 2px 2px 2px 2px; + font-size: $fontSize; + @include border-radius(0px); + + &.ui-state-focus { + border-width: 0; + background-size: 100% 2px, 100% 1px; + outline: none; + padding-bottom: 2px; + } + + &.ui-state-disabled { + border-bottom: 1px dotted; + } + + &.ui-widget-content { + border-width: 1px; + background: transparent; + background-image: none; + } + + &.ui-state-error { + border-color: $inputInvalidBorderColor; + } + } + + .ui-inputfield:-webkit-autofill { + border-color: #bdbdbd; + border-style: solid; + border-width: 0px 0px 1px 0px; + + &.ui-state-focus { + padding-bottom: 0px; + } + } + + .md-inputfield { + display: block; + position:relative; + + input:focus ~ label, + input.ui-state-filled ~ label, + textarea:focus ~ label, + textarea.ui-state-filled ~ label, + .md-inputwrapper-focus ~ label, + .md-inputwrapper-filled ~ label { + top:-20px; + font-size:12px; + color:$primaryColor; + } + + input:-webkit-autofill ~ label { + top:-20px; + font-size:12px; + color:$primaryColor; + } + + label { + color:#999; + font-weight:normal; + position:absolute; + pointer-events:none; + left:5px; + top:1px; + transition: $transitionDuration ease all; + -moz-transition: $transitionDuration ease all; + -webkit-transition: $transitionDuration ease all; + } + + input.ui-state-error ~ label { + color: $inputErrorTextColor; + } + } + + .ui-selectonelistbox { + background-color: $inputBgColor; + border: 0 none; + @include border-radius($borderRadius); + + &.ui-inputfield { + padding: 0; + } + + .ui-selectlistbox-list { + padding: 0; + border: 1px solid $contentBorderColor; + } + + .ui-selectlistbox-item { + overflow: hidden; + padding: $listItemPadding; + margin: 0; + @include rippleitem(); + @include transition(background-color $transitionDuration); + @include border-radius(0); + + &.ui-state-hover { + @include hover-element(); + } + } + + .ui-selectlistbox-filter-container { + margin: 0; + padding: $inputHeaderPadding; + background-color: $primaryColor; + @include border-radius-top($borderRadius); + + .ui-inputfield { + border-color: darken($headerTextColor, 15%); + color: $headerTextColor; + width: 100%; + padding-left: 2px; + padding-right: $iconWidth; + @include border-box-sizing(); + + &.ui-state-focus { + border-color: $headerTextColor; + } + } + + .ui-icon { + color: $headerTextColor; + top: 6px; + right: 12px; + } + } + } + + .ui-multiselectlistbox { + .ui-multiselectlistbox-header { + padding: $inputHeaderPadding; + position: relative; + bottom: -1px; + } + + .ui-multiselectlistbox-list { + padding: 0; + background-color: $contentBgColor; + } + + li.ui-multiselectlistbox-item { + padding: $listItemPadding; + margin: 0; + @include rippleitem(); + @include transition(background-color $transitionDuration); + @include border-radius(0px); + + &.ui-state-hover { + @include hover-element(); + } + } + } + + .ui-button { + overflow: hidden; + background-color: $primaryColor; + color: $buttonTextColor; + height: 30px; + padding: 0 14px; + border: 0 none; + -moz-box-shadow: 0 1px 2.5px 0 rgba(0, 0, 0, 0.26), 0 1px 5px 0 rgba(0, 0, 0, 0.16); + -webkit-box-shadow: 0 1px 2.5px 0 rgba(0, 0, 0, 0.26), 0 1px 5px 0 rgba(0, 0, 0, 0.16); + box-shadow: 0 1px 2.5px 0 rgba(0, 0, 0, 0.26), 0 1px 5px 0 rgba(0, 0, 0, 0.16); + @include transition(background-color $transitionDuration); + + &.ui-state-hover { + background-color: $primaryDarkColor; + } + + &.ui-state-focus { + outline: 0 none; + background-color: lighten($primaryColor,10%); + } + + .ui-button-text { + padding: 0; + line-height: 30px; + font-size: $fontSize; + } + + .ui-icon { + color: #ffffff; + } + + &.ui-button-icon-only { + @include border-radius(50%); + width: 30px; + height: 30px; + + .ui-icon { + margin-top: -1 * $iconWidth / 2; + margin-left: -1 * $iconHeight / 2; + } + } + + &.ui-button-text-icon-left, + &.ui-button-text-icon-right { + .ui-icon { + margin-top: -1 * $iconWidth / 2; + } + } + + &.ui-button-text-icon-left { + padding-left: 36px; + } + + &.ui-button-text-icon-right { + padding-right: 36px; + } + + &.secondary-btn { + background-color: $accentColor; + color: $accentTextColor; + + &.ui-state-hover { + background-color: $accentDarkColor; + } + + &.ui-state-focus { + outline: 0 none; + background-color: lighten($accentColor,10%); + } + + .ui-icon { + color: $accentTextColor; + } + } + + &.blue-grey-btn { + background-color: #607D8B; + + &.ui-state-hover { + background-color: #37474F; + } + + &.ui-state-focus { + outline: 0 none; + background-color: lighten(#607D8B,10%); + } + } + + &.cyan-btn { + background-color: #00BCD4; + + &.ui-state-hover { + background-color: #00838F; + } + + &.ui-state-focus { + outline: 0 none; + background-color: lighten(#00BCD4,10%); + } + } + + &.teal-btn { + background-color: #009688; + + &.ui-state-hover { + background-color: #00695C; + } + + &.ui-state-focus { + outline: 0 none; + background-color: lighten(#009688,10%); + } + } + + &.red-btn { + background-color: #F44336; + + &.ui-state-hover { + background-color: #C62828; + } + + &.ui-state-focus { + outline: 0 none; + background-color: lighten(#F44336,10%); + } + } + + &.green-btn { + background-color: #4CAF50; + + &.ui-state-hover { + background-color: #2E7D32; + } + + &.ui-state-focus { + outline: 0 none; + background-color: lighten(#4CAF50,10%); + } + } + + &.deep-orange-btn { + background-color: #FF5722; + + &.ui-state-hover { + background-color: #D84315; + } + + &.ui-state-focus { + outline: 0 none; + background-color: lighten(#FF5722,10%); + } + } + + &.purple-btn { + background-color: #673AB7; + + &.ui-state-hover { + background-color: #4527A0; + } + + &.ui-state-focus { + outline: 0 none; + background-color: lighten(#673AB7,10%); + } + } + + &.pink-btn { + background-color: #E91E63; + + &.ui-state-hover { + background-color: #AD1457; + } + + &.ui-state-focus { + outline: 0 none; + background-color: lighten(#E91E63,10%); + } + } + + &.amber-btn { + background-color: #FFC107; + color: #212121; + + &.ui-state-hover { + background-color: #FF8F00; + } + + &.ui-state-focus { + outline: 0 none; + background-color: lighten(#FFC107,10%); + } + } + + &.orange-btn { + background-color: #FF9800; + + &.ui-state-hover { + background-color: #EF6C00; + } + + &.ui-state-focus { + outline: 0 none; + background-color: lighten(#FF9800,10%); + } + } + + &.brown-btn { + background-color: #795548; + + &.ui-state-hover { + background-color: #4E342E; + } + + &.ui-state-focus { + outline: 0 none; + background-color: lighten(#795548,10%); + } + } + + &.flat { + @include no-shadow(); + } + } + + .ui-buttonset { + .ui-state-active { + background-color: $accentColor; + color: $accentTextColor; + } + } + + .ui-splitbutton { + @include border-radius($borderRadius); + -moz-box-shadow: 0 1px 2.5px 0 rgba(0, 0, 0, 0.26), 0 1px 5px 0 rgba(0, 0, 0, 0.16); + -webkit-box-shadow: 0 1px 2.5px 0 rgba(0, 0, 0, 0.26), 0 1px 5px 0 rgba(0, 0, 0, 0.16); + box-shadow: 0 1px 2.5px 0 rgba(0, 0, 0, 0.26), 0 1px 5px 0 rgba(0, 0, 0, 0.16); + + > .ui-button { + @include no-shadow(); + + &.ui-state-active { + background-color: lighten($primaryColor,10%); + } + } + + .ui-splitbutton-menubutton { + height: 30px; + @include border-radius-left(0); + @include border-radius-right(3px); + } + } + + .ui-selectbooleanbutton { + &.ui-state-active { + background-color: $accentColor; + color: $accentTextColor; + + .ui-icon { + color: $accentTextColor; + } + } + } + + .ui-chkbox { + display: inline-block; + vertical-align: middle; + width: $iconWidth - 2px; + height: $iconHeight - 2px; + cursor: default; + margin: 0 4px 0 0; + + .ui-chkbox-box { + border: 2px solid $checkboxBorderColor; + width: $iconWidth - 6px; + height: $iconHeight - 6px; + + @include transition(background-color $transitionDuration); + + .ui-chkbox-icon { + font-size: $fontSize + 4; + margin-left: -2px; + margin-top: -2px; + } + + &.ui-state-active { + border-color: $primaryColor; + background-color: $primaryColor; + + .ui-chkbox-icon { + color: $primaryTextColor; + } + + &.ui-state-focus { + .ui-chkbox-icon { + color: $primaryTextColor; + } + } + } + + &.ui-state-focus { + border-color: $primaryColor; + @include content-shadow(); + @include transition(box-shadow $transitionDuration); + + .ui-chkbox-icon { + color: $primaryColor; + } + } + } + } + + .ui-radiobutton { + position: relative; + margin: 0 4px 0 0; + display: inline-block; + vertical-align: middle; + + .ui-radiobutton-box { + width: $fontSize -1px; + height: $fontSize -1px; + border: 2px solid $radioButtonBorderColor; + @include transition(box-shadow $transitionDuration); + @include border-radius(50%); + + &.ui-state-focus { + @include content-shadow(); + } + + &.ui-state-active { + border-color: $primaryColor; + background-color: transparent; + } + + .ui-radiobutton-icon { + top: 0; + left: 0; + width: 20px; + height: 20px; + display: block; + box-sizing: border-box; + position: absolute; + @include border-radius(50%); + transition: -webkit-transform ease .28s; + transition: transform ease .28s; + -webkit-transform: scale(0); + transform: scale(0); + } + + .ui-icon-bullet { + background-color: $primaryColor; + -webkit-transform: scale(0.5); + transform: scale(0.5); + margin-left: 0; + } + } + } + + .ui-selectmanycheckbox, .ui-selectoneradio { + &.ui-widget { + label { + display: inline-block; + vertical-align: middle; + margin-top: 0; + } + } + } + + .ui-autocomplete-panel { + padding: 0; + border: 0 none; + @include border-radius(0); + + &.ui-shadow { + @include overlay-input-shadow(); + } + + .ui-autocomplete-list { + padding: 0; + + .ui-autocomplete-item { + padding: $listItemPadding; + margin: 0; + @include border-radius(0); + @include transition(background-color $transitionDuration); + + .ui-autocomplete-query { + font-weight: 700; + } + } + + .ui-autocomplete-group { + padding: $listItemPadding; + } + } + } + + .ui-autocomplete { + .ui-autocomplete-dropdown { + right: 0; + margin-right: 0; + + &.ui-button.ui-button-icon-only { + background-color: transparent; + @include no-shadow(); + height: 20px; + width: 20px; + padding: 0; + + .ui-button-text { + display: none; + } + + .ui-icon { + color: $textSecondaryColor; + } + } + } + + &.ui-autocomplete-multiple { + .ui-autocomplete-multiple-container { + &.ui-inputfield { + @include border-box-sizing(); + padding: 2px 2px 1px 2px; + } + + &.ui-state-focus { + padding-bottom: 0; + } + } + + .ui-autocomplete-input-token { + float: none; + display: inline-block; + margin: 0 1px; + vertical-align: middle; + + > input { + padding: 0; + font-size: $fontSize; + margin: 0; + } + } + + .ui-autocomplete-token { + display: inline-block; + float: none; + vertical-align: middle; + + .ui-autocomplete-token-icon { + margin-top: -10px; + } + } + } + } + + .ui-selectonemenu { + border-width: 0; + background: white no-repeat; + background-image: linear-gradient(to bottom, #3F51B5, #3F51B5), linear-gradient(to bottom, #bdbdbd, #bdbdbd); + background-size: 0 2px, 100% 1px; + background-position: 50% 100%, 50% 100%; + transition: background-size 0.3s cubic-bezier(0.64, 0.09, 0.08, 1); + padding-bottom: 2px; + box-sizing: border-box; + @include border-radius(0); + + &.ui-state-focus { + border-width: 0; + background-size: 100% 2px, 100% 1px; + outline: none; + padding-bottom: 2px; + } + + .ui-selectonemenu-trigger { + height: $iconHeight; + width: $iconWidth; + font-size: $iconFontSize; + margin-top: 0; + padding: 0; + top: 0; + margin-right: 0; + + .ui-icon { + height: $iconHeight; + width: $iconWidth; + margin-top: 0; + color: $textSecondaryColor; + } + } + + .ui-selectonemenu-label { + &.ui-inputfield { + background: none; + font-family: $fontFamily; + } + } + } + + .ui-selectonemenu-panel { + padding: 0; + @include border-radius(0); + + .ui-selectonemenu-list { + padding: 0; + } + + .ui-selectonemenu-item { + margin: 0; + padding: $listItemPadding; + @include transition(background-color $transitionDuration); + @include border-radius(0); + + &.ui-state-hover { + @include hover-element(); + } + } + + .ui-selectonemenu-item-group { + padding: 8px; + } + + &.ui-shadow { + @include overlay-input-shadow(); + } + + .ui-selectonemenu-filter-container { + .ui-icon { + top: 5px; + right: 8px; + } + } + } + + .ui-selectcheckboxmenu { + border-bottom: 1px solid $inputBorderColor; + @include border-box-sizing(); + @include border-radius(0); + + .ui-selectcheckboxmenu-label-container { + display: block; + + .ui-selectcheckboxmenu-label { + padding-top: 2px; + padding-bottom: 1px; + padding-left: 2px; + } + } + + .ui-selectcheckboxmenu-trigger { + height: $iconHeight; + width: $iconWidth; + font-size: $iconFontSize; + padding: 0; + + .ui-icon { + height: $iconHeight; + width: $iconWidth; + margin-top: 0; + color: $textSecondaryColor; + } + } + } + + .ui-selectcheckboxmenu-panel { + padding: 0; + border: 0 none; + @include border-radius(0); + @include overlay-input-shadow(); + + .ui-selectcheckboxmenu-header { + padding: $inputHeaderPadding; + margin: 0; + @include border-radius(0); + + .ui-chkbox { + float: none; + margin: 0 8px 0 1px; + + .ui-chkbox-box { + border-color: $headerTextColor; + + .ui-chkbox-icon { + border-color: $headerTextColor; + } + + &.ui-state-active { + .ui-chkbox-icon { + border-color: $headerTextColor; + } + } + + &.ui-state-focus { + background-color: $primaryLightColor; + @include transition(background-color $transitionDuration); + } + } + } + + .ui-selectcheckboxmenu-filter-container { + width: 70%; + display: inline-block; + vertical-align: middle; + float: none; + + .ui-icon { + top: -2px; + right: 0px; + color: $headerTextColor; + } + + .ui-inputfield { + border-color: darken($headerTextColor, 15%); + padding-right: 30px; + width: 100%; + border-color: $headerTextColor; + @include border-box-sizing(); + + &:focus { + border-color: $headerTextColor; + } + } + } + + .ui-selectcheckboxmenu-close { + margin-right: -6px; + + span { + color: #ffffff; + @include transition(color $transitionDuration); + } + + &.ui-state-hover { + padding: 1px; + + span { + color: $accentColor; + } + } + } + } + + .ui-selectcheckboxmenu-items-wrapper { + padding: 0; + + .ui-selectcheckboxmenu-items { + padding: 0; + } + } + + .ui-selectcheckboxmenu-item { + padding: $listItemPadding; + + label { + vertical-align: middle; + display: inline-block; + } + + .ui-chkbox { + margin-left: 2px; + } + } + } + + .ui-fluid { + .ui-selectonemenu { + .ui-selectonemenu-trigger { + width: $iconWidth; + padding: 0; + } + } + } + + #keypad-div { + @include border-radius(0); + + .keypad-key { + border: 0 none; + background-color: #ffffff; + font-size: $fontSize; + padding: 4px; + @include border-radius(50%); + @include transition(background-color $transitionDuration); + + &.ui-state-hover { + @include hover-element(); + } + } + + .keypad-shift, .keypad-enter, .keypad-spacebar, .keypad-back, .keypad-close, .keypad-clear { + @include border-radius(0); + background-color: $primaryColor; + color: #ffffff; + + &.ui-state-hover { + background-color: $primaryDarkColor; + color: #ffffff; + } + } + + &.ui-shadow { + @include overlay-input-shadow(); + } + } + + .ui-selectmanymenu { + padding: 0; + background-color: $inputBgColor; + @include border-radius($borderRadius); + + .ui-selectlistbox-item { + padding: $listItemPadding; + margin: 0; + position: relative; + overflow: hidden; + @include border-radius(0); + + &.ui-state-hover { + @include hover-element(); + } + + .ui-chkbox { + background-color: transparent; + margin: -2px 8px 0 0; + + .ui-chkbox-box { + &.ui-state-active { + border-color: #ffffff; + background-color: $accentColor; + } + } + } + } + + .ui-selectlistbox-filter-container { + margin: 0; + padding: $inputHeaderPadding; + background-color: $primaryColor; + @include border-radius-top($borderRadius); + + .ui-inputfield { + border-color: darken($headerTextColor, 15%); + color: $headerTextColor; + width: 100%; + padding-left: 2px; + padding-right: $iconWidth; + @include border-box-sizing(); + + &.ui-state-focus { + border-color: $headerTextColor; + } + } + + .ui-icon { + color: $headerTextColor; + top: 6px; + right: 12px; + } + } + + tr { + &.ui-selectlistbox-item { + td { + padding: 6px; + } + } + } + } + + .ui-spinner { + .ui-spinner-button { + width: 18px; + height: 10px; + padding: 0; + margin-right: 0; + background-color: transparent; + color: $textColor; + z-index: auto; + @include no-shadow(); + + .ui-icon-triangle-1-n { + color: $textColor; + } + + .ui-icon-triangle-1-s { + color: $textColor; + } + + .ui-icon { + top: 0px; + height: 12px; + color: $textSecondaryColor; + } + } + + .ui-spinner-up { + .ui-icon { + top: 4px; + } + } + + .ui-spinner-down { + .ui-icon { + top: 2px; + } + } + + .ui-spinner-input { + padding-right: 30px; + } + } + + .ui-fluid { + .ui-spinner { + .ui-spinner-button { + width: 25px; + height: 10px; + } + + .ui-spinner-input { + padding-right: 30px; + } + } + } + + .ui-inputswitch { + height: 14px; + width: 34px !important; + overflow: visible; + background-color: rgb(158,158,158); + border-color: rgb(158,158,158); + padding: 0; + @include border-radius(8px); + + .ui-inputswitch-handle { + top: -3px; + background-color: #ffffff; + @include border-radius(50%); + @include transition(background-color $transitionDuration); + width: 20px !important; + height: 20px !important; + -webkit-box-shadow: rgba(0, 0, 0, 0.2) 0px 1px 3px 0px, rgba(0, 0, 0, 0.137255) 0px 1px 1px 0px, rgba(0, 0, 0, 0.117647) 0px 2px 1px -1px; + -moz-box-shadow: rgba(0, 0, 0, 0.2) 0px 1px 3px 0px, rgba(0, 0, 0, 0.137255) 0px 1px 1px 0px, rgba(0, 0, 0, 0.117647) 0px 2px 1px -1px; + box-shadow: rgba(0, 0, 0, 0.2) 0px 1px 3px 0px, rgba(0, 0, 0, 0.137255) 0px 1px 1px 0px, rgba(0, 0, 0, 0.117647) 0px 2px 1px -1px; + } + + .ui-inputswitch-on { + visibility: hidden; + } + + .ui-inputswitch-off, .ui-inputswitch-on { + span { + visibility: hidden; + } + } + + &.ui-inputswitch-checked { + background-color: $accentLightColor; + border-color: $accentLightColor; + + .ui-inputswitch-handle { + background-color: $accentColor; + color: $accentTextColor; + } + } + } + + .ui-slider { + padding: 0; + + .ui-slider-handle { + background-color: $accentColor; + color: $accentTextColor; + @include border-radius(50%); + width: 20px; + height: 20px; + transform: scale(.7); + @include transition(all .4s cubic-bezier(.25,.8,.25,1)); + + &.ui-state-hover, + &.ui-state-focus { + transform: scale(1); + } + + &:focus { + outline: 0 none; + } + } + + &.ui-slider-horizontal { + height: 2px; + border: 0 none; + background-color: #bdbdbd; + + .ui-slider-handle { + top: -.65em; + } + } + + &.ui-slider-vertical { + width: 2px; + border: 0 none; + background-color: #bdbdbd; + + .ui-slider-handle { + left: -9px; + } + } + + .ui-slider-range { + padding: 0; + background-color: $accentColor; + color: $accentTextColor; + } + } + + .ui-calendar { + .ui-datepicker-trigger { + top: 7px; + right: 28px; + background-color: transparent; + color: $textColor; + height: $iconHeight; + width: $iconWidth; + @include no-shadow(); + @include border-radius(0); + + .ui-icon { + color: $textSecondaryColor; + } + } + } + + .ui-datepicker { + padding: 0; + width: 275px; + + &.ui-shadow { + @include overlay-input-shadow(); + } + + .ui-datepicker-header { + padding: $headerPadding; + background: $primaryDarkColor; + border-color: $primaryDarkColor; + @include border-radius-top(2px); + @include border-radius-bottom(0); + + .ui-datepicker-next { + cursor: pointer; + top: 8px; + font-size: $iconFontSize; + right: 8px; + color: #ffffff; + @include material-icon("\e039"); + + .ui-icon { + display: none; + } + + &.ui-datepicker-next-hover { + right: 8px; + } + } + + .ui-datepicker-prev { + cursor: pointer; + top: 8px; + font-size: $iconFontSize; + @include material-icon("\e039"); + @include rotate(180deg); + left: 8px; + color: #ffffff; + + .ui-icon { + display: none; + } + + &.ui-datepicker-prev-hover { + left: 8px; + } + } + } + + table { + table-layout: fixed; + border-spacing: 0; + border-collapse: collapse; + } + + thead { + tr { + color: #ffffff; + background: $primaryColor; + } + } + + tbody { + td { + padding: 2px; + box-sizing: border-box; + + a,span { + padding: .2em; + margin: 0; + text-align: center; + color: $textColor; + display: inline-block; + height: 28px; + width: 28px; + line-height: 28px; + @include border-radius(50%); + + &.ui-state-hover { + @include hover-element(); + } + + &.ui-state-active { + color: #ffffff; + background-color: $accentColor; + color: $accentTextColor; + } + } + + &.ui-datepicker-today { + a,span { + color: $textColor; + background-color: #ffffff; + border: 1px solid $accentColor; + + &.ui-state-active { + color: #ffffff; + background-color: $accentColor; + color: $accentTextColor; + } + } + } + } + } + + &.ui-datepicker-multi { + .ui-datepicker-header { + @include border-radius(0); + } + + .ui-datepicker-group { + table { + width: 100%; + @include border-box-sizing(); + } + } + } + + .ui-timepicker-div { + .ui_tpicker_time { + input { + border-color: #bdbdbd; + @include transition(border-color $transitionDuration); + width: 100%; + position: relative; + top: 5px; + left: -5px; + + &.ui-state-focus { + border-width: 0 0 2px 0; + border-color: $primaryColor; + padding-bottom: 0px; + } + } + } + + dl { + margin: -16px 0 40px 0; + + dt { + padding: $listItemPadding; + } + + dd { + margin-top: 42px; + } + } + } + + } + + .ui-fluid { + .ui-calendar { + .ui-datepicker-trigger.ui-button { + top: -4px; + width: 24px; + } + } + } + + .ui-rating { + .ui-rating-cancel { + text-indent: 0; + + a { + color: $textSecondaryColor; + background: none; + @include material-icon("\e5c9"); + font-size: $iconFontSize; + } + } + + .ui-rating-star { + text-indent: 0; + + a { + font-size: $iconFontSize; + color: $textSecondaryColor; + background: none; + @include material-icon("\e83a"); + font-size: $iconFontSize; + } + + &.ui-rating-star-on { + a { + color: $accentColor; + @include material-icon("\e838"); + font-size: $iconFontSize; + } + } + } + } + + .ui-password-panel { + &.ui-shadow { + @include overlay-input-shadow(); + } + } + + .ui-fileupload { + .ui-fileupload-buttonbar { + padding: $headerPadding; + + .ui-icon-arrowreturnthick-1-n { + @include icon_override('file_upload'); + } + + .ui-button { + background-color: $accentColor; + color: $accentTextColor; + margin-right: 6px; + + .ui-icon { + color: $accentTextColor; + } + + &.ui-state-hover { + background-color: $accentDarkColor; + } + } + } + + .ui-fileupload-content { + .ui-messages-error { + .ui-icon { + color: #ffffff; + } + } + } + } + + .ui-editor { + &.ui-widget-content { + padding: 0px; + } + } + + .ui-inputgroup { + height: 100%; + + .ui-inputgroup-addon, + .ui-inputgroup-addon-checkbox { + padding: $inputGroupPadding; + border-color: $inputGroupBorderColor; + background-color: $inputGroupBgColor; + color: $inputGroupTextColor; + min-width: $inputGroupAddonMinWidth; + border-left: 0; + border-right: 0; + border-top: 0; + + &:first-child { + @include border-radius-left(0); + } + + &:last-child { + @include border-radius-right($borderRadius); + } + } + + .ui-inputgroup-addon { + align-self: flex-end; + + > i { + @include flex(); + align-self: flex-end; + font-size: $inputGroupIconFontSize; + } + } + + .ui-inputtext { + align-self: flex-end; + } + + .md-inputfield { + -webkit-box-flex: 1; + -ms-flex: 1 1 auto; + flex: 1 1 auto; + width: 1%; + display: inherit; + + label { + top: 5px; + } + } + + .ui-button { + .ui-button-text { + padding: 0; + } + } + + .ui-inputgroup-addon-checkbox { + padding: 0; + position: relative; + + .ui-chkbox { + vertical-align: baseline; + position: absolute; + top: 50%; + left: 50%; + margin-top: -1 * $checkboxHeight / 2; + margin-left: -1 * $checkboxWidth / 2; + } + } + } + + .ui-fluid { + .ui-inputgroup { + .ui-button { + &.ui-button-icon-only { + width: 1.643em; + height: 1.643em; + min-width: 0; + padding: 0; + + .ui-button-icon-left { + margin-left: -.45em; + } + } + } + } + } +} \ No newline at end of file diff --git a/ace-web/src/main/webapp/resources/sass/theme/_icons.scss b/ace-web/src/main/webapp/resources/sass/theme/_icons.scss new file mode 100644 index 0000000..30e9d4f --- /dev/null +++ b/ace-web/src/main/webapp/resources/sass/theme/_icons.scss @@ -0,0 +1,977 @@ +.ui-icon-carat-2-n-s {@include icon-override("\e164");} +.ui-icon-triangle-1-n { @include icon-override("\e316"); } +.ui-icon-triangle-1-e { @include icon-override("\e315"); } +.ui-icon-triangle-1-s { @include icon-override("\e313"); } +.ui-icon-triangle-1-w { @include icon-override("\e314"); } +.ui-icon-carat-1-n { @include icon-override("\e316"); } +.ui-icon-carat-1-e { @include icon-override("\e315"); } +.ui-icon-carat-1-s { @include icon-override("\e313"); } +.ui-icon-carat-1-w { @include icon-override("\e314"); } +.ui-icon-arrow-1-n { @include icon-override("\e037"); @include rotate(-90deg);} +.ui-icon-arrowstop-1-n { @include icon-override("\e044"); @include rotate(-90deg);} +.ui-icon-arrow-1-s { @include icon-override("\e037"); @include rotate(90deg);} +.ui-icon-arrowstop-1-s { @include icon-override("\e045"); @include rotate(-90deg);} +.ui-icon-arrow-1-w { @include icon-override("\e037"); @include rotate(180deg);} +.ui-icon-arrowstop-1-w { @include icon-override("\e020"); } +.ui-icon-arrow-1-e { @include icon-override("\e037"); } +.ui-icon-arrowstop-1-e { @include icon-override("\e01f"); } +.ui-icon-arrowthick-1-s { @include icon-override("\e037"); @include rotate(90deg);} +.ui-icon-arrowthick-1-n { @include icon-override("\e037"); @include rotate(-90deg);} +.ui-icon-circle-triangle-e {@include icon-override("\e039"); } +.ui-icon-circle-triangle-w {@include icon-override("\e039"); @include rotate(180deg);} +.ui-icon-circle-triangle-s {@include icon-override("\e039"); @include rotate(90deg);} +.ui-icon-radio-off {@include icon-override("\e836");} +.ui-icon-radio-on {@include icon-override("\e837");} +.ui-icon-folder-collapsed {@include icon-override("\e2c7");} +.ui-icon-document {@include icon-override("\e14f");} +.ui-icon-video {@include icon-override("\e02c");} +.ui-icon-music {@include icon-override("\e405");} +.ui-icon-plus {@include icon-override("\e145");} +.ui-icon-minus {@include icon-override("\e15b");} +.ui-icon-plusthick {@include icon-override("\e145");} +.ui-icon-minusthick {@include icon-override("\e15b");} +.ui-icon-pencil {@include icon-override("\e3c9");} +.ui-icon-closethick { @include icon-override("\e5cd"); } +.ui-icon-circle-close { @include icon-override("\e5c9"); } +.ui-icon-gear { @include icon-override("\e8b8"); } +.ui-icon-calendar { @include icon-override("\e916"); } +.ui-icon-trash { @include icon-override("\e92b"); } +.ui-icon-notice { @include icon-override("\e001"); } +.ui-icon-alert { @include icon-override("\e002"); } +.ui-icon-circle-zoomin { @include icon-override("\e8ff"); } +.ui-icon-circle-zoomout { @include icon-override("\e900"); } +.ui-icon-circle-arrow-e { @include icon-override("\e039"); } +.ui-icon-circle-arrow-w { @include icon-override("\e039"); @include rotate(180deg); } + +.ui-icon-3d-rotation { @include icon-override("\e84d"); } +.ui-icon-ac-unit { @include icon-override("\eb3b"); } +.ui-icon-access-alarm { @include icon-override("\e190"); } +.ui-icon-access-alarms { @include icon-override("\e191"); } +.ui-icon-access-time { @include icon-override("\e192"); } +.ui-icon-accessibility { @include icon-override("\e84e"); } +.ui-icon-accessible { @include icon-override("\e914"); } +.ui-icon-account-balance { @include icon-override("\e84f"); } +.ui-icon-account-balance-wallet { @include icon-override("\e850"); } +.ui-icon-account-box { @include icon-override("\e851"); } +.ui-icon-account-circle { @include icon-override("\e853"); } +.ui-icon-adb { @include icon-override("\e60e"); } +.ui-icon-add { @include icon-override("\e145"); } +.ui-icon-add-a-photo { @include icon-override("\e439"); } +.ui-icon-add-alarm { @include icon-override("\e193"); } +.ui-icon-add-alert { @include icon-override("\e003"); } +.ui-icon-add-box { @include icon-override("\e146"); } +.ui-icon-add-circle { @include icon-override("\e147"); } +.ui-icon-add-circle-outline { @include icon-override("\e148"); } +.ui-icon-add-location { @include icon-override("\e567"); } +.ui-icon-add-shopping-cart { @include icon-override("\e854"); } +.ui-icon-add-to-photos { @include icon-override("\e39d"); } +.ui-icon-add-to-queue { @include icon-override("\e05c"); } +.ui-icon-adjust { @include icon-override("\e39e"); } +.ui-icon-airline-seat-flat { @include icon-override("\e630"); } +.ui-icon-airline-seat-flat-angled { @include icon-override("\e631"); } +.ui-icon-airline-seat-individual-suite { @include icon-override("\e632"); } +.ui-icon-airline-seat-legroom-extra { @include icon-override("\e633"); } +.ui-icon-airline-seat-legroom-normal { @include icon-override("\e634"); } +.ui-icon-airline-seat-legroom-reduced { @include icon-override("\e635"); } +.ui-icon-airline-seat-recline-extra { @include icon-override("\e636"); } +.ui-icon-airline-seat-recline-normal { @include icon-override("\e637"); } +.ui-icon-airplanemode-active { @include icon-override("\e195"); } +.ui-icon-airplanemode-inactive { @include icon-override("\e194"); } +.ui-icon-airplay { @include icon-override("\e055"); } +.ui-icon-airport-shuttle { @include icon-override("\eb3c"); } +.ui-icon-alarm { @include icon-override("\e855"); } +.ui-icon-alarm-add { @include icon-override("\e856"); } +.ui-icon-alarm-off { @include icon-override("\e857"); } +.ui-icon-alarm-on { @include icon-override("\e858"); } +.ui-icon-album { @include icon-override("\e019"); } +.ui-icon-all-inclusive { @include icon-override("\eb3d"); } +.ui-icon-all-out { @include icon-override("\e90b"); } +.ui-icon-android { @include icon-override("\e859"); } +.ui-icon-announcement { @include icon-override("\e85a"); } +.ui-icon-apps { @include icon-override("\e5c3"); } +.ui-icon-archive { @include icon-override("\e149"); } +.ui-icon-arrow-back { @include icon-override("\e5c4"); } +.ui-icon-arrow-downward { @include icon-override("\e5db"); } +.ui-icon-arrow-drop-down { @include icon-override("\e5c5"); } +.ui-icon-arrow-drop-down-circle { @include icon-override("\e5c6"); } +.ui-icon-arrow-drop-up { @include icon-override("\e5c7"); } +.ui-icon-arrow-forward { @include icon-override("\e5c8"); } +.ui-icon-arrow-upward { @include icon-override("\e5d8"); } +.ui-icon-art-track { @include icon-override("\e060"); } +.ui-icon-aspect-ratio { @include icon-override("\e85b"); } +.ui-icon-assessment { @include icon-override("\e85c"); } +.ui-icon-assignment { @include icon-override("\e85d"); } +.ui-icon-assignment-ind { @include icon-override("\e85e"); } +.ui-icon-assignment-late { @include icon-override("\e85f"); } +.ui-icon-assignment-return { @include icon-override("\e860"); } +.ui-icon-assignment-returned { @include icon-override("\e861"); } +.ui-icon-assignment-turned-in { @include icon-override("\e862"); } +.ui-icon-assistant { @include icon-override("\e39f"); } +.ui-icon-assistant-photo { @include icon-override("\e3a0"); } +.ui-icon-attach-file { @include icon-override("\e226"); } +.ui-icon-attach-money { @include icon-override("\e227"); } +.ui-icon-attachment { @include icon-override("\e2bc"); } +.ui-icon-audiotrack { @include icon-override("\e3a1"); } +.ui-icon-autorenew { @include icon-override("\e863"); } +.ui-icon-av-timer { @include icon-override("\e01b"); } +.ui-icon-backspace { @include icon-override("\e14a"); } +.ui-icon-backup { @include icon-override("\e864"); } +.ui-icon-battery-alert { @include icon-override("\e19c"); } +.ui-icon-battery-charging-full { @include icon-override("\e1a3"); } +.ui-icon-battery-full { @include icon-override("\e1a4"); } +.ui-icon-battery-std { @include icon-override("\e1a5"); } +.ui-icon-battery-unknown { @include icon-override("\e1a6"); } +.ui-icon-beach-access { @include icon-override("\eb3e"); } +.ui-icon-beenhere { @include icon-override("\e52d"); } +.ui-icon-block { @include icon-override("\e14b"); } +.ui-icon-bluetooth { @include icon-override("\e1a7"); } +.ui-icon-bluetooth-audio { @include icon-override("\e60f"); } +.ui-icon-bluetooth-connected { @include icon-override("\e1a8"); } +.ui-icon-bluetooth-disabled { @include icon-override("\e1a9"); } +.ui-icon-bluetooth-searching { @include icon-override("\e1aa"); } +.ui-icon-blur-circular { @include icon-override("\e3a2"); } +.ui-icon-blur-linear { @include icon-override("\e3a3"); } +.ui-icon-blur-off { @include icon-override("\e3a4"); } +.ui-icon-blur-on { @include icon-override("\e3a5"); } +.ui-icon-book { @include icon-override("\e865"); } +.ui-icon-bookmark { @include icon-override("\e866"); } +.ui-icon-bookmark-border { @include icon-override("\e867"); } +.ui-icon-border-all { @include icon-override("\e228"); } +.ui-icon-border-bottom { @include icon-override("\e229"); } +.ui-icon-border-clear { @include icon-override("\e22a"); } +.ui-icon-border-color { @include icon-override("\e22b"); } +.ui-icon-border-horizontal { @include icon-override("\e22c"); } +.ui-icon-border-inner { @include icon-override("\e22d"); } +.ui-icon-border-left { @include icon-override("\e22e"); } +.ui-icon-border-outer { @include icon-override("\e22f"); } +.ui-icon-border-right { @include icon-override("\e230"); } +.ui-icon-border-style { @include icon-override("\e231"); } +.ui-icon-border-top { @include icon-override("\e232"); } +.ui-icon-border-vertical { @include icon-override("\e233"); } +.ui-icon-branding-watermark { @include icon-override("\e06b"); } +.ui-icon-brightness-1 { @include icon-override("\e3a6"); } +.ui-icon-brightness-2 { @include icon-override("\e3a7"); } +.ui-icon-brightness-3 { @include icon-override("\e3a8"); } +.ui-icon-brightness-4 { @include icon-override("\e3a9"); } +.ui-icon-brightness-5 { @include icon-override("\e3aa"); } +.ui-icon-brightness-6 { @include icon-override("\e3ab"); } +.ui-icon-brightness-7 { @include icon-override("\e3ac"); } +.ui-icon-brightness-auto { @include icon-override("\e1ab"); } +.ui-icon-brightness-high { @include icon-override("\e1ac"); } +.ui-icon-brightness-low { @include icon-override("\e1ad"); } +.ui-icon-brightness-medium { @include icon-override("\e1ae"); } +.ui-icon-broken-image { @include icon-override("\e3ad"); } +.ui-icon-brush { @include icon-override("\e3ae"); } +.ui-icon-bubble-chart { @include icon-override("\e6dd"); } +.ui-icon-bug-report { @include icon-override("\e868"); } +.ui-icon-build { @include icon-override("\e869"); } +.ui-icon-burst-mode { @include icon-override("\e43c"); } +.ui-icon-business { @include icon-override("\e0af"); } +.ui-icon-business-center { @include icon-override("\eb3f"); } +.ui-icon-cached { @include icon-override("\e86a"); } +.ui-icon-cake { @include icon-override("\e7e9"); } +.ui-icon-call { @include icon-override("\e0b0"); } +.ui-icon-call-end { @include icon-override("\e0b1"); } +.ui-icon-call-made { @include icon-override("\e0b2"); } +.ui-icon-call-merge { @include icon-override("\e0b3"); } +.ui-icon-call-missed { @include icon-override("\e0b4"); } +.ui-icon-call-missed-outgoing { @include icon-override("\e0e4"); } +.ui-icon-call-received { @include icon-override("\e0b5"); } +.ui-icon-call-split { @include icon-override("\e0b6"); } +.ui-icon-call-to-action { @include icon-override("\e06c"); } +.ui-icon-camera { @include icon-override("\e3af"); } +.ui-icon-camera-alt { @include icon-override("\e3b0"); } +.ui-icon-camera-enhance { @include icon-override("\e8fc"); } +.ui-icon-camera-front { @include icon-override("\e3b1"); } +.ui-icon-camera-rear { @include icon-override("\e3b2"); } +.ui-icon-camera-roll { @include icon-override("\e3b3"); } +.ui-icon-cancel { @include icon-override("\e5c9"); } +.ui-icon-card-giftcard { @include icon-override("\e8f6"); } +.ui-icon-card-membership { @include icon-override("\e8f7"); } +.ui-icon-card-travel { @include icon-override("\e8f8"); } +.ui-icon-casino { @include icon-override("\eb40"); } +.ui-icon-cast { @include icon-override("\e307"); } +.ui-icon-cast-connected { @include icon-override("\e308"); } +.ui-icon-center-focus-strong { @include icon-override("\e3b4"); } +.ui-icon-center-focus-weak { @include icon-override("\e3b5"); } +.ui-icon-change-history { @include icon-override("\e86b"); } +.ui-icon-chat { @include icon-override("\e0b7"); } +.ui-icon-chat-bubble { @include icon-override("\e0ca"); } +.ui-icon-chat-bubble-outline { @include icon-override("\e0cb"); } +.ui-icon-check { @include icon-override("\e5ca"); } +.ui-icon-check-box { @include icon-override("\e834"); } +.ui-icon-check-box-outline-blank { @include icon-override("\e835"); } +.ui-icon-check-circle { @include icon-override("\e86c"); } +.ui-icon-chevron-left { @include icon-override("\e5cb"); } +.ui-icon-chevron-right { @include icon-override("\e5cc"); } +.ui-icon-child-care { @include icon-override("\eb41"); } +.ui-icon-child-friendly { @include icon-override("\eb42"); } +.ui-icon-chrome-reader-mode { @include icon-override("\e86d"); } +.ui-icon-class { @include icon-override("\e86e"); } +.ui-icon-clear { @include icon-override("\e14c"); } +.ui-icon-clear-all { @include icon-override("\e0b8"); } +.ui-icon-close { @include icon-override("\e5cd"); } +.ui-icon-closed-caption { @include icon-override("\e01c"); } +.ui-icon-cloud { @include icon-override("\e2bd"); } +.ui-icon-cloud-circle { @include icon-override("\e2be"); } +.ui-icon-cloud-done { @include icon-override("\e2bf"); } +.ui-icon-cloud-download { @include icon-override("\e2c0"); } +.ui-icon-cloud-off { @include icon-override("\e2c1"); } +.ui-icon-cloud-queue { @include icon-override("\e2c2"); } +.ui-icon-cloud-upload { @include icon-override("\e2c3"); } +.ui-icon-code { @include icon-override("\e86f"); } +.ui-icon-collections { @include icon-override("\e3b6"); } +.ui-icon-collections-bookmark { @include icon-override("\e431"); } +.ui-icon-color-lens { @include icon-override("\e3b7"); } +.ui-icon-colorize { @include icon-override("\e3b8"); } +.ui-icon-comment { @include icon-override("\e0b9"); } +.ui-icon-compare { @include icon-override("\e3b9"); } +.ui-icon-compare-arrows { @include icon-override("\e915"); } +.ui-icon-computer { @include icon-override("\e30a"); } +.ui-icon-confirmation-number { @include icon-override("\e638"); } +.ui-icon-contact-mail { @include icon-override("\e0d0"); } +.ui-icon-contact-phone { @include icon-override("\e0cf"); } +.ui-icon-contacts { @include icon-override("\e0ba"); } +.ui-icon-content-copy { @include icon-override("\e14d"); } +.ui-icon-content-cut { @include icon-override("\e14e"); } +.ui-icon-content-paste { @include icon-override("\e14f"); } +.ui-icon-control-point { @include icon-override("\e3ba"); } +.ui-icon-control-point-duplicate { @include icon-override("\e3bb"); } +.ui-icon-copyright { @include icon-override("\e90c"); } +.ui-icon-create { @include icon-override("\e150"); } +.ui-icon-create-new-folder { @include icon-override("\e2cc"); } +.ui-icon-credit-card { @include icon-override("\e870"); } +.ui-icon-crop { @include icon-override("\e3be"); } +.ui-icon-crop-16-9 { @include icon-override("\e3bc"); } +.ui-icon-crop-3-2 { @include icon-override("\e3bd"); } +.ui-icon-crop-5-4 { @include icon-override("\e3bf"); } +.ui-icon-crop-7-5 { @include icon-override("\e3c0"); } +.ui-icon-crop-din { @include icon-override("\e3c1"); } +.ui-icon-crop-free { @include icon-override("\e3c2"); } +.ui-icon-crop-landscape { @include icon-override("\e3c3"); } +.ui-icon-crop-original { @include icon-override("\e3c4"); } +.ui-icon-crop-portrait { @include icon-override("\e3c5"); } +.ui-icon-crop-rotate { @include icon-override("\e437"); } +.ui-icon-crop-square { @include icon-override("\e3c6"); } +.ui-icon-dashboard { @include icon-override("\e871"); } +.ui-icon-data-usage { @include icon-override("\e1af"); } +.ui-icon-date-range { @include icon-override("\e916"); } +.ui-icon-dehaze { @include icon-override("\e3c7"); } +.ui-icon-delete { @include icon-override("\e872"); } +.ui-icon-delete-forever { @include icon-override("\e92b"); } +.ui-icon-delete-sweep { @include icon-override("\e16c"); } +.ui-icon-description { @include icon-override("\e873"); } +.ui-icon-desktop-mac { @include icon-override("\e30b"); } +.ui-icon-desktop-windows { @include icon-override("\e30c"); } +.ui-icon-details { @include icon-override("\e3c8"); } +.ui-icon-developer-board { @include icon-override("\e30d"); } +.ui-icon-developer-mode { @include icon-override("\e1b0"); } +.ui-icon-device-hub { @include icon-override("\e335"); } +.ui-icon-devices { @include icon-override("\e1b1"); } +.ui-icon-devices-other { @include icon-override("\e337"); } +.ui-icon-dialer-sip { @include icon-override("\e0bb"); } +.ui-icon-dialpad { @include icon-override("\e0bc"); } +.ui-icon-directions { @include icon-override("\e52e"); } +.ui-icon-directions-bike { @include icon-override("\e52f"); } +.ui-icon-directions-boat { @include icon-override("\e532"); } +.ui-icon-directions-bus { @include icon-override("\e530"); } +.ui-icon-directions-car { @include icon-override("\e531"); } +.ui-icon-directions-railway { @include icon-override("\e534"); } +.ui-icon-directions-run { @include icon-override("\e566"); } +.ui-icon-directions-subway { @include icon-override("\e533"); } +.ui-icon-directions-transit { @include icon-override("\e535"); } +.ui-icon-directions-walk { @include icon-override("\e536"); } +.ui-icon-disc-full { @include icon-override("\e610"); } +.ui-icon-dns { @include icon-override("\e875"); } +.ui-icon-do-not-disturb { @include icon-override("\e612"); } +.ui-icon-do-not-disturb-alt { @include icon-override("\e611"); } +.ui-icon-do-not-disturb-off { @include icon-override("\e643"); } +.ui-icon-do-not-disturb-on { @include icon-override("\e644"); } +.ui-icon-dock { @include icon-override("\e30e"); } +.ui-icon-domain { @include icon-override("\e7ee"); } +.ui-icon-done { @include icon-override("\e876"); } +.ui-icon-done-all { @include icon-override("\e877"); } +.ui-icon-donut-large { @include icon-override("\e917"); } +.ui-icon-donut-small { @include icon-override("\e918"); } +.ui-icon-drafts { @include icon-override("\e151"); } +.ui-icon-drag-handle { @include icon-override("\e25d"); } +.ui-icon-drive-eta { @include icon-override("\e613"); } +.ui-icon-dvr { @include icon-override("\e1b2"); } +.ui-icon-edit { @include icon-override("\e3c9"); } +.ui-icon-edit-location { @include icon-override("\e568"); } +.ui-icon-eject { @include icon-override("\e8fb"); } +.ui-icon-email { @include icon-override("\e0be"); } +.ui-icon-enhanced-encryption { @include icon-override("\e63f"); } +.ui-icon-equalizer { @include icon-override("\e01d"); } +.ui-icon-error { @include icon-override("\e000"); } +.ui-icon-error-outline { @include icon-override("\e001"); } +.ui-icon-euro-symbol { @include icon-override("\e926"); } +.ui-icon-ev-station { @include icon-override("\e56d"); } +.ui-icon-event { @include icon-override("\e878"); } +.ui-icon-event-available { @include icon-override("\e614"); } +.ui-icon-event-busy { @include icon-override("\e615"); } +.ui-icon-event-note { @include icon-override("\e616"); } +.ui-icon-event-seat { @include icon-override("\e903"); } +.ui-icon-exit-to-app { @include icon-override("\e879"); } +.ui-icon-expand-less { @include icon-override("\e5ce"); } +.ui-icon-expand-more { @include icon-override("\e5cf"); } +.ui-icon-explicit { @include icon-override("\e01e"); } +.ui-icon-explore { @include icon-override("\e87a"); } +.ui-icon-exposure { @include icon-override("\e3ca"); } +.ui-icon-exposure-neg-1 { @include icon-override("\e3cb"); } +.ui-icon-exposure-neg-2 { @include icon-override("\e3cc"); } +.ui-icon-exposure-plus-1 { @include icon-override("\e3cd"); } +.ui-icon-exposure-plus-2 { @include icon-override("\e3ce"); } +.ui-icon-exposure-zero { @include icon-override("\e3cf"); } +.ui-icon-extension { @include icon-override("\e87b"); } +.ui-icon-face { @include icon-override("\e87c"); } +.ui-icon-fast-forward { @include icon-override("\e01f"); } +.ui-icon-fast-rewind { @include icon-override("\e020"); } +.ui-icon-favorite { @include icon-override("\e87d"); } +.ui-icon-favorite-border { @include icon-override("\e87e"); } +.ui-icon-featured-play-list { @include icon-override("\e06d"); } +.ui-icon-featured-video { @include icon-override("\e06e"); } +.ui-icon-feedback { @include icon-override("\e87f"); } +.ui-icon-fiber-dvr { @include icon-override("\e05d"); } +.ui-icon-fiber-manual-record { @include icon-override("\e061"); } +.ui-icon-fiber-new { @include icon-override("\e05e"); } +.ui-icon-fiber-pin { @include icon-override("\e06a"); } +.ui-icon-fiber-smart-record { @include icon-override("\e062"); } +.ui-icon-file-download { @include icon-override("\e2c4"); } +.ui-icon-file-upload { @include icon-override("\e2c6"); } +.ui-icon-filter { @include icon-override("\e3d3"); } +.ui-icon-filter-1 { @include icon-override("\e3d0"); } +.ui-icon-filter-2 { @include icon-override("\e3d1"); } +.ui-icon-filter-3 { @include icon-override("\e3d2"); } +.ui-icon-filter-4 { @include icon-override("\e3d4"); } +.ui-icon-filter-5 { @include icon-override("\e3d5"); } +.ui-icon-filter-6 { @include icon-override("\e3d6"); } +.ui-icon-filter-7 { @include icon-override("\e3d7"); } +.ui-icon-filter-8 { @include icon-override("\e3d8"); } +.ui-icon-filter-9 { @include icon-override("\e3d9"); } +.ui-icon-filter-9-plus { @include icon-override("\e3da"); } +.ui-icon-filter-b-and-w { @include icon-override("\e3db"); } +.ui-icon-filter-center-focus { @include icon-override("\e3dc"); } +.ui-icon-filter-drama { @include icon-override("\e3dd"); } +.ui-icon-filter-frames { @include icon-override("\e3de"); } +.ui-icon-filter-hdr { @include icon-override("\e3df"); } +.ui-icon-filter-list { @include icon-override("\e152"); } +.ui-icon-filter-none { @include icon-override("\e3e0"); } +.ui-icon-filter-tilt-shift { @include icon-override("\e3e2"); } +.ui-icon-filter-vintage { @include icon-override("\e3e3"); } +.ui-icon-find-in-page { @include icon-override("\e880"); } +.ui-icon-find-replace { @include icon-override("\e881"); } +.ui-icon-fingerprint { @include icon-override("\e90d"); } +.ui-icon-first-page { @include icon-override("\e5dc"); } +.ui-icon-fitness-center { @include icon-override("\eb43"); } +.ui-icon-flag { @include icon-override("\e153"); } +.ui-icon-flare { @include icon-override("\e3e4"); } +.ui-icon-flash-auto { @include icon-override("\e3e5"); } +.ui-icon-flash-off { @include icon-override("\e3e6"); } +.ui-icon-flash-on { @include icon-override("\e3e7"); } +.ui-icon-flight { @include icon-override("\e539"); } +.ui-icon-flight-land { @include icon-override("\e904"); } +.ui-icon-flight-takeoff { @include icon-override("\e905"); } +.ui-icon-flip { @include icon-override("\e3e8"); } +.ui-icon-flip-to-back { @include icon-override("\e882"); } +.ui-icon-flip-to-front { @include icon-override("\e883"); } +.ui-icon-folder { @include icon-override("\e2c7"); } +.ui-icon-folder-open { @include icon-override("\e2c8"); } +.ui-icon-folder-shared { @include icon-override("\e2c9"); } +.ui-icon-folder-special { @include icon-override("\e617"); } +.ui-icon-font-download { @include icon-override("\e167"); } +.ui-icon-format-align-center { @include icon-override("\e234"); } +.ui-icon-format-align-justify { @include icon-override("\e235"); } +.ui-icon-format-align-left { @include icon-override("\e236"); } +.ui-icon-format-align-right { @include icon-override("\e237"); } +.ui-icon-format-bold { @include icon-override("\e238"); } +.ui-icon-format-clear { @include icon-override("\e239"); } +.ui-icon-format-color-fill { @include icon-override("\e23a"); } +.ui-icon-format-color-reset { @include icon-override("\e23b"); } +.ui-icon-format-color-text { @include icon-override("\e23c"); } +.ui-icon-format-indent-decrease { @include icon-override("\e23d"); } +.ui-icon-format-indent-increase { @include icon-override("\e23e"); } +.ui-icon-format-italic { @include icon-override("\e23f"); } +.ui-icon-format-line-spacing { @include icon-override("\e240"); } +.ui-icon-format-list-bulleted { @include icon-override("\e241"); } +.ui-icon-format-list-numbered { @include icon-override("\e242"); } +.ui-icon-format-paint { @include icon-override("\e243"); } +.ui-icon-format-quote { @include icon-override("\e244"); } +.ui-icon-format-shapes { @include icon-override("\e25e"); } +.ui-icon-format-size { @include icon-override("\e245"); } +.ui-icon-format-strikethrough { @include icon-override("\e246"); } +.ui-icon-format-textdirection-l-to-r { @include icon-override("\e247"); } +.ui-icon-format-textdirection-r-to-l { @include icon-override("\e248"); } +.ui-icon-format-underlined { @include icon-override("\e249"); } +.ui-icon-forum { @include icon-override("\e0bf"); } +.ui-icon-forward { @include icon-override("\e154"); } +.ui-icon-forward-10 { @include icon-override("\e056"); } +.ui-icon-forward-30 { @include icon-override("\e057"); } +.ui-icon-forward-5 { @include icon-override("\e058"); } +.ui-icon-free-breakfast { @include icon-override("\eb44"); } +.ui-icon-fullscreen { @include icon-override("\e5d0"); } +.ui-icon-fullscreen-exit { @include icon-override("\e5d1"); } +.ui-icon-functions { @include icon-override("\e24a"); } +.ui-icon-g-translate { @include icon-override("\e927"); } +.ui-icon-gamepad { @include icon-override("\e30f"); } +.ui-icon-games { @include icon-override("\e021"); } +.ui-icon-gavel { @include icon-override("\e90e"); } +.ui-icon-gesture { @include icon-override("\e155"); } +.ui-icon-get-app { @include icon-override("\e884"); } +.ui-icon-gif { @include icon-override("\e908"); } +.ui-icon-golf-course { @include icon-override("\eb45"); } +.ui-icon-gps-fixed { @include icon-override("\e1b3"); } +.ui-icon-gps-not-fixed { @include icon-override("\e1b4"); } +.ui-icon-gps-off { @include icon-override("\e1b5"); } +.ui-icon-grade { @include icon-override("\e885"); } +.ui-icon-gradient { @include icon-override("\e3e9"); } +.ui-icon-grain { @include icon-override("\e3ea"); } +.ui-icon-graphic-eq { @include icon-override("\e1b8"); } +.ui-icon-grid-off { @include icon-override("\e3eb"); } +.ui-icon-grid-on { @include icon-override("\e3ec"); } +.ui-icon-group { @include icon-override("\e7ef"); } +.ui-icon-group-add { @include icon-override("\e7f0"); } +.ui-icon-group-work { @include icon-override("\e886"); } +.ui-icon-hd { @include icon-override("\e052"); } +.ui-icon-hdr-off { @include icon-override("\e3ed"); } +.ui-icon-hdr-on { @include icon-override("\e3ee"); } +.ui-icon-hdr-strong { @include icon-override("\e3f1"); } +.ui-icon-hdr-weak { @include icon-override("\e3f2"); } +.ui-icon-headset { @include icon-override("\e310"); } +.ui-icon-headset-mic { @include icon-override("\e311"); } +.ui-icon-healing { @include icon-override("\e3f3"); } +.ui-icon-hearing { @include icon-override("\e023"); } +.ui-icon-help { @include icon-override("\e887"); } +.ui-icon-help-outline { @include icon-override("\e8fd"); } +.ui-icon-high-quality { @include icon-override("\e024"); } +.ui-icon-highlight { @include icon-override("\e25f"); } +.ui-icon-highlight-off { @include icon-override("\e888"); } +.ui-icon-history { @include icon-override("\e889"); } +.ui-icon-home { @include icon-override("\e88a"); } +.ui-icon-hot-tub { @include icon-override("\eb46"); } +.ui-icon-hotel { @include icon-override("\e53a"); } +.ui-icon-hourglass-empty { @include icon-override("\e88b"); } +.ui-icon-hourglass-full { @include icon-override("\e88c"); } +.ui-icon-http { @include icon-override("\e902"); } +.ui-icon-https { @include icon-override("\e88d"); } +.ui-icon-image { @include icon-override("\e3f4"); } +.ui-icon-image-aspect-ratio { @include icon-override("\e3f5"); } +.ui-icon-import-contacts { @include icon-override("\e0e0"); } +.ui-icon-import-export { @include icon-override("\e0c3"); } +.ui-icon-important-devices { @include icon-override("\e912"); } +.ui-icon-inbox { @include icon-override("\e156"); } +.ui-icon-indeterminate-check-box { @include icon-override("\e909"); } +.ui-icon-info { @include icon-override("\e88e"); } +.ui-icon-info-outline { @include icon-override("\e88f"); } +.ui-icon-input { @include icon-override("\e890"); } +.ui-icon-insert-chart { @include icon-override("\e24b"); } +.ui-icon-insert-comment { @include icon-override("\e24c"); } +.ui-icon-insert-drive-file { @include icon-override("\e24d"); } +.ui-icon-insert-emoticon { @include icon-override("\e24e"); } +.ui-icon-insert-invitation { @include icon-override("\e24f"); } +.ui-icon-insert-link { @include icon-override("\e250"); } +.ui-icon-insert-photo { @include icon-override("\e251"); } +.ui-icon-invert-colors { @include icon-override("\e891"); } +.ui-icon-invert-colors-off { @include icon-override("\e0c4"); } +.ui-icon-iso { @include icon-override("\e3f6"); } +.ui-icon-keyboard { @include icon-override("\e312"); } +.ui-icon-keyboard-arrow-down { @include icon-override("\e313"); } +.ui-icon-keyboard-arrow-left { @include icon-override("\e314"); } +.ui-icon-keyboard-arrow-right { @include icon-override("\e315"); } +.ui-icon-keyboard-arrow-up { @include icon-override("\e316"); } +.ui-icon-keyboard-backspace { @include icon-override("\e317"); } +.ui-icon-keyboard-capslock { @include icon-override("\e318"); } +.ui-icon-keyboard-hide { @include icon-override("\e31a"); } +.ui-icon-keyboard-return { @include icon-override("\e31b"); } +.ui-icon-keyboard-tab { @include icon-override("\e31c"); } +.ui-icon-keyboard-voice { @include icon-override("\e31d"); } +.ui-icon-kitchen { @include icon-override("\eb47"); } +.ui-icon-label { @include icon-override("\e892"); } +.ui-icon-label-outline { @include icon-override("\e893"); } +.ui-icon-landscape { @include icon-override("\e3f7"); } +.ui-icon-language { @include icon-override("\e894"); } +.ui-icon-laptop { @include icon-override("\e31e"); } +.ui-icon-laptop-chromebook { @include icon-override("\e31f"); } +.ui-icon-laptop-mac { @include icon-override("\e320"); } +.ui-icon-laptop-windows { @include icon-override("\e321"); } +.ui-icon-last-page { @include icon-override("\e5dd"); } +.ui-icon-launch { @include icon-override("\e895"); } +.ui-icon-layers { @include icon-override("\e53b"); } +.ui-icon-layers-clear { @include icon-override("\e53c"); } +.ui-icon-leak-add { @include icon-override("\e3f8"); } +.ui-icon-leak-remove { @include icon-override("\e3f9"); } +.ui-icon-lens { @include icon-override("\e3fa"); } +.ui-icon-library-add { @include icon-override("\e02e"); } +.ui-icon-library-books { @include icon-override("\e02f"); } +.ui-icon-library-music { @include icon-override("\e030"); } +.ui-icon-lightbulb-outline { @include icon-override("\e90f"); } +.ui-icon-line-style { @include icon-override("\e919"); } +.ui-icon-line-weight { @include icon-override("\e91a"); } +.ui-icon-linear-scale { @include icon-override("\e260"); } +.ui-icon-link { @include icon-override("\e157"); } +.ui-icon-linked-camera { @include icon-override("\e438"); } +.ui-icon-list { @include icon-override("\e896"); } +.ui-icon-live-help { @include icon-override("\e0c6"); } +.ui-icon-live-tv { @include icon-override("\e639"); } +.ui-icon-local-activity { @include icon-override("\e53f"); } +.ui-icon-local-airport { @include icon-override("\e53d"); } +.ui-icon-local-atm { @include icon-override("\e53e"); } +.ui-icon-local-bar { @include icon-override("\e540"); } +.ui-icon-local-cafe { @include icon-override("\e541"); } +.ui-icon-local-car-wash { @include icon-override("\e542"); } +.ui-icon-local-convenience-store { @include icon-override("\e543"); } +.ui-icon-local-dining { @include icon-override("\e556"); } +.ui-icon-local-drink { @include icon-override("\e544"); } +.ui-icon-local-florist { @include icon-override("\e545"); } +.ui-icon-local-gas-station { @include icon-override("\e546"); } +.ui-icon-local-grocery-store { @include icon-override("\e547"); } +.ui-icon-local-hospital { @include icon-override("\e548"); } +.ui-icon-local-hotel { @include icon-override("\e549"); } +.ui-icon-local-laundry-service { @include icon-override("\e54a"); } +.ui-icon-local-library { @include icon-override("\e54b"); } +.ui-icon-local-mall { @include icon-override("\e54c"); } +.ui-icon-local-movies { @include icon-override("\e54d"); } +.ui-icon-local-offer { @include icon-override("\e54e"); } +.ui-icon-local-parking { @include icon-override("\e54f"); } +.ui-icon-local-pharmacy { @include icon-override("\e550"); } +.ui-icon-local-phone { @include icon-override("\e551"); } +.ui-icon-local-pizza { @include icon-override("\e552"); } +.ui-icon-local-play { @include icon-override("\e553"); } +.ui-icon-local-post-office { @include icon-override("\e554"); } +.ui-icon-local-printshop { @include icon-override("\e555"); } +.ui-icon-local-see { @include icon-override("\e557"); } +.ui-icon-local-shipping { @include icon-override("\e558"); } +.ui-icon-local-taxi { @include icon-override("\e559"); } +.ui-icon-location-city { @include icon-override("\e7f1"); } +.ui-icon-location-disabled { @include icon-override("\e1b6"); } +.ui-icon-location-off { @include icon-override("\e0c7"); } +.ui-icon-location-on { @include icon-override("\e0c8"); } +.ui-icon-location-searching { @include icon-override("\e1b7"); } +.ui-icon-lock { @include icon-override("\e897"); } +.ui-icon-lock-open { @include icon-override("\e898"); } +.ui-icon-lock-outline { @include icon-override("\e899"); } +.ui-icon-looks { @include icon-override("\e3fc"); } +.ui-icon-looks-3 { @include icon-override("\e3fb"); } +.ui-icon-looks-4 { @include icon-override("\e3fd"); } +.ui-icon-looks-5 { @include icon-override("\e3fe"); } +.ui-icon-looks-6 { @include icon-override("\e3ff"); } +.ui-icon-looks-one { @include icon-override("\e400"); } +.ui-icon-looks-two { @include icon-override("\e401"); } +.ui-icon-loop { @include icon-override("\e028"); } +.ui-icon-loupe { @include icon-override("\e402"); } +.ui-icon-low-priority { @include icon-override("\e16d"); } +.ui-icon-loyalty { @include icon-override("\e89a"); } +.ui-icon-mail { @include icon-override("\e158"); } +.ui-icon-mail-outline { @include icon-override("\e0e1"); } +.ui-icon-map { @include icon-override("\e55b"); } +.ui-icon-markunread { @include icon-override("\e159"); } +.ui-icon-markunread-mailbox { @include icon-override("\e89b"); } +.ui-icon-memory { @include icon-override("\e322"); } +.ui-icon-menu { @include icon-override("\e5d2"); } +.ui-icon-merge-type { @include icon-override("\e252"); } +.ui-icon-message { @include icon-override("\e0c9"); } +.ui-icon-mic { @include icon-override("\e029"); } +.ui-icon-mic-none { @include icon-override("\e02a"); } +.ui-icon-mic-off { @include icon-override("\e02b"); } +.ui-icon-mms { @include icon-override("\e618"); } +.ui-icon-mode-comment { @include icon-override("\e253"); } +.ui-icon-mode-edit { @include icon-override("\e254"); } +.ui-icon-monetization-on { @include icon-override("\e263"); } +.ui-icon-money-off { @include icon-override("\e25c"); } +.ui-icon-monochrome-photos { @include icon-override("\e403"); } +.ui-icon-mood { @include icon-override("\e7f2"); } +.ui-icon-mood-bad { @include icon-override("\e7f3"); } +.ui-icon-more { @include icon-override("\e619"); } +.ui-icon-more-horiz { @include icon-override("\e5d3"); } +.ui-icon-more-vert { @include icon-override("\e5d4"); } +.ui-icon-motorcycle { @include icon-override("\e91b"); } +.ui-icon-mouse { @include icon-override("\e323"); } +.ui-icon-move-to-inbox { @include icon-override("\e168"); } +.ui-icon-movie { @include icon-override("\e02c"); } +.ui-icon-movie-creation { @include icon-override("\e404"); } +.ui-icon-movie-filter { @include icon-override("\e43a"); } +.ui-icon-multiline-chart { @include icon-override("\e6df"); } +.ui-icon-music-note { @include icon-override("\e405"); } +.ui-icon-music-video { @include icon-override("\e063"); } +.ui-icon-my-location { @include icon-override("\e55c"); } +.ui-icon-nature { @include icon-override("\e406"); } +.ui-icon-nature-people { @include icon-override("\e407"); } +.ui-icon-navigate-before { @include icon-override("\e408"); } +.ui-icon-navigate-next { @include icon-override("\e409"); } +.ui-icon-navigation { @include icon-override("\e55d"); } +.ui-icon-near-me { @include icon-override("\e569"); } +.ui-icon-network-cell { @include icon-override("\e1b9"); } +.ui-icon-network-check { @include icon-override("\e640"); } +.ui-icon-network-locked { @include icon-override("\e61a"); } +.ui-icon-network-wifi { @include icon-override("\e1ba"); } +.ui-icon-new-releases { @include icon-override("\e031"); } +.ui-icon-next-week { @include icon-override("\e16a"); } +.ui-icon-nfc { @include icon-override("\e1bb"); } +.ui-icon-no-encryption { @include icon-override("\e641"); } +.ui-icon-no-sim { @include icon-override("\e0cc"); } +.ui-icon-not-interested { @include icon-override("\e033"); } +.ui-icon-note { @include icon-override("\e06f"); } +.ui-icon-note-add { @include icon-override("\e89c"); } +.ui-icon-notifications { @include icon-override("\e7f4"); } +.ui-icon-notifications-active { @include icon-override("\e7f7"); } +.ui-icon-notifications-none { @include icon-override("\e7f5"); } +.ui-icon-notifications-off { @include icon-override("\e7f6"); } +.ui-icon-notifications-paused { @include icon-override("\e7f8"); } +.ui-icon-offline-pin { @include icon-override("\e90a"); } +.ui-icon-ondemand-video { @include icon-override("\e63a"); } +.ui-icon-opacity { @include icon-override("\e91c"); } +.ui-icon-open-in-browser { @include icon-override("\e89d"); } +.ui-icon-open-in-new { @include icon-override("\e89e"); } +.ui-icon-open-with { @include icon-override("\e89f"); } +.ui-icon-pages { @include icon-override("\e7f9"); } +.ui-icon-pageview { @include icon-override("\e8a0"); } +.ui-icon-palette { @include icon-override("\e40a"); } +.ui-icon-pan-tool { @include icon-override("\e925"); } +.ui-icon-panorama { @include icon-override("\e40b"); } +.ui-icon-panorama-fish-eye { @include icon-override("\e40c"); } +.ui-icon-panorama-horizontal { @include icon-override("\e40d"); } +.ui-icon-panorama-vertical { @include icon-override("\e40e"); } +.ui-icon-panorama-wide-angle { @include icon-override("\e40f"); } +.ui-icon-party-mode { @include icon-override("\e7fa"); } +.ui-icon-pause { @include icon-override("\e034"); } +.ui-icon-pause-circle-filled { @include icon-override("\e035"); } +.ui-icon-pause-circle-outline { @include icon-override("\e036"); } +.ui-icon-payment { @include icon-override("\e8a1"); } +.ui-icon-people { @include icon-override("\e7fb"); } +.ui-icon-people-outline { @include icon-override("\e7fc"); } +.ui-icon-perm-camera-mic { @include icon-override("\e8a2"); } +.ui-icon-perm-contact-calendar { @include icon-override("\e8a3"); } +.ui-icon-perm-data-setting { @include icon-override("\e8a4"); } +.ui-icon-perm-device-information { @include icon-override("\e8a5"); } +.ui-icon-perm-identity { @include icon-override("\e8a6"); } +.ui-icon-perm-media { @include icon-override("\e8a7"); } +.ui-icon-perm-phone-msg { @include icon-override("\e8a8"); } +.ui-icon-perm-scan-wifi { @include icon-override("\e8a9"); } +.ui-icon-person { @include icon-override("\e7fd"); } +.ui-icon-person-add { @include icon-override("\e7fe"); } +.ui-icon-person-outline { @include icon-override("\e7ff"); } +.ui-icon-person-pin { @include icon-override("\e55a"); } +.ui-icon-person-pin-circle { @include icon-override("\e56a"); } +.ui-icon-personal-video { @include icon-override("\e63b"); } +.ui-icon-pets { @include icon-override("\e91d"); } +.ui-icon-phone { @include icon-override("\e0cd"); } +.ui-icon-phone-android { @include icon-override("\e324"); } +.ui-icon-phone-bluetooth-speaker { @include icon-override("\e61b"); } +.ui-icon-phone-forwarded { @include icon-override("\e61c"); } +.ui-icon-phone-in-talk { @include icon-override("\e61d"); } +.ui-icon-phone-iphone { @include icon-override("\e325"); } +.ui-icon-phone-locked { @include icon-override("\e61e"); } +.ui-icon-phone-missed { @include icon-override("\e61f"); } +.ui-icon-phone-paused { @include icon-override("\e620"); } +.ui-icon-phonelink { @include icon-override("\e326"); } +.ui-icon-phonelink-erase { @include icon-override("\e0db"); } +.ui-icon-phonelink-lock { @include icon-override("\e0dc"); } +.ui-icon-phonelink-off { @include icon-override("\e327"); } +.ui-icon-phonelink-ring { @include icon-override("\e0dd"); } +.ui-icon-phonelink-setup { @include icon-override("\e0de"); } +.ui-icon-photo { @include icon-override("\e410"); } +.ui-icon-photo-album { @include icon-override("\e411"); } +.ui-icon-photo-camera { @include icon-override("\e412"); } +.ui-icon-photo-filter { @include icon-override("\e43b"); } +.ui-icon-photo-library { @include icon-override("\e413"); } +.ui-icon-photo-size-select-actual { @include icon-override("\e432"); } +.ui-icon-photo-size-select-large { @include icon-override("\e433"); } +.ui-icon-photo-size-select-small { @include icon-override("\e434"); } +.ui-icon-picture-as-pdf { @include icon-override("\e415"); } +.ui-icon-picture-in-picture { @include icon-override("\e8aa"); } +.ui-icon-picture-in-picture-alt { @include icon-override("\e911"); } +.ui-icon-pie-chart { @include icon-override("\e6c4"); } +.ui-icon-pie-chart-outlined { @include icon-override("\e6c5"); } +.ui-icon-pin-drop { @include icon-override("\e55e"); } +.ui-icon-place { @include icon-override("\e55f"); } +.ui-icon-play-arrow { @include icon-override("\e037"); } +.ui-icon-play-circle-filled { @include icon-override("\e038"); } +.ui-icon-play-circle-outline { @include icon-override("\e039"); } +.ui-icon-play-for-work { @include icon-override("\e906"); } +.ui-icon-playlist-add { @include icon-override("\e03b"); } +.ui-icon-playlist-add-check { @include icon-override("\e065"); } +.ui-icon-playlist-play { @include icon-override("\e05f"); } +.ui-icon-plus-one { @include icon-override("\e800"); } +.ui-icon-poll { @include icon-override("\e801"); } +.ui-icon-polymer { @include icon-override("\e8ab"); } +.ui-icon-pool { @include icon-override("\eb48"); } +.ui-icon-portable-wifi-off { @include icon-override("\e0ce"); } +.ui-icon-portrait { @include icon-override("\e416"); } +.ui-icon-power { @include icon-override("\e63c"); } +.ui-icon-power-input { @include icon-override("\e336"); } +.ui-icon-power-settings-new { @include icon-override("\e8ac"); } +.ui-icon-pregnant-woman { @include icon-override("\e91e"); } +.ui-icon-present-to-all { @include icon-override("\e0df"); } +.ui-icon-print { @include icon-override("\e8ad"); } +.ui-icon-priority-high { @include icon-override("\e645"); } +.ui-icon-public { @include icon-override("\e80b"); } +.ui-icon-publish { @include icon-override("\e255"); } +.ui-icon-query-builder { @include icon-override("\e8ae"); } +.ui-icon-question-answer { @include icon-override("\e8af"); } +.ui-icon-queue { @include icon-override("\e03c"); } +.ui-icon-queue-music { @include icon-override("\e03d"); } +.ui-icon-queue-play-next { @include icon-override("\e066"); } +.ui-icon-radio { @include icon-override("\e03e"); } +.ui-icon-radio-button-checked { @include icon-override("\e837"); } +.ui-icon-radio-button-unchecked { @include icon-override("\e836"); } +.ui-icon-rate-review { @include icon-override("\e560"); } +.ui-icon-receipt { @include icon-override("\e8b0"); } +.ui-icon-recent-actors { @include icon-override("\e03f"); } +.ui-icon-record-voice-over { @include icon-override("\e91f"); } +.ui-icon-redeem { @include icon-override("\e8b1"); } +.ui-icon-redo { @include icon-override("\e15a"); } +.ui-icon-refresh { @include icon-override("\e5d5"); } +.ui-icon-remove { @include icon-override("\e15b"); } +.ui-icon-remove-circle { @include icon-override("\e15c"); } +.ui-icon-remove-circle-outline { @include icon-override("\e15d"); } +.ui-icon-remove-from-queue { @include icon-override("\e067"); } +.ui-icon-remove-red-eye { @include icon-override("\e417"); } +.ui-icon-remove-shopping-cart { @include icon-override("\e928"); } +.ui-icon-reorder { @include icon-override("\e8fe"); } +.ui-icon-repeat { @include icon-override("\e040"); } +.ui-icon-repeat-one { @include icon-override("\e041"); } +.ui-icon-replay { @include icon-override("\e042"); } +.ui-icon-replay-10 { @include icon-override("\e059"); } +.ui-icon-replay-30 { @include icon-override("\e05a"); } +.ui-icon-replay-5 { @include icon-override("\e05b"); } +.ui-icon-reply { @include icon-override("\e15e"); } +.ui-icon-reply-all { @include icon-override("\e15f"); } +.ui-icon-report { @include icon-override("\e160"); } +.ui-icon-report-problem { @include icon-override("\e8b2"); } +.ui-icon-restaurant { @include icon-override("\e56c"); } +.ui-icon-restaurant-menu { @include icon-override("\e561"); } +.ui-icon-restore { @include icon-override("\e8b3"); } +.ui-icon-restore-page { @include icon-override("\e929"); } +.ui-icon-ring-volume { @include icon-override("\e0d1"); } +.ui-icon-room { @include icon-override("\e8b4"); } +.ui-icon-room-service { @include icon-override("\eb49"); } +.ui-icon-rotate-90-degrees-ccw { @include icon-override("\e418"); } +.ui-icon-rotate-left { @include icon-override("\e419"); } +.ui-icon-rotate-right { @include icon-override("\e41a"); } +.ui-icon-rounded-corner { @include icon-override("\e920"); } +.ui-icon-router { @include icon-override("\e328"); } +.ui-icon-rowing { @include icon-override("\e921"); } +.ui-icon-rss-feed { @include icon-override("\e0e5"); } +.ui-icon-rv-hookup { @include icon-override("\e642"); } +.ui-icon-satellite { @include icon-override("\e562"); } +.ui-icon-save { @include icon-override("\e161"); } +.ui-icon-scanner { @include icon-override("\e329"); } +.ui-icon-schedule { @include icon-override("\e8b5"); } +.ui-icon-school { @include icon-override("\e80c"); } +.ui-icon-screen-lock-landscape { @include icon-override("\e1be"); } +.ui-icon-screen-lock-portrait { @include icon-override("\e1bf"); } +.ui-icon-screen-lock-rotation { @include icon-override("\e1c0"); } +.ui-icon-screen-rotation { @include icon-override("\e1c1"); } +.ui-icon-screen-share { @include icon-override("\e0e2"); } +.ui-icon-sd-card { @include icon-override("\e623"); } +.ui-icon-sd-storage { @include icon-override("\e1c2"); } +.ui-icon-search { @include icon-override("\e8b6"); } +.ui-icon-security { @include icon-override("\e32a"); } +.ui-icon-select-all { @include icon-override("\e162"); } +.ui-icon-send { @include icon-override("\e163"); } +.ui-icon-sentiment-dissatisfied { @include icon-override("\e811"); } +.ui-icon-sentiment-neutral { @include icon-override("\e812"); } +.ui-icon-sentiment-satisfied { @include icon-override("\e813"); } +.ui-icon-sentiment-very-dissatisfied { @include icon-override("\e814"); } +.ui-icon-sentiment-very-satisfied { @include icon-override("\e815"); } +.ui-icon-settings { @include icon-override("\e8b8"); } +.ui-icon-settings-applications { @include icon-override("\e8b9"); } +.ui-icon-settings-backup-restore { @include icon-override("\e8ba"); } +.ui-icon-settings-bluetooth { @include icon-override("\e8bb"); } +.ui-icon-settings-brightness { @include icon-override("\e8bd"); } +.ui-icon-settings-cell { @include icon-override("\e8bc"); } +.ui-icon-settings-ethernet { @include icon-override("\e8be"); } +.ui-icon-settings-input-antenna { @include icon-override("\e8bf"); } +.ui-icon-settings-input-component { @include icon-override("\e8c0"); } +.ui-icon-settings-input-composite { @include icon-override("\e8c1"); } +.ui-icon-settings-input-hdmi { @include icon-override("\e8c2"); } +.ui-icon-settings-input-svideo { @include icon-override("\e8c3"); } +.ui-icon-settings-overscan { @include icon-override("\e8c4"); } +.ui-icon-settings-phone { @include icon-override("\e8c5"); } +.ui-icon-settings-power { @include icon-override("\e8c6"); } +.ui-icon-settings-remote { @include icon-override("\e8c7"); } +.ui-icon-settings-system-daydream { @include icon-override("\e1c3"); } +.ui-icon-settings-voice { @include icon-override("\e8c8"); } +.ui-icon-share { @include icon-override("\e80d"); } +.ui-icon-shop { @include icon-override("\e8c9"); } +.ui-icon-shop-two { @include icon-override("\e8ca"); } +.ui-icon-shopping-basket { @include icon-override("\e8cb"); } +.ui-icon-shopping-cart { @include icon-override("\e8cc"); } +.ui-icon-short-text { @include icon-override("\e261"); } +.ui-icon-show-chart { @include icon-override("\e6e1"); } +.ui-icon-shuffle { @include icon-override("\e043"); } +.ui-icon-signal-cellular-4-bar { @include icon-override("\e1c8"); } +.ui-icon-signal-cellular-connected-no-internet-4-bar { @include icon-override("\e1cd"); } +.ui-icon-signal-cellular-no-sim { @include icon-override("\e1ce"); } +.ui-icon-signal-cellular-null { @include icon-override("\e1cf"); } +.ui-icon-signal-cellular-off { @include icon-override("\e1d0"); } +.ui-icon-signal-wifi-4-bar { @include icon-override("\e1d8"); } +.ui-icon-signal-wifi-4-bar-lock { @include icon-override("\e1d9"); } +.ui-icon-signal-wifi-off { @include icon-override("\e1da"); } +.ui-icon-sim-card { @include icon-override("\e32b"); } +.ui-icon-sim-card-alert { @include icon-override("\e624"); } +.ui-icon-skip-next { @include icon-override("\e044"); } +.ui-icon-skip-previous { @include icon-override("\e045"); } +.ui-icon-slideshow { @include icon-override("\e41b"); } +.ui-icon-slow-motion-video { @include icon-override("\e068"); } +.ui-icon-smartphone { @include icon-override("\e32c"); } +.ui-icon-smoke-free { @include icon-override("\eb4a"); } +.ui-icon-smoking-rooms { @include icon-override("\eb4b"); } +.ui-icon-sms { @include icon-override("\e625"); } +.ui-icon-sms-failed { @include icon-override("\e626"); } +.ui-icon-snooze { @include icon-override("\e046"); } +.ui-icon-sort { @include icon-override("\e164"); } +.ui-icon-sort-by-alpha { @include icon-override("\e053"); } +.ui-icon-spa { @include icon-override("\eb4c"); } +.ui-icon-space-bar { @include icon-override("\e256"); } +.ui-icon-speaker { @include icon-override("\e32d"); } +.ui-icon-speaker-group { @include icon-override("\e32e"); } +.ui-icon-speaker-notes { @include icon-override("\e8cd"); } +.ui-icon-speaker-notes-off { @include icon-override("\e92a"); } +.ui-icon-speaker-phone { @include icon-override("\e0d2"); } +.ui-icon-spellcheck { @include icon-override("\e8ce"); } +.ui-icon-star { @include icon-override("\e838"); } +.ui-icon-star-border { @include icon-override("\e83a"); } +.ui-icon-star-half { @include icon-override("\e839"); } +.ui-icon-stars { @include icon-override("\e8d0"); } +.ui-icon-stay-current-landscape { @include icon-override("\e0d3"); } +.ui-icon-stay-current-portrait { @include icon-override("\e0d4"); } +.ui-icon-stay-primary-landscape { @include icon-override("\e0d5"); } +.ui-icon-stay-primary-portrait { @include icon-override("\e0d6"); } +.ui-icon-stop { @include icon-override("\e047"); } +.ui-icon-stop-screen-share { @include icon-override("\e0e3"); } +.ui-icon-storage { @include icon-override("\e1db"); } +.ui-icon-store { @include icon-override("\e8d1"); } +.ui-icon-store-mall-directory { @include icon-override("\e563"); } +.ui-icon-straighten { @include icon-override("\e41c"); } +.ui-icon-streetview { @include icon-override("\e56e"); } +.ui-icon-strikethrough-s { @include icon-override("\e257"); } +.ui-icon-style { @include icon-override("\e41d"); } +.ui-icon-subdirectory-arrow-left { @include icon-override("\e5d9"); } +.ui-icon-subdirectory-arrow-right { @include icon-override("\e5da"); } +.ui-icon-subject { @include icon-override("\e8d2"); } +.ui-icon-subscriptions { @include icon-override("\e064"); } +.ui-icon-subtitles { @include icon-override("\e048"); } +.ui-icon-subway { @include icon-override("\e56f"); } +.ui-icon-supervisor-account { @include icon-override("\e8d3"); } +.ui-icon-surround-sound { @include icon-override("\e049"); } +.ui-icon-swap-calls { @include icon-override("\e0d7"); } +.ui-icon-swap-horiz { @include icon-override("\e8d4"); } +.ui-icon-swap-vert { @include icon-override("\e8d5"); } +.ui-icon-swap-vertical-circle { @include icon-override("\e8d6"); } +.ui-icon-switch-camera { @include icon-override("\e41e"); } +.ui-icon-switch-video { @include icon-override("\e41f"); } +.ui-icon-sync { @include icon-override("\e627"); } +.ui-icon-sync-disabled { @include icon-override("\e628"); } +.ui-icon-sync-problem { @include icon-override("\e629"); } +.ui-icon-system-update { @include icon-override("\e62a"); } +.ui-icon-system-update-alt { @include icon-override("\e8d7"); } +.ui-icon-tab { @include icon-override("\e8d8"); } +.ui-icon-tab-unselected { @include icon-override("\e8d9"); } +.ui-icon-tablet { @include icon-override("\e32f"); } +.ui-icon-tablet-android { @include icon-override("\e330"); } +.ui-icon-tablet-mac { @include icon-override("\e331"); } +.ui-icon-tag-faces { @include icon-override("\e420"); } +.ui-icon-tap-and-play { @include icon-override("\e62b"); } +.ui-icon-terrain { @include icon-override("\e564"); } +.ui-icon-text-fields { @include icon-override("\e262"); } +.ui-icon-text-format { @include icon-override("\e165"); } +.ui-icon-textsms { @include icon-override("\e0d8"); } +.ui-icon-texture { @include icon-override("\e421"); } +.ui-icon-theaters { @include icon-override("\e8da"); } +.ui-icon-thumb-down { @include icon-override("\e8db"); } +.ui-icon-thumb-up { @include icon-override("\e8dc"); } +.ui-icon-thumbs-up-down { @include icon-override("\e8dd"); } +.ui-icon-time-to-leave { @include icon-override("\e62c"); } +.ui-icon-timelapse { @include icon-override("\e422"); } +.ui-icon-timeline { @include icon-override("\e922"); } +.ui-icon-timer { @include icon-override("\e425"); } +.ui-icon-timer-10 { @include icon-override("\e423"); } +.ui-icon-timer-3 { @include icon-override("\e424"); } +.ui-icon-timer-off { @include icon-override("\e426"); } +.ui-icon-title { @include icon-override("\e264"); } +.ui-icon-toc { @include icon-override("\e8de"); } +.ui-icon-today { @include icon-override("\e8df"); } +.ui-icon-toll { @include icon-override("\e8e0"); } +.ui-icon-tonality { @include icon-override("\e427"); } +.ui-icon-touch-app { @include icon-override("\e913"); } +.ui-icon-toys { @include icon-override("\e332"); } +.ui-icon-track-changes { @include icon-override("\e8e1"); } +.ui-icon-traffic { @include icon-override("\e565"); } +.ui-icon-train { @include icon-override("\e570"); } +.ui-icon-tram { @include icon-override("\e571"); } +.ui-icon-transfer-within-a-station { @include icon-override("\e572"); } +.ui-icon-transform { @include icon-override("\e428"); } +.ui-icon-translate { @include icon-override("\e8e2"); } +.ui-icon-trending-down { @include icon-override("\e8e3"); } +.ui-icon-trending-flat { @include icon-override("\e8e4"); } +.ui-icon-trending-up { @include icon-override("\e8e5"); } +.ui-icon-tune { @include icon-override("\e429"); } +.ui-icon-turned-in { @include icon-override("\e8e6"); } +.ui-icon-turned-in-not { @include icon-override("\e8e7"); } +.ui-icon-tv { @include icon-override("\e333"); } +.ui-icon-unarchive { @include icon-override("\e169"); } +.ui-icon-undo { @include icon-override("\e166"); } +.ui-icon-unfold-less { @include icon-override("\e5d6"); } +.ui-icon-unfold-more { @include icon-override("\e5d7"); } +.ui-icon-update { @include icon-override("\e923"); } +.ui-icon-usb { @include icon-override("\e1e0"); } +.ui-icon-verified-user { @include icon-override("\e8e8"); } +.ui-icon-vertical-align-bottom { @include icon-override("\e258"); } +.ui-icon-vertical-align-center { @include icon-override("\e259"); } +.ui-icon-vertical-align-top { @include icon-override("\e25a"); } +.ui-icon-vibration { @include icon-override("\e62d"); } +.ui-icon-video-call { @include icon-override("\e070"); } +.ui-icon-video-label { @include icon-override("\e071"); } +.ui-icon-video-library { @include icon-override("\e04a"); } +.ui-icon-videocam { @include icon-override("\e04b"); } +.ui-icon-videocam-off { @include icon-override("\e04c"); } +.ui-icon-videogame-asset { @include icon-override("\e338"); } +.ui-icon-view-agenda { @include icon-override("\e8e9"); } +.ui-icon-view-array { @include icon-override("\e8ea"); } +.ui-icon-view-carousel { @include icon-override("\e8eb"); } +.ui-icon-view-column { @include icon-override("\e8ec"); } +.ui-icon-view-comfy { @include icon-override("\e42a"); } +.ui-icon-view-compact { @include icon-override("\e42b"); } +.ui-icon-view-day { @include icon-override("\e8ed"); } +.ui-icon-view-headline { @include icon-override("\e8ee"); } +.ui-icon-view-list { @include icon-override("\e8ef"); } +.ui-icon-view-module { @include icon-override("\e8f0"); } +.ui-icon-view-quilt { @include icon-override("\e8f1"); } +.ui-icon-view-stream { @include icon-override("\e8f2"); } +.ui-icon-view-week { @include icon-override("\e8f3"); } +.ui-icon-vignette { @include icon-override("\e435"); } +.ui-icon-visibility { @include icon-override("\e8f4"); } +.ui-icon-visibility-off { @include icon-override("\e8f5"); } +.ui-icon-voice-chat { @include icon-override("\e62e"); } +.ui-icon-voicemail { @include icon-override("\e0d9"); } +.ui-icon-volume-down { @include icon-override("\e04d"); } +.ui-icon-volume-mute { @include icon-override("\e04e"); } +.ui-icon-volume-off { @include icon-override("\e04f"); } +.ui-icon-volume-up { @include icon-override("\e050"); } +.ui-icon-vpn-key { @include icon-override("\e0da"); } +.ui-icon-vpn-lock { @include icon-override("\e62f"); } +.ui-icon-wallpaper { @include icon-override("\e1bc"); } +.ui-icon-warning { @include icon-override("\e002"); } +.ui-icon-watch { @include icon-override("\e334"); } +.ui-icon-watch-later { @include icon-override("\e924"); } +.ui-icon-wb-auto { @include icon-override("\e42c"); } +.ui-icon-wb-cloudy { @include icon-override("\e42d"); } +.ui-icon-wb-incandescent { @include icon-override("\e42e"); } +.ui-icon-wb-iridescent { @include icon-override("\e436"); } +.ui-icon-wb-sunny { @include icon-override("\e430"); } +.ui-icon-wc { @include icon-override("\e63d"); } +.ui-icon-web { @include icon-override("\e051"); } +.ui-icon-web-asset { @include icon-override("\e069"); } +.ui-icon-weekend { @include icon-override("\e16b"); } +.ui-icon-whatshot { @include icon-override("\e80e"); } +.ui-icon-widgets { @include icon-override("\e1bd"); } +.ui-icon-wifi { @include icon-override("\e63e"); } +.ui-icon-wifi-lock { @include icon-override("\e1e1"); } +.ui-icon-wifi-tethering { @include icon-override("\e1e2"); } +.ui-icon-work { @include icon-override("\e8f9"); } +.ui-icon-wrap-text { @include icon-override("\e25b"); } +.ui-icon-youtube-searched-for { @include icon-override("\e8fa"); } +.ui-icon-zoom-in { @include icon-override("\e8ff"); } +.ui-icon-zoom-out { @include icon-override("\e900"); } +.ui-icon-zoom-out-map { @include icon-override("\e56b"); } \ No newline at end of file diff --git a/ace-web/src/main/webapp/resources/sass/theme/_media.scss b/ace-web/src/main/webapp/resources/sass/theme/_media.scss new file mode 100644 index 0000000..ac0dda8 --- /dev/null +++ b/ace-web/src/main/webapp/resources/sass/theme/_media.scss @@ -0,0 +1,80 @@ +@media (max-width: 640px) { + body { + .ui-panelgrid { + .ui-grid-responsive { + .ui-grid-row { + border: 0 none; + } + } + } + + .ui-steps { + .ui-steps-item { + .ui-menuitem-link { + .ui-steps-title { + display: none; + } + } + } + } + + .ui-picklist { + &.ui-picklist-responsive { + .ui-picklist-list-wrapper { + margin-bottom: 8px; + } + .ui-picklist-buttons { + .ui-button { + &.ui-button-icon-only { + display: inline-block; + margin-right: 4px; + } + } + + .ui-icon-arrow-1-e { + @include icon-override("\e037"); @include rotate(90deg); + } + .ui-icon-arrowstop-1-e { + @include icon-override("\e045"); @include rotate(-90deg); + + } + .ui-icon-arrow-1-w { + @include icon-override("\e037"); @include rotate(-90deg); + } + .ui-icon-arrowstop-1-w { + @include icon-override("\e044"); @include rotate(-90deg); + } + } + } + } + + .ui-orderlist { + &.ui-grid-responsive { + .ui-orderlist-controls { + text-align: center; + width: auto; + margin-bottom: 8px; + + .ui-button { + margin-right: 4px; + } + } + } + } + + .ui-buttonset { + > .ui-button { + display: block; + @include border-radius(0); + + &:first-child { + @include border-radius-top(3px); + } + + &:last-child { + @include border-radius-bottom(3px); + } + } + } + } +} \ No newline at end of file diff --git a/ace-web/src/main/webapp/resources/sass/theme/_menus.scss b/ace-web/src/main/webapp/resources/sass/theme/_menus.scss new file mode 100644 index 0000000..7281eca --- /dev/null +++ b/ace-web/src/main/webapp/resources/sass/theme/_menus.scss @@ -0,0 +1,367 @@ +body { + .ui-breadcrumb { + a { + color: #ffffff; + } + + li:first-child { + a { + position: relative; + font-size: $iconFontSize; + margin-top: 0; + + span { + display: none; + } + } + } + } + + .ui-steps { + position: relative; + + .ui-steps-item { + background-color: transparent; + + &.ui-state-disabled { + @include opacity(1); + } + + .ui-menuitem-link { + display: inline-block; + text-align: left; + background-color: #ffffff; + overflow: hidden; + + .ui-steps-number { + display: inline-block; + background-color: $grayBgColor; + @include border-radius(50%); + padding: 4px 8px; + font-size: 16px; + color: #ffffff; + } + + .ui-steps-title { + display: inline; + margin-left: 10px; + color: $textSecondaryColor; + } + } + + &.ui-state-highlight { + .ui-steps-number { + background-color: $primaryColor; + } + + .ui-steps-title { + font-weight: 700; + color: $textColor; + } + } + + &:last-child { + .ui-menuitem-link { + display: block; + } + } + } + + &:before { + content:' '; + border: 1px solid $dividerColor; + width: 90%; + top: 45%; + left: 0; + display: block; + position: absolute; + } + } + + .ui-menu { + padding: 8px 0; + + .ui-shadow, &.ui-shadow { + @include overlay-input-shadow(); + } + + .ui-menu-list { + padding: 0; + margin: 0; + + li { + &.ui-widget-header { + margin: 0 0 1px 0; + @include border-radius(0); + border: 0 none; + width: 100%; + box-sizing: border-box; + padding: 0; + + h3 { + display: block; + float: none; + font-size: $fontSize; + padding: $menuitemPadding; + font-weight: 400; + + .ui-icon { + &.ui-icon-triangle-1-s, &.ui-icon-triangle-1-e { + margin: -12px 0 0 0; + } + } + } + } + + &.ui-menuitem { + margin: 0; + @include border-radius(0); + + &.ui-state-hover { + @include hover-element(); + } + + .ui-menuitem-link { + border: 0 none; + padding: $menuitemPadding; + width: 100%; + min-height: 32px; + box-sizing: border-box; + color: $textColor; + @include border-radius(0); + position: relative; + + &.ui-state-hover { + @include hover-element(); + } + + .ui-menuitem-icon { + margin-right: 8px; + display: inline-block; + vertical-align: middle; + float: none; + font-size: $iconFontSize - 2; + height: auto; + } + + .ui-menuitem-text { + display: inline-block; + vertical-align: middle; + float: none; + } + } + } + } + + .ui-separator { + height: 1px; + background-color: $dividerColor; + width: 100%; + box-sizing: border-box; + } + } + + &.ui-menu-toggleable { + .ui-menu-list { + li { + &.ui-widget-header { + padding-left: 30px; + + .ui-icon { + color: #ffffff; + + &.ui-icon-triangle-1-s { + margin-top: -10px; + } + + &.ui-icon-triangle-1-e { + margin-top: -10px; + } + } + } + } + } + } + + &.ui-tieredmenu { + .ui-icon-triangle-1-e { + position: absolute; + right: 8px; + top: 6px; + float: none; + } + + .ui-menu-child { + padding: 8px 0; + } + } + + &.ui-menubar { + padding: 0; + + .ui-menu-child { + padding: 8px 0; + } + + .ui-menubar-options { + padding: 0 10px; + } + + &.ui-megamenu { + &.ui-megamenu-vertical { + > .ui-menu-list { + padding: 8px 0; + } + } + } + } + + &.ui-slidemenu { + + .ui-menu-parent { + .ui-menu-child { + padding: 0; + @include no-shadow(); + } + } + + .ui-slidemenu-backward { + width: 100%; + @include border-box-sizing(); + @include border-radius(0); + } + } + } + + .ui-tabmenu { + padding: 0; + + .ui-tabmenu-nav { + padding: 0; + background-color: #ffffff; + border: 0 none; + @include border-radius(0px); + + > .ui-tabmenuitem { + top: auto; + margin: 0 4px 0 0; + padding: 0; + border-style: solid; + border-width: 0 0 2px 0; + @include transition(border-color $transitionDuration); + + > a { + padding: $headerPadding; + + &:focus { + outline: 0 none; + } + + .ui-menuitem-icon, .ui-menuitem-text { + float: none; + display: inline-block; + vertical-align: middle; + } + + .ui-menuitem-icon { + margin-right: 12px; + } + } + + &.ui-state-default { + a { + color: $textSecondaryColor; + + .ui-icon { + color: $textSecondaryColor; + } + } + } + + &.ui-state-hover { + background-color: #ffffff; + } + + &.ui-state-active { + background-color: #ffffff; + border-color: $accentColor; + border-style: solid; + + a { + color: $primaryColor; + + .ui-icon { + color: $primaryColor; + } + } + } + } + } + } + + .ui-panelmenu { + .ui-panelmenu-header { + background-color: $primaryColor; + margin-bottom: 1px; + + a { + padding: 6px 10px 6px 36px; + color: #ffffff; + font-size: $fontSize; + } + + .ui-icon { + color: #ffffff; + margin-top: -10px; + font-size: $iconFontSize - 2; + height: auto; + } + + &.ui-state-active { + background-color: $accentColor; + @include border-radius-bottom(0); + a, .ui-icon { + color: $accentTextColor; + } + } + } + + .ui-panelmenu-content { + padding: 0; + + .ui-menuitem { + margin: 0; + + .ui-menuitem-link { + border: 0 none; + padding: $menuitemPadding; + width: 100%; + min-height: 30px; + box-sizing: border-box; + color: $textColor; + @include border-radius(0); + position: relative; + + &.ui-state-hover { + @include hover-element(); + } + + .ui-menuitem-text { + display: inline-block; + vertical-align: middle; + float: none; + } + + .ui-icon { + position: static; + display: inline-block; + vertical-align: middle; + margin-right: 6px; + font-size: $iconFontSize - 2; + height: auto; + } + } + } + } + } +} \ No newline at end of file diff --git a/ace-web/src/main/webapp/resources/sass/theme/_messages.scss b/ace-web/src/main/webapp/resources/sass/theme/_messages.scss new file mode 100644 index 0000000..f8386ed --- /dev/null +++ b/ace-web/src/main/webapp/resources/sass/theme/_messages.scss @@ -0,0 +1,245 @@ +body { + /* Messages */ + .ui-messages { + > div { + padding: 10px 16px; + } + + ul { + display: inline-block; + margin-left: 0; + } + + .ui-messages-info { + background-color: #2196F3; + border-color: #2196F3; + color: #ffffff; + + .ui-messages-close:hover { + background-color: lighten(#2196F3,15%); + } + } + + .ui-messages-warn { + background-color: #ffc107; + border-color: #ffc107; + color: #000000; + + .ui-messages-close:hover { + background-color: lighten(#ffc107,15%); + } + } + + .ui-messages-error { + background-color: #e62a10; + border-color: #e62a10; + color: #ffffff; + + .ui-messages-close:hover { + background-color: lighten(#e62a10,15%); + } + } + + .ui-messages-fatal { + background-color: #212121; + border-color: #212121; + color: #ffffff; + + .ui-messages-close:hover { + background-color: lighten(#212121,15%); + } + } + } + + .ui-message { + padding: 4px 8px; + + &.ui-message-info { + background-color: #2196F3; + border-color: #2196F3; + color: #ffffff; + } + + &.ui-message-warn { + background-color: #ffc107; + border-color: #ffc107; + color: #ffffff; + } + + &.ui-message-error { + background-color: #e62a10; + border-color: #e62a10; + color: #ffffff; + } + + &.ui-message-fatal { + background-color: #212121; + border-color: #212121; + color: #ffffff; + } + + &.ui-message-icon-only { + text-align: center; + + span { + float: none; + margin-top: -1px; + position: static; + } + } + } + + /* Info */ + .ui-messages .ui-messages-info-icon,.ui-message .ui-message-info-icon { + background: none; + @include material-icon("\e88e"); + font-size: 24px; + color: #fff; + } + + .ui-message .ui-message-info-icon { + margin-top: -1px; + font-size: 18px; + right: 1px; + } + + /* Error */ + .ui-messages .ui-messages-error-icon, .ui-message .ui-message-error-icon { + background: none; + @include material-icon("\e000"); + font-size: 24px; + color: #fff; + } + + .ui-message .ui-message-error-icon { + margin-top: -1px; + font-size: 18px; + right: 1px; + } + + /* Warn */ + .ui-messages .ui-messages-warn-icon,.ui-message .ui-message-warn-icon { + background: none; + @include material-icon("\e002"); + font-size: 24px; + color: $textColor; + } + + .ui-messages .ui-messages-warn { + .ui-messages-close { + color: $textColor; + } + } + + .ui-message .ui-message-warn-icon { + margin-top: -1px; + font-size: 18px; + right: 1px; + } + + /* Fatal */ + .ui-messages .ui-messages-fatal-icon,.ui-message .ui-message-fatal-icon { + background: none; + @include material-icon("\e000"); + font-size: 24px; + color: #fff; + } + + .ui-message .ui-message-fatal-icon { + margin-top: -1px; + font-size: 18px; + } + + .ui-messages-close { + text-decoration: none; + color: #fff; + width: $iconWidth; + height: $iconWidth; + margin-top: -2px; + @include border-radius(50%); + @include transition(background-color $transitionDuration); + } + + .md-inputfield { + .ui-message { + &.ui-message-error { + background-color: transparent; + border: 0 none; + margin: 0px; + color: $inputErrorTextColor; + font-size: $errorMessageFontSize; + + .ui-message-error-icon { + color: $inputErrorTextColor; + font-size: $errorMessageIconFontSize; + } + } + } + } + + .ui-growl { + top: 90px; + + > .ui-growl-item-container { + opacity: 1; + + &.ui-growl-info { + background-color: #2196F3; + } + + &.ui-growl-warn { + background-color: #ffc107; + } + + &.ui-growl-error { + background-color: #e62a10; + } + + &.ui-growl-fatal { + background-color: #212121; + } + + &.ui-shadow { + @include overlay-content-shadow(); + } + } + + .ui-growl-item { + .ui-growl-image { + background: none; + color: #ffffff; + padding: 4px; + + &.ui-growl-image-info { + @include material-icon("\e88e"); + font-size: 36px; + } + + &.ui-growl-image-error { + @include material-icon("\e000"); + font-size: 36px; + } + + &.ui-growl-image-warn { + @include material-icon("\e002"); + font-size: 36px; + } + + &.ui-growl-image-fatal { + @include material-icon("\e000"); + font-size: 36px; + } + } + + .ui-growl-message { + color: #ffffff; + } + + .ui-growl-icon-close { + @include material-icon("\e5cd"); + font-size: 24px; + color: #ffffff; + } + } + } +} \ No newline at end of file diff --git a/ace-web/src/main/webapp/resources/sass/theme/_misc.scss b/ace-web/src/main/webapp/resources/sass/theme/_misc.scss new file mode 100644 index 0000000..941df64 --- /dev/null +++ b/ace-web/src/main/webapp/resources/sass/theme/_misc.scss @@ -0,0 +1,91 @@ +body { + .jqplot-target { + font-family: $fontFamily; + } + + .ui-progressbar { + height: 16px; + padding: 0; + border-color: $contentBorderColor; + + .ui-progressbar-value { + height: 16px; + padding: 0; + } + + .ui-progressbar-label { + color: $accentColor; + } + } + + .ui-galleria { + padding: 0; + + .ui-galleria-nav-prev { + left: 2px; + } + + .ui-galleria-nav-next { + right: 2px; + } + } + + .ui-log { + .ui-log-header { + padding: $headerPadding; + height: auto; + + > .ui-log-button { + line-height: 16px; + position: static; + display: inline-block; + vertical-align: middle; + margin-right: 4px; + border: 1px solid transparent; + padding: 1px 3px; + @include border-radius(50%); + @include transition(background-color $transitionDuration); + + &.ui-state-hover { + background-color: $primaryLightColor; + } + } + } + } + + .ui-tagcloud { + li { + margin: 4px 0px; + + a { + @include transition(background-color $transitionDuration); + @include border-radius(3px); + + &:hover { + @include hover-element(); + } + } + } + } + + .timeline-frame { + .timeline-event { + border-color: $contentBorderColor; + background-color: $contentBgColor; + + &.ui-state-active { + background-color: $accentColor; + border-color: $accentColor; + color: $accentTextColor; + } + } + + .timeline-axis { + border-color: $dividerColor; + } + + .timeline-navigation { + height: 36px; + } + } +} \ No newline at end of file diff --git a/ace-web/src/main/webapp/resources/sass/theme/_overlays.scss b/ace-web/src/main/webapp/resources/sass/theme/_overlays.scss new file mode 100644 index 0000000..e207b44 --- /dev/null +++ b/ace-web/src/main/webapp/resources/sass/theme/_overlays.scss @@ -0,0 +1,193 @@ +body { + .ui-dialog { + &.ui-shadow { + @include overlay-content-shadow(); + } + + .ui-dialog-titlebar { + background-color: #ffffff; + color: $textColor; + padding: $headerPadding; + + .ui-dialog-title { + font-weight: 700; + } + + .ui-dialog-titlebar-icon { + padding: 0; + @include border-radius(50%); + @include transition(background-color $transitionDuration); + + &.ui-state-hover, &.ui-state-focus { + @include hover-element(); + } + + .ui-icon { + color: $textSecondaryColor; + } + + .ui-icon-extlink { + @include icon_override('fullscreen'); + } + + .ui-icon-newwin { + @include icon_override('fullscreen_exit'); + } + } + } + + .ui-dialog-buttonpane, .ui-dialog-footer { + text-align: right; + + .ui-button { + background-color: #ffffff; + color: $textColor; + @include no-shadow(); + + .ui-icon { + color: $textSecondaryColor; + } + + &.ui-state-hover { + @include hover-element(); + } + } + } + + .ui-confirm-dialog-severity { + margin: 0px 12px; + } + } + + .ui-sidebar { + .ui-sidebar-close { + &:hover { + padding: 1px; + } + } + + .ui-button { + width: auto; + } + } + + .ui-lightbox { + &.ui-shadow { + @include overlay-content-shadow(); + } + + .ui-lightbox-caption { + padding: $headerPadding; + + .ui-lightbox-caption-text { + margin: 0; + } + + .ui-lightbox-close { + @include border-radius(50%); + @include transition(background-color $transitionDuration); + padding: 0; + margin: 0; + width: $iconWidth; + height: $iconHeight; + + &.ui-state-hover { + @include hover-element-primary(); + padding: 0; + } + } + } + + .ui-lightbox-content-wrapper { + .ui-lightbox-nav-right, .ui-lightbox-nav-left { + top: 40%; + + .ui-icon { + @include transition(color $transitionDuration); + font-size: 48px; + color: $primaryLightColor; + } + + &:hover { + .ui-icon { + color: #ffffff; + } + } + } + + .ui-lightbox-nav-right { + right: 24px; + } + } + } + + .ui-overlaypanel { + &.ui-shadow { + @include overlay-content-shadow(); + } + + .ui-overlaypanel-close { + background-color: $accentColor; + @include border-radius(50%); + @include transition(background-color $transitionDuration); + padding: 2px 4px; + right: -16px; + top: -16px; + @include content-shadow(); + + span { + color: $accentTextColor; + + &:before { + position: relative; + top: 2px; + } + } + + &.ui-state-hover { + background-color: $accentDarkColor; + } + } + } + + .ui-tooltip { + @include opacity(.9); + font-size: $fontSize - 2px; + + .ui-tooltip-text { + background-color: #323232; + @include overlay-content-shadow(); + } + + &.ui-tooltip-top { + .ui-tooltip-arrow { + border-top-color: #323232; + } + } + + &.ui-tooltip-bottom { + .ui-tooltip-arrow { + border-bottom-color: #323232; + } + } + + &.ui-tooltip-left { + .ui-tooltip-arrow { + border-left-color: #323232; + } + } + + &.ui-tooltip-right { + .ui-tooltip-arrow { + border-right-color: #323232; + } + } + } + + .ui-state-error, + .ui-widget.ui-state-error, + .ui-widget-content .ui-state-error, + .ui-widget-header .ui-state-error { + border-color: #e62a10; + } +} \ No newline at end of file diff --git a/ace-web/src/main/webapp/resources/sass/theme/_panels.scss b/ace-web/src/main/webapp/resources/sass/theme/_panels.scss new file mode 100644 index 0000000..02b4086 --- /dev/null +++ b/ace-web/src/main/webapp/resources/sass/theme/_panels.scss @@ -0,0 +1,432 @@ +body { + .ui-panel { + padding: 0; + + .ui-panel-titlebar { + border: 0 none; + padding: $headerPadding; + @include border-radius-top(2px); + @include border-radius-bottom(0px); + + .ui-panel-title { + margin: 0; + line-height: $lineHeight + 2; + } + + .ui-panel-titlebar-icon { + width: $iconWidth; + height: $iconHeight; + color: $headerTextColor; + margin: 0; + @include transition(background-color $transitionDuration); + @include border-radius(50%); + + &:hover { + background-color: $primaryLightColor; + } + } + } + + .ui-panel-content { + height: 100%; + box-sizing: border-box; + padding: $contentPadding; + } + + .ui-panel-footer { + padding: $headerPadding; + border: 0 none; + border-top: 1px solid $dividerColor; + margin: 0; + } + + &.ui-panel-collapsed-h { + .ui-panel-titlebar { + padding-left: 40px; + } + } + } + + .ui-fieldset { + padding: $contentPadding; + + .ui-fieldset-legend { + padding: $headerPadding; + padding-left: 2px; + padding-right: 8px; + color: $primaryColor; + + .ui-fieldset-toggler { + padding: 8px; + background-color: $primaryColor; + color: #ffffff; + @include border-radius(50%); + @include transition(background-color $transitionDuration); + margin-top: -10px; + margin-right: 8px; + @include content-shadow(); + + &:hover { + background-color: $primaryDarkColor; + } + } + + &.ui-state-focus { + background-color: transparent; + } + + &.ui-state-active { + background-color: transparent; + } + } + } + + .ui-notificationbar { + background-color: $accentColor; + color: $accentTextColor; + } + + .ui-panelgrid { + .ui-panelgrid-cell { + padding: $contentPadding; + } + + .ui-panelgrid-header, + .ui-panelgrid-footer { + > .ui-widget-header { + border-color: $primaryDarkColor; + } + } + + tbody { + .ui-panelgrid-cell { + &.ui-widget-header { + background-color: $primaryLightColor; + } + } + } + } + + .ui-accordion { + .ui-accordion-header { + background-color: $primaryColor; + padding: $headerPadding; + padding-left: 36px; + font-size: $fontSize; + color: $primaryTextColor; + @include transition(background-color $transitionDuration); + + &.ui-state-hover { + background-color: $primaryDarkColor; + } + + &.ui-state-active { + background-color: $accentColor; + color: $accentTextColor; + + &.ui-tabs-outline { + outline: 0 none; + background-color: lighten($accentColor, 10%); + } + } + + .ui-icon-triangle-1-e { + margin-top: -10px; + } + + .ui-icon-triangle-1-s { + margin-top: -10px; + } + + &.ui-tabs-outline { + background-color: lighten($primaryColor, 10%); + } + } + + .ui-accordion-content { + padding: $contentPadding; + line-height: $lineHeight; + } + } + + .ui-scrollpanel { + padding: 0; + + .ui-scrollpanel-track { + background-color: #ffffff; + border-color: transparent; + padding: 0; + } + + .ui-scrollpanel-drag { + @include border-radius(3px); + background-color: $dividerColor; + } + } + + .ui-toolbar { + background-color: $primaryDarkColor; + @include content-shadow(); + padding: 10px; + + .ui-button { + margin-right: 6px; + } + } + + .ui-tabs { + padding: 0; + + .ui-tabs-nav { + background-color: #ffffff; + border: 0 none; + @include border-radius(0); + + > li { + padding: 0; + @include transition(border-color $transitionDuration); + + > a { + padding: $headerPadding; + + &:focus { + outline: 0 none; + } + } + + > .ui-icon-close { + margin: 7px 0 0 0; + @include transition(color $transitionDuration); + color: $textSecondaryColor; + } + + &.ui-state-default { + a { + color: $textSecondaryColor; + } + } + + &.ui-state-hover { + background-color: #ffffff; + } + + &.ui-state-active { + background-color: #ffffff; + border-color: $accentColor; + border-style: solid; + + a { + color: $primaryColor; + font-weight: 700; + } + + > .ui-icon-close { + color: $accentColor; + } + } + + &.ui-tabs-outline { + outline: 0 none; + border-color: $accentLightColor; + } + } + } + + .ui-tabs-panel { + padding: $contentPadding; + } + + &.ui-tabs-top { + > .ui-tabs-nav { + padding: 0; + margin: 0; + @include border-radius-top(4px); + border-bottom: 1px solid $dividerColor; + + > li { + border-style: solid; + border-width: 0 0 2px 0; + } + } + } + + &.ui-tabs-bottom { + > .ui-tabs-nav { + padding: 0; + margin: 0; + @include border-radius-bottom(4px); + border-top: 1px solid $dividerColor; + + > li { + border-width: 2px 0 0 0; + } + } + } + + &.ui-tabs-left { + > .ui-tabs-nav { + padding: 0; + margin: 0; + @include border-radius-left(4px); + border-right: 1px solid $dividerColor; + + > li { + box-sizing: border-box; + border-width: 0 2px 0 0; + + > a { + width: 100%; + box-sizing: border-box; + } + } + } + } + + &.ui-tabs-right { + > .ui-tabs-nav { + padding: 0; + @include border-radius-right(4px); + border-left: 1px solid $dividerColor; + + > li { + box-sizing: border-box; + border-width: 0 0 0 2px; + + > a { + width: 100%; + box-sizing: border-box; + } + + &.ui-state-active { + > a { + padding-left: 14px; + } + } + } + } + } + + &.ui-tabs-scrollable { + .ui-tabs-navscroller { + > .ui-tabs-navscroller-btn { + outline: 0 none; + width: 18px; + display: block; + height: 42px; + background-color: #ffffff; + @include border-radius(0); + @include transition(background-color $transitionDuration); + + > span { + margin-top: 10px; + } + + &:hover { + @include hover-element(); + } + } + + > .ui-tabs-navscroller-btn-left { + z-index: 1; + left: 0; + border-right: 1px solid $dividerColor; + > span { + &:before { + position: relative; + left: -2px; + } + } + } + + > .ui-tabs-navscroller-btn-right { + z-index: 1; + right: 0; + border-left: 1px solid $dividerColor; + + > span { + &:before { + position: relative; + right: 2px; + } + } + } + + .ui-tabs-nav { + > li { + margin: 0; + } + } + } + + &.ui-tabs-top { + .ui-tabs-navscroller { + > .ui-tabs-nav { + border-bottom: 1px solid $dividerColor; + + > li { + border-style: solid; + border-width: 0 0 2px 0; + } + } + + > .ui-tabs-navscroller-btn-left { + border-top: 0 none; + border-bottom: 1px solid $dividerColor; + } + } + } + + &.ui-tabs-bottom { + .ui-tabs-navscroller { + > .ui-tabs-nav { + border-top: 1px solid $dividerColor; + + > li { + border-style: solid; + border-width: 2px 0 0 0; + } + } + + > .ui-tabs-navscroller-btn-left { + border-bottom: 0 none; + border-top: 1px solid $dividerColor; + } + + > .ui-tabs-navscroller-btn-right { + border-top: 1px solid $dividerColor; + } + } + } + } + } + + .ui-wizard { + .ui-wizard-step-titles { + background-color: $primaryDarkColor; + @include border-radius-top(3px); + + > li { + padding: $headerPadding; + color: #ffffff; + + &.ui-state-highlight { + color: #ffffff; + background-color: transparent; + border-bottom: 2px solid $accentColor; + @include border-radius(0); + } + } + } + + .ui-wizard-content { + margin: 0; + + .ui-panel { + .ui-panel-titlebar { + @include border-radius(0); + } + } + } + } + +} \ No newline at end of file diff --git a/ace-web/src/main/webapp/resources/sass/theme/_theme.scss b/ace-web/src/main/webapp/resources/sass/theme/_theme.scss new file mode 100644 index 0000000..4783066 --- /dev/null +++ b/ace-web/src/main/webapp/resources/sass/theme/_theme.scss @@ -0,0 +1,14 @@ +@import '../variables/_theme'; +@import '../_mixins'; +@import '_common'; +@import '_forms'; +@import '_data'; +@import '_panels'; +@import '_menus'; +@import '_messages'; +@import '_misc'; +@import '_overlays'; +@import '_media'; +@import '_icons'; +@import '../_theme_styles.scss'; + diff --git a/ace-web/src/main/webapp/resources/sass/variables/_common.scss b/ace-web/src/main/webapp/resources/sass/variables/_common.scss new file mode 100644 index 0000000..aec4366 --- /dev/null +++ b/ace-web/src/main/webapp/resources/sass/variables/_common.scss @@ -0,0 +1,29 @@ +/******************************/ +/* Common */ +/******************************/ +$fontSize:14px; +$fontFamily:"Roboto","Helvetica Neue",sans-serif; +$textColor:#212121; +$textSecondaryColor:#757575; +$lineHeight:18px; +$borderRadius:3px; +$dividerColor:#dbdbdb; +$dividerLightColor:#f8f8f8; +$transitionDuration:.3s; +$iconWidth:20px; +$iconHeight:20px; +$iconFontSize:20px; +$hoverBgColor:#e8e8e8; +$hoverTextColor:#000000; + +/* Predefined Colors */ +$blue:#147df0; +$pink:#ed3c76; +$green:#3e9018; +$red:#da2f31; +$orange:#ffb200; +$teal:#599597; +$purple:#633ea5; +$black:#000000; +$yellow:#ffd644; +$grayBgColor:#757575; \ No newline at end of file diff --git a/ace-web/src/main/webapp/resources/sass/variables/_layout.scss b/ace-web/src/main/webapp/resources/sass/variables/_layout.scss new file mode 100644 index 0000000..d3a3890 --- /dev/null +++ b/ace-web/src/main/webapp/resources/sass/variables/_layout.scss @@ -0,0 +1,11 @@ +@import './common'; + +$bodyBgColor:#F5F5F5; +$topbarSubmenuHoverBgColor:#f1f2f7; +$topbarMobileMenuBgColor:#ffffff; +$mobileBreakpoint:1024px; +$contentMobileMaskBgColor:#424242; +$breadcrumbBgColor:#ffffff; +$footerBgColor:#ffffff; +$nanoSliderBgColor:#aaaaaa; +$topbarSubmenuBgColor:#ffffff; diff --git a/ace-web/src/main/webapp/resources/sass/variables/_theme.scss b/ace-web/src/main/webapp/resources/sass/variables/_theme.scss new file mode 100644 index 0000000..738a81f --- /dev/null +++ b/ace-web/src/main/webapp/resources/sass/variables/_theme.scss @@ -0,0 +1,40 @@ +@import './common'; + +$headerPadding:8px 14px; +$headerTextColor:#ffffff; + +$contentPadding:8px 14px; +$contentBorderColor:#d8d8d8; +$contentBgColor:#ffffff; + +$inputBorderColor:#bdbdbd; +$inputInvalidBorderColor:#e62a10; +$inputBgColor:#ffffff; +$inputErrorTextColor:#e62a10; +$inputHeaderPadding:6px 10px; + +//groups +$inputGroupBorderColor:#bdbdbd; +$inputGroupBgColor:transparent; +$inputGroupTextColor:#757575; +$inputGroupIconColor:#bdbdbd; +$inputGroupAddonMinWidth:2*$fontSize; +$checkboxWidth:18px; +$checkboxHeight:18px; +$inputGroupPadding:2px 2px 1px 2px; +$borderRadius:0px; +$inputGroupIconFontSize: 1.5em; + +$buttonTextColor:#ffffff; + +$listItemPadding:6px 10px; + +$radioButtonBorderColor:#757575; +$checkboxBorderColor:#757575; + +$errorMessageFontSize:11px; +$errorMessageIconFontSize:13px; + +$dataTableRowBgColorEven:#f4f4f4; +$paginatorPadding:6px 10px; +$menuitemPadding:6px 10px; \ No newline at end of file diff --git a/ace-web/src/main/webapp/resources/serenity-layout/css/grid.css b/ace-web/src/main/webapp/resources/serenity-layout/css/grid.css new file mode 100644 index 0000000..5506190 --- /dev/null +++ b/ace-web/src/main/webapp/resources/serenity-layout/css/grid.css @@ -0,0 +1,347 @@ +/* + * New Grid CSS + * Only necessary to add if your PrimeFaces version is older than 5.3.14 + */ +.ui-g { + display: -webkit-box; + display: -moz-box; + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + flex-wrap: wrap; +} + +.ui-g:after { + clear: both; + content: ""; + display: table; +} + +.ui-g-1, +.ui-g-2, +.ui-g-3, +.ui-g-4, +.ui-g-5, +.ui-g-6, +.ui-g-7, +.ui-g-8, +.ui-g-9, +.ui-g-10, +.ui-g-11, +.ui-g-12 { + float: left; + box-sizing: border-box; + padding: 0.5em; +} + +.ui-g-1 { + width: 8.3333%; +} + +.ui-g-2 { + width: 16.6667%; +} + +.ui-g-3 { + width: 25%; +} + +.ui-g-4 { + width: 33.3333%; +} + +.ui-g-5 { + width: 41.6667%; +} + +.ui-g-6 { + width: 50%; +} + +.ui-g-7 { + width: 58.3333%; +} + +.ui-g-8 { + width: 66.6667%; +} + +.ui-g-9 { + width: 75%; +} + +.ui-g-10 { + width: 83.3333%; +} + +.ui-g-11 { + width: 91.6667%; +} + +.ui-g-12 { + width: 100%; +} + +@media screen and (max-width: 40em) { + .ui-sm-1, + .ui-sm-2, + .ui-sm-3, + .ui-sm-4, + .ui-sm-5, + .ui-sm-6, + .ui-sm-7, + .ui-sm-8, + .ui-sm-9, + .ui-sm-10, + .ui-sm-11, + .ui-sm-12 { + padding: 0.5em; + } + + .ui-sm-1 { + width: 8.3333%; + } + + .ui-sm-2 { + width: 16.6667%; + } + + .ui-sm-3 { + width: 25%; + } + + .ui-sm-4 { + width: 33.3333%; + } + + .ui-sm-5 { + width: 41.6667%; + } + + .ui-sm-6 { + width: 50%; + } + + .ui-sm-7 { + width: 58.3333%; + } + + .ui-sm-8 { + width: 66.6667%; + } + + .ui-sm-9 { + width: 75%; + } + + .ui-sm-10 { + width: 83.3333%; + } + + .ui-sm-11 { + width: 91.6667%; + } + + .ui-sm-12 { + width: 100%; + } +} + +@media screen and (min-width: 40.063em) { + .ui-md-1, + .ui-md-2, + .ui-md-3, + .ui-md-4, + .ui-md-5, + .ui-md-6, + .ui-md-7, + .ui-md-8, + .ui-md-9, + .ui-md-10, + .ui-md-11, + .ui-md-12 { + padding: 0.5em; + } + + .ui-md-1 { + width: 8.3333%; + } + + .ui-md-2 { + width: 16.6667%; + } + + .ui-md-3 { + width: 25%; + } + + .ui-md-4 { + width: 33.3333%; + } + + .ui-md-5 { + width: 41.6667%; + } + + .ui-md-6 { + width: 50%; + } + + .ui-md-7 { + width: 58.3333%; + } + + .ui-md-8 { + width: 66.6667%; + } + + .ui-md-9 { + width: 75%; + } + + .ui-md-10 { + width: 83.3333%; + } + + .ui-md-11 { + width: 91.6667%; + } + + .ui-md-12 { + width: 100%; + } +} + +@media screen and (min-width: 64.063em) { + .ui-lg-1, + .ui-lg-2, + .ui-lg-3, + .ui-lg-4, + .ui-lg-5, + .ui-lg-6, + .ui-lg-7, + .ui-lg-8, + .ui-lg-9, + .ui-lg-10, + .ui-lg-11, + .ui-lg-12 { + padding: 0.5em; + } + + .ui-lg-1 { + width: 8.3333%; + } + + .ui-lg-2 { + width: 16.6667%; + } + + .ui-lg-3 { + width: 25%; + } + + .ui-lg-4 { + width: 33.3333%; + } + + .ui-lg-5 { + width: 41.6667%; + } + + .ui-lg-6 { + width: 50%; + } + + .ui-lg-7 { + width: 58.3333%; + } + + .ui-lg-8 { + width: 66.6667%; + } + + .ui-lg-9 { + width: 75%; + } + + .ui-lg-10 { + width: 83.3333%; + } + + .ui-lg-11 { + width: 91.6667%; + } + + .ui-lg-12 { + width: 100%; + } +} + +@media screen and (min-width: 90.063em) { + .ui-xl-1, + .ui-xl-2, + .ui-xl-3, + .ui-xl-4, + .ui-xl-5, + .ui-xl-6, + .ui-xl-7, + .ui-xl-8, + .ui-xl-9, + .ui-xl-10, + .ui-xl-11, + .ui-xl-12 { + padding: 0.5em; + } + + .ui-xl-1 { + width: 8.3333%; + } + + .ui-xl-2 { + width: 16.6667%; + } + + .ui-xl-3 { + width: 25%; + } + + .ui-xl-4 { + width: 33.3333%; + } + + .ui-xl-5 { + width: 41.6667%; + } + + .ui-xl-6 { + width: 50%; + } + + .ui-xl-7 { + width: 58.3333%; + } + + .ui-xl-8 { + width: 66.6667%; + } + + .ui-xl-9 { + width: 75%; + } + + .ui-xl-10 { + width: 83.3333%; + } + + .ui-xl-11 { + width: 91.6667%; + } + + .ui-xl-12 { + width: 100%; + } +} + +.ui-g-nopad { + padding: 0px; +} \ No newline at end of file diff --git a/ace-web/src/main/webapp/resources/serenity-layout/css/layout-green.css b/ace-web/src/main/webapp/resources/serenity-layout/css/layout-green.css new file mode 100644 index 0000000..ae6b20b --- /dev/null +++ b/ace-web/src/main/webapp/resources/serenity-layout/css/layout-green.css @@ -0,0 +1,2938 @@ +/* Sidebar */ +/* Primary */ +/* Accent */ +/* Topbar */ +/* Submenu */ +/* Default MenuItem */ +/* Hover MenuItem */ +/* Active MenuItem */ +/* Dark Default MenuItem */ +/* Dark Hover MenuItem */ +/* Dark Active MenuItem */ +/******************************/ +/* Common */ +/******************************/ +/* Predefined Colors */ +/* roboto-300 - latin */ +@font-face { + font-family: "Roboto"; + font-style: normal; + font-weight: 300; + src: url("#{resource['serenity-layout:fonts/roboto-v15-latin-300.eot']}"); + /* IE9 Compat Modes */ + src: local("Roboto Light"), local("Roboto-Light"), url("#{resource['serenity-layout:fonts/roboto-v15-latin-300.eot']}#iefix") format("embedded-opentype"), url("#{resource['serenity-layout:fonts/roboto-v15-latin-300.woff2']}") format("woff2"), url("#{resource['serenity-layout:fonts/roboto-v15-latin-300.woff']}") format("woff"), url("#{resource['serenity-layout:fonts/roboto-v15-latin-300.ttf']}") format("truetype"), url("#{resource['serenity-layout:fonts/roboto-v15-latin-300.svg']}#Roboto") format("svg"); + /* Legacy iOS */ +} +/* roboto-regular - latin */ +@font-face { + font-family: "Roboto"; + font-style: normal; + font-weight: 400; + src: url("#{resource['serenity-layout:fonts/roboto-v15-latin-regular.eot']}"); + /* IE9 Compat Modes */ + src: local("Roboto"), local("Roboto-Regular"), url("#{resource['serenity-layout:fonts/roboto-v15-latin-regular.eot']}#iefix") format("embedded-opentype"), url("#{resource['serenity-layout:fonts/roboto-v15-latin-regular.woff2']}") format("woff2"), url("#{resource['serenity-layout:fonts/roboto-v15-latin-regular.woff']}") format("woff"), url("#{resource['serenity-layout:fonts/roboto-v15-latin-regular.ttf']}") format("truetype"), url("#{resource['serenity-layout:fonts/roboto-v15-latin-regular.svg']}#Roboto") format("svg"); + /* Legacy iOS */ +} +/* roboto-700 - latin */ +@font-face { + font-family: "Roboto"; + font-style: normal; + font-weight: 700; + src: url("#{resource['serenity-layout:fonts/roboto-v15-latin-700.eot']}"); + /* IE9 Compat Modes */ + src: local("Roboto Bold"), local("Roboto-Bold"), url("#{resource['serenity-layout:fonts/roboto-v15-latin-700.eot']}#iefix") format("embedded-opentype"), url("#{resource['serenity-layout:fonts/roboto-v15-latin-700.woff2']}") format("woff2"), url("#{resource['serenity-layout:fonts/roboto-v15-latin-700.woff']}") format("woff"), url("#{resource['serenity-layout:fonts/roboto-v15-latin-700.ttf']}") format("truetype"), url("#{resource['serenity-layout:fonts/roboto-v15-latin-700.svg']}#Roboto") format("svg"); + /* Legacy iOS */ +} +@font-face { + font-family: "Material Icons"; + font-style: normal; + font-weight: 400; + src: url("#{resource['serenity-layout:fonts/MaterialIcons-Regular.eot']}"); + /* For IE6-8 */ + src: local("Material Icons"), local("MaterialIcons-Regular"), url("#{resource['serenity-layout:fonts/MaterialIcons-Regular.woff2']}") format("woff2"), url("#{resource['serenity-layout:fonts/MaterialIcons-Regular.woff']}") format("woff"), url("#{resource['serenity-layout:fonts/MaterialIcons-Regular.ttf']}") format("truetype"); +} +/* Utils */ +.clearfix:after { + content: " "; + display: block; + clear: both; +} + +.card { + box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.14), 0 2px 1px -1px rgba(0, 0, 0, 0.12); + -webkit-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.14), 0 2px 1px -1px rgba(0, 0, 0, 0.12); + -moz-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.14), 0 2px 1px -1px rgba(0, 0, 0, 0.12); + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + border-radius: 2px; + background: #ffffff; + padding: 16px; + margin-bottom: 16px; + box-sizing: border-box; +} +.card.card-w-title { + padding-bottom: 32px; +} +.card h1 { + font-size: 24px; + font-weight: 400; + margin: 24px 0; +} +.card h1:first-child { + margin-top: 16px; +} +.card h2 { + font-size: 22px; + font-weight: 400; +} +.card h3 { + font-size: 20px; + font-weight: 400; +} +.card h4 { + font-size: 18px; + font-weight: 400; +} + +.nopad { + padding: 0; +} +.nopad .ui-panel-content { + padding: 0; +} + +@-webkit-keyframes fadeInDown { + from { + opacity: 0; + -webkit-transform: translate3d(0, -20px, 0); + transform: translate3d(0, -20px, 0); + } + to { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} +@keyframes fadeInDown { + from { + opacity: 0; + transform: translate3d(0, -20px, 0); + } + to { + opacity: 1; + transform: none; + } +} +@-webkit-keyframes fadeOutUp { + from { + opacity: 1; + } + to { + opacity: 0; + -webkit-transform: translate3d(0, -20px, 0); + transform: translate3d(0, -20px, 0); + } +} +@keyframes fadeOutUp { + from { + opacity: 1; + } + to { + opacity: 0; + -webkit-transform: translate3d(0, -20px, 0); + transform: translate3d(0, -20px, 0); + } +} +.fadeInDown { + -webkit-animation: fadeInDown 5s; + /* Safari 4.0 - 8.0 */ + animation: fadeInDown 5s; +} + +.fadeOutUp { + -webkit-animation: fadeOutUp 0.3s; + /* Safari 4.0 - 8.0 */ + animation: fadeOutUp 0.3s; +} + +.ui-shadow-1 { + -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24); + -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24); + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24); +} + +.ui-shadow-2 { + -webkit-box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23); + -moz-box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23); + box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23); +} + +.ui-shadow-3 { + -webkit-box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23); + -moz-box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23); + box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23); +} + +.ui-shadow-4 { + -webkit-box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22); + -moz-box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22); + box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22); +} + +.ui-shadow-5 { + -webkit-box-shadow: 0 19px 38px rgba(0, 0, 0, 0.3), 0 15px 12px rgba(0, 0, 0, 0.22); + -moz-box-shadow: 0 19px 38px rgba(0, 0, 0, 0.3), 0 15px 12px rgba(0, 0, 0, 0.22); + box-shadow: 0 19px 38px rgba(0, 0, 0, 0.3), 0 15px 12px rgba(0, 0, 0, 0.22); +} + +.ui-g { + -ms-flex-wrap: wrap; +} +.ui-g.form-group > div { + padding: 12px 16px; +} + +.ui-panelgrid.form-group .ui-panelgrid-cell { + padding: 12px 16px; +} + +.ui-selectoneradio.form-group .ui-grid-row > div, .ui-selectmanycheckbox.form-group .ui-grid-row > div { + padding: 8px 16px; +} + +.dashboard .task-box { + -webkit-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); + -moz-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); + box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); +} +.dashboard .task-box .task-box-header { + padding: 8px 14px; +} +.dashboard .task-box .task-box-header:before, .dashboard .task-box .task-box-header:after { + content: ""; + display: table; +} +.dashboard .task-box .task-box-header:after { + clear: both; +} +.dashboard .task-box .task-box-header i { + float: right; + color: #ffffff; +} +.dashboard .task-box .task-box-content { + background-color: #ffffff; + padding: 8px 14px; +} +.dashboard .task-box .task-box-content h3 { + font-weight: bold; + font-size: 14px; + margin: 14px 0 7px 0; + padding: 0; +} +.dashboard .task-box .task-box-content p { + color: #757575; + margin: 0 0 28px 0; + padding: 0; +} +.dashboard .task-box .task-box-footer { + background-color: #ffffff; + padding: 8px 14px; +} +.dashboard .task-box .task-box-footer:before, .dashboard .task-box .task-box-footer:after { + content: ""; + display: table; +} +.dashboard .task-box .task-box-footer:after { + clear: both; +} +.dashboard .task-box .task-box-footer img { + width: 32px; + float: right; + margin-left: 4px; +} +.dashboard .task-box .task-box-footer .task-status { + -moz-border-radius: 9px; + -webkit-border-radius: 9px; + border-radius: 9px; + padding: 2px 8px; + color: #ffffff; +} +.dashboard .task-box.task-box-1 .task-box-header { + background-color: #e91e63; +} +.dashboard .task-box.task-box-1 .task-box-footer .task-status { + background-color: #e91e63; +} +.dashboard .task-box.task-box-2 .task-box-header { + background-color: #ffc107; +} +.dashboard .task-box.task-box-2 .task-box-footer .task-status { + background-color: #ffc107; +} +.dashboard .task-box.task-box-3 .task-box-header { + background-color: #00bcd4; +} +.dashboard .task-box.task-box-3 .task-box-footer .task-status { + background-color: #00bcd4; +} +.dashboard .overview-box { + text-align: center; + color: #ffffff; + -webkit-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); + -moz-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); + box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); +} +.dashboard .overview-box .overview-box-header { + height: 24px; +} +.dashboard .overview-box .overview-box-content { + padding: 8px 14px 14px 14px; +} +.dashboard .overview-box .overview-box-content .overview-box-icon { + -moz-border-radius: 50%; + -webkit-border-radius: 50%; + border-radius: 50%; + width: 40px; + height: 40px; + line-height: 40px; + margin: 0 auto; + margin-top: -28px; +} +.dashboard .overview-box .overview-box-content .overview-box-icon i { + line-height: inherit; + font-size: 28px; +} +.dashboard .overview-box .overview-box-content .overview-box-title { + font-size: 16px; +} +.dashboard .overview-box .overview-box-content .overview-box-count { + font-size: 24px; +} +.dashboard .overview-box.overview-box-1 .overview-box-header { + background-color: #f06292; +} +.dashboard .overview-box.overview-box-1 .overview-box-content { + background-color: #e91e63; +} +.dashboard .overview-box.overview-box-1 .overview-box-content .overview-box-icon { + background-color: #e91e63; +} +.dashboard .overview-box.overview-box-2 .overview-box-header { + background-color: #4dd0e1; +} +.dashboard .overview-box.overview-box-2 .overview-box-content { + background-color: #00bcd4; +} +.dashboard .overview-box.overview-box-2 .overview-box-content .overview-box-icon { + background-color: #00bcd4; +} +.dashboard .overview-box.overview-box-3 .overview-box-header { + background-color: #ffd54f; +} +.dashboard .overview-box.overview-box-3 .overview-box-content { + background-color: #ffc107; +} +.dashboard .overview-box.overview-box-3 .overview-box-content .overview-box-icon { + background-color: #ffc107; +} +.dashboard .overview-box.overview-box-4 .overview-box-header { + background-color: #9e9e9e; +} +.dashboard .overview-box.overview-box-4 .overview-box-content { + background-color: #616161; +} +.dashboard .overview-box.overview-box-4 .overview-box-content .overview-box-icon { + background-color: #616161; +} +.dashboard .task-list { + overflow: hidden; +} +.dashboard .task-list > .ui-panel { + min-height: 340px; + border: 0 none; + -webkit-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); + -moz-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); + box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); +} +.dashboard .task-list .ui-panel-content { + padding: 10px 0 !important; +} +.dashboard .task-list button { + margin-top: -25px; + margin-right: 10px; + float: right; +} +.dashboard .task-list ul { + list-style-type: none; + margin: 0; + padding: 0; +} +.dashboard .task-list ul li { + padding: 9.76px 14px; + border-bottom: 1px solid #dbdbdb; +} +.dashboard .task-list ul li:first-child { + margin-top: 10px; +} +.dashboard .task-list ul .ui-chkbox { + vertical-align: middle; + margin-right: 5px; +} +.dashboard .task-list ul .task-name { + vertical-align: middle; +} +.dashboard .task-list ul i { + color: #757575; + float: right; +} +.dashboard .contact-form { + overflow: hidden; +} +.dashboard .contact-form .ui-panel { + min-height: 340px; + border: 0 none; + -webkit-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); + -moz-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); + box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); +} +.dashboard .contact-form .ui-g-12 { + padding: 16px 10px; +} +.dashboard .contact-form .ui-button { + margin-top: 20px; +} +.dashboard .messages { + overflow: hidden; +} +.dashboard .messages > .ui-panel { + min-height: 340px; + border: 0 none; + -webkit-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); + -moz-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); + box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); +} +.dashboard .messages .ui-panel-content { + padding: 15px 0 10px 0 !important; +} +.dashboard .messages ul { + list-style-type: none; + padding: 0; + margin: 0; +} +.dashboard .messages ul li { + border-bottom: 1px solid #d8d8d8; +} +.dashboard .messages ul li a { + padding: 9px; + width: 100%; + box-sizing: border-box; + text-decoration: none; + position: relative; + display: block; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + border-radius: 2px; + -moz-transition: background-color 0.2s; + -o-transition: background-color 0.2s; + -webkit-transition: background-color 0.2s; + transition: background-color 0.2s; +} +.dashboard .messages ul li a:before, .dashboard .messages ul li a:after { + content: ""; + display: table; +} +.dashboard .messages ul li a:after { + clear: both; +} +.dashboard .messages ul li a img { + float: left; +} +.dashboard .messages ul li a > div { + float: left; + margin-left: 10px; +} +.dashboard .messages ul li a > div .name { + font-size: 14px; + font-weight: 700; + display: block; + color: #212121; +} +.dashboard .messages ul li a > div .message { + font-size: 14px; + color: #757575; +} +.dashboard .messages ul li a button { + position: absolute; + top: 15px; +} +.dashboard .messages ul li a button.message-btn { + right: 20px; +} +.dashboard .messages ul li a button.remove-btn { + right: 60px; +} +.dashboard .messages ul li a:hover { + cursor: pointer; + background-color: #e8e8e8; +} +.dashboard .messages ul li:last-child { + border: 0; +} +.dashboard .chat .ui-panel { + border: 0 none; + -webkit-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); + -moz-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); + box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); +} +.dashboard .chat .ui-panel-content { + padding: 0 !important; +} +.dashboard .chat .ui-tabs { + border-color: transparent; +} +.dashboard .chat ul { + padding: 12px; + margin: 0; + list-style-type: none; +} +.dashboard .chat ul li { + padding: 6px 0; +} +.dashboard .chat ul li:before, .dashboard .chat ul li:after { + content: ""; + display: table; +} +.dashboard .chat ul li:after { + clear: both; +} +.dashboard .chat ul li img { + width: 36px; + float: left; +} +.dashboard .chat ul li span { + padding: 6px 12px; + float: left; + display: inline-block; + margin: 4px 0; + -moz-border-radius: 10px; + -webkit-border-radius: 10px; + border-radius: 10px; +} +.dashboard .chat ul li.message-from img, .dashboard .chat ul li.message-from span { + float: left; +} +.dashboard .chat ul li.message-from img { + margin-right: 8px; +} +.dashboard .chat ul li.message-from span { + background-color: #e8eaf6; +} +.dashboard .chat ul li.message-own img, .dashboard .chat ul li.message-own span { + float: right; +} +.dashboard .chat ul li.message-own img { + margin-left: 8px; +} +.dashboard .chat ul li.message-own span { + background: #c8e6c9; + color: #000000; +} +.dashboard .chat .new-message { + height: 40px; + border-top: 1px solid #dce2e7; + color: #afafc0; +} +.dashboard .chat .new-message .message-attachment { + display: inline-block; + border-right: 1px solid #dce2e7; + width: 40px; + line-height: 40px; + height: 100%; + text-align: center; +} +.dashboard .chat .new-message .message-attachment i { + line-height: inherit; + font-size: 24px; +} +.dashboard .chat .new-message .message-input { + position: relative; + top: -6px; + width: calc(100% - 100px); + display: inline-block; +} +.dashboard .chat .new-message .message-input input { + border: 0 none; + font-size: 14px; + width: 100%; + background-color: transparent; + outline: 0 none; + color: #757575; +} +.dashboard .global-sales .header-helper { + float: right; + opacity: 0.7; + filter: alpha(opacity=70); +} +.dashboard .global-sales .ui-panel { + border: 0 none; + -webkit-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); + -moz-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); + box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); +} +.dashboard .global-sales .ui-panel-content { + padding: 14px 9px 0px 9px; +} +.dashboard .global-sales table { + width: 100%; + border-collapse: collapse; +} +.dashboard .global-sales table th { + font-weight: 700; + text-align: left; + padding: 8px 5px; +} +.dashboard .global-sales table tbody tr { + border-top: 1px solid #dbdbdb; +} +.dashboard .global-sales table tbody tr img { + width: 36px; + height: 36px; +} +.dashboard .global-sales table tbody tr td { + padding: 8px 5px; +} +.dashboard .global-sales table tbody tr td:nth-child(1) { + font-weight: 700; + text-align: center; +} +.dashboard .global-sales table tbody tr td:nth-child(3) { + font-weight: 700; +} +.dashboard .global-sales table tbody tr td:nth-child(7) { + text-align: right; +} +.dashboard .global-sales table tbody tr td:nth-child(7) button { + margin-left: 10px; +} +.dashboard .global-sales table tbody tr td .up-arrow { + color: #cddc39; +} +.dashboard .global-sales table tbody tr td .down-arrow { + color: #e91e63; +} +.dashboard .status-bars ul { + margin: 0; + padding: 0; + list-style-type: none; +} +.dashboard .status-bars ul li { + padding: 8px 14px; + position: relative; +} +.dashboard .status-bars ul li span { + position: absolute; + right: 36px; + top: 8px; +} +.dashboard .status-bars ul li i { + position: absolute; + right: 4px; + top: 4px; +} +.dashboard .status-bars .status-bar { + height: 18px; + width: 75%; + background-color: #d8d8d8; + -moz-border-radius: 6px; + -webkit-border-radius: 6px; + border-radius: 6px; +} +.dashboard .status-bars .status-bar .status-bar-value { + height: 100%; + color: #ffffff; + text-align: right; + padding-right: 4px; + padding-top: 1px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + -moz-border-radius: 6px; + -webkit-border-radius: 6px; + border-radius: 6px; +} +.dashboard .status-bars .status-bar.status-bar-1 .status-bar-value { + background-color: #e91e63; +} +.dashboard .status-bars .status-bar.status-bar-1 ~ i { + color: #e91e63; +} +.dashboard .status-bars .status-bar.status-bar-2 .status-bar-value { + background-color: #00bcd4; +} +.dashboard .status-bars .status-bar.status-bar-2 ~ i { + color: #00bcd4; +} +.dashboard .status-bars .status-bar.status-bar-3 .status-bar-value { + background-color: #ffc107; +} +.dashboard .status-bars .status-bar.status-bar-3 ~ i { + color: #ffc107; +} +.dashboard .status-bars .status-bar.status-bar-4 .status-bar-value { + background-color: #cddc39; +} +.dashboard .status-bars .status-bar.status-bar-4 ~ i { + color: #cddc39; +} +.dashboard .status-bars .status-bar.status-bar-5 .status-bar-value { + background-color: #ff9800; +} +.dashboard .status-bars .status-bar.status-bar-5 ~ i { + color: #ff9800; +} +.dashboard .image-box .card { + padding: 0; +} +.dashboard .image-box .card img { + width: 100%; +} +.dashboard .image-box .card .image-box-content { + padding: 16px; +} +.dashboard .image-box .card .image-box-content h3 { + font-weight: 700; + margin-top: 0; +} +.dashboard .image-box .card .image-box-content .image-box-tag { + width: 40px; + text-align: left; + color: #ffffff; + background-color: #e91e63; + padding: 0 8px; + -moz-border-radius: 6px; + -webkit-border-radius: 6px; + border-radius: 6px; +} +.dashboard .image-box .card .image-box-footer { + text-align: right; +} +.dashboard .user-card { + border: 1px solid #dbdbdb; + padding: 0; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; +} +.dashboard .user-card .user-card-header { + height: 100px; + overflow: hidden; +} +.dashboard .user-card .user-card-header img { + width: 100%; +} +.dashboard .user-card .user-card-content { + min-height: 340px; + background-color: #ffffff; + position: relative; +} +.dashboard .user-card .user-card-content img { + position: absolute; + top: -90px; + left: 24px; +} +.dashboard .user-card .user-card-content .ui-button { + position: absolute; + width: 36px; + height: 36px; + top: -18px; + right: 24px; +} +.dashboard .user-card .user-card-content .user-card-name { + font-size: 20px; + color: #212121; + position: absolute; + top: -60px; + margin-left: 110px; + font-weight: 700; + white-space: nowrap; +} +.dashboard .user-card .user-card-content .user-detail { + text-align: left; +} +.dashboard .user-card .user-card-content .user-detail ul { + padding: 0px 0 32px 0; + margin: 0; + list-style-type: none; +} +.dashboard .user-card .user-card-content .user-detail ul li { + padding: 16px 24px; + border-top: 1px solid #dbdbdb; +} +.dashboard .user-card .user-card-content .user-detail ul li:last-child { + border-bottom: 1px solid #dbdbdb; +} +.dashboard .user-card .user-card-content .user-detail ul li i { + font-size: 24px; + margin-right: 8px; + width: 32px; + vertical-align: middle; +} +.dashboard .user-card .user-card-content .user-detail ul li .project-title { + font-weight: 700; + margin-right: 8px; +} +.dashboard .user-card .user-card-content .user-detail ul li .project-detail { + color: #757575; +} +.dashboard .user-card .user-card-content .user-detail ul li .project-progressbar { + display: inline-block; + width: 100px; + background-color: #dbdbdb; + float: right; + margin-top: 12px; +} +.dashboard .user-card .user-card-content .user-detail ul li .project-progressbar .project-progressbar-value { + background-color: #29ABE1; + height: 4px; +} +.dashboard .map .ui-panel { + border: 0 none; + -webkit-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); + -moz-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); + box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); +} +.dashboard .map .ui-panel .ui-panel-content { + padding: 8px; +} +.dashboard .map .ui-panel .ui-panel-content img { + width: 100%; +} +.dashboard .schedule .ui-panel { + border: 0 none; + -webkit-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); + -moz-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); + box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); +} +.dashboard .schedule .ui-panel .fc-today-button { + display: none; +} + +@media (max-width: 640px) { + .dashboard .status-bars .status-bar { + width: 65%; + } + .dashboard .global-sales table tbody tr td:nth-child(7) { + text-align: left; + } + .dashboard .global-sales table tbody tr td:nth-child(7) button { + display: block; + margin-left: 0; + } + .dashboard .global-sales table tbody tr td:nth-child(7) button:first-child { + margin-bottom: 4px; + } +} +.login-body { + + height: 100%; + background-position: center; + background-repeat: no-repeat; + background-size: cover; +} +.login-body .login-panel { + width: 550px; + height: 480px; + background-color: #ffffff; + position: absolute; + left: 50%; + top: 50%; + margin-left: -275px; + margin-top: -240px; + padding: 0; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + border-radius: 2px; + -webkit-box-shadow: 0 3px 5px 0 rgba(0, 0, 0, 0.2), 0 1px 18px 0 rgba(0, 0, 0, 0.12), 0 6px 10px 0 rgba(0, 0, 0, 0.14); + -moz-box-shadow: 0 3px 5px 0 rgba(0, 0, 0, 0.2), 0 1px 18px 0 rgba(0, 0, 0, 0.12), 0 6px 10px 0 rgba(0, 0, 0, 0.14); + box-shadow: 0 3px 5px 0 rgba(0, 0, 0, 0.2), 0 1px 18px 0 rgba(0, 0, 0, 0.12), 0 6px 10px 0 rgba(0, 0, 0, 0.14); +} +.login-body .login-panel .login-panel-header { + background-color: #29ABE1; + text-align: center; + padding: 8px 14px; +} +.login-body .login-panel .login-panel-header img { + vertical-align: middle; + width: 135px; +} +.login-body .login-panel .login-panel-content { + padding: 50px 100px; +} +.login-body .login-panel .login-panel-content h1 { + font-size: 16px; + margin-top: 0; + margin-bottom: 16px; + text-align: center; +} +.login-body .login-panel .login-panel-content .ui-g-12, .login-body .login-panel .login-panel-content .ui-g-6 { + padding: 1em; +} +.login-body .login-panel .login-panel-content .ui-g-12:last-child, .login-body .login-panel .login-panel-content .ui-g-6:last-child { + text-align: center; +} +.login-body .login-panel .login-panel-content .ui-g-12:last-child a, .login-body .login-panel .login-panel-content .ui-g-6:last-child a { + color: #29ABE1; +} +.login-body .login-panel .login-panel-content .password-reset { + text-align: right; +} +.login-body .login-panel .login-panel-content .password-reset a { + color: #757575; +} +.login-body .login-panel .login-panel-content .ui-chkbox-label { + margin: 0 0 0 8px; + vertical-align: middle; +} + +@media (max-width: 640px) { + .login-body .login-panel { + left: 0; + margin-left: 0; + width: 100%; + } + .login-body .login-panel .login-panel-content { + padding: 50px 25px; + } +} +.exception-body { + height: 100%; + background-position: center; + background-repeat: no-repeat; + background-size: cover; +} +.exception-body.error { + background-image: url("#{resource['serenity-layout:images/exception/error-bg.jpg']}"); +} +.exception-body.error .exception-panel .exception-code { + background-color: #e91e63; +} +.exception-body.error .exception-panel .exception-code img { + margin-left: -194px; +} +.exception-body.error .exception-panel .exception-icon { + background-color: #e91e63; +} +.exception-body.notfound { + background-image: url("#{resource['serenity-layout:images/exception/notfound-bg.jpg']}"); +} +.exception-body.notfound .exception-panel .exception-code { + background-color: #e91e63; +} +.exception-body.notfound .exception-panel .exception-code img { + margin-left: -206px; +} +.exception-body.notfound .exception-panel .exception-icon { + background-color: #e91e63; +} +.exception-body.accessdenied { + background-image: url("#{resource['serenity-layout:images/exception/access-bg.jpg']}"); +} +.exception-body.accessdenied .exception-panel .exception-code { + background-color: #ffb300; +} +.exception-body.accessdenied .exception-panel .exception-code img { + margin-left: -178px; +} +.exception-body.accessdenied .exception-panel .exception-icon { + background-color: #ffb300; +} +.exception-body .exception-panel { + width: 550px; + height: 480px; + background-color: #ffffff; + position: absolute; + left: 50%; + top: 50%; + margin-left: -275px; + margin-top: -240px; + padding: 0; + text-align: center; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + border-radius: 2px; + -webkit-box-shadow: 0 3px 5px 0 rgba(0, 0, 0, 0.2), 0 1px 18px 0 rgba(0, 0, 0, 0.12), 0 6px 10px 0 rgba(0, 0, 0, 0.14); + -moz-box-shadow: 0 3px 5px 0 rgba(0, 0, 0, 0.2), 0 1px 18px 0 rgba(0, 0, 0, 0.12), 0 6px 10px 0 rgba(0, 0, 0, 0.14); + box-shadow: 0 3px 5px 0 rgba(0, 0, 0, 0.2), 0 1px 18px 0 rgba(0, 0, 0, 0.12), 0 6px 10px 0 rgba(0, 0, 0, 0.14); +} +.exception-body .exception-panel .exception-code { + height: 240px; + position: relative; +} +.exception-body .exception-panel .exception-code img { + position: absolute; + bottom: 0; + height: 190px; + left: 50%; +} +.exception-body .exception-panel .exception-detail { + height: 240px; + position: relative; + padding: 60px 0 0 0; +} +.exception-body .exception-panel .exception-detail .exception-icon { + width: 90px; + height: 90px; + line-height: 90px; + text-align: center; + display: inline-block; + z-index: 100; + position: absolute; + top: -45px; + left: 50%; + margin-left: -45px; + -moz-border-radius: 50%; + -webkit-border-radius: 50%; + border-radius: 50%; + -webkit-box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.12), 0 0 1px 0 rgba(0, 0, 0, 0.14); + -moz-box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.12), 0 0 1px 0 rgba(0, 0, 0, 0.14); + box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.12), 0 0 1px 0 rgba(0, 0, 0, 0.14); +} +.exception-body .exception-panel .exception-detail .exception-icon i { + font-size: 45px; + line-height: inherit; + color: #ffffff; +} +.exception-body .exception-panel .exception-detail h1 { + font-size: 15px; + font-weight: bold; + margin: 10px 0 8px 0; +} +.exception-body .exception-panel .exception-detail p { + color: #757575; + margin: 0 0 60px 0; +} + +@media (max-width: 640px) { + .exception-body .exception-panel { + left: 0; + margin-left: 0; + width: 100%; + } + .exception-body.error .exception-panel .exception-code img { + height: 150px; + margin-left: -150px; + } + .exception-body.notfound .exception-panel .exception-code img { + height: 150px; + margin-left: -163px; + } + .exception-body.accessdenied .exception-panel .exception-code img { + height: 150px; + margin-left: -141px; + } +} +.landing-body { + background-color: #F5F5F5; +} +.landing-body * { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +.landing-body p { + line-height: 1.5; +} +.landing-body #header { + background-color: #F5F5F5; +} +.landing-body #header > div { + width: 960px; + margin: 0 auto; + height: 90px; + padding: 15px 0; +} +.landing-body #header > div img { + height: 60px; +} +.landing-body #header > div #landing-menu { + float: right; + list-style-type: none; + padding: 0; + margin: 20px 0 0 0; +} +.landing-body #header > div #landing-menu > li { + display: inline-block; +} +.landing-body #header > div #landing-menu > li a { + border-bottom: 5px solid transparent; + color: #616161; + display: inline-block; + min-width: 80px; + text-align: center; + height: 55px; + font-size: 15px; + -moz-transition: border-color 0.3s; + -o-transition: border-color 0.3s; + -webkit-transition: border-color 0.3s; + transition: border-color 0.3s; +} +.landing-body #header > div #landing-menu > li:hover a { + color: #3f51b5; + border-color: #3f51b5; +} +.landing-body #header > div #landing-menu-button { + color: #3f51b5; + display: none; + float: right; + margin-right: 15px; + margin-top: 5px; +} +.landing-body #header > div #landing-menu-button i { + font-size: 48px; +} +.landing-body #introduction > div { + background: url("#{resource['serenity-layout:images/landing/landing-header.png']}") no-repeat; + min-height: 400px; + color: #ffffff; + text-align: center; + padding-top: 120px; + background-size: cover; +} +.landing-body #introduction > div h1 { + padding: 0; + margin: 0 0 20px 0; +} +.landing-body #introduction > div p { + max-width: 400px; + margin: 0 auto; + margin-bottom: 40px; +} +.landing-body #introduction > div button { + min-width: 180px; +} +.landing-body #features > div { + width: 960px; + margin: 0 auto; + padding: 60px 0; +} +.landing-body #features > div .feature-box { + padding: 30px 15px 30px 0; +} +.landing-body #features > div .feature-box:before, .landing-body #features > div .feature-box:after { + content: ""; + display: table; +} +.landing-body #features > div .feature-box:after { + clear: both; +} +.landing-body #features > div .feature-box img { + float: left; + margin-right: 30px; +} +.landing-body #features > div .feature-box > div { + padding: 16px 0; +} +.landing-body #features > div .feature-box > div h3 { + font-size: 15px; + margin: 0; +} +.landing-body #features > div .feature-box > div p { + color: #757575; + margin: 8px; +} +.landing-body #stats { + background-color: #212121; + background-image: -webkit-gradient(linear, left top, left bottom, from(#212121), to(#424242)); + background-image: -webkit-linear-gradient(top, #212121, #424242); + background-image: -moz-linear-gradient(top, #212121, #424242); + background-image: -ms-linear-gradient(top, #212121, #424242); + background-image: -o-linear-gradient(top, #212121, #424242); + background-image: linear-gradient(to bottom, #212121, #424242); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#212121", endColorstr="#424242"); +} +.landing-body #stats > div { + width: 960px; + margin: 0 auto; + padding: 40px 0; +} +.landing-body #stats > div .ui-g-12 { + padding: 20px; +} +.landing-body #stats > div .stat-box { + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + background-color: #ffffff; + -webkit-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); + -moz-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); + box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); + padding: 18px; + text-align: center; + color: #e91e63; +} +.landing-body #stats > div .stat-box h3 { + font-weight: 400; + margin: 0; +} +.landing-body #stats > div .stat-box p { + margin: 0; +} +.landing-body #stats > div .stat-box.stat-box-active { + background-color: #e91e63; + color: #ffffff; +} +.landing-body #video { + -webkit-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); + -moz-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); + box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); +} +.landing-body #video > div { + width: 960px; + margin: 0 auto; + padding: 60px 0; +} +.landing-body #video > div .video-description { + padding-top: 80px; + padding-right: 50px; +} +.landing-body #video > div .video-description h3 { + font-weight: 400; + font-size: 24px; + margin: 0 0 12px 0; +} +.landing-body #video > div .video-description p { + margin: 0 0 24px 0; +} +.landing-body #pricing > div { + width: 960px; + margin: 0 auto; + padding: 60px 0; + text-align: center; +} +.landing-body #pricing > div > h2 { + font-size: 24px; + font-weight: normal; + margin: 0 0 12px 0; +} +.landing-body #pricing > div > p { + color: #757575; + margin: 0 0 40px 0; +} +.landing-body #pricing > div .pricing-box { + width: 100%; + text-align: left; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; +} +.landing-body #pricing > div .pricing-box .pricing-header { + background-color: #212121; + padding: 16px; + text-align: center; +} +.landing-body #pricing > div .pricing-box .pricing-header h3 { + margin: 0; + color: #ffffff; + font-size: 15px; + font-weight: 400; + padding-bottom: 4px; + border-bottom: 1px solid #a7a5a5; +} +.landing-body #pricing > div .pricing-box .pricing-header p { + color: #a7a5a5; + margin: 0; + padding: 4px 0 0 0; +} +.landing-body #pricing > div .pricing-box .pricing-content { + padding: 16px; + min-height: 350px; + position: relative; + -webkit-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); + -moz-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); + box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); +} +.landing-body #pricing > div .pricing-box .pricing-content ul { + list-style-type: none; + margin: 0; + padding: 0; +} +.landing-body #pricing > div .pricing-box .pricing-content ul li { + padding: 8px 0; +} +.landing-body #pricing > div .pricing-box .pricing-content ul li i { + color: #4caf50; + vertical-align: middle; + margin-right: 6px; +} +.landing-body #pricing > div .pricing-box .pricing-content button { + position: absolute; + min-width: 180px; + bottom: 20px; + left: 50%; + margin-left: -90px; +} +.landing-body #pricing > div .pricing-box .pricing-content .pricing-fee { + position: absolute; + top: -24px; + right: 14px; + margin-left: -90px; + text-align: center; + font-size: 16px; + width: 48px; + height: 48px; + line-height: 48px; + background-color: #e91e63; + color: #ffffff; + -moz-border-radius: 50%; + -webkit-border-radius: 50%; + border-radius: 50%; + -webkit-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); + -moz-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); + box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); +} +.landing-body #pricing > div .pricing-box.pricing-box-pro .pricing-header { + background-color: #e91e63; + color: #ffffff; +} +.landing-body #pricing > div .pricing-box.pricing-box-pro .pricing-header h3 { + border-bottom: 1px solid #ffffff; +} +.landing-body #pricing > div .pricing-box.pricing-box-pro .pricing-header p { + color: #ffffff; +} +.landing-body #pricing > div .pricing-box.pricing-box-pro .pricing-content .pricing-fee { + background-color: #212121; + color: #ffffff; +} +.landing-body #contact { + background-color: #424242; +} +.landing-body #contact > div { + width: 960px; + margin: 0 auto; + padding: 60px 0; + text-align: center; +} +.landing-body #contact > div > h2 { + font-size: 24px; + font-weight: normal; + margin: 0 0 12px 0; + color: #f5f5f5; +} +.landing-body #contact > div > p { + margin: 0 0 40px 0; + color: #e0e0e0; +} +.landing-body #contact > div .contact-form { + text-align: left; +} +.landing-body #contact > div .contact-form > div { + padding: 1em 0.5em; +} +.landing-body #contact > div .contact-form button { + width: auto; + min-width: 180px; + margin-left: 15px; + margin-top: 40px; +} +.landing-body #contact > div .contact-form .md-inputfield input:focus ~ label, +.landing-body #contact > div .contact-form .md-inputfield input.ui-state-filled ~ label, +.landing-body #contact > div .contact-form .md-inputfield textarea:focus ~ label, +.landing-body #contact > div .contact-form .md-inputfield textarea.ui-state-filled ~ label, +.landing-body #contact > div .contact-form .md-inputfield .md-inputwrapper-focus ~ label, +.landing-body #contact > div .contact-form .md-inputfield .md-inputwrapper-filled ~ label { + color: #8AD4F2; +} +.landing-body #contact > div .contact-form .md-inputfield input:-webkit-autofill ~ label { + color: #8AD4F2; +} +.landing-body #contact > div .contact-form .md-inputfield input:focus { + border-color: #8AD4F2; +} +.landing-body #contact > div .contact-form .md-inputfield input { + color: #ffffff; +} +.landing-body #footer { + background-color: #212121; + color: #ffffff; +} +.landing-body #footer > div { + width: 960px; + margin: 0 auto; + padding: 30px 0; +} +.landing-body #footer > div .footer-logo { + height: 54px; + float: left; + margin-right: 14px; +} +.landing-body #footer > div h4 { + margin: 0 0 8px 0; + font-weight: 700; +} +.landing-body #footer > div p { + margin: 0; + line-height: 1.5; +} +.landing-body #footer > div p:last-child { + margin-top: 8px; +} +.landing-body #footer > div i { + vertical-align: middle; +} +.landing-body #footer > div .footer-social a { + margin-right: 14px; + opacity: 0.7; + filter: alpha(opacity=70); +} +.landing-body #footer > div .footer-social a img { + width: 30px; + height: 30px; +} +.landing-body #footer > div .footer-social a:hover { + opacity: 1; + filter: alpha(opacity=100); +} + +@media screen and (max-width: 64em) { + .landing-body { + padding-top: 90px; + } + .landing-body #header { + position: fixed; + top: 0; + z-index: 100; + width: 100%; + -webkit-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); + -moz-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); + box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); + } + .landing-body #header > div { + width: 100%; + padding-left: 15px; + } + .landing-body #header > div #landing-menu-button { + display: block; + } + .landing-body #header > div #landing-menu { + -webkit-animation-duration: 0.5s; + -moz-animation-duration: 0.5s; + animation-duration: 0.5s; + display: none; + float: none; + width: 100%; + text-align: center; + background-color: #F5F5F5; + position: fixed; + top: 70px; + left: 0; + -webkit-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); + -moz-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); + box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14); + } + .landing-body #header > div #landing-menu li { + display: block; + } + .landing-body #header > div #landing-menu li a { + height: auto; + border-bottom: 0 none; + padding: 15px; + } + .landing-body #header > div #landing-menu.landing-menu-active { + display: block; + } + .landing-body #introduction { + width: 100%; + } + .landing-body #introduction > div h1, .landing-body #introduction > div p { + padding-left: 15px; + padding-right: 15px; + } + .landing-body #features > div { + width: 100%; + padding-left: 15px; + } + .landing-body #stats > div { + width: 100%; + } + .landing-body #video > div { + width: 100%; + text-align: center; + padding-left: 15px; + padding-right: 15px; + } + .landing-body #video > div .video-description { + padding-top: 0; + padding-right: 0; + } + .landing-body #video > div iframe { + width: 300px; + height: 200px; + } + .landing-body #pricing > div { + width: 100%; + adding-left: 15px; + padding-right: 15px; + } + .landing-body #contact > div { + width: 100%; + text-align: center; + } + .landing-body #contact > div .contact-map { + text-align: center; + } + .landing-body #contact > div .contact-map img { + width: 100%; + } + .landing-body #contact > div .contact-form .ui-g-12 { + padding: 15px; + } + .landing-body #footer > div { + width: 100%; + } + .landing-body #footer > div .ui-g-12 { + padding-top: 24px; + } +} +html { + height: 100%; +} + +body { + font-family: "Roboto", "Helvetica Neue", sans-serif; + font-size: 14px; + color: #212121; + -webkit-font-smoothing: antialiased; + padding: 0; + margin: 0; + min-height: 100%; + background-color: #F5F5F5; +} +body .ajax-loader { + font-size: 32px; + color: #29ABE1; +} + +.layout-wrapper .layout-sidebar { + width: 240px; + height: 100%; + position: fixed; + left: -180px; + top: 0; + -webkit-transition-timing-function: cubic-bezier(0.86, 0, 0.07, 1); + transition-timing-function: cubic-bezier(0.86, 0, 0.07, 1); + z-index: 999999; + background-color: #ffffff; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + -moz-transition: left 0.3s; + -o-transition: left 0.3s; + -webkit-transition: left 0.3s; + transition: left 0.3s; + -webkit-box-shadow: 3px 0 6px rgba(0, 0, 0, 0.3); + -moz-box-shadow: 3px 0 6px rgba(0, 0, 0, 0.3); + box-shadow: 3px 0 6px rgba(0, 0, 0, 0.3); +} +.layout-wrapper .layout-sidebar .sidebar-logo { + height: 64px; + background-color: #29ABE1; + padding-top: 8px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +.layout-wrapper .layout-sidebar .sidebar-logo img { + height: 48px; + margin-left: 12px; + vertical-align: middle; +} +.layout-wrapper .layout-sidebar .sidebar-logo .sidebar-anchor { + display: none; + width: 18px; + height: 18px; + border: 2px solid #ffffff; + background-color: #29ABE1; + vertical-align: middle; + float: right; + margin-right: 8px; + margin-top: 12px; + -moz-border-radius: 50%; + -webkit-border-radius: 50%; + border-radius: 50%; + -moz-transition: background-color 0.3s; + -o-transition: background-color 0.3s; + -webkit-transition: background-color 0.3s; + transition: background-color 0.3s; +} +.layout-wrapper .layout-sidebar .sidebar-logo .app-name { + color: #ffffff; + vertical-align: middle; + font-size: 26px; +} +.layout-wrapper .layout-sidebar .layout-menu { + list-style-type: none; + margin: 10px 0 0 0; + padding: 0; +} +.layout-wrapper .layout-sidebar .layout-menu li { + padding: 4px 10px; + width: 100%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +.layout-wrapper .layout-sidebar .layout-menu li.active-menuitem > a { + color: #29ABE1; +} +.layout-wrapper .layout-sidebar .layout-menu li.active-menuitem > a i { + color: #29ABE1; +} +.layout-wrapper .layout-sidebar .layout-menu li.active-menuitem > a i.layout-submenu-toggler { + -webkit-transform: rotate(-180deg); + -moz-transform: rotate(-180deg); + -o-transform: rotate(-180deg); + -ms-transform: rotate(-180deg); + transform: rotate(-180deg); +} +.layout-wrapper .layout-sidebar .layout-menu li > a { + color: #212121; + display: block; + padding: 10px 10px 10px 10px; + position: relative; + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + -moz-transition: all 0.3s; + -o-transition: all 0.3s; + -webkit-transition: all 0.3s; + transition: all 0.3s; +} +.layout-wrapper .layout-sidebar .layout-menu li > a:hover { + background-color: #E0E0E0; + color: #212121; +} +.layout-wrapper .layout-sidebar .layout-menu li > a:hover i { + color: #212121; +} +.layout-wrapper .layout-sidebar .layout-menu li > a > .menuitem-text { + display: inline-block; + max-width: 145px; + word-break: break-all; +} +.layout-wrapper .layout-sidebar .layout-menu li > a i { + color: #616161; + float: right; + width: 20px; + height: 20px; + font-size: 20px; + position: absolute; + right: 10px; + top: 50%; + margin-top: -10px; +} +.layout-wrapper .layout-sidebar .layout-menu li > a i.layout-submenu-toggler { + -moz-transition: all 0.3s; + -o-transition: all 0.3s; + -webkit-transition: all 0.3s; + transition: all 0.3s; + right: 34px; + display: none; +} +.layout-wrapper .layout-sidebar .layout-menu li > a .menuitem-badge { + display: none; + position: absolute; + right: 54px; + top: 50%; + margin-top: -8px; +} +.layout-wrapper .layout-sidebar .layout-menu li ul { + display: none; + list-style-type: none; + margin: 0; + padding: 0; +} +.layout-wrapper .layout-sidebar .layout-menu li ul li { + padding: 4px 0; +} +.layout-wrapper .layout-sidebar .layout-menu li ul li a { + padding-left: 20px; +} +.layout-wrapper .layout-sidebar .layout-menu li ul li ul li a { + padding-left: 30px; +} +.layout-wrapper .layout-sidebar .layout-menu li ul li ul li ul li a { + padding-left: 40px; +} +.layout-wrapper .layout-sidebar .layout-menu li ul li ul li ul ul li a { + padding-left: 50px; +} +.layout-wrapper .layout-sidebar .layout-menu li ul li ul li ul ul ul li a { + padding-left: 60px; +} +.layout-wrapper .layout-sidebar .layout-menu li ul li ul li ul ul ul ul li a { + padding-left: 70px; +} +.layout-wrapper .layout-sidebar .layout-menu li ul li ul li ul ul ul ul ul li a { + padding-left: 80px; +} +.layout-wrapper .layout-sidebar .layout-menu > li > a { + -moz-border-radius: 6px; + -webkit-border-radius: 6px; + border-radius: 6px; +} +.layout-wrapper .layout-sidebar .layout-menu > li.active-menuitem > a { + color: #ffffff; + background-color: #29ABE1; + -moz-border-radius: 6px; + -webkit-border-radius: 6px; + border-radius: 6px; + -moz-border-radius-bottomleft: 0; + -webkit-border-bottom-left-radius: 0; + border-bottom-left-radius: 0; + -moz-border-radius-bottomright: 0; + -webkit-border-bottom-right-radius: 0; + border-bottom-right-radius: 0; + -webkit-box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.14), 0 7px 10px -5px rgba(60, 72, 88, 0.3), 0 7px 10px -5px rgba(60, 72, 88, 0.1); + -moz-box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.14), 0 7px 10px -5px rgba(60, 72, 88, 0.3), 0 7px 10px -5px rgba(60, 72, 88, 0.1); + box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.14), 0 7px 10px -5px rgba(60, 72, 88, 0.3), 0 7px 10px -5px rgba(60, 72, 88, 0.1); +} +.layout-wrapper .layout-sidebar .layout-menu > li.active-menuitem > a i { + color: #ffffff; +} +.layout-wrapper .layout-sidebar .layout-menu > li.active-menuitem > ul { + background-color: #EEEEEE; + -moz-border-radius-bottomleft: 6px; + -webkit-border-bottom-left-radius: 6px; + border-bottom-left-radius: 6px; + -moz-border-radius-bottomright: 6px; + -webkit-border-bottom-right-radius: 6px; + border-bottom-right-radius: 6px; +} +.layout-wrapper .layout-sidebar .layout-menu .menuitem-badge { + float: right; + display: inline-block; + width: 16px; + height: 16px; + margin-right: 6px; + text-align: center; + background-color: #29ABE1; + color: #ffffff; + font-size: 12px; + font-weight: 700; + line-height: 16px; + -moz-border-radius: 50%; + -webkit-border-radius: 50%; + border-radius: 50%; +} +.layout-wrapper .layout-sidebar.layout-sidebar-active { + left: 0; +} +.layout-wrapper .layout-sidebar.layout-sidebar-active .sidebar-logo img { + display: inline; +} +.layout-wrapper .layout-sidebar.layout-sidebar-active .sidebar-logo .sidebar-anchor { + display: inline-block; +} +.layout-wrapper .layout-sidebar.layout-sidebar-active .layout-menu li a i.layout-submenu-toggler { + display: inline-block; +} +.layout-wrapper .layout-sidebar.layout-sidebar-active .layout-menu li a .menuitem-badge { + display: inline-block; +} +.layout-wrapper .layout-sidebar .nano .sidebar-scroll-content { + display: block; + height: 100%; + position: relative; +} +.layout-wrapper .layout-sidebar .nano .sidebar-scroll-content .layout-menu { + padding-bottom: 120px; +} +.layout-wrapper .layout-sidebar .nano .nano-pane .nano-slider { + background-color: #aaaaaa; + opacity: 0.3; + filter: alpha(opacity=30); +} +.layout-wrapper .layout-sidebar.layout-sidebar-dark { + background-color: #29ABE1; +} +.layout-wrapper .layout-sidebar.layout-sidebar-dark .layout-menu li > a { + color: #dee0e3; +} +.layout-wrapper .layout-sidebar.layout-sidebar-dark .layout-menu li > a:hover { + background-color: #2341BB; + color: #ffffff; +} +.layout-wrapper .layout-sidebar.layout-sidebar-dark .layout-menu li > a:hover i { + color: #ffffff; +} +.layout-wrapper .layout-sidebar.layout-sidebar-dark .layout-menu li > a i { + color: #dee0e3; +} +.layout-wrapper .layout-sidebar.layout-sidebar-dark .layout-menu li.active-menuitem > a { + color: #8AD4F2; +} +.layout-wrapper .layout-sidebar.layout-sidebar-dark .layout-menu li.active-menuitem > a i { + color: #8AD4F2; +} +.layout-wrapper .layout-sidebar.layout-sidebar-dark .layout-menu > li.active-menuitem > a { + background-color: #2341BB; + color: #ffffff; +} +.layout-wrapper .layout-sidebar.layout-sidebar-dark .layout-menu > li.active-menuitem > a i { + color: #ffffff; +} +.layout-wrapper .layout-sidebar.layout-sidebar-dark .layout-menu > li.active-menuitem > ul { + background-color: #2341BB; +} +.layout-wrapper .layout-main { + margin-left: 60px; + -moz-transition: margin-left 0.3s; + -o-transition: margin-left 0.3s; + -webkit-transition: margin-left 0.3s; + transition: margin-left 0.3s; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +.layout-wrapper .layout-main .layout-topbar { + height: 64px; + background-color: #29ABE1; + padding: 16px 42px 16px 24px; + position: fixed; + width: calc(100% - 40px); + -moz-transition: width 0.3s; + -o-transition: width 0.3s; + -webkit-transition: width 0.3s; + transition: width 0.3s; + -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 4px 5px 0 rgba(0, 0, 0, 0.14); + -moz-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 4px 5px 0 rgba(0, 0, 0, 0.14); + box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 4px 5px 0 rgba(0, 0, 0, 0.14); + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + z-index: 999997; +} +.layout-wrapper .layout-main .layout-topbar .topbar-logo { + display: none; +} +.layout-wrapper .layout-main .layout-topbar .menu-btn { + display: none; + color: #ffffff; + float: left; +} +.layout-wrapper .layout-main .layout-topbar .menu-btn i { + font-size: 32px; +} +.layout-wrapper .layout-main .layout-topbar .topbar-menu-btn { + display: none; + color: #ffffff; + float: right; +} +.layout-wrapper .layout-main .layout-topbar .topbar-menu-btn i { + font-size: 32px; +} +.layout-wrapper .layout-main .layout-topbar .mobile-logo { + display: none; + height: 48px; + margin-top: -8px; +} +.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .sidebar-logo { + display: none; +} +.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu { + list-style-type: none; + margin: 0; + padding: 0; + vertical-align: middle; + margin: 0; + -webkit-animation-duration: 0s; + -moz-animation-duration: 0s; + animation-duration: 0s; +} +.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu:before, .layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu:after { + content: ""; + display: table; +} +.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu:after { + clear: both; +} +.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu .topbar-badge { + width: 16px; + height: 16px; + text-align: center; + background-color: #29ABE1; + color: #ffffff; + font-size: 12px; + font-weight: 700; + line-height: 16px; + -moz-border-radius: 50%; + -webkit-border-radius: 50%; + border-radius: 50%; +} +.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li { + float: right; + position: relative; + margin-left: 20px; +} +.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li > a { + color: #ffffff; + position: relative; +} +.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li > a .topbar-item-name { + display: none; +} +.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li > a i { + font-size: 32px; + color: #ffffff; + -moz-transition: color 0.3s; + -o-transition: color 0.3s; + -webkit-transition: color 0.3s; + transition: color 0.3s; +} +.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li > a i:hover { + color: #e6e6e6; +} +.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li > a .topbar-badge { + position: absolute; + right: -4px; + top: -24px; +} +.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li.profile-item { + float: left; + margin-left: 0; + padding-top: 4px; +} +.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li.profile-item > a { + display: inline-block; + position: relative; + top: -10px; + color: #ffffff; +} +.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li.profile-item > a .profile-image-wrapper { + display: inline-block; + vertical-align: middle; + border: 2px solid transparent; + width: 40px; + height: 40px; + -moz-border-radius: 50%; + -webkit-border-radius: 50%; + border-radius: 50%; + -moz-transition: border-color 0.3s; + -o-transition: border-color 0.3s; + -webkit-transition: border-color 0.3s; + transition: border-color 0.3s; +} +.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li.profile-item > a .profile-image-wrapper img { + width: 40px; + height: 40px; +} +.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li.profile-item > a .profile-name { + display: inline-block; + margin-left: 6px; + vertical-align: middle; + margin-top: -4px; +} +.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li.profile-item > a:hover .profile-image-wrapper { + border-color: #29ABE1; +} +.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li.profile-item > ul { + right: auto; + left: 5px; +} +.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li.profile-item > ul:before { + left: 8px; +} +.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li.search-item { + position: relative; + display: inline-block; + vertical-align: middle; + height: 40px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li.search-item input { + border: 0 none; + width: 150px; + padding: 6px 24px 6px 6px; + border-bottom: 1px solid #ffffff; + -moz-transition: all 0.3s; + -o-transition: all 0.3s; + -webkit-transition: all 0.3s; + transition: all 0.3s; + outline: 0 none; + color: #ffffff; +} +.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li.search-item input:focus { + border-bottom-color: #ffffff; +} +.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li.search-item input:focus label { + color: #ffffff; +} +.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li.search-item i { + position: absolute; + right: 0; + top: 0; + color: #ffffff; + font-size: 28px; +} +.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li.search-item label { + color: #ffffff; + margin-top: 6px; +} +.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li.search-item input:focus ~ i { + color: #ffffff; +} +.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li > ul { + position: absolute; + top: 60px; + right: 5px; + display: none; + width: 250px; + background-color: #ffffff; + -webkit-animation-duration: 0.5s; + -moz-animation-duration: 0.5s; + animation-duration: 0.5s; + list-style-type: none; + margin: 0; + padding: 8px 0; + border-top: 4px solid #29ABE1; + -webkit-box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23); + -moz-box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23); + box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23); +} +.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li > ul a { + padding: 10px 10px 10px 10px; + display: block; + width: 100%; + box-sizing: border-box; + color: #212121; +} +.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li > ul a i { + color: #757575; + margin-right: 8px; +} +.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li > ul a img { + margin-right: 8px; +} +.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li > ul a i, .layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li > ul a img, .layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li > ul a span { + vertical-align: middle; + display: inline-block; +} +.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li > ul a .topbar-submenuitem-badge { + background-color: #29ABE1; + padding: 2px 4px; + display: block; + font-size: 12px; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + color: #ffffff; + float: right; +} +.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li > ul a:hover { + background-color: #f1f2f7; + -moz-transition: background-color 0.3s; + -o-transition: background-color 0.3s; + -webkit-transition: background-color 0.3s; + transition: background-color 0.3s; +} +.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li > ul a:hover i { + color: #212121; +} +.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li > ul:before { + width: 0; + height: 0; + border-left: 8px solid transparent; + border-right: 8px solid transparent; + border-bottom: 15px solid #29ABE1; + content: " "; + position: absolute; + top: -15px; + left: 232px; +} +.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li.active-topmenuitem > ul { + display: block; +} +.layout-wrapper .layout-main .layout-breadcrumb { + background-color: #ffffff; + -webkit-box-shadow: inset 0 -2px 4px 0 rgba(0, 0, 0, 0.14); + -moz-box-shadow: inset 0 -2px 4px 0 rgba(0, 0, 0, 0.14); + box-shadow: inset 0 -2px 4px 0 rgba(0, 0, 0, 0.14); + min-height: 42px; + padding-top: 64px; +} +.layout-wrapper .layout-main .layout-breadcrumb:before, .layout-wrapper .layout-main .layout-breadcrumb:after { + content: ""; + display: table; +} +.layout-wrapper .layout-main .layout-breadcrumb:after { + clear: both; +} +.layout-wrapper .layout-main .layout-breadcrumb ul { + margin: 8px 0 0 0; + padding: 0 0 0 20px; + list-style: none; + color: #757575; + display: inline-block; +} +.layout-wrapper .layout-main .layout-breadcrumb ul li { + display: inline-block; + vertical-align: middle; + color: #757575; +} +.layout-wrapper .layout-main .layout-breadcrumb ul li:nth-child(even) { + font-size: 20px; +} +.layout-wrapper .layout-main .layout-breadcrumb ul li:first-child(even) { + color: #29ABE1; +} +.layout-wrapper .layout-main .layout-breadcrumb ul li a { + color: #757575; +} +.layout-wrapper .layout-main .layout-breadcrumb .layout-breadcrumb-options { + float: right; + padding: 0px 20px 0 0; + height: 100%; +} +.layout-wrapper .layout-main .layout-breadcrumb .layout-breadcrumb-options a { + color: #757575; + display: inline-block; + width: 42px; + height: 42px; + line-height: 42px; + text-align: center; + -moz-transition: background-color 0.3s; + -o-transition: background-color 0.3s; + -webkit-transition: background-color 0.3s; + transition: background-color 0.3s; +} +.layout-wrapper .layout-main .layout-breadcrumb .layout-breadcrumb-options a:hover { + background-color: #e8e8e8; +} +.layout-wrapper .layout-main .layout-breadcrumb .layout-breadcrumb-options a i { + line-height: inherit; +} +.layout-wrapper .layout-main .layout-content { + padding: 17px 17px 24px 17px; +} +.layout-wrapper .layout-main .layout-main-mask { + display: none; +} +.layout-wrapper .layout-main .layout-footer { + padding: 16px 24px; + border: 0 none; + border: 1px solid #dbdbdb; + background: #ffffff; +} +.layout-wrapper .layout-main .layout-footer img { + margin-top: 5px; + width: 100px; +} +.layout-wrapper .layout-main .layout-footer .footer-text-right { + float: right; + margin-top: 10px; +} +.layout-wrapper .layout-main .layout-footer .footer-text-right span { + vertical-align: middle; +} + +.layout-wrapper-static .layout-sidebar { + left: 0; +} +.layout-wrapper-static .layout-sidebar .sidebar-logo .sidebar-anchor { + display: inline-block; + background-color: #ffffff; +} +.layout-wrapper-static .layout-sidebar .layout-menu li a i.layout-submenu-toggler { + display: inline-block; +} +.layout-wrapper-static .layout-sidebar .layout-menu li a .menuitem-badge { + display: inline-block; +} +.layout-wrapper-static .layout-main { + margin-left: 240px; +} +.layout-wrapper-static .layout-main .layout-topbar { + width: calc(100% - 240px); +} + +.layout-wrapper-static-restore .layout-sidebar { + -moz-transition: none; + -o-transition: none; + -webkit-transition: none; + transition: none; +} + +@media (max-width: 1024px) { + .layout-wrapper .layout-sidebar { + left: -240px; + } + .layout-wrapper .layout-sidebar .sidebar-logo .sidebar-anchor { + display: none !important; + } + .layout-wrapper .layout-main { + margin-left: 0; + left: 0; + -moz-transition: left 0.3s; + -o-transition: left 0.3s; + -webkit-transition: left 0.3s; + transition: left 0.3s; + -webkit-transition-timing-function: cubic-bezier(0.86, 0, 0.07, 1); + transition-timing-function: cubic-bezier(0.86, 0, 0.07, 1); + } + .layout-wrapper .layout-main .layout-topbar { + width: 100%; + text-align: center; + padding: 16px 24px; + } + .layout-wrapper .layout-main .layout-topbar:before, .layout-wrapper .layout-main .layout-topbar:after { + content: ""; + display: table; + } + .layout-wrapper .layout-main .layout-topbar:after { + clear: both; + } + .layout-wrapper .layout-main .layout-topbar .menu-btn { + display: inline-block; + } + .layout-wrapper .layout-main .layout-topbar .topbar-menu-btn { + display: inline-block; + } + .layout-wrapper .layout-main .layout-topbar .mobile-logo { + display: inline; + } + .layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu { + display: none; + -webkit-animation-duration: 0.5s; + -moz-animation-duration: 0.5s; + animation-duration: 0.5s; + text-align: left; + -webkit-box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.3); + -moz-box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.3); + box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.3); + } + .layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu:before { + width: 0; + height: 0; + border-left: 8px solid transparent; + border-right: 8px solid transparent; + border-bottom: 15px solid #29ABE1; + content: " "; + position: absolute; + top: -15px; + left: 232px; + } + .layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu.topbar-menu-active { + position: fixed; + top: 75px; + right: 30px; + width: 250px; + display: block; + padding: 8px 0; + background-color: #ffffff; + border-top: 4px solid #29ABE1; + } + .layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu.topbar-menu-active > li { + float: none; + display: block; + margin: 0; + } + .layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu.topbar-menu-active > li > a { + padding: 8px 14px; + display: block; + color: #212121; + } + .layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu.topbar-menu-active > li > a:hover { + background-color: #e8e8e8; + } + .layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu.topbar-menu-active > li > a:hover i { + color: #212121; + } + .layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu.topbar-menu-active > li > a i { + color: #757575; + display: inline-block; + vertical-align: middle; + margin-right: 8px; + } + .layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu.topbar-menu-active > li > a .topbar-item-name { + display: inline-block; + vertical-align: middle; + } + .layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu.topbar-menu-active > li > a .topbar-badge { + position: static; + float: right; + margin-top: 4px; + } + .layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu.topbar-menu-active > li > ul { + position: static; + box-shadow: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; + padding: 0; + width: 100%; + border-top: 0 none; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + } + .layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu.topbar-menu-active > li > ul:before { + display: none; + } + .layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu.topbar-menu-active > li > ul a { + padding-left: 28px; + } + .layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu.topbar-menu-active > li.profile-item img { + width: 24px; + height: 24px; + } + .layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu li a { + font-size: 14px; + } + .layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu li a i { + font-size: 24px; + } + .layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu li.search-item { + padding: 8px 14px; + } + .layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu li.search-item input { + padding: 2px 2px 1px 2px; + border-color: #757575; + border-width: 0 0 1px 0; + border-style: solid; + color: #212121; + margin-left: 28px; + width: 85%; + } + .layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu li.search-item input:focus { + border-bottom-color: #29ABE1; + border-width: 0 0 2px 0; + width: 85%; + } + .layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu li.search-item input:focus ~ i { + color: #29ABE1; + } + .layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu li.search-item input:focus ~ label { + color: #29ABE1; + top: -15px; + } + .layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu li.search-item i { + color: #757575; + right: auto; + left: 0px; + } + .layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu li.search-item label { + color: #757575; + left: 32px; + margin-top: 0; + } + .layout-wrapper.layout-wrapper-active { + overflow: hidden; + } + .layout-wrapper.layout-wrapper-active .layout-sidebar { + left: 0; + box-shadow: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; + } + .layout-wrapper.layout-wrapper-active .layout-sidebar .layout-menu li a i.layout-submenu-toggler { + display: inline-block; + } + .layout-wrapper.layout-wrapper-active .layout-sidebar .layout-menu li a .menuitem-badge { + display: inline-block; + } + .layout-wrapper.layout-wrapper-active .layout-main { + position: fixed; + left: 240px; + width: calc(100%); + -webkit-box-shadow: inset 3px 0px 6px 1px rgba(0, 0, 0, 0.3); + -moz-box-shadow: inset 3px 0px 6px 1px rgba(0, 0, 0, 0.3); + box-shadow: inset 3px 0px 6px 1px rgba(0, 0, 0, 0.3); + } + .layout-wrapper.layout-wrapper-active .layout-main .layout-topbar { + -webkit-box-shadow: inset 3px 0px 6px 1px rgba(0, 0, 0, 0.3); + -moz-box-shadow: inset 3px 0px 6px 1px rgba(0, 0, 0, 0.3); + box-shadow: inset 3px 0px 6px 1px rgba(0, 0, 0, 0.3); + } + .layout-wrapper.layout-wrapper-active .layout-main .layout-breadcrumb { + -webkit-box-shadow: inset 3px 0px 6px 1px rgba(0, 0, 0, 0.3); + -moz-box-shadow: inset 3px 0px 6px 1px rgba(0, 0, 0, 0.3); + box-shadow: inset 3px 0px 6px 1px rgba(0, 0, 0, 0.3); + } + .layout-wrapper.layout-wrapper-active .layout-main .layout-breadcrumb .layout-breadcrumb-options { + display: none; + } + .layout-wrapper.layout-wrapper-active .layout-main-mask { + z-index: 999998; + position: absolute; + left: 0; + top: 0; + background-color: #424242; + display: block; + opacity: 0.5; + filter: alpha(opacity=50); + width: 100%; + height: 100%; + overflow: hidden; + } + + body.hidden-overflow { + overflow: hidden; + } +} +.layout-rtl.layout-wrapper .layout-sidebar { + left: auto; + right: -180px; + -moz-transition: right 0.3s; + -o-transition: right 0.3s; + -webkit-transition: right 0.3s; + transition: right 0.3s; + direction: rtl; +} +.layout-rtl.layout-wrapper .layout-sidebar .sidebar-logo { + direction: rtl; +} +.layout-rtl.layout-wrapper .layout-sidebar .sidebar-logo img { + margin-left: 0px; + margin-right: 12px; +} +.layout-rtl.layout-wrapper .layout-sidebar .sidebar-logo .sidebar-anchor { + float: left; + margin-right: 0px; + margin-left: 8px; +} +.layout-rtl.layout-wrapper .layout-sidebar .layout-menu { + direction: rtl; +} +.layout-rtl.layout-wrapper .layout-sidebar .layout-menu li > a i { + float: left; + right: auto; + left: 10px; +} +.layout-rtl.layout-wrapper .layout-sidebar .layout-menu li > a i.layout-submenu-toggler { + right: auto; + left: 34px; +} +.layout-rtl.layout-wrapper .layout-sidebar .layout-menu li > a .menuitem-badge { + right: auto; + left: 54px; +} +.layout-rtl.layout-wrapper .layout-sidebar .layout-menu li ul li a { + padding-right: 20px; + padding-left: 0px; +} +.layout-rtl.layout-wrapper .layout-sidebar .layout-menu li ul li ul li a { + padding-right: 30px; + padding-left: 0px; +} +.layout-rtl.layout-wrapper .layout-sidebar .layout-menu li ul li ul li ul li a { + padding-right: 40px; + padding-left: 0px; +} +.layout-rtl.layout-wrapper .layout-sidebar .layout-menu li ul li ul li ul ul li a { + padding-right: 50px; + padding-left: 0px; +} +.layout-rtl.layout-wrapper .layout-sidebar .layout-menu li ul li ul li ul ul ul li a { + padding-right: 60px; + padding-left: 0px; +} +.layout-rtl.layout-wrapper .layout-sidebar .layout-menu li ul li ul li ul ul ul ul li a { + padding-right: 70px; + padding-left: 0px; +} +.layout-rtl.layout-wrapper .layout-sidebar .layout-menu li ul li ul li ul ul ul ul ul li a { + padding-right: 80px; + padding-left: 0px; +} +.layout-rtl.layout-wrapper .layout-sidebar .layout-menu .menuitem-badge { + float: left; + margin-right: 0px; + margin-left: 6px; +} +.layout-rtl.layout-wrapper .layout-sidebar.layout-sidebar-active { + left: auto; + right: 0px; +} +.layout-rtl.layout-wrapper .layout-sidebar .nano .nano-pane { + right: auto; + left: 0; +} +.layout-rtl.layout-wrapper .layout-main { + margin-left: 0px; + margin-right: 60px; + -moz-transition: margin-right 0.3s; + -o-transition: margin-right 0.3s; + -webkit-transition: margin-right 0.3s; + transition: margin-right 0.3s; +} +.layout-rtl.layout-wrapper .layout-main .layout-topbar .menu-btn { + float: right; +} +.layout-rtl.layout-wrapper .layout-main .layout-topbar .topbar-menu-btn { + float: left; +} +.layout-rtl.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li { + float: left; + margin-left: 0px; + margin-right: 20px; +} +.layout-rtl.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li > a .topbar-badge { + left: -4px; + right: auto; +} +.layout-rtl.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li.profile-item { + float: right; + margin-left: 0px; + margin-right: 0px; +} +.layout-rtl.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li.profile-item > a .profile-name { + margin-left: 0px; + margin-right: 6px; + margin-top: 13px; + float: left; +} +.layout-rtl.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li.profile-item > ul { + left: auto; + right: 5px; + direction: rtl; + text-align: right; +} +.layout-rtl.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li.profile-item > ul:before { + left: auto; + right: 8px; +} +.layout-rtl.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li.search-item { + direction: rtl; +} +.layout-rtl.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li.search-item input { + padding: 6px 6px 6px 24px; +} +.layout-rtl.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li.search-item i { + right: auto; + left: 0; +} +.layout-rtl.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li.search-item label { + right: 5px; + left: auto; +} +.layout-rtl.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li > ul { + left: 5px; + right: auto; + direction: rtl; + text-align: right; +} +.layout-rtl.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li > ul a i, .layout-rtl.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li > ul a img { + margin-right: 0px; + margin-left: 8px; +} +.layout-rtl.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li > ul a .topbar-submenuitem-badge { + float: left; +} +.layout-rtl.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li > ul:before { + left: auto; + right: 232px; +} +.layout-rtl.layout-wrapper .layout-main .layout-breadcrumb { + direction: rtl; +} +.layout-rtl.layout-wrapper .layout-main .layout-breadcrumb ul { + padding: 0 20px 0 0; +} +.layout-rtl.layout-wrapper .layout-main .layout-breadcrumb .layout-breadcrumb-options { + float: left; + padding: 0px 0px 0 20px; +} +.layout-rtl.layout-wrapper .layout-main .layout-footer { + direction: rtl; +} +.layout-rtl.layout-wrapper .layout-main .layout-footer .footer-text-right { + float: left; + margin-top: 10px; +} +.layout-rtl.layout-wrapper-static .layout-sidebar { + left: auto; + right: 0; +} +.layout-rtl.layout-wrapper-static .layout-main { + margin-left: 0px; + margin-right: 240px; +} +.layout-rtl.layout-wrapper-static-restore .layout-sidebar { + -moz-transition: none; + -o-transition: none; + -webkit-transition: none; + transition: none; +} +@media (max-width: 1024px) { + .layout-rtl.layout-wrapper .layout-sidebar { + left: auto; + right: -240px; + } + .layout-rtl.layout-wrapper .layout-main { + margin-right: 0px; + margin-left: 0px; + left: auto; + right: 0; + -moz-transition: right 0.3s; + -o-transition: right 0.3s; + -webkit-transition: right 0.3s; + transition: right 0.3s; + } + .layout-rtl.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu { + direction: rtl; + text-align: right; + } + .layout-rtl.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu:before { + right: 232px; + left: auto; + } + .layout-rtl.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu.topbar-menu-active { + left: 30px; + right: auto; + } + .layout-rtl.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu.topbar-menu-active > li { + float: none; + margin: 0px; + } + .layout-rtl.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu.topbar-menu-active > li > a i { + margin-right: 0px; + margin-left: 8px; + } + .layout-rtl.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu.topbar-menu-active > li > a .topbar-badge { + float: left; + } + .layout-rtl.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu.topbar-menu-active > li > ul a { + padding-left: 0px; + padding-right: 28px; + } + .layout-rtl.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li.profile-item > a .profile-name { + float: none; + } + .layout-rtl.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu li.search-item input { + margin-left: 0px; + margin-right: 28px; + padding: 2px 2px 1px 2px; + } + .layout-rtl.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu li.search-item i { + left: auto; + right: 0px; + } + .layout-rtl.layout-wrapper .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu li.search-item label { + right: 32px; + left: auto; + } + .layout-rtl.layout-wrapper.layout-wrapper-active .layout-sidebar { + right: 0; + left: auto; + } + .layout-rtl.layout-wrapper.layout-wrapper-active .layout-main { + left: auto; + right: 240px; + } + .layout-rtl.layout-wrapper.layout-wrapper-active .layout-main-mask { + left: auto; + right: 0; + } +} + +@media (min-width: 1025px) { + .layout-wrapper.layout-menu-horizontal .layout-sidebar { + width: 100%; + height: auto; + top: 64px; + left: 0; + z-index: 99; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar .sidebar-logo { + display: none; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar > .nano { + overflow: visible; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar > .nano > .nano-content { + margin-right: 0 !important; + display: inherit; + height: auto; + position: static; + overflow: visible; + overflow-x: visible; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar > .nano > .nano-content.sidebar-scroll-content .layout-menu { + padding-bottom: 0; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar > .nano > .nano-pane { + display: none !important; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar .layout-menu { + margin: 0; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar .layout-menu > li { + width: auto; + padding: 0; + position: relative; + float: left; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar .layout-menu > li > a { + height: 44px; + padding-top: 12px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar .layout-menu > li > a:hover { + background-color: #E0E0E0; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar .layout-menu > li > a .menuitem-text { + vertical-align: middle; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar .layout-menu > li > a i { + float: none; + position: static; + vertical-align: middle; + margin-top: 0; + top: auto; + right: auto; + margin-right: 5px; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar .layout-menu > li > a i.layout-submenu-toggler { + display: inline-block; + margin-top: 2px; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar .layout-menu > li.active-menuitem > a { + color: #ffffff; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar .layout-menu > li.active-menuitem > a i { + color: #ffffff; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar .layout-menu > li.active-menuitem > a:hover { + color: #212121; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar .layout-menu > li.active-menuitem > a:hover i { + color: #212121; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar .layout-menu > li > ul { + top: 44px; + left: 0; + width: 230px; + position: absolute; + padding: 0; + margin: 0; + z-index: 100; + overflow: auto; + max-height: 450px; + -webkit-box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23); + -moz-box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23); + box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23); + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar .layout-menu > li > ul li a { + padding-left: 40px; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar .layout-menu > li > ul li a:hover { + background-color: #E0E0E0; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar .layout-menu > li > ul li a i { + float: none; + left: 10px; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar .layout-menu > li > ul li a i:last-child { + right: 10px; + left: auto; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar .layout-menu > li > ul li a .layout-submenu-toggler { + display: block; + left: auto; + right: 10px; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar .layout-menu > li > ul li ul li a { + padding-left: 50px; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar .layout-menu > li > ul li ul li a:hover { + background-color: #E0E0E0; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar .layout-menu > li > ul li ul li a i:first-child { + left: 20px; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar .layout-menu > li > ul li ul ul li a { + padding-left: 60px; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar .layout-menu > li > ul li ul ul li a:hover { + background-color: #E0E0E0; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar .layout-menu > li > ul li ul ul li a i:first-child { + left: 30px; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar .layout-menu > li.active-menuitem > ul { + background-color: #EEEEEE; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar .layout-menu li a:hover { + background-color: #E0E0E0; + color: #212121; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar .layout-menu li a:hover i { + color: #212121; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar .layout-menu li a .menuitem-badge { + left: 18px; + top: 15px; + display: block; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar.layout-sidebar-dark { + background-color: #616161; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar.layout-sidebar-dark .layout-menu > li > a:hover { + background-color: #545454; + color: #ffffff; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar.layout-sidebar-dark .layout-menu > li > a:hover i { + color: #ffffff; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar.layout-sidebar-dark .layout-menu > li > ul li a:hover { + background-color: #545454; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar.layout-sidebar-dark .layout-menu li a:hover { + color: #ffffff; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar.layout-sidebar-dark .layout-menu li a:hover i { + color: #ffffff; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar.layout-sidebar-dark .layout-menu li.active-menuitem > a { + color: #96d099; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar.layout-sidebar-dark .layout-menu li.active-menuitem > a i { + color: #96d099; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar.layout-sidebar-dark .layout-menu li.active-menuitem > a:hover { + color: #ffffff; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar.layout-sidebar-dark .layout-menu li.active-menuitem > a:hover i { + color: #ffffff; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar.layout-sidebar-dark .layout-menu > li.active-menuitem > a { + color: #ffffff; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar.layout-sidebar-dark .layout-menu > li.active-menuitem > a i { + color: #ffffff; + } + .layout-wrapper.layout-menu-horizontal .layout-sidebar.layout-sidebar-dark .layout-menu > li.active-menuitem > ul { + background-color: #616161; + } + .layout-wrapper.layout-menu-horizontal .layout-main { + margin-left: 0px; + } + .layout-wrapper.layout-menu-horizontal .layout-topbar { + width: 100%; + } + .layout-wrapper.layout-menu-horizontal .layout-topbar .topbar-logo { + float: left; + margin-top: -10px; + margin-right: 20px; + display: inline-block; + } + .layout-wrapper.layout-menu-horizontal .layout-topbar .topbar-logo img { + height: 56px; + vertical-align: middle; + } + .layout-wrapper.layout-menu-horizontal .layout-topbar .topbar-logo .app-name { + color: #ffffff; + font-size: 26px; + } + .layout-wrapper.layout-menu-horizontal .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li.profile-item { + float: right; + margin-left: 20px; + } + .layout-wrapper.layout-menu-horizontal .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li.profile-item > ul { + left: auto; + right: 105px; + } + .layout-wrapper.layout-menu-horizontal .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li.profile-item > ul:before { + left: 232px; + } + .layout-wrapper.layout-menu-horizontal .layout-breadcrumb { + padding-top: 108px; + } + .layout-wrapper.layout-menu-horizontal.layout-rtl .layout-main { + margin-right: 0px; + } + .layout-wrapper.layout-menu-horizontal.layout-rtl .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li.profile-item { + float: left; + margin-right: 20px; + margin-left: auto; + } + .layout-wrapper.layout-menu-horizontal.layout-rtl .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li.profile-item > ul { + left: 105px; + right: auto; + } + .layout-wrapper.layout-menu-horizontal.layout-rtl .layout-main .layout-topbar .layout-topbar-menu-wrapper .topbar-menu > li.profile-item > ul:before { + left: auto; + right: 232px; + } + .layout-wrapper.layout-menu-horizontal.layout-rtl .layout-main .layout-topbar .topbar-logo { + float: right; + margin-right: auto; + margin-left: 20px; + } + .layout-wrapper.layout-menu-horizontal.layout-rtl .layout-sidebar { + -moz-transition: right 0s; + -o-transition: right 0s; + -webkit-transition: right 0s; + transition: right 0s; + } + .layout-wrapper.layout-menu-horizontal.layout-rtl .layout-sidebar .layout-menu > li { + float: right; + } + .layout-wrapper.layout-menu-horizontal.layout-rtl .layout-sidebar .layout-menu > li > a i { + margin-right: auto; + margin-left: 5px; + } + .layout-wrapper.layout-menu-horizontal.layout-rtl .layout-sidebar .layout-menu > li > ul { + left: auto; + } + .layout-wrapper.layout-menu-horizontal.layout-rtl .layout-sidebar .layout-menu > li > ul li a { + padding-right: 40px; + padding-left: 0px; + } + .layout-wrapper.layout-menu-horizontal.layout-rtl .layout-sidebar .layout-menu > li > ul li a i { + right: 10px; + left: auto; + } + .layout-wrapper.layout-menu-horizontal.layout-rtl .layout-sidebar .layout-menu > li > ul li a i:last-child { + left: 10px; + right: auto; + } + .layout-wrapper.layout-menu-horizontal.layout-rtl .layout-sidebar .layout-menu > li > ul li a .layout-submenu-toggler { + right: auto; + left: 10px; + } + .layout-wrapper.layout-menu-horizontal.layout-rtl .layout-sidebar .layout-menu > li > ul li ul li a { + padding-right: 50px; + padding-left: 0px; + } + .layout-wrapper.layout-menu-horizontal.layout-rtl .layout-sidebar .layout-menu > li > ul li ul li a i:first-child { + right: 20px; + left: auto; + } + .layout-wrapper.layout-menu-horizontal.layout-rtl .layout-sidebar .layout-menu > li > ul li ul ul li a { + padding-right: 60px; + padding-left: 0px; + } + .layout-wrapper.layout-menu-horizontal.layout-rtl .layout-sidebar .layout-menu > li > ul li ul ul li a i:first-child { + right: 30px; + left: auto; + } + .layout-wrapper.layout-menu-horizontal.layout-rtl .layout-sidebar .layout-menu li a .menuitem-badge { + right: 18px; + left: auto; + } + .layout-wrapper.layout-menu-horizontal.layout-rtl .layout-sidebar .layout-menu li a i:last-child { + margin-right: 3px; + } +} +/* Add your customizations of layout here */ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/css/layout-green.scss b/ace-web/src/main/webapp/resources/serenity-layout/css/layout-green.scss new file mode 100644 index 0000000..64875ed --- /dev/null +++ b/ace-web/src/main/webapp/resources/serenity-layout/css/layout-green.scss @@ -0,0 +1,67 @@ +/* Sidebar */ +$sidebarLogoBgColor:#29ABE1; +$sidebarBgColor:#ffffff; +$darkSidebarBgColor:#29ABE1; + +/* Primary */ +$primaryColor:#29ABE1; +$primaryDarkColor:#2341BB; +$primaryLightColor:#8AD4F2; +$primaryLightestColor:#A8E1F7; +$primaryTextColor:#ffffff; + +/* Accent */ +$accentColor:#29ABE1; +$accentDarkColor: #2341BB; +$accentLightColor: #8AD4F2; + +/* Topbar */ +$topbarTextColor:#ffffff; +$topbarIconColor:#ffffff; + +/* Submenu */ +$submenuBgColor:#EEEEEE; +$darkSubmenuBgColor:#2341BB; +$horizontalSubmenuBgColor:#EEEEEE; +$horizontalDarkSubmenuBgColor:#616161; +$horizontalSubmenuitemHoverBgColor:#E0E0E0; +$horizontalSubmenuitemDarkHoverBgColor:#545454; +$horizontalSubmenuitemDarkHoverTextColor:#ffffff; +$horizontalMenuActiveTextColor:#ffffff; +$horizontalMenuActiveHoverTextColor:#212121; +$horizontalDarkMenuActiveTextColor:#ffffff; +$horizontalDarkMenuActiveHoverTextColor:#ffffff; + +/* Default MenuItem */ +$menuitemTextColor:#212121; +$menuitemIconTextColor:#616161; + +/* Hover MenuItem */ +$menuitemHoverBgColor:#E0E0E0; +$menuitemHoverTextColor:#212121; +$menuitemHoverIconTextColor:#212121; + +/* Active MenuItem */ +$menuitemActiveBgColor:#29ABE1; +$menuitemActiveTextColor:#ffffff; +$menuitemActiveIconTextColor:#ffffff; +$subMenuitemActiveTextColor:#29ABE1; +$subMenuitemActiveIconTextColor:#29ABE1; + +/* Dark Default MenuItem */ +$darkMenuitemTextColor:#dee0e3; +$darkMenuitemIconTextColor:#dee0e3; + +/* Dark Hover MenuItem */ +$darkMenuitemHoverBgColor:#2341BB; +$darkMenuitemHoverTextColor:#ffffff; +$darkMenuitemHoverIconTextColor:#ffffff; + +/* Dark Active MenuItem */ +$darkMenuitemActiveBgColor:#2341BB; +$darkMenuitemActiveTextColor:#ffffff; +$darkMenuitemActiveIconTextColor:#ffffff; +$darksubMenuitemActiveTextColor:#8AD4F2; +$darksubMenuitemActiveIconTextColor:#8AD4F2; + +@import '../../sass/layout/_layout'; diff --git a/ace-web/src/main/webapp/resources/serenity-layout/css/nanoscroller.css b/ace-web/src/main/webapp/resources/serenity-layout/css/nanoscroller.css new file mode 100644 index 0000000..db3de71 --- /dev/null +++ b/ace-web/src/main/webapp/resources/serenity-layout/css/nanoscroller.css @@ -0,0 +1,58 @@ +/** initial setup **/ +.nano { + position : relative; + width : 100%; + height : 100%; + overflow : hidden; +} +.nano > .nano-content { + /* position : absolute; */ + overflow : scroll; + overflow-x : hidden; + top : 0; + right : 0; + bottom : 0; + left : 0; +} +.nano > .nano-content:focus { + outline: thin dotted; +} +.nano > .nano-content::-webkit-scrollbar { + display: none; +} +.has-scrollbar > .nano-content::-webkit-scrollbar { + display: block; +} +.nano > .nano-pane { + background : transparent; + position : absolute; + width : 10px; + right : 0; + top : 0; + bottom : 0; + visibility : hidden\9; /* Target only IE7 and IE8 with this hack */ + opacity : .01; + -webkit-transition : .2s; + -moz-transition : .2s; + -o-transition : .2s; + transition : .2s; + -moz-border-radius : 5px; + -webkit-border-radius : 5px; + border-radius : 5px; +} +.nano > .nano-pane.nano-pane-rtl { + right: auto; + left: 0; +} +.nano > .nano-pane > .nano-slider { + background:rgba(255,255,255,0.1); + position : relative; + margin : 0 1px; + -moz-border-radius : 2px; + -webkit-border-radius : 2px; + border-radius : 2px; +} +.nano:hover > .nano-pane, .nano-pane.active, .nano-pane.flashed { + visibility : visible\9; /* Target only IE7 and IE8 with this hack */ + opacity : 0.99; +} diff --git a/ace-web/src/main/webapp/resources/serenity-layout/css/ripple.css b/ace-web/src/main/webapp/resources/serenity-layout/css/ripple.css new file mode 100644 index 0000000..552d0b9 --- /dev/null +++ b/ace-web/src/main/webapp/resources/serenity-layout/css/ripple.css @@ -0,0 +1,50 @@ +/* Ripple Effect Style like Google Material Buttons Effect*/ + +.ripplelink{ + /* display:block; */ + /*color:#fff;*/ + text-decoration:none; + position:relative; + overflow:hidden; + -webkit-transition: all 0.2s ease; + -moz-transition: all 0.2s ease; + -o-transition: all 0.2s ease; + transition: all 0.2s ease; + z-index:0; +} + +.ripplelink:hover{ + /*z-index:1000;*/ +} + +.ink { + display: block; + position: absolute; + background:rgba(255, 255, 255, 0.4); + border-radius: 100%; + -webkit-transform:scale(0); + -moz-transform:scale(0); + -o-transform:scale(0); + transform:scale(0); +} + +.ripple-animate { + -webkit-animation:ripple 0.65s linear; + -moz-animation:ripple 0.65s linear; + -ms-animation:ripple 0.65s linear; + -o-animation:ripple 0.65s linear; + animation:ripple 0.65s linear; +} + +@-webkit-keyframes ripple { + 100% {opacity: 0; -webkit-transform: scale(2.5);} +} +@-moz-keyframes ripple { + 100% {opacity: 0; -moz-transform: scale(2.5);} +} +@-o-keyframes ripple { + 100% {opacity: 0; -o-transform: scale(2.5);} +} +@keyframes ripple { + 100% {opacity: 0; transform: scale(2.5);} +} \ No newline at end of file diff --git a/ace-web/src/main/webapp/resources/serenity-layout/fonts/MaterialIcons-Regular.eot b/ace-web/src/main/webapp/resources/serenity-layout/fonts/MaterialIcons-Regular.eot new file mode 100644 index 0000000..70508eb Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/fonts/MaterialIcons-Regular.eot differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/fonts/MaterialIcons-Regular.ttf b/ace-web/src/main/webapp/resources/serenity-layout/fonts/MaterialIcons-Regular.ttf new file mode 100644 index 0000000..7015564 Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/fonts/MaterialIcons-Regular.ttf differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/fonts/MaterialIcons-Regular.woff b/ace-web/src/main/webapp/resources/serenity-layout/fonts/MaterialIcons-Regular.woff new file mode 100644 index 0000000..b648a3e Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/fonts/MaterialIcons-Regular.woff differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/fonts/MaterialIcons-Regular.woff2 b/ace-web/src/main/webapp/resources/serenity-layout/fonts/MaterialIcons-Regular.woff2 new file mode 100644 index 0000000..9fa2112 Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/fonts/MaterialIcons-Regular.woff2 differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-300.eot b/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-300.eot new file mode 100644 index 0000000..826acfd Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-300.eot differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-300.svg b/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-300.svg new file mode 100644 index 0000000..52b2832 --- /dev/null +++ b/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-300.svg @@ -0,0 +1,314 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-300.ttf b/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-300.ttf new file mode 100644 index 0000000..66bc5ab Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-300.ttf differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-300.woff b/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-300.woff new file mode 100644 index 0000000..7e6c479 Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-300.woff differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-300.woff2 b/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-300.woff2 new file mode 100644 index 0000000..c34c128 Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-300.woff2 differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-700.eot b/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-700.eot new file mode 100644 index 0000000..f89cad7 Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-700.eot differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-700.svg b/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-700.svg new file mode 100644 index 0000000..fc8d42f --- /dev/null +++ b/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-700.svg @@ -0,0 +1,310 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-700.ttf b/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-700.ttf new file mode 100644 index 0000000..19090af Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-700.ttf differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-700.woff b/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-700.woff new file mode 100644 index 0000000..bf737c1 Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-700.woff differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-700.woff2 b/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-700.woff2 new file mode 100644 index 0000000..11cde5d Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-700.woff2 differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-regular.eot b/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-regular.eot new file mode 100644 index 0000000..d26bc8f Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-regular.eot differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-regular.svg b/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-regular.svg new file mode 100644 index 0000000..ed55c10 --- /dev/null +++ b/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-regular.svg @@ -0,0 +1,308 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-regular.ttf b/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-regular.ttf new file mode 100644 index 0000000..7b25f3c Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-regular.ttf differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-regular.woff b/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-regular.woff new file mode 100644 index 0000000..941dfa4 Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-regular.woff differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-regular.woff2 b/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-regular.woff2 new file mode 100644 index 0000000..120796b Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/fonts/roboto-v15-latin-regular.woff2 differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/ace_logo.jpg b/ace-web/src/main/webapp/resources/serenity-layout/images/ace_logo.jpg new file mode 100644 index 0000000..c4b9e41 Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/images/ace_logo.jpg differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/apc_card.png b/ace-web/src/main/webapp/resources/serenity-layout/images/apc_card.png new file mode 100644 index 0000000..be5efc9 Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/images/apc_card.png differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/arrebol.png b/ace-web/src/main/webapp/resources/serenity-layout/images/arrebol.png new file mode 100644 index 0000000..51417c2 Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/images/arrebol.png differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/avatar.png b/ace-web/src/main/webapp/resources/serenity-layout/images/avatar.png new file mode 100644 index 0000000..b59e5b9 Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/images/avatar.png differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/avatar1.png b/ace-web/src/main/webapp/resources/serenity-layout/images/avatar1.png new file mode 100644 index 0000000..c858822 Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/images/avatar1.png differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/avatar2.png b/ace-web/src/main/webapp/resources/serenity-layout/images/avatar2.png new file mode 100644 index 0000000..9feab7d Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/images/avatar2.png differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/avatar3.png b/ace-web/src/main/webapp/resources/serenity-layout/images/avatar3.png new file mode 100644 index 0000000..4b3f8e2 Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/images/avatar3.png differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/avatar4.png b/ace-web/src/main/webapp/resources/serenity-layout/images/avatar4.png new file mode 100644 index 0000000..e13d651 Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/images/avatar4.png differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/bridge.png b/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/bridge.png new file mode 100644 index 0000000..cb2fbb9 Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/bridge.png differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/flag-belgium.png b/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/flag-belgium.png new file mode 100644 index 0000000..f03e432 Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/flag-belgium.png differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/flag-brazil.png b/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/flag-brazil.png new file mode 100644 index 0000000..7dacdd1 Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/flag-brazil.png differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/flag-china.png b/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/flag-china.png new file mode 100644 index 0000000..1513e31 Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/flag-china.png differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/flag-france.png b/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/flag-france.png new file mode 100644 index 0000000..17878d8 Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/flag-france.png differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/flag-uk.png b/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/flag-uk.png new file mode 100644 index 0000000..4a58c36 Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/flag-uk.png differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/gradient-waters.png b/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/gradient-waters.png new file mode 100644 index 0000000..25f99fa Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/gradient-waters.png differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/map.jpg b/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/map.jpg new file mode 100644 index 0000000..38b4b8a Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/map.jpg differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/sidebar-image.jpg b/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/sidebar-image.jpg new file mode 100644 index 0000000..5cc3855 Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/sidebar-image.jpg differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/usercard.png b/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/usercard.png new file mode 100644 index 0000000..a83e51a Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/usercard.png differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/weather-icon-1.svg b/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/weather-icon-1.svg new file mode 100644 index 0000000..25bc665 --- /dev/null +++ b/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/weather-icon-1.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/weather-icon-2.svg b/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/weather-icon-2.svg new file mode 100644 index 0000000..63792cb --- /dev/null +++ b/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/weather-icon-2.svg @@ -0,0 +1,3 @@ + + + diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/weather-icon-3.svg b/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/weather-icon-3.svg new file mode 100644 index 0000000..625278d --- /dev/null +++ b/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/weather-icon-3.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/weather-icon-4.svg b/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/weather-icon-4.svg new file mode 100644 index 0000000..711ee31 --- /dev/null +++ b/ace-web/src/main/webapp/resources/serenity-layout/images/dashboard/weather-icon-4.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/excel-xls-icon.png b/ace-web/src/main/webapp/resources/serenity-layout/images/excel-xls-icon.png new file mode 100644 index 0000000..149024e Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/images/excel-xls-icon.png differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/exception/401.svg b/ace-web/src/main/webapp/resources/serenity-layout/images/exception/401.svg new file mode 100644 index 0000000..f3c1ca8 --- /dev/null +++ b/ace-web/src/main/webapp/resources/serenity-layout/images/exception/401.svg @@ -0,0 +1,16 @@ + + + + 401 + Created with Sketch. + + + + + + + + + + + \ No newline at end of file diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/exception/404.svg b/ace-web/src/main/webapp/resources/serenity-layout/images/exception/404.svg new file mode 100644 index 0000000..402c9d9 --- /dev/null +++ b/ace-web/src/main/webapp/resources/serenity-layout/images/exception/404.svg @@ -0,0 +1,3 @@ + + + diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/exception/500(1).svg b/ace-web/src/main/webapp/resources/serenity-layout/images/exception/500(1).svg new file mode 100644 index 0000000..500e478 --- /dev/null +++ b/ace-web/src/main/webapp/resources/serenity-layout/images/exception/500(1).svg @@ -0,0 +1,3 @@ + + + diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/exception/500.svg b/ace-web/src/main/webapp/resources/serenity-layout/images/exception/500.svg new file mode 100644 index 0000000..500e478 --- /dev/null +++ b/ace-web/src/main/webapp/resources/serenity-layout/images/exception/500.svg @@ -0,0 +1,3 @@ + + + diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/exception/access-bg.jpg b/ace-web/src/main/webapp/resources/serenity-layout/images/exception/access-bg.jpg new file mode 100644 index 0000000..9c222a4 Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/images/exception/access-bg.jpg differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/exception/error-bg(1).jpg b/ace-web/src/main/webapp/resources/serenity-layout/images/exception/error-bg(1).jpg new file mode 100644 index 0000000..4317a03 Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/images/exception/error-bg(1).jpg differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/exception/error-bg.jpg b/ace-web/src/main/webapp/resources/serenity-layout/images/exception/error-bg.jpg new file mode 100644 index 0000000..4317a03 Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/images/exception/error-bg.jpg differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/exception/icon-apple-green.svg b/ace-web/src/main/webapp/resources/serenity-layout/images/exception/icon-apple-green.svg new file mode 100644 index 0000000..e008673 --- /dev/null +++ b/ace-web/src/main/webapp/resources/serenity-layout/images/exception/icon-apple-green.svg @@ -0,0 +1,3 @@ + + + diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/exception/icon-apple-purple.svg b/ace-web/src/main/webapp/resources/serenity-layout/images/exception/icon-apple-purple.svg new file mode 100644 index 0000000..8e0f544 --- /dev/null +++ b/ace-web/src/main/webapp/resources/serenity-layout/images/exception/icon-apple-purple.svg @@ -0,0 +1,3 @@ + + + diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/exception/icon-donut-red.svg b/ace-web/src/main/webapp/resources/serenity-layout/images/exception/icon-donut-red.svg new file mode 100644 index 0000000..2f5bc44 --- /dev/null +++ b/ace-web/src/main/webapp/resources/serenity-layout/images/exception/icon-donut-red.svg @@ -0,0 +1,3 @@ + + + diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/exception/icon-donut-yellow.svg b/ace-web/src/main/webapp/resources/serenity-layout/images/exception/icon-donut-yellow.svg new file mode 100644 index 0000000..f6d93b5 --- /dev/null +++ b/ace-web/src/main/webapp/resources/serenity-layout/images/exception/icon-donut-yellow.svg @@ -0,0 +1,3 @@ + + + diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/exception/icon-shop-purple.svg b/ace-web/src/main/webapp/resources/serenity-layout/images/exception/icon-shop-purple.svg new file mode 100644 index 0000000..fe5275c --- /dev/null +++ b/ace-web/src/main/webapp/resources/serenity-layout/images/exception/icon-shop-purple.svg @@ -0,0 +1,3 @@ + + + diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/exception/icon-shop-yellow.svg b/ace-web/src/main/webapp/resources/serenity-layout/images/exception/icon-shop-yellow.svg new file mode 100644 index 0000000..0a86338 --- /dev/null +++ b/ace-web/src/main/webapp/resources/serenity-layout/images/exception/icon-shop-yellow.svg @@ -0,0 +1,3 @@ + + + diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/exception/icon-taxi-yellow.svg b/ace-web/src/main/webapp/resources/serenity-layout/images/exception/icon-taxi-yellow.svg new file mode 100644 index 0000000..962157a --- /dev/null +++ b/ace-web/src/main/webapp/resources/serenity-layout/images/exception/icon-taxi-yellow.svg @@ -0,0 +1,3 @@ + + + diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/exception/notfound-bg.jpg b/ace-web/src/main/webapp/resources/serenity-layout/images/exception/notfound-bg.jpg new file mode 100644 index 0000000..ecf3d7f Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/images/exception/notfound-bg.jpg differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/landing/icon-cleancode.svg b/ace-web/src/main/webapp/resources/serenity-layout/images/landing/icon-cleancode.svg new file mode 100644 index 0000000..b9da184 --- /dev/null +++ b/ace-web/src/main/webapp/resources/serenity-layout/images/landing/icon-cleancode.svg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/landing/icon-coffee.svg b/ace-web/src/main/webapp/resources/serenity-layout/images/landing/icon-coffee.svg new file mode 100644 index 0000000..64b012a --- /dev/null +++ b/ace-web/src/main/webapp/resources/serenity-layout/images/landing/icon-coffee.svg @@ -0,0 +1,3 @@ + + + diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/landing/icon-facebook.svg b/ace-web/src/main/webapp/resources/serenity-layout/images/landing/icon-facebook.svg new file mode 100644 index 0000000..c6421fb --- /dev/null +++ b/ace-web/src/main/webapp/resources/serenity-layout/images/landing/icon-facebook.svg @@ -0,0 +1,16 @@ + + + + icon-facebook + Created with Sketch. + + + + + + + + + + + \ No newline at end of file diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/landing/icon-hours.svg b/ace-web/src/main/webapp/resources/serenity-layout/images/landing/icon-hours.svg new file mode 100644 index 0000000..d13c031 --- /dev/null +++ b/ace-web/src/main/webapp/resources/serenity-layout/images/landing/icon-hours.svg @@ -0,0 +1,3 @@ + + + diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/landing/icon-linkedin.svg b/ace-web/src/main/webapp/resources/serenity-layout/images/landing/icon-linkedin.svg new file mode 100644 index 0000000..561d394 --- /dev/null +++ b/ace-web/src/main/webapp/resources/serenity-layout/images/landing/icon-linkedin.svg @@ -0,0 +1,16 @@ + + + + icon-linkedin + Created with Sketch. + + + + + + + + + + + \ No newline at end of file diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/landing/icon-moderndesign.svg b/ace-web/src/main/webapp/resources/serenity-layout/images/landing/icon-moderndesign.svg new file mode 100644 index 0000000..5fe4ba9 --- /dev/null +++ b/ace-web/src/main/webapp/resources/serenity-layout/images/landing/icon-moderndesign.svg @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/landing/icon-responsive.svg b/ace-web/src/main/webapp/resources/serenity-layout/images/landing/icon-responsive.svg new file mode 100644 index 0000000..5a867c7 --- /dev/null +++ b/ace-web/src/main/webapp/resources/serenity-layout/images/landing/icon-responsive.svg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/landing/icon-twitter.svg b/ace-web/src/main/webapp/resources/serenity-layout/images/landing/icon-twitter.svg new file mode 100644 index 0000000..18cde8c --- /dev/null +++ b/ace-web/src/main/webapp/resources/serenity-layout/images/landing/icon-twitter.svg @@ -0,0 +1,16 @@ + + + + icon-twitter + Created with Sketch. + + + + + + + + + + + \ No newline at end of file diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/landing/icon-ui.svg b/ace-web/src/main/webapp/resources/serenity-layout/images/landing/icon-ui.svg new file mode 100644 index 0000000..766985a --- /dev/null +++ b/ace-web/src/main/webapp/resources/serenity-layout/images/landing/icon-ui.svg @@ -0,0 +1,3 @@ + + + diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/landing/icon-welldocumented.svg b/ace-web/src/main/webapp/resources/serenity-layout/images/landing/icon-welldocumented.svg new file mode 100644 index 0000000..ee83d9f --- /dev/null +++ b/ace-web/src/main/webapp/resources/serenity-layout/images/landing/icon-welldocumented.svg @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/landing/landing-header.png b/ace-web/src/main/webapp/resources/serenity-layout/images/landing/landing-header.png new file mode 100644 index 0000000..b6c2c0a Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/images/landing/landing-header.png differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/landing/map-contact.png b/ace-web/src/main/webapp/resources/serenity-layout/images/landing/map-contact.png new file mode 100644 index 0000000..9311d89 Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/images/landing/map-contact.png differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/login/login-bg.jpg b/ace-web/src/main/webapp/resources/serenity-layout/images/login/login-bg.jpg new file mode 100644 index 0000000..9c222a4 Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/images/login/login-bg.jpg differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/logo-colored.png b/ace-web/src/main/webapp/resources/serenity-layout/images/logo-colored.png new file mode 100644 index 0000000..8cf868a Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/images/logo-colored.png differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/logo-slim.png b/ace-web/src/main/webapp/resources/serenity-layout/images/logo-slim.png new file mode 100644 index 0000000..05cfa20 Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/images/logo-slim.png differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/mapa.png b/ace-web/src/main/webapp/resources/serenity-layout/images/mapa.png new file mode 100644 index 0000000..80ac3bf Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/images/mapa.png differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/images/rightmenu-icon.png b/ace-web/src/main/webapp/resources/serenity-layout/images/rightmenu-icon.png new file mode 100644 index 0000000..efa47f7 Binary files /dev/null and b/ace-web/src/main/webapp/resources/serenity-layout/images/rightmenu-icon.png differ diff --git a/ace-web/src/main/webapp/resources/serenity-layout/js/calendar_es.js b/ace-web/src/main/webapp/resources/serenity-layout/js/calendar_es.js new file mode 100644 index 0000000..0c04bbc --- /dev/null +++ b/ace-web/src/main/webapp/resources/serenity-layout/js/calendar_es.js @@ -0,0 +1,26 @@ +PrimeFaces.locales['es'] = { + closeText: 'Cerrar', + prevText: 'Anterior', + nextText: 'Siguiente', + monthNames: ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'], + monthNamesShort: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'], + dayNames: ['Domingo', 'Lunes', 'Martes', 'MiĆ©rcoles', 'Jueves', 'Viernes', 'SĆ”bado'], + dayNamesShort: ['Dom', 'Lun', 'Mar', 'Mie', 'Jue', 'Vie', 'Sab'], + dayNamesMin: ['D', 'L', 'M', 'X', 'J', 'V', 'S'], + weekHeader: 'Semana', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: '', + timeOnlyTitle: 'SĆ³lo hora', + timeText: 'Tiempo', + hourText: 'Hora', + minuteText: 'Minuto', + secondText: 'Segundo', + currentText: 'Fecha actual', + ampm: false, + month: 'Mes', + week: 'Semana', + day: 'DĆ­a', + allDayText: 'Todo el dĆ­a' +} \ No newline at end of file diff --git a/ace-web/src/main/webapp/resources/serenity-layout/js/layout.js b/ace-web/src/main/webapp/resources/serenity-layout/js/layout.js new file mode 100644 index 0000000..2047672 --- /dev/null +++ b/ace-web/src/main/webapp/resources/serenity-layout/js/layout.js @@ -0,0 +1,750 @@ +/** + * PrimeFaces Serenity Layout + */ +PrimeFaces.widget.Serenity = PrimeFaces.widget.BaseWidget.extend({ + + init: function(cfg) { + this._super(cfg); + this.wrapper = $(document.body).children('.layout-wrapper'); + + var $this = this; + $(function() { + $this._init(); + }); + + if(!this.wrapper.hasClass('layout-menu-horizontal')) { + this.restoreMenuState(); + } + + this.expandedMenuitems = this.expandedMenuitems||[]; + }, + + _init: function() { + this.contentWrapper = this.wrapper.children('.layout-main'); + this.sidebar = this.wrapper.children('.layout-sidebar'); + this.menu = this.sidebar.find('.layout-menu'); + this.menulinks = this.menu.find('a'); + this.topbar = this.contentWrapper.children('.layout-topbar'); + this.menuButton = this.topbar.children('.menu-btn'); + this.topbarMenu = this.topbar.find('> .layout-topbar-menu-wrapper > .topbar-menu'); + this.topbarItems = this.topbarMenu.children('li'); + this.topbarLinks = this.topbarMenu.find('a'); + this.topbarMenuButton = this.topbar.find('> .topbar-menu-btn'); + this.anchorButton = this.sidebar.find('> .sidebar-logo > .sidebar-anchor'); + this.nano = this.sidebar.find('.nano'); + this.isRTL = this.wrapper.hasClass('layout-rtl'); + this.bindEvents(); + }, + + bindEvents: function() { + var $this = this; + + $('.nano').nanoScroller({flash: true, isRTL: $this.isRTL}); + + this.sidebar.on('mouseenter', function(e) { + + if(!$this.wrapper.hasClass('layout-sidebar-static')) { + if($this.hideTimeout) { + clearTimeout($this.hideTimeout); + } + $this.sidebar.addClass('layout-sidebar-active'); + } + + }) + .on('mouseleave', function(e) { + + if(!$this.wrapper.hasClass('layout-sidebar-static')) { + $this.hideTimeout = setTimeout(function() { + $this.sidebar.removeClass('layout-sidebar-active'); + }, $this.cfg.closeDelay); + } + + }); + + + this.menulinks.off('click').on('click', function(e) { + var link = $(this), + item = link.parent(), + submenu = item.children('ul'); + horizontal = $this.isHorizontal() && $this.isDesktop(); + + if(horizontal) { + $this.horizontalMenuClick = true; + } + + if(item.hasClass('active-menuitem')) { + if(submenu.length) { + $this.removeMenuitem(item.attr('id')); + item.removeClass('active-menuitem'); + + if(horizontal) { + if(item.parent().is($this.jq)) { + $this.menuActive = false; + } + + submenu.hide(); + } + else { + submenu.slideUp(); + } + + submenu.find('.ink').remove(); + + submenu.slideUp(function() { + $this.removeMenuitem(item.attr('id')); + item.removeClass('active-menuitem'); + }); + } + } + else { + $this.addMenuitem(item.attr('id')); + + if(horizontal) { + $this.deactivateItems(item.siblings()); + item.addClass('active-menuitem'); + $this.menuActive = true; + submenu.show(); + } + else { + $this.deactivateItems(item.siblings(), true); + $this.activate(item); + } + } + + setTimeout(function() { + $this.nano.nanoScroller(); + }, 500); + + if(!horizontal) { + setTimeout(function() { + $(".nano").nanoScroller(); + }, 500); + } + + if(submenu.length) { + e.preventDefault(); + } + }); + + this.menu.find('> li').on('mouseenter', function(e) { + if($this.isHorizontal() && $this.isDesktop()) { + var item = $(this); + + if(!item.hasClass('active-menuitem')) { + $this.menu.find('.active-menuitem').removeClass('active-menuitem'); + $this.menu.find('ul:visible').hide(); + $this.menu.find('.ink').remove(); + + if($this.menuActive) { + item.addClass('active-menuitem'); + item.children('ul').show(); + } + } + } + }); + + this.topbarLinks.off('click.topbarLink').on('click.topbarLink', function(e) { + var link = $(this), + item = link.parent(), + submenu = link.next(); + + $this.topbarClick = true; + + item.siblings('.active-topmenuitem').removeClass('active-topmenuitem'); + + if($this.isMobile()) { + item.children('ul').removeClass('fadeInDown fadeOutUp'); + item.toggleClass('active-topmenuitem'); + } + else { + if(submenu.length) { + if(item.hasClass('active-topmenuitem')) { + submenu.addClass('fadeOutUp').removeClass('fadeInDown'); + + setTimeout(function() { + item.removeClass('active-topmenuitem'), + submenu.removeClass('fadeOutUp'); + }, 450); + } + else { + item.addClass('active-topmenuitem'); + submenu.addClass('fadeInDown'); + } + } + } + + var href = link.attr('href'); + if(href && href !== '#') { + window.location.href = href; + } + + e.preventDefault(); + }); + + this.anchorButton.on('click', function(e) { + $this.wrapper.removeClass('layout-wrapper-static-restore'); + $this.wrapper.toggleClass('layout-wrapper-static'); + $this.saveMenuState(); + e.preventDefault(); + }); + + this.menuButton.on('click', function(e) { + $this.wrapper.removeClass('layout-wrapper-static-restore').toggleClass('layout-wrapper-active'); + $(document.body).toggleClass('hidden-overflow'); + + setTimeout(function() { + $this.nano.nanoScroller(); + }, 500); + + e.preventDefault(); + }); + + this.topbarMenuButton.on('click', function(e) { + $this.topbarClick = true; + $this.topbarMenu.find('ul').removeClass('fadeInDown fadeOutUp'); + + if($this.topbarMenu.hasClass('topbar-menu-active')) { + $this.topbarMenu.addClass('fadeOutUp').removeClass('fadeInDown'); + + setTimeout(function() { + $this.topbarMenu.removeClass('topbar-menu-active fadeOutUp'); + }, 450); + } + else { + $this.topbarMenu.addClass('topbar-menu-active fadeInDown'); + } + + e.preventDefault(); + }); + + this.topbarItems.filter('.search-item').on('click', function() { + $this.topbarClick = true; + }); + + this.contentWrapper.children('.layout-main-mask').on('click', function(e) { + $this.wrapper.removeClass('layout-wrapper-active layout-wrapper-static-restore'); + $(document.body).removeClass('hidden-overflow'); + }); + + $(document.body).on('click', function() { + if($this.isHorizontal() && !$this.horizontalMenuClick && $this.isDesktop()) { + $this.menu.find('.active-menuitem').removeClass('active-menuitem'); + $this.menu.find('ul:visible').hide(); + $this.menuActive = false; + } + + if(!$this.topbarClick) { + $this.topbarItems.filter('.active-topmenuitem').removeClass('active-topmenuitem'); + $this.topbarMenu.removeClass('topbar-menu-active'); + } + + $this.horizontalMenuClick = false; + $this.topbarClick = false; + }); + }, + + activate: function(item) { + var submenu = item.children('ul'); + item.addClass('active-menuitem'); + + if(submenu.length) { + submenu.slideDown(); + } + }, + + deactivate: function(item) { + var submenu = item.children('ul'); + item.removeClass('active-menuitem').find('.ink').remove(); + + if(submenu.length) { + submenu.hide(); + submenu.find('.ink').remove(); + } + }, + + deactivateItems: function(items, animate) { + var $this = this; + + for(var i = 0; i < items.length; i++) { + var item = items.eq(i), + submenu = item.children('ul'); + + if(submenu.length) { + if(item.hasClass('active-menuitem')) { + var activeSubItems = item.find('.active-menuitem'); + item.removeClass('active-menuitem'); + + if(animate) { + submenu.slideUp('normal', function() { + $(this).parent().find('.active-menuitem').each(function() { + $this.deactivate($(this)); + }); + }); + } + else { + submenu.hide(); + item.find('.active-menuitem').each(function() { + $this.deactivate($(this)); + }); + } + + $this.removeMenuitem(item.attr('id')); + activeSubItems.each(function() { + $this.removeMenuitem($(this).attr('id')); + }); + } + else { + item.find('.active-menuitem').each(function() { + var subItem = $(this); + $this.deactivate(subItem); + $this.removeMenuitem(subItem.attr('id')); + }); + } + } + else if(item.hasClass('active-menuitem')) { + $this.deactivate(item); + $this.removeMenuitem(item.attr('id')); + } + } + }, + + removeMenuitem: function (id) { + this.expandedMenuitems = $.grep(this.expandedMenuitems, function (value) { + return value !== id; + }); + this.saveMenuState(); + }, + + addMenuitem: function (id) { + if ($.inArray(id, this.expandedMenuitems) === -1) { + this.expandedMenuitems.push(id); + } + this.saveMenuState(); + }, + + saveMenuState: function() { + if(this.isHorizontal()) { + return; + } + + if(this.wrapper.hasClass('layout-wrapper-static')) + $.cookie('serenity_menu_static', 'serenity_menu_static', {path: '/'}); + else + $.removeCookie('serenity_menu_static', {path: '/'}); + + $.cookie('serenity_expandeditems', this.expandedMenuitems.join(','), {path: '/'}); + }, + + clearMenuState: function() { + $.removeCookie('serenity_expandeditems', {path: '/'}); + $.removeCookie('serenity_menu_static', {path: '/'}); + }, + + restoreMenuState: function() { + var menuCookie = $.cookie('serenity_expandeditems'); + if (menuCookie) { + this.expandedMenuitems = menuCookie.split(','); + for (var i = 0; i < this.expandedMenuitems.length; i++) { + var id = this.expandedMenuitems[i]; + if (id) { + var menuitem = $("#" + this.expandedMenuitems[i].replace(/:/g, "\\:")); + menuitem.addClass('active-menuitem'); + + var submenu = menuitem.children('ul'); + if(submenu.length) { + submenu.show(); + } + } + } + } + + var sidebarCookie = $.cookie('serenity_menu_static'); + if(sidebarCookie) { + this.wrapper.addClass('layout-wrapper-static layout-wrapper-static-restore'); + } + }, + + hideTopBar: function() { + var $this = this; + this.topbarMenu.addClass('fadeOutUp'); + + setTimeout(function() { + $this.topbarMenu.removeClass('fadeOutUp topbar-menu-visible'); + },500); + }, + + isMobile: function() { + return window.innerWidth <= 640; + }, + + isHorizontal: function() { + return this.wrapper.hasClass('layout-menu-horizontal'); + }, + + isDesktop: function() { + return window.innerWidth > 1024; + } +}); + +/*! + * jQuery Cookie Plugin v1.4.1 + * https://github.com/carhartl/jquery-cookie + * + * Copyright 2006, 2014 Klaus Hartl + * Released under the MIT license + */ +(function (factory) { + if (typeof define === 'function' && define.amd) { + // AMD (Register as an anonymous module) + define(['jquery'], factory); + } else if (typeof exports === 'object') { + // Node/CommonJS + module.exports = factory(require('jquery')); + } else { + // Browser globals + factory(jQuery); + } +}(function ($) { + + var pluses = /\+/g; + + function encode(s) { + return config.raw ? s : encodeURIComponent(s); + } + + function decode(s) { + return config.raw ? s : decodeURIComponent(s); + } + + function stringifyCookieValue(value) { + return encode(config.json ? JSON.stringify(value) : String(value)); + } + + function parseCookieValue(s) { + if (s.indexOf('"') === 0) { + // This is a quoted cookie as according to RFC2068, unescape... + s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); + } + + try { + // Replace server-side written pluses with spaces. + // If we can't decode the cookie, ignore it, it's unusable. + // If we can't parse the cookie, ignore it, it's unusable. + s = decodeURIComponent(s.replace(pluses, ' ')); + return config.json ? JSON.parse(s) : s; + } catch(e) {} + } + + function read(s, converter) { + var value = config.raw ? s : parseCookieValue(s); + return $.isFunction(converter) ? converter(value) : value; + } + + var config = $.cookie = function (key, value, options) { + + // Write + + if (arguments.length > 1 && !$.isFunction(value)) { + options = $.extend({}, config.defaults, options); + + if (typeof options.expires === 'number') { + var days = options.expires, t = options.expires = new Date(); + t.setMilliseconds(t.getMilliseconds() + days * 864e+5); + } + + return (document.cookie = [ + encode(key), '=', stringifyCookieValue(value), + options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE + options.path ? '; path=' + options.path : '', + options.domain ? '; domain=' + options.domain : '', + options.secure ? '; secure' : '' + ].join('')); + } + + // Read + + var result = key ? undefined : {}, + // To prevent the for loop in the first place assign an empty array + // in case there are no cookies at all. Also prevents odd result when + // calling $.cookie(). + cookies = document.cookie ? document.cookie.split('; ') : [], + i = 0, + l = cookies.length; + + for (; i < l; i++) { + var parts = cookies[i].split('='), + name = decode(parts.shift()), + cookie = parts.join('='); + + if (key === name) { + // If second argument (value) is a function it's a converter... + result = read(cookie, value); + break; + } + + // Prevent storing a cookie that we couldn't decode. + if (!key && (cookie = read(cookie)) !== undefined) { + result[name] = cookie; + } + } + + return result; + }; + + config.defaults = {}; + + $.removeCookie = function (key, options) { + // Must not alter options, thus extending a fresh object... + $.cookie(key, '', $.extend({}, options, { expires: -1 })); + return !$.cookie(key); + }; + +})); + +/* JS extensions to support material animations */ +if(PrimeFaces.widget.InputSwitch) { + PrimeFaces.widget.InputSwitch = PrimeFaces.widget.InputSwitch.extend({ + + init: function(cfg) { + this._super(cfg); + + if(this.input.prop('checked')) { + this.jq.addClass('ui-inputswitch-checked'); + } + }, + + toggle: function() { + var $this = this; + + if(this.input.prop('checked')) { + this.uncheck(); + setTimeout(function() { + $this.jq.removeClass('ui-inputswitch-checked'); + }, 100); + } + else { + this.check(); + setTimeout(function() { + $this.jq.addClass('ui-inputswitch-checked'); + }, 100); + } + } + }); +} + +if(PrimeFaces.widget.SelectBooleanButton) { + PrimeFaces.widget.SelectBooleanButton.prototype.check = function() { + if(!this.disabled) { + this.input.prop('checked', true); + this.jq.addClass('ui-state-active').children('.ui-button-text').contents()[0].textContent = this.cfg.onLabel; + + if(this.icon.length > 0) { + this.icon.removeClass(this.cfg.offIcon).addClass(this.cfg.onIcon); + } + + this.input.trigger('change'); + } + } + + PrimeFaces.widget.SelectBooleanButton.prototype.uncheck = function() { + if(!this.disabled) { + this.input.prop('checked', false); + this.jq.removeClass('ui-state-active').children('.ui-button-text').contents()[0].textContent = this.cfg.offLabel; + + if(this.icon.length > 0) { + this.icon.removeClass(this.cfg.onIcon).addClass(this.cfg.offIcon); + } + + this.input.trigger('change'); + } + } +} + +PrimeFaces.skinInput = function(input) { + setTimeout(function() { + if(input.val() != '') { + var parent = input.parent(); + input.addClass('ui-state-filled'); + + if(parent.is("span:not('.md-inputfield')")) { + parent.addClass('md-inputwrapper-filled'); + } + } + }, 1); + + input.on('mouseenter', function() { + $(this).addClass('ui-state-hover'); + }) + .on('mouseleave', function() { + $(this).removeClass('ui-state-hover'); + }) + .on('focus', function() { + var parent = input.parent(); + $(this).addClass('ui-state-focus'); + + if(parent.is("span:not('.md-inputfield')")) { + parent.addClass('md-inputwrapper-focus'); + } + }) + .on('blur', function() { + $(this).removeClass('ui-state-focus'); + + if(input.hasClass('hasDatepicker')) { + setTimeout(function() { + PrimeFaces.onInputBlur(input); + },150); + } + else { + PrimeFaces.onInputBlur(input); + } + }); + + //aria + input.attr('role', 'textbox') + .attr('aria-disabled', input.is(':disabled')) + .attr('aria-readonly', input.prop('readonly')); + + if(input.is('textarea')) { + input.attr('aria-multiline', true); + } + + return this; +}; + +PrimeFaces.onInputBlur = function(input) { + var parent = input.parent(), + hasInputFieldClass = parent.is("span:not('.md-inputfield')"); + + if(parent.hasClass('md-inputwrapper-focus')) { + parent.removeClass('md-inputwrapper-focus'); + } + + if(input.val() != '') { + input.addClass('ui-state-filled'); + if(hasInputFieldClass) { + parent.addClass('md-inputwrapper-filled'); + } + } + else { + input.removeClass('ui-state-filled'); + parent.removeClass('md-inputwrapper-filled'); + } +}; + +if(PrimeFaces.widget.AutoComplete) { + PrimeFaces.widget.AutoComplete.prototype.setupMultipleMode = function() { + var $this = this; + this.multiItemContainer = this.jq.children('ul'); + this.inputContainer = this.multiItemContainer.children('.ui-autocomplete-input-token'); + + this.multiItemContainer.hover(function() { + $(this).addClass('ui-state-hover'); + }, + function() { + $(this).removeClass('ui-state-hover'); + } + ).click(function() { + $this.input.focus(); + }); + + //delegate events to container + this.input.focus(function() { + $this.multiItemContainer.addClass('ui-state-focus'); + $this.jq.addClass('md-inputwrapper-focus'); + }).blur(function(e) { + $this.multiItemContainer.removeClass('ui-state-focus'); + $this.jq.removeClass('md-inputwrapper-focus').addClass('md-inputwrapper-filled'); + + setTimeout(function() { + if($this.hinput.children().length == 0 && !$this.multiItemContainer.hasClass('ui-state-focus')) { + $this.jq.removeClass('md-inputwrapper-filled'); + } + }, 150); + }); + + var closeSelector = '> li.ui-autocomplete-token > .ui-autocomplete-token-icon'; + this.multiItemContainer.off('click', closeSelector).on('click', closeSelector, null, function(event) { + if($this.multiItemContainer.children('li.ui-autocomplete-token').length === $this.cfg.selectLimit) { + if(PrimeFaces.isIE(8)) { + $this.input.val(''); + } + $this.input.css('display', 'inline'); + $this.enableDropdown(); + } + $this.removeItem(event, $(this).parent()); + }); + }; +}; + +if(PrimeFaces.widget.Calendar) { + PrimeFaces.widget.Calendar.prototype.bindDateSelectListener = function() { + var _self = this; + + this.cfg.onSelect = function() { + if(_self.cfg.popup) { + _self.fireDateSelectEvent(); + } + else { + var newDate = $.datepicker.formatDate(_self.cfg.dateFormat, _self.getDate()); + + _self.input.val(newDate); + _self.fireDateSelectEvent(); + } + + if(_self.input.val() != '') { + var parent = _self.input.parent(); + parent.addClass('md-inputwrapper-filled'); + _self.input.addClass('ui-state-filled'); + } + }; + }; +} + +/* Issue #924 is fixed for 5.3+ and 6.0. (compatibility with 5.3) */ +if(window['PrimeFaces'] && window['PrimeFaces'].widget.Dialog) { + PrimeFaces.widget.Dialog = PrimeFaces.widget.Dialog.extend({ + + enableModality: function() { + this._super(); + $(document.body).children(this.jqId + '_modal').addClass('ui-dialog-mask'); + }, + + syncWindowResize: function() {} + }); +} + +/* Issue #2131 */ +if(window['PrimeFaces'] && window['PrimeFaces'].widget.Schedule) { + PrimeFaces.widget.Schedule = PrimeFaces.widget.Schedule.extend({ + + setupEventSource: function() { + var $this = this, + offset = moment().utcOffset()*60000; + + this.cfg.events = function(start, end, timezone, callback) { + var options = { + source: $this.id, + process: $this.id, + update: $this.id, + formId: $this.cfg.formId, + params: [ + {name: $this.id + '_start', value: start.valueOf() + offset}, + {name: $this.id + '_end', value: end.valueOf() + offset} + ], + onsuccess: function(responseXML, status, xhr) { + PrimeFaces.ajax.Response.handle(responseXML, status, xhr, { + widget: $this, + handle: function(content) { + callback($.parseJSON(content).events); + } + }); + + return true; + } + }; + + PrimeFaces.ajax.Request.handle(options); + } + } + }); +} \ No newline at end of file diff --git a/ace-web/src/main/webapp/resources/serenity-layout/js/nanoscroller.js b/ace-web/src/main/webapp/resources/serenity-layout/js/nanoscroller.js new file mode 100644 index 0000000..da7f9b7 --- /dev/null +++ b/ace-web/src/main/webapp/resources/serenity-layout/js/nanoscroller.js @@ -0,0 +1,1040 @@ +/*! nanoScrollerJS - v0.8.7 - 2015 + * http://jamesflorentino.github.com/nanoScrollerJS/ + * Copyright (c) 2015 James Florentino; Licensed MIT */ +(function (factory) { + if (typeof define === 'function' && define.amd) { + return define(['jquery'], function ($) { + return factory($, window, document); + }); + } else if (typeof exports === 'object') { + return module.exports = factory(require('jquery'), window, document); + } else { + return factory(jQuery, window, document); + } +})(function ($, window, document) { + "use strict"; + var BROWSER_IS_IE7, BROWSER_SCROLLBAR_WIDTH, DOMSCROLL, DOWN, DRAG, ENTER, KEYDOWN, KEYUP, MOUSEDOWN, MOUSEENTER, MOUSEMOVE, MOUSEUP, MOUSEWHEEL, NanoScroll, PANEDOWN, RESIZE, SCROLL, SCROLLBAR, TOUCHMOVE, UP, WHEEL, cAF, defaults, getBrowserScrollbarWidth, hasTransform, isFFWithBuggyScrollbar, rAF, transform, _elementStyle, _prefixStyle, _vendor; + defaults = { + + /** + a classname for the pane element. + @property paneClass + @type String + @default 'nano-pane' + */ + paneClass: 'nano-pane', + + /** + a classname for the slider element. + @property sliderClass + @type String + @default 'nano-slider' + */ + sliderClass: 'nano-slider', + + /** + a classname for the content element. + @property contentClass + @type String + @default 'nano-content' + */ + contentClass: 'nano-content', + + /** + a classname for enabled mode + @property enabledClass + @type String + @default 'has-scrollbar' + */ + enabledClass: 'has-scrollbar', + + /** + a classname for flashed mode + @property flashedClass + @type String + @default 'flashed' + */ + flashedClass: 'flashed', + + /** + a classname for active mode + @property activeClass + @type String + @default 'active' + */ + activeClass: 'active', + + /** + a setting to enable native scrolling in iOS devices. + @property iOSNativeScrolling + @type Boolean + @default false + */ + iOSNativeScrolling: false, + + /** + a setting to prevent the rest of the page being + scrolled when user scrolls the `.content` element. + @property preventPageScrolling + @type Boolean + @default false + */ + preventPageScrolling: false, + + /** + a setting to disable binding to the resize event. + @property disableResize + @type Boolean + @default false + */ + disableResize: false, + + /** + a setting to make the scrollbar always visible. + @property alwaysVisible + @type Boolean + @default false + */ + alwaysVisible: false, + + /** + a default timeout for the `flash()` method. + @property flashDelay + @type Number + @default 1500 + */ + flashDelay: 1500, + + /** + a minimum height for the `.slider` element. + @property sliderMinHeight + @type Number + @default 20 + */ + sliderMinHeight: 20, + + /** + a maximum height for the `.slider` element. + @property sliderMaxHeight + @type Number + @default null + */ + sliderMaxHeight: null, + + /** + an alternate document context. + @property documentContext + @type Document + @default null + */ + documentContext: null, + + /** + an alternate window context. + @property windowContext + @type Window + @default null + */ + windowContext: null, + + /** + menu orientation for PrimeFaces Layouts + @property isRTL + @type Boolean + @default false + */ + isRTL: false + }; + + /** + @property SCROLLBAR + @type String + @static + @final + @private + */ + SCROLLBAR = 'scrollbar'; + + /** + @property SCROLL + @type String + @static + @final + @private + */ + SCROLL = 'scroll'; + + /** + @property MOUSEDOWN + @type String + @final + @private + */ + MOUSEDOWN = 'mousedown'; + + /** + @property MOUSEENTER + @type String + @final + @private + */ + MOUSEENTER = 'mouseenter'; + + /** + @property MOUSEMOVE + @type String + @static + @final + @private + */ + MOUSEMOVE = 'mousemove'; + + /** + @property MOUSEWHEEL + @type String + @final + @private + */ + MOUSEWHEEL = 'mousewheel'; + + /** + @property MOUSEUP + @type String + @static + @final + @private + */ + MOUSEUP = 'mouseup'; + + /** + @property RESIZE + @type String + @final + @private + */ + RESIZE = 'resize'; + + /** + @property DRAG + @type String + @static + @final + @private + */ + DRAG = 'drag'; + + /** + @property ENTER + @type String + @static + @final + @private + */ + ENTER = 'enter'; + + /** + @property UP + @type String + @static + @final + @private + */ + UP = 'up'; + + /** + @property PANEDOWN + @type String + @static + @final + @private + */ + PANEDOWN = 'panedown'; + + /** + @property DOMSCROLL + @type String + @static + @final + @private + */ + DOMSCROLL = 'DOMMouseScroll'; + + /** + @property DOWN + @type String + @static + @final + @private + */ + DOWN = 'down'; + + /** + @property WHEEL + @type String + @static + @final + @private + */ + WHEEL = 'wheel'; + + /** + @property KEYDOWN + @type String + @static + @final + @private + */ + KEYDOWN = 'keydown'; + + /** + @property KEYUP + @type String + @static + @final + @private + */ + KEYUP = 'keyup'; + + /** + @property TOUCHMOVE + @type String + @static + @final + @private + */ + TOUCHMOVE = 'touchmove'; + + /** + @property BROWSER_IS_IE7 + @type Boolean + @static + @final + @private + */ + BROWSER_IS_IE7 = window.navigator.appName === 'Microsoft Internet Explorer' && /msie 7./i.test(window.navigator.appVersion) && window.ActiveXObject; + + /** + @property BROWSER_SCROLLBAR_WIDTH + @type Number + @static + @default null + @private + */ + BROWSER_SCROLLBAR_WIDTH = null; + rAF = window.requestAnimationFrame; + cAF = window.cancelAnimationFrame; + _elementStyle = document.createElement('div').style; + _vendor = (function () { + var i, transform, vendor, vendors, _i, _len; + vendors = ['t', 'webkitT', 'MozT', 'msT', 'OT']; + for (i = _i = 0, _len = vendors.length; _i < _len; i = ++_i) { + vendor = vendors[i]; + transform = vendors[i] + 'ransform'; + if (transform in _elementStyle) { + return vendors[i].substr(0, vendors[i].length - 1); + } + } + return false; + })(); + _prefixStyle = function (style) { + if (_vendor === false) { + return false; + } + if (_vendor === '') { + return style; + } + return _vendor + style.charAt(0).toUpperCase() + style.substr(1); + }; + transform = _prefixStyle('transform'); + hasTransform = transform !== false; + + /** + Returns browser's native scrollbar width + @method getBrowserScrollbarWidth + @return {Number} the scrollbar width in pixels + @static + @private + */ + getBrowserScrollbarWidth = function () { + var outer, outerStyle, scrollbarWidth; + outer = document.createElement('div'); + outerStyle = outer.style; + outerStyle.position = 'absolute'; + outerStyle.width = '100px'; + outerStyle.height = '100px'; + outerStyle.overflow = SCROLL; + outerStyle.top = '-9999px'; + document.body.appendChild(outer); + scrollbarWidth = outer.offsetWidth - outer.clientWidth; + document.body.removeChild(outer); + return scrollbarWidth; + }; + isFFWithBuggyScrollbar = function () { + var isOSXFF, ua, version; + ua = window.navigator.userAgent; + isOSXFF = /(?=.+Mac OS X)(?=.+Firefox)/.test(ua); + if (!isOSXFF) { + return false; + } + version = /Firefox\/\d{2}\./.exec(ua); + if (version) { + version = version[0].replace(/\D+/g, ''); + } + return isOSXFF && +version > 23; + }; + + /** + @class NanoScroll + @param element {HTMLElement|Node} the main element + @param options {Object} nanoScroller's options + @constructor + */ + NanoScroll = (function () { + function NanoScroll(el, options) { + this.el = el; + this.options = options; + BROWSER_SCROLLBAR_WIDTH || (BROWSER_SCROLLBAR_WIDTH = getBrowserScrollbarWidth()); + this.$el = $(this.el); + this.doc = $(this.options.documentContext || document); + this.win = $(this.options.windowContext || window); + this.body = this.doc.find('body'); + this.$content = this.$el.children("." + this.options.contentClass); + this.$content.attr('tabindex', this.options.tabIndex || 0); + this.content = this.$content[0]; + this.previousPosition = 0; + if (this.options.iOSNativeScrolling && (this.el.style.WebkitOverflowScrolling != null)) { + this.nativeScrolling(); + } else { + this.generate(); + } + this.createEvents(); + this.addEvents(); + this.reset(); + } + + + /** + Prevents the rest of the page being scrolled + when user scrolls the `.nano-content` element. + @method preventScrolling + @param event {Event} + @param direction {String} Scroll direction (up or down) + @private + */ + + NanoScroll.prototype.preventScrolling = function (e, direction) { + if (!this.isActive) { + return; + } + if (e.type === DOMSCROLL) { + if (direction === DOWN && e.originalEvent.detail > 0 || direction === UP && e.originalEvent.detail < 0) { + e.preventDefault(); + } + } else if (e.type === MOUSEWHEEL) { + if (!e.originalEvent || !e.originalEvent.wheelDelta) { + return; + } + if (direction === DOWN && e.originalEvent.wheelDelta < 0 || direction === UP && e.originalEvent.wheelDelta > 0) { + e.preventDefault(); + } + } + }; + + + /** + Enable iOS native scrolling + @method nativeScrolling + @private + */ + + NanoScroll.prototype.nativeScrolling = function () { + this.$content.css({ + WebkitOverflowScrolling: 'touch' + }); + this.iOSNativeScrolling = true; + this.isActive = true; + }; + + + /** + Updates those nanoScroller properties that + are related to current scrollbar position. + @method updateScrollValues + @private + */ + + NanoScroll.prototype.updateScrollValues = function () { + var content, direction; + content = this.content; + this.maxScrollTop = content.scrollHeight - content.clientHeight; + this.prevScrollTop = this.contentScrollTop || 0; + this.contentScrollTop = content.scrollTop; + direction = this.contentScrollTop > this.previousPosition ? "down" : this.contentScrollTop < this.previousPosition ? "up" : "same"; + this.previousPosition = this.contentScrollTop; + if (direction !== "same") { + this.$el.trigger('update', { + position: this.contentScrollTop, + maximum: this.maxScrollTop, + direction: direction + }); + } + if (!this.iOSNativeScrolling) { + this.maxSliderTop = this.paneHeight - this.sliderHeight; + this.sliderTop = this.maxScrollTop === 0 ? 0 : this.contentScrollTop * this.maxSliderTop / this.maxScrollTop; + } + }; + + + /** + Updates CSS styles for current scroll position. + Uses CSS 2d transfroms and `window.requestAnimationFrame` if available. + @method setOnScrollStyles + @private + */ + + NanoScroll.prototype.setOnScrollStyles = function () { + var cssValue; + if (hasTransform) { + cssValue = {}; + cssValue[transform] = "translate(0, " + this.sliderTop + "px)"; + } else { + cssValue = { + top: this.sliderTop + }; + } + if (rAF) { + if (cAF && this.scrollRAF) { + cAF(this.scrollRAF); + } + this.scrollRAF = rAF((function (_this) { + return function () { + _this.scrollRAF = null; + return _this.slider.css(cssValue); + }; + })(this)); + } else { + this.slider.css(cssValue); + } + }; + + + /** + Creates event related methods + @method createEvents + @private + */ + + NanoScroll.prototype.createEvents = function () { + this.events = { + down: (function (_this) { + return function (e) { + _this.isBeingDragged = true; + _this.offsetY = e.pageY - _this.slider.offset().top; + if (!_this.slider.is(e.target)) { + _this.offsetY = 0; + } + _this.pane.addClass(_this.options.activeClass); + _this.doc.bind(MOUSEMOVE, _this.events[DRAG]).bind(MOUSEUP, _this.events[UP]); + _this.body.bind(MOUSEENTER, _this.events[ENTER]); + return false; + }; + })(this), + drag: (function (_this) { + return function (e) { + _this.sliderY = e.pageY - _this.$el.offset().top - _this.paneTop - (_this.offsetY || _this.sliderHeight * 0.5); + _this.scroll(); + if (_this.contentScrollTop >= _this.maxScrollTop && _this.prevScrollTop !== _this.maxScrollTop) { + _this.$el.trigger('scrollend'); + } else if (_this.contentScrollTop === 0 && _this.prevScrollTop !== 0) { + _this.$el.trigger('scrolltop'); + } + return false; + }; + })(this), + up: (function (_this) { + return function (e) { + _this.isBeingDragged = false; + _this.pane.removeClass(_this.options.activeClass); + _this.doc.unbind(MOUSEMOVE, _this.events[DRAG]).unbind(MOUSEUP, _this.events[UP]); + _this.body.unbind(MOUSEENTER, _this.events[ENTER]); + return false; + }; + })(this), + resize: (function (_this) { + return function (e) { + _this.reset(); + }; + })(this), + panedown: (function (_this) { + return function (e) { + _this.sliderY = (e.offsetY || e.originalEvent.layerY) - (_this.sliderHeight * 0.5); + _this.scroll(); + _this.events.down(e); + return false; + }; + })(this), + scroll: (function (_this) { + return function (e) { + _this.updateScrollValues(); + if (_this.isBeingDragged) { + return; + } + if (!_this.iOSNativeScrolling) { + _this.sliderY = _this.sliderTop; + _this.setOnScrollStyles(); + } + if (e == null) { + return; + } + if (_this.contentScrollTop >= _this.maxScrollTop) { + if (_this.options.preventPageScrolling) { + _this.preventScrolling(e, DOWN); + } + if (_this.prevScrollTop !== _this.maxScrollTop) { + _this.$el.trigger('scrollend'); + } + } else if (_this.contentScrollTop === 0) { + if (_this.options.preventPageScrolling) { + _this.preventScrolling(e, UP); + } + if (_this.prevScrollTop !== 0) { + _this.$el.trigger('scrolltop'); + } + } + }; + })(this), + wheel: (function (_this) { + return function (e) { + var delta; + if (e == null) { + return; + } + delta = e.delta || e.wheelDelta || (e.originalEvent && e.originalEvent.wheelDelta) || -e.detail || (e.originalEvent && -e.originalEvent.detail); + if (delta) { + _this.sliderY += -delta / 3; + } + _this.scroll(); + return false; + }; + })(this), + enter: (function (_this) { + return function (e) { + var _ref; + if (!_this.isBeingDragged) { + return; + } + if ((e.buttons || e.which) !== 1) { + return (_ref = _this.events)[UP].apply(_ref, arguments); + } + }; + })(this) + }; + }; + + + /** + Adds event listeners with jQuery. + @method addEvents + @private + */ + + NanoScroll.prototype.addEvents = function () { + var events; + this.removeEvents(); + events = this.events; + if (!this.options.disableResize) { + this.win.bind(RESIZE, events[RESIZE]); + } + if (!this.iOSNativeScrolling) { + this.slider.bind(MOUSEDOWN, events[DOWN]); + this.pane.bind(MOUSEDOWN, events[PANEDOWN]).bind("" + MOUSEWHEEL + " " + DOMSCROLL, events[WHEEL]); + } + this.$content.bind("" + SCROLL + " " + MOUSEWHEEL + " " + DOMSCROLL + " " + TOUCHMOVE, events[SCROLL]); + }; + + + /** + Removes event listeners with jQuery. + @method removeEvents + @private + */ + + NanoScroll.prototype.removeEvents = function () { + var events; + events = this.events; + this.win.unbind(RESIZE, events[RESIZE]); + if (!this.iOSNativeScrolling) { + this.slider.unbind(); + this.pane.unbind(); + } + this.$content.unbind("" + SCROLL + " " + MOUSEWHEEL + " " + DOMSCROLL + " " + TOUCHMOVE, events[SCROLL]); + }; + + + /** + Generates nanoScroller's scrollbar and elements for it. + @method generate + @chainable + @private + */ + + NanoScroll.prototype.generate = function () { + var contentClass, cssRule, currentPadding, options, pane, paneClass, sliderClass, isRTL; + options = this.options; + paneClass = options.paneClass, sliderClass = options.sliderClass, contentClass = options.contentClass, isRTL = options.isRTL; + if (!(pane = this.$el.children("." + paneClass)).length && !pane.children("." + sliderClass).length) { + this.$el.append("
    "); + } + this.pane = this.$el.children("." + paneClass); + this.slider = this.pane.find("." + sliderClass); + if (BROWSER_SCROLLBAR_WIDTH === 0 && isFFWithBuggyScrollbar()) { + if (isRTL) { + currentPadding = window.getComputedStyle(this.content, null).getPropertyValue('padding-left').replace(/[^0-9.]+/g, ''); + cssRule = { + left: -14, + paddingLeft: +currentPadding + 14 + }; + } else { + currentPadding = window.getComputedStyle(this.content, null).getPropertyValue('padding-right').replace(/[^0-9.]+/g, ''); + cssRule = { + right: -14, + paddingRight: +currentPadding + 14 + }; + } + } else if (BROWSER_SCROLLBAR_WIDTH) { + if (isRTL) { + cssRule = { + left: -BROWSER_SCROLLBAR_WIDTH + }; + } else { + cssRule = { + right: -BROWSER_SCROLLBAR_WIDTH + }; + } + this.$el.addClass(options.enabledClass); + } + if (cssRule != null) { + this.$content.css(cssRule); + + if (isRTL) { + this.pane.addClass('nano-pane-rtl'); + } + } + return this; + }; + + + /** + @method restore + @private + */ + + NanoScroll.prototype.restore = function () { + this.stopped = false; + if (!this.iOSNativeScrolling) { + this.pane.show(); + } + this.addEvents(); + }; + + + /** + Resets nanoScroller's scrollbar. + @method reset + @chainable + @example + $(".nano").nanoScroller(); + */ + + NanoScroll.prototype.reset = function () { + var content, contentHeight, contentPosition, contentStyle, contentStyleOverflowY, paneBottom, paneHeight, paneOuterHeight, paneTop, parentMaxHeight, right, left, sliderHeight; + if (this.iOSNativeScrolling) { + this.contentHeight = this.content.scrollHeight; + return; + } + if (!this.$el.find("." + this.options.paneClass).length) { + this.generate().stop(); + } + if (this.stopped) { + this.restore(); + } + content = this.content; + contentStyle = content.style; + contentStyleOverflowY = contentStyle.overflowY; + if (BROWSER_IS_IE7) { + this.$content.css({ + height: this.$content.height() + }); + } + contentHeight = content.scrollHeight + BROWSER_SCROLLBAR_WIDTH; + parentMaxHeight = parseInt(this.$el.css("max-height"), 10); + if (parentMaxHeight > 0) { + this.$el.height(""); + this.$el.height(content.scrollHeight > parentMaxHeight ? parentMaxHeight : content.scrollHeight); + } + paneHeight = this.pane.outerHeight(false); + paneTop = parseInt(this.pane.css('top'), 10); + paneBottom = parseInt(this.pane.css('bottom'), 10); + paneOuterHeight = paneHeight + paneTop + paneBottom; + sliderHeight = Math.round(paneOuterHeight / contentHeight * paneHeight); + if (sliderHeight < this.options.sliderMinHeight) { + sliderHeight = this.options.sliderMinHeight; + } else if ((this.options.sliderMaxHeight != null) && sliderHeight > this.options.sliderMaxHeight) { + sliderHeight = this.options.sliderMaxHeight; + } + if (contentStyleOverflowY === SCROLL && contentStyle.overflowX !== SCROLL) { + sliderHeight += BROWSER_SCROLLBAR_WIDTH; + } + this.maxSliderTop = paneOuterHeight - sliderHeight; + this.contentHeight = contentHeight; + this.paneHeight = paneHeight; + this.paneOuterHeight = paneOuterHeight; + this.sliderHeight = sliderHeight; + this.paneTop = paneTop; + this.slider.height(sliderHeight); + this.events.scroll(); + this.pane.show(); + this.isActive = true; + if ((content.scrollHeight === content.clientHeight) || (this.pane.outerHeight(true) >= content.scrollHeight && contentStyleOverflowY !== SCROLL)) { + this.pane.hide(); + this.isActive = false; + } else if (this.el.clientHeight === content.scrollHeight && contentStyleOverflowY === SCROLL) { + this.slider.hide(); + } else { + this.slider.show(); + } + this.pane.css({ + opacity: (this.options.alwaysVisible ? 1 : ''), + visibility: (this.options.alwaysVisible ? 'visible' : '') + }); + contentPosition = this.$content.css('position'); + if (contentPosition === 'static' || contentPosition === 'relative') { + if (this.options.isRTL) { + left = parseInt(this.$content.get(0).style.left, 10); + if (left) { + this.$content.css({ + left: '', + marginLeft: left + }); + } + } else { + right = parseInt(this.$content.get(0).style.right, 10); + if (right) { + this.$content.css({ + right: '', + marginRight: right + }); + } + } + } + return this; + }; + + + /** + @method scroll + @private + @example + $(".nano").nanoScroller({ scroll: 'top' }); + */ + + NanoScroll.prototype.scroll = function () { + if (!this.isActive) { + return; + } + this.sliderY = Math.max(0, this.sliderY); + this.sliderY = Math.min(this.maxSliderTop, this.sliderY); + this.$content.scrollTop(this.maxScrollTop * this.sliderY / this.maxSliderTop); + if (!this.iOSNativeScrolling) { + this.updateScrollValues(); + this.setOnScrollStyles(); + } + return this; + }; + + + /** + Scroll at the bottom with an offset value + @method scrollBottom + @param offsetY {Number} + @chainable + @example + $(".nano").nanoScroller({ scrollBottom: value }); + */ + + NanoScroll.prototype.scrollBottom = function (offsetY) { + if (!this.isActive) { + return; + } + this.$content.scrollTop(this.contentHeight - this.$content.height() - offsetY).trigger(MOUSEWHEEL); + this.stop().restore(); + return this; + }; + + + /** + Scroll at the top with an offset value + @method scrollTop + @param offsetY {Number} + @chainable + @example + $(".nano").nanoScroller({ scrollTop: value }); + */ + + NanoScroll.prototype.scrollTop = function (offsetY) { + if (!this.isActive) { + return; + } + this.$content.scrollTop(+offsetY).trigger(MOUSEWHEEL); + this.stop().restore(); + return this; + }; + + + /** + Scroll to an element + @method scrollTo + @param node {Node} A node to scroll to. + @chainable + @example + $(".nano").nanoScroller({ scrollTo: $('#a_node') }); + */ + + NanoScroll.prototype.scrollTo = function (node) { + if (!this.isActive) { + return; + } + this.scrollTop(this.$el.find(node).get(0).offsetTop); + return this; + }; + + + /** + To stop the operation. + This option will tell the plugin to disable all event bindings and hide the gadget scrollbar from the UI. + @method stop + @chainable + @example + $(".nano").nanoScroller({ stop: true }); + */ + + NanoScroll.prototype.stop = function () { + if (cAF && this.scrollRAF) { + cAF(this.scrollRAF); + this.scrollRAF = null; + } + this.stopped = true; + this.removeEvents(); + if (!this.iOSNativeScrolling) { + this.pane.hide(); + } + return this; + }; + + + /** + Destroys nanoScroller and restores browser's native scrollbar. + @method destroy + @chainable + @example + $(".nano").nanoScroller({ destroy: true }); + */ + + NanoScroll.prototype.destroy = function () { + if (!this.stopped) { + this.stop(); + } + if (!this.iOSNativeScrolling && this.pane.length) { + this.pane.remove(); + } + if (BROWSER_IS_IE7) { + this.$content.height(''); + } + this.$content.removeAttr('tabindex'); + if (this.$el.hasClass(this.options.enabledClass)) { + this.$el.removeClass(this.options.enabledClass); + if (this.options.isRTL) { + this.$content.css({ + left: '' + }); + } else { + this.$content.css({ + right: '' + }); + } + } + return this; + }; + + + /** + To flash the scrollbar gadget for an amount of time defined in plugin settings (defaults to 1,5s). + Useful if you want to show the user (e.g. on pageload) that there is more content waiting for him. + @method flash + @chainable + @example + $(".nano").nanoScroller({ flash: true }); + */ + + NanoScroll.prototype.flash = function () { + if (this.iOSNativeScrolling) { + return; + } + if (!this.isActive) { + return; + } + this.reset(); + this.pane.addClass(this.options.flashedClass); + setTimeout((function (_this) { + return function () { + _this.pane.removeClass(_this.options.flashedClass); + }; + })(this), this.options.flashDelay); + return this; + }; + + return NanoScroll; + + })(); + $.fn.nanoScroller = function (settings) { + return this.each(function () { + var options, scrollbar; + if (!(scrollbar = this.nanoscroller)) { + options = $.extend({}, defaults, settings); + this.nanoscroller = scrollbar = new NanoScroll(this, options); + } + if (settings && typeof settings === "object") { + $.extend(scrollbar.options, settings); + if (settings.scrollBottom != null) { + return scrollbar.scrollBottom(settings.scrollBottom); + } + if (settings.scrollTop != null) { + return scrollbar.scrollTop(settings.scrollTop); + } + if (settings.scrollTo) { + return scrollbar.scrollTo(settings.scrollTo); + } + if (settings.scroll === 'bottom') { + return scrollbar.scrollBottom(0); + } + if (settings.scroll === 'top') { + return scrollbar.scrollTop(0); + } + if (settings.scroll && settings.scroll instanceof $) { + return scrollbar.scrollTo(settings.scroll); + } + if (settings.stop) { + return scrollbar.stop(); + } + if (settings.destroy) { + return scrollbar.destroy(); + } + if (settings.flash) { + return scrollbar.flash(); + } + } + return scrollbar.reset(); + }); + }; + $.fn.nanoScroller.Constructor = NanoScroll; +}); \ No newline at end of file diff --git a/ace-web/src/main/webapp/resources/serenity-layout/js/ripple.js b/ace-web/src/main/webapp/resources/serenity-layout/js/ripple.js new file mode 100644 index 0000000..d6cc289 --- /dev/null +++ b/ace-web/src/main/webapp/resources/serenity-layout/js/ripple.js @@ -0,0 +1,34 @@ +$(function() { + var ink, d, x, y; + $(document.body).off('mousedown.ripple','.ripplelink,.ui-button,.ui-selectlistbox-item,.ui-multiselectlistbox-item') + .on('mousedown.ripple','.ripplelink,.ui-button,.ui-selectlistbox-item,.ui-multiselectlistbox-item', null, function(e){ + var element = $(this); + + if(element.find(".ink").length === 0){ + if(element.hasClass('ripplelink')) { + if(element.hasClass('tabmenuitem-link')) { + element.append(""); + } + else { + element.children('span').after(""); + } + } + else { + element.append(""); + } + } + + ink = $(this).find(".ink"); + ink.removeClass("ripple-animate"); + + if(!ink.height() && !ink.width()){ + d = Math.max($(this).outerWidth(), $(this).outerHeight()); + ink.css({height: d, width: d}); + } + + x = e.pageX - $(this).offset().left - ink.width()/2; + y = e.pageY - $(this).offset().top - ink.height()/2; + + ink.css({top: y+'px', left: x+'px', 'pointer-events': 'none'}).addClass("ripple-animate"); + }); +}); \ No newline at end of file diff --git a/ace-web/src/main/webapp/resources/serenity-layout/js/swipe.js b/ace-web/src/main/webapp/resources/serenity-layout/js/swipe.js new file mode 100644 index 0000000..c539612 --- /dev/null +++ b/ace-web/src/main/webapp/resources/serenity-layout/js/swipe.js @@ -0,0 +1,1973 @@ +/*! + * @fileOverview TouchSwipe - jQuery Plugin + * @version 1.6.18 + * + * @author Matt Bryson http://www.github.com/mattbryson + * @see https://github.com/mattbryson/TouchSwipe-Jquery-Plugin + * @see http://labs.rampinteractive.co.uk/touchSwipe/ + * @see http://plugins.jquery.com/project/touchSwipe + * @license + * Copyright (c) 2010-2015 Matt Bryson + * Dual licensed under the MIT or GPL Version 2 licenses. + * + */ + +(function(factory) { + if (typeof define === 'function' && define.amd && define.amd.jQuery) { + // AMD. Register as anonymous module. + define(['jquery'], factory); + } else if (typeof module !== 'undefined' && module.exports) { + // CommonJS Module + factory(require("jquery")); + } else { + // Browser globals. + factory(jQuery); + } +}(function($) { + "use strict"; + + //Constants + var VERSION = "1.6.18", + LEFT = "left", + RIGHT = "right", + UP = "up", + DOWN = "down", + IN = "in", + OUT = "out", + + NONE = "none", + AUTO = "auto", + + SWIPE = "swipe", + PINCH = "pinch", + TAP = "tap", + DOUBLE_TAP = "doubletap", + LONG_TAP = "longtap", + HOLD = "hold", + + HORIZONTAL = "horizontal", + VERTICAL = "vertical", + + ALL_FINGERS = "all", + + DOUBLE_TAP_THRESHOLD = 10, + + PHASE_START = "start", + PHASE_MOVE = "move", + PHASE_END = "end", + PHASE_CANCEL = "cancel", + + SUPPORTS_TOUCH = 'ontouchstart' in window, + + SUPPORTS_POINTER_IE10 = window.navigator.msPointerEnabled && !window.navigator.pointerEnabled && !SUPPORTS_TOUCH, + + SUPPORTS_POINTER = (window.navigator.pointerEnabled || window.navigator.msPointerEnabled) && !SUPPORTS_TOUCH, + + PLUGIN_NS = 'TouchSwipe'; + + + + /** + * The default configuration, and available options to configure touch swipe with. + * You can set the default values by updating any of the properties prior to instantiation. + * @name $.fn.swipe.defaults + * @namespace + * @property {int} [fingers=1] The number of fingers to detect in a swipe. Any swipes that do not meet this requirement will NOT trigger swipe handlers. + * @property {int} [threshold=75] The number of pixels that the user must move their finger by before it is considered a swipe. + * @property {int} [cancelThreshold=null] The number of pixels that the user must move their finger back from the original swipe direction to cancel the gesture. + * @property {int} [pinchThreshold=20] The number of pixels that the user must pinch their finger by before it is considered a pinch. + * @property {int} [maxTimeThreshold=null] Time, in milliseconds, between touchStart and touchEnd must NOT exceed in order to be considered a swipe. + * @property {int} [fingerReleaseThreshold=250] Time in milliseconds between releasing multiple fingers. If 2 fingers are down, and are released one after the other, if they are within this threshold, it counts as a simultaneous release. + * @property {int} [longTapThreshold=500] Time in milliseconds between tap and release for a long tap + * @property {int} [doubleTapThreshold=200] Time in milliseconds between 2 taps to count as a double tap + * @property {function} [swipe=null] A handler to catch all swipes. See {@link $.fn.swipe#event:swipe} + * @property {function} [swipeLeft=null] A handler that is triggered for "left" swipes. See {@link $.fn.swipe#event:swipeLeft} + * @property {function} [swipeRight=null] A handler that is triggered for "right" swipes. See {@link $.fn.swipe#event:swipeRight} + * @property {function} [swipeUp=null] A handler that is triggered for "up" swipes. See {@link $.fn.swipe#event:swipeUp} + * @property {function} [swipeDown=null] A handler that is triggered for "down" swipes. See {@link $.fn.swipe#event:swipeDown} + * @property {function} [swipeStatus=null] A handler triggered for every phase of the swipe. See {@link $.fn.swipe#event:swipeStatus} + * @property {function} [pinchIn=null] A handler triggered for pinch in events. See {@link $.fn.swipe#event:pinchIn} + * @property {function} [pinchOut=null] A handler triggered for pinch out events. See {@link $.fn.swipe#event:pinchOut} + * @property {function} [pinchStatus=null] A handler triggered for every phase of a pinch. See {@link $.fn.swipe#event:pinchStatus} + * @property {function} [tap=null] A handler triggered when a user just taps on the item, rather than swipes it. If they do not move, tap is triggered, if they do move, it is not. + * @property {function} [doubleTap=null] A handler triggered when a user double taps on the item. The delay between taps can be set with the doubleTapThreshold property. See {@link $.fn.swipe.defaults#doubleTapThreshold} + * @property {function} [longTap=null] A handler triggered when a user long taps on the item. The delay between start and end can be set with the longTapThreshold property. See {@link $.fn.swipe.defaults#longTapThreshold} + * @property (function) [hold=null] A handler triggered when a user reaches longTapThreshold on the item. See {@link $.fn.swipe.defaults#longTapThreshold} + * @property {boolean} [triggerOnTouchEnd=true] If true, the swipe events are triggered when the touch end event is received (user releases finger). If false, it will be triggered on reaching the threshold, and then cancel the touch event automatically. + * @property {boolean} [triggerOnTouchLeave=false] If true, then when the user leaves the swipe object, the swipe will end and trigger appropriate handlers. + * @property {string|undefined} [allowPageScroll='auto'] How the browser handles page scrolls when the user is swiping on a touchSwipe object. See {@link $.fn.swipe.pageScroll}.

    + "auto" : all undefined swipes will cause the page to scroll in that direction.
    + "none" : the page will not scroll when user swipes.
    + "horizontal" : will force page to scroll on horizontal swipes.
    + "vertical" : will force page to scroll on vertical swipes.
    + * @property {boolean} [fallbackToMouseEvents=true] If true mouse events are used when run on a non touch device, false will stop swipes being triggered by mouse events on non tocuh devices. + * @property {string} [excludedElements=".noSwipe"] A jquery selector that specifies child elements that do NOT trigger swipes. By default this excludes elements with the class .noSwipe . + * @property {boolean} [preventDefaultEvents=true] by default default events are cancelled, so the page doesn't move. You can dissable this so both native events fire as well as your handlers. + + */ + var defaults = { + fingers: 1, + threshold: 75, + cancelThreshold: null, + pinchThreshold: 20, + maxTimeThreshold: null, + fingerReleaseThreshold: 250, + longTapThreshold: 500, + doubleTapThreshold: 200, + swipe: null, + swipeLeft: null, + swipeRight: null, + swipeUp: null, + swipeDown: null, + swipeStatus: null, + pinchIn: null, + pinchOut: null, + pinchStatus: null, + click: null, //Deprecated since 1.6.2 + tap: null, + doubleTap: null, + longTap: null, + hold: null, + triggerOnTouchEnd: true, + triggerOnTouchLeave: false, + allowPageScroll: "auto", + fallbackToMouseEvents: true, + excludedElements: ".noSwipe", + preventDefaultEvents: true + }; + + + + /** + * Applies TouchSwipe behaviour to one or more jQuery objects. + * The TouchSwipe plugin can be instantiated via this method, or methods within + * TouchSwipe can be executed via this method as per jQuery plugin architecture. + * An existing plugin can have its options changed simply by re calling .swipe(options) + * @see TouchSwipe + * @class + * @param {Mixed} method If the current DOMNode is a TouchSwipe object, and method is a TouchSwipe method, then + * the method is executed, and any following arguments are passed to the TouchSwipe method. + * If method is an object, then the TouchSwipe class is instantiated on the current DOMNode, passing the + * configuration properties defined in the object. See TouchSwipe + * + */ + $.fn.swipe = function(method) { + var $this = $(this), + plugin = $this.data(PLUGIN_NS); + + //Check if we are already instantiated and trying to execute a method + if (plugin && typeof method === 'string') { + if (plugin[method]) { + return plugin[method].apply(plugin, Array.prototype.slice.call(arguments, 1)); + } else { + $.error('Method ' + method + ' does not exist on jQuery.swipe'); + } + } + + //Else update existing plugin with new options hash + else if (plugin && typeof method === 'object') { + plugin['option'].apply(plugin, arguments); + } + + //Else not instantiated and trying to pass init object (or nothing) + else if (!plugin && (typeof method === 'object' || !method)) { + return init.apply(this, arguments); + } + + return $this; + }; + + /** + * The version of the plugin + * @readonly + */ + $.fn.swipe.version = VERSION; + + + + //Expose our defaults so a user could override the plugin defaults + $.fn.swipe.defaults = defaults; + + /** + * The phases that a touch event goes through. The phase is passed to the event handlers. + * These properties are read only, attempting to change them will not alter the values passed to the event handlers. + * @namespace + * @readonly + * @property {string} PHASE_START Constant indicating the start phase of the touch event. Value is "start". + * @property {string} PHASE_MOVE Constant indicating the move phase of the touch event. Value is "move". + * @property {string} PHASE_END Constant indicating the end phase of the touch event. Value is "end". + * @property {string} PHASE_CANCEL Constant indicating the cancel phase of the touch event. Value is "cancel". + */ + $.fn.swipe.phases = { + PHASE_START: PHASE_START, + PHASE_MOVE: PHASE_MOVE, + PHASE_END: PHASE_END, + PHASE_CANCEL: PHASE_CANCEL + }; + + /** + * The direction constants that are passed to the event handlers. + * These properties are read only, attempting to change them will not alter the values passed to the event handlers. + * @namespace + * @readonly + * @property {string} LEFT Constant indicating the left direction. Value is "left". + * @property {string} RIGHT Constant indicating the right direction. Value is "right". + * @property {string} UP Constant indicating the up direction. Value is "up". + * @property {string} DOWN Constant indicating the down direction. Value is "cancel". + * @property {string} IN Constant indicating the in direction. Value is "in". + * @property {string} OUT Constant indicating the out direction. Value is "out". + */ + $.fn.swipe.directions = { + LEFT: LEFT, + RIGHT: RIGHT, + UP: UP, + DOWN: DOWN, + IN: IN, + OUT: OUT + }; + + /** + * The page scroll constants that can be used to set the value of allowPageScroll option + * These properties are read only + * @namespace + * @readonly + * @see $.fn.swipe.defaults#allowPageScroll + * @property {string} NONE Constant indicating no page scrolling is allowed. Value is "none". + * @property {string} HORIZONTAL Constant indicating horizontal page scrolling is allowed. Value is "horizontal". + * @property {string} VERTICAL Constant indicating vertical page scrolling is allowed. Value is "vertical". + * @property {string} AUTO Constant indicating either horizontal or vertical will be allowed, depending on the swipe handlers registered. Value is "auto". + */ + $.fn.swipe.pageScroll = { + NONE: NONE, + HORIZONTAL: HORIZONTAL, + VERTICAL: VERTICAL, + AUTO: AUTO + }; + + /** + * Constants representing the number of fingers used in a swipe. These are used to set both the value of fingers in the + * options object, as well as the value of the fingers event property. + * These properties are read only, attempting to change them will not alter the values passed to the event handlers. + * @namespace + * @readonly + * @see $.fn.swipe.defaults#fingers + * @property {string} ONE Constant indicating 1 finger is to be detected / was detected. Value is 1. + * @property {string} TWO Constant indicating 2 fingers are to be detected / were detected. Value is 2. + * @property {string} THREE Constant indicating 3 finger are to be detected / were detected. Value is 3. + * @property {string} FOUR Constant indicating 4 finger are to be detected / were detected. Not all devices support this. Value is 4. + * @property {string} FIVE Constant indicating 5 finger are to be detected / were detected. Not all devices support this. Value is 5. + * @property {string} ALL Constant indicating any combination of finger are to be detected. Value is "all". + */ + $.fn.swipe.fingers = { + ONE: 1, + TWO: 2, + THREE: 3, + FOUR: 4, + FIVE: 5, + ALL: ALL_FINGERS + }; + + /** + * Initialise the plugin for each DOM element matched + * This creates a new instance of the main TouchSwipe class for each DOM element, and then + * saves a reference to that instance in the elements data property. + * @internal + */ + function init(options) { + //Prep and extend the options + if (options && (options.allowPageScroll === undefined && (options.swipe !== undefined || options.swipeStatus !== undefined))) { + options.allowPageScroll = NONE; + } + + //Check for deprecated options + //Ensure that any old click handlers are assigned to the new tap, unless we have a tap + if (options.click !== undefined && options.tap === undefined) { + options.tap = options.click; + } + + if (!options) { + options = {}; + } + + //pass empty object so we dont modify the defaults + options = $.extend({}, $.fn.swipe.defaults, options); + + //For each element instantiate the plugin + return this.each(function() { + var $this = $(this); + + //Check we havent already initialised the plugin + var plugin = $this.data(PLUGIN_NS); + + if (!plugin) { + plugin = new TouchSwipe(this, options); + $this.data(PLUGIN_NS, plugin); + } + }); + } + + /** + * Main TouchSwipe Plugin Class. + * Do not use this to construct your TouchSwipe object, use the jQuery plugin method $.fn.swipe(); {@link $.fn.swipe} + * @private + * @name TouchSwipe + * @param {DOMNode} element The HTML DOM object to apply to plugin to + * @param {Object} options The options to configure the plugin with. @link {$.fn.swipe.defaults} + * @see $.fh.swipe.defaults + * @see $.fh.swipe + * @class + */ + function TouchSwipe(element, options) { + + //take a local/instacne level copy of the options - should make it this.options really... + var options = $.extend({}, options); + + var useTouchEvents = (SUPPORTS_TOUCH || SUPPORTS_POINTER || !options.fallbackToMouseEvents), + START_EV = useTouchEvents ? (SUPPORTS_POINTER ? (SUPPORTS_POINTER_IE10 ? 'MSPointerDown' : 'pointerdown') : 'touchstart') : 'mousedown', + MOVE_EV = useTouchEvents ? (SUPPORTS_POINTER ? (SUPPORTS_POINTER_IE10 ? 'MSPointerMove' : 'pointermove') : 'touchmove') : 'mousemove', + END_EV = useTouchEvents ? (SUPPORTS_POINTER ? (SUPPORTS_POINTER_IE10 ? 'MSPointerUp' : 'pointerup') : 'touchend') : 'mouseup', + LEAVE_EV = useTouchEvents ? (SUPPORTS_POINTER ? 'mouseleave' : null) : 'mouseleave', //we manually detect leave on touch devices, so null event here + CANCEL_EV = (SUPPORTS_POINTER ? (SUPPORTS_POINTER_IE10 ? 'MSPointerCancel' : 'pointercancel') : 'touchcancel'); + + + + //touch properties + var distance = 0, + direction = null, + currentDirection = null, + duration = 0, + startTouchesDistance = 0, + endTouchesDistance = 0, + pinchZoom = 1, + pinchDistance = 0, + pinchDirection = 0, + maximumsMap = null; + + + + //jQuery wrapped element for this instance + var $element = $(element); + + //Current phase of th touch cycle + var phase = "start"; + + // the current number of fingers being used. + var fingerCount = 0; + + //track mouse points / delta + var fingerData = {}; + + //track times + var startTime = 0, + endTime = 0, + previousTouchEndTime = 0, + fingerCountAtRelease = 0, + doubleTapStartTime = 0; + + //Timeouts + var singleTapTimeout = null, + holdTimeout = null; + + // Add gestures to all swipable areas if supported + try { + $element.bind(START_EV, touchStart); + $element.bind(CANCEL_EV, touchCancel); + } catch (e) { + $.error('events not supported ' + START_EV + ',' + CANCEL_EV + ' on jQuery.swipe'); + } + + // + //Public methods + // + + /** + * re-enables the swipe plugin with the previous configuration + * @function + * @name $.fn.swipe#enable + * @return {DOMNode} The Dom element that was registered with TouchSwipe + * @example $("#element").swipe("enable"); + */ + this.enable = function() { + //Incase we are already enabled, clean up... + this.disable(); + $element.bind(START_EV, touchStart); + $element.bind(CANCEL_EV, touchCancel); + return $element; + }; + + /** + * disables the swipe plugin + * @function + * @name $.fn.swipe#disable + * @return {DOMNode} The Dom element that is now registered with TouchSwipe + * @example $("#element").swipe("disable"); + */ + this.disable = function() { + removeListeners(); + return $element; + }; + + /** + * Destroy the swipe plugin completely. To use any swipe methods, you must re initialise the plugin. + * @function + * @name $.fn.swipe#destroy + * @example $("#element").swipe("destroy"); + */ + this.destroy = function() { + removeListeners(); + $element.data(PLUGIN_NS, null); + $element = null; + }; + + + /** + * Allows run time updating of the swipe configuration options. + * @function + * @name $.fn.swipe#option + * @param {String} property The option property to get or set, or a has of multiple options to set + * @param {Object} [value] The value to set the property to + * @return {Object} If only a property name is passed, then that property value is returned. If nothing is passed the current options hash is returned. + * @example $("#element").swipe("option", "threshold"); // return the threshold + * @example $("#element").swipe("option", "threshold", 100); // set the threshold after init + * @example $("#element").swipe("option", {threshold:100, fingers:3} ); // set multiple properties after init + * @example $("#element").swipe({threshold:100, fingers:3} ); // set multiple properties after init - the "option" method is optional! + * @example $("#element").swipe("option"); // Return the current options hash + * @see $.fn.swipe.defaults + * + */ + this.option = function(property, value) { + + if (typeof property === 'object') { + options = $.extend(options, property); + } else if (options[property] !== undefined) { + if (value === undefined) { + return options[property]; + } else { + options[property] = value; + } + } else if (!property) { + return options; + } else { + $.error('Option ' + property + ' does not exist on jQuery.swipe.options'); + } + + return null; + } + + + + // + // Private methods + // + + // + // EVENTS + // + /** + * Event handler for a touch start event. + * Stops the default click event from triggering and stores where we touched + * @inner + * @param {object} jqEvent The normalised jQuery event object. + */ + function touchStart(jqEvent) { + + //If we already in a touch event (a finger already in use) then ignore subsequent ones.. + if (getTouchInProgress()) { + return; + } + + //Check if this element matches any in the excluded elements selectors, or its parent is excluded, if so, DON'T swipe + if ($(jqEvent.target).closest(options.excludedElements, $element).length > 0) { + return; + } + + //As we use Jquery bind for events, we need to target the original event object + //If these events are being programmatically triggered, we don't have an original event object, so use the Jq one. + var event = jqEvent.originalEvent ? jqEvent.originalEvent : jqEvent; + + + //If we have a pointer event, whoes type is 'mouse' and we have said NO mouse events, then dont do anything. + if(event.pointerType && event.pointerType=="mouse" && options.fallbackToMouseEvents==false) { + return; + }; + + var ret, + touches = event.touches, + evt = touches ? touches[0] : event; + + phase = PHASE_START; + + //If we support touches, get the finger count + if (touches) { + // get the total number of fingers touching the screen + fingerCount = touches.length; + } + //Else this is the desktop, so stop the browser from dragging content + else if (options.preventDefaultEvents !== false) { + jqEvent.preventDefault(); //call this on jq event so we are cross browser + } + + //clear vars.. + distance = 0; + direction = null; + currentDirection=null; + pinchDirection = null; + duration = 0; + startTouchesDistance = 0; + endTouchesDistance = 0; + pinchZoom = 1; + pinchDistance = 0; + maximumsMap = createMaximumsData(); + cancelMultiFingerRelease(); + + //Create the default finger data + createFingerData(0, evt); + + // check the number of fingers is what we are looking for, or we are capturing pinches + if (!touches || (fingerCount === options.fingers || options.fingers === ALL_FINGERS) || hasPinches()) { + // get the coordinates of the touch + startTime = getTimeStamp(); + + if (fingerCount == 2) { + //Keep track of the initial pinch distance, so we can calculate the diff later + //Store second finger data as start + createFingerData(1, touches[1]); + startTouchesDistance = endTouchesDistance = calculateTouchesDistance(fingerData[0].start, fingerData[1].start); + } + + if (options.swipeStatus || options.pinchStatus) { + ret = triggerHandler(event, phase); + } + } else { + //A touch with more or less than the fingers we are looking for, so cancel + ret = false; + } + + //If we have a return value from the users handler, then return and cancel + if (ret === false) { + phase = PHASE_CANCEL; + triggerHandler(event, phase); + return ret; + } else { + if (options.hold) { + holdTimeout = setTimeout($.proxy(function() { + //Trigger the event + $element.trigger('hold', [event.target]); + //Fire the callback + if (options.hold) { + ret = options.hold.call($element, event, event.target); + } + }, this), options.longTapThreshold); + } + + setTouchInProgress(true); + } + + return null; + }; + + + + /** + * Event handler for a touch move event. + * If we change fingers during move, then cancel the event + * @inner + * @param {object} jqEvent The normalised jQuery event object. + */ + function touchMove(jqEvent) { + + //As we use Jquery bind for events, we need to target the original event object + //If these events are being programmatically triggered, we don't have an original event object, so use the Jq one. + var event = jqEvent.originalEvent ? jqEvent.originalEvent : jqEvent; + + //If we are ending, cancelling, or within the threshold of 2 fingers being released, don't track anything.. + if (phase === PHASE_END || phase === PHASE_CANCEL || inMultiFingerRelease()) + return; + + var ret, + touches = event.touches, + evt = touches ? touches[0] : event; + + + //Update the finger data + var currentFinger = updateFingerData(evt); + endTime = getTimeStamp(); + + if (touches) { + fingerCount = touches.length; + } + + if (options.hold) { + clearTimeout(holdTimeout); + } + + phase = PHASE_MOVE; + + //If we have 2 fingers get Touches distance as well + if (fingerCount == 2) { + + //Keep track of the initial pinch distance, so we can calculate the diff later + //We do this here as well as the start event, in case they start with 1 finger, and the press 2 fingers + if (startTouchesDistance == 0) { + //Create second finger if this is the first time... + createFingerData(1, touches[1]); + + startTouchesDistance = endTouchesDistance = calculateTouchesDistance(fingerData[0].start, fingerData[1].start); + } else { + //Else just update the second finger + updateFingerData(touches[1]); + + endTouchesDistance = calculateTouchesDistance(fingerData[0].end, fingerData[1].end); + pinchDirection = calculatePinchDirection(fingerData[0].end, fingerData[1].end); + } + + pinchZoom = calculatePinchZoom(startTouchesDistance, endTouchesDistance); + pinchDistance = Math.abs(startTouchesDistance - endTouchesDistance); + } + + if ((fingerCount === options.fingers || options.fingers === ALL_FINGERS) || !touches || hasPinches()) { + + //The overall direction of the swipe. From start to now. + direction = calculateDirection(currentFinger.start, currentFinger.end); + + //The immediate direction of the swipe, direction between the last movement and this one. + currentDirection = calculateDirection(currentFinger.last, currentFinger.end); + + //Check if we need to prevent default event (page scroll / pinch zoom) or not + validateDefaultEvent(jqEvent, currentDirection); + + //Distance and duration are all off the main finger + distance = calculateDistance(currentFinger.start, currentFinger.end); + duration = calculateDuration(); + + //Cache the maximum distance we made in this direction + setMaxDistance(direction, distance); + + //Trigger status handler + ret = triggerHandler(event, phase); + + + //If we trigger end events when threshold are met, or trigger events when touch leaves element + if (!options.triggerOnTouchEnd || options.triggerOnTouchLeave) { + + var inBounds = true; + + //If checking if we leave the element, run the bounds check (we can use touchleave as its not supported on webkit) + if (options.triggerOnTouchLeave) { + var bounds = getbounds(this); + inBounds = isInBounds(currentFinger.end, bounds); + } + + //Trigger end handles as we swipe if thresholds met or if we have left the element if the user has asked to check these.. + if (!options.triggerOnTouchEnd && inBounds) { + phase = getNextPhase(PHASE_MOVE); + } + //We end if out of bounds here, so set current phase to END, and check if its modified + else if (options.triggerOnTouchLeave && !inBounds) { + phase = getNextPhase(PHASE_END); + } + + if (phase == PHASE_CANCEL || phase == PHASE_END) { + triggerHandler(event, phase); + } + } + } else { + phase = PHASE_CANCEL; + triggerHandler(event, phase); + } + + if (ret === false) { + phase = PHASE_CANCEL; + triggerHandler(event, phase); + } + } + + + + + /** + * Event handler for a touch end event. + * Calculate the direction and trigger events + * @inner + * @param {object} jqEvent The normalised jQuery event object. + */ + function touchEnd(jqEvent) { + //As we use Jquery bind for events, we need to target the original event object + //If these events are being programmatically triggered, we don't have an original event object, so use the Jq one. + var event = jqEvent.originalEvent ? jqEvent.originalEvent : jqEvent, + touches = event.touches; + + //If we are still in a touch with the device wait a fraction and see if the other finger comes up + //if it does within the threshold, then we treat it as a multi release, not a single release and end the touch / swipe + if (touches) { + if (touches.length && !inMultiFingerRelease()) { + startMultiFingerRelease(event); + return true; + } else if (touches.length && inMultiFingerRelease()) { + return true; + } + } + + //If a previous finger has been released, check how long ago, if within the threshold, then assume it was a multifinger release. + //This is used to allow 2 fingers to release fractionally after each other, whilst maintaining the event as containing 2 fingers, not 1 + if (inMultiFingerRelease()) { + fingerCount = fingerCountAtRelease; + } + + //Set end of swipe + endTime = getTimeStamp(); + + //Get duration incase move was never fired + duration = calculateDuration(); + + //If we trigger handlers at end of swipe OR, we trigger during, but they didnt trigger and we are still in the move phase + if (didSwipeBackToCancel() || !validateSwipeDistance()) { + phase = PHASE_CANCEL; + triggerHandler(event, phase); + } else if (options.triggerOnTouchEnd || (options.triggerOnTouchEnd === false && phase === PHASE_MOVE)) { + //call this on jq event so we are cross browser + if (options.preventDefaultEvents !== false) { + jqEvent.preventDefault(); + } + phase = PHASE_END; + triggerHandler(event, phase); + } + //Special cases - A tap should always fire on touch end regardless, + //So here we manually trigger the tap end handler by itself + //We dont run trigger handler as it will re-trigger events that may have fired already + else if (!options.triggerOnTouchEnd && hasTap()) { + //Trigger the pinch events... + phase = PHASE_END; + triggerHandlerForGesture(event, phase, TAP); + } else if (phase === PHASE_MOVE) { + phase = PHASE_CANCEL; + triggerHandler(event, phase); + } + + setTouchInProgress(false); + + return null; + } + + + + /** + * Event handler for a touch cancel event. + * Clears current vars + * @inner + */ + function touchCancel() { + // reset the variables back to default values + fingerCount = 0; + endTime = 0; + startTime = 0; + startTouchesDistance = 0; + endTouchesDistance = 0; + pinchZoom = 1; + + //If we were in progress of tracking a possible multi touch end, then re set it. + cancelMultiFingerRelease(); + + setTouchInProgress(false); + } + + + /** + * Event handler for a touch leave event. + * This is only triggered on desktops, in touch we work this out manually + * as the touchleave event is not supported in webkit + * @inner + */ + function touchLeave(jqEvent) { + //If these events are being programmatically triggered, we don't have an original event object, so use the Jq one. + var event = jqEvent.originalEvent ? jqEvent.originalEvent : jqEvent; + + //If we have the trigger on leave property set.... + if (options.triggerOnTouchLeave) { + phase = getNextPhase(PHASE_END); + triggerHandler(event, phase); + } + } + + /** + * Removes all listeners that were associated with the plugin + * @inner + */ + function removeListeners() { + $element.unbind(START_EV, touchStart); + $element.unbind(CANCEL_EV, touchCancel); + $element.unbind(MOVE_EV, touchMove); + $element.unbind(END_EV, touchEnd); + + //we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit + if (LEAVE_EV) { + $element.unbind(LEAVE_EV, touchLeave); + } + + setTouchInProgress(false); + } + + + /** + * Checks if the time and distance thresholds have been met, and if so then the appropriate handlers are fired. + */ + function getNextPhase(currentPhase) { + + var nextPhase = currentPhase; + + // Ensure we have valid swipe (under time and over distance and check if we are out of bound...) + var validTime = validateSwipeTime(); + var validDistance = validateSwipeDistance(); + var didCancel = didSwipeBackToCancel(); + + //If we have exceeded our time, then cancel + if (!validTime || didCancel) { + nextPhase = PHASE_CANCEL; + } + //Else if we are moving, and have reached distance then end + else if (validDistance && currentPhase == PHASE_MOVE && (!options.triggerOnTouchEnd || options.triggerOnTouchLeave)) { + nextPhase = PHASE_END; + } + //Else if we have ended by leaving and didn't reach distance, then cancel + else if (!validDistance && currentPhase == PHASE_END && options.triggerOnTouchLeave) { + nextPhase = PHASE_CANCEL; + } + + return nextPhase; + } + + + /** + * Trigger the relevant event handler + * The handlers are passed the original event, the element that was swiped, and in the case of the catch all handler, the direction that was swiped, "left", "right", "up", or "down" + * @param {object} event the original event object + * @param {string} phase the phase of the swipe (start, end cancel etc) {@link $.fn.swipe.phases} + * @inner + */ + function triggerHandler(event, phase) { + + + + var ret, + touches = event.touches; + + // SWIPE GESTURES + if (didSwipe() || hasSwipes()) { + ret = triggerHandlerForGesture(event, phase, SWIPE); + } + + // PINCH GESTURES (if the above didn't cancel) + if ((didPinch() || hasPinches()) && ret !== false) { + ret = triggerHandlerForGesture(event, phase, PINCH); + } + + // CLICK / TAP (if the above didn't cancel) + if (didDoubleTap() && ret !== false) { + //Trigger the tap events... + ret = triggerHandlerForGesture(event, phase, DOUBLE_TAP); + } + + // CLICK / TAP (if the above didn't cancel) + else if (didLongTap() && ret !== false) { + //Trigger the tap events... + ret = triggerHandlerForGesture(event, phase, LONG_TAP); + } + + // CLICK / TAP (if the above didn't cancel) + else if (didTap() && ret !== false) { + //Trigger the tap event.. + ret = triggerHandlerForGesture(event, phase, TAP); + } + + + + // If we are cancelling the gesture, then manually trigger the reset handler + if (phase === PHASE_CANCEL) { + + touchCancel(event); + } + + + + + // If we are ending the gesture, then manually trigger the reset handler IF all fingers are off + if (phase === PHASE_END) { + //If we support touch, then check that all fingers are off before we cancel + if (touches) { + if (!touches.length) { + touchCancel(event); + } + } else { + touchCancel(event); + } + } + + return ret; + } + + + + /** + * Trigger the relevant event handler + * The handlers are passed the original event, the element that was swiped, and in the case of the catch all handler, the direction that was swiped, "left", "right", "up", or "down" + * @param {object} event the original event object + * @param {string} phase the phase of the swipe (start, end cancel etc) {@link $.fn.swipe.phases} + * @param {string} gesture the gesture to trigger a handler for : PINCH or SWIPE {@link $.fn.swipe.gestures} + * @return Boolean False, to indicate that the event should stop propagation, or void. + * @inner + */ + function triggerHandlerForGesture(event, phase, gesture) { + + var ret; + + //SWIPES.... + if (gesture == SWIPE) { + //Trigger status every time.. + $element.trigger('swipeStatus', [phase, direction || null, distance || 0, duration || 0, fingerCount, fingerData, currentDirection]); + + if (options.swipeStatus) { + ret = options.swipeStatus.call($element, event, phase, direction || null, distance || 0, duration || 0, fingerCount, fingerData, currentDirection); + //If the status cancels, then dont run the subsequent event handlers.. + if (ret === false) return false; + } + + if (phase == PHASE_END && validateSwipe()) { + + //Cancel any taps that were in progress... + clearTimeout(singleTapTimeout); + clearTimeout(holdTimeout); + + $element.trigger('swipe', [direction, distance, duration, fingerCount, fingerData, currentDirection]); + + if (options.swipe) { + ret = options.swipe.call($element, event, direction, distance, duration, fingerCount, fingerData, currentDirection); + //If the status cancels, then dont run the subsequent event handlers.. + if (ret === false) return false; + } + + //trigger direction specific event handlers + switch (direction) { + case LEFT: + $element.trigger('swipeLeft', [direction, distance, duration, fingerCount, fingerData, currentDirection]); + + if (options.swipeLeft) { + ret = options.swipeLeft.call($element, event, direction, distance, duration, fingerCount, fingerData, currentDirection); + } + break; + + case RIGHT: + $element.trigger('swipeRight', [direction, distance, duration, fingerCount, fingerData, currentDirection]); + + if (options.swipeRight) { + ret = options.swipeRight.call($element, event, direction, distance, duration, fingerCount, fingerData, currentDirection); + } + break; + + case UP: + $element.trigger('swipeUp', [direction, distance, duration, fingerCount, fingerData, currentDirection]); + + if (options.swipeUp) { + ret = options.swipeUp.call($element, event, direction, distance, duration, fingerCount, fingerData, currentDirection); + } + break; + + case DOWN: + $element.trigger('swipeDown', [direction, distance, duration, fingerCount, fingerData, currentDirection]); + + if (options.swipeDown) { + ret = options.swipeDown.call($element, event, direction, distance, duration, fingerCount, fingerData, currentDirection); + } + break; + } + } + } + + + //PINCHES.... + if (gesture == PINCH) { + $element.trigger('pinchStatus', [phase, pinchDirection || null, pinchDistance || 0, duration || 0, fingerCount, pinchZoom, fingerData]); + + if (options.pinchStatus) { + ret = options.pinchStatus.call($element, event, phase, pinchDirection || null, pinchDistance || 0, duration || 0, fingerCount, pinchZoom, fingerData); + //If the status cancels, then dont run the subsequent event handlers.. + if (ret === false) return false; + } + + if (phase == PHASE_END && validatePinch()) { + + switch (pinchDirection) { + case IN: + $element.trigger('pinchIn', [pinchDirection || null, pinchDistance || 0, duration || 0, fingerCount, pinchZoom, fingerData]); + + if (options.pinchIn) { + ret = options.pinchIn.call($element, event, pinchDirection || null, pinchDistance || 0, duration || 0, fingerCount, pinchZoom, fingerData); + } + break; + + case OUT: + $element.trigger('pinchOut', [pinchDirection || null, pinchDistance || 0, duration || 0, fingerCount, pinchZoom, fingerData]); + + if (options.pinchOut) { + ret = options.pinchOut.call($element, event, pinchDirection || null, pinchDistance || 0, duration || 0, fingerCount, pinchZoom, fingerData); + } + break; + } + } + } + + if (gesture == TAP) { + if (phase === PHASE_CANCEL || phase === PHASE_END) { + + clearTimeout(singleTapTimeout); + clearTimeout(holdTimeout); + + //If we are also looking for doubelTaps, wait incase this is one... + if (hasDoubleTap() && !inDoubleTap()) { + doubleTapStartTime = getTimeStamp(); + + //Now wait for the double tap timeout, and trigger this single tap + //if its not cancelled by a double tap + singleTapTimeout = setTimeout($.proxy(function() { + doubleTapStartTime = null; + $element.trigger('tap', [event.target]); + + if (options.tap) { + ret = options.tap.call($element, event, event.target); + } + }, this), options.doubleTapThreshold); + + } else { + doubleTapStartTime = null; + $element.trigger('tap', [event.target]); + if (options.tap) { + ret = options.tap.call($element, event, event.target); + } + } + } + } else if (gesture == DOUBLE_TAP) { + if (phase === PHASE_CANCEL || phase === PHASE_END) { + clearTimeout(singleTapTimeout); + clearTimeout(holdTimeout); + doubleTapStartTime = null; + $element.trigger('doubletap', [event.target]); + + if (options.doubleTap) { + ret = options.doubleTap.call($element, event, event.target); + } + } + } else if (gesture == LONG_TAP) { + if (phase === PHASE_CANCEL || phase === PHASE_END) { + clearTimeout(singleTapTimeout); + doubleTapStartTime = null; + + $element.trigger('longtap', [event.target]); + if (options.longTap) { + ret = options.longTap.call($element, event, event.target); + } + } + } + + return ret; + } + + + // + // GESTURE VALIDATION + // + + /** + * Checks the user has swipe far enough + * @return Boolean if threshold has been set, return true if the threshold was met, else false. + * If no threshold was set, then we return true. + * @inner + */ + function validateSwipeDistance() { + var valid = true; + //If we made it past the min swipe distance.. + if (options.threshold !== null) { + valid = distance >= options.threshold; + } + + return valid; + } + + /** + * Checks the user has swiped back to cancel. + * @return Boolean if cancelThreshold has been set, return true if the cancelThreshold was met, else false. + * If no cancelThreshold was set, then we return true. + * @inner + */ + function didSwipeBackToCancel() { + var cancelled = false; + if (options.cancelThreshold !== null && direction !== null) { + cancelled = (getMaxDistance(direction) - distance) >= options.cancelThreshold; + } + + return cancelled; + } + + /** + * Checks the user has pinched far enough + * @return Boolean if pinchThreshold has been set, return true if the threshold was met, else false. + * If no threshold was set, then we return true. + * @inner + */ + function validatePinchDistance() { + if (options.pinchThreshold !== null) { + return pinchDistance >= options.pinchThreshold; + } + return true; + } + + /** + * Checks that the time taken to swipe meets the minimum / maximum requirements + * @return Boolean + * @inner + */ + function validateSwipeTime() { + var result; + //If no time set, then return true + if (options.maxTimeThreshold) { + if (duration >= options.maxTimeThreshold) { + result = false; + } else { + result = true; + } + } else { + result = true; + } + + return result; + } + + + /** + * Checks direction of the swipe and the value allowPageScroll to see if we should allow or prevent the default behaviour from occurring. + * This will essentially allow page scrolling or not when the user is swiping on a touchSwipe object. + * @param {object} jqEvent The normalised jQuery representation of the event object. + * @param {string} direction The direction of the event. See {@link $.fn.swipe.directions} + * @see $.fn.swipe.directions + * @inner + */ + function validateDefaultEvent(jqEvent, direction) { + + //If the option is set, allways allow the event to bubble up (let user handle weirdness) + if (options.preventDefaultEvents === false) { + return; + } + + if (options.allowPageScroll === NONE) { + jqEvent.preventDefault(); + } else { + var auto = options.allowPageScroll === AUTO; + + switch (direction) { + case LEFT: + if ((options.swipeLeft && auto) || (!auto && options.allowPageScroll != HORIZONTAL)) { + jqEvent.preventDefault(); + } + break; + + case RIGHT: + if ((options.swipeRight && auto) || (!auto && options.allowPageScroll != HORIZONTAL)) { + jqEvent.preventDefault(); + } + break; + + case UP: + if ((options.swipeUp && auto) || (!auto && options.allowPageScroll != VERTICAL)) { + jqEvent.preventDefault(); + } + break; + + case DOWN: + if ((options.swipeDown && auto) || (!auto && options.allowPageScroll != VERTICAL)) { + jqEvent.preventDefault(); + } + break; + + case NONE: + + break; + } + } + } + + + // PINCHES + /** + * Returns true of the current pinch meets the thresholds + * @return Boolean + * @inner + */ + function validatePinch() { + var hasCorrectFingerCount = validateFingers(); + var hasEndPoint = validateEndPoint(); + var hasCorrectDistance = validatePinchDistance(); + return hasCorrectFingerCount && hasEndPoint && hasCorrectDistance; + + } + + /** + * Returns true if any Pinch events have been registered + * @return Boolean + * @inner + */ + function hasPinches() { + //Enure we dont return 0 or null for false values + return !!(options.pinchStatus || options.pinchIn || options.pinchOut); + } + + /** + * Returns true if we are detecting pinches, and have one + * @return Boolean + * @inner + */ + function didPinch() { + //Enure we dont return 0 or null for false values + return !!(validatePinch() && hasPinches()); + } + + + + + // SWIPES + /** + * Returns true if the current swipe meets the thresholds + * @return Boolean + * @inner + */ + function validateSwipe() { + //Check validity of swipe + var hasValidTime = validateSwipeTime(); + var hasValidDistance = validateSwipeDistance(); + var hasCorrectFingerCount = validateFingers(); + var hasEndPoint = validateEndPoint(); + var didCancel = didSwipeBackToCancel(); + + // if the user swiped more than the minimum length, perform the appropriate action + // hasValidDistance is null when no distance is set + var valid = !didCancel && hasEndPoint && hasCorrectFingerCount && hasValidDistance && hasValidTime; + + return valid; + } + + /** + * Returns true if any Swipe events have been registered + * @return Boolean + * @inner + */ + function hasSwipes() { + //Enure we dont return 0 or null for false values + return !!(options.swipe || options.swipeStatus || options.swipeLeft || options.swipeRight || options.swipeUp || options.swipeDown); + } + + + /** + * Returns true if we are detecting swipes and have one + * @return Boolean + * @inner + */ + function didSwipe() { + //Enure we dont return 0 or null for false values + return !!(validateSwipe() && hasSwipes()); + } + + /** + * Returns true if we have matched the number of fingers we are looking for + * @return Boolean + * @inner + */ + function validateFingers() { + //The number of fingers we want were matched, or on desktop we ignore + return ((fingerCount === options.fingers || options.fingers === ALL_FINGERS) || !SUPPORTS_TOUCH); + } + + /** + * Returns true if we have an end point for the swipe + * @return Boolean + * @inner + */ + function validateEndPoint() { + //We have an end value for the finger + return fingerData[0].end.x !== 0; + } + + // TAP / CLICK + /** + * Returns true if a click / tap events have been registered + * @return Boolean + * @inner + */ + function hasTap() { + //Enure we dont return 0 or null for false values + return !!(options.tap); + } + + /** + * Returns true if a double tap events have been registered + * @return Boolean + * @inner + */ + function hasDoubleTap() { + //Enure we dont return 0 or null for false values + return !!(options.doubleTap); + } + + /** + * Returns true if any long tap events have been registered + * @return Boolean + * @inner + */ + function hasLongTap() { + //Enure we dont return 0 or null for false values + return !!(options.longTap); + } + + /** + * Returns true if we could be in the process of a double tap (one tap has occurred, we are listening for double taps, and the threshold hasn't past. + * @return Boolean + * @inner + */ + function validateDoubleTap() { + if (doubleTapStartTime == null) { + return false; + } + var now = getTimeStamp(); + return (hasDoubleTap() && ((now - doubleTapStartTime) <= options.doubleTapThreshold)); + } + + /** + * Returns true if we could be in the process of a double tap (one tap has occurred, we are listening for double taps, and the threshold hasn't past. + * @return Boolean + * @inner + */ + function inDoubleTap() { + return validateDoubleTap(); + } + + + /** + * Returns true if we have a valid tap + * @return Boolean + * @inner + */ + function validateTap() { + return ((fingerCount === 1 || !SUPPORTS_TOUCH) && (isNaN(distance) || distance < options.threshold)); + } + + /** + * Returns true if we have a valid long tap + * @return Boolean + * @inner + */ + function validateLongTap() { + //slight threshold on moving finger + return ((duration > options.longTapThreshold) && (distance < DOUBLE_TAP_THRESHOLD)); + } + + /** + * Returns true if we are detecting taps and have one + * @return Boolean + * @inner + */ + function didTap() { + //Enure we dont return 0 or null for false values + return !!(validateTap() && hasTap()); + } + + + /** + * Returns true if we are detecting double taps and have one + * @return Boolean + * @inner + */ + function didDoubleTap() { + //Enure we dont return 0 or null for false values + return !!(validateDoubleTap() && hasDoubleTap()); + } + + /** + * Returns true if we are detecting long taps and have one + * @return Boolean + * @inner + */ + function didLongTap() { + //Enure we dont return 0 or null for false values + return !!(validateLongTap() && hasLongTap()); + } + + + + + // MULTI FINGER TOUCH + /** + * Starts tracking the time between 2 finger releases, and keeps track of how many fingers we initially had up + * @inner + */ + function startMultiFingerRelease(event) { + previousTouchEndTime = getTimeStamp(); + fingerCountAtRelease = event.touches.length + 1; + } + + /** + * Cancels the tracking of time between 2 finger releases, and resets counters + * @inner + */ + function cancelMultiFingerRelease() { + previousTouchEndTime = 0; + fingerCountAtRelease = 0; + } + + /** + * Checks if we are in the threshold between 2 fingers being released + * @return Boolean + * @inner + */ + function inMultiFingerRelease() { + + var withinThreshold = false; + + if (previousTouchEndTime) { + var diff = getTimeStamp() - previousTouchEndTime + if (diff <= options.fingerReleaseThreshold) { + withinThreshold = true; + } + } + + return withinThreshold; + } + + + /** + * gets a data flag to indicate that a touch is in progress + * @return Boolean + * @inner + */ + function getTouchInProgress() { + //strict equality to ensure only true and false are returned + return !!($element.data(PLUGIN_NS + '_intouch') === true); + } + + /** + * Sets a data flag to indicate that a touch is in progress + * @param {boolean} val The value to set the property to + * @inner + */ + function setTouchInProgress(val) { + + //If destroy is called in an event handler, we have no el, and we have already cleaned up, so return. + if(!$element) { return; } + + //Add or remove event listeners depending on touch status + if (val === true) { + $element.bind(MOVE_EV, touchMove); + $element.bind(END_EV, touchEnd); + + //we only have leave events on desktop, we manually calcuate leave on touch as its not supported in webkit + if (LEAVE_EV) { + $element.bind(LEAVE_EV, touchLeave); + } + } else { + + $element.unbind(MOVE_EV, touchMove, false); + $element.unbind(END_EV, touchEnd, false); + + //we only have leave events on desktop, we manually calcuate leave on touch as its not supported in webkit + if (LEAVE_EV) { + $element.unbind(LEAVE_EV, touchLeave, false); + } + } + + + //strict equality to ensure only true and false can update the value + $element.data(PLUGIN_NS + '_intouch', val === true); + } + + + /** + * Creates the finger data for the touch/finger in the event object. + * @param {int} id The id to store the finger data under (usually the order the fingers were pressed) + * @param {object} evt The event object containing finger data + * @return finger data object + * @inner + */ + function createFingerData(id, evt) { + var f = { + start: { + x: 0, + y: 0 + }, + last: { + x: 0, + y: 0 + }, + end: { + x: 0, + y: 0 + } + }; + f.start.x = f.last.x = f.end.x = evt.pageX || evt.clientX; + f.start.y = f.last.y = f.end.y = evt.pageY || evt.clientY; + fingerData[id] = f; + return f; + } + + /** + * Updates the finger data for a particular event object + * @param {object} evt The event object containing the touch/finger data to upadte + * @return a finger data object. + * @inner + */ + function updateFingerData(evt) { + var id = evt.identifier !== undefined ? evt.identifier : 0; + var f = getFingerData(id); + + if (f === null) { + f = createFingerData(id, evt); + } + + f.last.x = f.end.x; + f.last.y = f.end.y; + + f.end.x = evt.pageX || evt.clientX; + f.end.y = evt.pageY || evt.clientY; + + return f; + } + + /** + * Returns a finger data object by its event ID. + * Each touch event has an identifier property, which is used + * to track repeat touches + * @param {int} id The unique id of the finger in the sequence of touch events. + * @return a finger data object. + * @inner + */ + function getFingerData(id) { + return fingerData[id] || null; + } + + + /** + * Sets the maximum distance swiped in the given direction. + * If the new value is lower than the current value, the max value is not changed. + * @param {string} direction The direction of the swipe + * @param {int} distance The distance of the swipe + * @inner + */ + function setMaxDistance(direction, distance) { + if(direction==NONE) return; + distance = Math.max(distance, getMaxDistance(direction)); + maximumsMap[direction].distance = distance; + } + + /** + * gets the maximum distance swiped in the given direction. + * @param {string} direction The direction of the swipe + * @return int The distance of the swipe + * @inner + */ + function getMaxDistance(direction) { + if (maximumsMap[direction]) return maximumsMap[direction].distance; + return undefined; + } + + /** + * Creats a map of directions to maximum swiped values. + * @return Object A dictionary of maximum values, indexed by direction. + * @inner + */ + function createMaximumsData() { + var maxData = {}; + maxData[LEFT] = createMaximumVO(LEFT); + maxData[RIGHT] = createMaximumVO(RIGHT); + maxData[UP] = createMaximumVO(UP); + maxData[DOWN] = createMaximumVO(DOWN); + + return maxData; + } + + /** + * Creates a map maximum swiped values for a given swipe direction + * @param {string} The direction that these values will be associated with + * @return Object Maximum values + * @inner + */ + function createMaximumVO(dir) { + return { + direction: dir, + distance: 0 + } + } + + + // + // MATHS / UTILS + // + + /** + * Calculate the duration of the swipe + * @return int + * @inner + */ + function calculateDuration() { + return endTime - startTime; + } + + /** + * Calculate the distance between 2 touches (pinch) + * @param {point} startPoint A point object containing x and y co-ordinates + * @param {point} endPoint A point object containing x and y co-ordinates + * @return int; + * @inner + */ + function calculateTouchesDistance(startPoint, endPoint) { + var diffX = Math.abs(startPoint.x - endPoint.x); + var diffY = Math.abs(startPoint.y - endPoint.y); + + return Math.round(Math.sqrt(diffX * diffX + diffY * diffY)); + } + + /** + * Calculate the zoom factor between the start and end distances + * @param {int} startDistance Distance (between 2 fingers) the user started pinching at + * @param {int} endDistance Distance (between 2 fingers) the user ended pinching at + * @return float The zoom value from 0 to 1. + * @inner + */ + function calculatePinchZoom(startDistance, endDistance) { + var percent = (endDistance / startDistance) * 1; + return percent.toFixed(2); + } + + + /** + * Returns the pinch direction, either IN or OUT for the given points + * @return string Either {@link $.fn.swipe.directions.IN} or {@link $.fn.swipe.directions.OUT} + * @see $.fn.swipe.directions + * @inner + */ + function calculatePinchDirection() { + if (pinchZoom < 1) { + return OUT; + } else { + return IN; + } + } + + + /** + * Calculate the length / distance of the swipe + * @param {point} startPoint A point object containing x and y co-ordinates + * @param {point} endPoint A point object containing x and y co-ordinates + * @return int + * @inner + */ + function calculateDistance(startPoint, endPoint) { + return Math.round(Math.sqrt(Math.pow(endPoint.x - startPoint.x, 2) + Math.pow(endPoint.y - startPoint.y, 2))); + } + + /** + * Calculate the angle of the swipe + * @param {point} startPoint A point object containing x and y co-ordinates + * @param {point} endPoint A point object containing x and y co-ordinates + * @return int + * @inner + */ + function calculateAngle(startPoint, endPoint) { + var x = startPoint.x - endPoint.x; + var y = endPoint.y - startPoint.y; + var r = Math.atan2(y, x); //radians + var angle = Math.round(r * 180 / Math.PI); //degrees + + //ensure value is positive + if (angle < 0) { + angle = 360 - Math.abs(angle); + } + + return angle; + } + + /** + * Calculate the direction of the swipe + * This will also call calculateAngle to get the latest angle of swipe + * @param {point} startPoint A point object containing x and y co-ordinates + * @param {point} endPoint A point object containing x and y co-ordinates + * @return string Either {@link $.fn.swipe.directions.LEFT} / {@link $.fn.swipe.directions.RIGHT} / {@link $.fn.swipe.directions.DOWN} / {@link $.fn.swipe.directions.UP} + * @see $.fn.swipe.directions + * @inner + */ + function calculateDirection(startPoint, endPoint) { + + if( comparePoints(startPoint, endPoint) ) { + return NONE; + } + + var angle = calculateAngle(startPoint, endPoint); + + if ((angle <= 45) && (angle >= 0)) { + return LEFT; + } else if ((angle <= 360) && (angle >= 315)) { + return LEFT; + } else if ((angle >= 135) && (angle <= 225)) { + return RIGHT; + } else if ((angle > 45) && (angle < 135)) { + return DOWN; + } else { + return UP; + } + } + + + /** + * Returns a MS time stamp of the current time + * @return int + * @inner + */ + function getTimeStamp() { + var now = new Date(); + return now.getTime(); + } + + + + /** + * Returns a bounds object with left, right, top and bottom properties for the element specified. + * @param {DomNode} The DOM node to get the bounds for. + */ + function getbounds(el) { + el = $(el); + var offset = el.offset(); + + var bounds = { + left: offset.left, + right: offset.left + el.outerWidth(), + top: offset.top, + bottom: offset.top + el.outerHeight() + } + + return bounds; + } + + + /** + * Checks if the point object is in the bounds object. + * @param {object} point A point object. + * @param {int} point.x The x value of the point. + * @param {int} point.y The x value of the point. + * @param {object} bounds The bounds object to test + * @param {int} bounds.left The leftmost value + * @param {int} bounds.right The righttmost value + * @param {int} bounds.top The topmost value + * @param {int} bounds.bottom The bottommost value + */ + function isInBounds(point, bounds) { + return (point.x > bounds.left && point.x < bounds.right && point.y > bounds.top && point.y < bounds.bottom); + }; + + /** + * Checks if the two points are equal + * @param {object} point A point object. + * @param {object} point B point object. + * @return true of the points match + */ + function comparePoints(pointA, pointB) { + return (pointA.x == pointB.x && pointA.y == pointB.y); + } + + + } + + + + + /** + * A catch all handler that is triggered for all swipe directions. + * @name $.fn.swipe#swipe + * @event + * @default null + * @param {EventObject} event The original event object + * @param {int} direction The direction the user swiped in. See {@link $.fn.swipe.directions} + * @param {int} distance The distance the user swiped + * @param {int} duration The duration of the swipe in milliseconds + * @param {int} fingerCount The number of fingers used. See {@link $.fn.swipe.fingers} + * @param {object} fingerData The coordinates of fingers in event + * @param {string} currentDirection The current direction the user is swiping. + */ + + + + + /** + * A handler that is triggered for "left" swipes. + * @name $.fn.swipe#swipeLeft + * @event + * @default null + * @param {EventObject} event The original event object + * @param {int} direction The direction the user swiped in. See {@link $.fn.swipe.directions} + * @param {int} distance The distance the user swiped + * @param {int} duration The duration of the swipe in milliseconds + * @param {int} fingerCount The number of fingers used. See {@link $.fn.swipe.fingers} + * @param {object} fingerData The coordinates of fingers in event + * @param {string} currentDirection The current direction the user is swiping. + */ + + /** + * A handler that is triggered for "right" swipes. + * @name $.fn.swipe#swipeRight + * @event + * @default null + * @param {EventObject} event The original event object + * @param {int} direction The direction the user swiped in. See {@link $.fn.swipe.directions} + * @param {int} distance The distance the user swiped + * @param {int} duration The duration of the swipe in milliseconds + * @param {int} fingerCount The number of fingers used. See {@link $.fn.swipe.fingers} + * @param {object} fingerData The coordinates of fingers in event + * @param {string} currentDirection The current direction the user is swiping. + */ + + /** + * A handler that is triggered for "up" swipes. + * @name $.fn.swipe#swipeUp + * @event + * @default null + * @param {EventObject} event The original event object + * @param {int} direction The direction the user swiped in. See {@link $.fn.swipe.directions} + * @param {int} distance The distance the user swiped + * @param {int} duration The duration of the swipe in milliseconds + * @param {int} fingerCount The number of fingers used. See {@link $.fn.swipe.fingers} + * @param {object} fingerData The coordinates of fingers in event + * @param {string} currentDirection The current direction the user is swiping. + */ + + /** + * A handler that is triggered for "down" swipes. + * @name $.fn.swipe#swipeDown + * @event + * @default null + * @param {EventObject} event The original event object + * @param {int} direction The direction the user swiped in. See {@link $.fn.swipe.directions} + * @param {int} distance The distance the user swiped + * @param {int} duration The duration of the swipe in milliseconds + * @param {int} fingerCount The number of fingers used. See {@link $.fn.swipe.fingers} + * @param {object} fingerData The coordinates of fingers in event + * @param {string} currentDirection The current direction the user is swiping. + */ + + /** + * A handler triggered for every phase of the swipe. This handler is constantly fired for the duration of the pinch. + * This is triggered regardless of swipe thresholds. + * @name $.fn.swipe#swipeStatus + * @event + * @default null + * @param {EventObject} event The original event object + * @param {string} phase The phase of the swipe event. See {@link $.fn.swipe.phases} + * @param {string} direction The direction the user swiped in. This is null if the user has yet to move. See {@link $.fn.swipe.directions} + * @param {int} distance The distance the user swiped. This is 0 if the user has yet to move. + * @param {int} duration The duration of the swipe in milliseconds + * @param {int} fingerCount The number of fingers used. See {@link $.fn.swipe.fingers} + * @param {object} fingerData The coordinates of fingers in event + * @param {string} currentDirection The current direction the user is swiping. + */ + + /** + * A handler triggered for pinch in events. + * @name $.fn.swipe#pinchIn + * @event + * @default null + * @param {EventObject} event The original event object + * @param {int} direction The direction the user pinched in. See {@link $.fn.swipe.directions} + * @param {int} distance The distance the user pinched + * @param {int} duration The duration of the swipe in milliseconds + * @param {int} fingerCount The number of fingers used. See {@link $.fn.swipe.fingers} + * @param {int} zoom The zoom/scale level the user pinched too, 0-1. + * @param {object} fingerData The coordinates of fingers in event + */ + + /** + * A handler triggered for pinch out events. + * @name $.fn.swipe#pinchOut + * @event + * @default null + * @param {EventObject} event The original event object + * @param {int} direction The direction the user pinched in. See {@link $.fn.swipe.directions} + * @param {int} distance The distance the user pinched + * @param {int} duration The duration of the swipe in milliseconds + * @param {int} fingerCount The number of fingers used. See {@link $.fn.swipe.fingers} + * @param {int} zoom The zoom/scale level the user pinched too, 0-1. + * @param {object} fingerData The coordinates of fingers in event + */ + + /** + * A handler triggered for all pinch events. This handler is constantly fired for the duration of the pinch. This is triggered regardless of thresholds. + * @name $.fn.swipe#pinchStatus + * @event + * @default null + * @param {EventObject} event The original event object + * @param {int} direction The direction the user pinched in. See {@link $.fn.swipe.directions} + * @param {int} distance The distance the user pinched + * @param {int} duration The duration of the swipe in milliseconds + * @param {int} fingerCount The number of fingers used. See {@link $.fn.swipe.fingers} + * @param {int} zoom The zoom/scale level the user pinched too, 0-1. + * @param {object} fingerData The coordinates of fingers in event + */ + + /** + * A click handler triggered when a user simply clicks, rather than swipes on an element. + * This is deprecated since version 1.6.2, any assignment to click will be assigned to the tap handler. + * You cannot use on to bind to this event as the default jQ click event will be triggered. + * Use the tap event instead. + * @name $.fn.swipe#click + * @event + * @deprecated since version 1.6.2, please use {@link $.fn.swipe#tap} instead + * @default null + * @param {EventObject} event The original event object + * @param {DomObject} target The element clicked on. + */ + + /** + * A click / tap handler triggered when a user simply clicks or taps, rather than swipes on an element. + * @name $.fn.swipe#tap + * @event + * @default null + * @param {EventObject} event The original event object + * @param {DomObject} target The element clicked on. + */ + + /** + * A double tap handler triggered when a user double clicks or taps on an element. + * You can set the time delay for a double tap with the {@link $.fn.swipe.defaults#doubleTapThreshold} property. + * Note: If you set both doubleTap and tap handlers, the tap event will be delayed by the doubleTapThreshold + * as the script needs to check if its a double tap. + * @name $.fn.swipe#doubleTap + * @see $.fn.swipe.defaults#doubleTapThreshold + * @event + * @default null + * @param {EventObject} event The original event object + * @param {DomObject} target The element clicked on. + */ + + /** + * A long tap handler triggered once a tap has been release if the tap was longer than the longTapThreshold. + * You can set the time delay for a long tap with the {@link $.fn.swipe.defaults#longTapThreshold} property. + * @name $.fn.swipe#longTap + * @see $.fn.swipe.defaults#longTapThreshold + * @event + * @default null + * @param {EventObject} event The original event object + * @param {DomObject} target The element clicked on. + */ + + /** + * A hold tap handler triggered as soon as the longTapThreshold is reached + * You can set the time delay for a long tap with the {@link $.fn.swipe.defaults#longTapThreshold} property. + * @name $.fn.swipe#hold + * @see $.fn.swipe.defaults#longTapThreshold + * @event + * @default null + * @param {EventObject} event The original event object + * @param {DomObject} target The element clicked on. + */ + +})); diff --git a/ace-ws-rest/hs_err_pid15652.log b/ace-ws-rest/hs_err_pid15652.log new file mode 100644 index 0000000..7ec7ad2 --- /dev/null +++ b/ace-ws-rest/hs_err_pid15652.log @@ -0,0 +1,322 @@ +# +# There is insufficient memory for the Java Runtime Environment to continue. +# Native memory allocation (malloc) failed to allocate 586312 bytes for Chunk::new +# Possible reasons: +# The system is out of physical RAM or swap space +# In 32 bit mode, the process size limit was hit +# Possible solutions: +# Reduce memory load on the system +# Increase physical memory or swap space +# Check if swap backing store is full +# Use 64 bit Java on a 64 bit OS +# Decrease Java heap size (-Xmx/-Xms) +# Decrease number of Java threads +# Decrease Java thread stack sizes (-Xss) +# Set larger code cache with -XX:ReservedCodeCacheSize= +# This output file may be truncated or incomplete. +# +# Out of Memory Error (allocation.cpp:389), pid=15652, tid=0x000024f8 +# +# JRE version: OpenJDK Runtime Environment (8.0_312-b07) (build 1.8.0_312-b07) +# Java VM: OpenJDK Server VM (25.312-b07 mixed mode windows-x86 ) +# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows +# + +--------------- T H R E A D --------------- + +Current thread (0x3fe16800): JavaThread "C2 CompilerThread1" daemon [_thread_in_native, id=9464, stack(0x401c0000,0x40210000)] + +Stack: [0x401c0000,0x40210000], sp=0x4020dc54, free space=311k +Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) +V [jvm.dll+0x1a73b8] +V [jvm.dll+0x19f743] +V [jvm.dll+0x8030d] +V [jvm.dll+0x809b2] +V [jvm.dll+0x97c83] +V [jvm.dll+0x33a992] +V [jvm.dll+0x36d4de] +V [jvm.dll+0x32c6f0] +V [jvm.dll+0x32dd7e] +V [jvm.dll+0x32c23f] +V [jvm.dll+0x31bf86] +V [jvm.dll+0x62547] +V [jvm.dll+0x6145a] +V [jvm.dll+0x1787fa] +V [jvm.dll+0x1ba8cb] +C [msvcr120.dll+0x2c129] +C [msvcr120.dll+0x2c10d] +C [KERNEL32.DLL+0x16739] +C [ntdll.dll+0x68e7f] +C [ntdll.dll+0x68e4d] +C 0x00000000 + + +Current CompileTask: +C2: 3939 2490 ! 4 org.codehaus.plexus.interpolation.StringSearchInterpolator::interpolate (650 bytes) + + +--------------- P R O C E S S --------------- + +Java Threads: ( => current thread ) + 0x3fe60c00 JavaThread "Service Thread" daemon [_thread_blocked, id=3016, stack(0x40370000,0x403c0000)] + 0x3fe5f400 JavaThread "C1 CompilerThread3" daemon [_thread_blocked, id=11516, stack(0x402e0000,0x40330000)] + 0x3fe17400 JavaThread "C2 CompilerThread2" daemon [_thread_in_vm, id=8752, stack(0x40250000,0x402a0000)] +=>0x3fe16800 JavaThread "C2 CompilerThread1" daemon [_thread_in_native, id=9464, stack(0x401c0000,0x40210000)] + 0x3fe15800 JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=7116, stack(0x40130000,0x40180000)] + 0x3fe0d800 JavaThread "Attach Listener" daemon [_thread_blocked, id=10172, stack(0x400a0000,0x400f0000)] + 0x3fe0a000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=17000, stack(0x40010000,0x40060000)] + 0x3fdf0000 JavaThread "Finalizer" daemon [_thread_blocked, id=15936, stack(0x3fb10000,0x3fb60000)] + 0x3fdeac00 JavaThread "Reference Handler" daemon [_thread_blocked, id=15388, stack(0x3fa80000,0x3fad0000)] + 0x00af2400 JavaThread "main" [_thread_in_Java, id=6224, stack(0x02580000,0x025d0000)] + +Other Threads: + 0x00bbe400 VMThread [stack: 0x3f9f0000,0x3fa40000] [id=2760] + 0x3fe63000 WatcherThread [stack: 0x40400000,0x40450000] [id=16896] + +VM state:not at safepoint (normal execution) + +VM Mutex/Monitor currently owned by a thread: None + +Heap: + PSYoungGen total 73472K, used 12912K [0x2ecc0000, 0x33b40000, 0x3d600000) + eden space 66560K, 12% used [0x2ecc0000,0x2f49c2c8,0x32dc0000) + from space 6912K, 70% used [0x33480000,0x339400b0,0x33b40000) + to space 6912K, 0% used [0x32dc0000,0x32dc0000,0x33480000) + ParOldGen total 43776K, used 9138K [0x11a00000, 0x144c0000, 0x2ecc0000) + object space 43776K, 20% used [0x11a00000,0x122ec8b0,0x144c0000) + Metaspace used 10722K, capacity 10849K, committed 11008K, reserved 11648K + +Card table byte_map: [0x3d600000,0x3d760000] byte_map_base: 0x3d573000 + +Marking Bits: (ParMarkBitMap*) 0x71efa760 + Begin Bits: [0x3dc90000, 0x3e780000) + End Bits: [0x3e780000, 0x3f270000) + +Polling page: 0x025d0000 + +CodeCache: size=245760Kb used=7574Kb max_used=7581Kb free=238185Kb + bounds [0x02600000, 0x02d70000, 0x11600000] + total_blobs=2852 nmethods=2663 adapters=103 + compilation: enabled + +Compilation events (10 events): +Event: 3.889 Thread 0x3fe5f400 2638 3 org.apache.maven.model.profile.activation.PropertyProfileActivator::isActive (270 bytes) +Event: 3.891 Thread 0x3fe5f400 nmethod 2638 0x02d49e48 code [0x02d4a160, 0x02d4ba90] +Event: 3.891 Thread 0x3fe5f400 2640 3 org.apache.maven.model.merge.MavenModelMerger::getReportPluginKey (5 bytes) +Event: 3.892 Thread 0x3fe5f400 nmethod 2640 0x02d4ca08 code [0x02d4cba0, 0x02d4d2b0] +Event: 3.892 Thread 0x3fe5f400 2641 3 org.apache.maven.model.ReportPlugin::getKey (12 bytes) +Event: 3.892 Thread 0x3fe5f400 nmethod 2641 0x02d4d788 code [0x02d4d920, 0x02d4dff0] +Event: 3.892 Thread 0x3fe5f400 2642 1 org.apache.maven.model.CiManagement::getSystem (5 bytes) +Event: 3.892 Thread 0x3fe5f400 nmethod 2642 0x02d36d48 code [0x02d36e40, 0x02d36ee0] +Event: 3.892 Thread 0x3fe5f400 2643 1 org.apache.maven.model.CiManagement::getUrl (5 bytes) +Event: 3.892 Thread 0x3fe5f400 nmethod 2643 0x02d49c48 code [0x02d49d40, 0x02d49de0] + +GC Heap History (10 events): +Event: 1.536 GC heap before +{Heap before GC invocations=2 (full 0): + PSYoungGen total 19200K, used 19195K [0x2ecc0000, 0x30200000, 0x3d600000) + eden space 16640K, 100% used [0x2ecc0000,0x2fd00000,0x2fd00000) + from space 2560K, 99% used [0x2fd00000,0x2ff7ef68,0x2ff80000) + to space 2560K, 0% used [0x2ff80000,0x2ff80000,0x30200000) + ParOldGen total 43776K, used 863K [0x11a00000, 0x144c0000, 0x2ecc0000) + object space 43776K, 1% used [0x11a00000,0x11ad7e08,0x144c0000) + Metaspace used 5735K, capacity 5778K, committed 5888K, reserved 6528K +Event: 1.542 GC heap after +Heap after GC invocations=2 (full 0): + PSYoungGen total 19200K, used 2548K [0x2ecc0000, 0x30200000, 0x3d600000) + eden space 16640K, 0% used [0x2ecc0000,0x2ecc0000,0x2fd00000) + from space 2560K, 99% used [0x2ff80000,0x301fd1f8,0x30200000) + to space 2560K, 0% used [0x2fd00000,0x2fd00000,0x2ff80000) + ParOldGen total 43776K, used 1306K [0x11a00000, 0x144c0000, 0x2ecc0000) + object space 43776K, 2% used [0x11a00000,0x11b46998,0x144c0000) + Metaspace used 5735K, capacity 5778K, committed 5888K, reserved 6528K +} +Event: 1.891 GC heap before +{Heap before GC invocations=3 (full 0): + PSYoungGen total 19200K, used 19188K [0x2ecc0000, 0x30200000, 0x3d600000) + eden space 16640K, 100% used [0x2ecc0000,0x2fd00000,0x2fd00000) + from space 2560K, 99% used [0x2ff80000,0x301fd1f8,0x30200000) + to space 2560K, 0% used [0x2fd00000,0x2fd00000,0x2ff80000) + ParOldGen total 43776K, used 1306K [0x11a00000, 0x144c0000, 0x2ecc0000) + object space 43776K, 2% used [0x11a00000,0x11b46998,0x144c0000) + Metaspace used 6876K, capacity 6942K, committed 7040K, reserved 7552K +Event: 1.895 GC heap after +Heap after GC invocations=3 (full 0): + PSYoungGen total 19200K, used 2550K [0x2ecc0000, 0x31240000, 0x3d600000) + eden space 16640K, 0% used [0x2ecc0000,0x2ecc0000,0x2fd00000) + from space 2560K, 99% used [0x2fd00000,0x2ff7dad8,0x2ff80000) + to space 2560K, 0% used [0x30fc0000,0x30fc0000,0x31240000) + ParOldGen total 43776K, used 2966K [0x11a00000, 0x144c0000, 0x2ecc0000) + object space 43776K, 6% used [0x11a00000,0x11ce5b48,0x144c0000) + Metaspace used 6876K, capacity 6942K, committed 7040K, reserved 7552K +} +Event: 2.180 GC heap before +{Heap before GC invocations=4 (full 0): + PSYoungGen total 19200K, used 19190K [0x2ecc0000, 0x31240000, 0x3d600000) + eden space 16640K, 100% used [0x2ecc0000,0x2fd00000,0x2fd00000) + from space 2560K, 99% used [0x2fd00000,0x2ff7dad8,0x2ff80000) + to space 2560K, 0% used [0x30fc0000,0x30fc0000,0x31240000) + ParOldGen total 43776K, used 2966K [0x11a00000, 0x144c0000, 0x2ecc0000) + object space 43776K, 6% used [0x11a00000,0x11ce5b48,0x144c0000) + Metaspace used 8099K, capacity 8177K, committed 8320K, reserved 8576K +Event: 2.184 GC heap after +Heap after GC invocations=4 (full 0): + PSYoungGen total 35840K, used 2546K [0x2ecc0000, 0x31240000, 0x3d600000) + eden space 33280K, 0% used [0x2ecc0000,0x2ecc0000,0x30d40000) + from space 2560K, 99% used [0x30fc0000,0x3123c8d0,0x31240000) + to space 2560K, 0% used [0x30d40000,0x30d40000,0x30fc0000) + ParOldGen total 43776K, used 4865K [0x11a00000, 0x144c0000, 0x2ecc0000) + object space 43776K, 11% used [0x11a00000,0x11ec0508,0x144c0000) + Metaspace used 8099K, capacity 8177K, committed 8320K, reserved 8576K +} +Event: 3.276 GC heap before +{Heap before GC invocations=5 (full 0): + PSYoungGen total 35840K, used 35826K [0x2ecc0000, 0x31240000, 0x3d600000) + eden space 33280K, 100% used [0x2ecc0000,0x30d40000,0x30d40000) + from space 2560K, 99% used [0x30fc0000,0x3123c8d0,0x31240000) + to space 2560K, 0% used [0x30d40000,0x30d40000,0x30fc0000) + ParOldGen total 43776K, used 4865K [0x11a00000, 0x144c0000, 0x2ecc0000) + object space 43776K, 11% used [0x11a00000,0x11ec0508,0x144c0000) + Metaspace used 10426K, capacity 10554K, committed 10624K, reserved 10624K +Event: 3.284 GC heap after +Heap after GC invocations=5 (full 0): + PSYoungGen total 35840K, used 2552K [0x2ecc0000, 0x33b40000, 0x3d600000) + eden space 33280K, 0% used [0x2ecc0000,0x2ecc0000,0x30d40000) + from space 2560K, 99% used [0x30d40000,0x30fbe0a0,0x30fc0000) + to space 6912K, 0% used [0x33480000,0x33480000,0x33b40000) + ParOldGen total 43776K, used 9134K [0x11a00000, 0x144c0000, 0x2ecc0000) + object space 43776K, 20% used [0x11a00000,0x122eb8b0,0x144c0000) + Metaspace used 10426K, capacity 10554K, committed 10624K, reserved 10624K +} +Event: 3.847 GC heap before +{Heap before GC invocations=6 (full 0): + PSYoungGen total 35840K, used 35832K [0x2ecc0000, 0x33b40000, 0x3d600000) + eden space 33280K, 100% used [0x2ecc0000,0x30d40000,0x30d40000) + from space 2560K, 99% used [0x30d40000,0x30fbe0a0,0x30fc0000) + to space 6912K, 0% used [0x33480000,0x33480000,0x33b40000) + ParOldGen total 43776K, used 9134K [0x11a00000, 0x144c0000, 0x2ecc0000) + object space 43776K, 20% used [0x11a00000,0x122eb8b0,0x144c0000) + Metaspace used 10683K, capacity 10785K, committed 10880K, reserved 11648K +Event: 3.854 GC heap after +Heap after GC invocations=6 (full 0): + PSYoungGen total 73472K, used 4864K [0x2ecc0000, 0x33b40000, 0x3d600000) + eden space 66560K, 0% used [0x2ecc0000,0x2ecc0000,0x32dc0000) + from space 6912K, 70% used [0x33480000,0x339400b0,0x33b40000) + to space 6912K, 0% used [0x32dc0000,0x32dc0000,0x33480000) + ParOldGen total 43776K, used 9138K [0x11a00000, 0x144c0000, 0x2ecc0000) + object space 43776K, 20% used [0x11a00000,0x122ec8b0,0x144c0000) + Metaspace used 10683K, capacity 10785K, committed 10880K, reserved 11648K +} + +Deoptimization events (10 events): +Event: 3.314 Thread 0x00af2400 Uncommon trap: reason=class_check action=maybe_recompile pc=0x02b1066c method=java.util.regex.Pattern$CharProperty$1.isSatisfiedBy(I)Z @ 5 +Event: 3.314 Thread 0x00af2400 Uncommon trap: reason=class_check action=maybe_recompile pc=0x02b17d88 method=java.util.regex.Pattern$7.isSatisfiedBy(I)Z @ 16 +Event: 3.314 Thread 0x00af2400 Uncommon trap: reason=class_check action=maybe_recompile pc=0x02b1065c method=java.util.regex.Pattern$7.isSatisfiedBy(I)Z @ 16 +Event: 3.314 Thread 0x00af2400 Uncommon trap: reason=class_check action=maybe_recompile pc=0x02b17d88 method=java.util.regex.Pattern$7.isSatisfiedBy(I)Z @ 16 +Event: 3.370 Thread 0x00af2400 Uncommon trap: reason=unstable_if action=reinterpret pc=0x02aa85d4 method=java.lang.String.trim()Ljava/lang/String; @ 63 +Event: 3.468 Thread 0x00af2400 Uncommon trap: reason=speculate_class_check action=maybe_recompile pc=0x02b93990 method=java.nio.charset.CharsetDecoder.decode(Ljava/nio/ByteBuffer;Ljava/nio/CharBuffer;Z)Ljava/nio/charset/CoderResult; @ 57 +Event: 3.469 Thread 0x00af2400 Uncommon trap: reason=speculate_class_check action=maybe_recompile pc=0x02b93990 method=java.nio.charset.CharsetDecoder.decode(Ljava/nio/ByteBuffer;Ljava/nio/CharBuffer;Z)Ljava/nio/charset/CoderResult; @ 57 +Event: 3.471 Thread 0x00af2400 Uncommon trap: reason=speculate_class_check action=maybe_recompile pc=0x02adb514 method=java.nio.charset.CharsetDecoder.decode(Ljava/nio/ByteBuffer;Ljava/nio/CharBuffer;Z)Ljava/nio/charset/CoderResult; @ 57 +Event: 3.472 Thread 0x00af2400 Uncommon trap: reason=speculate_class_check action=maybe_recompile pc=0x02adb514 method=java.nio.charset.CharsetDecoder.decode(Ljava/nio/ByteBuffer;Ljava/nio/CharBuffer;Z)Ljava/nio/charset/CoderResult; @ 57 +Event: 3.865 Thread 0x00af2400 Uncommon trap: reason=unstable_if action=reinterpret pc=0x02aaeee8 method=java.util.LinkedHashMap.afterNodeInsertion(Z)V @ 18 + +Classes redefined (0 events): +No events + +Internal exceptions (10 events): +Event: 2.303 Thread 0x00af2400 Exception (0x2f2c62c8) thrown at [C:\wsjdk\Corretto8Src\installers\windows\zip\corretto-build\buildRoot\src\hotspot\src\share\vm\prims\jvm.cpp, line 1527] +Event: 2.304 Thread 0x00af2400 Exception (0x2f2cb2c0) thrown at [C:\wsjdk\Corretto8Src\installers\windows\zip\corretto-build\buildRoot\src\hotspot\src\share\vm\classfile\systemDictionary.cpp, line 206] +Event: 2.417 Thread 0x00af2400 Implicit null exception at 0x026d741f to 0x026d769d +Event: 2.478 Thread 0x00af2400 Exception (0x2f9bcd58) thrown at [C:\wsjdk\Corretto8Src\installers\windows\zip\corretto-build\buildRoot\src\hotspot\src\share\vm\interpreter\linkResolver.cpp, line 1185] +Event: 2.478 Thread 0x00af2400 Exception (0x2f9bcf68) thrown at [C:\wsjdk\Corretto8Src\installers\windows\zip\corretto-build\buildRoot\src\hotspot\src\share\vm\interpreter\linkResolver.cpp, line 1185] +Event: 2.478 Thread 0x00af2400 Exception (0x2f9bd178) thrown at [C:\wsjdk\Corretto8Src\installers\windows\zip\corretto-build\buildRoot\src\hotspot\src\share\vm\interpreter\linkResolver.cpp, line 1185] +Event: 2.478 Thread 0x00af2400 Exception (0x2f9c5448) thrown at [C:\wsjdk\Corretto8Src\installers\windows\zip\corretto-build\buildRoot\src\hotspot\src\share\vm\interpreter\linkResolver.cpp, line 1185] +Event: 2.478 Thread 0x00af2400 Exception (0x2f9c5658) thrown at [C:\wsjdk\Corretto8Src\installers\windows\zip\corretto-build\buildRoot\src\hotspot\src\share\vm\interpreter\linkResolver.cpp, line 1185] +Event: 2.478 Thread 0x00af2400 Exception (0x2f9c5868) thrown at [C:\wsjdk\Corretto8Src\installers\windows\zip\corretto-build\buildRoot\src\hotspot\src\share\vm\interpreter\linkResolver.cpp, line 1185] +Event: 3.165 Thread 0x00af2400 Implicit null exception at 0x02b048d2 to 0x02b057dd + +Events (10 events): +Event: 3.472 Thread 0x00af2400 Uncommon trap: trap_request=0xffffff76 fr.pc=0x02adb514 +Event: 3.472 Thread 0x00af2400 DEOPT PACKING pc=0x02adb514 sp=0x025ce0f0 +Event: 3.472 Thread 0x00af2400 DEOPT UNPACKING pc=0x0263abbc sp=0x025ce098 mode 2 +Event: 3.802 Executing VM operation: ForceSafepoint +Event: 3.802 Executing VM operation: ForceSafepoint done +Event: 3.847 Executing VM operation: ParallelGCFailedAllocation +Event: 3.854 Executing VM operation: ParallelGCFailedAllocation done +Event: 3.865 Thread 0x00af2400 Uncommon trap: trap_request=0xffffff65 fr.pc=0x02aaeee8 +Event: 3.865 Thread 0x00af2400 DEOPT PACKING pc=0x02aaeee8 sp=0x025ce0f0 +Event: 3.865 Thread 0x00af2400 DEOPT UNPACKING pc=0x0263abbc sp=0x025ce0c4 mode 2 + + +Dynamic libraries: +0x009b0000 - 0x009e5000 C:\Program Files (x86)\Amazon Corretto\jdk1.8.0_312\bin\java.exe +0x773e0000 - 0x77589000 C:\WINDOWS\SYSTEM32\ntdll.dll +0x764b0000 - 0x765a0000 C:\WINDOWS\System32\KERNEL32.DLL +0x75500000 - 0x75752000 C:\WINDOWS\System32\KERNELBASE.dll +0x743a0000 - 0x74440000 C:\WINDOWS\SYSTEM32\apphelp.dll +0x751c0000 - 0x7523c000 C:\WINDOWS\System32\ADVAPI32.dll +0x76810000 - 0x768d2000 C:\WINDOWS\System32\msvcrt.dll +0x75b50000 - 0x75bca000 C:\WINDOWS\System32\sechost.dll +0x75360000 - 0x7541b000 C:\WINDOWS\System32\RPCRT4.dll +0x765a0000 - 0x7674c000 C:\WINDOWS\System32\USER32.dll +0x76490000 - 0x764aa000 C:\WINDOWS\System32\win32u.dll +0x76750000 - 0x76772000 C:\WINDOWS\System32\GDI32.dll +0x76a80000 - 0x76b5f000 C:\WINDOWS\System32\gdi32full.dll +0x770e0000 - 0x7715b000 C:\WINDOWS\System32\msvcp_win.dll +0x75760000 - 0x75872000 C:\WINDOWS\System32\ucrtbase.dll +0x73510000 - 0x73733000 C:\WINDOWS\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.22000.120_none_e541a94fcce8ed6d\COMCTL32.dll +0x76a50000 - 0x76a75000 C:\WINDOWS\System32\IMM32.DLL +0x74860000 - 0x7494e000 C:\Program Files (x86)\Amazon Corretto\jdk1.8.0_312\jre\bin\msvcr120.dll +0x747e0000 - 0x74851000 C:\Program Files (x86)\Amazon Corretto\jdk1.8.0_312\jre\bin\msvcp120.dll +0x71940000 - 0x71f64000 C:\Program Files (x86)\Amazon Corretto\jdk1.8.0_312\jre\bin\server\jvm.dll +0x75420000 - 0x75426000 C:\WINDOWS\System32\PSAPI.DLL +0x747d0000 - 0x747d8000 C:\WINDOWS\SYSTEM32\WSOCK32.dll +0x75d20000 - 0x75d84000 C:\WINDOWS\System32\WS2_32.dll +0x74790000 - 0x747c1000 C:\WINDOWS\SYSTEM32\WINMM.dll +0x74740000 - 0x74748000 C:\WINDOWS\SYSTEM32\VERSION.dll +0x74780000 - 0x7478d000 C:\Program Files (x86)\Amazon Corretto\jdk1.8.0_312\jre\bin\verify.dll +0x74750000 - 0x74774000 C:\Program Files (x86)\Amazon Corretto\jdk1.8.0_312\jre\bin\java.dll +0x74720000 - 0x74734000 C:\Program Files (x86)\Amazon Corretto\jdk1.8.0_312\jre\bin\zip.dll +0x75e20000 - 0x76422000 C:\WINDOWS\System32\SHELL32.dll +0x74ac0000 - 0x75162000 C:\WINDOWS\SYSTEM32\windows.storage.dll +0x758c0000 - 0x75b4b000 C:\WINDOWS\System32\combase.dll +0x749d0000 - 0x74aba000 C:\WINDOWS\SYSTEM32\wintypes.dll +0x75430000 - 0x754f1000 C:\WINDOWS\System32\SHCORE.dll +0x75170000 - 0x751ba000 C:\WINDOWS\System32\shlwapi.dll +0x746c0000 - 0x746d8000 C:\WINDOWS\SYSTEM32\profapi.dll +0x74710000 - 0x74719000 C:\Program Files\NetBeans-12.2\netbeans\java\maven\lib\jansi-native\windows32\jansi.dll +0x746e0000 - 0x746f6000 C:\Program Files (x86)\Amazon Corretto\jdk1.8.0_312\jre\bin\net.dll +0x72cf0000 - 0x72d40000 C:\WINDOWS\system32\mswsock.dll +0x74670000 - 0x7467f000 C:\Program Files (x86)\Amazon Corretto\jdk1.8.0_312\jre\bin\nio.dll +0x73340000 - 0x73507000 C:\WINDOWS\SYSTEM32\dbghelp.dll +0x771c0000 - 0x77224000 C:\WINDOWS\System32\bcryptPrimitives.dll + +VM Arguments: +jvm_args: -Dclassworlds.conf=C:\Program Files\NetBeans-12.2\netbeans\java\maven\bin\..\bin\m2.conf -Dmaven.home=C:\Program Files\NetBeans-12.2\netbeans\java\maven\bin\.. -Dlibrary.jansi.path=C:\Program Files\NetBeans-12.2\netbeans\java\maven\bin\..\lib\jansi-native -Dmaven.multiModuleProjectDirectory=D:\arrebol\ApoyoProyectosComerciales\apc-ws-rest +java_command: org.codehaus.plexus.classworlds.launcher.Launcher -Dnetbeans.deploy=true -Dmaven.ext.class.path=C:\Program Files\NetBeans-12.2\netbeans\java\maven-nblib\netbeans-eventspy.jar -Dfile.encoding=UTF-8 -PLocalhost-Mobile-APP package +java_class_path (initial): C:\Program Files\NetBeans-12.2\netbeans\java\maven\bin\..\boot\plexus-classworlds-2.6.0.jar +Launcher Type: SUN_STANDARD + +Environment Variables: +JAVA_HOME=C:\Program Files (x86)\Amazon Corretto\jdk1.8.0_312 +PATH=C:\Program Files (x86)\Amazon Corretto\jdk1.8.0_312\bin;C:\Program Files\Amazon Corretto\jdk11.0.13_8\bin;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\Program Files (x86)\Java\jdk1.8.0_271\bin;C:\Environment\flutter\flutter_windows_1.22.5-stable\flutter\bin;D:\environment\mongodb\mongodb-win32-x86_64-windows-4.4.4\bin;;C:\Users\zavlo\AppData\Local\Microsoft\WindowsApps;D:\environment\dart-sass-1.32.11-windows-x64\dart-sass +USERNAME=zavlo +OS=Windows_NT +PROCESSOR_IDENTIFIER=AMD64 Family 23 Model 24 Stepping 1, AuthenticAMD + + + +--------------- S Y S T E M --------------- + +OS: Windows 10.0 , 64 bit Build 22000 (10.0.22000.434) + +CPU:total 8 (initial active 8) (8 cores per cpu, 1 threads per core) family 23 model 24 stepping 1, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, avx2, aes, clmul, mmxext, 3dnowpref, lzcnt, sse4a, tsc, tscinvbit, tscinv, bmi1 + +Memory: 4k page, physical 7274124k(331820k free), swap 17759880k(1416k free) + +vm_info: OpenJDK Server VM (25.312-b07) for windows-x86 JRE (1.8.0_312-b07), built on Oct 14 2021 21:08:45 by "Administrator" with MS VC++ 12.0 (VS2013) + +time: Wed Mar 16 20:20:31 2022 +timezone: Hora estįndar central (México) +elapsed time: 3.944722 seconds (0d 0h 0m 3s) + diff --git a/ace-ws-rest/nb-configuration.xml b/ace-ws-rest/nb-configuration.xml new file mode 100644 index 0000000..5f17c36 --- /dev/null +++ b/ace-ws-rest/nb-configuration.xml @@ -0,0 +1,21 @@ + + + + + + 1.8-web + ide + JDK_1.8 + Tomcat + + diff --git a/ace-ws-rest/pom.xml b/ace-ws-rest/pom.xml new file mode 100644 index 0000000..e8a8ed3 --- /dev/null +++ b/ace-ws-rest/pom.xml @@ -0,0 +1,283 @@ + + + 4.0.0 + + com.arrebol + ace-ws-rest + 1.0.0 + war + + ace-ws-rest + + + ${project.build.directory}/endorsed + UTF-8 + 2.3.14 + + + + + javax + javaee-api + 8.0 + provided + + + org.glassfish + jakarta.faces + ${mojarra.version} + + + javax.el + javax.el-api + 3.0.0 + provided + + + javax.servlet + javax.servlet-api + 3.1.0 + provided + + + + + com.arrebol + ace-controller-mobile + 1.0.0 + jar + + + + javax.ws.rs + javax.ws.rs-api + 2.1 + + + + org.glassfish.jersey.containers + jersey-container-servlet + 2.27 + + + + org.glassfish.jersey.media + jersey-media-moxy + 2.27 + + + + org.glassfish.jersey.media + jersey-media-multipart + 2.27 + + + org.eclipse.persistence + org.eclipse.persistence.moxy + 2.7.4 + + + + javax.servlet + javax.servlet-api + 3.1.0 + provided + + + + org.glassfish.jersey.inject + jersey-hk2 + 2.27 + + + + org.glassfish + javax.json + 1.1.4 + + + + junit + junit + 4.12 + test + + + org.glassfish.jersey.test-framework + jersey-test-framework-util + 2.27 + test + + + org.glassfish.jersey.test-framework.providers + jersey-test-framework-provider-bundle + 2.27 + pom + test + + + + + + AWS-EC2 + + jdbc:mysql://localhost:3306/apo_pro_com_april_ten?serverTimezone=UTC + root + Saladeespera2_ + + + + Localhost-Mobile-APP + + jdbc:mysql://localhost:3306/apo_pro_com_april_ten?serverTimezone=GMT-5 + apoprocommobilelocalhost + 0Ps$6%q8 + + + + Amazon-Web-Services-Mobile-APP + + jdbc:mysql://ace.civi8tosgaol.us-east-2.rds.amazonaws.com:3306/apo_pro_com_april_ten + apoprocommobile + 0Ps$6%q8 + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.8 + 1.8 + + ${endorsed.dir} + + + + + org.apache.maven.plugins + maven-war-plugin + 2.3 + + + + src/main/webapp/META-INF + true + META-INF + + + false + + + + org.apache.maven.plugins + maven-dependency-plugin + 2.6 + + + validate + + copy + + + ${endorsed.dir} + true + + + javax + javaee-api + 8.0 + jar + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12.4 + + true + + + + + + diff --git a/ace-ws-rest/replay_pid15652.log b/ace-ws-rest/replay_pid15652.log new file mode 100644 index 0000000..24b3e0c --- /dev/null +++ b/ace-ws-rest/replay_pid15652.log @@ -0,0 +1,2597 @@ +JvmtiExport can_access_local_variables 0 +JvmtiExport can_hotswap_or_post_breakpoint 0 +JvmtiExport can_post_on_exceptions 0 +# 297 ciObject found +ciMethod java/lang/Object ()V 4097 1 386754 0 0 +ciMethod java/lang/Object hashCode ()I 2049 1 256 0 -1 +ciMethod java/lang/Object equals (Ljava/lang/Object;)Z 3441 1 5558 0 -1 +ciMethod java/lang/Object toString ()Ljava/lang/String; 0 0 1 0 -1 +instanceKlass java/util/AbstractMap$SimpleImmutableEntry +instanceKlass org/eclipse/aether/util/graph/selector/ExclusionDependencySelector$ExclusionComparator +instanceKlass org/eclipse/aether/graph/Dependency$Exclusions$1 +instanceKlass org/eclipse/aether/internal/impl/collect/DataPool$GraphKey +instanceKlass org/eclipse/aether/internal/impl/collect/DataPool$Descriptor +instanceKlass org/eclipse/aether/internal/impl/collect/DataPool$Constraint$VersionRepo +instanceKlass org/eclipse/aether/internal/impl/collect/DataPool$Constraint +instanceKlass org/eclipse/aether/internal/impl/collect/DataPool$ConstraintKey +instanceKlass org/eclipse/aether/util/graph/manager/ClassicDependencyManager$Key +instanceKlass org/eclipse/aether/graph/DependencyCycle +instanceKlass org/eclipse/aether/internal/impl/collect/DefaultDependencyCollectionContext +instanceKlass org/eclipse/aether/internal/impl/collect/NodeStack +instanceKlass org/eclipse/aether/internal/impl/collect/ObjectPool +instanceKlass org/eclipse/aether/internal/impl/collect/CachingArtifactTypeRegistry +instanceKlass org/eclipse/aether/util/artifact/ArtifactIdUtils +instanceKlass org/apache/maven/project/DefaultDependencyResolutionRequest +instanceKlass org/apache/maven/lifecycle/internal/LifecycleDependencyResolver$ReactorDependencyFilter +instanceKlass org/eclipse/aether/util/filter/AndDependencyFilter +instanceKlass org/eclipse/aether/util/filter/ScopeDependencyFilter +instanceKlass org/apache/maven/project/artifact/DefaultProjectArtifactsCache$CacheKey +instanceKlass org/apache/commons/lang3/Validate +instanceKlass org/apache/maven/lifecycle/internal/ExecutionPlanItem +instanceKlass org/apache/maven/model/Exclusion +instanceKlass org/apache/maven/plugin/MavenPluginValidator +instanceKlass org/codehaus/plexus/component/repository/ComponentDependency +instanceKlass org/codehaus/plexus/component/repository/ComponentRequirement +instanceKlass org/apache/maven/plugin/descriptor/Parameter +instanceKlass org/codehaus/plexus/configuration/DefaultPlexusConfiguration +instanceKlass org/apache/maven/repository/internal/ArtifactDescriptorReaderDelegate +instanceKlass org/apache/maven/model/merge/ModelMerger$NotifierKeyComputer +instanceKlass org/apache/maven/model/Notifier +instanceKlass org/apache/maven/model/ActivationFile +instanceKlass org/apache/maven/model/Site +instanceKlass org/eclipse/aether/util/version/GenericVersion$Item +instanceKlass org/eclipse/aether/util/version/GenericVersion$Tokenizer +instanceKlass org/eclipse/aether/util/version/GenericVersion +instanceKlass org/eclipse/aether/util/version/GenericVersionConstraint +instanceKlass org/eclipse/aether/version/VersionConstraint +instanceKlass org/eclipse/aether/version/VersionRange +instanceKlass org/eclipse/aether/util/version/GenericVersionScheme +instanceKlass java/util/Formattable +instanceKlass java/util/Formatter$Conversion +instanceKlass java/util/Formatter$Flags +instanceKlass java/util/Formatter$FormatSpecifier +instanceKlass java/util/Formatter$FixedString +instanceKlass java/util/Formatter$FormatString +instanceKlass java/util/Formatter +instanceKlass org/apache/maven/repository/internal/DefaultModelCache$Key +instanceKlass org/apache/maven/model/building/ModelCacheTag$2 +instanceKlass org/apache/maven/model/building/ModelCacheTag$1 +instanceKlass org/apache/maven/model/io/xpp3/MavenXpp3Reader$1 +instanceKlass org/apache/maven/model/io/xpp3/MavenXpp3Reader$ContentTransformer +instanceKlass org/apache/maven/model/io/xpp3/MavenXpp3Reader +instanceKlass org/apache/maven/repository/internal/DefaultModelResolver +instanceKlass org/apache/maven/repository/internal/DefaultModelCache +instanceKlass java/nio/channels/spi/AbstractInterruptibleChannel$1 +instanceKlass sun/nio/ch/Interruptible +instanceKlass sun/nio/ch/FileKey +instanceKlass sun/nio/ch/FileLockTable +instanceKlass sun/nio/ch/NativeThread +instanceKlass java/nio/channels/FileLock +instanceKlass sun/nio/ch/FileDispatcherImpl$1 +instanceKlass sun/nio/ch/NativeDispatcher +instanceKlass sun/nio/ch/NativeThreadSet +instanceKlass java/net/Inet6Address$Inet6AddressHolder +instanceKlass java/net/InetAddress$2 +instanceKlass sun/net/spi/nameservice/NameService +instanceKlass java/net/Inet6AddressImpl +instanceKlass java/net/InetAddressImpl +instanceKlass java/net/InetAddressImplFactory +instanceKlass java/net/InetAddress$Cache +instanceKlass java/net/InetAddress$InetAddressHolder +instanceKlass java/net/InetAddress$1 +instanceKlass java/net/InetAddress +instanceKlass sun/nio/ch/IOUtil$1 +instanceKlass sun/nio/ch/IOUtil +instanceKlass java/nio/file/attribute/FileAttribute +instanceKlass java/nio/channels/spi/AbstractInterruptibleChannel +instanceKlass java/nio/channels/InterruptibleChannel +instanceKlass java/nio/channels/ScatteringByteChannel +instanceKlass java/nio/channels/GatheringByteChannel +instanceKlass java/nio/channels/SeekableByteChannel +instanceKlass java/nio/channels/ByteChannel +instanceKlass org/eclipse/aether/repository/LocalArtifactRequest +instanceKlass org/eclipse/aether/internal/impl/DefaultRepositoryEventDispatcher$1 +instanceKlass org/eclipse/aether/RepositoryEvent$Builder +instanceKlass org/eclipse/aether/internal/impl/DefaultSyncContextFactory$DefaultSyncContext +instanceKlass org/apache/maven/repository/internal/DefaultVersionResolver$Key +instanceKlass org/eclipse/aether/artifact/AbstractArtifact +instanceKlass org/apache/maven/plugin/DefaultPluginDescriptorCache$CacheKey +instanceKlass org/apache/maven/lifecycle/internal/GoalTask +instanceKlass org/apache/maven/execution/ProjectExecutionEvent +instanceKlass org/apache/maven/lifecycle/internal/CompoundProjectExecutionListener +instanceKlass org/apache/maven/lifecycle/internal/LifecycleTask +instanceKlass org/eclipse/aether/util/repository/ChainedWorkspaceReader +instanceKlass java/util/LinkedList$ListItr +instanceKlass org/codehaus/plexus/util/dag/TopologicalSorter +instanceKlass org/codehaus/plexus/util/dag/Vertex +instanceKlass org/codehaus/plexus/util/dag/DAG +instanceKlass org/apache/maven/project/ProjectSorter +instanceKlass org/apache/maven/graph/DefaultProjectDependencyGraph +instanceKlass org/apache/maven/project/DefaultProjectBuildingResult +instanceKlass org/apache/maven/lifecycle/internal/DefaultLifecyclePluginAnalyzer$1 +instanceKlass org/apache/maven/lifecycle/mapping/LifecycleMojo +instanceKlass org/apache/maven/lifecycle/mapping/Lifecycle +instanceKlass org/apache/maven/model/building/DefaultModelBuildingEvent +instanceKlass org/apache/maven/model/building/ModelBuildingEventCatapult$1 +instanceKlass org/apache/maven/project/ReactorModelPool$CacheKey +instanceKlass org/apache/maven/project/DefaultProjectBuilder$InterimResult +instanceKlass org/apache/maven/artifact/versioning/Restriction +instanceKlass org/apache/maven/artifact/ArtifactUtils +instanceKlass org/apache/maven/artifact/DefaultArtifact +instanceKlass java/lang/Byte$ByteCache +instanceKlass java/lang/Short$ShortCache +instanceKlass java/lang/Long$LongCache +instanceKlass org/apache/commons/lang3/math/NumberUtils +instanceKlass org/apache/maven/artifact/versioning/ComparableVersion$IntItem +instanceKlass org/apache/maven/artifact/versioning/ComparableVersion$Item +instanceKlass org/apache/maven/artifact/versioning/ComparableVersion +instanceKlass org/apache/maven/artifact/versioning/DefaultArtifactVersion +instanceKlass java/util/Collections$1 +instanceKlass org/apache/maven/repository/internal/ArtifactDescriptorUtils +instanceKlass org/apache/maven/model/Extension +instanceKlass org/codehaus/plexus/interpolation/util/StringUtils +instanceKlass org/apache/maven/model/DistributionManagement +instanceKlass org/apache/maven/model/DependencyManagement +instanceKlass org/apache/maven/model/License +instanceKlass org/apache/maven/model/IssueManagement +instanceKlass org/apache/maven/model/Scm +instanceKlass org/apache/maven/model/Prerequisites +instanceKlass org/apache/maven/model/Organization +instanceKlass org/apache/maven/model/CiManagement +instanceKlass org/apache/maven/model/MailingList +instanceKlass org/apache/maven/model/Parent +instanceKlass org/codehaus/plexus/interpolation/reflection/MethodMap +instanceKlass org/codehaus/plexus/interpolation/reflection/ClassMap$CacheMiss +instanceKlass org/codehaus/plexus/interpolation/reflection/ClassMap +instanceKlass org/codehaus/plexus/interpolation/reflection/ReflectionValueExtractor$Tokenizer +instanceKlass org/codehaus/plexus/interpolation/reflection/ReflectionValueExtractor +instanceKlass org/codehaus/plexus/interpolation/util/ValueSourceUtils +instanceKlass org/apache/maven/model/interpolation/StringVisitorModelInterpolator$ModelVisitor +instanceKlass org/apache/maven/model/interpolation/StringVisitorModelInterpolator$1 +instanceKlass org/codehaus/plexus/interpolation/PrefixAwareRecursionInterceptor +instanceKlass org/codehaus/plexus/interpolation/StringSearchInterpolator +instanceKlass org/apache/maven/model/interpolation/UrlNormalizingPostProcessor +instanceKlass org/apache/maven/model/interpolation/PathTranslatingPostProcessor +instanceKlass java/text/DontCareFieldPosition$1 +instanceKlass java/text/Format$FieldDelegate +instanceKlass org/apache/maven/model/interpolation/MavenBuildTimestamp +instanceKlass org/apache/maven/model/interpolation/ProblemDetectingValueSource +instanceKlass org/codehaus/plexus/interpolation/PrefixedValueSourceWrapper +instanceKlass org/codehaus/plexus/interpolation/FeedbackEnabledValueSource +instanceKlass org/codehaus/plexus/interpolation/AbstractDelegatingValueSource +instanceKlass org/codehaus/plexus/interpolation/QueryEnabledValueSource +instanceKlass org/apache/maven/model/merge/ModelMerger$ExtensionKeyComputer +instanceKlass org/apache/maven/model/merge/ModelMerger$ResourceKeyComputer +instanceKlass java/util/Collections$EmptyEnumeration +instanceKlass org/apache/maven/model/merge/ModelMerger$SourceDominant +instanceKlass org/apache/maven/model/merge/ModelMerger$DependencyKeyComputer +instanceKlass org/apache/maven/model/ActivationProperty +instanceKlass org/apache/maven/model/building/DefaultModelProblem +instanceKlass org/apache/maven/model/building/ModelProblemCollectorRequest +instanceKlass org/apache/maven/model/building/ModelProblemUtils +instanceKlass org/apache/maven/model/io/xpp3/MavenXpp3ReaderEx$Xpp3DomBuilderInputLocationBuilder +instanceKlass org/apache/maven/model/io/xpp3/MavenXpp3ReaderEx$1 +instanceKlass org/codehaus/plexus/util/xml/Xpp3DomBuilder$InputLocationBuilder +instanceKlass org/apache/maven/model/io/xpp3/MavenXpp3ReaderEx$ContentTransformer +instanceKlass org/apache/maven/model/io/xpp3/MavenXpp3ReaderEx +instanceKlass org/apache/maven/model/building/ModelSource2 +instanceKlass org/apache/maven/model/building/DefaultModelBuildingResult +instanceKlass org/apache/maven/model/building/AbstractModelBuildingListener +instanceKlass org/apache/maven/project/ProjectModelResolver +instanceKlass org/apache/maven/model/building/DefaultModelBuildingRequest +instanceKlass org/apache/maven/artifact/repository/LegacyLocalRepositoryManager +instanceKlass org/apache/maven/project/DefaultProjectBuildingRequest +instanceKlass org/slf4j/impl/OutputChoice$1 +instanceKlass org/apache/maven/shared/utils/logging/AnsiMessageBuilder +instanceKlass org/apache/maven/shared/utils/logging/MessageBuilder +instanceKlass org/netbeans/shaded/json/simple/JSONValue +instanceKlass org/netbeans/shaded/json/simple/JSONStreamAware +instanceKlass org/netbeans/shaded/json/simple/JSONAware +instanceKlass org/apache/maven/lifecycle/internal/DefaultExecutionEventCatapult$1 +instanceKlass org/apache/maven/lifecycle/internal/DefaultExecutionEvent +instanceKlass org/apache/maven/AbstractMavenLifecycleParticipant +instanceKlass org/apache/maven/settings/RuntimeInfo +instanceKlass org/eclipse/aether/repository/RemoteRepository$Builder +instanceKlass org/eclipse/aether/AbstractRepositoryListener +instanceKlass org/eclipse/aether/util/repository/DefaultAuthenticationSelector +instanceKlass org/eclipse/aether/util/repository/DefaultProxySelector +instanceKlass org/eclipse/aether/util/repository/DefaultMirrorSelector +instanceKlass org/apache/maven/settings/crypto/DefaultSettingsDecryptionResult +instanceKlass org/apache/maven/settings/crypto/DefaultSettingsDecryptionRequest +instanceKlass org/eclipse/aether/internal/impl/TrackingFileManager +instanceKlass org/eclipse/aether/internal/impl/SimpleLocalRepositoryManager +instanceKlass java/util/ArrayList$SubList$1 +instanceKlass org/eclipse/aether/internal/impl/PrioritizedComponent +instanceKlass org/eclipse/sisu/wire/EntrySetAdapter$ValueIterator +instanceKlass org/eclipse/aether/util/ConfigUtils +instanceKlass org/eclipse/aether/internal/impl/PrioritizedComponents +instanceKlass org/apache/maven/RepositoryUtils$MavenArtifactTypeRegistry +instanceKlass org/apache/maven/RepositoryUtils +instanceKlass org/eclipse/aether/util/repository/SimpleResolutionErrorPolicy +instanceKlass org/eclipse/aether/util/repository/SimpleArtifactDescriptorPolicy +instanceKlass org/eclipse/aether/artifact/DefaultArtifactType +instanceKlass org/eclipse/aether/util/artifact/SimpleArtifactTypeRegistry +instanceKlass org/eclipse/aether/util/graph/transformer/JavaDependencyContextRefiner +instanceKlass org/eclipse/aether/util/graph/transformer/ChainedDependencyGraphTransformer +instanceKlass org/eclipse/aether/util/graph/transformer/ConflictResolver +instanceKlass org/eclipse/aether/graph/Exclusion +instanceKlass org/eclipse/aether/util/graph/selector/ExclusionDependencySelector +instanceKlass org/eclipse/aether/util/graph/selector/OptionalDependencySelector +instanceKlass org/eclipse/aether/util/graph/selector/ScopeDependencySelector +instanceKlass org/eclipse/aether/util/graph/selector/AndDependencySelector +instanceKlass org/eclipse/aether/util/graph/manager/ClassicDependencyManager +instanceKlass org/eclipse/aether/util/graph/traverser/FatArtifactTraverser +instanceKlass org/eclipse/aether/DefaultSessionData +instanceKlass org/eclipse/aether/DefaultRepositorySystemSession$NullFileTransformerManager +instanceKlass org/eclipse/aether/transform/FileTransformerManager +instanceKlass org/eclipse/aether/DefaultRepositorySystemSession$NullArtifactTypeRegistry +instanceKlass org/eclipse/aether/DefaultRepositorySystemSession$NullAuthenticationSelector +instanceKlass org/eclipse/aether/DefaultRepositorySystemSession$NullProxySelector +instanceKlass org/eclipse/aether/DefaultRepositorySystemSession$NullMirrorSelector +instanceKlass org/eclipse/aether/SessionData +instanceKlass org/eclipse/aether/artifact/ArtifactTypeRegistry +instanceKlass org/eclipse/aether/artifact/ArtifactType +instanceKlass org/eclipse/aether/util/graph/transformer/ConflictResolver$VersionSelector +instanceKlass org/eclipse/aether/util/graph/transformer/ConflictResolver$ScopeSelector +instanceKlass org/eclipse/aether/util/graph/transformer/ConflictResolver$OptionalitySelector +instanceKlass org/eclipse/aether/util/graph/transformer/ConflictResolver$ScopeDeriver +instanceKlass org/apache/maven/repository/internal/MavenRepositorySystemUtils +instanceKlass org/apache/maven/execution/DefaultMavenExecutionResult +instanceKlass org/apache/maven/artifact/repository/MavenArtifactRepository +instanceKlass org/apache/maven/artifact/repository/layout/ArtifactRepositoryLayout2 +instanceKlass org/apache/maven/execution/AbstractExecutionListener +instanceKlass java/util/Collections$SynchronizedMap +instanceKlass org/eclipse/aether/transfer/AbstractTransferListener +instanceKlass org/apache/maven/toolchain/building/DefaultToolchainsBuildingResult +instanceKlass org/apache/maven/toolchain/building/DefaultToolchainsBuilder$1 +instanceKlass org/apache/maven/toolchain/model/io/xpp3/MavenToolchainsXpp3Writer +instanceKlass org/apache/maven/toolchain/model/io/xpp3/MavenToolchainsXpp3Reader$1 +instanceKlass org/apache/maven/toolchain/model/io/xpp3/MavenToolchainsXpp3Reader$ContentTransformer +instanceKlass org/apache/maven/toolchain/model/io/xpp3/MavenToolchainsXpp3Reader +instanceKlass org/apache/maven/building/DefaultProblemCollector +instanceKlass org/apache/maven/building/ProblemCollectorFactory +instanceKlass org/apache/maven/toolchain/building/DefaultToolchainsBuildingRequest +instanceKlass org/apache/maven/settings/building/DefaultSettingsBuildingResult +instanceKlass org/codehaus/plexus/interpolation/SimpleRecursionInterceptor +instanceKlass org/apache/maven/settings/building/DefaultSettingsBuilder$1 +instanceKlass org/codehaus/plexus/interpolation/os/OperatingSystemUtils$DefaultEnvVarSource +instanceKlass org/codehaus/plexus/interpolation/os/OperatingSystemUtils$EnvVarSource +instanceKlass org/codehaus/plexus/interpolation/os/OperatingSystemUtils +instanceKlass org/codehaus/plexus/interpolation/AbstractValueSource +instanceKlass org/codehaus/plexus/interpolation/RegexBasedInterpolator +instanceKlass org/codehaus/plexus/util/xml/pull/MXSerializer +instanceKlass org/codehaus/plexus/util/xml/pull/XmlSerializer +instanceKlass org/apache/maven/settings/io/xpp3/SettingsXpp3Writer +instanceKlass org/codehaus/plexus/util/xml/pull/EntityReplacementMap +instanceKlass org/apache/maven/settings/io/xpp3/SettingsXpp3Reader$1 +instanceKlass org/apache/maven/settings/io/xpp3/SettingsXpp3Reader$ContentTransformer +instanceKlass org/apache/maven/settings/io/xpp3/SettingsXpp3Reader +instanceKlass org/apache/maven/building/FileSource +instanceKlass org/apache/maven/settings/building/DefaultSettingsBuildingRequest +instanceKlass org/apache/maven/plugin/CompoundMojoExecutionListener +instanceKlass org/apache/maven/project/RepositorySessionDecorator +instanceKlass com/google/inject/internal/BytecodeGen +instanceKlass com/google/inject/internal/DelegatingInvocationHandler +instanceKlass java/security/SecureRandomSpi +instanceKlass sun/security/util/MessageDigestSpi2 +instanceKlass sun/security/jca/GetInstance$Instance +instanceKlass java/security/Provider$UString +instanceKlass java/security/Provider$Service +instanceKlass sun/security/provider/NativePRNG$NonBlocking +instanceKlass sun/security/provider/NativePRNG$Blocking +instanceKlass sun/security/provider/NativePRNG +instanceKlass sun/security/provider/SunEntries$1 +instanceKlass sun/security/provider/SunEntries +instanceKlass sun/security/jca/ProviderConfig$2 +instanceKlass sun/security/jca/ProviderList$2 +instanceKlass sun/misc/FDBigInteger +instanceKlass sun/misc/FloatingDecimal$PreparedASCIIToBinaryBuffer +instanceKlass sun/misc/FloatingDecimal$ASCIIToBinaryConverter +instanceKlass sun/misc/FloatingDecimal$BinaryToASCIIBuffer +instanceKlass sun/misc/FloatingDecimal$ExceptionalBinaryToASCIIBuffer +instanceKlass sun/misc/FloatingDecimal$BinaryToASCIIConverter +instanceKlass sun/misc/FloatingDecimal +instanceKlass java/security/Provider$EngineDescription +instanceKlass java/security/Provider$ServiceKey +instanceKlass sun/security/jca/ProviderConfig +instanceKlass sun/security/jca/ProviderList +instanceKlass sun/security/jca/Providers +instanceKlass sun/security/jca/GetInstance +instanceKlass java/security/Security$1 +instanceKlass java/security/Security +instanceKlass java/security/MessageDigestSpi +instanceKlass java/security/spec/AlgorithmParameterSpec +instanceKlass java/security/Key +instanceKlass org/sonatype/plexus/components/sec/dispatcher/PasswordDecryptor +instanceKlass org/apache/maven/artifact/resolver/DefaultArtifactResolver$DaemonThreadCreator +instanceKlass java/util/concurrent/ThreadPoolExecutor$AbortPolicy +instanceKlass java/util/concurrent/RejectedExecutionHandler +instanceKlass java/util/concurrent/AbstractExecutorService +instanceKlass java/util/concurrent/ExecutorService +instanceKlass org/codehaus/plexus/classworlds/realm/Entry +instanceKlass java/util/Random +instanceKlass org/eclipse/sisu/inject/Guice4$1 +instanceKlass org/apache/maven/model/Contributor +instanceKlass org/apache/maven/model/PatternSet +instanceKlass org/apache/maven/model/merge/ModelMerger$KeyComputer +instanceKlass org/apache/maven/model/merge/ModelMerger$Remapping +instanceKlass org/apache/maven/cli/event/DefaultEventSpyContext +instanceKlass org/eclipse/sisu/wire/EntryListAdapter$ValueIterator +instanceKlass org/apache/maven/cli/logging/Slf4jLogger +instanceKlass org/eclipse/sisu/inject/LazyBeanEntry$JsrNamed +instanceKlass org/eclipse/sisu/inject/LazyBeanEntry +instanceKlass org/eclipse/sisu/inject/Implementations +instanceKlass org/eclipse/sisu/plexus/LazyPlexusBean +instanceKlass org/eclipse/sisu/inject/RankedSequence$Itr +instanceKlass org/eclipse/sisu/inject/RankedBindings$Itr +instanceKlass org/eclipse/sisu/inject/LocatedBeans$Itr +instanceKlass org/eclipse/sisu/plexus/RealmFilteredBeans$FilteredItr +instanceKlass org/eclipse/sisu/plexus/DefaultPlexusBeans$Itr +instanceKlass org/eclipse/sisu/plexus/DefaultPlexusBeans +instanceKlass org/eclipse/sisu/plexus/RealmFilteredBeans +instanceKlass org/eclipse/sisu/inject/LocatedBeans +instanceKlass org/eclipse/sisu/inject/MildElements$Indexable +instanceKlass com/google/inject/internal/ProviderInternalFactory$1 +instanceKlass com/google/inject/internal/ConstructorInjector$1 +instanceKlass java/util/concurrent/ConcurrentHashMap$Traverser +instanceKlass org/eclipse/sisu/inject/MildValues$ValueItr +instanceKlass org/eclipse/sisu/inject/RankedSequence$Content +instanceKlass com/google/inject/internal/CircularDependencyProxy +instanceKlass org/eclipse/sisu/inject/InjectorBindings +instanceKlass com/google/inject/spi/ProvisionListener$ProvisionInvocation +instanceKlass com/google/inject/internal/MembersInjectorImpl$1 +instanceKlass com/google/inject/internal/InternalContext +instanceKlass com/google/inject/internal/Initializer$1 +instanceKlass com/google/common/collect/TransformedIterator +instanceKlass com/google/common/collect/CompactHashMap$Itr +instanceKlass com/google/common/collect/AbstractMapBasedMultimap$AsMap$AsMapIterator +instanceKlass com/google/inject/internal/SingleMethodInjector$1 +instanceKlass com/google/inject/internal/InjectorImpl$MethodInvoker +instanceKlass com/google/inject/internal/SingleMethodInjector +instanceKlass com/google/inject/internal/InjectorImpl$ProviderBindingImpl$1 +instanceKlass com/google/inject/internal/InjectorImpl$1 +instanceKlass com/google/inject/internal/SingleFieldInjector +instanceKlass com/google/inject/internal/SingleParameterInjector +instanceKlass org/eclipse/sisu/plexus/PlexusConfigurations$ConfigurationProvider +instanceKlass org/eclipse/sisu/bean/BeanPropertySetter +instanceKlass javax/annotation/PreDestroy +instanceKlass javax/annotation/PostConstruct +instanceKlass com/google/inject/internal/MembersInjectorImpl +instanceKlass org/eclipse/sisu/bean/BeanInjector +instanceKlass org/eclipse/sisu/plexus/PlexusLifecycleManager$2 +instanceKlass org/eclipse/sisu/bean/PropertyBinder$1 +instanceKlass org/eclipse/sisu/plexus/ProvidedPropertyBinding +instanceKlass org/eclipse/sisu/plexus/PlexusRequirements$AbstractRequirementProvider +instanceKlass org/eclipse/sisu/bean/BeanPropertyField +instanceKlass org/eclipse/sisu/bean/DeclaredMembers$MemberIterator +instanceKlass org/eclipse/sisu/bean/BeanPropertyIterator +instanceKlass org/eclipse/sisu/bean/DeclaredMembers +instanceKlass org/eclipse/sisu/bean/IgnoreSetters +instanceKlass org/eclipse/sisu/bean/BeanProperties +instanceKlass org/eclipse/sisu/plexus/PlexusRequirements +instanceKlass org/eclipse/sisu/plexus/PlexusConfigurations +instanceKlass org/eclipse/sisu/plexus/PlexusPropertyBinder +instanceKlass org/eclipse/sisu/bean/BeanLifecycle +instanceKlass com/google/inject/internal/EncounterImpl +instanceKlass com/google/inject/internal/AbstractBindingProcessor$Processor$1 +instanceKlass org/apache/maven/session/scope/internal/SessionScope$2 +instanceKlass org/apache/maven/execution/scope/internal/MojoExecutionScope$2 +instanceKlass com/google/inject/internal/ProviderInternalFactory +instanceKlass com/google/inject/internal/InternalProviderInstanceBindingImpl$Factory +instanceKlass com/google/inject/internal/FactoryProxy +instanceKlass com/google/inject/internal/InternalFactoryToProviderAdapter +instanceKlass com/google/inject/internal/ConstructionContext +instanceKlass com/google/inject/internal/SingletonScope$1 +instanceKlass com/google/inject/internal/ProviderToInternalFactoryAdapter +instanceKlass com/google/inject/internal/CycleDetectingLock$CycleDetectingLockFactory$ReentrantCycleDetectingLock +instanceKlass com/google/inject/internal/Initializer$InjectableReference +instanceKlass com/google/common/collect/Collections2 +instanceKlass com/google/inject/internal/ProvisionListenerStackCallback +instanceKlass com/google/common/cache/LocalCache$AbstractReferenceEntry +instanceKlass com/google/inject/internal/ProvisionListenerCallbackStore$KeyBinding +instanceKlass com/google/inject/internal/util/Classes +instanceKlass com/google/inject/spi/ExposedBinding +instanceKlass com/google/inject/internal/CreationListener +instanceKlass com/google/inject/internal/InjectorShell$LoggerFactory +instanceKlass com/google/inject/internal/InjectorShell$InjectorFactory +instanceKlass com/google/inject/internal/Initializables$1 +instanceKlass com/google/inject/internal/Initializables +instanceKlass com/google/inject/internal/ConstantFactory +instanceKlass com/google/inject/internal/InjectorShell +instanceKlass com/google/inject/internal/ProvisionListenerCallbackStore +instanceKlass com/google/inject/internal/SingleMemberInjector +instanceKlass com/google/inject/spi/TypeEncounter +instanceKlass com/google/inject/internal/MembersInjectorStore +instanceKlass com/google/inject/internal/TypeConverterBindingProcessor$4 +instanceKlass com/google/inject/internal/TypeConverterBindingProcessor$2 +instanceKlass com/google/inject/internal/TypeConverterBindingProcessor$1 +instanceKlass com/google/inject/internal/TypeConverterBindingProcessor$5 +instanceKlass com/google/inject/internal/FailableCache +instanceKlass com/google/inject/internal/ConstructorInjectorStore +instanceKlass com/google/inject/internal/DeferredLookups +instanceKlass com/google/inject/spi/ProviderBinding +instanceKlass com/google/inject/spi/ConvertedConstantBinding +instanceKlass com/google/common/collect/ListMultimap +instanceKlass com/google/inject/internal/InjectorImpl +instanceKlass com/google/inject/internal/Lookups +instanceKlass com/google/inject/internal/InjectorImpl$InjectorOptions +instanceKlass org/eclipse/sisu/wire/PlaceholderBeanProvider +instanceKlass org/eclipse/sisu/wire/BeanProviders$3 +instanceKlass org/sonatype/inject/BeanEntry +instanceKlass org/eclipse/sisu/BeanEntry +instanceKlass com/google/inject/internal/ProvisionListenerStackCallback$ProvisionCallback +instanceKlass com/google/inject/internal/ConstructorInjector +instanceKlass com/google/inject/internal/DefaultConstructionProxyFactory$ReflectiveProxy +instanceKlass com/google/inject/internal/ConstructionProxy +instanceKlass com/google/inject/internal/DefaultConstructionProxyFactory +instanceKlass com/google/inject/internal/ConstructionProxyFactory +instanceKlass com/google/inject/internal/ConstructorBindingImpl$Factory +instanceKlass org/eclipse/sisu/inject/TypeArguments$Implicit +instanceKlass org/eclipse/sisu/wire/BeanProviders$4 +instanceKlass org/eclipse/sisu/wire/BeanProviders$7 +instanceKlass org/eclipse/sisu/wire/BeanProviders$1 +instanceKlass com/google/inject/spi/ProviderLookup$1 +instanceKlass com/google/inject/spi/ProviderWithDependencies +instanceKlass com/google/inject/spi/ProviderLookup +instanceKlass org/eclipse/sisu/wire/BeanProviders +instanceKlass org/eclipse/sisu/inject/HiddenSource +instanceKlass org/eclipse/sisu/wire/LocatorWiring +instanceKlass com/google/inject/ProvidedBy +instanceKlass com/google/inject/ImplementedBy +instanceKlass org/apache/maven/settings/crypto/SettingsDecryptionResult +instanceKlass org/apache/maven/settings/building/DefaultSettingsProblemCollector +instanceKlass org/apache/maven/settings/merge/MavenSettingsMerger +instanceKlass org/apache/maven/settings/building/SettingsBuildingResult +instanceKlass org/apache/maven/settings/building/SettingsProblemCollector +instanceKlass org/eclipse/aether/impl/MetadataGenerator +instanceKlass org/apache/maven/model/Relocation +instanceKlass org/eclipse/aether/internal/impl/DefaultArtifactResolver$ResolutionGroup +instanceKlass org/eclipse/aether/repository/LocalArtifactResult +instanceKlass com/google/common/base/ExtraObjectsMethodsForWeb +instanceKlass org/eclipse/aether/transform/FileTransformer +instanceKlass org/eclipse/aether/internal/impl/collect/DefaultVersionFilterContext +instanceKlass org/eclipse/aether/graph/DefaultDependencyNode +instanceKlass org/eclipse/aether/version/Version +instanceKlass org/eclipse/aether/internal/impl/collect/DefaultDependencyCollector$PremanagedDependency +instanceKlass org/eclipse/aether/internal/impl/collect/DataPool +instanceKlass org/eclipse/aether/graph/Dependency +instanceKlass org/eclipse/aether/collection/VersionFilter +instanceKlass org/eclipse/aether/collection/DependencyTraverser +instanceKlass org/eclipse/aether/collection/DependencyManager +instanceKlass org/eclipse/aether/internal/impl/collect/DefaultDependencyCollector$Results +instanceKlass org/eclipse/aether/internal/impl/collect/DefaultDependencyCollector$Args +instanceKlass org/eclipse/aether/collection/VersionFilter$VersionFilterContext +instanceKlass org/eclipse/aether/collection/DependencyGraphTransformationContext +instanceKlass org/eclipse/aether/collection/DependencyCollectionContext +instanceKlass org/eclipse/aether/transfer/TransferResource +instanceKlass org/eclipse/aether/spi/connector/checksum/ChecksumPolicy +instanceKlass org/eclipse/aether/resolution/ArtifactDescriptorResult +instanceKlass org/eclipse/aether/resolution/ArtifactDescriptorRequest +instanceKlass org/eclipse/aether/resolution/VersionRangeResult +instanceKlass org/eclipse/aether/resolution/VersionRangeRequest +instanceKlass org/eclipse/aether/resolution/DependencyResult +instanceKlass org/eclipse/aether/resolution/DependencyRequest +instanceKlass org/eclipse/aether/collection/CollectResult +instanceKlass org/eclipse/aether/collection/CollectRequest +instanceKlass org/eclipse/aether/resolution/ArtifactResult +instanceKlass org/eclipse/aether/resolution/ArtifactRequest +instanceKlass org/eclipse/aether/resolution/VersionResult +instanceKlass org/eclipse/aether/resolution/VersionRequest +instanceKlass org/eclipse/aether/installation/InstallResult +instanceKlass org/eclipse/aether/installation/InstallRequest +instanceKlass org/eclipse/aether/RepositoryEvent +instanceKlass org/eclipse/aether/impl/UpdateCheck +instanceKlass org/eclipse/aether/spi/connector/layout/RepositoryLayout +instanceKlass com/google/inject/util/Types +instanceKlass org/eclipse/aether/spi/io/FileProcessor$ProgressListener +instanceKlass org/eclipse/aether/spi/log/Logger +instanceKlass org/eclipse/aether/repository/RepositoryPolicy +instanceKlass org/eclipse/aether/internal/impl/DefaultDeployer$EventCatapult +instanceKlass org/eclipse/aether/deployment/DeployResult +instanceKlass org/eclipse/aether/deployment/DeployRequest +instanceKlass org/eclipse/aether/SyncContext +instanceKlass org/eclipse/aether/repository/LocalRepository +instanceKlass org/eclipse/aether/repository/LocalRepositoryManager +instanceKlass org/eclipse/aether/spi/connector/transport/Transporter +instanceKlass org/eclipse/aether/spi/locator/ServiceLocator +instanceKlass org/eclipse/aether/repository/RemoteRepository +instanceKlass org/eclipse/aether/spi/connector/RepositoryConnector +instanceKlass org/apache/maven/model/Activation +instanceKlass org/apache/maven/model/ActivationOS +instanceKlass org/apache/maven/model/profile/activation/JdkVersionProfileActivator$RangeValue +instanceKlass org/apache/maven/model/InputLocation +instanceKlass org/apache/maven/model/InputSource +instanceKlass org/apache/maven/model/interpolation/StringVisitorModelInterpolator$InnerInterpolator +instanceKlass org/apache/maven/model/building/ModelBuildingEventCatapult +instanceKlass org/apache/maven/model/profile/DefaultProfileActivationContext +instanceKlass org/apache/maven/model/building/ModelData +instanceKlass org/apache/maven/model/building/DefaultModelProblemCollector +instanceKlass org/apache/maven/model/building/ModelCacheTag +instanceKlass org/apache/maven/model/building/ModelBuildingEvent +instanceKlass org/apache/maven/model/building/ModelProblemCollectorExt +instanceKlass org/apache/maven/model/profile/ProfileActivationContext +instanceKlass org/apache/maven/cli/internal/extension/model/CoreExtension +instanceKlass org/apache/maven/building/ProblemCollector +instanceKlass org/apache/maven/toolchain/merge/MavenToolchainMerger +instanceKlass org/codehaus/plexus/interpolation/InterpolationPostProcessor +instanceKlass org/apache/maven/toolchain/building/ToolchainsBuildingResult +instanceKlass org/eclipse/aether/repository/AuthenticationSelector +instanceKlass org/eclipse/aether/repository/ProxySelector +instanceKlass org/eclipse/aether/repository/MirrorSelector +instanceKlass org/eclipse/aether/resolution/ResolutionErrorPolicy +instanceKlass org/eclipse/sisu/Nullable +instanceKlass org/apache/maven/classrealm/ClassRealmManagerDelegate +instanceKlass org/apache/maven/classrealm/ClassRealmConstituent +instanceKlass org/apache/maven/classrealm/ClassRealmRequest +instanceKlass org/eclipse/aether/repository/WorkspaceRepository +instanceKlass org/apache/maven/ArtifactFilterManagerDelegate +instanceKlass sun/reflect/generics/tree/MethodTypeSignature +instanceKlass sun/reflect/generics/tree/VoidDescriptor +instanceKlass org/apache/maven/plugin/internal/DefaultPluginManager +instanceKlass org/apache/maven/DefaultProjectDependenciesResolver +instanceKlass org/apache/maven/plugin/internal/DefaultLegacySupport +instanceKlass org/apache/maven/artifact/resolver/DefaultArtifactResolver +instanceKlass org/apache/maven/project/DefaultDependencyResolutionResult +instanceKlass org/apache/maven/project/DefaultProjectDependenciesResolver +instanceKlass org/apache/maven/lifecycle/mapping/LifecyclePhase +instanceKlass org/apache/maven/lifecycle/internal/DefaultLifecyclePluginAnalyzer$GoalSpec +instanceKlass org/apache/maven/lifecycle/internal/DefaultLifecyclePluginAnalyzer +instanceKlass org/apache/maven/repository/DefaultMirrorSelector +instanceKlass org/apache/maven/model/Reporting +instanceKlass org/apache/maven/model/PluginContainer +instanceKlass org/apache/maven/project/inheritance/DefaultModelInheritanceAssembler +instanceKlass org/apache/maven/execution/ExecutionEvent +instanceKlass org/apache/maven/lifecycle/internal/DefaultExecutionEventCatapult +instanceKlass org/apache/maven/lifecycle/internal/PhaseRecorder +instanceKlass org/apache/maven/lifecycle/internal/DependencyContext +instanceKlass org/apache/maven/lifecycle/internal/ProjectIndex +instanceKlass org/apache/maven/execution/ProjectDependencyGraph +instanceKlass org/apache/maven/graph/DefaultGraphBuilder +instanceKlass org/apache/maven/toolchain/DefaultToolchain +instanceKlass org/apache/maven/toolchain/java/JavaToolchain +instanceKlass org/apache/maven/toolchain/java/JavaToolchainFactory +instanceKlass org/apache/maven/repository/ArtifactTransferListener +instanceKlass org/apache/maven/settings/crypto/SettingsDecryptionRequest +instanceKlass org/apache/maven/repository/legacy/LegacyRepositorySystem +instanceKlass org/apache/maven/artifact/repository/layout/FlatRepositoryLayout +instanceKlass org/apache/maven/repository/legacy/resolver/transform/DefaultArtifactTransformationManager +instanceKlass org/apache/maven/project/artifact/ProjectArtifactsCache$CacheRecord +instanceKlass org/apache/maven/project/artifact/ProjectArtifactsCache$Key +instanceKlass org/apache/maven/project/artifact/DefaultProjectArtifactsCache +instanceKlass org/apache/maven/profiles/ProfilesRoot +instanceKlass java/util/concurrent/atomic/AtomicBoolean +instanceKlass org/apache/maven/eventspy/AbstractEventSpy +instanceKlass org/apache/maven/lifecycle/internal/DefaultLifecycleMappingDelegate +instanceKlass org/apache/maven/lifecycle/internal/ProjectSegment +instanceKlass org/apache/maven/lifecycle/internal/builder/multithreaded/ThreadOutputMuxer +instanceKlass org/apache/maven/lifecycle/internal/builder/multithreaded/ConcurrencyDependencyGraph +instanceKlass java/util/concurrent/CompletionService +instanceKlass java/util/concurrent/Executor +instanceKlass java/util/concurrent/ThreadFactory +instanceKlass org/apache/maven/lifecycle/internal/builder/multithreaded/MultiThreadedBuilder +instanceKlass org/apache/maven/plugin/PluginRealmCache$CacheRecord +instanceKlass org/apache/maven/plugin/PluginRealmCache$Key +instanceKlass org/apache/maven/plugin/DefaultPluginRealmCache +instanceKlass org/apache/maven/plugin/prefix/PluginPrefixResult +instanceKlass org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResolver +instanceKlass org/codehaus/plexus/interpolation/Interpolator +instanceKlass org/codehaus/plexus/interpolation/BasicInterpolator +instanceKlass org/codehaus/plexus/interpolation/ValueSource +instanceKlass org/codehaus/plexus/interpolation/RecursionInterceptor +instanceKlass org/apache/maven/lifecycle/internal/DefaultLifecycleExecutionPlanCalculator +instanceKlass org/apache/maven/execution/ProjectExecutionListener +instanceKlass org/apache/maven/lifecycle/internal/ReactorBuildStatus +instanceKlass org/apache/maven/lifecycle/internal/ProjectBuildList +instanceKlass org/apache/maven/lifecycle/internal/builder/singlethreaded/SingleThreadedBuilder +instanceKlass org/apache/maven/project/ProjectRealmCache$Key +instanceKlass org/apache/maven/project/DefaultProjectRealmCache +instanceKlass org/apache/maven/artifact/factory/DefaultArtifactFactory +instanceKlass org/apache/maven/lifecycle/internal/ReactorContext +instanceKlass org/apache/maven/lifecycle/internal/TaskSegment +instanceKlass org/apache/maven/execution/BuildSummary +instanceKlass org/apache/maven/repository/legacy/repository/DefaultArtifactRepositoryFactory +instanceKlass org/apache/maven/wagon/observers/ChecksumObserver +instanceKlass org/apache/maven/repository/legacy/DefaultWagonManager +instanceKlass org/apache/maven/artifact/repository/DefaultArtifactRepositoryFactory +instanceKlass org/apache/maven/repository/legacy/resolver/conflict/NearestConflictResolver +instanceKlass org/apache/maven/plugin/PluginArtifactsCache$CacheRecord +instanceKlass org/apache/maven/plugin/PluginArtifactsCache$Key +instanceKlass org/apache/maven/plugin/DefaultPluginArtifactsCache +instanceKlass org/apache/maven/artifact/handler/manager/DefaultArtifactHandlerManager +instanceKlass org/apache/maven/toolchain/model/TrackableBase +instanceKlass org/apache/maven/toolchain/DefaultToolchainsBuilder +instanceKlass org/apache/maven/model/RepositoryPolicy +instanceKlass org/apache/maven/settings/RepositoryPolicy +instanceKlass org/apache/maven/repository/Proxy +instanceKlass org/apache/maven/artifact/repository/Authentication +instanceKlass org/apache/maven/settings/RepositoryBase +instanceKlass org/apache/maven/artifact/handler/DefaultArtifactHandler +instanceKlass org/eclipse/aether/artifact/Artifact +instanceKlass org/eclipse/aether/collection/DependencySelector +instanceKlass org/eclipse/aether/resolution/ArtifactDescriptorPolicy +instanceKlass org/eclipse/aether/collection/DependencyGraphTransformer +instanceKlass org/apache/maven/plugin/internal/DefaultPluginDependenciesResolver +instanceKlass org/apache/maven/repository/legacy/resolver/conflict/NewestConflictResolver +instanceKlass org/apache/maven/lifecycle/mapping/DefaultLifecycleMapping +instanceKlass org/apache/maven/project/path/DefaultPathTranslator +instanceKlass org/apache/maven/project/DependencyResolutionResult +instanceKlass org/apache/maven/project/ReactorModelPool +instanceKlass org/apache/maven/model/building/ModelBuildingResult +instanceKlass org/apache/maven/project/DefaultProjectBuilder$InternalConfig +instanceKlass org/apache/maven/project/ReactorModelCache +instanceKlass org/apache/maven/project/DependencyResolutionRequest +instanceKlass org/apache/maven/model/building/ModelCache +instanceKlass org/apache/maven/model/resolution/ModelResolver +instanceKlass org/apache/maven/model/RepositoryBase +instanceKlass org/apache/maven/model/building/ModelBuildingListener +instanceKlass org/apache/maven/project/DefaultProjectBuilder +instanceKlass org/apache/maven/project/ProjectRealmCache$CacheRecord +instanceKlass org/apache/maven/project/DefaultProjectBuildingHelper +instanceKlass org/apache/maven/wagon/providers/http/httpclient/config/Registry +instanceKlass org/apache/maven/wagon/providers/http/httpclient/impl/conn/PoolingHttpClientConnectionManager +instanceKlass org/apache/maven/wagon/providers/http/httpclient/pool/ConnPoolControl +instanceKlass org/apache/maven/wagon/providers/http/httpclient/client/methods/CloseableHttpResponse +instanceKlass org/apache/maven/wagon/providers/http/wagon/shared/BasicAuthScope +instanceKlass org/apache/maven/wagon/providers/http/wagon/shared/HttpConfiguration +instanceKlass org/apache/maven/wagon/providers/http/httpclient/impl/client/CloseableHttpClient +instanceKlass org/apache/maven/wagon/providers/http/httpclient/client/HttpClient +instanceKlass org/apache/maven/wagon/providers/http/httpclient/Header +instanceKlass org/apache/maven/wagon/providers/http/httpclient/NameValuePair +instanceKlass org/apache/maven/wagon/providers/http/httpclient/client/ServiceUnavailableRetryStrategy +instanceKlass org/apache/maven/wagon/providers/http/httpclient/client/HttpRequestRetryHandler +instanceKlass org/apache/maven/wagon/providers/http/httpclient/conn/ssl/TrustStrategy +instanceKlass org/apache/maven/wagon/providers/http/httpclient/ssl/TrustStrategy +instanceKlass org/apache/maven/wagon/providers/http/httpclient/auth/Credentials +instanceKlass org/apache/maven/wagon/providers/http/httpclient/client/AuthCache +instanceKlass org/apache/maven/wagon/providers/http/httpclient/client/CredentialsProvider +instanceKlass org/apache/maven/wagon/providers/http/httpclient/config/Lookup +instanceKlass org/apache/maven/wagon/providers/http/httpclient/protocol/HttpContext +instanceKlass org/apache/maven/wagon/providers/http/httpclient/HttpEntity +instanceKlass org/apache/maven/wagon/providers/http/httpclient/HttpResponse +instanceKlass org/apache/maven/wagon/providers/http/httpclient/client/methods/HttpUriRequest +instanceKlass org/apache/maven/wagon/providers/http/httpclient/HttpRequest +instanceKlass org/apache/maven/wagon/providers/http/httpclient/HttpMessage +instanceKlass org/apache/maven/wagon/providers/http/httpclient/auth/AuthScheme +instanceKlass org/apache/maven/wagon/providers/http/httpclient/conn/HttpClientConnectionManager +instanceKlass org/apache/maven/rtinfo/internal/DefaultRuntimeInformation +instanceKlass org/apache/maven/plugin/version/internal/DefaultPluginVersionResolver$Versions +instanceKlass org/apache/maven/plugin/version/internal/DefaultPluginVersionResult +instanceKlass org/eclipse/aether/RequestTrace +instanceKlass org/eclipse/aether/version/VersionScheme +instanceKlass org/eclipse/aether/repository/ArtifactRepository +instanceKlass org/eclipse/aether/metadata/Metadata +instanceKlass org/apache/maven/plugin/version/PluginVersionResult +instanceKlass org/apache/maven/plugin/version/internal/DefaultPluginVersionResolver +instanceKlass org/apache/maven/artifact/repository/metadata/Versioning +instanceKlass org/apache/maven/lifecycle/internal/DefaultLifecycleTaskSegmentCalculator +instanceKlass org/apache/maven/repository/metadata/DefaultGraphConflictResolutionPolicy +instanceKlass org/apache/maven/lifecycle/MavenExecutionPlan +instanceKlass org/apache/maven/lifecycle/DefaultLifecycleExecutor +instanceKlass org/apache/maven/repository/metadata/ClasspathContainer +instanceKlass org/apache/maven/repository/metadata/DefaultClasspathTransformation +instanceKlass org/apache/maven/lifecycle/internal/DefaultMojoExecutionConfigurator +instanceKlass org/apache/maven/artifact/repository/layout/DefaultRepositoryLayout +instanceKlass org/apache/maven/repository/legacy/resolver/conflict/FarthestConflictResolver +instanceKlass org/apache/maven/artifact/repository/ArtifactRepositoryPolicy +instanceKlass org/apache/maven/project/artifact/DefaultMavenMetadataCache$CacheKey +instanceKlass org/apache/maven/project/artifact/DefaultMavenMetadataCache +instanceKlass org/apache/maven/wagon/InputData +instanceKlass org/apache/maven/wagon/OutputData +instanceKlass java/util/EventObject +instanceKlass org/apache/maven/wagon/events/SessionListener +instanceKlass org/apache/maven/wagon/resource/Resource +instanceKlass org/apache/maven/wagon/repository/RepositoryPermissions +instanceKlass org/apache/maven/wagon/proxy/ProxyInfo +instanceKlass org/apache/maven/wagon/authentication/AuthenticationInfo +instanceKlass org/apache/maven/wagon/events/TransferEventSupport +instanceKlass org/apache/maven/wagon/events/SessionEventSupport +instanceKlass org/apache/maven/wagon/repository/Repository +instanceKlass org/apache/maven/wagon/proxy/ProxyInfoProvider +instanceKlass org/apache/maven/wagon/AbstractWagon +instanceKlass org/apache/maven/wagon/StreamingWagon +instanceKlass org/codehaus/classworlds/ClassRealm +instanceKlass org/codehaus/plexus/component/configurator/AbstractComponentConfigurator +instanceKlass org/apache/maven/project/artifact/MavenMetadataSource$ProjectRelocation +instanceKlass org/apache/maven/model/Dependency +instanceKlass org/apache/maven/repository/legacy/metadata/ResolutionGroup +instanceKlass org/apache/maven/project/artifact/MavenMetadataSource +instanceKlass org/apache/maven/settings/TrackableBase +instanceKlass org/apache/maven/settings/building/SettingsBuildingRequest +instanceKlass org/apache/maven/plugin/ExtensionRealmCache$Key +instanceKlass org/apache/maven/plugin/DefaultExtensionRealmCache +instanceKlass org/eclipse/aether/RepositoryListener +instanceKlass org/eclipse/aether/util/graph/visitor/AbstractDepthFirstNodeListGenerator +instanceKlass org/eclipse/aether/graph/DependencyNode +instanceKlass org/apache/maven/plugin/ExtensionRealmCache$CacheRecord +instanceKlass org/eclipse/aether/graph/DependencyFilter +instanceKlass org/apache/maven/plugin/descriptor/PluginDescriptorBuilder +instanceKlass org/codehaus/plexus/component/configurator/ConfigurationListener +instanceKlass org/eclipse/aether/graph/DependencyVisitor +instanceKlass org/apache/maven/plugin/logging/Log +instanceKlass org/apache/maven/plugin/internal/DefaultMavenPluginManager +instanceKlass org/apache/maven/artifact/versioning/ArtifactVersion +instanceKlass org/apache/maven/execution/DefaultRuntimeInformation +instanceKlass org/apache/maven/project/validation/ModelValidationResult +instanceKlass org/apache/maven/project/validation/DefaultModelValidator +instanceKlass org/apache/maven/plugin/DefaultBuildPluginManager +instanceKlass org/apache/maven/wagon/events/TransferListener +instanceKlass org/apache/maven/profiles/ProfileManager +instanceKlass org/apache/maven/model/building/ModelSource +instanceKlass org/apache/maven/project/ProjectBuilderConfiguration +instanceKlass org/apache/maven/project/DefaultMavenProjectBuilder +instanceKlass org/apache/maven/repository/legacy/resolver/conflict/OldestConflictResolver +instanceKlass org/apache/maven/artifact/repository/metadata/Metadata +instanceKlass org/apache/maven/artifact/repository/metadata/io/DefaultMetadataReader +instanceKlass org/sonatype/plexus/components/sec/dispatcher/model/SettingsSecurity +instanceKlass org/eclipse/sisu/space/asm/Item +instanceKlass org/eclipse/sisu/space/asm/ByteVector +instanceKlass org/eclipse/sisu/space/asm/MethodVisitor +instanceKlass org/eclipse/sisu/space/asm/FieldVisitor +instanceKlass org/sonatype/plexus/components/cipher/PBECipher +instanceKlass org/codehaus/plexus/component/repository/ComponentSetDescriptor +instanceKlass org/apache/maven/plugin/PluginDescriptorCache$Key +instanceKlass org/apache/maven/plugin/DefaultPluginDescriptorCache +instanceKlass org/apache/maven/artifact/versioning/VersionRange +instanceKlass org/apache/maven/artifact/resolver/ResolutionNode +instanceKlass org/apache/maven/artifact/resolver/filter/ArtifactFilter +instanceKlass org/apache/maven/repository/legacy/metadata/MetadataResolutionRequest +instanceKlass org/apache/maven/repository/legacy/resolver/DefaultLegacyArtifactCollector +instanceKlass org/apache/maven/repository/metadata/MetadataGraphEdge +instanceKlass org/apache/maven/repository/metadata/MetadataGraph +instanceKlass org/apache/maven/repository/metadata/MetadataGraphVertex +instanceKlass org/apache/maven/repository/metadata/DefaultGraphConflictResolver +instanceKlass org/apache/maven/repository/legacy/resolver/conflict/DefaultConflictResolverFactory +instanceKlass org/apache/maven/project/ProjectBuildingResult +instanceKlass org/apache/maven/exception/ExceptionSummary +instanceKlass org/apache/maven/model/building/ModelProblem +instanceKlass org/apache/maven/exception/DefaultExceptionHandler +instanceKlass java/lang/Deprecated +instanceKlass org/eclipse/aether/DefaultRepositorySystemSession +instanceKlass org/apache/maven/model/building/Result +instanceKlass org/eclipse/aether/RepositorySystemSession +instanceKlass org/apache/maven/execution/MavenExecutionResult +instanceKlass org/apache/maven/DefaultMaven +instanceKlass org/apache/maven/artifact/resolver/ArtifactResolutionResult +instanceKlass org/apache/maven/artifact/resolver/ArtifactResolutionRequest +instanceKlass org/apache/maven/artifact/repository/RepositoryRequest +instanceKlass org/apache/maven/artifact/resolver/DefaultResolutionErrorHandler +instanceKlass org/apache/maven/artifact/repository/metadata/RepositoryMetadata +instanceKlass org/apache/maven/artifact/metadata/ArtifactMetadata +instanceKlass org/apache/maven/repository/legacy/metadata/ArtifactMetadata +instanceKlass org/apache/maven/artifact/repository/ArtifactRepository +instanceKlass org/apache/maven/artifact/Artifact +instanceKlass java/nio/channels/WritableByteChannel +instanceKlass java/nio/channels/ReadableByteChannel +instanceKlass java/nio/channels/Channel +instanceKlass org/codehaus/plexus/logging/AbstractLogEnabled +instanceKlass org/apache/maven/configuration/BeanConfigurationRequest +instanceKlass org/codehaus/plexus/component/configurator/expression/ExpressionEvaluator +instanceKlass org/codehaus/plexus/configuration/PlexusConfiguration +instanceKlass org/codehaus/plexus/component/configurator/converters/lookup/ConverterLookup +instanceKlass org/apache/maven/configuration/internal/DefaultBeanConfigurator +instanceKlass org/apache/maven/model/building/ModelProblemCollector +instanceKlass org/apache/maven/model/building/ModelBuildingRequest +instanceKlass org/apache/maven/model/ModelBase +instanceKlass org/apache/maven/model/merge/ModelMerger +instanceKlass org/apache/maven/model/plugin/DefaultLifecycleBindingsInjector +instanceKlass org/apache/maven/toolchain/ToolchainPrivate +instanceKlass org/apache/maven/toolchain/Toolchain +instanceKlass org/apache/maven/toolchain/DefaultToolchainManager +instanceKlass org/apache/maven/model/ConfigurationContainer +instanceKlass org/apache/maven/model/InputLocationTracker +instanceKlass org/apache/maven/plugin/version/PluginVersionRequest +instanceKlass org/apache/maven/plugin/prefix/PluginPrefixRequest +instanceKlass org/eclipse/sisu/inject/Guice4 +instanceKlass com/google/inject/spi/ProviderWithExtensionVisitor +instanceKlass org/eclipse/sisu/plexus/PlexusBean +instanceKlass org/codehaus/plexus/component/repository/ComponentDescriptor +instanceKlass org/sonatype/inject/Parameters +instanceKlass org/eclipse/sisu/plexus/PlexusXmlBeanConverter +instanceKlass org/eclipse/sisu/plexus/PlexusBeanConverter +instanceKlass com/google/inject/spi/TypeConverterBinding +instanceKlass com/google/inject/spi/ProvisionListenerBinding +instanceKlass com/google/inject/spi/TypeListenerBinding +instanceKlass org/eclipse/sisu/bean/BeanListener +instanceKlass com/google/inject/matcher/Matchers +instanceKlass org/eclipse/sisu/bean/PropertyBinder +instanceKlass org/eclipse/sisu/plexus/PlexusBeanBinder +instanceKlass com/google/inject/spi/InjectionListener +instanceKlass org/sonatype/plexus/components/cipher/DefaultPlexusCipher +instanceKlass org/apache/maven/settings/validation/DefaultSettingsValidator +instanceKlass org/apache/maven/settings/validation/SettingsValidator +instanceKlass org/apache/maven/settings/io/DefaultSettingsWriter +instanceKlass org/apache/maven/settings/io/SettingsWriter +instanceKlass org/apache/maven/settings/io/DefaultSettingsReader +instanceKlass org/apache/maven/settings/io/SettingsReader +instanceKlass org/apache/maven/settings/crypto/DefaultSettingsDecrypter +instanceKlass org/apache/maven/settings/crypto/SettingsDecrypter +instanceKlass org/apache/maven/settings/building/DefaultSettingsBuilder +instanceKlass org/apache/maven/settings/building/SettingsBuilder +instanceKlass org/eclipse/aether/transport/wagon/WagonTransporterFactory +instanceKlass org/eclipse/aether/spi/connector/transport/TransporterFactory +instanceKlass org/eclipse/aether/internal/transport/wagon/PlexusWagonProvider +instanceKlass org/eclipse/aether/transport/wagon/WagonProvider +instanceKlass org/eclipse/aether/internal/transport/wagon/PlexusWagonConfigurator +instanceKlass org/eclipse/aether/transport/wagon/WagonConfigurator +instanceKlass org/apache/maven/repository/internal/VersionsMetadataGeneratorFactory +instanceKlass org/apache/maven/repository/internal/SnapshotMetadataGeneratorFactory +instanceKlass org/eclipse/aether/impl/MetadataGeneratorFactory +instanceKlass org/apache/maven/repository/internal/DefaultVersionResolver +instanceKlass org/eclipse/aether/impl/VersionResolver +instanceKlass org/apache/maven/repository/internal/DefaultVersionRangeResolver +instanceKlass org/eclipse/aether/impl/VersionRangeResolver +instanceKlass org/apache/maven/repository/internal/DefaultArtifactDescriptorReader +instanceKlass org/eclipse/aether/impl/ArtifactDescriptorReader +instanceKlass org/eclipse/aether/internal/impl/DefaultArtifactResolver +instanceKlass org/eclipse/aether/impl/ArtifactResolver +instanceKlass org/eclipse/aether/internal/impl/DefaultInstaller +instanceKlass org/eclipse/aether/impl/Installer +instanceKlass org/eclipse/aether/internal/impl/collect/DefaultDependencyCollector +instanceKlass org/eclipse/aether/impl/DependencyCollector +instanceKlass org/eclipse/aether/internal/impl/DefaultLocalRepositoryProvider +instanceKlass org/eclipse/aether/impl/LocalRepositoryProvider +instanceKlass org/eclipse/aether/internal/impl/DefaultChecksumPolicyProvider +instanceKlass org/eclipse/aether/spi/connector/checksum/ChecksumPolicyProvider +instanceKlass org/eclipse/aether/internal/impl/DefaultRepositorySystem +instanceKlass org/eclipse/aether/RepositorySystem +instanceKlass org/eclipse/aether/internal/impl/DefaultRepositoryEventDispatcher +instanceKlass org/eclipse/aether/impl/RepositoryEventDispatcher +instanceKlass org/eclipse/aether/internal/impl/DefaultUpdateCheckManager +instanceKlass org/eclipse/aether/impl/UpdateCheckManager +instanceKlass org/eclipse/aether/internal/impl/DefaultMetadataResolver +instanceKlass org/eclipse/aether/impl/MetadataResolver +instanceKlass org/eclipse/aether/internal/impl/DefaultRepositoryConnectorProvider +instanceKlass org/eclipse/aether/impl/RepositoryConnectorProvider +instanceKlass org/eclipse/aether/internal/impl/DefaultSyncContextFactory +instanceKlass org/eclipse/aether/impl/SyncContextFactory +instanceKlass org/eclipse/aether/internal/impl/Maven2RepositoryLayoutFactory +instanceKlass org/eclipse/aether/spi/connector/layout/RepositoryLayoutFactory +instanceKlass org/eclipse/aether/internal/impl/DefaultRepositoryLayoutProvider +instanceKlass org/eclipse/aether/spi/connector/layout/RepositoryLayoutProvider +instanceKlass org/eclipse/aether/internal/impl/LoggerFactoryProvider +instanceKlass org/eclipse/aether/internal/impl/DefaultUpdatePolicyAnalyzer +instanceKlass org/eclipse/aether/impl/UpdatePolicyAnalyzer +instanceKlass org/eclipse/aether/internal/impl/DefaultRemoteRepositoryManager +instanceKlass org/eclipse/aether/impl/RemoteRepositoryManager +instanceKlass org/eclipse/aether/internal/impl/DefaultOfflineController +instanceKlass org/eclipse/aether/impl/OfflineController +instanceKlass org/eclipse/aether/internal/impl/DefaultFileProcessor +instanceKlass org/eclipse/aether/spi/io/FileProcessor +instanceKlass org/eclipse/aether/internal/impl/EnhancedLocalRepositoryManagerFactory +instanceKlass org/eclipse/aether/internal/impl/slf4j/Slf4jLoggerFactory +instanceKlass org/eclipse/aether/spi/log/LoggerFactory +instanceKlass org/eclipse/aether/internal/impl/DefaultDeployer +instanceKlass org/eclipse/aether/impl/Deployer +instanceKlass org/eclipse/aether/internal/impl/SimpleLocalRepositoryManagerFactory +instanceKlass org/eclipse/aether/spi/localrepo/LocalRepositoryManagerFactory +instanceKlass org/eclipse/aether/internal/impl/DefaultTransporterProvider +instanceKlass org/eclipse/aether/spi/connector/transport/TransporterProvider +instanceKlass org/eclipse/aether/connector/basic/BasicRepositoryConnectorFactory +instanceKlass org/eclipse/aether/spi/locator/Service +instanceKlass org/eclipse/aether/spi/connector/RepositoryConnectorFactory +instanceKlass org/apache/maven/model/validation/DefaultModelValidator +instanceKlass org/apache/maven/model/validation/ModelValidator +instanceKlass org/apache/maven/model/superpom/DefaultSuperPomProvider +instanceKlass org/apache/maven/model/superpom/SuperPomProvider +instanceKlass org/apache/maven/model/profile/activation/PropertyProfileActivator +instanceKlass org/apache/maven/model/profile/activation/OperatingSystemProfileActivator +instanceKlass org/apache/maven/model/profile/activation/JdkVersionProfileActivator +instanceKlass org/apache/maven/model/profile/activation/FileProfileActivator +instanceKlass org/apache/maven/model/profile/activation/ProfileActivator +instanceKlass org/apache/maven/model/profile/DefaultProfileSelector +instanceKlass org/apache/maven/model/profile/ProfileSelector +instanceKlass org/apache/maven/model/profile/DefaultProfileInjector +instanceKlass org/apache/maven/model/profile/ProfileInjector +instanceKlass org/apache/maven/model/plugin/DefaultReportingConverter +instanceKlass org/apache/maven/model/plugin/ReportingConverter +instanceKlass org/apache/maven/model/plugin/DefaultReportConfigurationExpander +instanceKlass org/apache/maven/model/plugin/ReportConfigurationExpander +instanceKlass org/apache/maven/model/plugin/DefaultPluginConfigurationExpander +instanceKlass org/apache/maven/model/plugin/PluginConfigurationExpander +instanceKlass org/apache/maven/model/path/DefaultUrlNormalizer +instanceKlass org/apache/maven/model/path/UrlNormalizer +instanceKlass org/apache/maven/model/path/DefaultPathTranslator +instanceKlass org/apache/maven/model/path/PathTranslator +instanceKlass org/apache/maven/model/path/DefaultModelUrlNormalizer +instanceKlass org/apache/maven/model/path/ModelUrlNormalizer +instanceKlass org/apache/maven/model/path/DefaultModelPathTranslator +instanceKlass org/apache/maven/model/path/ModelPathTranslator +instanceKlass org/apache/maven/model/normalization/DefaultModelNormalizer +instanceKlass org/apache/maven/model/normalization/ModelNormalizer +instanceKlass org/apache/maven/model/management/DefaultPluginManagementInjector +instanceKlass org/apache/maven/model/management/PluginManagementInjector +instanceKlass org/apache/maven/model/management/DefaultDependencyManagementInjector +instanceKlass org/apache/maven/model/management/DependencyManagementInjector +instanceKlass org/apache/maven/model/locator/DefaultModelLocator +instanceKlass org/apache/maven/model/io/DefaultModelWriter +instanceKlass org/apache/maven/model/io/ModelWriter +instanceKlass org/apache/maven/model/io/DefaultModelReader +instanceKlass org/apache/maven/model/interpolation/AbstractStringBasedModelInterpolator +instanceKlass org/apache/maven/model/interpolation/ModelInterpolator +instanceKlass org/apache/maven/model/inheritance/DefaultInheritanceAssembler +instanceKlass org/apache/maven/model/inheritance/InheritanceAssembler +instanceKlass sun/reflect/ClassDefiner$1 +instanceKlass sun/reflect/ClassDefiner +instanceKlass sun/reflect/MethodAccessorGenerator$1 +instanceKlass sun/reflect/Label$PatchInfo +instanceKlass sun/reflect/Label +instanceKlass sun/reflect/UTF8 +instanceKlass sun/reflect/ClassFileAssembler +instanceKlass sun/reflect/ByteVectorImpl +instanceKlass sun/reflect/ByteVector +instanceKlass sun/reflect/ByteVectorFactory +instanceKlass sun/reflect/AccessorGenerator +instanceKlass sun/reflect/ClassFileConstants +instanceKlass org/apache/maven/model/composition/DefaultDependencyManagementImporter +instanceKlass org/apache/maven/model/composition/DependencyManagementImporter +instanceKlass org/apache/maven/model/building/DefaultModelProcessor +instanceKlass org/apache/maven/model/building/ModelProcessor +instanceKlass org/apache/maven/model/io/ModelReader +instanceKlass org/apache/maven/model/locator/ModelLocator +instanceKlass org/apache/maven/model/building/DefaultModelBuilder +instanceKlass org/apache/maven/model/building/ModelBuilder +instanceKlass org/apache/maven/cli/internal/BootstrapCoreExtensionManager +instanceKlass org/apache/maven/cli/configuration/SettingsXmlConfigurationProcessor +instanceKlass org/apache/maven/cli/configuration/ConfigurationProcessor +instanceKlass org/apache/maven/toolchain/io/DefaultToolchainsWriter +instanceKlass org/apache/maven/toolchain/io/ToolchainsWriter +instanceKlass org/apache/maven/toolchain/io/DefaultToolchainsReader +instanceKlass org/apache/maven/toolchain/io/ToolchainsReader +instanceKlass org/apache/maven/toolchain/building/DefaultToolchainsBuilder +instanceKlass org/apache/maven/toolchain/building/ToolchainsBuilder +instanceKlass org/apache/maven/execution/MavenSession +instanceKlass org/apache/maven/session/scope/internal/SessionScope$Memento +instanceKlass org/apache/maven/session/scope/internal/SessionScope$ScopeState +instanceKlass org/apache/maven/session/scope/internal/SessionScope$1 +instanceKlass org/apache/maven/session/scope/internal/SessionScope +instanceKlass org/apache/maven/lifecycle/internal/LifecycleDependencyResolver +instanceKlass org/apache/maven/lifecycle/internal/DefaultProjectArtifactFactory +instanceKlass org/apache/maven/lifecycle/internal/ProjectArtifactFactory +instanceKlass org/apache/maven/internal/aether/DefaultRepositorySystemSessionFactory +instanceKlass org/apache/maven/extension/internal/CoreExportsProvider +instanceKlass org/apache/maven/plugin/MojoExecution +instanceKlass org/apache/maven/project/MavenProject +instanceKlass org/apache/maven/execution/MojoExecutionEvent +instanceKlass org/apache/maven/execution/scope/internal/MojoExecutionScope$ScopeState +instanceKlass org/apache/maven/execution/scope/MojoExecutionScoped +instanceKlass org/apache/maven/execution/scope/internal/MojoExecutionScope$1 +instanceKlass org/apache/maven/execution/scope/internal/MojoExecutionScope +instanceKlass org/apache/maven/execution/MojoExecutionListener +instanceKlass org/eclipse/sisu/space/QualifiedTypeBinder$1 +instanceKlass org/apache/maven/execution/DefaultMavenExecutionRequestPopulator +instanceKlass org/apache/maven/execution/MavenExecutionRequestPopulator +instanceKlass org/apache/maven/classrealm/DefaultClassRealmManager +instanceKlass org/apache/maven/classrealm/ClassRealmManager +instanceKlass org/apache/maven/SessionScoped +instanceKlass org/apache/maven/ReactorReader +instanceKlass org/apache/maven/repository/internal/MavenWorkspaceReader +instanceKlass org/eclipse/aether/repository/WorkspaceReader +instanceKlass org/eclipse/sisu/space/WildcardKey$QualifiedImpl +instanceKlass org/eclipse/sisu/space/WildcardKey$Qualified +instanceKlass org/eclipse/sisu/space/WildcardKey +instanceKlass org/eclipse/sisu/Typed +instanceKlass org/sonatype/inject/EagerSingleton +instanceKlass org/eclipse/sisu/EagerSingleton +instanceKlass org/sonatype/inject/Mediator +instanceKlass org/eclipse/sisu/inject/TypeArguments +instanceKlass org/apache/maven/DefaultArtifactFilterManager +instanceKlass org/apache/maven/ArtifactFilterManager +instanceKlass org/eclipse/sisu/space/asm/Context +instanceKlass org/eclipse/sisu/space/asm/Attribute +instanceKlass org/eclipse/sisu/space/asm/AnnotationVisitor +instanceKlass org/eclipse/sisu/space/asm/ClassReader +instanceKlass org/eclipse/sisu/space/IndexedClassFinder$1 +instanceKlass org/eclipse/sisu/inject/Logs$SLF4JSink +instanceKlass org/eclipse/sisu/inject/Logs$Sink +instanceKlass org/eclipse/sisu/inject/Logs +instanceKlass org/eclipse/sisu/space/QualifierCache +instanceKlass org/eclipse/sisu/space/QualifiedTypeVisitor +instanceKlass org/eclipse/sisu/plexus/PlexusTypeVisitor$ComponentAnnotationVisitor +instanceKlass org/eclipse/sisu/space/AnnotationVisitor +instanceKlass org/eclipse/sisu/plexus/PlexusTypeVisitor +instanceKlass org/eclipse/sisu/space/ClassVisitor +instanceKlass org/eclipse/sisu/plexus/PlexusXmlBeanModule$PlexusXmlBeanSource +instanceKlass org/eclipse/sisu/inject/DescriptionSource +instanceKlass org/eclipse/sisu/inject/AnnotatedSource +instanceKlass org/eclipse/sisu/Priority +instanceKlass org/eclipse/sisu/Hidden +instanceKlass org/eclipse/sisu/Description +instanceKlass org/eclipse/sisu/inject/Sources +instanceKlass com/google/inject/Key$AnnotationInstanceStrategy +instanceKlass com/google/inject/name/NamedImpl +instanceKlass com/google/inject/name/Named +instanceKlass com/google/inject/name/Names +instanceKlass com/google/inject/internal/MoreTypes$ParameterizedTypeImpl +instanceKlass sun/reflect/generics/reflectiveObjects/ParameterizedTypeImpl +instanceKlass sun/reflect/generics/reflectiveObjects/LazyReflectiveObjectGenerator +instanceKlass org/apache/maven/wagon/Wagon +instanceKlass org/sonatype/plexus/components/cipher/PlexusCipher +instanceKlass org/codehaus/plexus/component/configurator/ComponentConfigurator +instanceKlass org/apache/maven/toolchain/ToolchainsBuilder +instanceKlass org/apache/maven/toolchain/ToolchainManagerPrivate +instanceKlass org/apache/maven/toolchain/ToolchainManager +instanceKlass org/apache/maven/toolchain/ToolchainFactory +instanceKlass org/apache/maven/settings/MavenSettingsBuilder +instanceKlass org/apache/maven/rtinfo/RuntimeInformation +instanceKlass org/apache/maven/project/artifact/ProjectArtifactsCache +instanceKlass org/apache/maven/project/artifact/MavenMetadataCache +instanceKlass org/apache/maven/project/ProjectRealmCache +instanceKlass org/apache/maven/project/ProjectDependenciesResolver +instanceKlass org/apache/maven/project/ProjectBuildingHelper +instanceKlass org/apache/maven/project/ProjectBuilder +instanceKlass org/apache/maven/project/MavenProjectHelper +instanceKlass org/apache/maven/plugin/version/PluginVersionResolver +instanceKlass org/apache/maven/plugin/prefix/PluginPrefixResolver +instanceKlass org/apache/maven/plugin/internal/PluginDependenciesResolver +instanceKlass org/apache/maven/plugin/PluginRealmCache +instanceKlass org/apache/maven/plugin/PluginManager +instanceKlass org/apache/maven/plugin/PluginDescriptorCache +instanceKlass org/apache/maven/plugin/PluginArtifactsCache +instanceKlass org/apache/maven/plugin/MavenPluginManager +instanceKlass org/apache/maven/plugin/LegacySupport +instanceKlass org/apache/maven/plugin/ExtensionRealmCache +instanceKlass org/apache/maven/plugin/BuildPluginManager +instanceKlass org/apache/maven/model/plugin/LifecycleBindingsInjector +instanceKlass org/apache/maven/lifecycle/internal/builder/BuilderCommon +instanceKlass org/apache/maven/lifecycle/internal/builder/Builder +instanceKlass org/apache/maven/lifecycle/internal/MojoExecutor +instanceKlass org/apache/maven/lifecycle/internal/MojoDescriptorCreator +instanceKlass org/apache/maven/lifecycle/internal/LifecycleTaskSegmentCalculator +instanceKlass org/apache/maven/lifecycle/internal/LifecycleStarter +instanceKlass org/apache/maven/lifecycle/internal/LifecyclePluginResolver +instanceKlass org/apache/maven/lifecycle/internal/LifecycleModuleBuilder +instanceKlass org/apache/maven/lifecycle/internal/LifecycleExecutionPlanCalculator +instanceKlass org/apache/maven/lifecycle/internal/LifecycleDebugLogger +instanceKlass org/apache/maven/lifecycle/internal/ExecutionEventCatapult +instanceKlass org/apache/maven/lifecycle/internal/BuildListCalculator +instanceKlass org/apache/maven/lifecycle/MojoExecutionConfigurator +instanceKlass org/apache/maven/lifecycle/LifecycleMappingDelegate +instanceKlass org/apache/maven/lifecycle/LifecycleExecutor +instanceKlass org/apache/maven/lifecycle/LifeCyclePluginAnalyzer +instanceKlass org/apache/maven/lifecycle/DefaultLifecycles +instanceKlass org/apache/maven/graph/GraphBuilder +instanceKlass org/apache/maven/eventspy/internal/EventSpyDispatcher +instanceKlass org/apache/maven/configuration/BeanConfigurator +instanceKlass org/apache/maven/bridge/MavenRepositorySystem +instanceKlass org/apache/maven/artifact/resolver/ResolutionErrorHandler +instanceKlass org/apache/maven/artifact/repository/metadata/io/MetadataReader +instanceKlass org/apache/maven/artifact/metadata/ArtifactMetadataSource +instanceKlass org/apache/maven/repository/legacy/metadata/ArtifactMetadataSource +instanceKlass org/apache/maven/artifact/handler/manager/ArtifactHandlerManager +instanceKlass org/apache/maven/artifact/factory/ArtifactFactory +instanceKlass org/apache/maven/ProjectDependenciesResolver +instanceKlass org/apache/maven/Maven +instanceKlass org/apache/maven/artifact/handler/ArtifactHandler +instanceKlass org/sonatype/plexus/components/sec/dispatcher/SecDispatcher +instanceKlass org/apache/maven/lifecycle/Lifecycle +instanceKlass org/eclipse/sisu/space/CloningClassSpace$1 +instanceKlass org/apache/maven/lifecycle/mapping/LifecycleMapping +instanceKlass org/apache/maven/repository/metadata/GraphConflictResolver +instanceKlass org/apache/maven/repository/metadata/GraphConflictResolutionPolicy +instanceKlass org/eclipse/sisu/plexus/ConfigurationImpl +instanceKlass org/apache/maven/repository/metadata/ClasspathTransformation +instanceKlass org/apache/maven/repository/legacy/resolver/transform/ArtifactTransformationManager +instanceKlass org/apache/maven/repository/legacy/resolver/transform/ArtifactTransformation +instanceKlass org/apache/maven/repository/legacy/resolver/conflict/ConflictResolverFactory +instanceKlass org/apache/maven/repository/legacy/resolver/conflict/ConflictResolver +instanceKlass org/apache/maven/repository/legacy/repository/ArtifactRepositoryFactory +instanceKlass org/apache/maven/repository/legacy/UpdateCheckManager +instanceKlass org/apache/maven/repository/RepositorySystem +instanceKlass org/apache/maven/repository/MirrorSelector +instanceKlass org/apache/maven/project/validation/ModelValidator +instanceKlass org/apache/maven/project/path/PathTranslator +instanceKlass org/apache/maven/project/interpolation/ModelInterpolator +instanceKlass org/apache/maven/project/inheritance/ModelInheritanceAssembler +instanceKlass org/apache/maven/project/MavenProjectBuilder +instanceKlass org/apache/maven/profiles/MavenProfilesBuilder +instanceKlass org/apache/maven/execution/RuntimeInformation +instanceKlass org/apache/maven/artifact/resolver/ArtifactResolver +instanceKlass org/apache/maven/artifact/resolver/ArtifactCollector +instanceKlass org/apache/maven/repository/legacy/resolver/LegacyArtifactCollector +instanceKlass org/apache/maven/artifact/repository/metadata/RepositoryMetadataManager +instanceKlass org/apache/maven/artifact/repository/layout/ArtifactRepositoryLayout +instanceKlass org/apache/maven/artifact/repository/ArtifactRepositoryFactory +instanceKlass org/apache/maven/artifact/manager/WagonManager +instanceKlass org/apache/maven/repository/legacy/WagonManager +instanceKlass org/apache/maven/artifact/installer/ArtifactInstaller +instanceKlass org/apache/maven/artifact/deployer/ArtifactDeployer +instanceKlass org/eclipse/sisu/plexus/PlexusXmlMetadata +instanceKlass org/eclipse/sisu/plexus/Roles +instanceKlass org/apache/maven/eventspy/EventSpy +instanceKlass org/eclipse/sisu/plexus/Hints +instanceKlass org/eclipse/sisu/space/AbstractDeferredClass +instanceKlass org/eclipse/sisu/plexus/RequirementImpl +instanceKlass org/codehaus/plexus/component/annotations/Requirement +instanceKlass org/eclipse/sisu/space/Streams +instanceKlass org/eclipse/sisu/plexus/ComponentImpl +instanceKlass org/codehaus/plexus/component/annotations/Component +instanceKlass org/eclipse/sisu/plexus/PlexusTypeRegistry +instanceKlass org/eclipse/sisu/plexus/PlexusXmlScanner +instanceKlass javax/enterprise/inject/Typed +instanceKlass org/eclipse/sisu/space/QualifiedTypeBinder +instanceKlass org/eclipse/sisu/plexus/PlexusTypeBinder +instanceKlass com/google/inject/spi/InjectionRequest +instanceKlass org/eclipse/sisu/bean/BeanProperty +instanceKlass com/google/inject/internal/Nullability +instanceKlass com/google/inject/spi/InjectionPoint$OverrideIndex +instanceKlass org/eclipse/sisu/inject/RankedBindings +instanceKlass org/eclipse/sisu/Mediator +instanceKlass java/util/function/BiConsumer +instanceKlass sun/reflect/generics/tree/TypeVariableSignature +instanceKlass com/google/common/collect/ComparisonChain +instanceKlass com/google/inject/Inject +instanceKlass javax/inject/Inject +instanceKlass java/lang/reflect/WildcardType +instanceKlass java/lang/reflect/TypeVariable +instanceKlass sun/reflect/generics/tree/ClassSignature +instanceKlass sun/reflect/generics/tree/Signature +instanceKlass sun/reflect/generics/tree/FormalTypeParameter +instanceKlass com/google/inject/spi/InjectionPoint$InjectableMembers +instanceKlass com/google/inject/spi/InjectionPoint$InjectableMember +instanceKlass com/google/common/collect/Ordering +instanceKlass com/google/inject/spi/InjectionPoint +instanceKlass java/lang/reflect/ParameterizedType +instanceKlass com/google/inject/internal/MoreTypes$GenericArrayTypeImpl +instanceKlass com/google/inject/internal/MoreTypes$CompositeType +instanceKlass com/google/inject/Key$AnnotationTypeStrategy +instanceKlass com/google/common/util/concurrent/AbstractFuture$Failure +instanceKlass com/google/common/util/concurrent/AbstractFuture$Cancellation +instanceKlass com/google/common/util/concurrent/AbstractFuture$SetFuture +instanceKlass com/google/common/util/concurrent/Uninterruptibles +instanceKlass com/google/common/base/CommonPattern +instanceKlass com/google/common/base/Platform$JdkPatternCompiler +instanceKlass com/google/common/base/PatternCompiler +instanceKlass com/google/common/base/Platform +instanceKlass com/google/common/base/Stopwatch +instanceKlass java/util/concurrent/locks/LockSupport +instanceKlass com/google/common/util/concurrent/AbstractFuture$Waiter +instanceKlass com/google/common/util/concurrent/AbstractFuture$Listener +instanceKlass com/google/common/util/concurrent/AbstractFuture$UnsafeAtomicHelper$1 +instanceKlass com/google/common/util/concurrent/AbstractFuture$AtomicHelper +instanceKlass com/google/common/util/concurrent/GwtFluentFutureCatchingSpecialization +instanceKlass com/google/common/util/concurrent/ListenableFuture +instanceKlass com/google/common/cache/LocalCache$LoadingValueReference +instanceKlass java/lang/annotation/Documented +instanceKlass java/lang/annotation/Target +instanceKlass javax/inject/Named +instanceKlass javax/inject/Qualifier +instanceKlass com/google/inject/BindingAnnotation +instanceKlass javax/inject/Scope +instanceKlass com/google/inject/ScopeAnnotation +instanceKlass com/google/inject/internal/Annotations$AnnotationChecker +instanceKlass java/lang/reflect/Proxy$1 +instanceKlass java/lang/reflect/WeakCache$Value +instanceKlass sun/misc/ProxyGenerator$ExceptionTableEntry +instanceKlass sun/misc/ProxyGenerator$PrimitiveTypeInfo +instanceKlass sun/misc/ProxyGenerator$FieldInfo +instanceKlass java/io/DataOutput +instanceKlass sun/misc/ProxyGenerator$ConstantPool$Entry +instanceKlass sun/misc/ProxyGenerator$MethodInfo +instanceKlass sun/misc/ProxyGenerator$ProxyMethod +instanceKlass sun/misc/ProxyGenerator$ConstantPool +instanceKlass sun/misc/ProxyGenerator +instanceKlass java/lang/reflect/WeakCache$Factory +instanceKlass java/util/function/Supplier +instanceKlass java/lang/reflect/Proxy$ProxyClassFactory +instanceKlass java/lang/reflect/Proxy$KeyFactory +instanceKlass java/util/function/BiFunction +instanceKlass java/lang/reflect/WeakCache +instanceKlass java/lang/reflect/Proxy +instanceKlass sun/reflect/annotation/AnnotationInvocationHandler +instanceKlass sun/reflect/annotation/AnnotationParser$1 +instanceKlass sun/reflect/annotation/ExceptionProxy +instanceKlass java/lang/Class$4 +instanceKlass java/lang/annotation/Inherited +instanceKlass java/lang/annotation/Retention +instanceKlass sun/reflect/annotation/AnnotationType$1 +instanceKlass java/lang/reflect/GenericArrayType +instanceKlass sun/reflect/generics/visitor/Reifier +instanceKlass sun/reflect/generics/visitor/TypeTreeVisitor +instanceKlass sun/reflect/generics/factory/CoreReflectionFactory +instanceKlass sun/reflect/generics/factory/GenericsFactory +instanceKlass sun/reflect/generics/scope/AbstractScope +instanceKlass sun/reflect/generics/scope/Scope +instanceKlass sun/reflect/generics/tree/ClassTypeSignature +instanceKlass sun/reflect/generics/tree/SimpleClassTypeSignature +instanceKlass sun/reflect/generics/tree/FieldTypeSignature +instanceKlass sun/reflect/generics/tree/BaseType +instanceKlass sun/reflect/generics/tree/TypeSignature +instanceKlass sun/reflect/generics/tree/ReturnType +instanceKlass sun/reflect/generics/tree/TypeArgument +instanceKlass sun/reflect/generics/tree/TypeTree +instanceKlass sun/reflect/generics/tree/Tree +instanceKlass sun/reflect/generics/parser/SignatureParser +instanceKlass com/google/inject/internal/Annotations$TestAnnotation +instanceKlass com/google/inject/internal/Annotations$3 +instanceKlass com/google/common/base/Joiner$MapJoiner +instanceKlass com/google/common/base/Joiner +instanceKlass java/lang/reflect/InvocationHandler +instanceKlass com/google/inject/internal/Annotations +instanceKlass org/eclipse/sisu/Parameters +instanceKlass org/eclipse/sisu/wire/ParameterKeys +instanceKlass org/eclipse/sisu/wire/TypeConverterCache +instanceKlass org/eclipse/sisu/inject/DefaultRankingFunction +instanceKlass com/google/inject/internal/Scoping +instanceKlass com/google/inject/internal/InternalFactory +instanceKlass com/google/inject/spi/ConstructorBinding +instanceKlass com/google/inject/spi/ProviderInstanceBinding +instanceKlass com/google/inject/internal/DelayedInitialize +instanceKlass com/google/inject/spi/ProviderKeyBinding +instanceKlass com/google/inject/spi/InstanceBinding +instanceKlass com/google/inject/spi/HasDependencies +instanceKlass com/google/inject/spi/LinkedKeyBinding +instanceKlass com/google/inject/spi/UntargettedBinding +instanceKlass com/google/inject/internal/BindingImpl +instanceKlass com/google/inject/Key$AnnotationStrategy +instanceKlass org/eclipse/sisu/wire/ElementAnalyzer$1 +instanceKlass com/google/inject/util/Modules$EmptyModule +instanceKlass com/google/inject/util/Modules$OverriddenModuleBuilder +instanceKlass com/google/inject/util/Modules +instanceKlass sun/reflect/annotation/AnnotationParser +instanceKlass com/google/common/collect/ImmutableMap$Builder +instanceKlass com/google/inject/internal/MoreTypes +instanceKlass com/google/inject/multibindings/ProvidesIntoOptional +instanceKlass com/google/inject/multibindings/ProvidesIntoMap +instanceKlass com/google/inject/multibindings/ProvidesIntoSet +instanceKlass com/google/inject/Provides +instanceKlass javax/inject/Singleton +instanceKlass com/google/inject/spi/ElementSource +instanceKlass com/google/inject/spi/ScopeBinding +instanceKlass com/google/inject/Scopes$2 +instanceKlass com/google/inject/Scopes$1 +instanceKlass com/google/inject/internal/SingletonScope +instanceKlass com/google/inject/Scopes +instanceKlass com/google/inject/Singleton +instanceKlass com/google/inject/spi/Elements$ModuleInfo +instanceKlass com/google/inject/PrivateModule +instanceKlass com/google/inject/internal/util/StackTraceElements$InMemoryStackTraceElement +instanceKlass com/google/inject/internal/util/StackTraceElements +instanceKlass com/google/inject/spi/ModuleSource +instanceKlass com/google/inject/internal/InternalFlags$1 +instanceKlass com/google/inject/internal/InternalFlags +instanceKlass com/google/inject/internal/ProviderMethodsModule +instanceKlass com/google/inject/internal/AbstractBindingBuilder +instanceKlass com/google/inject/binder/ConstantBindingBuilder +instanceKlass com/google/common/collect/Sets +instanceKlass com/google/inject/binder/AnnotatedElementBuilder +instanceKlass com/google/inject/spi/Elements$RecordingBinder +instanceKlass com/google/inject/Binding +instanceKlass com/google/inject/spi/DefaultBindingTargetVisitor +instanceKlass com/google/inject/spi/BindingTargetVisitor +instanceKlass com/google/inject/spi/Elements +instanceKlass com/google/inject/internal/InjectorShell$RootModule +instanceKlass java/util/concurrent/atomic/AtomicReferenceArray +instanceKlass java/util/concurrent/Future +instanceKlass java/util/concurrent/ConcurrentLinkedQueue$Node +instanceKlass com/google/common/cache/Weigher +instanceKlass com/google/common/base/Predicate +instanceKlass com/google/common/base/Equivalence +instanceKlass com/google/common/base/MoreObjects +instanceKlass com/google/common/cache/LocalCache$1 +instanceKlass com/google/common/cache/ReferenceEntry +instanceKlass com/google/common/cache/CacheLoader +instanceKlass com/google/common/cache/LocalCache$LocalManualCache +instanceKlass com/google/inject/internal/WeakKeySet$1 +instanceKlass com/google/common/cache/LocalCache$StrongValueReference +instanceKlass com/google/common/cache/LocalCache$ValueReference +instanceKlass com/google/common/cache/CacheBuilder$2 +instanceKlass com/google/common/cache/CacheStats +instanceKlass com/google/common/base/Suppliers$SupplierOfInstance +instanceKlass com/google/common/base/Suppliers +instanceKlass com/google/common/cache/CacheBuilder$1 +instanceKlass com/google/common/cache/AbstractCache$StatsCounter +instanceKlass com/google/common/cache/LoadingCache +instanceKlass com/google/common/cache/Cache +instanceKlass com/google/common/base/Ticker +instanceKlass com/google/common/base/Supplier +instanceKlass com/google/common/cache/CacheBuilder +instanceKlass com/google/common/cache/RemovalListener +instanceKlass com/google/inject/internal/WeakKeySet +instanceKlass com/google/inject/internal/State$1 +instanceKlass com/google/inject/internal/InheritingState +instanceKlass com/google/inject/internal/ProcessedBindingData +instanceKlass com/google/inject/spi/DefaultElementVisitor +instanceKlass com/google/inject/internal/State +instanceKlass com/google/inject/internal/InjectorShell$Builder +instanceKlass com/google/common/collect/Lists +instanceKlass com/google/common/collect/AbstractMapEntry +instanceKlass com/google/common/collect/LinkedHashMultimap$ValueSetLink +instanceKlass com/google/common/collect/Platform +instanceKlass com/google/common/collect/Multiset +instanceKlass com/google/common/collect/AbstractMultimap +instanceKlass com/google/common/collect/SetMultimap +instanceKlass com/google/common/collect/Maps$EntryTransformer +instanceKlass com/google/common/collect/BiMap +instanceKlass com/google/common/base/Converter +instanceKlass com/google/common/collect/ImmutableMap +instanceKlass com/google/common/base/Function +instanceKlass com/google/common/collect/SortedMapDifference +instanceKlass com/google/common/collect/MapDifference +instanceKlass com/google/common/collect/Maps +instanceKlass com/google/inject/internal/CycleDetectingLock +instanceKlass com/google/common/collect/Multimap +instanceKlass com/google/inject/internal/CycleDetectingLock$CycleDetectingLockFactory +instanceKlass com/google/inject/internal/Initializable +instanceKlass com/google/inject/internal/Initializer +instanceKlass com/google/common/collect/PeekingIterator +instanceKlass com/google/common/collect/UnmodifiableIterator +instanceKlass com/google/common/collect/Iterators +instanceKlass com/google/inject/internal/util/SourceProvider +instanceKlass com/google/common/collect/Hashing +instanceKlass com/google/common/collect/ObjectArrays +instanceKlass com/google/common/primitives/Primitives +instanceKlass com/google/common/base/Preconditions +instanceKlass com/google/common/collect/CollectPreconditions +instanceKlass com/google/common/collect/ImmutableCollection$Builder +instanceKlass com/google/inject/internal/Errors +instanceKlass java/util/logging/LogManager$5 +instanceKlass sun/reflect/UnsafeFieldAccessorFactory +instanceKlass java/util/logging/LoggingProxyImpl +instanceKlass sun/util/logging/LoggingProxy +instanceKlass sun/util/logging/LoggingSupport$1 +instanceKlass sun/util/logging/LoggingSupport +instanceKlass sun/util/logging/PlatformLogger$LoggerProxy +instanceKlass sun/util/logging/PlatformLogger$1 +instanceKlass sun/util/logging/PlatformLogger +instanceKlass java/util/logging/LogManager$LoggerContext$1 +instanceKlass java/util/logging/LogManager$3 +instanceKlass java/util/logging/LogManager$2 +instanceKlass java/util/logging/LogManager$LogNode +instanceKlass java/util/logging/LogManager$LoggerContext +instanceKlass java/util/logging/LogManager$1 +instanceKlass java/util/logging/LogManager +instanceKlass java/util/concurrent/CopyOnWriteArrayList +instanceKlass java/util/logging/Logger$LoggerBundle +instanceKlass java/util/logging/Level$KnownLevel +instanceKlass java/util/logging/Level +instanceKlass java/util/logging/Handler +instanceKlass java/util/logging/Logger +instanceKlass com/google/inject/internal/util/Stopwatch +instanceKlass com/google/inject/Injector +instanceKlass com/google/inject/internal/InternalInjectorCreator +instanceKlass com/google/inject/Guice +instanceKlass org/eclipse/sisu/wire/Wiring +instanceKlass org/eclipse/sisu/wire/WireModule$Strategy$1 +instanceKlass org/eclipse/sisu/wire/WireModule$Strategy +instanceKlass org/eclipse/sisu/wire/AbstractTypeConverter +instanceKlass com/google/inject/spi/ElementVisitor +instanceKlass org/eclipse/sisu/wire/WireModule +instanceKlass org/eclipse/sisu/bean/BeanBinder +instanceKlass org/eclipse/sisu/plexus/PlexusBindingModule +instanceKlass org/codehaus/plexus/DefaultPlexusContainer$BootModule +instanceKlass org/codehaus/plexus/component/annotations/Configuration +instanceKlass org/eclipse/sisu/plexus/PlexusAnnotatedMetadata +instanceKlass org/eclipse/sisu/plexus/PlexusBeanMetadata +instanceKlass org/eclipse/sisu/plexus/PlexusAnnotatedBeanModule$PlexusAnnotatedBeanSource +instanceKlass org/eclipse/sisu/space/SpaceModule$Strategy$1 +instanceKlass org/eclipse/sisu/space/DefaultClassFinder +instanceKlass org/eclipse/sisu/space/asm/ClassVisitor +instanceKlass org/eclipse/sisu/space/SpaceScanner +instanceKlass org/eclipse/sisu/space/IndexedClassFinder +instanceKlass org/eclipse/sisu/space/ClassFinder +instanceKlass org/eclipse/sisu/space/SpaceModule +instanceKlass org/eclipse/sisu/space/SpaceVisitor +instanceKlass org/eclipse/sisu/plexus/PlexusTypeListener +instanceKlass org/eclipse/sisu/space/QualifiedTypeListener +instanceKlass org/eclipse/sisu/plexus/PlexusAnnotatedBeanModule$1 +instanceKlass org/eclipse/sisu/space/SpaceModule$Strategy +instanceKlass org/eclipse/sisu/plexus/PlexusAnnotatedBeanModule +instanceKlass org/eclipse/sisu/plexus/PlexusBeanSource +instanceKlass org/eclipse/sisu/plexus/PlexusXmlBeanModule +instanceKlass org/eclipse/sisu/plexus/PlexusBeanModule +instanceKlass org/eclipse/sisu/space/URLClassSpace +instanceKlass org/codehaus/plexus/DefaultPlexusContainer$SLF4JLoggerFactoryProvider +instanceKlass com/google/inject/util/Providers$ConstantProvider +instanceKlass com/google/inject/util/Providers +instanceKlass org/codehaus/plexus/personality/plexus/lifecycle/phase/Disposable +instanceKlass org/codehaus/plexus/personality/plexus/lifecycle/phase/Startable +instanceKlass org/codehaus/plexus/personality/plexus/lifecycle/phase/Initializable +instanceKlass org/codehaus/plexus/personality/plexus/lifecycle/phase/Contextualizable +instanceKlass org/codehaus/plexus/logging/LogEnabled +instanceKlass org/eclipse/sisu/bean/PropertyBinding +instanceKlass org/eclipse/sisu/bean/LifecycleBuilder +instanceKlass org/eclipse/sisu/bean/BeanScheduler$1 +instanceKlass com/google/inject/spi/DefaultBindingScopingVisitor +instanceKlass com/google/inject/spi/BindingScopingVisitor +instanceKlass org/eclipse/sisu/bean/BeanScheduler$CycleActivator +instanceKlass com/google/inject/MembersInjector +instanceKlass com/google/inject/PrivateBinder +instanceKlass com/google/inject/Scope +instanceKlass com/google/inject/spi/TypeListener +instanceKlass com/google/inject/binder/AnnotatedConstantBindingBuilder +instanceKlass com/google/inject/spi/Message +instanceKlass com/google/inject/spi/Element +instanceKlass com/google/inject/spi/ModuleAnnotatedMethodScanner +instanceKlass com/google/inject/TypeLiteral +instanceKlass com/google/inject/binder/AnnotatedBindingBuilder +instanceKlass com/google/inject/binder/LinkedBindingBuilder +instanceKlass com/google/inject/binder/ScopedBindingBuilder +instanceKlass com/google/inject/spi/Dependency +instanceKlass com/google/inject/Key +instanceKlass com/google/inject/spi/ProvisionListener +instanceKlass com/google/inject/Binder +instanceKlass org/eclipse/sisu/bean/BeanScheduler +instanceKlass org/eclipse/sisu/plexus/DefaultPlexusBeanLocator +instanceKlass org/eclipse/sisu/inject/MildKeys +instanceKlass org/eclipse/sisu/plexus/ClassRealmManager +instanceKlass org/codehaus/plexus/context/ContextMapAdapter +instanceKlass org/codehaus/plexus/context/DefaultContext +instanceKlass org/codehaus/plexus/logging/AbstractLogger +instanceKlass org/codehaus/plexus/logging/AbstractLoggerManager +instanceKlass java/util/Date +instanceKlass java/text/DigitList +instanceKlass java/text/FieldPosition +instanceKlass java/util/Currency$CurrencyNameGetter +instanceKlass java/util/Currency$1 +instanceKlass java/util/Currency +instanceKlass java/text/DecimalFormatSymbols +instanceKlass java/util/concurrent/atomic/AtomicMarkableReference$Pair +instanceKlass java/util/concurrent/atomic/AtomicMarkableReference +instanceKlass java/text/DateFormatSymbols +instanceKlass sun/util/calendar/CalendarUtils +instanceKlass sun/util/calendar/CalendarDate +instanceKlass sun/util/locale/LanguageTag +instanceKlass java/util/ResourceBundle$CacheKeyReference +instanceKlass java/util/ResourceBundle$CacheKey +instanceKlass java/util/ResourceBundle$RBClassLoader$1 +instanceKlass java/util/spi/ResourceBundleControlProvider +instanceKlass java/util/ResourceBundle +instanceKlass java/util/ResourceBundle$Control +instanceKlass sun/util/resources/LocaleData$1 +instanceKlass sun/util/resources/LocaleData +instanceKlass sun/util/locale/provider/LocaleResources +instanceKlass sun/util/locale/provider/CalendarDataUtility$CalendarWeekParameterGetter +instanceKlass sun/util/locale/provider/LocaleServiceProviderPool$LocalizedObjectGetter +instanceKlass java/util/ServiceLoader$1 +instanceKlass java/util/ServiceLoader$LazyIterator +instanceKlass java/util/ServiceLoader +instanceKlass sun/util/locale/provider/SPILocaleProviderAdapter$1 +instanceKlass sun/util/locale/provider/LocaleServiceProviderPool +instanceKlass sun/util/locale/provider/CalendarDataUtility +instanceKlass java/util/Calendar$Builder +instanceKlass sun/util/locale/provider/JRELocaleProviderAdapter$1 +instanceKlass sun/util/locale/provider/LocaleDataMetaInfo +instanceKlass sun/util/locale/provider/AvailableLanguageTags +instanceKlass sun/util/locale/provider/LocaleProviderAdapter$1 +instanceKlass sun/util/locale/provider/ResourceBundleBasedAdapter +instanceKlass sun/util/locale/provider/LocaleProviderAdapter +instanceKlass java/util/spi/LocaleServiceProvider +instanceKlass java/util/Calendar +instanceKlass java/util/TimeZone$1 +instanceKlass sun/util/calendar/ZoneInfoFile$ZoneOffsetTransitionRule +instanceKlass java/io/DataInput +instanceKlass sun/util/calendar/ZoneInfoFile$1 +instanceKlass sun/util/calendar/ZoneInfoFile +instanceKlass sun/util/calendar/CalendarSystem +instanceKlass java/util/TimeZone +instanceKlass java/text/AttributedCharacterIterator$Attribute +instanceKlass com/google/inject/matcher/AbstractMatcher +instanceKlass com/google/inject/matcher/Matcher +instanceKlass com/google/inject/spi/TypeConverter +instanceKlass org/codehaus/plexus/DefaultPlexusContainer$LoggerProvider +instanceKlass org/codehaus/plexus/DefaultPlexusContainer$DefaultsModule +instanceKlass org/codehaus/plexus/DefaultPlexusContainer$ContainerModule +instanceKlass org/eclipse/sisu/inject/ImplicitBindings +instanceKlass org/eclipse/sisu/inject/MildValues$InverseMapping +instanceKlass org/eclipse/sisu/inject/MildValues +instanceKlass org/eclipse/sisu/inject/Weak +instanceKlass java/util/concurrent/atomic/AtomicReference +instanceKlass org/eclipse/sisu/inject/BindingPublisher +instanceKlass org/eclipse/sisu/inject/RankingFunction +instanceKlass org/eclipse/sisu/inject/BindingSubscriber +instanceKlass org/eclipse/sisu/inject/DefaultBeanLocator +instanceKlass org/eclipse/sisu/inject/DeferredClass +instanceKlass org/codehaus/plexus/DefaultPlexusContainer$LoggerManagerProvider +instanceKlass org/eclipse/sisu/inject/DeferredProvider +instanceKlass com/google/inject/Provider +instanceKlass com/google/inject/AbstractModule +instanceKlass org/codehaus/plexus/context/Context +instanceKlass org/eclipse/sisu/space/ClassSpace +instanceKlass javax/inject/Provider +instanceKlass org/eclipse/sisu/bean/BeanManager +instanceKlass org/eclipse/sisu/plexus/PlexusBeanLocator +instanceKlass org/codehaus/plexus/classworlds/ClassWorldListener +instanceKlass com/google/inject/Module +instanceKlass org/eclipse/sisu/inject/MutableBeanLocator +instanceKlass org/eclipse/sisu/inject/BeanLocator +instanceKlass org/codehaus/plexus/DefaultPlexusContainer +instanceKlass org/codehaus/plexus/MutablePlexusContainer +instanceKlass org/apache/maven/extension/internal/CoreExports +instanceKlass java/util/Collections$EmptyIterator +instanceKlass java/util/Collections$UnmodifiableCollection$1 +instanceKlass org/codehaus/plexus/DefaultContainerConfiguration +instanceKlass org/codehaus/plexus/ContainerConfiguration +instanceKlass org/codehaus/plexus/util/xml/XMLWriter +instanceKlass org/codehaus/plexus/util/xml/Xpp3Dom +instanceKlass org/codehaus/plexus/util/xml/pull/MXParser +instanceKlass org/codehaus/plexus/util/xml/pull/XmlPullParser +instanceKlass org/codehaus/plexus/util/xml/Xpp3DomBuilder +instanceKlass java/util/regex/ASCII +instanceKlass java/util/regex/Matcher +instanceKlass java/util/regex/MatchResult +instanceKlass java/util/Locale$1 +instanceKlass org/codehaus/plexus/util/ReaderFactory +instanceKlass org/apache/maven/project/ExtensionDescriptor +instanceKlass org/apache/maven/project/ExtensionDescriptorBuilder +instanceKlass org/apache/maven/extension/internal/CoreExtensionEntry +instanceKlass org/apache/maven/cli/ResolveFile +instanceKlass org/codehaus/plexus/util/StringUtils +instanceKlass org/codehaus/plexus/logging/Logger +instanceKlass org/apache/maven/cli/logging/Slf4jLoggerManager +instanceKlass org/slf4j/impl/MavenSlf4jSimpleFriend +instanceKlass org/slf4j/MavenSlf4jFriend +instanceKlass org/apache/maven/cli/logging/BaseSlf4jConfiguration +instanceKlass org/codehaus/plexus/util/IOUtil +instanceKlass org/codehaus/plexus/util/PropertyUtils +instanceKlass org/apache/maven/cli/logging/Slf4jConfiguration +instanceKlass org/apache/maven/cli/logging/Slf4jConfigurationFactory +instanceKlass org/slf4j/impl/OutputChoice +instanceKlass sun/net/DefaultProgressMeteringPolicy +instanceKlass sun/net/ProgressMeteringPolicy +instanceKlass sun/net/ProgressMonitor +instanceKlass org/slf4j/impl/SimpleLoggerConfiguration$1 +instanceKlass java/text/Format +instanceKlass org/slf4j/impl/SimpleLoggerConfiguration +instanceKlass org/slf4j/helpers/NamedLoggerBase +instanceKlass org/slf4j/impl/SimpleLoggerFactory +instanceKlass org/slf4j/impl/StaticLoggerBinder +instanceKlass org/slf4j/spi/LoggerFactoryBinder +instanceKlass java/util/Collections$3 +instanceKlass java/net/URLClassLoader$3$1 +instanceKlass sun/misc/CompoundEnumeration +instanceKlass java/net/URLClassLoader$3 +instanceKlass sun/misc/URLClassPath$1 +instanceKlass java/lang/ClassLoader$2 +instanceKlass sun/misc/URLClassPath$2 +instanceKlass org/slf4j/helpers/Util +instanceKlass org/slf4j/helpers/NOPLoggerFactory +instanceKlass java/util/concurrent/LinkedBlockingQueue$Node +instanceKlass java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject +instanceKlass java/util/concurrent/locks/Condition +instanceKlass java/util/concurrent/locks/AbstractQueuedSynchronizer$Node +instanceKlass java/util/concurrent/locks/AbstractOwnableSynchronizer +instanceKlass java/util/concurrent/BlockingQueue +instanceKlass org/slf4j/helpers/SubstituteLoggerFactory +instanceKlass org/slf4j/ILoggerFactory +instanceKlass org/slf4j/event/LoggingEvent +instanceKlass org/slf4j/LoggerFactory +instanceKlass org/apache/commons/lang3/StringUtils +instanceKlass java/util/Properties$LineReader +instanceKlass sun/net/www/protocol/jar/JarFileFactory +instanceKlass sun/net/www/protocol/jar/URLJarFile$URLJarFileCloseController +instanceKlass java/net/URLClassLoader$2 +instanceKlass sun/misc/Launcher$BootClassPathHolder$1 +instanceKlass sun/misc/Launcher$BootClassPathHolder +instanceKlass org/apache/maven/cli/CLIReportingUtils +instanceKlass org/apache/maven/properties/internal/SystemProperties +instanceKlass java/util/Collections$UnmodifiableMap$UnmodifiableEntrySet$UnmodifiableEntry +instanceKlass java/util/Collections$UnmodifiableMap$UnmodifiableEntrySet$1 +instanceKlass org/codehaus/plexus/util/Os +instanceKlass org/apache/maven/properties/internal/EnvironmentUtils +instanceKlass java/util/ListIterator +instanceKlass org/apache/commons/cli/Util +instanceKlass org/apache/commons/cli/CommandLine +instanceKlass java/util/LinkedHashMap$LinkedHashIterator +instanceKlass org/apache/commons/cli/Parser +instanceKlass org/apache/maven/cli/CleanArgument +instanceKlass org/apache/commons/cli/OptionValidator +instanceKlass org/apache/commons/cli/Option$Builder +instanceKlass org/apache/commons/cli/Option +instanceKlass org/apache/commons/cli/Options +instanceKlass org/apache/commons/cli/CommandLineParser +instanceKlass org/apache/maven/cli/CLIManager +instanceKlass org/apache/maven/cli/logging/Slf4jStdoutLogger +instanceKlass org/eclipse/aether/DefaultRepositoryCache +instanceKlass org/apache/maven/project/ProjectBuildingRequest +instanceKlass org/eclipse/aether/RepositoryCache +instanceKlass org/apache/maven/execution/DefaultMavenExecutionRequest +instanceKlass org/apache/maven/execution/MavenExecutionRequest +instanceKlass java/lang/Shutdown$Lock +instanceKlass java/lang/Shutdown +instanceKlass java/lang/ApplicationShutdownHooks$1 +instanceKlass java/lang/ApplicationShutdownHooks +instanceKlass org/fusesource/jansi/internal/WindowsSupport +instanceKlass org/fusesource/jansi/internal/Kernel32$SMALL_RECT +instanceKlass org/fusesource/jansi/internal/Kernel32$COORD +instanceKlass org/fusesource/jansi/internal/Kernel32$CONSOLE_SCREEN_BUFFER_INFO +instanceKlass org/fusesource/jansi/internal/Kernel32 +instanceKlass org/fusesource/hawtjni/runtime/Library +instanceKlass org/fusesource/jansi/internal/CLibrary +instanceKlass java/util/TreeMap$Entry +instanceKlass java/lang/ProcessEnvironment$CheckedEntry +instanceKlass java/lang/ProcessEnvironment$CheckedEntrySet$1 +instanceKlass java/util/Collections$UnmodifiableMap +instanceKlass java/lang/ProcessEnvironment$EntryComparator +instanceKlass java/lang/ProcessEnvironment$NameComparator +instanceKlass org/fusesource/jansi/AnsiConsole +instanceKlass org/fusesource/jansi/Ansi$1 +instanceKlass java/util/concurrent/Callable +instanceKlass org/fusesource/jansi/Ansi +instanceKlass org/apache/maven/shared/utils/logging/LoggerLevelRenderer +instanceKlass org/apache/maven/shared/utils/logging/MessageUtils +instanceKlass java/util/regex/Pattern$TreeInfo +instanceKlass java/util/regex/Pattern$Node +instanceKlass java/util/regex/Pattern +instanceKlass org/apache/maven/cli/CliRequest +instanceKlass org/apache/maven/toolchain/building/ToolchainsBuildingRequest +instanceKlass org/apache/maven/building/Source +instanceKlass org/apache/maven/execution/ExecutionListener +instanceKlass org/eclipse/aether/transfer/TransferListener +instanceKlass org/slf4j/Logger +instanceKlass org/codehaus/plexus/logging/LoggerManager +instanceKlass org/apache/maven/eventspy/EventSpy$Context +instanceKlass org/codehaus/plexus/PlexusContainer +instanceKlass org/apache/maven/exception/ExceptionHandler +instanceKlass org/apache/maven/cli/MavenCli +instanceKlass java/util/TreeMap$PrivateEntryIterator +instanceKlass java/util/TimSort +instanceKlass sun/security/action/GetBooleanAction +instanceKlass java/util/Arrays$LegacyMergeSort +instanceKlass org/codehaus/plexus/classworlds/launcher/Configurator$1 +instanceKlass java/util/HashMap$HashIterator +instanceKlass org/codehaus/plexus/classworlds/launcher/ConfigurationParser$1 +instanceKlass java/util/ArrayList$Itr +instanceKlass org/codehaus/plexus/classworlds/strategy/AbstractStrategy +instanceKlass org/codehaus/plexus/classworlds/strategy/Strategy +instanceKlass org/codehaus/plexus/classworlds/strategy/StrategyFactory +instanceKlass java/util/NavigableMap +instanceKlass java/util/SortedMap +instanceKlass java/util/NavigableSet +instanceKlass java/util/SortedSet +instanceKlass java/io/FilenameFilter +instanceKlass org/codehaus/plexus/classworlds/launcher/ConfigurationParser +instanceKlass org/codehaus/plexus/classworlds/launcher/Configurator +instanceKlass org/codehaus/plexus/classworlds/launcher/ConfigurationHandler +instanceKlass java/lang/Void +instanceKlass org/codehaus/plexus/classworlds/ClassWorld +instanceKlass java/lang/Class$MethodArray +instanceKlass sun/launcher/LauncherHelper$FXHelper +instanceKlass org/codehaus/plexus/classworlds/launcher/Launcher +instanceKlass java/io/FilePermission$1 +instanceKlass sun/nio/fs/AbstractPath +instanceKlass java/net/URI$Parser +instanceKlass java/net/URI +instanceKlass sun/nio/fs/Util +instanceKlass sun/nio/fs/WindowsPathParser$Result +instanceKlass sun/nio/fs/WindowsPathParser +instanceKlass java/util/AbstractList$Itr +instanceKlass java/nio/file/FileSystem +instanceKlass java/nio/file/spi/FileSystemProvider +instanceKlass sun/nio/fs/DefaultFileSystemProvider +instanceKlass sun/net/www/MessageHeader +instanceKlass java/net/URLConnection +instanceKlass java/security/PermissionCollection +instanceKlass java/util/zip/CRC32 +instanceKlass java/util/zip/Checksum +instanceKlass sun/nio/ByteBuffered +instanceKlass java/lang/Package +instanceKlass sun/misc/ASCIICaseInsensitiveComparator +instanceKlass java/util/jar/Attributes$Name +instanceKlass java/util/jar/Attributes +instanceKlass sun/misc/Resource +instanceKlass sun/misc/IOUtils +instanceKlass sun/misc/ExtensionDependency +instanceKlass java/util/LinkedList$Node +instanceKlass java/util/zip/ZStreamRef +instanceKlass java/util/zip/Inflater +instanceKlass java/util/zip/ZipEntry +instanceKlass sun/misc/JarIndex +instanceKlass sun/nio/ch/DirectBuffer +instanceKlass sun/misc/PerfCounter$CoreCounters +instanceKlass sun/misc/Perf +instanceKlass sun/misc/Perf$GetPerfAction +instanceKlass sun/misc/PerfCounter +instanceKlass java/util/zip/ZipCoder +instanceKlass java/util/Deque +instanceKlass java/util/Queue +instanceKlass java/nio/charset/StandardCharsets +instanceKlass java/util/jar/JavaUtilJarAccessImpl +instanceKlass sun/misc/JavaUtilJarAccess +instanceKlass sun/misc/FileURLMapper +instanceKlass sun/misc/URLClassPath$JarLoader$1 +instanceKlass sun/nio/cs/ThreadLocalCoders$Cache +instanceKlass sun/nio/cs/ThreadLocalCoders +instanceKlass java/util/zip/ZipFile$1 +instanceKlass sun/misc/JavaUtilZipFileAccess +instanceKlass java/util/zip/ZipFile +instanceKlass java/util/zip/ZipConstants +instanceKlass sun/misc/URLClassPath$Loader +instanceKlass sun/misc/URLClassPath$3 +instanceKlass sun/net/util/URLUtil +instanceKlass java/net/URLClassLoader$1 +instanceKlass java/lang/StringCoding$StringDecoder +instanceKlass java/lang/ThreadLocal$ThreadLocalMap +instanceKlass java/lang/StringCoding +instanceKlass java/lang/invoke/MethodHandleStatics$1 +instanceKlass java/lang/invoke/MethodHandleStatics +instanceKlass java/lang/invoke/MemberName$Factory +instanceKlass java/lang/ClassValue$Version +instanceKlass java/lang/ClassValue$Identity +instanceKlass java/lang/ClassValue +instanceKlass java/lang/invoke/MethodHandleImpl$3 +instanceKlass java/lang/invoke/MethodHandleImpl$2 +instanceKlass java/util/function/Function +instanceKlass java/lang/invoke/MethodHandleImpl$1 +instanceKlass java/lang/invoke/MethodHandleImpl +instanceKlass jdk/jfr/internal/EventWriter +instanceKlass java/lang/SystemClassLoaderAction +instanceKlass sun/misc/Launcher$AppClassLoader$1 +instanceKlass sun/misc/URLClassPath +instanceKlass java/security/Principal +instanceKlass java/security/ProtectionDomain$Key +instanceKlass java/security/ProtectionDomain$2 +instanceKlass sun/misc/JavaSecurityProtectionDomainAccess +instanceKlass java/security/ProtectionDomain$JavaSecurityAccessImpl +instanceKlass sun/misc/JavaSecurityAccess +instanceKlass sun/net/util/IPAddressUtil +instanceKlass java/net/URLStreamHandler +instanceKlass java/net/Parts +instanceKlass java/util/BitSet +instanceKlass sun/net/www/ParseUtil +instanceKlass java/io/FileInputStream$1 +instanceKlass java/lang/CharacterData +instanceKlass sun/util/locale/LocaleUtils +instanceKlass java/util/Locale$LocaleKey +instanceKlass sun/util/locale/BaseLocale$Key +instanceKlass sun/util/locale/BaseLocale +instanceKlass java/util/concurrent/ConcurrentHashMap$CollectionView +instanceKlass java/util/concurrent/ConcurrentHashMap$CounterCell +instanceKlass java/util/concurrent/ConcurrentHashMap$Node +instanceKlass java/util/concurrent/locks/ReentrantLock +instanceKlass java/util/concurrent/locks/Lock +instanceKlass java/util/concurrent/ConcurrentMap +instanceKlass sun/util/locale/LocaleObjectCache +instanceKlass java/util/Locale +instanceKlass java/lang/reflect/Array +instanceKlass java/nio/charset/CoderResult$Cache +instanceKlass java/nio/charset/CoderResult +instanceKlass java/nio/charset/CharsetDecoder +instanceKlass sun/nio/cs/ArrayDecoder +instanceKlass java/io/Reader +instanceKlass java/lang/Readable +instanceKlass sun/misc/MetaIndex +instanceKlass java/util/StringTokenizer +instanceKlass sun/misc/Launcher$ExtClassLoader$1 +instanceKlass java/net/URLClassLoader$7 +instanceKlass sun/misc/JavaNetAccess +instanceKlass java/lang/ClassLoader$ParallelLoaders +instanceKlass sun/security/util/Debug +instanceKlass sun/misc/Launcher$Factory +instanceKlass java/net/URLStreamHandlerFactory +instanceKlass java/lang/Compiler$1 +instanceKlass java/lang/Compiler +instanceKlass java/lang/System$2 +instanceKlass sun/misc/JavaLangAccess +instanceKlass sun/io/Win32ErrorMode +instanceKlass sun/misc/OSEnvironment +instanceKlass java/lang/Integer$IntegerCache +instanceKlass sun/misc/NativeSignalHandler +instanceKlass sun/misc/Signal +instanceKlass java/lang/Terminator$1 +instanceKlass sun/misc/SignalHandler +instanceKlass java/lang/Terminator +instanceKlass java/lang/ClassLoader$NativeLibrary +instanceKlass java/io/ExpiringCache$Entry +instanceKlass java/lang/ClassLoader$3 +instanceKlass java/nio/file/Path +instanceKlass java/nio/file/Watchable +instanceKlass java/lang/Enum +instanceKlass java/io/ExpiringCache +instanceKlass java/io/FileSystem +instanceKlass java/io/DefaultFileSystem +instanceKlass java/nio/Bits$1 +instanceKlass sun/misc/JavaNioAccess +instanceKlass java/nio/ByteOrder +instanceKlass java/nio/Bits +instanceKlass java/nio/charset/CodingErrorAction +instanceKlass java/nio/charset/CharsetEncoder +instanceKlass sun/nio/cs/ArrayEncoder +instanceKlass sun/reflect/ReflectionFactory$1 +instanceKlass java/lang/Class$1 +instanceKlass sun/nio/cs/SingleByte +instanceKlass sun/nio/cs/HistoricallyNamedCharset +instanceKlass sun/security/action/GetPropertyAction +instanceKlass java/lang/ThreadLocal +instanceKlass java/nio/charset/spi/CharsetProvider +instanceKlass java/nio/charset/Charset +instanceKlass java/io/Writer +instanceKlass java/util/Arrays +instanceKlass sun/reflect/misc/ReflectUtil +instanceKlass java/lang/reflect/ReflectAccess +instanceKlass sun/reflect/LangReflectAccess +instanceKlass java/lang/reflect/Modifier +instanceKlass sun/reflect/annotation/AnnotationType +instanceKlass java/lang/Class$AnnotationData +instanceKlass sun/reflect/generics/repository/AbstractRepository +instanceKlass java/lang/Class$Atomic +instanceKlass java/lang/Class$ReflectionData +instanceKlass java/lang/Class$3 +instanceKlass java/util/concurrent/atomic/AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl$1 +instanceKlass java/security/PrivilegedExceptionAction +instanceKlass java/util/concurrent/atomic/AtomicReferenceFieldUpdater +instanceKlass java/io/OutputStream +instanceKlass java/io/Flushable +instanceKlass java/io/FileDescriptor$1 +instanceKlass sun/misc/JavaIOFileDescriptorAccess +instanceKlass java/io/FileDescriptor +instanceKlass sun/misc/Version +instanceKlass jdk/internal/util/StaticProperty +instanceKlass java/lang/Runtime +instanceKlass java/util/Hashtable$Enumerator +instanceKlass java/util/Iterator +instanceKlass java/util/Enumeration +instanceKlass java/util/Objects +instanceKlass java/util/Collections$SynchronizedCollection +instanceKlass java/lang/Math +instanceKlass java/util/Hashtable$Entry +instanceKlass sun/misc/VM +instanceKlass java/util/HashMap$Node +instanceKlass java/util/Map$Entry +instanceKlass sun/reflect/Reflection +instanceKlass sun/misc/SharedSecrets +instanceKlass java/lang/ref/Reference$1 +instanceKlass sun/misc/JavaLangRefAccess +instanceKlass java/lang/ref/ReferenceQueue$Lock +instanceKlass java/util/Collections$UnmodifiableCollection +instanceKlass java/util/AbstractMap +instanceKlass java/util/Set +instanceKlass java/util/Collections +instanceKlass java/lang/ref/Reference$Lock +instanceKlass sun/reflect/ReflectionFactory +instanceKlass java/util/AbstractCollection +instanceKlass java/util/RandomAccess +instanceKlass java/util/List +instanceKlass java/util/Collection +instanceKlass java/lang/Iterable +instanceKlass java/security/cert/Certificate +instanceKlass sun/reflect/ReflectionFactory$GetReflectionFactoryAction +instanceKlass java/security/PrivilegedAction +instanceKlass java/security/AccessController +instanceKlass java/security/Permission +instanceKlass java/security/Guard +instanceKlass java/lang/String$CaseInsensitiveComparator +instanceKlass java/util/Comparator +instanceKlass java/io/ObjectStreamField +instanceKlass java/lang/Number +instanceKlass java/lang/Character +instanceKlass java/lang/Boolean +instanceKlass java/nio/Buffer +instanceKlass java/lang/StackTraceElement +instanceKlass java/security/CodeSource +instanceKlass sun/misc/Launcher +instanceKlass java/util/jar/Manifest +instanceKlass java/net/URL +instanceKlass java/io/File +instanceKlass java/io/InputStream +instanceKlass java/io/Closeable +instanceKlass java/lang/AutoCloseable +instanceKlass sun/misc/Unsafe +instanceKlass java/lang/AbstractStringBuilder +instanceKlass java/lang/Appendable +instanceKlass java/lang/invoke/CallSite +instanceKlass java/lang/invoke/MethodType +instanceKlass java/lang/invoke/LambdaForm +instanceKlass java/lang/invoke/MethodHandleNatives +instanceKlass java/lang/invoke/MemberName +instanceKlass java/lang/invoke/MethodHandle +instanceKlass sun/reflect/CallerSensitive +instanceKlass java/lang/annotation/Annotation +instanceKlass sun/reflect/FieldAccessor +instanceKlass sun/reflect/ConstantPool +instanceKlass sun/reflect/ConstructorAccessor +instanceKlass sun/reflect/MethodAccessor +instanceKlass sun/reflect/MagicAccessorImpl +instanceKlass java/lang/reflect/Parameter +instanceKlass java/lang/reflect/Member +instanceKlass java/lang/reflect/AccessibleObject +instanceKlass java/util/Dictionary +instanceKlass java/util/Map +instanceKlass java/lang/ThreadGroup +instanceKlass java/lang/Thread$UncaughtExceptionHandler +instanceKlass java/lang/Thread +instanceKlass java/lang/Runnable +instanceKlass java/lang/ref/ReferenceQueue +instanceKlass java/lang/ref/Reference +instanceKlass java/security/AccessControlContext +instanceKlass java/security/ProtectionDomain +instanceKlass java/lang/SecurityManager +instanceKlass java/lang/Throwable +instanceKlass java/lang/System +instanceKlass java/lang/ClassLoader +instanceKlass java/lang/Cloneable +instanceKlass java/lang/Class +instanceKlass java/lang/reflect/Type +instanceKlass java/lang/reflect/GenericDeclaration +instanceKlass java/lang/reflect/AnnotatedElement +instanceKlass java/lang/String +instanceKlass java/lang/CharSequence +instanceKlass java/lang/Comparable +instanceKlass java/io/Serializable +ciInstanceKlass java/lang/Object 1 1 78 100 10 10 10 10 8 10 10 10 100 8 10 3 8 10 10 7 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 7 1 1 100 1 1 1 1 12 12 100 12 12 1 12 100 12 12 1 1 12 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 +ciInstanceKlass java/io/Serializable 1 0 7 100 100 1 1 1 1 +ciMethod java/lang/CharSequence length ()I 0 0 1 0 -1 +ciMethod java/lang/CharSequence charAt (I)C 0 0 1 0 -1 +ciMethod java/lang/CharSequence toString ()Ljava/lang/String; 0 0 1 0 -1 +ciInstanceKlass java/lang/CharSequence 1 1 89 18 100 10 18 100 10 10 100 10 11 10 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 15 16 15 16 12 1 100 12 15 1 12 100 12 1 12 12 1 1 1 10 1 11 1 1 1 1 1 11 1 1 1 1 100 1 1 1 100 12 12 12 100 1 1 1 100 1 1 1 100 1 1 +ciMethod java/lang/String ([CII)V 4097 1 5635 0 724 +ciMethod java/lang/String length ()I 4097 1 146831 0 0 +ciMethod java/lang/String charAt (I)C 16385 1 332556 0 116 +ciMethod java/lang/String getChars (II[CI)V 3113 1 5549 0 308 +ciMethod java/lang/String equals (Ljava/lang/Object;)Z 16561 53697 20544 0 -1 +ciMethod java/lang/String startsWith (Ljava/lang/String;I)Z 2761 5441 4587 0 468 +ciMethod java/lang/String startsWith (Ljava/lang/String;)Z 2097 1 41334 0 436 +ciMethod java/lang/String hashCode ()I 2745 32769 1367 0 276 +ciMethod java/lang/String lastIndexOf (II)I 833 41657 950 0 -1 +ciMethod java/lang/String lastIndexOfSupplementary (II)I 0 0 1 0 -1 +ciMethod java/lang/String indexOf (Ljava/lang/String;)I 2057 1 16314 0 -1 +ciMethod java/lang/String indexOf (Ljava/lang/String;I)I 2049 1 38417 0 0 +ciMethod java/lang/String indexOf ([CII[CIII)I 833 32801 1442 0 1088 +ciMethod java/lang/String substring (I)Ljava/lang/String; 2049 1 9276 0 0 +ciMethod java/lang/String substring (II)Ljava/lang/String; 2105 1 5445 0 852 +ciMethod java/lang/String contains (Ljava/lang/CharSequence;)Z 2089 1 6921 0 0 +ciMethod java/lang/String toString ()Ljava/lang/String; 665 1 4916 0 0 +ciMethod java/lang/String valueOf (Ljava/lang/Object;)Ljava/lang/String; 649 1 4859 0 0 +ciInstanceKlass java/lang/String 1 1 548 10 8 9 9 10 100 10 10 10 10 100 10 10 10 10 10 100 8 10 10 8 10 10 10 10 10 10 10 10 10 10 10 100 10 10 10 10 10 10 10 10 10 7 10 10 10 100 100 10 10 11 11 10 10 9 11 10 10 10 10 7 3 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 11 10 10 10 10 10 7 10 10 8 10 10 3 3 7 10 10 10 10 10 11 7 10 10 100 10 10 10 11 11 11 7 3 10 10 10 10 8 8 8 10 10 10 10 10 10 10 10 10 10 10 7 10 10 10 10 8 10 10 8 8 10 10 10 10 7 9 7 10 7 100 100 100 1 1 1 1 1 1 1 1 1 5 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 1 100 1 100 1 1 1 1 1 1 1 1 100 1 100 1 1 1 1 100 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 100 100 1 100 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 1 12 12 7 12 1 12 12 12 12 1 100 12 12 12 12 12 1 1 7 12 1 12 12 12 12 12 12 12 100 12 12 1 12 12 7 12 100 12 12 12 12 1 12 1 1 12 12 12 12 7 12 12 7 12 12 12 12 12 1 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 7 12 12 1 12 12 1 12 1 12 12 12 12 7 12 1 12 12 1 12 12 100 12 100 12 12 1 12 12 12 7 12 1 1 1 100 12 12 12 12 12 12 12 12 12 12 12 1 12 12 1 12 1 1 100 12 100 12 7 12 12 1 12 1 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +staticfield java/lang/String serialPersistentFields [Ljava/io/ObjectStreamField; 0 [Ljava/io/ObjectStreamField; +staticfield java/lang/String CASE_INSENSITIVE_ORDER Ljava/util/Comparator; java/lang/String$CaseInsensitiveComparator +ciInstanceKlass java/lang/Class 1 1 1236 9 9 10 10 10 10 9 9 9 9 100 10 10 8 10 8 8 10 10 10 10 10 10 10 10 10 8 10 8 8 10 11 10 10 10 10 10 9 10 100 10 9 7 100 8 10 10 7 10 10 100 100 10 10 10 10 9 10 7 10 100 10 10 10 9 10 10 10 10 10 7 100 10 10 10 10 10 9 10 7 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 100 8 10 10 100 10 100 11 10 10 10 10 10 10 10 8 10 10 10 8 9 10 10 10 10 8 10 8 10 10 10 10 8 10 100 9 10 10 10 10 10 100 10 100 10 10 10 10 10 10 10 10 100 10 10 10 10 10 10 10 10 10 10 10 10 10 9 10 9 100 10 9 10 100 10 9 10 10 10 10 10 10 10 8 10 10 9 10 7 9 10 10 7 10 10 10 10 9 10 9 10 10 10 10 9 9 10 9 100 10 100 10 10 11 11 11 7 11 11 9 9 7 7 10 9 9 10 10 9 7 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 8 7 10 8 8 8 8 10 10 9 9 10 7 9 7 10 7 7 10 10 10 8 10 7 10 7 10 100 8 10 7 10 10 11 10 100 10 10 8 8 10 10 9 11 7 11 9 10 10 10 9 9 10 10 10 10 10 11 11 11 11 7 11 10 10 7 11 10 10 10 11 11 7 10 10 9 9 10 10 10 10 7 9 100 7 100 100 1 1 1 1 7 1 1 1 1 1 3 1 3 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 5 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 100 100 100 1 100 1 1 1 100 1 1 1 1 100 1 1 1 1 1 1 100 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 100 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 100 100 100 100 100 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 100 100 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 100 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 12 12 12 12 12 12 12 12 1 12 1 12 1 1 12 12 12 12 7 12 12 12 12 1 12 1 1 12 12 7 12 7 12 12 7 12 100 12 100 12 100 12 1 12 12 1 1 1 12 12 1 12 7 12 1 1 12 12 12 12 12 1 100 12 12 12 12 12 12 12 12 7 1 1 12 12 7 12 12 12 12 7 12 1 12 12 12 12 12 12 100 12 12 12 12 12 12 7 12 12 12 1 1 12 1 12 1 12 100 12 12 12 100 12 12 1 12 12 12 1 12 12 12 12 12 1 12 1 12 12 12 12 1 12 1 12 12 12 12 12 1 12 1 12 12 12 12 12 12 12 12 1 12 12 12 12 12 12 12 12 12 12 12 12 12 12 1 12 12 1 12 12 100 12 12 12 100 12 12 12 12 1 12 12 12 12 1 12 12 12 1 12 12 7 12 7 12 12 12 12 12 12 12 12 12 12 12 12 1 1 12 7 12 12 100 12 1 12 100 12 12 1 1 12 12 12 12 12 12 1 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 1 1 7 1 1 1 1 12 12 12 12 12 1 12 1 1 1 1 12 100 1 12 1 12 1 12 1 1 1 12 7 12 12 1 12 1 1 7 12 12 12 12 1 12 12 100 12 7 12 12 12 12 12 12 12 12 12 12 7 12 12 1 1 12 7 12 12 1 7 12 12 12 12 1 12 12 12 100 12 12 100 12 12 12 1 12 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +staticfield java/lang/Class serialPersistentFields [Ljava/io/ObjectStreamField; 0 [Ljava/io/ObjectStreamField; +ciInstanceKlass java/lang/Cloneable 1 0 7 100 100 1 1 1 1 +instanceKlass com/google/inject/internal/BytecodeGen$BridgeClassLoader +instanceKlass org/eclipse/sisu/space/CloningClassSpace$CloningClassLoader +instanceKlass java/util/ResourceBundle$RBClassLoader +instanceKlass sun/reflect/DelegatingClassLoader +instanceKlass java/security/SecureClassLoader +ciInstanceKlass java/lang/ClassLoader 1 1 848 9 9 9 10 10 10 10 7 10 7 7 7 10 10 9 7 10 9 9 9 9 9 9 10 10 7 10 9 9 7 9 7 10 10 10 10 10 10 10 10 10 7 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 100 10 100 10 10 10 10 10 100 7 10 8 10 10 10 8 10 100 8 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 8 11 9 11 10 8 8 10 10 10 10 10 10 10 10 7 7 10 10 10 7 10 10 10 7 10 10 10 10 10 10 7 10 10 10 100 10 10 10 9 9 100 8 10 10 10 7 10 10 100 10 100 10 100 10 10 10 10 10 9 10 10 100 10 7 10 10 10 10 10 10 10 10 11 11 11 100 10 9 10 10 7 8 10 9 8 10 9 8 7 10 10 7 8 10 10 10 8 8 10 10 10 8 8 10 10 7 10 10 10 9 10 10 7 9 10 10 8 8 10 10 10 8 10 10 10 10 9 10 10 10 100 10 10 10 10 9 9 9 9 9 10 7 7 10 1 1 7 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 100 100 1 1 1 1 1 1 100 100 100 100 100 1 1 1 1 1 1 100 100 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 100 100 1 1 1 1 1 100 100 1 1 1 1 1 100 100 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 100 1 1 100 1 1 1 1 100 100 1 1 1 1 1 1 1 1 1 1 100 1 100 1 1 1 1 1 1 1 1 1 12 12 12 12 7 12 100 12 12 1 1 1 12 12 12 1 12 12 12 12 12 12 12 12 1 12 12 1 12 1 12 12 12 12 12 12 12 12 1 12 7 12 12 12 12 12 12 12 12 12 100 12 7 12 12 12 12 1 12 1 12 7 12 12 12 12 1 1 1 12 12 1 12 1 1 12 12 12 12 7 12 12 12 12 12 12 100 12 12 12 12 12 12 12 12 12 12 7 12 12 1 7 12 12 12 12 1 1 12 12 12 12 12 12 12 12 1 1 12 12 12 1 12 100 12 7 12 1 12 12 12 7 12 100 12 1 12 7 12 1 12 12 12 12 12 1 1 12 12 1 12 12 1 12 1 100 1 12 12 12 12 12 100 12 12 12 1 1 12 12 12 12 12 12 12 100 12 1 12 12 12 12 1 1 12 1 12 12 1 1 12 1 1 12 12 1 1 12 12 100 12 1 1 12 1 12 12 12 12 12 1 12 12 1 1 12 1 12 12 12 12 12 12 12 12 1 12 12 12 12 100 12 12 12 12 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +staticfield java/lang/ClassLoader nocerts [Ljava/security/cert/Certificate; 0 [Ljava/security/cert/Certificate; +ciMethod java/lang/System arraycopy (Ljava/lang/Object;ILjava/lang/Object;II)V 5121 1 640 0 -1 +ciInstanceKlass java/lang/System 1 1 380 10 10 10 10 10 9 7 10 11 10 10 10 100 8 10 10 8 10 100 10 8 10 10 100 10 10 9 10 9 9 7 10 10 10 10 10 10 100 100 8 10 10 7 10 100 8 10 8 10 100 8 10 100 10 8 10 10 10 8 10 10 10 10 10 10 10 10 10 7 7 10 10 100 10 10 8 10 10 7 9 10 7 9 10 9 7 10 8 10 8 8 10 10 10 10 10 10 10 10 7 10 10 10 9 9 9 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 1 1 1 100 1 100 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 12 12 12 12 12 12 1 7 12 100 12 100 12 12 12 1 1 12 100 12 1 12 1 12 12 100 12 1 12 100 12 12 12 12 12 1 12 12 12 12 12 1 1 1 12 12 1 12 1 1 1 12 1 1 1 1 12 12 7 12 1 12 7 12 12 12 12 12 7 12 12 12 1 1 12 12 1 12 7 12 1 7 12 7 12 1 7 12 12 1 12 12 1 12 1 12 1 1 12 7 12 12 7 12 12 7 12 12 12 1 12 12 12 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +staticfield java/lang/System in Ljava/io/InputStream; java/io/BufferedInputStream +staticfield java/lang/System out Ljava/io/PrintStream; org/fusesource/jansi/AnsiPrintStream +staticfield java/lang/System err Ljava/io/PrintStream; org/fusesource/jansi/AnsiPrintStream +instanceKlass org/apache/maven/artifact/repository/metadata/RepositoryMetadataDeploymentException +instanceKlass org/apache/maven/artifact/repository/metadata/RepositoryMetadataInstallationException +instanceKlass java/lang/Exception +instanceKlass java/lang/Error +ciInstanceKlass java/lang/Throwable 1 1 363 10 9 9 9 9 9 10 9 10 10 100 100 10 8 10 8 10 10 10 100 8 10 10 10 10 8 9 10 100 10 10 100 10 10 11 10 10 10 8 10 10 7 8 8 10 10 8 8 9 10 100 10 11 8 8 10 8 10 8 100 10 9 10 10 7 10 7 10 10 100 8 10 10 10 10 7 10 10 11 11 11 8 8 10 11 10 9 8 7 10 100 8 10 11 8 9 10 9 11 100 10 10 100 100 1 1 1 100 1 100 1 1 1 1 5 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 1 1 1 1 1 1 1 1 1 1 1 1 100 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 100 1 100 100 1 1 1 1 1 1 1 1 1 1 1 12 12 12 12 12 12 12 12 12 12 1 1 1 12 1 100 12 12 1 1 12 7 12 12 1 100 12 12 1 12 12 1 7 12 100 12 12 12 12 1 12 12 1 1 1 12 12 1 1 12 100 12 1 12 1 1 12 1 12 1 1 12 12 12 7 12 12 1 12 100 1 1 12 100 12 100 12 1 100 12 12 100 12 100 12 12 1 1 100 12 1 1 12 1 1 12 1 12 100 12 12 12 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +staticfield java/lang/Throwable UNASSIGNED_STACK [Ljava/lang/StackTraceElement; 0 [Ljava/lang/StackTraceElement; +staticfield java/lang/Throwable SUPPRESSED_SENTINEL Ljava/util/List; java/util/Collections$UnmodifiableRandomAccessList +staticfield java/lang/Throwable EMPTY_THROWABLE_ARRAY [Ljava/lang/Throwable; 0 [Ljava/lang/Throwable; +staticfield java/lang/Throwable $assertionsDisabled Z 1 +instanceKlass java/util/ServiceConfigurationError +instanceKlass com/google/common/util/concurrent/ExecutionError +instanceKlass java/lang/AssertionError +instanceKlass org/apache/maven/BuildAbort +instanceKlass java/lang/VirtualMachineError +instanceKlass java/lang/LinkageError +instanceKlass java/lang/ThreadDeath +ciInstanceKlass java/lang/Error 1 1 30 10 10 10 10 10 100 7 1 1 1 5 0 1 1 1 1 1 1 1 1 1 1 12 12 12 12 12 1 1 +ciInstanceKlass java/lang/ThreadDeath 0 0 18 10 100 100 1 1 1 5 0 1 1 1 1 1 1 12 1 1 +instanceKlass org/codehaus/plexus/interpolation/reflection/MethodMap$AmbiguousException +instanceKlass org/apache/maven/model/resolution/UnresolvableModelException +instanceKlass org/apache/maven/model/resolution/InvalidRepositoryException +instanceKlass org/apache/maven/toolchain/building/ToolchainsBuildingException +instanceKlass org/apache/maven/execution/MavenExecutionRequestPopulationException +instanceKlass org/apache/maven/plugin/version/PluginVersionNotFoundException +instanceKlass org/apache/maven/plugin/InvalidPluginException +instanceKlass org/apache/maven/artifact/repository/metadata/RepositoryMetadataReadException +instanceKlass org/apache/maven/artifact/repository/metadata/RepositoryMetadataStoreException +instanceKlass org/apache/maven/BuildFailureException +instanceKlass org/codehaus/plexus/util/dag/CycleDetectedException +instanceKlass org/apache/maven/project/DuplicateProjectException +instanceKlass org/apache/maven/repository/ArtifactDoesNotExistException +instanceKlass org/apache/maven/repository/ArtifactTransferFailedException +instanceKlass org/apache/maven/artifact/installer/ArtifactInstallationException +instanceKlass org/codehaus/plexus/interpolation/InterpolationException +instanceKlass org/apache/maven/project/interpolation/ModelInterpolationException +instanceKlass java/security/GeneralSecurityException +instanceKlass org/apache/maven/artifact/deployer/ArtifactDeploymentException +instanceKlass org/apache/maven/project/DependencyResolutionException +instanceKlass org/apache/maven/model/building/ModelBuildingException +instanceKlass org/apache/maven/wagon/providers/http/httpclient/HttpException +instanceKlass org/eclipse/aether/RepositoryException +instanceKlass org/apache/maven/lifecycle/LifecycleExecutionException +instanceKlass org/apache/maven/lifecycle/LifecycleNotFoundException +instanceKlass org/apache/maven/lifecycle/LifecyclePhaseNotFoundException +instanceKlass org/apache/maven/repository/metadata/MetadataGraphTransformationException +instanceKlass org/apache/maven/lifecycle/internal/builder/BuilderNotFoundException +instanceKlass org/apache/maven/lifecycle/NoGoalSpecifiedException +instanceKlass org/apache/maven/lifecycle/MissingProjectException +instanceKlass org/apache/maven/wagon/WagonException +instanceKlass org/apache/maven/artifact/repository/metadata/RepositoryMetadataResolutionException +instanceKlass org/apache/maven/artifact/versioning/InvalidVersionSpecificationException +instanceKlass org/apache/maven/settings/building/SettingsBuildingException +instanceKlass org/codehaus/plexus/component/composition/CycleDetectedInComponentGraphException +instanceKlass org/codehaus/plexus/component/configurator/expression/ExpressionEvaluationException +instanceKlass org/codehaus/plexus/configuration/PlexusConfigurationException +instanceKlass org/codehaus/plexus/component/repository/exception/ComponentLifecycleException +instanceKlass org/codehaus/plexus/personality/plexus/lifecycle/phase/InitializationException +instanceKlass org/apache/maven/plugin/PluginConfigurationException +instanceKlass org/apache/maven/plugin/PluginManagerException +instanceKlass org/apache/maven/artifact/InvalidRepositoryException +instanceKlass org/apache/maven/project/ProjectBuildingException +instanceKlass org/sonatype/plexus/components/sec/dispatcher/SecDispatcherException +instanceKlass org/sonatype/plexus/components/cipher/PlexusCipherException +instanceKlass org/apache/maven/repository/legacy/metadata/ArtifactMetadataRetrievalException +instanceKlass org/apache/maven/repository/metadata/GraphConflictResolutionException +instanceKlass org/apache/maven/repository/metadata/MetadataResolutionException +instanceKlass org/apache/maven/repository/legacy/resolver/conflict/ConflictResolverNotFoundException +instanceKlass org/apache/maven/MavenExecutionException +instanceKlass org/apache/maven/configuration/BeanConfigurationException +instanceKlass org/codehaus/plexus/component/configurator/ComponentConfigurationException +instanceKlass org/apache/maven/toolchain/MisconfiguredToolchainException +instanceKlass org/apache/maven/plugin/InvalidPluginDescriptorException +instanceKlass org/apache/maven/plugin/MojoNotFoundException +instanceKlass org/apache/maven/plugin/PluginDescriptorParsingException +instanceKlass org/apache/maven/plugin/PluginResolutionException +instanceKlass org/apache/maven/artifact/resolver/AbstractArtifactResolutionException +instanceKlass org/apache/maven/plugin/prefix/NoPluginFoundForPrefixException +instanceKlass org/apache/maven/plugin/version/PluginVersionResolutionException +instanceKlass org/apache/maven/plugin/AbstractMojoExecutionException +instanceKlass java/util/concurrent/TimeoutException +instanceKlass java/util/concurrent/ExecutionException +instanceKlass com/google/inject/internal/ErrorsException +instanceKlass com/google/inject/internal/InternalProvisionException +instanceKlass org/codehaus/plexus/context/ContextException +instanceKlass java/text/ParseException +instanceKlass org/codehaus/plexus/PlexusContainerException +instanceKlass org/codehaus/plexus/component/repository/exception/ComponentLookupException +instanceKlass org/codehaus/plexus/util/xml/pull/XmlPullParserException +instanceKlass java/security/PrivilegedActionException +instanceKlass java/lang/CloneNotSupportedException +instanceKlass org/apache/commons/cli/ParseException +instanceKlass org/apache/maven/cli/MavenCli$ExitException +instanceKlass org/codehaus/plexus/classworlds/launcher/ConfigurationException +instanceKlass java/io/IOException +instanceKlass org/codehaus/plexus/classworlds/ClassWorldException +instanceKlass java/lang/InterruptedException +instanceKlass java/lang/ReflectiveOperationException +instanceKlass java/lang/RuntimeException +ciInstanceKlass java/lang/Exception 1 1 30 10 10 10 10 10 100 7 1 1 1 5 0 1 1 1 1 1 1 1 1 1 1 12 12 12 12 12 1 1 +instanceKlass java/util/ConcurrentModificationException +instanceKlass com/google/inject/OutOfScopeException +instanceKlass org/apache/maven/artifact/InvalidArtifactRTException +instanceKlass java/lang/annotation/IncompleteAnnotationException +instanceKlass java/lang/reflect/UndeclaredThrowableException +instanceKlass com/google/common/cache/CacheLoader$InvalidCacheLoadException +instanceKlass com/google/common/util/concurrent/UncheckedExecutionException +instanceKlass java/util/NoSuchElementException +instanceKlass com/google/inject/CreationException +instanceKlass com/google/inject/ConfigurationException +instanceKlass com/google/inject/ProvisionException +instanceKlass java/lang/TypeNotPresentException +instanceKlass java/lang/IndexOutOfBoundsException +instanceKlass java/lang/SecurityException +instanceKlass java/lang/UnsupportedOperationException +instanceKlass java/lang/IllegalStateException +instanceKlass java/lang/IllegalArgumentException +instanceKlass java/lang/ArithmeticException +instanceKlass java/lang/NullPointerException +instanceKlass java/lang/IllegalMonitorStateException +instanceKlass java/lang/ArrayStoreException +instanceKlass java/lang/ClassCastException +ciInstanceKlass java/lang/RuntimeException 1 1 30 10 10 10 10 10 100 7 1 1 1 5 0 1 1 1 1 1 1 1 1 1 1 12 12 12 12 12 1 1 +ciInstanceKlass java/lang/SecurityManager 0 0 383 9 10 100 9 10 9 100 10 100 8 10 10 10 10 10 10 10 10 10 100 10 10 9 10 10 10 100 8 10 9 9 8 9 100 10 8 10 10 10 100 10 10 100 100 8 10 8 8 8 8 8 8 10 8 8 8 8 8 10 10 8 100 8 10 8 8 8 8 8 10 8 100 8 8 10 8 9 8 9 9 8 10 100 8 10 10 100 10 10 10 8 9 9 100 10 10 10 9 8 8 9 9 100 10 9 8 8 8 10 10 9 100 10 10 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 100 100 100 1 1 1 1 100 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 100 1 1 1 1 1 100 100 1 1 1 1 1 100 1 1 1 1 1 1 1 1 12 12 1 12 12 12 1 100 12 1 1 12 12 12 12 12 12 12 100 12 1 12 100 12 12 100 12 1 1 12 12 1 12 1 1 12 12 12 1 12 1 1 1 12 1 1 1 1 1 1 12 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 100 12 1 1 1 1 1 100 12 1 12 12 1 12 1 1 12 1 12 12 12 1 12 12 1 12 12 12 12 1 1 12 12 1 12 1 1 1 12 100 12 12 1 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +ciInstanceKlass java/security/ProtectionDomain 1 1 287 9 10 9 7 10 9 9 9 10 7 9 9 7 9 10 100 10 10 10 10 9 10 8 100 8 10 10 10 10 10 8 11 8 10 8 8 10 10 10 10 8 10 8 8 10 9 10 9 10 100 100 10 10 7 10 100 10 10 11 11 11 100 10 10 11 11 10 10 11 10 7 10 10 8 10 7 10 10 7 7 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 100 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 1 100 100 1 100 100 100 100 100 100 100 1 1 1 1 1 1 12 12 12 1 12 12 12 12 12 1 12 12 1 12 100 12 100 100 12 12 12 100 12 1 1 1 12 12 100 12 12 1 1 12 1 1 12 12 12 12 1 12 1 1 100 12 12 12 12 100 12 1 1 100 12 1 1 12 12 100 12 12 100 12 1 12 12 12 12 100 12 12 12 1 12 7 12 1 7 12 1 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +staticfield java/security/ProtectionDomain debug Lsun/security/util/Debug; null +ciInstanceKlass java/security/AccessControlContext 1 1 313 9 9 10 8 10 10 9 9 9 10 100 100 10 11 11 11 11 7 11 10 10 9 10 11 10 100 100 8 10 10 100 9 9 9 9 9 9 9 10 9 10 10 8 10 10 10 100 10 10 10 10 8 10 8 10 8 8 10 8 10 8 10 10 10 8 8 100 10 10 100 10 8 10 10 10 8 10 10 10 7 10 10 10 10 10 10 10 10 7 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 1 1 100 1 100 100 1 1 1 1 1 1 1 1 100 1 1 1 100 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 100 12 1 100 12 12 12 12 12 100 12 1 12 100 12 12 12 12 1 12 12 7 12 100 12 100 12 100 12 1 1 1 12 12 1 12 12 12 12 12 12 12 7 12 12 12 12 1 12 12 100 12 1 12 100 12 1 100 12 1 100 12 1 1 12 1 12 1 12 12 12 1 1 1 12 12 1 12 1 12 1 12 12 12 1 12 12 12 12 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +instanceKlass java/net/URLClassLoader +ciInstanceKlass java/security/SecureClassLoader 1 1 134 10 7 10 9 10 10 9 10 10 10 10 10 7 10 10 7 10 10 10 9 100 10 8 10 10 10 10 8 100 8 10 8 10 10 7 7 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 100 1 1 1 1 1 1 1 1 1 1 100 100 100 1 1 1 1 12 1 12 12 7 12 100 12 12 12 12 12 12 12 1 12 1 12 12 12 12 1 1 12 12 12 7 12 1 1 1 12 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +staticfield java/security/SecureClassLoader debug Lsun/security/util/Debug; null +instanceKlass java/lang/NoSuchFieldException +instanceKlass java/lang/InstantiationException +instanceKlass java/lang/IllegalAccessException +instanceKlass java/lang/reflect/InvocationTargetException +instanceKlass java/lang/NoSuchMethodException +instanceKlass java/lang/ClassNotFoundException +ciInstanceKlass java/lang/ReflectiveOperationException 1 1 27 10 10 10 10 100 7 1 1 1 5 0 1 1 1 1 1 1 1 1 1 12 12 12 12 1 1 +ciInstanceKlass java/lang/ClassNotFoundException 1 1 32 100 10 10 9 100 7 1 1 1 5 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 12 1 1 1 +instanceKlass java/lang/ClassFormatError +instanceKlass java/lang/UnsatisfiedLinkError +instanceKlass java/lang/IncompatibleClassChangeError +instanceKlass java/lang/BootstrapMethodError +instanceKlass java/lang/NoClassDefFoundError +ciInstanceKlass java/lang/LinkageError 1 1 24 10 10 10 100 7 1 1 1 5 0 1 1 1 1 1 1 1 1 12 12 12 1 1 +ciInstanceKlass java/lang/NoClassDefFoundError 1 1 21 10 10 100 7 1 1 1 5 0 1 1 1 1 1 1 1 12 12 1 1 +ciInstanceKlass java/lang/ClassCastException 1 1 21 10 10 100 100 1 1 1 5 0 1 1 1 1 1 1 1 12 12 1 1 +ciInstanceKlass java/lang/ArrayStoreException 1 1 21 10 10 100 100 1 1 1 5 0 1 1 1 1 1 1 1 12 12 1 1 +instanceKlass java/lang/StackOverflowError +instanceKlass java/lang/OutOfMemoryError +ciInstanceKlass java/lang/VirtualMachineError 1 1 27 10 10 10 10 100 100 1 1 1 5 0 1 1 1 1 1 1 1 1 1 12 12 12 12 1 1 +ciInstanceKlass java/lang/OutOfMemoryError 1 1 21 10 10 100 100 1 1 1 5 0 1 1 1 1 1 1 1 12 12 1 1 +ciInstanceKlass java/lang/StackOverflowError 1 1 21 10 10 100 100 1 1 1 5 0 1 1 1 1 1 1 1 12 12 1 1 +ciInstanceKlass java/lang/IllegalMonitorStateException 1 1 21 10 10 100 100 1 1 1 5 0 1 1 1 1 1 1 1 12 12 1 1 +instanceKlass java/lang/ref/PhantomReference +instanceKlass java/lang/ref/FinalReference +instanceKlass java/lang/ref/WeakReference +instanceKlass java/lang/ref/SoftReference +ciInstanceKlass java/lang/ref/Reference 1 1 141 9 9 7 9 10 100 10 100 10 9 9 10 9 9 10 10 7 10 10 10 10 7 8 10 7 10 10 10 7 10 10 7 7 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 100 100 100 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 12 12 1 12 12 1 12 1 12 12 7 12 12 12 12 12 12 1 12 12 12 7 12 1 1 12 1 12 12 12 1 7 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +instanceKlass org/eclipse/sisu/inject/MildElements$Soft +instanceKlass com/google/common/cache/LocalCache$SoftValueReference +instanceKlass sun/util/locale/provider/LocaleResources$ResourceReference +instanceKlass java/util/ResourceBundle$BundleReference +instanceKlass org/eclipse/sisu/inject/MildKeys$Soft +instanceKlass sun/util/locale/LocaleObjectCache$CacheEntry +ciInstanceKlass java/lang/ref/SoftReference 1 1 35 10 9 9 10 10 7 7 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 12 12 12 12 12 1 1 1 +instanceKlass sun/nio/ch/SharedFileLockTable$FileLockReference +instanceKlass java/lang/reflect/Proxy$Key2 +instanceKlass org/eclipse/sisu/inject/MildElements$Weak +instanceKlass com/google/common/cache/LocalCache$WeakEntry +instanceKlass java/lang/reflect/WeakCache$CacheValue +instanceKlass java/lang/reflect/Proxy$Key1 +instanceKlass java/lang/reflect/WeakCache$CacheKey +instanceKlass com/google/common/cache/LocalCache$WeakValueReference +instanceKlass java/util/logging/LogManager$LoggerWeakRef +instanceKlass java/util/ResourceBundle$LoaderReference +instanceKlass org/eclipse/sisu/inject/MildKeys$Weak +instanceKlass java/lang/ThreadLocal$ThreadLocalMap$Entry +instanceKlass java/lang/ClassValue$Entry +instanceKlass java/util/WeakHashMap$Entry +ciInstanceKlass java/lang/ref/WeakReference 1 1 20 10 10 100 7 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 +instanceKlass java/lang/ref/Finalizer +ciInstanceKlass java/lang/ref/FinalReference 1 1 16 10 100 7 1 1 1 1 1 1 1 1 1 12 1 1 +instanceKlass sun/misc/Cleaner +ciInstanceKlass java/lang/ref/PhantomReference 1 1 19 10 100 100 1 1 1 1 1 1 1 1 1 1 1 1 12 1 1 +ciInstanceKlass sun/misc/Cleaner 1 1 75 9 9 9 9 10 9 7 10 10 10 11 100 100 10 10 7 10 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 12 12 12 12 12 12 1 12 12 12 100 12 1 1 12 100 12 1 12 1 1 1 1 1 1 1 1 +staticfield sun/misc/Cleaner dummyQueue Ljava/lang/ref/ReferenceQueue; java/lang/ref/ReferenceQueue +ciInstanceKlass java/lang/ref/Finalizer 1 1 153 9 9 9 10 9 9 10 10 7 10 10 10 10 7 11 100 10 100 10 10 10 100 10 10 100 10 7 10 7 10 10 10 10 7 10 7 10 10 10 7 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 12 12 12 12 12 12 12 12 1 12 12 12 12 1 7 12 1 12 1 12 100 12 100 12 1 12 12 1 1 1 12 12 7 12 1 12 1 12 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +staticfield java/lang/ref/Finalizer lock Ljava/lang/Object; java/lang/Object +instanceKlass java/lang/ref/ReferenceQueue$Null +ciInstanceKlass java/lang/ref/ReferenceQueue 1 1 133 10 7 10 9 9 9 9 9 9 9 100 10 9 7 10 10 10 100 8 10 10 10 5 0 10 11 7 10 7 10 7 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 100 100 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 12 1 12 12 12 12 7 12 12 12 12 1 12 1 7 12 12 12 1 1 12 100 12 12 12 100 12 1 7 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +staticfield java/lang/ref/ReferenceQueue $assertionsDisabled Z 1 +instanceKlass java/util/logging/LogManager$Cleaner +instanceKlass org/apache/maven/shared/utils/logging/MessageUtils$1 +instanceKlass java/lang/ref/Finalizer$FinalizerThread +instanceKlass java/lang/ref/Reference$ReferenceHandler +ciInstanceKlass java/lang/Thread 1 1 550 9 9 9 9 100 8 10 3 8 3 10 10 100 8 10 9 10 10 10 10 10 10 10 9 10 10 9 10 9 10 9 10 9 10 9 9 10 9 10 9 10 9 100 10 10 9 9 9 7 7 10 8 10 10 10 10 10 100 10 10 10 10 100 11 10 9 10 9 10 100 10 10 100 10 10 11 10 100 10 10 10 7 10 10 10 10 10 10 10 10 10 10 100 8 10 10 10 8 10 8 10 8 8 10 10 7 8 10 9 9 10 10 10 9 10 100 10 11 9 9 10 100 10 11 100 10 10 11 10 100 10 10 10 8 9 10 11 10 11 10 7 8 100 1 1 100 1 100 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 1 3 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 100 100 1 1 1 1 1 1 100 1 1 1 1 100 100 100 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 1 1 100 100 1 1 1 1 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 12 12 12 12 1 1 12 1 12 12 1 1 12 12 7 12 100 12 7 12 12 12 12 12 12 12 12 12 12 12 12 12 7 12 12 12 12 12 100 12 12 12 12 1 12 12 12 12 1 1 1 12 12 12 12 12 1 12 12 12 1 12 12 12 100 12 12 1 12 1 12 100 12 12 1 12 12 1 12 12 12 12 12 12 12 12 12 1 1 12 12 1 12 1 1 1 100 12 100 12 1 12 12 12 12 12 12 1 12 100 12 12 12 12 1 12 100 12 1 12 12 12 12 1 12 12 100 12 12 12 12 100 12 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +staticfield java/lang/Thread EMPTY_STACK_TRACE [Ljava/lang/StackTraceElement; 0 [Ljava/lang/StackTraceElement; +staticfield java/lang/Thread SUBCLASS_IMPLEMENTATION_PERMISSION Ljava/lang/RuntimePermission; java/lang/RuntimePermission +ciInstanceKlass java/lang/ThreadGroup 1 1 275 10 9 8 9 7 9 9 10 10 10 10 10 9 9 10 10 9 10 9 9 10 100 10 10 10 9 10 10 9 10 10 10 10 10 10 10 10 10 10 10 100 10 10 10 7 10 100 10 9 10 8 10 10 10 10 11 100 9 100 10 8 10 10 8 10 10 10 10 10 8 10 8 10 8 7 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 100 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 100 1 1 100 1 1 1 1 12 12 1 12 1 12 12 12 12 12 12 12 12 12 12 12 12 100 12 12 12 100 12 12 7 12 100 12 12 12 12 12 12 12 12 12 12 12 12 12 12 1 12 12 1 12 12 12 12 1 100 12 12 12 12 1 12 1 1 12 12 1 12 100 12 100 12 12 100 1 1 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +ciMethod java/util/Map get (Ljava/lang/Object;)Ljava/lang/Object; 0 0 1 0 -1 +ciInstanceKlass java/util/Map 1 1 139 11 11 10 11 11 11 11 100 11 11 100 100 10 11 11 11 11 10 11 11 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 100 100 100 100 100 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 100 12 12 100 12 100 12 12 1 12 12 1 1 12 100 12 100 12 12 12 12 12 100 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +instanceKlass java/util/Hashtable +ciInstanceKlass java/util/Dictionary 1 1 31 10 100 7 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 1 1 +instanceKlass java/util/Properties +ciInstanceKlass java/util/Hashtable 1 1 431 100 9 9 9 10 10 100 100 10 8 10 10 10 10 10 8 10 9 7 7 4 10 9 4 10 11 10 10 10 100 10 9 10 9 10 10 3 9 9 3 10 10 10 11 11 11 11 7 11 11 10 10 10 9 9 9 100 100 10 10 8 10 10 8 10 8 10 7 10 10 7 10 10 7 10 100 10 10 7 11 11 100 10 10 10 11 100 10 100 11 11 10 10 10 10 10 100 10 10 8 10 10 100 11 10 10 10 7 100 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 5 0 1 1 1 1 1 1 1 1 1 1 3 1 3 1 3 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 100 1 1 100 100 100 1 1 1 1 1 1 1 1 1 1 1 1 100 100 100 1 1 1 1 1 100 1 1 1 100 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 100 1 100 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 12 12 12 1 1 1 12 12 12 12 7 12 1 12 12 1 1 7 12 12 12 12 12 12 12 1 12 7 12 12 12 12 12 12 12 12 12 12 7 12 7 12 12 1 12 12 12 12 12 12 12 1 1 12 1 12 1 1 7 12 1 12 12 1 12 12 1 1 12 1 12 12 1 100 12 100 12 1 100 12 100 12 12 100 12 12 12 100 12 1 12 1 12 100 12 1 100 12 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +instanceKlass java/security/Provider +ciInstanceKlass java/util/Properties 1 1 273 10 10 9 10 7 10 10 10 10 9 10 100 3 100 8 10 7 10 10 100 10 10 10 10 10 8 10 10 10 10 10 100 100 10 10 100 8 10 10 100 10 10 100 10 10 10 10 11 11 10 10 8 10 10 100 10 10 8 10 100 10 10 10 7 10 10 10 10 8 10 8 10 10 9 7 100 1 1 1 1 1 1 5 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 100 1 1 1 1 100 1 1 100 100 1 1 100 1 1 1 1 1 100 1 1 100 100 100 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 12 12 12 12 1 12 12 12 12 12 12 1 1 1 12 1 12 12 1 12 12 12 12 12 1 12 12 12 12 12 1 1 12 12 1 1 12 12 1 12 1 12 7 12 12 12 12 1 12 100 12 1 12 12 1 12 1 12 12 1 12 12 12 1 100 12 1 100 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +staticfield java/util/Properties hexDigit [C 16 +instanceKlass java/lang/reflect/Executable +instanceKlass java/lang/reflect/Field +ciInstanceKlass java/lang/reflect/AccessibleObject 1 1 147 10 9 10 10 7 10 7 100 8 10 9 10 100 8 10 11 10 10 10 9 10 10 100 10 10 7 8 10 7 10 10 7 9 7 7 7 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 100 1 1 1 1 1 1 1 7 12 12 100 12 12 1 12 1 1 1 12 12 12 1 1 12 12 12 12 12 12 100 12 12 1 12 100 12 1 1 1 1 1 7 12 1 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +staticfield java/lang/reflect/AccessibleObject ACCESS_PERMISSION Ljava/security/Permission; java/lang/reflect/ReflectPermission +staticfield java/lang/reflect/AccessibleObject reflectionFactory Lsun/reflect/ReflectionFactory; sun/reflect/ReflectionFactory +ciInstanceKlass java/lang/reflect/Field 1 1 372 9 10 10 10 9 10 10 10 10 9 9 9 9 9 9 9 100 8 10 7 10 9 9 10 7 10 10 10 10 10 10 10 100 10 8 10 10 8 10 10 8 10 11 9 10 10 10 10 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 10 10 9 10 10 10 10 11 10 7 10 10 9 10 11 10 10 9 10 7 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 100 100 1 100 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 100 1 1 1 1 1 1 1 12 12 7 12 7 12 12 12 12 7 12 12 12 12 12 12 12 12 12 1 1 12 1 12 12 12 12 1 12 12 12 12 12 7 7 12 1 1 12 12 1 12 12 1 100 12 100 12 12 12 12 7 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 7 12 12 7 12 12 7 12 1 100 12 7 12 12 7 12 7 12 12 12 100 12 100 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 +ciInstanceKlass java/lang/reflect/Parameter 0 0 215 10 9 9 9 9 9 9 100 10 10 10 100 10 10 11 10 10 10 10 10 8 8 10 10 10 8 10 8 10 10 10 10 10 10 10 10 10 10 11 10 100 10 10 10 10 10 9 100 10 11 11 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 100 100 100 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 12 12 12 12 12 12 12 1 12 12 100 12 1 12 100 12 12 100 12 12 12 12 1 1 100 12 12 12 1 1 12 12 12 12 12 12 12 100 12 12 100 12 100 12 1 100 12 12 12 12 12 12 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +instanceKlass java/lang/reflect/Constructor +instanceKlass java/lang/reflect/Method +ciInstanceKlass java/lang/reflect/Executable 1 1 389 10 10 10 11 10 10 10 8 10 10 10 7 8 100 10 10 10 10 8 10 100 8 10 8 10 10 8 10 10 11 10 8 8 10 10 7 10 100 10 10 10 10 10 10 100 10 10 10 10 10 100 10 100 8 10 10 100 8 10 10 10 10 10 8 8 3 8 9 10 100 8 9 10 10 10 10 10 10 7 10 10 10 10 11 10 7 10 10 9 10 10 10 9 10 10 9 10 9 10 9 7 7 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 100 100 1 1 1 1 1 100 100 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 100 1 1 1 1 1 1 1 1 1 1 1 12 7 12 12 7 12 7 12 12 12 1 12 12 12 1 1 1 12 12 12 1 12 1 1 12 1 12 100 1 12 12 12 1 1 100 12 12 1 12 1 12 12 7 12 12 12 1 12 12 12 12 100 12 12 1 1 12 12 1 1 12 12 12 12 1 1 1 12 12 1 1 12 12 12 12 12 12 12 1 12 12 7 12 12 7 12 12 1 100 12 12 12 12 12 12 100 12 100 12 12 12 12 12 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +ciInstanceKlass java/lang/reflect/Method 1 1 353 9 10 10 9 10 10 10 10 9 9 9 9 9 9 9 9 9 9 9 100 8 10 7 10 9 10 10 7 7 10 10 10 7 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 11 9 10 10 10 10 11 10 100 10 10 10 10 9 10 10 10 10 10 11 10 7 100 100 10 8 10 10 10 10 10 10 10 8 7 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 100 1 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 7 12 7 12 12 12 12 7 12 12 12 12 12 12 12 12 12 12 12 12 12 1 1 12 1 12 12 12 12 1 1 12 12 7 12 12 7 12 12 12 7 12 12 7 100 12 12 12 12 12 12 12 12 12 100 12 7 12 12 12 12 7 12 12 1 12 12 12 12 12 7 12 12 7 12 7 12 7 12 7 12 7 12 1 1 1 1 12 12 12 12 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +ciInstanceKlass java/lang/reflect/Constructor 1 1 335 10 10 9 10 10 10 9 10 9 9 9 9 9 9 9 9 100 8 10 7 10 9 10 10 10 10 100 100 10 7 10 10 10 10 10 10 10 10 10 10 10 9 10 10 10 10 100 8 10 11 10 10 10 9 10 10 10 10 10 10 10 10 10 100 8 10 10 10 10 10 10 11 9 10 7 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 100 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 7 12 7 12 12 12 12 7 12 12 12 12 12 12 12 12 12 12 12 1 1 12 1 12 12 12 7 12 12 12 1 1 7 12 12 7 12 12 7 12 12 12 12 100 12 12 12 12 7 12 12 12 12 1 1 12 7 12 12 12 12 12 7 12 12 12 12 12 12 12 12 12 1 1 12 12 12 12 100 12 100 12 100 12 100 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 +instanceKlass sun/reflect/FieldAccessorImpl +instanceKlass sun/reflect/ConstructorAccessorImpl +instanceKlass sun/reflect/MethodAccessorImpl +ciInstanceKlass sun/reflect/MagicAccessorImpl 1 1 13 10 100 7 1 1 1 1 1 1 12 1 1 +instanceKlass sun/reflect/GeneratedMethodAccessor7 +instanceKlass sun/reflect/GeneratedMethodAccessor6 +instanceKlass sun/reflect/GeneratedMethodAccessor5 +instanceKlass sun/reflect/GeneratedMethodAccessor4 +instanceKlass sun/reflect/GeneratedMethodAccessor3 +instanceKlass sun/reflect/GeneratedMethodAccessor2 +instanceKlass sun/reflect/GeneratedMethodAccessor1 +instanceKlass sun/reflect/DelegatingMethodAccessorImpl +instanceKlass sun/reflect/NativeMethodAccessorImpl +ciInstanceKlass sun/reflect/MethodAccessorImpl 1 1 22 10 100 7 100 1 1 1 1 1 1 1 100 100 1 1 12 1 1 1 1 1 +instanceKlass sun/reflect/GeneratedConstructorAccessor16 +instanceKlass sun/reflect/GeneratedConstructorAccessor15 +instanceKlass sun/reflect/GeneratedConstructorAccessor14 +instanceKlass sun/reflect/GeneratedConstructorAccessor13 +instanceKlass sun/reflect/GeneratedConstructorAccessor12 +instanceKlass sun/reflect/GeneratedConstructorAccessor11 +instanceKlass sun/reflect/GeneratedConstructorAccessor10 +instanceKlass sun/reflect/GeneratedConstructorAccessor9 +instanceKlass sun/reflect/GeneratedConstructorAccessor8 +instanceKlass sun/reflect/GeneratedConstructorAccessor7 +instanceKlass sun/reflect/GeneratedConstructorAccessor6 +instanceKlass sun/reflect/GeneratedConstructorAccessor5 +instanceKlass sun/reflect/GeneratedConstructorAccessor4 +instanceKlass sun/reflect/GeneratedConstructorAccessor3 +instanceKlass sun/reflect/GeneratedConstructorAccessor2 +instanceKlass sun/reflect/BootstrapConstructorAccessorImpl +instanceKlass sun/reflect/GeneratedConstructorAccessor1 +instanceKlass sun/reflect/DelegatingConstructorAccessorImpl +instanceKlass sun/reflect/NativeConstructorAccessorImpl +ciInstanceKlass sun/reflect/ConstructorAccessorImpl 1 1 24 10 100 7 100 1 1 1 1 1 1 1 100 100 100 1 1 12 1 1 1 1 1 1 +ciInstanceKlass sun/reflect/DelegatingClassLoader 1 1 13 10 100 7 1 1 1 1 1 1 12 1 1 +ciInstanceKlass sun/reflect/ConstantPool 1 1 106 10 9 10 10 10 10 10 10 10 10 10 10 10 10 10 10 7 7 8 10 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 1 1 7 12 1 1 1 1 +instanceKlass sun/reflect/UnsafeFieldAccessorImpl +ciInstanceKlass sun/reflect/FieldAccessorImpl 1 1 56 10 100 7 100 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 1 1 1 1 1 +instanceKlass sun/reflect/UnsafeObjectFieldAccessorImpl +instanceKlass sun/reflect/UnsafeStaticFieldAccessorImpl +ciInstanceKlass sun/reflect/UnsafeFieldAccessorImpl 1 1 233 10 9 10 10 9 10 9 10 10 9 10 10 10 10 100 10 10 10 8 10 10 100 8 10 8 10 8 10 100 10 10 8 10 8 10 8 10 8 10 8 10 8 10 8 10 8 10 8 10 10 8 8 8 8 8 8 10 8 8 8 10 10 7 7 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 1 1 1 1 1 1 1 1 1 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 7 12 7 12 12 7 12 12 12 12 12 12 7 12 7 12 12 1 12 12 1 12 1 1 12 1 12 1 12 1 12 1 12 1 100 12 1 100 12 1 100 12 1 100 12 1 100 12 1 100 12 1 100 12 1 100 12 12 1 1 1 1 1 1 100 12 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +staticfield sun/reflect/UnsafeFieldAccessorImpl unsafe Lsun/misc/Unsafe; sun/misc/Unsafe +instanceKlass sun/reflect/UnsafeQualifiedStaticFieldAccessorImpl +ciInstanceKlass sun/reflect/UnsafeStaticFieldAccessorImpl 1 1 38 10 9 10 9 7 7 8 10 7 1 1 1 1 1 1 1 1 1 1 12 12 7 12 12 1 1 7 12 1 1 1 1 1 1 1 1 1 +ciInstanceKlass sun/reflect/CallerSensitive 0 0 17 100 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 +instanceKlass java/lang/invoke/DirectMethodHandle +ciInstanceKlass java/lang/invoke/MethodHandle 1 1 444 9 10 10 10 9 10 10 10 10 10 10 11 10 10 10 9 10 100 100 10 8 10 10 8 10 10 10 10 10 10 10 10 10 7 10 10 10 8 10 10 10 10 10 8 10 8 10 8 10 9 100 10 9 9 8 10 10 10 10 10 10 10 10 8 10 10 10 10 10 10 9 8 10 10 8 10 10 10 10 10 10 8 10 10 100 9 10 100 10 10 9 10 10 8 9 9 9 10 10 10 10 7 10 10 8 10 10 100 10 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 100 100 1 1 1 1 1 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 12 12 12 100 12 12 12 100 12 12 100 12 12 12 100 12 12 12 12 12 12 1 1 1 12 12 1 12 12 7 12 12 12 12 12 100 12 100 12 1 12 12 12 1 7 12 12 12 12 12 1 12 1 12 1 100 12 12 1 100 12 100 1 12 12 12 12 12 12 12 12 1 12 12 12 12 12 12 12 1 12 12 1 12 12 100 12 12 12 1 12 12 1 12 1 100 12 12 12 12 12 1 12 12 12 7 12 12 12 12 1 12 12 12 12 1 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +staticfield java/lang/invoke/MethodHandle FORM_OFFSET J 16 +staticfield java/lang/invoke/MethodHandle $assertionsDisabled Z 1 +ciInstanceKlass java/lang/invoke/DirectMethodHandle 0 0 712 100 100 100 10 10 10 100 10 10 10 10 10 100 100 10 10 10 10 10 10 10 9 100 10 9 10 10 10 10 10 10 100 10 10 10 10 100 10 100 10 100 10 10 10 100 10 10 100 10 10 10 10 10 10 10 10 8 10 10 10 10 10 9 100 10 10 10 100 10 8 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 8 8 8 8 8 8 8 8 8 8 8 10 10 100 9 100 10 100 10 10 10 10 100 9 10 9 9 9 10 100 10 9 10 10 8 10 10 10 10 9 9 10 10 100 100 100 9 10 10 10 10 9 10 100 10 100 10 10 9 9 10 9 10 10 10 10 10 9 10 10 10 10 9 9 10 10 9 9 9 9 10 9 9 10 10 9 10 9 10 10 100 10 10 10 10 10 8 8 8 9 10 100 10 10 9 9 9 9 9 9 8 8 8 8 10 10 9 9 100 1 100 1 1 1 1 1 1 100 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 100 100 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 100 1 1 1 1 1 1 1 1 1 1 1 1 100 100 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 1 1 1 1 1 100 1 1 1 1 12 12 12 1 12 12 12 12 12 1 1 12 12 12 12 12 12 12 12 1 12 12 12 12 12 12 12 1 100 12 12 12 12 1 12 1 12 1 12 12 12 1 12 12 1 12 12 12 12 100 12 100 12 12 12 12 12 12 100 12 1 12 100 12 12 1 1 12 12 12 12 12 12 12 12 12 12 12 12 100 12 12 12 12 12 1 1 1 1 1 1 1 1 1 1 1 12 12 1 12 1 12 1 100 12 12 12 12 1 12 12 12 12 12 12 1 12 12 100 12 12 1 12 12 12 12 12 12 100 12 12 1 1 1 12 12 12 12 12 12 12 1 12 1 12 12 12 12 12 12 12 12 12 12 12 12 12 100 12 12 100 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 1 12 12 100 12 12 12 1 1 1 100 12 1 12 12 12 12 12 12 12 12 1 1 1 1 12 12 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +ciInstanceKlass java/lang/invoke/MemberName 1 1 654 100 7 100 10 10 10 9 9 10 9 10 10 10 10 10 10 10 9 10 100 100 10 8 10 10 10 10 9 8 10 100 100 10 10 100 100 7 10 9 100 8 10 10 10 10 10 10 10 10 10 8 8 8 10 10 9 3 10 10 10 10 10 10 10 10 10 100 8 10 10 8 9 8 9 10 8 10 10 10 10 10 100 10 10 8 10 10 8 10 10 100 10 10 8 8 10 10 10 10 10 10 10 10 10 3 10 3 10 3 3 3 3 3 3 10 100 10 3 10 3 10 10 10 10 10 10 10 10 10 10 10 10 100 10 10 10 100 10 10 10 10 100 10 10 8 10 10 10 10 10 10 10 10 10 10 10 100 10 100 8 10 10 10 10 10 10 10 8 8 8 8 10 10 10 8 8 10 8 10 10 10 8 8 10 10 8 8 100 10 8 8 8 8 10 100 100 100 10 100 10 100 10 9 10 100 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 1 3 1 3 1 3 1 3 1 3 1 1 1 1 1 1 1 1 3 1 1 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 1 1 1 1 1 100 1 1 1 100 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 12 12 12 12 12 12 12 12 12 12 12 12 12 12 100 12 12 1 1 12 1 12 12 12 12 12 1 100 12 1 1 12 1 1 1 12 12 1 1 12 12 12 12 12 12 12 12 12 1 1 1 100 12 12 12 12 12 12 12 12 12 12 12 1 12 12 100 100 12 1 12 12 12 12 12 1 12 12 1 12 12 1 12 12 1 12 12 1 1 12 12 12 12 12 12 12 12 12 12 12 100 1 1 100 12 12 12 12 12 100 12 12 12 12 12 12 1 12 1 12 12 1 12 100 12 100 12 12 12 12 12 12 12 1 12 1 1 100 12 12 100 12 12 12 1 1 1 1 12 12 12 1 1 12 1 12 12 1 1 12 1 1 1 1 1 1 1 12 1 1 1 1 1 100 12 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +staticfield java/lang/invoke/MemberName $assertionsDisabled Z 1 +ciInstanceKlass java/lang/invoke/MethodHandleNatives 1 1 442 100 10 9 10 100 10 10 10 10 8 8 8 8 8 8 8 8 8 8 100 10 100 10 10 100 10 10 8 10 8 10 8 10 9 8 10 100 10 100 100 8 100 7 10 10 100 9 10 10 10 100 10 10 10 10 100 10 9 8 10 8 10 8 8 8 100 8 10 10 10 10 10 100 10 10 8 8 10 10 10 8 10 8 8 9 10 10 10 100 100 10 10 10 100 100 10 10 100 10 10 100 100 10 10 10 10 100 10 10 10 10 10 10 10 8 8 100 10 100 10 10 10 10 7 10 10 10 9 10 10 10 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 100 1 1 100 100 100 100 1 1 100 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 100 100 1 1 1 100 100 1 1 1 1 1 1 1 1 1 12 12 12 1 12 12 12 1 1 1 1 1 1 1 1 1 1 1 12 1 12 100 12 1 12 1 12 1 12 1 12 100 12 1 100 12 1 12 1 1 1 1 1 12 1 100 12 12 12 100 12 1 12 100 12 12 12 1 100 12 12 1 12 1 12 1 1 1 1 1 12 12 12 12 12 1 12 12 1 1 12 12 1 100 12 1 1 100 12 12 12 12 1 1 12 1 1 1 1 1 100 12 12 1 12 100 12 12 12 12 12 1 1 1 12 1 12 12 12 12 1 12 12 12 12 7 12 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +staticfield java/lang/invoke/MethodHandleNatives COUNT_GWT Z 1 +staticfield java/lang/invoke/MethodHandleNatives $assertionsDisabled Z 1 +ciInstanceKlass java/lang/invoke/LambdaForm 0 0 986 100 100 9 10 10 9 9 10 100 10 9 10 9 10 100 9 10 9 9 9 10 100 10 10 10 10 10 10 10 9 10 8 10 10 10 10 100 10 10 8 10 10 10 100 8 10 10 10 10 10 100 10 100 10 10 9 9 10 10 100 10 10 10 10 10 10 10 10 10 10 8 10 10 8 8 9 9 9 10 10 10 9 10 10 10 10 10 10 10 10 8 8 8 8 8 8 8 8 10 9 10 10 10 10 10 10 10 100 10 10 9 10 10 10 10 10 10 8 10 100 100 10 10 10 10 11 11 11 100 10 10 10 10 100 10 8 10 10 8 10 10 10 100 10 8 10 9 10 10 8 8 10 10 8 8 8 10 10 9 10 8 8 9 10 10 8 8 8 100 8 100 8 100 8 10 8 10 9 10 10 9 10 10 10 10 10 10 10 10 10 10 8 100 10 10 9 10 8 8 100 8 8 9 8 8 8 10 8 8 8 10 10 8 8 8 10 8 10 8 8 8 8 8 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 9 8 10 11 11 9 9 9 9 9 10 10 8 10 8 9 100 10 100 10 100 10 9 10 10 10 10 9 10 10 9 10 9 10 9 100 9 9 10 100 10 10 10 10 9 100 1 100 1 100 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 1 3 1 3 1 1 1 3 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 100 1 1 1 1 1 1 100 1 1 1 1 1 1 1 100 100 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 100 1 100 100 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 100 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 12 12 12 12 12 12 1 12 12 12 100 12 12 12 12 12 12 12 1 12 12 100 12 100 12 12 12 12 12 12 1 12 12 12 100 12 1 12 1 12 12 12 1 1 12 12 12 12 12 1 12 1 12 12 12 12 12 12 1 12 12 12 12 12 12 100 12 12 1 12 12 1 1 12 12 12 12 100 12 12 12 100 12 12 12 12 12 12 12 1 1 1 1 1 1 1 1 12 12 12 12 12 12 12 12 12 1 12 12 12 12 12 12 12 100 12 12 1 1 100 12 12 12 100 12 100 12 12 1 12 12 12 12 1 12 1 12 12 1 12 12 1 12 1 12 12 12 12 1 1 12 12 1 1 1 12 12 100 12 12 1 1 12 12 12 1 1 1 1 1 1 1 1 1 12 1 12 100 12 12 12 12 12 12 12 12 12 12 12 12 1 1 12 12 12 12 1 1 1 1 1 12 1 1 1 100 12 1 1 1 12 12 1 1 1 12 1 12 1 1 1 1 1 12 12 12 100 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 1 12 12 12 12 12 12 12 12 12 12 1 12 1 12 1 12 1 12 1 12 12 12 12 12 12 12 100 12 12 12 12 12 12 12 12 1 12 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +ciInstanceKlass java/lang/invoke/MethodType 0 0 603 100 10 10 10 9 10 100 9 9 10 9 8 10 10 9 9 10 100 10 8 10 10 10 100 8 10 100 10 10 10 10 11 9 11 100 10 9 10 10 10 10 10 9 100 10 100 10 10 10 10 10 10 10 10 10 10 8 8 10 9 100 10 10 10 10 10 10 10 10 10 8 10 10 10 10 10 11 10 10 10 10 10 100 10 10 10 10 9 100 10 10 10 10 10 10 10 10 8 8 10 8 10 10 9 10 10 10 10 10 10 10 10 10 10 10 10 9 100 10 10 10 10 10 8 10 11 9 10 10 10 10 10 9 9 10 9 10 10 100 10 100 10 100 9 8 10 10 8 100 100 10 100 1 1 1 1 1 5 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 1 3 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 100 1 1 1 1 1 1 1 100 1 1 100 1 1 1 1 1 1 100 100 1 100 1 1 1 1 1 100 1 1 100 1 1 1 1 100 1 1 1 12 12 12 12 100 12 12 12 100 12 100 12 1 100 12 12 100 100 12 1 1 12 12 12 1 1 12 1 12 12 12 100 12 12 12 1 100 12 12 12 12 12 12 12 12 1 12 1 12 12 100 12 12 12 12 12 12 12 12 1 1 12 12 1 12 12 12 12 100 12 12 12 1 12 12 100 12 12 12 12 12 12 12 12 12 1 12 12 12 12 1 12 100 12 12 100 12 12 12 1 1 12 1 100 12 12 12 12 12 12 12 12 12 100 12 12 12 12 12 12 1 12 12 12 100 12 12 1 100 12 12 12 12 12 100 12 12 12 12 12 100 12 12 100 12 12 12 1 1 12 12 12 1 1 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +ciInstanceKlass java/lang/BootstrapMethodError 0 0 39 10 10 10 10 10 100 100 1 1 1 5 0 1 1 1 1 1 1 1 1 100 100 1 1 12 12 12 100 12 12 1 1 1 1 1 1 1 1 +instanceKlass java/lang/invoke/VolatileCallSite +instanceKlass java/lang/invoke/MutableCallSite +instanceKlass java/lang/invoke/ConstantCallSite +ciInstanceKlass java/lang/invoke/CallSite 0 0 322 10 10 9 10 10 100 100 10 100 10 10 10 100 100 10 10 10 8 10 10 10 9 10 10 10 10 100 8 10 10 10 100 10 9 10 10 10 10 9 9 10 10 9 10 10 10 10 10 10 100 10 10 10 10 10 10 100 100 8 10 10 10 10 10 100 100 8 10 10 100 8 10 100 10 10 10 8 10 10 8 10 10 100 10 8 10 10 100 100 10 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 100 1 1 1 1 1 100 100 100 100 100 100 100 1 1 1 1 1 1 1 1 100 100 1 1 12 12 12 12 12 1 1 12 1 12 12 12 1 1 100 12 12 1 12 12 12 12 12 100 12 12 1 1 12 12 1 12 12 12 12 12 100 12 100 12 12 100 12 12 100 12 12 12 12 12 100 12 12 1 12 12 12 12 12 12 1 1 1 12 12 100 12 12 1 1 1 12 1 1 12 1 12 12 100 12 12 12 12 12 1 12 12 12 1 1 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +ciInstanceKlass java/lang/invoke/ConstantCallSite 0 0 42 10 9 10 100 10 9 100 10 10 100 100 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 12 12 12 1 12 12 1 12 1 1 1 1 1 1 +ciInstanceKlass java/lang/invoke/MutableCallSite 0 0 57 10 10 9 10 10 10 9 10 10 100 10 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 12 12 12 12 12 12 100 12 1 12 1 1 1 1 1 1 1 1 1 1 1 1 1 +ciInstanceKlass java/lang/invoke/VolatileCallSite 0 0 33 10 10 10 10 10 10 100 100 1 1 1 1 1 1 1 1 1 1 1 12 12 12 12 12 12 1 1 1 1 1 1 1 +ciMethod java/lang/AbstractStringBuilder (I)V 1513 1 39019 0 0 +ciMethod java/lang/AbstractStringBuilder ensureCapacityInternal (I)V 4097 1 82300 0 628 +ciMethod java/lang/AbstractStringBuilder newCapacity (I)I 1041 1 3363 0 0 +ciMethod java/lang/AbstractStringBuilder hugeCapacity (I)I 0 0 1 0 -1 +ciMethod java/lang/AbstractStringBuilder append (Ljava/lang/String;)Ljava/lang/AbstractStringBuilder; 2777 1 5584 0 916 +ciMethod java/lang/AbstractStringBuilder appendNull ()Ljava/lang/AbstractStringBuilder; 0 0 1 0 -1 +ciMethod java/lang/AbstractStringBuilder append (Ljava/lang/CharSequence;II)Ljava/lang/AbstractStringBuilder; 1953 16633 2507 0 1556 +instanceKlass java/lang/StringBuilder +instanceKlass java/lang/StringBuffer +ciInstanceKlass java/lang/AbstractStringBuilder 1 1 318 7 10 9 9 10 10 10 7 3 10 3 100 10 100 10 10 10 10 100 10 10 10 8 10 10 10 10 10 10 10 10 10 10 10 7 10 11 10 8 100 10 8 10 10 8 8 10 10 11 3 8 10 10 7 5 0 8 10 10 10 10 10 10 10 10 100 10 8 8 10 10 10 8 8 8 10 10 8 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 7 100 7 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 12 12 12 12 12 7 12 1 12 1 1 12 12 100 12 12 1 12 12 1 12 7 12 12 12 12 12 12 100 1 12 12 1 1 1 12 12 1 1 12 12 1 12 12 1 1 12 12 100 12 12 12 12 12 1 1 1 12 12 12 1 1 1 12 12 1 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +ciInstanceKlass java/lang/StringBuffer 1 1 371 10 10 10 11 10 10 9 9 10 10 9 10 100 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 7 10 10 8 10 8 10 8 10 10 10 10 7 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 7 10 9 9 9 7 7 100 100 1 1 1 1 1 5 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 12 12 12 12 12 12 12 12 1 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 7 12 1 12 100 12 1 100 12 1 12 1 12 12 100 12 100 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 1 12 7 12 7 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +staticfield java/lang/StringBuffer serialPersistentFields [Ljava/io/ObjectStreamField; 3 [Ljava/io/ObjectStreamField; +ciMethod java/lang/StringBuilder ()V 1057 1 27718 0 -1 +ciMethod java/lang/StringBuilder (I)V 961 1 8054 0 180 +ciMethod java/lang/StringBuilder append (Ljava/lang/String;)Ljava/lang/StringBuilder; 2441 1 67831 0 916 +ciMethod java/lang/StringBuilder append (Ljava/lang/CharSequence;II)Ljava/lang/StringBuilder; 2097 1 10662 0 0 +ciMethod java/lang/StringBuilder replace (IILjava/lang/String;)Ljava/lang/StringBuilder; 0 0 1 0 -1 +ciMethod java/lang/StringBuilder toString ()Ljava/lang/String; 1209 1 30478 0 724 +ciInstanceKlass java/lang/StringBuilder 1 1 326 10 10 10 11 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 7 9 9 10 10 10 10 10 10 10 100 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 7 7 100 100 1 1 1 5 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 1 12 12 12 100 12 12 12 100 12 12 12 1 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +ciInstanceKlass sun/misc/Unsafe 1 1 390 10 10 10 10 7 8 10 9 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 100 10 10 7 7 8 10 10 7 10 9 7 9 7 9 7 9 7 9 7 9 7 9 7 9 7 9 10 9 9 9 9 9 9 9 9 9 10 9 7 1 1 1 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 7 12 7 12 7 12 1 1 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 100 12 100 12 12 12 12 12 12 12 12 12 12 12 1 12 1 1 12 1 12 12 1 12 1 12 1 12 1 12 1 12 1 12 1 12 1 12 12 12 12 12 12 12 12 12 12 12 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +staticfield sun/misc/Unsafe theUnsafe Lsun/misc/Unsafe; sun/misc/Unsafe +staticfield sun/misc/Unsafe ARRAY_BOOLEAN_BASE_OFFSET I 12 +staticfield sun/misc/Unsafe ARRAY_BYTE_BASE_OFFSET I 12 +staticfield sun/misc/Unsafe ARRAY_SHORT_BASE_OFFSET I 12 +staticfield sun/misc/Unsafe ARRAY_CHAR_BASE_OFFSET I 12 +staticfield sun/misc/Unsafe ARRAY_INT_BASE_OFFSET I 12 +staticfield sun/misc/Unsafe ARRAY_LONG_BASE_OFFSET I 16 +staticfield sun/misc/Unsafe ARRAY_FLOAT_BASE_OFFSET I 12 +staticfield sun/misc/Unsafe ARRAY_DOUBLE_BASE_OFFSET I 16 +staticfield sun/misc/Unsafe ARRAY_OBJECT_BASE_OFFSET I 12 +staticfield sun/misc/Unsafe ARRAY_BOOLEAN_INDEX_SCALE I 1 +staticfield sun/misc/Unsafe ARRAY_BYTE_INDEX_SCALE I 1 +staticfield sun/misc/Unsafe ARRAY_SHORT_INDEX_SCALE I 2 +staticfield sun/misc/Unsafe ARRAY_CHAR_INDEX_SCALE I 2 +staticfield sun/misc/Unsafe ARRAY_INT_INDEX_SCALE I 4 +staticfield sun/misc/Unsafe ARRAY_LONG_INDEX_SCALE I 8 +staticfield sun/misc/Unsafe ARRAY_FLOAT_INDEX_SCALE I 4 +staticfield sun/misc/Unsafe ARRAY_DOUBLE_INDEX_SCALE I 8 +staticfield sun/misc/Unsafe ARRAY_OBJECT_INDEX_SCALE I 4 +staticfield sun/misc/Unsafe ADDRESS_SIZE I 4 +instanceKlass java/util/zip/ZipFile$ZipFileInputStream +instanceKlass java/io/FilterInputStream +instanceKlass java/io/FileInputStream +instanceKlass java/io/ByteArrayInputStream +ciInstanceKlass java/io/InputStream 1 1 63 10 10 100 10 100 10 10 100 100 5 0 10 8 10 7 100 1 1 1 3 1 1 1 1 1 1 1 1 1 1 100 1 1 100 100 1 1 1 1 1 1 1 1 1 12 12 1 1 12 1 1 100 12 1 12 1 1 1 1 1 1 1 +ciInstanceKlass java/io/ByteArrayInputStream 1 1 62 10 9 9 9 9 10 100 10 100 10 10 7 7 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 12 12 12 12 12 100 12 1 1 100 12 1 1 1 1 1 1 1 1 1 +ciInstanceKlass java/io/File 1 1 598 9 9 10 9 9 9 10 9 100 10 8 10 9 10 100 10 10 10 10 10 100 8 10 10 8 10 8 10 8 10 8 10 8 10 8 10 8 10 9 10 10 10 10 10 10 10 7 10 10 10 10 10 100 8 10 10 10 8 10 7 10 10 10 10 100 10 100 10 10 10 10 10 8 7 10 100 100 10 10 10 7 10 10 10 10 10 10 10 10 10 10 10 7 7 10 11 11 11 11 100 10 10 10 10 7 11 10 10 10 10 10 10 10 8 10 10 10 10 10 10 10 10 100 8 10 10 10 8 8 10 10 100 8 10 10 10 10 10 10 10 10 8 10 10 9 9 10 9 10 9 10 10 10 10 10 10 9 10 9 9 10 10 10 8 100 7 100 100 100 1 1 7 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 5 0 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 100 100 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 100 100 1 100 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 100 100 1 1 100 100 100 1 1 100 1 1 1 1 12 12 12 12 12 12 12 12 1 1 12 12 12 1 12 12 12 12 1 1 12 12 1 12 1 12 1 12 1 12 1 12 1 12 1 12 12 12 12 12 12 12 12 12 1 12 12 12 12 12 1 1 12 12 1 12 1 12 12 12 1 1 12 12 12 12 1 1 12 1 1 12 7 12 100 12 1 12 12 12 12 12 12 12 12 100 12 12 12 1 1 7 12 100 12 12 12 1 12 1 100 12 12 12 12 12 12 12 12 1 12 12 12 12 12 12 12 12 1 1 12 12 1 1 12 12 1 1 12 12 12 12 100 12 12 100 12 100 12 12 12 12 7 12 12 12 12 100 12 100 12 7 12 7 12 12 12 12 12 12 12 12 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +staticfield java/io/File fs Ljava/io/FileSystem; java/io/WinNTFileSystem +staticfield java/io/File separatorChar C 92 +staticfield java/io/File separator Ljava/lang/String; "\" +staticfield java/io/File pathSeparatorChar C 59 +staticfield java/io/File pathSeparator Ljava/lang/String; ";" +staticfield java/io/File PATH_OFFSET J 12 +staticfield java/io/File PREFIX_LENGTH_OFFSET J 8 +staticfield java/io/File UNSAFE Lsun/misc/Unsafe; sun/misc/Unsafe +staticfield java/io/File $assertionsDisabled Z 1 +instanceKlass org/codehaus/plexus/classworlds/realm/ClassRealm +instanceKlass sun/misc/Launcher$ExtClassLoader +instanceKlass sun/misc/Launcher$AppClassLoader +ciInstanceKlass java/net/URLClassLoader 1 1 550 9 10 9 10 7 10 9 10 10 10 7 10 10 10 10 10 10 7 10 10 10 7 100 100 8 10 10 10 10 11 11 11 100 11 11 10 11 11 11 10 10 10 7 10 10 7 7 10 7 10 10 10 10 100 100 10 8 10 8 10 10 10 8 8 10 10 10 100 100 8 10 10 10 10 10 10 10 10 10 7 10 10 10 10 10 10 10 10 8 10 11 9 10 9 9 9 9 9 9 10 8 10 7 10 10 7 10 10 7 10 10 10 10 7 10 9 10 8 100 8 10 10 8 10 10 9 10 10 10 10 100 8 10 100 10 10 100 10 10 7 100 10 7 10 10 10 7 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 100 100 1 100 1 1 1 100 1 1 100 100 100 100 100 100 100 100 100 1 1 100 100 100 100 1 1 1 1 1 1 1 100 100 1 1 1 100 1 1 100 1 1 100 1 1 100 100 1 1 1 1 1 1 1 1 1 100 100 100 1 1 1 1 1 1 1 1 1 1 1 1 12 12 12 12 1 12 12 7 12 100 12 7 12 1 12 12 12 12 7 12 1 12 12 12 1 1 1 1 12 12 12 12 100 12 100 12 12 1 12 100 12 12 12 12 12 12 12 1 12 12 1 1 12 1 12 7 12 12 1 1 1 12 1 12 12 1 1 12 12 12 1 1 1 12 12 7 12 7 12 12 12 12 12 12 1 12 7 12 12 12 12 12 7 12 12 1 12 7 12 7 12 7 12 12 12 12 12 12 12 7 12 1 12 1 12 1 12 12 1 12 12 12 12 1 7 12 7 12 12 1 1 1 12 12 1 12 12 12 100 12 12 12 12 1 1 1 12 7 12 1 12 12 1 1 1 12 7 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +ciInstanceKlass java/net/URL 1 1 607 10 10 10 9 9 10 10 10 9 10 8 10 7 10 10 8 10 9 100 8 10 10 8 9 7 10 10 9 10 9 8 9 10 9 10 8 9 10 10 8 10 7 10 10 10 10 10 8 10 10 10 8 9 8 10 10 100 10 10 10 10 9 10 9 10 10 10 10 100 100 10 7 10 10 10 10 10 100 10 10 10 100 10 10 100 8 10 9 10 10 9 10 100 10 10 10 10 10 10 10 10 10 10 10 9 9 100 8 10 10 9 10 10 7 11 7 8 8 10 10 7 8 8 7 10 10 10 10 8 8 10 100 10 10 10 10 10 10 8 10 100 10 8 8 10 8 8 8 8 100 10 9 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 100 8 10 10 10 10 10 7 10 7 7 10 9 9 100 1 1 1 1 1 5 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 100 100 1 1 1 100 100 1 1 1 1 1 1 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 100 100 100 1 1 1 1 1 1 1 100 1 1 100 100 100 1 1 1 1 100 100 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 12 12 12 7 12 12 12 12 12 1 12 1 12 1 12 12 1 1 12 12 1 12 1 12 12 12 12 1 12 12 12 12 1 12 12 7 12 1 12 1 12 12 12 12 12 1 12 12 12 1 12 1 12 12 1 12 12 7 12 12 100 12 100 12 12 12 12 12 100 12 1 1 12 1 12 12 12 12 12 1 12 1 12 12 1 1 100 12 100 12 12 100 12 12 1 12 12 12 12 12 12 12 12 7 12 12 12 12 12 1 1 12 12 12 12 1 100 12 1 1 1 7 12 1 1 1 1 12 12 12 1 1 7 12 1 100 12 12 12 12 100 12 100 12 100 12 1 12 1 12 12 12 12 12 12 12 12 12 12 12 12 12 12 1 1 12 12 100 12 1 1 1 12 7 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +staticfield java/net/URL serialPersistentFields [Ljava/io/ObjectStreamField; 7 [Ljava/io/ObjectStreamField; +ciInstanceKlass java/util/jar/Manifest 1 1 265 10 7 10 9 7 10 9 9 10 10 10 10 10 11 11 10 10 100 100 10 8 10 10 10 10 11 100 10 10 11 11 11 11 100 100 8 10 11 7 8 10 10 10 8 10 10 10 11 10 10 10 8 10 7 10 10 10 100 8 10 10 8 10 10 10 10 11 10 10 10 100 7 10 11 10 11 10 7 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 100 100 100 100 100 1 1 1 100 100 100 100 1 1 100 1 1 1 1 1 1 1 1 1 1 12 1 12 1 12 12 12 12 12 12 12 7 12 12 100 12 1 1 1 12 12 12 12 1 12 12 12 100 12 100 12 12 1 1 1 1 12 1 1 12 12 12 1 12 12 12 12 12 12 1 12 1 12 12 12 1 1 12 1 12 100 12 12 12 12 12 7 12 12 1 1 12 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +ciInstanceKlass sun/misc/Launcher 1 1 234 9 10 10 9 9 10 10 100 100 8 10 10 9 8 10 10 8 10 10 8 10 8 100 10 10 10 100 100 100 100 10 100 10 8 10 10 10 9 7 10 9 10 7 10 10 8 10 10 10 10 10 100 10 7 10 7 10 8 7 100 1 1 7 1 7 1 7 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 100 100 100 100 100 100 100 1 1 1 1 1 1 100 1 1 100 1 1 100 1 1 1 1 1 1 1 1 1 12 12 12 12 12 12 12 1 1 1 12 12 12 1 7 12 12 1 7 12 100 12 1 7 12 1 1 100 12 100 12 1 1 1 1 12 1 1 12 12 12 12 1 12 12 12 1 12 1 12 12 12 12 7 12 1 12 1 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +ciInstanceKlass sun/misc/Launcher$AppClassLoader 1 1 203 8 10 100 10 7 10 10 7 10 10 10 11 9 10 10 10 10 10 10 10 10 100 10 10 10 7 8 10 10 9 10 100 10 10 10 10 100 10 100 100 10 100 10 10 100 10 7 10 10 7 7 1 1 1 1 1 1 1 1 1 1 1 100 100 1 100 1 1 1 1 100 1 1 1 1 1 1 1 1 100 1 1 1 1 1 7 12 1 12 1 12 7 12 1 12 12 7 12 7 12 12 7 12 7 12 12 12 100 12 12 12 12 1 12 12 12 1 1 7 12 12 100 12 1 12 12 12 1 12 1 1 12 1 12 12 1 12 1 7 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +staticfield sun/misc/Launcher$AppClassLoader $assertionsDisabled Z 1 +ciInstanceKlass sun/misc/Launcher$ExtClassLoader 1 1 243 10 9 7 10 7 10 10 100 10 100 10 10 10 10 10 11 10 8 10 7 9 10 10 7 10 10 7 10 10 8 10 10 10 10 10 7 10 10 10 10 100 10 11 10 10 8 10 10 10 100 10 100 100 10 100 10 10 100 10 10 7 1 1 1 1 1 1 1 1 1 100 100 1 1 100 1 1 1 1 1 1 100 100 100 1 1 100 100 1 1 100 100 100 100 1 1 1 1 1 1 1 12 12 7 1 12 1 12 7 12 1 12 1 12 12 12 12 7 12 7 12 7 12 1 7 12 1 12 12 12 1 12 12 1 12 1 7 12 12 12 12 12 1 12 12 12 12 1 100 12 100 12 12 1 100 12 12 12 1 12 1 1 12 1 12 12 1 12 7 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +ciInstanceKlass java/security/CodeSource 1 1 351 10 9 9 9 9 10 100 10 100 10 7 10 10 10 100 10 10 10 10 10 100 10 10 10 10 10 10 10 10 10 10 10 10 10 8 10 10 10 10 8 10 10 100 10 10 8 10 10 10 8 8 9 100 8 10 10 8 10 8 8 8 10 10 10 10 10 10 100 100 10 10 10 10 10 100 10 10 8 10 10 10 100 10 100 100 8 8 10 10 10 100 10 10 11 10 10 11 10 10 8 100 10 10 100 10 11 11 7 100 1 1 1 5 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 100 1 1 100 1 1 100 100 100 1 1 1 100 100 100 100 100 100 100 100 1 1 1 1 12 12 12 12 12 100 12 100 7 12 1 12 12 100 1 12 100 12 12 12 1 12 100 100 12 100 12 12 100 12 12 12 12 1 12 12 12 12 1 12 1 12 1 12 12 12 1 1 12 1 1 12 12 1 12 1 1 1 100 12 12 12 12 12 12 1 1 12 12 12 100 12 12 1 12 1 12 12 12 1 12 1 1 1 1 12 100 12 1 12 12 100 12 12 12 100 1 1 12 12 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +ciInstanceKlass java/lang/StackTraceElement 1 1 101 10 8 10 100 9 8 9 9 9 7 10 10 10 8 10 8 8 8 10 8 10 8 7 10 10 10 10 100 100 1 1 1 1 1 1 1 1 1 5 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 100 1 1 1 1 1 12 1 100 12 1 12 1 12 12 12 1 12 12 1 12 1 1 1 12 1 12 1 1 12 12 12 12 1 1 1 1 1 1 1 1 1 1 1 +instanceKlass java/nio/LongBuffer +instanceKlass java/nio/CharBuffer +instanceKlass java/nio/ByteBuffer +ciInstanceKlass java/nio/Buffer 1 1 106 100 10 9 9 100 100 10 8 10 10 10 10 9 10 10 8 8 8 9 10 100 10 100 10 100 10 100 10 7 7 1 1 1 3 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 12 1 1 1 12 12 12 12 12 12 12 1 1 1 12 1 1 1 1 1 1 1 1 1 1 1 1 +ciInstanceKlass java/lang/Boolean 1 1 112 10 9 10 10 8 10 9 9 8 10 7 10 10 100 100 10 10 8 10 9 7 100 100 1 1 1 1 1 1 1 1 1 1 1 1 5 0 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 100 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 12 12 1 7 12 12 12 1 12 1 12 7 12 1 1 12 12 1 7 12 12 1 1 1 1 1 1 1 1 1 1 1 1 +staticfield java/lang/Boolean TRUE Ljava/lang/Boolean; java/lang/Boolean +staticfield java/lang/Boolean FALSE Ljava/lang/Boolean; java/lang/Boolean +staticfield java/lang/Boolean TYPE Ljava/lang/Class; java/lang/Class +ciMethod java/lang/Character isValidCodePoint (I)Z 0 0 1 0 -1 +ciMethod java/lang/Character highSurrogate (I)C 0 0 1 0 -1 +ciMethod java/lang/Character lowSurrogate (I)C 0 0 1 0 -1 +ciInstanceKlass java/lang/Character 1 1 460 7 100 10 9 9 10 10 10 10 3 3 3 3 3 10 10 3 11 11 10 10 100 10 10 3 10 10 10 100 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 5 0 10 10 10 10 10 10 10 10 10 10 9 100 10 10 10 3 10 10 100 10 10 10 10 8 10 9 10 10 10 10 8 10 9 100 100 100 100 1 1 100 1 100 1 100 1 1 1 1 3 1 3 1 1 3 1 3 1 1 1 1 1 1 1 3 1 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 1 1 1 3 1 1 3 1 1 1 1 1 3 1 1 1 5 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 1 1 1 1 1 1 1 1 12 12 12 12 12 12 7 12 12 12 7 12 12 12 12 1 12 12 12 12 1 12 12 12 12 12 12 7 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 1 12 12 100 12 12 1 12 12 12 1 100 12 100 12 12 12 7 12 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +staticfield java/lang/Character TYPE Ljava/lang/Class; java/lang/Class +staticfield java/lang/Character $assertionsDisabled Z 1 +instanceKlass java/math/BigDecimal +instanceKlass java/math/BigInteger +instanceKlass java/util/concurrent/atomic/AtomicLong +instanceKlass java/util/concurrent/atomic/AtomicInteger +instanceKlass java/lang/Long +instanceKlass java/lang/Integer +instanceKlass java/lang/Short +instanceKlass java/lang/Byte +instanceKlass java/lang/Double +instanceKlass java/lang/Float +ciInstanceKlass java/lang/Number 1 1 34 10 10 100 7 100 1 1 1 5 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 +ciInstanceKlass java/lang/Float 1 1 175 7 100 10 10 100 4 100 10 10 8 8 10 10 10 10 4 4 4 10 9 10 10 10 10 10 10 3 3 3 10 10 10 10 8 10 9 7 100 1 1 1 1 1 4 1 1 1 4 1 1 3 1 3 1 3 1 3 1 1 1 1 1 1 1 5 0 1 1 1 1 1 1 1 1 1 7 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 7 12 100 12 1 1 12 100 12 1 1 100 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 1 7 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +staticfield java/lang/Float TYPE Ljava/lang/Class; java/lang/Class +ciInstanceKlass java/lang/Double 1 1 229 7 100 10 10 10 100 10 10 6 0 8 10 8 10 8 100 6 0 10 5 0 5 0 8 8 10 10 8 10 8 8 8 10 10 10 10 10 10 10 10 6 0 6 0 6 0 10 9 10 10 10 10 5 0 5 0 10 10 10 10 8 10 9 7 100 1 1 1 1 1 6 0 1 1 1 6 0 1 1 3 1 3 1 3 1 3 1 1 1 1 1 1 1 5 0 1 1 1 1 1 1 100 100 1 1 1 7 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 7 12 12 12 1 12 100 12 1 12 1 12 1 1 12 1 1 100 12 100 12 1 12 1 1 1 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 1 7 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +staticfield java/lang/Double TYPE Ljava/lang/Class; java/lang/Class +ciInstanceKlass java/lang/Byte 1 1 153 7 10 9 10 7 100 10 8 10 8 10 10 10 10 10 10 10 10 8 8 10 9 10 10 10 10 5 0 10 8 10 9 7 100 7 1 1 1 1 1 3 1 3 1 1 1 1 1 1 1 3 1 3 1 1 5 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 12 12 12 1 1 12 1 12 1 12 12 12 12 12 12 12 12 1 1 12 12 12 12 12 12 1 7 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +staticfield java/lang/Byte TYPE Ljava/lang/Class; java/lang/Class +ciInstanceKlass java/lang/Short 1 1 161 7 100 10 10 7 100 10 8 10 8 10 10 10 10 10 10 9 10 10 10 8 8 10 9 10 10 10 10 3 3 5 0 10 8 10 9 7 100 7 1 1 1 1 1 3 1 3 1 1 1 1 1 1 1 3 1 3 1 1 5 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 12 12 1 1 12 1 12 1 12 12 12 12 12 12 12 12 12 12 1 1 12 12 12 12 12 12 1 7 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +staticfield java/lang/Short TYPE Ljava/lang/Class; java/lang/Class +ciInstanceKlass java/lang/Integer 1 1 314 7 100 7 10 9 7 10 10 10 10 10 10 10 10 3 8 10 10 10 3 9 9 3 9 7 8 10 100 10 8 10 10 8 10 8 10 3 10 10 10 10 8 100 10 10 5 0 8 10 10 7 9 9 10 10 9 10 10 10 10 100 100 10 8 8 10 8 8 8 8 8 8 10 10 10 5 0 3 3 3 3 3 10 10 8 10 9 3 3 3 3 3 3 7 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 1 3 1 1 5 0 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 12 12 100 12 12 12 100 12 12 12 1 12 12 12 12 12 12 1 1 12 1 12 1 12 12 1 12 1 12 12 12 12 12 1 1 12 12 1 12 12 1 12 12 12 12 12 12 12 7 12 1 1 12 1 1 12 1 1 1 1 1 1 12 12 12 12 12 1 7 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +staticfield java/lang/Integer TYPE Ljava/lang/Class; java/lang/Class +staticfield java/lang/Integer digits [C 36 +staticfield java/lang/Integer DigitTens [C 100 +staticfield java/lang/Integer DigitOnes [C 100 +staticfield java/lang/Integer sizeTable [I 10 +ciInstanceKlass java/lang/Long 1 1 361 7 100 7 10 9 7 10 10 10 10 10 5 0 5 0 100 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 5 0 8 10 10 10 7 5 0 5 0 9 9 3 3 7 8 10 8 10 8 8 10 5 0 10 10 10 10 8 100 10 10 8 10 8 10 10 5 0 5 0 9 10 8 8 10 8 8 8 8 8 8 10 10 10 10 9 10 10 10 100 100 10 10 10 10 10 5 0 5 0 5 0 5 0 5 0 10 10 10 8 10 9 7 100 7 1 1 1 1 1 1 5 0 1 1 1 1 1 1 1 3 1 3 1 5 0 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 12 12 12 12 12 1 12 12 12 12 12 12 100 12 12 12 12 12 12 100 12 12 12 1 12 12 12 1 12 12 1 1 12 1 12 1 1 12 12 12 12 12 1 1 12 12 1 12 1 12 12 12 12 1 1 12 1 1 1 1 1 1 12 12 12 12 12 12 100 12 1 1 12 12 12 12 12 12 12 1 7 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +staticfield java/lang/Long TYPE Ljava/lang/Class; java/lang/Class +ciInstanceKlass java/lang/NullPointerException 1 1 21 10 10 100 7 1 1 1 5 0 1 1 1 1 1 1 1 12 12 1 1 +ciInstanceKlass java/lang/ArithmeticException 1 1 21 10 10 100 100 1 1 1 5 0 1 1 1 1 1 1 1 12 12 1 1 +ciMethod java/util/List isEmpty ()Z 0 0 1 0 -1 +ciMethod java/util/List iterator ()Ljava/util/Iterator; 0 0 1 0 -1 +ciInstanceKlass java/util/List 1 1 116 10 11 11 11 11 11 11 10 100 10 100 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 100 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 12 12 100 12 12 100 12 12 12 100 12 1 100 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +ciMethod java/util/Vector ensureCapacityHelper (I)V 2049 1 4921 0 0 +ciMethod java/util/Vector grow (I)V 81 1 16 0 0 +ciMethod java/util/Vector hugeCapacity (I)I 0 0 1 0 -1 +ciMethod java/util/Vector size ()I 1065 1 133 0 0 +ciMethod java/util/Vector contains (Ljava/lang/Object;)Z 3153 1 2855 0 0 +ciMethod java/util/Vector indexOf (Ljava/lang/Object;I)I 3129 625 2873 0 0 +ciMethod java/util/Vector elementAt (I)Ljava/lang/Object; 297 1 3009 0 0 +ciMethod java/util/Vector removeElementAt (I)V 121 1 2939 0 0 +ciMethod java/util/Vector addElement (Ljava/lang/Object;)V 2049 1 4863 0 0 +ciMethod java/util/Vector elementData (I)Ljava/lang/Object; 2049 1 3009 0 0 +instanceKlass java/util/TreeMap$Values +instanceKlass org/eclipse/sisu/inject/MildElements +instanceKlass org/eclipse/sisu/inject/MildValues$1 +instanceKlass com/google/common/collect/Maps$Values +instanceKlass com/google/common/collect/AbstractMultimap$Values +instanceKlass com/google/common/collect/AbstractMapBasedMultimap$WrappedCollection +instanceKlass com/google/common/collect/ImmutableCollection +instanceKlass java/util/HashMap$Values +instanceKlass java/util/AbstractQueue +instanceKlass java/util/LinkedHashMap$LinkedValues +instanceKlass java/util/ArrayDeque +instanceKlass java/util/AbstractSet +instanceKlass java/util/AbstractList +ciInstanceKlass java/util/AbstractCollection 1 1 149 100 10 10 10 11 11 10 7 10 10 10 10 10 7 10 7 3 10 100 8 10 3 100 10 11 11 10 10 10 11 8 100 10 10 8 10 10 7 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 100 1 1 1 1 12 12 12 7 12 12 12 1 100 12 12 12 7 12 7 12 1 100 12 1 12 1 1 12 1 12 12 12 100 12 1 1 12 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +instanceKlass java/util/Collections$SingletonList +instanceKlass org/apache/maven/model/merge/ModelMerger$MergingList +instanceKlass java/util/ArrayList$SubList +instanceKlass sun/security/jca/ProviderList$3 +instanceKlass com/google/common/collect/Lists$Partition +instanceKlass com/google/common/collect/Lists$TransformingRandomAccessList +instanceKlass java/util/Arrays$ArrayList +instanceKlass java/util/AbstractSequentialList +instanceKlass java/util/Collections$EmptyList +instanceKlass java/util/ArrayList +instanceKlass java/util/Vector +ciInstanceKlass java/util/AbstractList 1 1 172 10 9 10 10 100 10 10 11 11 11 10 10 11 11 11 10 10 11 11 11 7 10 7 10 100 100 10 100 10 7 11 10 10 11 100 10 10 100 10 8 10 10 8 10 7 7 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 100 1 1 100 1 1 100 1 1 1 1 1 1 1 1 1 12 12 12 12 1 12 7 12 12 12 7 12 12 12 12 12 12 12 100 12 7 1 12 1 12 1 1 12 1 1 12 12 1 12 12 1 1 12 12 1 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +instanceKlass java/util/Stack +ciInstanceKlass java/util/Vector 1 1 394 100 10 100 100 10 8 10 10 10 10 7 9 9 10 10 11 9 10 100 100 10 10 9 10 10 10 7 3 10 100 10 3 100 10 10 10 10 100 8 10 100 10 10 100 10 10 8 10 10 10 100 100 10 10 10 10 10 10 10 10 10 10 10 10 10 8 10 8 10 100 8 10 10 10 8 10 10 10 10 8 100 10 100 10 10 11 100 10 100 10 11 10 10 11 10 100 10 7 100 100 100 100 1 1 1 1 1 1 1 1 1 1 1 1 5 0 1 1 1 1 1 1 100 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 100 100 1 1 100 100 100 1 1 1 1 1 1 1 1 1 1 100 1 1 1 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 1 1 1 12 12 12 12 1 12 12 12 12 100 12 12 12 1 7 12 7 12 12 12 12 12 1 12 1 1 12 12 12 12 1 1 1 12 1 1 12 12 12 1 1 12 12 12 12 12 12 12 12 12 100 12 100 12 100 12 12 1 1 100 100 12 100 12 100 12 12 1 1 12 1 12 100 12 100 12 1 1 100 12 12 12 100 12 12 1 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +ciMethod java/util/Stack push (Ljava/lang/Object;)Ljava/lang/Object; 3329 1 2895 0 0 +ciMethod java/util/Stack pop ()Ljava/lang/Object; 121 1 2939 0 0 +ciMethod java/util/Stack peek ()Ljava/lang/Object; 129 1 2941 0 0 +ciInstanceKlass java/util/Stack 1 1 56 10 10 10 10 10 100 10 10 10 7 7 1 1 1 5 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 12 12 12 1 12 12 1 1 1 1 1 1 1 1 1 1 1 +ciMethod java/util/ArrayList isEmpty ()Z 4097 1 8313 0 52 +ciMethod java/util/ArrayList iterator ()Ljava/util/Iterator; 3073 1 5520 0 148 +ciMethod java/util/ArrayList access$000 (Ljava/util/ArrayList;)I 1097 1 137 0 0 +instanceKlass org/netbeans/shaded/json/simple/JSONArray +instanceKlass org/apache/maven/artifact/versioning/ComparableVersion$ListItem +instanceKlass org/eclipse/sisu/bean/BeanScheduler$Pending +ciInstanceKlass java/util/ArrayList 1 1 365 100 9 10 7 9 9 100 100 10 8 10 10 10 10 9 11 10 7 7 10 9 10 10 10 10 10 3 10 100 10 3 10 10 10 100 100 10 10 10 10 10 10 10 100 10 10 8 8 10 10 11 10 10 10 100 10 10 10 10 11 10 7 10 7 10 10 7 10 8 8 8 8 8 11 100 10 100 10 11 10 10 11 10 7 100 100 100 100 1 1 1 1 1 1 1 1 5 0 1 1 3 1 1 1 1 1 1 1 1 1 1 1 100 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 100 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 12 12 1 1 1 12 12 12 12 12 7 12 12 1 7 12 12 12 12 7 12 12 12 12 1 12 12 12 1 1 12 7 12 12 12 12 12 12 1 12 1 1 100 12 12 12 100 12 12 12 1 100 12 12 100 12 100 12 12 1 12 1 12 12 1 12 1 1 1 1 1 100 12 1 12 1 12 100 12 12 12 100 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +staticfield java/util/ArrayList EMPTY_ELEMENTDATA [Ljava/lang/Object; 0 [Ljava/lang/Object; +staticfield java/util/ArrayList DEFAULTCAPACITY_EMPTY_ELEMENTDATA [Ljava/lang/Object; 0 [Ljava/lang/Object; +ciMethod java/util/Set contains (Ljava/lang/Object;)Z 0 0 1 0 -1 +ciMethod java/util/Set add (Ljava/lang/Object;)Z 0 0 1 0 -1 +ciInstanceKlass java/util/Set 1 1 50 100 10 100 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 12 1 1 1 1 1 +instanceKlass java/util/Hashtable$KeySet +instanceKlass org/eclipse/aether/graph/Dependency$Exclusions +instanceKlass java/util/Collections$SingletonSet +instanceKlass java/util/EnumSet +instanceKlass java/lang/ProcessEnvironment$CheckedKeySet +instanceKlass org/eclipse/sisu/wire/EntrySetAdapter +instanceKlass java/util/TreeMap$EntrySet +instanceKlass org/eclipse/sisu/wire/EntryMapAdapter$EntrySet +instanceKlass com/google/common/collect/CompactHashMap$EntrySetView +instanceKlass com/google/common/collect/Sets$ImprovedAbstractSet +instanceKlass com/google/common/collect/Sets$SetView +instanceKlass sun/util/resources/ParallelListResourceBundle$KeySet +instanceKlass java/util/LinkedHashMap$LinkedEntrySet +instanceKlass java/util/LinkedHashMap$LinkedKeySet +instanceKlass java/util/HashMap$EntrySet +instanceKlass java/lang/ProcessEnvironment$CheckedEntrySet +instanceKlass java/util/TreeMap$KeySet +instanceKlass java/util/HashMap$KeySet +instanceKlass java/util/TreeSet +instanceKlass java/util/HashSet +instanceKlass java/util/WeakHashMap$KeySet +instanceKlass java/util/Collections$SetFromMap +instanceKlass java/util/Hashtable$EntrySet +instanceKlass java/util/Collections$EmptySet +ciInstanceKlass java/util/AbstractSet 1 1 75 10 7 7 11 10 10 100 100 10 11 11 10 10 11 10 11 11 7 7 1 1 1 1 1 1 1 100 100 100 1 1 100 1 1 1 1 1 1 1 12 1 1 12 12 1 1 12 7 12 12 7 12 100 12 12 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +instanceKlass java/util/Collections$SingletonMap +instanceKlass org/eclipse/sisu/wire/EntryMapAdapter +instanceKlass com/google/common/collect/Maps$ViewCachingAbstractMap +instanceKlass org/eclipse/sisu/wire/MergedProperties +instanceKlass com/google/common/cache/LocalCache +instanceKlass com/google/common/collect/CompactHashMap +instanceKlass java/util/IdentityHashMap +instanceKlass java/util/TreeMap +instanceKlass java/util/concurrent/ConcurrentHashMap +instanceKlass sun/util/PreHashedMap +instanceKlass java/util/WeakHashMap +instanceKlass java/util/HashMap +instanceKlass java/util/Collections$EmptyMap +ciInstanceKlass java/util/AbstractMap 1 1 161 10 10 10 11 10 11 11 11 7 11 10 11 100 10 11 11 10 11 9 100 10 9 100 10 7 11 11 11 100 100 11 8 100 10 10 8 10 10 10 7 7 100 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 100 100 1 1 1 1 1 100 1 1 100 1 1 1 1 1 100 100 100 1 1 1 100 100 1 1 1 7 1 1 1 1 1 1 12 12 12 7 12 12 7 12 12 1 12 12 12 1 12 12 12 12 1 12 12 1 1 12 12 1 1 12 1 1 12 1 12 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +ciMethod java/util/HashMap hash (Ljava/lang/Object;)I 4097 1 48923 0 128 +ciMethod java/util/HashMap get (Ljava/lang/Object;)Ljava/lang/Object; 4097 1 6092 0 468 +ciMethod java/util/HashMap getNode (ILjava/lang/Object;)Ljava/util/HashMap$Node; 4097 33 5944 0 404 +ciMethod java/util/HashMap containsKey (Ljava/lang/Object;)Z 145 1 6188 0 468 +ciMethod java/util/HashMap put (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; 2049 1 7679 0 -1 +instanceKlass org/netbeans/shaded/json/simple/JSONObject +instanceKlass org/apache/maven/artifact/versioning/ManagedVersionMap +instanceKlass java/lang/ProcessEnvironment +instanceKlass java/util/LinkedHashMap +ciInstanceKlass java/util/HashMap 1 1 511 10 100 10 100 10 100 11 11 11 7 3 10 100 100 10 8 10 10 10 10 10 8 10 9 10 9 4 10 10 11 9 4 10 11 11 11 11 7 11 11 10 10 9 10 9 9 9 10 9 7 10 10 10 10 10 9 10 100 3 7 7 10 10 9 9 10 10 10 10 9 7 10 9 7 10 9 7 10 100 10 11 11 11 100 10 10 100 100 10 10 10 10 10 10 10 8 10 100 10 4 10 4 10 10 10 8 4 10 100 11 10 10 10 10 7 7 100 100 1 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 1 1 1 1 1 1 1 5 0 1 1 3 1 1 1 1 3 1 3 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 100 100 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 100 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 100 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 100 1 1 100 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 7 12 1 12 1 100 12 1 12 12 12 1 12 1 1 1 12 12 12 12 7 12 1 12 12 12 12 12 12 12 12 12 12 7 12 7 12 12 1 12 12 12 12 12 12 12 12 12 12 12 1 12 12 12 12 12 12 12 1 1 12 12 12 12 12 12 12 12 1 12 12 1 12 1 1 100 12 100 12 100 12 1 12 1 1 12 12 12 100 12 12 12 100 12 100 12 1 100 12 12 12 12 1 100 12 1 100 12 12 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +instanceKlass java/util/LinkedHashMap$Entry +ciInstanceKlass java/util/HashMap$Node 1 1 85 10 9 9 9 9 100 10 10 8 10 10 10 100 11 10 11 7 7 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 12 12 12 1 12 1 12 12 100 12 100 1 12 12 12 100 1 1 1 1 1 1 1 1 1 1 1 +ciMethod java/lang/Math min (II)I 4097 1 50247 0 -1 +ciInstanceKlass java/lang/Math 1 1 289 10 10 10 10 10 10 10 6 0 7 6 0 10 10 10 10 10 10 10 10 10 10 10 10 100 3 3 3 10 100 5 0 5 0 5 0 5 0 5 0 9 10 100 8 10 8 10 100 5 0 5 0 100 3 5 0 3 10 10 9 9 10 10 7 6 0 9 100 10 10 10 10 10 4 10 10 10 10 10 10 10 10 10 10 10 10 5 0 5 0 3 6 0 4 6 0 6 0 7 4 4 6 0 10 9 10 9 10 4 6 0 100 100 1 1 1 1 1 6 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 100 12 12 12 12 12 12 1 12 12 12 12 12 12 12 12 12 12 12 12 1 12 1 12 100 12 1 1 12 1 12 1 1 12 12 12 12 12 12 1 12 1 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 1 12 12 12 12 7 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +staticfield java/lang/Math $assertionsDisabled Z 1 +ciMethod java/util/Iterator hasNext ()Z 0 0 1 0 -1 +ciMethod java/util/Iterator next ()Ljava/lang/Object; 0 0 1 0 -1 +ciInstanceKlass java/util/Iterator 1 1 45 100 8 10 10 11 11 11 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 100 12 12 12 100 12 1 1 1 1 1 1 1 1 1 1 +ciMethod java/util/Arrays copyOf ([Ljava/lang/Object;I)[Ljava/lang/Object; 2089 1 10548 0 -1 +ciMethod java/util/Arrays copyOf ([CI)[C 1345 1 11119 0 0 +ciMethod java/util/Arrays copyOfRange ([CII)[C 4097 1 5762 0 480 +ciInstanceKlass java/util/Arrays 1 1 810 10 100 100 10 8 10 10 8 8 10 10 100 10 10 10 10 10 10 10 10 10 7 10 100 10 10 100 10 10 100 10 10 100 10 10 100 10 10 100 10 10 100 10 10 9 10 100 10 10 10 100 10 10 7 10 10 10 10 10 10 10 7 11 10 10 10 10 10 10 10 10 11 10 100 10 10 100 10 10 100 10 10 100 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 7 10 10 8 7 10 10 10 100 10 100 10 100 10 100 10 100 10 100 10 100 10 100 10 10 9 100 10 10 10 10 10 10 10 10 10 10 8 8 10 10 8 10 10 10 10 100 3 10 100 10 10 11 10 10 10 10 10 10 10 10 10 11 8 10 11 11 11 11 18 11 11 18 11 18 11 18 100 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 1 1 7 1 100 1 1 1 1 3 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 100 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 1 1 1 12 12 1 1 12 12 1 12 100 12 12 12 12 12 12 12 12 1 100 12 100 1 1 1 12 12 100 1 1 12 100 1 1 12 100 1 1 12 100 1 1 12 100 1 1 12 100 1 1 12 12 7 12 100 1 1 12 7 12 7 12 1 12 1 12 12 100 12 100 12 12 12 12 1 12 12 7 12 12 12 100 12 12 12 7 12 100 12 100 1 1 12 1 1 12 1 1 12 1 1 12 12 12 12 12 12 12 100 12 12 100 12 12 12 12 12 1 7 12 12 1 1 12 12 12 1 12 1 12 1 12 1 12 1 12 1 12 1 12 1 12 12 12 1 12 12 12 12 12 12 12 12 12 1 1 12 12 1 12 12 12 100 12 1 1 12 100 12 12 12 12 12 12 12 12 12 12 12 1 12 100 12 100 12 12 1 15 16 15 12 12 100 12 15 12 100 12 15 12 100 12 15 12 1 100 12 12 12 12 12 12 12 12 12 12 100 12 12 12 12 12 12 12 12 12 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 10 10 1 1 1 1 1 1 1 10 1 1 1 1 10 1 1 1 1 10 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 12 12 12 12 12 1 1 100 1 1 100 1 1 +staticfield java/util/Arrays $assertionsDisabled Z 1 +instanceKlass java/io/ExpiringCache$1 +ciInstanceKlass java/util/LinkedHashMap 1 1 234 9 9 9 9 10 7 10 10 9 9 9 10 100 10 10 10 10 9 9 10 10 10 10 10 10 10 10 9 10 9 7 10 9 7 10 9 7 10 100 10 11 100 10 11 7 7 100 100 1 1 100 1 100 1 100 1 1 1 1 1 1 1 1 5 0 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 7 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 1 1 1 100 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 100 1 1 1 1 100 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 12 12 12 12 12 1 12 12 12 12 12 12 1 12 12 12 12 12 100 12 12 12 12 12 100 12 12 12 12 12 1 12 12 1 12 1 1 100 12 1 100 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +ciMethodData java/lang/Object ()V 2 386754 orig 204 232 48 218 113 168 11 85 63 216 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 2 0 0 17 38 47 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 3 0 1 0 0 0 0 0 0 0 255 255 255 255 0 0 0 0 data 0 oops 0 +instanceKlass java/lang/NumberFormatException +ciInstanceKlass java/lang/IllegalArgumentException 1 1 27 10 10 10 10 100 7 1 1 1 5 0 1 1 1 1 1 1 1 1 1 12 12 12 12 1 1 +ciMethodData java/lang/String charAt (I)C 2 332556 orig 204 232 48 218 113 0 54 85 63 4 1 0 0 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 25 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 2 0 0 97 88 40 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 8 0 2 0 0 0 40 0 0 0 255 255 255 255 7 0 1 0 data 10 0x10007 0x0 0x20 0x50b0c 0xa0007 0x50b0c 0x18 0x0 0x120002 0x0 oops 0 +ciMethod java/util/HashMap$TreeNode getTreeNode (ILjava/lang/Object;)Ljava/util/HashMap$TreeNode; 0 0 1 0 -1 +ciInstanceKlass java/util/HashMap$TreeNode 0 0 182 100 10 9 9 100 9 9 9 10 100 10 9 9 9 10 10 10 10 10 10 10 10 10 9 10 10 10 10 9 10 10 10 10 10 10 10 100 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 100 1 1 1 100 100 1 1 1 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 12 1 12 12 12 12 1 12 12 12 12 100 12 12 12 12 12 12 100 12 100 12 100 12 12 12 12 12 12 12 12 12 12 12 12 12 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +ciMethodData java/lang/String hashCode ()I 2 19772 orig 204 232 48 218 113 168 68 85 63 20 1 0 0 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 16 0 0 1 32 0 0 225 233 1 0 0 0 0 0 0 0 0 0 2 0 0 0 1 0 11 0 2 0 0 0 60 0 0 0 255 255 255 255 7 0 6 0 data 15 0x60007 0x21e 0x3c 0x1e2 0xe0007 0x1 0x2c 0x1e1 0x1e0007 0x1e1 0x1c 0x3d20 0x2d0003 0x3d20 0xfffffff0 oops 0 +ciMethodData java/lang/AbstractStringBuilder ensureCapacityInternal (I)V 2 82300 orig 204 232 48 218 113 176 180 90 63 16 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 17 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 2 0 0 225 251 9 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 11 0 2 0 0 0 32 0 0 0 255 255 255 255 7 0 7 0 data 8 0x70007 0x132bc 0x20 0xcc0 0x110002 0xcc0 0x140002 0xcc0 oops 0 +ciMethodData java/lang/String length ()I 2 147447 orig 204 232 48 218 113 0 53 85 63 216 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 2 0 0 185 239 17 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 3 0 1 0 0 0 0 0 0 0 255 255 255 255 0 0 0 0 data 0 oops 0 +ciMethodData java/util/HashMap hash (Ljava/lang/Object;)I 2 48923 orig 204 232 48 218 113 176 53 96 63 32 1 0 0 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 17 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 217 232 5 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 6 0 2 0 0 0 52 0 0 0 255 255 255 255 7 0 1 0 data 13 0x10007 0xbd1b 0x1c 0x0 0x50003 0x0 0x24 0x90005 0x2953 0xb7fdf0 0x937f 0xb81640 0x49 oops 2 9 java/lang/String 11 java/io/File +ciMethod java/util/HashSet contains (Ljava/lang/Object;)Z 3073 1 6521 0 980 +ciMethod java/util/HashSet add (Ljava/lang/Object;)Z 2049 1 5444 0 2388 +instanceKlass java/util/LinkedHashSet +ciInstanceKlass java/util/HashSet 1 1 255 10 7 10 9 11 4 10 10 10 10 7 10 10 11 10 10 10 9 10 10 10 10 7 10 100 100 10 10 10 10 10 10 11 11 10 10 10 100 100 10 8 10 10 10 10 10 10 8 10 4 10 4 10 8 4 10 100 10 11 100 10 100 10 7 10 7 7 100 100 1 1 1 5 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 100 1 100 1 1 100 100 100 100 1 1 1 1 1 1 1 12 1 12 7 12 7 12 12 12 12 1 12 12 12 12 12 12 12 12 12 1 1 1 12 100 12 12 12 12 12 100 12 12 12 100 12 12 1 1 1 12 12 12 12 12 100 12 1 12 12 12 1 100 12 100 1 1 1 12 100 12 1 12 1 1 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 +staticfield java/util/HashSet PRESENT Ljava/lang/Object; java/lang/Object +ciMethodData java/util/Arrays copyOfRange ([CII)[C 2 5762 orig 204 232 48 218 113 232 250 98 63 132 1 0 0 120 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 29 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 17 164 0 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 9 0 2 0 0 0 144 0 0 0 255 255 255 255 7 0 5 0 data 36 0x50007 0x1482 0x80 0x0 0x100002 0x0 0x140005 0x0 0x0 0x0 0x0 0x0 0x190005 0x0 0x0 0x0 0x0 0x0 0x1d0005 0x0 0x0 0x0 0x0 0x0 0x200005 0x0 0x0 0x0 0x0 0x0 0x230002 0x0 0x360002 0x1482 0x390002 0x1482 oops 0 +ciMethodData java/lang/String ([CII)V 2 5635 orig 204 232 48 218 113 136 44 85 63 112 1 0 0 104 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 25 160 0 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 14 0 2 0 0 0 120 0 0 0 255 255 255 255 2 0 1 0 data 30 0x10002 0x1403 0x50007 0x1403 0x18 0x0 0xd0002 0x0 0x120007 0x1385 0x38 0x7e 0x160007 0x7e 0x18 0x0 0x1e0002 0x0 0x250007 0x0 0x10 0x7e 0x370007 0x1385 0x18 0x0 0x410002 0x0 0x4b0002 0x1385 oops 0 +ciMethodData java/lang/AbstractStringBuilder newCapacity (I)I 2 3363 orig 204 232 48 218 113 72 181 90 63 32 1 0 0 32 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 17 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 130 0 0 0 9 101 0 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 18 0 2 0 0 0 68 0 0 0 255 255 255 255 7 0 13 0 data 17 0xd0007 0x5f9 0x10 0x6a8 0x130007 0x0 0x20 0xca1 0x1a0007 0xca1 0x24 0x0 0x1f0002 0x0 0x220003 0x0 0xc oops 0 +ciMethodData java/util/Arrays copyOf ([CI)[C 2 11120 orig 204 232 48 218 113 176 244 98 63 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 168 0 0 0 65 86 1 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 7 0 2 0 0 0 16 0 0 0 255 255 255 255 2 0 11 0 data 4 0xb0002 0x2ac8 0xe0002 0x2ac8 oops 0 +ciMethodData java/lang/String getChars (II[CI)V 2 5549 orig 204 232 48 218 113 104 57 85 63 76 1 0 0 64 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 133 1 0 0 65 161 0 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 9 0 2 0 0 0 80 0 0 0 255 255 255 255 7 0 1 0 data 20 0x10007 0x1428 0x18 0x0 0x90002 0x0 0x130007 0x1428 0x18 0x0 0x1b0002 0x0 0x210007 0x1428 0x18 0x0 0x2b0002 0x0 0x3a0002 0x1428 oops 0 +ciMethodData java/lang/String startsWith (Ljava/lang/String;I)Z 2 17659 orig 204 232 48 218 113 24 67 85 63 32 1 0 0 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 168 2 0 0 145 132 0 0 153 18 2 0 0 0 0 0 0 0 0 0 2 0 0 0 1 0 13 0 2 0 0 0 64 0 0 0 255 255 255 255 7 0 25 0 data 16 0x190007 0x1 0x20 0x1091 0x250007 0xff4 0x10 0x9d 0x2f0007 0x52d 0x20 0x42b1 0x410007 0x37ea 0xfffffff0 0xac7 oops 0 +ciInstanceKlass java/util/jar/Attributes$Name 1 1 175 10 9 100 8 10 10 100 10 10 9 10 10 10 10 10 7 9 11 10 8 10 9 8 9 8 9 8 9 8 9 8 9 8 9 8 9 8 9 8 9 8 9 8 9 8 9 8 9 8 9 8 9 8 9 7 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 12 12 1 12 12 1 7 12 12 12 12 12 12 12 100 1 7 12 7 12 12 1 12 1 12 1 12 1 12 1 12 1 12 1 12 1 12 1 12 1 12 1 12 1 12 1 12 1 12 1 12 1 12 1 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +staticfield java/util/jar/Attributes$Name MANIFEST_VERSION Ljava/util/jar/Attributes$Name; java/util/jar/Attributes$Name +staticfield java/util/jar/Attributes$Name SIGNATURE_VERSION Ljava/util/jar/Attributes$Name; java/util/jar/Attributes$Name +staticfield java/util/jar/Attributes$Name CONTENT_TYPE Ljava/util/jar/Attributes$Name; java/util/jar/Attributes$Name +staticfield java/util/jar/Attributes$Name CLASS_PATH Ljava/util/jar/Attributes$Name; java/util/jar/Attributes$Name +staticfield java/util/jar/Attributes$Name MAIN_CLASS Ljava/util/jar/Attributes$Name; java/util/jar/Attributes$Name +staticfield java/util/jar/Attributes$Name SEALED Ljava/util/jar/Attributes$Name; java/util/jar/Attributes$Name +staticfield java/util/jar/Attributes$Name EXTENSION_LIST Ljava/util/jar/Attributes$Name; java/util/jar/Attributes$Name +staticfield java/util/jar/Attributes$Name EXTENSION_NAME Ljava/util/jar/Attributes$Name; java/util/jar/Attributes$Name +staticfield java/util/jar/Attributes$Name EXTENSION_INSTALLATION Ljava/util/jar/Attributes$Name; java/util/jar/Attributes$Name +staticfield java/util/jar/Attributes$Name IMPLEMENTATION_TITLE Ljava/util/jar/Attributes$Name; java/util/jar/Attributes$Name +staticfield java/util/jar/Attributes$Name IMPLEMENTATION_VERSION Ljava/util/jar/Attributes$Name; java/util/jar/Attributes$Name +staticfield java/util/jar/Attributes$Name IMPLEMENTATION_VENDOR Ljava/util/jar/Attributes$Name; java/util/jar/Attributes$Name +staticfield java/util/jar/Attributes$Name IMPLEMENTATION_VENDOR_ID Ljava/util/jar/Attributes$Name; java/util/jar/Attributes$Name +staticfield java/util/jar/Attributes$Name IMPLEMENTATION_URL Ljava/util/jar/Attributes$Name; java/util/jar/Attributes$Name +staticfield java/util/jar/Attributes$Name SPECIFICATION_TITLE Ljava/util/jar/Attributes$Name; java/util/jar/Attributes$Name +staticfield java/util/jar/Attributes$Name SPECIFICATION_VERSION Ljava/util/jar/Attributes$Name; java/util/jar/Attributes$Name +staticfield java/util/jar/Attributes$Name SPECIFICATION_VENDOR Ljava/util/jar/Attributes$Name; java/util/jar/Attributes$Name +ciMethodData java/lang/AbstractStringBuilder (I)V 2 39781 orig 204 232 48 218 113 208 178 90 63 228 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 189 0 0 0 65 213 4 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 3 0 2 0 0 0 8 0 0 0 255 255 255 255 2 0 1 0 data 2 0x10002 0x9aa8 oops 0 +ciMethodData java/lang/StringBuilder append (Ljava/lang/String;)Ljava/lang/StringBuilder; 2 69284 orig 204 232 48 218 113 96 230 90 63 228 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 49 1 0 0 153 107 8 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 3 0 2 0 0 0 8 0 0 0 255 255 255 255 2 0 2 0 data 2 0x20002 0x10d73 oops 0 +ciMethodData java/lang/AbstractStringBuilder append (Ljava/lang/String;)Ljava/lang/AbstractStringBuilder; 2 5584 orig 204 232 48 218 113 0 188 90 63 64 1 0 0 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 91 1 0 0 169 163 0 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 14 0 2 0 0 0 80 0 0 0 255 255 255 255 7 0 1 0 data 20 0x10007 0x1475 0x18 0x0 0x50002 0x0 0xa0005 0x8d 0xb7fdf0 0x13e8 0x0 0x0 0x150002 0x1475 0x230005 0x8d 0xb7fdf0 0x13e8 0x0 0x0 oops 2 8 java/lang/String 16 java/lang/String +ciMethodData java/lang/StringBuilder toString ()Ljava/lang/String; 2 31319 orig 204 232 48 218 113 232 244 90 63 224 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 151 0 0 0 1 206 3 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 3 0 2 0 0 0 8 0 0 0 255 255 255 255 2 0 13 0 data 2 0xd0002 0x79c0 oops 0 +ciMethodData java/util/HashMap getNode (ILjava/lang/Object;)Ljava/util/HashMap$Node; 2 5944 orig 204 232 48 218 113 128 61 96 63 76 2 0 0 216 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 17 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 2 0 0 193 169 0 0 161 8 0 0 0 0 0 0 0 0 0 0 2 0 0 0 1 0 37 0 2 0 0 0 88 1 0 0 255 255 255 255 7 0 6 0 data 86 0x60007 0x30a 0x158 0x122e 0xe0007 0x0 0x148 0x122e 0x1c0007 0x555 0x138 0xcd9 0x250007 0x6c8 0x58 0x611 0x310007 0x185 0x48 0x48c 0x350007 0x0 0x38 0x48c 0x3b0005 0x19e 0xb81870 0xf1 0xb7fdf0 0x1fd 0x3e0007 0x33 0x10 0x459 0x4c0007 0x3dc 0xd0 0x31f 0x510004 0xfffffce1 0x0 0x0 0x0 0x0 0x540007 0x31f 0x40 0x0 0x590004 0x0 0x0 0x0 0x0 0x0 0x5e0005 0x0 0x0 0x0 0x0 0x0 0x680007 0x113 0x58 0x260 0x740007 0x4d 0x48 0x213 0x780007 0x0 0x38 0x213 0x7e0005 0x14e 0x42007e38 0x32 0xb7fdf0 0x93 0x810007 0x1 0x10 0x212 0x8f0007 0x54 0xffffffa8 0xc0 oops 4 26 java/security/CodeSource 28 java/lang/String 74 java/util/jar/Attributes$Name 76 java/lang/String +ciMethodData java/lang/String lastIndexOf (II)I 2 29927 orig 204 232 48 218 113 176 71 85 63 64 1 0 0 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 87 20 0 0 113 26 0 0 129 4 3 0 0 0 0 0 0 0 0 0 2 0 0 0 1 0 14 0 2 0 0 0 76 0 0 0 255 255 255 255 7 0 3 0 data 19 0x30007 0x0 0x44 0x34e 0x100002 0x34e 0x170007 0x86 0x2c 0x6358 0x1f0007 0x6090 0x10 0x2c8 0x280003 0x6090 0xffffffe0 0x300002 0x0 oops 0 +ciMethodData java/lang/String lastIndexOfSupplementary (II)I 1 0 orig 204 232 48 218 113 104 72 85 63 96 1 0 0 40 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 108 0 0 0 255 255 255 255 2 0 1 0 data 27 0x10002 0x0 0x40007 0x0 0x64 0x0 0xd0002 0x0 0x130002 0x0 0x1d0002 0x0 0x240007 0x0 0x3c 0x0 0x2d0007 0x0 0x20 0x0 0x380007 0x0 0x10 0x0 0x410003 0x0 0xffffffd0 oops 0 +ciMethodData java/lang/String startsWith (Ljava/lang/String;)Z 2 41342 orig 204 232 48 218 113 136 67 85 63 8 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 1 0 0 193 3 5 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 3 0 2 0 0 0 24 0 0 0 255 255 255 255 5 0 3 0 data 6 0x30005 0x3 0xb7fdf0 0xa075 0x0 0x0 oops 1 2 java/lang/String +ciMethodData java/util/HashMap get (Ljava/lang/Object;)Ljava/lang/Object; 2 6092 orig 204 232 48 218 113 120 60 96 63 44 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 97 174 0 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 10 0 2 0 0 0 60 0 0 0 255 255 255 255 2 0 2 0 data 15 0x20002 0x15cc 0x60005 0x9 0x40ab86d0 0x15c3 0x0 0x0 0xb0007 0x937 0x1c 0xc95 0xf0003 0xc95 0xc oops 1 4 java/util/HashMap +ciMethod java/util/ArrayList$Itr (Ljava/util/ArrayList;)V 2089 1 7788 0 0 +ciMethod java/util/ArrayList$Itr hasNext ()Z 2113 1 5569 0 84 +ciMethod java/util/ArrayList$Itr next ()Ljava/lang/Object; 2097 1 5411 0 212 +ciMethod java/util/ArrayList$Itr checkForComodification ()V 2065 1 10657 0 0 +instanceKlass java/util/ArrayList$ListItr +ciInstanceKlass java/util/ArrayList$Itr 1 1 88 9 10 9 9 9 9 10 10 100 10 9 100 10 100 10 10 100 10 11 7 7 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 100 1 1 1 1 1 1 1 12 12 12 7 12 12 12 12 12 1 12 1 1 12 1 100 12 100 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +ciMethodData java/lang/String substring (II)Ljava/lang/String; 2 5445 orig 204 232 48 218 113 224 78 85 63 92 1 0 0 104 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 1 0 0 241 161 0 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 15 0 2 0 0 0 124 0 0 0 255 255 255 255 7 0 1 0 data 31 0x10007 0x143e 0x18 0x0 0x90002 0x0 0x130007 0x143e 0x18 0x0 0x1b0002 0x0 0x240007 0x143e 0x18 0x0 0x2c0002 0x0 0x310007 0x36c 0x2c 0x10d2 0x3a0007 0xab6 0x1c 0x61c 0x3e0003 0x61c 0x14 0x4b0002 0xe22 oops 0 +ciMethodData java/lang/String indexOf ([CII[CIII)I 2 72890 orig 204 232 48 218 113 248 74 85 63 228 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 16 0 0 209 41 0 0 177 101 8 0 164 2 0 0 236 132 0 0 2 0 0 0 3 0 35 0 2 0 0 0 240 0 0 0 255 255 255 255 7 224 3 0 data 60 0x3e007 0x53a 0x2c 0x1 0x80007 0x1 0x1c 0x0 0xc0003 0x0 0xc 0x130007 0x53a 0x10 0x0 0x1b0007 0x53a 0x10 0x0 0x390007 0x34e 0xa4 0x26fb 0x420007 0x4ab 0x3c 0x2250 0x4c0007 0x34c 0x2c 0x1000f 0x550007 0x1f04 0x1c 0xe10b 0x580003 0xe10b 0xffffffe0 0x5f0007 0x34c 0x4c 0x23af 0x7b0007 0x1ec 0x2c 0x285f 0x860007 0x21c3 0x1c 0x69c 0x8f0003 0x69c 0xffffffe0 0x960007 0x21c3 0x10 0x1ec 0xa10003 0x250f 0xffffff68 oops 0 +ciMethodData java/util/Stack pop ()Ljava/lang/Object; 2 2939 orig 204 232 48 218 113 104 182 94 63 52 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 15 0 0 0 97 91 0 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 72 0 0 0 255 255 255 255 5 0 1 0 data 18 0x10005 0x0 0x41ff51b8 0xb6c 0x0 0x0 0x60005 0x0 0x41ff51b8 0xb6c 0x0 0x0 0xe0005 0x0 0x41ff51b8 0xb6c 0x0 0x0 oops 3 2 java/util/Stack 8 java/util/Stack 14 java/util/Stack +ciMethodData java/util/Stack peek ()Ljava/lang/Object; 2 2941 orig 204 232 48 218 113 240 182 94 63 52 1 0 0 40 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 16 0 0 0 105 91 0 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 6 0 2 0 0 0 72 0 0 0 255 255 255 255 5 0 1 0 data 18 0x10005 0x0 0x41ff51b8 0xb6d 0x0 0x0 0x60007 0xb6d 0x18 0x0 0xd0002 0x0 0x150005 0x0 0x41ff51b8 0xb6d 0x0 0x0 oops 2 2 java/util/Stack 14 java/util/Stack +ciMethodData java/util/Vector elementAt (I)Ljava/lang/Object; 2 3009 orig 204 232 48 218 113 160 108 94 63 136 1 0 0 120 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 37 0 0 0 225 92 0 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 5 0 2 0 0 0 152 0 0 0 255 255 255 255 7 0 5 0 data 38 0x50007 0xb9c 0x80 0x0 0x100002 0x0 0x140005 0x0 0x0 0x0 0x0 0x0 0x190005 0x0 0x0 0x0 0x0 0x0 0x200005 0x0 0x0 0x0 0x0 0x0 0x230005 0x0 0x0 0x0 0x0 0x0 0x260002 0x0 0x2c0005 0x0 0x41ff51b8 0xb6d 0x41ff5248 0x2f oops 2 34 java/util/Stack 36 java/util/Vector +ciMethodData java/util/Vector removeElementAt (I)V 2 2939 orig 204 232 48 218 113 48 111 94 63 184 1 0 0 168 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 25 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 15 0 0 0 97 91 0 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 10 0 2 0 0 0 200 0 0 0 255 255 255 255 7 0 15 0 data 50 0xf0007 0xb6c 0x80 0x0 0x1a0002 0x0 0x1e0005 0x0 0x0 0x0 0x0 0x0 0x230005 0x0 0x0 0x0 0x0 0x0 0x2a0005 0x0 0x0 0x0 0x0 0x0 0x2d0005 0x0 0x0 0x0 0x0 0x0 0x300002 0x0 0x350007 0xb6c 0x18 0x0 0x3d0002 0x0 0x4b0007 0xb6c 0x18 0x0 0x5b0002 0x0 0x710104 0x0 0x0 0x0 0x0 0x0 oops 0 +ciMethodData java/util/HashMap containsKey (Ljava/lang/Object;)Z 2 6188 orig 204 232 48 218 113 248 61 96 63 44 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 17 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 18 0 0 0 209 192 0 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 10 0 2 0 0 0 60 0 0 0 255 255 255 255 2 0 2 0 data 15 0x20002 0x181a 0x60005 0x15c 0x40ab86d0 0x15eb 0x41a352a8 0xd3 0x90007 0x1311 0x1c 0x509 0xd0003 0x509 0xc oops 2 4 java/util/HashMap 6 java/util/LinkedHashMap +ciMethodData java/lang/StringBuilder (I)V 2 8383 orig 204 232 48 218 113 128 228 90 63 228 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 120 0 0 0 57 2 1 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 3 0 2 0 0 0 8 0 0 0 255 255 255 255 2 0 2 0 data 2 0x20002 0x2047 oops 0 +ciMethodData java/lang/String indexOf (Ljava/lang/String;I)I 2 38494 orig 204 232 48 218 113 88 73 85 63 252 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 241 170 4 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 3 0 2 0 0 0 8 0 0 0 255 255 255 255 2 0 21 0 data 2 0x150002 0x955e oops 0 +ciMethodData java/lang/String indexOf (Ljava/lang/String;)I 2 16617 orig 204 232 48 218 113 216 72 85 63 8 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 65 255 1 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 3 0 2 0 0 0 24 0 0 0 255 255 255 255 5 0 3 0 data 6 0x30005 0x0 0xb7fdf0 0x3fe8 0x0 0x0 oops 1 2 java/lang/String +ciInstanceKlass org/codehaus/plexus/classworlds/realm/ClassRealm 1 1 439 7 10 9 9 7 10 9 10 9 9 7 10 9 10 10 10 9 7 10 11 11 11 11 11 10 10 10 10 10 7 10 7 11 9 10 10 10 8 10 8 10 10 10 10 100 10 10 10 10 10 7 11 10 11 10 10 10 11 10 7 10 10 10 11 11 10 10 9 10 8 10 7 10 8 10 10 10 8 10 10 10 10 10 8 10 8 10 8 11 8 8 8 8 10 8 10 10 10 10 10 7 10 11 10 10 10 7 7 7 10 10 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 100 100 100 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 7 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 7 1 1 1 1 1 1 1 100 100 1 1 1 1 1 100 100 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 12 12 12 1 12 12 7 12 12 12 1 12 12 7 12 12 12 1 12 7 12 12 12 7 12 12 12 12 100 12 12 12 1 1 7 12 12 12 12 1 7 12 1 12 12 12 12 1 12 12 12 12 1 7 12 12 12 12 12 1 12 7 12 12 12 12 12 100 12 12 1 100 12 1 1 12 12 12 1 12 12 12 12 12 1 12 1 12 1 12 1 1 1 1 12 1 12 7 12 12 1 7 12 12 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +staticfield org/codehaus/plexus/classworlds/realm/ClassRealm isParallelCapable Z 1 +ciMethodData java/lang/String substring (I)Ljava/lang/String; 2 9278 orig 204 232 48 218 113 32 78 85 63 48 1 0 0 48 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 241 25 1 0 1 0 0 0 34 20 0 0 0 0 0 0 2 0 0 0 0 0 10 0 2 0 0 0 84 0 0 0 255 255 255 255 7 0 1 0 data 21 0x10007 0x233e 0x18 0x0 0x90002 0x0 0x160007 0x233e 0x18 0x0 0x1e0002 0x0 0x23e007 0x2153 0x1c 0x1ec 0x270003 0x1ec 0x14 0x340002 0x2153 oops 0 +ciMethod java/lang/StringIndexOutOfBoundsException (I)V 0 0 1 0 -1 +instanceKlass java/lang/ArrayIndexOutOfBoundsException +instanceKlass java/lang/StringIndexOutOfBoundsException +ciInstanceKlass java/lang/IndexOutOfBoundsException 0 0 21 10 10 100 100 1 1 1 5 0 1 1 1 1 1 1 1 12 12 1 1 +ciInstanceKlass java/lang/StringIndexOutOfBoundsException 0 0 38 10 10 100 10 8 10 10 10 100 100 1 1 1 5 0 1 1 1 1 1 1 1 1 12 12 1 1 12 12 12 1 1 1 1 1 1 1 +ciMethodData java/util/HashSet add (Ljava/lang/Object;)Z 2 5444 orig 204 232 48 218 113 152 224 111 63 36 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 33 162 0 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 6 0 2 0 0 0 52 0 0 0 255 255 255 255 5 0 8 0 data 13 0x80005 0x0 0x40ab86d0 0x10bd 0x41a352a8 0x387 0xb0007 0x113 0x1c 0x1331 0xf0003 0x1331 0xc oops 2 2 java/util/HashMap 4 java/util/LinkedHashMap +ciMethodData java/util/Vector ensureCapacityHelper (I)V 2 4921 orig 204 232 48 218 113 104 101 94 63 244 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 201 145 0 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 6 0 2 0 0 0 24 0 0 0 255 255 255 255 7 0 7 0 data 6 0x70007 0x1233 0x18 0x6 0xc0002 0x6 oops 0 +ciMethodData java/util/Vector grow (I)V 1 16 orig 204 232 48 218 113 16 102 94 63 60 1 0 0 60 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 0 0 0 49 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 76 0 0 0 255 255 255 255 7 0 11 0 data 19 0xb0007 0x6 0x1c 0x0 0x120003 0x0 0xc 0x1b0007 0x6 0x10 0x0 0x240007 0x6 0x18 0x0 0x280002 0x0 0x320002 0x6 oops 0 +ciInstanceKlass java/lang/ArrayIndexOutOfBoundsException 0 0 38 10 100 10 8 10 10 10 10 100 100 1 1 1 5 0 1 1 1 1 1 1 1 1 12 1 1 12 12 12 12 1 1 1 1 1 1 1 +ciMethodData java/util/Vector addElement (Ljava/lang/Object;)V 2 4863 orig 204 232 48 218 113 152 112 94 63 16 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 249 143 0 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 7 0 2 0 0 0 32 0 0 0 255 255 255 255 2 0 17 0 data 8 0x110002 0x11ff 0x240004 0x0 0xb7fe40 0x6c4 0xb7fdf0 0xb37 oops 2 4 java/lang/Class 6 java/lang/String +ciMethodData java/lang/String valueOf (Ljava/lang/Object;)Ljava/lang/String; 2 4879 orig 204 232 48 218 113 128 95 85 63 32 1 0 0 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 17 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 81 0 0 0 241 149 0 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 6 0 2 0 0 0 52 0 0 0 255 255 255 255 7 0 1 0 data 13 0x10007 0x12b9 0x1c 0x5 0x60003 0x5 0x24 0xa0005 0x12b4 0x4073a7d0 0x4 0xb816e0 0x1 oops 2 9 org/codehaus/plexus/classworlds/realm/ClassRealm 11 java/net/URL +ciMethodData java/util/ArrayList$Itr hasNext ()Z 2 5569 orig 204 232 48 218 113 200 113 116 63 16 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 8 1 0 0 201 165 0 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 6 0 2 0 0 0 36 0 0 0 255 255 255 255 2 0 8 0 data 9 0x80002 0x14b9 0xb0007 0x44c 0x1c 0x106d 0xf0003 0x106d 0xc oops 0 +ciInstanceKlass java/util/NoSuchElementException 0 0 21 10 10 100 100 1 1 1 5 0 1 1 1 1 1 1 1 12 12 1 1 +ciMethodData java/util/ArrayList$Itr checkForComodification ()V 2 10657 orig 204 232 48 218 113 152 116 116 63 240 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 1 0 0 249 68 1 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 5 0 2 0 0 0 24 0 0 0 255 255 255 255 7 0 11 0 data 6 0xb0007 0x289f 0x18 0x0 0x120002 0x0 oops 0 +ciMethodData java/util/ArrayList$Itr next ()Ljava/lang/Object; 2 5411 orig 204 232 48 218 113 128 114 116 63 60 1 0 0 48 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 1 0 0 233 160 0 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 10 0 2 0 0 0 80 0 0 0 255 255 255 255 5 0 1 0 data 20 0x10005 0x5 0x40ab8790 0x1418 0x0 0x0 0xe0002 0x141d 0x110007 0x141d 0x18 0x0 0x180002 0x0 0x270007 0x141d 0x18 0x0 0x2e0002 0x0 oops 1 2 java/util/ArrayList$Itr +ciMethodData java/util/ArrayList$Itr (Ljava/util/ArrayList;)V 2 7788 orig 204 232 48 218 113 72 113 116 63 228 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 1 0 0 57 235 0 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 3 0 2 0 0 0 8 0 0 0 255 255 255 255 2 0 6 0 data 2 0x60002 0x1d67 oops 0 +ciMethodData java/lang/String toString ()Ljava/lang/String; 2 4916 orig 204 232 48 218 113 152 93 85 63 216 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 83 0 0 0 9 151 0 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 3 0 1 0 0 0 0 0 0 0 255 255 255 255 0 0 0 0 data 0 oops 0 +ciMethodData java/lang/AbstractStringBuilder append (Ljava/lang/CharSequence;II)Ljava/lang/AbstractStringBuilder; 2 19083 orig 204 232 48 218 113 152 191 90 63 92 2 0 0 40 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 31 8 0 0 185 70 0 0 97 19 2 0 0 0 0 0 0 0 0 0 2 0 0 0 1 0 25 0 2 0 0 0 100 1 0 0 255 255 255 255 7 0 1 0 data 89 0x10007 0x8d7 0x10 0x0 0x80007 0x0 0x48 0x8d7 0xd0007 0x0 0x38 0x8d7 0x120005 0x0 0xb7fdf0 0x8d7 0x0 0x0 0x170007 0x8d7 0xe0 0x0 0x220002 0x0 0x270005 0x0 0x0 0x0 0x0 0x0 0x2b0005 0x0 0x0 0x0 0x0 0x0 0x300005 0x0 0x0 0x0 0x0 0x0 0x340005 0x0 0x0 0x0 0x0 0x0 0x390005 0x0 0x0 0x0 0x0 0x0 0x3d0005 0x0 0x0 0x0 0x0 0x0 0x420005 0x0 0x0 0x0 0x0 0x0 0x450005 0x0 0x0 0x0 0x0 0x0 0x480002 0x0 0x590002 0x8d7 0x680007 0x8d7 0x34 0x426c 0x740005 0x0 0xb7fdf0 0x426c 0x0 0x0 0x800003 0x426c 0xffffffd8 oops 2 14 java/lang/String 82 java/lang/String +ciMethodData java/lang/StringBuilder append (Ljava/lang/CharSequence;II)Ljava/lang/StringBuilder; 2 10712 orig 204 232 48 218 113 176 231 90 63 236 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 1 0 0 145 70 1 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 3 0 2 0 0 0 8 0 0 0 255 255 255 255 2 0 4 0 data 2 0x40002 0x28d2 oops 0 +ciMethodData java/util/ArrayList iterator ()Ljava/util/Iterator; 2 5520 orig 204 232 48 218 113 232 19 95 63 224 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 128 1 0 0 129 160 0 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 3 0 2 0 0 0 8 0 0 0 255 255 255 255 2 0 5 0 data 2 0x50002 0x1410 oops 0 +ciMethod org/apache/maven/model/path/UrlNormalizer normalize (Ljava/lang/String;)Ljava/lang/String; 0 0 1 0 -1 +ciInstanceKlass org/apache/maven/model/path/UrlNormalizer 1 0 9 100 100 1 1 1 1 1 1 +ciMethod org/apache/maven/model/path/DefaultUrlNormalizer normalize (Ljava/lang/String;)Ljava/lang/String; 649 1 268 0 0 +ciInstanceKlass org/apache/maven/model/path/DefaultUrlNormalizer 1 1 65 10 8 10 10 10 10 100 10 10 10 10 100 7 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 12 1 7 12 12 12 12 1 12 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +ciMethod org/codehaus/plexus/interpolation/RecursionInterceptor expressionResolutionStarted (Ljava/lang/String;)V 0 0 1 0 -1 +ciMethod org/codehaus/plexus/interpolation/RecursionInterceptor expressionResolutionFinished (Ljava/lang/String;)V 0 0 1 0 -1 +ciMethod org/codehaus/plexus/interpolation/RecursionInterceptor hasRecursiveExpression (Ljava/lang/String;)Z 0 0 1 0 -1 +ciInstanceKlass org/codehaus/plexus/interpolation/RecursionInterceptor 1 0 16 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 +ciMethod org/codehaus/plexus/interpolation/ValueSource getValue (Ljava/lang/String;)Ljava/lang/Object; 0 0 1 0 -1 +ciInstanceKlass org/codehaus/plexus/interpolation/ValueSource 1 0 13 100 100 1 1 1 1 1 1 1 1 1 1 +ciMethodData java/util/HashSet contains (Ljava/lang/Object;)Z 2 6521 orig 204 232 48 218 113 24 224 111 63 8 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 128 1 0 0 201 191 0 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 3 0 2 0 0 0 24 0 0 0 255 255 255 255 5 0 5 0 data 6 0x50005 0x0 0x40ab86d0 0x17dc 0x41a352a8 0x1d oops 2 2 java/util/HashMap 4 java/util/LinkedHashMap +ciMethod org/codehaus/plexus/interpolation/InterpolationPostProcessor execute (Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object; 0 0 1 0 -1 +ciInstanceKlass org/codehaus/plexus/interpolation/InterpolationPostProcessor 1 0 9 100 100 1 1 1 1 1 1 +ciMethodData java/util/ArrayList isEmpty ()Z 2 8313 orig 204 232 48 218 113 136 1 95 63 244 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 201 243 0 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 6 0 2 0 0 0 28 0 0 0 255 255 255 255 7 0 4 0 data 7 0x40007 0x6a1 0x1c 0x17d8 0x80003 0x17d8 0xc oops 0 +ciInstanceKlass java/util/ConcurrentModificationException 0 0 27 10 10 10 10 100 100 1 1 1 5 0 1 1 1 1 1 1 1 1 1 12 12 12 12 1 1 +ciInstanceKlass org/codehaus/plexus/interpolation/InterpolationCycleException 0 0 53 100 10 8 10 8 11 10 10 10 100 100 1 1 1 5 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 1 12 1 100 12 12 12 12 1 1 1 1 1 1 1 1 1 1 1 1 +ciInstanceKlass org/codehaus/plexus/interpolation/PrefixedObjectValueSource 1 1 53 7 7 10 10 10 10 10 100 11 100 7 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 12 12 12 1 12 1 1 1 1 1 1 1 1 +ciInstanceKlass org/codehaus/plexus/interpolation/MapBasedValueSource 1 1 34 10 9 11 7 7 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 12 12 7 12 1 1 1 1 1 1 1 +ciMethod org/apache/maven/model/interpolation/UrlNormalizingPostProcessor execute (Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object; 3497 1 2077 0 0 +ciInstanceKlass org/apache/maven/model/interpolation/UrlNormalizingPostProcessor 1 1 71 10 9 9 11 10 11 7 10 8 11 8 8 8 8 7 7 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 12 7 12 12 7 12 1 1 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +staticfield org/apache/maven/model/interpolation/UrlNormalizingPostProcessor URL_EXPRESSIONS Ljava/util/Set; java/util/HashSet +ciMethod org/codehaus/plexus/interpolation/StringSearchInterpolator interpolate (Ljava/lang/String;Lorg/codehaus/plexus/interpolation/RecursionInterceptor;Ljava/util/Set;)Ljava/lang/String; 2633 9793 4440 0 -1 +ciInstanceKlass org/codehaus/plexus/interpolation/StringSearchInterpolator 1 1 272 10 7 10 9 7 10 9 9 9 7 8 9 8 9 11 11 7 10 10 7 10 10 11 8 7 10 10 10 10 10 9 10 10 10 11 8 10 10 11 100 10 11 11 11 11 11 7 11 10 10 10 11 7 11 11 11 10 11 11 11 7 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 100 100 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 100 100 100 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 12 1 12 1 12 12 12 1 1 12 1 12 7 12 12 1 12 1 12 7 12 1 1 7 12 12 12 12 12 12 12 12 12 7 12 1 12 12 7 12 1 12 12 12 12 7 12 12 1 12 12 12 12 12 1 12 12 12 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +ciMethod org/codehaus/plexus/interpolation/PrefixAwareRecursionInterceptor hasRecursiveExpression (Ljava/lang/String;)Z 3121 1 2845 0 0 +ciMethod org/codehaus/plexus/interpolation/PrefixAwareRecursionInterceptor expressionResolutionFinished (Ljava/lang/String;)V 4097 1 2869 0 0 +ciMethod org/codehaus/plexus/interpolation/PrefixAwareRecursionInterceptor expressionResolutionStarted (Ljava/lang/String;)V 3121 1 2869 0 0 +ciInstanceKlass org/codehaus/plexus/interpolation/PrefixAwareRecursionInterceptor 1 1 113 10 7 10 9 9 11 7 11 7 9 10 10 10 10 9 10 10 10 10 7 7 100 1 1 1 8 1 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 1 1 12 1 12 12 7 12 1 12 12 7 12 12 12 12 100 12 12 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +ciMethod org/codehaus/plexus/interpolation/util/ValueSourceUtils trimPrefix (Ljava/lang/String;[Ljava/lang/String;Z)Ljava/lang/String; 4097 5345 5731 0 1376 +ciInstanceKlass org/codehaus/plexus/interpolation/util/ValueSourceUtils 1 1 68 10 11 11 11 7 10 10 10 8 100 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 100 1 1 1 1 100 1 1 12 7 12 7 12 12 1 12 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +ciMethodData java/lang/String contains (Ljava/lang/CharSequence;)Z 2 6932 orig 204 232 48 218 113 216 81 85 63 60 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 1 0 0 121 208 0 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 6 0 2 0 0 0 76 0 0 0 255 255 255 255 5 0 2 0 data 19 0x20005 0x0 0xb7fdf0 0x1a0f 0x0 0x0 0x70005 0x0 0xb7fdf0 0x1a0f 0x0 0x0 0xb0007 0x1889 0x1c 0x186 0xf0003 0x186 0xc oops 2 2 java/lang/String 8 java/lang/String +ciMethodData java/util/Vector elementData (I)Ljava/lang/Object; 2 3009 orig 204 232 48 218 113 232 115 94 63 220 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 9 86 0 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 3 0 1 0 0 0 0 0 0 0 255 255 255 255 0 0 0 0 data 0 oops 0 +ciMethodData java/util/Vector indexOf (Ljava/lang/Object;I)I 2 2873 orig 204 232 48 218 113 168 106 94 63 128 1 0 0 60 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 134 1 0 0 145 77 0 0 33 9 0 0 0 0 0 0 0 0 0 0 2 0 0 0 2 0 16 0 2 0 0 0 140 0 0 0 255 255 255 255 7 0 1 0 data 35 0x10007 0x9b2 0x48 0x0 0xb0007 0x0 0x2c 0x0 0x140007 0x0 0x10 0x0 0x1c0003 0x0 0xffffffe0 0x1f0003 0x0 0x50 0x290007 0x9b2 0x44 0x124 0x330005 0x0 0xb7fdf0 0x124 0x0 0x0 0x360007 0x124 0x10 0x0 0x3e0003 0x124 0xffffffc8 oops 1 24 java/lang/String +ciMethodData java/util/Vector contains (Ljava/lang/Object;)Z 2 2873 orig 204 232 48 218 113 128 105 94 63 36 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 138 1 0 0 121 77 0 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 6 0 2 0 0 0 52 0 0 0 255 255 255 255 5 0 3 0 data 13 0x30005 0x0 0x41ff51b8 0x9af 0x0 0x0 0x60007 0x9af 0x1c 0x0 0xa0003 0x0 0xc oops 1 2 java/util/Stack +ciMethodData java/util/Stack push (Ljava/lang/Object;)Ljava/lang/Object; 2 2895 orig 204 232 48 218 113 232 181 94 63 8 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 160 1 0 0 121 77 0 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 24 0 0 0 255 255 255 255 5 0 2 0 data 6 0x20005 0x0 0x41ff51b8 0x9af 0x0 0x0 oops 1 2 java/util/Stack +ciMethodData org/codehaus/plexus/interpolation/util/ValueSourceUtils trimPrefix (Ljava/lang/String;[Ljava/lang/String;Z)Ljava/lang/String; 2 8672 orig 204 232 48 218 113 160 54 118 66 228 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 156 2 0 0 25 163 0 0 33 250 0 0 0 0 0 0 0 0 0 0 2 0 0 0 1 0 18 0 2 0 0 0 240 0 0 0 255 255 255 255 7 0 1 0 data 60 0x10007 0x1463 0x10 0x0 0x170007 0xae0 0xc0 0x28c6 0x240005 0x28 0xb7fdf0 0x289e 0x0 0x0 0x270007 0x1f43 0x8c 0x983 0x2d0005 0x14 0xb7fdf0 0x96f 0x0 0x0 0x300005 0x14 0xb7fdf0 0x96f 0x0 0x0 0x370005 0x14 0xb7fdf0 0x96f 0x0 0x0 0x3a0007 0x983 0x40 0x0 0x3f0005 0x0 0x0 0x0 0x0 0x0 0x430003 0x0 0x18 0x490003 0x1f43 0xffffff4c 0x4d0007 0x983 0x20 0xae0 0x510007 0x3a0 0x10 0x740 oops 4 10 java/lang/String 20 java/lang/String 26 java/lang/String 32 java/lang/String +ciMethodData org/codehaus/plexus/interpolation/StringSearchInterpolator interpolate (Ljava/lang/String;Lorg/codehaus/plexus/interpolation/RecursionInterceptor;Ljava/util/Set;)Ljava/lang/String; 2 14462 orig 204 232 48 218 113 24 53 117 66 236 7 0 0 196 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 200 4 0 0 137 128 0 0 97 157 1 0 0 0 0 0 0 0 0 0 2 0 0 0 3 0 91 0 2 0 0 0 244 6 0 0 255 255 255 255 7 0 1 0 data 445 0x10007 0x1011 0x10 0x0 0xc0005 0xf 0xb7fdf0 0x1002 0x0 0x0 0x110002 0x1011 0x220005 0x1d 0xb7fdf0 0x1a05 0x0 0x0 0x290007 0x1011 0x5e0 0xa11 0x350005 0xe 0xb814f0 0xa03 0x0 0x0 0x420005 0xe 0xb7fdf0 0xa03 0x0 0x0 0x490007 0xa11 0x1c 0x0 0x4c0003 0x0 0x590 0x580005 0xe 0xb7fdf0 0xa03 0x0 0x0 0x5c0005 0xe 0xb7fdf0 0xa03 0x0 0x0 0x670005 0xe 0xb7fdf0 0xa03 0x0 0x0 0x6c0005 0xe 0xb7fdf0 0xa03 0x0 0x0 0x730005 0xe 0xb7fdf0 0xa03 0x0 0x0 0x770005 0xe 0xb7fdf0 0xa03 0x0 0x0 0x7e0007 0x0 0x120 0xa11 0x850007 0xa11 0x110 0x0 0x8c0005 0x0 0x0 0x0 0x0 0x0 0x8f0007 0x0 0xe8 0x0 0x940007 0x0 0x1c 0x0 0x980003 0x0 0x24 0xa10005 0x0 0x0 0x0 0x0 0x0 0xa90007 0x0 0xa4 0x0 0xb10005 0x0 0x0 0x0 0x0 0x0 0xbc0005 0x0 0x0 0x0 0x0 0x0 0xbf0007 0x0 0x64 0x0 0xc60005 0x0 0x0 0x0 0x0 0x0 0xd40005 0x0 0x0 0x0 0x0 0x0 0xda0005 0x0 0x0 0x0 0x0 0x0 0xde0003 0x0 0xfffffde8 0xe70005 0x0 0x40ab8610 0xa11 0x0 0x0 0xec0007 0x1 0x360 0xa10 0xf30005 0xe 0xb7fdf0 0xa02 0x0 0x0 0xf60007 0xa10 0x28 0x0 0xfc0005 0x0 0x0 0x0 0x0 0x0 0x1040005 0x0 0x40ab8670 0xa10 0x0 0x0 0x1090007 0xa10 0x18 0x0 0x1150002 0x0 0x11c0005 0x0 0x40ab8670 0xa10 0x0 0x0 0x1270005 0x0 0x40ab86d0 0xa10 0x0 0x0 0x1350005 0x0 0x40ab8730 0xa10 0x0 0x0 0x13e0005 0x0 0x40ab8790 0x2c53 0x0 0x0 0x1430007 0x29c 0xd0 0x29b7 0x1480005 0x0 0x40ab8790 0x29b7 0x0 0x0 0x14d0004 0x0 0x40ab87f0 0xa10 0x40ab8850 0x1a4e 0x1540007 0x2243 0x1c 0x774 0x1570003 0x774 0x80 0x15e0005 0x538 0x40ab87f0 0xa10 0x40ab8850 0x12fb 0x1670007 0x1acf 0x50 0x774 0x16c0005 0x0 0xb7fdf0 0x774 0x0 0x0 0x1710005 0x5 0xb7fdf0 0x76f 0x0 0x0 0x1740007 0x774 0x10 0x0 0x17e0003 0x2243 0xffffff24 0x1830007 0x774 0x28 0x29c 0x1880007 0x29c 0x18 0x0 0x1940002 0x0 0x19a0007 0x29c 0x134 0x774 0x1a00002 0x774 0x1a50002 0x774 0x1ae0007 0x0 0xe8 0x774 0x1b50005 0x0 0x40ab8730 0x774 0x0 0x0 0x1ba0007 0x0 0xc0 0x774 0x1c10005 0x0 0x40ab8730 0x774 0x0 0x0 0x1ca0005 0x0 0x40ab8790 0xecc 0x0 0x0 0x1cf0007 0x758 0x80 0x774 0x1d40005 0x0 0x40ab8790 0x774 0x0 0x0 0x1d90004 0x0 0x40ab88b0 0x774 0x0 0x0 0x1e40005 0x0 0x40ab88b0 0x774 0x0 0x0 0x1ed0007 0x758 0x1c 0x1c 0x1f40003 0x1c 0x18 0x1f70003 0x758 0xffffff74 0x1fe0002 0x774 0x2010005 0x5 0xb814f0 0x76f 0x0 0x0 0x2080003 0x774 0x24 0x20e0005 0x0 0x40ab8610 0x29c 0x0 0x0 0x2170005 0x0 0x40ab8670 0xa10 0x0 0x0 0x21c0003 0xa10 0x24 0x2240005 0x0 0x0 0x0 0x0 0x0 0x22e0007 0x774 0x28 0x29d 0x2350005 0x9 0xb814f0 0x294 0x0 0x0 0x23c0007 0x0 0x28 0xa11 0x2450005 0xe 0xb7fdf0 0xa03 0x0 0x0 0x24d0003 0xa11 0xfffffa14 0x2530007 0x99b 0x5c 0x676 0x2590007 0x676 0x4c 0x0 0x2620005 0x0 0x0 0x0 0x0 0x0 0x2650005 0x0 0x0 0x0 0x0 0x0 0x2690003 0x0 0x64 0x26f0005 0xf 0xb7fdf0 0x1002 0x0 0x0 0x2720007 0x0 0x40 0x1011 0x27d0005 0xf 0xb7fdf0 0x1002 0x0 0x0 0x2800005 0xf 0xb814f0 0x1002 0x0 0x0 0x2860005 0xf 0xb814f0 0x1002 0x0 0x0 oops 39 6 java/lang/String 14 java/lang/String 24 java/lang/StringBuilder 30 java/lang/String 43 java/lang/String 49 java/lang/String 55 java/lang/String 61 java/lang/String 67 java/lang/String 73 java/lang/String 151 java/util/HashSet 161 java/lang/String 177 org/codehaus/plexus/interpolation/PrefixAwareRecursionInterceptor 189 org/codehaus/plexus/interpolation/PrefixAwareRecursionInterceptor 195 java/util/HashMap 201 java/util/ArrayList 207 java/util/ArrayList$Itr 217 java/util/ArrayList$Itr 223 org/codehaus/plexus/interpolation/PrefixedObjectValueSource 225 org/codehaus/plexus/interpolation/MapBasedValueSource 236 org/codehaus/plexus/interpolation/PrefixedObjectValueSource 238 org/codehaus/plexus/interpolation/MapBasedValueSource 246 java/lang/String 252 java/lang/String 287 java/util/ArrayList 297 java/util/ArrayList 303 java/util/ArrayList$Itr 313 java/util/ArrayList$Itr 319 org/apache/maven/model/interpolation/UrlNormalizingPostProcessor 325 org/apache/maven/model/interpolation/UrlNormalizingPostProcessor 343 java/lang/StringBuilder 352 java/util/HashSet 358 org/codehaus/plexus/interpolation/PrefixAwareRecursionInterceptor 377 java/lang/StringBuilder 387 java/lang/String 419 java/lang/String 429 java/lang/String 435 java/lang/StringBuilder 441 java/lang/StringBuilder +ciMethodData org/codehaus/plexus/interpolation/PrefixAwareRecursionInterceptor hasRecursiveExpression (Ljava/lang/String;)Z 2 2858 orig 204 232 48 218 113 80 68 117 66 60 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 134 1 0 0 33 77 0 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 13 0 2 0 0 0 76 0 0 0 255 255 255 255 2 0 9 0 data 19 0x90002 0x9a4 0xe0007 0x0 0x44 0x9a4 0x160005 0x0 0x41ff51b8 0x9a4 0x0 0x0 0x190007 0x9a4 0x1c 0x0 0x1d0003 0x0 0xc oops 1 8 java/util/Stack +ciMethodData org/codehaus/plexus/interpolation/PrefixAwareRecursionInterceptor expressionResolutionStarted (Ljava/lang/String;)V 2 2869 orig 204 232 48 218 113 152 69 117 66 16 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 134 1 0 0 121 77 0 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 3 0 2 0 0 0 32 0 0 0 255 255 255 255 2 0 9 0 data 8 0x90002 0x9af 0x120005 0x0 0x41ff51b8 0x9af 0x0 0x0 oops 1 4 java/util/Stack +ciMethodData org/codehaus/plexus/interpolation/PrefixAwareRecursionInterceptor expressionResolutionFinished (Ljava/lang/String;)V 2 2869 orig 204 232 48 218 113 240 68 117 66 8 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 169 73 0 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 11 0 2 0 0 0 24 0 0 0 255 255 255 255 5 0 4 0 data 6 0x40005 0x0 0x41ff51b8 0x935 0x0 0x0 oops 1 2 java/util/Stack +ciMethodData org/apache/maven/model/interpolation/UrlNormalizingPostProcessor execute (Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object; 2 2077 orig 204 232 48 218 113 232 32 117 66 92 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 181 1 0 0 65 51 0 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 8 0 2 0 0 0 104 0 0 0 255 255 255 255 7 0 1 0 data 26 0x10007 0x0 0x68 0x668 0x80005 0x0 0x40ab8610 0x668 0x0 0x0 0xd0007 0x655 0x40 0x13 0x150005 0x0 0xb7fdf0 0x13 0x0 0x0 0x180005 0x0 0x40e8eb10 0x13 0x0 0x0 oops 3 6 java/util/HashSet 16 java/lang/String 22 org/apache/maven/model/path/DefaultUrlNormalizer +ciMethodData org/apache/maven/model/path/DefaultUrlNormalizer normalize (Ljava/lang/String;)Ljava/lang/String; 1 292 orig 204 232 48 218 113 232 182 61 65 132 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 77 68 79 32 101 120 116 114 97 32 100 97 116 97 32 108 111 99 107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 81 0 0 0 153 6 0 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 2 0 26 0 2 0 0 0 148 1 0 0 255 255 255 255 7 0 3 0 data 101 0x30007 0x8 0x194 0xcb 0x90005 0x81 0xb7fdf0 0x4a 0x0 0x0 0xe0007 0x0 0x1c 0xcb 0x110003 0xcb 0x15c 0x150007 0x0 0x34 0x0 0x1a0005 0x0 0x0 0x0 0x0 0x0 0x1e0003 0x0 0xffffffa4 0x280007 0x0 0x44 0x0 0x2e0005 0x0 0x0 0x0 0x0 0x0 0x330007 0x0 0x1c 0x0 0x390003 0x0 0xffffffc8 0x410005 0x0 0x0 0x0 0x0 0x0 0x480007 0x0 0x34 0x0 0x4f0005 0x0 0x0 0x0 0x0 0x0 0x530003 0x0 0x8c 0x5a0002 0x0 0x610005 0x0 0x0 0x0 0x0 0x0 0x640005 0x0 0x0 0x0 0x0 0x0 0x6b0005 0x0 0x0 0x0 0x0 0x0 0x6e0005 0x0 0x0 0x0 0x0 0x0 0x710005 0x0 0x0 0x0 0x0 0x0 0x750003 0x0 0xfffffe88 oops 1 6 java/lang/String +compile org/codehaus/plexus/interpolation/StringSearchInterpolator interpolate (Ljava/lang/String;Lorg/codehaus/plexus/interpolation/RecursionInterceptor;Ljava/util/Set;)Ljava/lang/String; -1 4 inline 131 0 -1 org/codehaus/plexus/interpolation/StringSearchInterpolator interpolate (Ljava/lang/String;Lorg/codehaus/plexus/interpolation/RecursionInterceptor;Ljava/util/Set;)Ljava/lang/String; 1 12 java/lang/String length ()I 1 17 java/lang/StringBuilder (I)V 2 2 java/lang/AbstractStringBuilder (I)V 3 1 java/lang/Object ()V 1 34 java/lang/String indexOf (Ljava/lang/String;I)I 2 21 java/lang/String indexOf ([CII[CIII)I 1 53 java/lang/StringBuilder append (Ljava/lang/CharSequence;II)Ljava/lang/StringBuilder; 2 4 java/lang/AbstractStringBuilder append (Ljava/lang/CharSequence;II)Ljava/lang/AbstractStringBuilder; 3 18 java/lang/String length ()I 3 89 java/lang/AbstractStringBuilder ensureCapacityInternal (I)V 4 17 java/lang/AbstractStringBuilder newCapacity (I)I 4 20 java/util/Arrays copyOf ([CI)[C 3 116 java/lang/String charAt (I)C 1 66 java/lang/String indexOf (Ljava/lang/String;I)I 2 21 java/lang/String indexOf ([CII[CIII)I 1 88 java/lang/String length ()I 1 92 java/lang/String substring (II)Ljava/lang/String; 2 75 java/lang/String ([CII)V 3 1 java/lang/Object ()V 3 75 java/util/Arrays copyOfRange ([CII)[C 1 103 java/lang/String length ()I 1 108 java/lang/String length ()I 1 115 java/lang/String length ()I 1 119 java/lang/String substring (II)Ljava/lang/String; 2 75 java/lang/String ([CII)V 3 1 java/lang/Object ()V 3 75 java/util/Arrays copyOfRange ([CII)[C 1 231 java/util/HashSet contains (Ljava/lang/Object;)Z 2 5 java/util/HashMap containsKey (Ljava/lang/Object;)Z 3 2 java/util/HashMap hash (Ljava/lang/Object;)I 4 9 java/lang/String hashCode ()I 3 6 java/util/HashMap getNode (ILjava/lang/Object;)Ljava/util/HashMap$Node; 1 243 java/lang/String startsWith (Ljava/lang/String;)Z 2 3 java/lang/String startsWith (Ljava/lang/String;I)Z 1 260 org/codehaus/plexus/interpolation/PrefixAwareRecursionInterceptor hasRecursiveExpression (Ljava/lang/String;)Z 2 9 org/codehaus/plexus/interpolation/util/ValueSourceUtils trimPrefix (Ljava/lang/String;[Ljava/lang/String;Z)Ljava/lang/String; 3 36 java/lang/String startsWith (Ljava/lang/String;)Z 4 3 java/lang/String startsWith (Ljava/lang/String;I)Z 3 45 java/lang/String length ()I 3 48 java/lang/String substring (I)Ljava/lang/String; 4 52 java/lang/String ([CII)V 5 1 java/lang/Object ()V 5 75 java/util/Arrays copyOfRange ([CII)[C 3 55 java/lang/String startsWith (Ljava/lang/String;)Z 4 3 java/lang/String startsWith (Ljava/lang/String;I)Z 2 22 java/util/Vector contains (Ljava/lang/Object;)Z 3 3 java/util/Vector indexOf (Ljava/lang/Object;I)I 1 284 org/codehaus/plexus/interpolation/PrefixAwareRecursionInterceptor expressionResolutionStarted (Ljava/lang/String;)V 2 9 org/codehaus/plexus/interpolation/util/ValueSourceUtils trimPrefix (Ljava/lang/String;[Ljava/lang/String;Z)Ljava/lang/String; 3 36 java/lang/String startsWith (Ljava/lang/String;)Z 4 3 java/lang/String startsWith (Ljava/lang/String;I)Z 3 45 java/lang/String length ()I 3 48 java/lang/String substring (I)Ljava/lang/String; 4 52 java/lang/String ([CII)V 5 1 java/lang/Object ()V 5 75 java/util/Arrays copyOfRange ([CII)[C 3 55 java/lang/String startsWith (Ljava/lang/String;)Z 4 3 java/lang/String startsWith (Ljava/lang/String;I)Z 2 18 java/util/Stack push (Ljava/lang/Object;)Ljava/lang/Object; 3 2 java/util/Vector addElement (Ljava/lang/Object;)V 4 17 java/util/Vector ensureCapacityHelper (I)V 1 295 java/util/HashMap get (Ljava/lang/Object;)Ljava/lang/Object; 2 2 java/util/HashMap hash (Ljava/lang/Object;)I 3 9 java/lang/String hashCode ()I 2 6 java/util/HashMap getNode (ILjava/lang/Object;)Ljava/util/HashMap$Node; 1 309 java/util/ArrayList iterator ()Ljava/util/Iterator; 2 5 java/util/ArrayList$Itr (Ljava/util/ArrayList;)V 3 6 java/lang/Object ()V 1 318 java/util/ArrayList$Itr hasNext ()Z 2 8 java/util/ArrayList access$000 (Ljava/util/ArrayList;)I 1 328 java/util/ArrayList$Itr next ()Ljava/lang/Object; 2 1 java/util/ArrayList$Itr checkForComodification ()V 2 14 java/util/ArrayList access$000 (Ljava/util/ArrayList;)I 1 364 java/lang/String toString ()Ljava/lang/String; 1 369 java/lang/String contains (Ljava/lang/CharSequence;)Z 2 2 java/lang/String toString ()Ljava/lang/String; 1 416 java/lang/String valueOf (Ljava/lang/Object;)Ljava/lang/String; 1 437 java/util/ArrayList isEmpty ()Z 1 449 java/util/ArrayList iterator ()Ljava/util/Iterator; 2 5 java/util/ArrayList$Itr (Ljava/util/ArrayList;)V 3 6 java/lang/Object ()V 1 458 java/util/ArrayList$Itr hasNext ()Z 2 8 java/util/ArrayList access$000 (Ljava/util/ArrayList;)I 1 468 java/util/ArrayList$Itr next ()Ljava/lang/Object; 2 1 java/util/ArrayList$Itr checkForComodification ()V 2 14 java/util/ArrayList access$000 (Ljava/util/ArrayList;)I 1 484 org/apache/maven/model/interpolation/UrlNormalizingPostProcessor execute (Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object; 2 8 java/util/HashSet contains (Ljava/lang/Object;)Z 3 5 java/util/HashMap containsKey (Ljava/lang/Object;)Z 4 2 java/util/HashMap hash (Ljava/lang/Object;)I 5 9 java/lang/String hashCode ()I 4 6 java/util/HashMap getNode (ILjava/lang/Object;)Ljava/util/HashMap$Node; 2 21 java/lang/String toString ()Ljava/lang/String; 1 510 java/lang/String valueOf (Ljava/lang/Object;)Ljava/lang/String; 1 513 java/lang/StringBuilder append (Ljava/lang/String;)Ljava/lang/StringBuilder; 2 2 java/lang/AbstractStringBuilder append (Ljava/lang/String;)Ljava/lang/AbstractStringBuilder; 3 10 java/lang/String length ()I 3 21 java/lang/AbstractStringBuilder ensureCapacityInternal (I)V 4 17 java/lang/AbstractStringBuilder newCapacity (I)I 4 20 java/util/Arrays copyOf ([CI)[C 3 35 java/lang/String getChars (II[CI)V 1 535 org/codehaus/plexus/interpolation/PrefixAwareRecursionInterceptor expressionResolutionFinished (Ljava/lang/String;)V 2 4 java/util/Stack pop ()Ljava/lang/Object; 3 1 java/util/Vector size ()I 3 6 java/util/Stack peek ()Ljava/lang/Object; 4 1 java/util/Vector size ()I 4 21 java/util/Vector elementAt (I)Ljava/lang/Object; 5 44 java/util/Vector elementData (I)Ljava/lang/Object; 3 14 java/util/Vector removeElementAt (I)V 1 565 java/lang/StringBuilder append (Ljava/lang/String;)Ljava/lang/StringBuilder; 2 2 java/lang/AbstractStringBuilder append (Ljava/lang/String;)Ljava/lang/AbstractStringBuilder; 3 10 java/lang/String length ()I 3 21 java/lang/AbstractStringBuilder ensureCapacityInternal (I)V 4 17 java/lang/AbstractStringBuilder newCapacity (I)I 4 20 java/util/Arrays copyOf ([CI)[C 3 35 java/lang/String getChars (II[CI)V 1 581 java/lang/String length ()I 1 623 java/lang/String length ()I 1 637 java/lang/String length ()I 1 640 java/lang/StringBuilder append (Ljava/lang/CharSequence;II)Ljava/lang/StringBuilder; 2 4 java/lang/AbstractStringBuilder append (Ljava/lang/CharSequence;II)Ljava/lang/AbstractStringBuilder; 3 18 java/lang/String length ()I 3 89 java/lang/AbstractStringBuilder ensureCapacityInternal (I)V 4 17 java/lang/AbstractStringBuilder newCapacity (I)I 4 20 java/util/Arrays copyOf ([CI)[C 3 116 java/lang/String charAt (I)C 1 646 java/lang/StringBuilder toString ()Ljava/lang/String; 2 13 java/lang/String ([CII)V 3 1 java/lang/Object ()V 3 75 java/util/Arrays copyOfRange ([CII)[C diff --git a/ace-ws-rest/src/main/java/com/arrebol/apc/ws/administration/ClosingDayWS.java b/ace-ws-rest/src/main/java/com/arrebol/apc/ws/administration/ClosingDayWS.java new file mode 100644 index 0000000..27d9cd5 --- /dev/null +++ b/ace-ws-rest/src/main/java/com/arrebol/apc/ws/administration/ClosingDayWS.java @@ -0,0 +1,124 @@ +/* + * 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.ws.administration; + +import com.arrebol.apc.controller.mobile.controller.admin.ClosingDayController; +import com.arrebol.apc.controller.mobile.controller.admin.StableSmallBoxController; +import com.arrebol.apc.controller.mobile.controller.bitacora.BitacoraController; +import com.arrebol.apc.controller.mobile.json.loan.GenericAPCResponserJaxb; +import java.io.Serializable; +import javax.ws.rs.FormParam; +import javax.ws.rs.GET; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Path("closing-days") +public class ClosingDayWS implements Serializable { + + @PUT + @Path("delete-closing-day") + @Produces(MediaType.APPLICATION_JSON) + public Response deleteClosingDay(@FormParam("id") String idClosingDay, + @FormParam("updatedBy") String updatedBy, + @FormParam("office") String office) { + Response response; + ClosingDayController controller = new ClosingDayController(); + StableSmallBoxController smallBoxController = new StableSmallBoxController(); + GenericAPCResponserJaxb apcResponse = new GenericAPCResponserJaxb(); + try { + if (!smallBoxController.existStableSmallBoxByCreatedOn(office)) { + if (controller.disableClosingDayById(idClosingDay, updatedBy)) { + BitacoraController bitacoraController = new BitacoraController(); + + if (bitacoraController.insertBitacoraRecord("Eliminar corte del dĆ­a", "APK", "Se borro el corte de dĆ­a por administrador desde el celular", updatedBy, office, "Borrado desde la aplicaciĆ³n mĆ³vil")) { + apcResponse.setSuccessful(Boolean.TRUE); + apcResponse.setEnabledSubmit(Boolean.FALSE); + apcResponse.setMessage("Se borro el corte del dĆ­a."); + response = Response.ok().entity(apcResponse).build(); + } else { + apcResponse.setSuccessful(Boolean.FALSE); + apcResponse.setEnabledSubmit(Boolean.FALSE); + apcResponse.setMessage("Error al guardar la bitacora. Contacte a su supervisor."); + response = Response.ok().entity(apcResponse).build(); + } + } else { + apcResponse.setSuccessful(Boolean.FALSE); + apcResponse.setEnabledSubmit(Boolean.FALSE); + apcResponse.setMessage("No se borro el corte del dĆ­a."); + response = Response.ok().entity(apcResponse).build(); + } + } else { + apcResponse.setSuccessful(Boolean.FALSE); + apcResponse.setEnabledSubmit(Boolean.FALSE); + apcResponse.setMessage("Ya existe un cuadre de caja chica del dĆ­a, el corte del dĆ­a no puede ser borrado."); + response = Response.ok().entity(apcResponse).build(); + } + } catch (Exception e) { + apcResponse.setSuccessful(Boolean.FALSE); + apcResponse.setEnabledSubmit(Boolean.FALSE); + apcResponse.setMessage("Hubo un error al intentar borrar el corte del dĆ­a. Notifique a su supervisor."); + response = Response.ok().entity(apcResponse).build(); + logger.error("deleteClosingDay", e); + + } + return response; + } + + @GET + @Path("find-closing-day") + @Produces(MediaType.APPLICATION_JSON) + public Response findClosingDayByEmployeeAndOffice(@QueryParam("employee") String idEmployee, + @QueryParam("office") String idOffice) { + Response response; + ClosingDayController controller = new ClosingDayController(); + StableSmallBoxController smallBoxController = new StableSmallBoxController(); + GenericAPCResponserJaxb apcResponse = new GenericAPCResponserJaxb(); + try { + if (!smallBoxController.existStableSmallBoxByCreatedOn(idOffice)) { + String id = controller.findIdClosingDayByEmployee(idEmployee, idOffice); + if (null != id && id.length() == 36) { + apcResponse.setSuccessful(Boolean.TRUE); + apcResponse.setEnabledSubmit(Boolean.TRUE); + apcResponse.setIdClosingDay(id); + apcResponse.setMessage("Corte del dĆ­a encontrado."); + response = Response.ok(apcResponse).build(); + } else { + apcResponse.setSuccessful(Boolean.FALSE); + apcResponse.setEnabledSubmit(Boolean.FALSE); + apcResponse.setMessage("Corte del dĆ­a del usuario seleccionado no existente."); + response = Response.ok(apcResponse).build(); + } + } else { + apcResponse.setSuccessful(Boolean.FALSE); + apcResponse.setEnabledSubmit(Boolean.FALSE); + apcResponse.setMessage("No se pude seleccionar el corte del dĆ­a porque ya exite un corte de caja chica."); + response = Response.ok(apcResponse).build(); + } + } catch (Exception e) { + apcResponse.setSuccessful(Boolean.FALSE); + apcResponse.setEnabledSubmit(Boolean.FALSE); + apcResponse.setMessage("Hubo un error obteniendo el corte del dĆ­a. Contacte a su administrador."); + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + logger.error("updatePaidFeesStatusInLoanDetailIds", e); + + } + return response; + } + + final Logger logger = LogManager.getLogger(getClass()); +} diff --git a/ace-ws-rest/src/main/java/com/arrebol/apc/ws/administration/SmallBoxWS.java b/ace-ws-rest/src/main/java/com/arrebol/apc/ws/administration/SmallBoxWS.java new file mode 100644 index 0000000..f9c5b70 --- /dev/null +++ b/ace-ws-rest/src/main/java/com/arrebol/apc/ws/administration/SmallBoxWS.java @@ -0,0 +1,122 @@ +/* + * 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.ws.administration; + +import com.arrebol.apc.controller.mobile.controller.admin.StableGeneralBoxController; +import com.arrebol.apc.controller.mobile.controller.admin.StableSmallBoxController; +import com.arrebol.apc.controller.mobile.controller.bitacora.BitacoraController; +import com.arrebol.apc.controller.mobile.json.loan.GenericAPCResponserJaxb; +import java.io.Serializable; +import javax.ws.rs.FormParam; +import javax.ws.rs.GET; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Path("small-boxes") +public class SmallBoxWS implements Serializable { + + @PUT + @Path("delete-small-box") + @Produces(MediaType.APPLICATION_JSON) + public Response deleteSmallBox(@FormParam("id") String idSmallBox, + @FormParam("updatedBy") String updatedBy, + @FormParam("office") String office) { + Response response; + StableSmallBoxController smallBoxController = new StableSmallBoxController(); + StableGeneralBoxController generalBoxController = new StableGeneralBoxController(); + GenericAPCResponserJaxb apcResponse = new GenericAPCResponserJaxb(); + try { + if (!generalBoxController.existStableGeneralBoxByCreatedOn(office)) { + if (smallBoxController.disableIdSmallBoxById(idSmallBox, updatedBy)) { + BitacoraController bitacoraController = new BitacoraController(); + + if (bitacoraController.insertBitacoraRecord("Eliminar cuadre de caja chica", "APK", "Se borro el corte de caja chica por administrador desde el celular", updatedBy, office, "Borrado desde la aplicaciĆ³n mĆ³vil")) { + apcResponse.setSuccessful(Boolean.TRUE); + apcResponse.setEnabledSubmit(Boolean.FALSE); + apcResponse.setMessage("Se borro el corte de caja chica."); + response = Response.ok().entity(apcResponse).build(); + } else { + apcResponse.setSuccessful(Boolean.FALSE); + apcResponse.setEnabledSubmit(Boolean.FALSE); + apcResponse.setMessage("Error al guardar la bitacora. Contacte a su supervisor."); + response = Response.ok().entity(apcResponse).build(); + } + } else { + apcResponse.setSuccessful(Boolean.FALSE); + apcResponse.setEnabledSubmit(Boolean.FALSE); + apcResponse.setMessage("No se borro el corte de caja chica."); + response = Response.ok().entity(apcResponse).build(); + } + } else { + apcResponse.setSuccessful(Boolean.FALSE); + apcResponse.setEnabledSubmit(Boolean.FALSE); + apcResponse.setMessage("Ya existe un cuadre de caja general del dĆ­a, el corte de caja chica no puede ser borrado."); + response = Response.ok().entity(apcResponse).build(); + } + } catch (Exception e) { + apcResponse.setSuccessful(Boolean.FALSE); + apcResponse.setEnabledSubmit(Boolean.FALSE); + apcResponse.setMessage("Hubo un error al intentar borrar el corte de caja chica. Notifique a su supervisor."); + response = Response.ok().entity(apcResponse).build(); + logger.error("deleteSmallBox", e); + + } + return response; + } + + @GET + @Path("find-small-box") + @Produces(MediaType.APPLICATION_JSON) + public Response findSmallBoxByOffice(@QueryParam("office") String idOffice) { + Response response; + StableSmallBoxController smallBoxController = new StableSmallBoxController(); + StableGeneralBoxController generalBoxController = new StableGeneralBoxController(); + GenericAPCResponserJaxb apcResponse = new GenericAPCResponserJaxb(); + try { + if (!generalBoxController.existStableGeneralBoxByCreatedOn(idOffice)) { + String id = smallBoxController.findIdStableSmallBoxByOfficeInCurrentDate(idOffice); + if (null != id && id.length() == 36) { + apcResponse.setSuccessful(Boolean.TRUE); + apcResponse.setEnabledSubmit(Boolean.TRUE); + apcResponse.setIdSmallBox(id); + apcResponse.setMessage("Corte de caja chica encontrado."); + response = Response.ok(apcResponse).build(); + } else { + apcResponse.setSuccessful(Boolean.FALSE); + apcResponse.setEnabledSubmit(Boolean.FALSE); + apcResponse.setMessage("Corte de caja chica no existente."); + response = Response.ok(apcResponse).build(); + } + } else { + apcResponse.setSuccessful(Boolean.FALSE); + apcResponse.setEnabledSubmit(Boolean.FALSE); + apcResponse.setMessage("No se pude seleccionar el corte de caja chica porque ya exite un corte general."); + response = Response.ok(apcResponse).build(); + } + } catch (Exception e) { + apcResponse.setSuccessful(Boolean.FALSE); + apcResponse.setEnabledSubmit(Boolean.FALSE); + apcResponse.setMessage("Hubo un error onteniendo la caja chica. Contacte a su administrador."); + response = Response.status(Response.Status.NOT_ACCEPTABLE).entity(apcResponse).build(); + logger.error("findSmallBoxByOffice", e); + } + return response; + } + + final Logger logger = LogManager.getLogger(getClass()); +} diff --git a/ace-ws-rest/src/main/java/com/arrebol/apc/ws/cash/CashRegisterWS.java b/ace-ws-rest/src/main/java/com/arrebol/apc/ws/cash/CashRegisterWS.java new file mode 100644 index 0000000..3a6aea2 --- /dev/null +++ b/ace-ws-rest/src/main/java/com/arrebol/apc/ws/cash/CashRegisterWS.java @@ -0,0 +1,82 @@ +/* + * 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.ws.cash; + +import com.arrebol.apc.controller.mobile.controller.cash.CashRegisterCurdateByUserController; +import java.io.Serializable; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Path("cashRegister") +public class CashRegisterWS implements Serializable { + + @GET + @Path("findAllBy") + @Produces(MediaType.APPLICATION_JSON) + public Response findAllCashRegisterCurdateByUserId(@QueryParam("id") String userId) { + logger.debug("findAllCashRegisterCurdateByUserId"); + + Response response; + try { + if (null == userId) { + throw new NullPointerException("Id is null"); + } + + response = Response.ok( + cashRegisterCurdateByUserController.findAllCashRegisterCurdateByUserId(userId) + ).build(); + } catch (Exception e) { + logger.error("findAllCashRegisterCurdateByUserId", e); + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + + return response; + } + + @GET + @Path("findDailyTotals") + @Produces(MediaType.APPLICATION_JSON) + public Response findDailyTotalsByUserId(@QueryParam("id") String userId) { + logger.debug("findDailyTotalsByUserId"); + + Response response; + try { + if (null == userId) { + throw new NullPointerException("Id is null"); + } + + response = Response.ok( + cashRegisterCurdateByUserController.findDailyTotalsByUserId(userId) + ).build(); + } catch (Exception e) { + logger.error("findDailyTotalsByUserId", e); + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + + return response; + } + + private static final long serialVersionUID = 5664587426544509670L; + final Logger logger = LogManager.getLogger(CashRegisterWS.class); + private final CashRegisterCurdateByUserController cashRegisterCurdateByUserController; + + public CashRegisterWS() { + this.cashRegisterCurdateByUserController = new CashRegisterCurdateByUserController(); + } + +} diff --git a/ace-ws-rest/src/main/java/com/arrebol/apc/ws/cfg/ApplicationCfg.java b/ace-ws-rest/src/main/java/com/arrebol/apc/ws/cfg/ApplicationCfg.java new file mode 100644 index 0000000..9cbedc7 --- /dev/null +++ b/ace-ws-rest/src/main/java/com/arrebol/apc/ws/cfg/ApplicationCfg.java @@ -0,0 +1,51 @@ +/* + * 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.ws.cfg; + +import javax.ws.rs.ApplicationPath; +import org.glassfish.jersey.media.multipart.MultiPartFeature; +import org.glassfish.jersey.moxy.json.MoxyJsonFeature; +import org.glassfish.jersey.server.ResourceConfig; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@ApplicationPath("/resource") +public class ApplicationCfg extends ResourceConfig { + + public ApplicationCfg() { + packages(buildPackages()) + .register(MoxyJsonFeature.class) + .register(JsonMoxyConfigurationContextResolver.class) + .register(MultiPartFeature.class); + } + + private String buildPackages() { + StringBuilder builder = new StringBuilder(); + + builder.append("org.glassfish.jersey.examples.multipart;"); + builder.append("com.arrebol.apc.ws.login;"); + builder.append("com.arrebol.apc.ws.preferences;"); + builder.append("com.arrebol.apc.ws.customer;"); + builder.append("com.arrebol.apc.ws.search;"); + builder.append("com.arrebol.apc.ws.loan;"); + builder.append("com.arrebol.apc.ws.cash;"); + builder.append("com.arrebol.apc.ws.exchange;"); + builder.append("com.arrebol.apc.ws.otherexpense;"); + builder.append("com.arrebol.apc.ws.reports;"); + builder.append("com.arrebol.apc.ws.gasoline;"); + builder.append("com.arrebol.apc.ws.person;"); + builder.append("com.arrebol.apc.ws.route;"); + builder.append("com.arrebol.apc.ws.employee;"); + builder.append("com.arrebol.apc.ws.user;"); + builder.append("com.arrebol.apc.ws.administration;"); + + return builder.toString(); + } +} diff --git a/ace-ws-rest/src/main/java/com/arrebol/apc/ws/cfg/JsonMoxyConfigurationContextResolver.java b/ace-ws-rest/src/main/java/com/arrebol/apc/ws/cfg/JsonMoxyConfigurationContextResolver.java new file mode 100644 index 0000000..3824757 --- /dev/null +++ b/ace-ws-rest/src/main/java/com/arrebol/apc/ws/cfg/JsonMoxyConfigurationContextResolver.java @@ -0,0 +1,45 @@ +/* + * 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.ws.cfg; + +import java.util.HashMap; +import java.util.Map; +import javax.ws.rs.ext.ContextResolver; +import javax.ws.rs.ext.Provider; +import org.eclipse.persistence.jaxb.JAXBContextProperties; +import org.glassfish.jersey.moxy.json.MoxyJsonConfig; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Provider +public class JsonMoxyConfigurationContextResolver implements ContextResolver { + + private final MoxyJsonConfig config; + + public JsonMoxyConfigurationContextResolver() { + final Map namespacePrefixMapper = new HashMap<>(); + namespacePrefixMapper.put("http://www.w3.org/2001/XMLSchema-instance", "xsi"); + + config = new MoxyJsonConfig() + .setNamespacePrefixMapper(namespacePrefixMapper) + .setNamespaceSeparator(':') + .setAttributePrefix("") + .setValueWrapper("value") + .property(JAXBContextProperties.JSON_WRAPPER_AS_ARRAY_NAME, true) + .setFormattedOutput(true) + .setIncludeRoot(true) + .setMarshalEmptyCollections(true); + } + + @Override + public MoxyJsonConfig getContext(Class objectType) { + return config; + } +} diff --git a/ace-ws-rest/src/main/java/com/arrebol/apc/ws/customer/CustomerWS.java b/ace-ws-rest/src/main/java/com/arrebol/apc/ws/customer/CustomerWS.java new file mode 100644 index 0000000..027926c --- /dev/null +++ b/ace-ws-rest/src/main/java/com/arrebol/apc/ws/customer/CustomerWS.java @@ -0,0 +1,59 @@ +/* + * 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.ws.customer; + +import com.arrebol.apc.controller.mobile.controller.customer.CustomerController; +import com.arrebol.apc.model.views.LoanByUserView; +import java.io.Serializable; +import java.util.List; +import javax.ws.rs.FormParam; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.GenericEntity; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Path("customer") +public class CustomerWS implements Serializable { + + private static final long serialVersionUID = -5280895557294295716L; + + @POST + @Path("list") + @Produces(MediaType.APPLICATION_JSON) + public Response findAllLoansByUserId(@FormParam("orderList") String orderList, @FormParam("userId") String userId) { + logger.debug("findAllLoansByUserId"); + + Response response; + try { + GenericEntity> list = new GenericEntity>(controller.findAllLoansByUserId(orderList, userId)) { + }; + + response = Response.ok(list).build(); + } catch (Exception e) { + logger.error("findAllLoansByUserId", e); + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + return response; + } + + final Logger logger = LogManager.getLogger(CustomerWS.class); + private final CustomerController controller; + + public CustomerWS() { + this.controller = new CustomerController(); + } + +} diff --git a/ace-ws-rest/src/main/java/com/arrebol/apc/ws/employee/EmployeeWS.java b/ace-ws-rest/src/main/java/com/arrebol/apc/ws/employee/EmployeeWS.java new file mode 100644 index 0000000..d7ad022 --- /dev/null +++ b/ace-ws-rest/src/main/java/com/arrebol/apc/ws/employee/EmployeeWS.java @@ -0,0 +1,49 @@ +/* + * 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.ws.employee; + +import com.arrebol.apc.controller.mobile.controller.tracking.PaymentTrackingController; +import com.arrebol.apc.controller.mobile.moxy.views.PaymentTrackingViewJaxb; +import java.io.Serializable; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Path("employee") +public class EmployeeWS implements Serializable { + + @GET + @Path("payment-traking") + @Produces(MediaType.APPLICATION_JSON) + public Response paymentTraking(@QueryParam("id") String userId, @QueryParam("office") String officeId) { + logger.debug("paymentTraking"); + Response response; + try { + PaymentTrackingController controller = new PaymentTrackingController(); + PaymentTrackingViewJaxb paymentTracking = controller.paymentTrakingByUserDetails(userId, officeId); + + response = Response.ok(paymentTracking).build(); + } catch (Exception e) { + logger.error("paymentTraking", e); + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + return response; + } + + private static final long serialVersionUID = -4827528662562714898L; + final Logger logger = LogManager.getLogger(EmployeeWS.class); +} diff --git a/ace-ws-rest/src/main/java/com/arrebol/apc/ws/exchange/ExchangeWS.java b/ace-ws-rest/src/main/java/com/arrebol/apc/ws/exchange/ExchangeWS.java new file mode 100644 index 0000000..95840ef --- /dev/null +++ b/ace-ws-rest/src/main/java/com/arrebol/apc/ws/exchange/ExchangeWS.java @@ -0,0 +1,143 @@ +/* + * 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.ws.exchange; + +import com.arrebol.apc.controller.mobile.controller.exchange.ExchangeEnebledUsersController; +import com.arrebol.apc.controller.mobile.controller.preference.SystemPreferenceController; +import com.arrebol.apc.model.views.ExchangeEnebledUsersView; +import com.arrebol.apc.model.ws.parsed.Exchange; +import com.arrebol.apc.model.ws.parsed.ExchangeJaxb; +import java.io.Serializable; +import java.util.List; +import javax.ws.rs.Consumes; +import javax.ws.rs.FormParam; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.GenericEntity; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Path("exchange") +public class ExchangeWS implements Serializable { + + @GET + @Path("availableUsers") + @Produces(MediaType.APPLICATION_JSON) + public Response availableUsers(@QueryParam("id") String userId, @QueryParam("office") String officeId) { + logger.debug("availableUsers"); + Response response; + try { + GenericEntity> results + = new GenericEntity>( + exchangeEnebledUsersController.findEnebledUsersToUserId(userId, officeId) + ) { + }; + + response = Response.ok(results).build(); + } catch (Exception e) { + logger.error("availableUsers", e); + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + return response; + } + + @PUT + @Path("newExchange") + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + public Response newExchange(ExchangeJaxb exchange) { + logger.debug("newExchange"); + Response response; + try { + if (systemPreferenceController.findConfigurationButton(exchange.getSenderId(), exchange.getOfficeId()).isActiveButton()) { + if (exchangeEnebledUsersController.newExchange(exchange)) { + response = Response.ok().build(); + } else { + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + } else { + response = Response.status(Response.Status.CONFLICT).build(); + } + + } catch (Exception e) { + logger.error("newExchange", e); + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + return response; + } + + @POST + @Path("updateExchange") + @Produces(MediaType.APPLICATION_JSON) + public Response updateExchange( + @FormParam(value = "transfer") String transfer, + @FormParam(value = "user") String user, + @FormParam(value = "office") String office, + @FormParam(value = "action") boolean isApproved) { + logger.debug("updateExchange"); + Response response; + try { + if (systemPreferenceController.findConfigurationButton(user, office).isActiveButton()) { + if (exchangeEnebledUsersController.updateExchange(transfer, user, isApproved)) { + response = Response.ok().build(); + } else { + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + } else { + response = Response.status(Response.Status.CONFLICT).build(); + } + } catch (Exception e) { + logger.error("updateExchange", e); + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + return response; + } + + @GET + @Path("allBy") + @Produces(MediaType.APPLICATION_JSON) + public Response exchangesByUsers(@QueryParam("id") String userId) { + logger.debug("availableUsers"); + Response response; + try { + GenericEntity> results + = new GenericEntity>( + exchangeEnebledUsersController.exchangesByUsers(userId) + ) { + }; + + response = Response.ok(results).build(); + } catch (Exception e) { + logger.error("availableUsers", e); + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + return response; + } + + private static final long serialVersionUID = -4827528662562714897L; + final Logger logger = LogManager.getLogger(ExchangeWS.class); + + private final ExchangeEnebledUsersController exchangeEnebledUsersController; + private final SystemPreferenceController systemPreferenceController; + + public ExchangeWS() { + this.exchangeEnebledUsersController = new ExchangeEnebledUsersController(); + this.systemPreferenceController = new SystemPreferenceController(); + } + +} diff --git a/ace-ws-rest/src/main/java/com/arrebol/apc/ws/gasoline/GasolineWS.java b/ace-ws-rest/src/main/java/com/arrebol/apc/ws/gasoline/GasolineWS.java new file mode 100644 index 0000000..a898df3 --- /dev/null +++ b/ace-ws-rest/src/main/java/com/arrebol/apc/ws/gasoline/GasolineWS.java @@ -0,0 +1,76 @@ +/* + * 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.ws.gasoline; + +import com.arrebol.apc.controller.mobile.controller.gasoline.GasolineController; +import com.arrebol.apc.model.catalog.RouteCtlg; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.core.User; +import com.arrebol.apc.model.enums.GenericStatus; +import com.arrebol.apc.model.gasoline.Gasoline; +import java.io.Serializable; +import java.util.Date; +import java.util.UUID; +import javax.ws.rs.FormParam; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Path("gasoline") +public class GasolineWS implements Serializable { + + @PUT + @Path("save-new-gasoline-payment") + @Produces(MediaType.APPLICATION_JSON) + public Response saveNewGasolinePayment(@FormParam("idUser") String idUser, + @FormParam("idOffice") String idOffice, + @FormParam("idRoute") String idRoute, + @FormParam("total") Double total, + @FormParam("km") Double km, + @FormParam("quantity") Double quantity, + @FormParam("description") String description) { + Response response; + try { + GasolineController controller = new GasolineController(); + + Gasoline gasoline = new Gasoline( + UUID.randomUUID().toString(), + new User(idUser), + new Office(idOffice), + new RouteCtlg(idRoute), + quantity, + km, + total, + GenericStatus.ENABLED, + description, + idUser, + new Date()); + + if (controller.saveNewGasolinePayment(gasoline)) { + response = Response.ok().build(); + } else { + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + } catch (Exception e) { + logger.error("saveNewGasolineEntry"); + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + return response; + } + + private static final long serialVersionUID = -5280895557294295916L; + final Logger logger = LogManager.getLogger(getClass()); +} diff --git a/ace-ws-rest/src/main/java/com/arrebol/apc/ws/loan/LoanWS.java b/ace-ws-rest/src/main/java/com/arrebol/apc/ws/loan/LoanWS.java new file mode 100644 index 0000000..2985e3c --- /dev/null +++ b/ace-ws-rest/src/main/java/com/arrebol/apc/ws/loan/LoanWS.java @@ -0,0 +1,830 @@ +/* + * 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.ws.loan; + +import com.arrebol.apc.controller.mobile.controller.loan.LoanController; +import com.arrebol.apc.controller.mobile.controller.preference.SystemPreferenceController; +import com.arrebol.apc.controller.mobile.json.loan.AuthorizeTransferList; +import com.arrebol.apc.controller.mobile.json.loan.AuthorizeTransferPaymentsDto; +import com.arrebol.apc.controller.mobile.json.loan.DeleteLoanDetailsJaxb; +import com.arrebol.apc.controller.mobile.json.loan.GenericAPCResponserJaxb; +import com.arrebol.apc.controller.mobile.json.loan.UpdateLoanToDeliveryStatusDTO; +import com.arrebol.apc.controller.mobile.json.loan.UpdateLoanToDeliveryStatusList; +import com.arrebol.apc.model.core.Office; +import com.arrebol.apc.model.enums.ComissionType; +import com.arrebol.apc.model.enums.LoanStatus; +import com.arrebol.apc.model.enums.TransferStatus; +import com.arrebol.apc.model.loan.Loan; +import com.arrebol.apc.model.loan.LoanDetails; +import com.arrebol.apc.model.system.logs.Bitacora; +import com.arrebol.apc.model.ws.parsed.LoanRequestedJaxb; +import com.arrebol.apc.model.views.AvailableCustomersView; +import com.arrebol.apc.model.views.AvailableEndorsementsView; +import com.arrebol.apc.model.views.LoanToDeliveryByCertifierView; +import com.arrebol.apc.model.ws.parsed.FeesToPayByLoanRequestJaxb; +import com.arrebol.apc.model.ws.parsed.LoanDetailJaxb; +import com.arrebol.apc.model.ws.parsed.NewAmountJaxb; +import com.arrebol.apc.model.ws.parsed.NewTransferAccountJaxb; +import com.arrebol.apc.model.ws.parsed.RenovationWithEndorsementJaxb; +import com.arrebol.apc.model.ws.parsed.ThumbnailJaxb; +import java.io.InputStream; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import javax.ws.rs.Consumes; +import javax.ws.rs.FormParam; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.GenericEntity; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.glassfish.jersey.media.multipart.FormDataContentDisposition; +import org.glassfish.jersey.media.multipart.FormDataParam; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Path("loan") +public class LoanWS implements Serializable { + + private static final long serialVersionUID = -5416113076264972459L; + + @GET + @Path("findAllLoans") + @Produces(MediaType.APPLICATION_JSON) + public Response findAllLoanTypeByOffice(@QueryParam("id") String id) { + logger.debug("updateOrderInList"); + Response response; + try { + response = Response.ok(loanController.findAllLoanTypeByOffice(id)).build(); + } catch (Exception e) { + logger.error("updateOrderInList", e); + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + return response; + } + + @GET + @Path("findAllAvailableCustomersByType") + @Produces(MediaType.APPLICATION_JSON) + public Response findAllAvailableCustomersByType(@QueryParam("name") String name) { + logger.debug("findAllAvailableCustomersByType"); + Response response; + try { + GenericEntity> results + = new GenericEntity>( + loanController.findAllAvailableCustomersByType("%" + name + "%")) { + }; + + response = Response.ok(results).build(); + } catch (Exception e) { + logger.error("findAllAvailableCustomersByType", e); + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + return response; + } + + @GET + @Path("find-fees-to-pay-by-loan-id") + @Produces(MediaType.APPLICATION_JSON) + public Response findFeesToPayByLoanId(@QueryParam("idLoan") String idLoan) { + logger.debug("findFeesToPayByLoanId"); + Response response; + try { + GenericEntity> results + = new GenericEntity>( + loanController.findFeesToPayByLoanId(idLoan)) { + }; + + response = Response.ok(results).build(); + } catch (Exception e) { + logger.error("findFeesToPayByLoanId", e); + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + return response; + } + + @PUT + @Path("update-paid-fees-status-in-loan-detail-ids") + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + public Response updatePaidFeesStatusInLoanDetailIds(FeesToPayByLoanRequestJaxb feesToPayByLoanRequestJaxb) { + logger.debug("updatePaidFeesStatusInLoanDetailIds"); + + Response response; + try { + if (loanController.updatePaidFeesStatusInLoanDetailIds(feesToPayByLoanRequestJaxb)) { + response = Response.ok().build(); + } else { + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + } catch (Exception e) { + if (e.getMessage().contains("User unavailable to this operation")) { + response = Response.status(Response.Status.CONFLICT).build(); + } else { + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + logger.error("updatePaidFeesStatusInLoanDetailIds", e); + + } + return response; + } + + @GET + @Path("findAllAvailableEndorsementsByType") + @Produces(MediaType.APPLICATION_JSON) + public Response findAllAvailableEndorsementsByType(@QueryParam("name") String name) { + logger.debug("findAllAvailableEndorsementsByType"); + Response response; + try { + GenericEntity> results + = new GenericEntity>( + loanController.findAllAvailableEndorsementsByType("%" + name + "%")) { + }; + + response = Response.ok(results).build(); + } catch (Exception e) { + logger.error("findAllAvailableEndorsementsByType", e); + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + return response; + } + + @PUT + @Path("create") + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + public Response createLoan(LoanRequestedJaxb loan) { + logger.debug("createLoan"); + + Response response; + try { + if (loanController.createLoan(loan)) { + response = Response.ok().build(); + } else { + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + } catch (Exception e) { + if (e.getMessage().contains("User unavailable to this operation")) { + response = Response.status(Response.Status.CONFLICT).build(); + } else { + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + logger.error("createLoan", e); + + } + return response; + } + + @PUT + @Path("create-with-image") + @Consumes(MediaType.MULTIPART_FORM_DATA) + @Produces(MediaType.APPLICATION_JSON) + public Response createLoanWithImage( + // LoanRequestedJaxb loan, + @FormDataParam("thumbnail") ThumbnailJaxb thumbnail, + @FormDataParam("thumbnail") FormDataContentDisposition thumbnailMetaData) { + logger.debug("createLoan"); + + Response response; + try { + if (true/*loanController.createLoan(loan)*/) { + response = Response.ok().build(); + } else { + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + } catch (Exception e) { + if (e.getMessage().contains("User unavailable to this operation")) { + response = Response.status(Response.Status.CONFLICT).build(); + } else { + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + logger.error("createLoan", e); + + } + return response; + } + + @PUT + @Path("create-with-image2") + @Consumes(MediaType.MULTIPART_FORM_DATA) + @Produces(MediaType.APPLICATION_JSON) + public Response createLoanWithImage2( + // LoanRequestedJaxb loan, + @FormDataParam("file") InputStream file, + @FormDataParam("file") FormDataContentDisposition fileDisposition) { + logger.debug("createLoan"); + + Response response; + try { + if (true/*loanController.createLoan(loan)*/) { + response = Response.ok().build(); + } else { + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + } catch (Exception e) { + if (e.getMessage().contains("User unavailable to this operation")) { + response = Response.status(Response.Status.CONFLICT).build(); + } else { + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + logger.error("createLoan", e); + + } + return response; + } + + @POST + @Path("saveNewAmount") + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + public Response saveNewAmount(NewAmountJaxb newAmountJaxb) { + logger.debug("saveNewAmount"); + Response response; + try { + if (newAmountJaxb.getAmount().compareTo(BigDecimal.ZERO) <= 0 && !newAmountJaxb.getManager()) { + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } else { + if (systemPreferenceController.findConfigurationButton(newAmountJaxb.getUserId(), newAmountJaxb.getOfficeId()).isActiveButton()) { + + if (loanController.saveNewAmount(newAmountJaxb)) { + response = Response.ok().build(); + } else { + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + } else { + response = Response.status(Response.Status.CONFLICT).build(); + } + } + } catch (Exception e) { + logger.error("saveNewAmount", e); + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + return response; + } + + @POST + @Path("saveNewTransferAccount") + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + public Response saveNewTransferAccount(NewTransferAccountJaxb transfer) { + logger.debug("saveNewTransferAccount"); + Response response; + try { + if (transfer.getAmount().compareTo(BigDecimal.ZERO) <= 0 && !transfer.getManager()) { + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } else { + if (systemPreferenceController.findConfigurationButton(transfer.getUserId(), transfer.getOfficeId()).isActiveButton()) { + + if (loanController.saveNewTransferAmount(transfer)) { + response = Response.ok().build(); + } else { + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + } else { + response = Response.status(Response.Status.CONFLICT).build(); + } + } + } catch (Exception e) { + logger.error("saveNewTransferAccount", e); + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + return response; + } + + @GET + @Path("findNewCreditLimit") + @Produces(MediaType.APPLICATION_JSON) + public Response findNewCreditLimit(@QueryParam("office") String office, @QueryParam("loan") String loan) { + logger.debug("findNewCreditLimit"); + Response response; + try { + /** + * This method is for get all loan types applying some business + * rules, like number of Fees and if you are ok in 100% you can get + * next loan. + */ + //response = Response.ok(loanController.findNewCreditLimit(office, loan)).build(); + response = Response.ok(loanController.findAllLoansTypeByOffice(office)).build(); + } catch (Exception e) { + logger.error("findNewCreditLimit", e); + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + return response; + } + + @PUT + @Path("renovation") + @Produces(MediaType.APPLICATION_JSON) + public Response renovation( + @FormParam("loan") String loan, + @FormParam("credit") String credit, + @FormParam("user") String user, + @FormParam("office") String office, + @FormParam("amount") double amount, + @FormParam("currentOwner") String currentOwner) { + logger.debug("renovation"); + + Response response; + try { + if (systemPreferenceController.findConfigurationButton(user, office).isActiveButton()) { + if (validateRenovationData(loan, credit, user)) { + if (loanController.renovation(loan, credit, user, new BigDecimal(amount), null)) { + response = Response.ok().build(); + } else { + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + } else { + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + } else { + response = Response.status(Response.Status.CONFLICT).build(); + } + } catch (Exception e) { + logger.error("renovation", e); + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + return response; + } + + @PUT + @Path("renovation-has-payment-today") + @Produces(MediaType.APPLICATION_JSON) + public Response renovationHasPaymentToday( + @FormParam("loan") String loan, + @FormParam("credit") String credit, + @FormParam("user") String user, + @FormParam("office") String office, + @FormParam("amount") double amount, + @FormParam("currentOwner") String currentOwner) { + logger.debug("renovationHasPaymentToday"); + + Response response; + try { + if (systemPreferenceController.findConfigurationButton(user, office).isActiveButton()) { + if (validateRenovationData(loan, credit, user)) { + if (loanController.renovationHasPaymentToday(loan, credit, user, new BigDecimal(amount), currentOwner, null)) { + response = Response.ok().build(); + } else { + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + } else { + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + } else { + response = Response.status(Response.Status.CONFLICT).build(); + } + } catch (Exception e) { + logger.error("renovationHasPaymentToday", e); + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + return response; + } + + @GET + @Path("deliveryList") + @Produces(MediaType.APPLICATION_JSON) + public Response deliveryList(@QueryParam("user") String userId) { + logger.debug("deliveryList"); + Response response; + try { + GenericEntity> results + = new GenericEntity< List< LoanToDeliveryByCertifierView>>( + loanController.findLoansByCertifier(userId) + ) { + }; + + response = Response.ok(results).build(); + } catch (Exception e) { + logger.error("deliveryList", e); + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + return response; + } + + @POST + @Path("certifierAction") + @Produces(MediaType.APPLICATION_JSON) + public Response certifierAction( + @FormParam(value = "id") String id, + @FormParam(value = "user") String user, + @FormParam(value = "office") String office, + @FormParam(value = "comments") String comments, + @FormParam(value = "action") boolean action, + @FormParam(value = "amount") double amount, + @FormParam(value = "discount") double discount) { + logger.debug("certifierAction"); + Response response; + try { + if (systemPreferenceController.findConfigurationButton(user, office).isActiveButton()) { + if (loanController.certifierAction(id, user, comments, action, new BigDecimal(amount), new BigDecimal(discount))) { + response = Response.ok().build(); + } else { + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + } else { + response = Response.status(Response.Status.CONFLICT).build(); + } + } catch (Exception e) { + logger.error("certifierAction", e); + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + return response; + } + + @POST + @Path("certifier-action-with-comission") + @Produces(MediaType.APPLICATION_JSON) + public Response certifierActionWithComission( + @FormParam(value = "id") String id, + @FormParam(value = "user") String user, + @FormParam(value = "office") String office, + @FormParam(value = "comments") String comments, + @FormParam(value = "action") boolean action, + @FormParam(value = "amount") double amount, + @FormParam(value = "discount") double discount, + @FormParam(value = "includeComission") boolean includeComission) { + logger.debug("certifierAction"); + Response response; + try { + if (systemPreferenceController.findConfigurationButton(user, office).isActiveButton()) { + if (loanController.certifierAction(id, user, comments, action, new BigDecimal(amount), new BigDecimal(discount), includeComission ? ComissionType.INCLUDED : ComissionType.EXCLUDED)) { + response = Response.ok().build(); + } else { + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + } else { + response = Response.status(Response.Status.CONFLICT).build(); + } + } catch (Exception e) { + logger.error("certifierAction", e); + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + return response; + } + + @GET + @Path("approved-details") + @Produces(MediaType.APPLICATION_JSON) + public Response approvedDetailsByIdLoan(@QueryParam("id") String loan) { + logger.debug("approvedDetailsByIdLoan"); + Response response; + try { + + GenericEntity> results + = new GenericEntity< List< LoanDetailJaxb>>( + loanController.approvedDetailsByIdLoan(loan) + ) { + }; + + response = Response.ok(results).build(); + } catch (Exception e) { + logger.error("approvedDetailsByIdLoan", e); + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + return response; + } + + @PUT + @Path("renovation-with-endorsement") + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + public Response renovationWithEndorsement(RenovationWithEndorsementJaxb renovation) { + logger.debug("renovationWithEndorsement"); + + Response response; + try { + if (systemPreferenceController.findConfigurationButton(renovation.getUser(), renovation.getOffice()).isActiveButton()) { + if (validateRenovationData(renovation.getLoan(), renovation.getCredit(), renovation.getUser())) { + if (renovation.isHasPaymentToday()) { + if (loanController.renovationHasPaymentToday(renovation.getLoan(), renovation.getCredit(), renovation.getUser(), new BigDecimal(renovation.getAmount()), renovation.getCurrentOwner(), renovation.getEndorsement())) { + response = Response.ok().build(); + } else { + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + } else { + if (loanController.renovation(renovation.getLoan(), renovation.getCredit(), renovation.getUser(), new BigDecimal(renovation.getAmount()), renovation.getEndorsement())) { + response = Response.ok().build(); + } else { + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + } + } else { + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + } else { + response = Response.status(Response.Status.CONFLICT).build(); + } + } catch (Exception e) { + logger.error("renovationWithEndorsement", e); + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + return response; + } + + @PUT + @Path("delete-today-payment") + @Produces(MediaType.APPLICATION_JSON) + public Response deleteTodayPayment( + @FormParam(value = "customer") String customerId, + @FormParam(value = "loan") String loanId, + @FormParam(value = "user") String userId, + @FormParam(value = "office") String office, + @FormParam(value = "comments") String comments, + @FormParam(value = "action") String action) { + logger.debug("deleteTodayPayment"); + Response response; + try { + DeleteLoanDetailsJaxb deleteLoanDetailsJaxb = loanController.enebleToDeleteTodayDetails(customerId, userId); + if (deleteLoanDetailsJaxb.getApprovedOrPendingRenovation()) { + Bitacora bitacora = new Bitacora(); + StringBuilder builder = new StringBuilder("Eliminar "); + + builder.append(("DELETE_PAYMENT".equals(action) ? "abono" : "multa")); + + bitacora.setAction(builder.toString()); + bitacora.setCommentsUser(comments); + bitacora.setCreatedBy(userId); + bitacora.setCreatedOn(new Date()); + bitacora.setNameUser("Certificador"); + bitacora.setOffice(new Office(office)); + + switch (action) { + case "DELETE_PAYMENT": + if (deleteLoanDetailsJaxb.getTodayPayment()) { + List details = loanController.getLoanDetailsCurdatebyIdLoan(loanId); + + if (details != null && !details.isEmpty()) { + + Loan loanUpdate = loanController.getLoanById(loanId); + BigDecimal tempMonto = BigDecimal.ZERO; + + for (LoanDetails detail : details) { + loanUpdate.setAmountPaid(loanUpdate.getAmountPaid().subtract(detail.getPaymentAmount())); + loanUpdate.setLastReferenceNumber(loanUpdate.getLastReferenceNumber() - 1); + tempMonto = tempMonto.add(detail.getPaymentAmount()); + } + + bitacora.setDescription("Un abono del cliente " + loanUpdate.getCustomer().getFullName() + " se borro desde la APP Movil monto $" + tempMonto.toString()); + + if (loanController.deleteLoanDetailsByLoanCurdate(new Loan(loanId))) { + Date date = new Date(); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.add(Calendar.DAY_OF_YEAR, -1); + date = calendar.getTime(); + loanUpdate.setLastUpdatedOn(date); + + loanController.updateLoan(loanUpdate); + + //bitacoraCtrl.saveBitacora(bitacora); + } + } + response = Response.ok().build(); + } else { + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + break; + case "DELETE_FEE": + if (deleteLoanDetailsJaxb.getTodayFee()) { + + List details = loanController.getLoanDetailsFeeCurdatebyIdLoan(loanId); + + if (details != null && !details.isEmpty()) { + Loan loanUpdate = loanController.getLoanById(loanId); + BigDecimal tempMonto = BigDecimal.ZERO; + + for (LoanDetails detail : details) { + loanUpdate.setAmountToPay(loanUpdate.getAmountToPay().subtract(detail.getPaymentAmount())); + tempMonto = tempMonto.add(detail.getPaymentAmount()); + } + bitacora.setDescription("Una multa del cliente " + loanUpdate.getCustomer().getFullName() + " se borro desde la APP Movil monto $" + tempMonto.toString()); + if (loanController.deleteLoanDetailsFeeByLoanCurdate(loanId)) { + loanController.deleteLoanFeeNotificationByLoanCurdate(loanId); + + Date date = new Date(); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.add(Calendar.DAY_OF_YEAR, -1); + date = calendar.getTime(); + loanUpdate.setLastUpdatedOn(date); + + loanController.updateLoan(loanUpdate); + //bitacoraCtrl.saveBitacora(bitacora); + } + } + response = Response.ok().build(); + } else { + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + break; + default: + response = Response.ok().build(); + } + } else { + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + } catch (Exception e) { + logger.error("deleteTodayPayment"); + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + + return response; + } + + @GET + @Path("eneble-to-delete-today-details") + @Produces(MediaType.APPLICATION_JSON) + public Response enebleToDeleteTodayDetails(@QueryParam("id") String customerId, @QueryParam("user") String userId) { + logger.debug("enebleToDeleteTodayDetails"); + Response response; + try { + response = Response.ok(loanController.enebleToDeleteTodayDetails(customerId, userId)).build(); + } catch (Exception e) { + logger.error("enebleToDeleteTodayDetails"); + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + + return response; + } + + @PUT + @Path("update-loan-type-by-loan-id") + @Produces(MediaType.APPLICATION_JSON) + public Response updateLoanTypeByLoanId(@FormParam("idLoan") String idLoan, + @FormParam("idLoanType") String idLoanType) { + Response response; + GenericAPCResponserJaxb apcResponse = new GenericAPCResponserJaxb(); + try { + if (loanController.updatePaymentTotalLoanById(idLoan, idLoanType)) { + apcResponse.setSuccessful(Boolean.TRUE); + apcResponse.setEnabledSubmit(Boolean.FALSE); + apcResponse.setMessage("Se actualizo el monto del prestamo"); + response = Response.ok().entity(apcResponse).build(); + } else { + apcResponse.setSuccessful(Boolean.FALSE); + apcResponse.setEnabledSubmit(Boolean.FALSE); + apcResponse.setMessage("No se actualizo el monto del prestamo"); + response = Response.ok().entity(apcResponse).build(); + } + } catch (Exception e) { + apcResponse.setSuccessful(Boolean.FALSE); + apcResponse.setEnabledSubmit(Boolean.FALSE); + apcResponse.setMessage("Error al actualizar el monto del prestamo"); + response = Response.ok().entity(apcResponse).build(); + logger.error("deleteClosingDay", e); + + } + return response; + } + + @GET + @Path("find-all-transfer-to-authorize") + @Produces(MediaType.APPLICATION_JSON) + public Response findAllTransferToAuthorize() { + logger.debug("findAllTransferToAuthorize"); + Response response; + try { + GenericEntity> results + = new GenericEntity>( + loanController.findAllTransferToAuthorize()) { + }; + + response = Response.ok(results).build(); + } catch (Exception e) { + logger.error("findAllTransferToAuthorize", e); + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + return response; + } + + @PUT + @Path("update-transfer-list") + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + public Response updateTransferList(AuthorizeTransferList authorizeTransferList) { + Response response; + GenericAPCResponserJaxb apcResponse = new GenericAPCResponserJaxb(); + try { + if (loanController.updateTransferList(authorizeTransferList, TransferStatus.AUTHORIZED)) { + apcResponse.setSuccessful(Boolean.TRUE); + apcResponse.setEnabledSubmit(Boolean.FALSE); + String message = authorizeTransferList.getTransferListToUpdateStatus().size() == 1 ? "Se autorizo la transferencia bancaria" : "Se autorizaron las transferencias bancarias"; + apcResponse.setMessage(message); + response = Response.ok().entity(apcResponse).build(); + } else { + apcResponse.setSuccessful(Boolean.FALSE); + apcResponse.setEnabledSubmit(Boolean.FALSE); + String message = authorizeTransferList.getTransferListToUpdateStatus().size() == 1 ? "No se autorizo la trasferencia bancaria" : "No se autorizaron las trasferencias bancaria"; + apcResponse.setMessage(message); + response = Response.ok().entity(apcResponse).build(); + } + } catch (Exception e) { + apcResponse.setSuccessful(Boolean.FALSE); + apcResponse.setEnabledSubmit(Boolean.FALSE); + String message = authorizeTransferList.getTransferListToUpdateStatus().size() == 1 ? "Error al autorizar la transferencia bancaria" : "Error al autorizar las transferencias bancaria"; + apcResponse.setMessage(message); + + response = Response.ok().entity(apcResponse).build(); + logger.error("updateTransferList", e); + + } + return response; + } + + @GET + @Path("find-all-loans-in-pending-status-to-delivery") + @Produces(MediaType.APPLICATION_JSON) + public Response findAllLoanInPendingStatusToDeliveryView() { + logger.debug("findAllLoanInPendingStatusToDeliveryView"); + Response response; + try { + GenericEntity> results + = new GenericEntity>( + loanController.findAllLoanInPendingStatusToDeliveryView()) { + }; + + response = Response.ok(results).build(); + } catch (Exception e) { + logger.error("findAllLoanInPendingStatusToDeliveryView", e); + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + return response; + } + + @PUT + @Path("update-loan-pending-status-to-delivery") + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + public Response updateLoanPendingStatusToDelivery(UpdateLoanToDeliveryStatusList updateLoanToDeliveryStatusList) { + Response response; + GenericAPCResponserJaxb apcResponse = new GenericAPCResponserJaxb(); + try { + if (loanController.updateLoanPendingStatusToDelivery(updateLoanToDeliveryStatusList, LoanStatus.TO_DELIVERY)) { + apcResponse.setSuccessful(Boolean.TRUE); + apcResponse.setEnabledSubmit(Boolean.FALSE); + String message = updateLoanToDeliveryStatusList.getLoanToDeliveryList().size() == 1 ? "Se liberĆ³ el prestamo" : "Se liberaron los prestamos"; + apcResponse.setMessage(message); + response = Response.ok().entity(apcResponse).build(); + } else { + apcResponse.setSuccessful(Boolean.FALSE); + apcResponse.setEnabledSubmit(Boolean.FALSE); + String message = updateLoanToDeliveryStatusList.getLoanToDeliveryList().size() == 1 ? "No se liberĆ³ el prestamo" : "No se liberaron los prestamos"; + apcResponse.setMessage(message); + response = Response.ok().entity(apcResponse).build(); + } + } catch (Exception e) { + apcResponse.setSuccessful(Boolean.FALSE); + apcResponse.setEnabledSubmit(Boolean.FALSE); + String message = updateLoanToDeliveryStatusList.getLoanToDeliveryList().size() == 1 ? "Error al liberar el prestamo" : "Error al liberar los prestamos"; + apcResponse.setMessage(message); + + response = Response.ok().entity(apcResponse).build(); + logger.error("updateLoanPendingStatusToDelivery", e); + + } + return response; + } + + /** + * + * @param loan + * @param credit + * @param user + * @param date yyyy-MM-dd HH:mm:ss + * @return + */ + private boolean validateRenovationData(String loan, String credit, String user) { + if (null == loan || loan.length() != 36) { + return false; + } + if (null == credit || credit.length() != 36) { + return false; + } + return !(null == user || user.length() != 36); + } + + final Logger logger = LogManager.getLogger(LoanWS.class); + private final LoanController loanController; + private final SystemPreferenceController systemPreferenceController; + + public LoanWS() { + this.loanController = new LoanController(); + this.systemPreferenceController = new SystemPreferenceController(); + } + +} diff --git a/ace-ws-rest/src/main/java/com/arrebol/apc/ws/login/LoginWS.java b/ace-ws-rest/src/main/java/com/arrebol/apc/ws/login/LoginWS.java new file mode 100644 index 0000000..3991684 --- /dev/null +++ b/ace-ws-rest/src/main/java/com/arrebol/apc/ws/login/LoginWS.java @@ -0,0 +1,58 @@ +/* + * 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.ws.login; + +import com.arrebol.apc.controller.mobile.controller.login.LoginWSController; +import java.io.Serializable; +import javax.ws.rs.FormParam; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Path("login") +public class LoginWS implements Serializable { + + private static final long serialVersionUID = 4130449130428311393L; + + @POST + @Produces(MediaType.APPLICATION_JSON) + public Response login(@FormParam("userName") String userName, + @FormParam("token") String token) { + logger.info("access"); + + Response response; + try { + response = Response.status(Response.Status.OK).entity(getController().login(userName, token)).build(); + } catch (Exception e) { + logger.error("Access denied", e); + response = Response.status(Response.Status.FORBIDDEN).build(); + } + return response; + } + + final Logger logger = LogManager.getLogger(LoginWS.class); + + private final LoginWSController controller; + + public LoginWS() { + controller = new LoginWSController(); + } + + private LoginWSController getController() { + return controller; + } + +} diff --git a/ace-ws-rest/src/main/java/com/arrebol/apc/ws/otherexpense/OtherExpenseWS.java b/ace-ws-rest/src/main/java/com/arrebol/apc/ws/otherexpense/OtherExpenseWS.java new file mode 100644 index 0000000..0b20d15 --- /dev/null +++ b/ace-ws-rest/src/main/java/com/arrebol/apc/ws/otherexpense/OtherExpenseWS.java @@ -0,0 +1,70 @@ +/* + * 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.ws.otherexpense; + +import com.arrebol.apc.controller.mobile.controller.otherexpense.OtherExpenseController; +import com.arrebol.apc.controller.mobile.controller.preference.SystemPreferenceController; +import java.io.Serializable; +import javax.ws.rs.FormParam; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Path("otherExpense") +public class OtherExpenseWS implements Serializable { + + @PUT + @Path("new") + @Produces(MediaType.APPLICATION_JSON) + public Response newOtherExpense( + @FormParam("office") String office, + @FormParam("user") String user, + @FormParam("expense") Double expense, + @FormParam("description") String description) { + Response response; + try { + + if (systemPreferenceController.findConfigurationButton(user, office).isActiveButton()) { + if (otherExpenseController.addOtherExpense(office, user, expense, description)) { + response = Response.ok().build(); + } else { + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + } else { + response = Response.status(Response.Status.CONFLICT).build(); + } + + } catch (Exception e) { + logger.error("newOtherExpense", e); + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + + return response; + } + + private static final long serialVersionUID = 3210072051203175268L; + + final Logger logger = LogManager.getLogger(OtherExpenseWS.class); + + private final OtherExpenseController otherExpenseController; + private final SystemPreferenceController systemPreferenceController; + + public OtherExpenseWS() { + this.otherExpenseController = new OtherExpenseController(); + this.systemPreferenceController = new SystemPreferenceController(); + } + +} diff --git a/ace-ws-rest/src/main/java/com/arrebol/apc/ws/person/PersonWS.java b/ace-ws-rest/src/main/java/com/arrebol/apc/ws/person/PersonWS.java new file mode 100644 index 0000000..3ee8df4 --- /dev/null +++ b/ace-ws-rest/src/main/java/com/arrebol/apc/ws/person/PersonWS.java @@ -0,0 +1,53 @@ +/* + * 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.ws.person; + +import com.arrebol.apc.controller.mobile.controller.person.PersonController; +import java.io.Serializable; +import javax.ws.rs.FormParam; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Path("person") +public class PersonWS implements Serializable { + + @PUT + @Path("change-contact-number-by-loan-id") + @Produces(MediaType.APPLICATION_JSON) + public Response changeContactNumber( + @FormParam("loanId") String loanId, + @FormParam("lastUpdatedBy") String lastUpdatedBy, + @FormParam("contactNumber") String contactNumber, + @FormParam("isCustomer") boolean isCustomer) { + Response response; + try { + PersonController controller = new PersonController(); + + if (controller.changeContactNumber(loanId, lastUpdatedBy, contactNumber, isCustomer)) { + response = Response.ok().build(); + } else { + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + } catch (Exception e) { + logger.error("changeContactNumber"); + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + return response; + } + + final Logger logger = LogManager.getLogger(getClass()); +} diff --git a/ace-ws-rest/src/main/java/com/arrebol/apc/ws/preferences/SystemPreferenceWS.java b/ace-ws-rest/src/main/java/com/arrebol/apc/ws/preferences/SystemPreferenceWS.java new file mode 100644 index 0000000..00ee915 --- /dev/null +++ b/ace-ws-rest/src/main/java/com/arrebol/apc/ws/preferences/SystemPreferenceWS.java @@ -0,0 +1,125 @@ +/* + * 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.ws.preferences; + +import com.arrebol.apc.controller.mobile.controller.preference.SystemPreferenceController; +import com.arrebol.apc.controller.mobile.moxy.views.LoanByUserOrderPreferenceViewListJaxb; +import com.arrebol.apc.model.views.LoanByUserOrderPreferenceView; +import com.arrebol.apc.model.ws.parsed.ConfigurationJaxb; +import java.io.Serializable; +import java.util.List; +import javax.ws.rs.Consumes; +import javax.ws.rs.FormParam; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.GenericEntity; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Path("systemPreference") +public class SystemPreferenceWS implements Serializable { + + private static final long serialVersionUID = -2316998237505965201L; + + @POST + @Path("findAllLoanByUserOrderPreference") + @Produces(MediaType.APPLICATION_JSON) + public Response findAllLoanByUserOrderPreference(@FormParam("userId") String userId) { + logger.debug("findAllLoanByUserOrderPreference"); + Response response; + try { + GenericEntity> list = new GenericEntity>( + controller.findAllLoanByUserOrderPreference(userId) + ) { + }; + + response = Response.ok(list).build(); + } catch (Exception e) { + logger.error("findAllLoanByUserOrderPreference", e); + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + return response; + } + + @PUT + @Path("updateOrderInList") + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + public Response updateOrderInList(LoanByUserOrderPreferenceViewListJaxb updateOrderListPreference) { + logger.debug("updateOrderInList"); + Response response; + try { + + if (controller.updateOrderInList(updateOrderListPreference)) { + response = Response.ok().build(); + } else { + response = Response.notModified().build(); + } + } catch (Exception e) { + logger.error("updateOrderInList", e); + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + return response; + } + + @PUT + @Path("updateUserMobilePreference") + @Produces(MediaType.APPLICATION_JSON) + public Response updateUserMobilePreference( + @FormParam("userId") String userId, + @FormParam("preferenceName") String preferenceName, + @FormParam("preferenceValue") String preferenceValue) { + logger.debug("updateUserMobilePreference"); + Response response; + + try { + if (controller.updateUserMobilePreference(userId, preferenceName, preferenceValue)) { + response = Response.ok().build(); + } else { + response = Response.notModified().build(); + } + } catch (Exception e) { + logger.error("updateUserMobilePreference", e); + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + return response; + } + + @GET + @Path("active-button") + @Produces(MediaType.APPLICATION_JSON) + public Response activeButton(@QueryParam("user") String user, @QueryParam("office") String office) { + logger.debug("activeButton"); + Response response; + try { + response = Response.ok(controller.findConfigurationButton(user, office)).build(); + } catch (Exception e) { + logger.error("updateOrderInList", e); + response = Response.ok(new ConfigurationJaxb(false)).build(); + } + return response; + } + + final Logger logger = LogManager.getLogger(SystemPreferenceWS.class); + private final SystemPreferenceController controller; + + public SystemPreferenceWS() { + this.controller = new SystemPreferenceController(); + } + +} diff --git a/ace-ws-rest/src/main/java/com/arrebol/apc/ws/reports/ReportsWS.java b/ace-ws-rest/src/main/java/com/arrebol/apc/ws/reports/ReportsWS.java new file mode 100644 index 0000000..12a11d9 --- /dev/null +++ b/ace-ws-rest/src/main/java/com/arrebol/apc/ws/reports/ReportsWS.java @@ -0,0 +1,47 @@ +/* + * 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.ws.reports; + +import com.arrebol.apc.controller.mobile.controller.reports.ReportsController; +import java.io.Serializable; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Path("reports") +public class ReportsWS implements Serializable { + + @GET + @Path("find-user-week-report-details-by-user") + @Produces(MediaType.APPLICATION_JSON) + public Response findUserWeekReportDetailsByUser(@QueryParam("id") String id) { + logger.debug("findUserWeekReportDetailsByUser"); + + Response response; + try { + ReportsController controller = new ReportsController(); + response = Response.ok(controller.findUserWeekReportDetailsByUser(id)).build(); + } catch (Exception e) { + logger.error("findUserWeekReportDetailsByUser"); + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + return response; + } + + private static final long serialVersionUID = -5280895557294295916L; + final Logger logger = LogManager.getLogger(getClass()); +} diff --git a/ace-ws-rest/src/main/java/com/arrebol/apc/ws/route/RouteWS.java b/ace-ws-rest/src/main/java/com/arrebol/apc/ws/route/RouteWS.java new file mode 100644 index 0000000..d9ec8e7 --- /dev/null +++ b/ace-ws-rest/src/main/java/com/arrebol/apc/ws/route/RouteWS.java @@ -0,0 +1,44 @@ +/* + * 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.ws.route; + +import com.arrebol.apc.controller.mobile.controller.route.RouteController; +import java.io.Serializable; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Path("route") +public class RouteWS implements Serializable { + + @GET + @Path("find-all-routes-availables-by-office-id") + @Produces(MediaType.APPLICATION_JSON) + public Response findAllRoutesAvailablesByOfficeId(@QueryParam("id") String id) { + logger.debug("findAllRoutesAvailablesByOfficeId"); + Response response; + try { + RouteController controller = new RouteController(); + response = Response.ok(controller.findAllRoutesAvailables(id)).build(); + } catch (Exception e) { + logger.error("findAllRoutesAvailablesByOfficeId", e); + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + return response; + } + final Logger logger = LogManager.getLogger(getClass()); +} diff --git a/ace-ws-rest/src/main/java/com/arrebol/apc/ws/search/SearchWS.java b/ace-ws-rest/src/main/java/com/arrebol/apc/ws/search/SearchWS.java new file mode 100644 index 0000000..0ae72b6 --- /dev/null +++ b/ace-ws-rest/src/main/java/com/arrebol/apc/ws/search/SearchWS.java @@ -0,0 +1,130 @@ +/* + * 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.ws.search; + +import com.arrebol.apc.controller.mobile.controller.search.PersonSearchController; +import com.arrebol.apc.model.views.PersonSearchHistoricalDetailsView; +import com.arrebol.apc.model.views.PersonSearchView; +import java.io.Serializable; +import java.util.List; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.GenericEntity; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Path("search") +public class SearchWS implements Serializable { + + private static final long serialVersionUID = 7794635470022372773L; + + @GET + @Path("person/{fullNameToSearch}") + @Produces(MediaType.APPLICATION_JSON) + public Response findPersonTypeByFullName(@PathParam("fullNameToSearch") String nameToSearch) { + + Response response; + try { + response = Response.ok(controller.fullNameEqualsToPersonSearch(nameToSearch)).build(); + } catch (Exception e) { + logger.error("findExistingPerson", e); + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + return response; + } + + @GET + @Path("name/{personSearch}") + @Produces(MediaType.APPLICATION_JSON) + public Response findAllCoincidences(@PathParam("personSearch") String personSearch) { + logger.debug("findAllCoincidences"); + + Response response; + try { + GenericEntity> entities + = new GenericEntity>(controller.findAllCoincidences("%" + personSearch + "%")) { + }; + + response = Response.ok(entities).build(); + } catch (Exception e) { + logger.error("findAllCoincidences", e); + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + return response; + } + + @GET + @Path("person") + @Produces(MediaType.APPLICATION_JSON) + public Response findPersonSearchDetailById(@QueryParam("id") String id) { + logger.debug("findAllCoincidences"); + + Response response; + try { + response = Response.ok(controller.findPersonSearchDetail(id)).build(); + } catch (Exception e) { + logger.error("findAllCoincidences", e); + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + return response; + } + + @GET + @Path("historicalDetails") + @Produces(MediaType.APPLICATION_JSON) + public Response historicalDetails(@QueryParam("person") String personId) { + logger.debug("historicalDetails"); + + Response response; + try { + GenericEntity> entities + = new GenericEntity>(controller.findPersonHistoricalDetailsByPersonId(personId)) { + }; + + response = Response.ok(entities).build(); + } catch (Exception e) { + logger.error("historicalDetails", e); + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + return response; + } + + @GET + @Path("payment-details") + @Produces(MediaType.APPLICATION_JSON) + public Response searchPaymentDetails(@QueryParam("user") String user, + @QueryParam("personSearch") String personSearch) { + logger.debug("searchPaymentDetails"); + + Response response; + try { + response = Response.ok(controller.searchPaymentDetails(user, personSearch)).build(); + } catch (Exception e) { + logger.error("searchPaymentDetails", e); + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + return response; + } + + final Logger logger = LogManager.getLogger(SearchWS.class); + private final PersonSearchController controller; + + public SearchWS() { + this.controller = new PersonSearchController(); + } + +} diff --git a/ace-ws-rest/src/main/java/com/arrebol/apc/ws/user/UserWS.java b/ace-ws-rest/src/main/java/com/arrebol/apc/ws/user/UserWS.java new file mode 100644 index 0000000..f487776 --- /dev/null +++ b/ace-ws-rest/src/main/java/com/arrebol/apc/ws/user/UserWS.java @@ -0,0 +1,55 @@ +/* + * 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.ws.user; + +import com.arrebol.apc.controller.mobile.controller.user.UserController; +import com.arrebol.apc.model.core.User; +import java.io.Serializable; +import java.util.List; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.GenericEntity; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@Path("users") +public class UserWS implements Serializable { + + @GET + @Path("list-by-office") + @Produces(MediaType.APPLICATION_JSON) + public Response listOfUsersByOffice(@QueryParam("office") String office) { + logger.debug("listOfUsersByOffice"); + Response response; + try { + UserController controller = new UserController(); + GenericEntity> results + = new GenericEntity>( + controller.listOfUsersByOffice(office) + ) { + }; + + response = Response.ok(results).build(); + } catch (Exception e) { + logger.error("listOfUsersByOffice", e); + response = Response.status(Response.Status.NOT_ACCEPTABLE).build(); + } + return response; + } + + final Logger logger = LogManager.getLogger(getClass()); + +} diff --git a/ace-ws-rest/src/main/resources/log4j2.xml b/ace-ws-rest/src/main/resources/log4j2.xml new file mode 100644 index 0000000..536c783 --- /dev/null +++ b/ace-ws-rest/src/main/resources/log4j2.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + %d{dd-MM-yyyy HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n + + + + + + + + + + + \ No newline at end of file diff --git a/ace-ws-rest/src/main/webapp/META-INF/context.xml b/ace-ws-rest/src/main/webapp/META-INF/context.xml new file mode 100644 index 0000000..e22a3e3 --- /dev/null +++ b/ace-ws-rest/src/main/webapp/META-INF/context.xml @@ -0,0 +1,2 @@ + + diff --git a/ace-ws-rest/src/main/webapp/WEB-INF/beans.xml b/ace-ws-rest/src/main/webapp/WEB-INF/beans.xml new file mode 100644 index 0000000..c02d76e --- /dev/null +++ b/ace-ws-rest/src/main/webapp/WEB-INF/beans.xml @@ -0,0 +1,7 @@ + + + + diff --git a/ace-ws-rest/src/main/webapp/index.html b/ace-ws-rest/src/main/webapp/index.html new file mode 100644 index 0000000..3368e9c --- /dev/null +++ b/ace-ws-rest/src/main/webapp/index.html @@ -0,0 +1,10 @@ + + + + Start Page + + + +

    Hello World!

    + + diff --git a/ace-ws-rest/src/test/java/com/arrebol/apc/ws/cash/CashRegisterWSTest.java b/ace-ws-rest/src/test/java/com/arrebol/apc/ws/cash/CashRegisterWSTest.java new file mode 100644 index 0000000..25510d1 --- /dev/null +++ b/ace-ws-rest/src/test/java/com/arrebol/apc/ws/cash/CashRegisterWSTest.java @@ -0,0 +1,47 @@ +/* + * 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.ws.cash; + +import java.net.URI; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import org.glassfish.jersey.server.ResourceConfig; +import org.glassfish.jersey.test.JerseyTest; +import org.glassfish.jersey.test.TestProperties; +import org.glassfish.jersey.test.util.runner.ConcurrentRunner; +import static org.junit.Assert.assertEquals; +import org.junit.Test; +import org.junit.runner.RunWith; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@RunWith(ConcurrentRunner.class) +public class CashRegisterWSTest extends JerseyTest { + + private static final URI BASE_URI = URI.create("http://localhost:8080/apc-ws-rest/resource"); + public static final String USER_ID = "67b3081e-8bc9-11ea-b45c-c7b846343364"; + + @Override + protected ResourceConfig configure() { + enable(TestProperties.LOG_TRAFFIC); + return new ResourceConfig(CashRegisterWS.class); + } + + @Test + public void findAllLoanByUserOrderPreference() { + Response response = target().path("cashRegister/findAllBy") + .queryParam("id", USER_ID) + .request(MediaType.APPLICATION_JSON) + .get(Response.class); + + System.out.println("response: " + response); + assertEquals(200, response.getStatus()); + } +} diff --git a/ace-ws-rest/src/test/java/com/arrebol/apc/ws/customer/CustomerWSTest.java b/ace-ws-rest/src/test/java/com/arrebol/apc/ws/customer/CustomerWSTest.java new file mode 100644 index 0000000..f1500b4 --- /dev/null +++ b/ace-ws-rest/src/test/java/com/arrebol/apc/ws/customer/CustomerWSTest.java @@ -0,0 +1,58 @@ +/* + * 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.ws.customer; + +import java.net.URI; +import javax.ws.rs.client.Entity; +import javax.ws.rs.core.Form; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import org.glassfish.jersey.server.ResourceConfig; +import org.glassfish.jersey.test.JerseyTest; +import org.glassfish.jersey.test.TestProperties; +import org.glassfish.jersey.test.util.runner.ConcurrentRunner; +import static org.junit.Assert.assertEquals; +import org.junit.Test; +import org.junit.runner.RunWith; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@RunWith(ConcurrentRunner.class) +public class CustomerWSTest extends JerseyTest { + + private static final URI BASE_URI = URI.create("http://localhost:8080/apc-ws-rest/resource"); + public static final String USER_ID = "67b3081e-8bc9-11ea-b45c-c7b846343364"; + + public CustomerWSTest() { + } + + @Override + protected ResourceConfig configure() { + enable(TestProperties.LOG_TRAFFIC); + return new ResourceConfig(CustomerWS.class); + } + + @Test + public void findAllLoanByUserOrderPreference() { + Form form = new Form(); + + form.param("orderList", "ALPHABETICALLY"); + //form.param("orderList", "ORDER_IN_LIST"); + form.param("userId", USER_ID); + + Response response = target().path("/customer/list") + .request(MediaType.APPLICATION_JSON) + .post(Entity.form(form), Response.class); + + System.out.println("response: " + response); + assertEquals(200, response.getStatus()); + } + +} diff --git a/ace-ws-rest/src/test/java/com/arrebol/apc/ws/customer/employee/EmployeeWSTest.java b/ace-ws-rest/src/test/java/com/arrebol/apc/ws/customer/employee/EmployeeWSTest.java new file mode 100644 index 0000000..dbd2016 --- /dev/null +++ b/ace-ws-rest/src/test/java/com/arrebol/apc/ws/customer/employee/EmployeeWSTest.java @@ -0,0 +1,54 @@ +/* + * 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.ws.customer.employee; + +import com.arrebol.apc.ws.employee.EmployeeWS; +import static com.arrebol.apc.ws.exchange.ExchangeWSTest.OFFICE_ID_TPC; +import java.net.URI; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import org.glassfish.jersey.server.ResourceConfig; +import org.glassfish.jersey.test.JerseyTest; +import org.glassfish.jersey.test.TestProperties; +import org.glassfish.jersey.test.util.runner.ConcurrentRunner; +import static org.junit.Assert.assertEquals; +import org.junit.Test; +import org.junit.runner.RunWith; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@RunWith(ConcurrentRunner.class) +public class EmployeeWSTest extends JerseyTest { + + private static final URI BASE_URI = URI.create("http://localhost:8080/apc-ws-rest/resource"); + + public static final String USER_ID_AVATAR_TWO = "52cbc85a-8bc9-11ea-b45c-c7b846343364"; + public static final String OFFICE_ID_GDL = "e0f1a2fc-7d1f-11ea-af3e-28f659da398e"; + + @Override + protected ResourceConfig configure() { + enable(TestProperties.LOG_TRAFFIC); + return new ResourceConfig(EmployeeWS.class); + } + + @Test + public void paymentTraking() { + + Response response = target().path("employee/payment-traking") + .queryParam("id", USER_ID_AVATAR_TWO) + .queryParam("office", OFFICE_ID_TPC) + .request(MediaType.APPLICATION_JSON) + .get(Response.class); + + System.out.println("response: " + response); + assertEquals(200, response.getStatus()); + } + +} diff --git a/ace-ws-rest/src/test/java/com/arrebol/apc/ws/exchange/ExchangeWSTest.java b/ace-ws-rest/src/test/java/com/arrebol/apc/ws/exchange/ExchangeWSTest.java new file mode 100644 index 0000000..d524d4b --- /dev/null +++ b/ace-ws-rest/src/test/java/com/arrebol/apc/ws/exchange/ExchangeWSTest.java @@ -0,0 +1,93 @@ +/* + * 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.ws.exchange; + +import com.arrebol.apc.model.ws.parsed.ExchangeJaxb; +import java.math.BigDecimal; +import java.net.URI; +import javax.ws.rs.client.Entity; +import javax.ws.rs.core.Form; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import org.glassfish.jersey.server.ResourceConfig; +import org.glassfish.jersey.test.JerseyTest; +import org.glassfish.jersey.test.TestProperties; +import org.glassfish.jersey.test.util.runner.ConcurrentRunner; +import static org.junit.Assert.assertEquals; +import org.junit.Test; +import org.junit.runner.RunWith; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@RunWith(ConcurrentRunner.class) +public class ExchangeWSTest extends JerseyTest { + + private static final URI BASE_URI = URI.create("http://localhost:8080/apc-ws-rest/resource"); + + public static final String USER_ID_AVATAR_ONE = "67b3081e-8bc9-11ea-b45c-c7b846343364"; + public static final String USER_ID_AVATAR_TWO = "52cbc85a-8bc9-11ea-b45c-c7b846343364"; + public static final String OFFICE_ID_GDL = "e0f1a2fc-7d1f-11ea-af3e-28f659da398e"; + public static final String OFFICE_ID_TPC = "caef3a64-7d1f-11ea-af3e-28f659da398e"; + public static final String TRANSFER_ID ="815c7092-94fe-40a0-bf8e-e4a047300c7c"; + + @Override + protected ResourceConfig configure() { + enable(TestProperties.LOG_TRAFFIC); + return new ResourceConfig(ExchangeWS.class); + } + + //@Test + public void findAllAvailableEndorsementsByOffice() { + + Response response = target().path("exchange/availableUsers") + .queryParam("id", USER_ID_AVATAR_TWO) + .queryParam("office", OFFICE_ID_TPC) + .request(MediaType.APPLICATION_JSON) + .get(Response.class); + + System.out.println("response: " + response); + assertEquals(200, response.getStatus()); + } + + //@Test + public void newExchange() { + ExchangeJaxb jaxb = new ExchangeJaxb(); + + jaxb.setOfficeId(OFFICE_ID_TPC); + jaxb.setSenderId(USER_ID_AVATAR_ONE); + jaxb.setReceiverId(USER_ID_AVATAR_TWO); + jaxb.setAmount(new BigDecimal(1000.0)); + + Response response = target().path("exchange/newExchange") + .request(MediaType.APPLICATION_JSON) + .accept(MediaType.APPLICATION_JSON) + .put(Entity.entity(jaxb, MediaType.APPLICATION_JSON), Response.class); + + System.out.println("response: " + response); + assertEquals(200, response.getStatus()); + } + + @Test + public void updateExchange() { + Form form = new Form(); + + form.param("transfer", TRANSFER_ID); + form.param("user", USER_ID_AVATAR_TWO); + form.param("action", "true"); + + + Response response = target().path("exchange/updateExchange") + .request(MediaType.APPLICATION_JSON) + .post(Entity.form(form), Response.class); + + System.out.println("response: " + response); + assertEquals(200, response.getStatus()); + } +} diff --git a/ace-ws-rest/src/test/java/com/arrebol/apc/ws/loan/LoanWSTest.java b/ace-ws-rest/src/test/java/com/arrebol/apc/ws/loan/LoanWSTest.java new file mode 100644 index 0000000..d243a7f --- /dev/null +++ b/ace-ws-rest/src/test/java/com/arrebol/apc/ws/loan/LoanWSTest.java @@ -0,0 +1,221 @@ +/* + * 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.ws.loan; + +import com.arrebol.apc.model.ws.parsed.PersonJaxb; +import com.arrebol.apc.model.ws.parsed.LoanRequestedJaxb; +import com.arrebol.apc.model.ws.parsed.NewAmountJaxb; +import java.math.BigDecimal; +import java.net.URI; +import javax.ws.rs.client.Entity; +import javax.ws.rs.core.Form; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import org.glassfish.jersey.server.ResourceConfig; +import org.glassfish.jersey.test.JerseyTest; +import org.glassfish.jersey.test.TestProperties; +import org.glassfish.jersey.test.util.runner.ConcurrentRunner; +import org.junit.Assert; +import static org.junit.Assert.assertEquals; +import org.junit.Test; +import org.junit.runner.RunWith; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@RunWith(ConcurrentRunner.class) +public class LoanWSTest extends JerseyTest { + + private static final URI BASE_URI = URI.create("http://localhost:8080/apc-ws-rest/resource"); + private static final String OFFICE_ID = "e0f1a2fc-7d1f-11ea-af3e-28f659da398e"; + private static final String LOAN_ID = "acccdfac-8e1b-11ea-b65e-4e1376171215"; + private static final String USER_ID = "52cbc85a-8bc9-11ea-b45c-c7b846343364"; + private static final String ROUTE_ID = "5e9a24e0-8e19-11ea-b65e-4e1376171215"; + private static final String LOAN_TYPE_ID = "dc255a16-8dff-11ea-8745-07889553dd5f"; + private static final String CUSTOMER_ID = "4adc2c28-8e1e-11ea-b65e-4e1376171215"; + private static final String ENDORSEMENT_ID = "ef10171e-8e1e-11ea-b65e-4e1376171215"; + private static final String CREATED_ON = "2020-06-02 12:13:14"; + private static final String DUMMY_STRING_DATA = "DUMMY DATA"; + + public LoanWSTest() { + } + + @Override + protected ResourceConfig configure() { + enable(TestProperties.LOG_TRAFFIC); + return new ResourceConfig(LoanWS.class); + } + + //@Test + public void findAllLoanTypeByOffice() { + + Response response = target().path("loan/findAllLoans") + .queryParam("id", OFFICE_ID) + .request(MediaType.APPLICATION_JSON) + .get(Response.class); + + System.out.println("response: " + response); + assertEquals(200, response.getStatus()); + } + + //@Test + public void findAllAvailableCustomersByOffice() { + + Response response = target().path("loan/findAllAvailableCustomers") + .queryParam("id", OFFICE_ID) + .request(MediaType.APPLICATION_JSON) + .get(Response.class); + + System.out.println("response: " + response); + assertEquals(200, response.getStatus()); + } + + //@Test + public void findAllAvailableEndorsementsByOffice() { + + Response response = target().path("loan/findAllAvailableEndorsements") + .queryParam("id", OFFICE_ID) + .request(MediaType.APPLICATION_JSON) + .get(Response.class); + + System.out.println("response: " + response); + assertEquals(200, response.getStatus()); + } + + //@Test + public void createLoan() { + LoanRequestedJaxb loan = new LoanRequestedJaxb(); + + loan.setLoanTypeId(LOAN_TYPE_ID); + loan.setOfficeId(OFFICE_ID); + loan.setUserId(USER_ID); + loan.setRouteId(ROUTE_ID); + loan.setCustomer(buildPerson(true, true)); + loan.setEndorsement(buildPerson(false, false)); + + Response response = target().path("loan/create") + .request(MediaType.APPLICATION_JSON) + .accept(MediaType.APPLICATION_JSON) + .put(Entity.entity(loan, MediaType.APPLICATION_JSON), Response.class); + + System.out.println("response: " + response); + assertEquals(200, response.getStatus()); + } + + //@Test + public void saveNewAmount() { + try { + NewAmountJaxb jaxb = newAmountJaxb(); + + Response response = target().path("loan/saveNewAmount") + .request(MediaType.APPLICATION_JSON) + .accept(MediaType.APPLICATION_JSON) + .post(Entity.entity(jaxb, MediaType.APPLICATION_JSON), Response.class); + + System.out.println("response: " + response); + assertEquals(200, response.getStatus()); + } catch (Exception e) { + Assert.assertNull(null); + } + } + + //@Test + public void renovation() { + try { + Form form = new Form(); + + form.param("loan", LOAN_ID); + form.param("credit", LOAN_TYPE_ID); + form.param("user", USER_ID); + form.param("date", CREATED_ON); + + Response response = target().path("loan/renovation") + .request(MediaType.APPLICATION_JSON) + .put(Entity.form(form), Response.class); + + System.out.println("response: " + response); + assertEquals(200, response.getStatus()); + } catch (Exception e) { + Assert.assertNull(null); + } + } + + @Test + public void certifierAction() { + try { + Form form = new Form(); + + form.param("id", "148c6a61-2e80-45bb-a854-8515547d7871"); + form.param("user", "52cbc85a-8bc9-11ea-b45c-c7b846343364"); + form.param("comments", "USER AVATAR 2"); + form.param("action", "true"); + form.param("amount", "1230.0"); + + Response response = target().path("loan/certifierAction") + .request(MediaType.APPLICATION_JSON) + .post(Entity.form(form), Response.class); + + System.out.println("response: " + response); + assertEquals(200, response.getStatus()); + } catch (Exception e) { + Assert.assertNull(null); + } + } + + /** + * + * @return + */ + private NewAmountJaxb newAmountJaxb() { + NewAmountJaxb jaxb = new NewAmountJaxb(); + + jaxb.setLoanId(LOAN_ID); + jaxb.setUserId(USER_ID); + jaxb.setAmount(new BigDecimal(50)); + jaxb.setCustomer(true); + jaxb.setFee(true); + jaxb.setStrDate("2020-05-26 09:41:07"); + + return jaxb; + } + + /** + * + * @param isDummyPerson + * @param isCustomer + * @return + */ + private PersonJaxb buildPerson(boolean isDummyPerson, boolean isCustomer) { + PersonJaxb person = new PersonJaxb(); + + if (isDummyPerson) { + person.setFirstName(DUMMY_STRING_DATA); + person.setLastName(DUMMY_STRING_DATA); + person.setMiddleName(DUMMY_STRING_DATA); + person.setAddressHome(DUMMY_STRING_DATA); + person.setPhoneHome(DUMMY_STRING_DATA); + person.setThumbnail("https://w7.pngwing.com/pngs/571/847/png-transparent-avatar-free-content-ugly-teacher-s-hat-cartoon-scalable-vector-graphics.png"); + person.setCreatePerson(true); + if (isCustomer) { + person.setAddressWork(DUMMY_STRING_DATA); + person.setPhoneWork(DUMMY_STRING_DATA); + person.setCompanyName(DUMMY_STRING_DATA); + } + } else { + if (isCustomer) { + person.setId(CUSTOMER_ID); + } else { + person.setId(ENDORSEMENT_ID); + } + } + + return person; + } + +} diff --git a/ace-ws-rest/src/test/java/com/arrebol/apc/ws/loan/LoanWithImageWSTest.java b/ace-ws-rest/src/test/java/com/arrebol/apc/ws/loan/LoanWithImageWSTest.java new file mode 100644 index 0000000..f2fdd6f --- /dev/null +++ b/ace-ws-rest/src/test/java/com/arrebol/apc/ws/loan/LoanWithImageWSTest.java @@ -0,0 +1,137 @@ +/* + * 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.ws.loan; + +import com.arrebol.apc.model.ws.parsed.LoanRequestedJaxb; +import com.arrebol.apc.model.ws.parsed.PersonJaxb; +import com.arrebol.apc.model.ws.parsed.ThumbnailJaxb; +import com.arrebol.apc.ws.cfg.ApplicationCfg; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.net.URI; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.ws.rs.client.Entity; +import javax.ws.rs.client.WebTarget; +import javax.ws.rs.core.Application; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.UriBuilder; +import org.glassfish.jersey.client.ClientConfig; +import org.glassfish.jersey.media.multipart.FormDataBodyPart; +import org.glassfish.jersey.media.multipart.FormDataContentDisposition; +import org.glassfish.jersey.media.multipart.FormDataMultiPart; +import org.glassfish.jersey.media.multipart.MultiPartFeature; +import org.glassfish.jersey.test.JerseyTest; +import static org.junit.Assert.assertEquals; +import org.junit.Test; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +public class LoanWithImageWSTest extends JerseyTest { + + @Override + protected URI getBaseUri() { + return UriBuilder.fromUri(super.getBaseUri()).path("apc-ws-rest").build(); + } + + @Override + protected Application configure() { + return new ApplicationCfg(); + } + + @Override + protected void configureClient(ClientConfig config) { + config.register(MultiPartFeature.class); + } + + private static final URI BASE_URI = URI.create("http://localhost:8080/apc-ws-rest/resource"); + private static final String OFFICE_ID = "e0f1a2fc-7d1f-11ea-af3e-28f659da398e"; + private static final String LOAN_ID = "acccdfac-8e1b-11ea-b65e-4e1376171215"; + private static final String USER_ID = "52cbc85a-8bc9-11ea-b45c-c7b846343364"; + private static final String ROUTE_ID = "5e9a24e0-8e19-11ea-b65e-4e1376171215"; + private static final String LOAN_TYPE_ID = "dc255a16-8dff-11ea-8745-07889553dd5f"; + private static final String CUSTOMER_ID = "4adc2c28-8e1e-11ea-b65e-4e1376171215"; + private static final String ENDORSEMENT_ID = "ef10171e-8e1e-11ea-b65e-4e1376171215"; + private static final String CREATED_ON = "2020-06-02 12:13:14"; + private static final String DUMMY_STRING_DATA = "DUMMY DATA"; + + @Test + public void createLoanWithImage() { + LoanRequestedJaxb loan = new LoanRequestedJaxb(); + + loan.setLoanTypeId(LOAN_TYPE_ID); + loan.setOfficeId(OFFICE_ID); + loan.setUserId(USER_ID); + loan.setRouteId(ROUTE_ID); + loan.setCustomer(buildPerson(true, true)); + loan.setEndorsement(buildPerson(true, false)); + + ThumbnailJaxb thumbnail = new ThumbnailJaxb(); + String name = "/Users/Picasso/Desktop/login_bg.png"; + File initialFile = new File(name); + + try { + thumbnail.setName(name); + thumbnail.setFile(new FileInputStream(initialFile)); + } catch (FileNotFoundException ex) { + Logger.getLogger(LoanWSTest.class.getName()).log(Level.SEVERE, null, ex); + } + + final WebTarget target = target().path("loan/create-with-image2"); + + final FormDataMultiPart mp = new FormDataMultiPart(); + + mp.bodyPart(new FormDataBodyPart(FormDataContentDisposition.name("file").fileName("file").build(), + thumbnail.getFile(), + MediaType.APPLICATION_JSON_TYPE)); + + + + Response response = target.request().put(Entity.entity(mp, MediaType.MULTIPART_FORM_DATA_TYPE), Response.class); + + System.out.println("response: " + response); + assertEquals(200, response.getStatus()); + } + + /** + * + * @param isDummyPerson + * @param isCustomer + * @return + */ + private PersonJaxb buildPerson(boolean isDummyPerson, boolean isCustomer) { + PersonJaxb person = new PersonJaxb(); + + if (isDummyPerson) { + person.setFirstName(DUMMY_STRING_DATA); + person.setLastName(DUMMY_STRING_DATA); + person.setMiddleName(DUMMY_STRING_DATA); + person.setAddressHome(DUMMY_STRING_DATA); + person.setPhoneHome(DUMMY_STRING_DATA); + person.setThumbnail("https://w7.pngwing.com/pngs/571/847/png-transparent-avatar-free-content-ugly-teacher-s-hat-cartoon-scalable-vector-graphics.png"); + person.setCreatePerson(true); + if (isCustomer) { + person.setAddressWork(DUMMY_STRING_DATA); + person.setPhoneWork(DUMMY_STRING_DATA); + person.setCompanyName(DUMMY_STRING_DATA); + } + } else { + if (isCustomer) { + person.setId(CUSTOMER_ID); + } else { + person.setId(ENDORSEMENT_ID); + } + } + + return person; + } +} diff --git a/ace-ws-rest/src/test/java/com/arrebol/apc/ws/login/LoginWSTest.java b/ace-ws-rest/src/test/java/com/arrebol/apc/ws/login/LoginWSTest.java new file mode 100644 index 0000000..b25f308 --- /dev/null +++ b/ace-ws-rest/src/test/java/com/arrebol/apc/ws/login/LoginWSTest.java @@ -0,0 +1,58 @@ +/* + * 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.ws.login; + +import java.net.URI; +import javax.ws.rs.client.Entity; +import javax.ws.rs.core.Form; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import org.glassfish.jersey.server.ResourceConfig; +import org.glassfish.jersey.test.JerseyTest; +import org.glassfish.jersey.test.TestProperties; +import org.glassfish.jersey.test.util.runner.ConcurrentRunner; +import org.junit.Test; +import static org.junit.Assert.*; +import org.junit.runner.RunWith; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@RunWith(ConcurrentRunner.class) +public class LoginWSTest extends JerseyTest { + + private static final URI BASE_URI = URI.create("http://localhost:8080/apc-ws-rest/resource"); + private static final String USER_NAME = "avatar1"; + private static final String PASSWORD = "8478A4A2819E9C06AB738123C5D04B4FA1AA67548EBA64EAD40B635EA8AA8D5B"; + + public LoginWSTest() { + } + + @Override + protected ResourceConfig configure() { + enable(TestProperties.LOG_TRAFFIC); + return new ResourceConfig(LoginWS.class); + } + + @Test + public void login() { + Form form = new Form(); + + form.param("userName", USER_NAME); + form.param("token", PASSWORD); + + Response response = target().path("login") + .request(MediaType.APPLICATION_JSON) + .post(Entity.form(form), Response.class); + + System.out.println("response: " + response); + assertEquals(200, response.getStatus()); + } + +} diff --git a/ace-ws-rest/src/test/java/com/arrebol/apc/ws/preferences/SystemPreferenceWSTest.java b/ace-ws-rest/src/test/java/com/arrebol/apc/ws/preferences/SystemPreferenceWSTest.java new file mode 100644 index 0000000..5e11917 --- /dev/null +++ b/ace-ws-rest/src/test/java/com/arrebol/apc/ws/preferences/SystemPreferenceWSTest.java @@ -0,0 +1,103 @@ +/* + * 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.ws.preferences; + +import com.arrebol.apc.controller.mobile.moxy.views.LoanByUserOrderPreferenceViewJaxb; +import com.arrebol.apc.controller.mobile.moxy.views.LoanByUserOrderPreferenceViewListJaxb; +import com.arrebol.apc.model.enums.PreferenceName; +import com.arrebol.apc.model.enums.PreferenceValue; +import java.net.URI; +import java.util.ArrayList; +import java.util.List; +import javax.ws.rs.client.Entity; +import javax.ws.rs.core.Form; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import org.glassfish.jersey.server.ResourceConfig; +import org.glassfish.jersey.test.JerseyTest; +import org.glassfish.jersey.test.TestProperties; +import org.glassfish.jersey.test.util.runner.ConcurrentRunner; +import org.junit.Test; +import static org.junit.Assert.*; +import org.junit.runner.RunWith; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@RunWith(ConcurrentRunner.class) +public class SystemPreferenceWSTest extends JerseyTest { + + private static final URI BASE_URI = URI.create("http://localhost:8080/apc-ws-rest/resource"); + public static final String USER_ID = "52cbc85a-8bc9-11ea-b45c-c7b846343364"; + public static final String USER_ID_2 = "67b3081e-8bc9-11ea-b45c-c7b846343364"; + public static final String USER_ID_3 = "3870767c-8bc9-11ea-b45c-c7b846343364"; + + public SystemPreferenceWSTest() { + } + + @Override + protected ResourceConfig configure() { + enable(TestProperties.LOG_TRAFFIC); + return new ResourceConfig(SystemPreferenceWS.class); + } + + //Test + public void findAllLoanByUserOrderPreference() { + Form form = new Form(); + + form.param("userId", USER_ID); + + Response response = target().path("/systemPreference/findAllLoanByUserOrderPreference") + .request(MediaType.APPLICATION_JSON) + .post(Entity.form(form), Response.class); + + System.out.println("response: " + response); + assertEquals(200, response.getStatus()); + } + + //@Test + public void updateOrderInList() { + List orderPreference = new ArrayList<>(); + + orderPreference.add( + new LoanByUserOrderPreferenceViewJaxb( + "5c925364-8e1b-11ea-b65e-4e1376171215", + "3870767c-8bc9-11ea-b45c-c7b846343364", + 1 + ) + ); + + LoanByUserOrderPreferenceViewListJaxb updateOrderListPreference = new LoanByUserOrderPreferenceViewListJaxb(orderPreference); + + Response response = target().path("/systemPreference/updateOrderInList") + .request(MediaType.APPLICATION_JSON) + .accept(MediaType.APPLICATION_JSON) + .put(Entity.entity(updateOrderListPreference, MediaType.APPLICATION_JSON), Response.class); + + System.out.println("response: " + response); + assertEquals(200, response.getStatus()); + } + + @Test + public void updateUserMobilePreference() { + Form form = new Form(); + + form.param("userId", USER_ID_3); + form.param("preferenceName", PreferenceName.ORDER_LIST.name()); + form.param("preferenceValue", PreferenceValue.ALPHABETICALLY.name()); + + Response response = target().path("/systemPreference/updateUserMobilePreference") + .request(MediaType.APPLICATION_JSON) + .put(Entity.form(form), Response.class); + + System.out.println("response: " + response); + assertEquals(200, response.getStatus()); + } + +} diff --git a/ace-ws-rest/src/test/java/com/arrebol/apc/ws/user/UserWSTest.java b/ace-ws-rest/src/test/java/com/arrebol/apc/ws/user/UserWSTest.java new file mode 100644 index 0000000..089c1cb --- /dev/null +++ b/ace-ws-rest/src/test/java/com/arrebol/apc/ws/user/UserWSTest.java @@ -0,0 +1,48 @@ +/* + * 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.ws.user; + +import static com.arrebol.apc.ws.cash.CashRegisterWSTest.USER_ID; +import java.net.URI; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import org.glassfish.jersey.server.ResourceConfig; +import org.glassfish.jersey.test.JerseyTest; +import org.glassfish.jersey.test.TestProperties; +import org.glassfish.jersey.test.util.runner.ConcurrentRunner; +import static org.junit.Assert.assertEquals; +import org.junit.Test; +import org.junit.runner.RunWith; + +/** + * + * @author Carlos Janitzio Zavala Lopez + */ +@RunWith(ConcurrentRunner.class) +public class UserWSTest extends JerseyTest { + + private static final URI BASE_URI = URI.create("http://localhost:8080/apc-ws-rest/resource"); + public final static String TEPIC_OFFICE = "caef3a64-7d1f-11ea-af3e-28f659da398e"; + + @Override + protected ResourceConfig configure() { + enable(TestProperties.LOG_TRAFFIC); + return new ResourceConfig(UserWS.class); + } + + @Test + public void findAllLoanByUserOrderPreference() { + Response response = target().path("users/list-by-office") + .queryParam("office", TEPIC_OFFICE) + .request(MediaType.APPLICATION_JSON) + .get(Response.class); + + System.out.println("response: " + response); + assertEquals(200, response.getStatus()); + } +} diff --git a/ace-ws-rest/src/test/resources/apc.cfg.xml b/ace-ws-rest/src/test/resources/apc.cfg.xml new file mode 100644 index 0000000..1ee5dd4 --- /dev/null +++ b/ace-ws-rest/src/test/resources/apc.cfg.xml @@ -0,0 +1,224 @@ + + + + + org.hibernate.dialect.MySQLDialect + com.mysql.cj.jdbc.Driver + jdbc:mysql://localhost:3306/apo_pro_com_april_ten?serverTimezone=GMT-5 + apoprocommobilelocalhost + 0Ps$6%q8 + 1 + 2 + 300 + 50 + 3000 + false + false + true + thread + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ace-ws-rest/src/test/resources/log4j2.xml b/ace-ws-rest/src/test/resources/log4j2.xml new file mode 100644 index 0000000..65d7c2a --- /dev/null +++ b/ace-ws-rest/src/test/resources/log4j2.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + %d{dd-MM-yyyy HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n + + + + + + + + + + + \ No newline at end of file diff --git a/ace/nb-configuration.xml b/ace/nb-configuration.xml new file mode 100644 index 0000000..a65c451 --- /dev/null +++ b/ace/nb-configuration.xml @@ -0,0 +1,18 @@ + + + + + + JDK_1.8 + + diff --git a/ace/pom.xml b/ace/pom.xml new file mode 100644 index 0000000..50601e2 --- /dev/null +++ b/ace/pom.xml @@ -0,0 +1,125 @@ + + + 4.0.0 + com.arrebol + ace + 1.0.0 + pom + + UTF-8 + 1.8 + 1.8 + + + + AWS-EC2 + + + AWS-EC2 + true + + + + ../ace-security + ../ace-layout + ../ace-model + ../ace-controller + ../ace-web + + + + Localhost + + + Localhost + true + + + + ../ace-security + ../ace-layout + ../ace-model + ../ace-controller + ../ace-web + + + + Localhost-Mobile-APP + + + Localhost-Mobile-APP + true + + + + ../ace-security + ../ace-model + ../ace-controller-mobile + ../ace-ws-rest + + + + Amazon-Web-Services + + + Amazon-Web-Services + true + + + + ../ace-security + ../ace-layout + ../ace-model + ../ace-controller + ../ace-web + + + + Amazon-Web-Services-Mobile-APP + + + Amazon-Web-Services-Mobile-APP + true + + + + ../ace-security + ../ace-model + ../ace-controller-mobile + ../ace-ws-rest + + + + Amazon-Web-Services-Test + + + Amazon-Web-Services-Test + true + + + + ../ace-security + ../ace-layout + ../ace-model + ../ace-controller + ../ace-web + + + + Amazon-Web-Services-Mobile-APP-Test + + + Amazon-Web-Services-Mobile-APP-Test + true + + + + ../ace-security + ../ace-model + ../ace-controller-mobile + ../ace-ws-rest + + + + ace + \ No newline at end of file