-Phone:
-000 000000
-
-Tax no.
-xxx / 000 / ###
-"
- printf '
- [form method="POST" action="/update_sender"
- [hidden "id" "%s"]
- <textarea name="address" placeholder="address">%s</textarea>
- [submit "update" "update" Update]
- ]' \
- "$(HTML $id)" \
- "$(HTML "${address}")"
-}
-
-list_clients(){
- [ -d clients/ ] && for c in clients/*; do
- read -r address hourly <"$c"
- address="$(UNSTRING "${address#address=}")"
- [ "$address" ] || address="(no address)"
- printf '[div .client .address <!--
- -->%s[a href="/clients/%s" Edit]]
- ' "$(HTML "$address")" "$(HTML "${c#clients/}")"
- done
-}
-
-list_senders(){
- [ -d senders/ ] && for s in senders/*; do
- address=$(cat "$s")
- [ "$address" ] || address="(no address)"
- printf '[div .sender .address <!--
- -->%s[a href="/senders/%s" Edit]]
- ' "$(HTML "$address")" "$(HTML "${s#senders/}")"
- done
-}
-
-list_invoices(){
- [ -d invoices/ ] && for i in invoices/*; do
- read -r sender client date number vat<<-EOF
- sed q "$i"
- EOF
- [ -f "senders/${sender#sender=}" ] \
- && sender="$(sed q "senders/${sender#sender=}")" \
- || sender="(unset)"
- [ -f "clients/${client#client=}" ] \
- && client="$(sed q "client/${client#client=}")" \
- || client="(unset)"
- [ "$date" -gt 0 ] \
- && date="$(date -d @$date +%x)" \
- || date="(unset)"
-
- printf '[div .invoice
- [h2
- %s]
- [label From:] %s [label To:] %s [label on] %s
- [a href="/invoices/%s" Edit]
- ]' "$(HTML "$number")" "$(HTML "$sender")" \
- "$(HTML "$client")" "$(HTML "$date")"
- done
-}
-
-info="$(PATH "${PATH_INFO}")"
+which git && [ ! -d .git ] && {
+ git init
+ mkdir -p clients/ invoices/ senders/
+ printf 'export/
+serverkey' >.gitignore
+ git add clients/ invoices/ senders/ .gitignore
+ git commit -m 'initialisation of invoice repo'
+} >&2