<?php
global $runnerTableSettings;
$runnerTableSettings['production_output'] = array(
	'name' => 'production_output',
	'shortName' => 'production_output',
	'pagesByType' => array(
		'add' => array( 
			'add' 
		),
		'export' => array( 
			'export' 
		),
		'import' => array( 
			'import' 
		),
		'edit' => array( 
			'edit' 
		),
		'view' => array( 
			'view' 
		),
		'list' => array( 
			'list' 
		),
		'print' => array( 
			'print' 
		),
		'masterlist' => array( 
			'masterlist' 
		),
		'masterprint' => array( 
			'masterprint' 
		),
		'search' => array( 
			'search' 
		) 
	),
	'pageTypes' => array(
		'add' => 'add',
		'export' => 'export',
		'import' => 'import',
		'edit' => 'edit',
		'view' => 'view',
		'list' => 'list',
		'print' => 'print',
		'masterlist' => 'masterlist',
		'masterprint' => 'masterprint',
		'search' => 'search' 
	),
	'defaultPages' => array(
		'add' => 'add',
		'export' => 'export',
		'import' => 'import',
		'edit' => 'edit',
		'view' => 'view',
		'list' => 'list',
		'print' => 'print',
		'masterlist' => 'masterlist',
		'masterprint' => 'masterprint',
		'search' => 'search' 
	),
	'afterEditDetails' => 'production_output',
	'afterAddDetail' => 'production_output',
	'detailsBadgeColor' => '778899',
	'sql' => 'SELECT
    id,
    production_report_no,
    production_work_order_id,
    report_date,
    production_area,
    supervisor_id,
    shift_code,
    status,
    current_active_step_name,
    remarks,
    prepared_by,
    noted_by,
    created_at,

    CASE
        WHEN status = \'Processing\'
             AND current_active_step_name IS NOT NULL
             AND current_active_step_name <> \'\'
        THEN CONCAT(
            \'Processing \',
            current_active_step_name
        )

        ELSE status
    END AS status_display

FROM production_output',
	'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' => 'id',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					 
				) 
			),
			'tableName' => 'production_output' 
		),
		'production_report_no' => array(
			'name' => 'production_report_no',
			'goodName' => 'production_report_no',
			'strField' => 'production_report_no',
			'index' => 2,
			'sqlExpression' => 'production_report_no',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					'format' => 'Readonly' 
				) 
			),
			'tableName' => 'production_output' 
		),
		'production_work_order_id' => array(
			'name' => 'production_work_order_id',
			'goodName' => 'production_work_order_id',
			'strField' => 'production_work_order_id',
			'index' => 3,
			'type' => 3,
			'sqlExpression' => 'production_work_order_id',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					 
				) 
			),
			'tableName' => 'production_output' 
		),
		'report_date' => array(
			'name' => 'report_date',
			'goodName' => 'report_date',
			'strField' => 'report_date',
			'index' => 4,
			'type' => 7,
			'sqlExpression' => 'report_date',
			'viewFormats' => array(
				'view' => array(
					'format' => 'Short Date' 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					'format' => 'Date',
					'dateEditType' => 11 
				) 
			),
			'tableName' => 'production_output' 
		),
		'production_area' => array(
			'name' => 'production_area',
			'goodName' => 'production_area',
			'strField' => 'production_area',
			'index' => 5,
			'sqlExpression' => 'production_area',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					 
				) 
			),
			'tableName' => 'production_output' 
		),
		'supervisor_id' => array(
			'name' => 'supervisor_id',
			'goodName' => 'supervisor_id',
			'strField' => 'supervisor_id',
			'index' => 6,
			'type' => 3,
			'sqlExpression' => 'supervisor_id',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					 
				) 
			),
			'tableName' => 'production_output' 
		),
		'shift_code' => array(
			'name' => 'shift_code',
			'goodName' => 'shift_code',
			'strField' => 'shift_code',
			'index' => 7,
			'sqlExpression' => 'shift_code',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					 
				) 
			),
			'tableName' => 'production_output' 
		),
		'status' => array(
			'name' => 'status',
			'goodName' => 'status',
			'strField' => 'status',
			'index' => 8,
			'sqlExpression' => 'status',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					'format' => 'Lookup wizard',
					'lookupType' => 0,
					'lookupValues' => array( 
						'Pending Approval',
						'Pending Fulfillment',
						'Processing' 
					) 
				) 
			),
			'tableName' => 'production_output' 
		),
		'remarks' => array(
			'name' => 'remarks',
			'goodName' => 'remarks',
			'strField' => 'remarks',
			'index' => 10,
			'type' => 201,
			'sqlExpression' => 'remarks',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					'format' => 'Text area' 
				) 
			),
			'tableName' => 'production_output' 
		),
		'prepared_by' => array(
			'name' => 'prepared_by',
			'goodName' => 'prepared_by',
			'strField' => 'prepared_by',
			'index' => 11,
			'type' => 3,
			'sqlExpression' => 'prepared_by',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					 
				) 
			),
			'tableName' => 'production_output' 
		),
		'noted_by' => array(
			'name' => 'noted_by',
			'goodName' => 'noted_by',
			'strField' => 'noted_by',
			'index' => 12,
			'type' => 3,
			'sqlExpression' => 'noted_by',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					 
				) 
			),
			'tableName' => 'production_output' 
		),
		'created_at' => array(
			'name' => 'created_at',
			'goodName' => 'created_at',
			'strField' => 'created_at',
			'index' => 13,
			'type' => 135,
			'sqlExpression' => 'created_at',
			'viewFormats' => array(
				'view' => array(
					'format' => 'Short Date' 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					'format' => 'Date',
					'dateEditType' => 11 
				) 
			),
			'tableName' => 'production_output' 
		),
		'current_active_step_name' => array(
			'name' => 'current_active_step_name',
			'goodName' => 'current_active_step_name',
			'strField' => 'current_active_step_name',
			'index' => 9,
			'sqlExpression' => 'current_active_step_name',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					'format' => 'Lookup wizard',
					'lookupType' => 0,
					'lookupValues' => array( 
						'Production',
						'Packing',
						'Quality Checking',
						'Ready for Release' 
					) 
				) 
			),
			'tableName' => 'production_output' 
		),
		'status_display' => array(
			'name' => 'status_display',
			'goodName' => 'status_display',
			'strField' => 'status_display',
			'index' => 14,
			'sqlExpression' => 'CASE
        WHEN status = \'Processing\'
             AND current_active_step_name IS NOT NULL
             AND current_active_step_name <> \'\'
        THEN CONCAT(
            \'Processing \',
            current_active_step_name
        )

        ELSE status
    END',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					 
				) 
			),
			'tableName' => '' 
		) 
	),
	'detailsTables' => array( 
		'production_output_details' 
	),
	'query' => array(
		'sql' => 'SELECT
    id,
    production_report_no,
    production_work_order_id,
    report_date,
    production_area,
    supervisor_id,
    shift_code,
    status,
    current_active_step_name,
    remarks,
    prepared_by,
    noted_by,
    created_at,

    CASE
        WHEN status = \'Processing\'
             AND current_active_step_name IS NOT NULL
             AND current_active_step_name <> \'\'
        THEN CONCAT(
            \'Processing \',
            current_active_step_name
        )

        ELSE status
    END AS status_display

FROM production_output',
		'parsed' => true,
		'type' => 'SQLQuery',
		'fieldList' => array( 
			array(
				'sql' => 'id',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'production_output',
					'name' => 'id' 
				),
				'encrypted' => false,
				'columnName' => 'id' 
			),
			array(
				'sql' => 'production_report_no',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'production_output',
					'name' => 'production_report_no' 
				),
				'encrypted' => false,
				'columnName' => 'production_report_no' 
			),
			array(
				'sql' => 'production_work_order_id',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'production_output',
					'name' => 'production_work_order_id' 
				),
				'encrypted' => false,
				'columnName' => 'production_work_order_id' 
			),
			array(
				'sql' => 'report_date',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'production_output',
					'name' => 'report_date' 
				),
				'encrypted' => false,
				'columnName' => 'report_date' 
			),
			array(
				'sql' => 'production_area',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'production_output',
					'name' => 'production_area' 
				),
				'encrypted' => false,
				'columnName' => 'production_area' 
			),
			array(
				'sql' => 'supervisor_id',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'production_output',
					'name' => 'supervisor_id' 
				),
				'encrypted' => false,
				'columnName' => 'supervisor_id' 
			),
			array(
				'sql' => 'shift_code',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'production_output',
					'name' => 'shift_code' 
				),
				'encrypted' => false,
				'columnName' => 'shift_code' 
			),
			array(
				'sql' => 'status',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'production_output',
					'name' => 'status' 
				),
				'encrypted' => false,
				'columnName' => 'status' 
			),
			array(
				'sql' => 'current_active_step_name',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'production_output',
					'name' => 'current_active_step_name' 
				),
				'encrypted' => false,
				'columnName' => 'current_active_step_name' 
			),
			array(
				'sql' => 'remarks',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'production_output',
					'name' => 'remarks' 
				),
				'encrypted' => false,
				'columnName' => 'remarks' 
			),
			array(
				'sql' => 'prepared_by',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'production_output',
					'name' => 'prepared_by' 
				),
				'encrypted' => false,
				'columnName' => 'prepared_by' 
			),
			array(
				'sql' => 'noted_by',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'production_output',
					'name' => 'noted_by' 
				),
				'encrypted' => false,
				'columnName' => 'noted_by' 
			),
			array(
				'sql' => 'created_at',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'production_output',
					'name' => 'created_at' 
				),
				'encrypted' => false,
				'columnName' => 'created_at' 
			),
			array(
				'sql' => 'CASE
        WHEN status = \'Processing\'
             AND current_active_step_name IS NOT NULL
             AND current_active_step_name <> \'\'
        THEN CONCAT(
            \'Processing \',
            current_active_step_name
        )

        ELSE status
    END',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => 'status_display',
				'expression' => array(
					'sql' => 'CASE
        WHEN status = \'Processing\'
             AND current_active_step_name IS NOT NULL
             AND current_active_step_name <> \'\'
        THEN CONCAT(
            \'Processing \',
            current_active_step_name
        )

        ELSE status
    END',
					'parsed' => true,
					'type' => 'NonParsedEntity' 
				),
				'encrypted' => false,
				'columnName' => 'status_display' 
			) 
		),
		'fromList' => array( 
			array(
				'sql' => 'production_output',
				'parsed' => true,
				'type' => 'FromListItem',
				'table' => array(
					'sql' => 'production_output',
					'parsed' => true,
					'type' => 'SQLTable',
					'columns' => array( 
						'id',
						'production_report_no',
						'production_work_order_id',
						'report_date',
						'production_area',
						'supervisor_id',
						'shift_code',
						'status',
						'current_active_step_name',
						'remarks',
						'prepared_by',
						'noted_by',
						'created_at' 
					),
					'name' => 'production_output' 
				),
				'joinOn' => array(
					'sql' => '',
					'parsed' => false,
					'type' => 'LogicalExpression',
					'contained' => array( 
						 
					),
					'unionType' => 0,
					'column' => null 
				),
				'joinList' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'JoinOn',
					'field1' => array( 
						 
					),
					'field2' => array( 
						 
					) 
				),
				'link' => 0 
			) 
		),
		'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 
			),
			array(
				'fieldIndex' => 11,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => -1,
				'havingIndex' => -1 
			),
			array(
				'fieldIndex' => 12,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => -1,
				'havingIndex' => -1 
			),
			array(
				'fieldIndex' => 13,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => -1,
				'havingIndex' => -1 
			) 
		),
		'headSql' => 'SELECT',
		'fieldListSql' => 'id,
    production_report_no,
    production_work_order_id,
    report_date,
    production_area,
    supervisor_id,
    shift_code,
    status,
    current_active_step_name,
    remarks,
    prepared_by,
    noted_by,
    created_at,

    CASE
        WHEN status = \'Processing\'
             AND current_active_step_name IS NOT NULL
             AND current_active_step_name <> \'\'
        THEN CONCAT(
            \'Processing \',
            current_active_step_name
        )

        ELSE status
    END AS status_display',
		'fromListSql' => 'FROM production_output',
		'orderBySql' => '',
		'tailSql' => '' 
	),
	'hasJsEvents' => true,
	'originalTable' => 'production_output',
	'originalPagesByType' => array(
		'add' => array( 
			'add' 
		),
		'export' => array( 
			'export' 
		),
		'import' => array( 
			'import' 
		),
		'edit' => array( 
			'edit' 
		),
		'view' => array( 
			'view' 
		),
		'list' => array( 
			'list' 
		),
		'print' => array( 
			'print' 
		),
		'masterlist' => array( 
			'masterlist' 
		),
		'masterprint' => array( 
			'masterprint' 
		),
		'search' => array( 
			'search' 
		) 
	),
	'originalPageTypes' => array(
		'add' => 'add',
		'export' => 'export',
		'import' => 'import',
		'edit' => 'edit',
		'view' => 'view',
		'list' => 'list',
		'print' => 'print',
		'masterlist' => 'masterlist',
		'masterprint' => 'masterprint',
		'search' => 'search' 
	),
	'originalDefaultPages' => array(
		'add' => 'add',
		'export' => 'export',
		'import' => 'import',
		'edit' => 'edit',
		'view' => 'view',
		'list' => 'list',
		'print' => 'print',
		'masterlist' => 'masterlist',
		'masterprint' => 'masterprint',
		'search' => 'search' 
	),
	'searchSettings' => array(
		'caseSensitiveSearch' => false,
		'searchableFields' => array( 
			'id',
			'production_report_no',
			'production_work_order_id',
			'report_date',
			'production_area',
			'supervisor_id',
			'shift_code',
			'status',
			'remarks',
			'prepared_by',
			'noted_by',
			'created_at',
			'current_active_step_name',
			'status_display' 
		),
		'searchSuggest' => true,
		'highlightSearchResults' => true,
		'hideDataUntilSearch' => false,
		'hideFilterUntilSearch' => false,
		'googleLikeSearchFields' => array( 
			'id',
			'production_report_no',
			'production_work_order_id',
			'report_date',
			'production_area',
			'supervisor_id',
			'shift_code',
			'status',
			'remarks',
			'prepared_by',
			'noted_by',
			'created_at',
			'current_active_step_name',
			'status_display' 
		) 
	),
	'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['production_output'] = array(
	'tableCaption' => 'Production Output',
	'fieldLabels' => array(
		'id' => 'ID',
		'production_report_no' => 'Production Report No.',
		'production_work_order_id' => 'Production Work Order ID',
		'report_date' => 'Report Date',
		'production_area' => 'Production Area',
		'supervisor_id' => 'Supervisor ID',
		'shift_code' => 'Shift Code',
		'status' => 'Status',
		'remarks' => 'Remarks',
		'prepared_by' => 'Prepared by',
		'noted_by' => 'Noted By',
		'created_at' => 'Created At',
		'current_active_step_name' => 'Current Active Step Name',
		'status_display' => 'Status Display' 
	),
	'fieldTooltips' => array(
		'id' => '',
		'production_report_no' => '',
		'production_work_order_id' => '',
		'report_date' => '',
		'production_area' => '',
		'supervisor_id' => '',
		'shift_code' => '',
		'status' => '',
		'remarks' => '',
		'prepared_by' => '',
		'noted_by' => '',
		'created_at' => '',
		'current_active_step_name' => '',
		'status_display' => '' 
	),
	'fieldPlaceholders' => array(
		'id' => '',
		'production_report_no' => '',
		'production_work_order_id' => '',
		'report_date' => '',
		'production_area' => '',
		'supervisor_id' => '',
		'shift_code' => '',
		'status' => '',
		'remarks' => '',
		'prepared_by' => '',
		'noted_by' => '',
		'created_at' => '',
		'current_active_step_name' => '',
		'status_display' => '' 
	),
	'pageTitles' => array(
		 
	) 
);
}
?>