psdi.app.contract.purch

Class PurchView

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


    public class PurchView
    extends Contract
    implements PurchViewRemote
    MBO object to represent the view containing the Contract and the Purchase Contract tables. The key attributes for this object are ContractNum, RevisionNum and OrgId.

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


    Attribute Name Description
    AcceptanceLoss Liable for acceptance loss?
    AcceptPeriod Acceptance period in days.
    AddLinesOnUse Can additional lines be added to purchase document with contract reference.
    AdjustAmt Non-persistent field to indicate the amount that the unitcost must be incremented or decremented.
    AmtRemaining Difference between the maximum volume and the commited cost for a volume specified contract.
    AutoExtendPeriod Auto extend period in days.
    BuyAhead Is this a buy ahead rate, ie entered directly by the user and not calculated from the list of active exchange rates.
    CustomerNum Vendors' number identifying our company.
    CanExceedVolume Can the specified maximum volume be exceeded?
    ChangeBy, ChangeDate The name of the person who last modified the form and the date on which the form was last modified.
    ChgPriceOnUseCan price be changed on the line with contract reference.
    ChgQtyOnUseCan quantity be changed on line with contract reference.
    CondForExtConditions for extension.
    Contact Vendors' contact name.
    ContractId Unique identifier for every Contract in the database. Every Contract has a unique ContractID.*
    ContractNum Contract Number. This is one of the key fields. Each ContractNum need not be unique. Every new revision of the same contract will carry the same contract number.
    ContractPurchId Unique identifier of the ContractPurch table.
    ContractType Indicates whether the type of the contract is Labor or Lease or Maintenance or Purchase or Rental or Software License or Warranty.
    CreateRel Flag indicating if a Release PO can be created from the contract.
    CurrencyCode Currencycode of the Contract.
    CustNotifyPeriod Customer notification period in days.
    CustomerNum Vendors' number identifying our company.
    CustomerTermAllowed Flag to indicate if early termination is allowed by the customer.
    DeliveryLoss Flag to indicate if there is a liability for delivery loss.
    Description Description of the Purchase Contract.
    Description_LongDescription Long description of the Purchase Contract.
    EndDate Date when is Contract is no longer valid.
    EnforceBundle Bundle enforced?
    ExchangeDate Date on which the exchange rate was obtained.
    ExchangeRate Exchange rate at the time of contract approval.
    ExchangeRate2 Exchangerate in basecurrency2.
    Extendable Is the contract extendable?
    FOB Freight on Board. The point where responsibility and liability are transferred.
    FreightTermsThe terms under which the shipment is made. For example, the field may contain "Perishable goods. Deliver ASAP"
    HasInsuranceDoes this vendor have a current insurance policy ?
    HistoryFlag Flag indicating history Purchase Contracts.
    Inclusive1 Flag indicating if the Contract Total is inclusive of Tax1.
    Inclusive2 Flag indicating if the Contract Total is inclusive of Tax2
    Inclusive3 Flag indicating if the Contract Total is inclusive of Tax3
    Inclusive4 Flag indicating if the Contract Total is inclusive of Tax4
    Inclusive5 Flag indicating if the Contract Total is inclusive of Tax5
    InsuranceExpDate Expiration date of the vendors insurance policy.
    MasterNum Master Contract Number.
    MaxRelVol Maximum Release Volume.
    MaxVol Maximum Volume.
    OrgId Identifier of the organization for this Purchase Order.
    PaymentSched Is there a payment schedule for this contract?
    PaymentTerms Specified terms of payment for this vendor. For example we can say "TEN " which means the invoice will be paid with 10 days.
    PORequired Will a PO be required for this contract?
    PurchaseAgent The name of the Purchase Agent.
    RenewalDate Date that the contract can be renewed.
    RevComments Revision Comments.
    RevisionNum Revision number of the contract.
    ShippingLoss Liable for shipping loss?
    ShipVia Specifies how the goods should be shipped (FedEx,UPS etc)
    StartDate Beginning of the Validity period of a contract.
    StatusThe status of the Contract. Can be one of approved, draft, waiting for approval, canceled, closed, waiting to start, expired.
    StatusDate The date on which the status of this contract was changed.
    TotalBaseCost The total cost of the contract in Base Currency 1.
    TotalCost The Total Cost of the Contract.
    VendNotifyPeriod Vendor notice of termination in days.
    Vendor Identifier of the vendor code.
    VendorRefNum Vendor reference number.
    VendorTermAllowed Is early termination allowed by vendor?
    OwnerSysId, SenderSysId Columns used by MAXIMO E-Commerce Adapter (MEA).

    Last Update: Monday, April 08, 2004 - Ganesh - javadocs

    • Constructor Detail

      • PurchView

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

      • getStatusHistory

        protected MboSetRemote getStatusHistory()
                                         throws MXException,
                                                java.rmi.RemoteException
        Return the CONTRACTSTATUS object. Required for statefullness.
        Overrides:
        getStatusHistory in class Contract
        Returns:
        The set of CONTRACTSTATUS records
        Throws:
        MXException
        java.rmi.RemoteException
      • init

        public void init()
                  throws MXException
        Description copied from class: Contract
        Initialize the Contract object. Set certain fields to always read-only. Set certain fields
        Overrides:
        init in class Contract
        Throws:
        MXException
      • add

        public void add()
                 throws MXException,
                        java.rmi.RemoteException
        Add method on the Purchase Contract View. All default values for fields are specified in the database.
        Specified by:
        add in interface MboRemote
        Overrides:
        add in class Contract
        Throws:
        MXException
        java.rmi.RemoteException
      • copyPRLineToContract

        public MboRemote copyPRLineToContract(MboRemote sourcePRLine,
                                              MboSetRemote contractLineSetRemote)
                                       throws MXException,
                                              java.rmi.RemoteException
        Copies all relevant information from PRLine to ContractLine. Also copied the PRCost to ContractCost.
        Parameters:
        sourcePRLine - - The PRLine reference from which the details are copied over to the ContractLine.
        Returns:
        contractLineRemote - The newly created Contract Line.
        Throws:
        MXException
        java.rmi.RemoteException
      • duplicate

        public MboRemote duplicate()
                            throws MXException,
                                   java.rmi.RemoteException
        Duplicates a Contract,its lines and cost lines
        1. Creates a duplicate Purchase Order.
        2. The add method of Contract sets the status of the duplicated Purchase order to WAPPR.
        3. Autokeys the ContractNum 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.
        Specified by:
        duplicate in interface MboRemote
        Overrides:
        duplicate in class Mbo
        Returns:
        MboRemote-the newly duplicated Contract
        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 ContractLine so that certain ContractLine fields can be skipped without being copied. The following are Contract fields will be skipped without being copied to the newly duplicated Contract
        1. changeby
        2. contractid
        3. contractpurchid
        4. changedate
        5. enddate
        6. exchangedate
        7. exchangerate
        8. externalrefid
        9. historyflag
        10. contractnum
        11. orgid
        12. ownersysid
        13. sendersysid
        14. startdate
        15. status
        16. statusdate
        17. revisionnum
        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:
        MXException
        java.rmi.RemoteException
        See Also:
        ContractLine.skipCopyField(psdi.mbo.MboValueInfo), ContractLine.loadSkipFieldCopyHashSet()
      • createRelease

        public MboRemote createRelease(MboSetRemote contractLineSetRemote)
                                throws MXException,
                                       java.rmi.RemoteException
        Creates a Release Purchase Order that has all the header and line info from the purchase contract. This method is called on an existing purchase contract that is approved. The user selects the contractLines that need to go to the Release PO and also selects the charge values for the PO Lines that are to be created. If the charge values are not specified, an error is raised.
        Specified by:
        createRelease in interface PurchViewRemote
        Returns:
        PO remote object.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        PurchView.createRelease(psdi.mbo.MboSetRemote)
      • createReleaseHeaderAndLines

        public MboRemote createReleaseHeaderAndLines(MboSetRemote contractLineSetRemote)
                                              throws MXException,
                                                     java.rmi.RemoteException
        Creates the release PO Header and its lines.
        Parameters:
        contractLineSetRemote -
        Returns:
        Newly created release.
        Throws:
        MXException
        java.rmi.RemoteException
      • createReleaseHeaderAndLines

        public MboRemote createReleaseHeaderAndLines(MboSetRemote contractLineSetRemote,
                                                     java.lang.String siteID)
                                              throws MXException,
                                                     java.rmi.RemoteException
        Creates the release PO Header and its lines.
        Parameters:
        contractLineSetRemote -
        siteID -
        Returns:
        Newly created release.
        Throws:
        MXException
        java.rmi.RemoteException
      • copySelectedLinesToRelease

        public void copySelectedLinesToRelease(MboRemote releasePOHeader,
                                               java.util.Vector selectedMbos)
                                        throws MXException,
                                               java.rmi.RemoteException
        This method copies all selected lines of the purchase contract to the Release PO.
        Throws:
        MXException
        java.rmi.RemoteException
      • canCreateRelease

        public void canCreateRelease()
                              throws MXException,
                                     java.rmi.RemoteException
        Checks if the following conditions are true.
        • The create release flag must be checked.
        • The Contract must be approved before a release can be created.
        • The current date must fall between the start and end dates
          Specified by:
          canCreateRelease in interface PurchViewRemote
          Throws:
          MXApplicationException("contract", - "createRelFalse") - thrown when the createrelease flag is not checked.
          MXApplicationException("contract","ContractNotApproved") - - thrown when the contract is not approved.
          java.rmi.RemoteException
          MXException
          See Also:
          canCreateRelease
        • canCreateRFQ

          public void canCreateRFQ()
                            throws MXException,
                                   java.rmi.RemoteException
          Checks if the list of authorized sites is not empty.
          Specified by:
          canCreateRFQ in interface PurchViewRemote
          Throws:
          MXApplicationException("contract", - "noAuthorizedSites") - thrown when the the list of authorized sites is empty.
          java.rmi.RemoteException
          MXException
          See Also:
          canCreateRFQ
        • createPOHeader

          public MboRemote createPOHeader()
                                   throws MXException,
                                          java.rmi.RemoteException
          Creates the Release PO Header. Copies the field values from the Contract Header to the corresponding fields in the Release PO Header.
          Returns:
          - The newly created Release PO Header.
          Throws:
          MXException
          java.rmi.RemoteException
        • createPOHeader

          public MboRemote createPOHeader(java.lang.String siteID)
                                   throws MXException,
                                          java.rmi.RemoteException
          Creates the Release PO Header. Copies the field values from the Contract Header to the corresponding fields in the Release PO Header.
          Parameters:
          siteid -
          Returns:
          - The newly created Release PO Header.
          Throws:
          MXException
          java.rmi.RemoteException
        • copyPurchContractValuesToPOHeader

          public void copyPurchContractValuesToPOHeader(MboRemote poHeaderRemote)
                                                 throws MXException,
                                                        java.rmi.RemoteException
          Deprecated. 
          Copy the fields in the Purchase Contract to the corresponding fields of the passed in PO Release Header reference. Set the current contract reference on the newly created Release Contract Header.
          Parameters:
          poHeaderRemote -
          Throws:
          MXException
          java.rmi.RemoteException
        • copyPurchContractValuesToPOHeader

          public void copyPurchContractValuesToPOHeader(MboRemote poHeaderRemote,
                                                        java.lang.String siteID)
                                                 throws MXException,
                                                        java.rmi.RemoteException
          Copy the fields in the Purchase Contract to the corresponding fields of the passed in PO Release Header reference. Set the current contract reference on the newly created Release Contract Header.
          Parameters:
          poHeaderRemote -
          siteID -
          Throws:
          MXException
          java.rmi.RemoteException
        • createRFQ

          public MboRemote createRFQ(MboSetRemote contractLineSetRemote)
                              throws MXException,
                                     java.rmi.RemoteException
          Creates an RFQ from a Contract. The user selects the contractLines that need to go to the RFQ and also selects the charge values for the RFQLines that are to be created. If the charge values are not specified, an error is raised.
          Specified by:
          createRFQ in interface PurchViewRemote
          Returns:
          rfqRemote - The newly created RFQ.
          Throws:
          MXApplicationException("contract", - "noRFQNum") will be thrown if there is no RFQ Number specified for the RFQ that is to be created.
          MXException
          java.rmi.RemoteException
          See Also:
          PurchView.createRFQ(psdi.mbo.MboSetRemote)
        • modify

          public void modify()
                      throws MXException,
                             java.rmi.RemoteException
          Internal method that marks the record as modified. Called whenever a field is modified so we can update the changedate/changeby.
          Overrides:
          modify in class Contract
          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 initialized or reset from this Mbo to another MboSet. Set the editibility of the Mbos related to the contract. The initRelationship() only when the relationship name that is specified inside this method is used to obtain the target MboSet.
          Overrides:
          initRelationship in class Contract
          Parameters:
          relationName - the relationship name
          mboSet - the mboset
          Throws:
          MXException
          java.rmi.RemoteException
        • setEditibilityFlags

          protected void setEditibilityFlags(boolean flag)
                                      throws MXException,
                                             java.rmi.RemoteException
          sets the editibility flags for fields in Contract.
          Throws:
          MXException
          java.rmi.RemoteException
        • getAmountOnOrder

          public double getAmountOnOrder()
                                  throws MXException,
                                         java.rmi.RemoteException
          Calculates the amount on order for the current contract. Calculated as a sum of all REL Type POLines in an approved status sum (POLINE.LOADEDCOST) where receipts complete = N - (sum of all POLINE.RECEIVEDCOST) where receipts complete = 'N'
          Specified by:
          getAmountOnOrder in interface PurchViewRemote
          Returns:
          amountOnOrder - The Amount currently on order against the contract.
          Throws:
          MXException
          java.rmi.RemoteException
          See Also:
          PurchView.getAmountOnOrder()
        • getInvoiceVariance

          public double getInvoiceVariance()
                                    throws MXException,
                                           java.rmi.RemoteException
          Gets the total invoice variance for all invoices which were created for this contract. Obtainted by summing matrectrans and servrectrans records of type 'INVOICE' for all receipt lines from release POs not in a status of ('CANCEL') for this contract.
          Specified by:
          getInvoiceVariance in interface PurchViewRemote
          Returns:
          Throws:
          MXException
          java.rmi.RemoteException
          See Also:
          PurchView.getInvoiceVariance()
        • getAmountReceived

          public double getAmountReceived()
                                   throws MXException,
                                          java.rmi.RemoteException
          Calculates the total amount received against the Purchase Contract. The sum of POLINE.RECEIVEDTOTALCOST for all Release Type POs that were created from this contract. All release type POs that have been canceled will not be included in the calculation.
          Specified by:
          getAmountReceived in interface PurchViewRemote
          Returns:
          Throws:
          MXException
          java.rmi.RemoteException
          See Also:
          PurchView.getAmountReceived()
        • canViewRelCost

          public void canViewRelCost()
                              throws MXException,
                                     java.rmi.RemoteException
          Determines if the user can go to the 'View Release Costs' page. The user cannot go to this page if the status of the contract is Waiting for Approval or Draft.
          Specified by:
          canViewRelCost in interface PurchViewRemote
          Throws:
          MXException
          java.rmi.RemoteException
          See Also:
          PurchView.canViewRelCost()
        • deleteSWLic

          public void deleteSWLic()
                           throws MXException,
                                  java.rmi.RemoteException
          Delete a software contract header.
          Throws:
          MXException
          java.rmi.RemoteException
        • save

          public void save()
                    throws MXException,
                           java.rmi.RemoteException
          Description copied from class: StatefulMbo
          Overrides the save of Mbo so that a row is added to the status history table when a new object is saved.
          Overrides:
          save in class StatefulMbo
          Throws:
          MXException
          java.rmi.RemoteException
          See Also:
          removeContractReferencesFromPR
        • removeContractReferencesFromPR

          public void removeContractReferencesFromPR()
                                              throws MXException,
                                                     java.rmi.RemoteException
          Removes contract references from PRLines, if the contract lines were copied from a PR If the PR is closed, it reopens the PR (sets the PR status to APPR) after removing contract references from PRLines.
          Throws:
          MXException
          java.rmi.RemoteException
        • removeContractReferencesFromRFQ

          public void removeContractReferencesFromRFQ()
                                               throws MXException,
                                                      java.rmi.RemoteException
          Removes contract references from RFQLines, if the contract lines were copied from a RFQ If the RFQ is closed, it reopens the RFQ (sets the RFQ status to SENT) after removing contract references from RFQLines.
          Throws:
          MXException
          java.rmi.RemoteException
        • getPOCurrency

          public void getPOCurrency(java.lang.String[] statuses)
                             throws MXException,
                                    java.rmi.RemoteException
          Throws:
          MXException
          java.rmi.RemoteException
        • getSqlLineOrLoadedCost

          public void getSqlLineOrLoadedCost()
                                      throws MXException,
                                             java.rmi.RemoteException
          Throws:
          MXException
          java.rmi.RemoteException