diff --git a/app/Http/Controllers/Banking/Transfers.php b/app/Http/Controllers/Banking/Transfers.php index 5f9b8f554..ed92b5201 100644 --- a/app/Http/Controllers/Banking/Transfers.php +++ b/app/Http/Controllers/Banking/Transfers.php @@ -55,6 +55,7 @@ class Transfers extends Controller ); $request = request(); + if (isset($request['sort']) && array_key_exists($request['sort'], $special_key)) { $sort_order = array(); diff --git a/resources/assets/js/views/purchases/bills.js b/resources/assets/js/views/purchases/bills.js index 35ab75333..408f7c6ae 100644 --- a/resources/assets/js/views/purchases/bills.js +++ b/resources/assets/js/views/purchases/bills.js @@ -81,7 +81,7 @@ const app = new Vue({ this.form.items = items; } - if (document.getElementById('taxes').getAttribute('data-value')) { + if ((document.getElementById('taxes') != null) && (document.getElementById('taxes').getAttribute('data-value'))) { this.taxes = JSON.parse(document.getElementById('taxes').getAttribute('data-value')); } }, @@ -348,16 +348,5 @@ const app = new Vue({ .catch(error => { }); }, - - onDeleteTransaction(form_id) { - this.transaction = new Form(form_id); - - this.confirm.url = this.transaction.action; - this.confirm.title = this.transaction.title; - this.confirm.message = this.transaction.message; - this.confirm.button_cancel = this.transaction.cancel; - this.confirm.button_delete = this.transaction.delete; - this.confirm.show = true; - } } }); diff --git a/resources/assets/js/views/sales/invoices.js b/resources/assets/js/views/sales/invoices.js index a1ea6f2aa..d2b6259ea 100644 --- a/resources/assets/js/views/sales/invoices.js +++ b/resources/assets/js/views/sales/invoices.js @@ -81,7 +81,7 @@ const app = new Vue({ this.form.items = items; } - if (document.getElementById('taxes').getAttribute('data-value')) { + if ((document.getElementById('taxes') != null) && (document.getElementById('taxes').getAttribute('data-value'))) { this.taxes = JSON.parse(document.getElementById('taxes').getAttribute('data-value')); } }, @@ -349,16 +349,5 @@ const app = new Vue({ .catch(error => { }); }, - - onDeleteTransaction(form_id) { - this.transaction = new Form(form_id); - - this.confirm.url = this.transaction.action; - this.confirm.title = this.transaction.title; - this.confirm.message = this.transaction.message; - this.confirm.button_cancel = this.transaction.cancel; - this.confirm.button_delete = this.transaction.delete; - this.confirm.show = true; - } } }); diff --git a/resources/views/purchases/bills/show.blade.php b/resources/views/purchases/bills/show.blade.php index b6e64ec73..4b7d4448a 100644 --- a/resources/views/purchases/bills/show.blade.php +++ b/resources/views/purchases/bills/show.blade.php @@ -565,7 +565,7 @@ 'type' => 'button', 'class' => 'btn btn-danger btn-sm', 'title' => trans('general.delete'), - 'onclick' => 'confirmDelete("' . '#bill-transaction-' . $transaction->id . '", "' . trans_choice('general.transaction', 2) . '", "' . trans('general.delete_confirm', ['name' => '' . Date::parse($transaction->paid_at)->format($date_format) . ' - ' . money($transaction->amount, $transaction->currency_code, true) . ' - ' . $transaction->account->name . '', 'type' => strtolower(trans_choice('general.transactions', 1))]) . '", "' . trans('general.cancel') . '", "' . trans('general.delete') . '")' + '@click' => 'confirmDelete("' . route('transactions.destroy', $transaction->id) . '", "' . trans_choice('general.transactions', 2) . '", "' . $message. '", "' . trans('general.cancel') . '", "' . trans('general.delete') . '")' )) !!} {!! Form::close() !!} @endif diff --git a/resources/views/sales/invoices/show.blade.php b/resources/views/sales/invoices/show.blade.php index 1e2655210..6a207f4b4 100644 --- a/resources/views/sales/invoices/show.blade.php +++ b/resources/views/sales/invoices/show.blade.php @@ -543,10 +543,10 @@