{
  "name": "dialog/productivity_report/filter_lua.json",
  "wpa_time_period": {
     "info": "wpa_time_period",
     "info2": "shift: yv=1, av=2, iv=3, em=4",
     "info3": "iv or em shift can be within next day, but it isn't next day work shift",
     "info4": "yv shift can be within pevious day, but it is time period work shift",
     "table": "wpa",
     "rule": [
       ["wpa_date_", ">=", "param.start_prev_date"],
       ["wpa_date_", "<=", "param.end_next_date"],
       [[["wpa_date_", "<>", "param.start_date"], "or", ["wpa_end_time", ">=", "12:00:00"], "or", ["wpa_shift_number", "<", 3]]],
       [[["wpa_date_", "<>", "param.end_date"], "or", ["wpa_end_time", "<=", "12:00:00"], "or", ["wpa_shift_number", "<>", 1]]],
       [[["wpa_date_", "<>", "param.start_prev_date"], "or", ["wpa_end_time", ">", "12:00:00"]]],
       [[["wpa_date_", "<>", "param.start_prev_date"], "or", ["wpa_shift_number", "==", 1]]],
       [[["wpa_date_", "<>", "param.end_next_date"], "or", ["wpa_end_time", "<", "12:00:00"]]],
       [[["wpa_date_", "<>", "param.end_next_date"], "or", ["wpa_shift_number", ">=", 3]]]
     ]
   },
  "wos_production_lot_phase": [
    {
      "info": "wos_production_lot_phase",
      "table": "wos",
      "rule": [
       ["wos_production_lot", "==", "param.wpa_production_lot"],
       ["wos_work_phase", "==", "param.wpa_work_phase_est_id"]
      ]
    }
  ],
  "wpe_work_phase": [
    {
      "info": "wpe_work_phase",
      "table": "wpe",
      "rule": [
       ["wpe_work__position_num_id", "==", "param.wo_work__position_num_id"],
       ["wpe_phase_number", "==", "param.wpa_work_phase_est_id"]
      ]
    }
  ],
  "wpa_previous_work_order": [
    {
      "info": "wos_production_lot_phase",
      "table": "wpa",
      "rule": [
       ["wpa_measured_track_time", ">", 0],
       ["wpa_work__position_num_id", "==", "param.wpa_work__position_num_id"],
       ["wpa_work_phase_est_id", "==", "param.wpa_work_phase_est_id"],
       ["wo_row_number", "==", "param.wo_row_number"]
      ]
    }
  ],
  "wpa_speed": [
    {
      "info": "type",
      "table": "wpa",
      "rule": [
        ["wpa_type_", "<>", "OA"]
      ]
    },
    {
     "info": "wpa_time_period",
     "info2": "shift: yv=1, av=2, iv=3, em=4",
     "info3": "iv or em shift can be within next day, but it isn't next day work shift",
     "info4": "yv shift can be within pevious day, but it is time period work shift",
     "table": "wpa",
     "rule": "wpa_time_period"
    }
  ],
  "wpa_track_time": [
   {
     "info": "type",
     "table": "wpa",
     "rule": [
       ["wpa_type_", "==", "OA"],
       ["wlg_follow_track_time", ">", 0]
     ]
   },
   {
     "info": "time_period",
     "table": "wpa",
     "rule": [
       ["wpa_date_", ">=", "param.start_date"],
       ["wpa_date_", "<=", "param.end_date"]
     ]
   }
  ]
}
