use of org.kuali.kfs.integration.purap.CapitalAssetSystem in project cu-kfs by CU-CommunityApps.
the class PurchasingActionBase method setManufacturerFromVendorByItem.
public ActionForward setManufacturerFromVendorByItem(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
PurchasingAccountsPayableFormBase purchasingForm = (PurchasingAccountsPayableFormBase) form;
PurchasingDocument document = (PurchasingDocument) purchasingForm.getDocument();
String vendorName = document.getVendorName();
if (StringUtils.isEmpty(vendorName)) {
GlobalVariables.getMessageMap().putError(PurapConstants.CAPITAL_ASSET_TAB_ERRORS, PurapKeyConstants.ERROR_CAPITAL_ASSET_NO_VENDOR, (String[]) null);
} else {
PurchasingCapitalAssetItem assetItem = document.getPurchasingCapitalAssetItems().get(getSelectedLine(request));
CapitalAssetSystem system = assetItem.getPurchasingCapitalAssetSystem();
if (system != null) {
system.setCapitalAssetManufacturerName(vendorName);
}
}
return mapping.findForward(KFSConstants.MAPPING_BASIC);
}
use of org.kuali.kfs.integration.purap.CapitalAssetSystem in project cu-kfs by CU-CommunityApps.
the class PurchasingActionBase method useOffCampusAssetLocationBuildingByItem.
public ActionForward useOffCampusAssetLocationBuildingByItem(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
PurchasingFormBase baseForm = (PurchasingFormBase) form;
PurchasingDocument document = (PurchasingDocument) baseForm.getDocument();
String fullParameter = (String) request.getAttribute(KFSConstants.METHOD_TO_CALL_ATTRIBUTE);
String assetItemIndex = StringUtils.substringBetween(fullParameter, KFSConstants.METHOD_TO_CALL_PARM1_LEFT_DEL, KFSConstants.METHOD_TO_CALL_PARM1_RIGHT_DEL);
String assetLocationIndex = StringUtils.substringBetween(fullParameter, KFSConstants.METHOD_TO_CALL_PARM2_LEFT_DEL, KFSConstants.METHOD_TO_CALL_PARM2_RIGHT_DEL);
PurchasingCapitalAssetItem assetItem = document.getPurchasingCapitalAssetItems().get(Integer.parseInt(assetItemIndex));
CapitalAssetSystem system = assetItem.getPurchasingCapitalAssetSystem();
if ("new".equals(assetLocationIndex)) {
useOffCampusAssetLocationBuilding(system.getNewPurchasingCapitalAssetLocationLine());
} else {
useOffCampusAssetLocationBuilding(system.getCapitalAssetLocations().get(Integer.parseInt(assetLocationIndex)));
}
return mapping.findForward(KFSConstants.MAPPING_BASIC);
}
use of org.kuali.kfs.integration.purap.CapitalAssetSystem in project cu-kfs by CU-CommunityApps.
the class PurchasingActionBase method addItemCapitalAssetByDocument.
public ActionForward addItemCapitalAssetByDocument(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
PurchasingFormBase purchasingForm = (PurchasingFormBase) form;
PurchasingDocument purDocument = (PurchasingDocument) purchasingForm.getDocument();
ItemCapitalAsset asset = purDocument.getPurchasingCapitalAssetItems().get(0).getNewPurchasingItemCapitalAssetLine();
boolean rulePassed = SpringContext.getBean(KualiRuleService.class).applyRules(new AttributedAddPurchasingItemCapitalAssetEvent("", purDocument, asset));
if (rulePassed) {
// get specific asset item and grab system as well and attach asset number
CapitalAssetSystem system = purDocument.getPurchasingCapitalAssetSystems().get(getSelectedLine(request));
asset = purDocument.getPurchasingCapitalAssetItems().get(0).getAndResetNewPurchasingItemCapitalAssetLine();
asset.setCapitalAssetSystemIdentifier(system.getCapitalAssetSystemIdentifier());
if (capitalAssetSystemHasAssetItem(system, asset)) {
GlobalVariables.getMessageMap().putError(PurapConstants.CAPITAL_ASSET_TAB_ERRORS, PurapKeyConstants.ERROR_CAPITAL_ASSET_DUPLICATE_ASSET);
} else {
system.getItemCapitalAssets().add(asset);
}
}
return mapping.findForward(KFSConstants.MAPPING_BASIC);
}
use of org.kuali.kfs.integration.purap.CapitalAssetSystem in project cu-kfs by CU-CommunityApps.
the class PurchasingActionBase method setManufacturerFromVendorByDocument.
public ActionForward setManufacturerFromVendorByDocument(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
PurchasingAccountsPayableFormBase purchasingForm = (PurchasingAccountsPayableFormBase) form;
PurchasingDocument document = (PurchasingDocument) purchasingForm.getDocument();
String vendorName = document.getVendorName();
if (StringUtils.isEmpty(vendorName)) {
GlobalVariables.getMessageMap().putError(PurapConstants.CAPITAL_ASSET_TAB_ERRORS, PurapKeyConstants.ERROR_CAPITAL_ASSET_NO_VENDOR, (String[]) null);
} else {
CapitalAssetSystem system = document.getPurchasingCapitalAssetSystems().get(getSelectedLine(request));
if (system != null) {
system.setCapitalAssetManufacturerName(vendorName);
}
}
return mapping.findForward(KFSConstants.MAPPING_BASIC);
}
use of org.kuali.kfs.integration.purap.CapitalAssetSystem in project cu-kfs by CU-CommunityApps.
the class PurchasingActionBase method clearNotCurrentYearByItem.
public ActionForward clearNotCurrentYearByItem(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
PurchasingAccountsPayableFormBase purchasingForm = (PurchasingAccountsPayableFormBase) form;
PurchasingDocument document = (PurchasingDocument) purchasingForm.getDocument();
PurchasingCapitalAssetItem assetItem = document.getPurchasingCapitalAssetItems().get(getSelectedLine(request));
CapitalAssetSystem system = assetItem.getPurchasingCapitalAssetSystem();
if (system != null) {
system.setCapitalAssetNotReceivedCurrentFiscalYearIndicator(false);
system.setCapitalAssetTypeCode("");
}
return mapping.findForward(KFSConstants.MAPPING_BASIC);
}
Aggregations