[ic] UPS Additional shipping calculation

Mike Heins interchange-users@lists.akopia.com
Tue May 8 19:03:01 2001


Quoting Kestutis Lasys (kestutis.lasys@delfi.lt):
> > > Additional shipping calculation:
> > > x = x + (x * .85)
> > > x = x + ( x * .85 )
> > > x=x+(x*.85)
> > > x = x  * 1.85
> > > and so on......
> > > 
> > > Nothing seems to change this caculation
> > > 
> > > Any ideas? Is it a bug - according to the docs this is how it is done - just
> > > won't work for me.
> > 
> > Bug in the docs. For the internal UPS calculation, all you can do
> > is add some fixed number.
> > 
> > If you use the external lookup, you could do "* .85" and it should
> > work.
> 
> I am just interesting how it should work?
> 
> That is still written in the user interface help:
> ------------------
> "You can enter any valid mathematical expression 
> and you can reuse the "x" variable as many times 
> as you need to ..."  
> ... 
> "even a UPS weight based calculation"
> ...
> "It is important to note that you must specify some 
> sort of equality on the left hand side of the equation."

The "x" thing works, but is really, really deprecated. It should
come out of the docs.

> ------------------
> 
> Mike wrote: 
> "For the internal UPS calculation, all you can do is add some fixed
> number".
> 
> In program: Interpolate.pm
> -------------------------------------------------
>                         return '' if $final == 0;
>                         $o->{adder} =~ s/\bx\b/$final/g;
>                         $o->{adder} =~ s/\@\@TOTAL\@\\?\@/$final/g;
>                         $o->{adder} = $ready_safe->reval($o->{adder});
>                         $final += $o->{adder} if $o->{adder};
>                         $final = POSIX::ceil($final) if
> is_yes($o->{round});
> --------------------------------------------------
> i.e. you can use any valid mathematical expression, 
> but without left hand side of the equation.

Since I don't know what you are trying to add, it is pretty hard to
come up with a formula. You have found the code that matters; the
thing you need to do is come up with a formula.

My guess from what you have is:

	@@TOTAL@@ * .85

for the adder.

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

Fast, reliable, cheap.  Pick two and we'll talk.  -- unknown