Search in sources :

Example 1 with PurchasingCapitalAssetSystemBase

use of org.kuali.kfs.module.purap.businessobject.PurchasingCapitalAssetSystemBase in project cu-kfs by CU-CommunityApps.

the class PurchasingActionBase method deleteItemCapitalAssetByDocument.

public ActionForward deleteItemCapitalAssetByDocument(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    PurchasingFormBase purchasingForm = (PurchasingFormBase) form;
    PurchasingDocument purDocument = (PurchasingDocument) purchasingForm.getDocument();
    // get specific asset item
    PurchasingCapitalAssetItem assetItem = purDocument.getPurchasingCapitalAssetItems().get(getSelectedLine(request));
    ItemCapitalAsset asset = assetItem.getNewPurchasingItemCapitalAssetLine();
    boolean rulePassed = true;
    if (rulePassed) {
        String fullParameter = (String) request.getAttribute(KFSConstants.METHOD_TO_CALL_ATTRIBUTE);
        String systemIndex = StringUtils.substringBetween(fullParameter, KFSConstants.METHOD_TO_CALL_PARM1_LEFT_DEL, KFSConstants.METHOD_TO_CALL_PARM1_RIGHT_DEL);
        String assetIndex = StringUtils.substringBetween(fullParameter, KFSConstants.METHOD_TO_CALL_PARM2_LEFT_DEL, KFSConstants.METHOD_TO_CALL_PARM2_RIGHT_DEL);
        PurchasingCapitalAssetSystemBase system = (PurchasingCapitalAssetSystemBase) purDocument.getPurchasingCapitalAssetSystems().get(Integer.parseInt(systemIndex));
        system.getItemCapitalAssets().remove(Integer.parseInt(assetIndex));
    }
    return mapping.findForward(KFSConstants.MAPPING_BASIC);
}
Also used : PurchasingCapitalAssetItem(org.kuali.kfs.module.purap.businessobject.PurchasingCapitalAssetItem) PurchasingDocument(org.kuali.kfs.module.purap.document.PurchasingDocument) PurchasingCapitalAssetSystemBase(org.kuali.kfs.module.purap.businessobject.PurchasingCapitalAssetSystemBase) ItemCapitalAsset(org.kuali.kfs.integration.purap.ItemCapitalAsset)

Example 2 with PurchasingCapitalAssetSystemBase

use of org.kuali.kfs.module.purap.businessobject.PurchasingCapitalAssetSystemBase in project cu-kfs by CU-CommunityApps.

the class PurchasingActionBase method deleteItemCapitalAssetByItem.

public ActionForward deleteItemCapitalAssetByItem(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    PurchasingFormBase purchasingForm = (PurchasingFormBase) form;
    PurchasingDocument purDocument = (PurchasingDocument) purchasingForm.getDocument();
    // get specific asset item
    PurchasingCapitalAssetItem assetItem = purDocument.getPurchasingCapitalAssetItems().get(getSelectedLine(request));
    ItemCapitalAsset asset = assetItem.getNewPurchasingItemCapitalAssetLine();
    boolean rulePassed = true;
    if (rulePassed) {
        String fullParameter = (String) request.getAttribute(KFSConstants.METHOD_TO_CALL_ATTRIBUTE);
        String assetIndex = StringUtils.substringBetween(fullParameter, KFSConstants.METHOD_TO_CALL_PARM2_LEFT_DEL, KFSConstants.METHOD_TO_CALL_PARM2_RIGHT_DEL);
        PurchasingCapitalAssetSystemBase system = (PurchasingCapitalAssetSystemBase) assetItem.getPurchasingCapitalAssetSystem();
        system.getItemCapitalAssets().remove(Integer.parseInt(assetIndex));
    }
    return mapping.findForward(KFSConstants.MAPPING_BASIC);
}
Also used : PurchasingCapitalAssetItem(org.kuali.kfs.module.purap.businessobject.PurchasingCapitalAssetItem) PurchasingDocument(org.kuali.kfs.module.purap.document.PurchasingDocument) PurchasingCapitalAssetSystemBase(org.kuali.kfs.module.purap.businessobject.PurchasingCapitalAssetSystemBase) ItemCapitalAsset(org.kuali.kfs.integration.purap.ItemCapitalAsset)

Aggregations

ItemCapitalAsset (org.kuali.kfs.integration.purap.ItemCapitalAsset)2 PurchasingCapitalAssetItem (org.kuali.kfs.module.purap.businessobject.PurchasingCapitalAssetItem)2 PurchasingCapitalAssetSystemBase (org.kuali.kfs.module.purap.businessobject.PurchasingCapitalAssetSystemBase)2 PurchasingDocument (org.kuali.kfs.module.purap.document.PurchasingDocument)2