mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-22 16:18:30 +00:00
fix: update additional cost and total asset cost after asset repair (#47233)
* fix: add consumed stock's cost to the asset value after repair
* fix: do not copy additional cost and total asset cost
(cherry picked from commit ed8a8532e1)
Co-authored-by: Khushi Rawat <142375893+khushi8112@users.noreply.github.com>
This commit is contained in:
@@ -512,6 +512,7 @@
|
|||||||
"fieldname": "total_asset_cost",
|
"fieldname": "total_asset_cost",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"label": "Total Asset Cost",
|
"label": "Total Asset Cost",
|
||||||
|
"no_copy": 1,
|
||||||
"options": "Company:company:default_currency",
|
"options": "Company:company:default_currency",
|
||||||
"read_only": 1
|
"read_only": 1
|
||||||
},
|
},
|
||||||
@@ -520,6 +521,7 @@
|
|||||||
"fieldname": "additional_asset_cost",
|
"fieldname": "additional_asset_cost",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"label": "Additional Asset Cost",
|
"label": "Additional Asset Cost",
|
||||||
|
"no_copy": 1,
|
||||||
"options": "Company:company:default_currency",
|
"options": "Company:company:default_currency",
|
||||||
"read_only": 1
|
"read_only": 1
|
||||||
},
|
},
|
||||||
@@ -593,7 +595,7 @@
|
|||||||
"link_fieldname": "target_asset"
|
"link_fieldname": "target_asset"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"modified": "2025-04-15 16:33:17.189524",
|
"modified": "2025-04-24 15:31:47.373274",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Assets",
|
"module": "Assets",
|
||||||
"name": "Asset",
|
"name": "Asset",
|
||||||
|
|||||||
@@ -98,9 +98,11 @@ class AssetRepair(AccountsController):
|
|||||||
|
|
||||||
self.increase_asset_value()
|
self.increase_asset_value()
|
||||||
|
|
||||||
|
total_repair_cost = self.get_total_value_of_stock_consumed()
|
||||||
if self.capitalize_repair_cost:
|
if self.capitalize_repair_cost:
|
||||||
self.asset_doc.total_asset_cost += self.repair_cost
|
total_repair_cost += self.repair_cost
|
||||||
self.asset_doc.additional_asset_cost += self.repair_cost
|
self.asset_doc.total_asset_cost += total_repair_cost
|
||||||
|
self.asset_doc.additional_asset_cost += total_repair_cost
|
||||||
|
|
||||||
if self.get("stock_consumption"):
|
if self.get("stock_consumption"):
|
||||||
self.check_for_stock_items_and_warehouse()
|
self.check_for_stock_items_and_warehouse()
|
||||||
@@ -139,9 +141,11 @@ class AssetRepair(AccountsController):
|
|||||||
|
|
||||||
self.decrease_asset_value()
|
self.decrease_asset_value()
|
||||||
|
|
||||||
|
total_repair_cost = self.get_total_value_of_stock_consumed()
|
||||||
if self.capitalize_repair_cost:
|
if self.capitalize_repair_cost:
|
||||||
self.asset_doc.total_asset_cost -= self.repair_cost
|
total_repair_cost += self.repair_cost
|
||||||
self.asset_doc.additional_asset_cost -= self.repair_cost
|
self.asset_doc.total_asset_cost -= total_repair_cost
|
||||||
|
self.asset_doc.additional_asset_cost -= total_repair_cost
|
||||||
|
|
||||||
if self.get("capitalize_repair_cost"):
|
if self.get("capitalize_repair_cost"):
|
||||||
self.ignore_linked_doctypes = ("GL Entry", "Stock Ledger Entry")
|
self.ignore_linked_doctypes = ("GL Entry", "Stock Ledger Entry")
|
||||||
|
|||||||
Reference in New Issue
Block a user