Search in sources :

Example 1 with GeneralLedgerEntryAsset

use of org.kuali.kfs.module.cam.businessobject.GeneralLedgerEntryAsset in project cu-kfs by CU-CommunityApps.

the class GlLineServiceImpl method createGeneralLedgerEntryAsset.

protected void createGeneralLedgerEntryAsset(GeneralLedgerEntry entry, Document document, Integer capitalAssetLineNumber) {
    // KFSMI-9645 : check if the document is already referenced to prevent an OJB locking error
    for (GeneralLedgerEntryAsset glEntryAsset : entry.getGeneralLedgerEntryAssets()) {
        if (glEntryAsset.getCapitalAssetManagementDocumentNumber().equals(document.getDocumentNumber()) && glEntryAsset.getCapitalAssetBuilderLineNumber().equals(capitalAssetLineNumber)) {
            // an object with this key already exists, abort and don't attempt to add another
            return;
        }
    }
    // If we get here, add a child record with the document number
    GeneralLedgerEntryAsset entryAsset = new GeneralLedgerEntryAsset();
    entryAsset.setGeneralLedgerAccountIdentifier(entry.getGeneralLedgerAccountIdentifier());
    entryAsset.setCapitalAssetBuilderLineNumber(capitalAssetLineNumber);
    entryAsset.setCapitalAssetManagementDocumentNumber(document.getDocumentNumber());
    entry.getGeneralLedgerEntryAssets().add(entryAsset);
}
Also used : GeneralLedgerEntryAsset(org.kuali.kfs.module.cam.businessobject.GeneralLedgerEntryAsset)

Aggregations

GeneralLedgerEntryAsset (org.kuali.kfs.module.cam.businessobject.GeneralLedgerEntryAsset)1