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

feat: validating asset scrap date #43093

Merged
merged 4 commits into from
Sep 12, 2024

Conversation

rahulgupta8848
Copy link
Contributor

@rahulgupta8848 rahulgupta8848 commented Sep 6, 2024

Background/Context

  1. When we select Asset Scrapping, the system by default takes the current date and scraps the asset as on the date
  2. In case the company wants to scrap their asset with backdated effect, then that cannot be achieved in the present system as there is no option to select the scrap date anywhere.
  3. Also, there is no restriction on scrapping the asset even if depreciation entries are posted

Solution Summary

  1. If a user wants to scrap an asset, then the system will ask for a scrapping date (as shown in the below screenshot).
  2. According to the date entered by the user, the asset will be scrapped on that date with back dated effect.
  3. The scrapping date cannot be before the purchase date or it cannot be after the current date. Also, If the depreciation entries are passed, asset can only be scrap after the last depreciation date and not before it. In such cases depreciation entry needs to be manually cancelled first and then scrapping can be possible.

image

#no-docs

erpnext/assets/doctype/asset/asset.py Outdated Show resolved Hide resolved
erpnext/assets/doctype/asset/depreciation.py Outdated Show resolved Hide resolved
erpnext/assets/doctype/asset/asset.js Outdated Show resolved Hide resolved
erpnext/assets/doctype/asset/asset.js Outdated Show resolved Hide resolved
erpnext/assets/doctype/asset/test_asset.py Outdated Show resolved Hide resolved
erpnext/assets/doctype/asset/test_asset.py Outdated Show resolved Hide resolved
@rahulgupta8848
Copy link
Contributor Author

@nabinhait i have implemented all the suggested changes please look into it

@nabinhait nabinhait enabled auto-merge (squash) September 12, 2024 06:07
@nabinhait nabinhait merged commit e07bc5a into frappe:develop Sep 12, 2024
18 checks passed
mergify bot pushed a commit that referenced this pull request Sep 12, 2024
* feat: validating asset scrap date

* refactor: refactorization of scrap asset function

---------

Co-authored-by: “rahulgupta8848” <“rahul.gupta@8848digital.com”>
(cherry picked from commit e07bc5a)

# Conflicts:
#	erpnext/assets/doctype/asset/asset.js
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.

2 participants