Search in sources :

Example 1 with CapitalAssetInformationDetailExtendedAttribute

use of edu.cornell.kfs.fp.businessobject.CapitalAssetInformationDetailExtendedAttribute in project cu-kfs by CU-CommunityApps.

the class CuCapitalAssetManagementModuleServiceImpl method checkNewCapitalAssetFieldsExist.

protected boolean checkNewCapitalAssetFieldsExist(CapitalAssetInformation capitalAssetInformation, AccountingDocument accountingDocument, int caLineIndex) {
    boolean valid = true;
    if (StringUtils.isBlank(capitalAssetInformation.getCapitalAssetTypeCode())) {
        String label = this.getDataDictionaryService().getAttributeLabel(CapitalAssetInformation.class, KFSPropertyConstants.CAPITAL_ASSET_TYPE_CODE);
        GlobalVariables.getMessageMap().putError(KFSPropertyConstants.CAPITAL_ASSET_TYPE_CODE, KFSKeyConstants.ERROR_REQUIRED, label);
        valid = false;
    }
    if (capitalAssetInformation.getCapitalAssetQuantity() == null || capitalAssetInformation.getCapitalAssetQuantity() <= 0) {
        String label = this.getDataDictionaryService().getAttributeLabel(CapitalAssetInformation.class, KFSPropertyConstants.CAPITAL_ASSET_QUANTITY);
        GlobalVariables.getMessageMap().putError(KFSPropertyConstants.CAPITAL_ASSET_QUANTITY, KFSKeyConstants.ERROR_REQUIRED, label);
        valid = false;
    }
    // VENDOR_IS_REQUIRED_FOR_NON_MOVEABLE_ASSET parameter determines if we need to check
    // vendor name entered.
    String vendorNameRequired = getParameterService().getParameterValueAsString(Asset.class, CamsParameterConstants.CapitalAsset.VENDOR_REQUIRED_FOR_NON_MOVEABLE_ASSET_IND);
    if ("Y".equalsIgnoreCase(vendorNameRequired)) {
        // skip vendor name required validation for procurement card document
        // skip vendor name required validation for FP Docs
        String pid = KEWServiceLocator.getDocumentTypeService().findByDocumentId(accountingDocument.getDocumentNumber()).getDocTypeParentId();
        String docType = KEWServiceLocator.getDocumentTypeService().findById(pid).getName();
        if (!(docType.equals("FP")) && !(accountingDocument instanceof ProcurementCardDocument) && StringUtils.isBlank(capitalAssetInformation.getVendorName())) {
            String label = this.getDataDictionaryService().getAttributeLabel(CapitalAssetInformation.class, KFSPropertyConstants.VENDOR_NAME);
            GlobalVariables.getMessageMap().putError(KFSPropertyConstants.VENDOR_NAME, KFSKeyConstants.ERROR_REQUIRED, label);
            valid = false;
        }
    }
    // MANUFACTURER_IS_REQUIRED_FOR_NON_MOVEABLE_ASSET parameter determines if we need to check
    // vendor name entered.
    String manufacturerNameRequired = getParameterService().getParameterValueAsString(Asset.class, CamsParameterConstants.CapitalAsset.MANUFACTURER_REQUIRED_FOR_NON_MOVEABLE_ASSET_IND);
    if ("Y".equalsIgnoreCase(manufacturerNameRequired)) {
        if (StringUtils.isBlank(capitalAssetInformation.getCapitalAssetManufacturerName())) {
            String label = this.getDataDictionaryService().getAttributeLabel(CapitalAssetInformation.class, KFSPropertyConstants.CAPITAL_ASSET_MANUFACTURE_NAME);
            GlobalVariables.getMessageMap().putError(KFSPropertyConstants.CAPITAL_ASSET_MANUFACTURE_NAME, KFSKeyConstants.ERROR_REQUIRED, label);
            valid = false;
        }
    }
    if (StringUtils.isBlank(capitalAssetInformation.getCapitalAssetDescription())) {
        String label = this.getDataDictionaryService().getAttributeLabel(CapitalAssetInformation.class, CamsPropertyConstants.Asset.CAPITAL_ASSET_DESCRIPTION);
        GlobalVariables.getMessageMap().putError(CamsPropertyConstants.Asset.CAPITAL_ASSET_DESCRIPTION, KFSKeyConstants.ERROR_REQUIRED, label);
        valid = false;
    }
    int index = 0;
    List<CapitalAssetInformationDetail> capitalAssetInformationDetails = capitalAssetInformation.getCapitalAssetInformationDetails();
    for (CapitalAssetInformationDetail dtl : capitalAssetInformationDetails) {
        String errorPathPrefix = KFSPropertyConstants.DOCUMENT + "." + KFSPropertyConstants.CAPITAL_ASSET_INFORMATION + "[" + caLineIndex + "]." + KFSPropertyConstants.CAPITAL_ASSET_INFORMATION_DETAILS;
        CapitalAssetInformationDetailExtendedAttribute capDetailExt = (CapitalAssetInformationDetailExtendedAttribute) dtl.getExtension();
        String buildingCd = dtl.getBuildingCode();
        String roomCd = dtl.getBuildingRoomNumber();
        String assetLocationCityName = capDetailExt.getAssetLocationCityName();
        String assetLocationCountryCode = capDetailExt.getAssetLocationCountryCode();
        String assetLocationStateCode = capDetailExt.getAssetLocationStateCode();
        String assetLocationStreetAddress = capDetailExt.getAssetLocationStreetAddress();
        String assetLocationZipCode = capDetailExt.getAssetLocationZipCode();
        // Room is not required for non-moveable
        AssetType assetType = getAssetType(capitalAssetInformation.getCapitalAssetTypeCode());
        if (StringUtils.isBlank(assetLocationCityName) && StringUtils.isBlank(assetLocationStateCode) && StringUtils.isBlank(assetLocationCountryCode) && StringUtils.isBlank(assetLocationStreetAddress) && StringUtils.isBlank(assetLocationZipCode)) {
            // Building code required for moveable assets or assets that require building
            if (ObjectUtils.isNull(assetType) || assetType.isMovingIndicator() || assetType.isRequiredBuildingIndicator()) {
                if (StringUtils.isBlank(dtl.getBuildingCode())) {
                    String label = this.getDataDictionaryService().getAttributeLabel(Building.class, KFSPropertyConstants.BUILDING_CODE);
                    GlobalVariables.getMessageMap().putErrorWithoutFullErrorPath(errorPathPrefix + "[" + index + "]" + "." + KFSPropertyConstants.BUILDING_CODE, KFSKeyConstants.ERROR_REQUIRED, label);
                    valid = false;
                }
            }
            // Room is not required for non-moveable
            if (ObjectUtils.isNull(assetType) || assetType.isMovingIndicator()) {
                // Room is required for moveable
                if (StringUtils.isBlank(roomCd)) {
                    String label = this.getDataDictionaryService().getAttributeLabel(Room.class, KFSPropertyConstants.BUILDING_ROOM_NUMBER);
                    GlobalVariables.getMessageMap().putErrorWithoutFullErrorPath(errorPathPrefix + "[" + index + "]" + "." + KFSPropertyConstants.BUILDING_ROOM_NUMBER, KFSKeyConstants.ERROR_REQUIRED, label);
                    valid = false;
                }
            }
        }
        if (StringUtils.isNotBlank(assetLocationCityName) || StringUtils.isNotBlank(assetLocationStateCode) || StringUtils.isNotBlank(assetLocationCountryCode) || StringUtils.isNotBlank(assetLocationStreetAddress) || StringUtils.isNotBlank(assetLocationZipCode)) {
            if (StringUtils.isNotBlank(buildingCd)) {
                GlobalVariables.getMessageMap().putErrorWithoutFullErrorPath(errorPathPrefix + "[" + index + "]" + "." + KFSPropertyConstants.BUILDING_CODE, KFSKeyConstants.ERROR_CUSTOM, "Building Code not allowed with off-campus Asset Location Address");
                valid = false;
            }
            if (StringUtils.isNotBlank(roomCd)) {
                GlobalVariables.getMessageMap().putErrorWithoutFullErrorPath(errorPathPrefix + "[" + index + "]" + "." + KFSPropertyConstants.BUILDING_ROOM_NUMBER, KFSKeyConstants.ERROR_CUSTOM, "Room Number not allowed with off-campus Asset Location Address");
                valid = false;
            }
            if (StringUtils.isBlank(assetLocationCityName)) {
                GlobalVariables.getMessageMap().putErrorWithoutFullErrorPath(errorPathPrefix + "[" + index + "]" + "." + "extension.assetLocationCityName", KFSKeyConstants.ERROR_CUSTOM, "City Name is required with off-campus Asset Location Address");
                valid = false;
            }
            if (StringUtils.isBlank(assetLocationStateCode)) {
                GlobalVariables.getMessageMap().putErrorWithoutFullErrorPath(errorPathPrefix + "[" + index + "]" + "." + "extension.assetLocationStateCode", KFSKeyConstants.ERROR_CUSTOM, "State Code is required with off-campus Asset Location Address");
                valid = false;
            }
            if (StringUtils.isBlank(assetLocationCountryCode)) {
                GlobalVariables.getMessageMap().putErrorWithoutFullErrorPath(errorPathPrefix + "[" + index + "]" + "." + "extension.assetLocationCountryCode", KFSKeyConstants.ERROR_CUSTOM, "Country Code is required with off-campus Asset Location Address");
                valid = false;
            }
            if (StringUtils.isBlank(assetLocationStreetAddress)) {
                GlobalVariables.getMessageMap().putErrorWithoutFullErrorPath(errorPathPrefix + "[" + index + "]" + "." + "extension.assetLocationStreetAddress", KFSKeyConstants.ERROR_CUSTOM, "Street Address is required with off-campus Asset Location Address");
                valid = false;
            }
            if (StringUtils.isBlank(assetLocationZipCode)) {
                GlobalVariables.getMessageMap().putErrorWithoutFullErrorPath(errorPathPrefix + "[" + index + "]" + "." + "extension.assetLocationZipCode", KFSKeyConstants.ERROR_CUSTOM, "Zipcode is required with off-campus Asset Location Address");
                valid = false;
            }
        }
        index++;
    }
    return valid;
}
Also used : AssetType(org.kuali.kfs.module.cam.businessobject.AssetType) CapitalAssetInformationDetailExtendedAttribute(edu.cornell.kfs.fp.businessobject.CapitalAssetInformationDetailExtendedAttribute) CapitalAssetInformationDetail(org.kuali.kfs.fp.businessobject.CapitalAssetInformationDetail) ProcurementCardDocument(org.kuali.kfs.fp.document.ProcurementCardDocument)

Example 2 with CapitalAssetInformationDetailExtendedAttribute

use of edu.cornell.kfs.fp.businessobject.CapitalAssetInformationDetailExtendedAttribute in project cu-kfs by CU-CommunityApps.

the class CuCapitalAssetManagementModuleServiceImpl method validateAssetTagLocationLines.

protected boolean validateAssetTagLocationLines(CapitalAssetInformation capitalAssetInformation, int capitalAssetIndex, AccountingDocument accountingDocument) {
    boolean valid = true;
    CapitalAssetEditable capitalAssetEditable = (CapitalAssetEditable) accountingDocument;
    List<CapitalAssetInformation> capitalAssets = capitalAssetEditable.getCapitalAssetInformation();
    List<CapitalAssetInformationDetail> capitalAssetInformationDetails = capitalAssetInformation.getCapitalAssetInformationDetails();
    int index = 0;
    for (CapitalAssetInformationDetail dtl : capitalAssetInformationDetails) {
        CapitalAssetInformationDetailExtendedAttribute capDetailExt = (CapitalAssetInformationDetailExtendedAttribute) dtl.getExtension();
        String assetLocationCityName = capDetailExt.getAssetLocationCityName();
        String assetLocationCountryCode = capDetailExt.getAssetLocationCountryCode();
        String assetLocationStateCode = capDetailExt.getAssetLocationStateCode();
        String assetLocationStreetAddress = capDetailExt.getAssetLocationStreetAddress();
        String assetLocationZipCode = capDetailExt.getAssetLocationZipCode();
        // We have to explicitly call this DD service to upper case each field. This may not be the best place and maybe form
        // populate is a better place but we CAMS team don't own FP document. This is the best we can do for now.
        businessObjectDictionaryService.performForceUppercase(dtl);
        String errorPathPrefix = KFSPropertyConstants.DOCUMENT + "." + KFSPropertyConstants.CAPITAL_ASSET_INFORMATION + "[" + capitalAssetIndex + "]." + KFSPropertyConstants.CAPITAL_ASSET_INFORMATION_DETAILS;
        if (StringUtils.isNotBlank(dtl.getCampusCode())) {
            Campus campus = campusService.getCampus(dtl.getCampusCode());
            if (ObjectUtils.isNull(campus)) {
                valid = false;
                String label = this.getDataDictionaryService().getAttributeLabel(Campus.class, KFSPropertyConstants.CODE);
                GlobalVariables.getMessageMap().putErrorWithoutFullErrorPath(errorPathPrefix + "[" + index + "]" + "." + KFSPropertyConstants.CAMPUS_CODE, KFSKeyConstants.ERROR_EXISTENCE, label);
            }
        }
        Map<String, String> params;
        if (StringUtils.isNotBlank(dtl.getCampusCode()) && StringUtils.isNotBlank(dtl.getBuildingCode()) && StringUtils.isBlank(assetLocationCityName) && StringUtils.isBlank(assetLocationStateCode) && StringUtils.isBlank(assetLocationCountryCode) && StringUtils.isBlank(assetLocationStreetAddress) && StringUtils.isBlank(assetLocationZipCode)) {
            params = new HashMap<String, String>();
            params.put(KFSPropertyConstants.CAMPUS_CODE, dtl.getCampusCode());
            params.put(KFSPropertyConstants.BUILDING_CODE, dtl.getBuildingCode());
            Building building = businessObjectService.findByPrimaryKey(Building.class, params);
            // Check if building is valid
            if (ObjectUtils.isNull(building)) {
                valid = false;
                GlobalVariables.getMessageMap().putErrorWithoutFullErrorPath(errorPathPrefix + "[" + index + "]" + "." + KFSPropertyConstants.BUILDING_CODE, CamsKeyConstants.AssetLocationGlobal.ERROR_INVALID_BUILDING_CODE, dtl.getBuildingCode(), dtl.getCampusCode());
            }
        }
        AssetType assetType = getAssetType(capitalAssetInformation.getCapitalAssetTypeCode());
        if (StringUtils.isBlank(assetLocationCityName) && StringUtils.isBlank(assetLocationStateCode) && StringUtils.isBlank(assetLocationCountryCode) && StringUtils.isBlank(assetLocationStreetAddress) && StringUtils.isBlank(assetLocationZipCode)) {
            // If building was specified but was not required for this asset type display an error
            if (StringUtils.isNotBlank(dtl.getBuildingCode()) && ObjectUtils.isNotNull(assetType) && !assetType.isMovingIndicator() && !assetType.isRequiredBuildingIndicator()) {
                valid = false;
                String label = this.getDataDictionaryService().getAttributeLabel(Building.class, KFSPropertyConstants.BUILDING_CODE);
                GlobalVariables.getMessageMap().putErrorWithoutFullErrorPath(errorPathPrefix + "[" + index + "]" + "." + KFSPropertyConstants.BUILDING_CODE, CamsKeyConstants.AssetLocation.ERROR_ASSET_LOCATION_BUILDING_NONMOVEABLE, label);
            }
            if (StringUtils.isNotBlank(dtl.getCampusCode()) && StringUtils.isNotBlank(dtl.getBuildingCode()) && StringUtils.isNotBlank(dtl.getBuildingRoomNumber())) {
                params = new HashMap<>();
                params.put(KFSPropertyConstants.CAMPUS_CODE, dtl.getCampusCode());
                params.put(KFSPropertyConstants.BUILDING_CODE, dtl.getBuildingCode());
                params.put(KFSPropertyConstants.BUILDING_ROOM_NUMBER, dtl.getBuildingRoomNumber());
                Room room = businessObjectService.findByPrimaryKey(Room.class, params);
                // Check if room is valid
                if (ObjectUtils.isNull(room)) {
                    valid = false;
                    GlobalVariables.getMessageMap().putErrorWithoutFullErrorPath(errorPathPrefix + "[" + index + "]" + "." + KFSPropertyConstants.BUILDING_ROOM_NUMBER, CamsKeyConstants.AssetLocationGlobal.ERROR_INVALID_ROOM_NUMBER, dtl.getBuildingRoomNumber(), dtl.getBuildingCode(), dtl.getCampusCode());
                }
            }
            // If room was specified but was not required for this asset type display an error
            if (StringUtils.isNotBlank(dtl.getBuildingRoomNumber()) && ObjectUtils.isNotNull(assetType) && !assetType.isMovingIndicator()) {
                valid = false;
                String label = this.getDataDictionaryService().getAttributeLabel(Room.class, KFSPropertyConstants.BUILDING_ROOM_NUMBER);
                GlobalVariables.getMessageMap().putErrorWithoutFullErrorPath(errorPathPrefix + "[" + index + "]" + "." + KFSPropertyConstants.BUILDING_ROOM_NUMBER, CamsKeyConstants.AssetLocation.ERROR_ASSET_LOCATION_ROOM_NUMBER_NONMOVEABLE, label);
            }
        }
        index++;
    }
    return valid;
}
Also used : CapitalAssetInformation(org.kuali.kfs.fp.businessobject.CapitalAssetInformation) Building(org.kuali.kfs.sys.businessobject.Building) Campus(org.kuali.rice.location.api.campus.Campus) CapitalAssetInformationDetail(org.kuali.kfs.fp.businessobject.CapitalAssetInformationDetail) CapitalAssetEditable(org.kuali.kfs.fp.document.CapitalAssetEditable) AssetType(org.kuali.kfs.module.cam.businessobject.AssetType) CapitalAssetInformationDetailExtendedAttribute(edu.cornell.kfs.fp.businessobject.CapitalAssetInformationDetailExtendedAttribute) Room(org.kuali.kfs.sys.businessobject.Room)

Example 3 with CapitalAssetInformationDetailExtendedAttribute

use of edu.cornell.kfs.fp.businessobject.CapitalAssetInformationDetailExtendedAttribute in project cu-kfs by CU-CommunityApps.

the class CapitalAssetInformationActionBase method createCapitalAssetInformationDetail.

/**
 * creates a new tag/location details record and adds to the collection for capital asset
 *
 * @param capitalAsset
 */
protected void createCapitalAssetInformationDetail(CapitalAssetInformation capitalAsset) {
    CapitalAssetInformationDetail assetDetail = new CapitalAssetInformationDetail();
    assetDetail.setDocumentNumber(capitalAsset.getDocumentNumber());
    assetDetail.setCapitalAssetLineNumber(capitalAsset.getCapitalAssetLineNumber());
    assetDetail.setItemLineNumber(getNextLineItemNumber(capitalAsset));
    // ==== CU Customization: Populate extended attribute on Information Detail object. ====
    CapitalAssetInformationDetailExtendedAttribute detailea = (CapitalAssetInformationDetailExtendedAttribute) assetDetail.getExtension();
    detailea.setDocumentNumber(capitalAsset.getDocumentNumber());
    detailea.setCapitalAssetLineNumber(assetDetail.getCapitalAssetLineNumber());
    detailea.setItemLineNumber(assetDetail.getItemLineNumber());
    capitalAsset.getCapitalAssetInformationDetails().add(0, assetDetail);
}
Also used : CapitalAssetInformationDetailExtendedAttribute(edu.cornell.kfs.fp.businessobject.CapitalAssetInformationDetailExtendedAttribute) CapitalAssetInformationDetail(org.kuali.kfs.fp.businessobject.CapitalAssetInformationDetail)

Example 4 with CapitalAssetInformationDetailExtendedAttribute

use of edu.cornell.kfs.fp.businessobject.CapitalAssetInformationDetailExtendedAttribute in project cu-kfs by CU-CommunityApps.

the class CapitalAssetInformationActionBase method addCapitalAssetInfoDetailLines.

/**
 * add detail lines into the given capital asset information
 *
 * @param capitalAssetInformation the given capital asset information
 */
protected void addCapitalAssetInfoDetailLines(CapitalAssetInformation capitalAssetInformation) {
    LOG.debug("addCapitalAssetInfoDetailLines() - start");
    if (ObjectUtils.isNull(capitalAssetInformation)) {
        return;
    }
    Integer quantity = capitalAssetInformation.getCapitalAssetQuantity();
    if (quantity == null || quantity <= 0) {
        String errorPath = KFSPropertyConstants.DOCUMENT + "." + KFSPropertyConstants.CAPITAL_ASSET_INFORMATION;
        GlobalVariables.getMessageMap().putError(errorPath, KFSKeyConstants.ERROR_INVALID_CAPITAL_ASSET_QUANTITY);
        return;
    }
    List<CapitalAssetInformationDetail> detailLines = capitalAssetInformation.getCapitalAssetInformationDetails();
    Integer nextItemLineNumber = 0;
    if (ObjectUtils.isNotNull(detailLines) || detailLines.size() > 0) {
        for (CapitalAssetInformationDetail detailLine : detailLines) {
            nextItemLineNumber = detailLine.getItemLineNumber().intValue();
        }
    }
    // If details collection has old lines, this loop will add new lines to make the total equal to the quantity.
    for (int index = 1; detailLines.size() < quantity; index++) {
        CapitalAssetInformationDetail detailLine = new CapitalAssetInformationDetail();
        detailLine.setDocumentNumber(capitalAssetInformation.getDocumentNumber());
        detailLine.setCapitalAssetLineNumber(capitalAssetInformation.getCapitalAssetLineNumber());
        detailLine.setItemLineNumber(++nextItemLineNumber);
        // ==== CU Customization: Populate extended attribute on Information Detail object. ====
        CapitalAssetInformationDetailExtendedAttribute detailea = (CapitalAssetInformationDetailExtendedAttribute) detailLine.getExtension();
        detailea.setDocumentNumber(capitalAssetInformation.getDocumentNumber());
        detailea.setCapitalAssetLineNumber(detailLine.getCapitalAssetLineNumber());
        detailea.setItemLineNumber(detailLine.getItemLineNumber());
        detailLines.add(detailLine);
    }
}
Also used : CapitalAssetInformationDetailExtendedAttribute(edu.cornell.kfs.fp.businessobject.CapitalAssetInformationDetailExtendedAttribute) CapitalAssetInformationDetail(org.kuali.kfs.fp.businessobject.CapitalAssetInformationDetail)

Example 5 with CapitalAssetInformationDetailExtendedAttribute

use of edu.cornell.kfs.fp.businessobject.CapitalAssetInformationDetailExtendedAttribute 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

CapitalAssetInformationDetailExtendedAttribute (edu.cornell.kfs.fp.businessobject.CapitalAssetInformationDetailExtendedAttribute)5 CapitalAssetInformationDetail (org.kuali.kfs.fp.businessobject.CapitalAssetInformationDetail)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