solve empty address issue on pdf

This commit is contained in:
gohil jayvirsinh
2021-06-28 07:49:27 +00:00
committed by Mohit Panjwani
parent 2ec87baa6f
commit 5eaea3ad59
3 changed files with 32 additions and 0 deletions

View File

@ -449,6 +449,10 @@ class Estimate extends Model implements HasMedia
public function getCompanyAddress()
{
if ($this->company && (! $this->company->address()->exists())) {
return false;
}
$format = CompanySetting::getSetting('estimate_company_address_format', $this->company_id);
return $this->getFormattedString($format);
@ -456,6 +460,10 @@ class Estimate extends Model implements HasMedia
public function getCustomerShippingAddress()
{
if ($this->user && (! $this->user->shippingAddress()->exists())) {
return false;
}
$format = CompanySetting::getSetting('estimate_shipping_address_format', $this->company_id);
return $this->getFormattedString($format);
@ -463,6 +471,10 @@ class Estimate extends Model implements HasMedia
public function getCustomerBillingAddress()
{
if ($this->user && (! $this->user->billingAddress()->exists())) {
return false;
}
$format = CompanySetting::getSetting('estimate_billing_address_format', $this->company_id);
return $this->getFormattedString($format);