function commerce_invoice_new in Commerce Invoice 7
Returns an initialized invoice object.
Parameters
$uid: The uid of the owner of the invoice.
$order_id: The ID of the order the invoice belongs to (if available).
$type: The type of the invoice; defaults to the standard 'invoice' type.
Return value
An invoice object with all default fields initialized.
2 calls to commerce_invoice_new()
- commerce_invoice_rules_generate in ./
commerce_invoice.rules.inc - _commerce_invoice_create in ./
commerce_invoice.module - Creation callback for the Entity module.
File
- ./
commerce_invoice.module, line 135 - Generates the invoice and allows you to display an invoice id in views
Code
function commerce_invoice_new($uid = 0, $order_id = 0, $type = 'commerce_invoice') {
return entity_get_controller('commerce_invoice')
->create(array(
'uid' => $uid,
'order_id' => $order_id,
'type' => $type,
));
}