mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-03 06:44:37 -04:00
Merge pull request #4146 from beganovich/v2-update-countries-in-cp
(v5) Show empty string on PDF if country is not set
This commit is contained in:
commit
3702f68f32
@ -53,6 +53,10 @@ class PersonalAddress extends Component
|
|||||||
{
|
{
|
||||||
$data = $this->validate($this->rules);
|
$data = $this->validate($this->rules);
|
||||||
|
|
||||||
|
if ($data['country_id'] == 'none') {
|
||||||
|
$data['country_id'] = null;
|
||||||
|
}
|
||||||
|
|
||||||
$this->profile
|
$this->profile
|
||||||
->fill($data)
|
->fill($data)
|
||||||
->save();
|
->save();
|
||||||
|
@ -53,6 +53,10 @@ class ShippingAddress extends Component
|
|||||||
{
|
{
|
||||||
$data = $this->validate($this->rules);
|
$data = $this->validate($this->rules);
|
||||||
|
|
||||||
|
if ($data['shipping_country_id'] == 'none') {
|
||||||
|
$data['shipping_country_id'] = null;
|
||||||
|
}
|
||||||
|
|
||||||
$this->profile
|
$this->profile
|
||||||
->fill($data)
|
->fill($data)
|
||||||
->save();
|
->save();
|
||||||
|
@ -111,7 +111,7 @@ class HtmlEngine
|
|||||||
$data['$invoice.po_number'] = ['value' => $this->entity->po_number ?: ' ', 'label' => ctrans('texts.po_number')];
|
$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['$line_taxes'] = ['value' => $this->makeLineTaxes() ?: ' ', 'label' => ctrans('texts.taxes')];
|
||||||
// $data['$invoice.line_taxes'] = &$data['$line_taxes'];
|
// $data['$invoice.line_taxes'] = &$data['$line_taxes'];
|
||||||
|
|
||||||
// $data['$total_taxes'] = ['value' => $this->makeTotalTaxes() ?: ' ', 'label' => ctrans('texts.taxes')];
|
// $data['$total_taxes'] = ['value' => $this->makeTotalTaxes() ?: ' ', 'label' => ctrans('texts.taxes')];
|
||||||
// $data['$invoice.total_taxes'] = &$data['$total_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['$vat_number'] = ['value' => $this->client->vat_number ?: ' ', 'label' => ctrans('texts.vat_number')];
|
||||||
$data['$website'] = ['value' => $this->client->present()->website() ?: ' ', 'label' => ctrans('texts.website')];
|
$data['$website'] = ['value' => $this->client->present()->website() ?: ' ', 'label' => ctrans('texts.website')];
|
||||||
$data['$phone'] = ['value' => $this->client->present()->phone() ?: ' ', 'label' => ctrans('texts.phone')];
|
$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['$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'] = ['value' => $this->entity->present()->clientName() ?: ' ', 'label' => ctrans('texts.client_name')];
|
||||||
$data['$client.name'] = &$data['$client_name'];
|
$data['$client.name'] = &$data['$client_name'];
|
||||||
@ -550,7 +550,7 @@ class HtmlEngine
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media print {
|
@media print {
|
||||||
thead {display: table-header-group;}
|
thead {display: table-header-group;}
|
||||||
tfoot {display: table-footer-group;}
|
tfoot {display: table-footer-group;}
|
||||||
button {display: none;}
|
button {display: none;}
|
||||||
body {margin: 0;}
|
body {margin: 0;}
|
||||||
@ -568,7 +568,7 @@ class HtmlEngine
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media print {
|
@media print {
|
||||||
thead {display: table-header-group;}
|
thead {display: table-header-group;}
|
||||||
button {display: none;}
|
button {display: none;}
|
||||||
body {margin: 0;}
|
body {margin: 0;}
|
||||||
}';
|
}';
|
||||||
|
@ -61,6 +61,7 @@
|
|||||||
<div class="col-span-6 sm:col-span-2">
|
<div class="col-span-6 sm:col-span-2">
|
||||||
<label for="country" class="input-label">@lang('texts.country')</label>
|
<label for="country" class="input-label">@lang('texts.country')</label>
|
||||||
<select id="country" class="input w-full form-select" wire:model.defer="country_id">
|
<select id="country" class="input w-full form-select" wire:model.defer="country_id">
|
||||||
|
<option value="none"></option>
|
||||||
@foreach($countries as $country)
|
@foreach($countries as $country)
|
||||||
<option value="{{ $country->id }}">
|
<option value="{{ $country->id }}">
|
||||||
{{ $country->iso_3166_2 }} ({{ $country->name }})
|
{{ $country->iso_3166_2 }} ({{ $country->name }})
|
||||||
|
@ -61,7 +61,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-span-4 sm:col-span-2">
|
<div class="col-span-4 sm:col-span-2">
|
||||||
<label for="shipping_country" class="input-label">@lang('texts.shipping_country')</label>
|
<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)
|
@foreach($countries as $country)
|
||||||
<option value="{{ $country->id }}">
|
<option value="{{ $country->id }}">
|
||||||
{{ $country->iso_3166_2 }} ({{ $country->name }})
|
{{ $country->iso_3166_2 }} ({{ $country->name }})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user