diff --git a/app/DataMapper/CompanySettings.php b/app/DataMapper/CompanySettings.php index 874ad1529b50..44069fcf8a5a 100644 --- a/app/DataMapper/CompanySettings.php +++ b/app/DataMapper/CompanySettings.php @@ -466,70 +466,70 @@ class CompanySettings extends BaseSettings private static function getEntityVariableDefaults() { $variables = [ - 'client_details' => (object)[ - '$client.name' => ctrans('texts.client_name'), - '$client.id_number' => ctrans('texts.id_number'), - '$client.vat_number' => ctrans('texts.vat_number'), - '$client.address1' => ctrans('texts.address1'), - '$client.address2' => ctrans('texts.address2'), - '$client.city_state_postal' => ctrans('texts.city_state_postal'), - '$client.country' => ctrans('texts.country'), - '$client.email' => ctrans('texts.email'), + 'client_details' => [ + '$client.name', + '$client.id_number', + '$client.vat_number', + '$client.address1', + '$client.address2', + '$client.city_state_postal', + '$client.country', + '$contact.email', ], - 'company_details' => (object)[ - '$company.company_name' => ctrans('texts.company_name'), - '$company.id_number' => ctrans('texts.id_number'), - '$company.vat_number' => ctrans('texts.vat_number'), - '$company.website' => ctrans('texts.website'), - '$company.email' => ctrans('texts.email'), - '$company.phone' => ctrans('texts.phone'), + 'company_details' => [ + '$company.company_name', + '$company.id_number', + '$company.vat_number', + '$company.website', + '$company.email', + '$company.phone', ], - 'company_address' => (object)[ - '$company.address1' => ctrans('texts.address1'), - '$company.address2' => ctrans('texts.address2'), - '$company.city_state_postal' => ctrans('texts.city_state_postal'), - '$company.country' => ctrans('texts.country'), + 'company_address' => [ + '$company.address1', + '$company.address2', + '$company.city_state_postal', + '$company.country', ], - 'invoice_details' => (object)[ - '$invoice.invoice_number' => ctrans('texts.invoice_number'), - '$invoice.po_number' => ctrans('texts.po_number'), - '$invoice.invoice_date' => ctrans('texts.invoice_date'), - '$invoice.due_date' => ctrans('texts.due_date'), - '$invoice.balance_due' => ctrans('texts.balance_due'), - '$invoice.invoice_total' => ctrans('texts.invoice_total'), + 'invoice_details' => [ + '$invoice.invoice_number', + '$invoice.po_number', + '$invoice.invoice_date', + '$invoice.due_date', + '$invoice.balance_due', + '$invoice.invoice_total', ], - 'quote_details' => (object)[ - '$quote.quote_number' => ctrans('texts.quote_number'), - '$quote.po_number' => ctrans('texts.po_number'), - '$quote.quote_date' => ctrans('texts.quote_date'), - '$quote.valid_until' => ctrans('texts.valid_until'), - '$quote.balance_due' => ctrans('texts.balance_due'), - '$quote.quote_total' => ctrans('texts.quote_total'), + 'quote_details' => [ + '$quote.quote_number', + '$quote.po_number', + '$quote.quote_date', + '$quote.valid_until', + '$quote.balance_due', + '$quote.quote_total', ], - 'credit_details' => (object)[ - '$credit.credit_number' => ctrans('texts.credit_number'), - '$credit.po_number' => ctrans('texts.po_number'), - '$credit.credit_date' => ctrans('texts.credit_date'), - '$credit.credit_balance' => ctrans('texts.credit_balance'), - '$credit.credit_amount' => ctrans('texts.credit_amount'), + 'credit_details' => [ + '$credit.credit_number', + '$credit.po_number', + '$credit.credit_date', + '$credit.credit_balance', + '$credit.credit_amount', ], - 'product_columns' => (object)[ - '$product.product_key' => ctrans('texts.product_key'), - '$product.notes' => ctrans('texts.notes'), - '$product.cost' => ctrans('texts.cost'), - '$product.quantity' => ctrans('texts.quantity'), - '$product.discount' => ctrans('texts.discount'), - '$product.tax_name1' => ctrans('texts.tax_name1'), - '$product.line_total' => ctrans('texts.line_total'), + 'product_columns' => [ + '$product.product_key', + '$product.notes', + '$product.cost', + '$product.quantity', + '$product.discount', + '$product.tax_name1', + '$product.line_total', ], - 'task_columns' => (object)[ - '$task.product_key' => ctrans('texts.product_key'), - '$task.notes' => ctrans('texts.notes'), - '$task.cost' => ctrans('texts.cost'), - '$task.quantity' => ctrans('texts.quantity'), - '$task.discount' => ctrans('texts.discount'), - '$task.tax_name1' => ctrans('texts.tax_name1'), - '$task.line_total' => ctrans('texts.line_total'), + 'task_columns' =>[ + '$task.product_key', + '$task.notes', + '$task.cost', + '$task.quantity', + '$task.discount', + '$task.tax_name1', + '$task.line_total', ], ]; diff --git a/app/Designs/Designer.php b/app/Designs/Designer.php index 3334218e252d..1bc7aa99a076 100644 --- a/app/Designs/Designer.php +++ b/app/Designs/Designer.php @@ -89,30 +89,22 @@ class Designer public function getIncludes() { - $this->setDesign($this->getSection('includes')); - - return $this; + return $this->getSection('includes'); } public function getHeader() { - $this->setDesign($this->getSection('header')); - - return $this; + return $this->getSection('header'); } public function getFooter() { - $this->setDesign($this->getSection('footer')); - - return $this; + return $this->getSection('footer'); } public function getBody() { - $this->setDesign($this->getSection('body')); - - return $this; + return $this->getSection('body'); } public function getHtml():string @@ -148,6 +140,7 @@ class Designer private function exportVariables() { + //$s = microtime(true); $company = $this->entity->company; $this->exported_variables['$app_url'] = $this->entity->generateAppUrl(); @@ -178,7 +171,7 @@ class Designer if (strlen($this->exported_variables['$product_table_body']) == 0) { $this->exported_variables['$product_table_header'] = ''; } - + //\Log::error("Exporting variables took = ".(microtime(true)-$s)); return $this; } @@ -186,8 +179,10 @@ class Designer { $output = ''; - foreach (array_keys($input_variables) as $value) { - $output .= $variables[$value]; + foreach (array_values($input_variables) as $value) { + if (array_key_exists($value, $variables)) { + $output .= $variables[$value]; + } } return $output; @@ -198,9 +193,11 @@ class Designer $output = ''; foreach (array_keys($input_variables) as $value) { - $tmp = str_replace("", "_label", $variables[$value]); - //$output .= $variables[$value]; - $output .= $tmp; + if (array_key_exists($value, $variables)) { + $tmp = str_replace("", "_label", $variables[$value]); + + $output .= $tmp; + } } return $output; @@ -217,15 +214,15 @@ class Designer '$client.city_state_postal' => '
$client.city_state_postal
', '$client.postal_city_state' => '$client.postal_city_state
', '$client.country' => '$client.country
', - '$client.email' => '$client.email
', - '$client.client1' => '$client1
', - '$client.client2' => '$client2
', - '$client.client3' => '$client3
', - '$client.client4' => '$client4
', - '$client.contact1' => '$contact1
', - '$client.contact2' => '$contact2
', - '$client.contact3' => '$contact3
', - '$client.contact4' => '$contact4
', + '$contact.email' => '$client.email
', + '$client.custom1' => '$client.custom1
', + '$client.custom2' => '$client.custom2
', + '$client.custom3' => '$client.custom3
', + '$client.custom4' => '$client.custom4
', + '$contact.contact1' => '$contact.custom1
', + '$contact.contact2' => '$contact.custom2
', + '$contact.contact3' => '$contact.custom3
', + '$contact.contact4' => '$contact.custom4
', ]; return $this->processCustomFields($company, $data); @@ -269,21 +266,21 @@ class Designer private function invoiceDetails(Company $company) { $data = [ - '$invoice.invoice_number' => '$invoice.number_label$invoice.number', - '$invoice.po_number' => '$invoice.po_number_label$invoice.po_number', - '$invoice.invoice_date' => '$invoice.date_label$invoice.date', - '$invoice.due_date' => '$invoice.due_date_label$invoice.due_date', - '$invoice.balance_due' => '$invoice.balance_due_label$invoice.balance_due', - '$invoice.invoice_total' => '$invoice.total_label$invoice.total', - '$invoice.partial_due' => '$invoice.partial_due_label$invoice.partial_due', - '$invoice.invoice1' => '$invoice1_label$invoice1', - '$invoice.invoice2' => '$invoice2_label$invoice2', - '$invoice.invoice3' => '$invoice3_label$invoice3', - '$invoice.invoice4' => '$invoice4_label$invoice4', - '$invoice.surcharge1' => '$surcharge1_label$surcharge1', - '$invoice.surcharge2' => '$surcharge2_label$surcharge2', - '$invoice.surcharge3' => '$surcharge3_label$surcharge3', - '$invoice.surcharge4' => '$surcharge4_label$surcharge4', + '$invoice.number' => '$invoice.number_label: $invoice.number', + '$invoice.po_number' => '$invoice.po_number_label: $invoice.po_number', + '$invoice.date' => '$invoice.date_label: $invoice.date', + '$invoice.due_date' => '$invoice.due_date_label: $invoice.due_date', + '$invoice.balance_due' => '$invoice.balance_due_label: $invoice.balance_due', + '$invoice.total' => '$invoice.total_label: $invoice.total', + '$invoice.partial_due' => '$invoice.partial_due_label: $invoice.partial_due', + '$invoice.custom1' => '$invoice1_label: $invoice.custom1', + '$invoice.custom2' => '$invoice2_label: $invoice.custom2', + '$invoice.custom3' => '$invoice3_label: $invoice.custom3', + '$invoice.custom4' => '$invoice4_label: $invoice.custom4', + '$surcharge1' => '$surcharge1_label: $surcharge1', + '$surcharge2' => '$surcharge2_label: $surcharge2', + '$surcharge3' => '$surcharge3_label: $surcharge3', + '$surcharge4' => '$surcharge4_label: $surcharge4', ]; return $this->processCustomFields($company, $data); diff --git a/app/Http/Controllers/SetupController.php b/app/Http/Controllers/SetupController.php index 71649541fa86..55b5e137752f 100644 --- a/app/Http/Controllers/SetupController.php +++ b/app/Http/Controllers/SetupController.php @@ -99,14 +99,15 @@ class SetupController extends Controller */ public function checkDB(): Response { - if (Account::count() == 0) {} + if (Account::count() == 0) { + } // test db - > /setup/check_db (POST) please send array of DB variables - response 200/success or 400 [message] // test mail -> /setup/check_mail (POST) please send array of MAIL xvariables - response 200/success or 400 [message] $randomStatus = rand(0, 1); - if($randomStatus) { + if ($randomStatus) { return response([], 200); } @@ -120,14 +121,15 @@ class SetupController extends Controller */ public function checkMail(): Response { - if (Account::count() == 0) {} + if (Account::count() == 0) { + } // test db - > /setup/check_db (POST) please send array of DB variables - response 200/success or 400 [message] // test mail -> /setup/check_mail (POST) please send array of MAIL variables - response 200/success or 400 [message] $randomStatus = rand(0, 1); - if($randomStatus) { + if ($randomStatus) { return response([], 200); } diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 90699f8b32a5..a96994d824bf 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -46,7 +46,6 @@ class Kernel extends HttpKernel \Illuminate\View\Middleware\ShareErrorsFromSession::class, \App\Http\Middleware\VerifyCsrfToken::class, \Illuminate\Routing\Middleware\SubstituteBindings::class, - \App\Http\Middleware\StartupCheck::class, \App\Http\Middleware\QueryLogging::class, ], diff --git a/app/Http/Requests/Template/ShowTemplateRequest.php b/app/Http/Requests/Template/ShowTemplateRequest.php index 56488c5491e8..7dcbbc00b08f 100644 --- a/app/Http/Requests/Template/ShowTemplateRequest.php +++ b/app/Http/Requests/Template/ShowTemplateRequest.php @@ -46,6 +46,5 @@ class ShowTemplateRequest extends Request public function message() { - } } diff --git a/app/Jobs/Quote/CreateQuotePdf.php b/app/Jobs/Quote/CreateQuotePdf.php index 59cb55c2f75a..abb8fd0512c1 100644 --- a/app/Jobs/Quote/CreateQuotePdf.php +++ b/app/Jobs/Quote/CreateQuotePdf.php @@ -74,47 +74,22 @@ class CreateQuotePdf implements ShouldQueue App::setLocale($this->contact->preferredLocale()); - $path = $this->quote->client->quote_filepath(); + $path = $this->quote->client->quote_filepath(); - $design = Design::find($this->decodePrimaryKey($this->quote->client->getSetting('quote_design_id'))); + $design = Design::find($this->decodePrimaryKey($this->quote->client->getSetting('quote_design_id'))); - $designer = new Designer($this->quote, $design, $this->quote->client->getSetting('pdf_variables'), 'quote'); + $designer = new Designer($this->quote, $design, $this->quote->client->getSetting('pdf_variables'), 'quote'); //todo - move this to the client creation stage so we don't keep hitting this unnecessarily Storage::makeDirectory($path, 0755); - //\Log::error($html); - $all_pages_header = $settings->all_pages_header; $all_pages_footer = $settings->all_pages_footer; $quote_number = $this->quote->number; - - // if($all_pages_header && $all_pages_footer){ - // $all_pages_header = $designer->init()->getHeader()->getHtml(); - // $all_pages_footer = $designer->init()->getFooter()->getHtml(); - // $design_body = $designer->init()->getBody()->getHtml(); - // $quote_number = "header_and_footer"; - // } - // elseif($all_pages_header){ - // $all_pages_header = $designer->init()->getHeader()->getHtml(); - // $design_body = $designer->init()->getBody()->getFooter()->getHtml(); - // $quote_number = "header_only"; - // } - // elseif($all_pages_footer){ - // $all_pages_footer = $designer->init()->getFooter()->getHtml(); - // $design_body = $designer->init()->getHeader()->getBody()->getHtml(); - // $quote_number = "footer_only"; - // } - // else{ $design_body = $designer->build()->getHtml(); - - - - //get invoice design - // $html = $this->generateInvoiceHtml($design_body, $this->quote, $this->contact); $html = $this->generateEntityHtml($designer, $this->quote, $this->contact); $pdf = $this->makePdf($all_pages_header, $all_pages_footer, $html); @@ -122,8 +97,6 @@ class CreateQuotePdf implements ShouldQueue $instance = Storage::disk($this->disk)->put($file_path, $pdf); - //$instance= Storage::disk($this->disk)->path($file_path); - // return $file_path; } } diff --git a/app/Utils/TemplateEngine.php b/app/Utils/TemplateEngine.php index 2c61f7031f48..0f516bcff1d2 100644 --- a/app/Utils/TemplateEngine.php +++ b/app/Utils/TemplateEngine.php @@ -126,7 +126,6 @@ class TemplateEngine ]); $this->body = $converter->convertToHtml($this->body); - } private function entityValues() @@ -145,7 +144,6 @@ class TemplateEngine ]); $this->body = $converter->convertToHtml($this->body); - } private function renderTemplate() diff --git a/app/Utils/Traits/MakesInvoiceHtml.php b/app/Utils/Traits/MakesInvoiceHtml.php index 4dfb0536b6a9..e428c85292d6 100644 --- a/app/Utils/Traits/MakesInvoiceHtml.php +++ b/app/Utils/Traits/MakesInvoiceHtml.php @@ -45,13 +45,15 @@ trait MakesInvoiceHtml $labels = $entity->makeLabels(); $values = $entity->makeValues($contact); + $designer->build(); + $data = []; $data['entity'] = $entity; $data['lang'] = $client->preferredLocale(); - $data['includes'] = $designer->init()->getIncludes()->getHtml(); - $data['header'] = $designer->init()->getHeader()->getHtml(); - $data['body'] = $designer->init()->getBody()->getHtml(); - $data['footer'] = $designer->init()->getFooter()->getHtml(); + $data['includes'] = $designer->getIncludes(); + $data['header'] = $designer->getHeader(); + $data['body'] = $designer->getBody(); + $data['footer'] = $designer->getFooter(); $html = view('pdf.stub', $data)->render(); diff --git a/app/Utils/Traits/MakesInvoiceValues.php b/app/Utils/Traits/MakesInvoiceValues.php index cde42e5b6490..9ed032f1255b 100644 --- a/app/Utils/Traits/MakesInvoiceValues.php +++ b/app/Utils/Traits/MakesInvoiceValues.php @@ -125,6 +125,12 @@ trait MakesInvoiceValues $settings = $this->client->getMergedSettings(); + if (!$contact) { + $contact = $this->client->primary_contact()->first(); + } + + $calc = $this->calc(); + $data = []; $data['$tax'] = ['value' => '', 'label' => ctrans('texts.tax')]; $data['$app_url'] = ['value' => $this->generateAppUrl(), 'label' => '']; @@ -170,26 +176,26 @@ trait MakesInvoiceValues $data['$entity_number'] = &$data['$number']; //$data['$paid_to_date'] = ; - $data['$invoice.discount'] = ['value' => Number::formatMoney($this->calc()->getTotalDiscount(), $this->client) ?: ' ', 'label' => ctrans('texts.discount')]; + $data['$invoice.discount'] = ['value' => Number::formatMoney($calc->getTotalDiscount(), $this->client) ?: ' ', 'label' => ctrans('texts.discount')]; $data['$discount'] = &$data['$invoice.discount']; - $data['$subtotal'] = ['value' => Number::formatMoney($this->calc()->getSubTotal(), $this->client) ?: ' ', 'label' => ctrans('texts.subtotal')]; + $data['$subtotal'] = ['value' => Number::formatMoney($calc->getSubTotal(), $this->client) ?: ' ', 'label' => ctrans('texts.subtotal')]; $data['$invoice.subtotal'] = &$data['$subtotal']; $data['$invoice.balance_due'] = ['value' => Number::formatMoney($this->balance, $this->client) ?: ' ', 'label' => ctrans('texts.balance_due')]; $data['$quote.balance_due'] = &$data['$invoice.balance_due']; $data['$balance_due'] = &$data['$invoice.balance_due']; $data['$invoice.partial_due'] = ['value' => Number::formatMoney($this->partial, $this->client) ?: ' ', 'label' => ctrans('texts.partial_due')]; - $data['$total'] = ['value' => Number::formatMoney($this->calc()->getTotal(), $this->client) ?: ' ', 'label' => ctrans('texts.total')]; + $data['$total'] = ['value' => Number::formatMoney($calc->getTotal(), $this->client) ?: ' ', 'label' => ctrans('texts.total')]; $data['$quote.total'] = &$data['$total']; - $data['$invoice.total'] = ['value' => Number::formatMoney($this->calc()->getTotal(), $this->client) ?: ' ', 'label' => ctrans('texts.invoice_total')]; + $data['$invoice.total'] = ['value' => Number::formatMoney($calc->getTotal(), $this->client) ?: ' ', 'label' => ctrans('texts.invoice_total')]; $data['$invoice.amount'] = &$data['$total']; - $data['$quote.amount'] = ['value' => Number::formatMoney($this->calc()->getTotal(), $this->client) ?: ' ', 'label' => ctrans('texts.quote_total')]; - $data['$credit.total'] = ['value' => Number::formatMoney($this->calc()->getTotal(), $this->client) ?: ' ', 'label' => ctrans('texts.credit_total')]; + $data['$quote.amount'] = ['value' => Number::formatMoney($calc->getTotal(), $this->client) ?: ' ', 'label' => ctrans('texts.quote_total')]; + $data['$credit.total'] = ['value' => Number::formatMoney($calc->getTotal(), $this->client) ?: ' ', 'label' => ctrans('texts.credit_total')]; $data['$credit.number'] = ['value' => $this->number ?: ' ', 'label' => ctrans('texts.credit_number')]; $data['$credit.amount'] = &$data['$credit.total']; - $data['$balance'] = ['value' => Number::formatMoney($this->calc()->getBalance(), $this->client) ?: ' ', 'label' => ctrans('texts.balance')]; + $data['$balance'] = ['value' => Number::formatMoney($calc->getBalance(), $this->client) ?: ' ', 'label' => ctrans('texts.balance')]; $data['$invoice.balance'] = &$data['$balance']; - $data['$taxes'] = ['value' => Number::formatMoney($this->calc()->getItemTotalTaxes(), $this->client) ?: ' ', 'label' => ctrans('texts.taxes')]; + $data['$taxes'] = ['value' => Number::formatMoney($calc->getItemTotalTaxes(), $this->client) ?: ' ', 'label' => ctrans('texts.taxes')]; $data['$invoice.taxes'] = &$data['$taxes']; $data['$invoice.custom1'] = ['value' => $this->custom_value1 ?: ' ', 'label' => $this->makeCustomField('invoice1')]; @@ -210,7 +216,7 @@ trait MakesInvoiceValues $data['$quote_no'] = &$data['$quote.number']; $data['$quote.quote_no'] = &$data['$quote.number']; $data['$quote.valid_until'] = ['value' => $this->due_date, 'label' => ctrans('texts.valid_until')]; - $data['$credit_amount'] = ['value' => Number::formatMoney($this->calc()->getTotal(), $this->client) ?: ' ', 'label' => ctrans('texts.credit_amount')]; + $data['$credit_amount'] = ['value' => Number::formatMoney($calc->getTotal(), $this->client) ?: ' ', 'label' => ctrans('texts.credit_amount')]; $data['$credit_balance'] = ['value' => Number::formatMoney($this->balance, $this->client) ?: ' ', 'label' => ctrans('texts.credit_balance')]; ; $data['$credit_number'] = &$data['$number']; @@ -239,7 +245,7 @@ trait MakesInvoiceValues $data['$website'] = ['value' => $this->client->present()->website() ?: ' ', 'label' => ctrans('texts.website')]; $data['$phone'] = ['value' => $this->client->present()->phone() ?: ' ', 'label' => ctrans('texts.phone')]; $data['$country'] = ['value' => isset($this->client->country->name) ? $this->client->country->name : 'No Country Set', 'label' => ctrans('texts.country')]; - $data['$email'] = ['value' => isset($this->client->primary_contact()->first()->email) ? $this->client->primary_contact()->first()->email : 'no contact email on record', 'label' => ctrans('texts.email')]; + $data['$email'] = ['value' => isset($contact) ? $contact->email : 'no contact email on record', 'label' => ctrans('texts.email')]; $data['$client_name'] = ['value' => $this->present()->clientName() ?: ' ', 'label' => ctrans('texts.client_name')]; $data['$client.name'] = &$data['$client_name']; $data['$client.address1'] = &$data['$address1']; @@ -257,16 +263,17 @@ trait MakesInvoiceValues $data['$client.country'] = &$data['$country']; $data['$client.email'] = &$data['$email']; - if (!$contact) { - $contact = $this->client->primary_contact()->first(); - } + + $data['$contact.full_name'] = ['value' => $contact->present()->name(), 'label' => ctrans('texts.name')]; + $data['$contact.email'] = ['value' => $contact->email, 'label' => ctrans('texts.email')]; + $data['$contact.phone'] = ['value' => $contact->phone, 'label' => ctrans('texts.phone')]; $data['$contact_name'] = $data['$contact.name'] = ['value' => isset($contact) ? $contact->present()->name() : 'no contact name on record', 'label' => ctrans('texts.contact_name')]; - $data['$contact1'] = ['value' => isset($contact) ? $contact->custom_value1 : ' ', 'label' => $this->makeCustomField('contact1')]; - $data['$contact2'] = ['value' => isset($contact) ? $contact->custom_value2 : ' ', 'label' => $this->makeCustomField('contact1')]; - $data['$contact3'] = ['value' => isset($contact) ? $contact->custom_value3 : ' ', 'label' => $this->makeCustomField('contact1')]; - $data['$contact4'] = ['value' => isset($contact) ? $contact->custom_value4 : ' ', 'label' => $this->makeCustomField('contact1')]; + $data['$contact.custom1'] = ['value' => isset($contact) ? $contact->custom_value1 : ' ', 'label' => $this->makeCustomField('contact1')]; + $data['$contact.custom2'] = ['value' => isset($contact) ? $contact->custom_value2 : ' ', 'label' => $this->makeCustomField('contact1')]; + $data['$contact.custom3'] = ['value' => isset($contact) ? $contact->custom_value3 : ' ', 'label' => $this->makeCustomField('contact1')]; + $data['$contact.custom4'] = ['value' => isset($contact) ? $contact->custom_value4 : ' ', 'label' => $this->makeCustomField('contact1')]; $data['$company.city_state_postal'] = ['value' => $this->company->present()->cityStateZip($settings->city, $settings->state, $settings->postal_code, false) ?: ' ', 'label' => ctrans('texts.city_state_postal')]; $data['$company.postal_city_state'] = ['value' => $this->company->present()->cityStateZip($settings->city, $settings->state, $settings->postal_code, true) ?: ' ', 'label' => ctrans('texts.postal_city_state')]; @@ -373,7 +380,7 @@ trait MakesInvoiceValues $table_header = '