psdi.app.invoice

Interface InvoiceLineRemote

    • Method Detail

      • copyPOLine

        void copyPOLine()
                 throws MXException,
                        java.rmi.RemoteException
        Copy the poline fields
        Throws:
        MXException
        java.rmi.RemoteException
      • clearPOLine

        void clearPOLine()
                  throws MXException,
                         java.rmi.RemoteException
        Clear the fields copied from poline.
        Throws:
        MXException
        java.rmi.RemoteException
      • addCostFromPOLine

        void addCostFromPOLine(InvoiceCostSetRemote invCostSet,
                               MboRemote poLine)
                        throws MXException,
                               java.rmi.RemoteException
        This method adds new invoice cost lines and copies over the values from PO Cost and PO line. Each related PO Cost line should have one corresponding invoice cost line.
        Throws:
        MXException
        java.rmi.RemoteException
      • validateCurrency

        void validateCurrency(java.lang.String invoiceCurrency)
                       throws MXException,
                              java.rmi.RemoteException
        Obtain exchange rate from po currency to invoice currency and base currency
        Throws:
        MXException
        java.rmi.RemoteException
      • validateInvoiceMatchForApproval

        void validateInvoiceMatchForApproval()
                                      throws MXException,
                                             java.rmi.RemoteException
        Check if any invoicematch is currently specifyed for the invoiceline. If no invoicematch is available, then check if nay match can be found now. If no match is found, raise error. If there are existing invoicematch records, then validate the invoice match to make sure that the match is still valid. If not, then raise error.
        Throws:
        MXException
        java.rmi.RemoteException
      • checkForServiceProrating

        void checkForServiceProrating()
                               throws MXException,
                                      java.rmi.RemoteException
        If the invoice line have PRORATE = Y, PRORATECOST != 0 (should we check this?) and there are distributions existing for any of the INVOICELINEs (i.e. there are INVOICELINEs with more than one INVOICECOST line), than raise error - Cannot Prorate services on an invoice with distributed lines.
        Throws:
        MXException
        java.rmi.RemoteException
      • checkForPOLineTolerance

        void checkForPOLineTolerance(java.lang.Double upperTolerancePct,
                                     java.lang.Double lowerTolerancePct,
                                     java.lang.Double upperToleranceAmt,
                                     java.lang.Double lowerToleranceAmt)
                              throws MXException,
                                     java.rmi.RemoteException
        For each invoice line that refers to a PO line, a check is made to ensure that the cost on the invoice is not too different from the cost specified on the PO line. This check is made based on the values specified for TOLERANCE.UPPERINVOICEPCT / TOLERANCE.LOWERINVOICEPCT and TOLERANCE.UPPERINVOICEAMT / TOLERANCE.LOWERINVOICEAMT attributes. Tolerance Checking is always done in Base Currency1.
        Parameters:
        upperTolerancePct - The value specified in TOLERANCE.UPPERINVOICEPCT.
        lowerTolerancePct - The value specified in TOLERANCE.LOWERINVOICEPCT.
        UpperToleranceAmt - The value specified in TOLERANCE.UPPERINVOICEAMT.
        lowerToleranceAmt - The value specified in TOLERANCE.LOWERINVOICEAMT.
        Throws:
        MXApplicationException - (invoice, ExceedPOTolerance) Tolerance level exceeded.
        MXException
        java.rmi.RemoteException
      • getInvoiceMatchSet

        InvoiceMatchSetRemote getInvoiceMatchSet()
                                          throws MXException,
                                                 java.rmi.RemoteException
        Create invoice line for receipt. It will be called by matrectrans and servrectrans when pay on receipt.
        Throws:
        MXException
        java.rmi.RemoteException
      • createDefaultReceipt

        MboRemote createDefaultReceipt()
                                throws MXException,
                                       java.rmi.RemoteException
        Create a receipt by invoice. It sets all the values on receipt based on the information on invoicecost, invoiceline and invoice. This function is used by the functions to create different receipts by invoice.
        Throws:
        MXException
        java.rmi.RemoteException
      • createDefaultServiceReceipt

        MboRemote createDefaultServiceReceipt()
                                       throws MXException,
                                              java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • createDefaultMaterialReceipt

        MboRemote createDefaultMaterialReceipt()
                                        throws MXException,
                                               java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • createReceipts

        void createReceipts()
                     throws MXException,
                            java.rmi.RemoteException
        For each invoicecost, this function creates the receipt and invoice match from invoicecost for the line
        Throws:
        MXException
        java.rmi.RemoteException
      • calcProrateCostForReceipt

        double calcProrateCostForReceipt()
                                  throws MXException,
                                         java.rmi.RemoteException
        Calculate the proratecost which will be put on the receipt.
        Throws:
        MXException
        java.rmi.RemoteException
      • needProcessVariance

        boolean needProcessVariance()
                             throws MXException,
                                    java.rmi.RemoteException
        Does this invoice line need to process variance? If the invoice doesn't refer to a PO - POLine, the only brand new receipt will be written for this invoiceline, so, no variance calculation is needed. Also, if this invoiceline refers to a PO - POLine, but this POLine's receiptreqd=N. a brand new receipt will be written, so, no variance calculation needed either. For all the other cases, calculation for variance is needed.
        Throws:
        MXException
        java.rmi.RemoteException
      • createReceiptOrTransactionForVariance

        void createReceiptOrTransactionForVariance()
                                            throws MXException,
                                                   java.rmi.RemoteException
        Create servrectrans and matrectrans for invoice variance.
        Throws:
        MXException
        java.rmi.RemoteException
      • createTransactionsAfterAppr

        void createTransactionsAfterAppr(double currencyVar,
                                         double priceVar)
                                  throws MXException,
                                         java.rmi.RemoteException
        This method is used to create invoice variance transactions and is called through the invoice mbo. Mainly for ERP group's use.
        Throws:
        MXException
        java.rmi.RemoteException
      • findOrigReceiptSum

        double findOrigReceiptSum(java.lang.String attribute)
                           throws MXException,
                                  java.rmi.RemoteException
        Find the sum of certain numerical attibute of the receipts matching the 100% invoicecost line of the invoiceline.
        Throws:
        MXException
        java.rmi.RemoteException
      • getIssue

        boolean getIssue()
                  throws MXException,
                         java.rmi.RemoteException
        If it is a service, issue is always yes, if not, invoiceline must have a poline, get it's issue flag from the poline.
        Throws:
        MXException
        java.rmi.RemoteException
      • setCurVarTotal

        void setCurVarTotal(double currencyVariance)
                     throws MXException,
                            java.rmi.RemoteException
        This method is to be used by ERP to set the global variable curVar when they don't want us to calculate the currency variance instead they do it. This method should always be called before the invoice approval when the external system does the invoice matching and passes it in because in that case it is assumed that they are also calculating the variances.
        Throws:
        MXException
        java.rmi.RemoteException
      • setPriceVarTotal

        void setPriceVarTotal(double priceVariance)
                       throws MXException,
                              java.rmi.RemoteException
        This method is to be used by ERP to set the global variable curVar when they don't want us to calculate the currency variance instead they do it. This method should always be called before the invoice approval when the external system does the invoice matching and passes it in because in that case it is assumed that they are also calculating the variances.
        Throws:
        MXException
        java.rmi.RemoteException
      • copyReceiptPOLineToInvoiceLine

        void copyReceiptPOLineToInvoiceLine(MboRemote receiptOrPOLine,
                                            double qty,
                                            double cost)
                                     throws MXException,
                                            java.rmi.RemoteException
        This method decides and calls the respective methods to copy receipt or poline info to the newly created invoice line. This method has to called from the InvoiceLine MboSet as it adds the new invoice line.
        Parameters:
        receiptOrPOLine - The receipt or poline mbo from which the values will be copied.
        qty - The quantity which the user will calculate and pass in.
        cost - The linecost which the user will calculate and pass in.
        Throws:
        MXException
        java.rmi.RemoteException
      • canDistributeInvoiceLine

        void canDistributeInvoiceLine()
                               throws MXException,
                                      java.rmi.RemoteException
        If the related PO line is already distributed i.e POLINE.DISTRIBUTED=Y, you cannot distribute this invoice line. This method should be called by the GUI when the "Distribute Costs" button on the Invoice Line page is pushed.
        Throws:
        MXApplicationException - (invoice, POLineMissing) Related PO Line is missing.
        MXApplicationException - (invoice, DistributedInPO) Line already distributed in PO.
        MXException
        java.rmi.RemoteException
      • canDistributeProrateInvoiceLine

        void canDistributeProrateInvoiceLine()
                                      throws MXException,
                                             java.rmi.RemoteException
        If this invoice line is a prorate line i.e. PRORATESERVICE=Y, you cannot distribute this invoice line. This method should be called by the GUI when the "Distribute Costs" button on the Invoice Line page is pushed.
        Throws:
        MXApplicationException - (invoice, CannotDistProrateLine) Line cannot be distributed as it can be prorated.
        MXException
        java.rmi.RemoteException
      • canAllocateServices

        void canAllocateServices()
                          throws MXException,
                                 java.rmi.RemoteException
        You can allocate services only if this invoice line is a prorate line i.e. PRORATESERVICE=Y. This method should be called by the GUI when the "Allocate Services" button on the Invoice Line page is pushed.
        Throws:
        MXApplicationException - (invoice, CannotAllocateServices) Cannot allocate services as no services to prorate.
        MXException
        java.rmi.RemoteException
      • CanAllocateServIfEnteredOrWappr

        void CanAllocateServIfEnteredOrWappr()
                                      throws MXException,
                                             java.rmi.RemoteException
        You can allocate services only if the status of the owner invoice is ENTERED or WAPPR. This method should be called by the GUI when the "Allocate Services" action on the Invoice Line page is used.
        Throws:
        MXApplicationException - (invoice, AllocateServIfEnteredOrWappr) Can allocate services only if invoice status is ENTERED or WAPPR.
        MXException
        java.rmi.RemoteException
      • getPOToInvCur

        double getPOToInvCur()
                      throws MXException,
                             java.rmi.RemoteException
        Obtain the exchangerate from po's currency to invoice's currency. Use three-step method to find exchange rate.
        Returns:
        double The exchange rate from PO to Invoice currency.
        Throws:
        MXApplicationException - (invoice, POMissing) PO not found.
        MXApplicationException - (invoice, ExchangeRateNotFound) Exchangerate not found.
        MXException
        java.rmi.RemoteException
      • canDistributeIssueInvoiceLine

        void canDistributeIssueInvoiceLine()
                                    throws MXException,
                                           java.rmi.RemoteException
        If the related PO line is a not a direct issue, you cannot distribute this invoice line. This method should be called by the GUI when the "Distribute Costs" button on the Invoice line page is pushed.
        Throws:
        MXApplicationException - (invoice, POLineMissing) Related PO Line is missing.
        MXApplicationException - (invoice, POLineNotDirectIssue) PO Line is not a direct issue.
        MXException
        java.rmi.RemoteException
      • updateWOCosts

        void updateWOCosts()
                    throws MXException,
                           java.rmi.RemoteException
        This method updates the actual service cost of the workorders which are associated to the related invoice costs of the owner invoice. When approving the invoice, if the invoice line is charged to a service which does not have any ponum or polinenum, we have to update the actual service cost of the workorder on the related invoice cost lines.
        Throws:
        MXException
        java.rmi.RemoteException