psdi.app.pr

Class FldPRCostQuantity

  • All Implemented Interfaces:
    MboConstants, MboValueListener


    public class FldPRCostQuantity
    extends MboValueAdapter
    Validation class for PR Cost Quantity. The quantity entered must not be greater than the PR line quantity. If the PR quantity is 0 the percentage is always 100%, otherwise it is equal to the PR cost quantity as a percentage of the PR line quantity. If the cost line quantity is less than 0, the percentage is negative. Also if the PR cost quantity is not null, the PR cost linecost and loaded cost are calculated and set.
    • Method Detail

      • action

        public void action()
                    throws MXException,
                           java.rmi.RemoteException
        If the PR quantity is 0 the percentage is always 100%, otherwise it is equal to the PR cost quantity as a percentage of the PR line quantity. If the cost line quantity is less than 0, the percentage is negative. Also if the PR cost quantity is not null, the PR cost linecost is calculated and set; the percentage attribute's field validation does not calculate linecost.
        Conditions:
        1. If the quantity is set to zero, set the percentage to zero.
        2. If the sum of the quantities on the prcost lines is equal to the quantity on the PRline then round off the percentage so that the sum of the percentages on the lines is 100.
        3. If the sum of the quantities on the prcost lines is NOT equal to the quantity on the PRline, then calculate percentage = (PR cost quantity/PRline quantity) * 100.
        4. If the quantity on the PR cost line is less than zero negate the percentage
        5. If the quantity and the unit cost on the PR cost line are not null set the PR cost linecost =(PRline.linecost * prcost.percentage) /100 set the PR cost loadedcost =(PRline.loadedcost * prcost.percentage) /100
        Specified by:
        action in interface MboValueListener
        Overrides:
        action in class MboValueAdapter
        Throws:
        MXException
        java.rmi.RemoteException