From 963ddac528daa6ac9694757af704282f9bd22262 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 13 Feb 2024 09:40:57 +0530 Subject: [PATCH] fix: Adjust amount in last row due to rounding --- erpnext/assets/doctype/asset/asset.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/erpnext/assets/doctype/asset/asset.py b/erpnext/assets/doctype/asset/asset.py index 3fcb9720dd1..4560d098cd7 100644 --- a/erpnext/assets/doctype/asset/asset.py +++ b/erpnext/assets/doctype/asset/asset.py @@ -513,14 +513,14 @@ class Asset(AccountsController): ) # Adjust depreciation amount in the last period based on the expected value after useful life - if finance_book.expected_value_after_useful_life and ( + if ( ( n == cint(final_number_of_depreciations) - 1 - and value_after_depreciation != finance_book.expected_value_after_useful_life + and flt(value_after_depreciation) != flt(finance_book.expected_value_after_useful_life) ) - or value_after_depreciation < finance_book.expected_value_after_useful_life + or flt(value_after_depreciation) < flt(finance_book.expected_value_after_useful_life) ): - depreciation_amount += value_after_depreciation - finance_book.expected_value_after_useful_life + depreciation_amount += flt(value_after_depreciation) - flt(finance_book.expected_value_after_useful_life) skip_row = True if flt(depreciation_amount, self.precision("gross_purchase_amount")) > 0: