psdi.app.jobplan

Class JobItem

  • All Implemented Interfaces:
    java.rmi.Remote, JobItemRemote, MboConstants, MboRemote, MaxRemoteProxy
    Direct Known Subclasses:
    JobMaterial, JobService, JobTool


    public class JobItem
    extends Mbo
    implements JobItemRemote
    Base MBO object that represents a Job Material,Job Services and JobTool.
    See JobPlan Package description for details.

    The attributes in this object are as follows::

    Attribute NameDescription
    ConditionCodeThe condition of the item in a given job plan
    DirectReqIndicates whether the item will be purchased with the intent of issuing the it directly upon receipt or not.
    HoursNumber Of Hours For Which A Tool Is Used. APllicable to Tool only.
    ItemnumIdentifier of the item being used.
    ItemQty}Specifies the number of items needed for the task.
    ITEMSETIDSet identifier for the item.
    JobplanidA system generated unique identifier for the job plan that owns this Job Item. This will be copied from owner Job Plan to this Job Item.
    JobItemidA system generated unique identifier for this Job Tool.
    JpnumIdentifier for the Job Plan. This will be copied from owner Job Plan to this Job Material.
    JpTaskIdentifier of the the Job Plan task for which this Item is used.
    LineCostA non-persistent attribute that indicates the estimated total cost of the Item.
    LineTypeThe Line type of JobMaterial, JobService and JobTool.
    LocationIdentifier of the storeroom location of this item.
    OrgIdIdentifier of the organization for the Job Item.
    siteidIdentifier of the Site for the Job Tool.
    RateIdentifies the Cost for the Tool per hour.
    ReserveReqIdentifies Whether Reservation Required for this tool
    StoreLocSite Storeroom's Site
    UnitCostA non-persistent attribute that indicates the unit cost of the Item.
    VendorIdentifier of the Company for Contractor who supplies the materials.
    JM1 through JM6Extra Fields.

    • Constructor Detail

      • JobItem

        public JobItem(MboSet ms)
                throws MXException,
                       java.rmi.RemoteException
        Construct the JobItem object
        Throws:
        MXException
        java.rmi.RemoteException
    • Method Detail

      • init

        public void init()
                  throws MXException
        Initialize the Job Item object
        Set the orgid READONLY flag to true if there is an orgid on the jobplan
        Set the siteid READONLY flag to true if there is a siteid on the jobplan
        Overrides:
        init in class Mbo
        Throws:
        MXException
      • initFieldFlagsOnMbo

        public void initFieldFlagsOnMbo(java.lang.String attrName)
                                 throws MXException
        Description copied from class: Mbo
        The logic of setting the readonly and required field flags to the mbo. Any setting of the field flags that require expensive operation, such as database query should be moved from init() to this method. However, those which don't require steps such as fetching Mbos can be left in init(). You can group the logic for a few attributes together if logic of deciding their flag is the same, or in other words, can be handled at once.
        Overrides:
        initFieldFlagsOnMbo in class Mbo
        Throws:
        MXException
      • add

        public void add()
                 throws MXException,
                        java.rmi.RemoteException
        Add a new Job Item.
        When a new JobItem(ie. JobMaterial/JobServices is added, the following attributes are set to the default values.
        The jobplan number, jobplanid, orgid and siteid are copied from the jobplan which owns this object.
        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 jpnum.
        Specified by:
        propagateKeyValue in interface MboRemote
        Overrides:
        propagateKeyValue in class Mbo
        Parameters:
        keyName - Should equal "jpnum" or else nothing will be propagated.
        keyValue - The new value of jpnum.
        Throws:
        MXException
        java.rmi.RemoteException
      • setLineCost

        public void setLineCost()
                         throws MXException,
                                java.rmi.RemoteException
        Set linecost value
        The linecost represents the estimated total cost of the item(Material/Service). This value is calculated using the following formula
        line cost = unitcost * quantity
        Throws:
        MXException
        java.rmi.RemoteException
      • setUnitCost

        public void setUnitCost()
                         throws MXException,
                                java.rmi.RemoteException
        Set unitcost value
        The unitcost value will be set to the value of either "AVGCOST" or "STDCOST" or "LASTCOST" depending on the "DEFISSUECOST" of this item.
        Throws:
        MXException
        java.rmi.RemoteException
      • setVendor

        public void setVendor()
                       throws MXException,
                              java.rmi.RemoteException
        Set VENDOR value
        The default Vendor will be depending on the "isdefault" of this item.
        Throws:
        MXException
        java.rmi.RemoteException
      • setUnitCostFromInvvendor

        public void setUnitCostFromInvvendor()
                                      throws MXException,
                                             java.rmi.RemoteException
        Set unit cost from INVVENDOR
        If it is direct issue - if it is a default vendor, then take last cost of the vendor and set it to unitcost - if it is not a default vendor and there invvendor records for this item, then take the latest "last date" vendor records and take last cost from that. - if there is no itemnum and vendor combination in the invvendor table, then do not populate the unitcost.
        Throws:
        MXException
        java.rmi.RemoteException
      • getValidateOrder

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

        protected boolean skipCopyField(MboValueInfo mvi)
                                 throws java.rmi.RemoteException,
                                        MXException
        This method overrides the skipCopyField() in the Mbo. This method takes the MboValueInfo as its parameter to see if this field needs to be copied or skipped.If this field does not need to be copied, it returns true. The following fields donot get copied from the source JobItem to the target JobItem.
        1. jpnum
        2. jobplanid
        Overrides:
        skipCopyField in class Mbo
        Parameters:
        mvi - 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
      • undelete

        public void undelete()
                      throws java.rmi.RemoteException,
                             MXException
        undeletes the Job Material / Job Services.
        If the Task Number:Orgid:Siteid key combination does not exist or is marked for deletion, the jptask field on the job labor is set to null.
        Specified by:
        undelete in interface MboRemote
        Overrides:
        undelete in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.jobplan.JobTask#iisValidTaskComponentKey(MboRemote mbo)
      • appValidate

        public void appValidate()
                         throws MXException,
                                java.rmi.RemoteException
        This method will be called to make sure the Task Number:Orgid:Siteid key combination is a valid JobTask key combination
        Overrides:
        appValidate in class Mbo
        Throws:
        MXApplicationException - If JobItem key is invalid and is a material linetype, then MXApplicationException("jobplan","materialnotvalidjptask")
        MXApplicationException - If JobItem key is invalid and is a service linetype, then MXApplicationException("jobplan","servicenotvalidjptask")
        MXApplicationException - If JobItem key is invalid and is not a material or service linetype, then MXApplicationException("jobplan","notvalidjptask")
        MXApplicationException - If this record has a location and no storelocsite, then MXApplicationException("jobplan","needstoreroomsite")
        MXException
        java.rmi.RemoteException
      • setToolRate

        public void setToolRate()
                         throws MXException,
                                java.rmi.RemoteException
        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
      • getOrgForGL

        public java.lang.String getOrgForGL(java.lang.String lookupAttr)
                                     throws MXException,
                                            java.rmi.RemoteException
        Override Mbo.getOrgForGL as JOBITEM is an ITEMSET object and GLAccount needs ORGID to work. Override the method just to bypass framework's elaborate check of objecttype before returning ORGID.
        Specified by:
        getOrgForGL in interface MboRemote
        Overrides:
        getOrgForGL in class Mbo
        Returns:
        orgId
        Throws:
        MXException
        java.rmi.RemoteException