Skip to content
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
AccountDebitCreditMemo
TotalRp 3.330.000Rp 3.000.000

Not balanced: Rp 330.000 more on the debit side

  • accounts is the chart of accounts. Each account has a code and a name.
  • v-model is the list of lines. Each line has an id, an account code, a debit or a credit, and an optional memo.
  • 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.
  • currency is an ISO 4217 code (default USD), and locale sets the format. Change the words with labels or 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

NameTypeDefaultDescription
accounts*{ code: string; name: string; }[]—
currencystring"USD"
localestring"en"
labelsPartial<{ 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; }>—
modelValueBlessJournalLine[][]

Events

NamePayloadDescription
update:modelValue[value: BlessJournalLine[]]
post[lines: BlessJournalLine[]]

Released under the MIT License. Character names and artwork belong to their owners.