mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 18:27:16 -04:00
Merge pull request #9511 from beganovich/1390-terms-2.0
Fixes for gateway fields override
This commit is contained in:
commit
c7058c6af9
@ -190,6 +190,8 @@ class RequiredClientInfo extends Component
|
|||||||
|
|
||||||
public $db;
|
public $db;
|
||||||
|
|
||||||
|
public bool $is_subscription = false;
|
||||||
|
|
||||||
public function mount()
|
public function mount()
|
||||||
{
|
{
|
||||||
MultiDB::setDb($this->db);
|
MultiDB::setDb($this->db);
|
||||||
@ -230,12 +232,11 @@ class RequiredClientInfo extends Component
|
|||||||
$this->invoice_terms = $invoice->terms;
|
$this->invoice_terms = $invoice->terms;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$this->company_gateway->always_show_required_fields)
|
if(!$this->company_gateway->always_show_required_fields || $this->is_subscription)
|
||||||
$this->checkFields();
|
$this->checkFields();
|
||||||
|
|
||||||
if($this->unfilled_fields > 0 || $this->company_gateway->always_show_required_fields)
|
if($this->unfilled_fields > 0 || ($this->company_gateway->always_show_required_fields || $this->is_subscription))
|
||||||
$this->show_form = true;
|
$this->show_form = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Computed]
|
#[Computed]
|
||||||
@ -398,7 +399,7 @@ class RequiredClientInfo extends Component
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->unfilled_fields === 0 && !$this->company_gateway->always_show_required_fields) {
|
if ($this->unfilled_fields === 0 && (!$this->company_gateway->always_show_required_fields || $this->is_subscription)) {
|
||||||
$this->dispatch(
|
$this->dispatch(
|
||||||
'passed-required-fields-check',
|
'passed-required-fields-check',
|
||||||
client_postal_code: $this->contact->client->postal_code
|
client_postal_code: $this->contact->client->postal_code
|
||||||
|
@ -10,6 +10,6 @@
|
|||||||
@endif
|
@endif
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
@livewire('required-client-info', ['db' => $company->db, 'fields' => method_exists($gateway, 'getClientRequiredFields') ? $gateway->getClientRequiredFields() : [], 'contact_id' => auth()->guard('contact')->user()->id, 'countries' => $countries, 'company_id' => $company->id, 'company_gateway_id' => $gateway->company_gateway ? $gateway->company_gateway->id : $gateway->id, 'form_only' => true])
|
@livewire('required-client-info', ['db' => $company->db, 'fields' => method_exists($gateway, 'getClientRequiredFields') ? $gateway->getClientRequiredFields() : [], 'contact_id' => auth()->guard('contact')->user()->id, 'countries' => $countries, 'company_id' => $company->id, 'company_gateway_id' => $gateway->company_gateway ? $gateway->company_gateway->id : $gateway->id, 'form_only' => true, 'is_subscription' => true])
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
@endpush
|
@endpush
|
||||||
|
|
||||||
@section('body')
|
@section('body')
|
||||||
@livewire('required-client-info', ['db' => $company->db, 'fields' => method_exists($gateway, 'getClientRequiredFields') ? $gateway->getClientRequiredFields() : [], 'contact_id' => auth()->guard('contact')->user()->id, 'countries' => $countries, 'company_id' => $company->id, 'company_gateway_id' => $gateway->company_gateway ? $gateway->company_gateway->id : $gateway->id])
|
@livewire('required-client-info', ['db' => $company->db, 'fields' => method_exists($gateway, 'getClientRequiredFields') ? $gateway->getClientRequiredFields() : [], 'contact_id' => auth()->guard('contact')->user()->id, 'countries' => $countries, 'company_id' => $company->id, 'company_gateway_id' => $gateway->company_gateway ? $gateway->company_gateway->id : $gateway->id, 'is_subscription' => request()->query('source') == 'subscriptions'])
|
||||||
|
|
||||||
<div class="container mx-auto grid grid-cols-12 opacity-25 pointer-events-none" data-ref="gateway-container">
|
<div class="container mx-auto grid grid-cols-12 opacity-25 pointer-events-none" data-ref="gateway-container">
|
||||||
<div class="col-span-12 lg:col-span-6 lg:col-start-4 bg-white shadow rounded-lg">
|
<div class="col-span-12 lg:col-span-6 lg:col-start-4 bg-white shadow rounded-lg">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user