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: first depreciation amount in asset #29385

Merged
merged 3 commits into from
Jan 21, 2022

Conversation

nextchamp-saqib
Copy link
Member

@nextchamp-saqib nextchamp-saqib commented Jan 21, 2022

Asset Price = 10,00,000
Available for Use Date = 25-07-2021
Depreciation

  • Straight Line
  • No. of Depr = 36
  • Freq = 1
  • Depr Start Date = 31-07-2021

If you submit the asset, the first depreciation amount is calculated as 5,376 which is 896 * 6, where 896 is per day depreciation amount and 6 is the no. of days from 25-07-2021 to 31-07-2021

The no. of days is incorrect since 25-07-2021 to 31-07-2021 is actually 7 days, including 25th hence the 5,376 value is incorrect


While selling an asset without any depreciation, the depreciation amount is calculated excluding the available for use date so a similar problem exists.

@github-actions github-actions bot added the needs-tests This PR needs automated unit-tests. label Jan 21, 2022
@nextchamp-saqib nextchamp-saqib added backport version-13-hotfix and removed needs-tests This PR needs automated unit-tests. labels Jan 21, 2022
@codecov
Copy link

codecov bot commented Jan 21, 2022

Codecov Report

Merging #29385 (ae580d1) into develop (5ae44f3) will decrease coverage by 0.28%.
The diff coverage is 50.00%.

@@             Coverage Diff             @@
##           develop   #29385      +/-   ##
===========================================
- Coverage    58.06%   57.77%   -0.29%     
===========================================
  Files         1110     1091      -19     
  Lines        68067    67882     -185     
===========================================
- Hits         39523    39219     -304     
- Misses       28544    28663     +119     
Impacted Files Coverage Δ
erpnext/assets/doctype/asset/asset.py 75.33% <50.00%> (+0.04%) ⬆️
...unts/report/purchase_register/purchase_register.py 32.19% <0.00%> (-41.10%) ⬇️
...ext/accounts/report/balance_sheet/balance_sheet.py 36.36% <0.00%> (-21.82%) ⬇️
...e_purchase_register/item_wise_purchase_register.py 58.00% <0.00%> (-17.00%) ⬇️
...em_wise_sales_register/item_wise_sales_register.py 51.36% <0.00%> (-11.82%) ⬇️
erpnext/stock/doctype/price_list/price_list.py 62.74% <0.00%> (-11.77%) ⬇️
...t/accounts/report/sales_register/sales_register.py 71.51% <0.00%> (-9.10%) ⬇️
...pnext/accounts/report/gross_profit/gross_profit.py 82.49% <0.00%> (-6.23%) ⬇️
...work_order_stock_report/work_order_stock_report.py 94.11% <0.00%> (-5.89%) ⬇️
...t/payroll/doctype/payroll_period/payroll_period.py 64.81% <0.00%> (-5.56%) ⬇️
... and 45 more

@nextchamp-saqib nextchamp-saqib merged commit c7e75f9 into frappe:develop Jan 21, 2022
nextchamp-saqib added a commit that referenced this pull request Jan 21, 2022
…-29385

fix: first depreciation amount in asset (backport #29385)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant