Merge pull request #26323 from deepeshgarg007/multi-company-deferred-revenue_develop

fix: Auto process deferred accounting for multi-company setup
This commit is contained in:
Deepesh Garg
2021-07-06 16:55:55 +05:30
committed by GitHub

View File

@@ -301,9 +301,13 @@ def process_deferred_accounting(posting_date=None):
start_date = add_months(today(), -1) start_date = add_months(today(), -1)
end_date = add_days(today(), -1) end_date = add_days(today(), -1)
companies = frappe.get_all('Company')
for company in companies:
for record_type in ('Income', 'Expense'): for record_type in ('Income', 'Expense'):
doc = frappe.get_doc(dict( doc = frappe.get_doc(dict(
doctype='Process Deferred Accounting', doctype='Process Deferred Accounting',
company=company.name,
posting_date=posting_date, posting_date=posting_date,
start_date=start_date, start_date=start_date,
end_date=end_date, end_date=end_date,