psdi.app.workorder

Class WPItem

  • All Implemented Interfaces:
    java.rmi.Remote, WorkPlanMbo, WPItemRemote, MboConstants, MboRemote, MaxRemoteProxy
    Direct Known Subclasses:
    WPMaterial, WPService, WPTool


    public class WPItem
    extends Mbo
    implements WPItemRemote, WorkPlanMbo
    Mbo to Represent the WPItem Object. This is a base object for WPMaterial, WPService and WPTool Object

    See WorkOrder Package description.

    There is no key attribute for this object. The attributes in this object are as follows:

    Attribute NameDescription
    CatalogCodeThe Catalog code for the item, or the vendor part number.
    DescriptionThe Description for the item/service/tools.
    DirectReqThis is to signify if the item on this reservation will be ordered outside of standard inventory.
    IssueTo Issue to a laborcode or craft.
    ItemNumIdentifier of the this WPItem.
    ItemQtyItem quantity required for the work plan task.
    LineCostA attribute to calculate the total cost of the line(ItemQty * UnitCost).
    LineTypeThe type of work plan material/service/tools. It could be ITEM, MATERIAL, EXTERNAL or SPORDER type for WPMaterial, SERVICE and STDSERVICE FOR WPSERVICE, TOOL for WPTool.
    LocationPrimary or alternate location from inventory for this work plan material/service/tool item.
    ManufacturerThe Manufacturer of this work plan material/service item.
    ModelNumModel number or manufacturer part number for the item of this work plan material.
    OrderUnitOrder unit for the item of this work plan material/service.
    OrgIdIdentifier of the organization for this failure.
    PR}Identifier of the purchase requisition of the ordered item of this work plan material/service.
    PRLineNumThe Purchase requisition Line number of the ordered item of this work plan material/service.
    RequestByThe Person requesting this item of this work plan material/service.
    RequireDateThe Date this item is needed.
    SiteIdIdentifier of the site for this failure.
    TaskIDA non-persistent attribute to reprsent the task identifier of the Work Order associate with this work plan material/service.
    UnitCost}Item unit cost when work order was approved.
    UnitCostHasChanged Flag tracks if the unit cost has been overwritten by user. If No - field will be overwritten by MAXIMO on Approval. If Yes - field will not be overwritten by MAXIMO on Approval.
    VendorSuggested vendor to order this item from.
    VendorPackCodeVendor's pack code for the item.
    VendorPackQuantityVendor's pack quantity for the item.
    VendorUnitPriceThe unit price of the item in vendor's currency.
    VendorWareHouseVendor's warehouse for the item.
    WoNumIdentifier of the work order associate with this work plan material/service.
    WPM1-WPM3Extra fields, crossover fields from JobMaterial.JM1-JM3.
    RATEThe toolrate of the tool
    RaterHasChangedSet to True when a user manually enters rate for a tool
    HoursThe number of hours that this tool will be used for. User-entered value.
    RESERVEREQIndicates whether or not the tool requires a reservation.
    • Constructor Detail

      • WPItem

        public WPItem(MboSet ms)
               throws MXException,
                      java.rmi.RemoteException
        Basic construtor
        Parameters:
        ms - The WPItem MboSet.
        Throws:
        MXException
        java.rmi.RemoteException
    • Method Detail

      • add

        public void add()
                 throws MXException,
                        java.rmi.RemoteException
        Sets Default value for some of the fields of the new WPItem. New WPItem can only be created by the work order object.

        WONUM defaults from the parent and set WONUM of parent to read only.
        The table below shows the default values for each of the attributes listed.

        Attribute NameAttribute Value
        wonumWorkorder's wonum
        LineCost0.0
        Specified by:
        add in interface MboRemote
        Overrides:
        add in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • propagateKeyValue

        public void propagateKeyValue(java.lang.String keyName,
                                      java.lang.String keyValue)
                               throws MXException,
                                      java.rmi.RemoteException
        Set value for Wonum.
        Specified by:
        propagateKeyValue in interface MboRemote
        Overrides:
        propagateKeyValue in class Mbo
        Parameters:
        keyName - Should equal "wonum" or else nothing will be propagated.
        keyValue - The new value of wonum.
        Throws:
        MXException
        java.rmi.RemoteException
      • copyHazardForItem

        public void copyHazardForItem()
                               throws MXException,
                                      java.rmi.RemoteException
        Copy Hazard for Item
        Throws:
        MXException
        java.rmi.RemoteException
      • updateTotals

        public void updateTotals(MboRemote wo,
                                 boolean isGain)
                          throws MXException,
                                 java.rmi.RemoteException
        Updates the work order totals related to the work plan mbo.
        Specified by:
        updateTotals in interface WorkPlanMbo
        Parameters:
        wo - The work order Mbo to update.
        isGain - Is this a gain or loss for the work order.
        Throws:
        MXException
        java.rmi.RemoteException
      • setEstCost

        public void setEstCost(MboRemote wo,
                               double lineCost)
                        throws MXException,
                               java.rmi.RemoteException
        Set the Estimated Material(EstMatCost), Service(EstServCost) and Tool(EstToolCost) Cost in workorder
        Throws:
        MXException
        java.rmi.RemoteException
      • skipCopyField

        protected boolean skipCopyField(MboValueInfo mvi)
                                 throws java.rmi.RemoteException,
                                        MXException
        Overrides the skipCopyField() in the Mbo. Since this method takes the MboValueInfo as its parameter just check to see if this field needs to be copied or not. If this field does not need to be copied return true. The following is a list of fields that are not copied from the source WPItem to the target WPItem.
        1. WONUM
        2. PR
        3. PRLINENUM
        4. REQUESTNUM
        5. REQUIREDATE
        Overrides:
        skipCopyField in class Mbo
        Parameters:
        The - MboValueInfo object of the MboValue that needs to be copied.
        Returns:
        true if the field does not need to be copied, in all other cases return false.
        Throws:
        MXException
        java.rmi.RemoteException
      • validateStoreLocSite

        public void validateStoreLocSite()
                                  throws MXException,
                                         java.rmi.RemoteException
        Checks to see whether it has a valid StoreLocSite
        Throws:
        MXException
        java.rmi.RemoteException
      • setLocation

        public void setLocation()
                         throws MXException,
                                java.rmi.RemoteException
        set the location field if there is only one inventory record
        Throws:
        MXException
        java.rmi.RemoteException
      • getRequiredMaterialCost

        public void getRequiredMaterialCost()
                                     throws MXException,
                                            java.rmi.RemoteException
        Supplies a unit cost for direct requests. Calling this method updates the UnitCost attribute. It looks for the bid price first, then the last price. It checks the item-vendor- catalogcode and if not found, check for item-vendor in invvendor. The price will be set to the price found.
        Throws:
        MXException
        java.rmi.RemoteException
      • setBaseCurrencyUnitCost

        public void setBaseCurrencyUnitCost(double vendorunitcost)
                                     throws MXException,
                                            java.rmi.RemoteException
        Calculate unitcost based on vendorunitcost and set the unitcost.
        Throws:
        MXException
        java.rmi.RemoteException
      • getValidateOrder

        public java.lang.String[] getValidateOrder()
        Validation Order for WPItem attributes.
        Overrides:
        getValidateOrder in class Mbo
      • isNullQty

        public void isNullQty()
                       throws MXException,
                              java.rmi.RemoteException
        This method is used to check if the itemqty field on the WPMaterial is null Check to see if this MRLine's itemqty is null. If the itemqty is null throw an error message because lines must have not null quantities.
        Specified by:
        isNullQty in interface WPItemRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        WPItem.isNullQty()
      • setVendor

        public void setVendor()
                       throws MXException,
                              java.rmi.RemoteException
        set the vendor if it finds one.
        Throws:
        MXException - Inventory
        java.rmi.RemoteException