psdi.app.inventory

Class MatUseTransSet

    • Constructor Detail

    • Method Detail

      • getMboInstance

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

        public void copyInvReserveSet(MboSetRemote invReserveSet)
                               throws MXException,
                                      java.rmi.RemoteException
        Loops thru the passed InvReserveSet and add new MatUseTrans based on each InvReserve selected.
        Specified by:
        copyInvReserveSet in interface MatUseTransSetRemote
        Parameters:
        invReserveSet - the MboSetRemote of InvReserveSetRemote instance. Only process the selected rows.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.inventory.MatUSeTransSet#copyInvReserveSet()
      • copySparePartSet

        public void copySparePartSet(MboSetRemote sparePartSet)
                              throws MXException,
                                     java.rmi.RemoteException
        Loops thru the passed SparePartSet and adds new MatUseTrans based on each SparePart selected.
        Specified by:
        copySparePartSet in interface MatUseTransSetRemote
        Parameters:
        SparePartSet - the MboSetRemote of SparePartSetRemote instance. Only selected rows are processed.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.inventory.MatUseTransSet#copySparePartSet()
      • addMatUseFromInvReserve

        public MboRemote addMatUseFromInvReserve(MboRemote invRes)
                                          throws MXException,
                                                 java.rmi.RemoteException
        Private method to add and copy necessary information from InvReserve to MatUseTrans.
        Specified by:
        addMatUseFromInvReserve in interface MatUseTransSetRemote
        Parameters:
        invRes - The InvReserve mbo.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.inventory.MatUSeTransSet#addMatUseFromInvReserve()
      • setDateRange

        public void setDateRange(int type)
                          throws MXException,
                                 java.rmi.RemoteException
        Sets the userpref date range setting.
        Specified by:
        setDateRange in interface MatUseTransSetRemote
        Parameters:
        type - The type of date range for userpref setting 0 - NO_SELECTION 1 - CURRENT_DATE 2 - LAST_NDAYS 3 - YEAR_TO_DATE 4 - RANGE
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.inventory.MatUSeTransSet#setDateRange(int type)
      • getDateRange

        public int getDateRange()
                         throws MXException,
                                java.rmi.RemoteException
        Gets the type of date range setting, set by the user.
        Specified by:
        getDateRange in interface MatUseTransSetRemote
        Returns:
        The userpref setting for date range(NO_SELECTION, CURRENT_DATE, LAST_NDAYS,YEAR_TO_DATE, RANGE).
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.inventory.MatUSeTransSet#getDateRange()
      • setLastNDays

        public void setLastNDays(int nDays)
                          throws MXException,
                                 java.rmi.RemoteException
        Sets the userpref last N days setting.
        Specified by:
        setLastNDays in interface MatUseTransSetRemote
        Parameters:
        int - last number of days
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.inventory.MatUSeTransSet#setLastNDays(int nDays)
      • getLastNDays

        public int getLastNDays()
                         throws MXException,
                                java.rmi.RemoteException
        Gets the last number of days, set by the user.
        Specified by:
        getLastNDays in interface MatUseTransSetRemote
        Returns:
        The userpref setting for last number of days.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.inventory.MatUSeTransSet#getLastNDays()
      • getUserPrefWhere

        public java.lang.String getUserPrefWhere()
        Overrides the MboSet getUserPrefWhere() to return a userpref "WHERE" clause which is appended to the existing "WHERE" clause. This is called by the framework to allow any app specific modifications to the whereClause.
         
        Overrides:
        getUserPrefWhere in class MboSet
        Parameters:
        none -
        Returns:
        The "WHERE" clause String.
      • addDates

        public java.util.Date addDates(java.util.Date date,
                                       int days)
        Adds or subtracts days from the given date.
         
        Parameters:
        date - a Date object
        days - the positive or negative days to add to the date
        Returns:
        An adjusted Date object
        Throws:
        none
      • canAdd

        public void canAdd()
                    throws MXException
        Determines if material transactions can be created. This set must be owned by an Inventory, MatRecTrans, Work Order, InvReserve, MatUseTrans, or Locations Mbo. If owned by a work order, the work order must be open and approved.
        Overrides:
        canAdd in class MboSet
        Throws:
        MXApplicationException - Thrown with "inventory","matUseTransNoAdd" if not owned by any Mbo or a Mbo of type not listed above.
        Thrown with "workorder","ActualsAppr", param(wonum) if the work order owner is not approved.
        Thrown with "workorder", "WOHistory", param (wonum) if the work order is in history.
        MXException
      • remove

        public void remove(MboRemote mbo)
                    throws MXException,
                           java.rmi.RemoteException
        remove the child mbo need remove it from the childlookup. Also informs the listeners of the removal.
        Specified by:
        remove in interface MboSetRemote
        Overrides:
        remove in class MboSet
        Throws:
        MXException
        java.rmi.RemoteException
      • preValidateIpcBom

        public void preValidateIpcBom(IpcBomSetRemote bomset)
                               throws MXException,
                                      java.rmi.RemoteException
        Hook for IPC to prevalidate bills of materials for this particular application
        Specified by:
        preValidateIpcBom in interface MatUseTransSetRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.inventory.MatUSeTransSet#preValidateIpcBom
      • addDeltaCurbal

        public void addDeltaCurbal(MboRemote invBal,
                                   double quantity,
                                   MboRemote currentMatUse)
                            throws MXException,
                                   java.rmi.RemoteException
        A method to accumulate curbal for the matusetrans objects added to this set. Once all the MatUseTrans objects have been saved these accumulated quantity will be used to update the curbal of invbalances .
        Parameters:
        invBal - -- The invbalances to update
        quantity - -- a quntity
        currentMatUse - -- the MatUseTrans object being saved in the set
        Throws:
        MXException
        java.rmi.RemoteException
      • addDeltaIssueYTD

        public void addDeltaIssueYTD(MboRemote inventory,
                                     double quantity,
                                     MboRemote currentMatUse)
                              throws MXException,
                                     java.rmi.RemoteException
        A method to accumulate issue quantity for the matusetrans objects added to this set. Once all the MatUseTrans objects have been saved these accumulated issue year to date will be used to update the inventory record
        Parameters:
        inventory - -- The inventory to update
        quantity - -- a quntity
        currentMatUse - -- the current MatUseTrans object in the set being saved
        Throws:
        MXException
        java.rmi.RemoteException
      • transCommitted

        public void transCommitted()
                            throws MXException
        A method to update the accumulated issue quantity and issue year to date for the MatUseTrans objects to the database. Since we are unable to listen for a postCommitEventAction on the set this method will be called for each MatUseTrans Mbo that the postCommitEventAction is called on. Once the last Mbo has been saved this method will update the invbalances.curbal, inventory.issueytd and inventory.lastissuedate. In addition, it will repopulate the curbal values in the saved MatUseTrans records if it sees that the invbalances records refetched were updated by other users.
        Throws:
        MXException
      • getInvReserveVector

        public java.util.Vector getInvReserveVector()
                                             throws MXException,
                                                    java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • getUncommittedTransVector

        public java.util.Vector getUncommittedTransVector()
                                                   throws MXException,
                                                          java.rmi.RemoteException
        10-20360
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • setUncommittedTransVector

        public void setUncommittedTransVector(java.util.Vector uncommitted)
                                       throws MXException,
                                              java.rmi.RemoteException
        10-20360
        Throws:
        MXException
        java.rmi.RemoteException
      • clearVectors

        public void clearVectors()
                          throws MXException
        12-14015/IV25282: after MatUseTransListener.postCommitAction, clear all cthe vecotrs holding inventory retlated to inventory current balances - so if user does issues mutile times without leaving the Issues and Transfers application, inventory balance is updated incorrectly.
        Throws:
        MXException
      • storeToRotatingAssetHash

        public void storeToRotatingAssetHash(MboRemote matUse)
                                      throws MXException,
                                             java.rmi.RemoteException
        IV56875:applied 71 IV04697/11-15298:
        Parameters:
        matrec -
        Throws:
        MXException
        java.rmi.RemoteException
      • getLifoFifoInHash

        public java.util.Hashtable getLifoFifoInHash()
                                              throws MXException,
                                                     java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException