Skip to content

Commit

Permalink
fix: incorrect gl balance on multi company setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ruthra-kumar committed Aug 21, 2023
1 parent 37cee42 commit cb9aad3
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def get_data(self, args):
)

if self.filters.show_gl_balance:
gl_balance_map = get_gl_balance(self.filters.report_date)
gl_balance_map = get_gl_balance(self.filters.report_date, self.filters.company)

for party, party_dict in self.party_total.items():
if party_dict.outstanding == 0:
Expand Down Expand Up @@ -232,12 +232,12 @@ def setup_ageing_columns(self):
self.add_column(label="Total Amount Due", fieldname="total_due")


def get_gl_balance(report_date):
def get_gl_balance(report_date, company):
return frappe._dict(
frappe.db.get_all(
"GL Entry",
fields=["party", "sum(debit - credit)"],
filters={"posting_date": ("<=", report_date), "is_cancelled": 0},
filters={"posting_date": ("<=", report_date), "is_cancelled": 0, "company": company},
group_by="party",
as_list=1,
)
Expand Down

0 comments on commit cb9aad3

Please sign in to comment.