You are here

commerce_avatax_ui.admin.inc in Drupal Commerce Connector for AvaTax 7.3

Same filename and directory in other branches
  1. 7.4 includes/commerce_avatax_ui.admin.inc

Admin settings for commerce_avatax.

Copyright (C) Alexander Bischoff, adTumbler.com

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

File

includes/commerce_avatax_ui.admin.inc
View source
<?php

/**
 * @file
 * Admin settings for commerce_avatax.
 *
 * Copyright (C) Alexander Bischoff, adTumbler.com
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 */

/**
 * Admin settings menu callback.
 */
function commerce_avatax_ui_admin_settings() {
  $form = array();

  // Set AvaTax license details.
  $form['commerce_avatax_product_version'] = array(
    '#title' => t('Select AvaTax Version'),
    '#description' => t('Select AvaTax Calc Basic or AvaTax Calc Pro according to your AvaTax Acount License'),
    '#type' => 'select',
    '#options' => array(
      'basic' => t('AvaTax Calc Basic'),
      'pro' => t('AvaTax Calc Pro'),
    ),
    '#default_value' => variable_get('commerce_avatax_product_version', 'basic'),
  );

  // Configure mode for AvaTax Pro.
  $form['commerce_avatax_pro_mode'] = array(
    '#title' => t('Select Mode for AvaTax Pro'),
    '#description' => t('Only select a live mode if you have first configured Drupal Commerce and the AvaTax PRO include file'),
    '#type' => 'select',
    '#options' => array(
      'not_set' => t('Not Set'),
      'compute' => t('Compute'),
      'item_code' => t('Item Code'),
      'tax_code' => t('Tax Code'),
      'taxonomy_tax_code' => t('Taxonomy Tax Code'),
    ),
    '#default_value' => variable_get('commerce_avatax_pro_mode', 'not_set'),
  );
  $form['commerce_avatax_company_code'] = array(
    '#title' => t('Company Code'),
    '#description' => t('Enter the Company Code found under Organization in your AvaTax Dashboard'),
    '#type' => 'textfield',
    '#default_value' => variable_get('commerce_avatax_company_code', ''),
  );
  $form['commerce_avatax_use_mode'] = array(
    '#title' => t('Select Development or Production'),
    '#description' => t('Select Development - Only select Production if you have completed the GO LIVE process with Avalara'),
    '#type' => 'select',
    '#options' => array(
      'Development' => t('Development'),
      'Production' => t('Production'),
    ),
    '#default_value' => variable_get('commerce_avatax_use_mode', 'Development'),
  );

  // Limit the list of states to use AvaTax for sales tax calculations.
  $form['commerce_avatax_select_states'] = array(
    '#title' => t('Limit AvaTax Calc to selected states'),
    '#description' => t('Enter list of states - e.g. CA, NY, WA - Leave blank for all states'),
    '#type' => 'textfield',
    '#default_value' => variable_get('commerce_avatax_select_states', ''),
  );

  // Set Shipping Tax code to be used by Avatax.
  $form['commerce_avatax_shipcode'] = array(
    '#title' => t('Shipping Tax Code'),
    '#description' => t('The Sales Tax code to be used for Shipping'),
    '#type' => 'textfield',
    '#default_value' => variable_get('commerce_avatax_shipcode', 'FR020100'),
  );

  // Configure sales tax description to be shown to users.
  $form['commerce_avatax_tax_description'] = array(
    '#title' => t('Sales Tax Description'),
    '#description' => t('The Sales Tax description to be displayed on the order check out form'),
    '#type' => 'textfield',
    '#default_value' => variable_get('commerce_avatax_tax_description', 'Sales Tax'),
  );

  // Configure address to use for sales tax.
  $form['commerce_avatax_tax_address'] = array(
    '#title' => t('Select Destination Address to use for Sales Tax'),
    '#description' => t('Only select Shipping if you have installed the Drupal Commerce Shipping Module'),
    '#type' => 'select',
    '#options' => array(
      'Billing' => t('Billing'),
      'Shipping' => t('Shipping'),
    ),
    '#default_value' => variable_get('commerce_avatax_tax_address', 'Billing'),
  );

  // Set Sales Tax automatic commits.
  $form['commerce_avatax_erp_status'] = array(
    '#title' => t('Automatic updates to AvaTax doc status'),
    '#description' => t('Select "Yes" to enable automatic updates to AvaTax doc status'),
    '#type' => 'radios',
    '#options' => array(
      '0' => t('No'),
      '1' => t('Yes'),
    ),
    '#default_value' => variable_get('commerce_avatax_erp_status', '0'),
  );

  // Set Street, City, State and Zip for Primary Business Office Location.
  $form['commerce_avatax_primary_street1'] = array(
    '#title' => t('Primary Business Street 1'),
    '#description' => t('The Primary Street 1 your business is located in'),
    '#type' => 'textfield',
    '#default_value' => variable_get('commerce_avatax_primary_street1', ''),
  );
  $form['commerce_avatax_primary_street2'] = array(
    '#title' => t('Primary Business Street 2'),
    '#description' => t('The Primary Street 2 your business is located in'),
    '#type' => 'textfield',
    '#default_value' => variable_get('commerce_avatax_primary_street2', ''),
  );
  $form['commerce_avatax_primary_city'] = array(
    '#title' => t('Primary Business City'),
    '#description' => t('The primary City your business is located in'),
    '#type' => 'textfield',
    '#default_value' => variable_get('commerce_avatax_primary_city', ''),
  );
  $form['commerce_avatax_primary_state'] = array(
    '#title' => t('Primary Business State'),
    '#description' => t('The primary State your business is located in. NB - Must be a Valid 2 character code'),
    '#type' => 'textfield',
    '#default_value' => variable_get('commerce_avatax_primary_state', ''),
  );
  $form['commerce_avatax_primary_zip'] = array(
    '#title' => t('Primary Business Zip'),
    '#description' => t('The primary Zip code your business is located in. NB - Must be a Valid 5 digit zip'),
    '#type' => 'textfield',
    '#default_value' => variable_get('commerce_avatax_primary_zip', ''),
  );

  // Sales Tax Exemption management.
  $form['commerce_avatax_exemptions'] = array(
    '#title' => t('Use AvaTax Calc for Sales Tax Exemptions'),
    '#description' => t('Leave as Yes - Future provision for a sales tax exemption management module'),
    '#type' => 'radios',
    '#options' => array(
      '0' => t('No'),
      '1' => t('Yes'),
    ),
    '#default_value' => variable_get('commerce_avatax_exemptions', '1'),
  );
  return system_settings_form($form);
}

Functions

Namesort descending Description
commerce_avatax_ui_admin_settings Admin settings menu callback.