Sort by id not doc_number

This fixes the bug where documents were displayed out of order
This commit is contained in:
2024-08-30 09:19:58 -04:00
parent 9b69d3f728
commit 9ac1261ed0
2 changed files with 2 additions and 2 deletions

View File

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