mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-29 18:04:46 +00:00
fix: Only add additional depreciation schedule row on sale if depreciation_amount > 0
(cherry picked from commit 9e7022830e)
This commit is contained in:
@@ -230,13 +230,15 @@ 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)
|
||||||
|
|
||||||
self.append("schedules", {
|
if depreciation_amount > 0:
|
||||||
"schedule_date": date_of_sale,
|
self.append("schedules", {
|
||||||
"depreciation_amount": depreciation_amount,
|
"schedule_date": date_of_sale,
|
||||||
"depreciation_method": d.depreciation_method,
|
"depreciation_amount": depreciation_amount,
|
||||||
"finance_book": d.finance_book,
|
"depreciation_method": d.depreciation_method,
|
||||||
"finance_book_id": d.idx
|
"finance_book": d.finance_book,
|
||||||
})
|
"finance_book_id": d.idx
|
||||||
|
})
|
||||||
|
|
||||||
break
|
break
|
||||||
|
|
||||||
# For first row
|
# For first row
|
||||||
|
|||||||
Reference in New Issue
Block a user