From 131452ca9425795fadd78023c0bd3dfb1f8a5d45 Mon Sep 17 00:00:00 2001 From: Rucha Mahabal Date: Mon, 27 Apr 2020 10:52:38 +0530 Subject: [PATCH] fix: Lab Test Invoicing (#21435) --- erpnext/healthcare/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/healthcare/utils.py b/erpnext/healthcare/utils.py index 9a32c737cf2..a7565323585 100644 --- a/erpnext/healthcare/utils.py +++ b/erpnext/healthcare/utils.py @@ -43,7 +43,7 @@ def validate_customer_created(patient): def get_fee_validity(patient_appointments): if not frappe.db.get_single_value('Healthcare Settings', 'enable_free_follow_ups'): - return + return [] items_to_invoice = [] for appointment in patient_appointments: @@ -110,7 +110,7 @@ def get_lab_tests_to_invoice(patient): filters={'patient': patient.name, 'invoiced': False, 'docstatus': 1} ) for lab_test in lab_tests: - item, is_billable = frappe.get_cached_value('Lab Test Template', lab_test.lab_test_code, ['item', 'is_billable']) + item, is_billable = frappe.get_cached_value('Lab Test Template', lab_test.template, ['item', 'is_billable']) if is_billable: lab_tests_to_invoice.append({ 'reference_type': 'Lab Test',