use of org.kuali.kfs.sys.businessobject.SourceAccountingLine in project cu-kfs by CU-CommunityApps.
the class AdvanceDepositServiceImpl method setupSourceAccountingLine.
protected void setupSourceAccountingLine(AchIncomeTransaction transaction, AdvanceDepositDocument advanceDepositDocument, String chart, String objectCode, String account) {
SourceAccountingLine sourceAccountingLine = new SourceAccountingLine();
sourceAccountingLine.setSequenceNumber(advanceDepositDocument.getNextSourceLineNumber());
sourceAccountingLine.setChartOfAccountsCode(chart);
sourceAccountingLine.setPostingYear(getSourceAccountingLinePostingYear(sourceAccountingLine));
sourceAccountingLine.setFinancialObjectCode(objectCode);
setSourceAccountingLineAccountNumber(account, sourceAccountingLine);
sourceAccountingLine.setFinancialDocumentLineDescription(transaction.getPayerName());
setSourceAccountingLineAmount(transaction, sourceAccountingLine, chart, objectCode);
sourceAccountingLine.setOverrideCode(AccountingLineOverride.CODE.NONE);
sourceAccountingLine.setPostingYear(advanceDepositDocument.getPostingYear());
sourceAccountingLine.setDocumentNumber(advanceDepositDocument.getDocumentNumber());
List<SourceAccountingLine> sourceLines = new ArrayList<>();
sourceLines.add(sourceAccountingLine);
advanceDepositDocument.setSourceAccountingLines(sourceLines);
}
use of org.kuali.kfs.sys.businessobject.SourceAccountingLine in project cu-kfs by CU-CommunityApps.
the class PurchasingAccountsPayableDocumentBase method populateAccountsForRouting.
/**
* Makes sure that accounts for routing has been generated, so that other information can be retrieved from that
*/
protected void populateAccountsForRouting() {
SpringContext.getBean(PurapAccountingService.class).updateAccountAmounts(this);
setAccountsForRouting(SpringContext.getBean(PurapAccountingService.class).generateSummary(getItems()));
// need to refresh to get the references for the searchable attributes (ie status) and for invoking route levels (ie account
// objects) -hjs
refreshNonUpdateableReferences();
for (SourceAccountingLine sourceLine : getAccountsForRouting()) {
sourceLine.refreshNonUpdateableReferences();
}
}
use of org.kuali.kfs.sys.businessobject.SourceAccountingLine in project cu-kfs by CU-CommunityApps.
the class KualiAccountingDocumentActionBase method insertSourceLine.
/**
* This action executes an insert of a SourceAccountingLine into a document only after validating the accounting line and
* checking any appropriate business rules.
*
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
* @throws Exception
*/
public ActionForward insertSourceLine(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
KualiAccountingDocumentFormBase financialDocumentForm = (KualiAccountingDocumentFormBase) form;
SourceAccountingLine line = financialDocumentForm.getNewSourceLine();
// populate chartOfAccountsCode from account number if accounts cant cross chart and Javascript is turned off
// SpringContext.getBean(AccountService.class).populateAccountingLineChartIfNeeded(line);
boolean rulePassed = true;
// DV acct line amount got error during form populate; should not insert this line. KFSUPGRADE-847
MessageMap msgMap = GlobalVariables.getMessageMap();
if (msgMap.hasErrors() && msgMap.getErrorMessages().keySet().contains("newSourceLine.amount") && financialDocumentForm.getDocument() instanceof DisbursementVoucherDocument) {
rulePassed = false;
}
// before we check the regular rules we need to check the sales tax rules
// TODO: Refactor rules so we no longer have to call this before a copy of the
// accountingLine
rulePassed &= checkSalesTax((AccountingDocument) financialDocumentForm.getDocument(), line, true, true, 0);
// check any business rules
rulePassed &= SpringContext.getBean(KualiRuleService.class).applyRules(new AddAccountingLineEvent(KFSConstants.NEW_SOURCE_ACCT_LINE_PROPERTY_NAME, financialDocumentForm.getDocument(), line));
if (rulePassed) {
// add accountingLine
SpringContext.getBean(PersistenceService.class).refreshAllNonUpdatingReferences(line);
insertAccountingLine(true, financialDocumentForm, line);
// clear the used newTargetLine
financialDocumentForm.setNewSourceLine(null);
}
return mapping.findForward(KFSConstants.MAPPING_BASIC);
}
use of org.kuali.kfs.sys.businessobject.SourceAccountingLine in project cu-kfs by CU-CommunityApps.
the class KualiAccountingDocumentActionBase method getSourceAccountingLine.
/**
* This method is a helper method that will return a source accounting line. The reason we're making it protected in here is so
* that we can override this method in some of the modules. PurchasingActionBase is one of the subclasses that will be
* overriding this, because in PurchasingActionBase, we'll need to get the source accounting line using both an item index and
* an account index.
*
* @param form
* @param request
* @param isSource
* @return
*/
protected SourceAccountingLine getSourceAccountingLine(ActionForm form, HttpServletRequest request) {
int lineIndex = getSelectedLine(request);
SourceAccountingLine line = (SourceAccountingLine) ObjectUtils.deepCopy(((KualiAccountingDocumentFormBase) form).getFinancialDocument().getSourceAccountingLine(lineIndex));
return line;
}
use of org.kuali.kfs.sys.businessobject.SourceAccountingLine in project cu-kfs by CU-CommunityApps.
the class CuProcurementCardDocument method customizeExplicitGeneralLedgerPendingEntry.
@Override
public void customizeExplicitGeneralLedgerPendingEntry(GeneralLedgerPendingEntrySourceDetail postable, GeneralLedgerPendingEntry explicitEntry) {
Date temp = getProcurementCardTransactionPostingDetailDate();
if (temp != null && allowBackpost(temp)) {
Integer prevFiscYr = getPreviousFiscalYear();
explicitEntry.setUniversityFiscalPeriodCode(FINAL_ACCOUNTING_PERIOD);
explicitEntry.setUniversityFiscalYear(prevFiscYr);
List<SourceAccountingLine> srcLines = getSourceAccountingLines();
for (SourceAccountingLine src : srcLines) {
src.setPostingYear(prevFiscYr);
}
List<TargetAccountingLine> trgLines = getTargetAccountingLines();
for (TargetAccountingLine trg : trgLines) {
trg.setPostingYear(prevFiscYr);
}
}
}
Aggregations