Add Ends-On field in the Lead doctype (#13147)

* add ends_on date in lead to be mapped with calendar event

* set default ends_on to 1 hour from contact_time
diff --git a/erpnext/utilities/transaction_base.py b/erpnext/utilities/transaction_base.py
index f2327ca..0c2b6c5 100644
--- a/erpnext/utilities/transaction_base.py
+++ b/erpnext/utilities/transaction_base.py
@@ -36,7 +36,8 @@
 
 	def add_calendar_event(self, opts, force=False):
 		if cstr(self.contact_by) != cstr(self._prev.contact_by) or \
-				cstr(self.contact_date) != cstr(self._prev.contact_date) or force:
+				cstr(self.contact_date) != cstr(self._prev.contact_date) or force or \
+				(hasattr(self, "ends_on") and cstr(self.ends_on) != cstr(self._prev.ends_on)):
 
 			self.delete_events()
 			self._add_calendar_event(opts)
@@ -58,6 +59,7 @@
 				"subject": opts.subject,
 				"description": opts.description,
 				"starts_on":  self.contact_date,
+				"ends_on": opts.ends_on,
 				"event_type": "Private",
 				"ref_type": self.doctype,
 				"ref_name": self.name