Search in sources :

Example 1 with ContractsGrantsInvoiceObjectCode

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

the class ContractsGrantsInvoiceDocumentServiceImpl method createSourceAccountingLine.

protected CustomerInvoiceDetail createSourceAccountingLine(String docNum, String coaCode, String acctNum, SubFundGroup subFundGroup, KualiDecimal totalAmount, Integer seqNum) {
    CustomerInvoiceDetail cid = new CustomerInvoiceDetail();
    cid.setDocumentNumber(docNum);
    cid.setAccountNumber(acctNum);
    cid.setChartOfAccountsCode(coaCode);
    ContractsGrantsInvoiceObjectCode cgbiObjectCode = contractGrantsInvoiceObjectCodeForSubFundGroup(subFundGroup, coaCode);
    if (cgbiObjectCode != null) {
        cid.setFinancialObjectCode(cgbiObjectCode.getIncomeFinancialObjectCode());
        // To get AR Object codes for the GLPEs .... as it is not being called implicitly.
        cid.setAccountsReceivableObjectCode(cgbiObjectCode.getReceivableFinancialObjectCode());
    }
    cid.setSequenceNumber(seqNum);
    cid.setInvoiceItemQuantity(BigDecimal.ONE);
    cid.setInvoiceItemUnitOfMeasureCode(ArConstants.CUSTOMER_INVOICE_DETAIL_UOM_DEFAULT);
    cid.setInvoiceItemUnitPrice(totalAmount);
    cid.setAmount(totalAmount);
    if (totalAmount.isNegative()) {
        cid.setInvoiceItemDiscountLineNumber(seqNum);
    }
    return cid;
}
Also used : ContractsGrantsInvoiceObjectCode(org.kuali.kfs.module.ar.businessobject.ContractsGrantsInvoiceObjectCode) CustomerInvoiceDetail(org.kuali.kfs.module.ar.businessobject.CustomerInvoiceDetail)

Aggregations

ContractsGrantsInvoiceObjectCode (org.kuali.kfs.module.ar.businessobject.ContractsGrantsInvoiceObjectCode)1 CustomerInvoiceDetail (org.kuali.kfs.module.ar.businessobject.CustomerInvoiceDetail)1