{
    "keyColumn": "timesheet_id",
    "wildsearch": "true",
    "detailHeaderColumnPrefix": "Team: ",
    "handleFile": "true",
    "detailHeaderColumns": [
        "project_id"
    ],
    "breadCrumbColumn": "project_id",
    "orderBy": {
        "timesheet_id": "DESC"
    },
    "listColumns": [
        "project_id",
        "estimation_file_id",
        "timesheet_estimated_time",
        "timesheet_description",
        "timesheet_type",
        "timesheet_status",
        "added_on",
        "added_by"
    ],
    "showColumns": [
        "project_id",
        "estimation_file_id",
        "timesheet_estimated_time",
        "timesheet_description",
        "timesheet_type",
        "timesheet_status",
        "added_on",
        "added_by"
    ],
    "detailColumns": [
        "timesheet_id",
        "project_id",
        "estimation_file_id",
        "timesheet_estimated_time",
        "timesheet_description",
        "timesheet_type",
        "timesheet_status",
        "added_on",
        "added_by"
    ],
    "columns": {
        "timesheet_id": {
            "name": "ID",
            "editoptions": {
                "type": "hidden"
            }
        },
        "project_id": {
            "name": "Project",
            "searchable": "true",
            "sortable": "true",
            "external": "true",
            "externalOptions": {
                "externalTable": "tbl_projects",
                "externalColumn": "project_id",
                "externalShowColumn": "project_title"
            }
        },
        "estimation_file_id": {
            "name": "uploaded timesheet",
            "external": "true",
            "externalOptions": {
                "externalTable": "tbl_files",
                "externalColumn": "file_id",
                "externalShowColumn": "file_id"
            },
            "editoptions": {
                "type": "file",
                "label": "Upload timesheet",
                "class": "file"
            }
        },
        "timesheet_estimated_time": {
            "name": "Estimated Hours",
            "searchable": "true",
            "sortable": "true",
            "editoptions": {
                "type": "textbox",
                "label": "Estimated Hours",
                "class": "textbox",
                "hint": "Estimated Hours",
                "validations": [
                    "required"
                ]
            }
        },
        "timesheet_description": {
            "name": "Description",
            "editoptions": {
                "type": "textarea",
                "label": "Timesheet Description",
                "class": "textbox",
                "validations": [
                    "required"
                ]
            }
        },
        "added_on": {
            "name": "Added on [m/d/Y]",
            "sortable": "true",
            "dbFormat": "date",
            "displayFormat": "m/d/Y"
        },
        "added_by": {
            "name": "Added by",
            "external": "true",
            "externalOptions": {
                "externalTable": "tbl_employee",
                "externalColumn": "emp_main_id",
                "externalShowColumn": "first_name"
            },
            "editoptions": {
            }
        },
        "timesheet_type": {
            "name": "Type",
            "searchable": "true",
            "editoptions": {
                "type": "select",
                "source": {
                    "main estimate": "Main estimate",
                    "additional estimate": "Additional estimate",
                    "estimation error": "Estimation error",
                    "client feedback": "Client feedback",
                    "plan variation": "Plan variation",
                    "others": "Others"
                },
                "default": "",
                "source_type": "array",
                "label": "Timesheet Type",
                "class": "select",
                "validations": [
                    "required"
                ]
            }
        },
        "timesheet_status": {
            "name": "Status",
            "sortable": "true",
            "popupoptions": {
                "type": "popup",
                "customaction": "Cmshelper::getTimesheetstatusPopupUrl"
            }
        }
    },
    "reference": {
        "referenceTable": "tbl_projects",
        "referenceColumn": "project_id",
        "referenceTableForiegnKey": "project_id"
    },
    "customActions": {
        "beforeAddRecord": "Cmshelper::validateEngine",
        "afterAddRecord": "Cmshelper::increaseTimesheetCount",
        "beforeEditRecord": "Cmshelper::updateTimesheetCount",
        "beforeDeleteRecord": "Cmshelper::decreaseTimesheetCount"
    },
    "opertations": [
        "add",
        "view",
        "delete"
    ],
    "operationLabel": {
        "addLabel": "Add Timesheet",
        "viewTitle": "View Timesheet Details",
        "deleteTitle": "Delete Timesheet"
    }
}