fix: Only add additional depreciation schedule row on sale if depreciation_amount > 0

(cherry picked from commit 9e7022830e)
This commit is contained in:
GangaManoj
2021-10-25 01:34:42 +05:30
committed by mergify-bot
parent 595d6c31b5
commit 92ebe52432

View File

@@ -230,6 +230,7 @@ class Asset(AccountsController):
depreciation_amount, days, months = self.get_pro_rata_amt(d, depreciation_amount, depreciation_amount, days, months = self.get_pro_rata_amt(d, depreciation_amount,
from_date, date_of_sale) from_date, date_of_sale)
if depreciation_amount > 0:
self.append("schedules", { self.append("schedules", {
"schedule_date": date_of_sale, "schedule_date": date_of_sale,
"depreciation_amount": depreciation_amount, "depreciation_amount": depreciation_amount,
@@ -237,6 +238,7 @@ class Asset(AccountsController):
"finance_book": d.finance_book, "finance_book": d.finance_book,
"finance_book_id": d.idx "finance_book_id": d.idx
}) })
break break
# For first row # For first row