desc sort issues, estimates, & invoices

This commit is contained in:
2022-02-21 06:22:13 -05:00
parent 925d4b8bcf
commit 3ae3107760
3 changed files with 3 additions and 3 deletions

View File

@@ -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)

View File

@@ -1,6 +1,6 @@
<% if @customer.present? %>
<% @customer.qbo_estimates.each do |estimate| %>
<% @customer.qbo_estimates.order(doc_number: :desc).each do |estimate| %>
<div class="row">
<b><%= link_to "##{estimate.doc_number}", estimate_path(estimate), target: :_blank %></b> <%= estimate.txn_date %>
</div>

View File

@@ -1,6 +1,6 @@
<% if @customer.present? %>
<% @customer.qbo_invoices.each do |invoice| %>
<% @customer.qbo_invoices.order(doc_number: :desc).each do |invoice| %>
<div class="row">
<b><%= link_to "##{invoice.doc_number}", invoice_path(invoice), target: :_blank %></b> <%= invoice.txn_date %>
</div>