Skip to content

Commit

Permalink
fix: solve linter test failing
Browse files Browse the repository at this point in the history
  • Loading branch information
viralpatel15 authored Nov 4, 2023
1 parent 72d761f commit 0bf2f8c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion erpnext/assets/doctype/asset/depreciation.py
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,11 @@ def get_value_after_depreciation_on_disposal_date(asset, disposal_date, finance_
asset_doc = frappe.get_doc("Asset", asset)

if asset_doc.available_for_use_date > getdate(disposal_date):
frappe.throw("Disposal date {0} cannot be before available for use date {1} of the asset".format(disposal_date, asset_doc.available_for_use_date))
frappe.throw(

Check warning on line 784 in erpnext/assets/doctype/asset/depreciation.py

View check run for this annotation

Codecov / codecov/patch

erpnext/assets/doctype/asset/depreciation.py#L784

Added line #L784 was not covered by tests
"Disposal date {0} cannot be before available for use date {1} of the asset.".format(
disposal_date, asset_doc.available_for_use_date
)
)
elif asset_doc.available_for_use_date == getdate(disposal_date):
return flt(asset_doc.gross_purchase_amount - asset_doc.opening_accumulated_depreciation)

Check warning on line 790 in erpnext/assets/doctype/asset/depreciation.py

View check run for this annotation

Codecov / codecov/patch

erpnext/assets/doctype/asset/depreciation.py#L790

Added line #L790 was not covered by tests

Expand Down

0 comments on commit 0bf2f8c

Please sign in to comment.