Skip to content

Commit

Permalink
Merge pull request #896 from fproldan/diamoerp-staging
Browse files Browse the repository at this point in the history
feat: opening balance (#894) (#895)
  • Loading branch information
fproldan authored Dec 6, 2024
2 parents 0976608 + 33f10bf commit 394eef7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions erpnext/accounts/report/trial_balance/trial_balance.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,19 @@ def get_data(filters):
return data

def get_opening_balances(filters):
from erpnext.accounts.report.utils import convert, get_currency
balance_sheet_opening = get_rootwise_opening_balances(filters, "Balance Sheet")
pl_opening = get_rootwise_opening_balances(filters, "Profit and Loss")

balance_sheet_opening.update(pl_opening)

currency_filters = get_currency(filters)

if filters and filters.get('presentation_currency'):
for k, v in balance_sheet_opening.items():
v["opening_debit"] = convert(flt(v["opening_debit"]), currency_filters.get("presentation_currency"), currency_filters.get("company_currency"), currency_filters.get("report_date"))
v["opening_credit"] = convert(flt(v["opening_credit"]), currency_filters.get("presentation_currency"), currency_filters.get("company_currency"), currency_filters.get("report_date"))

return balance_sheet_opening


Expand Down

0 comments on commit 394eef7

Please sign in to comment.