Skip to content

Commit

Permalink
fix: Remove duplicate event in Patient Appointment
Browse files Browse the repository at this point in the history
(cherry picked from commit f0587f8)
  • Loading branch information
Sajinsr authored and akashkrishna619 committed Sep 17, 2023
1 parent cba9ad9 commit 4a4ce77
Showing 1 changed file with 0 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,62 +202,6 @@ frappe.ui.form.on('Patient Appointment', {
});
},

appointment_for: function(frm) {
if (frm.doc.appointment_for == 'Practitioner') {
if (!frm.doc.practitioner) {
frm.set_value('department', '');
}
frm.set_value('service_unit', '');
frm.trigger('set_check_availability_action');
} else if (frm.doc.appointment_for == 'Service Unit') {
frm.set_value({
'practitioner': '',
'practitioner_name': '',
'department': '',
});
frm.trigger('set_book_action');
} else if (frm.doc.appointment_for == 'Department') {
frm.set_value({
'practitioner': '',
'practitioner_name': '',
'service_unit': '',
});
frm.trigger('set_book_action');
} else {
if (frm.doc.appointment_for == 'Department') {
frm.set_value('service_unit', '');
}
frm.set_value({
'practitioner': '',
'practitioner_name': '',
'department': '',
'service_unit': '',
});
frm.page.clear_primary_action();
}
},

set_book_action: function(frm) {
frm.page.set_primary_action(__('Book'), function() {
frm.enable_save();
frm.save();
});
},

set_check_availability_action: function(frm) {
frm.page.set_primary_action(__('Check Availability'), function() {
if (!frm.doc.patient) {
frappe.msgprint({
title: __('Not Allowed'),
message: __('Please select Patient first'),
indicator: 'red'
});
} else {
check_and_set_availability(frm);
}
});
},

patient: function(frm) {
if (frm.doc.patient) {
frm.trigger('toggle_payment_fields');
Expand Down

0 comments on commit 4a4ce77

Please sign in to comment.