psdi.app.workorder

Class WPMaterial

  • All Implemented Interfaces:
    java.rmi.Remote, WorkPlanMbo, WPItemRemote, WPMaterialRemote, MboConstants, MboRemote, MaxRemoteProxy


    public class WPMaterial
    extends WPItem
    implements WPMaterialRemote
    Mbo to Represent the WPMaterial Object. WPMaterial is a view which extend from WPItem.

    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 on this reservation.
    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 Item for this wpmaterial.
    ItemQtyItem quantity required for the work plan task.
    LineCostA non-persistent attribute to calculate the total cost of the line(ItemQty * UnitCost).
    LineTypeThe type of work plan material. It could be ITEM, MATERIAL, EXTERNAL or SPORDER type.
    LocationPrimary or alternate location from inventory for this work plan material item.
    StorelocsiteStoreroom's Site for this work plan material item.
    ManufacturerThe Manufacturer of this work plan material 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.
    OrgIdIdentifier of the organization for this failure.
    PRIdentifier of the purchase requisition of the ordered item of this work plan material.
    PRLineNumThe Purchase requisition Line number of the ordered item of this work plan material.
    RequestByThe Person requesting this item of this work plan material.
    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.
    UnitCostItem 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.
    WPM1-WPM3Extra fields, crossover fields from JobMaterial.JM1-JM3.
    RATEThe toolrate of the tool. This attribute is applicable to WPTool only.
    RaterHasChangedSet to True when a user manually enters rate for a tool. This attribute is applicable to WPTool only.
    HoursThe number of hours that this tool was used for. User-entered value. This attribute is applicable to WPTool only.
    RESERVEREQIndicates whether or not the tool requires a reservation. This attribute is applicable to WPTool only.
    • Constructor Detail

      • WPMaterial

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

      • saveNewModifiedWPMaterial

        public void saveNewModifiedWPMaterial(MboRemote mbo)
      • getNewModifiedWPMaterial

        public MboRemote getNewModifiedWPMaterial()
      • init

        public void init()
                  throws MXException
        Initialize the WPMaterial object, owner must be workorder
        Overrides:
        init in class Mbo
        Throws:
        MXApplicationException - ownerWoWPMaterial when this wpmaterial does not have a owner or its owner is not a workorder.
        MXException
      • add

        public void add()
                 throws MXException,
                        java.rmi.RemoteException
        Sets Default value for some of the fields of the new wpmaterial. New wpmaterial 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
        UNITCOSTHASCHANGEDfalse
        storelocsitefalse
        LineTypeITEM
        Specified by:
        add in interface MboRemote
        Overrides:
        add in class WPItem
        Throws:
        MXApplicationException - ownerWoWPMaterial when this wpmaterial does not have a owner or its owner is not a workorder.
        MXException
        java.rmi.RemoteException
      • save

        public void save()
                  throws MXException,
                         java.rmi.RemoteException
        Saves the WPMaterial and all related Mbos
        Overrides:
        save in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • appValidate

        public void appValidate()
                         throws MXException,
                                java.rmi.RemoteException
        Multiple checks are done to validate a WPMaterial. If this isn't a direct request, the location is needed. If this mbo is brand new (toBeAdded), call copyHazardForItem. Finally, changes to WPMaterial may need to be reflected in the InvReserves.
        Overrides:
        appValidate in class Mbo
        Throws:
        MXApplicationException - LocMissing when the method needsStoreroom returns true.
        MXApplicationException - (po, NoItemForLineType) is thrown when line type is ITEM and does not have an item number associate with it.
        MXApplicationException - (workorder, DescriptionRequired) is thrown when line type is MATERIAL and does not have a description.
        java.rmi.RemoteException
        MXException
        See Also:
        WPMaterial.needsStoreroom(), WPItem.copyHazardForItem(), psdi.app.workorder.WPMaterial#updateInvReserve
      • canDelete

        public void canDelete()
                       throws MXException
        Can not delete if there exists an Actual Material for this WPMATERIAL
        Overrides:
        canDelete in class Mbo
        Throws:
        MXAccessException - deletewpmaterial when there exists an Actual Material for this WPMaterial.
        MXException
      • refreshRate

        public void refreshRate()
                         throws MXException,
                                java.rmi.RemoteException
        Sets the unitcost (a.k.a rate).
        Throws:
        MXApplicationException - ItemNotFound when the item is not exist in Item table.
        java.rmi.RemoteException
        MXException
      • getItemCostFromInventory

        public void getItemCostFromInventory()
                                      throws MXException,
                                             java.rmi.RemoteException
        Sets the unitcost to the unitcost from Inventory object.
        Throws:
        MXApplicationException - InventoryNotFound when the item can not be found in specified location in inventory object.
        java.rmi.RemoteException
        MXException
      • updateEstimateTotal

        public void updateEstimateTotal(double delta)
                                 throws MXException,
                                        java.rmi.RemoteException
        Called by custom classes for quantity and rate to update the value of WO.EstMatCost
        Parameters:
        delta - the cost need be added to WO.EstMatCost.
        Throws:
        MXException
        java.rmi.RemoteException
      • setEstCost

        public void setEstCost(MboRemote wo,
                               double lineCost)
                        throws MXException,
                               java.rmi.RemoteException
        Set the Estimated Material(EstMatCost) Cost in workorder
        Overrides:
        setEstCost in class WPItem
        Throws:
        MXException
        java.rmi.RemoteException
      • delete

        public void delete(long accessModifier)
                    throws MXException,
                           java.rmi.RemoteException
        Subtracts the line cost from WO.EstMatCost. When the last WPMaterial is deleted, WO.EstMatCost is editable.
        Specified by:
        delete in interface MboRemote
        Overrides:
        delete in class Mbo
        Parameters:
        accessModifier - The bitwise flag specified to determine if certain normal security checks are to be bypassed for this delete request.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        WPMaterialSet.checkToRemoveHazardInfo(String)
      • undelete

        public void undelete()
                      throws MXException,
                             java.rmi.RemoteException
        Adds the line cost to WO.EstMatCost. If the MboSet was empty before, WO.EstMatCost is zero'ed out and made read-only.
        Specified by:
        undelete in interface MboRemote
        Overrides:
        undelete in class Mbo
        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.
        Overrides:
        setBaseCurrencyUnitCost in class WPItem
        Throws:
        MXException
        java.rmi.RemoteException
      • supplyStoreroom

        public void supplyStoreroom()
                             throws java.rmi.RemoteException,
                                    MXException
        Examines the WPMaterial record and supplies the storeroom when where the record is in need of a storeroom location. This method uses the needsStoreroom method to determine if the location is needed. This method is called by PM Work Order generation methods and by Work Order's Apply Route. If WPMaterial records still need a storeroom location, the user's Labor StoreLocation is supplied. Finally, the supplied site's default storeroom will be used.
        Throws:
        java.rmi.RemoteException
        MXException
        See Also:
        psdi.app.workorder.WPMaterial#needsStoreroom., PM.generateWork(boolean, int, boolean), PM.calculateWork(boolean, java.util.Date), psdi.app.signature.SignatureService#getlaborForuserAndOrg, If set, this takes precedence., If set, this takes precedence.
      • deleteCreatedInvReserves

        public void deleteCreatedInvReserves()
                                      throws MXException,
                                             java.rmi.RemoteException
        IV34122: delete the invreserve that was created before an exception, for example, field Issue To requires a value.
        Throws:
        MXException
        java.rmi.RemoteException
      • setValue

        public void setValue(java.lang.String attributeName,
                             java.lang.String val,
                             long accessModifier)
                      throws MXException,
                             java.rmi.RemoteException
        IJ30306: method to collect list of wpmaterial modified in the current mboset - wpmaterial can be edited when wo is approved. This is for InvReserveSet.updateWpmReservation
        Specified by:
        setValue in interface MboRemote
        Overrides:
        setValue in class Mbo
        Parameters:
        attributeName - The attribute name within the current object.
        val - The string value to set to the attribute.
        accessModifier - The bitwise flags such as NOACCESSCHECK, NOVALIDATION_AND_NOACTION, and DELAYVALIDATION.
        Throws:
        MXException - "Attribute {0} does not exist" exception will be thrown if the attribute does not exist in the object. "Field is read only" exception will be thrown if the attribute is READONLY and the accessModifier does not specify NOACCESSCHECK. "Invalid Data Type" exception will be thrown for datatype mismatch. For example, setting a string value of characters to an attribute which has datatype of YORN.
        java.rmi.RemoteException
        See Also:
        Mbo.setValue(String,String,long)
      • getWPMInVector

        public MboRemote getWPMInVector(java.util.Vector v)
                                 throws MXException,
                                        java.rmi.RemoteException
        IJ30306
        Parameters:
        v -
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException