From 27af6b377fb77bcf869714dac50d81677998d54c Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 8 Feb 2019 16:52:13 +0530 Subject: [PATCH] fix: defered accounting fixes --- erpnext/accounts/deferred_revenue.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/erpnext/accounts/deferred_revenue.py b/erpnext/accounts/deferred_revenue.py index 9ff8b042810..13c57fe326b 100644 --- a/erpnext/accounts/deferred_revenue.py +++ b/erpnext/accounts/deferred_revenue.py @@ -128,9 +128,13 @@ def book_deferred_income_or_expense(doc, start_date=None, end_date=None): # book the expense/income on the last day, but it will be trigger on the 1st of month at 12:00 AM # start_date: 1st of the last month or the start date # end_date: end_date or today-1 + enable_check = "enable_deferred_revenue" \ + if doc.doctype=="Sales Invoice" else "enable_deferred_expense" gl_entries = [] for item in doc.get('items'): + if not item.get(enable_check): continue + skip = False last_gl_entry, booking_start_date, booking_end_date, skip = \ get_booking_dates(doc, item, start_date, end_date)