Choose a year to total completed store sales by state, set dealer and non-tax destinations aside, and calculate the tax owed.
This report totals completed store orders for one calendar year and groups them by the ship-to state. eBay orders are left out. Dealer accounts are counted as dealer non-taxable, and destinations that have no matching store tax rate are counted as state non-taxable. A rate saved for every zone in a country, or for every country, still counts as a match. Taxes Collected is the tax stored on the orders. Taxes Owed is the taxable amount times the most specific matching tax rate. This screen does not change any orders.
oc_order, oc_order_total, and oc_customer, excluding rows present in oc_kb_ebay_orders. Rates come from oc_tax_rate joined to oc_zone_to_geo_zone. Names come from oc_country and oc_zone.mtPrepare() as a date range. Amounts use mtFloat(). A blank ship-to country or state falls back to the payment address. Customer group 2 is dealer non-taxable. Tax rates join oc_tax_rate.geo_zone_id to oc_zone_to_geo_zone.geo_zone_id. A stored zone_id of 0 covers that country, and a stored country_id of 0 covers every country. The most specific rate is used. If the rate query returns nothing, the report still loads and treats every destination as state non-taxable. Taxes owed are rounded to cents once per state. Names and amounts are escaped. Column names are checked against the live tables before the year query runs. The eBay link uses store_order_id, then open_cart_order_id, then order_id. A failed read is logged and the database error is shown on this page.