psdi.app.invoice

Class FldInvoiceCostPercentage

  • All Implemented Interfaces:
    MboConstants, MboValueListener


    public class FldInvoiceCostPercentage
    extends MboValueAdapter
    InvoiceCost.percentage validation class: Updates the invoice cost quantity and linecost based on the percentage. If invoice line quantity is null then the percentage applies to the linecost else it applies to the quantity. While calculating these values we have to make sure that the their invoice cost lines totals are equal to the invoice line values.
    • Constructor Detail

      • FldInvoiceCostPercentage

        public FldInvoiceCostPercentage(MboValue mbv)
        Construct and attach to the mbo value
    • Method Detail

      • action

        public void action()
                    throws MXException,
                           java.rmi.RemoteException
        The invoice cost quantity and linecost are updated based on the percentage value. If the invoice line quantity is null then the percentage applies to the linecost else it applies to the quantity. If the total of the invoice cost lines percentage is 100 we have to set the quantity and linecost values equal to their invoice line values minus the sum of their previous invoice cost lines values.

        Conditions :
        1. If the sum of the percentages is 100 ,set the quantity on the invoice cost line as the difference between the quantity on the invoice line and the sum of the invoice cost quantities on the other invoicecost lines and the linecost as the difference between the linecost on the invoice line and the sum of the invoice cost linecosts of the other invoicecost lines
        2. If the sum of the percentages is not 100,set the invoice cost quantity = quantity * percentage/100 and set the invoicecost linecost=linecost * percentage/100
        Specified by:
        action in interface MboValueListener
        Overrides:
        action in class MboValueAdapter
        Throws:
        MXException
        java.rmi.RemoteException