From: Paul Hänsch Date: Mon, 26 May 2025 18:45:55 +0000 (+0200) Subject: parallel processing of invoice summary in doclist X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=fd94d8708fc6e260dc4def7a2a22da1c1234960c;p=invoices parallel processing of invoice summary in doclist --- diff --git a/doclist.sh b/doclist.sh index 6e77fa6..9abecd7 100755 --- a/doclist.sh +++ b/doclist.sh @@ -6,17 +6,18 @@ list_status() { local status=$1 id type net tax gross junk grep -lxF "status ${status}" "$_DATA"/*.kvd \ - | LANG=C sort -r \ | while read file; do id="${file##*/}" id="${id%.kvd}" + gross='0.00' DB3 open "$file" || continue type="$(DB3 get type)" [ -d "${_EXEC}/${type}/" ] \ && . "${_EXEC}/${type}/form.sh" - cat <<-EOF + ( sed -E ':A; N; $!bA; s;\n;;g' <<-EOF + ${id} [form .invoice method=POST - [h3 [a href="${_BASE}/doc/${id}" . $(DB3 get invnum |HTML)]] + [h3 [a href="${_BASE}/doc/${id}" . $({ DB3 get invnum || printf '####'; }|HTML)]] [span .date . $(DB3 get date |HTML)] [span .rcpt . $(DB3 get rcpt |sed -E 's/ *;.*//g' |HTML)] [span .total . ${gross} €] @@ -34,7 +35,10 @@ list_status() { [button type=submit name=action value=pdf_export . $(_ PDF)] ] EOF - done + ) & + done \ + | LANG=C sort -r \ + | cut -d" " -f2- } "$_EXEC/cgilite/html-sh.sed" <