mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-09 08:11:19 +00:00
fix: make rate of depreciation mandatory
This commit is contained in:
@@ -805,10 +805,10 @@ class Asset(AccountsController):
|
|||||||
):
|
):
|
||||||
return args.get("rate_of_depreciation")
|
return args.get("rate_of_depreciation")
|
||||||
|
|
||||||
if self.flags.increase_in_asset_value_due_to_repair:
|
if args.get("rate_of_depreciation") and not flt(args.get("expected_value_after_useful_life")):
|
||||||
if not flt(args.get("expected_value_after_useful_life")):
|
return args.get("rate_of_depreciation")
|
||||||
return args.get("rate_of_depreciation")
|
|
||||||
|
|
||||||
|
if self.flags.increase_in_asset_value_due_to_repair:
|
||||||
value = flt(args.get("expected_value_after_useful_life")) / flt(
|
value = flt(args.get("expected_value_after_useful_life")) / flt(
|
||||||
args.get("value_after_depreciation")
|
args.get("value_after_depreciation")
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -88,7 +88,8 @@
|
|||||||
"depends_on": "eval:doc.depreciation_method == 'Written Down Value'",
|
"depends_on": "eval:doc.depreciation_method == 'Written Down Value'",
|
||||||
"fieldname": "rate_of_depreciation",
|
"fieldname": "rate_of_depreciation",
|
||||||
"fieldtype": "Percent",
|
"fieldtype": "Percent",
|
||||||
"label": "Rate of Depreciation (%)"
|
"label": "Rate of Depreciation (%)",
|
||||||
|
"mandatory_depends_on": "eval:doc.depreciation_method == 'Written Down Value'"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "salvage_value_percentage",
|
"fieldname": "salvage_value_percentage",
|
||||||
@@ -128,7 +129,7 @@
|
|||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2024-11-29 14:36:54.399034",
|
"modified": "2024-12-13 12:11:03.743209",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Assets",
|
"module": "Assets",
|
||||||
"name": "Asset Finance Book",
|
"name": "Asset Finance Book",
|
||||||
|
|||||||
Reference in New Issue
Block a user