Read only
Every query below is a SELECT. It changes nothing. Run it in phpMyAdmin or the mysql client, on a copy of the database if you have one.
WHMCS guide
A missing tax line is easy to miss: the invoice still adds up and the client pays it. The gap shows up when the tax return is due. It usually comes from one of four places, and each can be read from the database in seconds.
DMS.S2 — Before you start
Every query below is a SELECT. It changes nothing. Run it in phpMyAdmin or the mysql client, on a copy of the database if you have one.
If your business does not collect tax, WHMCS is right to add none. The last query returns nothing when there are no tax rules, so it cannot hand you a false list.
We ran each query on a test database with rows that should match and rows that should not: a 2-letter country, an empty country, a hidden product, a free product. Neither of our two live installs charges tax, so queries 2 to 4 return nothing there.
DMS.S3 — The queries
TaxEnabled must read on. Off voids every rule and every Apply Tax box. TaxDomains decides whether domain registrations and renewals are taxed too.
SELECT setting, value
FROM tblconfiguration
WHERE setting IN ('TaxEnabled', 'TaxDomains', 'TaxType');
A 0% rate, a rate above 100% (1700 typed for 17), a rule with no name, or a country saved as a word by an import or the API. WHMCS matches the client's 2-letter country code, so Brazil or United States never matches anyone.
SELECT id, level, name, country, state, taxrate
FROM tbltax
WHERE taxrate <= 0 OR taxrate > 100 OR TRIM(name) = ''
OR (TRIM(country) <> '' AND LOWER(TRIM(country)) <> 'any'
AND TRIM(country) NOT REGEXP '^[A-Za-z]{2}$');
Same level, country and state. WHMCS applies the first one it finds, so the other never fires, and editing it changes nothing.
SELECT level, UPPER(TRIM(country)) AS country, LOWER(TRIM(state)) AS state,
COUNT(*) AS rules, GROUP_CONCAT(id) AS ids
FROM tbltax
GROUP BY level, UPPER(TRIM(country)), LOWER(TRIM(state))
HAVING rules > 1;
Each product and add-on has its own Apply Tax box. A new product copied from an untaxed one keeps it off. Hidden and free items are left out.
SELECT 'product' AS kind, id, name FROM tblproducts
WHERE tax = 0 AND paytype <> 'free' AND hidden = 0 AND retired = 0
AND EXISTS (SELECT 1 FROM tbltax)
UNION ALL
SELECT 'addon', id, name FROM tbladdons
WHERE tax = 0 AND hidden = 0
AND LOWER(REPLACE(REPLACE(billingcycle, '-', ''), ' ', '')) NOT IN ('free', 'freeaccount')
AND EXISTS (SELECT 1 FROM tbltax);
DMS.S4 — The addon
Brasa Pricing Audit runs these tax checks with the rest of its catalog checks, only when your store charges tax, and e-mails admins when a new finding appears. It never changes a setting, a rule or a price.

$39 per year
Finds the price and catalog setups that give away money or block a sale.
DMS.S5 — Questions
Configuration > System Settings > Tax Configuration. Set Tax Support to ON, choose inclusive or exclusive, decide on domains, and add the rules on the Tax Rules tab. Then tick Apply Tax on each paid product and add-on that should carry it.
No. WHMCS works out tax when it creates an invoice. The fix applies to the next invoices, including renewals. Invoices already sent keep their amounts; correct them only with your accountant.
Check that client's profile. A client marked Tax Exempt pays no tax on any invoice, and a client whose country or state does not match any rule falls outside every rule.
DMS.S6 — Start a project
Tell us how the tax was set up. If other hosts would hit it, it may become a check.