Search in sources :

Example 1 with AchIncomeTransaction

use of edu.cornell.kfs.fp.businessobject.AchIncomeTransaction in project cu-kfs by CU-CommunityApps.

the class AdvanceDepositServiceImpl method createDocuments.

/**
 * @see AdvanceDepositService#createDocuments()
 */
public void createDocuments() {
    List<AchIncomeTransaction> transactions = (List<AchIncomeTransaction>) businessObjectService.findMatchingOrderBy(AchIncomeTransaction.class, new HashMap<String, Object>(), ACH_TRANSACTION_SEQUENCE_NUMBER, true);
    for (AchIncomeTransaction transaction : transactions) {
        AdvanceDepositDocument document = createAdvanceDepositDocument(transaction);
        saveDocument(document);
        createNotes(transaction, document);
    }
}
Also used : AchIncomeTransaction(edu.cornell.kfs.fp.businessobject.AchIncomeTransaction) HashMap(java.util.HashMap) AdvanceDepositDocument(org.kuali.kfs.fp.document.AdvanceDepositDocument) List(java.util.List) ArrayList(java.util.ArrayList)

Example 2 with AchIncomeTransaction

use of edu.cornell.kfs.fp.businessobject.AchIncomeTransaction in project cu-kfs by CU-CommunityApps.

the class AdvanceDepositServiceImpl method loadAchIncomeTransactions.

private void loadAchIncomeTransactions(Object parsedObject) {
    List<AchIncomeTransaction> achIncomeTransactions = new ArrayList();
    List<AchIncomeFile> achIncomeFiles = (List<AchIncomeFile>) parsedObject;
    for (AchIncomeFile achIncomeFile : achIncomeFiles) {
        setAchTransactions(achIncomeFile, achIncomeTransactions);
    }
    saveTransaction(achIncomeTransactions);
}
Also used : AchIncomeTransaction(edu.cornell.kfs.fp.businessobject.AchIncomeTransaction) ArrayList(java.util.ArrayList) AchIncomeFile(edu.cornell.kfs.fp.businessobject.AchIncomeFile) List(java.util.List) ArrayList(java.util.ArrayList)

Example 3 with AchIncomeTransaction

use of edu.cornell.kfs.fp.businessobject.AchIncomeTransaction in project cu-kfs by CU-CommunityApps.

the class AdvanceDepositServiceImpl method setAchTransactions.

protected void setAchTransactions(AchIncomeFile achIncomeFile, List achIncomeTransactions) {
    Timestamp bankTimestamp = getFormattedTimestamp(achIncomeFile, "fileDate/time");
    for (AchIncomeFileGroup achIncomeFileGroup : achIncomeFile.getGroups()) {
        for (AchIncomeFileTransactionSet achIncomeFileTransactionSet : achIncomeFileGroup.getTransactionSets()) {
            for (AchIncomeFileTransaction achIncomeFileTransaction : achIncomeFileTransactionSet.getTransactionGuts()) {
                if (KFSConstants.GL_CREDIT_CODE.equals(achIncomeFileTransaction.getCreditDebitIndicator())) {
                    AchIncomeTransaction achIncomeTransaction = new AchIncomeTransaction();
                    achIncomeTransaction.setPaymentMethodCode(achIncomeFileTransaction.getPaymentMethodCode());
                    achIncomeTransaction.setEffectiveDate(achIncomeFileTransaction.getEffectiveDate());
                    achIncomeTransaction.setLoadTimestamp(dateTimeService.getCurrentTimestamp());
                    achIncomeTransaction.setBankTimestamp(bankTimestamp);
                    achIncomeTransaction.setTransactionAmount(achIncomeFileTransaction.getTransactionAmount());
                    achIncomeTransaction.setPayerName(truncatePayerNameIfNecessary(achIncomeFileTransaction));
                    achIncomeTransaction.setNotes(createNotes(achIncomeFileTransaction));
                    achIncomeTransactions.add(achIncomeTransaction);
                }
            }
        }
    }
}
Also used : AchIncomeFileTransaction(edu.cornell.kfs.fp.businessobject.AchIncomeFileTransaction) AchIncomeTransaction(edu.cornell.kfs.fp.businessobject.AchIncomeTransaction) AchIncomeFileGroup(edu.cornell.kfs.fp.businessobject.AchIncomeFileGroup) AchIncomeFileTransactionSet(edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionSet) Timestamp(java.sql.Timestamp)

Example 4 with AchIncomeTransaction

use of edu.cornell.kfs.fp.businessobject.AchIncomeTransaction in project cu-kfs by CU-CommunityApps.

the class AdvanceDepositServiceImplTest method testCreateSourceAccountingLineMatchingNote.

@Test
public void testCreateSourceAccountingLineMatchingNote() {
    AchIncomeTransaction transaction = new AchIncomeTransaction();
    List<AchIncomeNote> notes = setupNotes("an ARMY of one");
    transaction.setNotes(notes);
    advanceDepositService.createSourceAccountingLine(transaction, advanceDepositDocument);
    assertNotNull(advanceDepositDocument.getSourceAccountingLines());
    assertEquals(1, advanceDepositDocument.getSourceAccountingLines().size());
    assertEquals("CU", advanceDepositDocument.getSourceAccountingLine(0).getChartOfAccountsCode());
    assertEquals("5000", advanceDepositDocument.getSourceAccountingLine(0).getFinancialObjectCode());
    assertEquals("1234567", advanceDepositDocument.getSourceAccountingLine(0).getAccountNumber());
}
Also used : AchIncomeTransaction(edu.cornell.kfs.fp.businessobject.AchIncomeTransaction) AchIncomeNote(edu.cornell.kfs.fp.businessobject.AchIncomeNote) Test(org.junit.Test)

Example 5 with AchIncomeTransaction

use of edu.cornell.kfs.fp.businessobject.AchIncomeTransaction in project cu-kfs by CU-CommunityApps.

the class AdvanceDepositServiceImplTest method testSetupSourceAccountingLine_NegativeAmount.

@Test
public void testSetupSourceAccountingLine_NegativeAmount() {
    SourceAccountingLine sourceAccountingLine = new SourceAccountingLine();
    AchIncomeTransaction achIncomeTransaction = new AchIncomeTransaction();
    achIncomeTransaction.setTransactionAmount(new KualiDecimal(10));
    advanceDepositService.setupSourceAccountingLine(achIncomeTransaction, advanceDepositDocument, "IT", EXPENSE_OBJECT_CODE, "1234567");
    assertEquals("Accounting line amount should be the transaction amount negated", achIncomeTransaction.getTransactionAmount().negated(), advanceDepositDocument.getSourceAccountingLine(0).getAmount());
}
Also used : AchIncomeTransaction(edu.cornell.kfs.fp.businessobject.AchIncomeTransaction) KualiDecimal(org.kuali.rice.core.api.util.type.KualiDecimal) SourceAccountingLine(org.kuali.kfs.sys.businessobject.SourceAccountingLine) Test(org.junit.Test)

Aggregations

AchIncomeTransaction (edu.cornell.kfs.fp.businessobject.AchIncomeTransaction)7 Test (org.junit.Test)4 AchIncomeNote (edu.cornell.kfs.fp.businessobject.AchIncomeNote)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 SourceAccountingLine (org.kuali.kfs.sys.businessobject.SourceAccountingLine)2 KualiDecimal (org.kuali.rice.core.api.util.type.KualiDecimal)2 AchIncomeFile (edu.cornell.kfs.fp.businessobject.AchIncomeFile)1 AchIncomeFileGroup (edu.cornell.kfs.fp.businessobject.AchIncomeFileGroup)1 AchIncomeFileTransaction (edu.cornell.kfs.fp.businessobject.AchIncomeFileTransaction)1 AchIncomeFileTransactionSet (edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionSet)1 Timestamp (java.sql.Timestamp)1 HashMap (java.util.HashMap)1 AdvanceDepositDocument (org.kuali.kfs.fp.document.AdvanceDepositDocument)1