psdi.app.inventory

Class Reorder

  • All Implemented Interfaces:
    java.rmi.Remote, ReorderRemote, MboConstants, MboRemote, MaxRemoteProxy


    public class Reorder
    extends Mbo
    implements ReorderRemote
    Mbo object to represent Reorder.The table is ReorderPad. The table content is populated automatically by the reorder process. The storeroom reorder result remains in the table until the process is invoked by the same user to the same storeroom. The result for direct order will be cleared when the next reorder process for direct order items is started by the same user. The reorder result for desktop requisition is cleared immediately after the process is finished.

    This object doesn't have key attributes.

    See Inventory Package description.

    The attributes in this object are as follows:

    Attribute NameDescription
    CATALOGCODE Vendor catalog Code for the Item if available.
    CATEGORYCategory of item: Stocked/Non-Stocked/Special Order.
    CONTRACTLINEIDLine ID of the contract applied to the order of this item. Along with CONTRACTREFNUM, it specifies the contract line from which the price of this item is obtained.
    CONTRACTREFNUMNumber of the Contract applied to the order of this item. Along with the CONTRACTREFNUM, it specifies the contract line from which the price of this item is obtained.
    CURBALCurrent balance at this storeroom if the order is for the storeroom.
    DELIVERYTIMEDelivery Time, used to calculate the required date of this item.
    DESCRIPTIONDescription of the item being ordered. It is this item's description or MR's description if the order is for MR.
    ASSETLOCATION The location of the asset that requires the item.
    ASSETNUMThe asset that requires the item.
    EXPLOTQTYTotal quantity of this item in expired lots. It is considered when calculating the quantity being reordered.
    GLACCOUNTGL Account copied from inventory's glaccount.
    GLCREDITACCT GL Account to be credit.
    GLDEBITACCTThe GL Account to be debited for this item. It is the control account of the inventory record.
    Extra Fields IN19 thru IN23Extra Fields copied from item
    ITEMNUMItem number of the item being reordered.
    LINETYPE The type of item or service being ordered. Possible values include ITEM, MATERIAL, SERVICE or EXTERNAL.
    LOCATIONThe storeroom where the item is required. Empty if it is for direct order.
    LOTTYPEInventory lot type for this item (LOT or NOLOT).
    MANUFACTURERCompany that manufactured the item if available.
    MAXLEVELMaximum level - Not used.
    MINLEVELMinimum level.The minimum inventory level (reorder point). If user chooses to use reorder point, the item will be reordered only if the available quantity in the storeroom is dropped belong this amount. specified for the ITEMNUM-LOCATION. Filled in by Workorder Approval or Material Request Approval.
    MODELNUM Vendor Model Number For The Item if available.
    MRLINENUMMaterial request line number against which this item is requested. Only applicable for the reorder process for MR. It is null for storeroom reorder items.
    MRNUMThe Material Request Number against which the Direct Request has been made, if any. Filled in by Material Request Approval. It is null for storeroom reorder items.
    ORDERQTYOrder quantity , quantity to be re-ordered(Inventory Reorder Quantity,
    ORGID Organization of the site where reorder is taking place. in ORDERUNITS. It is calculated by the reorder process.
    ORDERUNITUnit of order of the item to be ordered.
    PONUMThe number of the PO containing the order of this item generated by reorder process.
    POQTYTotal quantity of this item on existing purchase orders. It is considered when calculating the reorder quantity.
    PRNUMNumber of the PR containing the order of this item generated by the reorder process.
    PRQTYTotal quantity of this item on the existing purchase requests. It is considered when calculating the reorder quantity.
    REORDERQTYThe quantity of this item being reordered. It is calculated by the reorder process if the reorder is for a storeroom, otherwise, it is specified on the direct order.
    REQUESTBYThe person making the request in case of direct issue lines. It is the user name of the person. Applicable only to direct order items. It is the enterby field of MR or requestby field of wpitem.
    REQUIREDATE Date on which item is required.
    RESERVEDQTYQuantity of the item already being reserved. It is considered when calculating the reorder quantity.
    SCHEDSTARTScheduled start date for the workorder when it is direct order item from a workorder.
    SITE The site of the location, MR, or the direct order items the reorder is processing.
    TARGSTARTDATETarget Start Date for the item when it is direct order item from a workorder.
    UNITCOSTUnit cost for the item being ordered. It is decided by the reorder process.
    USRNAME Login user name of the person who performs the reorder.
    VENDORVendor code from where the item is being ordered. It is decided by the reorder process according to a predefined logic.
    VENDORPACKCODEThe pack code of the product. It is the code of how the items will be packed. For example, BOX (12 to a box) or PALLET (30 to a pallet). Only applicable to direct order items.
    VENDORPACKQUANTITYThe quantity of the pack code. For example, pack code is box pack quantity is 12. Only applicable to direct order items.
    VENDORWAREHOUSE Vendor warehouse that the product will come from.
    WONUMThe Work Order that requires the item. Applicable to direct order item.
    See Also:
    ReorderMutex
    • Constructor Detail

      • Reorder

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

      • init

        public void init()
                  throws MXException
        init() Initialization rountine. Set field flags for both always readonly attributes as well as those fields which are editable only during insert
        Overrides:
        init in class Mbo
        Throws:
        MXException
      • toExtString

        public java.lang.String toExtString()
                                     throws MXException,
                                            java.rmi.RemoteException
        Returns a string to describe the reordering item. For debugging.
        Specified by:
        toExtString in interface ReorderRemote
        Parameters:
        none -
        Returns:
        String a description of this reordering item.
        Throws:
        none
        MXException
        java.rmi.RemoteException
        See Also:
        Reorder.toExtString()
      • processVendorAndCost

        public void processVendorAndCost(boolean considerContract,
                                         int allowanceDays,
                                         boolean recheckLeadTime)
                                  throws MXException,
                                         java.rmi.RemoteException
        Process the vendor and cost information for this item.
        Identify the vendor and cost, and update reorder mbo for this item. It involves locating the applicable contracts if considerContract is true. This method and calculateQuantity() will most likely to be called at the same time. The reason to not combine those functionalities into one single method is because the GUI client or some other client program might only need reorder quantity infomation calculated in some occations.

        The rule for getting the vendor and price is as the following:

        1. If itemnum is null, no default price is necessary, and there is no way to find the default vendor if it is not specified. The GLCreditAcct will be set by the vendor if specified and the method returns.
        2. If contract reference number is already specified, that means contracts was found by previous process The unit cost, vendor will be used as the price and vendor, no further actions required except for setting any missing information such as GLCreditAcct from the vendor.
        3. Look for the available blanket and other contracts for the specified itemnum in the following prioritized order. The process will stop at any time when a group of contracts are found. First it look for the blanket contracts with the vendor first if presents, then it looks for the other contracts of this vendor. If there is no contract found for this vendor, look for the contracts of the primary vendor of this item in inventory, then any vendor, always blanket first then other contracts. If there is catalogcode specified, the contract with the catalogcode has the higher priority. A non-blanket contract with the same catalogcode will be picked before a blanket contract without or with a different catalogcode.
        4. The located contracts are examined in order to locate the contract and ContractLine with the lowest price among all. If the order quantity is smaller than the minimum order quantity specified on the contract line, and this order quantity is auto-calculated by reorder (not specified explicitly by the user,) then the final reorder quantity will be the minimum order quantity of the contract if this contract is being used. The cost will be based on the final quantity. The contract which provides the lowest total cost will be chosen. The vendor, unit price, GL account, order unit etc. will be set according to the contract. The vendor will be updated by the contract's vendor if it is different than the one originally existed.
        5. If there is no contract found, it tries to locate a bid price first than the last cost of the invvendor record of the primary vendor, and then the bid price first then the last cost of the invvendor record of the default value. If all of them are 0, find the most recent last price of any vendor in invvendor for this item. If reorder doesn't have a vendor to start with, the vendor whose the price is obtained will be set as the vendor, otherwise, only the price will be taken, the vendor previously specified will stay.

        1. If reorder is for MR and there is Contract Reference number specified on this MRLine already, reorder will find the specified contract and the line for the item. Since MRLine only have contract reference number specified but not contract line number, reorder finds the contractline of this contract containing this item number. It is most likely to only have one such line.
        2. If vendor is picked by reorder the default vendor from invvendor. This include when vendor is already provided by MRLine when it reaches reorder. Since reorder doesn't know how the vendor got on to the mrline.
        Specified by:
        processVendorAndCost in interface ReorderRemote
        Parameters:
        considerContract - True if contracts need to be considered.
        allowanceDays - extra leadtime
        recheckLeadTime - whether recheck if reorder need to process this item based on invvendor's leadtime
        Throws:
        none
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.inventory.Reorder#processVendorAndCost(boolean)
      • generatePRHeader

        public PRRemote generatePRHeader(PRSetRemote prSet)
                                  throws MXException,
                                         java.rmi.RemoteException
        Add a new PR to prSet, and update it with the information in this reorder item.
        MR will only be ordered through MR reorder, the direct order from inventory reorder will not order for MR. Because of this, one MR will generate one or more PR/POs, but there won't be cases that one PR/PO covers lines from more than 1 MR. If MR's description is not empty, the reorder generated PR/PO will carry the MR's description. If it is empty, the description of generated PR/PO will be the string from reorder.txt. Since there will be no situation that one PR covers multple MR, we are not going to check for this case.
        Specified by:
        generatePRHeader in interface ReorderRemote
        Parameters:
        prSet - a PRSetRemote
        Returns:
        It returns the new PR.
        Throws:
        none
        MXException
        java.rmi.RemoteException
        See Also:
        Reorder.generatePRHeader(PRSetRemote)
      • generatePRLine

        public void generatePRLine(PRRemote pr,
                                   boolean groupByVender)
                            throws MXException,
                                   java.rmi.RemoteException
        Excecute Reorder for this item.
        Generate PRLine for this item and add to the pr. It also updates related fields for this reordered item.
        Specified by:
        generatePRLine in interface ReorderRemote
        Parameters:
        groupByVender - true if reorder should be grouped by vendor
        Throws:
        none
        MXException
        java.rmi.RemoteException
        See Also:
        Reorder.generatePRLine(PRRemote, boolean)
      • generatePOLine

        public void generatePOLine(PRRemote po,
                                   boolean groupByVender)
                            throws MXException,
                                   java.rmi.RemoteException
        Excecute Reorder for this item.
        Generate POLine for this item and add to the pO. It also updates related fields for this reordered item. This function is only called when generating PR is not needed.
        Specified by:
        generatePOLine in interface ReorderRemote
        Parameters:
        groupByVender - true if reorder should be grouped by vendor
        Throws:
        none
        MXException
        java.rmi.RemoteException
        See Also:
        Reorder.generatePOLine(PRRemote, boolean)
      • calculateReorderQtywithInventory

        public void calculateReorderQtywithInventory(MboRemote inventoryMbo)
                                              throws MXException,
                                                     java.rmi.RemoteException
        Deprecated. 
        10-14337: if orderunit used is different from inventory.orderunit,need to convert the orderunit in order to calculate true reorderqty.
        Parameters:
        inventoryMbo -
        Throws:
        MXException
        java.rmi.RemoteException