5 | sed -E 's;[0-9]{2}$;d&;; :0 s;([0-9])([0-9]{3}[dm]);\1m\2;; t0; y;dm;,.;'
10 [form .ibanassign action="%s/ledgers/set_iban.sh" method=POST
11 [input type=hidden name=session_id value="%s"]
12 ' "$(l10n "IBAN Assignments")" "${_BASE}" "$SESSION_ID"
13 printf '[datalist id=lattendants .'
14 pdi_load "${_DATA}"/vcard/*.vcf |sed -n '/^FN\;:/!b; s;^FN\;:;;; p;' \
16 printf '[option value="%s"]' "$(HTML "$name")"
19 l10n_attendant="$(l10n attendant)"
20 printf %s\\n "$IBAN_ASSIGN" \
21 | while read -r state iban data; do
22 iban="$(UNSTRING "$iban")"
23 [ ! "$iban" ] && iban="??????????"
24 printf '[input type=checkbox id="use_%s" name="use_%s" value=true]' "$iban" "$iban"
25 printf '[fieldset .iban .%s [legend . %s ]' \
27 if [ $state = sure ]; then
29 uid="${card%%/*}" name="$(UNSTRING "${card#*/}")"
30 printf '[span .card . %s]' "$(HTML "${name}")"
33 elif [ $state = guess ]; then
34 record="$(UNSTRING "${data%% *}")"
37 principal="${record#* * * }" principal="${principal%% *}"
38 subject="${record#* * * * }" subject="${subject%% *}"
39 amount="${record#* * * * * }" amount="${amount%% *}"
40 printf '[p .principal . %s][p .date %s][p .amount %s][p .subject . %s]' \
41 "$(UNSTRING "$principal" |HTML)" "$date" "$(credit "$amount")" "$(UNSTRING "$subject" |HTML)"
42 n=0; for card in $cards; do
43 n=$((n+1)); uid="${card%%/*}" name="$(UNSTRING "${card#*/}")"
45 [input type=checkbox id="check_${iban}_$n" name="check_${iban}_$n" value=true checked=checked]
46 [input .card name="fn_${iban}_$n" value="$(HTML "$name")" .disabled tabindex="-1"]
47 [label .del for="check_${iban}_$n" . -]
50 for m in 1 2 3 4 5 6 7 8; do
52 [input type=checkbox id="check_${iban}_$((n+m))" name="check_${iban}_$((n+m))" value=true]
53 [input .card name="fn_${iban}_$((n+m))" value="" placeholder="${l10n_attendant}" list="lattendants"]
54 [label .add for="check_${iban}_$((n+m))" . +]
57 printf '[label .button for="use_%s" . %s]' "$iban" "$(l10n Accept Suggestions)"
58 printf '[label .button for="use_%s" . %s]' "$iban" "$(l10n Ignore Suggestions)"
59 elif [ $state = unknown ]; then
61 principal="${data#* * * }" principal="${principal%% *}"
62 subject="${data#* * * * }" subject="${subject%% *}"
63 amount="${data#* * * * * }" amount="${amount%% *}"
64 printf '[p .principal . %s][p .date %s][p .amount %s][p .subject . %s]' \
65 "$(UNSTRING "$principal" |HTML)" "$date" "$(credit "$amount")" "$(UNSTRING "$subject" |HTML)"
66 printf '[input name="check_" type=hidden][input type=hidden][label .del]'
67 n=0; for m in 1 2 3 4 5 6 7 8; do
69 [input type=checkbox id="check_${iban}_$((n+m))" name="check_${iban}_$((n+m))" value=false]
70 [input .card name="fn_${iban}_$((n+m))" value="" placeholder="${l10n_attendant}" list="lattendants"]
71 [label .add for="check_${iban}_$((n+m))" . +]
74 printf '[label .button for="use_%s" . %s]' "$iban" "$(l10n Accept Suggestions)"
75 printf '[label .button for="use_%s" . %s]' "$iban" "$(l10n Ignore Suggestions)"
79 printf '[button type=submit . %s]' "$(l10n Submit Changes)"
81 } | yield_page ledgers