use of org.kuali.kfs.fp.businessobject.CapitalAssetInformation in project cu-kfs by CU-CommunityApps.
the class GlLineServiceImpl method updatePreTagInformation.
/**
* Updates pre tag information received from FP document
*
* @param entry GeneralLedgerEntry
* @param document AssetPaymentDocument
*/
protected void updatePreTagInformation(GeneralLedgerEntry entry, AssetPaymentDocument document, Integer capitalAssetLineNumber) {
CapitalAssetInformation capitalAssetInformation = findCapitalAssetInformation(entry.getDocumentNumber(), capitalAssetLineNumber);
if (ObjectUtils.isNotNull(capitalAssetInformation)) {
// if it is modify asset...
if (KFSConstants.CapitalAssets.CAPITAL_ASSET_MODIFY_ACTION_INDICATOR.equals(capitalAssetInformation.getCapitalAssetActionIndicator())) {
AssetPaymentAssetDetail assetPaymentAssetDetail = new AssetPaymentAssetDetail();
assetPaymentAssetDetail.setDocumentNumber(document.getDocumentNumber());
// get the allocated amount for the capital asset....
assetPaymentAssetDetail.setCapitalAssetNumber(capitalAssetInformation.getCapitalAssetNumber());
assetPaymentAssetDetail.setAllocatedAmount(KualiDecimal.ZERO);
assetPaymentAssetDetail.setAllocatedUserValue(assetPaymentAssetDetail.getAllocatedAmount());
assetPaymentAssetDetail.refreshReferenceObject(CamsPropertyConstants.AssetPaymentAssetDetail.ASSET);
Asset asset = assetPaymentAssetDetail.getAsset();
if (ObjectUtils.isNotNull(asset)) {
assetPaymentAssetDetail.setPreviousTotalCostAmount(asset.getTotalCostAmount() != null ? asset.getTotalCostAmount() : KualiDecimal.ZERO);
document.getAssetPaymentAssetDetail().add(assetPaymentAssetDetail);
}
}
}
}
use of org.kuali.kfs.fp.businessobject.CapitalAssetInformation in project cu-kfs by CU-CommunityApps.
the class GlLineServiceImpl method markCapitalAssetProcessed.
protected void markCapitalAssetProcessed(GeneralLedgerEntry primary, Integer capitalAssetLineNumber) {
CapitalAssetInformation capitalAssetInformation = findCapitalAssetInformation(primary.getDocumentNumber(), capitalAssetLineNumber);
// if it is create asset...
if (ObjectUtils.isNotNull(capitalAssetInformation)) {
capitalAssetInformation.setCapitalAssetProcessedIndicator(true);
businessObjectService.save(capitalAssetInformation);
}
}
use of org.kuali.kfs.fp.businessobject.CapitalAssetInformation 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());
}
}
}
use of org.kuali.kfs.fp.businessobject.CapitalAssetInformation in project cu-kfs by CU-CommunityApps.
the class GlLineServiceImpl method deactivateGLEntries.
protected void deactivateGLEntries(GeneralLedgerEntry entry, Document document, Integer capitalAssetLineNumber) {
// now deactivate the gl line..
CapitalAssetInformation capitalAssetInformation = findCapitalAssetInformation(entry.getDocumentNumber(), capitalAssetLineNumber);
if (ObjectUtils.isNotNull(capitalAssetInformation)) {
List<CapitalAssetAccountsGroupDetails> groupAccountingLines = capitalAssetInformation.getCapitalAssetAccountsGroupDetails();
Collection<GeneralLedgerEntry> documentGlEntries = findAllGeneralLedgerEntry(entry.getDocumentNumber());
for (CapitalAssetAccountsGroupDetails accountingLine : groupAccountingLines) {
// find the matching GL entry for this accounting line.
Collection<GeneralLedgerEntry> glEntries = findMatchingGeneralLedgerEntries(documentGlEntries, accountingLine);
for (GeneralLedgerEntry glEntry : glEntries) {
KualiDecimal lineAmount = accountingLine.getAmount();
// update submitted amount on the gl entry and save the results.
createGeneralLedgerEntryAsset(glEntry, document, capitalAssetLineNumber);
updateTransactionSumbitGlEntryAmount(glEntry, lineAmount);
}
}
}
}
use of org.kuali.kfs.fp.businessobject.CapitalAssetInformation in project cu-kfs by CU-CommunityApps.
the class CapitalAssetInformationAction method prepareRecordsForDisplay.
protected void prepareRecordsForDisplay(CapitalAssetInformationForm capitalAssetForm, GeneralLedgerEntry entry) {
GlLineService glLineService = SpringContext.getBean(GlLineService.class);
entry.setSelected(true);
capitalAssetForm.setGeneralLedgerEntry(entry);
capitalAssetForm.setPrimaryGlAccountId(entry.getGeneralLedgerAccountIdentifier());
List<CapitalAssetInformation> capitalAssetInformations = glLineService.findAllCapitalAssetInformation(entry.getDocumentNumber());
Collection<GeneralLedgerEntry> glEntries = glLineService.findAllGeneralLedgerEntry(entry.getDocumentNumber());
if (!capitalAssetInformations.isEmpty() && capitalAssetInformations.size() != glEntries.size()) {
// we need to generate missing capital asset info
glLineService.setupMissingCapitalAssetInformation(entry.getDocumentNumber());
}
List<CapitalAssetInformation> capitalAssetInformation = glLineService.findCapitalAssetInformationForGLLine(entry);
// to render and subsequent processing to occur successfully.
if (capitalAssetInformation.isEmpty()) {
glLineService.setupCapitalAssetInformation(entry);
capitalAssetInformation = glLineService.findCapitalAssetInformationForGLLine(entry);
}
capitalAssetForm.setCapitalAssetInformation(capitalAssetInformation);
}
Aggregations