Skip to content

For Accounting

alr journal turns a period of records into one balanced journal entry, as a CSV file you import into your accounting system. It reads the record files and a general-ledger mapping file, writes one file, and opens no network connection.

Export a Period

alr journal --period 2026-10-01..2026-10-31 --map gl-map.toml --out october.csv
  • The period is two dates, both days included. A record belongs to the day it finished, in UTC unless you pass --tz local, so the same files give the same journal on any machine. The entry is dated the last day of the period.
  • The output is written whole or not at all. A bad period, a bad map, or a period with nothing to post writes nothing.
  • The format is --profile generic (the default), for any spreadsheet, or --profile qbo for the QuickBooks Online journal-entry import (see QuickBooks Online).

Map Costs to Accounts

The mapping file says which account each cost posts to:

version = "2026-10"
default_account = "AI Compute"
offset_account = "Accrued AI Spend"
ambiguous_account = "AI Spend Ambiguous"
rounding_account = "AI Spend Rounding"

[acme]
key = "project"
value = "ACME-2026-14"
account = "AI Compute Acme"

[engineering]
key = "cost_center"
value = "eng-310"
account = "AI Compute Engineering"

A map line matches a record by its project, task, cost center, client, or provider. The first line in the file that matches decides the account, and a record no line matches posts to default_account. Change version whenever you change the map: it names the map in every entry. Write each account name exactly as your accounting system names it, and make sure it already exists in your chart of accounts.

QuickBooks Online

--profile qbo writes the layout QuickBooks Online imports for journal entries. Its columns are Journal No., Journal Date, Account Name, Journal/Description, Debits, Credits, and Name. The project, task, cost center, client, and provider of each line are text in Journal/Description; QuickBooks does not read them as classes or locations. The generic profile writes each one in a column of its own.

  • Account names. Write each account as QuickBooks names it, with no account number in front, and Parent:Child for a sub-account. The account must already exist. OpenALR warns when a name starts with a number.
  • Name. On a line for an Accounts Payable or Accounts Receivable account, QuickBooks wants a vendor or customer. Mark the account in the map with a table that has account, account_type (ap or ar), and name. Without name, OpenALR writes the line with an empty Name and warns.
  • Row limit. QuickBooks imports fewer than 1,000 rows per file. OpenALR warns when a file has more than 998 data rows. --split (with --out) writes numbered files of at most 998 data rows each, october-001.csv, october-002.csv, and so on, each with whole entries that balance on their own. Import either the single file or the split set of a period, never both: the journal numbers differ, so the period could post twice.
  • Date and separator. --date-format takes YYYY-MM-DD (the default), MM/DD/YYYY, or DD/MM/YYYY. --delimiter takes comma (the default) or semicolon. Both change only how the file is spelled. Match them to your company's settings; the defaults are assumptions.

Test-import a small file before you rely on this profile: the optional column names could not be checked against a sample file from QuickBooks.

What Posts, and What Never Does

Figure Posts?
Metered cost (money charged) Yes, a debit, grouped by account and by project, task, cost center, client, and provider
API-equivalent value Never. It is a valuation, not money spent; it appears as a memo figure only
A cost with no stated basis Never. The report names the records
A partial cost Yes, flagged in the line's memo
A corrected cost Yes, at the corrected figure
A record tagged with two values of a project, task, cost center, or client Yes, whole, to ambiguous_account, never split

How the Money Is Rounded

Every figure is read as an exact decimal; no floating-point number takes part in a sum. Each journal line is summed exactly and rounded to whole cents once, half to even. The offset line is the exact total, rounded the same way, and any difference between it and the rounded lines posts to rounding_account as a line of its own. The entry always balances, and the rounding is never dropped.

Re-Export and Corrections

The same records give the same file. Exporting a period again over the same records gives a byte-identical file. Its entry reference, ALR-<start>-<end>-<12 hex>, is derived from what the entry holds: it changes when a cost, a correction, a tag, the period, or the map's version changes, and for nothing else.

A posted period is closed. A cost correction made after the period's last day, to a record inside the period, is never an edit of the entry you posted. It belongs in an adjusting entry in the open period:

  1. alr journal reports each such correction, as correction after the period: N, with the correction, the record, and the figure before and after.
  2. Keep the file you posted. Post the difference in the open period by hand.
  3. Do not post the re-exported period a second time: it now shows the corrected figures and has a different entry reference.

This release does not write the adjusting entry for you.

Every caveat (records with no basis, unknown or partial costs, ambiguous tags, unmatched records, the rounding line) is printed in the export's report with the record ids.

Report a problem with this page