---
title: "Expenses"
description: "Kulukorvaukset ja hyväksynnät. Jokainen sovellus on moduuli samalla tietomallilla."
canonical: "https://obop.dev/fi/apps/expenses/"
lang: "fi"
---

# Expenses

## Mihin se on tarkoitettu

Employees file expense claims that move through draft, submitted, approved and paid. Paying needs its own permission and a human approval; receipts are referenced by note, not stored.

## Mitä paketti tekee ja mitä ei

Employee expense claims with a draft, submitted, approved and paid flow. Paying is a separate permission and needs a human approval; receipts are referenced by note, not stored. A claim has a number from a yearly series, and an employee sees and edits only their own claims; managers and finance see all.

## Moduulin tiedot

- **Versio:** `0.3.0`
- **Tekijä:** SpaceCorps
- **Lisenssi:** [AGPL-3.0-or-later](https://spdx.org/licenses/AGPL-3.0-or-later.html)
- **Vaatii ytimen:** `^0.2` (nykyinen ydin on 0.2.0)
- **Kypsyys:** Beta
- **Luokat:** Talous, Ihmiset

## Mallit

### `expenses_expense`

An amount an employee spent for the business and wants reimbursed

Lukuryhmä: `expenses.user`. Kirjoitusryhmä: `expenses.user`.

| Kenttä | Tyyppi | Tietoluokka | Henkilötieto | Ryhmä | Agentit näkevät | Kuvaus |
|---|---|---|---|---|---|---|
| `number` | sequence | `none` | ei | `expenses.user` | selkoisena | Claim number such as EXP-2026-0042, assigned when the claim is created; the series starts again each year |
| `description` | text | `none` | ei | `expenses.user` | selkoisena | What the money was spent on |
| `employee` | text | `internal` | kyllä | `expenses.user` | maskattu | User name of the person claiming the expense; the person who creates the claim unless set otherwise |
| `spent_on` | date | `none` | ei | `expenses.user` | selkoisena | Date of the purchase (YYYY-MM-DD) |
| `category` | select (travel, meals, lodging, supplies, software, other) | `none` | ei | `expenses.user` | selkoisena | Expense category: travel, meals, lodging, supplies, software, other |
| `amount` | money | `financial` | kyllä | `expenses.user` | pidätetty | Amount owed to the employee (minor currency units, e.g. cents) |
| `currency` | text | `none` | ei | `expenses.user` | selkoisena | ISO 4217 currency code, for example EUR |
| `receipt_note` | longtext | `none` | ei | `expenses.user` | selkoisena | Where the receipt is kept and what it shows |
| `paid_on` | date | `financial` | kyllä | `expenses.finance` | pidätetty | Date the employee was reimbursed (YYYY-MM-DD) |
| `payment_reference` | text | `financial` | kyllä | `expenses.finance` | pidätetty | Bank transfer reference of the reimbursement |
| `state` | select (draft, submitted, approved, paid, refused) | `none` | ei | `expenses.user` | selkoisena | Claim status: draft, submitted, approved, paid, refused |

## Työnkulut

### `expenses_expense`

| Toiminto | Siirtää | Kuka voi suorittaa | Hyväksyntä |
|---|---|---|---|
| `expenses_expense.submit` | state: draft → submitted | `expenses.user` | ei |
| `expenses_expense.approve` | state: submitted → approved | `expenses.manager` | ei |
| `expenses_expense.pay` | state: approved → paid | `expenses.finance` | kyllä |
| `expenses_expense.refuse` | state: submitted → refused | `expenses.manager` | ei |

## Käyttöoikeusryhmät

Tämän sovelluksen käyttämät ryhmät:

- `expenses.finance`
- `expenses.manager`
- `expenses.user`

## Hyväksyntävaiheet

Vaiheet, joita agentti voi vain ehdottaa:

- `expenses_expense.pay`

## Mitä agentit voivat ja eivät voi tehdä

Agentti voi lukea, hakea, luoda ja päivittää tämän sovelluksen tietueita sekä suorittaa toiminnot, jotka eivät vaadi hyväksyntää, tunnisteensa käyttöoikeusryhmien rajoissa.

Se voi vain ehdottaa näitä vaiheita, ja ihmisen on hyväksyttävä ne: `expenses_expense.pay`, `expenses_expense.delete`.

Henkilötiedot maskataan paikkamerkeiksi: `expenses_expense.employee`.

Nämä kentät pidätetään agenteilta kokonaan: `expenses_expense.amount`, `expenses_expense.paid_on`, `expenses_expense.payment_reference`.

## Riippuvuudet

Ei ole.

## Asennus

Asenna se Customize-sovelluksesta (Marketplace) tai komentoriviltä:

```bash
obop modules install-from expenses
```

Vaatii tietokannan ja ylläpitäjän oikeudet.

## Tee oma

[Moduulioppaassa näytetään, miten tällaiset sovellukset kirjoitetaan](/fi/docs/reference/module-manifest/)
