3 . "$_EXEC/cgilite/storage.sh"
6 if [ "$(POST show_account)" ]; then
7 uid="$(POST show_account)"
8 cfile="$(grep -lxF "UID;:${uid}" "${_DATA}/vcard/"*.vcf || grep -lxF "UID:${uid}" "${_DATA}/vcard/"*.vcf)"
9 REDIRECT "${_BASE}/ledgers/account.sh?card=${cfile##*/}"
14 printf '%03i\n' "$1" \
15 | sed -E 's;[0-9]{2}$;d&;; :0 s;([0-9])([0-9]{3}[dm]);\1m\2;; t0; y;dm;,.;'
19 { pdi_load "${_DATA}"/vcard/*.vcf
20 printf 'BEGIN:LEDGERS\n'
21 cat "${_DATA}"/ledgers/????-??-??\ -\ ????-??-??\ -\ ????.tbl
22 } | "${_EXEC}"/ledgers/iban_assign.awk
26 if [ "${PATH_INFO%/iban_assign/}" != "${PATH_INFO}" ]; then
27 . "${_EXEC}/ledgers/iban_assign.sh"
32 [form .upload action="%s/ledgers/csv_upload.sh" method="POST" enctype="multipart/form-data"
33 [label for=ledger_upload . %s:]
34 [input #ledger_upload type="file" name="csv" accept=".csv,text/csv"]
35 [input type=hidden name=session_id value="%s"]
36 [button type="submit" %s]
38 "${_BASE}" "$(l10n "Postbank CSV")" "$SESSION_ID" "$(l10n Upload)"
40 [form .ledgers action="%s/ledgers/delete.sh" method=POST
41 [input type=hidden name=session_id value="%s"]
43 ' "${_BASE}" "$SESSION_ID" "$(l10n Ledgers)"
44 for ledger in "$_DATA"/ledgers/????-??-??\ -\ ????-??-??\ -\ ????.tbl; do
45 ledger="${ledger##*/}"
46 [ "$ledger" = "????-??-?? - ????-??-?? - ????.tbl" ] && continue
47 printf '[p .ledger . %s [button type=submit name=delete value="%s" . %s]]' \
48 "$(HTML "${ledger% - ????.tbl}")" "$(HTML "$ledger")" "$(l10n delete)"
51 unassigned="$(printf %s\\n "$IBAN_ASSIGN" |grep -E '^guess|^unknown' |wc -l)"
54 [h1 . $(l10n IBAN Assignments)]
55 $(printf "$(l10n "%i IBANs are unassigned")" "$unassigned")
56 [a href="${_BASE}/ledgers/iban_assign/" . $(l10n Assign IBANs)]
58 [form action="${_BASE}/ledgers/account.sh" method=POST
60 $(printf %s\\n "$IBAN_ASSIGN" \
64 s;([^\t]+)/([^\t]+);\1 \2\n;g;
67 | while read uid fn; do
69 fn="$(UNSTRING "$fn" |HTML)"
70 printf '[option value="%s" . %s]' "$uid" "$fn"
73 [button type="submit" . $(l10n Account)]
76 } | yield_page ledgers