fix: assest depreciation ledger
This commit is contained in:
parent
b75f198648
commit
91e3c07d77
@ -47,21 +47,22 @@ def get_data(filters):
|
|||||||
|
|
||||||
for d in gl_entries:
|
for d in gl_entries:
|
||||||
asset_data = assets_details.get(d.against_voucher)
|
asset_data = assets_details.get(d.against_voucher)
|
||||||
if not asset_data.get("accumulated_depreciation_amount"):
|
if asset_data:
|
||||||
asset_data.accumulated_depreciation_amount = d.debit
|
if not asset_data.get("accumulated_depreciation_amount"):
|
||||||
else:
|
asset_data.accumulated_depreciation_amount = d.debit
|
||||||
asset_data.accumulated_depreciation_amount += d.debit
|
else:
|
||||||
|
asset_data.accumulated_depreciation_amount += d.debit
|
||||||
|
|
||||||
row = frappe._dict(asset_data)
|
row = frappe._dict(asset_data)
|
||||||
row.update({
|
row.update({
|
||||||
"depreciation_amount": d.debit,
|
"depreciation_amount": d.debit,
|
||||||
"depreciation_date": d.posting_date,
|
"depreciation_date": d.posting_date,
|
||||||
"amount_after_depreciation": (flt(row.gross_purchase_amount) -
|
"amount_after_depreciation": (flt(row.gross_purchase_amount) -
|
||||||
flt(row.accumulated_depreciation_amount)),
|
flt(row.accumulated_depreciation_amount)),
|
||||||
"depreciation_entry": d.voucher_no
|
"depreciation_entry": d.voucher_no
|
||||||
})
|
})
|
||||||
|
|
||||||
data.append(row)
|
data.append(row)
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user