psdi.app.inventory

Class ReorderSet

    • Field Detail

      • mutexType

        public java.lang.String mutexType
        The type of this reorder set. It can be "MR", "DIRECTORDER", "STOREROOM", "STOREROOMDIRECTORDER".
      • mutexSite

        public java.lang.String mutexSite
        Site and Org ID.
      • mutexOrg

        public java.lang.String mutexOrg
      • mrPassedIn

        public MRRemote mrPassedIn
        A Hashtable to keep track of used funds for each used blanket contracts during this reorder process.
      • warnings

        public java.util.Vector warnings
        A vector of warning warnings. This list will be cleared and set with new warnings during the execution of each methods of ReorderSetRemote.
    • Method Detail

      • getMboInstance

        protected Mbo getMboInstance(MboSet ms)
                              throws MXException,
                                     java.rmi.RemoteException
        Generate a new Reorder object.
        Specified by:
        getMboInstance in class MboSet
        Parameters:
        ms - a MboSet
        Returns:
        a Reorder Mbo
        Throws:
        none
        MXException
        java.rmi.RemoteException
      • cancelReorder

        public void cancelReorder()
                           throws MXException,
                                  java.rmi.RemoteException
        Cancel the reorder process.
        This method has to be called if this is not a viewOnly reorder mbo set and reorder process will not continue. The method can only be called on the Mbo set which is obtained from ReorderServer through getReorderSet(), getReorderSetForMR(), and getReorderSetForDirectOrderOnly() methods. It clears the exclusive lock for this reorder if there is one and if it is a request from MR, the entries in the reorder table will also be removed.
        Specified by:
        cancelReorder in interface ReorderSetRemote
        Parameters:
        none -
        Throws:
        none
        MXException
        java.rmi.RemoteException
        See Also:
        ReorderSet.cancelReorder()
      • decideVendorAndCost

        public ReorderSetRemote decideVendorAndCost(boolean groupByVendor,
                                                    boolean considerContract,
                                                    int allowanceDays)
                                             throws MXException,
                                                    java.rmi.RemoteException
        Processing vendor and cost for each reorder item.
        This the last step before actually generating PR and POs. If the item is not a market item, it will identify vendors, unit cost for each item in the reorder set. The contracts will be checked against if group by vendor is true for the items with an item number in the reorder table. See Reorder.processVendorAndCost(boolean) for detail.
        Specified by:
        decideVendorAndCost in interface ReorderSetRemote
        Parameters:
        groupByVendor - Indicates if generated PR/POs needs to be grouped by vendors. If it is true, different items reordered from the same vendors will be different PR/PO lines on the same PR/PO.
        considerContract - True if vendor contract is considered.
        Returns:
        void
        Throws:
        none
        MXException
        java.rmi.RemoteException
        See Also:
        Reorder#processVendorAndCost(boolean)
      • reorder

        public void reorder(boolean groupByVendor,
                            boolean considerContract)
                     throws MXException,
                            java.rmi.RemoteException
        This method generates PRs and/or POs for the items in the reorder set.
        If groupByVendor is true, One PR is generated to include all the items whose prices are provided by the same contract or vendor. In this case, multiple PRLines will be in one PR. If groupByVendor is false, each PR will contain one single prline generated for one reorder item.
        Based on maxvars AUTOPOEXT for external orders and AUTOPOINT for internal orders, this method decide if it will generate waiting for approval PR, approved PR, waiting for approval PO, or approved PO when the maxvar is PRWAPPR, PRAPPR, POWAPPR, and POAPPR respectively. The approval process of generated PRs/POs is the same as approve the PR/PO individually outside of reorder process. If PR or PO is controlled by workflow, and if maxvar WFONPRREORDER, and WFONPOREORDER indicates so, the generated PR or PO will be put into workflow.
        The minimum and maximum PR/PO number is recorded through the process in this object and can be retrieved by calling its getReorderResult() method.
        If the reorder process is not initiated by MR, after each group of items by the same contract or vendor is finished processing, it commits to the database. If POs are generated, saving the POs and saving the PRs are in the same transaction. If the reorder process is initiated by MR, the reorder process only commit all together after all the lines in the MR is processed.
        Specified by:
        reorder in interface ReorderSetRemote
        Parameters:
        groupByVendor - True to genreate PRs grouped by vendor. If groupByVendor is true, each PR is generated for one blanket contract for a vendor. Multiple PRLines will be inserted. If groupByVendor is false, One PR is generated for one reorder item.
        considerContract - boolean
        Throws:
        none
        MXException
        java.rmi.RemoteException
        See Also:
        ReorderSet.reorder(boolean, boolean)
      • setKey

        public void setKey(java.lang.Object parent,
                           java.lang.String key,
                           java.lang.String type,
                           java.lang.String siteID,
                           java.lang.String orgID)
                    throws MXException,
                           java.rmi.RemoteException
        Determines what type of reorder request this is and what the key is to the mutex entry in the mutex table if it has one.
        This method can only be invoked by the ReorderService. The type can be "DIRECTORDER", "STOREROOM", "STOREROOMDIRECTORDER", and "MR". According to the type, the key can be location, mrnum or even blank if it is direct order only.
        Parameters:
        parent - Identifies the caller.
        theStoreRoom - The storeroom. ReorderServiceRemote.REORDERONLY if it is direct order only.
        key - According to the type, the key can be location, mrnum or even blank if it is direct order only.
        type - The type can be "DIRECTORDER", "STOREROOM", "STOREROOMDIRECTORDER", and "MR".
        Throws:
        MXApplicationException -
        GROUPKEYREASON
        reorderInvalidSetStoreRoomif parent is not serviceRemote
        MXException
        java.rmi.RemoteException
      • setInsertDate

        public void setInsertDate(java.lang.Object parent,
                                  java.util.Date date)
                           throws MXException,
                                  java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • setUserName

        public void setUserName(java.lang.Object parent,
                                java.lang.String theUserName)
                         throws MXException,
                                java.rmi.RemoteException
        Determines who the user is who placed this reorder request.
        It is a convenient function only meant to be used by the ReorderService which obtains this Mbo set. The object parent is used to check if the caller is an authorized caller.
        Parameters:
        parent - Identifies the caller of this function.
        theUserName - The user name for this reorder.
        Throws:
        MXApplicationException -
        GROUPKEYREASON
        reorderInvalidSetUserName if parent is not serviceRemote
        MXException
        java.rmi.RemoteException
      • setViewOnly

        public void setViewOnly(java.lang.Object parent,
                                boolean viewOnlyFlag)
                         throws MXException,
                                java.rmi.RemoteException
        Set the view only flag of this reorder set.
        This is the function only can be called by the ReorderService which obtained this reorder mbo set. The object parent works as an identifier to let Reorder set know if the caller is an authorized caller.
        Parameters:
        parent - Identifies the caller of this function
        viewOnlyFlag - View only flag.
        Throws:
        MXApplicationException -
        GROUPKEYREASON
        reorderInvalidSetViewOnly if parent is not serviceRemote
        MXException
        java.rmi.RemoteException
      • getReorderWarnings

        public java.util.Vector getReorderWarnings()
                                            throws java.rmi.RemoteException
        Returns a vector of MXApplicationExceptions.
        These are the warnings generated by the previous method called on the reorder set since the clearance of the last time. The user should always call this after reorder is finished to see if there is any warning generated. If there is no warnings, the vector's size is 0.
        Specified by:
        getReorderWarnings in interface ReorderSetRemote
        Parameters:
        none -
        Returns:
        A vector of MXApplications. It will be empty if there is no warning.
        Throws:
        none
        java.rmi.RemoteException
        See Also:
        ReorderSet.getReorderWarnings()
      • getReorderResult

        public java.lang.Object[] getReorderResult()
                                            throws java.rmi.RemoteException
        Get the information that reflects either the preview or the final reorder result. It includes start and end generated PR numbers, start and end generated PO numbers if any, and the total number of items processed.
        Specified by:
        getReorderResult in interface ReorderSetRemote
        Returns:
        Object[] a five element object array contains:
        • Integer total number of items reordered
        • String the start of the pr number generated
        • String the end of the pr number generated
        • String the start of the po number generated, empty if no po's generated
        • String the end of the po number generated, empty if no po's generated
        Throws:
        java.rmi.RemoteException
        See Also:
        ReorderSet.getReorderResult()
      • monitorLock

        public void monitorLock(java.lang.String siteID)
                         throws MXException,
                                java.rmi.RemoteException
        Spawn a thread to sleep the amount of time specified in mxserver.properties' mxe.reorder.previewtimeout, and wake up to check if the reorder is being performed on the request locked by the specified reordermutex record. If it is not, remove the record. Thread will terminate automatically.
        Specified by:
        monitorLock in interface ReorderSetRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        ReorderSet.monitorLock(String)
      • deleteNullOrderUnit

        public void deleteNullOrderUnit(UserInfo userInfo,
                                        java.lang.String siteID)
                                 throws MXException,
                                        java.rmi.RemoteException
        Delete records from ReorderPad if the order unit is null.
        Specified by:
        deleteNullOrderUnit in interface ReorderSetRemote
        Parameters:
        userInfo - UserInfo object of whom is performing this operation.
        siteID - Site.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        ReorderItemsSet#execute()