You are here

function commerce_avatax_general_settings_form in Drupal Commerce Connector for AvaTax 7.5

Builds the AvaTax general settings form.

1 string reference to 'commerce_avatax_general_settings_form'
commerce_avatax_menu in ./commerce_avatax.module
Implements hook_menu().

File

includes/commerce_avatax.admin.inc, line 241
Administrative callbacks for the Commerce Avatax module.

Code

function commerce_avatax_general_settings_form($form, &$form_state) {
  $form['general'] = array(
    '#title' => t('General settings'),
    '#type' => 'fieldset',
  );
  $form['general'][COMMERCE_AVATAX_VAR_PREFIX . 'product_types'] = array(
    '#title' => t('Product types'),
    '#type' => 'select',
    '#multiple' => TRUE,
    '#options' => commerce_product_type_get_name(),
    '#default_value' => variable_get(COMMERCE_AVATAX_VAR_PREFIX . 'product_types', array()),
    '#description' => t('Select the product types for which you want to customize tax codes that are sent to Avatax, otherwise the generic code P0000000 is going to be used.'),
  );
  $form['general'][COMMERCE_AVATAX_VAR_PREFIX . 'exemptions_status'] = array(
    '#title' => t('Administer Sales Tax Exemptions'),
    '#description' => t('Registered users with the "configure avatax exemptions" permission will be able to specify a tax exemption code.'),
    '#type' => 'checkbox',
    '#default_value' => variable_get(COMMERCE_AVATAX_VAR_PREFIX . 'exemptions_status', 0),
  );
  $form['general'][COMMERCE_AVATAX_VAR_PREFIX . 'tax_calculation_enabled'] = array(
    '#title' => t('Enable tax calculation?'),
    '#description' => t('Uncheck this to disable tax calculation.'),
    '#type' => 'checkbox',
    '#default_value' => variable_get(COMMERCE_AVATAX_VAR_PREFIX . 'tax_calculation_enabled', TRUE),
  );
  $form['general'][COMMERCE_AVATAX_VAR_PREFIX . 'enable_logging'] = array(
    '#title' => t('Enable logging'),
    '#type' => 'checkbox',
    '#description' => t('Enables detailed AvaTax transaction logging.'),
    '#default_value' => variable_get(COMMERCE_AVATAX_VAR_PREFIX . 'enable_logging', FALSE),
  );
  $form['general'][COMMERCE_AVATAX_VAR_PREFIX . 'disable_document_committing'] = array(
    '#title' => t('Disable document committing'),
    '#type' => 'checkbox',
    '#default_value' => variable_get(COMMERCE_AVATAX_VAR_PREFIX . 'disable_document_committing', FALSE),
  );
  $form = system_settings_form($form);
  $form['#submit'][] = 'commerce_avatax_general_settings_form_submit';
  return $form;
}