def METHOD_NAME(doctype, txt, searchfield, start, page_len, filters):
	query_filters = {}
	if txt:
		query_filters["batch_no"] = ["like", f"%{txt}%"]
	if filters.get("voucher_no"):
		serial_batch_bundle = frappe.get_cached_value(
			"Serial and Batch Bundle",
			{"voucher_no": ("in", filters.get("voucher_no")), "docstatus": 1, "is_cancelled": 0},
			"name",
		)
		query_filters["parent"] = serial_batch_bundle
		if not txt:
			query_filters["batch_no"] = ("is", "set")
		return frappe.get_all(
			"Serial and Batch Entry", filters=query_filters, fields=["batch_no"], as_list=True
		)
	else:
		query_filters["item"] = filters.get("item_code")
		return frappe.get_all("Batch", filters=query_filters, as_list=True)