From 2c5abc2dd377193f65178309d441d499dae31b1c Mon Sep 17 00:00:00 2001 From: sunsetsystems Date: Wed, 27 Oct 2010 20:46:40 +0000 Subject: [PATCH] fixes for in-house dispensing --- library/classes/Prescription.class.php | 1 + templates/prescription/general_edit.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/library/classes/Prescription.class.php b/library/classes/Prescription.class.php index b0b6be48ee8..220b50c1c94 100644 --- a/library/classes/Prescription.class.php +++ b/library/classes/Prescription.class.php @@ -622,6 +622,7 @@ function prescriptions_factory($patient_id, } function get_dispensation_count() { + if (empty($this->id)) return 0; $refills_row = sqlQuery("SELECT count(*) AS count FROM drug_sales " . "WHERE prescription_id = '" . $this->id . "' AND quantity > 0"); return $refills_row['count']; diff --git a/templates/prescription/general_edit.html b/templates/prescription/general_edit.html index f915857fb8c..e89742dd649 100644 --- a/templates/prescription/general_edit.html +++ b/templates/prescription/general_edit.html @@ -143,7 +143,7 @@   {xl t='in-house'}