From 306f8ef1c4cc4a07bb37da0a435b9465ccdfecc5 Mon Sep 17 00:00:00 2001 From: DevSoftTech Server Date: Tue, 18 Aug 2026 17:32:24 +0530 Subject: [PATCH] Refresh mPDF debug snapshot on build --- app/Controllers/Ipd_discharge.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Controllers/Ipd_discharge.php b/app/Controllers/Ipd_discharge.php index 3f7fc3e..dde1a56 100644 --- a/app/Controllers/Ipd_discharge.php +++ b/app/Controllers/Ipd_discharge.php @@ -5562,7 +5562,9 @@ class Ipd_discharge extends BaseController } $file = WRITEPATH . 'debug' . DIRECTORY_SEPARATOR . 'discharge_mpdf_input_' . $ipdId . '_' . $templateId . '.html'; - if (! is_file($file) && (int) ($this->request->getGet('build') ?? 0) === 1) { + if ((int) ($this->request->getGet('build') ?? 0) === 1) { + @unlink($file); + @unlink(WRITEPATH . 'debug' . DIRECTORY_SEPARATOR . 'discharge_mpdf_runtime_' . $ipdId . '_' . $templateId . '.json'); $previousGet = $_GET; $_GET['tpl'] = $templateId; $_GET['refresh'] = 1;