]> git.plutz.net Git - invoices/commitdiff
merged factur-x ui from zack branch
authorPaul Hänsch <paul@plutz.net>
Thu, 24 Jul 2025 19:37:56 +0000 (21:37 +0200)
committerPaul Hänsch <paul@plutz.net>
Thu, 24 Jul 2025 19:37:56 +0000 (21:37 +0200)
doclist.sh
index.cgi

index 9abecd7e7d8a333997fb7384e427814407300442..10e5a8526d6c2c51c8a8bb989c4e69e34456d447 100755 (executable)
@@ -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
     ) &
index b1bdfedc28703cf2cd8511853b262a6a90174ae3..fe919dc22f9db7459c098c762f14230e6588d884 100755 (executable)
--- 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