diff --git a/app/Services/PdfMaker/Design.php b/app/Services/PdfMaker/Design.php index 608f9e28c54a..91ca48cfa2ab 100644 --- a/app/Services/PdfMaker/Design.php +++ b/app/Services/PdfMaker/Design.php @@ -306,7 +306,7 @@ class Design extends BaseDesign return $elements; } - public function entityDetails(): array + public function entityDetailsx(): array { @@ -379,7 +379,7 @@ class Design extends BaseDesign } - public function entityDetailsx(): array + public function entityDetails(): array { @@ -457,6 +457,7 @@ class Design extends BaseDesign return $elements; } + public function deliveryNoteTable(): array { if ($this->type !== self::DELIVERY_NOTE) { diff --git a/app/Services/PdfMaker/Designs/Utilities/DesignHelpers.php b/app/Services/PdfMaker/Designs/Utilities/DesignHelpers.php index 868425679f2e..bef121554684 100644 --- a/app/Services/PdfMaker/Designs/Utilities/DesignHelpers.php +++ b/app/Services/PdfMaker/Designs/Utilities/DesignHelpers.php @@ -246,7 +246,44 @@ trait DesignHelpers ]]; } - public function entityVariableCheck(string $variable): string + + public function entityVariableCheck(string $variable): bool + { + // Extract $invoice.date => date + // so we can append date as $entity->date and not $entity->$invoice.date; + + // When it comes to invoice balance, we'll always show it. + if ($variable == '$invoice.total') { + return false; + } + + // Some variables don't map 1:1 to table columns. This gives us support for such cases. + $aliases = [ + '$quote.balance_due' => 'partial', + ]; + + try { + $_variable = explode('.', $variable)[1]; + } catch (Exception $e) { + throw new Exception('Company settings seems to be broken. Missing $entity.variable type.'); + } + + if (\in_array($variable, \array_keys($aliases))) { + $_variable = $aliases[$variable]; + } + + if (is_null($this->entity->{$_variable})) { + return true; + } + + if (empty($this->entity->{$_variable})) { + return true; + } + + return false; + } + + public function entityVariableCheckx(string $variable): string { // Extract $invoice.date => date // so we can append date as $entity->date and not $entity->$invoice.date; diff --git a/resources/views/pdf-designs/clean.html b/resources/views/pdf-designs/clean.html index b7184fa6f707..8f112366270b 100644 --- a/resources/views/pdf-designs/clean.html +++ b/resources/views/pdf-designs/clean.html @@ -34,11 +34,6 @@ padding: 0; } - span { - - border-right:10px; - } - #qr-bill { width:100% !important; box-sizing: border-box; @@ -57,7 +52,8 @@ } .company-logo { - max-width: $company_logo_size; + max-width: 65%; + /* max-width: $company_logo_size;*/ } #company-details { @@ -86,32 +82,34 @@ } .client-and-entity-wrapper { - display: flex; - padding: 0.2rem; +/* display: flex;*/ + padding: 1rem; + display: grid; + grid-template-columns: 1fr 1fr 1fr; border-top: 1px solid #d8d8d8; border-bottom: 1px solid #d8d8d8; } #entity-details { - display: table; - padding-right: 30px; - flex-direction: column; - overflow: hidden; - height: 12px; - white-space: nowrap; - line-height: var(--line-height); + display:flex; + text-align: left; + margin-right: 20px; + } - .entity-details-cell { - display: table-cell; - border-right: 10px solid transparent; + #entity-details > tr, + #entity-details th { + font-weight: normal; + padding-right: 15px; + padding-top: 2.5px; + padding-bottom: 2.5px; } #client-details { display: flex; flex-direction: column; - padding-right: 30px; line-height: var(--line-height); + padding-right:30px; } #shipping-details { @@ -120,6 +118,12 @@ line-height: var(--line-height); } + #client-details { + display: flex; + flex-direction: column; + line-height: var(--line-height); + } + #client-details > :first-child { font-weight: bold; } @@ -367,7 +371,9 @@

$entity_label

-
+
+
+
@@ -423,4 +429,4 @@ $entity_images }); -
+ \ No newline at end of file