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
feat: Closing balance for period closing and reporting #34257
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deepeshgarg007
requested review from
nextchamp-saqib and
ruthra-kumar
as code owners
March 21, 2023 11:30
nabinhait
requested changes
Mar 22, 2023
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #34257 +/- ##
===========================================
+ Coverage 63.79% 63.80% +0.01%
===========================================
Files 809 810 +1
Lines 59347 59530 +183
===========================================
+ Hits 37859 37984 +125
- Misses 21488 21546 +58
|
nabinhait
approved these changes
Mar 24, 2023
deepeshgarg007
added a commit
that referenced
this pull request
Jul 10, 2023
* feat: Introduce opening entry for reporting (cherry picked from commit 9739d8b) * feat: Introduce opening entry for reporting (cherry picked from commit b44a19b) * fix: Add patches to create accounting dimension in Closing Balance (cherry picked from commit 36c08d0) * feat: Cascade closing balances on PCV submit (cherry picked from commit c3f39c3) # Conflicts: # erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py # erpnext/patches.txt * feat: Add views in standard filter (cherry picked from commit e18336e) * chore: Rewrite query using query builder (cherry picked from commit 7fa7d6b) # Conflicts: # erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py * feat: Add validations against period closing voucher (cherry picked from commit f92c63f) * fix: Order by issue in aggregation query (cherry picked from commit 6607c8b) * fix: Add patch to update closing balances (cherry picked from commit a663df3) * fix: Closing balance entries for period closing voucher (cherry picked from commit 436fc03) * fix: Update patch to generate closing balance entries (cherry picked from commit 95c9aaf) # Conflicts: # erpnext/patches.txt * perf: Apply closing balance in Trial Balance report (cherry picked from commit e5f603c) # Conflicts: # erpnext/accounts/report/trial_balance/trial_balance.py * chore: Minor fixes (cherry picked from commit c089c41) # Conflicts: # erpnext/patches.txt * fix: Aggregation with previous closing balance (cherry picked from commit 4a2046d) # Conflicts: # erpnext/patches.txt * test: Add static posting dates to tests (cherry picked from commit 310f71c) * chore: Add index to period closing voucher column (cherry picked from commit 5dabc98) * chore: rename Closing Balance to Account Closing Balance (cherry picked from commit 3249a79) * test: Add test case for closing balance (cherry picked from commit f0267fe) * chore: Use account closing balance in set gl entries (cherry picked from commit 0157fa1) # Conflicts: # erpnext/accounts/report/financial_statements.py * fix: Update patch (cherry picked from commit 76775a3) * fix: Account sub query (cherry picked from commit 7f11373) * chore: Simplify query (cherry picked from commit 00fe304) # Conflicts: # erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py * chore: Add missing validations (cherry picked from commit 0aadb68) * chore: Remove unnecessary list comprehension (cherry picked from commit 44053db) # Conflicts: # erpnext/accounts/report/financial_statements.py * fix: Ignore opening entries if PCV posted (cherry picked from commit f9397a8) # Conflicts: # erpnext/accounts/report/financial_statements.py * fix: Don't validate if no GL Entry exists (cherry picked from commit 528ab50) * chore: Fix Typo (cherry picked from commit 3fd9520) * fix: Validation for cancelation (cherry picked from commit 30eb6c8) * fix: Partial trial balance view (cherry picked from commit b7dcf27) * fix: CS financial statement param (cherry picked from commit f8cff09) * chore: Improve validation message (cherry picked from commit 8ce1da1) * chore: Resolve conflicts * chore: Resolve conflicts --------- Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
frappe-pr-bot
pushed a commit
that referenced
this pull request
Jul 11, 2023
# [14.30.0](v14.29.2...v14.30.0) (2023-07-11) ### Bug Fixes * accepted warehouse and rejected warehouse can't be same ([5d77e3c](5d77e3c)) * also check on_hold ([#35910](#35910)) ([59b3277](59b3277)) * conflicts ([e55a264](e55a264)) * conflicts ([79f9785](79f9785)) * conflicts ([a178e66](a178e66)) * conflicts ([6459c28](6459c28)) * deferred accounting entries on accounts frozen ([#35978](#35978)) ([573183c](573183c)) * Delivery Note return valuation ([296f312](296f312)) * German translations ([#35990](#35990)) ([b7b864e](b7b864e)) * incorrect status in MR created from PP (backport [#36085](#36085)) ([#36086](#36086)) ([6dc7a19](6dc7a19)) * incorrect TCS amount while customer has advance payment ([#35397](#35397)) ([2a4bbf3](2a4bbf3)) * labels and translations ([#35963](#35963)) ([04b1d45](04b1d45)) * Opening balance in presentation currency in Trial Balance report ([#36036](#36036)) ([39e38bf](39e38bf)) * payment entry `voucher_type` error ([#35779](#35779)) ([f3af0b2](f3af0b2)) * **Payment Entry:** compare rounded amount ([#36011](#36011)) ([d80b0aa](d80b0aa)) * possible type error on ERR creation ([0569899](0569899)) * precision causing outstanding issue on partly paid invoices ([#36030](#36030)) ([3e711e8](3e711e8)) * Share ledger showing cancelled docs ([#35993](#35993)) ([5102d0c](5102d0c)) * Validate for missing expense account ([#36078](#36078)) ([f4f886c](f4f886c)) * Vietnamese translation of "Company" ([#35887](#35887)) ([e443e6c](e443e6c)) ### Features * Closing balance for period closing and reporting ([#34257](#34257)) ([ebf3c01](ebf3c01))
@deepeshgarg007 , Can you help us as we can check this Use Case, Can you provide any List of Transactions or Flow we can check the same. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introducing a new doctype "Account Closing Balance" for calculating opening balances in Financial Statements
Adding this brings in some minor restrictions on the way users post accounting entries in ERPNext.
Since the calculation of the closing balances is tied to the period closing voucher, users won't be able to change any accounting entry or post opening-entries before the period closing voucher's posting date. Only once the period closing voucher is canceled previous entries can be updated.
This also has support for custom accounting dimensions so dimension-based filtering is also possible. If there are PCVs posted and no account closing balances have been created then by default GL entries are used for computation as per the current behavior
Why is this required?
Right now for calculating the opening balances or even account balances the reports and functions go through all the previous GLs (could be of just 1 fiscal year or 10 years for some) even when practically there is not much change in the entries
These reports and functions usually take a lot of time or fail for users dealing with more than a million GL entries, so pre-computing balances for such time frames help with such performance improvements.
On a typical site with 1.5 million GL entries running the trial balance report without "Account Closing Balance" the report takes around 21s whereas with "Account Closing Balance" it comes down to 8s
Before:
After:
ToDo List
no-docs