Search in sources :

Example 36 with PurchasingDocument

use of org.kuali.kfs.module.purap.document.PurchasingDocument in project cu-kfs by CU-CommunityApps.

the class PurchasingActionBase method setupCAMSSystem.

public ActionForward setupCAMSSystem(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    PurchasingAccountsPayableFormBase purchasingForm = (PurchasingAccountsPayableFormBase) form;
    PurchasingDocument document = (PurchasingDocument) purchasingForm.getDocument();
    SpringContext.getBean(PurchasingService.class).setupCapitalAssetSystem(document);
    return mapping.findForward(KFSConstants.MAPPING_BASIC);
}
Also used : PurchasingDocument(org.kuali.kfs.module.purap.document.PurchasingDocument) PurchasingService(org.kuali.kfs.module.purap.document.service.PurchasingService)

Example 37 with PurchasingDocument

use of org.kuali.kfs.module.purap.document.PurchasingDocument 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);
}
Also used : PurchasingCapitalAssetItem(org.kuali.kfs.module.purap.businessobject.PurchasingCapitalAssetItem) PurchasingDocument(org.kuali.kfs.module.purap.document.PurchasingDocument) CapitalAssetSystem(org.kuali.kfs.integration.purap.CapitalAssetSystem)

Example 38 with PurchasingDocument

use of org.kuali.kfs.module.purap.document.PurchasingDocument in project cu-kfs by CU-CommunityApps.

the class PurchasingFormBase method getPurchasingCapitalAssetSystemAvailability.

public String getPurchasingCapitalAssetSystemAvailability() {
    String availability = PurapConstants.CapitalAssetAvailability.NONE;
    PurchasingDocument pd = (PurchasingDocument) this.getDocument();
    if ((PurapConstants.CapitalAssetSystemTypes.ONE_SYSTEM.equals(pd.getCapitalAssetSystemTypeCode()) && PurapConstants.CapitalAssetSystemStates.NEW.equals(pd.getCapitalAssetSystemStateCode()))) {
        availability = PurapConstants.CapitalAssetAvailability.ONCE;
    } else if ((PurapConstants.CapitalAssetSystemTypes.INDIVIDUAL.equals(pd.getCapitalAssetSystemTypeCode()) && PurapConstants.CapitalAssetSystemStates.NEW.equals(pd.getCapitalAssetSystemStateCode()))) {
        availability = PurapConstants.CapitalAssetAvailability.EACH;
    }
    return availability;
}
Also used : PurchasingDocument(org.kuali.kfs.module.purap.document.PurchasingDocument)

Example 39 with PurchasingDocument

use of org.kuali.kfs.module.purap.document.PurchasingDocument in project cu-kfs by CU-CommunityApps.

the class PurchasingFormBase method getPurchasingCapitalAssetLocationAvailability.

public String getPurchasingCapitalAssetLocationAvailability() {
    String availability = PurapConstants.CapitalAssetAvailability.NONE;
    PurchasingDocument pd = (PurchasingDocument) this.getDocument();
    if ((PurapConstants.CapitalAssetSystemTypes.ONE_SYSTEM.equals(pd.getCapitalAssetSystemTypeCode()) && PurapConstants.CapitalAssetSystemStates.NEW.equals(pd.getCapitalAssetSystemStateCode()))) {
        availability = PurapConstants.CapitalAssetAvailability.ONCE;
    } else if ((PurapConstants.CapitalAssetSystemTypes.INDIVIDUAL.equals(pd.getCapitalAssetSystemTypeCode()) && PurapConstants.CapitalAssetSystemStates.NEW.equals(pd.getCapitalAssetSystemStateCode()))) {
        availability = PurapConstants.CapitalAssetAvailability.EACH;
    }
    return availability;
}
Also used : PurchasingDocument(org.kuali.kfs.module.purap.document.PurchasingDocument)

Example 40 with PurchasingDocument

use of org.kuali.kfs.module.purap.document.PurchasingDocument in project cu-kfs by CU-CommunityApps.

the class PurchasingFormBase method getPurchasingItemCapitalAssetAvailability.

// Availability once
public String getPurchasingItemCapitalAssetAvailability() {
    String availability = PurapConstants.CapitalAssetAvailability.NONE;
    PurchasingDocument pd = (PurchasingDocument) this.getDocument();
    if ((PurapConstants.CapitalAssetSystemTypes.ONE_SYSTEM.equals(pd.getCapitalAssetSystemTypeCode()) && PurapConstants.CapitalAssetSystemStates.MODIFY.equals(pd.getCapitalAssetSystemStateCode())) || (PurapConstants.CapitalAssetSystemTypes.MULTIPLE.equals(pd.getCapitalAssetSystemTypeCode()) && PurapConstants.CapitalAssetSystemStates.MODIFY.equals(pd.getCapitalAssetSystemStateCode()))) {
        availability = PurapConstants.CapitalAssetAvailability.ONCE;
    } else if ((PurapConstants.CapitalAssetSystemTypes.INDIVIDUAL.equals(pd.getCapitalAssetSystemTypeCode()) && PurapConstants.CapitalAssetSystemStates.MODIFY.equals(pd.getCapitalAssetSystemStateCode()))) {
        availability = PurapConstants.CapitalAssetAvailability.EACH;
    }
    return availability;
}
Also used : PurchasingDocument(org.kuali.kfs.module.purap.document.PurchasingDocument)

Aggregations

PurchasingDocument (org.kuali.kfs.module.purap.document.PurchasingDocument)42 CapitalAssetSystem (org.kuali.kfs.integration.purap.CapitalAssetSystem)14 PurchasingCapitalAssetItem (org.kuali.kfs.module.purap.businessobject.PurchasingCapitalAssetItem)10 KualiRuleService (org.kuali.kfs.krad.service.KualiRuleService)7 PurapService (org.kuali.kfs.module.purap.document.service.PurapService)6 PurchasingService (org.kuali.kfs.module.purap.document.service.PurchasingService)5 ItemCapitalAsset (org.kuali.kfs.integration.purap.ItemCapitalAsset)4 MessageMap (org.kuali.kfs.krad.util.MessageMap)4 PurApItem (org.kuali.kfs.module.purap.businessobject.PurApItem)4 ActionForward (org.apache.struts.action.ActionForward)3 Map (java.util.Map)2 CapitalAssetLocation (org.kuali.kfs.integration.purap.CapitalAssetLocation)2 BusinessObjectService (org.kuali.kfs.krad.service.BusinessObjectService)2 PurchasingCapitalAssetSystemBase (org.kuali.kfs.module.purap.businessobject.PurchasingCapitalAssetSystemBase)2 PurchaseOrderAmendmentDocument (org.kuali.kfs.module.purap.document.PurchaseOrderAmendmentDocument)2 PurchaseOrderDocument (org.kuali.kfs.module.purap.document.PurchaseOrderDocument)2 PurchasingDocumentBase (org.kuali.kfs.module.purap.document.PurchasingDocumentBase)2 AttributedAddPurchasingAccountsPayableItemEvent (org.kuali.kfs.module.purap.document.validation.event.AttributedAddPurchasingAccountsPayableItemEvent)2 AttributedAddPurchasingCapitalAssetLocationEvent (org.kuali.kfs.module.purap.document.validation.event.AttributedAddPurchasingCapitalAssetLocationEvent)2 AttributedAddPurchasingItemCapitalAssetEvent (org.kuali.kfs.module.purap.document.validation.event.AttributedAddPurchasingItemCapitalAssetEvent)2