[ic] CommonAdjust

Mike Heins mikeh@minivend.com
Sat, 14 Apr 2001 21:05:36 -0400


Quoting Jim Balcom (jim@idk-enterprises.com):
> 
> JC>>pricing table:
> JC>>sku	q12	q15	q16	q18	q20	q24	q48	q72	q75	q80	q96
> JC>>AP-S				0.75				0.50
> JC>>AP-M						1.25					1
> 
> This is absolutely fantastic!
> 
> Once I get my income taxes done, I'll try implementing this. It looks
> easy when you present it this way!
> 
> JC>>PriceField	nonexistant_field
> JC>>CommonAdjust   pricing:q12,q15,q16,q18,q20,q48,q72,q75,q80,q96: ;:price
> 
> This one may confoozle me a bit until I play around.
> 
> JC>>but there must be a better way if you can't predict what the breaks will be.
> 
> I can predict what they will be. But, it's just that every manufacturer
> seems to set their own quantities per bag and bags per case. But, I can
> set them up.
> 

A little known fact about CommonAdjust is that you don't have to have
them all be one, you can maintain multiple ones. Say you have as your
default:

    PriceField   common_adjust
    CommonAdjust  pricing:q12,q24,q48,q96: ;:price

    pricing.txt:
    sku	q12	q24	q48	q96
    AP-S		0.75	0.50

    products.txt slice:
    sku	price	common_adjust
    AP-S	1.00	

If item AP-S has nothing in the field common_adjust, it uses the above.
If another item needs different and custom breaks:

    # Same as above, repeated
    PriceField   common_adjust
    CommonAdjust  pricing:q12,q24,q48,q96: ;:price

    price_special.txt:
    sku	q18	q36	q72
    OR-S	0.90	0.75	0.50

    products.txt slice:
    sku	price	common_adjust
    OR-S	1.00	price_special:q18,q36,q72 ;:price

Now OR-S uses the CommonAdjust string from the database and ignores
the default one.

-- 
Red Hat, Inc., 131 Willow Lane, Floor 2, Oxford, OH  45056
phone +1.513.523.7621 fax 7501 <mheins@redhat.com>

For a successful technology, reality must take precedence over public
relations, for Nature cannot be fooled. -- Dick Feynman