X-Git-Url: http://git.plutz.net/?a=blobdiff_plain;f=invoices.sh;h=d53ace75b41d3452e5224fb75d43222435ac6323;hb=refs%2Fheads%2Fmaster;hp=a1ec2339be82ce4e994d215282a221b5fe01b663;hpb=af7737f425a9c32b53501fd9a72f8d1657c8aaf1;p=invoices diff --git a/invoices.sh b/invoices.sh index a1ec233..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 @@ -174,7 +176,7 @@ $({ sed 1d "invoices/$id"; printf 'time= work= hours=\n'; } \ %s] ] [td [textarea name=work %s] ] - [td [input type=number name=hours value="%.2g" step=any] ] + [td [input type=number name=hours value="%g" step=any] ] [td %s] ]' "$(UNSTRING "${time#time=}" |HTML)" \ "$(UNSTRING "${work#work=}" |HTML)" \ @@ -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"