You are here

function uc_payment_pack_receive_check_form in Ubercart 7.3

Same name and namespace in other branches
  1. 5 payment/uc_payment_pack/uc_payment_pack.module \uc_payment_pack_receive_check_form()
  2. 6.2 payment/uc_payment_pack/uc_payment_pack.admin.inc \uc_payment_pack_receive_check_form()

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

See also

uc_payment_pack_receive_check_form_submit()

1 string reference to 'uc_payment_pack_receive_check_form'
uc_payment_pack_menu in payment/uc_payment_pack/uc_payment_pack.module
Implements hook_menu().

File

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;
}