Skip to content

Commit

Permalink
Fix: credit notes sorting (#2632)
Browse files Browse the repository at this point in the history
## Context

we show credit notes on invoice page and on all credit notes page
at invoice page we sort them by `created_at` of type `date_time`
at the all credit notes page we sort them by `issuing_date` of type
`date`

As result they are sorted slightly differently and they are not sorted
accurately on the all credit notes page

## Description

Unified ways we sort credit notes, using `:created_at` for sorting
  • Loading branch information
annvelents authored Sep 27, 2024
1 parent 2626489 commit a1a2877
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/queries/credit_notes_query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class CreditNotesQuery < BaseQuery
def call
credit_notes = base_scope.result
credit_notes = paginate(credit_notes)
credit_notes = credit_notes.order(issuing_date: :desc)
credit_notes = credit_notes.order(created_at: :desc)

credit_notes = with_customer_id(credit_notes) if filters.customer_id.present?

Expand Down

0 comments on commit a1a2877

Please sign in to comment.