Search in sources :

Example 6 with CapitalAssetInformationDetail

use of org.kuali.kfs.fp.businessobject.CapitalAssetInformationDetail in project cu-kfs by CU-CommunityApps.

the class GlLineServiceImpl method updatePreTagInformation.

/**
 * This method reads the pre-tag information and creates objects for asset global document
 *
 * @param entry GL Line
 * @param document Asset Global Maintenance Document
 * @param assetGlobal Asset Global Object
 */
protected void updatePreTagInformation(GeneralLedgerEntry entry, MaintenanceDocument document, AssetGlobal assetGlobal, Integer capitalAssetLineNumber) {
    CapitalAssetInformation capitalAssetInformation = findCapitalAssetInformation(entry.getDocumentNumber(), capitalAssetLineNumber);
    // if it is create asset...
    if (ObjectUtils.isNotNull(capitalAssetInformation)) {
        if (KFSConstants.CapitalAssets.CAPITAL_ASSET_CREATE_ACTION_INDICATOR.equals(capitalAssetInformation.getCapitalAssetActionIndicator())) {
            List<CapitalAssetInformationDetail> capitalAssetInformationDetails = capitalAssetInformation.getCapitalAssetInformationDetails();
            for (CapitalAssetInformationDetail capitalAssetInformationDetail : capitalAssetInformationDetails) {
                // This is not added to constructor in CAMS to provide module isolation from CAMS
                AssetGlobalDetail assetGlobalDetail = new AssetGlobalDetail();
                assetGlobalDetail.setDocumentNumber(document.getDocumentNumber());
                assetGlobalDetail.setCampusCode(capitalAssetInformationDetail.getCampusCode());
                assetGlobalDetail.setBuildingCode(capitalAssetInformationDetail.getBuildingCode());
                assetGlobalDetail.setBuildingRoomNumber(capitalAssetInformationDetail.getBuildingRoomNumber());
                assetGlobalDetail.setBuildingSubRoomNumber(capitalAssetInformationDetail.getBuildingSubRoomNumber());
                assetGlobalDetail.setSerialNumber(capitalAssetInformationDetail.getCapitalAssetSerialNumber());
                assetGlobalDetail.setCapitalAssetNumber(NextAssetNumberFinder.getLongValue());
                assetGlobalDetail.setCampusTagNumber(capitalAssetInformationDetail.getCapitalAssetTagNumber());
                // KFSPTS-3597 add off campus information
                CapitalAssetInformationDetailExtendedAttribute extendedAttribute = (CapitalAssetInformationDetailExtendedAttribute) capitalAssetInformationDetail.getExtension();
                assetGlobalDetail.setOffCampusAddress(extendedAttribute.getAssetLocationStreetAddress());
                assetGlobalDetail.setOffCampusCityName(extendedAttribute.getAssetLocationCityName());
                assetGlobalDetail.setOffCampusCountryCode(extendedAttribute.getAssetLocationCountryCode());
                assetGlobalDetail.setOffCampusStateCode(extendedAttribute.getAssetLocationStateCode());
                assetGlobalDetail.setOffCampusZipCode(extendedAttribute.getAssetLocationZipCode());
                AssetGlobalDetail uniqueAsset = new AssetGlobalDetail();
                ObjectValueUtils.copySimpleProperties(assetGlobalDetail, uniqueAsset);
                assetGlobalDetail.getAssetGlobalUniqueDetails().add(uniqueAsset);
                assetGlobal.getAssetSharedDetails().add(assetGlobalDetail);
            }
            assetGlobal.setVendorName(capitalAssetInformation.getVendorName());
            assetGlobal.setInventoryStatusCode(CamsConstants.InventoryStatusCode.CAPITAL_ASSET_ACTIVE_IDENTIFIABLE);
            assetGlobal.setCapitalAssetTypeCode(capitalAssetInformation.getCapitalAssetTypeCode());
            assetGlobal.setManufacturerName(capitalAssetInformation.getCapitalAssetManufacturerName());
            assetGlobal.setManufacturerModelNumber(capitalAssetInformation.getCapitalAssetManufacturerModelNumber());
            assetGlobal.setCapitalAssetDescription(capitalAssetInformation.getCapitalAssetDescription());
        }
    }
}
Also used : CapitalAssetInformation(org.kuali.kfs.fp.businessobject.CapitalAssetInformation) AssetGlobalDetail(org.kuali.kfs.module.cam.businessobject.AssetGlobalDetail) CapitalAssetInformationDetailExtendedAttribute(edu.cornell.kfs.fp.businessobject.CapitalAssetInformationDetailExtendedAttribute) CapitalAssetInformationDetail(org.kuali.kfs.fp.businessobject.CapitalAssetInformationDetail)

Aggregations

CapitalAssetInformationDetail (org.kuali.kfs.fp.businessobject.CapitalAssetInformationDetail)6 CapitalAssetInformationDetailExtendedAttribute (edu.cornell.kfs.fp.businessobject.CapitalAssetInformationDetailExtendedAttribute)5 CapitalAssetInformation (org.kuali.kfs.fp.businessobject.CapitalAssetInformation)2 AssetType (org.kuali.kfs.module.cam.businessobject.AssetType)2 CapitalAssetEditable (org.kuali.kfs.fp.document.CapitalAssetEditable)1 ProcurementCardDocument (org.kuali.kfs.fp.document.ProcurementCardDocument)1 AssetGlobalDetail (org.kuali.kfs.module.cam.businessobject.AssetGlobalDetail)1 Building (org.kuali.kfs.sys.businessobject.Building)1 Room (org.kuali.kfs.sys.businessobject.Room)1 Campus (org.kuali.rice.location.api.campus.Campus)1