2020-12-24 01:28:38 +03:00
|
|
|
/**
|
2022-06-01 10:15:55 +03:00
|
|
|
* First we will load all of this project's JavaScript dependencies which
|
|
|
|
* includes Vue and other libraries. It is a great starting point when
|
|
|
|
* building robust, powerful web applications using Vue and Laravel.
|
|
|
|
*/
|
2021-07-28 18:38:56 +03:00
|
|
|
require('./../../bootstrap');
|
|
|
|
import Vue from 'vue';
|
|
|
|
|
|
|
|
import DashboardPlugin from './../../plugins/dashboard-plugin';
|
2022-06-01 10:15:55 +03:00
|
|
|
import { addDays, format } from 'date-fns';
|
2022-06-07 15:52:42 +03:00
|
|
|
import { setPromiseTimeout, getQueryVariable } from './../../plugins/functions';
|
2021-07-28 18:38:56 +03:00
|
|
|
|
|
|
|
import Global from './../../mixins/global';
|
|
|
|
|
|
|
|
import Form from './../../plugins/form';
|
|
|
|
import BulkAction from './../../plugins/bulk-action';
|
|
|
|
|
|
|
|
// plugin setup
|
|
|
|
Vue.use(DashboardPlugin);
|
|
|
|
|
|
|
|
const app = new Vue({
|
|
|
|
el: '#main-body',
|
|
|
|
|
|
|
|
mixins: [
|
|
|
|
Global
|
|
|
|
],
|
|
|
|
|
|
|
|
data: function () {
|
2021-08-01 21:47:02 +03:00
|
|
|
return {
|
|
|
|
form: new Form('document'),
|
|
|
|
bulk_action: new BulkAction('documents'),
|
|
|
|
totals: {
|
|
|
|
sub: 0,
|
|
|
|
item_discount: '',
|
|
|
|
discount: '',
|
|
|
|
discount_text: false,
|
|
|
|
taxes: [],
|
|
|
|
total: 0
|
|
|
|
},
|
|
|
|
transaction: [],
|
|
|
|
edit: {
|
|
|
|
status: false,
|
|
|
|
currency: false,
|
|
|
|
items: 0,
|
|
|
|
},
|
|
|
|
colspan: 6,
|
|
|
|
discount: false,
|
|
|
|
tax: false,
|
|
|
|
discounts: [],
|
|
|
|
tax_id: [],
|
|
|
|
items: [],
|
2021-09-02 17:14:03 +03:00
|
|
|
selected_items:[],
|
2021-08-01 21:47:02 +03:00
|
|
|
taxes: [],
|
|
|
|
page_loaded: false,
|
|
|
|
currencies: [],
|
|
|
|
min_due_date: false,
|
|
|
|
currency_symbol: {
|
|
|
|
"name":"US Dollar",
|
|
|
|
"code":"USD",
|
|
|
|
"rate":1,
|
|
|
|
"precision":2,
|
|
|
|
"symbol":"$",
|
|
|
|
"symbol_first":1,
|
|
|
|
"decimal_mark":".",
|
|
|
|
"thousands_separator":","
|
|
|
|
},
|
|
|
|
dropdown_visible: true,
|
|
|
|
dynamic_taxes: [],
|
2022-06-01 10:15:55 +03:00
|
|
|
show_discount: false,
|
|
|
|
show_discount_text: true,
|
|
|
|
delete_discount: false
|
2021-08-01 21:47:02 +03:00
|
|
|
}
|
2021-07-28 18:38:56 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
mounted() {
|
2021-08-15 22:35:05 +01:00
|
|
|
this.form.discount_type = 'percentage';
|
2021-08-13 13:24:08 +01:00
|
|
|
|
2021-08-01 21:47:02 +03:00
|
|
|
if ((document.getElementById('items') != null) && (document.getElementById('items').rows)) {
|
|
|
|
this.colspan = document.getElementById("items").rows[0].cells.length - 1;
|
|
|
|
}
|
|
|
|
|
2022-06-01 10:15:55 +03:00
|
|
|
if (! this.edit.status) {
|
2021-08-01 21:47:02 +03:00
|
|
|
this.dropdown_visible = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
this.currency_symbol.rate = this.form.currency_rate;
|
|
|
|
|
|
|
|
if (company_currency_code) {
|
|
|
|
let default_currency_symbol = null;
|
|
|
|
|
|
|
|
for (let symbol of this.currencies) {
|
2022-06-01 10:15:55 +03:00
|
|
|
if (symbol.code == company_currency_code) {
|
2021-08-01 21:47:02 +03:00
|
|
|
default_currency_symbol = symbol.symbol;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
this.currency_symbol.symbol = default_currency_symbol;
|
2021-08-26 14:50:27 +03:00
|
|
|
};
|
2022-06-01 10:15:55 +03:00
|
|
|
|
|
|
|
if (document_app_env == 'production') {
|
|
|
|
this.onFormCapture();
|
|
|
|
}
|
2021-07-28 18:38:56 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
2021-09-02 17:14:03 +03:00
|
|
|
onRefFocus(ref) {
|
2022-06-01 10:15:55 +03:00
|
|
|
let index = this.form.items.length - 1;
|
2021-09-02 17:14:03 +03:00
|
|
|
|
|
|
|
this.$refs['items-' + index + '-' + ref][0].focus();
|
2021-08-27 15:33:11 +03:00
|
|
|
},
|
|
|
|
|
2021-07-28 18:38:56 +03:00
|
|
|
onCalculateTotal() {
|
|
|
|
let global_discount = parseFloat(this.form.discount);
|
2022-04-15 17:53:45 +03:00
|
|
|
let total_discount = 0;
|
2021-07-28 18:38:56 +03:00
|
|
|
let line_item_discount_total = 0;
|
|
|
|
let sub_total = 0;
|
|
|
|
let totals_taxes = [];
|
|
|
|
let grand_total = 0;
|
2022-04-15 17:53:45 +03:00
|
|
|
let items_amount = this.calculateTotalBeforeDiscountAndTax();
|
2021-07-28 18:38:56 +03:00
|
|
|
|
|
|
|
// items calculate
|
|
|
|
this.items.forEach(function(item, index) {
|
2022-04-15 17:53:45 +03:00
|
|
|
item.total = item.grand_total = item.price * item.quantity;
|
2021-07-28 18:38:56 +03:00
|
|
|
|
2022-04-15 17:53:45 +03:00
|
|
|
let item_discounted_total = items_amount[index];
|
2021-07-28 18:38:56 +03:00
|
|
|
|
2022-04-15 17:53:45 +03:00
|
|
|
let line_discount_amount = item.total - item_discounted_total;
|
2021-07-28 18:38:56 +03:00
|
|
|
|
2022-04-15 17:53:45 +03:00
|
|
|
// Apply line & total discount to item
|
|
|
|
if (global_discount) {
|
|
|
|
if (this.form.discount_type === 'percentage') {
|
|
|
|
if (global_discount > 100) {
|
|
|
|
global_discount = 100;
|
2021-08-13 13:24:08 +01:00
|
|
|
}
|
|
|
|
|
2022-04-15 17:53:45 +03:00
|
|
|
total_discount += (item_discounted_total / 100) * global_discount;
|
|
|
|
item_discounted_total -= (item_discounted_total / 100) * global_discount;
|
2021-08-11 15:22:19 +01:00
|
|
|
} else {
|
2022-04-15 17:53:45 +03:00
|
|
|
total_discount += (items_amount[index] / (items_amount['total'] / 100)) * (global_discount / 100);
|
|
|
|
item_discounted_total -= (items_amount[index] / (items_amount['total'] / 100)) * (global_discount / 100);
|
2021-07-28 18:38:56 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// set item total
|
2022-04-15 17:53:45 +03:00
|
|
|
if (item.discount || global_discount) {
|
2021-07-28 18:38:56 +03:00
|
|
|
item.grand_total = item_discounted_total;
|
|
|
|
}
|
|
|
|
|
2022-04-15 17:53:45 +03:00
|
|
|
this.calculateItemTax(item, totals_taxes, total_discount + line_discount_amount);
|
|
|
|
|
|
|
|
item.total = item.price * item.quantity;
|
|
|
|
|
2021-07-28 18:38:56 +03:00
|
|
|
// calculate sub, tax, discount all items.
|
|
|
|
line_item_discount_total += line_discount_amount;
|
|
|
|
sub_total += item.total;
|
|
|
|
grand_total += item.grand_total;
|
|
|
|
|
|
|
|
this.form.items[index].name = item.name;
|
|
|
|
this.form.items[index].description = item.description;
|
|
|
|
this.form.items[index].quantity = item.quantity;
|
|
|
|
this.form.items[index].price = item.price;
|
|
|
|
this.form.items[index].discount = item.discount;
|
2022-04-15 17:53:45 +03:00
|
|
|
this.form.items[index].discount_type = item.discount_type;
|
2021-07-28 18:38:56 +03:00
|
|
|
this.form.items[index].total = item.total;
|
|
|
|
}, this);
|
|
|
|
|
|
|
|
this.totals.item_discount = line_item_discount_total;
|
2022-04-15 17:53:45 +03:00
|
|
|
this.totals.discount = total_discount;
|
2021-07-28 18:38:56 +03:00
|
|
|
this.totals.sub = sub_total;
|
|
|
|
this.totals.taxes = totals_taxes;
|
|
|
|
this.totals.total = grand_total;
|
|
|
|
|
|
|
|
this.form.items.forEach(function(form_item, form_index) {
|
|
|
|
let item = this.items[form_index];
|
2021-08-01 21:47:02 +03:00
|
|
|
|
2021-07-28 18:38:56 +03:00
|
|
|
for (const [key, value] of Object.entries(item)) {
|
|
|
|
if (key == 'add_tax' || key == 'tax_ids' || key == 'add_discount') {
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
|
|
|
|
if (form_item[key] === undefined) {
|
|
|
|
form_item[key] = value
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}, this);
|
|
|
|
|
|
|
|
this.currencyConversion();
|
|
|
|
},
|
|
|
|
|
2022-04-15 17:53:45 +03:00
|
|
|
calculateItemTax(item, totals_taxes, total_discount_amount) {
|
|
|
|
let taxes = this.dynamic_taxes;
|
|
|
|
|
|
|
|
if (item.tax_ids) {
|
|
|
|
let inclusive_tax_total = 0;
|
|
|
|
let price_for_tax = 0;
|
|
|
|
let total_tax_amount = 0;
|
|
|
|
let inclusives = [];
|
|
|
|
let compounds = [];
|
|
|
|
let fixed = [];
|
|
|
|
let withholding = [];
|
|
|
|
let normal = [];
|
|
|
|
|
|
|
|
item.tax_ids.forEach(function(item_tax, item_tax_index) {
|
|
|
|
for (var index_taxes = 0; index_taxes < taxes.length; index_taxes++) {
|
|
|
|
let tax = taxes[index_taxes];
|
|
|
|
|
|
|
|
if (item_tax.id != tax.id) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (tax.type) {
|
|
|
|
case 'inclusive':
|
|
|
|
inclusives.push({
|
|
|
|
tax_index: item_tax_index,
|
|
|
|
tax_id: tax.id,
|
|
|
|
tax_name: tax.title,
|
|
|
|
tax_rate: tax.rate
|
|
|
|
});
|
|
|
|
break;
|
|
|
|
case 'compound':
|
|
|
|
compounds.push({
|
|
|
|
tax_index: item_tax_index,
|
|
|
|
tax_id: tax.id,
|
|
|
|
tax_name: tax.title,
|
|
|
|
tax_rate: tax.rate
|
|
|
|
});
|
|
|
|
break;
|
|
|
|
case 'fixed':
|
|
|
|
fixed.push({
|
|
|
|
tax_index: item_tax_index,
|
|
|
|
tax_id: tax.id,
|
|
|
|
tax_name: tax.title,
|
|
|
|
tax_rate: tax.rate
|
|
|
|
});
|
|
|
|
break;
|
|
|
|
case 'withholding':
|
|
|
|
withholding.push({
|
|
|
|
tax_index: item_tax_index,
|
|
|
|
tax_id: tax.id,
|
|
|
|
tax_name: tax.title,
|
|
|
|
tax_rate: tax.rate
|
|
|
|
});
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
normal.push({
|
|
|
|
tax_index: item_tax_index,
|
|
|
|
tax_id: tax.id,
|
|
|
|
tax_name: tax.title,
|
|
|
|
tax_rate: tax.rate
|
|
|
|
});
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}, this);
|
|
|
|
|
|
|
|
if (inclusives.length) {
|
|
|
|
inclusives.forEach(function(inclusive) {
|
|
|
|
item.tax_ids[inclusive.tax_index].price = item.grand_total - (item.grand_total / (1 + inclusive.tax_rate / 100));
|
|
|
|
|
|
|
|
inclusive_tax_total += item.tax_ids[inclusive.tax_index].price;
|
|
|
|
|
|
|
|
totals_taxes = this.calculateTotalsTax(totals_taxes, inclusive.tax_id, inclusive.tax_name, inclusive.tax_type, item.tax_ids[inclusive.tax_index].price);
|
|
|
|
}, this);
|
|
|
|
|
|
|
|
item.total = parseFloat(item.grand_total - inclusive_tax_total);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (fixed.length) {
|
|
|
|
fixed.forEach(function(fixed) {
|
|
|
|
item.tax_ids[fixed.tax_index].price = fixed.tax_rate * item.quantity;
|
|
|
|
|
|
|
|
total_tax_amount += item.tax_ids[fixed.tax_index].price;
|
|
|
|
|
|
|
|
totals_taxes = this.calculateTotalsTax(totals_taxes, fixed.tax_id, fixed.tax_name, fixed.tax_type, item.tax_ids[fixed.tax_index].price);
|
|
|
|
}, this);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (inclusives.length) {
|
|
|
|
price_for_tax = item.total;
|
|
|
|
} else {
|
|
|
|
price_for_tax = item.grand_total;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (normal.length) {
|
|
|
|
normal.forEach(function(normal) {
|
|
|
|
item.tax_ids[normal.tax_index].price = price_for_tax * (normal.tax_rate / 100);
|
|
|
|
|
|
|
|
total_tax_amount += item.tax_ids[normal.tax_index].price;
|
|
|
|
|
|
|
|
totals_taxes = this.calculateTotalsTax(totals_taxes, normal.tax_id, normal.tax_name, normal.tax_type, item.tax_ids[normal.tax_index].price);
|
|
|
|
}, this);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (withholding.length) {
|
|
|
|
withholding.forEach(function(withholding) {
|
|
|
|
item.tax_ids[withholding.tax_index].price = -(price_for_tax * (withholding.tax_rate / 100));
|
|
|
|
|
|
|
|
total_tax_amount += item.tax_ids[withholding.tax_index].price;
|
|
|
|
|
|
|
|
totals_taxes = this.calculateTotalsTax(totals_taxes, withholding.tax_id, withholding.tax_name, withholding.tax_type, item.tax_ids[withholding.tax_index].price);
|
|
|
|
}, this);
|
|
|
|
}
|
|
|
|
|
|
|
|
item.grand_total += total_tax_amount;
|
|
|
|
|
|
|
|
if (compounds.length) {
|
|
|
|
compounds.forEach(function(compound) {
|
|
|
|
item.tax_ids[compound.tax_index].price = (item.grand_total / 100) * compound.tax_rate;
|
|
|
|
|
|
|
|
totals_taxes = this.calculateTotalsTax(totals_taxes, compound.tax_id, compound.tax_name, compound.tax_type, item.tax_ids[compound.tax_index].price);
|
|
|
|
|
|
|
|
item.grand_total += item.tax_ids[compound.tax_index].price;
|
|
|
|
}, this);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (inclusives.length) {
|
|
|
|
item.total += total_discount_amount;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
calculateTotalBeforeDiscountAndTax() {
|
|
|
|
let amount_before_discount_and_tax = [];
|
|
|
|
let total = 0;
|
|
|
|
|
|
|
|
this.items.forEach(function(item, index) {
|
|
|
|
let item_total = 0;
|
|
|
|
|
|
|
|
item_total = item.price * item.quantity;
|
|
|
|
|
|
|
|
// item discount calculate.
|
|
|
|
if (item.discount) {
|
|
|
|
if (item.discount_type === 'percentage') {
|
|
|
|
if (item.discount > 100) {
|
|
|
|
item.discount = 100;
|
|
|
|
}
|
|
|
|
|
|
|
|
item.discount_amount = item_total * (item.discount / 100);
|
|
|
|
} else {
|
|
|
|
if (parseInt(item.discount) > item_total) {
|
|
|
|
item.discount_amount = item_total;
|
|
|
|
} else {
|
|
|
|
item.discount_amount = parseFloat(item.discount);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
item.discount_amount = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
total += item_total - item.discount_amount;
|
|
|
|
amount_before_discount_and_tax[index] = item_total - item.discount_amount;
|
|
|
|
});
|
|
|
|
|
|
|
|
amount_before_discount_and_tax['total'] = total;
|
|
|
|
|
|
|
|
return amount_before_discount_and_tax;
|
|
|
|
},
|
|
|
|
|
2022-06-01 10:15:55 +03:00
|
|
|
calculateTotalsTax(totals_taxes, id, name, price) {
|
2021-07-28 18:38:56 +03:00
|
|
|
let total_tax_index = totals_taxes.findIndex(total_tax => {
|
|
|
|
if (total_tax.id === id) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}, this);
|
|
|
|
|
|
|
|
if (total_tax_index === -1) {
|
|
|
|
totals_taxes.push({
|
|
|
|
id: id,
|
|
|
|
name: name,
|
|
|
|
total: price,
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
totals_taxes[total_tax_index].total = parseFloat(totals_taxes[total_tax_index].total) + parseFloat(price);
|
|
|
|
}
|
|
|
|
|
|
|
|
return totals_taxes;
|
|
|
|
},
|
|
|
|
|
2021-09-02 17:14:03 +03:00
|
|
|
onSelectedItem(item){
|
|
|
|
this.onAddItem(item);
|
|
|
|
},
|
|
|
|
|
2021-08-03 13:07:09 +03:00
|
|
|
// addItem to list
|
2021-08-25 19:51:38 +03:00
|
|
|
onAddItem(payload) {
|
2021-09-02 17:14:03 +03:00
|
|
|
let { item, itemType } = payload;
|
2021-08-25 19:51:38 +03:00
|
|
|
let inputRef = `${itemType === 'newItem' ? 'name' : 'description'}`; // indication for which input to focus first
|
2021-07-28 18:38:56 +03:00
|
|
|
let total = 1 * item.price;
|
|
|
|
let item_taxes = [];
|
2022-06-01 10:15:55 +03:00
|
|
|
|
2021-07-28 18:38:56 +03:00
|
|
|
if (item.tax_ids) {
|
|
|
|
item.tax_ids.forEach(function (tax_id, index) {
|
|
|
|
if (this.taxes.includes(tax_id)) {
|
|
|
|
this.taxes[tax_id].push(item.id);
|
|
|
|
} else {
|
|
|
|
this.taxes.push(tax_id);
|
|
|
|
this.taxes[tax_id] = [];
|
|
|
|
this.taxes[tax_id].push(item.id);
|
|
|
|
}
|
|
|
|
|
|
|
|
item_taxes.push({
|
|
|
|
id: tax_id,
|
|
|
|
price: 10,
|
|
|
|
});
|
|
|
|
}, this);
|
|
|
|
}
|
|
|
|
|
|
|
|
this.form.items.push({
|
|
|
|
item_id: item.id,
|
|
|
|
name: item.name,
|
|
|
|
description: item.description,
|
|
|
|
quantity: 1,
|
|
|
|
price: item.price,
|
|
|
|
tax_ids: item.tax_ids,
|
|
|
|
discount: 0,
|
|
|
|
total: total,
|
|
|
|
});
|
|
|
|
|
|
|
|
this.items.push({
|
|
|
|
item_id: item.id,
|
|
|
|
name: item.name,
|
|
|
|
description: item.description,
|
|
|
|
quantity: 1,
|
|
|
|
price: item.price,
|
2022-06-01 10:15:55 +03:00
|
|
|
add_tax: false,
|
2021-07-28 18:38:56 +03:00
|
|
|
tax_ids: item_taxes,
|
|
|
|
add_discount: false,
|
|
|
|
discount: 0,
|
|
|
|
discount_amount: 0,
|
|
|
|
total: total,
|
|
|
|
// @todo
|
|
|
|
// invoice_item_checkbox_sample: [],
|
|
|
|
});
|
|
|
|
|
2021-09-02 17:14:03 +03:00
|
|
|
setTimeout(function() {
|
|
|
|
this.onRefFocus(inputRef);
|
|
|
|
}.bind(this), 100);
|
|
|
|
|
2021-07-28 18:38:56 +03:00
|
|
|
setTimeout(function() {
|
|
|
|
this.onCalculateTotal();
|
|
|
|
}.bind(this), 800);
|
|
|
|
},
|
|
|
|
|
|
|
|
onSelectedTax(item_index) {
|
2022-06-01 10:15:55 +03:00
|
|
|
if (! this.tax_id) {
|
2021-07-28 18:38:56 +03:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
let selected_tax;
|
|
|
|
|
2021-08-01 21:47:02 +03:00
|
|
|
this.dynamic_taxes.forEach(function(tax) {
|
2021-07-28 18:38:56 +03:00
|
|
|
if (tax.id == this.tax_id) {
|
|
|
|
selected_tax = tax;
|
|
|
|
}
|
|
|
|
}, this);
|
|
|
|
|
|
|
|
this.items[item_index].tax_ids.push({
|
|
|
|
id: selected_tax.id,
|
|
|
|
name: selected_tax.title,
|
|
|
|
price: 0
|
|
|
|
});
|
|
|
|
|
|
|
|
this.form.items[item_index].tax_ids.push(this.tax_id);
|
|
|
|
|
|
|
|
if (this.taxes.includes(this.tax_id)) {
|
|
|
|
this.taxes[this.tax_id].push(this.items[item_index].item_id);
|
|
|
|
} else {
|
|
|
|
this.taxes[this.tax_id] = [];
|
|
|
|
this.taxes[this.tax_id].push(this.items[item_index].item_id);
|
|
|
|
}
|
|
|
|
|
|
|
|
this.tax_id = '';
|
|
|
|
|
|
|
|
this.onCalculateTotal();
|
|
|
|
},
|
|
|
|
|
|
|
|
// remove document item row => row_id = index
|
|
|
|
onDeleteItem(index) {
|
|
|
|
this.items.splice(index, 1);
|
|
|
|
this.form.items.splice(index, 1);
|
|
|
|
|
|
|
|
this.onCalculateTotal();
|
|
|
|
},
|
|
|
|
|
|
|
|
onAddLineDiscount(item_index) {
|
2021-08-15 22:35:05 +01:00
|
|
|
this.items[item_index].discount_type = 'percentage';
|
2021-07-28 18:38:56 +03:00
|
|
|
this.items[item_index].add_discount = true;
|
|
|
|
},
|
|
|
|
|
2021-08-11 15:22:19 +01:00
|
|
|
onChangeDiscountType(type) {
|
|
|
|
this.form.discount_type = type;
|
|
|
|
this.onCalculateTotal();
|
|
|
|
},
|
|
|
|
|
|
|
|
onChangeLineDiscountType(item_index, type) {
|
|
|
|
this.items[item_index].discount_type = type;
|
|
|
|
this.onCalculateTotal();
|
|
|
|
},
|
|
|
|
|
2021-07-28 18:38:56 +03:00
|
|
|
onAddTotalDiscount() {
|
|
|
|
let discount = document.getElementById('pre-discount').value;
|
|
|
|
|
2021-08-15 22:35:05 +01:00
|
|
|
if (this.form.discount_type === 'percentage') {
|
2021-08-11 15:22:19 +01:00
|
|
|
if (discount < 0) {
|
|
|
|
discount = 0;
|
|
|
|
} else if (discount > 100) {
|
|
|
|
discount = 100;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (discount < 0) {
|
|
|
|
discount = 0;
|
|
|
|
} else if (discount > this.totals.sub) {
|
|
|
|
discount = this.totals.sub;
|
|
|
|
}
|
2021-07-28 18:38:56 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
document.getElementById('pre-discount').value = discount;
|
|
|
|
|
|
|
|
this.form.discount = discount;
|
|
|
|
this.discount = false;
|
|
|
|
|
|
|
|
this.onCalculateTotal();
|
|
|
|
},
|
|
|
|
|
|
|
|
onDeleteDiscount(item_index) {
|
|
|
|
this.items[item_index].add_discount = false;
|
2022-04-15 17:53:45 +03:00
|
|
|
this.items[item_index].discount = 0;
|
|
|
|
this.onCalculateTotal();
|
2021-07-28 18:38:56 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
onAddTax(item_index) {
|
|
|
|
this.items[item_index].add_tax = true;
|
|
|
|
},
|
|
|
|
|
2022-06-01 10:15:55 +03:00
|
|
|
onAddDiscount() {
|
|
|
|
this.show_discount = !this.show_discount;
|
|
|
|
|
|
|
|
if (this.show_discount) {
|
|
|
|
this.show_discount_text = false;
|
|
|
|
this.delete_discount = true;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
onRemoveDiscountArea() {
|
|
|
|
this.show_discount = false;
|
|
|
|
this.show_discount_text = true;
|
|
|
|
this.discount = false;
|
|
|
|
this.delete_discount = false;
|
|
|
|
},
|
|
|
|
|
2021-07-28 18:38:56 +03:00
|
|
|
onDeleteTax(item_index, tax_index) {
|
|
|
|
if (tax_index == '999') {
|
|
|
|
this.items[item_index].add_tax = false;
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
this.items[item_index].tax_ids.splice(tax_index, 1);
|
|
|
|
this.form.items[item_index].tax_ids.splice(tax_index, 1);
|
|
|
|
|
|
|
|
this.onCalculateTotal();
|
|
|
|
},
|
|
|
|
|
|
|
|
onBindingItemField(item_index, field_name) {
|
|
|
|
this.form.items[item_index][field_name] = this.items[item_index][field_name];
|
|
|
|
},
|
|
|
|
|
|
|
|
async onPayment() {
|
|
|
|
let document_id = document.getElementById('document_id').value;
|
|
|
|
|
|
|
|
let payment = {
|
|
|
|
modal: false,
|
|
|
|
url: url + '/modals/documents/' + document_id + '/transactions/create',
|
|
|
|
title: '',
|
|
|
|
html: '',
|
|
|
|
buttons:{}
|
|
|
|
};
|
|
|
|
|
|
|
|
let payment_promise = Promise.resolve(window.axios.get(payment.url));
|
|
|
|
|
|
|
|
payment_promise.then(response => {
|
|
|
|
payment.modal = true;
|
|
|
|
payment.title = response.data.data.title;
|
|
|
|
payment.html = response.data.html;
|
|
|
|
payment.buttons = response.data.data.buttons;
|
|
|
|
|
|
|
|
this.component = Vue.component('add-new-component', (resolve, reject) => {
|
|
|
|
resolve({
|
2022-06-07 16:53:51 +03:00
|
|
|
template: '<div id="dynamic-payment-component"><akaunting-modal-add-new modal-dialog-class="max-w-md" modal-position-top :show="payment.modal" @submit="onSubmit" @cancel="onCancel" :buttons="payment.buttons" :title="payment.title" :is_component=true :message="payment.html"></akaunting-modal-add-new></div>',
|
2022-06-01 10:15:55 +03:00
|
|
|
|
|
|
|
mixins: [
|
|
|
|
Global
|
|
|
|
],
|
|
|
|
|
|
|
|
data: function () {
|
|
|
|
return {
|
|
|
|
form:{},
|
|
|
|
payment: payment,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
onSubmit(event) {
|
|
|
|
this.form = event;
|
|
|
|
|
|
|
|
this.form.response = {};
|
|
|
|
|
|
|
|
this.loading = true;
|
|
|
|
|
|
|
|
let data = this.form.data();
|
|
|
|
|
|
|
|
FormData.prototype.appendRecursive = function(data, wrapper = null) {
|
|
|
|
for(var name in data) {
|
|
|
|
if (wrapper) {
|
|
|
|
if ((typeof data[name] == 'object' || data[name].constructor === Array) && ((data[name] instanceof File != true ) && (data[name] instanceof Blob != true))) {
|
|
|
|
this.appendRecursive(data[name], wrapper + '[' + name + ']');
|
|
|
|
} else {
|
|
|
|
this.append(wrapper + '[' + name + ']', data[name]);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if ((typeof data[name] == 'object' || data[name].constructor === Array) && ((data[name] instanceof File != true ) && (data[name] instanceof Blob != true))) {
|
|
|
|
this.appendRecursive(data[name], name);
|
|
|
|
} else {
|
|
|
|
this.append(name, data[name]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
let form_data = new FormData();
|
|
|
|
form_data.appendRecursive(data);
|
|
|
|
|
|
|
|
window.axios({
|
|
|
|
method: this.form.method,
|
|
|
|
url: this.form.action,
|
|
|
|
data: form_data,
|
|
|
|
headers: {
|
|
|
|
'X-CSRF-TOKEN': window.Laravel.csrfToken,
|
|
|
|
'X-Requested-With': 'XMLHttpRequest',
|
|
|
|
'Content-Type': 'multipart/form-data'
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.then(response => {
|
|
|
|
if (response.data.success) {
|
|
|
|
if (response.data.redirect) {
|
|
|
|
this.form.loading = true;
|
|
|
|
|
|
|
|
window.location.href = response.data.redirect;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (response.data.error) {
|
|
|
|
this.form.loading = false;
|
|
|
|
|
|
|
|
this.form.response = response.data;
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.catch(error => {
|
|
|
|
this.form.loading = false;
|
|
|
|
|
|
|
|
this.form.onFail(error);
|
|
|
|
|
|
|
|
this.method_show_html = error.message;
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
onCancel() {
|
|
|
|
this.payment.modal = false;
|
|
|
|
this.payment.html = null;
|
|
|
|
|
|
|
|
let documentClasses = document.body.classList;
|
|
|
|
|
|
|
|
documentClasses.remove("modal-open");
|
|
|
|
},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
});
|
|
|
|
})
|
|
|
|
.catch(error => {
|
|
|
|
})
|
|
|
|
.finally(function () {
|
|
|
|
// always executed
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
async onEditPayment(transaction_id) {
|
|
|
|
let document_id = document.getElementById('document_id').value;
|
|
|
|
|
|
|
|
let payment = {
|
|
|
|
modal: false,
|
|
|
|
url: url + '/modals/documents/' + document_id + '/transactions/edit/' + transaction_id,
|
|
|
|
title: '',
|
|
|
|
html: '',
|
|
|
|
buttons:{}
|
|
|
|
};
|
|
|
|
|
|
|
|
let payment_promise = Promise.resolve(window.axios.get(payment.url));
|
|
|
|
|
|
|
|
payment_promise.then(response => {
|
|
|
|
payment.modal = true;
|
|
|
|
payment.title = response.data.data.title;
|
|
|
|
payment.html = response.data.html;
|
|
|
|
payment.buttons = response.data.data.buttons;
|
|
|
|
|
|
|
|
this.component = Vue.component('add-new-component', (resolve, reject) => {
|
|
|
|
resolve({
|
2022-06-07 16:53:51 +03:00
|
|
|
template: '<div id="dynamic-payment-component"><akaunting-modal-add-new modal-dialog-class="max-w-md" modal-position-top :show="payment.modal" @submit="onSubmit" @cancel="onCancel" :buttons="payment.buttons" :title="payment.title" :is_component=true :message="payment.html"></akaunting-modal-add-new></div>',
|
2021-07-28 18:38:56 +03:00
|
|
|
|
|
|
|
mixins: [
|
|
|
|
Global
|
|
|
|
],
|
|
|
|
|
|
|
|
data: function () {
|
|
|
|
return {
|
|
|
|
form:{},
|
|
|
|
payment: payment,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
onSubmit(event) {
|
|
|
|
this.form = event;
|
2021-07-30 18:49:30 +03:00
|
|
|
|
2021-07-28 18:38:56 +03:00
|
|
|
this.form.response = {};
|
|
|
|
|
|
|
|
this.loading = true;
|
|
|
|
|
|
|
|
let data = this.form.data();
|
|
|
|
|
|
|
|
FormData.prototype.appendRecursive = function(data, wrapper = null) {
|
|
|
|
for(var name in data) {
|
|
|
|
if (wrapper) {
|
|
|
|
if ((typeof data[name] == 'object' || data[name].constructor === Array) && ((data[name] instanceof File != true ) && (data[name] instanceof Blob != true))) {
|
|
|
|
this.appendRecursive(data[name], wrapper + '[' + name + ']');
|
|
|
|
} else {
|
|
|
|
this.append(wrapper + '[' + name + ']', data[name]);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if ((typeof data[name] == 'object' || data[name].constructor === Array) && ((data[name] instanceof File != true ) && (data[name] instanceof Blob != true))) {
|
|
|
|
this.appendRecursive(data[name], name);
|
|
|
|
} else {
|
|
|
|
this.append(name, data[name]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
let form_data = new FormData();
|
|
|
|
form_data.appendRecursive(data);
|
|
|
|
|
|
|
|
window.axios({
|
|
|
|
method: this.form.method,
|
|
|
|
url: this.form.action,
|
|
|
|
data: form_data,
|
|
|
|
headers: {
|
|
|
|
'X-CSRF-TOKEN': window.Laravel.csrfToken,
|
|
|
|
'X-Requested-With': 'XMLHttpRequest',
|
|
|
|
'Content-Type': 'multipart/form-data'
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.then(response => {
|
|
|
|
if (response.data.success) {
|
|
|
|
if (response.data.redirect) {
|
|
|
|
this.form.loading = true;
|
|
|
|
|
|
|
|
window.location.href = response.data.redirect;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (response.data.error) {
|
|
|
|
this.form.loading = false;
|
|
|
|
|
|
|
|
this.form.response = response.data;
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.catch(error => {
|
|
|
|
this.form.loading = false;
|
|
|
|
|
|
|
|
this.form.onFail(error);
|
|
|
|
|
|
|
|
this.method_show_html = error.message;
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
onCancel() {
|
|
|
|
this.payment.modal = false;
|
|
|
|
this.payment.html = null;
|
|
|
|
|
|
|
|
let documentClasses = document.body.classList;
|
|
|
|
|
|
|
|
documentClasses.remove("modal-open");
|
|
|
|
},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
});
|
|
|
|
})
|
|
|
|
.catch(error => {
|
|
|
|
})
|
|
|
|
.finally(function () {
|
|
|
|
// always executed
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
2022-06-01 10:15:55 +03:00
|
|
|
async onEmail(route) {
|
|
|
|
let email = {
|
|
|
|
modal: false,
|
|
|
|
route: route,
|
|
|
|
title: '',
|
|
|
|
html: '',
|
|
|
|
buttons:{}
|
|
|
|
};
|
|
|
|
|
|
|
|
let email_promise = Promise.resolve(window.axios.get(email.route));
|
|
|
|
|
|
|
|
email_promise.then(response => {
|
|
|
|
email.modal = true;
|
|
|
|
email.title = response.data.data.title;
|
|
|
|
email.html = response.data.html;
|
|
|
|
email.buttons = response.data.data.buttons;
|
|
|
|
|
|
|
|
this.component = Vue.component('add-new-component', (resolve, reject) => {
|
|
|
|
resolve({
|
2022-06-06 10:33:03 +03:00
|
|
|
template: '<div id="dynamic-email-component"><akaunting-modal-add-new modal-dialog-class="max-w-screen-md" :show="email.modal" @submit="onSubmit" @cancel="onCancel" :buttons="email.buttons" :title="email.title" :is_component=true :message="email.html"></akaunting-modal-add-new></div>',
|
2022-06-01 10:15:55 +03:00
|
|
|
|
|
|
|
mixins: [
|
|
|
|
Global
|
|
|
|
],
|
|
|
|
|
|
|
|
data: function () {
|
|
|
|
return {
|
|
|
|
form:{},
|
|
|
|
email: email,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
onSubmit(event) {
|
|
|
|
this.$emit('submit', event);
|
|
|
|
event.submit();
|
|
|
|
},
|
|
|
|
|
|
|
|
onCancel() {
|
|
|
|
this.email.modal = false;
|
|
|
|
this.email.html = null;
|
|
|
|
|
|
|
|
let documentClasses = document.body.classList;
|
|
|
|
|
|
|
|
documentClasses.remove("modal-open");
|
|
|
|
},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
});
|
|
|
|
})
|
|
|
|
.catch(error => {
|
|
|
|
})
|
|
|
|
.finally(function () {
|
|
|
|
// always executed
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
2021-07-28 18:38:56 +03:00
|
|
|
// Change currency get money
|
|
|
|
onChangeCurrency(currency_code) {
|
|
|
|
if (this.edit.status && this.edit.currency <= 2) {
|
|
|
|
this.edit.currency++;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!this.currencies.length) {
|
|
|
|
let currency_promise = Promise.resolve(window.axios.get((url + '/settings/currencies')));
|
|
|
|
|
|
|
|
currency_promise.then(response => {
|
|
|
|
if ( response.data.success) {
|
|
|
|
this.currencies = response.data.data;
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.catch(error => {
|
|
|
|
this.onChangeCurrency(currency_code);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
this.currencies.forEach(function (currency, index) {
|
|
|
|
if (currency_code == currency.code) {
|
|
|
|
this.currency = currency;
|
|
|
|
|
|
|
|
this.form.currency_code = currency.code;
|
|
|
|
this.form.currency_rate = currency.rate;
|
|
|
|
|
|
|
|
this.currencyConversion();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (company_currency_code == currency.code) {
|
|
|
|
this.currency_symbol = currency;
|
|
|
|
}
|
|
|
|
}, this);
|
|
|
|
},
|
|
|
|
|
|
|
|
setDueMinDate(date) {
|
|
|
|
this.min_due_date = date;
|
|
|
|
},
|
|
|
|
|
|
|
|
currencyConversion() {
|
2021-06-28 13:00:24 +03:00
|
|
|
setTimeout(() => {
|
2021-07-28 18:38:56 +03:00
|
|
|
if (document.querySelectorAll('.js-conversion-input')) {
|
2021-06-28 13:00:24 +03:00
|
|
|
let currency_input = document.querySelectorAll('.js-conversion-input');
|
2021-07-28 18:38:56 +03:00
|
|
|
|
2021-06-28 13:00:24 +03:00
|
|
|
for(let input of currency_input) {
|
|
|
|
input.setAttribute('size', input.value.length);
|
|
|
|
}
|
|
|
|
}
|
2021-07-28 18:38:56 +03:00
|
|
|
}, 250);
|
2022-06-01 10:15:55 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
onBeforeUnload() {
|
|
|
|
window.onbeforeunload = function() {
|
|
|
|
return 'Are you sure you want to leave this page';
|
|
|
|
};
|
|
|
|
},
|
|
|
|
|
|
|
|
onFormCapture() {
|
|
|
|
let form_html = document.querySelector('form');
|
|
|
|
|
|
|
|
if (form_html && form_html.getAttribute('id') == 'document') {
|
|
|
|
form_html.querySelectorAll('input, textarea, select, ul, li, a, [type="button"]').forEach((element) => {
|
|
|
|
element.addEventListener('click', () => {
|
|
|
|
this.onBeforeUnload();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
form_html.querySelectorAll('[type="submit"]').forEach((submit) => {
|
|
|
|
submit.addEventListener('click', () => {
|
|
|
|
window.onbeforeunload = null;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
onChangeRecurringDate() {
|
|
|
|
let started_at = new Date(this.form.recurring_started_at);
|
|
|
|
let due_at = format(addDays(started_at, this.form.payment_terms), 'YYYY-MM-DD');
|
|
|
|
|
|
|
|
this.form.due_at = due_at;
|
|
|
|
},
|
2022-06-07 15:52:42 +03:00
|
|
|
|
|
|
|
onSubmitViaSendEmail() {
|
|
|
|
this.form['senddocument'] = true;
|
|
|
|
|
|
|
|
this.onSubmit();
|
|
|
|
},
|
2021-07-28 18:38:56 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
created() {
|
|
|
|
this.form.items = [];
|
|
|
|
|
|
|
|
if (typeof document_items !== 'undefined' && document_items) {
|
|
|
|
this.edit.status = true;
|
|
|
|
this.edit.currency = 1;
|
|
|
|
|
|
|
|
document_items.forEach(function(item) {
|
|
|
|
// form set item
|
|
|
|
this.form.items.push({
|
|
|
|
item_id: item.item_id,
|
|
|
|
name: item.name,
|
|
|
|
description: item.description === null ? "" : item.description,
|
|
|
|
quantity: item.quantity,
|
|
|
|
price: (item.price).toFixed(2),
|
|
|
|
tax_ids: item.tax_ids,
|
|
|
|
discount: item.discount_rate,
|
2021-08-15 17:20:39 +01:00
|
|
|
discount_type: item.discount_type,
|
2021-07-28 18:38:56 +03:00
|
|
|
total: (item.total).toFixed(2)
|
|
|
|
});
|
|
|
|
|
|
|
|
if (item.tax_ids) {
|
|
|
|
item.tax_ids.forEach(function (tax_id, index) {
|
|
|
|
if (this.taxes.includes(tax_id)) {
|
|
|
|
this.taxes[tax_id].push(item.id);
|
|
|
|
} else {
|
|
|
|
this.taxes.push(tax_id);
|
|
|
|
|
|
|
|
this.taxes[tax_id] = [];
|
|
|
|
|
|
|
|
this.taxes[tax_id].push(item.id);
|
|
|
|
}
|
|
|
|
}, this);
|
|
|
|
}
|
|
|
|
|
|
|
|
let item_taxes = [];
|
|
|
|
|
|
|
|
item.taxes.forEach(function(item_tax) {
|
|
|
|
item_taxes.push({
|
|
|
|
id: item_tax.tax_id,
|
|
|
|
name: item_tax.name,
|
|
|
|
price: (item_tax.amount).toFixed(2),
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
this.items.push({
|
|
|
|
item_id: item.item_id,
|
|
|
|
name: item.name,
|
|
|
|
description: item.description === null ? "" : item.description,
|
|
|
|
quantity: item.quantity,
|
|
|
|
price: (item.price).toFixed(2),
|
2022-06-01 10:15:55 +03:00
|
|
|
add_tax: false,
|
2021-07-28 18:38:56 +03:00
|
|
|
tax_ids: item_taxes,
|
|
|
|
add_discount: (item.discount_rate) ? true : false,
|
|
|
|
discount: item.discount_rate,
|
2021-08-15 17:20:39 +01:00
|
|
|
discount_type: item.discount_type,
|
2021-07-28 18:38:56 +03:00
|
|
|
total: (item.total).toFixed(2),
|
|
|
|
// @todo
|
|
|
|
// invoice_item_checkbox_sample: [],
|
|
|
|
});
|
|
|
|
}, this);
|
|
|
|
|
|
|
|
this.items.forEach(function(item) {
|
|
|
|
item.tax_ids.forEach(function(tax) {
|
|
|
|
let total_tax_index = this.totals.taxes.findIndex(total_tax => {
|
|
|
|
if (total_tax.id === tax.id) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}, this);
|
|
|
|
|
|
|
|
if (total_tax_index === -1) {
|
|
|
|
this.totals.taxes.push({
|
|
|
|
id: tax.id,
|
|
|
|
name: tax.name,
|
|
|
|
total: tax.price,
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
this.totals.taxes[total_tax_index].total = parseFloat(this.totals.taxes[total_tax_index].total) + parseFloat(tax.price);
|
|
|
|
}
|
|
|
|
}, this);
|
|
|
|
}, this);
|
|
|
|
}
|
|
|
|
|
2021-08-01 21:47:02 +03:00
|
|
|
if (typeof document_currencies !== 'undefined' && document_currencies) {
|
2021-07-28 18:38:56 +03:00
|
|
|
this.currencies = document_currencies;
|
|
|
|
|
|
|
|
this.currencies.forEach(function (currency, index) {
|
|
|
|
if (document_default_currency == currency.code) {
|
|
|
|
this.currency = currency;
|
|
|
|
|
|
|
|
this.form.currency_code = currency.code;
|
|
|
|
}
|
|
|
|
}, this);
|
|
|
|
}
|
2021-08-01 21:47:02 +03:00
|
|
|
|
|
|
|
if (typeof document_taxes !== 'undefined' && document_taxes) {
|
|
|
|
this.dynamic_taxes = document_taxes;
|
|
|
|
}
|
2022-06-01 10:15:55 +03:00
|
|
|
|
2022-06-07 15:52:42 +03:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2022-06-01 10:15:55 +03:00
|
|
|
this.page_loaded = true;
|
2021-07-28 18:38:56 +03:00
|
|
|
}
|
|
|
|
});
|