Sort expenses by date desc, and then by name and total
This make more sense, as is the same order user by invoices, and the most recent expense is at the top. Closes #79
This commit is contained in:
parent
52256c3cb9
commit
60ec335769
|
@ -55,7 +55,7 @@ func mustCollectExpenseEntries(ctx context.Context, conn *Conn, locale *Locale,
|
||||||
select expense.slug
|
select expense.slug
|
||||||
, invoice_date
|
, invoice_date
|
||||||
, invoice_number
|
, invoice_number
|
||||||
, to_price(expense.amount + coalesce(sum(tax.amount)::integer, 0), decimal_digits)
|
, to_price(expense.amount + coalesce(sum(tax.amount)::integer, 0), decimal_digits) as total
|
||||||
, contact.name
|
, contact.name
|
||||||
, coalesce(attachment.original_filename, '')
|
, coalesce(attachment.original_filename, '')
|
||||||
, expense.tags
|
, expense.tags
|
||||||
|
@ -78,7 +78,7 @@ func mustCollectExpenseEntries(ctx context.Context, conn *Conn, locale *Locale,
|
||||||
, expense.tags
|
, expense.tags
|
||||||
, expense.expense_status
|
, expense.expense_status
|
||||||
, esi18n.name
|
, esi18n.name
|
||||||
order by invoice_date
|
order by invoice_date desc, contact.name, total desc
|
||||||
`, where), args...)
|
`, where), args...)
|
||||||
defer rows.Close()
|
defer rows.Close()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue