mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 19:04:41 -04:00
Required info binding with required client info
This commit is contained in:
parent
568c0aa028
commit
5b0c63cb39
@ -15,12 +15,31 @@ namespace App\Http\Livewire;
|
||||
use App\Libraries\MultiDB;
|
||||
use App\Models\ClientContact;
|
||||
use App\Models\CompanyGateway;
|
||||
use App\Models\Invoice;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Support\Str;
|
||||
use Livewire\Component;
|
||||
|
||||
class RequiredClientInfo extends Component
|
||||
{
|
||||
use MakesHash;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
public $show_terms = false;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
public $invoice;
|
||||
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
public $fields = [];
|
||||
|
||||
/**
|
||||
@ -28,6 +47,9 @@ class RequiredClientInfo extends Component
|
||||
*/
|
||||
public $contact;
|
||||
|
||||
/**
|
||||
* @var Client
|
||||
*/
|
||||
public $client;
|
||||
|
||||
/**
|
||||
@ -117,6 +139,18 @@ class RequiredClientInfo extends Component
|
||||
count($this->fields) > 0
|
||||
? $this->checkFields()
|
||||
: $this->show_form = false;
|
||||
|
||||
if($this->company->settings->show_accept_invoice_terms && request()->has('hash'))
|
||||
{
|
||||
$this->show_terms = true;
|
||||
|
||||
$hash = Cache::get(request()->input('hash'));
|
||||
|
||||
$this->invoice = Invoice::find($this->decodePrimaryKey($hash['invoice_id']));
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function handleSubmit(array $data): bool
|
||||
@ -215,6 +249,10 @@ class RequiredClientInfo extends Component
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($this->show_terms)
|
||||
$this->show_form = true;
|
||||
|
||||
}
|
||||
|
||||
public function showCopyBillingCheckbox(): bool
|
||||
|
4
public/vendor/livewire/livewire.js
vendored
4
public/vendor/livewire/livewire.js
vendored
File diff suppressed because one or more lines are too long
2
public/vendor/livewire/livewire.js.map
vendored
2
public/vendor/livewire/livewire.js.map
vendored
File diff suppressed because one or more lines are too long
2
public/vendor/livewire/manifest.json
vendored
2
public/vendor/livewire/manifest.json
vendored
@ -1 +1 @@
|
||||
{"/livewire.js":"/livewire.js?id=de3fca26689cb5a39af4"}
|
||||
{"/livewire.js":"/livewire.js?id=fe747446aa84856d8b66"}
|
@ -45,6 +45,20 @@
|
||||
@endcomponent
|
||||
@endif
|
||||
|
||||
@if($show_terms)
|
||||
|
||||
@component('portal.ninja2020.components.general.card-element', ['title' => ctrans('texts.terms_of_service') ])
|
||||
|
||||
<input
|
||||
id="terms"
|
||||
name="terms"
|
||||
type="checkbox"
|
||||
class="h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"
|
||||
/>
|
||||
@endcomponent
|
||||
|
||||
@endif
|
||||
|
||||
@component('portal.ninja2020.components.general.card-element-single')
|
||||
<div class="flex flex-col items-end">
|
||||
<button class="button button-primary bg-primary">
|
||||
|
@ -33,7 +33,7 @@
|
||||
{{ ctrans('texts.i_agree') }}
|
||||
</button>
|
||||
</div>
|
||||
<div class="mt-3 flex w-full rounded-md shadow-sm sm:mt-0 sm:w-auto">
|
||||
<div class="mt-3 flex w-full rounded-md shadow-sm sm:mt-0 sm:w-auto" id="hide_close">
|
||||
<button @click="document.getElementById('displayTermsModal').style.display = 'none';" type="button" class="button button-secondary">
|
||||
{{ ctrans('texts.close') }}
|
||||
</button>
|
||||
|
Loading…
x
Reference in New Issue
Block a user