Runs live, versioned Python application objects on one VM, with a suite of apps: projects, notes, tasks, files and more.
Expenses that hold up in an audit
What app-finance asks for before an expense, a business trip or a fringe benefit is on the books, why, and which of it is yours to set.
This is not tax advice. It describes what the software records and refuses. The US federal rules it is shaped around are named below so you can look them up and take them to your accountant; they are summarised, hedged, and may have changed. Every percentage, threshold and rate the box applies is operator data -- a row you can read and edit, with its source beside it -- and none of it is a constant in code. If a number is wrong for your business, change the row.
What an auditor asks for
For travel, meals, gifts and vehicle use, US federal law asks for more than "we spent it": IRC section 274(d) disallows those expenses unless the taxpayer substantiates, by adequate records or sufficient evidence, the amount, the time and place, the business purpose and, for meals and entertainment, the business relationship of the people present. Treasury Regulation 1.274-5 says what adequate records are, and generally requires documentary evidence (a receipt) for lodging whatever it cost and for any other expenditure of $75 or more. IRS Publication 463 (Travel, Gift, and Car Expenses) walks through it, including the mileage log a vehicle needs instead of a receipt.
An employer that reimburses employees under an accountable plan (Treas. Reg. 1.62-2) keeps those reimbursements out of wages only when the expense has a business connection, is substantiated within a reasonable period, and any excess is returned. The regulation's safe harbour for "reasonable" is 60 days to substantiate and 120 days to return an excess. Whether your plan is accountable is a question for your accountant; the box counts what is late.
What app-finance records against each of those:
| The auditor's question | Where the answer lives | What refuses a missing answer |
|---|---|---|
| How much, and when | expenses.amount_cents, incurred_on | required, validation.min 1 (every writer) |
| Where | expenses.location; mileage_logs.from_place / to_place | required on the log |
| What business it was for | expenses.business_purpose; mileage_logs.business_purpose | required_when the category says so (expenses); required (mileage) |
| Who was there, and their relationship | expenses.attendees | required_when the category says so |
| The receipt | expenses.receipt_scan_id -> the scan (app-intake) -> its stored image | required_when the amount is over the category's threshold |
| Who approved it | expenses.approved_by / approved_at (someone other than the claimant) | the hook refuses self-approval |
| How much is deductible | expenses.deductible_bps / deductible_cents, stamped at approval | the category_stamps locked check |
| The miles | mileage_logs odometer readings and miles | the mileage_rules locked check |
Expense categories
expense_categories is the policy, one row per kind of spending:
| Field | Means |
|---|---|
deductible_bps | the share treated as deductible, in basis points (10000 all, 5000 half, 0 none) |
requires_business_purpose | cannot be submitted or approved without a purpose |
requires_attendees | cannot be submitted or approved without attendees |
receipt_required_over_cents | a linked receipt is required when the amount is strictly over this; 7499 means from $75.00, 0 means always, blank means never |
account_id | the expense account it is booked to when the expense names none |
active | inactive categories cannot be chosen any more |
notes | where the numbers came from, and when somebody last checked |
A starter set is seeded, each row citing its source and saying "check with your accountant": client meals (50%, purpose and attendees, receipt over $74.99 -- IRC 274(k) and (n); the 100% restaurant exception covered 2021-2022 only), travel lodging (100%, receipt always), travel transport (100%), travel meals (50%), office supplies (100%), entertainment (0% -- IRC 274(a) after the 2017 amendments) and personal-vehicle mileage (100%, no receipt: the log is the evidence). Finance (role:finance) and admins edit them; everybody signed in can read them.
How a category binds an expense
When an expense is created, recategorised, re-priced, submitted or approved, the category's requirements and deductible share are stamped onto it: receipt_required, purpose_required, attendees_required, deductible_bps, deductible_cents (amount x basis points / 10000, rounded half-up once). Then:
required_whenturns the stamped flags into refusals while the expense is
submitted, approved or billed -- declared, and enforced for every writer.
- The
category_stampslocked check refuses, inside the write lock and for
every writer, stamps that disagree with the category at that moment. The hook stamps writes that come through the API; a writer below it (an import, action_confirm_scan, the mileage handler) stamps with object_expense_rules.category_stamps, the same function.
- Approval freezes the stamps with the rest of the expense (
locked_when).
Editing a category later restates nothing already approved: last year's report says what last year's policy said.
An expense with no category carries no stamps and no new requirement -- every expense written before app-finance 0.19.0 is one. The report calls its amount unclassified rather than guessing.
The receipt
receipt_scan_id points at a scan in app-intake: the photographed or emailed document, whose stored image is the evidence. It is a relation with requires: update, so you can only cite a receipt you may act on, and it is unique: one receipt substantiates one expense. Confirming a scan (action_confirm_scan) links it automatically and takes the category, purpose, attendees and place. Approvers (role:manager) and finance may read scans. The old free-text receipt_ref stays readable for what was recorded before; the requirement reads only the link.
The deductible report
GET /objects/action_expense_report?from=2025-01-01&to=2025-12-31&period=month|quarter|year[&format=csv]
Approved and billed expenses in the range, by period of incurred_on and category: count, amount, deductible, non-deductible and unclassified cents, plus by_category, by_period, totals and gaps -- every expense on the books missing what its stamps required, an approver, or a category. In every row deductible + non-deductible + unclassified = amount. Each caller sees the expenses they may read: a claimant their own, managers and finance the company's.
Accountable-plan timing
Two queues on the home page, counted for each viewer:
- Expenses missing a receipt / a business purpose -- drafts whose
category requires one that is not there yet. They cannot be submitted until it is.
- Expense claims past the accountable-plan window -- drafts and
submitted claims whose incurred_on is at least expenses.accountable_plan_days days ago (an app-settings row; 60 when unset). The wording says "check with your accountant": being late does not by itself make a reimbursement taxable, and the box does not decide that.
Mileage
vehicles--ownershippersonal (the driver's own; business miles are
reimbursed per mile) or business (the company's; trips are logged as evidence of business use and reimburse nothing).
mileage_rates-- one row per calendar year:rate_hundredths_cent(7000 is
70 cents a mile, 6550 is 65.5), source_url, source_date. Nothing is seeded. The IRS announces the business standard mileage rate each year (and has changed it mid-year); look it up, or set your own reimbursement policy, and record where it came from. Approving a trip in a year with no row is refused, naming the year.
mileage_logs-- vehicle, date, odometer at start and end (or the miles),
from, to, business purpose; all required. The miles are worked out from the readings. Refused for every writer: an end reading at or below the start, miles that disagree with the readings, a range overlapping another live trip in the same vehicle (ranges are half-open: a trip may start where the last ended), and an approval not stamped with the year's rate.
Approving a log (somebody other than the driver) stamps the rate and the reimbursement (miles x rate / 100, half-up once). For a personal vehicle, system_mileage_expenses then creates one approved, personally-paid, unbillable expense in the mileage category (generated_from mileage_logs/{id}, unique -- replays create nothing more), owed to the driver. Its journal is posted by system_expense_books when the change-log replay (DBBASIC_ENABLE_CHANGE_DISPATCH) delivers it. Rejecting an approved log rejects that expense, and the books reverse.
Reimbursing above the IRS rate generally makes the excess wages; reimbursing below it is a policy choice. Commuting is not business mileage. Ask your accountant.
Fringe benefits
fringe_benefits is a register, not a calculator: employee, benefit type (the kinds IRS Publication 15-B discusses), period, value_cents, taxable yes/no with no default, valuation_method and source. Finance and admins only -- it is pay information about named people, and the recorder loses access when they leave finance. GET /objects/action_fringe_export?from=&to=[&format=csv] hands the rows whose period overlaps the range to a payroll provider as recorded, with formula-looking cells quoted. Nothing computes a value or withholding. Personal use of a business vehicle is the usual entry; its mileage log is the source to cite.
Year-end checklist
- Every expense category's numbers checked against its source, and notes
dated.
- Every year with trips has a
mileage_ratesrow with a source. - The deductible report for the year has no
gaps, or each one is
explained (a pre-0.19.0 expense categorised by hand, a receipt attached).
- No claims left in the accountable-plan queue, or each one explained.
- The fringe-benefit export reconciled with what payroll reported.
- All of it taken to your accountant, who decides what it means.
tests/test_audit_year_end.py runs this for a made-up year and checks every number by hand.