Definition

invoice_form($invoice_id, $module)
ecommerce-5--4/invoice/invoice.module, line 192

Description

Create an invoice form

Parameters

$invoice_id Number, the invoice ID

$module

Related topics

Namesort iconDescription
Form generationFunctions to enable the processing and display of HTML forms.

Code

<?php
function invoice_form($invoice_id, $module) {
  $invoice = invoice_get($invoice_id);
  $form = invoice_invoke($module, $invoice, 'form');
  $default_controls = array(
    'module' => array(
      '#type' => 'value',
      '#value' => $module,
    ),
    'invoice_id' => array(
      '#type' => 'value',
      '#value' => $invoice_id
    ),
    'invoice' => array(
      '#type' => 'value',
      '#value' => $invoice
    ),
    'submit' => array(
      'next' => array(
        '#type' => 'submit',
        '#value' => isset($_REQUEST['destination']) && $_REQUEST['destination'] == 'checkout/review' ? t('Review Order') : (isset($_REQUEST['op']) ? t('Update') : t('Next')),
      ),
    ),
  );
  $form += $default_controls;
  return $form;
}
?>