psdi.app.mr

Class MR

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


    public class MR
    extends StatefulMbo
    implements MRRemote
    MBO object to represent a Material Requisition. Materials or Services that need to be requested are done through the Material requisition. Every line of material or service or special order item to be requested, form every line in the MRLine object.Each line either requests items or services from either a vendor or a storeroom based on which they are qualified as direct or indirect requests. Approval of an MR automatically invokes the Reorder object that in turn creates a Purchase Requiistion for each line On the approval of a Purchase Requisition, a Purchase Order is created and when all the POLines are received the MR is closed. See Material Requisition Package description.

    This an organiztion level object.
    The key attributes for this object are SiteID and MRNum

    The attributes in this object are as follows:

    Attribute Name Description
    BaseTotalCost The total cost of the Material Requisition in BaseCurrency1
    BaseTotalCost2 The total cost of the Material Requisition in BaseCurrency2
    ChangeBy, ChangeDate Name of the user who last updated this object and date of last change.
    CurrencyCode A non-persistent field on the MR object. Indicates the currencycode.
    Description The description of the Material Requisition.
    DropPoint The drop point where the items are to be delivered.
    EnterBy, EnterDate Name of the user who first entered this Material Request and the date on which this Requisition was entered.
    AssetNum The identifier or the code of the asset that requires this item.
    FinCtrlId Financial Control identifier.
    GLDebitAcct The General Ledger account to which the MR is to be charged.
    HistoryFlag A YORN field used to indicate whether the MR status is CLOSED or APPROVED or WAPPR. If the MR is closed, the history flag is set to true.
    LDKey Long Description Key. This is a link to text stored in the LongDescription table.
    Location The location to which the items and services on this MR should be sent to.
    MRDate The date on which the Material Requisition was requested.
    MRNum A unique identifier identifying the Material Requisition number. This is the primary key of the MR table.
    MRStatusSeq MR status sequence.
    OrgID Identifier of the organization for this Material Requisition.
    PCardExpDate The procurement card expiration date. Similar to the expiration date on a credit card. Crosses over to PR.PCardExpDate.
    PCardNum Procurement card number. Similar to a credit card number. Crosses over to PR.PCardNum.
    PCardType The type of Payment like VISA, MASTERCARD, AMEX etc. Crosses over to PR.PCardType.
    PCardVerification Procurement Card Verification Value.
    Phone Phone number of the requisitioner.
    Priority Indicates the priority with which this Material Requisition should be handled.
    RequestedBy The Person who requests this Material Requisition.
    RequiredDate The earliest date by which the items on this material req must be delivered.
    ShipTo Identifier of the company to whom this MR will be shipped.
    SiteIDIdentifier of the site for this Material Requisition.
    StatusThe status of the Material Requisition. Can be one of approved, waiting for approval, cancelled, closed
    StatusDate The date on which the status of this MR was changed.
    TotalCost The total cost on the MR.
    TransType A non-persistent field on the MR object. This is a string that indicates whether an MR is opened or closed
    Type The type of Material request. Could be one of  STANDARD or RECURRING.
    WFActiveFlag to indicate if this MR is active in Workflow.
    WFIDEvery MR that is in workflow has a workflow id.
    WONumIdentifier of the Work Order that requires the items or services on the Material request.
    MR1 thru MR10 Extra Fields.
    MRLA1 thru MRLA5 Extra cross over fields. Cross over to PR's PRLA1 thru PRLA5 or PO's POLA1 thru POLA5

    Last Update: Tuesday, March 20, 2002 - Ganesh - javadocs

    • Field Detail

      • itemReferences

        public java.util.Hashtable itemReferences
        A hashtable that will hold all the itemnumbers and all corresponding itemMbo References.
      • checkLimitWhenApprove

        public boolean checkLimitWhenApprove
        During approval of MR, the approval limit needs to be checked. Turn this flag to false if the limit should not be checked.
      • mrMbo

        public MR mrMbo
    • Constructor Detail

      • MR

        public MR(MboSet ms)
           throws MXException,
                  java.rmi.RemoteException
        Construct the MR object. Just call the super constructor.
        Throws:
        MXException
        java.rmi.RemoteException
    • Method Detail

      • getItemReferenceHashtable

        public java.util.Hashtable getItemReferenceHashtable()
                                                      throws MXException,
                                                             java.rmi.RemoteException
        This method returns the Hashtable that holds all the itemnums and itemMbo references. itemReferences is a Hashtable that holds the references of all the newly created Item Mbos when the user creates special order items by just entering the description on the MRLine
        Specified by:
        getItemReferenceHashtable in interface MRRemote
        Throws:
        MXException
        java.rmi.RemoteException
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.mr.FldMRLineDescription
      • setItemReferenceHashtable

        public void setItemReferenceHashtable(java.lang.String itemnum,
                                              MboRemote item)
                                       throws MXException,
                                              java.rmi.RemoteException
        This method adds the itemnum and itemMbo reference to the Hashtable that holds all the itemnums and itemMbo references.
        Specified by:
        setItemReferenceHashtable in interface MRRemote
        Throws:
        MXException
        java.rmi.RemoteException
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.mr.FldMRLineDescription
      • getProcess

        public java.lang.String getProcess()
        Return the work flow process for material requests.
        Returns:
        - The string object "MR"
      • init

        public void init()
                  throws MXException
        Init method called by Architecture This method overrides the init in Mbo to provide custom initialisation. inititialize fields to readonly based on status The following fields are set to readonly
        1. TRANSTYPE
        2. BASETOTALCOST
        3. BASETOTALCOST2
        4. CURRENCYCODE
        Overrides:
        init in class Mbo
        Throws:
        MXException
      • add

        public void add()
                 throws MXException,
                        java.rmi.RemoteException
        Add a new Specific Material Request. Required fields of the Material Requisition are initialised in this method.
        The following fields are initialised with their respective values

        Attribute Name Attribute Value
        changeby Current username
        changedate Current Date
        currencycode Base Currency
        enterby Current user name
        enterdate Current date
        gldebitacct GLAccount from the corresponding labor record.
        historyflag No
        mrdate Current date
        priority 0(zero)
        requestedby Login user Name
        shipto Site's shiptoaddresscode
        status Waiting for Approval
        statusdate Current Date
        totalcost 0(zero)
        type "STANDARD"
        wfactive No
        Specified by:
        add in interface MboRemote
        Overrides:
        add in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        SignatureService.getLaborForUserAndOrg(java.lang.String, java.lang.String, psdi.security.UserInfo)
      • setDefaultStoreLoc

        public void setDefaultStoreLoc(java.lang.String defStore)
        Set the default storeloc for this MR. Called by psdi.app.mr.client.MR when a user changes their default storeloc. Also called internally when the user enters the reportedby field
        Specified by:
        setDefaultStoreLoc in interface MRRemote
        Parameters:
        The - new default storelocation
        See Also:
        MR.setDefaultStoreLoc(java.lang.String)
      • getDefaultStoreLoc

        public java.lang.String getDefaultStoreLoc()
                                            throws java.rmi.RemoteException
        Returns the defaultstoreloc for the person that reported this mr.
        Specified by:
        getDefaultStoreLoc in interface MRRemote
        Returns:
        java.lang.String. This could be null during creation of the mr.
        Throws:
        java.rmi.RemoteException
        See Also:
        MR.getDefaultStoreLoc()
      • getDefaultStoreLocSite

        public java.lang.String getDefaultStoreLocSite()
                                                throws java.rmi.RemoteException
        Returns the defaultstorelocsite for the person that reported this mr.
        Specified by:
        getDefaultStoreLocSite in interface MRRemote
        Throws:
        java.rmi.RemoteException
        See Also:
        MR.getDefaultStoreLocSite()
      • makeRecurring

        public boolean makeRecurring()
                              throws MXException,
                                     java.rmi.RemoteException
        Alters the current mr and flags it s recurring.
        Specified by:
        makeRecurring in interface MRRemote
        Returns:
        boolean true if the alteration was successful, false otherwise
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        MR.makeRecurring()
      • undoChangeToRecurring

        public void undoChangeToRecurring()
                                   throws MXException,
                                          java.rmi.RemoteException
        Reverses a call to makeRecurring.
        Specified by:
        undoChangeToRecurring in interface MRRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        makeRecurring
      • isTransfer

        public boolean isTransfer()
                           throws MXException,
                                  java.rmi.RemoteException
        Identifies if the mr is of type transfer.
        Specified by:
        isTransfer in interface MRRemote
        Returns:
        true if type is transfer false otherwise
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        MR.isTransfer()
      • modify

        public void modify()
                    throws MXException,
                           java.rmi.RemoteException
        Called when ever a field is modified so we can update the changedate/changeby.
        Overrides:
        modify in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • isRecurring

        public boolean isRecurring()
                            throws MXException,
                                   java.rmi.RemoteException
        Identifies if the mr is of type recurring.
        Specified by:
        isRecurring in interface MRRemote
        Returns:
        true if type is recurring false otherwise
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        MR.isRecurring()
      • isStandard

        public boolean isStandard()
                           throws MXException,
                                  java.rmi.RemoteException
        Identifies if the mr is of type standard
        Specified by:
        isStandard in interface MRRemote
        Returns:
        true if type is standard false otherwise
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        MR.isStandard()
      • isWAPPR

        public boolean isWAPPR()
                        throws MXException,
                               java.rmi.RemoteException
        Is MR's status WAPPR
        Specified by:
        isWAPPR in interface MRRemote
        Returns:
        true if status is WAPPR false otherwise
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        MR.isWAPPR()
      • isAPPR

        public boolean isAPPR()
                       throws MXException,
                              java.rmi.RemoteException
        Is MR's status APPR
        Specified by:
        isAPPR in interface MRRemote
        Returns:
        true if status is APPR false otherwise
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        MR.isAPPR()
      • isDraft

        public boolean isDraft()
                        throws MXException,
                               java.rmi.RemoteException
        Is MR a draft
        Specified by:
        isDraft in interface MRRemote
        Returns:
        true if MR is a draft false otherwise (draft MR is WAPPR, not in workflow, and not recurring)
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        MR.isDraft()
      • isClosed

        public boolean isClosed()
                         throws MXException,
                                java.rmi.RemoteException
        Is MR's status CLOSE
        Specified by:
        isClosed in interface MRRemote
        Returns:
        true if status is CLOSE false otherwise
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        MR.isClosed()
      • canDelete

        public void canDelete()
                       throws MXException,
                              java.rmi.RemoteException
        Can the object be deleted? MR's can only be deleted if the status is Waiting for Approval. An MR with any other status cannot be deleted.
        Overrides:
        canDelete in class Mbo
        Throws:
        MXException - thrown if this mr cannot be deleted
        java.rmi.RemoteException
      • delete

        public void delete(long accessModifier)
                    throws MXException,
                           java.rmi.RemoteException
        Delete this mr along with all relevant lines and transactions
        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 - thrown if this mr cannot be deleted
        java.rmi.RemoteException
        See Also:
        Mbo.delete(long)
      • undelete

        public void undelete()
                      throws MXException,
                             java.rmi.RemoteException
        un-delete this mr along with all relevant lines and transactions.Also undelete the correponding MRStatus Mbos.
        Specified by:
        undelete in interface MboRemote
        Overrides:
        undelete in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • completeLine

        public void completeLine(java.lang.String mrlinenum)
                          throws MXException,
                                 java.rmi.RemoteException
        Marks the specified line number as completed. Called by the issueing and/or receiving process by the inventory component. It is possible for this mr to change status to close automatically.
        Specified by:
        completeLine in interface MRRemote
        Throws:
        MXException - thrown if the specified mrline does not exist
        java.rmi.RemoteException
        See Also:
        MR.completeLine(java.lang.String)
      • lineCompleted

        public void lineCompleted()
                           throws MXException,
                                  java.rmi.RemoteException
        Internal processing of a completion of a line. This method will close the current mr if all other lines are marked complete.Check for the "complete" flag on the MRLine and if all the lines are complete..CLOSE the MR
        Specified by:
        lineCompleted in interface MRRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        MR.lineCompleted()
      • copy

        public MboRemote copy(MboSetRemote mboset)
                       throws MXException,
                              java.rmi.RemoteException
        Copies this mr into the target Mboset. This method will copy all the relevant fields from this mr to a new mr in the target mboset. This will also duplicate mrlines. For a non-recurring MR, calls copyMRLine.
        Specified by:
        copy in interface MboRemote
        Overrides:
        copy in class Mbo
        Parameters:
        mboset - The target MboSet
        Returns:
        The new mbo, with values copied from this mbo.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        MR.copyMRLine(psdi.mbo.MboRemote, psdi.mbo.MboRemote)
      • setCopyDefaults

        public void setCopyDefaults()
                             throws MXException,
                                    java.rmi.RemoteException
        Default defaults for a new mr that is a copy of another. This defaults values to type, changedate and changeby. This method has been overridden and is called by the framework to set the defaults after copying.
        Specified by:
        setCopyDefaults in interface MboRemote
        Overrides:
        setCopyDefaults in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • createNewRecurringMR

        public MboRemote createNewRecurringMR(MRSetRemote target,
                                              java.lang.String description,
                                              java.lang.String long_description)
                                       throws MXException,
                                              java.rmi.RemoteException
        Create a new mr of type recurring based on this mr. This method copies over all relevant fields from this mr to the target mr. The following fields are copied over from the source MR to the target MR.
        1. description
        2. long description
        3. drop point
        4. mr1..mr10
        5. priority
        6. shipto
        7. totalcost
        8. currencycode
        9. type is set to "RECURRING"

        The following fields are copied over from the source MRLine to the target MRLine.
        1. catalogcode
        2. category
        3. description
        4. long description
        5. directreq
        6. droppoint
        7. itemnum
        8. linecost
        9. linetype
        10. manufacturer
        11. modelnum
        12. mrlin1..5
        13. orderunit
        14. partialissue
        15. qty
        16. remarks
        17. storeloc
        18. unitcost
        19. vendor
        20. inspectionrequired
        21. currencycode

        Specified by:
        createNewRecurringMR in interface MRRemote
        Parameters:
        target - The target mboset where the new mr is created
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        MR.createNewRecurringMR(psdi.app.mr.MRSetRemote, java.lang.String, java.lang.String)
      • unApproveMR

        public void unApproveMR()
                         throws MXException,
                                java.rmi.RemoteException
        Un-approve this mr. The method is called by psdi.app.mr.client.MR. This changes the status to WAPPR
        Specified by:
        unApproveMR in interface MRRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        MR.unApproveMR()
      • cancelMR

        public void cancelMR()
                      throws MXException,
                             java.rmi.RemoteException
        Cancel this mr. The method is called by psdi.app.mr.client.MR.
        Specified by:
        cancelMR in interface MRRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        MR.cancelMR()
      • copyMRLine

        protected void copyMRLine(MboRemote fromLine,
                                  MboRemote newLine)
                           throws MXException,
                                  java.rmi.RemoteException
        Copies attribute values from a source MRLine to a target MRLine. Copies the floowing attributes
        1. itemnum
        2. linetype
        3. qty
        4. orderunit
        5. vendor
        6. manufacturer
        7. modelnum
        8. catalogcode
        9. description
        Parameters:
        fromLine - The source MRLine.
        newLine - The target MRLine.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        MR.copyMRLines(java.lang.String, int[]), MR.copy()
      • getAllHistoricalTransactions

        public java.util.Vector getAllHistoricalTransactions()
                                                      throws MXException,
                                                             java.rmi.RemoteException
        Gets mr-related history from multiple business objects.
        Specified by:
        getAllHistoricalTransactions in interface MRRemote
        Returns:
        A vector of transaction records containing display-ready strings where each transaction is sorted by decreasing date order (first element of each transaction record) Vector consists of changedate, description, status, changeby, reference, reference number, vendor
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        MR.getAllHistoricalTransactions()
      • createRecurringReqs

        public MboRemote createRecurringReqs()
                                      throws MXException,
                                             java.rmi.RemoteException
        Adds a new MR to this MboSet and and copies the values from the current record into the new one and returns the newly created Req. newReq is the new record created
        Specified by:
        createRecurringReqs in interface MRRemote
        Returns:
        MboRemote - the newly created recurring MR
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        MR.createRecurringReqs()
      • getTotalCostCurrencyCode

        public java.lang.String getTotalCostCurrencyCode()
                                                  throws MXException,
                                                         java.rmi.RemoteException
        This method returns the currencycode based on the following conditions:
        1. Returns the basecurrency1 if the mrlines are in different vendor currencies.
        2. Returns the mrline currencycode if all the lines are in the same currency.
        3. Returns the base currency if there are no MR lines.
        Specified by:
        getTotalCostCurrencyCode in interface MRRemote
        Returns:
        The currencycode.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        MR.getTotalCostCurrencyCode()
      • copySpareParts

        public void copySpareParts(MboSetRemote sparePartSet)
                            throws MXException,
                                   java.rmi.RemoteException
        Adds the spare parts to the MRs MRLines. This method receives a set of spare parts, gets the MRLines for this MR and adds the spare parts as MRLines by calling the copy method on MboSet.
        Specified by:
        copySpareParts in interface MRRemote
        Parameters:
        sparePartSet - The set of spare parts from the UI
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        MR.copySpareParts(psdi.mbo.MboSetRemote)