From 43546a13c7523268f033fd5f50520f3ca08307df Mon Sep 17 00:00:00 2001 From: Aibel Date: Tue, 5 Mar 2024 11:04:44 +0530 Subject: [PATCH] fix: change 'invoiced' flag to 'billing_status' from get_prescribed query of Lab Test and Clinical Procedure --- .../doctype/clinical_procedure/clinical_procedure.js | 2 +- .../doctype/clinical_procedure/clinical_procedure.py | 2 +- healthcare/healthcare/doctype/lab_test/lab_test.js | 3 +-- healthcare/healthcare/doctype/lab_test/lab_test.py | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/healthcare/healthcare/doctype/clinical_procedure/clinical_procedure.js b/healthcare/healthcare/doctype/clinical_procedure/clinical_procedure.js index 74cf4457ec..b8df8fc97c 100644 --- a/healthcare/healthcare/doctype/clinical_procedure/clinical_procedure.js +++ b/healthcare/healthcare/doctype/clinical_procedure/clinical_procedure.js @@ -492,7 +492,7 @@ let show_procedure_templates = function(frm, result){ frm.doc.service_request = $(this).attr('data-name'); frm.doc.practitioner = $(this).attr("data-practitioner"); frm.doc.invoiced = 0; - if ($(this).attr('data-invoiced') === 1) { + if ($(this).attr('data-invoiced') === "Invoiced") { frm.doc.invoiced = 1; } frm.refresh_field("procedure_template"); diff --git a/healthcare/healthcare/doctype/clinical_procedure/clinical_procedure.py b/healthcare/healthcare/doctype/clinical_procedure/clinical_procedure.py index 2e29bf86d4..6175b4cd56 100644 --- a/healthcare/healthcare/doctype/clinical_procedure/clinical_procedure.py +++ b/healthcare/healthcare/doctype/clinical_procedure/clinical_procedure.py @@ -356,7 +356,7 @@ def get_procedure_prescribed(patient, encounter=False): return ( frappe.qb.from_(hso) .select( - hso.template_dn, hso.order_group, hso.invoiced, hso.practitioner, hso.order_date, hso.name + hso.template_dn, hso.order_group, hso.billing_status, hso.practitioner, hso.order_date, hso.name ) .where(hso.patient == patient) .where(hso.status != "completed-Request Status") diff --git a/healthcare/healthcare/doctype/lab_test/lab_test.js b/healthcare/healthcare/doctype/lab_test/lab_test.js index 38d8ad9fa9..442daefb44 100644 --- a/healthcare/healthcare/doctype/lab_test/lab_test.js +++ b/healthcare/healthcare/doctype/lab_test/lab_test.js @@ -217,13 +217,12 @@ var show_lab_tests = function (frm, lab_test_list) { row.find("a").click(function () { frm.doc.template = $(this).attr('data-lab-test'); frm.doc.service_request = $(this).attr('data-name'); - console.log($(this).attr('data-name')) frm.doc.practitioner = $(this).attr('data-practitioner'); frm.set_df_property('template', 'read_only', 1); frm.set_df_property('patient', 'read_only', 1); frm.set_df_property('practitioner', 'read_only', 1); frm.doc.invoiced = 0; - if ($(this).attr('data-invoiced') === 1) { + if ($(this).attr('data-invoiced') === "Invoiced") { frm.doc.invoiced = 1; } refresh_field('invoiced'); diff --git a/healthcare/healthcare/doctype/lab_test/lab_test.py b/healthcare/healthcare/doctype/lab_test/lab_test.py index 9571e5e50e..ecfcccace0 100644 --- a/healthcare/healthcare/doctype/lab_test/lab_test.py +++ b/healthcare/healthcare/doctype/lab_test/lab_test.py @@ -441,7 +441,7 @@ def get_lab_test_prescribed(patient): return ( frappe.qb.from_(hso) .select( - hso.template_dn, hso.order_group, hso.invoiced, hso.practitioner, hso.order_date, hso.name + hso.template_dn, hso.order_group, hso.billing_status, hso.practitioner, hso.order_date, hso.name ) .where(hso.patient == patient) .where(hso.status != "completed-Request Status")