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

fix: make offsetting entry for acc dimensions in general ledger #36149

Merged

Conversation

GursheenK
Copy link
Member

@GursheenK GursheenK commented Jul 15, 2023

Problem
When multiple GL entries are posted against documents like Invoices, Journal Entries, Payment Entries, etc. with different values for one or multiple accounting dimensions, the accounts are balanced and show the correct values. However, when these entries are filtered using the accounting dimensions, the Debit and Credit values do not match because the corresponding entry can have a different value for the same accounting dimension.

Solution
An offsetting entry is posted for each accounting dimension that has more than one value in the gl_map. An option to automatically make an offsetting entry is added to the Accounting Dimension document. When enabled, the user has to choose an offsetting account which will be used for the extra entries.

Screenshot 2023-07-15 at 7 39 00 PM

Example
For a Journal Entry where ₹‎1000 is transferred from Branch Delhi to Branch Mumbai, only 2 GL entries were made. In such a case the Trial Balance Report filtered using the Accounting Dimension Branch is not balanced.

Screenshot 2023-07-15 at 7 44 18 PM

Now, if we enable the Automatically post balancing accounting entry for the Accounting Dimension Branch and select an Offsetting Account from the Accounting Dimension Doctype, for a Journal Entry where ₹‎1000 is transferred from Branch Delhi to Branch Mumbai, 4 GL entries are made -

Screenshot 2023-07-15 at 7 49 11 PM

The Trial Balance is now balanced whenever Journal Entries are made and filtered using Accounting Dimensions.

Screenshot 2023-07-15 at 7 59 10 PM

@github-actions github-actions bot added the needs-tests This PR needs automated unit-tests. label Jul 15, 2023
@codecov
Copy link

codecov bot commented Jul 17, 2023

Codecov Report

Merging #36149 (f999b75) into develop (3b58055) will increase coverage by 0.35%.
Report is 2 commits behind head on develop.
The diff coverage is 96.96%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #36149      +/-   ##
===========================================
+ Coverage    64.33%   64.69%   +0.35%     
===========================================
  Files          786      786              
  Lines        61078    61111      +33     
===========================================
+ Hits         39295    39536     +241     
+ Misses       21783    21575     -208     
Files Changed Coverage Δ
...ext/accounts/report/trial_balance/trial_balance.py 81.97% <ø> (+81.97%) ⬆️
...ctype/accounting_dimension/accounting_dimension.py 65.03% <85.71%> (+1.06%) ⬆️
erpnext/accounts/general_ledger.py 94.42% <100.00%> (+0.51%) ⬆️

... and 3 files with indirect coverage changes

@GursheenK GursheenK changed the title fix: make offsetting entry for acc dimensions in JV fix: make offsetting entry for acc dimensions in general ledger Jul 17, 2023
@GursheenK GursheenK marked this pull request as ready for review July 19, 2023 13:16
@deepeshgarg007 deepeshgarg007 merged commit caad453 into frappe:develop Jul 29, 2023
12 checks passed
@deepeshgarg007 deepeshgarg007 added the backport version-14-hotfix backport to version 14 label Aug 18, 2023
deepeshgarg007 added a commit that referenced this pull request Aug 21, 2023
…-36149

fix: make offsetting entry for acc dimensions in general ledger (#36149)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport version-14-hotfix backport to version 14 needs-tests This PR needs automated unit-tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants