{
    "keyColumn": "id",
    "wildsearch": "true",
    "detailHeaderColumnPrefix": "Attendace: ",
    "handleFile": "true",
    "detailHeaderColumns": ["username"],
    "breadCrumbColumn": "username",
    "orderBy": {
        "date": "DESC"
    },
    "includeJsFiles": ["attendance_add.js", "attendance_datepicker.js"],
    "listColumns": ["date", "emp_name", "shift_type", "check_in_disp", "check_out_disp", "hours_worked", "process_violation", "comments"],
    "showColumns": ["id", "date", "emp_id", "shift_type", "check_in", "check_out", "process_violation", "comments"],
    "detailColumns": ["id", "date", "emp_id", "emp_name", "shift_type", "check_in", "check_out", "check_in_disp", "check_out_disp", "hours_worked", "process_violation", "comments"],
     "where": "YEAR(date) >= YEAR(CURRENT_DATE - INTERVAL 12 MONTH)",
    "columns": {
        "id": {
            "name": "ID",
            "editoptions": {
                "type": "hidden"
            }
        },
        "date": {
            "name": "Date (m-d-y)",
            "searchable": "true",
            "sortable": "true",
            "dbFormat": "date",
            "displayFormat": "m/d/Y",
            "editoptions": {
                "dbFormat": "date",
                "displayFormat": "m/d/Y",
                "type": "datepicker",
                "onEdit": "disable",
                "label": "Date",
                "class": "",
                "validations": ["required"]
            }
        },
        "emp_id": {
            "name": "Username",
            "searchable": "true",
            "sortable": "true",
            "external": "true",
            "externalOptions": {
                "externalTable": "tbl_employee",
                "externalColumn": "emp_main_id",
                "externalShowColumn": "first_name"
            },
            "editoptions": {
                "type": "select",
                "onEdit": "disable",
                "source": "Cmshelper::getUsernameCombo",
                "default": "",
                "source_type": "function",
                "label": "User name",
                "class": "select",
                "validations": ["required"]
            }
        },
        "shift_type": {
            "name": "Shift",
            "external": "true",
            "externalOptions": {
                "externalTable": "tbl_shifts",
                "externalColumn": "id",
                "externalShowColumn": "title"
            },
            "editoptions": {
                "type": "select",
                "source": "Cmshelper::getShiftsCombo",
                "default": "",
                "source_type": "function",
                "label": "Shift",
                "class": "select",
                "validations": ["required"]
            }
        },
        "check_in": {
            "name": "Check In",
            "dbFormat": "datetime",
            "displayFormat": "m/d/Y h: ia",
            "editoptions": {
                "dbFormat": "date",
                "displayFormat": "m/d/Y",
                "type": "textbox",
                "label": "Check In",
                "hint": "Y-m-d h:m:s",
                "class": "",
                "validations": ["required"]
            }
        },
        "check_out": {
            "name": "Check Out",
            "dbFormat": "datetime",
            "displayFormat": "m/d/Y h: ia",
            "editoptions": {
                "dbFormat": "date",
                "displayFormat": "m/d/Y",
                "type": "textbox",
                "label": "Check Out",
                "hint": "Y-m-d h:m:s",
                "class": ""
            }
        },
        "emp_name": {
            "name": "Employee Name",
            "customColumn": "true",
            "customaction": "Cmshelper::getAttndcEmployeename"
        },
        "check_in_disp": {
            "name": "Check In",
            "customColumn": "true",
            "customaction": "Cmshelper::getAttndcCheckinTime"
        },
        "check_out_disp": {
            "name": "Check Out",
            "customColumn": "true",
            "customaction": "Cmshelper::getAttndcCheckoutTime"
        },
        "check_in_old": {
            "name": "CheckIn",
            "dbFormat": "datetime",
            "displayFormat": "h: ia",
            "searchable": "true",
            "sortable": "true",
            "editoptions": {
                "type": "select",
                "source": "Cmshelper::getTimeCombo",
                "default": "",
                "source_type": "function",
                "label": "CheckIn",
                "class": "select",
                "validations": ["required"]
            }
        },
        "check_out_old": {
            "name": "CheckOut",
            "dbFormat": "datetime",
            "displayFormat": "h: ia",
            "searchable": "true",
            "sortable": "true",
            "editoptions": {
                "type": "select",
                "source": "Cmshelper::getTimeCombo",
                "default": "",
                "source_type": "function",
                "label": "CheckOut",
                "class": "select",
                "validations": ["required"]
            }
        },
        "hours_worked": {
            "name": "Time",
            "customColumn": "true",
            "customaction": "Cmshelper::getAttndcTimeFromat"
        },
        "process_violation": {
            "name": "Process Violation",
            "editoptions": {
                "type": "checkbox",
                "label": "Process Violation?",
                "class": "inline",
                "default": "0",
                "enumvalues": {
                    "0": "No",
                    "1": "Yes"
                }
            }
        },
        "comments": {
            "name": "Comments",
            "editoptions": {
                "type": "textbox",
                "label": "Comments",
                "class": "textbox",
                "default": "-"
            }
        }
    },
    "customActions": {
        "beforeAddRecord": "Cmshelper::checkAttndcCondtn",
        "beforeEditRecord": "Cmshelper::checkPV"
    },
    "opertations": ["add", "view", "edit", "delete"],
    "operationLabel": {
        "addLabel": "Add",
        "editTitle": "Edit",
        "viewTitle": "View",
        "deleteTitle": "Delete"
    }
}