From 9fcb7c9ee1d18f6ab140201704eaef34d37b4a5c Mon Sep 17 00:00:00 2001 From: DevSoftTech Server Date: Thu, 9 Apr 2026 04:32:44 +0530 Subject: [PATCH] Apply placeholder resolver to general document body in create_final and normalize escaped newlines --- app/Controllers/DoctorDocument.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Controllers/DoctorDocument.php b/app/Controllers/DoctorDocument.php index 605af66..7d6ece7 100644 --- a/app/Controllers/DoctorDocument.php +++ b/app/Controllers/DoctorDocument.php @@ -1026,7 +1026,11 @@ class DoctorDocument extends BaseController $headerRef = 'Document Ref. No.' . date('Y') . '/' . $printNo . '/' . $patientDocId; $content = '
' . $headerRef . 'Date : ' . $issueDate . '
'; - $content .= (string) ($patientDoc['raw_data'] ?? ''); + + $rawData = (string) ($patientDoc['raw_data'] ?? ''); + $rawData = str_replace(["\\r\\n", "\\n", "\\r"], "\n", $rawData); + $rawData = $this->resolveDocPrintTemplatePlaceholders($rawData, $patientDoc); + $content .= $rawData; $customHeaderHtml = $this->resolveDocPrintTemplatePlaceholders( (string) ($selectedPrintTemplate['header_html'] ?? ''),