Skip to content

Commit

Permalink
Merge pull request #43830 from ruthra-kumar/missing_bill_no_in_genera…
Browse files Browse the repository at this point in the history
…l_ledger

fix: set bill_no before `against_voucher` gets concatenated
  • Loading branch information
ruthra-kumar authored Oct 25, 2024
2 parents 91f6f75 + 7bade7f commit 8647c67
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions erpnext/accounts/report/general_ledger/general_ledger.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,10 +348,18 @@ def get_accounts_with_children(accounts):
return frappe.qb.from_(doctype).select(doctype.name).where(Criterion.any(conditions)).run(pluck=True)


def set_bill_no(gl_entries):
inv_details = get_supplier_invoice_details()
for gl in gl_entries:
gl["bill_no"] = inv_details.get(gl.get("against_voucher"), "")


def get_data_with_opening_closing(filters, account_details, accounting_dimensions, gl_entries):
data = []
totals_dict = get_totals_dict()

set_bill_no(gl_entries)

gle_map = initialize_gle_map(gl_entries, filters, totals_dict)

totals, entries = get_accountwise_gle(filters, accounting_dimensions, gl_entries, gle_map, totals_dict)
Expand Down Expand Up @@ -542,7 +550,6 @@ def get_account_type_map(company):

def get_result_as_list(data, filters):
balance, _balance_in_account_currency = 0, 0
inv_details = get_supplier_invoice_details()

for d in data:
if not d.get("posting_date"):
Expand All @@ -552,7 +559,6 @@ def get_result_as_list(data, filters):
d["balance"] = balance

d["account_currency"] = filters.account_currency
d["bill_no"] = inv_details.get(d.get("against_voucher"), "")

return data

Expand Down

0 comments on commit 8647c67

Please sign in to comment.