Calm motion: animations on this site only fade, with no movement
Journal entry
Debit and credit lines that must balance before the entry can be saved
Records one money event in the books of an accounting or ERP app. In double-entry bookkeeping, each event changes two or more accounts, and the debits must equal the credits.
Basic
| Account | Debit | Credit | Memo | |
|---|---|---|---|---|
| Total | Rp 3.330.000 | Rp 3.000.000 | ||
Not balanced: Rp 330.000 more on the debit side
accountsis the chart of accounts. Each account has acodeand aname.v-modelis the list of lines. Each line has anid, anaccountcode, adebitor acredit, and an optionalmemo.- A line is a debit or a credit. If you type an amount in one column, the other column of that line clears.
- The table ends with the total of each side. A status line says "Balanced", or how much more is on one side. Screen readers hear it after each change.
- "Post the entry" emits
post. It is off until the sides are equal and at least two lines have an account. - The sums use whole cents, so 0.1 + 0.2 equals 0.3.
currencyis an ISO 4217 code (defaultUSD), andlocalesets the format. Change the words withlabelsor a label pack. The API table lists the keys.
The journalTotals function adds up the lines. It is exported for your own views.
Usage
ts
import { BlessJournalEntry } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
accounts* | { code: string; name: string; }[] | — | |
currency | string | "USD" | |
locale | string | "en" | |
labels | Partial<{ title: string; account: string; debit: string; credit: string; memo: string; pick: string; add: string; remove: (row: number) => string; field: (what: string, row: number) => string; total: string; balanced: string; off: (amount: string, side: string) => string; post: string; }> | — | |
modelValue | BlessJournalLine[] | [] |
Events
| Name | Payload | Description |
|---|---|---|
update:modelValue | [value: BlessJournalLine[]] | |
post | [lines: BlessJournalLine[]] |