From 3695dac36318ab162554a52a58fe937ed0faf681 Mon Sep 17 00:00:00 2001 From: denisdulici Date: Mon, 11 Dec 2017 22:37:05 +0300 Subject: [PATCH] fixed #142 --- app/Http/Controllers/Expenses/Bills.php | 2 +- app/Http/Controllers/Expenses/Payments.php | 2 +- app/Http/Controllers/Incomes/Invoices.php | 2 +- app/Http/Controllers/Incomes/Revenues.php | 2 +- config/columnsortable.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/Expenses/Bills.php b/app/Http/Controllers/Expenses/Bills.php index 884e6bb8e..6e04aebf1 100644 --- a/app/Http/Controllers/Expenses/Bills.php +++ b/app/Http/Controllers/Expenses/Bills.php @@ -37,7 +37,7 @@ class Bills extends Controller */ public function index() { - $bills = Bill::with(['vendor', 'status', 'items', 'payments', 'histories'])->collect(); + $bills = Bill::with(['vendor', 'status', 'items', 'payments', 'histories'])->collect(['billed_at'=> 'desc']); $vendors = collect(Vendor::enabled()->pluck('name', 'id')) ->prepend(trans('general.all_type', ['type' => trans_choice('general.vendors', 2)]), ''); diff --git a/app/Http/Controllers/Expenses/Payments.php b/app/Http/Controllers/Expenses/Payments.php index debb49b36..205ecb0ca 100644 --- a/app/Http/Controllers/Expenses/Payments.php +++ b/app/Http/Controllers/Expenses/Payments.php @@ -24,7 +24,7 @@ class Payments extends Controller */ public function index() { - $payments = Payment::with(['vendor', 'account', 'category'])->collect(); + $payments = Payment::with(['vendor', 'account', 'category'])->collect(['paid_at'=> 'desc']); $vendors = collect(Vendor::enabled()->pluck('name', 'id')) ->prepend(trans('general.all_type', ['type' => trans_choice('general.vendors', 2)]), ''); diff --git a/app/Http/Controllers/Incomes/Invoices.php b/app/Http/Controllers/Incomes/Invoices.php index 9ebfd7e92..938f6dae9 100644 --- a/app/Http/Controllers/Incomes/Invoices.php +++ b/app/Http/Controllers/Incomes/Invoices.php @@ -42,7 +42,7 @@ class Invoices extends Controller */ public function index() { - $invoices = Invoice::with(['customer', 'status', 'items', 'payments', 'histories'])->collect(); + $invoices = Invoice::with(['customer', 'status', 'items', 'payments', 'histories'])->collect(['invoice_number'=> 'desc']); $customers = collect(Customer::enabled()->pluck('name', 'id')) ->prepend(trans('general.all_type', ['type' => trans_choice('general.customers', 2)]), ''); diff --git a/app/Http/Controllers/Incomes/Revenues.php b/app/Http/Controllers/Incomes/Revenues.php index d34f1a272..404cfbbd4 100644 --- a/app/Http/Controllers/Incomes/Revenues.php +++ b/app/Http/Controllers/Incomes/Revenues.php @@ -26,7 +26,7 @@ class Revenues extends Controller */ public function index() { - $revenues = Revenue::with(['account', 'category', 'customer'])->collect(); + $revenues = Revenue::with(['account', 'category', 'customer'])->collect(['paid_at'=> 'desc']); $customers = collect(Customer::enabled()->pluck('name', 'id')) ->prepend(trans('general.all_type', ['type' => trans_choice('general.customers', 2)]), ''); diff --git a/config/columnsortable.php b/config/columnsortable.php index 6df10d541..7d9f8cdd6 100644 --- a/config/columnsortable.php +++ b/config/columnsortable.php @@ -15,7 +15,7 @@ return [ 'class' => 'fa fa-sort-amount' ], 'numeric' => [ - 'rows' => ['created_at', 'updated_at', 'paid_at', 'invoiced_at', 'due_at', 'id', 'quantity', 'rate', 'number', 'invoice_number', 'bill_number'], + 'rows' => ['created_at', 'updated_at', 'paid_at', 'invoiced_at', 'billed_at', 'due_at', 'id', 'quantity', 'rate', 'number', 'invoice_number', 'bill_number'], 'class' => 'fa fa-sort-numeric' ], ],