fixed setting and company currency issue..
This commit is contained in:
parent
d29859f65b
commit
bcf14a97ad
36
resources/assets/js/views/common/companies.js
vendored
36
resources/assets/js/views/common/companies.js
vendored
@ -47,5 +47,41 @@ const app = new Vue({
|
|||||||
|
|
||||||
this.form.submit();
|
this.form.submit();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Change currency get money
|
||||||
|
onChangeCurrency(currency_code) {
|
||||||
|
if (! currency_code) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! this.all_currencies.length) {
|
||||||
|
let currency_promise = Promise.resolve(window.axios.get((url + '/settings/currencies')));
|
||||||
|
|
||||||
|
currency_promise.then(response => {
|
||||||
|
if (response.data.success) {
|
||||||
|
this.all_currencies = response.data.data;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.all_currencies.forEach(function (currency, index) {
|
||||||
|
if (currency_code == currency.code) {
|
||||||
|
this.currency = currency;
|
||||||
|
|
||||||
|
this.form.currency = currency.code;
|
||||||
|
}
|
||||||
|
}, this);
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
this.onChangeCurrency(currency_code);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.all_currencies.forEach(function (currency, index) {
|
||||||
|
if (currency_code == currency.code) {
|
||||||
|
this.currency = currency;
|
||||||
|
|
||||||
|
this.form.currency = currency.code;
|
||||||
|
}
|
||||||
|
}, this);
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
36
resources/assets/js/views/settings/settings.js
vendored
36
resources/assets/js/views/settings/settings.js
vendored
@ -159,6 +159,42 @@ const app = new Vue({
|
|||||||
} else {
|
} else {
|
||||||
this.quantity_name_input = false;
|
this.quantity_name_input = false;
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// Change currency get money
|
||||||
|
onChangeCurrency(currency_code) {
|
||||||
|
if (! currency_code) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! this.all_currencies.length) {
|
||||||
|
let currency_promise = Promise.resolve(window.axios.get((url + '/settings/currencies')));
|
||||||
|
|
||||||
|
currency_promise.then(response => {
|
||||||
|
if (response.data.success) {
|
||||||
|
this.all_currencies = response.data.data;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.all_currencies.forEach(function (currency, index) {
|
||||||
|
if (currency_code == currency.code) {
|
||||||
|
this.currency = currency;
|
||||||
|
|
||||||
|
this.form.currency = currency.code;
|
||||||
|
}
|
||||||
|
}, this);
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
this.onChangeCurrency(currency_code);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.all_currencies.forEach(function (currency, index) {
|
||||||
|
if (currency_code == currency.code) {
|
||||||
|
this.currency = currency;
|
||||||
|
|
||||||
|
this.form.currency = currency.code;
|
||||||
|
}
|
||||||
|
}, this);
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user