psdi.app.common

Class FundTracker

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


  • public class FundTracker
    extends java.lang.Object
    Class: FundTracker PURPOSE: This class is used to keep a running tally of costs/funds used up off of Blanket/Price Agreement POs. Designed specifically for use in conjuction with the DefaultOrderPrice class, this slave class allows the DefaultOrderPrice class to keep watch over Blanket PO expenditures during a "process session". This class was designed to be instantiated ONCE during a "Process" and then used repeatedly during that "Process". A "Process" in this context can be defined as anything which occurs prior to a commit of the parent Set (eg. MRSet, POSet etc.). The idea here was to provide an ongoing means for tracking charges against an agreement/price po when that po was chosen as the source of a price. HISTORY OF NEED: Because Blanket/Price agreements can have total value tolerances associated with them, the need to keep an active count of how much of this total value(fund) has been consumed by the current process is real. It is This need is particularly evident in the Reorder process, which may generate many pr/pos during one process. Because DefaultOrderPrice seeks to provide the most accurate "default" price to be associated with a particular order line, it must recognize that just because an Blanket PO has "available" funds - that is, the value of the (po.totalcost - released amount), the caller may have consumed the remaining total during this very process! Therefore, a price pulled from a Blanket Agreement PO may actually not be valid even though standard fund calculation has been performed and the PO looks like a candidate. While its true that this approach does not consider outstanding PO/PR orders which have been saved, but not approved or released, and could very well be mulling around the database (just waiting to annoy users during approval!), this is not sufficient justification for ignoring the "smaller" problem FundTracker solves. Bottom Line: Since we can know with some surety that if the (total "available funds" - current "process" fund expenditure_ are not sufficient, then it is not a valid agreement for use and therefore not valid for pricing. A last note about the history of this class: cost/benefit analysis of the need for this class would certainly not have justified its creation if it were not for the needs of REORDER! The truth is this: Reorder generates many PR/PO, and often taps the same Blanket Agreement PO during ONE process. Reorder needs a FundTracker. Every other price seeker gets a little extra benefit with a tiny bit of effort and limited overhead. Justification for users other than Reorder: tiny effort, limited overhead, some benefit - why not? Fundamental ideas behind the FundTracker: - Each key value (app/object/tablewindowrow - example PO/POline) can have only one Total in use at a time. - Not all users will be interested in allowing modifications/editing - eliminating the need to be concerned with tracking a previous line(editkey) total. Reorder, for example, will not be interested in providing for modifications. Therefore, the totalHistory flag has been offered. This will minimize resource usage where possible. How to add DefaultOrderPrice access to applications other than users currently cited in Audience: - Modify the FundTracker.determineKeyValue() to consider the callers getName and set appropriate values.. AUDIENCE: As of the writing of this class, its primary user is to be DefaultOrderPrice. By passing a FundTracker instance to the DefaultOrderPrice constructor, you can manage agreement po fund allocations. The primary users of Default Price (again, as of these docs) were MR, PR, PO, REORDER, and WPMTL WHAT YOU GET: FundTracker uses hashtables to keep active record of current funds. The hastable has a key of object String, which should contain a valid PONumber. The value in the hashtable is a Double object containing the last record of funds used by this Process against the PO identified by String PONum Elements of this class which have accessor and mutator methods include the following: - get ! getTotalUsed(String ponumber) - set ! putFunds(String ponumber, double value) SEE the javadocs for FundTracker methods for further information on their use and capability
    • Constructor Summary

      Constructors 
      Constructor and Description
      FundTracker(boolean history)
      FundTracker(boolean) - Constructor Use this constructor to instantiate FundTracker - providing a boolean to shut on/off the historyFlag.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      double getTotalUsed(java.lang.String ponum)
      getTotalUsed (a public accessor method) WHAT: This method retrieves the value associated with a particular ponum key in the hastable REMEMBER: Value = The amount of funds used, thus far, off an agreement/blanket PO DURING THIS PROCESS....It should always be added (using putFunds()) in the BaseCurrency1 THEREFORE, it will be returned in BaseCurrency1 PARAMETERS:
      void putFunds(java.lang.String ponum, double value, Mbo mbo)
      putFunds(string,double) WHAT: A public method providing users ability to add a value into a hashtable for a particular po.
      • Methods inherited from class java.lang.Object

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

      • FundTracker

        public FundTracker(boolean history)
        FundTracker(boolean) - Constructor Use this constructor to instantiate FundTracker - providing a boolean to shut on/off the historyFlag. The option with which FundTracker can be instantiated is: - historyFlag = If historyFlag = true, the keyPonums and keyValues hashtables are used. These hashtables will store the previous value associated with a particular editkey(ex:po/polinenum) If someone passes in a request to putFunds() for an already used editkey, the keyPonums and keyValues hastables will be used to subtract the previous value from total funds before adding in the new putFunds() value. Otherwise, modifications would result in an inaccurate totalFunds counter!!!
    • Method Detail

      • getTotalUsed

        public double getTotalUsed(java.lang.String ponum)
        getTotalUsed (a public accessor method) WHAT: This method retrieves the value associated with a particular ponum key in the hastable REMEMBER: Value = The amount of funds used, thus far, off an agreement/blanket PO DURING THIS PROCESS....It should always be added (using putFunds()) in the BaseCurrency1 THEREFORE, it will be returned in BaseCurrency1 PARAMETERS:
      • putFunds

        public void putFunds(java.lang.String ponum,
                             double value,
                             Mbo mbo)
                      throws MXException,
                             java.rmi.RemoteException
        putFunds(string,double) WHAT: A public method providing users ability to add a value into a hashtable for a particular po. the value being added is the amount of new funds which should be considered SPENT on the associated agreement/blanket po. If there is already a value associated with this ponum, the value will be added to the existing value. PARAMETERS:
        Throws:
        MXException
        java.rmi.RemoteException