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);
}
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;
}
Aggregations