3 . "$_EXEC/cgilite/storage.sh"
8 | sed -E 's;[0-9]{2}$;d&;; :0 s;([0-9])([0-9]{3}[dm]);\1m\2;; t0; y;dm;,.;'
12 [form .upload action="%s/ledgers/csv_upload.sh" method="POST" enctype="multipart/form-data"
13 [label for=ledger_upload . %s:]
14 [input #ledger_upload type="file" name="csv" accept=".csv,text/csv"]
15 [input type=hidden name=session_id value="%s"]
16 [button type="submit" %s]
18 "${_BASE}" "$(l10n "Postbank CSV")" "$SESSION_ID" "$(l10n Upload)"
20 [form .ledgers action="%s/ledgers/delete.sh" method=POST
21 [input type=hidden name=session_id value="%s"]
23 ' "${_BASE}" "$SESSION_ID" "$(l10n Ledgers)"
24 for ledger in "$_DATA"/ledgers/????-??-??\ -\ ????-??-??\ -\ ????.tbl; do
25 ledger="${ledger##*/}"
26 [ "$ledger" = "????-??-?? - ????-??-?? - ????.tbl" ] && continue
27 printf '[p .ledger . %s [button type=submit name=delete value="%s" . %s]]' \
28 "$(HTML "${ledger% - ????.tbl}")" "$(HTML "$ledger")" "$(l10n delete)"
32 [form .ibanassign action="%s/ledgers/iban_assign.sh" method=POST
33 [input type=hidden name=session_id value="%s"]
35 ' "${_BASE}" "$SESSION_ID" "$(l10n "IBAN Assignments")"
36 { pdi_load "${_DATA}"/vcard/*.vcf
37 cat "${_DATA}"/ledgers/????-??-??\ -\ ????-??-??\ -\ ????.tbl
38 } | "${_EXEC}"/ledgers/iban_assign.awk \
39 | while read -r state iban data; do
40 printf '[fieldset .iban .%s [legend . %s ]' \
42 if [ $state = sure ]; then
44 elif [ $state = guess ]; then
45 record="$(UNSTRING "${data%% *}")"
47 principal="${record#* * * }" principal="${principal%% *}"
48 subject="${record#* * * * }" subject="${subject%% *}"
49 amount="${record#* * * * * }" amount="${amount%% *}"
50 printf '[p .principal . %s][p .amount %s][p .subject . %s]' \
51 "$(UNSTRING "$principal" |HTML)" "$(credit "$amount")" "$(UNSTRING "$subject" |HTML)"
52 printf '[h4 . %s]' "$(l10n Guesses)"
53 for card in $cards; do
54 uid="${card%%/*}" name="$(UNSTRING "${card#*/}")"
55 printf '[input .card key="cardfn" value="%s" placeholder="%s"]' "$(HTML "${name}")" "$(l10n attendent)"
57 elif [ $state = unknown ]; then
58 principal="${data#* * * }" principal="${principal%% *}"
59 subject="${data#* * * * }" subject="${subject%% *}"
60 amount="${data#* * * * * }" amount="${amount%% *}"
61 printf '[p .principal . %s][p .amount %s][p .subject . %s]' \
62 "$(UNSTRING "$principal" |HTML)" "$(credit "$amount")" "$(UNSTRING "$subject" |HTML)"
67 } | yield_page ledgers