Search in sources :

Example 1 with SystemInformation

use of org.kuali.kfs.module.ar.businessobject.SystemInformation in project cu-kfs by CU-CommunityApps.

the class ContractsGrantsInvoiceDocumentServiceImpl method buildSystemInformationMap.

private Map<String, Object> buildSystemInformationMap(ContractsGrantsInvoiceDocument document) {
    Map<String, Object> primaryKeys = new HashMap<>();
    primaryKeys.put(KFSPropertyConstants.UNIVERSITY_FISCAL_YEAR, document.getAccountingPeriod().getUniversityFiscalYear());
    primaryKeys.put(KFSPropertyConstants.PROCESSING_CHART_OF_ACCT_CD, document.getAccountsReceivableDocumentHeader().getProcessingChartOfAccountCode());
    primaryKeys.put(KFSPropertyConstants.PROCESSING_ORGANIZATION_CODE, document.getAccountsReceivableDocumentHeader().getProcessingOrganizationCode());
    SystemInformation sysInfo = businessObjectService.findByPrimaryKey(SystemInformation.class, primaryKeys);
    Map<String, Object> parameterMap = new HashMap<>();
    if (ObjectUtils.isNotNull(sysInfo)) {
        parameterMap.put(ArPropertyConstants.SYSTEM_INFORMATION + "." + ArPropertyConstants.SystemInformationFields.FEIN_NUMBER, sysInfo.getUniversityFederalEmployerIdentificationNumber());
        parameterMap.put(ArPropertyConstants.SYSTEM_INFORMATION + "." + KFSPropertyConstants.NAME, sysInfo.getOrganizationRemitToAddressName());
        parameterMap.put(ArPropertyConstants.SYSTEM_INFORMATION + "." + KFSPropertyConstants.ADDRESS_LINE1, sysInfo.getOrganizationRemitToLine1StreetAddress());
        parameterMap.put(ArPropertyConstants.SYSTEM_INFORMATION + "." + KFSPropertyConstants.ADDRESS_LINE2, sysInfo.getOrganizationRemitToLine2StreetAddress());
        parameterMap.put(ArPropertyConstants.SYSTEM_INFORMATION + "." + KFSPropertyConstants.CITY, sysInfo.getOrganizationRemitToCityName());
        parameterMap.put(ArPropertyConstants.SYSTEM_INFORMATION + "." + KFSPropertyConstants.STATE, sysInfo.getOrganizationRemitToStateCode());
        parameterMap.put(ArPropertyConstants.SYSTEM_INFORMATION + "." + KFSPropertyConstants.ZIPCODE, sysInfo.getOrganizationRemitToZipCode());
    }
    return parameterMap;
}
Also used : HashMap(java.util.HashMap) SystemInformation(org.kuali.kfs.module.ar.businessobject.SystemInformation)

Example 2 with SystemInformation

use of org.kuali.kfs.module.ar.businessobject.SystemInformation in project cu-kfs by CU-CommunityApps.

the class CustomerInvoiceDetailServiceImpl method getDiscountCustomerInvoiceDetail.

@Override
public CustomerInvoiceDetail getDiscountCustomerInvoiceDetail(CustomerInvoiceDetail customerInvoiceDetail, Integer universityFiscalYear, String chartOfAccountsCode, String organizationCode) {
    CustomerInvoiceDetail discountCustomerInvoiceDetail = (CustomerInvoiceDetail) ObjectUtils.deepCopy(customerInvoiceDetail);
    discountCustomerInvoiceDetail.setInvoiceItemUnitPriceToNegative();
    discountCustomerInvoiceDetail.updateAmountBasedOnQuantityAndUnitPrice();
    discountCustomerInvoiceDetail.setInvoiceItemDescription(ArConstants.DISCOUNT_PREFIX + StringUtils.trimToEmpty(customerInvoiceDetail.getInvoiceItemDescription()));
    Map<String, Object> criteria = new HashMap<>();
    criteria.put("universityFiscalYear", universityFiscalYear);
    criteria.put("processingChartOfAccountCode", chartOfAccountsCode);
    criteria.put("processingOrganizationCode", organizationCode);
    SystemInformation systemInformation = businessObjectService.findByPrimaryKey(SystemInformation.class, criteria);
    if (ObjectUtils.isNotNull(systemInformation)) {
        discountCustomerInvoiceDetail.setFinancialObjectCode(systemInformation.getDiscountObjectCode());
    }
    return discountCustomerInvoiceDetail;
}
Also used : HashMap(java.util.HashMap) SystemInformation(org.kuali.kfs.module.ar.businessobject.SystemInformation) AccountsReceivableCustomerInvoiceDetail(org.kuali.kfs.integration.ar.AccountsReceivableCustomerInvoiceDetail) CustomerInvoiceDetail(org.kuali.kfs.module.ar.businessobject.CustomerInvoiceDetail)

Aggregations

HashMap (java.util.HashMap)2 SystemInformation (org.kuali.kfs.module.ar.businessobject.SystemInformation)2 AccountsReceivableCustomerInvoiceDetail (org.kuali.kfs.integration.ar.AccountsReceivableCustomerInvoiceDetail)1 CustomerInvoiceDetail (org.kuali.kfs.module.ar.businessobject.CustomerInvoiceDetail)1