Commit graph

24 commits

Author SHA1 Message Date
33ba7650c3
invoices: self-contained payout addresses
Crypto options were limited to a hard-coded asset list, with one
address per coin in a side table. A payout address now carries
everything an invoice needs: ticker, name, QR URI scheme, amount
parameter, CoinGecko id, address and an active flag. Any coin can be
added, several addresses per ticker are fine, and known tickers fill the
QR and rate fields from the built-in templates.

The new-invoice form picks a payout address. The invoice snapshots the
ticker, address, name, scheme and amount parameter, and the PDF and QR
render from that copy, so editing, retiring or deleting a payout entry
never changes an issued invoice. "Fetch live" looks up the rate by the
payout address's CoinGecko id.

Migration 012 keeps the existing rows and backfills both the payout
metadata and the snapshots on existing crypto invoices.

Assisted-by: Claude:opus-5
2026-10-10 09:17:09 +04:00
9128867a33
invoices: statistics page
Add /admin/invoices/stats with a year filter: invoiced, received and
outstanding totals in GEL at each invoice's captured rate (the one
currency every invoice has), overdue count, average days to pay, money
received per month by payment date as a bar chart with the same figures
in a table, per-currency totals, top clients and crypto option usage.
Cancelled invoices are left out of every amount; hidden ones follow the
usual superuser-only visibility.

Assisted-by: Claude:opus-5
2026-10-10 09:12:21 +04:00
eeac07ed34
invoices: cancel with stamped PDF, superuser-only hiding
An invoice issued by mistake could only be left pending or marked paid.
Add cancel (with an optional reason) and reinstate. Cancelling renders a
third PDF variant with a diagonal CANCELLED stamp and the date/reason,
and it becomes the current one, so the client's link and download show
the invoice as void. Cancelled wins over paid in the status, and marking
a cancelled invoice paid is refused.

Superusers can also hide an invoice: it disappears from the admin list,
dashboard and invoice pages for every other user, while the client's
public link keeps working.

Assisted-by: Claude:opus-5
2026-10-10 08:35:01 +04:00
97919f3f71
admin: restore form styling
The invoice form's text inputs, textareas and label layout depended on
.contact-form rules that were deleted with the contact form, so they
fell back to white browser defaults with labels running inline. Give
every admin form (.invoice-form) one style: labels above fields, gray
inputs on the surface token, a focus state, single column on phones,
and the submit button styled like the rest.

Assisted-by: Claude:opus-5
2026-10-10 08:32:28 +04:00
8471570187
admin: per-area permissions on every route
Give each user independent read, write and delete flags per area
(invoices, bingo, users), so someone can e.g. review and remove bingo
incidents without being able to add any. The request method and path
decide the flag needed: GET is read except the new/duplicate forms, POST
to .../delete is delete, any other POST is write. Unmapped admin paths
are superuser-only, and a test enumerates every registered admin route
so a new one cannot ship without a rule.

Pages follow the same flags: nav and dashboard tiles show readable areas
only, write forms and delete buttons are hidden, and the datacenter form
is shown read-only.

Assisted-by: Claude:opus-5
2026-10-10 08:27:37 +04:00
9bf40690e5
admin: user accounts and session login
The admin was one shared HTTP Basic login: no way to give someone
partial access, revoke one person, or tell who changed what. Add a users
table and a session login form. Passwords are scrypt hashes from Ruby's
OpenSSL, so no native gem is needed. Sessions carry a per-user version
that is bumped on password change, which logs that user out everywhere.

ADMIN_USER/ADMIN_PASSWORD now bootstrap the first superuser on an empty
table and afterwards only work while no active superuser exists, as a
recovery path that re-creates one. Until per-area permissions land,
non-superusers only reach the dashboard and their own password page.

Assisted-by: Claude:opus-5
2026-10-10 08:25:46 +04:00
c2020bf903
admin: dashboard instead of the invoice list
/admin redirected to the invoice list, which stopped making sense once
the admin also ran the bingo. Make it a dashboard with one tile per
area: invoice totals, outstanding amount per currency, overdue count and
the five latest invoices; the bingo score, reserve size, latest incident
and card cells still missing a photo. A shared nav links the sections.
Tiles are per area so they can follow user permissions later.

Assisted-by: Claude:opus-5
2026-10-10 08:23:14 +04:00
1f059dc2f6
remove contact form
All checks were successful
Build and Deploy to Production / test (push) Successful in 45s
Build and Deploy to Production / build (push) Successful in 1m6s
Build and Deploy to Production / deploy (push) Successful in 46s
Tests / test (push) Successful in 43s
2026-08-04 01:25:50 +04:00
82fc1c6e17
site: multi-page structure with shared nav; rework services, keys, contact 2026-07-16 20:01:26 +04:00
0aec9f9320
assets: OG card and logo-derived favicons 2026-07-16 20:01:25 +04:00
89700368ef
styles: design tokens and self-hosted IBM Plex fonts 2026-07-16 20:01:25 +04:00
0fbb6ee809
invoices: multi-crypto payment support
All checks were successful
Build and Deploy to Production / test (push) Successful in 18s
Build and Deploy to Production / build (push) Successful in 49s
Build and Deploy to Production / deploy (push) Successful in 31s
One asset per invoice from a registry (lib/crypto_asset.rb): BTC, LTC,
ETH, XMR, SOL, ALGO, USDT/USDC on ERC-20/TRC-20/BEP-20/Solana/Algorand.
Migration 003 generalizes the ltc_* columns to crypto_* + crypto_coin
(existing LTC invoices backfilled). QR payload adapts per asset: BIP21
amount URIs where supported, bare address for tokens with a network
hint on the PDF. Default addresses come from the CRYPTO_ADDRESSES
secret (JSON code=>address); LTC_ADDRESS still works as legacy.
2026-07-03 02:01:57 +04:00
187910f69b
admin form: disable submit button to prevent duplicate invoices 2026-07-02 17:31:20 +04:00
7ed1a674aa
main page: SP -> Logo
All checks were successful
Build and Deploy to Production / build (push) Successful in 48s
Build and Deploy to Production / deploy (push) Successful in 27s
2026-06-09 02:22:28 +03:00
7dbeb0dd49
nbg and auto fill GEL exchange rate
All checks were successful
Build and Deploy to Production / build (push) Successful in 47s
Build and Deploy to Production / deploy (push) Successful in 27s
2026-06-08 19:29:25 +03:00
c9bcbe7ff5
ltc payments 2026-06-08 18:43:01 +03:00
8f3afcfcd2
logo in pdf
All checks were successful
Build and Deploy to Production / build (push) Successful in 1m2s
Build and Deploy to Production / deploy (push) Successful in 39s
2026-06-08 18:15:23 +03:00
96a0f55741
css: invoice list, badges, item form, download button
All checks were successful
Build and Deploy to Production / build (push) Successful in 1m9s
Build and Deploy to Production / deploy (push) Successful in 30s
Extends the existing dark palette to cover the invoicing UI:

- .invoice-list: zebra-free table with right-aligned totals.
- .badge / .badge-pending / .badge-paid: small status chip.
- .items-table: per-row inputs for description/qty/unit price, .remove-row
  button styling.
- .invoice-grid: two-column layout for the terms block (issued/due,
  currency/GEL rate).
- .link-button: subdued "+ add line" affordance.
- .download-button: the prominent CTA on the public landing page.
- color-scheme: dark on date inputs so the native picker matches the
  rest of the page.

No changes to existing rules.
2026-05-26 17:54:48 +03:00
226ccb8192
invoicing: admin and public views
Three admin templates:

- index: invoice list with status badge and link to detail.
- new: client + terms fields, dynamic line-item rows backed by
  admin-invoice-form.js (add/remove + re-index of items[N][...] names).
- show: invoice detail, public URL to share, toggle-paid button.

One public template, invoice_public.erb, shown at /i/:uuid: client name,
number, total, status, and a single big download button to /i/:uuid/pdf.

All admin pages are noindex; same for the public landing (it's a
client-specific URL, not search-discoverable content).
2026-05-26 17:54:40 +03:00
bf4683a973
fonts: vendor Noto Sans + Noto Sans Georgian
Prawn needs explicit TTFs to render anything beyond the built-in Latin
glyphs. Bundling Noto Sans (Latin/Cyrillic) and Noto Sans Georgian lets the
invoice PDF show both Latin and Georgian forms of the legal name.

OFL.txt is the upstream SIL Open Font License covering all five files.
2026-05-26 17:29:30 +03:00
c3f37e6cb0
more SEO: org -> person
All checks were successful
Build and Deploy to Production / build (push) Successful in 47s
Build and Deploy to Production / deploy (push) Successful in 32s
2026-05-05 01:45:18 +04:00
7296ffc944
SEO optimization
All checks were successful
Build and Deploy to Production / build (push) Successful in 45s
Build and Deploy to Production / deploy (push) Successful in 32s
2026-05-05 01:13:59 +04:00
7608cf15fc
useful icon and links
All checks were successful
Build and Deploy to Production / build (push) Successful in 45s
Build and Deploy to Production / deploy (push) Successful in 32s
2026-05-05 00:57:11 +04:00
1ab09043ee
ruby rework with contact form
All checks were successful
Build and Deploy to Production / build (push) Successful in 51s
Build and Deploy to Production / deploy (push) Successful in 34s
2026-05-05 00:45:27 +04:00