mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-28 12:11:08 -04:00
solve empty address issue on pdf
This commit is contained in:
committed by
Mohit Panjwani
parent
2ec87baa6f
commit
5eaea3ad59
@ -449,6 +449,10 @@ class Estimate extends Model implements HasMedia
|
|||||||
|
|
||||||
public function getCompanyAddress()
|
public function getCompanyAddress()
|
||||||
{
|
{
|
||||||
|
if ($this->company && (! $this->company->address()->exists())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$format = CompanySetting::getSetting('estimate_company_address_format', $this->company_id);
|
$format = CompanySetting::getSetting('estimate_company_address_format', $this->company_id);
|
||||||
|
|
||||||
return $this->getFormattedString($format);
|
return $this->getFormattedString($format);
|
||||||
@ -456,6 +460,10 @@ class Estimate extends Model implements HasMedia
|
|||||||
|
|
||||||
public function getCustomerShippingAddress()
|
public function getCustomerShippingAddress()
|
||||||
{
|
{
|
||||||
|
if ($this->user && (! $this->user->shippingAddress()->exists())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$format = CompanySetting::getSetting('estimate_shipping_address_format', $this->company_id);
|
$format = CompanySetting::getSetting('estimate_shipping_address_format', $this->company_id);
|
||||||
|
|
||||||
return $this->getFormattedString($format);
|
return $this->getFormattedString($format);
|
||||||
@ -463,6 +471,10 @@ class Estimate extends Model implements HasMedia
|
|||||||
|
|
||||||
public function getCustomerBillingAddress()
|
public function getCustomerBillingAddress()
|
||||||
{
|
{
|
||||||
|
if ($this->user && (! $this->user->billingAddress()->exists())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$format = CompanySetting::getSetting('estimate_billing_address_format', $this->company_id);
|
$format = CompanySetting::getSetting('estimate_billing_address_format', $this->company_id);
|
||||||
|
|
||||||
return $this->getFormattedString($format);
|
return $this->getFormattedString($format);
|
||||||
|
|||||||
@ -541,6 +541,10 @@ class Invoice extends Model implements HasMedia
|
|||||||
|
|
||||||
public function getCompanyAddress()
|
public function getCompanyAddress()
|
||||||
{
|
{
|
||||||
|
if ($this->company && (! $this->company->address()->exists())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$format = CompanySetting::getSetting('invoice_company_address_format', $this->company_id);
|
$format = CompanySetting::getSetting('invoice_company_address_format', $this->company_id);
|
||||||
|
|
||||||
return $this->getFormattedString($format);
|
return $this->getFormattedString($format);
|
||||||
@ -548,6 +552,10 @@ class Invoice extends Model implements HasMedia
|
|||||||
|
|
||||||
public function getCustomerShippingAddress()
|
public function getCustomerShippingAddress()
|
||||||
{
|
{
|
||||||
|
if ($this->user && (! $this->user->shippingAddress()->exists())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$format = CompanySetting::getSetting('invoice_shipping_address_format', $this->company_id);
|
$format = CompanySetting::getSetting('invoice_shipping_address_format', $this->company_id);
|
||||||
|
|
||||||
return $this->getFormattedString($format);
|
return $this->getFormattedString($format);
|
||||||
@ -555,6 +563,10 @@ class Invoice extends Model implements HasMedia
|
|||||||
|
|
||||||
public function getCustomerBillingAddress()
|
public function getCustomerBillingAddress()
|
||||||
{
|
{
|
||||||
|
if ($this->user && (! $this->user->billingAddress()->exists())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$format = CompanySetting::getSetting('invoice_billing_address_format', $this->company_id);
|
$format = CompanySetting::getSetting('invoice_billing_address_format', $this->company_id);
|
||||||
|
|
||||||
return $this->getFormattedString($format);
|
return $this->getFormattedString($format);
|
||||||
|
|||||||
@ -399,6 +399,10 @@ class Payment extends Model implements HasMedia
|
|||||||
|
|
||||||
public function getCompanyAddress()
|
public function getCompanyAddress()
|
||||||
{
|
{
|
||||||
|
if ($this->company && (! $this->company->address()->exists())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$format = CompanySetting::getSetting('payment_company_address_format', $this->company_id);
|
$format = CompanySetting::getSetting('payment_company_address_format', $this->company_id);
|
||||||
|
|
||||||
return $this->getFormattedString($format);
|
return $this->getFormattedString($format);
|
||||||
@ -406,6 +410,10 @@ class Payment extends Model implements HasMedia
|
|||||||
|
|
||||||
public function getCustomerBillingAddress()
|
public function getCustomerBillingAddress()
|
||||||
{
|
{
|
||||||
|
if ($this->user && (! $this->user->billingAddress()->exists())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$format = CompanySetting::getSetting('payment_from_customer_address_format', $this->company_id);
|
$format = CompanySetting::getSetting('payment_from_customer_address_format', $this->company_id);
|
||||||
|
|
||||||
return $this->getFormattedString($format);
|
return $this->getFormattedString($format);
|
||||||
|
|||||||
Reference in New Issue
Block a user