[ic] how to calculate item-subtotal by the item price *and* packingunit

Kevin Walsh interchange-users@icdevgroup.org
Fri Aug 16 11:45:01 2002


> >
> > You could also modify your UserTag for use with the [assign] tag,
> > to override the value returned by [subtotal].  Your tag could do what
> > it does now, and then return a subtotal for assignment, or do the
> > assignment itself.
> >
> Or use
> 
> $Vend::Session->{assigned}{subtotal} = $mynewsubtotal;
> 
Well. you could do that but, for the reason Racke pointed out,
it would be better to use $Tag->assign() if you wanted to assign
a new subtotal.

> 
> You mean
> 
> CommonAdjust  [my-usertag-for-the-new-item-subtotal]
>
That sort of thing, yes.

> 
> ? Would that not change the price ([item-price]) only? For example, 
> would that not displays
> 
> sku  description    Qt.(Unit)  price   unit   item total
> 1234 soap           1          36.00 $  72     36.00 $
> 
> instead of
> 
> sku  description    Qt.(Unit)  price   unit   item total
> 1234 soap           1          0.50 $  72     36.00 $
> 
That would depend upon the tags you use to display that table.
I would use the CommonAdjust UserTag to set up the subtotal and
then use something like [item-field price] to show the unit price.

Of course, that wouldn't take any qty discounts into account, but
you could have another UserTag, using similar code, to take care
of that.

-- 
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin@cursor.biz
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/