Search in sources :

Example 1 with OrganizationAccountingDefault

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

the class CustomerInvoiceDetailServiceImpl method getCustomerInvoiceDetailFromOrganizationAccountingDefault.

@Override
public CustomerInvoiceDetail getCustomerInvoiceDetailFromOrganizationAccountingDefault(Integer universityFiscalYear, String chartOfAccountsCode, String organizationCode) {
    CustomerInvoiceDetail customerInvoiceDetail = new CustomerInvoiceDetail();
    Map<String, Object> criteria = new HashMap<>();
    criteria.put("universityFiscalYear", universityFiscalYear);
    criteria.put("chartOfAccountsCode", chartOfAccountsCode);
    criteria.put("organizationCode", organizationCode);
    OrganizationAccountingDefault organizationAccountingDefault = businessObjectService.findByPrimaryKey(OrganizationAccountingDefault.class, criteria);
    if (ObjectUtils.isNotNull(organizationAccountingDefault)) {
        customerInvoiceDetail.setChartOfAccountsCode(organizationAccountingDefault.getDefaultInvoiceChartOfAccountsCode());
        customerInvoiceDetail.setAccountNumber(organizationAccountingDefault.getDefaultInvoiceAccountNumber());
        customerInvoiceDetail.setSubAccountNumber(organizationAccountingDefault.getDefaultInvoiceSubAccountNumber());
        customerInvoiceDetail.setFinancialObjectCode(organizationAccountingDefault.getDefaultInvoiceFinancialObjectCode());
        customerInvoiceDetail.setFinancialSubObjectCode(organizationAccountingDefault.getDefaultInvoiceFinancialSubObjectCode());
        customerInvoiceDetail.setProjectCode(organizationAccountingDefault.getDefaultInvoiceProjectCode());
        customerInvoiceDetail.setOrganizationReferenceId(organizationAccountingDefault.getDefaultInvoiceOrganizationReferenceIdentifier());
    }
    customerInvoiceDetail.setInvoiceItemTaxAmount(new KualiDecimal(0.00));
    customerInvoiceDetail.setInvoiceItemQuantity(new BigDecimal(1));
    customerInvoiceDetail.setInvoiceItemUnitOfMeasureCode(ArConstants.CUSTOMER_INVOICE_DETAIL_UOM_DEFAULT);
    customerInvoiceDetail.setTaxableIndicator(false);
    return customerInvoiceDetail;
}
Also used : OrganizationAccountingDefault(org.kuali.kfs.module.ar.businessobject.OrganizationAccountingDefault) HashMap(java.util.HashMap) AccountsReceivableCustomerInvoiceDetail(org.kuali.kfs.integration.ar.AccountsReceivableCustomerInvoiceDetail) CustomerInvoiceDetail(org.kuali.kfs.module.ar.businessobject.CustomerInvoiceDetail) KualiDecimal(org.kuali.kfs.core.api.util.type.KualiDecimal) BigDecimal(java.math.BigDecimal)

Aggregations

BigDecimal (java.math.BigDecimal)1 HashMap (java.util.HashMap)1 KualiDecimal (org.kuali.kfs.core.api.util.type.KualiDecimal)1 AccountsReceivableCustomerInvoiceDetail (org.kuali.kfs.integration.ar.AccountsReceivableCustomerInvoiceDetail)1 CustomerInvoiceDetail (org.kuali.kfs.module.ar.businessobject.CustomerInvoiceDetail)1 OrganizationAccountingDefault (org.kuali.kfs.module.ar.businessobject.OrganizationAccountingDefault)1