You are here

function commerce_invoice_default_commerce_invoice_number_pattern in Commerce Invoice 7.2

Implements hook_default_commerce_invoice_number_pattern().

File

./commerce_invoice.module, line 166
The Commerce Invoice module.

Code

function commerce_invoice_default_commerce_invoice_number_pattern() {
  $entity_type = 'commerce_invoice_number_pattern';
  $patterns = [];
  $patterns['consecutive'] = entity_create($entity_type, [
    'name' => 'consecutive',
    'label' => 'Consecutive',
    'pattern' => InvoiceNumber::SEQUENCE_TOKEN,
  ]);
  $patterns['daily'] = entity_create($entity_type, [
    'name' => 'daily',
    'label' => 'Daily',
    'pattern' => '[date:custom:Y]-[date:custom:m]-[date:custom:d]',
  ]);
  $patterns['monthly'] = entity_create($entity_type, [
    'name' => 'monthly',
    'label' => 'Monthly',
    'pattern' => '[date:custom:Y]-[date:custom:m]',
  ]);
  $patterns['yearly'] = entity_create($entity_type, [
    'name' => 'yearly',
    'label' => 'Yearly',
    'pattern' => '[date:custom:Y]',
  ]);
  return $patterns;
}