add condition for zero appointment slots
This commit is contained in:
parent
b84e56ebb5
commit
2515022377
@ -28,8 +28,9 @@ class Appointment(Document):
|
|||||||
number_of_appointments_in_same_slot = frappe.db.count(
|
number_of_appointments_in_same_slot = frappe.db.count(
|
||||||
'Appointment', filters={'scheduled_time': self.scheduled_time})
|
'Appointment', filters={'scheduled_time': self.scheduled_time})
|
||||||
number_of_agents = frappe.db.get_single_value('Appointment Booking Settings', 'number_of_agents')
|
number_of_agents = frappe.db.get_single_value('Appointment Booking Settings', 'number_of_agents')
|
||||||
if (number_of_appointments_in_same_slot >= number_of_agents):
|
if not number_of_agents == 0:
|
||||||
frappe.throw('Time slot is not available')
|
if (number_of_appointments_in_same_slot >= number_of_agents):
|
||||||
|
frappe.throw('Time slot is not available')
|
||||||
# Link lead
|
# Link lead
|
||||||
if not self.lead:
|
if not self.lead:
|
||||||
self.lead = self.find_lead_by_email()
|
self.lead = self.find_lead_by_email()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user