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();
}
Aggregations