Search in sources :

Example 6 with CuDisbursementPayee

use of edu.cornell.kfs.fp.businessobject.CuDisbursementPayee in project cu-kfs by CU-CommunityApps.

the class CuDisbursementPayeeLookupableHelperServiceImpl method getPersonAsPayees.

@Override
protected List<DisbursementPayee> getPersonAsPayees(Map<String, String> fieldValues) {
    List<DisbursementPayee> payeeList = new ArrayList<DisbursementPayee>();
    Map<String, String> fieldsForLookup = this.getPersonFieldValues(fieldValues);
    List<Person> persons = SpringContext.getBean(PersonService.class).findPeople(fieldsForLookup);
    boolean warningExists = false;
    for (Person personDetail : persons) {
        for (EntityAffiliationContract entityAffiliation : ((PersonImpl) personDetail).getAffiliations()) {
            if (entityAffiliation.isDefaultValue()) {
                if (StringUtils.equalsIgnoreCase(entityAffiliation.getAffiliationType().getCode(), CuDisbursementVoucherConstants.PayeeAffiliations.STUDENT)) {
                    CuDisbursementPayee payee = getPayeeFromPerson(personDetail, fieldValues, CuDisbursementVoucherConstants.DV_PAYEE_TYPE_STUDENT);
                    payeeList.add(payee);
                } else if (StringUtils.equalsIgnoreCase(entityAffiliation.getAffiliationType().getCode(), CuDisbursementVoucherConstants.PayeeAffiliations.ALUMNI)) {
                    CuDisbursementPayee payee = getPayeeFromPerson(personDetail, fieldValues, CuDisbursementVoucherConstants.DV_PAYEE_TYPE_ALUMNI);
                    payeeList.add(payee);
                } else if (StringUtils.equalsIgnoreCase(entityAffiliation.getAffiliationType().getCode(), CuDisbursementVoucherConstants.PayeeAffiliations.FACULTY) || StringUtils.equalsIgnoreCase(entityAffiliation.getAffiliationType().getCode(), CuDisbursementVoucherConstants.PayeeAffiliations.STAFF)) {
                    if (StringUtils.isNotBlank(personDetail.getEmployeeStatusCode()) && (personDetail.getEmployeeStatusCode().equals(ACTIVE)) || personDetail.getEmployeeStatusCode().equals(RETIRED)) {
                        CuDisbursementPayee payee = getPayeeFromPerson(personDetail, fieldValues, DisbursementVoucherConstants.DV_PAYEE_TYPE_EMPLOYEE);
                        payeeList.add(payee);
                    } else {
                        if (GlobalVariables.getMessageMap().containsMessageKey(CUKFSKeyConstants.WARNING_DV_PAYEE_MUST_BE_ACTIVE)) {
                            warningExists = true;
                            break;
                        }
                    }
                    if (!warningExists) {
                        GlobalVariables.getMessageMap().putWarningWithoutFullErrorPath(KFSPropertyConstants.PRINCIPAL_ID, CUKFSKeyConstants.WARNING_DV_PAYEE_MUST_BE_ACTIVE);
                    }
                }
                break;
            }
        }
    }
    return payeeList;
}
Also used : EntityAffiliationContract(org.kuali.rice.kim.api.identity.affiliation.EntityAffiliationContract) CuDisbursementPayee(edu.cornell.kfs.fp.businessobject.CuDisbursementPayee) PersonImpl(org.kuali.rice.kim.impl.identity.PersonImpl) PersonService(org.kuali.rice.kim.api.identity.PersonService) ArrayList(java.util.ArrayList) CuDisbursementPayee(edu.cornell.kfs.fp.businessobject.CuDisbursementPayee) DisbursementPayee(org.kuali.kfs.fp.businessobject.DisbursementPayee) Person(org.kuali.rice.kim.api.identity.Person)

Example 7 with CuDisbursementPayee

use of edu.cornell.kfs.fp.businessobject.CuDisbursementPayee in project cu-kfs by CU-CommunityApps.

the class CuDisbursementPayeeLookupableHelperServiceImpl method getPayeeFromVendor.

protected CuDisbursementPayee getPayeeFromVendor(VendorDetail vendorDetail, Map<String, String> fieldValues) {
    CuDisbursementPayee payee = ((CuDisbursementVoucherPayeeService) disbursementVoucherPayeeService).getPayeeFromVendor(vendorDetail);
    payee.setPaymentReasonCode(fieldValues.get(KFSPropertyConstants.PAYMENT_REASON_CODE));
    return payee;
}
Also used : CuDisbursementPayee(edu.cornell.kfs.fp.businessobject.CuDisbursementPayee) CuDisbursementVoucherPayeeService(edu.cornell.kfs.fp.document.service.CuDisbursementVoucherPayeeService)

Aggregations

CuDisbursementPayee (edu.cornell.kfs.fp.businessobject.CuDisbursementPayee)7 DisbursementPayee (org.kuali.kfs.fp.businessobject.DisbursementPayee)5 CuDisbursementVoucherPayeeService (edu.cornell.kfs.fp.document.service.CuDisbursementVoucherPayeeService)2 ArrayList (java.util.ArrayList)2 Person (org.kuali.rice.kim.api.identity.Person)2 CuDisbursementVoucherDocument (edu.cornell.kfs.fp.document.CuDisbursementVoucherDocument)1 List (java.util.List)1 ParameterService (org.kuali.kfs.coreservice.framework.parameter.ParameterService)1 VendorDetail (org.kuali.kfs.vnd.businessobject.VendorDetail)1 PersonService (org.kuali.rice.kim.api.identity.PersonService)1 EntityAffiliationContract (org.kuali.rice.kim.api.identity.affiliation.EntityAffiliationContract)1 PersonImpl (org.kuali.rice.kim.impl.identity.PersonImpl)1 BusinessObject (org.kuali.rice.krad.bo.BusinessObject)1