diff --git a/app/Services/Invoice/GenerateDeliveryNote.php b/app/Services/Invoice/GenerateDeliveryNote.php
index a7a35a05fcac..b54d89184b2f 100644
--- a/app/Services/Invoice/GenerateDeliveryNote.php
+++ b/app/Services/Invoice/GenerateDeliveryNote.php
@@ -43,9 +43,9 @@ class GenerateDeliveryNote
{
$delivery_note_design_id = $this->invoice->client->getSetting('delivery_note_design_id');
+ $design = Design::find($this->decodePrimaryKey($delivery_note_design_id));
- // if($design = Design::find($this->decodePrimaryKey($delivery_note_design_id)))
- if($design = Design::find(15))
+ if($design && $design->is_template)
{
$ts = new TemplateService($design);
diff --git a/app/Services/Pdf/PdfMock.php b/app/Services/Pdf/PdfMock.php
index 6b26adcc0078..c120168f2427 100644
--- a/app/Services/Pdf/PdfMock.php
+++ b/app/Services/Pdf/PdfMock.php
@@ -209,12 +209,12 @@ class PdfMock
'$client.shipping_address1' => '453',
'$client.shipping_address2' => '66327 Waters Trail',
'$client.city_state_postal' => 'Aufderharchester, North Carolina 11243',
- '$client.shipping_address' => '453
66327 Waters Trail
Aufderharchester, North Carolina 11243
Afghanistan
',
+ '$client.shipping_address' => '453
66327 Waters Trail
Aufderharchester, North Carolina 11243
United States
',
'$client.billing_address2' => '63993 Aiyana View',
'$client.billing_address1' => '8447',
'$client.shipping_country' => 'USA',
'$invoiceninja.whitelabel' => 'https://invoicing.co/images/new_logo.png',
- '$client.billing_address' => '8447
63993 Aiyana View
Aufderharchester, North Carolina 11243
Afghanistan
',
+ '$client.billing_address' => '8447
63993 Aiyana View
Aufderharchester, North Carolina 11243
United States
',
'$client.billing_country' => 'USA',
'$task.gross_line_total' => '100',
'$contact.portal_button' => 'View client portal',
@@ -331,14 +331,14 @@ class PdfMock
'$invoice.number' => '0029',
'$quote.quote_no' => '0029',
'$quote.datetime' => '25/Feb/2023 1:10 am',
- '$client_address' => '8447
63993 Aiyana View
Aufderharchester, North Carolina 11243
Afghanistan
',
- '$client.address' => '8447
63993 Aiyana View
Aufderharchester, North Carolina 11243
Afghanistan
',
+ '$client_address' => '8447
63993 Aiyana View
Aufderharchester, North Carolina 11243
United States
',
+ '$client.address' => '8447
63993 Aiyana View
Aufderharchester, North Carolina 11243
United States
',
'$payment_button' => 'Pay Now',
'$payment_qrcode' => '',
- '$client.country' => 'Afghanistan',
+ '$client.country' => 'United States',
'$user.last_name' => 'Erna Wunsch',
'$client.website' => 'http://www.parisian.org/',
'$dir_text_align' => 'left',
@@ -832,8 +832,8 @@ class PdfMock
'$purchase_order.custom2' => 'Custom 2',
'$purchase_order.custom3' => 'Custom 3',
'$purchase_order.custom4' => 'Custom 4',
- '$vendor.billing_address' => '589
761 Odessa Centers Suite 673
New Loy, Delaware 29359
Afghanistan
',
- '$vendor.billing_country' => 'Afghanistan',
+ '$vendor.billing_address' => '589
761 Odessa Centers Suite 673
New Loy, Delaware 29359
United States
',
+ '$vendor.billing_country' => 'United States',
'$purchase_order.number' => 'Live Preview #790',
'$purchase_order.total' => '$10,256.40',
'$vendor.billing_state' => 'West Virginia',
@@ -907,9 +907,9 @@ class PdfMock
'$company.website' => 'http://www.dare.com/vero-consequatur-eveniet-dolorum-exercitationem-alias-repellat.html',
'$gross_subtotal' => '$10,256.40',
'$emailSignature' => ' ',
- '$vendor_address' => '589
761 Odessa Centers Suite 673
New Loy, Delaware 29359
Afghanistan
',
- '$vendor.address' => '589
761 Odessa Centers Suite 673
New Loy, Delaware 29359
Afghanistan
',
- '$vendor.country' => 'Afghanistan',
+ '$vendor_address' => '589
761 Odessa Centers Suite 673
New Loy, Delaware 29359
United States
',
+ '$vendor.address' => '589
761 Odessa Centers Suite 673
New Loy, Delaware 29359
United States
',
+ '$vendor.country' => 'United States',
'$vendor.custom3' => 'Ea quia tempore.',
'$vendor.custom1' => 'Necessitatibus aut.',
'$vendor.custom4' => 'Nobis aut harum.',
@@ -1089,7 +1089,7 @@ class PdfMock
'$custom3' => ' ',
'$custom4' => ' ',
'$dueDate' => ' ',
- '$country' => 'Afghanistan',
+ '$country' => 'United States',
'$vendor3' => 'Ea quia tempore.',
'$contact' => 'Geo Maggio',
'$account' => 'Mrs. Kristina Powlowski',
diff --git a/app/Services/Template/TemplateService.php b/app/Services/Template/TemplateService.php
index 9ed3762cdffe..c9caffb66c1c 100644
--- a/app/Services/Template/TemplateService.php
+++ b/app/Services/Template/TemplateService.php
@@ -328,7 +328,7 @@ class TemplateService
->map(function ($invoice){
$payments = [];
- nlog($invoice);
+
if($invoice->payments) {
$payments = $invoice->payments->map(function ($payment) {
// nlog(microtime(true));