uc_payment_pack_receive_check_form

  1. drupal
    1. 6 uc_payment_pack.admin.inc function
    2. 7 uc_payment_pack.admin.inc function
Drupal 7 uc_payment_pack_receive_check_form($form, &$form_state, $order)

Receives a check for an order and put in a clear date.

See also

uc_payment_pack_receive_check_form_submit()

Related topics

1 string reference to 'uc_payment_pack_receive_check_form'

File

sites/all/modules/ubercart/payment/uc_payment_pack/uc_payment_pack.admin.inc, line 14
Payment pack administration menu items.

Code

function uc_payment_pack_receive_check_form($form, &$form_state, $order) {
  $balance = uc_payment_balance($order);
  $form['balance'] = array(
    '#prefix' => '<strong>' . t('Order balance:') . '</strong> ', 
    '#markup' => uc_currency_format($balance),
  );
  $form['order_id'] = array(
    '#type' => 'hidden', 
    '#value' => $order->order_id,
  );
  $form['amount'] = array(
    '#type' => 'uc_price', 
    '#title' => t('Amount'), 
    '#default_value' => $balance,
  );
  $form['comment'] = array(
    '#type' => 'textfield', 
    '#title' => t('Comment'), 
    '#description' => t('Any notes about the check, like type or check number.'), 
    '#size' => 64, 
    '#maxlength' => 256,
  );
  $form['clear'] = array(
    '#type' => 'fieldset', 
    '#title' => t('Expected clear date'), 
    '#attributes' => array('class' => array('uc-inline-form', 'clearfix')),
  );
  $form['clear']['clear_month'] = uc_select_month(NULL, format_date(REQUEST_TIME, 'custom', 'n'));
  $form['clear']['clear_day'] = uc_select_day(NULL, format_date(REQUEST_TIME, 'custom', 'j'));
  $form['clear']['clear_year'] = uc_select_year(NULL, format_date(REQUEST_TIME, 'custom', 'Y'), format_date(REQUEST_TIME, 'custom', 'Y'), format_date(REQUEST_TIME, 'custom', 'Y') + 1);

  $form['actions'] = array('#type' => 'actions');
  $form['actions']['submit'] = array(
    '#type' => 'submit', 
    '#value' => t('Receive check'),
  );

  return $form;
}