diff --git a/app/controllers/customers_controller.rb b/app/controllers/customers_controller.rb index 92fd55b..9494fcd 100644 --- a/app/controllers/customers_controller.rb +++ b/app/controllers/customers_controller.rb @@ -89,7 +89,7 @@ class CustomersController < ApplicationController begin @customer = Customer.find_by_id(params[:id]) @vehicles = @customer.vehicles.paginate(:page => params[:page]) - @issues = @customer.issues + @issues = @customer.issues.order(id: :desc) @billing_address = address_to_s(@customer.billing_address) @shipping_address = address_to_s(@customer.shipping_address) @closed_issues = (@issues - @issues.open) diff --git a/app/views/estimates/_list.html.erb b/app/views/estimates/_list.html.erb index 42cda5d..47219e1 100644 --- a/app/views/estimates/_list.html.erb +++ b/app/views/estimates/_list.html.erb @@ -1,6 +1,6 @@ <% if @customer.present? %> - <% @customer.qbo_estimates.each do |estimate| %> + <% @customer.qbo_estimates.order(doc_number: :desc).each do |estimate| %>
<%= link_to "##{estimate.doc_number}", estimate_path(estimate), target: :_blank %> <%= estimate.txn_date %>
diff --git a/app/views/invoices/_list.html.erb b/app/views/invoices/_list.html.erb index 81c9a54..7a3976f 100644 --- a/app/views/invoices/_list.html.erb +++ b/app/views/invoices/_list.html.erb @@ -1,6 +1,6 @@ <% if @customer.present? %> - <% @customer.qbo_invoices.each do |invoice| %> + <% @customer.qbo_invoices.order(doc_number: :desc).each do |invoice| %>
<%= link_to "##{invoice.doc_number}", invoice_path(invoice), target: :_blank %> <%= invoice.txn_date %>