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: incorrect net profit in Profit and Loss Statement #38969

Merged
merged 2 commits into from
Dec 28, 2023

Conversation

ruthra-kumar
Copy link
Member

@ruthra-kumar ruthra-kumar commented Dec 27, 2023

When Accumulated Values filter is enabled, P&L reported incorrect Net Profit amount. When it's enabled, each period has a running balance in the report. So, picking the last period's balance should be enough, rather than summing all of them.

Todo:

  • add test case

before

Screenshot 2023-12-27 at 4 51 56 PM

after

Screenshot 2023-12-27 at 4 52 17 PM

@github-actions github-actions bot added the needs-tests This PR needs automated unit-tests. label Dec 27, 2023
Copy link

codecov bot commented Dec 27, 2023

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (a09241e) 60.19% compared to head (d54f831) 60.20%.
Report is 86 commits behind head on develop.

❗ Current head d54f831 differs from pull request most recent head 8555617. Consider uploading reports for the commit 8555617 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #38969      +/-   ##
===========================================
+ Coverage    60.19%   60.20%   +0.01%     
===========================================
  Files          759      759              
  Lines        69767    69921     +154     
===========================================
+ Hits         41995    42098     +103     
- Misses       27772    27823      +51     
Files Coverage Δ
.../report/accounts_receivable/accounts_receivable.py 89.73% <100.00%> (+0.05%) ⬆️
erpnext/controllers/item_variant.py 68.62% <100.00%> (-2.73%) ⬇️
erpnext/controllers/selling_controller.py 79.94% <100.00%> (ø)
...cturing/doctype/production_plan/production_plan.py 80.75% <100.00%> (+0.58%) ⬆️
...stock/doctype/material_request/material_request.py 69.67% <100.00%> (ø)
...wise_balance_history/batch_wise_balance_history.py 74.69% <100.00%> (+0.94%) ⬆️
erpnext/accounts/report/financial_statements.py 80.00% <71.42%> (-0.50%) ⬇️
...it_and_loss_statement/profit_and_loss_statement.py 69.41% <69.23%> (-5.92%) ⬇️

... and 22 files with indirect coverage changes

@ruthra-kumar ruthra-kumar marked this pull request as draft December 27, 2023 12:02
@ruthra-kumar ruthra-kumar changed the title fix: incorrect net profit in Profit and Loss report fix: incorrect net profit in Profit and Loss Statement Dec 27, 2023
@ruthra-kumar ruthra-kumar added backport version-15-hotfix and removed needs-tests This PR needs automated unit-tests. labels Dec 28, 2023
@ruthra-kumar ruthra-kumar marked this pull request as ready for review December 28, 2023 10:44
@ruthra-kumar
Copy link
Member Author

@ruthra-kumar ruthra-kumar merged commit 915d864 into frappe:develop Dec 28, 2023
13 of 14 checks passed
ruthra-kumar added a commit that referenced this pull request Dec 28, 2023
…-38969

fix: incorrect net profit in Profit and Loss Statement (backport #38969)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 16, 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