{
	"name": "wpa/update_started_work_phase_work_time.json",
  "info_fi": "Kuormitusryhmän 'seurataan työn  etenemistä' on oltava päällä ja lisäksi tot. työvaiheen tyyppi on oltava AL tai ET-tyyppiset tot työvaiheet joiden alatyyppi=AL",
  "database": "4d",
	"parameter": {
		"show_sql": false
	},
  "queryZZ": [
    [
      "wpa_work_load_group_id",
      "=",
      "BW1"
    ]
  ],
  "query": [
    [
      "wpa_start_date",
      ">=",
      "2015-01-01"
    ],
    "and",
    [
      "wlg_follow_work_progression",
      "=",
      1
    ],
    "and",
    "query_started",
    "and",
    "query_wo_open"
  ],
  "set": {
    "query_wo_open": [
      "wo_state",
			"in",
			[
				"EK",
				"KU",
				"AL",
				"PY"
			]
    ],
    "query_started": [
      [
        "wpa_type_",
        "=",
        "AL"
      ],
      "or",
      "query_unproductive_started"
    ],
    "query_unproductive_started": [
      [
        "wpa_type_",
        "=",
        "ET"
      ],
      "and",
      [
        "wpa_subtype",
        "=",
        "AL"
      ]
    ],
    "query_productive_started": [
      "wpa_type_",
      "=",
      "AL"
    ],
    "query_started_test": [
      "query_productive_started",
      "or",
      "query_unproductive_started"
    ]
  },
  "set_all": [
    [
      "wpa_type_",
      "=",
      "AL"
    ],
    "or",
    [
      "wpa_type_",
      "=",
      "ET"
    ],
    "and",
    [
      "wpa_subtype",
      "=",
      "AL"
    ]
  ],
  "query_with_many_set": [
    [
      "wpa_start_date",
      ">=",
      "2015-01-01"
    ],
    "and",
    [
      "wlg_follow_work_progression",
      "=",
      1
    ],
    "and",
    "query_started"
  ],
  "query_orig": [
    [
      "wpa_start_date",
      ">=",
      "2015-01-01"
    ],
    "and",
    [
      "wlg_follow_work_progression",
      "=",
      1
    ],
    "and",
    [
      "wpa_type_",
      "=",
      "AL"
    ]
  ],
  "query_test_not_working": [
    [
      "wpa_start_date",
      ">=",
      "2015-01-01"
    ],
    "and",
    [
      "wlg_follow_work_progression",
      "=",
      1
    ],
    "and",
    [
      [
        "wpa_type_",
        "=",
        "AL"
      ],
      "or",
      [
        [
          "wpa_type_",
          "=",
          "ET"
        ],
        "and",
        [
          "wpa_subtype",
          "=",
          "AL"
        ]
      ]
    ]
  ],
  "field": [
    "wpa_start_date",
    "wpa_start_time",
    "wpa_date_",
    "wpa_end_time",
    "wpa_start_shift_number",
    "wpa_shift_number",
    "wpa_work_load_group_id",
    "wpa_production_lot",
    "wpa_work_phase_est_id",
    "wpa_type_",
    "wpa_subtype",
    "wpa_start_employee_id",
    "wpa_program_id",
    "wpa_additional_data",
    "wpa_info",
    "wpa_record_id",
    "wpa_change_id",
    "wpa_work_time__amount",
    "wpa_social_cost_multiplier",
    "wpa_work_description",
    "wpa_profit_multiplier",
    "wpa_setup_salary__hour",
    "wpa_salary__hour",
    "wpa_machine_setup_cost__hour",
    "wpa_machine_work_cost__hour",
    "wpa_salary_bonus",
    "wpa_work__position_num_id",
    "wpa_start_subtype",
    "wpa_machine_hours",
		"wpa_setup_time__amount",
		"wpa_night_work_hours"
  ],
  "fieldXX": [
    "wlg_automatic_receipt_delay"
  ]
}
