psdi.app.invoice

Class Invoice.UninvoicedReceiptsInfo

  • java.lang.Object
    • psdi.app.invoice.Invoice.UninvoicedReceiptsInfo
  • Enclosing class:
    Invoice


    public class Invoice.UninvoicedReceiptsInfo
    extends java.lang.Object
    This class is the in-memory representation of the uninvoiced receipt information for the PO/POLine of the same invoice. It is constructed by first getUninvoicedReceipts() call and destroyed or cleared before save. An instance of this object is the in-memory representation of the uninvoiced receipts information. Database will not be updated by any of the operations provided in this class. This is an inner class of Invoice.
    • Constructor Summary

      Constructors 
      Constructor and Description
      UninvoicedReceiptsInfo(Invoice inv)
      Constructor: Create the empty hashtables, set byCost, set type, and retrieve the receipt MboSet.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void destroy()
      Close everything.
      double getIssueUnitCost(MboRemote receipt, MboRemote invoiceLine)
      Get the unit cost of receipt in issue unit and invoice's currency.
      double[] getNewlyAllocated(java.lang.String invoiceLineNum, java.lang.String receiptID)
      Get the allocated quantity or cost of a receipt to a certain invoice line.
      double getRemainingCost(MboRemote receipt)
      Get the remaining unmatched cost of the receipt.
      double getRemainingQty(MboRemote receipt)
      Get the remaining unmatched quantity of a receipt.
      java.util.Vector getUninvoicedReceipts(java.lang.String poNum, java.lang.String polinenum, int type, boolean isCreditInvoice, java.lang.String siteID, boolean isNegativeLine, java.lang.String receiptID)
      Get the uninvoiced receipts of the type, ponum, and polinenum, ordered by their transaction dates.
      void update(MboRemote invoiceLine, MboRemote receipt, double qty, double cost)
      Update the newAllocation and uninvoicedQtyCost hashtables by the match of this receipt.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • UninvoicedReceiptsInfo

        public UninvoicedReceiptsInfo(Invoice inv)
        Constructor: Create the empty hashtables, set byCost, set type, and retrieve the receipt MboSet. If poLineNum is null, all po's receipts of type with invoicenum=null will be retrieved.
        Parameters:
        inv -
    • Method Detail

      • destroy

        public void destroy()
        Close everything. This should be called in the save of invoice.
      • getRemainingQty

        public double getRemainingQty(MboRemote receipt)
                               throws MXException,
                                      java.rmi.RemoteException
        Get the remaining unmatched quantity of a receipt.
        Parameters:
        receipt - The Mbo remote of the receipt.
        Returns:
        double The unmatched quantity.
        Throws:
        MXException
        java.rmi.RemoteException
      • getRemainingCost

        public double getRemainingCost(MboRemote receipt)
                                throws MXException,
                                       java.rmi.RemoteException
        Get the remaining unmatched cost of the receipt.
        Parameters:
        receipt - The Mbo remote of the receipt.
        Returns:
        double The unmatched cost.
        Throws:
        MXException
        java.rmi.RemoteException
      • getNewlyAllocated

        public double[] getNewlyAllocated(java.lang.String invoiceLineNum,
                                          java.lang.String receiptID)
        Get the allocated quantity or cost of a receipt to a certain invoice line.
        Parameters:
        invoiceLineNum - The identifier of the invoice line.
        receiptID - The identifier of the receipt.
        Returns:
        double[] Array of allocated quantity or cost.
      • getUninvoicedReceipts

        public java.util.Vector getUninvoicedReceipts(java.lang.String poNum,
                                                      java.lang.String polinenum,
                                                      int type,
                                                      boolean isCreditInvoice,
                                                      java.lang.String siteID,
                                                      boolean isNegativeLine,
                                                      java.lang.String receiptID)
                                               throws MXException,
                                                      java.rmi.RemoteException
        Get the uninvoiced receipts of the type, ponum, and polinenum, ordered by their transaction dates.
        Parameters:
        poNum - PO number for this invoice line
        polinenum - The POLine number.
        type - The type of receipt: material or service.
        Returns:
        Vector A vector of objects containing MboRemote of receipt.
        Throws:
        MXException
        java.rmi.RemoteException
      • update

        public void update(MboRemote invoiceLine,
                           MboRemote receipt,
                           double qty,
                           double cost)
                    throws MXException,
                           java.rmi.RemoteException
        Update the newAllocation and uninvoicedQtyCost hashtables by the match of this receipt. This is called when a match is decided and about to write to the database.
        Parameters:
        invoiceLine - The invoice line which this match is done on.
        receipt - The MboRemote of the receipt which is matched to the invoice-invoiceline.
        qty - Quantity of the receipt which is matched to this invoice-invoiceline. It's in issue unit.
        cost - Cost of the receipt which matched to this invoice-invoiceline. It's in invoice's currency.
        Throws:
        MXApplicationException - (invoice, NoSuchReceipt) Receipt not found.
        MXException
        java.rmi.RemoteException
      • getIssueUnitCost

        public double getIssueUnitCost(MboRemote receipt,
                                       MboRemote invoiceLine)
                                throws MXException,
                                       java.rmi.RemoteException
        Get the unit cost of receipt in issue unit and invoice's currency.
        Parameters:
        receipt - The receipt Mbo Remote.
        Returns:
        double The unit cost.
        Throws:
        MXException
        java.rmi.RemoteException