[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: Minivend Shipping Quirks (or why this doesn't work in Canada)
Quoting Ryan Hertz (rhertz@gyb.baits.com):
> At 02:35 PM 6/24/99 , Ryan Hertz wrote:
> >
> >At 07:14 AM 6/24/99 , Steve Cockwell wrote:
> >>
> >>Okay, here is what I found:
> >>
> >>1. As you probably all already know, minivend rounds shipping weights
> >>up to the next integer. This is fine in the U.S. where a pound is a
> >>pound, but in Canada where a Kilogram is 2.2 lbs this makes for really
> >>heavy CDs :-) We need a way to specify the decimal place to round on.
> >>For some shipping methods it would be convenient to have 0.1kg
> >>boundaries, for others, 0.5 and so on. Maybe there is already a way to
> >>do this that's not in the docs?
>
> Steve, I just thought of something that might solve your problem. You
> could multiply all your weights by 10 and do likewise to your lookup - that
> way you would not miss the trailing decimal.
MiniVend most certainly does NOT round weights up in the general case. All
shipping.asc min/max comparisons are numeric and not integer. In the
specific case of UPS-style lookup, it does round up any fractional as
UPS does.
I think all of that is reasonable considering that even-weight boundaries
are the only ones in most shipping tables. Imagine maintaining a database
with shipping entries for every one-hundredth kilogram. And rounding to
boundaries like 2.2 is NOT reasonable. If anyone wants to do that they
will have to write the code, and I certainly wish them luck writing
a general-purpose configurable version. Let me know when that code is
done, tested, and documented in less than ten pages and I will put it
in MiniVend. 8-)
If you are using KG and have lookup entries like 2.20, then it sounds
like you need to switch to pounds. And if you want to make KG into pounds
in your entries, it isn't too hard:
Variable KG_TO_POUNDS <<EOF
[calc]
# trailing zero intended
my $kg = [item-list] q{[item-field weight]} + [/item-list] 0;
return $kg / 2.2046;
[/calc]
EOF
cups Canada UPS __KG_TO_POUNDS__ 0 150 C CanGround [default zip K2V4G5] 3.00
The cases I have specifically seen almost always are Americanized
versions of tables. Just put your weights to KG and change the entries
for 2.2 to 1, and all should be golden. In any case, it is just math.
A simple spreadsheet formula on any set of tables should be able to
convert a to a series of "pseudo-weights" which will work with rounding.
If you do that and a conversion similar to the above you should even
be able to keep your product database weights in whatever measurement
system your admin people find reasonable.
--
Mike Heins http://www.minivend.com/ ___
Internet Robotics |_ _|____
Be patient. God isn't 131 Willow Lane, Floor 2 | || _ \
finished with me yet. Oxford, OH 45056 | || |_) |
-- unknown <mikeh@minivend.com> |___| _ <
513.523.7621 FAX 7501 |_| \_\