psdi.app.invoice

Class InvoiceLineSet

    • Field Detail

      • keyForNewInvoiceLine

        public java.lang.String keyForNewInvoiceLine
    • Constructor Detail

      • InvoiceLineSet

        public InvoiceLineSet(MboServerInterface ms)
                       throws java.rmi.RemoteException
        Construct the set
        Throws:
        java.rmi.RemoteException
    • Method Detail

      • createInvoiceLine

        public void createInvoiceLine(MboRemote receiptOrPOLine,
                                      double qty,
                                      double cost)
                               throws MXException,
                                      java.rmi.RemoteException
        This method creates the new default invoiceline and calls the method to populate its attributes. The user must pass in the receipt or poline mbo from which the values will be copied. Also the quantity and linecost must be passed in as the values displayed on the user interface may be calculated and hence different. This depends upon if the user is displaying the invoiced or uninvoiced quantity and cost.
        Specified by:
        createInvoiceLine in interface InvoiceLineSetRemote
        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
      • clearAllocatedLines

        public void clearAllocatedLines()
                                 throws MXException,
                                        java.rmi.RemoteException
        Clear the prorated info from the lines which have been prorated. This method is called by the GUI when it brings up the allocate services page so that the to be prorated lines can be prorated again.
        Specified by:
        clearAllocatedLines in interface InvoiceLineSetRemote
        Throws:
        MXException
        java.rmi.RemoteException
      • allocateServices

        public void allocateServices()
                              throws MXException,
                                     java.rmi.RemoteException
        This method is called by the GUI to prorate the cost of the selected service lines to the selected lines to which the cost is to be prorated. The lines are marked selected in the set. The prorated flag of the lines which are being prorated is set to true and the other lines proratecost and the loaded cost is being updated. Also the loaded cost of the prorated lines is recalculatetd.
        Specified by:
        allocateServices in interface InvoiceLineSetRemote
        Throws:
        MXException
        java.rmi.RemoteException
      • allocateServices

        public void allocateServices(InvoiceLineSetRemote acceptingLines)
                              throws MXException,
                                     java.rmi.RemoteException
        This method is called by the GUI to allocate all the cost of the lines in this Mbo set to the spedified material or service lines which are ready to accept the allocation. All the cost of the to be allocated lines are proportionally alloced to the target lines to their linecosts. The prorate flag, loadedcost, and proratecost will be updated to those being prorated lines; the loadedcost, and proratecost on the target lines will be updated too.
        Specified by:
        allocateServices in interface InvoiceLineSetRemote
        Parameters:
        acceptingLines - The Mbo Set containing the lines which are about to accept the allocation. The validity of this set is not checked. Whoever calls this method need to make sure the acceptingLines has to contain only those line whose prorateservice is false.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        InvoiceLineSet.allocateServices(InvoiceLineSetRemote)
      • canAdd

        public void canAdd()
                    throws MXException
        Can an object be added to the InvoiceLine? The owner of InvoiceLine must be Invoice and the status should be ENTERED and WAPPR.
        Overrides:
        canAdd in class MboSet
        Throws:
        MXApplicationException(invoice, - onlyAccessableByInvoice) is thrown when the owner is not Invoice
        MXApplicationException(invoice, - cannotAdd) is thrown when the Invoice status is not ENTERED or WAPPR
        MXException
      • getInvoiceForQueryOnly

        public MboRemote getInvoiceForQueryOnly(java.lang.String invoicenum,
                                                java.lang.String siteid)
                                         throws MXException,
                                                java.rmi.RemoteException
        IV35816/71201: multiple invoice lines may query one invoice. For Performance, just use one, instead of invoiceline.getMboSet("INVOICE") each time; The InvoiceLineSet may contain multiple invoices. if there are a large number of invoice lines, the repeated sql fetches slow down the performance
        Parameters:
        invoicenum -
        siteid -
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • setInvoiceforQueryOnly

        public void setInvoiceforQueryOnly(MboRemote invoice)
                                    throws MXException,
                                           java.rmi.RemoteException
        IV35816/71201: for performance
        Parameters:
        invoice -
        Throws:
        MXException
        java.rmi.RemoteException
      • getPOForQueryOnly

        public MboRemote getPOForQueryOnly(java.lang.String ponum,
                                           java.lang.String positeid,
                                           java.lang.String porevisionnum)
                                    throws MXException,
                                           java.rmi.RemoteException
        IV35816/71201: multiple invoice lines may query one PO. For Performance, just use one, instead of invoiceline.getMboSet("PO"); The InvoiceLineSet may contain a large number of invoice lines
        Specified by:
        getPOForQueryOnly in interface InvoiceLineSetRemote
        Parameters:
        ponum -
        positeid -
        porevisionnum -
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • getCompaniesForQueryOnly

        public MboRemote getCompaniesForQueryOnly(java.lang.String vendor,
                                                  java.lang.String orgid)
                                           throws MXException,
                                                  java.rmi.RemoteException
        IV35816/71201: multiple invoicecost may query one company. For Performance, just use one, instead of each invoicecost getting its own companies record because there is probaby onnly one company.
        Parameters:
        companies -
        orgid -
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • setCompaniesforQueryOnly

        public void setCompaniesforQueryOnly(MboRemote company)
                                      throws MXException,
                                             java.rmi.RemoteException
        IV35816/71201: for performance
        Parameters:
        company -
        Throws:
        MXException
        java.rmi.RemoteException
      • getTaxTypeForQueryOnly

        public MboRemote getTaxTypeForQueryOnly(java.lang.String typeCode,
                                                java.lang.String orgid)
                                         throws MXException,
                                                java.rmi.RemoteException
        IV35816/71201: multiple invoicelines may query one taxType for its typeCode-up to 5. For Performance, just use one, instead of each invoiceline getting its own taxtype multiple times.
        Specified by:
        getTaxTypeForQueryOnly in interface InvoiceLineSetRemote
        Parameters:
        typeCode -
        orgid -
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • getTaxRateForQueryOnly

        public java.lang.Double getTaxRateForQueryOnly(java.lang.String typeCode,
                                                       java.lang.String taxCode,
                                                       java.lang.String orgID,
                                                       java.lang.String currentDate)
                                                throws MXException,
                                                       java.rmi.RemoteException
        IV35816/71201: multiple invoicelines may query one tax for its typeCode-up to 5. For Performance, just use one, instead of each invoiceline getting its own tax multiple times.
        Specified by:
        getTaxRateForQueryOnly in interface InvoiceLineSetRemote
        Parameters:
        typeCode -
        taxCode -
        orgID -
        currentDate -
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • setTaxRateforQueryOnly

        public void setTaxRateforQueryOnly(java.lang.String typeCode,
                                           java.lang.String taxCode,
                                           java.lang.String orgID,
                                           java.lang.String currentDate,
                                           double rate)
                                    throws MXException,
                                           java.rmi.RemoteException
        IV35816/71201:for Performance
        Specified by:
        setTaxRateforQueryOnly in interface InvoiceLineSetRemote
        Parameters:
        typeCode -
        taxCode -
        orgID -
        currentDate -
        rate -
        Throws:
        MXException
        java.rmi.RemoteException
      • getTaxForQueryOnly

        public MboRemote getTaxForQueryOnly(java.lang.String typeCode,
                                            java.lang.String taxCode,
                                            java.lang.String orgid)
                                     throws MXException,
                                            java.rmi.RemoteException
        IV35816/71201: multiple invoiceline may query only a small number of taxes(maybe just one) for its typeCode-up to 5. For Performance, cache the ones that have been used - to avoid same sql fetched for each invoice line.
        Specified by:
        getTaxForQueryOnly in interface InvoiceLineSetRemote
        Parameters:
        taxCode -
        typeCode -
        orgid -
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException