Skip to content

Commit

Permalink
fix: generate pdf only when result exists
Browse files Browse the repository at this point in the history
  • Loading branch information
GursheenK committed Aug 28, 2023
1 parent 5c2a949 commit f07f4ce
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,18 @@ def get_report_pdf(doc, consolidated=True):

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)

Expand Down

0 comments on commit f07f4ce

Please sign in to comment.