Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
d416765
fix(payments): size allocation columns from classes so the policy all…
nodemode-ai Nov 28, 2026
46901e3
docs(print): record the formtxt run with posted documents
nodemode-ai Nov 28, 2026
dab0292
fix(docform): resolve template codes to ids for party, items and tax
nodemode-ai Nov 28, 2026
8fe3b63
docs(web): log the allocation column classes and the policy sweep
nodemode-ai Nov 28, 2026
9ca3c08
docs(log): record the document form and posted print runs
nodemode-ai Nov 28, 2026
8a60506
fix(purchase): post a free line to the purchases account when none is…
nodemode-ai Nov 28, 2026
25a2f40
fix(sales): post a free line to the sales account when none is named
nodemode-ai Nov 28, 2026
ac2f12e
fix(linegrid): write amounts into the existing text node
nodemode-ai Nov 28, 2026
9f575fb
fix(table): set column widths in a way the content policy allows
nodemode-ai Nov 28, 2026
e483e09
fix(home): fill Home for a desktop owner who has not claimed the acco…
nodemode-ai Nov 28, 2026
1c4ee67
fix(lists): ask for at most 200 customers, the server's limit
nodemode-ai Nov 28, 2026
30c7cec
feat(linegrid): let the form rewrite every line's account hint
nodemode-ai Nov 28, 2026
e71a3cb
feat(docform): show the default account on every free line
nodemode-ai Nov 28, 2026
513ecf8
fix(grid): anchor numeric text at its right edge while it changes
nodemode-ai Nov 28, 2026
fcc0b39
docs(log): record the default free line account and the numeric anchor
nodemode-ai Nov 28, 2026
3067b6a
chore(release): 0.14.0
nodemode-ai Nov 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# Changelog

## 0.14.0

Lists and reports get their column widths back, the first screen of the desktop app is filled in, and a line with no item posts to a named account.

### Fixed
- **Column widths on every list and report** were being refused by the app's own security rule and never applied, so columns spread evenly. They apply now. The same fault in the payment allocation table is fixed.
- **Home in the desktop app** showed its three cards with no figures and two blank panels until the account was claimed. It now shows 0.00 and a plain sentence in each panel on an empty ledger.
- **A document started from a template lost its supplier or customer and its tax rate,** so the totals left out tax. Both are kept now.
- **A line with no item on a purchase document was refused** because nothing said which account it posts to. It now posts to the purchases account (5100, or the `purchase.expense_account` setting), and a sales line with no item posts to 4100 (or `sales.income_account`). The line shows that account, for example "5100 Purchases and cost of sales", before you save.
- **Delivery notes** failed to load its customer names; it asked the server for more rows than it allows.

### Improved
- When the server refuses one line of a document, the reason shows on that line.
- Numbers in a document's lines and totals no longer nudge as you type.

### Known issues
- A desktop ledger that has no chart of accounts yet does not point you to Setup from Home.
- An empty ledger shows 0.00 with no currency code.
- The account shown on a line with no item is 5100 or 4100 even if the setting names another account.
- Reading the snapshot from FormCel's window was not checked.

### Under the hood
- Every browser check for this version ran with the app's content security policy enforced; earlier checks had bypassed it. Printing through FormTxt was run with posted, numbered documents in Letter and A4 and a statement with rows. Not run: the packaged app, and anything on macOS or Windows.

## 0.13.9

Every printable document has a FormTxt template, document lines are tighter and add up as you type, and the window tells the owner to back up the key.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION := v0.13.9
VERSION := v0.14.0
GO_BUILD := CGO_ENABLED=0 go build -trimpath -ldflags "-s -w"

.PHONY: build web server check clean
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</p>

<p align="center">
<img alt="version v0.13.9" src="https://img.shields.io/badge/version-v0.13.9-eef0f4?style=flat-square">
<img alt="version v0.14.0" src="https://img.shields.io/badge/version-v0.14.0-eef0f4?style=flat-square">
<img alt="Go 1.26+" src="https://img.shields.io/badge/Go-1.26%2B-00ADD8?style=flat-square&logo=go&logoColor=white">
<img alt="TypeScript and Vite" src="https://img.shields.io/badge/TypeScript-Vite-3178c6?style=flat-square">
<img alt="License: Apache-2.0" src="https://img.shields.io/badge/license-Apache--2.0-3a3a3a?style=flat-square">
Expand Down
2 changes: 1 addition & 1 deletion cmd/HASHOUT_LOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Living log of all comment content, explainers, rationale, TODOs, & removed (hashed-out) code for the entry point, `embed.go`, `internal/server`, `internal/static` and `internal/startup`. Source files stay comment-free per dev-rules `sub-skills/hashout-log/SUB-SKILL.md`; everything they would have said lives here, indexed. Read it first, then edit code surgically.

Current build version: v0.13.9
Current build version: v0.14.0
Last updated: 2026-11-26 (US Eastern) · skeleton port from form.md

---
Expand Down
2 changes: 2 additions & 0 deletions docs/PRINT.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ FormTxt's `/api/reports/run` takes no page size (its fields are `template`, `dat

**Run on 2026-11-27 against FormTxt 0.38.0** (a copy on port 8901 with its own data folder, window in headless Chrome; FormLedger 0.13.9 work on 8801, seeded with `fl_exit.py --seed`, no `FORMLEDGER_FORMTXT_TEMPLATE_*` set). One draft of each kind was made through the API (quote, sales order, invoice for ACME; purchase order, purchase invoice and goods receipt for a supplier NORD with supplier ref NP-4471; an invoice in EUR for a EUR customer) and printed by id with `cli print`. Before the templates were in FormTxt each printed plain with the missing-template note (the EUR invoice's note named the `(A4)` title). After the 14 files from `--all` were opened through File > Open or import file and Always allow was clicked once, all eight prints (the seven kinds plus the EUR invoice) were drawn by FormTxt in 0.28 to 0.88 seconds. Page sizes: every USD document and the statement 612 by 792 points (Letter), the EUR invoice 595.28 by 841.89 points (A4), the same as the plain renderer gave for each. The statement had no rows because nothing was posted.

**Run on 2026-11-27 with posted documents, against FormTxt 0.38.0** (a copy on port 8951 with its own data folder and its window served from its own build in headless Chrome; FormLedger 0.14.0 work on 8933, seeded with `fl_exit.py --seed`, no `FORMLEDGER_FORMTXT_TEMPLATE_*` set). Through the API: quote SQ-2026-000001 and sales order SO-2026-000001 confirmed, invoices SI-2026-000001 and SI-2026-000002 posted for ACME, payment PR-2026-000001 of 50.00 posted and allocated to the first; purchase order PO-2026-000001 confirmed, goods receipt GR-2026-000001 and purchase invoice PI-2026-000001 posted for NORD; for the EUR customer EURO (receivable account 12001 in EUR) quote SQ-2026-000002 and order SO-2026-000002 confirmed, and invoice SI-2026-000003 posted on three EUR items whose income account 41001 is in EUR (an EUR invoice on the USD items is refused at posting with `currency_mismatch`, account 4100 is in USD). All 14 files from `--all` were opened through File > Open or import file, Always allow all outside agents was clicked once, and ten prints were drawn by FormTxt in 0.27 to 0.69 seconds: every kind from the Letter files, each heading carrying its number (for example `Invoice SI-2026-000001`, `Goods receipt GR-2026-000001`), 612 by 792 points, one page each; the EUR invoice, quote and order from the A4 files, 595.28 by 841.89 points, one page each, totals EUR 68.13, EUR 73.58 and EUR 73.58; the statement for ACME to 2026-11-27 with three rows (invoice 73.58, invoice 73.58, payment 50.00 credit) running to a closing balance of USD 97.16. Page one of each was rendered to PNG and looked at; no field was empty or misplaced and no template was changed.

### How the template is used

FormLedger carries an invoice template as its own data, written in FormTxt's `.ftxt` document format (`internal/printout/formtxt_invoice.json`, embedded in the binary). It is titled `FormLedger invoice template` and holds the company name, the document title and number, date, due date, currency and status, the bill-to customer name and code, a line table whose header row repeats on every page and whose second row is marked to repeat once per line (`item`, `description`, `quantity`, `unitPrice` as Rate, `taxRate`, `lineSubtotal` as Amount), then subtotal, tax, total with the currency, the notes, and "Page N of M" in the footer. A statement template ships the same way (`internal/printout/formtxt_statement.json`, titled `FormLedger statement template`, written by `./formledger formtxt-template statement`): company, period, customer name and code, currency, opening balance, one repeating row per event (`lineDate`, `event`, `reference`, `debit`, `credit`, `balance`) and the closing balance. With no `from` the heading reads "Statement to" and the end date. The two lookups are separate, so each kind uses its template once it is in FormTxt.
Expand Down
16 changes: 15 additions & 1 deletion internal/HASHOUT_LOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Living log of comment content, rationale and removed code for the core skeleton packages under `internal/`. Source files stay comment-free; what they would have said lives here, indexed. Read it first, then edit code surgically. Covers the packages ported in the core slice only; `internal/server`, `internal/static` and `internal/startup` are logged by their own slice.

Current build version: v0.13.9
Current build version: v0.14.0
Last updated: 2026-11-27 (US Eastern) · profit and loss and the balance sheet

---
Expand Down Expand Up @@ -1896,3 +1896,17 @@ FormTxt 0.38.0's `/api/reports/run` has no page size field, so the size lives in
- logged: v0.13.9 · 2026-11-27

The lost-key warning was only in the log. `/api/me` now carries `key` for the owner role only: encrypted, `madeHere` (the key is the one `EnsureHome` made in `FORMLEDGER_KEY_HOME` and no `FORMLEDGER_KEY_FILE` or credential overrides it), the path, and `backedUp`. The key itself never leaves the server. The confirmation is a file beside the key, `formledger.key.backed-up`, not a row in the database: it belongs to that key on that computer, survives a fresh data folder that reuses the key, and is gone if the key folder is replaced. `keyState` reads `config.Load` rather than threading the config through `Service`, because `server.go` builds the service and is not this slice's file; in desktop mode that also mints an unused window key per call, which is harmless. The route `POST /api/me/key-backed-up` (Session, owner checked in the handler) needs one line in `internal/auth/module.go`, with its owner. Run in a private copy with that line, started as the desktop shell does (`FORMLEDGER_DESKTOP=1 FORMLEDGER_KEY_HOME=/tmp/P3/appdata`, signed in through `/desktop/enter`): `key` read encrypted, madeHere, the path, not backed up; the confirm answered 200 and wrote the marker; a reload read backed up. With no key home, `key` read not encrypted and no path.

### internal/printout/formtxt.go, internal/printout/template.go · proven with posted documents
- refers-to: internal/printout/formtxt.go :: formtxt.Render; internal/printout/template.go :: TemplateCommand, sized, findShipped
- kind: rationale
- logged: v0.14.0 · 2026-11-27

The earlier proof printed drafts, so no heading had a number and the statement had no rows. On 2026-11-27 against FormTxt 0.38.0 on 8951 (its own data folder, window from its own build), with all 14 files from `--all` opened and Always allow clicked once, ten posted documents were drawn by FormTxt in 0.27 to 0.69 seconds: the seven kinds from the Letter files at 612 by 792 with numbered headings (SQ, SO, SI, PO, PI, GR), and an EUR invoice, quote and order from the A4 files at 595.28 by 841.89; the ACME statement showed two invoices of 73.58 and a payment of 50.00, closing 97.16. No template or code needed a change. An EUR invoice on the seeded USD items is refused at posting (`currency_mismatch`, income account 4100 is USD), so the EUR invoice used EUR items on an EUR income account.

### internal/purchase/resolve.go, internal/sales/resolve.go · a free line posts to the default account
- refers-to: internal/purchase/resolve.go :: expenseSetting, defaultExpenseCode; internal/sales/resolve.go :: incomeSetting, defaultIncomeCode
- kind: rationale
- logged: v0.14.0 · 2026-11-27

A line with no item and no account was refused (`no_expense_account`, `no_income_account`), and the form had no way to name one. The chart marks no default account, so the rule is the smallest honest one already used for item lines on buying: the setting `purchase.expense_account`, else 5100; selling gets the same shape, `sales.income_account`, else 4100. When that account is missing, inactive or a group, the refusal keeps its code and says in words to add the account to the chart or pick an item. Against a seeded copy, a free line "Courier fee" at 42.50 posted PI-2026-000001 as 5100 debit, 2110 credit, and SI-2026-000001 as 1200 debit, 4100 credit.
2 changes: 1 addition & 1 deletion internal/app/version.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package app

var Version = "v0.13.9"
var Version = "v0.14.0"

const Product = "FormLedger"
6 changes: 5 additions & 1 deletion internal/purchase/resolve.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,11 @@ func resolveLines(ctx context.Context, q store.Querier, in []LineInput, currency
return nil, bad("no_price", n+"has no item, so it needs a unitPrice")
}
if strings.TrimSpace(li.ExpenseAccount) == "" {
return nil, bad("no_expense_account", n+"has no item, so it needs an expenseAccount code")
code := expenseSetting(ctx, q)
if l.ExpenseAccountID, err = findAccount(ctx, q, code, n); err != nil {
return nil, refuse("no_expense_account", n+"has no item and the chart has no usable purchases account "+code+"; add account "+code+" to the chart or pick an item for this line")
}
l.ExpenseAccount = code
}
}
if li.Description != nil {
Expand Down
17 changes: 16 additions & 1 deletion internal/sales/resolve.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ import (
"github.com/nodemode-ai/formledger/internal/store"
)

const defaultIncomeCode = "4100"

func incomeSetting(ctx context.Context, q store.Querier) string {
var code string
err := q.QueryRowContext(ctx, `SELECT value FROM settings WHERE key = 'sales.income_account'`).Scan(&code)
if err != nil || strings.TrimSpace(code) == "" {
return defaultIncomeCode
}
return strings.TrimSpace(code)
}

type customer struct {
id string
code string
Expand Down Expand Up @@ -124,7 +135,11 @@ func resolveLines(ctx context.Context, q store.Querier, in []LineInput, currency
return nil, bad("no_price", n+"has no item, so it needs a unitPrice")
}
if strings.TrimSpace(li.IncomeAccount) == "" {
return nil, bad("no_income_account", n+"has no item, so it needs an incomeAccount code")
code := incomeSetting(ctx, q)
if l.IncomeAccountID, err = findAccount(ctx, q, code, n); err != nil {
return nil, refuse("no_income_account", n+"has no item and the chart has no usable sales account "+code+"; add account "+code+" to the chart or pick an item for this line")
}
l.IncomeAccount = code
}
}
if li.Description != nil {
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "formledger-desktop"
version = "0.13.9"
version = "0.14.0"
description = "FormLedger desktop app"
authors = ["NodeAgentc, Inc."]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/HASHOUT_LOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Living log of all comment content, explainers, rationale, TODOs, & removed (hashed-out) code for the Tauri 2 desktop shell (`src-tauri`). Source files stay comment-free per dev-rules `sub-skills/hashout-log/SUB-SKILL.md`; everything they would have said lives here, indexed. This file is also the compressed contextual map of the shell: read it first, then edit code surgically.

Current build version: v0.13.9
Current build version: v0.14.0
Last updated: 2026-11-26 (US Eastern) · the shell ported from form.md's src-tauri and renamed for FormLedger

---
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://schema.tauri.app/config/2",
"productName": "FormLedger",
"mainBinaryName": "formledger-desktop",
"version": "0.13.9",
"version": "0.14.0",
"identifier": "ai.nodemode.formledger",
"build": { "frontendDist": "splash" },
"app": {
Expand Down
Loading
Loading