def METHOD_NAME(company, filters=None):
	cond = ""
	filters = frappe._dict(filters or {})
	if filters.include_default_book_entries:
		company_fb = frappe.get_cached_value("Company", company, "default_finance_book")
		cond = """ AND (finance_book in (%s, %s, '') OR finance_book IS NULL)
			""" % (
			frappe.db.escape(filters.finance_book),
			frappe.db.escape(company_fb),
		)
	else:
		cond = " AND (finance_book in (%s, '') OR finance_book IS NULL)" % (
			frappe.db.escape(cstr(filters.finance_book))
		)
	if filters.get("cost_center"):
		filters.cost_center = get_cost_centers_with_children(filters.cost_center)
		cond += " and cost_center in %(cost_center)s"
	gl_sum = frappe.db.sql_list(
		"""
		select sum(credit) - sum(debit)
		from `tabGL Entry`
		where company=%(company)s and posting_date >= %(start_date)s and posting_date <= %(end_date)s
			and voucher_type != 'Period Closing Voucher'
			and account in ( SELECT name FROM tabAccount WHERE account_type = %(account_type)s) {cond}
	""".format(
			cond=cond
		),
		filters,
	)
	return gl_sum[0] if gl_sum and gl_sum[0] else 0