Do not render default footer when document print template footer is blank

This commit is contained in:
DevSoftTech Server 2026-04-09 04:45:02 +05:30
parent 9fcb7c9ee1
commit e087b26fc6
2 changed files with 3 additions and 1 deletions

View File

@ -1055,6 +1055,7 @@ class DoctorDocument extends BaseController
'print_footer_margin' => $printFooterMargin,
'custom_header_html' => $customHeaderHtml,
'custom_footer_html' => $customFooterHtml,
'has_selected_print_template' => is_array($selectedPrintTemplate),
];
$mpdfTempDir = WRITEPATH . 'cache' . DIRECTORY_SEPARATOR . 'mpdf';

View File

@ -8,6 +8,7 @@ $headerMargin = number_format((float) ($print_header_margin ?? 0.50), 2, '.', ''
$footerMargin = number_format((float) ($print_footer_margin ?? 1.50), 2, '.', '');
$customHeaderHtml = (string) ($custom_header_html ?? '');
$customFooterHtml = (string) ($custom_footer_html ?? '');
$hasSelectedPrintTemplate = ! empty($has_selected_print_template);
?>
<style>
@page {
@ -47,7 +48,7 @@ $customFooterHtml = (string) ($custom_footer_html ?? '');
<htmlpagefooter name="myFooter">
<?php if (trim($customFooterHtml) !== ''): ?>
<?= $customFooterHtml ?>
<?php else: ?>
<?php elseif (! $hasSelectedPrintTemplate): ?>
<table width="100%" style="font-size:10px;">
<tr>
<td width="15%">Page : {PAGENO}/{nbpg}</td>