Taxes are collected separately from colonists and natives.

Taxes_collected =
   Taxes_from_colonists + Taxes_from_natives
   ...at most MaxPlanetaryIncome

Taxes_from_colonists =
   Round(Round(Colonist_clans * Colonist_tax / 1000) * ColonistTaxRate / 100)
                    ...if Colonist_happiness ≥ 30
   0                ...if Colonist_happiness < 30

Taxes_from_natives =
   0                ...if Native_happiness < 30
   0                ...if natives are Amorphous
   Round(Min(Colonist_clans, Natives_due) * IF * NativeTaxRate / 100)
   ...where Natives_due = Round(Native_clans * Native_gov_number * Native_tax / 5000)
   ...where IF = 2 if natives are insectoid, IF = 1 otherwise

The Native_gov_number is tabulated in the Planet Rules section (e.g. 6 for Monarchy).