You are here

function _invoice_extend_node in Invoice 7

Adds additional structure to the specified node

Parameters

object $node:

1 call to _invoice_extend_node()
invoice_form in ./invoice_form.inc
Implements hook_form()

File

./invoice_helpers.inc, line 17
Invoice module

Code

function _invoice_extend_node($node) {
  if (!isset($node->invoice)) {
    $node->invoice = array(
      'invoice_number' => null,
      'formatted_invoice_number' => null,
      'invoice_number_zerofill' => null,
      'invoice_number_prefix' => null,
      'description' => null,
      'vat' => null,
      'pay_status' => null,
      'pay_limit' => null,
      'template' => null,
      'extotal' => null,
      'inctotal' => null,
      'formatted_vattotal' => null,
      'formatted_extotal' => null,
      'formatted_inctotal' => null,
      'formatted_created' => null,
    );
  }
  if (!isset($node->customer)) {
    $node->customer = array(
      'cid' => null,
      'customer_number' => null,
      'name' => null,
      'company_name' => null,
      'firstname' => null,
      'lastname' => null,
      'fullname' => null,
      'street' => null,
      'building_number' => null,
      'zipcode' => null,
      'city' => null,
      'state' => null,
      'country' => null,
      'coc_number' => null,
      'vat_number' => null,
      'description' => null,
    );
  }
  if (!isset($node->invoice_items)) {
    $node->invoice_items = array();
  }
}