diff --git a/resources/assets/js/mixins/global.js b/resources/assets/js/mixins/global.js
index bc672d9f6..f765248d7 100644
--- a/resources/assets/js/mixins/global.js
+++ b/resources/assets/js/mixins/global.js
@@ -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)
diff --git a/resources/assets/js/plugins/bulk-action.js b/resources/assets/js/plugins/bulk-action.js
index d0cf7d68d..61abe9750 100644
--- a/resources/assets/js/plugins/bulk-action.js
+++ b/resources/assets/js/plugins/bulk-action.js
@@ -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';
diff --git a/resources/assets/js/views/banking/accounts.js b/resources/assets/js/views/banking/accounts.js
index 7074405ea..29c768a1b 100644
--- a/resources/assets/js/views/banking/accounts.js
+++ b/resources/assets/js/views/banking/accounts.js
@@ -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 => {
- });
- }
- }
});
diff --git a/resources/assets/js/views/banking/reconciliations.js b/resources/assets/js/views/banking/reconciliations.js
index 475f4fe81..89154d550 100644
--- a/resources/assets/js/views/banking/reconciliations.js
+++ b/resources/assets/js/views/banking/reconciliations.js
@@ -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);
}
});
diff --git a/resources/assets/js/views/purchases/bills.js b/resources/assets/js/views/purchases/bills.js
index 408f7c6ae..5563302f8 100644
--- a/resources/assets/js/views/purchases/bills.js
+++ b/resources/assets/js/views/purchases/bills.js
@@ -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;
diff --git a/resources/assets/js/views/purchases/payments.js b/resources/assets/js/views/purchases/payments.js
index 0b1832541..ccf850426 100644
--- a/resources/assets/js/views/purchases/payments.js
+++ b/resources/assets/js/views/purchases/payments.js
@@ -29,12 +29,6 @@ const app = new Vue({
return {
form: new Form('payment'),
bulk_action: new BulkAction('payments'),
- currency: null,
}
},
-
- methods: {
- onCalcualte() {
- }
- }
});
diff --git a/resources/assets/js/views/sales/invoices.js b/resources/assets/js/views/sales/invoices.js
index d2b6259ea..503e3ae05 100644
--- a/resources/assets/js/views/sales/invoices.js
+++ b/resources/assets/js/views/sales/invoices.js
@@ -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;
diff --git a/resources/views/banking/reconciliations/create.blade.php b/resources/views/banking/reconciliations/create.blade.php
index 41badb563..16dcb7c4e 100644
--- a/resources/views/banking/reconciliations/create.blade.php
+++ b/resources/views/banking/reconciliations/create.blade.php
@@ -103,7 +103,7 @@
| {{ trans('general.difference') }}: |
- {{ Form::moneyGroup('difference_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.difference', 'currency' => $currency, 'dynamic-currency' => 'currency', 'masked' => 'true'], 0.00, 'text-right d-none') }}
+ {{ Form::moneyGroup('difference_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.difference', 'currency' => $currency, 'masked' => 'true'], 0.00, 'text-right d-none') }}
@money(0, $account->currency_code, true)
|
diff --git a/resources/views/partials/form/money_group.blade.php b/resources/views/partials/form/money_group.blade.php
index 752bfcee4..ed0cdccf9 100644
--- a/resources/views/partials/form/money_group.blade.php
+++ b/resources/views/partials/form/money_group.blade.php
@@ -1,6 +1,12 @@
@stack($name . '_input_start')
@stack($name . '_input_end')
diff --git a/resources/views/purchases/bills/create.blade.php b/resources/views/purchases/bills/create.blade.php
index 214e7f69b..035ff5b55 100644
--- a/resources/views/purchases/bills/create.blade.php
+++ b/resources/views/purchases/bills/create.blade.php
@@ -79,7 +79,7 @@
{{ trans('bills.sub_total') }}
- {{ Form::moneyGroup('sub_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.sub', 'currency' => $currency, 'dynamic-currency' => 'currency', 'masked' => 'true'], 0.00, 'text-right d-none') }}
+ {{ Form::moneyGroup('sub_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.sub', 'currency' => $currency, 'masked' => 'true'], 0.00, 'text-right d-none') }}
@money(0, $currency->code, true)
|
@@ -130,7 +130,7 @@
- {{ Form::moneyGroup('discount_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.discount', 'currency' => $currency, 'dynamic-currency' => 'currency', 'masked' => 'true'], 0.00, 'text-right d-none') }}
+ {{ Form::moneyGroup('discount_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.discount', 'currency' => $currency, 'masked' => 'true'], 0.00, 'text-right d-none') }}
@money(0, $currency->code, true)
{!! Form::hidden('discount', null, ['id' => 'discount', 'class' => 'form-control text-right', 'v-model' => 'form.discount']) !!}
@@ -144,7 +144,7 @@
{{ trans_choice('general.taxes', 1) }}
|
- {{ Form::moneyGroup('tax_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.tax', 'currency' => $currency, 'dynamic-currency' => 'currency', 'masked' => 'true'], 0.00, 'text-right d-none') }}
+ {{ Form::moneyGroup('tax_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.tax', 'currency' => $currency, 'masked' => 'true'], 0.00, 'text-right d-none') }}
@money(0, $currency->code, true)
|
@@ -157,7 +157,7 @@
{{ trans('bills.total') }}
- {{ Form::moneyGroup('grand_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.total', 'currency' => $currency, 'dynamic-currency' => 'currency', 'masked' => 'true'], 0.00, 'text-right d-none') }}
+ {{ Form::moneyGroup('grand_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.total', 'currency' => $currency, 'masked' => 'true'], 0.00, 'text-right d-none') }}
@money(0, $currency->code, true)
|
diff --git a/resources/views/purchases/bills/edit.blade.php b/resources/views/purchases/bills/edit.blade.php
index 7b809c793..9bea621a6 100644
--- a/resources/views/purchases/bills/edit.blade.php
+++ b/resources/views/purchases/bills/edit.blade.php
@@ -80,7 +80,7 @@
{{ trans('bills.sub_total') }}
- {{ Form::moneyGroup('sub_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.sub', 'currency' => $currency, 'dynamic-currency' => 'currency', 'masked' => 'true'], 0.00, 'text-right d-none') }}
+ {{ Form::moneyGroup('sub_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.sub', 'currency' => $currency, 'masked' => 'true'], 0.00, 'text-right d-none') }}
@money(0, $currency->code, true)
|
@@ -131,7 +131,7 @@
- {{ Form::moneyGroup('discount_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.discount', 'currency' => $currency, 'dynamic-currency' => 'currency', 'masked' => 'true'], 0.00, 'text-right d-none') }}
+ {{ Form::moneyGroup('discount_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.discount', 'currency' => $currency, 'masked' => 'true'], 0.00, 'text-right d-none') }}
@money(0, $currency->code, true)
{!! Form::hidden('discount', null, ['id' => 'discount', 'class' => 'form-control text-right', 'v-model' => 'form.discount']) !!}
@@ -145,7 +145,7 @@
{{ trans_choice('general.taxes', 1) }}
|
- {{ Form::moneyGroup('tax_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.tax', 'currency' => $currency, 'dynamic-currency' => 'currency', 'masked' => 'true'], 0.00, 'text-right d-none') }}
+ {{ Form::moneyGroup('tax_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.tax', 'currency' => $currency, 'masked' => 'true'], 0.00, 'text-right d-none') }}
@money(0, $currency->code, true)
|
@@ -158,7 +158,7 @@
{{ trans('bills.total') }}
- {{ Form::moneyGroup('grand_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.total', 'currency' => $currency, 'dynamic-currency' => 'currency', 'masked' => 'true'], 0.00, 'text-right d-none') }}
+ {{ Form::moneyGroup('grand_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.total', 'currency' => $currency, 'masked' => 'true'], 0.00, 'text-right d-none') }}
@money(0, $currency->code, true)
|
diff --git a/resources/views/purchases/bills/item.blade.php b/resources/views/purchases/bills/item.blade.php
index ca8ff9498..3c224b275 100644
--- a/resources/views/purchases/bills/item.blade.php
+++ b/resources/views/purchases/bills/item.blade.php
@@ -69,7 +69,7 @@
@stack('price_td_start')
@stack('price_input_start')
- {{ Form::moneyGroup('name', '', '', ['required' => 'required', 'v-model' => 'row.price', 'data-item' => 'price', 'currency' => $currency, 'dynamic-currency' => 'currency', 'change' => 'row.price = $event; onCalculateTotal'], 0.00, 'text-right input-price') }}
+ {{ Form::moneyGroup('name', '', '', ['required' => 'required', 'v-model' => 'row.price', 'data-item' => 'price', 'currency' => $currency, 'change' => 'row.price = $event; onCalculateTotal'], 0.00, 'text-right input-price') }}
'currency_code', 'class' => 'form-control', 'required' => 'required']) !!}
{!! Form::hidden('currency_rate', '1', ['id' => 'currency_rate']) !!}
- {{ Form::moneyGroup('amount', trans('general.amount'), 'money-bill-alt', ['required' => 'required', 'currency' => $currency, 'dynamic-currency' => 'currency'], 0.00) }}
+ {{ Form::moneyGroup('amount', trans('general.amount'), 'money-bill-alt', ['required' => 'required', 'currency' => $currency], 0.00) }}
{{ Form::selectGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, setting('default.account'), ['required' => 'required', 'change' => 'onChangeAccount']) }}
diff --git a/resources/views/sales/invoices/create.blade.php b/resources/views/sales/invoices/create.blade.php
index e26c5c47b..11a78069d 100644
--- a/resources/views/sales/invoices/create.blade.php
+++ b/resources/views/sales/invoices/create.blade.php
@@ -79,7 +79,7 @@
{{ trans('invoices.sub_total') }}
|
- {{ Form::moneyGroup('sub_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.sub', 'currency' => $currency, 'dynamic-currency' => 'currency', 'masked' => 'true'], 0.00, 'text-right d-none') }}
+ {{ Form::moneyGroup('sub_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.sub', 'currency' => $currency, 'masked' => 'true'], 0.00, 'text-right d-none') }}
@money(0, $currency->code, true)
|
@@ -130,7 +130,7 @@
- {{ Form::moneyGroup('discount_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.discount', 'currency' => $currency, 'dynamic-currency' => 'currency', 'masked' => 'true'], 0.00, 'text-right d-none') }}
+ {{ Form::moneyGroup('discount_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.discount', 'currency' => $currency, 'masked' => 'true'], 0.00, 'text-right d-none') }}
@money(0, $currency->code, true)
{!! Form::hidden('discount', null, ['id' => 'discount', 'class' => 'form-control text-right', 'v-model' => 'form.discount']) !!}
@@ -144,7 +144,7 @@
{{ trans_choice('general.taxes', 1) }}
|
- {{ Form::moneyGroup('tax_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.tax', 'currency' => $currency, 'dynamic-currency' => 'currency', 'masked' => 'true'], 0.00, 'text-right d-none') }}
+ {{ Form::moneyGroup('tax_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.tax', 'currency' => $currency, 'masked' => 'true'], 0.00, 'text-right d-none') }}
@money(0, $currency->code, true)
|
@@ -157,7 +157,7 @@
{{ trans('invoices.total') }}
- {{ Form::moneyGroup('grand_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.total', 'currency' => $currency, 'dynamic-currency' => 'currency', 'masked' => 'true'], 0.00, 'text-right d-none') }}
+ {{ Form::moneyGroup('grand_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.total', 'currency' => $currency, 'masked' => 'true'], 0.00, 'text-right d-none') }}
@money(0, $currency->code, true)
|
diff --git a/resources/views/sales/invoices/edit.blade.php b/resources/views/sales/invoices/edit.blade.php
index 3518fec3e..0a7138a4c 100644
--- a/resources/views/sales/invoices/edit.blade.php
+++ b/resources/views/sales/invoices/edit.blade.php
@@ -80,7 +80,7 @@
{{ trans('invoices.sub_total') }}
- {{ Form::moneyGroup('sub_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.sub', 'currency' => $currency, 'dynamic-currency' => 'currency', 'masked' => 'true'], 0.00, 'text-right d-none') }}
+ {{ Form::moneyGroup('sub_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.sub', 'currency' => $currency, 'masked' => 'true'], 0.00, 'text-right d-none') }}
@money(0, $currency->code, true)
|
@@ -131,7 +131,7 @@
- {{ Form::moneyGroup('discount_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.discount', 'currency' => $currency, 'dynamic-currency' => 'currency', 'masked' => 'true'], 0.00, 'text-right d-none') }}
+ {{ Form::moneyGroup('discount_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.discount', 'currency' => $currency, 'masked' => 'true'], 0.00, 'text-right d-none') }}
@money(0, $currency->code, true)
{!! Form::hidden('discount', null, ['id' => 'discount', 'class' => 'form-control text-right', 'v-model' => 'form.discount']) !!}
@@ -145,7 +145,7 @@
{{ trans_choice('general.taxes', 1) }}
|
- {{ Form::moneyGroup('tax_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.tax', 'currency' => $currency, 'dynamic-currency' => 'currency', 'masked' => 'true'], 0.00, 'text-right d-none') }}
+ {{ Form::moneyGroup('tax_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.tax', 'currency' => $currency, 'masked' => 'true'], 0.00, 'text-right d-none') }}
@money(0, $currency->code, true)
|
@@ -158,7 +158,7 @@
{{ trans('invoices.total') }}
- {{ Form::moneyGroup('grand_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.total', 'currency' => $currency, 'dynamic-currency' => 'currency', 'masked' => 'true'], 0.00, 'text-right d-none') }}
+ {{ Form::moneyGroup('grand_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.total', 'currency' => $currency, 'masked' => 'true'], 0.00, 'text-right d-none') }}
@money(0, $currency->code, true)
|
diff --git a/resources/views/sales/invoices/item.blade.php b/resources/views/sales/invoices/item.blade.php
index 92b02f660..4c117e48f 100644
--- a/resources/views/sales/invoices/item.blade.php
+++ b/resources/views/sales/invoices/item.blade.php
@@ -69,7 +69,7 @@
@stack('price_td_start')
@stack('price_input_start')
- {{ Form::moneyGroup('name', '', '', ['required' => 'required', 'v-model' => 'row.price', 'data-item' => 'price', 'currency' => $currency, 'dynamic-currency' => 'currency', 'change' => 'row.price = $event; onCalculateTotal'], 0.00, 'text-right input-price') }}
+ {{ Form::moneyGroup('name', '', '', ['required' => 'required', 'v-model' => 'row.price', 'data-item' => 'price', 'currency' => $currency, 'change' => 'row.price = $event; onCalculateTotal'], 0.00, 'text-right input-price') }}
|