Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: performance optimizations for accounting reports by refactoring account closing balance and period closing voucher #43435

Merged
merged 11 commits into from
Oct 23, 2024

Conversation

nabinhait
Copy link
Member

@nabinhait nabinhait commented Sep 30, 2024

Problem:

  • The Trial balance report was getting timed out after 30 mins
  • AR/AP reports were taking 15-20 mins
  • Account closing balance patch was taking too much time
  • The processing period for closing the voucher was taking too much time.
  • GL Entry form fields are not organized

Solutions:

  • Refactored account closing balance and period closing voucher code by processing GLE in chunk
  • Rewritten the closing balance patch
  • Optimized trial balance and AR/AP
  • Added indexes in GLE based on (party_type, party) and (company, posting_date)
  • Introduced "period start date" and "period end date" in PCV to handle monthly closing vouchers and written patches.
  • Organized fields in GLE

Result:

  • Trial Balance is running in 2 mins
  • AR/AP reports are running within a min
  • Account closing balance patch is running much faster than before

#no-docs

@nabinhait nabinhait force-pushed the accounting-reports-performance branch from bc05987 to b726ad7 Compare October 23, 2024 04:15
@nabinhait nabinhait merged commit 8b7e153 into frappe:develop Oct 23, 2024
18 checks passed
@nabinhait nabinhait deleted the accounting-reports-performance branch October 23, 2024 06:23
mergify bot pushed a commit that referenced this pull request Oct 23, 2024
… account closing balance and period closing voucher (#43435)

* fix: Gl Entry form cleanup

* fix: Added indexes in gl entry table

* perf: Refactored period closing voucher to handle large volume of gle

* fix: fixes as per new period start and end date fields in PCV

* perf: performance optimization for  accounting reports

* perf: performance optimizations for account closing balance patch

* fix: test cases

* fix: lenter issues - direct use of sql query

* fix: test cases

* fix: test cases

* fix: test cases

(cherry picked from commit 8b7e153)

# Conflicts:
#	erpnext/accounts/doctype/gl_entry/gl_entry.json
#	erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.json
#	erpnext/stock/report/test_reports.py
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant