From: Paul Hänsch Date: Thu, 24 Jul 2025 19:37:56 +0000 (+0200) Subject: merged factur-x ui from zack branch X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=5599105d66956f283ea5e4f39278be8699d3bec9;p=invoices merged factur-x ui from zack branch --- diff --git a/doclist.sh b/doclist.sh index 9abecd7..10e5a85 100755 --- a/doclist.sh +++ b/doclist.sh @@ -33,6 +33,7 @@ list_status() { [input type=hidden name=session_key value="$SESSION_KEY"] [button type=submit name=action value=update_invoice . $(_ Update)] [button type=submit name=action value=pdf_export . $(_ PDF)] + [button type=submit name=action value=xrechnung . $(_ XRechnung)] ] EOF ) & diff --git a/index.cgi b/index.cgi index b1bdfed..fe919dc 100755 --- a/index.cgi +++ b/index.cgi @@ -41,6 +41,16 @@ fi >&2 DB3 open "$file" for key in $(POST_KEYS); do case $key in id|tid|session_key|action):;; + *..):;; + *..*) v="${key#*..}" key="${key%..*}" + if [ $(POST "${key}..") = "${v}" ]; then + set -- + for seq in $(seq 1 "$(POST_COUNT "${key}..${v}")"); do + set -- "$@" "$(POST "${key}..${v}" $seq)" + done + DB3 store "$key" "$@" + fi + ;; *._*) if DB3 iterate _tmp_modified |grep -qxF "${key%._*}"; then DB3 append "${key%._*}" "$(POST "$key")" @@ -72,6 +82,16 @@ fi >&2 REDIRECT "${_BASE}$PATH_INFO" fi ;; + xrechnung) + id="$(POST id)" file="$_DATA/${id}.kvd" tmp="$(randomid)" + DB3 open "$file" + type="$(DB3 get type)" + . "${_EXEC}/${type}/form.sh" + . "${_EXEC}/factur-x.sh" + + yield_xml >"$_DATA/export/${id}.xml" + REDIRECT "${_BASE}/factur-x/${id}/xrechnung.xml" + ;; pdf_export) id="$(POST id)" file="$_DATA/${id}.kvd" tmp="$(randomid)" DB3 open "$file" @@ -124,6 +144,10 @@ esac id="${PATH_INFO#/pdf/}" id="${id%%/*}" FILE "$_DATA/export/${id}.pdf" ;; + /factur-x/*/xrechnung.xml) + id="${PATH_INFO#/factur-x/}" id="${id%%/*}" + FILE "$_DATA/export/${id}.xml" + ;; *) REDIRECT "${_BASE}/" ;; esac