{
  "database": "4d",
  "name":"query/wos/work_order_schedule_state/query.json",
  "optional_parameter":["order_number", "selection_id"],
  "parameter":{
    "order_number": "",
    "selection_id": [],
    "show_sql": true
  },
  "set": {
    "qry_set":[
      ["so_customer_order_number", "starts", "order_number"],
      "or",
      ["so_sales_order_id", "starts", "order_number"],
      "or",
      ["so_company_id", "starts", "order_number"]
    ]
  },
  "query": [
    "qry_set",
    "and",
    ["wos_work_phase", ">", 0],
    "and",
    ["sor_delivery_state", "=", ""]
  ],
  "order": ["wo_sales_order_id", ">", "wos_work_phase", ">","wos_production_lot", ">"],
  "limit": 1000,
  "qry_set_not_in_use": [
    ["wos_production_lot", "starts", "order_number"],
    "or",
    ["so_record_id", "in", "selection_id"]
  ]
}
