mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 16:44:31 -04:00
Fixes for address presentation for clients
This commit is contained in:
parent
3982fcc2b0
commit
0772c05e66
@ -136,21 +136,40 @@ class ClientPresenter extends EntityPresenter
|
|||||||
return $str;
|
return $str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// public function getCityState()
|
||||||
|
// {
|
||||||
|
// $settings = $this->entity->getMergedSettings();
|
||||||
|
|
||||||
|
// $country = false;
|
||||||
|
|
||||||
|
// if ($settings->country_id) {
|
||||||
|
// $country = Country::find($settings->country_id);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// $swap = $country && $country->swap_postal_code;
|
||||||
|
|
||||||
|
// $city = e($settings->city ?: '');
|
||||||
|
// $state = e($settings->state ?: '');
|
||||||
|
// $postalCode = e($settings->postal_code ?: '');
|
||||||
|
|
||||||
|
// if ($city || $state || $postalCode) {
|
||||||
|
// return $this->cityStateZip($city, $state, $postalCode, $swap);
|
||||||
|
// } else {
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
public function getCityState()
|
public function getCityState()
|
||||||
{
|
{
|
||||||
$settings = $this->entity->getMergedSettings();
|
$client = $this->entity;
|
||||||
|
|
||||||
$country = false;
|
$country = $client->country ?: false;
|
||||||
|
|
||||||
if ($settings->country_id) {
|
|
||||||
$country = Country::find($settings->country_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
$swap = $country && $country->swap_postal_code;
|
$swap = $country && $country->swap_postal_code;
|
||||||
|
|
||||||
$city = e($settings->city ?: '');
|
$city = e($client->city ?: '');
|
||||||
$state = e($settings->state ?: '');
|
$state = e($client->state ?: '');
|
||||||
$postalCode = e($settings->postal_code ?: '');
|
$postalCode = e($client->postal_code ?: '');
|
||||||
|
|
||||||
if ($city || $state || $postalCode) {
|
if ($city || $state || $postalCode) {
|
||||||
return $this->cityStateZip($city, $state, $postalCode, $swap);
|
return $this->cityStateZip($city, $state, $postalCode, $swap);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user