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 (backport #43093) #43185

Open
wants to merge 1 commit into
base: version-15-hotfix
Choose a base branch
from

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Sep 12, 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


This is an automatic backport of pull request #43093 done by Mergify.

* 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
Copy link
Contributor Author

mergify bot commented Sep 12, 2024

Cherry-pick of e07bc5a has failed:

On branch mergify/bp/version-15-hotfix/pr-43093
Your branch is up to date with 'origin/version-15-hotfix'.

You are currently cherry-picking commit e07bc5af41.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   erpnext/assets/doctype/asset/depreciation.py
	modified:   erpnext/assets/doctype/asset/test_asset.py

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   erpnext/assets/doctype/asset/asset.js

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

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.

1 participant