You are here

function uc_taxes_rate_delete in Ubercart 7.3

Same name and namespace in other branches
  1. 6.2 uc_taxes/uc_taxes.module \uc_taxes_rate_delete()

Deletes a tax rate from the database.

Parameters

$rate_id: The ID of the tax rate to delete.

1 call to uc_taxes_rate_delete()
uc_taxes_delete_form_submit in uc_taxes/uc_taxes.admin.inc
Form submission handler for uc_taxes_delete_form().

File

uc_taxes/uc_taxes.module, line 498
Ubercart Taxes module.

Code

function uc_taxes_rate_delete($rate_id) {

  // Delete the tax rate record.
  db_delete('uc_taxes')
    ->condition('id', $rate_id)
    ->execute();
  db_delete('uc_taxed_product_types')
    ->condition('tax_id', $rate_id)
    ->execute();
  db_delete('uc_taxed_line_items')
    ->condition('tax_id', $rate_id)
    ->execute();

  // Delete the associated conditions if they have been saved to the database.
  rules_config_delete(array(
    'uc_taxes_' . $rate_id,
  ));
}