fix: generate pdf only when result exists
diff --git a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py
index b35d237..cace967 100644
--- a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py
+++ b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py
@@ -65,19 +65,17 @@
 		filters = get_common_filters(doc)
 
 		if doc.report == "General Ledger":
-			filters.update(get_gl_filters(doc, entry, tax_id, presentation_currency))
-		else:
-			filters.update(get_ar_filters(doc, entry))
-
-		if doc.report == "General Ledger":
 			col, res = get_soa(filters)
 			for x in [0, -2, -1]:
 				res[x]["account"] = res[x]["account"].replace("'", "")
 			if len(res) == 3:
 				continue
 		else:
+			filters.update(get_ar_filters(doc, entry))
 			ar_res = get_ar_soa(filters)
 			col, res = ar_res[0], ar_res[1]
+			if not res:
+				continue
 
 		statement_dict[entry.customer] = get_html(doc, filters, entry, col, res, ageing)