You are here

function uc_taxes_copy in Ubercart 5

Copy a tax rule.

1 string reference to 'uc_taxes_copy'
uc_taxes_menu in uc_taxes/uc_taxes.module
Implementation of hook_menu().

File

uc_taxes/uc_taxes.module, line 287

Code

function uc_taxes_copy($tax_id) {
  $rule = db_fetch_array(db_query("SELECT * FROM {uc_taxes} WHERE id = %d", $tax_id));
  db_query("INSERT INTO {uc_taxes} (id, name, rate, taxed_product_types, taxed_line_items, weight, shippable) VALUES (%d, '%s', %f, '%s', '%s', %d, %d)", db_next_id('{uc_taxes}_id'), t('Copy of @rule', array(
    '%rule' => $rule['name'],
  )), $rule['rate'], $rule['taxed_product_types'], $rule['taxed_line_items'], $rule['weight'], $rule['shippable']);
  drupal_goto('admin/store/settings/taxes');
}