psdi.app.po

Class FldPOCostQuantity

  • All Implemented Interfaces:
    MboConstants, MboValueListener


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

      • action

        public void action()
                    throws MXException,
                           java.rmi.RemoteException
        If the PO quantity is 0 the percentage is always 100%, otherwise it is equal to the PO cost quantity as a percentage of the PO line quantity. If the cost line quantity is less than 0, the percentage is negative. Also if the PO cost quantity is not null, the PO 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 pocost lines is equal to the quantity on the POline 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 pocost lines is NOT equal to the quantity on the POLine, then calculate percentage = (PO cost quantity/POLine quantity) * 100.
        4. If the quantity on the PO cost line is less than zero negate the percentage
        5. If the quantity and the unit cost on the PO cost line are not null set the PO cost linecost =(POLine.linecost * pocost.percentage) /100 set the PO cost loadedcost =(POLine.loadedcost * pocost.percentage) /100
        Specified by:
        action in interface MboValueListener
        Overrides:
        action in class MboValueAdapter
        Throws:
        MXException
        java.rmi.RemoteException