# Expenses and spend

> The spend preset installs expense reports with receipts and spend policies, approvals, the approved total and reimbursement on the ledger, and receipt files for AI extraction.

Source: https://bettersupabase.com/docs/presets/spend

The `spend` preset is for an app in the style of Ramp or Expensify. A member
files an expense report with its receipts, the category's spend policy checks
it on submit, an approver decides it, and the reimbursement is paid through
the ledger.

## Config [#config]

```ts title="better-supabase.config.ts"
import { defineConfig } from "better-supabase/config";

export default defineConfig({ preset: "spend" });
```

`npx better-supabase init --preset spend` starts a new project from it, and
`npx better-supabase apply --preset spend` adds it to one you have
([CLI](/docs/cli/presets)).

## Blocks [#blocks]

The preset is [`saas`](/docs/presets#named-presets) plus these blocks, and
whatever they require:

| Block                                   | Role in the app                                               |
| --------------------------------------- | ------------------------------------------------------------- |
| [expenses](/docs/blocks/expenses)       | Reports, lines, categories, spend policies and reimbursements |
| [approvals](/docs/blocks/approvals)     | The approval each submitted report waits on                   |
| [attachments](/docs/blocks/attachments) | Receipt images and PDFs on each line                          |
| [ai-files](/docs/blocks/ai-files)       | Receipt files handed to a model to read the amount and date   |

The expenses block posts on the [ledger](/docs/blocks/ledger), which the
preset installs as one of its requirements.

## How the blocks connect [#how-the-blocks-connect]

`submit` checks each line against its category's spend policy, then the
report waits on its approval. When the approval is final, each category's
total posts on its expense account against the member's payable account, and
`reimburse` settles the payable account from expense cash. Each posting has
a key per report, so it can't post twice, and what the organization owes a
member is a ledger balance ([expenses](/docs/blocks/expenses)).

## With ReUI [#with-reui]

- Data Grid for reports, with Filters on status, category and amount.
- A file upload with a preview of the receipt next to the line form.
- Badge variants for the report status (submitted, approved, reimbursed).