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