|
|
@ -38,7 +38,7 @@ class Appointment(Document): |
|
|
|
number_of_agents = frappe.db.get_single_value('Appointment Booking Settings', 'number_of_agents') |
|
|
|
if not number_of_agents == 0: |
|
|
|
if (number_of_appointments_in_same_slot >= number_of_agents): |
|
|
|
frappe.throw('Time slot is not available') |
|
|
|
frappe.throw(_('Time slot is not available')) |
|
|
|
# Link lead |
|
|
|
if not self.party: |
|
|
|
lead = self.find_lead_by_email() |
|
|
@ -75,10 +75,10 @@ class Appointment(Document): |
|
|
|
subject=_('Appointment Confirmation')) |
|
|
|
if frappe.session.user == "Guest": |
|
|
|
frappe.msgprint( |
|
|
|
'Please check your email to confirm the appointment') |
|
|
|
_('Please check your email to confirm the appointment')) |
|
|
|
else : |
|
|
|
frappe.msgprint( |
|
|
|
'Appointment was created. But no lead was found. Please check the email to confirm') |
|
|
|
_('Appointment was created. But no lead was found. Please check the email to confirm')) |
|
|
|
|
|
|
|
def on_change(self): |
|
|
|
# Sync Calendar |
|
|
@ -91,7 +91,7 @@ class Appointment(Document): |
|
|
|
|
|
|
|
def set_verified(self, email): |
|
|
|
if not email == self.customer_email: |
|
|
|
frappe.throw('Email verification failed.') |
|
|
|
frappe.throw(_('Email verification failed.')) |
|
|
|
# Create new lead |
|
|
|
self.create_lead_and_link() |
|
|
|
# Remove unverified status |
|
|
@ -184,7 +184,7 @@ class Appointment(Document): |
|
|
|
appointment_event.insert(ignore_permissions=True) |
|
|
|
self.calendar_event = appointment_event.name |
|
|
|
self.save(ignore_permissions=True) |
|
|
|
|
|
|
|
|
|
|
|
def _get_verify_url(self): |
|
|
|
verify_route = '/book_appointment/verify' |
|
|
|
params = { |
|
|
|