+if tid="$(POST tid)"; then
+ if [ "$tid" != "$(transid "$cledger")" ]; then
+ SET_COOKIE 0 message="Ledger was changed since last edit"
+ REDIRECT "$REQUEST_URI"
+ fi
+ tdate="$(isdate "$(POST tdate)")"
+ tref="$(POST tref |grep -m1 -xE '.+')"
+ tamount="$(POST tamount \
+ | sed -E '
+ s;^([\+-]?[0-9]+)[\.,]([0-9][0-9])$;\1\2;;
+ s;^([\+-]?[0-9]+)$;&00;;
+ ' | grep -m1 -xE '[\+-]?[0-9]+')"
+ # debug "TDATE: $tdate TREF: $tref AMOUNT: $tamount"
+ if ! [ "$tdate" -a "$tref" -a "$tamount" ]; then
+ SET_COOKIE 0 message="Transaction info invalid"
+ REDIRECT "$REQUEST_URI"
+ fi
+ tdtstamp="$(date -ud "$tdate" +%s)"
+ printf '%s %i %s \ %s %i\n' \
+ "${tdate}" "${tdtstamp}" "$(STRING "${cardfile%.vcf}")" \
+ "$(STRING "$tref")" "${tamount}" \
+ >>"${cledger}"
+ REDIRECT "$REQUEST_URI"
+fi
+
+{ card="$(pdi_load "${_DATA}/vcard/$cardfile")"