mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Add in shipping details
This commit is contained in:
parent
2d9c884b00
commit
dc95528d13
@ -1048,6 +1048,10 @@ class PdfBuilder
|
|||||||
'id' => 'client-details',
|
'id' => 'client-details',
|
||||||
'elements' => $this->clientDetails(),
|
'elements' => $this->clientDetails(),
|
||||||
],
|
],
|
||||||
|
'shipping-details' => [
|
||||||
|
'id' => 'shipping-details',
|
||||||
|
'elements' => $this->shippingDetails(),
|
||||||
|
],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
@ -1287,6 +1291,31 @@ class PdfBuilder
|
|||||||
return $elements;
|
return $elements;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function shippingDetails(): array
|
||||||
|
{
|
||||||
|
$elements = [];
|
||||||
|
|
||||||
|
if (!$this->service->config->client) {
|
||||||
|
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->service->config->client->name, 'show_empty' => false, 'properties' => ['data-ref' => 'shipping_address-client.name']],
|
||||||
|
['element' => 'p', 'content' => $this->service->config->client->shipping_address1, 'show_empty' => false, 'properties' => ['data-ref' => 'shipping_address-client.shipping_address1']],
|
||||||
|
['element' => 'p', 'content' => $this->service->config->client->shipping_address2, 'show_empty' => false, 'properties' => ['data-ref' => 'shipping_address-client.shipping_address2']],
|
||||||
|
['element' => 'p', 'show_empty' => false, 'elements' => [
|
||||||
|
['element' => 'span', 'content' => "{$this->service->config->client->shipping_city} ", 'properties' => ['ref' => 'shipping_address-client.shipping_city']],
|
||||||
|
['element' => 'span', 'content' => "{$this->service->config->client->shipping_state} ", 'properties' => ['ref' => 'shipping_address-client.shipping_state']],
|
||||||
|
['element' => 'span', 'content' => "{$this->service->config->client->shipping_postal_code} ", 'properties' => ['ref' => 'shipping_address-client.shipping_postal_code']],
|
||||||
|
]],
|
||||||
|
['element' => 'p', 'content' => optional($this->service->config->client->shipping_country)->name, 'show_empty' => false],
|
||||||
|
];
|
||||||
|
|
||||||
|
return $elements;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates the delivery note table
|
* Generates the delivery note table
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user