Merge pull request #27812 from akurungadam/fix-appointment-slots

fix(healthcare): Availability slots display, disabled Practitioner Schedule
This commit is contained in:
Anoop
2021-10-07 08:45:56 +05:30
committed by GitHub
parent 56b58cbeea
commit 4da5cb36e7
2 changed files with 7 additions and 5 deletions

View File

@@ -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 += '</div><br><br>';
slot_html += '</div><br>';
slot_html += slot_info.avail_slot.map(slot => {
appointment_count = 0;
disabled = false;
count_class = tool_tip = '';
start_str = slot.from_time;
slot_start_time = moment(slot.from_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-service-unit="${slot_info.service_unit || ''}"
style="margin: 0 10px 10px 0; width: auto;" ${disabled ? 'disabled="disabled"' : ""}
data-toggle="tooltip" title="${tool_tip}">
${start_str.substring(0, start_str.length - 3)}<br>
<span class='badge ${count_class}'> ${count} </span>
data-toggle="tooltip" title="${tool_tip || ''}">
${start_str.substring(0, start_str.length - 3)}
${slot_info.service_unit_capacity ? `<br><span class='badge ${count_class}'> ${count} </span>` : ''}
</button>`;
}).join("");
if (slot_info.service_unit_capacity) {

View File

@@ -354,7 +354,7 @@ def get_available_slots(practitioner_doc, date):
validate_practitioner_schedules(schedule_entry, practitioner)
practitioner_schedule = frappe.get_doc('Practitioner Schedule', schedule_entry.schedule)
if practitioner_schedule:
if practitioner_schedule and not practitioner_schedule.disabled:
available_slots = []
for time_slot in practitioner_schedule.time_slots:
if weekday == time_slot.day: