View source
<?php
function commerce_reports_stock_views_default_views() {
$views = array();
$view = new view();
$view->name = 'commerce_reports_stock';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'commerce_product';
$view->human_name = 'Commerce Reports: Stock';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE;
$handler = $view
->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'Commerce Reports: Stock';
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['access']['type'] = 'perm';
$handler->display->display_options['access']['perm'] = 'access commerce reports';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'none';
$handler->display->display_options['style_plugin'] = 'table';
$handler->display->display_options['fields']['title']['id'] = 'title';
$handler->display->display_options['fields']['title']['table'] = 'commerce_product';
$handler->display->display_options['fields']['title']['field'] = 'title';
$handler->display->display_options['fields']['title']['link_to_product'] = 0;
$handler->display->display_options['fields']['sku']['id'] = 'sku';
$handler->display->display_options['fields']['sku']['table'] = 'commerce_product';
$handler->display->display_options['fields']['sku']['field'] = 'sku';
$handler->display->display_options['fields']['sku']['link_to_product'] = 0;
$handler->display->display_options['fields']['commerce_stock']['id'] = 'commerce_stock';
$handler->display->display_options['fields']['commerce_stock']['table'] = 'field_data_commerce_stock';
$handler->display->display_options['fields']['commerce_stock']['field'] = 'commerce_stock';
$handler->display->display_options['fields']['commerce_stock']['settings'] = array(
'thousand_separator' => '',
'decimal_separator' => '.',
'scale' => '0',
'prefix_suffix' => 0,
);
$handler->display->display_options['fields']['monthlysales']['id'] = 'monthlysales';
$handler->display->display_options['fields']['monthlysales']['table'] = 'commerce_product';
$handler->display->display_options['fields']['monthlysales']['field'] = 'monthlysales';
$handler->display->display_options['fields']['weeklysales']['id'] = 'weeklysales';
$handler->display->display_options['fields']['weeklysales']['table'] = 'commerce_product';
$handler->display->display_options['fields']['weeklysales']['field'] = 'weeklysales';
$handler->display->display_options['fields']['stocklifetime']['id'] = 'stocklifetime';
$handler->display->display_options['fields']['stocklifetime']['table'] = 'commerce_product';
$handler->display->display_options['fields']['stocklifetime']['field'] = 'stocklifetime';
$handler->display->display_options['sorts']['stocklifetime']['id'] = 'stocklifetime';
$handler->display->display_options['sorts']['stocklifetime']['table'] = 'commerce_product';
$handler->display->display_options['sorts']['stocklifetime']['field'] = 'stocklifetime';
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'commerce_product';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = '1';
$handler->display->display_options['filters']['type']['id'] = 'type';
$handler->display->display_options['filters']['type']['table'] = 'commerce_product';
$handler->display->display_options['filters']['type']['field'] = 'type';
$handler->display->display_options['filters']['type']['exposed'] = TRUE;
$handler->display->display_options['filters']['type']['expose']['operator_id'] = 'type_op';
$handler->display->display_options['filters']['type']['expose']['label'] = 'Type';
$handler->display->display_options['filters']['type']['expose']['operator'] = 'type_op';
$handler->display->display_options['filters']['type']['expose']['identifier'] = 'type';
$handler->display->display_options['filters']['type']['expose']['remember'] = TRUE;
$handler->display->display_options['filters']['type']['expose']['multiple'] = TRUE;
$handler->display->display_options['filters']['type']['expose']['remember_roles'] = array(
2 => '2',
1 => 0,
3 => 0,
4 => 0,
5 => 0,
6 => 0,
);
$handler = $view
->new_display('page', 'Page', 'page');
$handler->display->display_options['path'] = 'admin/commerce/reports/stock';
$handler->display->display_options['menu']['type'] = 'tab';
$handler->display->display_options['menu']['title'] = 'Stock';
$handler->display->display_options['menu']['description'] = 'View stock weekly and monthly sales, and projected inventory lifetime.';
$handler->display->display_options['menu']['weight'] = '0';
$handler->display->display_options['menu']['context'] = 0;
$handler->display->display_options['menu']['context_only_inline'] = 0;
$translatables['commerce_reports_stock'] = array(
t('Master'),
t('Commerce Reports: Stock'),
t('more'),
t('Apply'),
t('Reset'),
t('Sort by'),
t('Asc'),
t('Desc'),
t('Title'),
t('SKU'),
t('Stock'),
t('Monthly sales'),
t('Weekly sales'),
t('Stock lifetime'),
t('Type'),
t('Page'),
);
$views['commerce_reports_stock'] = $view;
return $views;
}