New version of usps.php
Edited by Kevin L. Shelton
--Corrected Insurance module by Michael May to calculate correct insurance amounts as that math was slightly off and didn't account for the fact that osCommerce might consider an order to be split among multiple packages.
--Added configuration option to turn insurance calculations on or off.
--Added configuration option to insure including full order total with taxes or insure just for merchandise value.
--Added calculations for international insurance.
--Corrected rounding on ounces calculation since weight is always rounded up.
If you use this module you will need to deactivate the original osCommerce USPS module in the shipping module configuration before installing this module. Then reactivate USPS after replacing the original usps.php file with this one. This is required due to the addition of several configuration variables that are set when the module is activated.
Please note that the maximum allowed insurance for some countries varies depending on the type of mail service being used. The maximum insurance amounts used in this module for each country are the largest values allowed for that country, regardless of service type. If, for example, insurance is allowed for air mail but not for surface mail then the amount used was the maximum insurance allowed for air mail. This unavoidably means that for some countries the shipping costs for certain mail services could be incorrect if the package cost exceeds the maximum allowed for one type of mail service but not another.
Of course once osCommerce considers an order to be split among multiple packages, based on the maximum package weight configuration you set, the shipping total is probably going to be off anyway. After all osCommerce considers all packages in an order as weighing the same amount which is normally not the case. Likewise my insurance calculations considers the value to be divided equally among all packages which is also usually not the case.