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(
|
||||
'Appointment', filters={'scheduled_time': self.scheduled_time})
|
||||
number_of_agents = frappe.db.get_single_value('Appointment Booking Settings', 'number_of_agents')
|
||||
if (number_of_appointments_in_same_slot >= number_of_agents):
|
||||
frappe.throw('Time slot is not available')
|
||||
if not number_of_agents == 0:
|
||||
if (number_of_appointments_in_same_slot >= number_of_agents):
|
||||
frappe.throw('Time slot is not available')
|
||||
# Link lead
|
||||
if not self.lead:
|
||||
self.lead = self.find_lead_by_email()
|
||||
|
Loading…
x
Reference in New Issue
Block a user