mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Accept user input from approve quote flow
This commit is contained in:
parent
4c76107526
commit
2b8779be46
@ -461,8 +461,11 @@ class CompanySettings extends BaseSettings
|
|||||||
|
|
||||||
public $show_shipping_address = false;
|
public $show_shipping_address = false;
|
||||||
|
|
||||||
|
public $accept_client_input_quote_approval = false;
|
||||||
|
|
||||||
public static $casts = [
|
public static $casts = [
|
||||||
'custom_sending_email' => 'string',
|
'accept_client_input_quote_approval' => 'bool',
|
||||||
|
'custom_sending_email' => 'string',
|
||||||
'show_paid_stamp' => 'bool',
|
'show_paid_stamp' => 'bool',
|
||||||
'show_shipping_address' => 'bool',
|
'show_shipping_address' => 'bool',
|
||||||
'company_logo_size' => 'string',
|
'company_logo_size' => 'string',
|
||||||
|
16
resources/js/clients/quotes/approve.js
vendored
16
resources/js/clients/quotes/approve.js
vendored
@ -9,9 +9,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
class Approve {
|
class Approve {
|
||||||
constructor(displaySignature, displayTerms) {
|
constructor(displaySignature, displayTerms, userInput) {
|
||||||
this.shouldDisplaySignature = displaySignature;
|
this.shouldDisplaySignature = displaySignature;
|
||||||
this.shouldDisplayTerms = displayTerms;
|
this.shouldDisplayTerms = displayTerms;
|
||||||
|
this.shouldDisplayUserInput = userInput;
|
||||||
this.termsAccepted = false;
|
this.termsAccepted = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,7 +60,7 @@ class Approve {
|
|||||||
document
|
document
|
||||||
.getElementById('approve-button')
|
.getElementById('approve-button')
|
||||||
.addEventListener('click', () => {
|
.addEventListener('click', () => {
|
||||||
if (this.shouldDisplaySignature && this.shouldDisplayTerms) {
|
if (this.shouldDisplaySignature && this.shouldDisplayTerms && !this.shouldDisplayUserInput) {
|
||||||
this.displaySignature();
|
this.displaySignature();
|
||||||
|
|
||||||
document
|
document
|
||||||
@ -76,10 +77,11 @@ class Approve {
|
|||||||
this.termsAccepted = true;
|
this.termsAccepted = true;
|
||||||
this.submitForm();
|
this.submitForm();
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.shouldDisplaySignature && !this.shouldDisplayTerms) {
|
if (this.shouldDisplaySignature && !this.shouldDisplayTerms && !this.shouldDisplayUserInput) {
|
||||||
this.displaySignature();
|
this.displaySignature();
|
||||||
|
|
||||||
document
|
document
|
||||||
@ -92,7 +94,7 @@ class Approve {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.shouldDisplaySignature && this.shouldDisplayTerms) {
|
if (!this.shouldDisplaySignature && this.shouldDisplayTerms && !this->this.shouldDisplayUserInput) {
|
||||||
this.displayTerms();
|
this.displayTerms();
|
||||||
|
|
||||||
document
|
document
|
||||||
@ -103,7 +105,7 @@ class Approve {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.shouldDisplaySignature && !this.shouldDisplayTerms) {
|
if (!this.shouldDisplaySignature && !this.shouldDisplayTerms && !this.shouldDisplayUserInput) {
|
||||||
this.submitForm();
|
this.submitForm();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -115,4 +117,6 @@ const signature = document.querySelector('meta[name="require-quote-signature"]')
|
|||||||
|
|
||||||
const terms = document.querySelector('meta[name="show-quote-terms"]').content;
|
const terms = document.querySelector('meta[name="show-quote-terms"]').content;
|
||||||
|
|
||||||
new Approve(Boolean(+signature), Boolean(+terms)).handle();
|
const user_input = document.querySelector('meta[name="accept-user-input"]').content;
|
||||||
|
|
||||||
|
new Approve(Boolean(+signature), Boolean(+terms), Boolean(+user_input)).handle();
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
<meta name="show-quote-terms" content="{{ $settings->show_accept_quote_terms ? true : false }}">
|
<meta name="show-quote-terms" content="{{ $settings->show_accept_quote_terms ? true : false }}">
|
||||||
<meta name="require-quote-signature" content="{{ $client->company->account->hasFeature(\App\Models\Account::FEATURE_INVOICE_SETTINGS) && $settings->require_quote_signature }}">
|
<meta name="require-quote-signature" content="{{ $client->company->account->hasFeature(\App\Models\Account::FEATURE_INVOICE_SETTINGS) && $settings->require_quote_signature }}">
|
||||||
|
<meta name="accept-user-input" content="{{ $client->getSetting('accept_client_input_quote_approval') }}">
|
||||||
|
|
||||||
@include('portal.ninja2020.components.no-cache')
|
@include('portal.ninja2020.components.no-cache')
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user