You are here

function commerce_invoice_ui_invoice_view in Commerce Invoice 7

Generate an array for rendering the given invoice.

Parameters

$invoice: A fully loaded invoice object.

$view_mode: The view mode for displaying the invoice, 'administrator' or 'customer'.

Return value

An array as expected by drupal_render().

1 call to commerce_invoice_ui_invoice_view()
commerce_invoice_ui_invoice_view_by_order in ./commerce_invoice_ui.module
Generate an array for rendering the given invoice, based on an order.
1 string reference to 'commerce_invoice_ui_invoice_view'
commerce_invoice_ui_menu in ./commerce_invoice_ui.module
Implements hook_menu().

File

./commerce_invoice_ui.module, line 105

Code

function commerce_invoice_ui_invoice_view($invoice, $view_mode = 'administrator', $breadcrumb = TRUE) {

  // Set the breadcrumb for the appropriate view mode if specified.
  if ($breadcrumb) {
    commerce_invoice_ui_set_breadcrumb();
  }
  drupal_add_css(drupal_get_path('module', 'commerce_order') . '/theme/commerce_order.css');
  return entity_view('commerce_invoice', array(
    $invoice->invoice_id => $invoice,
  ), $view_mode, NULL, TRUE);
}