{
  "name": "query/manager/order/order_row/sales_project_material.json",
  "database": "4d",
  "parameter": {
    "show_sql": false,
    "project": "",
    "record_type": "sales",
    "finished_state": ["LO", "PE"],
    "order_type": "TI"
  },
  "option":{
   "remove_empty_aggregate_row": true
  },
  "query": [
    ["ordr_delivery_state", "=", ""],
    "and",
    ["ord_project_id", "=", "project"],
    "and",
    ["ord_order_state", "not in", "finished_state"],
 		"and",
 		["ord_order_type", "=", "order_type"]
  ],
  "aggregate": {
    "sum": [
      "ordr_waiting_for_delivery",
      "ordr_order_amount"
    ]
  },
  "field": [
    "ordr_product_id",
    "ordr_waiting_for_delivery",
    "ordr_order_amount",
    "pr_work_number",
    "pr_product_type",
    "pr_stock_unit",
    "pr_name",
    "pr_stock_balance",
    "pr_minimum_order_amount",
    "pr_supplier_id",
    "pr_storable",
    "pr_json_data_free_amount",
    "pr_json_data_coming_amount",
    "pr_json_data_going_amount"
  ],
  "queryX": [
    ["ordr_delivery_state", "=", ""],
    "and",
    ["ord_project_id", "=", "project"],
    "and",
    ["ord_record_type", "=", "record_type"],
    "and",
    ["ord_order_state", "not in", "finished_state"],
 		"and",
 		["ord_order_type", "=", "order_type"]
  ]
}
