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'}