Search in sources :

Example 1 with CustomerExtendedAttribute

use of edu.cornell.kfs.module.ar.businessobject.CustomerExtendedAttribute in project cu-kfs by CU-CommunityApps.

the class CuContractsGrantsInvoiceDocumentServiceImpl method getCustomerNetTerms.

/*
     * CUMod: KFSPTS-15342
     */
protected Optional<Integer> getCustomerNetTerms(ContractsGrantsInvoiceDocument document) {
    Customer customer = null;
    AccountsReceivableDocumentHeader documentHeader = document.getAccountsReceivableDocumentHeader();
    if (ObjectUtils.isNotNull(documentHeader)) {
        documentHeader.refreshReferenceObject(ArPropertyConstants.CustomerInvoiceDocumentFields.CUSTOMER);
        customer = documentHeader.getCustomer();
    }
    if (ObjectUtils.isNotNull(customer)) {
        CustomerExtendedAttribute customerExtension = (CustomerExtendedAttribute) customer.getExtension();
        if (ObjectUtils.isNotNull(customerExtension)) {
            return Optional.ofNullable(customerExtension.getNetTermsInDays());
        }
    }
    return Optional.empty();
}
Also used : Customer(org.kuali.kfs.module.ar.businessobject.Customer) CustomerExtendedAttribute(edu.cornell.kfs.module.ar.businessobject.CustomerExtendedAttribute) AccountsReceivableDocumentHeader(org.kuali.kfs.module.ar.businessobject.AccountsReceivableDocumentHeader)

Aggregations

CustomerExtendedAttribute (edu.cornell.kfs.module.ar.businessobject.CustomerExtendedAttribute)1 AccountsReceivableDocumentHeader (org.kuali.kfs.module.ar.businessobject.AccountsReceivableDocumentHeader)1 Customer (org.kuali.kfs.module.ar.businessobject.Customer)1