Does anyone have any examples of importing Sales Tax data from Ubercart 2 into Drupal Commerce?
The two systems seem to use -very- different schemas (Ubercart uses separate line items and Commerce attaches tax to the product/line item. I looked at the commerce_migrate_ubercart module and it doesn't even try to handle this.
The problem is that we have historical data where rates have changed over time so it's not accurate to simply recalculate based on current rates.
We could live with simply being able to override the tax on the entire order, but I can't find a hook to override that in the commerce_orders table.
Edit: I could use commerce_tax_rate_apply('state_sales_tax', $line_item);
$tax_price = commerce_tax_rate_apply('state_sales_tax', $line_item); // <--- Now what? I don't understand how to apply $tax_price back to the original line item before saving. // Save the line item to get its ID. commerce_line_item_save($line_item);
Or: After saving the line item, how do I hook into the standard Rules for tax calculation? (Which work fine for new orders.)