mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-21 07:38:29 +00:00
fix: do not recalculate depreciation on sale invoice cancellation for fully depreciated asset
This commit is contained in:
@@ -1370,8 +1370,9 @@ class SalesInvoice(SellingController):
|
|||||||
)
|
)
|
||||||
asset.db_set("disposal_date", None)
|
asset.db_set("disposal_date", None)
|
||||||
add_asset_activity(asset.name, _("Asset returned"))
|
add_asset_activity(asset.name, _("Asset returned"))
|
||||||
|
asset_status = asset.get_status()
|
||||||
|
|
||||||
if asset.calculate_depreciation:
|
if asset.calculate_depreciation and not asset_status == "Fully Depreciated":
|
||||||
posting_date = (
|
posting_date = (
|
||||||
frappe.db.get_value("Sales Invoice", self.return_against, "posting_date")
|
frappe.db.get_value("Sales Invoice", self.return_against, "posting_date")
|
||||||
if self.is_return
|
if self.is_return
|
||||||
|
|||||||
Reference in New Issue
Block a user