From 05688517831bfaaf09f26a610245b9f90d09a56a Mon Sep 17 00:00:00 2001 From: DevSoftTech Server Date: Mon, 8 Jun 2026 17:18:02 +0530 Subject: [PATCH] Add Print Header checkbox for IPD bill printing - allows printing on letterhead --- app/Controllers/Billing/Ipd.php | 5 +++ app/Views/billing/ipd/bill_print.php | 3 ++ app/Views/billing/ipd/panel_bill_details.php | 37 ++++++++++++++++---- 3 files changed, 38 insertions(+), 7 deletions(-) diff --git a/app/Controllers/Billing/Ipd.php b/app/Controllers/Billing/Ipd.php index 62927e8..f8ce825 100644 --- a/app/Controllers/Billing/Ipd.php +++ b/app/Controllers/Billing/Ipd.php @@ -894,11 +894,16 @@ class Ipd extends BaseController $panelData = $this->ipdModel->getIpdPanelInfo($ipdId); $mode = max(1, min(6, $mode)); + + // Get header parameter from query string (default: show header) + $showHeader = $this->request->getGet('header') !== '0'; + $data = $this->buildBillDetailsTabData($panelData, $ipdId); $data['show_print_actions'] = false; $data['show_payment_details'] = in_array($mode, [1, 6], true); $data['letterhead_mode'] = in_array($mode, [5, 6], true); $data['print_mode'] = $mode; + $data['show_header'] = $showHeader; $html = view('billing/ipd/bill_print', $data); diff --git a/app/Views/billing/ipd/bill_print.php b/app/Views/billing/ipd/bill_print.php index 37c8fc2..96b525d 100644 --- a/app/Views/billing/ipd/bill_print.php +++ b/app/Views/billing/ipd/bill_print.php @@ -14,6 +14,7 @@ $hasBalanceTotal = array_key_exists('balance', $billTotals); $printMode = (int) ($print_mode ?? 1); $showPaymentDetails = (bool) ($show_payment_details ?? true); +$showHeader = (bool) ($show_header ?? true); $hospitalName = defined('H_Name') ? (string) constant('H_Name') : 'Hospital'; $hospitalAddress1 = defined('H_address_1') ? (string) constant('H_address_1') : ''; @@ -131,6 +132,7 @@ $billHeadingText = $isDischargeFinal + @@ -161,6 +163,7 @@ $billHeadingText = $isDischargeFinal
Page: {PAGENO}/{nbpg}
+
diff --git a/app/Views/billing/ipd/panel_bill_details.php b/app/Views/billing/ipd/panel_bill_details.php index d8089cf..09bc21c 100644 --- a/app/Views/billing/ipd/panel_bill_details.php +++ b/app/Views/billing/ipd/panel_bill_details.php @@ -53,14 +53,37 @@ $billHeaderTitle = $isDischargeFinal ? 'Bill No. : ' . (string) ($ipd->ipd_code / IPD ID: ipd_code ?? '') ?> id)) : ?> -
- Print Bill - Print Without Payment - Letter Head w/o Payment - Letter Head - Item Amt. With Discount - TPA Final Bill + +