mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
Story#112050051 - fix invoice sorting in admin
This commit is contained in:
parent
98298d9258
commit
0ce6b84ddf
2 changed files with 5 additions and 5 deletions
|
@ -23,7 +23,7 @@ class Admin::InvoicesController < AdminController
|
|||
|
||||
def index
|
||||
@q = Invoice.includes(:account_activity).search(params[:q])
|
||||
@q.sorts = 'id desc' if @q.sorts.empty?
|
||||
@q.sorts = 'number desc' if @q.sorts.empty?
|
||||
@invoices = @q.result.page(params[:page])
|
||||
end
|
||||
|
||||
|
|
|
@ -8,13 +8,13 @@
|
|||
%thead
|
||||
%tr
|
||||
%th{class: 'col-xs-3'}
|
||||
= sort_link(@q, 'invoice')
|
||||
= sort_link(@q, :number)
|
||||
%th{class: 'col-xs-3'}
|
||||
= sort_link(@q, 'buyer')
|
||||
= sort_link(@q, :buyer_name, "Buyer")
|
||||
%th{class: 'col-xs-3'}
|
||||
= sort_link(@q, 'due_date')
|
||||
= sort_link(@q, :due_date)
|
||||
%th{class: 'col-xs-3'}
|
||||
= sort_link(@q, 'receipt_date')
|
||||
= sort_link(@q, :account_activity_created_at, "Receipt date")
|
||||
%tbody
|
||||
- @invoices.each do |x|
|
||||
%tr
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue