Search in sources :

Example 1 with TargetAccountingLine

use of org.kuali.kfs.sys.businessobject.TargetAccountingLine in project cu-kfs by CU-CommunityApps.

the class KualiAccountingDocumentActionBase method performBalanceInquiryForTargetLine.

/**
 * Takes care of storing the action form in the User session and forwarding to the balance inquiry report menu action for a
 * target accounting line.
 *
 * @param mapping
 * @param form
 * @param request
 * @param response
 * @return ActionForward
 * @throws Exception
 */
public ActionForward performBalanceInquiryForTargetLine(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    int lineIndex = getSelectedLine(request);
    TargetAccountingLine line = this.getTargetAccountingLine(form, request);
    return performBalanceInquiryForAccountingLine(mapping, form, request, line);
}
Also used : TargetAccountingLine(org.kuali.kfs.sys.businessobject.TargetAccountingLine)

Example 2 with TargetAccountingLine

use of org.kuali.kfs.sys.businessobject.TargetAccountingLine in project cu-kfs by CU-CommunityApps.

the class KualiAccountingDocumentActionBase method insertTargetLine.

/**
 * This method will add a TargetAccountingLine to a FinancialDocument. This assumes that the user presses the add button for a
 * specific accounting line on the document and that the document is represented by a FinancialDocumentFormBase. It first
 * validates the line for data integrity and then checks appropriate business rules.
 *
 * @param mapping
 * @param form
 * @param request
 * @param response
 * @return ActionForward
 * @throws Exception
 */
public ActionForward insertTargetLine(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    KualiAccountingDocumentFormBase financialDocumentForm = (KualiAccountingDocumentFormBase) form;
    TargetAccountingLine line = financialDocumentForm.getNewTargetLine();
    // populate chartOfAccountsCode from account number if accounts cant cross chart and Javascript is turned off
    // SpringContext.getBean(AccountService.class).populateAccountingLineChartIfNeeded(line);
    boolean rulePassed = true;
    // 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, false, true, 0);
    // check any business rules
    rulePassed &= SpringContext.getBean(KualiRuleService.class).applyRules(new AddAccountingLineEvent(KFSConstants.NEW_TARGET_ACCT_LINE_PROPERTY_NAME, financialDocumentForm.getDocument(), line));
    // if the rule evaluation passed, let's add it
    if (rulePassed) {
        // add accountingLine
        SpringContext.getBean(PersistenceService.class).refreshAllNonUpdatingReferences(line);
        insertAccountingLine(false, financialDocumentForm, line);
        // clear the used newTargetLine
        financialDocumentForm.setNewTargetLine(null);
    }
    return mapping.findForward(KFSConstants.MAPPING_BASIC);
}
Also used : PersistenceService(org.kuali.kfs.krad.service.PersistenceService) AddAccountingLineEvent(org.kuali.kfs.sys.document.validation.event.AddAccountingLineEvent) TargetAccountingLine(org.kuali.kfs.sys.businessobject.TargetAccountingLine) AccountingDocument(org.kuali.kfs.sys.document.AccountingDocument)

Example 3 with TargetAccountingLine

use of org.kuali.kfs.sys.businessobject.TargetAccountingLine 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);
        }
    }
}
Also used : ProcurementCardTargetAccountingLine(org.kuali.kfs.fp.businessobject.ProcurementCardTargetAccountingLine) TargetAccountingLine(org.kuali.kfs.sys.businessobject.TargetAccountingLine) SourceAccountingLine(org.kuali.kfs.sys.businessobject.SourceAccountingLine) ProcurementCardSourceAccountingLine(org.kuali.kfs.fp.businessobject.ProcurementCardSourceAccountingLine) Date(java.sql.Date)

Example 4 with TargetAccountingLine

use of org.kuali.kfs.sys.businessobject.TargetAccountingLine in project cu-kfs by CU-CommunityApps.

the class SalaryExpenseTransferDocument method checkOjbectCodeForWorkstudy.

/**
 * KFSMI-4606 check routeNode condition
 *
 * @return boolean
 */
protected boolean checkOjbectCodeForWorkstudy() {
    Collection<String> workstudyRouteObjectcodes = SpringContext.getBean(ParameterService.class).getParameterValuesAsString(KfsParameterConstants.FINANCIAL_SYSTEM_DOCUMENT.class, KFSConstants.WORKSTUDY_ROUTE_OBJECT_CODES_PARM_NM);
    List<SourceAccountingLine> sourceAccountingLines = getSourceAccountingLines();
    List<TargetAccountingLine> targetAccountingLines = getTargetAccountingLines();
    // check object code in source and target accounting lines
    for (SourceAccountingLine sourceLine : sourceAccountingLines) {
        if (workstudyRouteObjectcodes.contains(sourceLine.getFinancialObjectCode())) {
            return true;
        }
    }
    for (TargetAccountingLine targetLine : targetAccountingLines) {
        if (workstudyRouteObjectcodes.contains(targetLine.getFinancialObjectCode())) {
            return true;
        }
    }
    return false;
}
Also used : ParameterService(org.kuali.kfs.coreservice.framework.parameter.ParameterService) TargetAccountingLine(org.kuali.kfs.sys.businessobject.TargetAccountingLine) KfsParameterConstants(org.kuali.kfs.sys.service.impl.KfsParameterConstants) SourceAccountingLine(org.kuali.kfs.sys.businessobject.SourceAccountingLine)

Example 5 with TargetAccountingLine

use of org.kuali.kfs.sys.businessobject.TargetAccountingLine in project cu-kfs by CU-CommunityApps.

the class AmazonWebServicesBillingServiceImpl method buildToAccountingLine.

private TargetAccountingLine buildToAccountingLine(String diDocumentNumber, AmazonBillingDistributionOfIncomeTransactionDTO transactionDTO) {
    TargetAccountingLine line = new TargetAccountingLine();
    line.setDocumentNumber(diDocumentNumber);
    line.setChartOfAccountsCode(transactionDTO.getChartCode());
    line.setAccountNumber(transactionDTO.getAccountNumber());
    line.setSubAccountNumber(transactionDTO.getSubAccountNumber());
    line.setFinancialObjectCode(transactionDTO.getObjectCodeNumber());
    line.setFinancialSubObjectCode(transactionDTO.getSubObjectCodeNumber());
    line.setProjectCode(transactionDTO.getProjectCodeNumber());
    line.setOrganizationReferenceId(StringUtils.substring(transactionDTO.getOrganizationReferenceId(), 0, 8));
    line.setAmount(transactionDTO.getAmount());
    line.setFinancialDocumentLineDescription(buildAccountingLineDescription());
    line.setSequenceNumber(new Integer(1));
    return line;
}
Also used : TargetAccountingLine(org.kuali.kfs.sys.businessobject.TargetAccountingLine)

Aggregations

TargetAccountingLine (org.kuali.kfs.sys.businessobject.TargetAccountingLine)9 SourceAccountingLine (org.kuali.kfs.sys.businessobject.SourceAccountingLine)4 ProcurementCardTargetAccountingLine (org.kuali.kfs.fp.businessobject.ProcurementCardTargetAccountingLine)2 Date (java.sql.Date)1 ParameterService (org.kuali.kfs.coreservice.framework.parameter.ParameterService)1 ProcurementCardSourceAccountingLine (org.kuali.kfs.fp.businessobject.ProcurementCardSourceAccountingLine)1 ProcurementCardTransactionDetail (org.kuali.kfs.fp.businessobject.ProcurementCardTransactionDetail)1 PersistenceService (org.kuali.kfs.krad.service.PersistenceService)1 AccountingLine (org.kuali.kfs.sys.businessobject.AccountingLine)1 AccountingDocument (org.kuali.kfs.sys.document.AccountingDocument)1 AccountingDocumentBase (org.kuali.kfs.sys.document.AccountingDocumentBase)1 AddAccountingLineEvent (org.kuali.kfs.sys.document.validation.event.AddAccountingLineEvent)1 KfsParameterConstants (org.kuali.kfs.sys.service.impl.KfsParameterConstants)1 ConfigurationService (org.kuali.rice.core.api.config.property.ConfigurationService)1 ActionTaken (org.kuali.rice.kew.api.action.ActionTaken)1