close #2432 Fixed: Invoice form sent to button not working ( #2zftu0c )

This commit is contained in:
Cüneyt Şentürk
2022-06-07 15:52:42 +03:00
parent d1f987c720
commit c94ab51c52
4 changed files with 36 additions and 3 deletions

View File

@ -8,7 +8,7 @@ import Vue from 'vue';
import DashboardPlugin from './../../plugins/dashboard-plugin';
import { addDays, format } from 'date-fns';
import { setPromiseTimeout } from './../../plugins/functions';
import { setPromiseTimeout, getQueryVariable } from './../../plugins/functions';
import Global from './../../mixins/global';
@ -939,6 +939,12 @@ const app = new Vue({
this.form.due_at = due_at;
},
onSubmitViaSendEmail() {
this.form['senddocument'] = true;
this.onSubmit();
},
},
created() {
@ -1040,6 +1046,21 @@ const app = new Vue({
this.dynamic_taxes = document_taxes;
}
if (getQueryVariable('senddocument')) {
// clear query string
let uri = window.location.toString();
if (uri.indexOf("?") > 0) {
let clean_uri = uri.substring(0, uri.indexOf("?"));
window.history.replaceState({}, document.title, clean_uri);
}
let email_route = document.getElementById('senddocument_route').value;
this.onEmail(email_route);
}
this.page_loaded = true;
}
});