[fix] [minor] setup wizard - calculate year end date on change of year start date

This commit is contained in:
Akhilesh Darjee
2013-11-26 17:29:51 +05:30
parent 259208187c
commit 84ed127e72
2 changed files with 10 additions and 3 deletions

View File

@@ -24,9 +24,10 @@ class DocType:
year_start_end_dates = webnotes.conn.sql("""select year_start_date, year_end_date
from `tabFiscal Year` where name=%s""", (self.doc.name))
if getdate(self.doc.year_start_date) != year_start_end_dates[0][0] or getdate(self.doc.year_end_date) != year_start_end_dates[0][1]:
webnotes.throw(_("Cannot change Year Start Date and Year End Date \
once the Fiscal Year is saved."))
if year_start_end_dates:
if getdate(self.doc.year_start_date) != year_start_end_dates[0][0] or getdate(self.doc.year_end_date) != year_start_end_dates[0][1]:
webnotes.throw(_("Cannot change Year Start Date and Year End Date \
once the Fiscal Year is saved."))
def on_update(self):
# validate year start date and year end date