- VENTAS POR AUTORIZAR - MARCA ERROR AL VER LOS DETALLES

This commit is contained in:
Brayan.Gonzalez 2025-06-20 19:20:47 -06:00
parent 624d45589e
commit ecf4937bb6
2 changed files with 257 additions and 251 deletions

View File

@ -7,7 +7,6 @@
*/
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;
@ -40,19 +39,19 @@ import org.primefaces.event.RowEditEvent;
@ViewScoped
public class LoanPendingDetailBean extends GenericBean implements Serializable, Datatable {
public void changeLoanType(){
public void changeLoanType() {
loan.setLoanType(new LoanType(typeLoanId));
loan.setAmountToPay(loanTypeCtrl.getLoanTypeById(typeLoanId).getPaymentTotal());
if(loanCtrl.updateLoan(loan)){
if (loanCtrl.updateLoan(loan)) {
showMessage(FacesMessage.SEVERITY_INFO, "Cambio de tipo de préstamo", "El préstamo se cambió correctamente");
}
}
public void changeDateAndApprovedLoan(){
public void changeDateAndApprovedLoan() {
loan.setCreatedOn(createdOn);
loan.setComments(comments);
if(loanCtrl.updateLoan(loan)){
if (loanCtrl.updateLoan(loan)) {
approvedLoan();
}
@ -67,15 +66,15 @@ public class LoanPendingDetailBean extends GenericBean implements Serializable,
return null == loanDetails ? new ArrayList<>() : loanDetails;
}
public People getCustomerDetail(String peopleId){
public People getCustomerDetail(String peopleId) {
return customerCtrl.findPeopleById(peopleId);
}
public List<Loan> getLoanByCustomer(String peopleId){
public List<Loan> getLoanByCustomer(String peopleId) {
return customerCtrl.findLoanByCustomer(peopleId);
}
public List<Loan> getLoanByEndorsement(String peopleId){
public List<Loan> getLoanByEndorsement(String peopleId) {
return endorsementCtrl.findLoanByEndorsement(peopleId);
}
@ -85,8 +84,7 @@ public class LoanPendingDetailBean extends GenericBean implements Serializable,
LoanByRenovation renovation;
renovation = loanCtrl.getLoanByRenovationByIdLoanNew(loan);
if(renovation != null)
{
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());
@ -320,14 +318,14 @@ public class LoanPendingDetailBean extends GenericBean implements Serializable,
endorsementCtrl = new EndorsementController();
loanTypeCtrl = new LoanTypeController();
setLoanId(externalContext().getRequestParameterMap().get("form:dtLoanPending_selection"));
setLoanId(externalContext().getRequestParameterMap().get("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());
loanEndorsement = getLoanByEndorsement(loan.getEndorsement() != null ? loan.getEndorsement().getId() : "0");
loanCustomer = getLoanByCustomer(loan.getCustomer() != null ? loan.getCustomer().getId() : "0");
loanType = loanTypeCtrl.fillLoanTypeDatatable(getLoggedUser().getOffice() != null ? getLoggedUser().getOffice().getId() : "0");
customers = customerCtrl.fillCustomersDatatable(getLoggedUser().getOffice() != null ? getLoggedUser().getOffice().getId() : "0");
}
}

View File

@ -67,6 +67,15 @@
<p:column headerText="#{i18n['admin.loans.datatable.column.comments']}" sortBy="#{loan.comments}" filterBy="#{loan.comments}">
<h:outputText value="#{loan.comments}" />
</p:column>
<p:column headerText="Detalles" style="text-align: center">
<p:button
value="Ver detalles"
title="Ver detalles"
outcome="#{i18n['outcome.admin.loan.pending.detail']}"
style="margin: 1px; background-color: #E1B12C">
<f:param name="dtLoanPending_selection" value="#{loan.id}"/>
</p:button>
</p:column>
-
</p:dataTable>
@ -77,7 +86,6 @@
<p:menuitem rendered="#{loginBean.isUserInRole('admin.loan.updated') and loanPendingManager.loan.size() > 0}" value="Rechazar" update="dtLoanPending,:form:msgs" icon="ui-icon-close" actionListener="#{loanPendingManager.deleteRow}">
<p:confirm message="#{i18n['general.confirm.confirm']}" />
</p:menuitem>
<p:menuitem value="Ver detalles" ajax="false" rendered="#{loanPendingManager.loan.size() > 0}" icon="ui-icon-edit" action="#{loanPendingManager.detailLoan(i18n['outcome.admin.loan.pending.detail'])}" />
</p:contextMenu>
<p:confirmDialog header="Confirmación" global="true" showEffect="fade" hideEffect="fade">