psdi.app.contract.lease

Class LeaseView

    • Constructor Detail

      • LeaseView

        public LeaseView(MboSet ms)
                  throws MXException,
                         java.rmi.RemoteException
        Construct the LeaseView 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
      • 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.
        Overrides:
        getStatusHandler in class Contract
      • add

        public void add()
                 throws MXException,
                        java.rmi.RemoteException
        Add method on the Leave Contract View.
        Specified by:
        add in interface MboRemote
        Overrides:
        add in class Contract
        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. changedate
        3. contractnum
        4. enddate
        5. exchangedate
        6. exchangerate
        7. expdone
        8. externalrefid
        9. historyflag
        10. orgid
        11. ownersysid
        12. receipts
        13. requireddate
        14. startdate
        15. status
        16. statusdate
        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:
        ContractLine.skipCopyField(psdi.mbo.MboValueInfo), ContractLine.loadSkipFieldCopyHashSet()
      • appValidate

        public void appValidate()
                         throws java.rmi.RemoteException,
                                MXException
        Description copied from class: Mbo
        Pre-save validation method. Programmer can override with specific rules.
        Overrides:
        appValidate in class Mbo
        Throws:
        java.rmi.RemoteException
        MXException
      • 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
      • canCreateSchedule

        public void canCreateSchedule()
                               throws MXException,
                                      java.rmi.RemoteException
        Cannot add a new payment schedule for an lease contract unless it is approved. The current date should be before the last schedule date.
        Specified by:
        canCreateSchedule in interface LeaseViewRemote
        Throws:
        MXApplicationException("contract", - "AfterLastScheduleDate")
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.contract.lease
      • setEditibilityFlags

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

        public double reCalcLeaseViewCost()
                                   throws MXException,
                                          java.rmi.RemoteException
        This method recalculates the lease view's total cost if the line cost on any of its payment schedule lines changes. This change can happen due to many reasons such as modifing the line cost, adding a new schedule, deleting an existing schedule, etc.
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • setRentalReadOnlyFields

        public void setRentalReadOnlyFields()
                                     throws MXException,
                                            java.rmi.RemoteException
        Sets some fields to read only if the contract type is rental
        Throws:
        MXException
        java.rmi.RemoteException
      • canPurchaseOrReturnAsset

        public void canPurchaseOrReturnAsset()
                                      throws MXException,
                                             java.rmi.RemoteException
        Can perform "Purchase" or "Return" assets "End Lease" actions for approved contracts only
        Specified by:
        canPurchaseOrReturnAsset in interface LeaseViewRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.contract.lease.ITSMELeaseView#canPurchaseOrReturnAsset
      • createEndLeaseInvoice

        public void createEndLeaseInvoice(java.lang.String invNumber,
                                          java.lang.String targetStatus,
                                          MboSetRemote assetSet,
                                          boolean purchaseFlag)
                                   throws MXException,
                                          java.rmi.RemoteException
        Create invoice for purchase assets belonging to a lease contract (Lease End action).
        Specified by:
        createEndLeaseInvoice in interface LeaseViewRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.contract.lease.ITSMELeaseView#createEndLeaseInvoice
      • createEndLeasePO

        public void createEndLeasePO(java.lang.String poNumber,
                                     java.lang.String targetStatus,
                                     MboSetRemote assetSet,
                                     boolean purchaseFlag)
                              throws MXException,
                                     java.rmi.RemoteException
        Specified by:
        createEndLeasePO in interface LeaseViewRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.contract.lease.ITSMELeaseView#createEndLeasePO
      • 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
        Specified by:
        reviseContract in interface LeaseViewRemote
        Overrides:
        reviseContract in class Contract
        Returns:
        Returns the newly created contract revision reference.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        canReviseContract
      • changeStatus

        public void changeStatus(java.lang.String status,
                                 java.util.Date date,
                                 java.lang.String memo,
                                 long accessModifier)
                          throws MXException,
                                 java.rmi.RemoteException
        Description copied from class: Contract
        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 Contract
        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)