diff --git a/healthcare/healthcare/doctype/lab_test_template/lab_test_template.py b/healthcare/healthcare/doctype/lab_test_template/lab_test_template.py index a75c533f94..22bcfd808b 100644 --- a/healthcare/healthcare/doctype/lab_test_template/lab_test_template.py +++ b/healthcare/healthcare/doctype/lab_test_template/lab_test_template.py @@ -10,6 +10,7 @@ from frappe import _ from frappe.model.document import Document from frappe.model.rename_doc import rename_doc +from frappe.utils import flt class LabTestTemplate(Document): @@ -21,6 +22,9 @@ def validate(self): if self.is_billable and (not self.lab_test_rate or self.lab_test_rate <= 0.0): frappe.throw(_('Standard Selling Rate should be greater than zero.')) + if self.sample and flt(self.sample_qty) <= 0: + frappe.throw(_('Sample Quantity cannot be negative or 0'), title=_('Invalid Quantity')) + self.validate_conversion_factor() self.enable_disable_item()