Is this correct?
$shipping_price = $line_item_wrapper->commerce_unit_price->value();
$shipping_tax = commerce_tax_total_amount($shipping_price['data']['components'], FALSE, $currency_code);
// Track the total costs of all shipping line items on an order, though
// typically this should be limited to one shipping line item per order.
$shippingamt += $shipping_price['amount'] - $shipping_tax;
The second parameter of
commerce_tax_total_amount determines whether it returns a total of taxes that is (
TRUE) or is not (
FALSE) included in the base price. Thus, the value of
$shipping_tax would be the amount of tax not included in the base price. So, if it's not included in the base price, why is it being subtracted from it?