psdi.app.common

Class Cost

  • java.lang.Object
    • psdi.app.common.Cost


  • public class Cost
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor and Description
      Cost() 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      double calcLoadedCost(UserInfo user, double linecost, double proratecost, double[] tax, boolean issue, java.lang.String orgID, MboRemote mbo)
      calculate the loadedcost for a poline,matrectrans,PR,PO,Sevrectrans record linecost: the current poline/matrectrans cost proratecost: the current poline/matrectrans proratecost tax: an array of taxes, tax[0]=0 not used typecode tax[1] corresponds to tax1 for tax1code 1 tax[2] " tax2 tax2code 2 tax[3] " tax3 tax3code 3 tax[4] " tax4 tax4code 4 tax[5] " tax5 tax5code 5 issue: if this is a direct issue? true or false.
      double calcMatRecProrateCost(MboRemote mbo)
      Calculates the prorate cost for a Material receipt.
      double calcProrateCost(MboRemote mbo, double receiptLineCost)
      Original method used to calculate the proratecost.
      double calcServRecProrateCost(MboRemote mbo)
      Calculates the prorate cost for a Service receipt Following are the rules.
      See if anything is available to prorate.
      double determineLoadedCostIfProrated(MboRemote mbo)
      Returns the actual loadedcost of the prorated service line.
      void prorateServices(MboSetRemote lines)
      Allocate the service cost to the material lines.
      • Methods inherited from class java.lang.Object

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

      • Cost

        public Cost()
    • Method Detail

      • calcLoadedCost

        public double calcLoadedCost(UserInfo user,
                                     double linecost,
                                     double proratecost,
                                     double[] tax,
                                     boolean issue,
                                     java.lang.String orgID,
                                     MboRemote mbo)
                              throws MXException,
                                     java.rmi.RemoteException
        calculate the loadedcost for a poline,matrectrans,PR,PO,Sevrectrans record linecost: the current poline/matrectrans cost proratecost: the current poline/matrectrans proratecost tax: an array of taxes, tax[0]=0 not used typecode tax[1] corresponds to tax1 for tax1code 1 tax[2] " tax2 tax2code 2 tax[3] " tax3 tax3code 3 tax[4] " tax4 tax4code 4 tax[5] " tax5 tax5code 5 issue: if this is a direct issue? true or false. To add taxes to loaded cost depends on the setup of "Add Tax Amount to Vendor Price" in the Tax Options - app setup There are three switches: "For No Items", if checked, value is 0. "For Issues On Receipt Items Only", if checked, value is 1. "For All Items", if checked, value is 2.
        Parameters:
        issue -
        tax -
        linecost -
        proratecost -
        Throws:
        MXException
        java.rmi.RemoteException
      • calcMatRecProrateCost

        public double calcMatRecProrateCost(MboRemote mbo)
                                     throws MXException,
                                            java.rmi.RemoteException
        Calculates the prorate cost for a Material receipt. The following are the rules
        • See if anything should be prorated. Are the receipts complete? ie, is the sum of all previous receipt quantities greater than or equal to the quantity ordered. If true - don't do anything.
        • If the quantity of all receipts (existing plus current) exceeds or equals the ordered qty, find what is left to prorate. Total all the prorate costs for existing receipts for this po.poline and subtract that from the polines proratecost. This remaining amount should be applied in full to the new receipt. Set matrectrans.proratecost to the amount being applied to the receipt set matrectrans.loadedcost to linecost + proratecost.
        • Is the quantity of all receipts (including this one) for this po.poline less than the quantity ordered (poline quantity)? If it is (receipts are partial) see how much should be prorated to the new receipt. Multiply the total prorate cost for the po/poline by the % currently received (quantity received/quantity ordered). This amount should be populated in the matrectrans.proratecost. matrectrans.loadedcost should be populated with linecost + proratecost.
        Throws:
        MXException
        java.rmi.RemoteException
      • calcServRecProrateCost

        public double calcServRecProrateCost(MboRemote mbo)
                                      throws MXException,
                                             java.rmi.RemoteException
        Calculates the prorate cost for a Service receipt Following are the rules.
        • See if anything is available to prorate. Are the receipts complete? ie, is the sum of all previous servrectrans costs greater than or equal to the poline service cost. If true, then the loadedcost should be the linecost (+ tax if included for all lines) and the proratecost should be 0.
        • If the cost of all service receipts (existing plus current) exceeds or equals the po ordered cost, find what is left to prorate. Total all the prorate costs for existing servrectrans for this po.poline and subtract that from the absolute polines proratecost. This remaining amount should be applied in full to the new service receipt. Set servrectrans.proratecost to the negative amount being applied to the receipt set servrectrans.loadedcost to linecost - proratecost.
        • Is the cost of all receipts (including this one) for this po.poline less than the cost ordered (poline cost)? If it is (receipts are partial) Set servrectrans.loadedcost to 0 Set servrectrans.proratecost to the negative loadedcost
        Throws:
        MXException
        java.rmi.RemoteException
      • prorateServices

        public void prorateServices(MboSetRemote lines)
                             throws java.rmi.RemoteException,
                                    MXException
        Allocate the service cost to the material lines. This method is called from invoice (earlier it was also used by PO). This method used to be located in PO, and now it is moved to this common package.
        Throws:
        java.rmi.RemoteException
        MXException
      • determineLoadedCostIfProrated

        public double determineLoadedCostIfProrated(MboRemote mbo)
                                             throws MXException,
                                                    java.rmi.RemoteException
        Returns the actual loadedcost of the prorated service line. The loadedcost on all servrectrans mbos remain zero until the whole amount has been received. If we try to over receive the loadedcost takes the value of linecost.
        Throws:
        MXException
        java.rmi.RemoteException
      • calcProrateCost

        public double calcProrateCost(MboRemote mbo,
                                      double receiptLineCost)
                               throws MXException,
                                      java.rmi.RemoteException
        Original method used to calculate the proratecost. Currently invoice is using it.
        Throws:
        MXException
        java.rmi.RemoteException