You are here

function commerce_avatax_order_admin_calculate_tax_form in Drupal Commerce Connector for AvaTax 7.5

Form callback: confirmation form for manually calculating Taxes of an order.

Parameters

$order: The order object to apply the Taxes to.

Return value

The form array to confirm the calculation.

See also

confirm_form()

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

File

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

Code

function commerce_avatax_order_admin_calculate_tax_form($form, &$form_state, $order) {
  $form['order_id'] = array(
    '#type' => 'value',
    '#value' => $order->order_id,
  );

  // Build a description of what the user may expect to occur on submission.
  $items = array(
    t('The AvaTax Service needs a valid postal address.'),
    t('Please note that a SalesOrder transaction is going to be created, the committed SalesInvoice transaction will be created once the order is paid in full.'),
  );
  $form = confirm_form($form, t('Are you sure you want to apply Taxes to order @number?', array(
    '@number' => $order->order_number,
  )), 'admin/commerce/orders/' . $order->order_id . '/edit', '<p>' . theme('item_list', array(
    'items' => $items,
  )) . '</p>', t('Calculate Taxes'), t('Cancel'));
  return $form;
}