psdi.app.po

Class PO

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


    public class PO
    extends PurchasingMbo
    implements PORemote
    MBO to represent a Purchase Order in a Maximo System
    A Purchase Order is an authorized order from a purchasing agent or department to an external vendor. MAXIMO also lets you grant the same kind of purchasing authority to the person responsible for a storeroom, to generate an internal PO against another storeroom. A storeroom-to-storeroom purchase can be viewed as a "transfer order" or an "internal PO." A purchase order is closed when all of its line items (materials or services), as well as the invoice with cost information, have been received.
    A purchase order can list items or services for a single vendor only. The items and services to be purchased are specified on the Purchase Order Lines . The PO Header contains details like total cost, total tax that the Purchase Order has incurred. The purchase order is verified by a superior authority who decides whether it can be approved or not.
    In addition, Purchasing module makes it possible to receive both materials and services.
  • Material receipts might include costs associated with items used for work done on site by company's employees. To record material receipts, use the PO Material Receipts screen. When inventory items are received against a purchase order, MAXIMO updates quantities and costs in Inventory, and an inventory transaction is generated.
    The user can also receive materials not tracked in inventory, but which requires a purchase order. For example, the user may order a catered lunch or a new desk, neither or which would be stored in Inventory or tracked by an item number. The user, however, wants to track their costs on purchase orders and receipts.
  • Service receipts might include costs associated with any service provided by a vendor or contractor, such as repairs to asset. The service may be performed on or off site. The user specifies service purchases either in terms of a quantity and a unit cost, or as a single lump sum amount. Whichever terms the user uses on the service PO must be the same on the corresponding receipt transaction, which the user records on the PO Service Receipts screen.
    The key attributes for this object are SiteId and PONum.

    See Purchase Order Package description.
    The attributes in this object are as follows:


    Attribute Name Description
    BillTo Identifier of the company that will receive the bill.
    BillToAttn Person to whom the bill should be sent.
    BuyAhead Indicates if the buyahead rate is directly entered by the user and not calculated from the active exchange rate.
    BuyerCompany Links the buyers' address information to the order.
    ChangeBy, ChangeDate The name of the person who last modified the form and the date on which the form was last modified.
    Contact Vendors' contact name.
    CurrencyCode Currencycode of the PO.
    CustomerNum Vendors' number identifying our company.
    Description Description of the Purchase Order.
    ECommStatusDateDate of the most recent e-commerce transaction
    EndDate Date when is PO is no longer valid. Used in the case of a Blanket PO End date.
    ExchangeDate Date on which the exchange rate was obtained.
    ExchangeRate Exchange rate at the time of approval.
    ExchangeRate2 Exchangerate in basecurrency2.
    FOB Freight on Board. The point where responsibility and liability are transferred.
    FollowUpDateDate the vendor should be contacted about the Purchase Order.
    FreightTermsThe terms under which the shipment is made. For example, the field may contain "Perishable goods. Deliver ASAP"
    HistoryFlag Flag indicating history Purchase Orders.
    Inclusive1 Flag indicating if the PO Total is inclusive of Tax1.
    Inclusive2 Flag indicating if the PO Total is inclusive of Tax2
    Inclusive3 Flag indicating if the PO Total is inclusive of Tax3
    Inclusive4 Flag indicating if the PO Total is inclusive of Tax4
    Inclusive5 Flag indicating if the PO Total is inclusive of Tax5
    Internal Flag to indicate if the PO is internal. Is the item's vendor the storeroom?
    MNetSent Indicates if the PO has been sent electronically.
    OrderDate Date the Purchase Order was Issued.
    OrgId Identifier of the organization for this Purchase Order.
    OriginalPONum The original purchase Order from which this Purchase Order was created.
    PaymentTerms Specified terms of payment for this vendor. For example we can say "TEN " which means the invoice will be paid with 10 days.
    PayOnReceipt Indicates if there is a payment on receipt agreement with the vendor.
    PONum Purchase Order Number. This is the key field. Each PONum must be unique as it the companies' internal tracking number.
    POType Indicates whether this PO is a Standard or ChangeOrder or Blanket or Release PO also known as the type of PO.
    Priority Indicates the priority with which this Purchase Order should be handled.
    PurchaseAgent The name of the Purchase Agent.
    Receipts Have the line items on this PO been received. If all the lines have been received,this field has "COMPLETE". If none of the line items have been received, it has "NONE". If the line items were partially received it has "PARTIAL"
    RequiredDate The earliest date by which the items on this purchase order must be delivered.
    ShipTo Identifier of the company to whom this PO will be shipped. Primary key of the Companies table.
    ShipToAttn Person to whom the items should be shipped.
    ShipVia Specifies how the goods should be shipped (FedEx,UPS etc)
    SiteIdIdentifier of the site for the Purchase Order.
    StartDate Beginning of the Validity period of an agreementPO. Used in a Blanket PO start date.
    StatusThe status of the Purchase Order. Can be one of approved, inprg, waiting for approval, cancelled, closed
    StatusDate The date on which the status of this PO was changed.
    TotalCost The Total Cost of this Purchase Order.
    TotalTax1 Total amount of Tax1 owed. This is included in the Total Cost if Inclusive1 is Yes.
    TotalTax2 Total amount of Tax2 owed. This is included in the Total Cost if Inclusive2 is Yes.
    TotalTax3 Total amount of Tax3 owed. This is included in the Total Cost if Inclusive3 is Yes.
    TotalTax4 Total amount of Tax4 owed. This is included in the Total Cost if Inclusive4 is Yes.
    TotalTax5 Total amount of Tax5 owed. This is included in the Total Cost if Inclusive5 is Yes.
    VenDeliveryDate The earliest date by which the vendor is supposed to deliver the items on the lines.
    Vendor Identifier of the Vendor to whom the PO would be sent to.
    PO1 thru PO10 Extra fields.
    ExternalRefId, OwnerSysId, SenderSysId, SourceSysId Columns used by MAXIMO E-Commerce Adapter (MEA).

    Last Update: Friday, March 22, 2002 - Ganesh - javadocs

    • Field Detail

      • dontShowCloseMessage

        public boolean dontShowCloseMessage
    • Constructor Detail

      • PO

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

      • getProcess

        public java.lang.String getProcess()
                                    throws MXException,
                                           java.rmi.RemoteException
        Return the work flow process for POs.
        Throws:
        MXException
        java.rmi.RemoteException
      • getCancelFlag

        public boolean getCancelFlag()
                              throws MXException,
                                     java.rmi.RemoteException
        Return APIFlag. If the flag is true, API wants the PO references on the PRlines to be deleted
        Specified by:
        getCancelFlag in interface PORemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        PO.getCancelFlag()
      • resetCancelFlag

        public void resetCancelFlag()
        Reset APIFlag to be true. If the flag is true, API wants the PO references on the PRlines to be deleted
        Specified by:
        resetCancelFlag in interface PORemote
        See Also:
        PO.resetCancelFlag()
      • init

        public void init()
                  throws MXException
        Initialize the Purchase Order. Sets certain fields on the PO to be always read-only.
        Overrides:
        init in class Mbo
        Throws:
        MXException
      • initFieldFlagsOnMbo

        public void initFieldFlagsOnMbo(java.lang.String attrName)
                                 throws MXException
        Description copied from class: Mbo
        The logic of setting the readonly and required field flags to the mbo. Any setting of the field flags that require expensive operation, such as database query should be moved from init() to this method. However, those which don't require steps such as fetching Mbos can be left in init(). You can group the logic for a few attributes together if logic of deciding their flag is the same, or in other words, can be handled at once.
        Overrides:
        initFieldFlagsOnMbo in class Mbo
        Throws:
        MXException
      • add

        public void add()
                 throws MXException,
                        java.rmi.RemoteException
        Add a new Purchase Order Required fields of the PO object are initialised in this method.Some date fields are initialised to current date. The following fields are initialised with their respective values
        Attribute Name Attribute Value
        billto Site's billtoaddresscode
        billtoattn Site's billtolaborcode
        buyahead No
        changeby Current username
        changedate Current Date
        currencycode Base Currency
        historyflag No
        inclusive1..5 No
        internal No
        orderdate Current Date
        payonreceipt No
        potype Standard
        potypemode STD
        priority 0(zero)
        receipts NONE
        shipto Site's shiptoaddresscode
        shiptoattn Site's shiptolaborcode
        status Waiting for Approval
        statusdate Current Date
        totalcost 0(zero)
        totaltax1..5 0(zero)
        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)
      • isApproved

        public boolean isApproved()
                           throws MXException,
                                  java.rmi.RemoteException
        This method will determine if the PO is approved. Returns true if PO status is APPR or INPRG.
        Specified by:
        isApproved in interface PORemote
        Returns:
        true if approved or inprg, false otherwise.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        PO.isApproved()
      • isInternal

        public boolean isInternal()
                           throws MXException,
                                  java.rmi.RemoteException
        This method will determine if the PO is internal or external based on the database "internal" column.
        Specified by:
        isInternal in interface PORemote
        Returns:
        true if internal, false if external.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        PO.isInternal()
      • createReceipt

        public MboRemote createReceipt(MboSetRemote existingReceiptSet,
                                       long polinenum,
                                       java.lang.String ownersysid)
                                throws MXException,
                                       java.rmi.RemoteException
        Returns a MatRecTrans mbo to the caller POService.createReceipt() The method is created for API,Wireless, and GUI It assumes that updates to other objects such as PO, POLINE, INVENTORY, INVBALANCES, INVVENDOR, WORKORDER,ASSET are performed in MatRecTrans.save()
        Specified by:
        createReceipt in interface PORemote
        Parameters:
        1: - existingReceiptSet: if existingReceiptSet is not null we want to add a new receipt (MatRecTrans or ServRecTrans) mbo to the existing set. Otherwise, create a new set
        Returns:
        A newly created MatRecTrans Mbo.
        Throws:
        MXApplicationException(inventory, - mxcollabRC) is thrown when the integration rules specify that the receipt cannot be created.
        MXApplicationException(po, - InvalidPOLineNum) is thrown when the polinenum that was passed into this method as a parameter is an invalid polinenum.
        MXException
        java.rmi.RemoteException
        See Also:
        PO.createReceipt(psdi.mbo.MboSetRemote, long, java.lang.String)
      • createReturn

        public MboRemote createReturn(MboSetRemote existingReceiptSet,
                                      long polinenum,
                                      java.lang.String ownersysid)
                               throws MXException,
                                      java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • determineReceiptStatus

        public void determineReceiptStatus()
                                    throws java.rmi.RemoteException,
                                           MXException
        Determines the PO's Receipt Status. Updates po.receipts to NONE, PARTIAL, or COMPLETE.
        Specified by:
        determineReceiptStatus in interface PORemote
        Parameters:
        poLine - The POLine the receipt is being created for. The information of this POLine might not be saved yet.
        Throws:
        java.rmi.RemoteException
        MXException
        See Also:
        PO.determineReceiptStatus()
      • validatePO

        public void validatePO()
                        throws java.rmi.RemoteException,
                               MXException
        Validate the Purchase Order to see if the PO has a vendor and also check if it has a valid MRNum.. This method is used at the time of approval to check if the PO is ready for approval.
        Throws:
        MXApplicationException(po, - novendor) is thrown when the PO does not have a vendor.
        java.rmi.RemoteException
        MXException
      • setTotalCost

        public void setTotalCost()
                          throws java.rmi.RemoteException,
                                 MXException
        Set the Total Cost and Total Taxes. This method updates the TotalCost and TotalTax attributes whenever the value of the PO changes as a result of changes in POLines.
        Throws:
        java.rmi.RemoteException
        MXException
      • canCreateChangeOrder

        public void canCreateChangeOrder()
                                  throws java.rmi.RemoteException,
                                         MXException
        Can a Change Order be created? This method checks to see if a change order can be created for this PO.A change order cannot be created for a blanket, price or release type POs.Also, the PO must be in the approved state when a change order is created. A ChangeOrder cannot be created from a PO with any other status.
        Specified by:
        canCreateChangeOrder in interface PORemote
        Throws:
        MXApplicationException(po,changeordertype) - thrown when the PO is the wrong type.
        MXApplicationException(po,changeorderstatus) - thrown when the PO is the wrong status.
        java.rmi.RemoteException
        MXException
        See Also:
        PO.canCreateChangeOrder()
      • hasReceipts

        public void hasReceipts()
                         throws MXException,
                                java.rmi.RemoteException
        If receipts exist for this po, throw an exception.
        Throws:
        MXApplicationException(po, - hasreceiptsitems) thrown when material receipts exist for the PO.
        MXApplicationException(po, - hasreceiptsservices) thrown when service receipts exist for the PO.
        MXException
        java.rmi.RemoteException
      • prorateServices

        public void prorateServices()
                             throws java.rmi.RemoteException,
                                    MXException
        Allocate the service lines among the POLines. This is called only by PO approval processes. Allocate those service lines if their prorateservice flag is true to all the material lines or those material lines whose those direct issue lines if maxvar "PRSPECIALDIRECT" is set to true. The cost of these service lines will be proportionaly added to the loaded costs of all the qualified material lines of this PO. The proportion will be based on the linecost of these material lines. After allocating service, the loadedcost of those service lines have been prorated will be set to 0, and the proratecost will be set to the negative value of the linecost. The proratecost of the material lines will be the total cost allocated from the service lines.
        Specified by:
        prorateServices in interface PORemote
        Throws:
        java.rmi.RemoteException
        MXException
        See Also:
        PO.prorateServices()
      • getAvailableFunds

        public double getAvailableFunds()
                                 throws MXException,
                                        java.rmi.RemoteException
        For the current Blanket PO, return the amount that is yet to be used. In other words, this method returns the amount that can be spent on a Blanket PO.
        Specified by:
        getAvailableFunds in interface PORemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        PO.getAvailableFunds()
      • createPOLineFromPR

        public MboRemote createPOLineFromPR(MboRemote fromPR,
                                            MboRemote fromPRLine,
                                            MboSetRemote poLines)
                                     throws MXException,
                                            java.rmi.RemoteException
        Create a PO Line from information on the given PR/PRLine. Also gets all the PRLines that belong to the PR that was passed in. It loops through the PRLines and checks if all of them have been assigned to POs(checks to see if the PRLINE.PONUM is not null). If all the lines were indeed assigned to different or same POs, it is time to close this PR. Hence the PR is closed.(The PRSTATUS is marked "COMP").
        Parameters:
        fromPR - = The PR being copied.
        fromPRLine - = The PRLine being copied.
        poLines - = The set of POLines for this PO.
        Returns:
        = The newly created POLine mbo.
        Throws:
        MXException
        java.rmi.RemoteException
      • setEditibilityFlags

        protected void setEditibilityFlags(boolean flag)
                                    throws MXException,
                                           java.rmi.RemoteException
        sets the flags for fields in PO. Called by POStatusHandler.updateMboForStatus when the PO is editable.
        Throws:
        MXException
        java.rmi.RemoteException
      • copySelectedLinesToRelease

        public void copySelectedLinesToRelease(PORemote toPOMbo)
                                        throws MXException,
                                               java.rmi.RemoteException
        This method copies all selected lines of the blanket PO, using line defaults, to the Release PO. Called by createRelease(MboSetRemote, boolean).
        Parameters:
        PO - remote object(release po)
        Throws:
        MXException
        java.rmi.RemoteException
      • copyBlanketLinesToRelease

        public void copyBlanketLinesToRelease(PORemote toPOMbo)
                                       throws MXException,
                                              java.rmi.RemoteException
        This method copies all the lines of the blanket PO to the Release PO called by createRelease.
        Parameters:
        PO - remote object(release po)
        Throws:
        MXException
        java.rmi.RemoteException
      • clearChargeValues

        protected void clearChargeValues()
                                  throws MXException,
                                         java.rmi.RemoteException
        This method clears this POs POLine's attributes assetnum, location, storeloc and wonum; sets issue to true; and sets these attributes to readonly.
        Throws:
        MXException
        java.rmi.RemoteException
      • deleteDistributions

        public void deleteDistributions()
                                 throws MXException,
                                        java.rmi.RemoteException
        Removes any distribtions that the POLine has and adds a new distribution that has a hunderd percent and has the linecost and the loadedcost of the asoociated POLine.
        Throws:
        MXException
        java.rmi.RemoteException
      • isPOBuyAhead

        public boolean isPOBuyAhead()
                             throws MXException,
                                    java.rmi.RemoteException
        This flag will affect the exchangerate2 calculation at po receipt time. If it is a buy ahead, use po.exchangerate2 as the receipt exchangerate2. If it is not a buy ahead, exchangerate2 is recalculated at receipt time.
        Specified by:
        isPOBuyAhead in interface PORemote
        Returns:
        return a boolean if po is a buy ahead or not.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        PO.isPOBuyAhead()
      • appValidate

        public void appValidate()
                         throws MXException,
                                java.rmi.RemoteException
        This method is called before save for last minute validations. Validations:
        • If po's type is invalid throw wxception.
        Overrides:
        appValidate in class Mbo
        Throws:
        MXApplicationException(po, - potypeisrequired) is thrown when potype is null.
        MXApplicationException(po, - fromsiterequired) is thrown when it's internal po and fromsite or storeloc is null.
        MXException
        java.rmi.RemoteException
      • isPOStatusAPPR

        public boolean isPOStatusAPPR()
                               throws MXException,
                                      java.rmi.RemoteException
        Checks if the status of the PO is 'APPR'.
        Specified by:
        isPOStatusAPPR in interface PORemote
        Parameters:
        none -
        Returns:
        boelean - TRUE if the PO's status is 'APPR' , false otherwise.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        PO.isPOStatusAPPR()
      • isPOStatusINPRG

        public boolean isPOStatusINPRG()
                                throws MXException,
                                       java.rmi.RemoteException
        Checks if the status of the PO is 'INPRG'.
        Specified by:
        isPOStatusINPRG in interface PORemote
        Returns:
        boelean - TRUE if the PO's status is 'APPR' , false otherwise.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        PO.isPOStatusINPRG()
      • getPORecord

        public java.util.Vector getPORecord()
                                     throws MXException,
                                            java.rmi.RemoteException
        Gets historical data from PO.
        Returns:
        Vector Consists of PO.changedate, PO.description, PO.receipts or PO.mnetsent (whichever is not null) or "" (if PO.receipts and PO.mnetsent are null), PO.changeby, "PO", PO.ponum, PO.vendor.
        Throws:
        MXException
        java.rmi.RemoteException
      • duplicate

        public MboRemote duplicate()
                            throws MXException,
                                   java.rmi.RemoteException
        Duplicates an entire PO,its lines and also the related DOCLINKS.
        1. Creates a duplicate Purchase Order.
        2. The add method of PO sets the status of the duplicated Purchase order to WAPPR.
        3. Autokeys the PONum if the autokey feature is turned on. If the autokey feature is turned off, the user must input the key value. The save() method checks for the key and throws an exception if the key is not entered.
        4. Called by createChangeOrder to duplicate the PO and the lines
        Specified by:
        duplicate in interface MboRemote
        Overrides:
        duplicate in class Mbo
        Returns:
        MboRemote-the newly duplicated PO
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Mbo.isAutoKeyed(java.lang.String)
      • skipCopyField

        protected boolean skipCopyField(MboValueInfo mvi)
                                 throws java.rmi.RemoteException,
                                        MXException
        This method overrides the skipCopyField() in the Mbo.Since this method takes the MboValueInfo as its parameter just check to see if this field needs to be copied or skipped by using the data from the static HashTable. If this field does not need to be copied return true. The same method is over-rided also in POLine so that certain POLine fields can be skipped without being copied. The following are PO fields will be skipped without being copied to the newly duplicated PO
        1. changeby
        2. changedate
        3. ecomstatusdate
        4. enddate
        5. exchangedate
        6. exchangerate
        7. externalrefid
        8. followupdate
        9. historyflag
        10. mnetsent
        11. orderdate
        12. orgid
        13. originalponum
        14. ownersysid
        15. receipts
        16. requireddate
        17. sendersysid
        18. siteid
        19. sourcesysid
        20. startdate
        21. status
        22. statusdate
        23. vendeliverydate
        Overrides:
        skipCopyField in class Mbo
        Parameters:
        - - The MboValueInfo object of the MboValue that needs to be copied.
        Returns:
        - True,if the field does not need to be copied.In all other cases return false.
        Throws:
        java.rmi.RemoteException
        MXException
        See Also:
        POLine.skipCopyField(psdi.mbo.MboValueInfo), PO.loadSkipFieldCopyHashSet()
      • createChangeOrder

        public MboRemote createChangeOrder(java.lang.String ponum,
                                           java.lang.String description)
                                    throws MXException,
                                           java.rmi.RemoteException
        This method creates change orders(creates a PO from an existing PO and copies over the lines from the corresponding POLines) Change order POs can be created only from approved or in progress POs(as long as no line items have been received) The status of the original PO from which this change order has been created will be changed to cancelled. The status of the change order is set to waiting for approval and the type is set to CHG.The original ponum field on the change order is set to the ponum against which this change order was created.
        Specified by:
        createChangeOrder in interface PORemote
        Returns:
        - The newly created Change Order
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        PO.createChangeOrder(java.lang.String, java.lang.String)
      • save

        public void save()
                  throws MXException,
                         java.rmi.RemoteException
        Saves the PO and also looks for POLines that have been marked for deletion.If any POLines have been marked for deletion it gets the corresponding PR or RFQ from which this line came. and changes the status of this PR from CLOSE to APPR and changes the RFQ status from CLOSE to INPRG. It also removes the PONum,polinenum,polineid from the corresponding PRLine
        Overrides:
        save in class StatefulMbo
        Throws:
        MXException
        java.rmi.RemoteException
      • initRelationship

        public void initRelationship(java.lang.String relationName,
                                     MboSetRemote mboSet)
                              throws MXException,
                                     java.rmi.RemoteException
        Called whenever a relationship is initailized or reset from this Mbo to another MboSet. At the time when poline is obtained from PO, move the POLineSet ahead of PO in the mxtransaction list. Fix for MIG (PLSQL) bug 004474
        Overrides:
        initRelationship in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • setRelatedMboEditibility

        public void setRelatedMboEditibility(java.lang.String relationName,
                                             MboSetRemote mboSet)
                                      throws MXException,
                                             java.rmi.RemoteException
        Sets the read/only flag for the related set if the set exists.
        Parameters:
        relationName - The relationship name of the related MboSet which need to set the read/only flag.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        #settings, PO.setEditibilityFlags(boolean)
      • poSentToVendor

        public void poSentToVendor()
                            throws MXException,
                                   java.rmi.RemoteException
        This method should be called by the UI before cancelling a PO. This is just to display an informative message to the user that the PO was successfully cancelled. The caller of this method(UI or anybody else) must catch MXApplication Exception. If this method throws an exception the caller must catch it and in the catch block of the try-catch, the PO's change status method should be called. After the change status is completed this exception must be shown to the user in the form of a dialog box.This is the only way in Java to show an informative message. If this method does not throw any exception the UI must still cancel the PO but there will be no message displayed.
        Throws:
        MXApplicationException(po,RequestWillBeSent) - will be thrown if the mnetsent field is neither null nor "ERROR"
        MXException
        java.rmi.RemoteException
      • modify

        public void modify()
                    throws MXException,
                           java.rmi.RemoteException
        Called whenever a change is made to the attributes of a MBO. The programmer should override if interested in intercepting this event. An example of the use of this is to set the changeby/changedate of a Purchase order whenever one of the attributes is set. If an MXException is thrown from this routine, the change of value is rolled back, this provides a mechanism to abort any changes. Default behavior is to do nothing. This method has overrided the Mbo.modify() method.
        Overrides:
        modify in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • copySpareParts

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

        public void canDuplicate()
                          throws MXException,
                                 java.rmi.RemoteException
        Checks if the PO can be duplicated. The PO cannot be duplicated under the following consitions.
        • Release POs cannot be duplicated.
        Throws:
        MXException
        java.rmi.RemoteException
      • getReceiptVector

        public java.util.Vector getReceiptVector()
                                          throws MXException,
                                                 java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • getInvoiceLineVector

        public java.util.Vector getInvoiceLineVector()
                                              throws MXException,
                                                     java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • changeStatus

        public void changeStatus(java.lang.String status,
                                 java.util.Date date,
                                 java.lang.String memo,
                                 long accessModifier)
                          throws MXException,
                                 java.rmi.RemoteException
        This method is overridden to add a wrapper to exceptions thrown during change status and to write warnings whether or not the status change is successful
        Specified by:
        changeStatus in interface StatefulMboRemote
        Overrides:
        changeStatus in class StatefulMbo
        Parameters:
        status - The new desired status. This is the translated status (that is, the status code as it would have been entered by a user, or valuelist.value), not the internal status value (valuelist.maxvalue).
        date - The effective date of the new status (java.util.Date). If null the current date/time is used.
        memo - A string briefly describing the circumstances of the change. The memo can be null.
        accessModifier - A value of NOACCESSCHECK will cause the method not to call canChangeStatus. Callers using this flag are responsible for ensuring that they are attempting a valid status change.
        Throws:
        MXException - Thrown if there is a problem.
        java.rmi.RemoteException
        See Also:
        StatefulMbo.canChangeStatus(String)
      • createContractFromPO

        public void createContractFromPO(java.lang.String contractNum,
                                         java.lang.String description,
                                         java.lang.String contractType)
                                  throws MXException,
                                         java.rmi.RemoteException
        An interface for UI to create one contract from a PO. It will take a contract number, description and contract type as parameters.
        Specified by:
        createContractFromPO in interface PORemote
        Parameters:
        contractNum - the contract number to be created that can be specified by the user
        description - the contract description
        contractType - the contract type to be created that can be specified by the user
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        ContractFromPOSet.execute()
      • checkingBeforeCreateContract

        public void checkingBeforeCreateContract()
                                          throws MXException,
                                                 java.rmi.RemoteException
        Cannot create contract if it's an internal PO.
        Specified by:
        checkingBeforeCreateContract in interface PORemote
        Throws:
        MXApplicationException - (po, internalpo) is thrown if it's an internal PO.
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.jsp.app.po.Actions#createcont
      • checkWAPPRStatus

        public void checkWAPPRStatus()
                              throws MXException,
                                     java.rmi.RemoteException
        Checks if the PO status is WAPPR. If the status is not WAPPR, display error message.
        Specified by:
        checkWAPPRStatus in interface PORemote
        Throws:
        MXApplicationException - (po, onlyWapprPOs) is thrown if PO status is not WAPPR.
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.jsp.app.po.Actions#viewagreements
      • updateReleasePO

        public void updateReleasePO(MboRemote contractRemote)
                             throws MXException,
                                    java.rmi.RemoteException
        Update fields for Release type of PO.
        Parameters:
        contractRemote - The Contract object
        Throws:
        MXException
        java.rmi.RemoteException
      • createInvoicesForSchedule

        public void createInvoicesForSchedule()
                                       throws MXException,
                                              java.rmi.RemoteException
        Create invoices for payment schedules. Invoices will be created if the polines for this PO has a contractnum and a scheduleid on it. This method will be called during PO approval.
        Specified by:
        createInvoicesForSchedule in interface PORemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        PO.createInvoicesForSchedule()
      • canDelete

        public void canDelete()
                       throws MXException,
                              java.rmi.RemoteException
        Throw exception when trying to delete a PO.
        Overrides:
        canDelete in class Mbo
        Throws:
        MXApplicationException(po, - cannotdeletepo) is thrown when trying to delete a PO.
        MXException
        java.rmi.RemoteException
      • getSharedWorkorder

        public MboRemote getSharedWorkorder(MboRemote mboRemote,
                                            java.lang.String wonum)
                                     throws MXException,
                                            java.rmi.RemoteException
        Retrieves the workorder referenced by the matrectrans or servrectrans objects for this PO.
        Specified by:
        getSharedWorkorder in interface PORemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.po.PO#getSharedWorkorder()
      • setFromOnePO

        public void setFromOnePO(boolean flag)
                          throws MXException,
                                 java.rmi.RemoteException
        Set isFromPO flag to be true, if it's coming from one individual PO.
        Throws:
        MXException
        java.rmi.RemoteException
      • getFromOnePO

        public boolean getFromOnePO()
                             throws MXException,
                                    java.rmi.RemoteException
        Return true if it's coming from one individual PO.
        Throws:
        MXException
        java.rmi.RemoteException
      • generateWO

        public void generateWO()
                        throws MXException,
                               java.rmi.RemoteException
        Generate required work orders if po is direct issue item line
        Throws:
        MXException
        java.rmi.RemoteException
      • getValidateOrder

        public java.lang.String[] getValidateOrder()
        Validation Order for PO attributes.
        Overrides:
        getValidateOrder in class Mbo
      • canRevisePO

        public void canRevisePO()
                         throws MXException,
                                java.rmi.RemoteException
        Checks if a new revision can be created from the current PO.
        1. A revision cannot be created from a PO that has already been revised. In other words the current PO cannot be in the REVISED status.
        2. The current PO must be in the approved or in progress status before a revision can be created.
        Specified by:
        canRevisePO in interface PORemote
        Throws:
        MXApplicationException("po", - "alreadyRevised") - thrown if the current PO is in the REVISED status.
        MXApplicationException("po", - "shouldBeAppr") - thrown if the current PO is not in the APPROVED status.
        MXApplicationException("po", - "revisionAlreadyCreated") - thrown if Revision has already been created from this PO.
        MXException
        java.rmi.RemoteException
        See Also:
        PO.canRevisePO()
      • revisePO

        public MboRemote revisePO(java.lang.String revDescription,
                                  boolean allowReceipt)
                           throws MXException,
                                  java.rmi.RemoteException
        Creates a new revision of the current PO.
        1. The new PO has the same PO number as the old PO.
        2. The new PO has a new revision number.
        3. When status of the new PO would be set to PENDING REVISION. The status of the old revision will remain APPROVED.
        4. When the new revision is approved the status of the old revision will be set to REVISED.
        Specified by:
        revisePO in interface PORemote
        Returns:
        Returns the newly created PO revision reference.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        PO.canRevisePO()
      • updatePndRevPO

        public void updatePndRevPO()
                            throws MXException,
                                   java.rmi.RemoteException
        Update Pending Revision PO's received information.
        Throws:
        MXException
        java.rmi.RemoteException
      • checkPOLineQtyCost

        public void checkPOLineQtyCost(MboRemote pndrevPOLine)
                                throws MXException,
                                       java.rmi.RemoteException
        Deprecated. 
        Parameters:
        pndrevPOLine -
        Throws:
        MXException
        java.rmi.RemoteException
      • checkPOLineQtyCost

        public void checkPOLineQtyCost(MboRemote apprPOLine,
                                       MboRemote pndrevPOLine)
                                throws MXException,
                                       java.rmi.RemoteException
        Check POLine ordered quantity. If ordered quantity is less than the total received quantity, throw exception. For null ordered quantity, check line cost. If line cost is less than the total received cost, throw exception. Otherwise, update PO.Receipts and POLine.ReceiptsComplete flags if necessary.
        Parameters:
        pndrevPOLine -
        Throws:
        MXApplicationException - (po, qtycannotlessthanreceived) is thrown if ordered quantity is less than the total received quantity
        MXApplicationException - (po, costcannotlessthanreceived) is thrown if line cost is less than the total received cost
        MXException
        java.rmi.RemoteException
      • useLineOrLoadedCost

        public java.lang.String useLineOrLoadedCost()
                                             throws MXException,
                                                    java.rmi.RemoteException
        11-16657/IV09276: added maxvars RECEIPLINEORLOADED to determine if receipt should use linecost or loadedcost to update POLine.receivedtotalcost.
        Returns:
        VarValue
        Throws:
        MXException
        java.rmi.RemoteException
      • getMboSet

        public MboSetRemote getMboSet(java.lang.String name)
                               throws MXException,
                                      java.rmi.RemoteException
        IV73901: during change status, the POLINE set on the scrren may be filtered. This does not happen in the Change Status dialog because it is handled in the POChangeStatusSet/ChangeStatusSet which gets a new PO in db (see POChangeStatusSet.getMboIntoSet() method). However, in the case of work flow, it uses the main PO and the POLine on the screen. This caused po being removed from PR for those lines that are filtered out.
        Specified by:
        getMboSet in interface MboRemote
        Overrides:
        getMboSet in class Mbo
        Parameters:
        name - The relationship provided to retrieve a related mboSet, usually using foreign keys. For example, "psdi.app.workorder.WOSetRemote.ASSET" is a relationship for the work order object to access the asset Set where "workorder.assetnum=asset.assetnum". The relationship can also be chained. Such as ASSET.ASSETSTATUS.
        Returns:
        The returned related set specified through the relationship.
        Throws:
        MXException - "A relationship called {0} does not exist for the {1} business object" exception will be thrown if the relationship was not found. "Unknown Object" exception will be thrown if the database object can not be found through the relationship.
        java.rmi.RemoteException
        See Also:
        Mbo.getMboSet(String)
      • setDontCheckCompleteFlag

        public void setDontCheckCompleteFlag(boolean flag)
                                      throws MXException,
                                             java.rmi.RemoteException
        Set dontCheckCompleteFlag flag from Invoice
        Throws:
        MXException
        java.rmi.RemoteException
      • getDontCheckCompleteFlag

        public boolean getDontCheckCompleteFlag()
                                         throws MXException,
                                                java.rmi.RemoteException
        Return dontCheckCompleteFlag to see if it's OK to close PO form invoice
        Throws:
        MXException
        java.rmi.RemoteException