Change currency money group issue solved.

This commit is contained in:
Cüneyt Şentürk
2020-02-29 11:40:33 +03:00
parent 0d109aa89c
commit ba79655afa
17 changed files with 66 additions and 95 deletions

View File

@ -43,6 +43,7 @@ export default {
data: function () {
return {
component: '',
currency: null,
}
},
@ -183,16 +184,30 @@ export default {
this.form.currency_code = response.data.currency_code;
this.form.currency_rate = response.data.currency_rate;
this.money.decimal = response.data.decimal_mark;
this.money.thousands = response.data.thousands_separator;
this.money.prefix = (response.data.symbol_first) ? response.data.symbol : '';
this.money.suffix = !(response.data.symbol_first) ? response.data.symbol : '';
this.money.precision = response.data.precision;
this.currency = response.data;
})
.catch(error => {
});
},
// Change currency get money
onChangeCurrency(currency_code) {
axios.get(url + '/settings/currencies/currency', {
params: {
code: currency_code
}
})
.then(response => {
this.currency = response.data;
this.form.currency_code = response.data.code;
this.form.currency_rate = response.data.rate;
})
.catch(error => {
});
},
// Pages limit change
onChangePaginationLimit(event) {
let path = '';
@ -232,6 +247,7 @@ export default {
window.location.href = path;
},
// Dynamic component get path view and show it.
onDynamicComponent(path)
{
axios.get(path)

View File

@ -1,4 +1,3 @@
import axios from "axios";
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
import NProgressAxios from './nprogress-axios';
@ -78,7 +77,7 @@ export default class BulkAction {
this.loading = true;
if (this.value != 'export') {
axios.post(path, {
window.axios.post(path, {
'handle': this.value,
'selected': this.selected
})
@ -97,7 +96,7 @@ export default class BulkAction {
//window.location.reload(false);
});
} else {
axios({
window.axios({
url: path,
method: 'POST',
data:{
@ -154,7 +153,7 @@ export default class BulkAction {
var item = event.target;
var status = (event.target.checked) ? 'enable' : 'disable';
axios.get(this.path + '/' + item_id + '/' + status)
window.axios.get(this.path + '/' + item_id + '/' + status)
.then(response => {
var type = (response.data.success) ? 'success' : 'warning';

View File

@ -32,22 +32,4 @@ const app = new Vue({
}
},
methods:{
onChangeCurrency(currency_code) {
axios.get(url + '/settings/currencies/currency', {
params: {
code: currency_code
}
})
.then(response => {
this.money.decimal = response.data.decimal_mark;
this.money.thousands = response.data.thousands_separator;
this.money.prefix = (response.data.symbol_first) ? response.data.symbol : '';
this.money.suffix = !(response.data.symbol_first) ? response.data.symbol : '';
this.money.precision = response.data.precision;
})
.catch(error => {
});
}
}
});

View File

@ -36,7 +36,6 @@ const app = new Vue({
cleared_amount: 0,
difference: 0,
},
currency: null,
}
},
@ -47,7 +46,7 @@ const app = new Vue({
methods:{
onReconcilition() {
let form = document.getElementById('form-create-reconciliation');
let path = form.action +'?started_at=' + this.form.started_at + '&ended_at=' + this.form.ended_at + '&closing_balance=' + this.form.closing_balance + '&account_id=' + this.form.account_id;
window.location.href = path;
@ -76,7 +75,7 @@ const app = new Vue({
if (type[0] == 'income') {
income_total += parseFloat(document.getElementById('transaction-' + type[1] + '-' + type[0]).value);
} else {
expense_total += parseFloat(document.getElementById('transaction-' + type[1] + '-' + type[0]).value);
expense_total += parseFloat(document.getElementById('transaction-' + type[1] + '-' + type[0]).value);
}
});

View File

@ -49,7 +49,6 @@ const app = new Vue({
transaction: [],
items: '',
discount: false,
currency: null,
taxes: null,
}
},
@ -102,21 +101,6 @@ const app = new Vue({
});
},
onChangeCurrency(currency_code) {
axios.get(url + '/settings/currencies/currency', {
params: {
code: currency_code
}
})
.then(response => {
this.currency = response.data;
this.form.currency_code = response.data.code;
this.form.currency_rate = response.data.rate;
})
.catch(error => {
});
},
onCalculateTotal() {
let sub_total = 0;
let discount_total = 0;

View File

@ -29,12 +29,6 @@ const app = new Vue({
return {
form: new Form('payment'),
bulk_action: new BulkAction('payments'),
currency: null,
}
},
methods: {
onCalcualte() {
}
}
});

View File

@ -49,7 +49,6 @@ const app = new Vue({
transaction: [],
items: '',
discount: false,
currency: null,
taxes: null,
}
},
@ -102,22 +101,6 @@ const app = new Vue({
});
},
onChangeCurrency(currency_code) {
axios.get(url + '/settings/currencies/currency', {
params: {
code: currency_code
}
})
.then(response => {
this.currency = response.data;
this.form.currency_code = response.data.code;
this.form.currency_rate = response.data.rate;
})
.catch(error => {
});
},
onCalculateTotal() {
let sub_total = 0;
let discount_total = 0;