Sales Tax Report

Choose a year to total completed store sales by state, set dealer and non-tax destinations aside, and calculate the tax owed.

Script Overview

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.

Operator Workflow
Step 1
Open the Report
  • Open Sales Tax Report from the Financial section.
  • The full navigation bar stays available.
Step 2
Choose the Year
  • Pick a year from the list. The report loads as soon as you choose one.
  • The list runs from 2020 through the current year. No date has to be typed.
Step 3
Read Each State
  • Each row is one ship-to country and state.
  • Dealer Non-Taxable and State Non-Taxable are already removed from Taxable.
Step 4
Use the Total Row
  • The dark Total row adds every state.
  • Use Taxes Owed for the filing. Taxes Collected is what the orders already charged.
Step 5
Close or Continue
  • Choose another year to reload the report.
  • Close this window if the Financial menu opened it.
Technical Reference & Safeguards
  • Data Read: Three set-based queries. Completed orders and their total lines come from 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.
  • Database Writes: None. This report does not insert, update, or delete store records.
  • Safeguards & Notifications: The year is limited to 2020 through the current year and bound with 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.