Search in sources :

Example 6 with CapitalAssetInformationDocumentBase

use of org.kuali.kfs.fp.document.CapitalAssetInformationDocumentBase in project cu-kfs by CU-CommunityApps.

the class CapitalAssetInformationActionBase method setupIntialNextCapitalAssetLineNumber.

/**
 * setups the next capital asset line number
 *
 * @param kualiDocumentFormBase
 */
protected void setupIntialNextCapitalAssetLineNumber(KualiDocumentFormBase kualiDocumentFormBase) {
    KualiAccountingDocumentFormBase kadfb = (KualiAccountingDocumentFormBase) kualiDocumentFormBase;
    CapitalAssetInformationDocumentBase caidb = (CapitalAssetInformationDocumentBase) kadfb.getFinancialDocument();
    List<CapitalAssetInformation> currentCapitalAssetInformation = this.getCurrentCapitalAssetInformationObject(kadfb);
    for (CapitalAssetInformation capitalAsset : currentCapitalAssetInformation) {
        if (capitalAsset.getCapitalAssetLineNumber() > caidb.getNextCapitalAssetLineNumber()) {
            caidb.setNextCapitalAssetLineNumber(capitalAsset.getCapitalAssetLineNumber());
        }
    }
    caidb.setNextCapitalAssetLineNumber(caidb.getNextCapitalAssetLineNumber() + 1);
}
Also used : CapitalAssetInformation(org.kuali.kfs.fp.businessobject.CapitalAssetInformation) CapitalAssetInformationDocumentBase(org.kuali.kfs.fp.document.CapitalAssetInformationDocumentBase) KualiAccountingDocumentFormBase(org.kuali.kfs.sys.web.struts.KualiAccountingDocumentFormBase)

Example 7 with CapitalAssetInformationDocumentBase

use of org.kuali.kfs.fp.document.CapitalAssetInformationDocumentBase in project cu-kfs by CU-CommunityApps.

the class CapitalAssetInformationActionBase method getCurrentCapitalAssetInformationObject.

/**
 * get the capital asset information object currently associated with the document
 */
protected List<CapitalAssetInformation> getCurrentCapitalAssetInformationObject(KualiAccountingDocumentFormBase kualiAccountingDocumentFormBase) {
    LOG.debug("getCurrentCapitalAssetInformationObject() - start");
    CapitalAssetInformationDocumentBase capitalAssetInformationDocumentBase = (CapitalAssetInformationDocumentBase) kualiAccountingDocumentFormBase.getFinancialDocument();
    if (!(capitalAssetInformationDocumentBase instanceof CapitalAssetEditable)) {
        return null;
    }
    List<CapitalAssetInformation> capitalAssetInformation = capitalAssetInformationDocumentBase.getCapitalAssetInformation();
    return capitalAssetInformation;
}
Also used : CapitalAssetInformation(org.kuali.kfs.fp.businessobject.CapitalAssetInformation) CapitalAssetInformationDocumentBase(org.kuali.kfs.fp.document.CapitalAssetInformationDocumentBase) CapitalAssetEditable(org.kuali.kfs.fp.document.CapitalAssetEditable)

Aggregations

CapitalAssetInformationDocumentBase (org.kuali.kfs.fp.document.CapitalAssetInformationDocumentBase)7 CapitalAssetInformation (org.kuali.kfs.fp.businessobject.CapitalAssetInformation)6 ArrayList (java.util.ArrayList)1 CapitalAccountingLines (org.kuali.kfs.fp.businessobject.CapitalAccountingLines)1 CapitalAccountingLinesDocumentBase (org.kuali.kfs.fp.document.CapitalAccountingLinesDocumentBase)1 CapitalAssetEditable (org.kuali.kfs.fp.document.CapitalAssetEditable)1 KualiAccountingDocumentFormBase (org.kuali.kfs.sys.web.struts.KualiAccountingDocumentFormBase)1 KualiDecimal (org.kuali.rice.core.api.util.type.KualiDecimal)1