From 32b3aa257c65ac0182b07e79bdc987a258e99564 Mon Sep 17 00:00:00 2001 From: Gaurav Naik Date: Mon, 14 May 2018 18:02:24 +0530 Subject: [PATCH] [Fix] Indentation for accounting_period overlap --- .../accounting_period/accounting_period.py | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/erpnext/accounts/doctype/accounting_period/accounting_period.py b/erpnext/accounts/doctype/accounting_period/accounting_period.py index 306bf9177e..8760d8f35e 100644 --- a/erpnext/accounts/doctype/accounting_period/accounting_period.py +++ b/erpnext/accounts/doctype/accounting_period/accounting_period.py @@ -15,20 +15,20 @@ class AccountingPeriod(Document): self.name = " - ".join([self.period_name, company_abbr]) def validate_overlap(self): - existing_accounting_period = frappe.db.sql("""select name from `tabAccounting Period` - where ( - (%(start_date)s between start_date and end_date) - or (%(end_date)s between start_date and end_date) - or (start_date between %(start_date)s and %(end_date)s) - or (end_date between %(start_date)s and %(end_date)s) - ) and name!=%(name)s and company=%(company)s""", - { - "start_date": self.start_date, - "end_date": self.end_date, - "name": self.name, - "company": self.company - }, as_dict=True) + existing_accounting_period = frappe.db.sql("""select name from `tabAccounting Period` + where ( + (%(start_date)s between start_date and end_date) + or (%(end_date)s between start_date and end_date) + or (start_date between %(start_date)s and %(end_date)s) + or (end_date between %(start_date)s and %(end_date)s) + ) and name!=%(name)s and company=%(company)s""", + { + "start_date": self.start_date, + "end_date": self.end_date, + "name": self.name, + "company": self.company + }, as_dict=True) - if len(existing_accounting_period) > 0: - frappe.throw("Accounting Period overlaps with {0}".format(existing_accounting_period[0].get("name"))) + if len(existing_accounting_period) > 0: + frappe.throw("Accounting Period overlaps with {0}".format(existing_accounting_period[0].get("name")))