(a) Except as provided by Subsection (b), a foreign taxable entity holding a registration or certificate of authority to do business in this state may withdraw from doing business in this state by filing a certificate of withdrawal with the secretary of state. The secretary of state shall file the certificate of withdrawal as provided by law.
(b) The foreign taxable entity may not withdraw from doing business in this state unless it has paid, before filing the certificate of withdrawal, any tax or penalty imposed by this chapter on the taxable entity.