psdi.app.invoice

Class FldInvoiceCostQty

  • All Implemented Interfaces:
    MboConstants, MboValueListener
    Direct Known Subclasses:
    FldInvoiceCostQtyForUI


    public class FldInvoiceCostQty
    extends MboValueAdapter
    InvoiceCost.quantity validation class: Checks if the quantity entered is not greater than the invoice line quantity. If the invoice quantity is 0 the percentage is always 100% else it is equal to percentage of invoice cost quantity in relation to the invoice line quantity. If Quantity is less than 0 percentage is negative. Also if the invoice cost quantity and unitcost is not null we are setting the invoice cost linecost here since we don't use percentage's field validation to do that.
    • Constructor Detail

      • FldInvoiceCostQty

        public FldInvoiceCostQty(MboValue mbv)
    • Method Detail

      • action

        public void action()
                    throws MXException,
                           java.rmi.RemoteException
        If the invoice quantity is 0 the percentage is always 100% set it equal to percentage of invoice cost quantity in relation to the invoice line quantity. If Quantity is less than 0 percentage is negative. Also if the invoice cost quantity and unitcost is not null we need to set the linecost since we don't use percentage's field validation to set it.

        Conditions:
        1. If the quantity is set to zero set the percentage to zero.If the sum of the quantity on the invoicecost lines is equal to the quantity on the invoiceline then round off the percentage so that the sum of the percentage on the lines is 100 otherwise calculate percentage= (invoice cost quantity/invoiceline quantity) * 100. If the quantity on the invoice cost line is less than zero negate the percentage
        2. If the quantity and the unit cost on the invoice cost line is not null set the invoice cost linecost = (invoiceline linecost * invoicecost percentage) /100
        Specified by:
        action in interface MboValueListener
        Overrides:
        action in class MboValueAdapter
        Throws:
        MXException
        java.rmi.RemoteException