X-Git-Url: http://git.plutz.net/?a=blobdiff_plain;f=invoices.sh;h=d53ace75b41d3452e5224fb75d43222435ac6323;hb=HEAD;hp=b99d8f2431b4a9b6e0b465acd3992b4a34f24794;hpb=ac0e0282a64b4b03fd1e8be053a5e916713144d5;p=invoices diff --git a/invoices.sh b/invoices.sh index b99d8f2..d53ace7 100755 --- a/invoices.sh +++ b/invoices.sh @@ -34,7 +34,9 @@ list_invoices(){ 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 @@ -276,7 +278,7 @@ update_invoice(){ printf 'time=%s work=%s hours=%s\n' \ "$(POST time $n |STRING)" "$(POST work $n |STRING)" \ "$(POST hours $n |STRING)" \ - | grep -xvF 'time= work= hours=0' + | grep -xvF 'time=\ work=\ hours=0' done } >"invoices/$id"