1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 08:21:34 +02:00

Show empty string if country is not set:

- Replace "No country set" with empty string in HtmlEngine.php
- Allow country_id & shipping_country_id to be null in shipping-address.blade.php & personal-address.blade.php
This commit is contained in:
Benjamin Beganović 2020-10-09 16:03:27 +02:00
parent 5cd1acd484
commit b0c383f75b
5 changed files with 15 additions and 5 deletions

View File

@ -53,6 +53,10 @@ class PersonalAddress extends Component
{
$data = $this->validate($this->rules);
if ($data['country_id'] == 'none') {
$data['country_id'] = null;
}
$this->profile
->fill($data)
->save();

View File

@ -53,6 +53,10 @@ class ShippingAddress extends Component
{
$data = $this->validate($this->rules);
if ($data['shipping_country_id'] == 'none') {
$data['shipping_country_id'] = null;
}
$this->profile
->fill($data)
->save();

View File

@ -111,7 +111,7 @@ class HtmlEngine
$data['$invoice.po_number'] = ['value' => $this->entity->po_number ?: ' ', 'label' => ctrans('texts.po_number')];
// $data['$line_taxes'] = ['value' => $this->makeLineTaxes() ?: ' ', 'label' => ctrans('texts.taxes')];
// $data['$invoice.line_taxes'] = &$data['$line_taxes'];
// $data['$total_taxes'] = ['value' => $this->makeTotalTaxes() ?: ' ', 'label' => ctrans('texts.taxes')];
// $data['$invoice.total_taxes'] = &$data['$total_taxes'];
@ -217,7 +217,7 @@ class HtmlEngine
$data['$vat_number'] = ['value' => $this->client->vat_number ?: ' ', 'label' => ctrans('texts.vat_number')];
$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['$country'] = ['value' => isset($this->client->country->name) ? $this->client->country->name : '', 'label' => ctrans('texts.country')];
$data['$email'] = ['value' => isset($this->contact) ? $this->contact->email : 'no contact email on record', 'label' => ctrans('texts.email')];
$data['$client_name'] = ['value' => $this->entity->present()->clientName() ?: ' ', 'label' => ctrans('texts.client_name')];
$data['$client.name'] = &$data['$client_name'];
@ -550,7 +550,7 @@ class HtmlEngine
}
@media print {
thead {display: table-header-group;}
thead {display: table-header-group;}
tfoot {display: table-footer-group;}
button {display: none;}
body {margin: 0;}
@ -568,7 +568,7 @@ class HtmlEngine
}
@media print {
thead {display: table-header-group;}
thead {display: table-header-group;}
button {display: none;}
body {margin: 0;}
}';

View File

@ -61,6 +61,7 @@
<div class="col-span-6 sm:col-span-2">
<label for="country" class="input-label">@lang('texts.country')</label>
<select id="country" class="input w-full form-select" wire:model.defer="country_id">
<option value="none"></option>
@foreach($countries as $country)
<option value="{{ $country->id }}">
{{ $country->iso_3166_2 }} ({{ $country->name }})

View File

@ -61,7 +61,8 @@
</div>
<div class="col-span-4 sm:col-span-2">
<label for="shipping_country" class="input-label">@lang('texts.shipping_country')</label>
<select id="shippking_country" class="input w-full form-select" wire:model.defer="shipping_country_id">
<select id="shipping_country" class="input w-full form-select" wire:model.defer="shipping_country_id">
<option value="none"></option>
@foreach($countries as $country)
<option value="{{ $country->id }}">
{{ $country->iso_3166_2 }} ({{ $country->name }})