From a50ecffb6917ed992771bc3fabcba8b62d6fab6b Mon Sep 17 00:00:00 2001 From: GangaManoj Date: Wed, 1 Dec 2021 21:46:09 +0530 Subject: [PATCH] fix: Fix depreciation_amount calculation (cherry picked from commit 22cc8d22462d50ef134651e7df2c36564fb7edf6) # Conflicts: # erpnext/regional/india/utils.py --- erpnext/regional/india/utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/erpnext/regional/india/utils.py b/erpnext/regional/india/utils.py index d47242e2f98..19d0781f5df 100644 --- a/erpnext/regional/india/utils.py +++ b/erpnext/regional/india/utils.py @@ -838,12 +838,16 @@ def update_taxable_values(doc, method): doc.get('items')[item_count - 1].taxable_value += diff def get_depreciation_amount(asset, depreciable_value, row): - depreciation_left = flt(row.total_number_of_depreciations) - flt(asset.number_of_depreciations_booked) + depreciation_left = flt(row.total_number_of_depreciations) if row.depreciation_method in ("Straight Line", "Manual"): # if the Depreciation Schedule is being prepared for the first time if not asset.flags.increase_in_asset_life: +<<<<<<< HEAD depreciation_amount = (flt(row.value_after_depreciation) - +======= + depreciation_amount = (flt(asset.gross_purchase_amount) - +>>>>>>> 22cc8d2246 (fix: Fix depreciation_amount calculation) flt(row.expected_value_after_useful_life)) / depreciation_left # if the Depreciation Schedule is being modified after Asset Repair