psdi.app.common.receipt

Class ReceiptMbo

  • java.lang.Object
  • All Implemented Interfaces:
    java.rmi.Remote, ReceiptMboRemote, MboConstants, MboRemote, MaxRemoteProxy
    Direct Known Subclasses:
    MatRecTrans, ServRecTrans


    public class ReceiptMbo
    extends Mbo
    implements ReceiptMboRemote
    This receipt class is the super class for both Material and Service receipts represented by MatRecTrans and ServRecTrans respectively. This class was created mainly to provide common functionality required by the two actual receipt objects. The common functionality includes: 1. Gets the PO & POLIne objects that the receipt is done against. 2. Payment on Receipt 3. Updates MR 4. Handles the Charge Store requirement 5. Approves the receipt
    • Field Detail

      • invoiceLineCreated

        public boolean invoiceLineCreated
        10-16171: if Invoice Line already created for this receipt and save() is called again, should not create a new invoice line
    • Constructor Detail

    • Method Detail

      • appValidate

        public void appValidate()
                         throws MXException,
                                java.rmi.RemoteException
        Application validation routine called before the receipt object is saved. ServRecTrans and MatRecTrans will need to super.appValidate().
        Overrides:
        appValidate in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • getPO

        public PORemote getPO()
                       throws MXException,
                              java.rmi.RemoteException
        Returns poMbo if it has been set. If the value is not set, call setPO() to get the poMbo the returned value may be null if this receipt is created from inventory transfer or from invoice.
        Specified by:
        getPO in interface ReceiptMboRemote
        Returns:
        a PORemote object
        Throws:
        MXException
        java.rmi.RemoteException
      • refetchPOLine

        public POLineRemote refetchPOLine()
                                   throws MXException,
                                          java.rmi.RemoteException
        Return poline after refetching from the database. Returns that same poLine reference if the where clause is the same.
        Throws:
        MXException
        java.rmi.RemoteException
      • getPOLine

        public POLineRemote getPOLine()
                               throws MXException,
                                      java.rmi.RemoteException
        Returns PoLineMbo if it has been set. If the value is not set, call setPOLine() to get the poLineMbo the returned value may be null if this receipt is created from inventory transfer or from invoice.
        Specified by:
        getPOLine in interface ReceiptMboRemote
        Returns:
        a POLineRemote object
        Throws:
        MXException
        java.rmi.RemoteException
      • receiptDetails

        public void receiptDetails()
                            throws MXException,
                                   java.rmi.RemoteException
        Common fields copied to MatRecTrans and ServRecTrans from the poLineMbo. This method is invoked when a polinenum is given.
        Throws:
        MXException
        java.rmi.RemoteException
      • getRemainingShipmentQty

        public double getRemainingShipmentQty(MboRemote mbo)
                                       throws MXException,
                                              java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • getRemainingQty

        public double getRemainingQty()
                               throws MXException,
                                      java.rmi.RemoteException
        Calculates the quantity that is yet to be received on either the MATRECTRANS or the SERVRECTRANS Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • getRemainingCurrencyLineCost

        public double getRemainingCurrencyLineCost()
                                            throws MXException,
                                                   java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • getRemainingInvoiceQty

        public double getRemainingInvoiceQty()
                                      throws MXException,
                                             java.rmi.RemoteException
        Calculates the quantity that is yet to be received on either the MATRECTRANS or the SERVRECTRANS Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • getRemainingInvoiceCurrencyLineCost

        public double getRemainingInvoiceCurrencyLineCost()
                                                   throws MXException,
                                                          java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • payOnReceipt

        public void payOnReceipt()
                          throws MXException,
                                 java.rmi.RemoteException
        This method handles the payment on Receipt requirement when a receipt is created. this method is invoked when a polinenum is given.
        Throws:
        MXException
        java.rmi.RemoteException
      • approveInvoices

        public void approveInvoices()
                             throws MXException,
                                    java.rmi.RemoteException
        Approves all the newly generated invoices whose references are stored in the poInvoice hashtable.
        Throws:
        MXException
        java.rmi.RemoteException
      • updateMR

        public void updateMR(MboRemote poline)
                      throws MXException,
                             java.rmi.RemoteException
        Updates MRLINE status.
        Parameters:
        poline - a poline object
        Throws:
        MXException
        java.rmi.RemoteException
      • isLastReceipt

        public boolean isLastReceipt()
                              throws MXException,
                                     java.rmi.RemoteException
        If the running total is now greater than the current mboSet's count, then it returns true to indicate that this receipt is the last receipt; false otherwise.
        Returns:
        a boolean value
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        ReceiptMboSet.getCurrentReceiptCount()
      • useIntegration

        public boolean useIntegration(MboRemote mbo,
                                      java.lang.String code)
                               throws MXException,
                                      java.rmi.RemoteException
        Public method for convenience of MAXCOLLAB calls.
        Parameters:
        mbo - a mbo object
        code - the code
        Returns:
        a boolean value
        Throws:
        MXException
        java.rmi.RemoteException
      • createChildMatServLines

        public void createChildMatServLines()
                                     throws MXException,
                                            java.rmi.RemoteException
        Creates the child MATRECTRANS or SERVRECTRANS records when a new PONUM and POLineNum is entered on the receipt UI. Gets the POCOST Mbos for the POLine reference and creates as many MATRECTRANS or SERVRECTRANS records as there are POCOST records. The newly created child records contain the cost information If there is only one POCOST record associated with the POLine , no new child receipts are created and the parent matrectrans contains the cost information.
        Throws:
        MXException
        java.rmi.RemoteException
      • deleteChildReceipts

        public void deleteChildReceipts()
                                 throws MXException,
                                        java.rmi.RemoteException
        Common method to be used by matrectrans and servrectrans to delete the child servrectrans or matrectrans, which were created earlier created when entering a new ponum and polinenum on the matrec or the servrec line.On clearing either the ponum or the polinenum, the additionally created children must be deleted from memory.
        Throws:
        MXException
        java.rmi.RemoteException
      • getWOReference

        public MboRemote getWOReference()
                                 throws MXException,
                                        java.rmi.RemoteException
        Get the workorder reference. This will be used to get the workorder mbo reference when thw workorder is being updated. For all other cases will return null. Called during the save or approve of the invoice. This will only be set by invoice.
        Throws:
        MXException
        java.rmi.RemoteException
      • createInvoicesForSchedule

        public void createInvoicesForSchedule()
                                       throws MXException,
                                              java.rmi.RemoteException
        Create invoices for payment schedules. Invoices will be created if the poline for this receipt has a contractnum and a scheduleid on it. This method will be called during the save of the receipt and will take precedence if this is also a pay on receipt PO.
        Throws:
        MXException
        java.rmi.RemoteException
      • getPOReference

        public PORemote getPOReference()
                                throws MXException,
                                       java.rmi.RemoteException
        Get the PO reference. This will be used to get the PO mbo reference which was set when the receipt was created by the invoice line.
        Throws:
        MXException
        java.rmi.RemoteException
      • setPOReference

        public void setPOReference(PORemote poRef)
                            throws MXException,
                                   java.rmi.RemoteException
        Used by invoice line to set the PO reference when it is creating receipts.
        Throws:
        MXException
        java.rmi.RemoteException
      • setPOCostReference

        public void setPOCostReference(MboRemote poCost)
                                throws MXException,
                                       java.rmi.RemoteException
        10-16483
        Parameters:
        poCost -
        Throws:
        MXException
        java.rmi.RemoteException
      • getPOCostReference

        public MboRemote getPOCostReference()
                                     throws MXException,
                                            java.rmi.RemoteException
        10-16483
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • getRemainingQtyTransInTransit

        public double getRemainingQtyTransInTransit()
                                             throws MXException,
                                                    java.rmi.RemoteException
        10-16065: get remaining ellible quantity for transfer-in based on a transfer-out
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • delete

        public void delete(long accessmodifier)
                    throws MXException,
                           java.rmi.RemoteException
        10-17510/10-16749: this handles: after there was an exception and the receipt has updated other objects but this receipt is being deleted after error is cleared
        Specified by:
        delete in interface MboRemote
        Overrides:
        delete in class Mbo
        Parameters:
        accessmodifier - The bitwise flag specified to determine if certain normal security checks are to be bypassed for this delete request. For example: if the accessModifer is NOACCESSCHECK, then the check for the object's NODELETE flag and the call to the object's canDelete() method will not be performed. If the accessModifer is NONE, then all the access checks are performed before this object is marked delete.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Mbo.delete(long)
      • undelete

        public void undelete()
                      throws MXException,
                             java.rmi.RemoteException
        10-17510/10-16749: this handles: after there was an exception and the receipt has updated other objects but this receipt is being deleted after error is cleared and undeleted()
        Specified by:
        undelete in interface MboRemote
        Overrides:
        undelete in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • useLineOrLoadedCost

        public java.lang.String useLineOrLoadedCost()
                                             throws MXException,
                                                    java.rmi.RemoteException
        11-16657/IV09276: added maxvars RECEIPLINEORLOADED to determine if receipt should use linecost or loadedcost to update POLine.receivedtotalcost.
        Returns:
        VarValue
        Throws:
        MXException
        java.rmi.RemoteException
      • getQtyStillInTransitForTransOut

        public double getQtyStillInTransitForTransOut()
                                               throws MXException,
                                                      java.rmi.RemoteException
        12-14129/IV26079:get all the qty still held by courier for the internal po - not received by the other storeroom yet.
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • getFirstCourierTransOut

        public MboRemote getFirstCourierTransOut()
                                          throws MXException,
                                                 java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException