def METHOD_NAME(company_list, filters):
	db_so = frappe.qb.DocType("Sales Order")
	db_so_item = frappe.qb.DocType("Sales Order Item")
	query = (
		frappe.qb.from_(db_so)
		.inner_join(db_so_item)
		.on(db_so_item.parent == db_so.name)
		.select(
			db_so.name,
			db_so.customer,
			db_so.transaction_date,
			db_so.territory,
			db_so.project,
			db_so.company,
			db_so_item.item_code,
			db_so_item.description,
			db_so_item.qty,
			db_so_item.uom,
			db_so_item.base_rate,
			db_so_item.base_amount,
			db_so_item.delivered_qty,
			(db_so_item.billed_amt * db_so.conversion_rate).as_("billed_amt"),
		)
		.where(db_so.docstatus == 1)
		.where(db_so.company.isin(tuple(company_list)))
	)
	if filters.get("item_group"):
		query = query.where(db_so_item.item_group == filters.item_group)
	if filters.get("from_date"):
		query = query.where(db_so.transaction_date >= filters.from_date)
	if filters.get("to_date"):
		query = query.where(db_so.transaction_date <= filters.to_date)
	if filters.get("item_code"):
		query = query.where(db_so_item.item_code == filters.item_code)
	if filters.get("customer"):
		query = query.where(db_so.customer == filters.customer)
	return query.run(as_dict=1)