From ba3e7f7a28e362f9b7cd428f40065004b48ef55f Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 11 Jun 2023 17:08:51 +1000 Subject: [PATCH] Fixes for showing shipping details label on invoice pdf --- app/Services/PdfMaker/Design.php | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/app/Services/PdfMaker/Design.php b/app/Services/PdfMaker/Design.php index 51c58ce1c532..0ca138f12823 100644 --- a/app/Services/PdfMaker/Design.php +++ b/app/Services/PdfMaker/Design.php @@ -254,19 +254,6 @@ class Design extends BaseDesign return $elements; } - // $elements = [ - // ['element' => 'p', 'content' => ctrans('texts.shipping_address'), 'properties' => ['data-ref' => 'shipping_address-label', 'style' => 'font-weight: bold; text-transform: uppercase']], - // ['element' => 'p', 'content' => $this->client->name, 'show_empty' => false, 'properties' => ['data-ref' => 'shipping_address-client.name']], - // ['element' => 'p', 'content' => $this->client->shipping_address1, 'show_empty' => false, 'properties' => ['data-ref' => 'shipping_address-client.shipping_address1']], - // ['element' => 'p', 'content' => $this->client->shipping_address2, 'show_empty' => false, 'properties' => ['data-ref' => 'shipping_address-client.shipping_address2']], - // ['element' => 'p', 'show_empty' => false, 'elements' => [ - // ['element' => 'span', 'content' => "{$this->client->shipping_city} ", 'properties' => ['ref' => 'shipping_address-client.shipping_city']], - // ['element' => 'span', 'content' => "{$this->client->shipping_state} ", 'properties' => ['ref' => 'shipping_address-client.shipping_state']], - // ['element' => 'span', 'content' => "{$this->client->shipping_postal_code} ", 'properties' => ['ref' => 'shipping_address-client.shipping_postal_code']], - // ]], - // ['element' => 'p', 'content' => optional($this->client->shipping_country)->name, 'show_empty' => false], - // ]; - $address_variables = [ '$client.address1', '$client.address2', @@ -287,7 +274,11 @@ class Design extends BaseDesign })->toArray(); - return $elements; + $header = []; + $header[] = ['element' => 'p', 'content' => ctrans('texts.shipping_address'), 'properties' => ['data-ref' => 'shipping_address-label', 'style' => 'font-weight: bold; text-transform: uppercase']]; + return array_merge($header, $elements); + + // return $elements; }