psdi.app.contract.schedule

Class SchLeaseView

  • java.lang.Object
    • Constructor Detail

      • SchLeaseView

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

      • add

        public void add()
                 throws MXException,
                        java.rmi.RemoteException
        This is called when a new schedule is added to the Schedule MboSet collection. The field defaults and field flags are set here. The table below shows the default values for each of the attributes listed.
        Attribute NameAttribute Value
        contractidOwner contract's ID
        enddateCurrent date
        inclusive1..inclusive2..inclusive3...No
        interimcharge0.0
        leaseratefactor0.0
        periodicpayment0.0
        scheduleidUnique ID
        schedulenumAdd one to the existing maximum value
        schedulerev0
        scheduletype
        singlelinefalse
        startdateCurrent date
        targinvstatusENTERED
        tax1..tax2..tax3...0.0
        Specified by:
        add in interface MboRemote
        Overrides:
        add in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • calculateEndDate

        public java.util.Date calculateEndDate(java.util.Date inDate)
                                        throws MXException,
                                               java.rmi.RemoteException
        Calculate the end date by adding the term to the current date. The term is in months.
        Returns:
        Date The calculated end date.
        Throws:
        MXException
        java.rmi.RemoteException
      • createInvoicesForSchedule

        public void createInvoicesForSchedule(MboSetRemote scheduleLineSet)
                                       throws MXException,
                                              java.rmi.RemoteException
        Create invoices for payment schedules belonging to a lease contract. The invoice creation schedule is based on the start date and end date of the payment schedule. One invoice is created for every due date. The invoice lines are created based on the single line flag on the owner schedule and the interim charge. If the end date has already passed meaning it is before today, create only one invoice. This can only happen in case of a revised schedule.
        Specified by:
        createInvoicesForSchedule in interface SchLeaseViewRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.contract.schedule
      • reCalcScheduleLineCost

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

        public void delete(long accessModifier)
                    throws MXException,
                           java.rmi.RemoteException
        This method deletes all the schedule lines related to this schedule. Also update the owner lease total cost.
        Specified by:
        delete in interface MboRemote
        Overrides:
        delete in class Mbo
        Parameters:
        accessModifier -
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Mbo.delete(long)
      • undelete

        public void undelete()
                      throws MXException,
                             java.rmi.RemoteException
        This method undeletes schedule that has been marked for deletion. All the related schedule lines are also undeleted. Also update the owner lease total cost.
        Specified by:
        undelete in interface MboRemote
        Overrides:
        undelete in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • reCalcInterimCharge

        public double reCalcInterimCharge()
                                   throws MXException,
                                          java.rmi.RemoteException
        This method recalculates the schedule's interim charge if it is changed on any of its schedule lines. This change can happen due to many reasons such as modifing the interim charge, adding a new line, deleting an existing line, etc.
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • 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. CONTRACTLINEID
        2. CONTRACTNUM
        3. REVISIONNUM
        4. SCHEDULEID
        5. TARGINVSTATUS
        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()
      • copy

        public MboRemote copy(MboSetRemote mboset)
                       throws MXException,
                              java.rmi.RemoteException
        Over-ride the copy method of the Mbo. This copy would copy all the POCost Mbos related to the POLine.
        Specified by:
        copy in interface MboRemote
        Overrides:
        copy in class Mbo
        Parameters:
        mboset - The set into which the new mbo will be added.
        Returns:
        The new mbo, with values copied from this mbo.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Mbo.copy(MboSetRemote, long)
      • checkRequiredFields

        public void checkRequiredFields()
                                 throws MXException,
                                        java.rmi.RemoteException
        Throws an exception if the start date or the gl debit account or the schedule on the payment schedule is null.
        Specified by:
        checkRequiredFields in interface SchLeaseViewRemote
        Throws:
        MXApplicationException("contract", - "StartDateIsNull");
        MXApplicationException("contract", - "GLDebitAcctIsNull");
        MXApplicationException("contract", - "ScheduleIsNull");
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.contract.schedule
      • canSelectAsset

        public void canSelectAsset()
                            throws MXException,
                                   java.rmi.RemoteException
        Throws an exception if invoices have already been generated for this schedule. Cannot select assets in this case.
        Specified by:
        canSelectAsset in interface SchLeaseViewRemote
        Throws:
        MXApplicationException("contract", - "PaymentAlreadyGenerated");
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.contract.schedule
      • canDelete

        public void canDelete()
                       throws MXException,
                              java.rmi.RemoteException
        This method is called by the Mbo's delete method. It checks if all the conditions are met to go ahead with the deletion of this record. Do not allow this payment schedule to be deleted if any invoices have been generated against it. Do not allow this payment schedule to be deleted if the contract is pending revision.
        Overrides:
        canDelete in class Mbo
        Throws:
        MXApplicationException - (contract, CannotDeleteIfInvoicesExist) Can only delete if invoices generated.
        MXApplicationException - (contract, CannotDeleteSchContractPNDREV) Can not delete if contract pending revision.
        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 Mbo
        Parameters:
        relationName - the relationship name
        mboSet - the mboset
        Throws:
        MXException
        java.rmi.RemoteException
      • canReviseSchedule

        public void canReviseSchedule()
                               throws MXException,
                                      java.rmi.RemoteException
        Check if the schedule can be revised. If the owner contract is in pending revision status, the schedule cannot be revised. If an existing schedule has already been revised, it cannot be revised again. If there are no invoices generated against a scheule, it cannot be revised. Existing pending invoices against a schedule have to be cancelled before it can be revised. The user is given an option to do so or stop the process.
        Specified by:
        canReviseSchedule in interface SchLeaseViewRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        SchLeaseView.canReviseSchedule()
      • getInvoicesForSchedule

        public MboSetRemote getInvoicesForSchedule()
                                            throws MXException,
                                                   java.rmi.RemoteException
        Get the invoice set for this schedule.
        Returns:
        MboSetRemote
        Throws:
        MXException
        java.rmi.RemoteException