sales tax & more

Michael + Jennifer Garrison Stuber garrisonstuber@bellsouth.net
Fri, 7 Jun 2002 22:36:03 -0700


> > We implemented an arbitrary spreadsheet language for manipulating
metering
> > data into one of our products at work.  At first I was concerned, but
throw
> > in a little Lex and Yacc and it's not that bad . . .
>
> Care to donate the code?

Regrettably it's nothing I can donate (closed source stuff that I don't
own), nevertheless you can roll some pretty powerful stuff with Lex and
Yacc.  If we were serious about this (and I confess I'm not at this point --
I still have line graphing stuff to work on) what would you want it to do?

Obvious choices are standard mathmatical operations, grouping, and if
statements.  The question in my mind is what would we reference?  For
example, in my company's product in the utility space we often deal with
meters, so on of the things our language supports was reference meters.  A
formula in the language might look like:

    if(metera:1>100, metera:1, meterb:1) + meterc:2

The colon followed by the number allows us to reference channels of data
within the meter.  The point here is not to indoctrinate you into the finer
points of the meter data manipulation, but to explore what a spreadsheet
language inside of the invoicing module might look like.  Would we want to
reference Lot balances?  Account balances?  Invoice line numbers?  Would we
need special grouping operators for lots or other invoices?  For example,
maybe a function that totaled outstanding lots for a particular customer
could be used to determine whether to slap on an extra fee:

    if(customerlots("Jimbob's Junk")>1000, 50, 0)

I have no idea what the invoice feature even looks like, so I may be totally
off base here.  If you did want to implement such a thing, what do you think
it would look like?