use of org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntry in project cu-kfs by CU-CommunityApps.
the class CuDisbursementVoucherDocument method generateDocumentGeneralLedgerPendingEntries.
@Override
public boolean generateDocumentGeneralLedgerPendingEntries(GeneralLedgerPendingEntrySequenceHelper sequenceHelper) {
if (getGeneralLedgerPendingEntries() == null || getGeneralLedgerPendingEntries().size() < 2) {
LOG.warn("No gl entries for accounting lines.");
return true;
}
/*
* only generate additional charge entries for payment method wire charge, and if the fee has not been waived
*/
if (KFSConstants.PaymentSourceConstants.PAYMENT_METHOD_WIRE.equals(getDisbVchrPaymentMethodCode()) && !getWireTransfer().isWireTransferFeeWaiverIndicator()) {
LOG.debug("generating wire charge gl pending entries.");
// retrieve wire charge
WireCharge wireCharge = getPaymentSourceHelperService().retrieveCurrentYearWireCharge();
// KFSPTS-764: Added if check to eliminate zero dollar wire charge generating zero dollar accounting entries
if (!isZeroDollarWireCharge(wireCharge)) {
// KFSPTS-764: only generate GLPE entries when wire charges are NOT zero dollars.
// generate debits
GeneralLedgerPendingEntry chargeEntry = getPaymentSourceHelperService().processWireChargeDebitEntries(this, sequenceHelper, wireCharge);
// generate credits
getPaymentSourceHelperService().processWireChargeCreditEntries(this, sequenceHelper, wireCharge, chargeEntry);
}
}
// for wire or drafts generate bank offset entry (if enabled), for ACH and checks offset will be generated by PDP
if (KFSConstants.PaymentSourceConstants.PAYMENT_METHOD_WIRE.equals(getDisbVchrPaymentMethodCode()) || KFSConstants.PaymentSourceConstants.PAYMENT_METHOD_DRAFT.equals(getDisbVchrPaymentMethodCode())) {
getPaymentSourceHelperService().generateDocumentBankOffsetEntries(this, sequenceHelper, DisbursementVoucherConstants.DOCUMENT_TYPE_WTFD);
}
return true;
}
use of org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntry in project cu-kfs by CU-CommunityApps.
the class PreEncumbranceDocument method generateGeneralLedgerPendingEntries.
@Override
public boolean generateGeneralLedgerPendingEntries(GeneralLedgerPendingEntrySourceDetail glpeSourceDetail, GeneralLedgerPendingEntrySequenceHelper sequenceHelper) {
// handle the explicit entry
// create a reference to the explicitEntry to be populated, so we can pass to the offset method later
GeneralLedgerPendingEntry explicitEntry = new GeneralLedgerPendingEntry();
processExplicitGeneralLedgerPendingEntry(sequenceHelper, glpeSourceDetail, explicitEntry);
// increment the sequence counter
sequenceHelper.increment();
return true;
}
use of org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntry in project cu-kfs by CU-CommunityApps.
the class CuPendingTransactionServiceImpl method generateDisbursementVoucherReversalEntries.
/**
* Generates the reversal entries for the given input DisbursementVoucherDocument.
*
* @param doc
* the DisbursementVoucherDocument for which we generate the reversal entries
* @param sequenceHelper
*/
protected void generateDisbursementVoucherReversalEntries(DisbursementVoucherDocument doc, GeneralLedgerPendingEntrySequenceHelper sequenceHelper) {
// generate all the pending entries for the document
SpringContext.getBean(GeneralLedgerPendingEntryService.class).generateGeneralLedgerPendingEntries(doc);
// for each pending entry, opposite-ify it and reattach it to the document
List<GeneralLedgerPendingEntry> glpes = doc.getGeneralLedgerPendingEntries();
if (glpes != null && glpes.size() > 0) {
for (GeneralLedgerPendingEntry glpe : glpes) {
if (KFSConstants.GL_CREDIT_CODE.equalsIgnoreCase(glpe.getTransactionDebitCreditCode())) {
glpe.setTransactionDebitCreditCode(KFSConstants.GL_DEBIT_CODE);
} else if (KFSConstants.GL_DEBIT_CODE.equalsIgnoreCase(glpe.getTransactionDebitCreditCode())) {
glpe.setTransactionDebitCreditCode(KFSConstants.GL_CREDIT_CODE);
}
glpe.setTransactionLedgerEntrySequenceNumber(sequenceHelper.getSequenceCounter());
sequenceHelper.increment();
Date transactionTimestamp = new Date(dateTimeService.getCurrentDate().getTime());
AccountingPeriod fiscalPeriod = accountingPeriodService.getByDate(new java.sql.Date(transactionTimestamp.getTime()));
glpe.setFinancialDocumentApprovedCode(KFSConstants.PENDING_ENTRY_APPROVED_STATUS_CODE.APPROVED);
glpe.setUniversityFiscalYear(fiscalPeriod.getUniversityFiscalYear());
glpe.setUniversityFiscalPeriodCode(fiscalPeriod.getUniversityFiscalPeriodCode());
businessObjectService.save(glpe);
}
}
}
use of org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntry in project cu-kfs by CU-CommunityApps.
the class CuGeneralLedgerPendingEntryServiceImplTest method testNotFillinFiscalYrPeriodForNonPCDODoc.
public void testNotFillinFiscalYrPeriodForNonPCDODoc() {
GeneralLedgerPendingEntry glpe = new GeneralLedgerPendingEntry();
glpe.setFinancialDocumentTypeCode(KFSConstants.FinancialDocumentTypeCodes.ADVANCE_DEPOSIT);
glpe.setUniversityFiscalYear(2012);
glpe.setUniversityFiscalPeriodCode("01");
cuGeneralLedgerPendingEntryService.fillInFiscalPeriodYear(glpe);
// 2012/01 is an inactive period; it should not be set to current fiscal yr/period for AD
assertTrue("should not fill in fiscal year", 2012 == glpe.getUniversityFiscalYear());
assertTrue("should not fill in fiscal period code", StringUtils.equals("01", glpe.getUniversityFiscalPeriodCode()));
}
use of org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntry in project cu-kfs by CU-CommunityApps.
the class CuPurapGeneralLedgerServiceImplTest method testGenerateEntriesPaymentRequest.
public void testGenerateEntriesPaymentRequest() throws Exception {
changeCurrentUser(UserNameFixture.ccs1);
PurchaseOrderDocument po = PurchaseOrderFixture.PO_NON_B2B_OPEN_WITH_ITEMS.createPurchaseOrderdDocument(SpringContext.getBean(DocumentService.class));
po.setVendorShippingPaymentTermsCode("AL");
po.setVendorPaymentTermsCode("00N30");
po.refreshNonUpdateableReferences();
changeCurrentUser(UserNameFixture.mo14);
CuPaymentRequestDocument preq = (CuPaymentRequestDocument) PaymentRequestFixture.PAYMENT_REQ_DOC.createPaymentRequestDocument(po.getPurapDocumentIdentifier());
preq.initiateDocument();
preq.populatePaymentRequestFromPurchaseOrder(po);
preq.setPaymentMethodCode("F");
preq.setApplicationDocumentStatus(PurapConstants.PaymentRequestStatuses.APPDOC_AWAITING_ACCOUNTS_PAYABLE_REVIEW);
((PaymentRequestItem) (preq.getItems().get(0))).setExtendedPrice(new KualiDecimal(1));
AccountingDocumentTestUtils.saveDocument(preq, SpringContext.getBean(DocumentService.class));
List<SummaryAccount> summaryAccounts = purapAccountingService.generateSummaryAccountsWithNoZeroTotalsNoUseTax(preq);
cuPurapGeneralLedgerServiceImpl.generateEntriesPaymentRequest(preq, null, summaryAccounts, "create");
boolean noBankOffsetGenerated = true;
for (GeneralLedgerPendingEntry pe : preq.getGeneralLedgerPendingEntries()) {
if (KFSKeyConstants.Bank.DESCRIPTION_GLPE_BANK_OFFSET.equalsIgnoreCase(pe.getTransactionLedgerEntryDescription())) {
noBankOffsetGenerated = false;
break;
}
}
assertEquals(2, preq.getGeneralLedgerPendingEntries().size());
assertTrue(noBankOffsetGenerated);
}
Aggregations