]> git.plutz.net Git - invoices/commitdiff
sort invoice list, newest to oldest master
authorPaul Hänsch <paul@plutz.net>
Thu, 28 Mar 2024 12:48:35 +0000 (13:48 +0100)
committerPaul Hänsch <paul@plutz.net>
Thu, 28 Mar 2024 12:48:35 +0000 (13:48 +0100)
invoices.sh

index 9ed6dfa56388fb2822d3c4129b2212e9c2ae12ac..d53ace75b41d3452e5224fb75d43222435ac6323 100755 (executable)
@@ -34,7 +34,9 @@ list_invoices(){
 
   for n in resent:Resent sent:Sent paid:Paid cancelled:Cancelled; do
     printf '[h1 %s]' "${n#*:}"
 
   for n in resent:Resent sent:Sent paid:Paid cancelled:Cancelled; do
     printf '[h1 %s]' "${n#*:}"
-    for i in invoices/*; do case "$(sed 1q <$i)" in
+    printf "%s\n" invoices/* \
+    | sort -r \
+    | while read i; do case "$(sed 1q <$i)" in
       *status=${n%:*}*) list_invoice "$i";;
     esac; done
   done
       *status=${n%:*}*) list_invoice "$i";;
     esac; done
   done