{
	"name": "form/nc/nc-timecard/nc-timecard.json",
	"layout": {
		"component": "nc-form",
		"attribute": {
			"id": "nc-timecard"
		},
		"element": [
			{
				"component": "nc-row",
				"element": [
					{
						"component": "nc-col",
						"attribute": {
							"width": "12/12"
						},
						"element": [
							{
								"component": "nc-header",
								"text": "Timecard",
								"attribute": {
									"model": "hdr.timecard.timecard",
									"size": "large"
								}
							}
						]
					}
				]
			},
			{
				"component": "nc-divider",
				"attribute": {
					"class": ["small"]
				}
			},
			{
				"component": "nc-row",
				"element": [
					{
						"component": "nc-col",
						"attribute": {
							"width": "2/12"
						},
						"element": [
							{
								"component": "nc-label",
								"text": "Employee",
								"attribute": {
									"model": "hdr.timecard.employee_id"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"width": "2/12"
						},
						"element": [
							{
								"component": "nc-input",
								"attribute": {
									"type": "text",
									"model": "rec.employee_id",
									"v-on:blur": "queryRec()"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"width": "auto"
						},
						"element": [
							{
								"component": "nc-input",
								"attribute": {
									"type": "text",
									"disabled": "disabled",
									"model": "rec.per.full_name"
								}
							}
						]
					}
				]
			},
			{
				"component": "nc-row",
				"element": [
					{
						"component": "nc-col",
						"attribute": {
							"width": "2/12"
						}
					},
					{
						"component": "nc-col",
						"attribute": {
							"width": "2/12"
						},
						"element": [
							{
								"component": "nc-button",
								"attribute": {
									":disabled": "rec.timecard_state == \"started\" || !rec.per || !rec.per.full_name || rec.per.full_name.length < 1",
									"v-on:click": "save()",
									"class": ["nc-button-wide"]
								},
								"element": [
									{
										"component": "nc-icon",
										"attribute": {
											"icon": "play"
										}
									},
									{
										"component": "nc-translate",
										"text": "Start",
										"attribute": {
											"model": "hdr.timecard.start"
										}
									}
								]
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"width": "2/12"
						},
						"element": [
							{
								"component": "nc-label",
								"text": "Start time",
								"attribute": {
									"model": "hdr.timecard.start_time"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"width": "auto"
						},
						"element": [
							{
								"component": "nc-input",
								"attribute": {
									":value": "dt.formatDateTime(rec.start_time)",
									"disabled": "disabled"
								}
							}
						]
					}
				]
			},
			{
				"component": "nc-row",
				"element": [
					{
						"component": "nc-col",
						"attribute": {
							"width": "2/12"
						}
					},
					{
						"component": "nc-col",
						"attribute": {
							"width": "2/12"
						},
						"element": [
							{
								"component": "nc-button",
								"attribute": {
									":disabled": "rec.timecard_state != \"started\" || !rec.per || !rec.per.full_name || rec.per.full_name.length < 1",
									"v-on:click": "save()",
									"class": ["nc-button-wide"]
								},
								"element": [
									{
										"component": "nc-icon",
										"attribute": {
											"icon": "stop"
										}
									},
									{
										"component": "nc-translate",
										"text": "End",
										"attribute": {
											"model": "hdr.timecard.end"
										}
									}
								]
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"width": "2/12"
						},
						"element": [
							{
								"component": "nc-label",
								"text": "Work time",
								"attribute": {
									"model": "hdr.timecard.work_time"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"width": "auto"
						},
						"element": [
							{
								"component": "nc-input",
								"attribute": {
									":value": "nc.round(rec.work_time, 4, true)",
									"disabled": "disabled"
								}
							}
						]
					}
				]
			},
			{
				"component": "nc-row",
				"element": [
					{
						"component": "nc-col",
						"attribute": {
							"width": "2/12"
						},
						"element": [
							{
								"component": "nc-label",
								"text": "Work shift",
								"attribute": {
									"model": "hdr.timecard.work_shift"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"width": "2/12"
						},
						"element": [
							{
								"component": "nc-dropdown",
								"attribute": {
									"model": "rec.work_shift"
								}
							}
						]
					}
				]
			},
			{
				"component": "nc-row",
				"element": [
					{
						"component": "nc-col",
						"attribute": {
							"width": "2/12"
						},
						"element": [
							{
								"component": "nc-label",
								"text": "End reason",
								"attribute": {
									"model": "hdr.timecard.end_reason"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"width": "2/12"
						},
						"element": [
							{
								"component": "nc-dropdown",
								"attribute": {
									"model": "rec.end_reason"
								}
							}
						]
					}
				]
			},
			{
				"component": "nc-row",
				"element": [
					{
						"component": "nc-col",
						"attribute": {
							"width": "2/12"
						},
						"element": [
							{
								"component": "nc-label",
								"text": "Location",
								"attribute": {
									"model": "hdr.timecard.location"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"width": "4/12"
						},
						"element": [
							{
								"component": "nc-dropdown",
								"attribute": {
									"model": "rec.location"
								}
							}
						]
					}
				]
			},
			{
				"component": "nc-row",
				"element": [
					{
						"component": "nc-col",
						"attribute": {
							"width": "2/12"
						},
						"element": [
							{
								"component": "nc-label",
								"text": "Group",
								"attribute": {
									"model": "hdr.timecard.json_data.work_group"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"width": "4/12"
						},
						"element": [
							{
								"component": "nc-dropdown",
								"attribute": {
									"model": "rec.json_data.work_group"
								}
							}
						]
					}
				]
			},
			{
				"component": "nc-row",
				"element": [
					{
						"component": "nc-col",
						"attribute": {
							"width": "2/12"
						},
						"element": [
							{
								"component": "nc-label",
								"text": "Subgroup",
								"attribute": {
									"model": "hdr.timecard.json_data.work_subgroup"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"width": "8/12"
						},
						"element": [
							{
								"component": "nc-dropdown",
								"attribute": {
									"model": "rec.json_data.work_subgroup"
								}
							}
						]
					}
				]
			},
			{
				"component": "nc-row",
				"element": [
					{
						"component": "nc-col",
						"attribute": {
							"width": "2/12"
						},
						"element": [
							{
								"component": "nc-label",
								"text": "Info",
								"attribute": {
									"model": "hdr.timecard.info"
								}
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"width": "auto"
						},
						"element": [
							{
								"component": "nc-textarea",
								"attribute": {
									"type": "textarea",
									"model": "rec.info",
									"rows": "5"
								}
							}
						]
					}
				]
			},
			{
				"component": "nc-divider",
				"attribute": {
					"class": ["small"]
				}
			}
		]
	}
}
