chore: refactor get_depreciable_assets
This commit is contained in:
parent
1fd73af744
commit
187e1a324a
@ -36,9 +36,11 @@ def post_depreciation_entries(date=None, commit=True):
|
|||||||
def get_depreciable_assets(date):
|
def get_depreciable_assets(date):
|
||||||
return frappe.db.sql_list(
|
return frappe.db.sql_list(
|
||||||
"""select distinct a.name
|
"""select distinct a.name
|
||||||
from tabAsset a, `tabDepreciation Schedule` ds
|
from tabAsset a, `tabAsset Depreciation Schedule` ads, `tabDepreciation Schedule` ds
|
||||||
where a.name = ds.parent and a.docstatus=1 and ds.schedule_date<=%s and a.calculate_depreciation = 1
|
where a.name = ads.asset and ads.name = ds.parent and a.docstatus=1 and ads.docstatus=1
|
||||||
and a.status in ('Submitted', 'Partially Depreciated')
|
and a.status in ('Submitted', 'Partially Depreciated')
|
||||||
|
and a.calculate_depreciation = 1
|
||||||
|
and ds.schedule_date<=%s
|
||||||
and ifnull(ds.journal_entry, '')=''""",
|
and ifnull(ds.journal_entry, '')=''""",
|
||||||
date,
|
date,
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user