Search in sources :

Example 1 with AssetGlobal

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

the class GlLineServiceImpl method createAssetGlobalDocument.

/**
 * @see GlLineService#createAssetGlobalDocument(List,
 * GeneralLedgerEntry)
 */
@Override
@NonTransactional
public Document createAssetGlobalDocument(GeneralLedgerEntry primary, Integer capitalAssetLineNumber) throws WorkflowException {
    // initiate a new document
    MaintenanceDocument document = (MaintenanceDocument) documentService.getNewDocument(DocumentTypeName.ASSET_ADD_GLOBAL);
    // create asset global
    AssetGlobal assetGlobal = createAssetGlobal(primary, document);
    assetGlobal.setCapitalAssetBuilderOriginIndicator(true);
    assetGlobal.setAcquisitionTypeCode(assetGlobalService.getNewAcquisitionTypeCode());
    updatePreTagInformation(primary, document, assetGlobal, capitalAssetLineNumber);
    assetGlobal.getAssetPaymentDetails().addAll(createAssetPaymentDetails(primary, document, 0, capitalAssetLineNumber));
    // save the document
    document.getNewMaintainableObject().setMaintenanceAction(KRADConstants.MAINTENANCE_NEW_ACTION);
    document.getDocumentHeader().setDocumentDescription(CAB_DESC_PREFIX + primary.getDocumentNumber());
    document.getNewMaintainableObject().setBusinessObject(assetGlobal);
    document.getNewMaintainableObject().setBoClass(assetGlobal.getClass());
    documentService.saveDocument(document);
    // mark the capital asset as processed..
    markCapitalAssetProcessed(primary, capitalAssetLineNumber);
    deactivateGLEntries(primary, document, capitalAssetLineNumber);
    return document;
}
Also used : MaintenanceDocument(org.kuali.kfs.kns.document.MaintenanceDocument) AssetGlobal(org.kuali.kfs.module.cam.businessobject.AssetGlobal) NonTransactional(org.kuali.kfs.sys.service.NonTransactional)

Example 2 with AssetGlobal

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

the class GlLineServiceImpl method createAssetGlobal.

/**
 * Creates asset global
 *
 * @param entry GeneralLedgerEntry
 * @param maintDoc MaintenanceDocument
 * @return AssetGlobal
 */
protected AssetGlobal createAssetGlobal(GeneralLedgerEntry entry, MaintenanceDocument maintDoc) {
    AssetGlobal assetGlobal = new AssetGlobal();
    assetGlobal.setOrganizationOwnerChartOfAccountsCode(entry.getChartOfAccountsCode());
    assetGlobal.setOrganizationOwnerAccountNumber(entry.getAccountNumber());
    assetGlobal.setDocumentNumber(maintDoc.getDocumentNumber());
    assetGlobal.setConditionCode(CamsConstants.Asset.CONDITION_CODE_E);
    // CSU 6702 BEGIN
    // year end changes
    String docType = DocumentTypeName.ASSET_ADD_GLOBAL;
    ParameterEvaluator evaluator = parameterEvaluatorService.getParameterEvaluator(KFSConstants.CoreModuleNamespaces.KFS, KfsParameterConstants.YEAR_END_ACCOUNTING_PERIOD_PARAMETER_NAMES.DETAIL_PARAMETER_TYPE, KfsParameterConstants.YEAR_END_ACCOUNTING_PERIOD_PARAMETER_NAMES.FISCAL_PERIOD_SELECTION_DOCUMENT_TYPES, docType);
    if (evaluator.evaluationSucceeds()) {
        Integer closingYear = new Integer(parameterService.getParameterValueAsString(KfsParameterConstants.GENERAL_LEDGER_BATCH.class, GeneralLedgerConstants.ANNUAL_CLOSING_FISCAL_YEAR_PARM));
        if (entry.getUniversityFiscalYear().equals(closingYear + 1)) {
            // default asset global year end accounting period drop down to current period instead of closing period(period 13)
            assetGlobal.setUniversityFiscalPeriodName("");
        }
    }
    return assetGlobal;
}
Also used : AssetGlobal(org.kuali.kfs.module.cam.businessobject.AssetGlobal) ParameterEvaluator(org.kuali.rice.core.api.parameter.ParameterEvaluator)

Example 3 with AssetGlobal

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

the class CuAssetGlobalServiceImplTest method testSetupAsset.

public void testSetupAsset() {
    AssetGlobal assetGlobal = AssetGlobalFixture.ONE.createAssetGlobal();
    AssetGlobalDetail assetGlobalDetail = AssetGlobalDetailFixture.ONE.createAssetGlobalDetail();
    Asset asset = assetGlobalService.setupAsset(assetGlobal, assetGlobalDetail, false);
    assertTrue("Asset was not null", null != asset);
    LOG.info("Asset created was not null");
}
Also used : AssetGlobalDetail(org.kuali.kfs.module.cam.businessobject.AssetGlobalDetail) AssetGlobal(org.kuali.kfs.module.cam.businessobject.AssetGlobal) Asset(org.kuali.kfs.module.cam.businessobject.Asset)

Aggregations

AssetGlobal (org.kuali.kfs.module.cam.businessobject.AssetGlobal)3 MaintenanceDocument (org.kuali.kfs.kns.document.MaintenanceDocument)1 Asset (org.kuali.kfs.module.cam.businessobject.Asset)1 AssetGlobalDetail (org.kuali.kfs.module.cam.businessobject.AssetGlobalDetail)1 NonTransactional (org.kuali.kfs.sys.service.NonTransactional)1 ParameterEvaluator (org.kuali.rice.core.api.parameter.ParameterEvaluator)1