1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Form only view for required client info

This commit is contained in:
Benjamin Beganović 2024-02-22 14:07:34 +01:00
parent 39f33a5113
commit 938ffbe66b
2 changed files with 23 additions and 10 deletions

View File

@ -143,6 +143,8 @@ class RequiredClientInfo extends Component
public $company_gateway_id;
public bool $form_only = false;
public function mount()
{
MultiDB::setDb($this->company->db);
@ -162,6 +164,15 @@ class RequiredClientInfo extends Component
count($this->fields) > 0 || $this->show_terms
? $this->checkFields()
: $this->show_form = false;
if (request()->query('source') === 'subscriptions') {
$this->show_form = false;
$this->dispatch(
'passed-required-fields-check',
client_postal_code: $this->contact->client->postal_code
);
}
}
public function toggleTermsAccepted()

View File

@ -1,5 +1,6 @@
<div wire:ignore.self class="container mx-auto grid grid-cols-12 mb-4" data-ref="required-fields-container">
<div class="col-span-12 lg:col-span-6 lg:col-start-4 overflow-hidden bg-white shadow rounded-lg">
<div wire:ignore.self class="@unless($form_only) container mx-auto grid grid-cols-12 @endunless mb-4" data-ref="required-fields-container">
<div class="col-span-12 lg:col-span-6 lg:col-start-4 overflow-hidden @unless($form_only) bg-white shadow rounded-lg @endunless">
@unless($form_only)
<div class="px-4 py-5 border-b border-gray-200 sm:px-6">
<h3 class="text-lg font-medium leading-6 text-gray-900">
{{ ctrans('texts.required_payment_information') }}
@ -9,6 +10,7 @@
{{ ctrans('texts.required_payment_information_more') }}
</p>
</div>
@endunless
<form id="required-client-info-form" x-on:submit.prevent="$wire.handleSubmit(Object.fromEntries(new FormData(document.getElementById('required-client-info-form'))))">
@foreach($fields as $field)