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