psdi.app.inventory

Class MatUseTrans

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


    public class MatUseTrans
    extends Mbo
    implements MatUseTransRemote
    Mbo object to represent MatUseTrans.

    See Inventory Package description.

    The key attribute(s) in this object are as follows: Matusetransid

    The attributes in this object are as follows:

    Attribute NameDescription
    ActualCostThe actual cost of the item to be considered for determining the trasaction value. For issues/returns, this is same as unitcost. Value may be different than unitcost if coming from MATRECTRANS.actualcost.
    ActualDateDate & Time when transaction actually occurred. Modifiable.
    BinnumThe bin from/to which the issue/return is being made.
    ConversionConversion from Order Unit to Issue Unit.Has value only from MATRECTRANS, otherwise always 1.
    CurBalThe current balance in the storeroom-bin-lot before the transaction is carried out.
    CurrencyCodeThe currency code for the transaction. Will always be BASECURRENCY1 for all issues/returns. Can only have a different value if coming from MATRECTRANS.currencycode.
    CurrencyLineCostThe line cost in the transaction currency. Only has value if coming from MATRECTRANS.currencylinecost.
    CurrencyUnitCostThe unit cost of the line in the transaction currency. This only has value if coming from MATRECTRANS.currencyunitcost.
    DescriptionDescription of the trasaction. Copied from Item initially.
    EnterByThe person entering the transaction.
    AssetNumThe Asset to which the item is being issued. This asset may be used for a work order at a location.
    ExchangeRateExchange Rate applicable for the transaction. Always be 1 for all issues/returns. Can only have a different value if coming from MATRECTRANS.exchangerate.
    ExchangeRate2Exchange Rate 2 applicable from transaction currency to BASECURRENCY2 if value is defined in MAXVARS.
    FinancialPeriodFinancial period during which the transaction took place.
    FinCtrlIdFinancial control ID.
    GlCreditAcctThe storeroom account to be credited for the transaction.
    GlDebitAcctThe GL Debit account for the transaction.
    IssueIdThe ID of the Material Issue record this return is referring to. Only has value when transaction is a RETURN against an issue.
    IssueToLabor Code of the person to whom the item is being issued/returned.
    IssueTypeTransaction type. Value must be a translated one against ValueList "ISSUETYP". Acceptable values are "ISSUE" and "RETURN".
    ItemNumInventory Item Number. Foreign key to Item.
    LdKeyKey to Longdescription for column Description.
    LineCostThe total line cost of the line computed as ACTUALCOST * QUANTITY.
    LineCost2Line cost of the transaction in BASECURRENCY2.
    LocationThe Location to which the item is being issued.
    LotNumThe lot from/to which the issue/return is being made.
    MatRecTransIdIdentify the MATRECTRANSID of this MATUSETRANS created by MATRECTRANS. This has value when a receipt(MATRECTRANS) is done for direct issue.
    MatUseTransIdUnique and primary key for this transaction.
    MemoMemo.
    MRLineNumMR Line Number that originated the need for the material.
    MRNumThe MR that originated the need for material.
    OrgIdIdentifier of the organization for this MatUseTrans. Foreign key to Organizations.
    OutSideYes/No flag to identify is the item being issued is external(holding) inventory.
    PackingSlipNumPacking Slip Number. Has value only if value comes from MATRECTRANS.packingslipnum.
    PhyscntThe physical balance in the storeroom-bin-lot before the transaction is carried out.
    PoLineNumThe Po Line Number against which the MATUSETRANS is created. Has value only if this MATUSETRANS is inserted by MATRECTRANS and the MATRECTRANS.issue=Y.
    PoNumThe Po Number against which the MATUSETRANS is created. Has value only if this MATUSETRANS is inserted by MATRECTRANS and the MATRECTRANS.issue=Y.
    QtyRequestedThe original quantity requested by the user.
    QtyReturnedQty returned for this issue-type ISSUE. Should be null for RETURN type.
    QuantityQuantity In-Out - # Of Items issued or returned. If this is an issue, quantity should be negative. If this is a return, quantity is positive.
    RequestNumA non-persistent column. Foreign key to INVRESERVE if the issue is done for a reservation.
    RollUpYes/No flag to indicates whether cost roll-up has taken place.
    RotAssetNumRotating Asset to be issued. Has value only when ITEM.rotating = "Y". The Asset must be currently in the storeroom location from where it is being issued.
    SiteIdIdentifier of the site for this MatUseTrans. Foreign key to Site.
    SparePartAddedYes/No flag to indicate if the transaction resulted in a SPAREPART update; i.e. if a sparepart record has been created as a result of this transaction.
    StoreLocThe storeroom location where the item is being issued/returned. Foreign key to Locations of type "STOREROOM","LABOR", or "COURIER". Login user should have proper priviledge before he/she can perform the transaction. USERNAME/LOCATION defined in LocAuth.
    TransDateDate & time transaction was entered. System date & time. Not modifiable.
    UnitCostThe cost of the item before the transaction; this is the inventory's default issue cost.
    WoNumThe work order to/from which the item is being issued/returned.
    TaskIDThe taskid in the work order to which the item is being issued.
    IT1 - IT9Extra Fields IT1 - IT9.
    ITIN1 - ITIN7Extra Fields ITIN1 - ITIN7.
    See Also:
    MatRecTrans, WO, Inventory
    • Constructor Detail

      • MatUseTrans

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

      • init

        public void init()
                  throws MXException
        Initialize the MatUseTrans object.
         
        Overrides:
        init in class Mbo
        Parameters:
        none -
        Throws:
        none
        MXException
      • add

        public void add()
                 throws MXException,
                        java.rmi.RemoteException
        Standard package method overridden here. Does the following:
        1) - set default values for required fields
        2) - depending upon owner of this matusetrans set, will also grab and set some non-required fields
        3) - If owner is equal to matrectrans, grabs and sets almost all values from the matrectrans.
        Specified by:
        add in interface MboRemote
        Overrides:
        add in class Mbo
        Throws:
        none
        MXException
        java.rmi.RemoteException
      • getTotalQtyForReturn

        public double getTotalQtyForReturn()
                                    throws MXException,
                                           java.rmi.RemoteException
        This method calculates the eligible quantity left for return for this issue. The quantity is calculated as: The total issue qty of this issue minus the sum of return quantity of the previous returns done for this issue.
        Throws:
        MXException
        java.rmi.RemoteException
      • setQtyForReturn

        public void setQtyForReturn(double qty)
                             throws MXException,
                                    java.rmi.RemoteException
        This method set the remainQty to appropriate one. After we default the maximal return qty for the user, User can still change the qty. But user can only change the qty less than or equal to the qty remaining.
        Specified by:
        setQtyForReturn in interface MatUseTransRemote
        Parameters:
        qty - passed to update the remainQty. It can be a negative number. But the result can not be less than zero.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.inventory.MatUseTrans.setQtyForReturn(double qty)
      • getIssueForThisReturn

        public MatUseTransRemote getIssueForThisReturn()
                                                throws MXException,
                                                       java.rmi.RemoteException
        The issue for this return; many returns may be done for this issue.
        Throws:
        MXException
        java.rmi.RemoteException
      • getTotalQty

        public double getTotalQty()
                           throws MXException,
                                  java.rmi.RemoteException
        The total quantity remaining for returns. This is the one-time fetch from the db. Each return being performed should not at exceed this amount.
        Throws:
        MXException
        java.rmi.RemoteException
      • canDelete

        public void canDelete()
                       throws MXException,
                              java.rmi.RemoteException
        Can delete only if object has not been added to the db!
        Overrides:
        canDelete in class Mbo
        Parameters:
        none -
        Throws:
        MXApplicationException -
        GROUPKEYREASON
        inventorymatusetransCannotDeleteif this MatUseTrans cannot be deleted
        MXException
        java.rmi.RemoteException
      • appValidate

        public void appValidate()
                         throws MXException,
                                java.rmi.RemoteException
        Application validation routine called before the MatUsetrans object is saved.
        Method validates the following:
        1) - A "BILLTO" field has been populated (wonum,assetnum,location,gldebitacct,mrnum)
        2) - If Item.isRotating(), rotassetnum and location are populated
        3) - Quantity is valid and has the right sign given issuetype
        4) - InvBalance and Inventory records exist for this matusetrans.
        5) - Based on a maxvar value check if the GL debit and credit accounts are required for this transaction.
        Overrides:
        appValidate in class Mbo
        Throws:
        MXApplicationException -
        GROUPKEYREASON
        inventorymatusetransNullChargeTo if all these fields are null: wonum, assetnum, location, gldebitacct, mrnum
        inventorymatusetransNullRotassetnum if itemnum is null, and this item is rotating and rotassetnum is null
        inventorymatusetransEmtpyRotLocation if itemnum is null, and this item is rotating and location is null
        inventorymatusetransZeroQuantity if quantity is 0 and issuetype is not INVOICE
        inventorymatusetransPosQuantity if issuetype is not null, and if isIssue() is true and quantity > 0
        inventorymatusetransNegQuantity if issuetype is not null, and if isReturn() is true and quantity < 0
        inventoryinvbalNotInInventory if invbalances and inventory records exist for the combination entered but inventory does not exists
        inventorymatusetransNoBalances if invbalances and inventory records exist for the combination entered but matusetrans inventory does not exists
        financialGLRequiredForTrans The debit and credit GL accounts require a value.
        MXException
        java.rmi.RemoteException
      • getWO

        public MboRemote getWO()
                        throws MXException,
                               java.rmi.RemoteException
        Gets the workorder related to this MatUseTrans. If this Mbo is owned by a workorder, the owning workorder mbo is returned. If this Mbo is not owned by a WO, attempts to get the related WO using getSharedMboSet. If no WO is found, null is returned.
        Specified by:
        getWO in interface MatUseTransRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.inventory.MatUseTrans.getWO()
      • save

        public void save()
                  throws MXException,
                         java.rmi.RemoteException
        Saves the MatUseTrans object and all its linked objects.
        Might alter corresponding Asset, Workorder or InvReserve records depending upon Integration setting, may also update invbalances.curbal, inventory.avgcost, inventory.issueytd
        Overrides:
        save in class Mbo
        Parameters:
        none -
        Throws:
        none
        MXException
        java.rmi.RemoteException
      • createInvoiceOnConsumption

        public void createInvoiceOnConsumption()
                                        throws MXException,
                                               java.rmi.RemoteException
        This method will call the invoice service method to generate invoice on Issue and Return consumption for consinment items.
        Throws:
        MXException
        java.rmi.RemoteException
      • getSharedAssetSet

        public MboSetRemote getSharedAssetSet()
                                       throws MXException,
                                              java.rmi.RemoteException
        10-16236: new method needed to avoid "updated by another user" message when adding same rotating item via select materials on WO actuals that has already been reserved via WO planned material.
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • getSharedInvBalance

        public MboRemote getSharedInvBalance()
                                      throws MXException,
                                             java.rmi.RemoteException
        private method created to gather the appropriate invbalance record by utilizing the logic built into the inventory object for retrieving the right invbalance record from memory. If the shared Inventory mbo is retrieved, using inventory methods will result in getting that inventory.mbos invbalance children. Because multiple matusetrans mbos may be interested in updating the same inventory or invbalance mbo, it is essential to carefully track down the right (shared) invbalance mbo before updating. This method accomplishes that.
        Specified by:
        getSharedInvBalance in interface MatUseTransRemote
        Throws:
        MXApplicationException - SHOULD NOT BE RETURNING NULL - WILL Throw exceptions
        GROUPKEYREASON
        inventorynoBalanceRecordIf owner is inventory and if balance is null
        inventorynoBalanceRecordif owner is not inventory getSharedInventory, then if balance is null
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.inventory.MatUseTrans.getSharedInvBalance()
      • setIgnoreLocationAssetMismatch

        public void setIgnoreLocationAssetMismatch(boolean value)
        Sets IgnoreLocationAssetMismatch boolean value.
        This mutator method allows caller to set the boolean value for private member value named ignoreLocationAssetMismatch. The member value is used primarily by the issueAsset method, and is defaulted by the object as true. If caller wishes to adjust the setting for this member, this method must be called.
        Specified by:
        setIgnoreLocationAssetMismatch in interface MatUseTransRemote
        Parameters:
        boolean -
        Throws:
        none
        See Also:
        psdi.app.inventory.MatUseTrans.setIgnoreLocationAssetMismatch(boolean)
      • setIgnoreLocationOccupied

        public void setIgnoreLocationOccupied(boolean value)
        Sets ignoreLocOccupied boolean value.
        This method allows the caller to set the boolean value for private member value named ignoreLocOccupied. The member value is used primarily by the issueAsset method, and is defaulted by the object as true. If caller wishes to adjust the setting for this member, this method must be called.* A setting of false will result in a check of the location where asset is being moved. If location is occupied, Maximo will warn/alert caller.
        Specified by:
        setIgnoreLocationOccupied in interface MatUseTransRemote
        Parameters:
        boolean -
        Throws:
        none
        See Also:
        psdi.app.inventory.MatUseTrans.setIgnoreLocationOccupied(boolean))
      • setUpdateWorkOrdersOnMoveAsset

        public void setUpdateWorkOrdersOnMoveAsset(boolean value)
        Sets updateWO boolean value.
        This method allows the caller to set the boolean value for private member value named updateWO. The member value is used primarily by the issueAsset method, and is defaulted by the object as true. If caller wishes to adjust the setting for this member, this method must be called. A setting of false will result in issueAsset failing to update WorkOrder information.
        Specified by:
        setUpdateWorkOrdersOnMoveAsset in interface MatUseTransRemote
        Parameters:
        boolean -
        Throws:
        none
        See Also:
        psdi.app.inventory.MatUseTrans.setUpdateWorkOrdersOnMoveAsset(boolean)
      • getSharedInvReserveSet

        public MboSetRemote getSharedInvReserveSet()
                                            throws MXException,
                                                   java.rmi.RemoteException
        73215:added this method to get invreserve set for the issue
        Throws:
        MXException
        java.rmi.RemoteException
      • returnIssue

        public MboRemote returnIssue()
                              throws MXException,
                                     java.rmi.RemoteException
        This method makes returns on this issue, within certain constraints.
        Returns can only be allowed when the issue has not been fully returned.
        The new returns are created in the current MboSet.
        Specified by:
        returnIssue in interface MatUseTransRemote
        Parameters:
        none -
        Returns:
        MboRemote
        Throws:
        MXApplicationException -
        GROUP KEY REASON
        inventoryreturnOnlyIssues if return is not on issues
        inventoryinvbalNotInInventory if MboRemote rtn is null
        inventorymxcollabINVISSR check MXCOLLAB api privileges for RETURN; if true - do not allow return of matusetrans or inventory
        inventorycannotReturnIssue if current location of the asset is not the location it was moved to
        inventorycannotreturnanymore if previous returns completely used for this issue,cannot allow any more returns
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.inventory.MatUseTrans.returnIssue()
      • returnIssue

        public MboRemote returnIssue(MboSetRemote newMatUseSet)
                              throws MXException,
                                     java.rmi.RemoteException
        This method makes returns on this issue, within certain constraints.
        Returns can only be allowed when the issue has not been fully returned.
        The new returns are created in the passed MboSet
        Specified by:
        returnIssue in interface MatUseTransRemote
        Parameters:
        none -
        Returns:
        MboRemote
        Throws:
        MXApplicationException -
        GROUP KEY REASON
        inventoryreturnOnlyIssues if return is not on issues
        inventoryinvbalNotInInventory if MboRemote rtn is null
        inventorymxcollabINVISSR check MXCOLLAB api privileges for RETURN; if true - do not allow return of matusetrans or inventory
        inventorycannotReturnIssue if current location of the asset is not the location it was moved to
        inventorycannotreturnanymore if previous returns completely used for this issue,cannot allow any more returns
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.inventory.MatUseTrans.returnIssue(MboSetRemote newMatUseSet)
      • isReturn

        public boolean isReturn()
                         throws MXException,
                                java.rmi.RemoteException
        Returns true if issuetype = the internal string for RETURN, otherwise returns false.
        Specified by:
        isReturn in interface MatUseTransRemote
        Parameters:
        none -
        Returns:
        boolean
        Throws:
        none
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.inventory.MatUseTrans.isReturn(boolean)
      • isIssue

        public boolean isIssue()
                        throws MXException,
                               java.rmi.RemoteException
        Returns true if issuetype = the internal string for ISSUE, otherwise returns false.
        Specified by:
        isIssue in interface MatUseTransRemote
        Parameters:
        none -
        Returns:
        boolean
        Throws:
        none
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.inventory.MatUseTrans.isIssue(boolean)
      • isKitMake

        protected boolean isKitMake()
                             throws MXException,
                                    java.rmi.RemoteException
        returns true if the MAXVALUE of the issuetype is 'KITMAKE'
        Throws:
        MXException
        java.rmi.RemoteException
      • isKitBreak

        protected boolean isKitBreak()
                              throws MXException,
                                     java.rmi.RemoteException
        returns true if the MAXVALUE of the issuetype is 'KITBREAK'.
        Throws:
        MXException
        java.rmi.RemoteException
      • getValidateOrder

        public java.lang.String[] getValidateOrder()
        Returns an array with the names of field validation classes in the order they should be used when they are called by the architecture with the DelayedValidation flag.

        This orderis established to ensure that certain values are not overwritten during the setValue process... The order will prevent one field with Delayed Validation from overwriting a second field with Delayed Validation. The order returned will prevent certain action() based setValues from occurring thereby preserving the values a caller like ERP may have set from being overwritten.

        This method will probably only be called by the architechture when building the order.
        Overrides:
        getValidateOrder in class Mbo
        Parameters:
        none -
        Returns:
        String[] - String array containing field validations to call in the order to be called
        Throws:
        none
      • delete

        public void delete(long accessModifier)
                    throws MXException,
                           java.rmi.RemoteException
        Adjust the line cost from WO.actMatCost.
        Specified by:
        delete in interface MboRemote
        Overrides:
        delete in class Mbo
        Parameters:
        accessModifier -
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Mbo.delete(long)
      • isUncommitted

        public boolean isUncommitted()
        Does this LabTrans have values not committed to the database?
        Returns:
        uncommitted
      • setUncommitted

        public void setUncommitted(boolean uncommitted)
        Set the uncommitted flag
        Parameters:
        uncommitted - What to set the flag to.
      • setSharedInvBalancesUpdatedFlag

        public void setSharedInvBalancesUpdatedFlag(boolean updated)
        Set the sharedInvBalancesHasBeenUpdated flag.
        Parameters:
        updated - true, if already updated.
      • setInvReserveUpdatedFlag

        public void setInvReserveUpdatedFlag(boolean updated)
        Set the sharedInvBalancesHasBeenUpdated flag.
        Parameters:
        updated - true, if already updated.
      • setCheckNegBalanceFlag

        public void setCheckNegBalanceFlag(boolean flag)
                                    throws MXException,
                                           java.rmi.RemoteException
        Set the private boolean CheckNegBalance to true
        Throws:
        MXException
        java.rmi.RemoteException
      • createMatUseTransRecordforLifoFifo

        public void createMatUseTransRecordforLifoFifo(MboRemote inv)
                                                throws MXException,
                                                       java.rmi.RemoteException
        This method creates the matusetrans based on invlifofifocost records. It sets the unitcost and quantity based on invlifofifocost record.
        Specified by:
        createMatUseTransRecordforLifoFifo in interface MatUseTransRemote
        Parameters:
        inv -
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.inventory.MatUseTrans.createMatUseTransRecordforLifoFifo(MboRemote)
      • setWorkOrderUpdatedFlag

        public void setWorkOrderUpdatedFlag(boolean updated)
        10-16438
        Parameters:
        updated - true, if already updated.
      • getInvReserveInVector

        public InvReserveRemote getInvReserveInVector(java.util.Vector v,
                                                      MboRemote thisInvReserve)
                                               throws MXException,
                                                      java.rmi.RemoteException
        10-16236: does my InvReserve just gotten from getSharedInvReserveSet find a match in the Vector? if found, return the InvReserve mbo in the vector, if not returns null
        Parameters:
        v -
        thisInvReserve -
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • isInvoice

        public boolean isInvoice()
                          throws MXException,
                                 java.rmi.RemoteException
        Returns true if issuetype = the internal string for INVOICE, otherwise returns false.
        Returns:
        boolean
        Throws:
        MXException
        java.rmi.RemoteException
      • isComingFromIShelper

        protected boolean isComingFromIShelper()
        Check if there is some Industry Solution logic to override a specific validation. in AppValidate method
        Returns:
        boolean
      • isVoidReceipt

        public boolean isVoidReceipt()
                              throws MXException,
                                     java.rmi.RemoteException
        Returns true if issuetype is the internal string for VOIDRECEIPT, otherwise returns false.
        Returns:
        boolean
        Throws:
        MXException
        java.rmi.RemoteException
      • storeTheLifoFifoUpdated

        public void storeTheLifoFifoUpdated(java.util.Hashtable lifofifoHash,
                                            java.lang.String invlifofifoID,
                                            MboRemote invlifofifocost)
                                     throws MXException,
                                            java.rmi.RemoteException
        IV77164: small method to store the newly updated invlifofifocost record in the hashtable
        Parameters:
        lifofifoHash -
        invlifofifoID -
        invlifofifocost -
        Throws:
        MXException
        java.rmi.RemoteException
      • isReceipt

        public boolean isReceipt()
                          throws MXException,
                                 java.rmi.RemoteException
        Returns true if issuetype is the internal string for RECEIPT, otherwise returns false.
        Returns:
        boolean
        Throws:
        MXException
        java.rmi.RemoteException
      • getPossibleInvLifofo

        public MboRemote getPossibleInvLifofo()
                                       throws MXException,
                                              java.rmi.RemoteException
        IJ00514: if the initial invlifofifocost records were created not thru receipt, the refoboject on the invlifofifocost records are not MATRECTRANS. It could be INVTRANS or blank. If this kind of invlifofifocost records were issued, then maximo does not have a way to retrieve the original cost date when the records were created.
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException