From 406cc522791e51ba81c31dbddf3e7fe2c4d30df4 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 13 Jan 2025 14:16:55 +1100 Subject: [PATCH] Adjustments for design and dom elements / attributes --- app/Helpers/Epc/EpcQrGenerator.php | 4 +- app/Helpers/SwissQr/SwissQrGenerator.php | 2 +- app/Http/Controllers/PreviewController.php | 1 + app/Services/Pdf/PdfBuilder.php | 82 +++++++++++++-------- app/Services/Pdf/PdfService.php | 5 +- app/Services/Pdf/Purify.php | 54 ++++++++++++-- app/Services/PdfMaker/Design.php | 52 +++++++------ app/Services/PdfMaker/PdfMaker.php | 58 ++++++++------- app/Services/PdfMaker/PdfMakerUtilities.php | 12 +-- app/Utils/Traits/Pdf/PdfMaker.php | 1 - resources/views/pdf-designs/bold.html | 2 +- resources/views/pdf-designs/business.html | 2 +- resources/views/pdf-designs/calm.html | 4 + resources/views/pdf-designs/clean.html | 13 +--- resources/views/pdf-designs/creative.html | 2 +- resources/views/pdf-designs/elegant.html | 2 +- resources/views/pdf-designs/hipster.html | 2 +- resources/views/pdf-designs/modern.html | 2 +- resources/views/pdf-designs/plain.html | 2 +- resources/views/pdf-designs/playful.html | 4 + resources/views/pdf-designs/tech.html | 4 +- 21 files changed, 193 insertions(+), 117 deletions(-) diff --git a/app/Helpers/Epc/EpcQrGenerator.php b/app/Helpers/Epc/EpcQrGenerator.php index 8c32d5ed74..9a4cc72fa3 100644 --- a/app/Helpers/Epc/EpcQrGenerator.php +++ b/app/Helpers/Epc/EpcQrGenerator.php @@ -55,8 +55,8 @@ class EpcQrGenerator $qr = $writer->writeString($this->encodeMessage(), 'utf-8'); - return " - {$qr}"; + return htmlspecialchars(" + {$qr}"); } catch (\Throwable $e) { nlog("EPC QR failure => ".$e->getMessage()); diff --git a/app/Helpers/SwissQr/SwissQrGenerator.php b/app/Helpers/SwissQr/SwissQrGenerator.php index 8657c864b6..242a6250df 100644 --- a/app/Helpers/SwissQr/SwissQrGenerator.php +++ b/app/Helpers/SwissQr/SwissQrGenerator.php @@ -172,7 +172,7 @@ class SwissQrGenerator ->setPrintable(false) ->getPaymentPart(); - return $html; + return htmlspecialchars($html); } catch (\Exception $e) { // if (is_iterable($qrBill->getViolations())) { diff --git a/app/Http/Controllers/PreviewController.php b/app/Http/Controllers/PreviewController.php index 75edb7ce94..47250a84df 100644 --- a/app/Http/Controllers/PreviewController.php +++ b/app/Http/Controllers/PreviewController.php @@ -212,6 +212,7 @@ class PreviewController extends BaseController ->build(); if (request()->query('html') == 'true') { + return $maker->getCompiledHTML(); } diff --git a/app/Services/Pdf/PdfBuilder.php b/app/Services/Pdf/PdfBuilder.php index ca054a3a1d..c46251ce08 100644 --- a/app/Services/Pdf/PdfBuilder.php +++ b/app/Services/Pdf/PdfBuilder.php @@ -83,6 +83,7 @@ class PdfBuilder private function removeEmptyElements(): self { + $elements =[ 'product-table', 'task-table', 'delivery-note-table', 'statement-invoice-table', 'statement-payment-table', 'statement-aging-table-totals', @@ -96,45 +97,59 @@ class PdfBuilder if ($el && $el->childElementCount === 0) { $el->parentNode->removeChild($el); // This removes the element completely - // $el->setAttribute('style', 'display: none !important;'); } } - - // $xpath = new \DOMXPath($this->document); - // $elements = $xpath->query('//*[@data-state="encoded-html"]'); + + + $xpath = new \DOMXPath($this->document); + $elements = $xpath->query('//*[@data-state="encoded-html"]'); - // foreach ($elements as $element) { + foreach ($elements as $element) { - // // Decode the HTML content - // $html = htmlspecialchars_decode($element->textContent, ENT_QUOTES | ENT_HTML5); - // $html = str_ireplace(['
'], '
', $html); + // Decode the HTML content + $html = htmlspecialchars_decode($element->textContent, ENT_QUOTES | ENT_HTML5); + $html = str_ireplace(['
',''], ['
',''], $html); - // // Create a temporary document to properly parse the HTML - // $temp = new \DOMDocument(); + // Create a temporary document to properly parse the HTML + $temp = new \DOMDocument(); - // // Add UTF-8 wrapper and div container - // $wrappedHtml = '
' . $html . '
'; + // Add UTF-8 wrapper and div container + $wrappedHtml = '
' . $html . '
'; - // // Load the HTML, suppressing any parsing warnings - // @$temp->loadHTML($wrappedHtml, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); + // Load the HTML, suppressing any parsing warnings + @$temp->loadHTML($wrappedHtml, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); - // // Import the div's contents - // $imported = $this->document->importNode($temp->getElementsByTagName('div')->item(0), true); + // Import the div's contents + $imported = $this->document->importNode($temp->getElementsByTagName('div')->item(0), true); - // // Clear existing content of the element - // while ($element->firstChild) { - // $element->removeChild($element->firstChild); - // } + // Clear existing content - more efficient + $element->textContent = ''; + // Get the first div's content + $divContent = $temp->getElementsByTagName('div')->item(0); - // // Append the new content to the element - // $element->appendChild($imported); + if ($divContent) { + // Import all nodes from the temporary div + foreach ($divContent->childNodes as $child) { + $imported = $this->document->importNode($child, true); + $element->appendChild($imported); + } + } else { + // Fallback - import the entire content if no div found + $imported = $this->document->importNode($temp->documentElement, true); + $element->appendChild($imported); + + } + + + } - // } return $this; } + + /** * Final method to get compiled HTML. * @@ -1131,7 +1146,7 @@ class PdfBuilder } if(array_key_exists($column, $column_visibility)){ - return $column_visibility[$column] ? false: true; + return !$column_visibility[$column]; } return true; @@ -1386,9 +1401,11 @@ class PdfBuilder $elements = [ ['element' => 'div', 'properties' => ['style' => 'display: flex; flex-direction: column;'], 'elements' => [ - ['element' => 'p', 'content' => strtr(str_replace(["labels", "values"], ["",""], $_variables['values']['$entity.public_notes']), $_variables), 'properties' => ['data-ref' => 'total_table-public_notes', 'style' => 'text-align: left;']], - ['element' => 'p', 'content' => '', 'properties' => ['style' => 'text-align: left; display: flex; flex-direction: column; page-break-inside: auto;'], 'elements' => [ - ['element' => 'span', 'content' => '$entity.terms_label: ', 'properties' => ['data-ref' => 'total_table-terms-label', 'style' => "font-weight: bold; text-align: left; margin-top: 1rem; {$show_terms_label}"]], + ['element' => 'div', 'properties' => ['data-ref' => 'total_table-public_notes', 'style' => 'text-align: left;'], 'elements' => [ + ['element' => 'span', 'content' => strtr(str_replace(["labels", "values"], ["",""], $_variables['values']['$entity.public_notes']), $_variables)] + ]], + ['element' => 'div', 'content' => '', 'properties' => ['style' => 'text-align: left; display: flex; flex-direction: column; page-break-inside: auto;'], 'elements' => [ + ['element' => 'span', 'content' => '$entity.terms_label: ', 'properties' => ['data-ref' => 'total_table-terms-label', 'style' => "text-align: left; margin-top: 1rem; {$show_terms_label}"]], ['element' => 'span', 'content' => strtr(str_replace("labels", "", $_variables['values']['$entity.terms']), $_variables['labels']), 'properties' => ['data-ref' => 'total_table-terms', 'style' => 'text-align: left;']], ]], ['element' => 'img', 'properties' => ['style' => 'max-width: 50%; height: auto;', 'src' => '$contact.signature', 'id' => 'contact-signature']], @@ -1495,6 +1512,7 @@ class PdfBuilder ['element' => 'span', 'content' => ''], ]]; + return $elements; } @@ -2037,11 +2055,15 @@ class PdfBuilder $html = strtr($this->getCompiledHTML(), $this->service->html_variables['labels']); $html = strtr($html, $this->service->html_variables['values']); - $html = htmlspecialchars_decode($html, ENT_QUOTES | ENT_HTML5); - $html = str_ireplace(['
'], '
', $html); + //old block + @$this->document->loadHTML(mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8')); - @$this->document->loadHTML(''.$html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); + //new block + // $html = htmlspecialchars_decode($html, ENT_QUOTES | ENT_HTML5); + // $html = str_ireplace(['
',''], ['
',''], $html); + // @$this->document->loadHTML(''.$html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); + //continues $this->document->saveHTML(); return $this; diff --git a/app/Services/Pdf/PdfService.php b/app/Services/Pdf/PdfService.php index 2f0b47f1c5..3b23761149 100644 --- a/app/Services/Pdf/PdfService.php +++ b/app/Services/Pdf/PdfService.php @@ -90,7 +90,10 @@ class PdfService public function getPdf() { try { - $pdf = $this->resolvePdfEngine($this->getHtml()); + + $html = $this->getHtml(); + // nlog($html); + $pdf = $this->resolvePdfEngine($html); $numbered_pdf = $this->pageNumbering($pdf, $this->company); diff --git a/app/Services/Pdf/Purify.php b/app/Services/Pdf/Purify.php index 3183a2c27f..b5c87b67ce 100644 --- a/app/Services/Pdf/Purify.php +++ b/app/Services/Pdf/Purify.php @@ -40,6 +40,7 @@ class Purify 'polygon', 'g', 'text', 'tspan', 'defs', 'use', 'title', ]; + private static array $allowed_attributes = [ // Global Attributes 'class' => ['*'], @@ -55,7 +56,7 @@ class Purify 'data-state' => ['*'], //SVG - 'd' => ['*'], + 'd' => ['*'], 'viewBox' => ['*'], 'xmlns' => ['http://www.w3.org/2000/svg'], 'fill' => ['*'], @@ -71,7 +72,7 @@ class Purify 'preserveAspectRatio' => ['*'], 'version' => ['*'], 'xlink:href' => ['#*'], // Only allow internal references - + 'fill-rule' => ['nonzero', 'evenodd'], // Layout & Presentation 'align' => ['left', 'center', 'right', 'justify'], 'valign' => ['top', 'middle', 'bottom', 'baseline'], @@ -115,6 +116,8 @@ class Purify 'content' => ['*'], 'http-equiv' => ['*'], 'viewport' => ['*'], + 'xmlns' => ['http://www.w3.org/2000/svg'], + ]; private static array $dangerous_css_patterns = [ @@ -214,6 +217,24 @@ class Purify return implode('; ', $safe_declarations); } + private static array $dangerous_svg_elements = [ + 'script', + 'handler', + 'foreignObject', + 'annotation-xml', + 'color-profile', + 'style', // or carefully sanitize if needed + 'onload', + 'onerror', + 'onunload', + 'onabort' + ]; + + private static function isDangerousSvgElement(string $tagName): bool + { + return in_array(strtolower($tagName), self::$dangerous_svg_elements); + } + public static function clean(string $html): string { if(config('ninja.disable_purify_html')){ @@ -221,9 +242,9 @@ class Purify } $html = str_replace('%24', '$', $html); - libxml_use_internal_errors(true); libxml_disable_entity_loader(true); +// nlog("pre purify => {$html}"); $document = new \DOMDocument(); @$document->loadHTML(htmlspecialchars_decode(htmlspecialchars($html, ENT_QUOTES, 'UTF-8'))); @@ -267,10 +288,24 @@ class Purify $current_attributes[$attr->name] = $attr->value; } + // Handle SVG node separately + if ($node->tagName === 'svg') { + // Keep only allowed SVG attributes + $current_attributes = []; + foreach ($node->attributes as $attr) { + + if (in_array($attr->name, self::$dangerous_svg_elements)) { + $node->removeAttribute($attr->name); + } + + } + + } else { // First, remove ALL attributes from the node - while ($node->attributes->length > 0) { - $attr = $node->attributes->item(0); - $node->removeAttribute($attr->nodeName); + while ($node->attributes->length > 0) { + $attr = $node->attributes->item(0); + $node->removeAttribute($attr->nodeName); + } } // Then add back only the allowed attributes @@ -361,15 +396,18 @@ class Purify $html = str_replace('%24', '$', $document->saveHTML()); + // nlog("post purify => {$html}"); return $html; } catch (\Exception $e) { nlog('Error cleaning HTML: ' . $e->getMessage()); + + libxml_disable_entity_loader(false); + libxml_clear_errors(); throw new \RuntimeException('HTML sanitization failed'); - }finally { - // Restore original setting + } finally { libxml_disable_entity_loader(false); libxml_clear_errors(); } diff --git a/app/Services/PdfMaker/Design.php b/app/Services/PdfMaker/Design.php index 7ca697c877..ef20622000 100644 --- a/app/Services/PdfMaker/Design.php +++ b/app/Services/PdfMaker/Design.php @@ -838,7 +838,6 @@ class Design extends BaseDesign $elements[] = ['element' => 'th', 'content' => $column . '_label', 'properties' => ['data-ref' => "{$type}_table-" . substr($column, 1) . '-th', 'visi' => $this->visibilityCheck($column_visibility, $column)]]; } } - $visible_elements = array_filter($elements, function ($element) { return $element['properties']['visi'] ?? true; @@ -883,7 +882,7 @@ class Design extends BaseDesign } if(array_key_exists($column, $column_visibility)){ - return $column_visibility[$column] ? false: true; + return !$column_visibility[$column]; } return true; @@ -957,20 +956,6 @@ class Design extends BaseDesign } } - - // Then, filter the elements array - $element['elements'] = array_map(function ($el) { - if (isset($el['properties']['visi'])) { - if ($el['properties']['visi'] === false) { - $el['properties']['style'] = 'display: none;'; - } - unset($el['properties']['visi']); - } - return $el; - }, $element['elements']); - - - $elements[] = $element; } return $elements; @@ -1030,7 +1015,15 @@ class Design extends BaseDesign $element['elements'][] = ['element' => 'td', 'content' => $row[$cell], 'properties' => ['data-ref' => 'product_table-product.tax2-td', 'visi' => $this->visibilityCheck($column_visibility, $cell)]]; } elseif ($cell == '$product.tax_rate3') { $element['elements'][] = ['element' => 'td', 'content' => $row[$cell], 'properties' => ['data-ref' => 'product_table-product.tax3-td', 'visi' => $this->visibilityCheck($column_visibility, $cell)]]; - } elseif ($cell == '$product.unit_cost' || $cell == '$task.rate') { + } elseif ($cell == '$task.discount' && !$this->company->enable_product_discount) { + $element['elements'][] = ['element' => 'td', 'content' => $row['$task.discount'], 'properties' => ['data-ref' => 'task_table-task.discount-td', 'style' => 'display: none;']]; + } elseif ($cell == '$task.tax_rate1') { + $element['elements'][] = ['element' => 'td', 'content' => $row[$cell], 'properties' => ['data-ref' => 'task_table-task.tax1-td', 'visi' => $this->visibilityCheck($column_visibility, $cell)]]; + } elseif ($cell == '$task.tax_rate2') { + $element['elements'][] = ['element' => 'td', 'content' => $row[$cell], 'properties' => ['data-ref' => 'task_table-task.tax2-td', 'visi' => $this->visibilityCheck($column_visibility, $cell)]]; + } elseif ($cell == '$task.tax_rate3') { + $element['elements'][] = ['element' => 'td', 'content' => $row[$cell], 'properties' => ['data-ref' => 'task_table-task.tax3-td', 'visi' => $this->visibilityCheck($column_visibility, $cell)]]; + }elseif ($cell == '$product.unit_cost' || $cell == '$task.rate') { $element['elements'][] = ['element' => 'td', 'content' => $row[$cell], 'properties' => ['style' => 'white-space: nowrap;', 'data-ref' => "{$_type}_table-" . substr($cell, 1) . '-td', 'visi' => $this->visibilityCheck($column_visibility, $cell)]]; } else { $element['elements'][] = ['element' => 'td', 'content' => $row[$cell], 'properties' => ['data-ref' => "{$_type}_table-" . substr($cell, 1) . '-td', 'visi' => $this->visibilityCheck($column_visibility, $cell)]]; @@ -1038,7 +1031,19 @@ class Design extends BaseDesign } } + // Then, filter the elements array + $element['elements'] = array_map(function ($el) { + if (isset($el['properties']['visi'])) { + if ($el['properties']['visi'] === false) { + $el['properties']['style'] = 'display: none;'; + } + unset($el['properties']['visi']); + } + return $el; + }, $element['elements']); + $elements[] = $element; + } $document = null; @@ -1058,10 +1063,11 @@ class Design extends BaseDesign }); // Transform the items first - $transformed_items = $this->transformLineItems($filtered_items, + $transformed_items = $this->transformLineItems( + $filtered_items->toArray(), $type_id === '1' ? '$product' : '$task' ); - +nlog($transformed_items); $columns = []; // Initialize all columns as empty @@ -1105,9 +1111,12 @@ class Design extends BaseDesign $variables = $this->context['pdf_variables']['total_columns']; $show_terms_label = $this->entityVariableCheck('$entity.terms') ? 'display: none;' : ''; + $elements = [ ['element' => 'div', 'properties' => ['style' => 'display: flex; flex-direction: column;'], 'elements' => [ - ['element' => 'p', 'content' => strtr(str_replace(["labels","values"], ["",""], $_variables['values']['$entity.public_notes']), $_variables), 'properties' => ['data-ref' => 'total_table-public_notes', 'style' => 'text-align: left;']], + ['element' => 'p', 'properties' => ['data-ref' => 'total_table-public_notes', 'style' => 'text-align: left;'], 'elements' => [ + ['element' => 'span', 'content' => strtr(str_replace(["labels", "values"], ["",""], $_variables['values']['$entity.public_notes']), $_variables)] + ]], ['element' => 'p', 'content' => '', 'properties' => ['style' => 'text-align: left; display: flex; flex-direction: column; page-break-inside: auto;'], 'elements' => [ ['element' => 'span', 'content' => '$entity.terms_label: ', 'properties' => ['data-ref' => 'total_table-terms-label', 'style' => "font-weight: bold; text-align: left; margin-top: 1rem; {$show_terms_label}"]], ['element' => 'span', 'content' => strtr(str_replace("labels", "", $_variables['values']['$entity.terms']), $_variables['labels']), 'properties' => ['data-ref' => 'total_table-terms', 'style' => 'text-align: left;']], @@ -1192,9 +1201,6 @@ class Design extends BaseDesign } } elseif (Str::startsWith($variable, '$custom_surcharge')) { $_variable = ltrim($variable, '$'); // $custom_surcharge1 -> custom_surcharge1 - - //07/09/2023 don't show custom values if they are empty - // $visible = intval($this->entity->{$_variable}) != 0; $visible = intval(str_replace(['0','.'], '', $this->entity->{$_variable})) != 0; $elements[1]['elements'][] = ['element' => 'div', 'elements' => [ diff --git a/app/Services/PdfMaker/PdfMaker.php b/app/Services/PdfMaker/PdfMaker.php index dd0e473ad5..8d2119bb0e 100644 --- a/app/Services/PdfMaker/PdfMaker.php +++ b/app/Services/PdfMaker/PdfMaker.php @@ -59,7 +59,7 @@ class PdfMaker public function build() { - + if (isset($this->data['template']) && isset($this->data['variables'])) { $this->getEmptyElements($this->data['template'], $this->data['variables']); } @@ -75,7 +75,7 @@ class PdfMaker $ts = new TemplateService(); - if (isset($this->options['client'])) { + if (isset($this->options['client']) && !empty($this->options['client'])) { $client = $this->options['client']; try { $ts->setCompany($client->company); @@ -85,7 +85,7 @@ class PdfMaker } } - if (isset($this->options['vendor'])) { + if (isset($this->options['vendor']) && !empty($this->options['vendor'])) { $vendor = $this->options['vendor']; try { $ts->setCompany($vendor->company); @@ -139,40 +139,48 @@ class PdfMaker } - // $xpath = new \DOMXPath($this->document); - // $elements = $xpath->query('//*[@data-state="encoded-html"]'); + $xpath = new \DOMXPath($this->document); + $elements = $xpath->query('//*[@data-state="encoded-html"]'); - // foreach ($elements as $element) { + foreach ($elements as $element) { - // // Decode the HTML content - // $html = htmlspecialchars_decode($element->textContent, ENT_QUOTES | ENT_HTML5); - // $html = str_ireplace(['
'], '
', $html); + // Decode the HTML content + $html = htmlspecialchars_decode($element->textContent, ENT_QUOTES | ENT_HTML5); + $html = str_ireplace(['
',''], ['
',''], $html); - // // Create a temporary document to properly parse the HTML - // $temp = new \DOMDocument(); + // Create a temporary document to properly parse the HTML + $temp = new \DOMDocument(); - // // Add UTF-8 wrapper and div container - // $wrappedHtml = '
' . $html . '
'; + // Add UTF-8 wrapper and div container + $wrappedHtml = '
' . $html . '
'; - // // Load the HTML, suppressing any parsing warnings - // @$temp->loadHTML($wrappedHtml, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); + // Load the HTML, suppressing any parsing warnings + @$temp->loadHTML($wrappedHtml, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); - // // Import the div's contents - // $imported = $this->document->importNode($temp->getElementsByTagName('div')->item(0), true); + // Import the div's contents + $imported = $this->document->importNode($temp->getElementsByTagName('div')->item(0), true); - // // Clear existing content of the element - // while ($element->firstChild) { - // $element->removeChild($element->firstChild); - // } + // Clear existing content - more efficient + $element->textContent = ''; + // Get the first div's content + $divContent = $temp->getElementsByTagName('div')->item(0); - // // Append the new content to the element - // $element->appendChild($imported); - - // } + if ($divContent) { + // Import all nodes from the temporary div + foreach ($divContent->childNodes as $child) { + $imported = $this->document->importNode($child, true); + $element->appendChild($imported); + } + } else { + // Fallback - import the entire content if no div found + $imported = $this->document->importNode($temp->documentElement, true); + $element->appendChild($imported); + } + } return $this; } diff --git a/app/Services/PdfMaker/PdfMakerUtilities.php b/app/Services/PdfMaker/PdfMakerUtilities.php index 8876f599dd..cf7b98c557 100644 --- a/app/Services/PdfMaker/PdfMakerUtilities.php +++ b/app/Services/PdfMaker/PdfMakerUtilities.php @@ -143,13 +143,15 @@ trait PdfMakerUtilities $html = strtr($html, $variables['values']); - // @$this->document->loadHTML(mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8')); + //old block + @$this->document->loadHTML(mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8')); - $html = htmlspecialchars_decode($html, ENT_QUOTES | ENT_HTML5); - $html = str_ireplace(['
'], '
', $html); - - @$this->document->loadHTML(''.$html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); + //new block + // $html = htmlspecialchars_decode($html, ENT_QUOTES | ENT_HTML5); + // $html = str_ireplace(['
'], '
', $html); + // @$this->document->loadHTML(''.$html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); + //continues $this->document->saveHTML(); } diff --git a/app/Utils/Traits/Pdf/PdfMaker.php b/app/Utils/Traits/Pdf/PdfMaker.php index 5bb2d679de..926692467a 100644 --- a/app/Utils/Traits/Pdf/PdfMaker.php +++ b/app/Utils/Traits/Pdf/PdfMaker.php @@ -95,7 +95,6 @@ trait PdfMaker $html = str_ireplace(['file:/', 'iframe', ''], '', $html); - // nlog($html); $generated = $pdf ->setHtml($html) ->generate(); diff --git a/resources/views/pdf-designs/bold.html b/resources/views/pdf-designs/bold.html index 5e0774d1c9..8fe4d7678f 100644 --- a/resources/views/pdf-designs/bold.html +++ b/resources/views/pdf-designs/bold.html @@ -414,7 +414,7 @@ } #qr-bill{ - width:100%; + width:100% !important; } /** Useful snippets, uncomment to enable. **/ diff --git a/resources/views/pdf-designs/business.html b/resources/views/pdf-designs/business.html index 3d5a9a8cf1..9015c381ee 100644 --- a/resources/views/pdf-designs/business.html +++ b/resources/views/pdf-designs/business.html @@ -348,7 +348,7 @@ } #qr-bill{ - width:100%; + width:100% !important; } diff --git a/resources/views/pdf-designs/calm.html b/resources/views/pdf-designs/calm.html index 885953fa6d..fd2a9624f4 100644 --- a/resources/views/pdf-designs/calm.html +++ b/resources/views/pdf-designs/calm.html @@ -348,6 +348,10 @@ .pqrcode {} + #qr-bill{ + width:100% !important; + } + /** Useful snippets, uncomment to enable. **/ /** Hide company logo **/ diff --git a/resources/views/pdf-designs/clean.html b/resources/views/pdf-designs/clean.html index c50a47c1e0..989333266e 100644 --- a/resources/views/pdf-designs/clean.html +++ b/resources/views/pdf-designs/clean.html @@ -37,17 +37,6 @@ padding: 0; } - #qr-bill { - width:100% !important; - box-sizing: border-box; - border-collapse: collapse; - color: #000; - } - - #qr-bill td { - max-width: none; - } - .header-container { display: grid; grid-template-columns: repeat(3, 1fr); @@ -360,7 +349,7 @@ } #qr-bill{ - width:100%; + width:100% !important; } /** Useful snippets, uncomment to enable. **/ diff --git a/resources/views/pdf-designs/creative.html b/resources/views/pdf-designs/creative.html index cfc68d6725..45209e744e 100644 --- a/resources/views/pdf-designs/creative.html +++ b/resources/views/pdf-designs/creative.html @@ -311,7 +311,7 @@ } #qr-bill{ - width:100%; + width:100% !important; } /** Useful snippets, uncomment to enable. **/ diff --git a/resources/views/pdf-designs/elegant.html b/resources/views/pdf-designs/elegant.html index f3c0646f80..2eeba2d836 100644 --- a/resources/views/pdf-designs/elegant.html +++ b/resources/views/pdf-designs/elegant.html @@ -331,7 +331,7 @@ } #qr-bill{ - width:100%; + width:100% !important; } /** Useful snippets, uncomment to enable. **/ diff --git a/resources/views/pdf-designs/hipster.html b/resources/views/pdf-designs/hipster.html index 358c5decf5..f9234c8e26 100644 --- a/resources/views/pdf-designs/hipster.html +++ b/resources/views/pdf-designs/hipster.html @@ -392,7 +392,7 @@ } #qr-bill{ - width:100%; + width:100% !important; } /** Useful snippets, uncomment to enable. **/ diff --git a/resources/views/pdf-designs/modern.html b/resources/views/pdf-designs/modern.html index 3c21952c68..0d8dad88cd 100644 --- a/resources/views/pdf-designs/modern.html +++ b/resources/views/pdf-designs/modern.html @@ -395,7 +395,7 @@ } #qr-bill{ - width:100%; + width:100% !important; } /** Useful snippets, uncomment to enable. **/ diff --git a/resources/views/pdf-designs/plain.html b/resources/views/pdf-designs/plain.html index 1477deca65..1b09b14c08 100644 --- a/resources/views/pdf-designs/plain.html +++ b/resources/views/pdf-designs/plain.html @@ -354,7 +354,7 @@ #qr-bill{ - width:100%; + width:100% !important; } diff --git a/resources/views/pdf-designs/playful.html b/resources/views/pdf-designs/playful.html index 52dd790a3c..a731537270 100644 --- a/resources/views/pdf-designs/playful.html +++ b/resources/views/pdf-designs/playful.html @@ -382,6 +382,10 @@ .pqrcode { } + + #qr-bill{ + width:100% !important; + } /** Useful snippets, uncomment to enable. **/ diff --git a/resources/views/pdf-designs/tech.html b/resources/views/pdf-designs/tech.html index f168be432c..3022ae03f2 100644 --- a/resources/views/pdf-designs/tech.html +++ b/resources/views/pdf-designs/tech.html @@ -387,8 +387,8 @@ } - #qr-bill{ - width:100%; + #qr-bill{ + width:100% !important; } /** Useful snippets, uncomment to enable. **/