psdi.app.labor

Class LaborCraftRate

  • java.lang.Object
  • All Implemented Interfaces:
    java.rmi.Remote, LaborCraftRateRemote, MboConstants, MboRemote, MaxRemoteProxy


    public class LaborCraftRate
    extends Mbo
    implements LaborCraftRateRemote
    Mbo object to represent LaborCraftRate. This object represents the multiple craft,skilllevels, and rates that can be associated with a Labor.

    This is an Org level object.

    The key attributes for this object are OrgId, Laborcode, Craft, Company, and Contractnum.

    The attributes in this object are as follows:

    See Also:
    Labor
    • Constructor Detail

      • LaborCraftRate

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

      • init

        public void init()
                  throws MXException
        Propagate key flag is set to false to avoid erroneous propagation of key to the craftrate object.
        Overrides:
        init in class Mbo
        Throws:
        MXException
      • add

        public void add()
                 throws MXException,
                        java.rmi.RemoteException
        Add new LaborCraftRate.
        Specified by:
        add in interface MboRemote
        Overrides:
        add in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.mbo.Mbo#add.
      • canDelete

        public void canDelete()
                       throws MXException,
                              java.rmi.RemoteException
        Cannot delete a LaborCraftRate if it is marked as default and it is not the last record.
        Overrides:
        canDelete in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • delete

        public void delete(long accessModifier)
                    throws MXException,
                           java.rmi.RemoteException
        Check to see if there are other laborcraftrate records for this labor that share this craft. If there are not, delete the pplaborrate associated with it.
        Specified by:
        delete in interface MboRemote
        Overrides:
        delete in class Mbo
        Parameters:
        accessModifier - The bitwise flag specified to determine if certain normal security checks are to be bypassed for this delete request. For example: if the accessModifer is NOACCESSCHECK, then the check for the object's NODELETE flag and the call to the object's canDelete() method will not be performed. If the accessModifer is NONE, then all the access checks are performed before this object is marked delete.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Mbo.delete(long)
      • undelete

        public void undelete()
                      throws MXException,
                             java.rmi.RemoteException
        Overridden to check whether the default craft is marked for deletion. If so throw exception.
        Specified by:
        undelete in interface MboRemote
        Overrides:
        undelete in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • propagateKeyValue

        public void propagateKeyValue(java.lang.String keyName,
                                      java.lang.String keyValue)
                               throws MXException,
                                      java.rmi.RemoteException
        Set value for LaborCode when propagating from Labor.
        Specified by:
        propagateKeyValue in interface MboRemote
        Overrides:
        propagateKeyValue in class Mbo
        Parameters:
        keyName - Should equal "laborcode" or else nothing will be propagated.
        keyValue - The new value of laborcode.
        Throws:
        MXException
        java.rmi.RemoteException
      • makeOtherNotDefault

        public void makeOtherNotDefault()
                                 throws MXException,
                                        java.rmi.RemoteException
        Used to force defaultcraft checkbox to function like a radiobutton. Uncheck all defaultcraft boxes except the one just clicked.
        Throws:
        MXException
        java.rmi.RemoteException
      • isFirstRecord

        public boolean isFirstRecord()
                              throws MXException,
                                     java.rmi.RemoteException
        Check to see if this entry is the first in the table.
        Returns:
        boolean
        Throws:
        MXException
        java.rmi.RemoteException
      • getStandardRate

        public double getStandardRate()
                               throws MXException,
                                      java.rmi.RemoteException
        Find the correct rate from the craftrate table matching on any non-null value of craft, orgid, skilllevel, company, or contractnum.
        Specified by:
        getStandardRate in interface LaborCraftRateRemote
        Returns:
        String
        Throws:
        MXException
        java.rmi.RemoteException
      • appValidate

        public void appValidate()
                         throws MXException,
                                java.rmi.RemoteException
        For each row, check against every other row in the set that it is unique.
        Overrides:
        appValidate in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • calculateIsActive

        protected boolean calculateIsActive()
                                     throws MXException,
                                            java.rmi.RemoteException
        Calculate the value of the isActive nonpersistent field based on contractnum.
        Returns:
        boolean
        Throws:
        MXException
        java.rmi.RemoteException
      • getSqlForEnteredFields

        public SqlFormat getSqlForEnteredFields()
                                         throws java.rmi.RemoteException,
                                                MXException
        Throws:
        java.rmi.RemoteException
        MXException
      • checkContract

        public void checkContract()
                           throws MXException,
                                  java.rmi.RemoteException
        If the contract status is APPR, then the displayrate and inherit flag for this laborcraftrate becomes editable, else the status is in DRAFT, PNDREV OR WAPPR, then it is readonly.
        Throws:
        MXException
        java.rmi.RemoteException
      • modify

        public void modify()
                    throws MXException,
                           java.rmi.RemoteException
        Description copied from class: Mbo
        This 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 work 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. The derived method has to call super.modify().
        Overrides:
        modify in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException