diff --git a/app/Finance/Transaction.php b/app/Finance/Transaction.php index 0fb13dc..635b61a 100644 --- a/app/Finance/Transaction.php +++ b/app/Finance/Transaction.php @@ -39,7 +39,7 @@ class Transaction extends Eloquent { * * @var array */ - protected $sortableColumns = ['name', 'amount', 'created_at']; + protected $sortableColumns = ['created_at', 'name', 'amount']; /** * Scope for request filter diff --git a/app/Http/Controllers/AccountsController.php b/app/Http/Controllers/AccountsController.php index 950cc74..fa2ec3a 100644 --- a/app/Http/Controllers/AccountsController.php +++ b/app/Http/Controllers/AccountsController.php @@ -40,7 +40,7 @@ public function transactions(Request $request, $id) if(empty($request->input('q'))) { - $transactions = $transactions->sortable()->paginate(); + $transactions = $transactions->sortable(['created_at' => 'desc'])->paginate(); $isSearch = false; } else { $transactions = $transactions->search($request->input('q'), null, true)->get(); diff --git a/app/Http/Controllers/TagsController.php b/app/Http/Controllers/TagsController.php index bcf0292..6ece1ed 100644 --- a/app/Http/Controllers/TagsController.php +++ b/app/Http/Controllers/TagsController.php @@ -39,7 +39,7 @@ public function transactions(Request $request, $id) if(empty($request->input('q'))) { - $transactions = $transactions->sortable()->paginate(); + $transactions = $transactions->sortable(['created_at' => 'desc'])->paginate(); $isSearch = false; } else { $transactions = $transactions->search($request->input('q'), null, true)->get(); diff --git a/app/Http/Controllers/TransactionsController.php b/app/Http/Controllers/TransactionsController.php index 2e10aea..098a6d5 100644 --- a/app/Http/Controllers/TransactionsController.php +++ b/app/Http/Controllers/TransactionsController.php @@ -32,7 +32,7 @@ public function index(Request $request) { if(empty($request->input('q'))) { - $transactions = Transaction::sortable()->filteredByType()->paginate(); + $transactions = Transaction::sortable(['created_at' => 'desc'])->filteredByType()->paginate(); $isSearch = false; } else { $transactions = Transaction::search($request->input('q'), null, true)->groupBy('id')->get(); @@ -70,7 +70,7 @@ public function deleteInvoice($id) if($info = json_decode($transaction->invoice)) { \Storage::delete('invoices/' . $info->store_name); } - + $transaction->update(['invoice' => null]); $this->notify('transactions.deleted_invoice'); diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 377c573..b7bc427 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -14,7 +14,7 @@ class AppServiceProvider extends ServiceProvider { - const VERSION = '1.0-alpha.1'; + const VERSION = '1.0-alpha.2'; /** * Bootstrap any application services. diff --git a/composer.json b/composer.json index 39df46f..1164841 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "umomega/bookkeeper", "description": "Laravel Powered Finance Tracker and CRM.", "keywords": ["umomega", "bookkeeper", "finance", "crm", "multilingual", "laravel", "laravel5", "php", "php7", "finance-application", "bookkeeping", "finance-tracker"], - "version": "1.0-alpha.1", + "version": "1.0-alpha.2", "license": "MIT", "type": "project", "authors": [