<?php
global $runnerTableSettings;
$runnerTableSettings['transaction_history_log'] = array(
	'name' => 'transaction_history_log',
	'shortName' => 'transaction_history_log',
	'pagesByType' => array(
		'list' => array( 
			'list',
			'historypopup' 
		),
		'search' => array( 
			'search' 
		) 
	),
	'pageTypes' => array(
		'list' => 'list',
		'historypopup' => 'list',
		'search' => 'search' 
	),
	'defaultPages' => array(
		'list' => 'list',
		'search' => 'search' 
	),
	'afterEditDetails' => 'transaction_history_log',
	'afterAddDetail' => 'transaction_history_log',
	'detailsBadgeColor' => 'e67349',
	'strOrderBy' => 'ORDER BY action_at DESC, id DESC',
	'orderInfo' => array( 
		array(
			'index' => 15,
			'dir' => 'DESC',
			'field' => 'action_at' 
		),
		array(
			'index' => 1,
			'dir' => 'DESC',
			'field' => 'id' 
		) 
	),
	'sql' => 'SELECT
    id,
    module_code,
    record_id,
    record_no,
    action_code,
    action_label,
    action_details,
    from_status,
    to_status,
    acted_by,
    actor_username,
    actor_name,
    actor_role,
    remarks,
    action_at,

    CASE
        WHEN UPPER(action_code) = \'SUBMITTED\' THEN \'Submitted by\'
        WHEN UPPER(action_code) = \'CREATED\' THEN \'Created by\'
        WHEN UPPER(action_code) = \'UPDATED\' THEN \'Edited by\'
        WHEN UPPER(action_code) = \'APPROVED\' THEN \'Approved by\'
        WHEN UPPER(action_code) = \'RETURNED\' THEN \'Returned by\'
        WHEN UPPER(action_code) = \'REJECTED\' THEN \'Rejected by\'
        WHEN UPPER(action_code) = \'CANCELLED\' THEN \'Cancelled by\'
        WHEN UPPER(action_code) = \'COMPLETED\' THEN \'Completed by\'
        ELSE action_label
    END AS activity,

    actor_name AS name,

    actor_name AS performed_by

FROM transaction_history_log
ORDER BY action_at DESC, id DESC',
	'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' => 'transaction_history_log' 
		),
		'module_code' => array(
			'name' => 'module_code',
			'goodName' => 'module_code',
			'strField' => 'module_code',
			'index' => 2,
			'sqlExpression' => 'module_code',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					 
				) 
			),
			'tableName' => 'transaction_history_log' 
		),
		'record_id' => array(
			'name' => 'record_id',
			'goodName' => 'record_id',
			'strField' => 'record_id',
			'index' => 3,
			'type' => 3,
			'sqlExpression' => 'record_id',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					 
				) 
			),
			'tableName' => 'transaction_history_log' 
		),
		'record_no' => array(
			'name' => 'record_no',
			'goodName' => 'record_no',
			'strField' => 'record_no',
			'index' => 4,
			'sqlExpression' => 'record_no',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					 
				) 
			),
			'tableName' => 'transaction_history_log' 
		),
		'action_code' => array(
			'name' => 'action_code',
			'goodName' => 'action_code',
			'strField' => 'action_code',
			'index' => 5,
			'sqlExpression' => 'action_code',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					 
				) 
			),
			'tableName' => 'transaction_history_log' 
		),
		'action_label' => array(
			'name' => 'action_label',
			'goodName' => 'action_label',
			'strField' => 'action_label',
			'index' => 6,
			'sqlExpression' => 'action_label',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					 
				) 
			),
			'tableName' => 'transaction_history_log' 
		),
		'action_details' => array(
			'name' => 'action_details',
			'goodName' => 'action_details',
			'strField' => 'action_details',
			'index' => 7,
			'type' => 201,
			'sqlExpression' => 'action_details',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					'format' => 'Text area' 
				) 
			),
			'tableName' => 'transaction_history_log' 
		),
		'from_status' => array(
			'name' => 'from_status',
			'goodName' => 'from_status',
			'strField' => 'from_status',
			'index' => 8,
			'sqlExpression' => 'from_status',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					 
				) 
			),
			'tableName' => 'transaction_history_log' 
		),
		'to_status' => array(
			'name' => 'to_status',
			'goodName' => 'to_status',
			'strField' => 'to_status',
			'index' => 9,
			'sqlExpression' => 'to_status',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					 
				) 
			),
			'tableName' => 'transaction_history_log' 
		),
		'acted_by' => array(
			'name' => 'acted_by',
			'goodName' => 'acted_by',
			'strField' => 'acted_by',
			'index' => 10,
			'type' => 3,
			'sqlExpression' => 'acted_by',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					 
				) 
			),
			'tableName' => 'transaction_history_log' 
		),
		'actor_username' => array(
			'name' => 'actor_username',
			'goodName' => 'actor_username',
			'strField' => 'actor_username',
			'index' => 11,
			'sqlExpression' => 'actor_username',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					 
				) 
			),
			'tableName' => 'transaction_history_log' 
		),
		'actor_name' => array(
			'name' => 'actor_name',
			'goodName' => 'actor_name',
			'strField' => 'actor_name',
			'index' => 12,
			'sqlExpression' => 'actor_name',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					 
				) 
			),
			'tableName' => 'transaction_history_log' 
		),
		'actor_role' => array(
			'name' => 'actor_role',
			'goodName' => 'actor_role',
			'strField' => 'actor_role',
			'index' => 13,
			'sqlExpression' => 'actor_role',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					 
				) 
			),
			'tableName' => 'transaction_history_log' 
		),
		'remarks' => array(
			'name' => 'remarks',
			'goodName' => 'remarks',
			'strField' => 'remarks',
			'index' => 14,
			'type' => 201,
			'sqlExpression' => 'remarks',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					'format' => 'Text area' 
				) 
			),
			'tableName' => 'transaction_history_log' 
		),
		'action_at' => array(
			'name' => 'action_at',
			'goodName' => 'action_at',
			'strField' => 'action_at',
			'index' => 15,
			'type' => 135,
			'sqlExpression' => 'action_at',
			'viewFormats' => array(
				'view' => array(
					'format' => 'Custom',
					'customExpression' => 'if ($value != "") {
    try {
        $dt = new DateTime($value, new DateTimeZone("Asia/Manila"));
        $value = $dt->format("M d, Y | h:i A");
    } catch (Exception $e) {
        // keep original value
    }
}' 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					'format' => 'Date',
					'dateEditType' => 11 
				) 
			),
			'tableName' => 'transaction_history_log' 
		),
		'activity' => array(
			'name' => 'activity',
			'goodName' => 'activity',
			'strField' => 'activity',
			'index' => 16,
			'sqlExpression' => 'CASE
        WHEN UPPER(action_code) = \'SUBMITTED\' THEN \'Submitted by\'
        WHEN UPPER(action_code) = \'CREATED\' THEN \'Created by\'
        WHEN UPPER(action_code) = \'UPDATED\' THEN \'Edited by\'
        WHEN UPPER(action_code) = \'APPROVED\' THEN \'Approved by\'
        WHEN UPPER(action_code) = \'RETURNED\' THEN \'Returned by\'
        WHEN UPPER(action_code) = \'REJECTED\' THEN \'Rejected by\'
        WHEN UPPER(action_code) = \'CANCELLED\' THEN \'Cancelled by\'
        WHEN UPPER(action_code) = \'COMPLETED\' THEN \'Completed by\'
        ELSE action_label
    END',
			'viewFormats' => array(
				'view' => array(
					'format' => 'Custom',
					'customExpression' => '$activity = trim((string)$value);
$color = "#666666";

switch (strtoupper($activity)) {
    case "SUBMITTED BY":
        $color = "#ff3b30";
        break;

    case "CREATED BY":
        $color = "#3f51b5";
        break;

    case "EDITED BY":
        $color = "#ff9500";
        break;

    case "APPROVED BY":
        $color = "#34c759";
        break;

    case "RETURNED BY":
        $color = "#af52de";
        break;

    case "REJECTED BY":
        $color = "#d0021b";
        break;

    case "CANCELLED BY":
        $color = "#8e8e93";
        break;
}

$value = "<span style=\'color:".$color."; font-weight:500;\'>".htmlspecialchars($activity)."</span>";' 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					 
				) 
			),
			'tableName' => '' 
		),
		'name' => array(
			'name' => 'name',
			'goodName' => 'name',
			'strField' => 'actor_name',
			'index' => 17,
			'sqlExpression' => 'actor_name',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					 
				) 
			),
			'tableName' => 'transaction_history_log' 
		),
		'performed_by' => array(
			'name' => 'performed_by',
			'goodName' => 'performed_by',
			'strField' => 'actor_name',
			'index' => 18,
			'sqlExpression' => 'actor_name',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					 
				) 
			),
			'tableName' => 'transaction_history_log' 
		) 
	),
	'query' => array(
		'sql' => 'SELECT
    id,
    module_code,
    record_id,
    record_no,
    action_code,
    action_label,
    action_details,
    from_status,
    to_status,
    acted_by,
    actor_username,
    actor_name,
    actor_role,
    remarks,
    action_at,

    CASE
        WHEN UPPER(action_code) = \'SUBMITTED\' THEN \'Submitted by\'
        WHEN UPPER(action_code) = \'CREATED\' THEN \'Created by\'
        WHEN UPPER(action_code) = \'UPDATED\' THEN \'Edited by\'
        WHEN UPPER(action_code) = \'APPROVED\' THEN \'Approved by\'
        WHEN UPPER(action_code) = \'RETURNED\' THEN \'Returned by\'
        WHEN UPPER(action_code) = \'REJECTED\' THEN \'Rejected by\'
        WHEN UPPER(action_code) = \'CANCELLED\' THEN \'Cancelled by\'
        WHEN UPPER(action_code) = \'COMPLETED\' THEN \'Completed by\'
        ELSE action_label
    END AS activity,

    actor_name AS name,

    actor_name AS performed_by

FROM transaction_history_log
ORDER BY action_at DESC, id DESC',
		'parsed' => true,
		'type' => 'SQLQuery',
		'fieldList' => array( 
			array(
				'sql' => 'id',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'transaction_history_log',
					'name' => 'id' 
				),
				'encrypted' => false,
				'columnName' => 'id' 
			),
			array(
				'sql' => 'module_code',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'transaction_history_log',
					'name' => 'module_code' 
				),
				'encrypted' => false,
				'columnName' => 'module_code' 
			),
			array(
				'sql' => 'record_id',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'transaction_history_log',
					'name' => 'record_id' 
				),
				'encrypted' => false,
				'columnName' => 'record_id' 
			),
			array(
				'sql' => 'record_no',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'transaction_history_log',
					'name' => 'record_no' 
				),
				'encrypted' => false,
				'columnName' => 'record_no' 
			),
			array(
				'sql' => 'action_code',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'transaction_history_log',
					'name' => 'action_code' 
				),
				'encrypted' => false,
				'columnName' => 'action_code' 
			),
			array(
				'sql' => 'action_label',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'transaction_history_log',
					'name' => 'action_label' 
				),
				'encrypted' => false,
				'columnName' => 'action_label' 
			),
			array(
				'sql' => 'action_details',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'transaction_history_log',
					'name' => 'action_details' 
				),
				'encrypted' => false,
				'columnName' => 'action_details' 
			),
			array(
				'sql' => 'from_status',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'transaction_history_log',
					'name' => 'from_status' 
				),
				'encrypted' => false,
				'columnName' => 'from_status' 
			),
			array(
				'sql' => 'to_status',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'transaction_history_log',
					'name' => 'to_status' 
				),
				'encrypted' => false,
				'columnName' => 'to_status' 
			),
			array(
				'sql' => 'acted_by',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'transaction_history_log',
					'name' => 'acted_by' 
				),
				'encrypted' => false,
				'columnName' => 'acted_by' 
			),
			array(
				'sql' => 'actor_username',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'transaction_history_log',
					'name' => 'actor_username' 
				),
				'encrypted' => false,
				'columnName' => 'actor_username' 
			),
			array(
				'sql' => 'actor_name',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'transaction_history_log',
					'name' => 'actor_name' 
				),
				'encrypted' => false,
				'columnName' => 'actor_name' 
			),
			array(
				'sql' => 'actor_role',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'transaction_history_log',
					'name' => 'actor_role' 
				),
				'encrypted' => false,
				'columnName' => 'actor_role' 
			),
			array(
				'sql' => 'remarks',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'transaction_history_log',
					'name' => 'remarks' 
				),
				'encrypted' => false,
				'columnName' => 'remarks' 
			),
			array(
				'sql' => 'action_at',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'transaction_history_log',
					'name' => 'action_at' 
				),
				'encrypted' => false,
				'columnName' => 'action_at' 
			),
			array(
				'sql' => 'CASE
        WHEN UPPER(action_code) = \'SUBMITTED\' THEN \'Submitted by\'
        WHEN UPPER(action_code) = \'CREATED\' THEN \'Created by\'
        WHEN UPPER(action_code) = \'UPDATED\' THEN \'Edited by\'
        WHEN UPPER(action_code) = \'APPROVED\' THEN \'Approved by\'
        WHEN UPPER(action_code) = \'RETURNED\' THEN \'Returned by\'
        WHEN UPPER(action_code) = \'REJECTED\' THEN \'Rejected by\'
        WHEN UPPER(action_code) = \'CANCELLED\' THEN \'Cancelled by\'
        WHEN UPPER(action_code) = \'COMPLETED\' THEN \'Completed by\'
        ELSE action_label
    END',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => 'activity',
				'expression' => array(
					'sql' => 'CASE
        WHEN UPPER(action_code) = \'SUBMITTED\' THEN \'Submitted by\'
        WHEN UPPER(action_code) = \'CREATED\' THEN \'Created by\'
        WHEN UPPER(action_code) = \'UPDATED\' THEN \'Edited by\'
        WHEN UPPER(action_code) = \'APPROVED\' THEN \'Approved by\'
        WHEN UPPER(action_code) = \'RETURNED\' THEN \'Returned by\'
        WHEN UPPER(action_code) = \'REJECTED\' THEN \'Rejected by\'
        WHEN UPPER(action_code) = \'CANCELLED\' THEN \'Cancelled by\'
        WHEN UPPER(action_code) = \'COMPLETED\' THEN \'Completed by\'
        ELSE action_label
    END',
					'parsed' => true,
					'type' => 'NonParsedEntity' 
				),
				'encrypted' => false,
				'columnName' => 'activity' 
			),
			array(
				'sql' => 'actor_name',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => 'name',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'transaction_history_log',
					'name' => 'actor_name' 
				),
				'encrypted' => false,
				'columnName' => 'name' 
			),
			array(
				'sql' => 'actor_name',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => 'performed_by',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'transaction_history_log',
					'name' => 'actor_name' 
				),
				'encrypted' => false,
				'columnName' => 'performed_by' 
			) 
		),
		'fromList' => array( 
			array(
				'sql' => 'transaction_history_log',
				'parsed' => true,
				'type' => 'FromListItem',
				'table' => array(
					'sql' => 'transaction_history_log',
					'parsed' => true,
					'type' => 'SQLTable',
					'columns' => array( 
						'id',
						'module_code',
						'record_id',
						'record_no',
						'action_code',
						'action_label',
						'action_details',
						'from_status',
						'to_status',
						'acted_by',
						'actor_username',
						'actor_name',
						'actor_role',
						'remarks',
						'action_at' 
					),
					'name' => 'transaction_history_log' 
				),
				'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( 
			array(
				'sql' => 'action_at DESC',
				'parsed' => true,
				'type' => 'OrderByListItem',
				'column' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'transaction_history_log',
					'name' => 'action_at' 
				),
				'asc' => false,
				'columnNumber' => 15 
			),
			array(
				'sql' => 'id DESC',
				'parsed' => true,
				'type' => 'OrderByListItem',
				'column' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'transaction_history_log',
					'name' => 'id' 
				),
				'asc' => false,
				'columnNumber' => 1 
			) 
		),
		'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 
			),
			array(
				'fieldIndex' => 14,
				'orderByIndex' => 0,
				'groupByIndex' => -1,
				'whereIndex' => -1,
				'havingIndex' => -1 
			),
			array(
				'fieldIndex' => 15,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => -1,
				'havingIndex' => -1 
			),
			array(
				'fieldIndex' => 16,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => -1,
				'havingIndex' => -1 
			),
			array(
				'fieldIndex' => 17,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => -1,
				'havingIndex' => -1 
			) 
		),
		'headSql' => 'SELECT',
		'fieldListSql' => 'id,
    module_code,
    record_id,
    record_no,
    action_code,
    action_label,
    action_details,
    from_status,
    to_status,
    acted_by,
    actor_username,
    actor_name,
    actor_role,
    remarks,
    action_at,

    CASE
        WHEN UPPER(action_code) = \'SUBMITTED\' THEN \'Submitted by\'
        WHEN UPPER(action_code) = \'CREATED\' THEN \'Created by\'
        WHEN UPPER(action_code) = \'UPDATED\' THEN \'Edited by\'
        WHEN UPPER(action_code) = \'APPROVED\' THEN \'Approved by\'
        WHEN UPPER(action_code) = \'RETURNED\' THEN \'Returned by\'
        WHEN UPPER(action_code) = \'REJECTED\' THEN \'Rejected by\'
        WHEN UPPER(action_code) = \'CANCELLED\' THEN \'Cancelled by\'
        WHEN UPPER(action_code) = \'COMPLETED\' THEN \'Completed by\'
        ELSE action_label
    END AS activity,

    actor_name AS name,

    actor_name AS performed_by',
		'fromListSql' => 'FROM transaction_history_log',
		'orderBySql' => 'ORDER BY action_at DESC, id DESC',
		'tailSql' => '' 
	),
	'hasEvents' => true,
	'hasJsEvents' => true,
	'originalTable' => 'transaction_history_log',
	'originalPagesByType' => array(
		'list' => array( 
			'list',
			'historypopup' 
		),
		'search' => array( 
			'search' 
		) 
	),
	'originalPageTypes' => array(
		'list' => 'list',
		'historypopup' => 'list',
		'search' => 'search' 
	),
	'originalDefaultPages' => array(
		'list' => 'list',
		'search' => 'search' 
	),
	'searchSettings' => array(
		'caseSensitiveSearch' => false,
		'searchableFields' => array( 
			'id',
			'module_code',
			'record_id',
			'record_no',
			'action_code',
			'action_label',
			'action_details',
			'from_status',
			'to_status',
			'acted_by',
			'actor_username',
			'actor_name',
			'actor_role',
			'remarks',
			'action_at',
			'activity',
			'name',
			'performed_by' 
		),
		'searchSuggest' => true,
		'highlightSearchResults' => true,
		'hideDataUntilSearch' => false,
		'hideFilterUntilSearch' => false,
		'googleLikeSearchFields' => array( 
			'id',
			'module_code',
			'record_id',
			'record_no',
			'action_code',
			'action_label',
			'action_details',
			'from_status',
			'to_status',
			'acted_by',
			'actor_username',
			'actor_name',
			'actor_role',
			'remarks',
			'action_at',
			'activity',
			'name',
			'performed_by' 
		) 
	),
	'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['transaction_history_log'] = array(
	'tableCaption' => 'Transaction History Log',
	'fieldLabels' => array(
		'id' => 'Id',
		'module_code' => 'Module Code',
		'record_id' => 'Record Id',
		'record_no' => 'Record No',
		'action_code' => 'Action Code',
		'action_label' => 'Action Label',
		'action_details' => 'Action Details',
		'from_status' => 'From Status',
		'to_status' => 'To Status',
		'acted_by' => 'Acted By',
		'actor_username' => 'Actor Username',
		'actor_name' => 'Actor Name',
		'actor_role' => 'Actor Role',
		'remarks' => 'Remarks',
		'action_at' => 'Action At',
		'activity' => 'Activity',
		'name' => 'Name',
		'performed_by' => 'Performed By' 
	),
	'fieldTooltips' => array(
		'id' => '',
		'module_code' => '',
		'record_id' => '',
		'record_no' => '',
		'action_code' => '',
		'action_label' => '',
		'action_details' => '',
		'from_status' => '',
		'to_status' => '',
		'acted_by' => '',
		'actor_username' => '',
		'actor_name' => '',
		'actor_role' => '',
		'remarks' => '',
		'action_at' => '',
		'activity' => '',
		'name' => '',
		'performed_by' => '' 
	),
	'fieldPlaceholders' => array(
		'id' => '',
		'module_code' => '',
		'record_id' => '',
		'record_no' => '',
		'action_code' => '',
		'action_label' => '',
		'action_details' => '',
		'from_status' => '',
		'to_status' => '',
		'acted_by' => '',
		'actor_username' => '',
		'actor_name' => '',
		'actor_role' => '',
		'remarks' => '',
		'action_at' => '',
		'activity' => '',
		'name' => '',
		'performed_by' => '' 
	),
	'pageTitles' => array(
		 
	) 
);
}
?>