psdi.app.contract

Class Contract

  • All Implemented Interfaces:
    java.rmi.Remote, PurchasingMboRemote, ContractRemote, MboConstants, MboRemote, StatefulMboRemote, MaxRemoteProxy
    Direct Known Subclasses:
    LaborView, LeaseView, MasterView, PurchView, SFWView, WarrantyView


    public class Contract
    extends PurchasingMbo
    implements ContractRemote
    MBO object to represent the Contract table. 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
    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.
    ChangeBy, ChangeDate The name of the person who last modified the form and the date on which the form was last modified.
    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.
    ContractType Indicates whether the type of the contract is Labor or Lease or Maintenance or Purchase or Rental or Software License or Warranty.
    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.
    Description Description of the Purchase Contract.
    Description_LongDescription Long description of the Purchase Contract.
    EndDate Date when is Contract is no longer valid.
    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.
    OrgId Identifier of the organization for this Contract.
    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.
    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?

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

    • Constructor Detail

      • Contract

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

      • init

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

        public void setContractTypeEditibilityAndValues(boolean fromInit)
                                                 throws MXException,
                                                        java.rmi.RemoteException
        Sets the editibility on certain fields of the PurchView object based on the type of the contract.
        Throws:
        MXException
        java.rmi.RemoteException
      • add

        public void add()
                 throws MXException,
                        java.rmi.RemoteException
        Description copied from class: Mbo
        This is called when a new Mbo is added to the Mboset collection. It is called AFTER user defaults have been set from the data dictionary. Programmer should usually override this to set some defaults. Default behavior is to do nothing.
        Specified by:
        add in interface MboRemote
        Overrides:
        add in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • getStatusHandler

        protected StatusHandler getStatusHandler()
        Description copied from class: StatefulMbo
        Return the status handler object to be used for the actual changing of the status. This is only called once by the framework. This method must be provided by the Mbo programmer.
        Specified by:
        getStatusHandler in class StatefulMbo
      • changeLineStatus

        public void changeLineStatus(MboSetRemote contractLineSetRemote)
                              throws MXException,
                                     java.rmi.RemoteException
        Changes the status of each contract line to the value of the non-persistent field on the PurchView called LINESTATUS. A linestatus of 'CLOSE' cannot be selected because the user cannot by himself close a contract line. At least one line has to be selected before clicking on the 'Change Status' button.
        Specified by:
        changeLineStatus in interface ContractRemote
        Parameters:
        contractLineSetRemote -
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Contract.changeLineStatus(psdi.mbo.MboSetRemote)
      • 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)
      • canEditContractLine

        public boolean canEditContractLine()
                                    throws MXException,
                                           java.rmi.RemoteException
        Checks the status of the Contract and returns false if the status is WAPPR, true otherwise
        Returns:
        true if status is WAPPR and false otherwise.
        Throws:
        MXException
        java.rmi.RemoteException
      • getStatusHistory

        protected MboSetRemote getStatusHistory()
                                         throws MXException,
                                                java.rmi.RemoteException
        Description copied from class: StatefulMbo
        Return the MboSet object used for storing the status change history. This method must be provided by the Mbo programmer.
        Specified by:
        getStatusHistory in class StatefulMbo
        Throws:
        MXException
        java.rmi.RemoteException
      • validateDates

        public void validateDates()
                           throws MXException,
                                  java.rmi.RemoteException
        Validates if the current Date falls between the start and end dates of the contract. If not, the user will not be allowed to create a release PO.
        Specified by:
        validateDates in interface ContractRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Contract.validateDates()
      • validateContract

        public void validateContract()
                              throws MXException,
                                     java.rmi.RemoteException
        Checks for several conditions before contract approval.
        • A vendor has to be entered before a contract can be approved.
        • Start date cannot be empty.
        • The contract must be authorized to be used by at least one site.
        Throws:
        MXException
        java.rmi.RemoteException
      • checkMasterMaxValue

        public void checkMasterMaxValue()
                                 throws MXException,
                                        java.rmi.RemoteException
        Compares the totalcosts of all child contracts, to the maximum value of the master contract. If the cost exceeds the maximum value that is specified on the contract, an exception is thrown.
        Throws:
        MXException
        java.rmi.RemoteException
      • getAvailableFunds

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

        public MboRemote reviseContract(java.lang.String revDescription)
                                 throws MXException,
                                        java.rmi.RemoteException
        Creates a new revision of the current contract.
        1. The new contract has the same contract number as the old contract.
        2. The new contract has a new revision number.
        3. When status of the new contract 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:
        reviseContract in interface ContractRemote
        Returns:
        Returns the newly created contract revision reference.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        canReviseContract
      • 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 Mbo
        Parameters:
        relationName - the relationship name
        mboSet - the mboset
        Throws:
        MXException
        java.rmi.RemoteException
      • canReviseContract

        public void canReviseContract()
                               throws MXException,
                                      java.rmi.RemoteException
        Checks if a new revison can be created from the current contract.
        1. A revision cannot be created from a contract that has already been revised. In other words the currenct contract cannot be in the REVISED status.
        2. The current contract must be in the APPROVED status before a revision can be created.
        Specified by:
        canReviseContract in interface ContractRemote
        Throws:
        MXApplicationException("contract", - "alreadyRevised") - thrown if the current contract is in the REVISED status.
        MXApplicationException("contract", - "shouldBeAppr") - thrown if the currenct contract
        MXException
        java.rmi.RemoteException
        See Also:
        Contract.canReviseContract()
      • findLatestMasterRevision

        public MboRemote findLatestMasterRevision()
                                           throws MXException,
                                                  java.rmi.RemoteException
        Returns:
        the latest revision of the master contract.
        Throws:
        MXException
        java.rmi.RemoteException
      • setContractTypeTerm

        public void setContractTypeTerm()
                                 throws MXException,
                                        java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • cancelOrSusupndPreviousRevision

        public void cancelOrSusupndPreviousRevision(java.lang.String internalStatus)
                                             throws MXException,
                                                    java.rmi.RemoteException
        Cancels or suspends the previous revision of the current contract being canceled or suspended.
        Throws:
        MXException
        java.rmi.RemoteException
      • setNextRevisionReference

        public void setNextRevisionReference(MboRemote nextRevisionRef)
                                      throws MXException,
                                             java.rmi.RemoteException
        Set the reference of the next revision to the passed in Mbo reference.
        Throws:
        MXException
        java.rmi.RemoteException
      • getNextRevisionReference

        public MboRemote getNextRevisionReference()
                                           throws MXException,
                                                  java.rmi.RemoteException
        Returns the reference of the previous revision.
        Throws:
        MXException
        java.rmi.RemoteException
      • getPreviousRevision

        public MboRemote getPreviousRevision()
                                      throws MXException,
                                             java.rmi.RemoteException
        Returns the previous revision of the Contract.
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • getNextRevision

        public MboRemote getNextRevision()
                                  throws MXException,
                                         java.rmi.RemoteException
        Returns the next revision of the Contract.
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • setInvoiceCreationFlag

        public void setInvoiceCreationFlag(boolean hasCreatedInvoice)
                                    throws MXException,
                                           java.rmi.RemoteException
        Called by WarrantyView to indicated the creation of invoices on contract approval.
        Parameters:
        hasCreatedInvoice -
        Throws:
        MXException
        java.rmi.RemoteException
      • getInvoiceCreationFlag

        public boolean getInvoiceCreationFlag()
                                       throws MXException,
                                              java.rmi.RemoteException
        Used to display the appropriate message when invoices have been created on contract approval.
        Returns:
        boolean
        Throws:
        MXException
        java.rmi.RemoteException
      • doesContractReferenceExistOnPO

        public boolean doesContractReferenceExistOnPO()
                                               throws MXException,
                                                      java.rmi.RemoteException
        Returns true if the contract reference exists on any PO Header or POLine.
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • canDelete

        public void canDelete()
                       throws MXException,
                              java.rmi.RemoteException
        Contracts cannot be deleted. An exception is thrown if someone tries to delete a contract.
        Overrides:
        canDelete in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • 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 Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • useLineOrLoadedCost

        public java.lang.String useLineOrLoadedCost()
                                             throws MXException,
                                                    java.rmi.RemoteException
        11-16657/IV09276: put it in Contract because Software contract might use it: added maxvars CONTRALINEORLOADED to determine if Contracts(in View Release Costs) should use linecost or loadedcost to calculate all costs.
        Returns:
        VarValue
        Throws:
        MXException
        java.rmi.RemoteException
      • prevStatusRemainApproved

        public boolean prevStatusRemainApproved()
                                         throws MXException,
                                                java.rmi.RemoteException
        maxvars CONTWSTARTAPPR: to determine if Contract is WSTART, previous Contract is Approved or Revised. Default behavior (CONTWSTARTAPPR is false): previous contract is Revised. If CONTWSTARTAPPR is true, then previous contract remains Approved.
        Returns:
        boolean
        Throws:
        MXException
        java.rmi.RemoteException