psdi.app.invoice

Class FldInvoiceLineUnitCost

  • All Implemented Interfaces:
    MboConstants, MboValueListener


    public class FldInvoiceLineUnitCost
    extends MboValueAdapter
    InvoiceLine.unitcost validation class: Sets the invoice line quantity and linecost depending the unitcost value entered. Also update the related invoice cost unitcost if there is only one invoice cost line for this invoice line.
    • Constructor Detail

      • FldInvoiceLineUnitCost

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

      • init

        public void init()
                  throws MXException,
                         java.rmi.RemoteException
        Set the field to read/only if there are multiple invoice cost lines. If the invoice line has a PO and the poline orderqty and unitcost are equal to 0, set invoice line unitcost read/only
        Specified by:
        init in interface MboValueListener
        Overrides:
        init in class MboValueAdapter
        Throws:
        MXException
        java.rmi.RemoteException
      • action

        public void action()
                    throws MXException,
                           java.rmi.RemoteException
        If the field has a unitcost and the invoice line quantity is not null set linecost equal to unitcost * quantity. Else if unitcost is not 0 and linecost is not null and quantity is null set invoice line quantity equal to linecost / unitcost. Also update the related invoice cost unitcost if there is only one invoice cost line.



        Conditions:
        1. If the invoiceqty is null then set the invoiceqty = linecost/unitcost.
        2. If unit cost is not null and if the invoiceqty is not null then set the linecost=unitcost*invoiceqty.
        Specified by:
        action in interface MboValueListener
        Overrides:
        action in class MboValueAdapter
        Throws:
        MXException
        java.rmi.RemoteException