<?php
global $runnerTableSettings;
$runnerTableSettings['InventoryCountDetail'] = array(
	'name' => 'InventoryCountDetail',
	'type' => 1,
	'shortName' => 'InventoryCountDetail',
	'pagesByType' => array(
		'export' => array( 
			'export' 
		),
		'import' => array( 
			'import' 
		),
		'edit' => array( 
			'edit' 
		),
		'view' => array( 
			'view' 
		),
		'list' => array( 
			'list' 
		),
		'print' => array( 
			'print' 
		),
		'search' => array( 
			'search' 
		) 
	),
	'pageTypes' => array(
		'export' => 'export',
		'import' => 'import',
		'edit' => 'edit',
		'view' => 'view',
		'list' => 'list',
		'print' => 'print',
		'search' => 'search' 
	),
	'defaultPages' => array(
		'export' => 'export',
		'import' => 'import',
		'edit' => 'edit',
		'view' => 'view',
		'list' => 'list',
		'print' => 'print',
		'search' => 'search' 
	),
	'afterEditDetails' => 'InventoryCountDetail',
	'afterAddDetail' => 'InventoryCountDetail',
	'detailsBadgeColor' => 'e07878',
	'sql' => 'SELECT
	icd.id,
	icd.description,
	icd.quantity,
	icd.batch_id,
	icd.createdAt,
	icd.updatedAt,
	icd.item_id,
	icd.rack_id,
	icd.inventory_count_id,
	i.name AS item_name,
	r.`zone` AS rack_zone
FROM
	inventorycountdetail AS icd
	LEFT OUTER JOIN item AS i ON i.id = icd.inventory_count_id
	LEFT OUTER JOIN rack AS r ON r.id = icd.rack_id
',
	'keyFields' => array( 
		'id' 
	),
	'deviceHideFields' => array(
		'1' => array( 
			 
		),
		'5' => array( 
			 
		) 
	),
	'fields' => array(
		'id' => array(
			'name' => 'id',
			'goodName' => 'id',
			'strField' => 'id',
			'index' => 1,
			'type' => 3,
			'autoinc' => true,
			'sqlExpression' => 'icd.id',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					 
				) 
			),
			'tableName' => 'inventorycountdetail' 
		),
		'description' => array(
			'name' => 'description',
			'goodName' => 'description',
			'strField' => 'description',
			'index' => 2,
			'sqlExpression' => 'icd.description',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					'format' => 'Readonly' 
				) 
			),
			'tableName' => 'inventorycountdetail' 
		),
		'quantity' => array(
			'name' => 'quantity',
			'goodName' => 'quantity',
			'strField' => 'quantity',
			'index' => 3,
			'type' => 3,
			'sqlExpression' => 'icd.quantity',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					'validateAs' => 'Number',
					'textHTML5Input' => 'Number' 
				) 
			),
			'tableName' => 'inventorycountdetail' 
		),
		'batch_id' => array(
			'name' => 'batch_id',
			'goodName' => 'batch_id',
			'strField' => 'batch_id',
			'index' => 4,
			'type' => 3,
			'sqlExpression' => 'icd.batch_id',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					'format' => 'Lookup wizard',
					'lookupType' => 2,
					'lookupTable' => 'vw_inventory_count_batch_lookup',
					'lookupTableConnection' => 'conn',
					'lookupLinkField' => 'batch_id',
					'lookupDisplayField' => 'batch_display',
					'lookupAutofillFields' => array( 
						array(
							'masterField' => 'item_id',
							'lookupField' => 'item_id' 
						),
						array(
							'masterField' => 'description',
							'lookupField' => 'description' 
						),
						array(
							'masterField' => 'rack_id',
							'lookupField' => 'rack_id' 
						) 
					) 
				) 
			),
			'tableName' => 'inventorycountdetail' 
		),
		'createdAt' => array(
			'name' => 'createdAt',
			'goodName' => 'createdAt',
			'strField' => 'createdAt',
			'index' => 5,
			'type' => 135,
			'sqlExpression' => 'icd.createdAt',
			'viewFormats' => array(
				'view' => array(
					'format' => 'Short Date' 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					'format' => 'Date',
					'dateEditType' => 11 
				) 
			),
			'tableName' => 'inventorycountdetail' 
		),
		'updatedAt' => array(
			'name' => 'updatedAt',
			'goodName' => 'updatedAt',
			'strField' => 'updatedAt',
			'index' => 6,
			'type' => 135,
			'sqlExpression' => 'icd.updatedAt',
			'viewFormats' => array(
				'view' => array(
					'format' => 'Short Date' 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					'format' => 'Date',
					'dateEditType' => 11 
				) 
			),
			'tableName' => 'inventorycountdetail' 
		),
		'item_id' => array(
			'name' => 'item_id',
			'goodName' => 'item_id',
			'strField' => 'item_id',
			'index' => 7,
			'type' => 3,
			'sqlExpression' => 'icd.item_id',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					'format' => 'Lookup wizard',
					'lookupType' => 2,
					'lookupTable' => 'item',
					'lookupTableConnection' => 'conn',
					'lookupLinkField' => 'id',
					'lookupDisplayField' => 'reference_number' 
				) 
			),
			'tableName' => 'inventorycountdetail',
			'viewLinkTable' => 'item',
			'viewLinkLookup' => true 
		),
		'rack_id' => array(
			'name' => 'rack_id',
			'goodName' => 'rack_id',
			'strField' => 'rack_id',
			'index' => 8,
			'type' => 3,
			'sqlExpression' => 'icd.rack_id',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					'format' => 'Lookup wizard',
					'lookupTable' => 'rack',
					'lookupTableConnection' => 'conn',
					'lookupLinkField' => 'id',
					'lookupDisplayField' => 'reference_number' 
				) 
			),
			'tableName' => 'inventorycountdetail',
			'viewLinkTable' => 'Rack',
			'viewLinkLookup' => false 
		),
		'inventory_count_id' => array(
			'name' => 'inventory_count_id',
			'goodName' => 'inventory_count_id',
			'strField' => 'inventory_count_id',
			'index' => 9,
			'type' => 3,
			'sqlExpression' => 'icd.inventory_count_id',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					'format' => 'Lookup wizard',
					'lookupTable' => 'inventorycount',
					'lookupTableConnection' => 'conn',
					'lookupLinkField' => 'id',
					'lookupDisplayField' => 'reference_number' 
				) 
			),
			'tableName' => 'inventorycountdetail',
			'viewLinkTable' => 'InventoryCount',
			'viewLinkLookup' => false 
		),
		'item_name' => array(
			'name' => 'item_name',
			'goodName' => 'item_name',
			'strField' => 'name',
			'index' => 10,
			'sqlExpression' => 'i.name',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					'format' => 'Readonly' 
				) 
			),
			'tableName' => 'item' 
		),
		'rack_zone' => array(
			'name' => 'rack_zone',
			'goodName' => 'rack_zone',
			'strField' => 'zone',
			'index' => 11,
			'sqlExpression' => 'r.`zone`',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					'format' => 'Readonly' 
				) 
			),
			'tableName' => 'rack' 
		) 
	),
	'masterTables' => array( 
		array(
			'table' => 'Rack',
			'detailsKeys' => array( 
				'rack_id' 
			),
			'masterKeys' => array( 
				'id' 
			) 
		),
		array(
			'table' => 'InventoryCount',
			'detailsKeys' => array( 
				'inventory_count_id' 
			),
			'masterKeys' => array( 
				'id' 
			) 
		) 
	),
	'query' => array(
		'sql' => 'SELECT
	icd.id,
	icd.description,
	icd.quantity,
	icd.batch_id,
	icd.createdAt,
	icd.updatedAt,
	icd.item_id,
	icd.rack_id,
	icd.inventory_count_id,
	i.name AS item_name,
	r.`zone` AS rack_zone
FROM
	inventorycountdetail AS icd
	LEFT OUTER JOIN item AS i ON i.id = icd.inventory_count_id
	LEFT OUTER JOIN rack AS r ON r.id = icd.rack_id
',
		'parsed' => true,
		'type' => 'SQLQuery',
		'fieldList' => array( 
			array(
				'sql' => 'icd.id',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'icd',
					'name' => 'id' 
				),
				'encrypted' => false,
				'columnName' => 'id' 
			),
			array(
				'sql' => 'icd.description',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'icd',
					'name' => 'description' 
				),
				'encrypted' => false,
				'columnName' => 'description' 
			),
			array(
				'sql' => 'icd.quantity',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'icd',
					'name' => 'quantity' 
				),
				'encrypted' => false,
				'columnName' => 'quantity' 
			),
			array(
				'sql' => 'icd.batch_id',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'icd',
					'name' => 'batch_id' 
				),
				'encrypted' => false,
				'columnName' => 'batch_id' 
			),
			array(
				'sql' => 'icd.createdAt',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'icd',
					'name' => 'createdAt' 
				),
				'encrypted' => false,
				'columnName' => 'createdAt' 
			),
			array(
				'sql' => 'icd.updatedAt',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'icd',
					'name' => 'updatedAt' 
				),
				'encrypted' => false,
				'columnName' => 'updatedAt' 
			),
			array(
				'sql' => 'icd.item_id',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'icd',
					'name' => 'item_id' 
				),
				'encrypted' => false,
				'columnName' => 'item_id' 
			),
			array(
				'sql' => 'icd.rack_id',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'icd',
					'name' => 'rack_id' 
				),
				'encrypted' => false,
				'columnName' => 'rack_id' 
			),
			array(
				'sql' => 'icd.inventory_count_id',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'icd',
					'name' => 'inventory_count_id' 
				),
				'encrypted' => false,
				'columnName' => 'inventory_count_id' 
			),
			array(
				'sql' => 'i.name',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => 'item_name',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'i',
					'name' => 'name' 
				),
				'encrypted' => false,
				'columnName' => 'item_name' 
			),
			array(
				'sql' => 'r.`zone`',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => 'rack_zone',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'r',
					'name' => 'zone' 
				),
				'encrypted' => false,
				'columnName' => 'rack_zone' 
			) 
		),
		'fromList' => array( 
			array(
				'sql' => 'inventorycountdetail AS icd',
				'parsed' => true,
				'type' => 'FromListItem',
				'table' => array(
					'sql' => 'inventorycountdetail',
					'parsed' => true,
					'type' => 'SQLTable',
					'columns' => array( 
						'id',
						'description',
						'quantity',
						'batch_id',
						'createdAt',
						'updatedAt',
						'item_id',
						'rack_id',
						'inventory_count_id' 
					),
					'name' => 'inventorycountdetail' 
				),
				'joinOn' => array(
					'sql' => '',
					'parsed' => false,
					'type' => 'LogicalExpression',
					'contained' => array( 
						 
					),
					'unionType' => 0,
					'column' => null 
				),
				'joinList' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'JoinOn',
					'field1' => array( 
						 
					),
					'field2' => array( 
						 
					) 
				),
				'alias' => 'icd',
				'link' => 0 
			),
			array(
				'sql' => 'LEFT OUTER JOIN item AS i ON i.id = icd.inventory_count_id',
				'parsed' => true,
				'type' => 'FromListItem',
				'table' => array(
					'sql' => 'item',
					'parsed' => true,
					'type' => 'SQLTable',
					'columns' => array( 
						'id',
						'reference_number',
						'name',
						'description',
						'reorder_level',
						'warranty_period_months',
						'shelf_life_days',
						'createdAt',
						'updatedAt',
						'category_id',
						'subcategory_id',
						'parent_item_id',
						'parent_item_name',
						'procurement_type',
						'brand_id',
						'brand',
						'weight',
						'dimensions',
						'unit_id',
						'sku',
						'item_classification',
						'food_classification_id',
						'priority',
						'status',
						'approved_by',
						'approved_date',
						'approval_remarks' 
					),
					'name' => 'item' 
				),
				'joinOn' => array(
					'sql' => 'i.id = icd.inventory_count_id',
					'parsed' => true,
					'type' => 'LogicalExpression',
					'contained' => array( 
						 
					),
					'unionType' => 0,
					'column' => array(
						'sql' => '',
						'parsed' => true,
						'type' => 'SQLField',
						'table' => 'i',
						'name' => 'id' 
					),
					'case' => '= icd.inventory_count_id',
					'useAlias' => false 
				),
				'joinList' => array(
					'sql' => 'i.id = icd.inventory_count_id',
					'parsed' => true,
					'type' => 'JoinOn',
					'field1' => array( 
						array(
							'sql' => '',
							'parsed' => true,
							'type' => 'SQLField',
							'table' => 'i',
							'name' => 'id' 
						) 
					),
					'field2' => array( 
						array(
							'sql' => '',
							'parsed' => true,
							'type' => 'SQLField',
							'table' => 'icd',
							'name' => 'inventory_count_id' 
						) 
					) 
				),
				'alias' => 'i',
				'link' => 3 
			),
			array(
				'sql' => 'LEFT OUTER JOIN rack AS r ON r.id = icd.rack_id',
				'parsed' => true,
				'type' => 'FromListItem',
				'table' => array(
					'sql' => 'rack',
					'parsed' => true,
					'type' => 'SQLTable',
					'columns' => array( 
						'id',
						'reference_number',
						'zone',
						'capacity_sqm',
						'createdAt',
						'updatedAt',
						'warehouse_id' 
					),
					'name' => 'rack' 
				),
				'joinOn' => array(
					'sql' => 'r.id = icd.rack_id',
					'parsed' => true,
					'type' => 'LogicalExpression',
					'contained' => array( 
						 
					),
					'unionType' => 0,
					'column' => array(
						'sql' => '',
						'parsed' => true,
						'type' => 'SQLField',
						'table' => 'r',
						'name' => 'id' 
					),
					'case' => '= icd.rack_id',
					'useAlias' => false 
				),
				'joinList' => array(
					'sql' => 'r.id = icd.rack_id',
					'parsed' => true,
					'type' => 'JoinOn',
					'field1' => array( 
						array(
							'sql' => '',
							'parsed' => true,
							'type' => 'SQLField',
							'table' => 'r',
							'name' => 'id' 
						) 
					),
					'field2' => array( 
						array(
							'sql' => '',
							'parsed' => true,
							'type' => 'SQLField',
							'table' => 'icd',
							'name' => 'rack_id' 
						) 
					) 
				),
				'alias' => 'r',
				'link' => 3 
			) 
		),
		'where' => array(
			'sql' => '',
			'parsed' => false,
			'type' => 'LogicalExpression',
			'contained' => array( 
				 
			),
			'unionType' => 0,
			'column' => null 
		),
		'groupBy' => array( 
			 
		),
		'having' => array(
			'sql' => '',
			'parsed' => false,
			'type' => 'LogicalExpression',
			'contained' => array( 
				 
			),
			'unionType' => 0,
			'column' => null 
		),
		'orderBy' => array( 
			 
		),
		'colsIndex' => array( 
			array(
				'fieldIndex' => 0,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => -1,
				'havingIndex' => -1 
			),
			array(
				'fieldIndex' => 1,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => -1,
				'havingIndex' => -1 
			),
			array(
				'fieldIndex' => 2,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => -1,
				'havingIndex' => -1 
			),
			array(
				'fieldIndex' => 3,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => -1,
				'havingIndex' => -1 
			),
			array(
				'fieldIndex' => 4,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => -1,
				'havingIndex' => -1 
			),
			array(
				'fieldIndex' => 5,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => -1,
				'havingIndex' => -1 
			),
			array(
				'fieldIndex' => 6,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => -1,
				'havingIndex' => -1 
			),
			array(
				'fieldIndex' => 7,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => -1,
				'havingIndex' => -1 
			),
			array(
				'fieldIndex' => 8,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => -1,
				'havingIndex' => -1 
			),
			array(
				'fieldIndex' => 9,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => -1,
				'havingIndex' => -1 
			),
			array(
				'fieldIndex' => 10,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => -1,
				'havingIndex' => -1 
			) 
		),
		'headSql' => 'SELECT',
		'fieldListSql' => 'icd.id,
	icd.description,
	icd.quantity,
	icd.batch_id,
	icd.createdAt,
	icd.updatedAt,
	icd.item_id,
	icd.rack_id,
	icd.inventory_count_id,
	i.name AS item_name,
	r.`zone` AS rack_zone',
		'fromListSql' => 'FROM
	inventorycountdetail AS icd
	LEFT OUTER JOIN item AS i ON i.id = icd.inventory_count_id
	LEFT OUTER JOIN rack AS r ON r.id = icd.rack_id',
		'orderBySql' => '',
		'tailSql' => '' 
	),
	'originalTable' => 'inventorycountdetail',
	'originalPagesByType' => array(
		'export' => array( 
			'export' 
		),
		'import' => array( 
			'import' 
		),
		'edit' => array( 
			'edit' 
		),
		'view' => array( 
			'view' 
		),
		'list' => array( 
			'list' 
		),
		'print' => array( 
			'print' 
		),
		'search' => array( 
			'search' 
		) 
	),
	'originalPageTypes' => array(
		'export' => 'export',
		'import' => 'import',
		'edit' => 'edit',
		'view' => 'view',
		'list' => 'list',
		'print' => 'print',
		'search' => 'search' 
	),
	'originalDefaultPages' => array(
		'export' => 'export',
		'import' => 'import',
		'edit' => 'edit',
		'view' => 'view',
		'list' => 'list',
		'print' => 'print',
		'search' => 'search' 
	),
	'searchSettings' => array(
		'caseSensitiveSearch' => false,
		'searchableFields' => array( 
			'id',
			'description',
			'quantity',
			'batch_id',
			'createdAt',
			'updatedAt',
			'item_id',
			'rack_id',
			'inventory_count_id',
			'item_name',
			'rack_zone' 
		),
		'searchSuggest' => true,
		'highlightSearchResults' => true,
		'hideDataUntilSearch' => false,
		'hideFilterUntilSearch' => false,
		'googleLikeSearchFields' => array( 
			'id',
			'description',
			'quantity',
			'batch_id',
			'createdAt',
			'updatedAt',
			'item_id',
			'rack_id',
			'inventory_count_id',
			'item_name',
			'rack_zone' 
		) 
	),
	'connId' => 'conn',
	'clickActions' => array(
		'row' => array(
			'action' => 'noaction' 
		),
		'fields' => array(
			 
		) 
	),
	'geoCoding' => array(
		'enabled' => false,
		'latField' => '',
		'lonField' => '',
		'addressFields' => array( 
			 
		) 
	),
	'whereTabs' => array( 
		 
	),
	'labels' => array(
		 
	),
	'chartSettings' => array(
		 
	),
	'dataSourceOperations' => array(
		 
	),
	'calendarSettings' => array(
		'categoryColors' => array( 
			 
		) 
	),
	'ganttSettings' => array(
		'categoryColors' => array( 
			 
		) 
	) 
);

global $runnerTableLabels;
if( mlang_getcurrentlang() === 'English' ) {
	$runnerTableLabels['InventoryCountDetail'] = array(
	'tableCaption' => 'Inventory Count Detail',
	'fieldLabels' => array(
		'id' => 'ID',
		'description' => 'Description',
		'quantity' => 'Quantity',
		'batch_id' => 'Batch ID',
		'createdAt' => 'Created At',
		'updatedAt' => 'Updated At',
		'item_id' => 'Item ID',
		'rack_id' => 'Rack ID',
		'inventory_count_id' => 'Inventory Count ID',
		'item_name' => 'Item Name',
		'rack_zone' => 'Rack Zone' 
	),
	'fieldTooltips' => array(
		'id' => '',
		'description' => '',
		'quantity' => '',
		'batch_id' => '',
		'createdAt' => '',
		'updatedAt' => '',
		'item_id' => '',
		'rack_id' => '',
		'inventory_count_id' => '',
		'item_name' => '',
		'rack_zone' => '' 
	),
	'fieldPlaceholders' => array(
		'id' => '',
		'description' => '',
		'quantity' => '',
		'batch_id' => '',
		'createdAt' => '',
		'updatedAt' => '',
		'item_id' => '',
		'rack_id' => '',
		'inventory_count_id' => '',
		'item_name' => '',
		'rack_zone' => '' 
	),
	'pageTitles' => array(
		 
	) 
);
}
?>