mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-24 07:29:22 +00:00
Merge pull request #27812 from akurungadam/fix-appointment-slots
fix(healthcare): Availability slots display, disabled Practitioner Schedule
This commit is contained in:
@@ -433,11 +433,12 @@ let check_and_set_availability = function(frm) {
|
|||||||
slot_html += `<br><span> <b> ${__('Maximum Capacity:')} </b> ${slot_info.service_unit_capacity} </span>`;
|
slot_html += `<br><span> <b> ${__('Maximum Capacity:')} </b> ${slot_info.service_unit_capacity} </span>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
slot_html += '</div><br><br>';
|
slot_html += '</div><br>';
|
||||||
|
|
||||||
slot_html += slot_info.avail_slot.map(slot => {
|
slot_html += slot_info.avail_slot.map(slot => {
|
||||||
appointment_count = 0;
|
appointment_count = 0;
|
||||||
disabled = false;
|
disabled = false;
|
||||||
|
count_class = tool_tip = '';
|
||||||
start_str = slot.from_time;
|
start_str = slot.from_time;
|
||||||
slot_start_time = moment(slot.from_time, 'HH:mm:ss');
|
slot_start_time = moment(slot.from_time, 'HH:mm:ss');
|
||||||
slot_end_time = moment(slot.to_time, 'HH:mm:ss');
|
slot_end_time = moment(slot.to_time, 'HH:mm:ss');
|
||||||
@@ -486,10 +487,11 @@ let check_and_set_availability = function(frm) {
|
|||||||
data-duration=${interval}
|
data-duration=${interval}
|
||||||
data-service-unit="${slot_info.service_unit || ''}"
|
data-service-unit="${slot_info.service_unit || ''}"
|
||||||
style="margin: 0 10px 10px 0; width: auto;" ${disabled ? 'disabled="disabled"' : ""}
|
style="margin: 0 10px 10px 0; width: auto;" ${disabled ? 'disabled="disabled"' : ""}
|
||||||
data-toggle="tooltip" title="${tool_tip}">
|
data-toggle="tooltip" title="${tool_tip || ''}">
|
||||||
${start_str.substring(0, start_str.length - 3)}<br>
|
${start_str.substring(0, start_str.length - 3)}
|
||||||
<span class='badge ${count_class}'> ${count} </span>
|
${slot_info.service_unit_capacity ? `<br><span class='badge ${count_class}'> ${count} </span>` : ''}
|
||||||
</button>`;
|
</button>`;
|
||||||
|
|
||||||
}).join("");
|
}).join("");
|
||||||
|
|
||||||
if (slot_info.service_unit_capacity) {
|
if (slot_info.service_unit_capacity) {
|
||||||
|
|||||||
@@ -354,7 +354,7 @@ def get_available_slots(practitioner_doc, date):
|
|||||||
validate_practitioner_schedules(schedule_entry, practitioner)
|
validate_practitioner_schedules(schedule_entry, practitioner)
|
||||||
practitioner_schedule = frappe.get_doc('Practitioner Schedule', schedule_entry.schedule)
|
practitioner_schedule = frappe.get_doc('Practitioner Schedule', schedule_entry.schedule)
|
||||||
|
|
||||||
if practitioner_schedule:
|
if practitioner_schedule and not practitioner_schedule.disabled:
|
||||||
available_slots = []
|
available_slots = []
|
||||||
for time_slot in practitioner_schedule.time_slots:
|
for time_slot in practitioner_schedule.time_slots:
|
||||||
if weekday == time_slot.day:
|
if weekday == time_slot.day:
|
||||||
|
|||||||
Reference in New Issue
Block a user