psdi.app.inventory

Class InvReserve

  • java.lang.Object
  • All Implemented Interfaces:
    java.rmi.Remote, InvReserveRemote, MboConstants, MboRemote, MaxRemoteProxy


    public class InvReserve
    extends Mbo
    implements InvReserveRemote
    Mbo object to represent a reservation. It is unlikely that this object is used directly. It would usually be called from the Inventory app service.

    See Inventory Package description.

    This is a site level object.

    The key attributes in this object are as follows: SiteId, Requestnum

    The attributes in this object are as follows:

    Attribute NameDescription
    ActualqtyQuantity of previously reserved item that has been issued
    DellocationDelivery location for this reserved item
    DescriptionDescription of this reservation. Initially copied from Item.Description but can be modified and serves as additional remark to the reservation.
    DirectreqIf false, reserved item must be issued from inventory. If true, reserved item will be purchased and received directly to the work order, bypassing inventory.
    AssetnumAsset for which this item is being reserved
    GlaccountGL account to be debited on issue
    InitflagDefaults to false, set to true by work order object when work order is initiated.
    IssuetoLaborcode or craft to whom the reserved item will be issued
    ItemnumInventory item being reserved
    ItemSetIDIdentifier of the itemset identifier for this object.
    LdkeyLong Description Key. This is a link to text stored in the LongDescription table.
    LocationStoreroom location of item being reserved
    MrlinenumMaterial request line number from which this Invreserve object originated
    MrnumMaterial request number from which this Invreserve object originated
    OrgIdIdentifier of the organization for this inventory reservation
    PolineidInternal purchase order unique line identifier
    PolinenumPurchase order line number from which this Invreserve object originated
    PonumNumber of approved, internal purchase order from which this Invreserve object originated.
    RequestedbyName of user who reserved the item
    RequesteddateDate and time of the item reservation
    RequestnumUnique identifier automatically generated for each reservation
    RequireddateDate and time the reserved item is needed on the work order
    ReservedqtyQuantity of item that was reserved
    SiteIdIdentifier of the site for this inventory reservation
    WoNumWork order for which this item is being reserved
    • Constructor Detail

      • InvReserve

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

      • init

        public void init()
                  throws MXException
        Initialize the object.
        Overrides:
        init in class Mbo
        Throws:
        java.rmi.RemoteException
        MXException
      • add

        public void add()
                 throws MXException,
                        java.rmi.RemoteException
        Adds a new reservation.
        The table below shows the default values for each of the attributes listed.
        Attribute NameAttribute Value
        actualqty0(zero)
        reservedqty0(zero)
        initflagfalse
        directreqfalse

        Specified by:
        add in interface MboRemote
        Overrides:
        add in class Mbo
        Parameters:
        none -
        Throws:
        none
        MXException
        java.rmi.RemoteException
      • appValidate

        public void appValidate()
                         throws MXException,
                                java.rmi.RemoteException
        Validations done before save().
        Overrides:
        appValidate in class Mbo
        Parameters:
        None -
        Throws:
        MXException
        java.rmi.RemoteException
      • save

        public void save()
                  throws MXException,
                         java.rmi.RemoteException
        Description copied from class: Mbo
        Save the object and other linked objects. Subclasses can code their save() logic to include any appropriate updates to other linked objects and call super.save().
        Overrides:
        save in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • copy

        public MboRemote copy(MboSetRemote mboset)
                       throws MXException,
                              java.rmi.RemoteException
        Description copied from class: Mbo
        Adds a new mbo to the set passed in and copies the information for each of the fields into the new mbo from this.
        Specified by:
        copy in interface MboRemote
        Overrides:
        copy in class Mbo
        Parameters:
        mboset - The set into which the new mbo will be added.
        Returns:
        The new mbo, with values copied from this mbo.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Mbo.copy(MboSetRemote, long)
      • issue

        public MboRemote issue(MboSetRemote newIssueSet,
                               java.lang.String bin,
                               java.lang.String lot,
                               java.lang.String rotasset,
                               double qty)
                        throws java.rmi.RemoteException,
                               MXException
        Return a new MatUseTrans record (ISSUE) for this reservation
        Specified by:
        issue in interface InvReserveRemote
        Parameters:
        bin - the bin of the storeroom to issue from
        lot - the lot if this is a lotted item
        asset - the piece of asset for issue
        Throws:
        java.rmi.RemoteException
        MXException
        See Also:
        psdi.app.inventory.InvReserve#issue(psdi.app.inventory.MboSetRemote, java.lang.String, java.lang.String, java.lang.String, double)
      • canDelete

        public void canDelete()
                       throws MXException,
                              java.rmi.RemoteException
        if work order of this reservation is WMATL status, should not allow user to delete the invserve.
        Overrides:
        canDelete in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • smartFindByObjectName

        public MboSetRemote smartFindByObjectName(java.lang.String sourceObj,
                                                  java.lang.String targetAttrName,
                                                  java.lang.String value,
                                                  boolean exact)
                                           throws MXException,
                                                  java.rmi.RemoteException
        Find a set of records of the object of the specified the application by the specified attribute and values of the current record.
        Specified by:
        smartFindByObjectName in interface MboRemote
        Overrides:
        smartFindByObjectName in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.mbo.Mbo#smartFindByObjectName()
      • delete

        public void delete(long accessModifier)
                    throws MXException,
                           java.rmi.RemoteException
        This method calls deleteInvUseLines() to delete corresponding InvUseLines.
        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. For example: if the accessModifer is NOACCESSCHECK, then the check for the object's NODELETE flag and the call to the object's canDelete() method will not be performed. If the accessModifer is NONE, then all the access checks are performed before this object is marked delete.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Mbo.delete(long)
      • deleteInvUseLines

        public void deleteInvUseLines()
                               throws MXException,
                                      java.rmi.RemoteException
        This method deletes the InvUseLine records for the give requestnum if the invuse(header) record is in Entered Status.
        Throws:
        MXException
        java.rmi.RemoteException
      • undelete

        public void undelete()
                      throws MXException,
                             java.rmi.RemoteException
        This method unmarks the Mbo for deletion.
        Specified by:
        undelete in interface MboRemote
        Overrides:
        undelete in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • setInvResType

        public void setInvResType(java.lang.String displayResType)
                           throws MXException,
                                  java.rmi.RemoteException
        Use this method when you only know the displayResType. Will set the reservation to APSoft if applicable.
        Specified by:
        setInvResType in interface InvReserveRemote
        Parameters:
        displayResType - The reservation type for the workorder, PO, MR, or reservation as an internal value. see #link setInvResType(String displayResType, int resbuffer, boolean disallowNegAvailBal, boolean setAPSoft)
        Throws:
        MXException
        java.rmi.RemoteException
      • setInvResType

        public void setInvResType(java.lang.String displayResType,
                                  int resbuffer)
                           throws MXException,
                                  java.rmi.RemoteException
        See #link setInvResType(String displayResType, int resbuffer, boolean disallowNegAvailBal, boolean setAPSoft)
        Parameters:
        displayResType - The reservation type fo the workorder, PO, MR, or reservation as an internal value.
        resbuffer - The organization buffer time
        setAPSoft - True if the reservation should be set to APSoft. Most of the time this should be true.
        Throws:
        MXException
        java.rmi.RemoteException
      • setInvResType

        public void setInvResType(java.lang.String displayResType,
                                  boolean disallowNegAvailBal)
                           throws MXException,
                                  java.rmi.RemoteException
        Use this method when you want to set the restype and you do not know the resbuffer but do know all the other values. seet #link setInvResType(String displayResType, int resbuffer, boolean disallowNegAvailBal, boolean setAPSoft)
        Specified by:
        setInvResType in interface InvReserveRemote
        Throws:
        MXException
        java.rmi.RemoteException
      • setInvResType

        public void setInvResType(java.lang.String displayResType,
                                  int resbuffer,
                                  boolean disallowNegAvailBal)
                           throws MXException,
                                  java.rmi.RemoteException
        Method to set the reservation restype field base on the following conditions. To know if a reservation can be set to APHARD the following equation will be used. Required Date <= System Date + INVENTORY.LEADTIME + resbuffer If the passed in restype is SOFT, the reservation will be always be SOFT. If the available balance can go negative: 1) If the passed in restype is HARD, the value will be HARD. If the passed in value is not HARD or SOFT (automatic), the system will use the above equation. If the equation is true, then the reservation will be APHARD, otherwise, APSOFT. If the available balance can not go negative then the following will be considered. If the passed in restype is HARD, and the reservation will set the available balance negative, the restype will be BACKORDER and HARDBACKORDER will be set to true. If the passed in restype is neither HARD or SOFT (automatic) and the above equation is true and the reservation will set the available balance negative, the reservation will become BACKORDER. If the above equation is true and there is enough in the inventory, the reservation will become APHARD. If the above equation is false, the reservation will become APSOFT. If the reservation has been set to backorder then a check on HARDBACKORDER will be done to see if the item will go to HARD or APHARD, respectively.
        Specified by:
        setInvResType in interface InvReserveRemote
        Parameters:
        setAPSoft - Will set the reservation to APSOFT if applicpable. Most of the time this will be true.
        Throws:
        MXException
        java.rmi.RemoteException
      • checkWMATStatus

        public boolean checkWMATStatus(java.lang.String itemnum,
                                       java.lang.String location,
                                       java.lang.String itemsetid,
                                       java.lang.String siteid)
                                throws MXException
        Check to see if record exists in WOMATSTATUSSYNC table.
        Parameters:
        itemnum - The inventory record number.
        location - The location of the inventory record.
        itemsetid - The Set of the inventory item.
        siteid - The site where the inventory record exists.
        Returns:
        false if record exists
        Throws:
        MXException
      • setMRUpdated

        public void setMRUpdated()
                          throws MXException,
                                 java.rmi.RemoteException
        This method sets MRUpdate flag to true.
        Throws:
        MXException
        java.rmi.RemoteException
      • setInvReserveValQtyFlag

        public void setInvReserveValQtyFlag()
                                     throws MXException,
                                            java.rmi.RemoteException
        This method sets the flag if the reserved qty needs to be validated.
        Throws:
        MXException
        java.rmi.RemoteException
      • getInvReserveValQtyFlag

        public boolean getInvReserveValQtyFlag()
                                        throws MXException,
                                               java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException