We ship many small internet orders via US Mail. We've been setting up all kinds of software to simplify the process & now my brain is fried!
All orders over 20 lbs will go UPS - e-ship takes care of that.
I have created a chart of all zip codes in US and what their postage will be by pound. This table will be 50010 USPS Rate table.
See chart here
http://savatage99.googlepages.com/ZIPCO ... CHART1.xls
The goal is On Release of the order to show what the Mail rate will be.
So I need to get the Ship-To Zip Code (no prob) and calculate the order weight (rounded up). Now with these two fields I should be able to get the price from the new USPS rate table.
The rate table has a min & max zip per zone & weight. I need to setrange or filter - and would like some suggestions on the best way to accomplish this task.
TotalOrderWeight := ROUND(SalesHeader."Total Order Weight", 1, '>');
USPSRATETABLE.GET(SalesHeader."Ship-to ZIP Code",SalesHeader."Ship-To Zip Code", TotalOrderWeight);
If TotalOrderWeight < 21
THEN
SETFILTER(USPSRateTable.ToMinZipCode,'>=%1',SalesHeader."Ship-To Zip CODE") ;
SETFILTER(USPSRateTable.ToMaxZipCode,'<=%1',SalesHeader."Ship-To Zip Code");
SETFILTER(USPSRateTable.Weight,'=%1',TotalOrderWeight);
SalesHeader.USPSOrderPostage := USPSRateTabel.Price
ELSE
SalesHeader.USPSOrderPostage := 0;
Am I in the ballpark here? or does somone know of a better way?
Answers
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
A little tweaking and the final code used
http://www.BiloBeauty.com
http://www.autismspeaks.org
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!