Beancount.Directives.Pad (beancount_ex v0.6.0)

Copy Markdown View Source

The pad directive inserts an automatic balancing transaction before the next balance assertion on an account.

See Pad.

Beancount syntax

2025-12-20 pad Assets:Cash Equity:Opening

General form: YYYY-MM-DD pad Account SourceAccount

Beancount generates a transaction between account and source_account so the next balance on account can succeed.

Elixir struct

%Beancount.Directives.Pad{
  date: ~D[2025-12-20],
  account: "Assets:Cash",
  source_account: "Equity:Opening",
  metadata: %{}
}

Or use Beancount.pad/4:

Beancount.pad(~D[2025-12-20], "Assets:Cash", "Equity:Opening")

Fields

  • date - Date.t() from which the pad is active until the next balance on account.
  • account - account to pad (must later have a balance directive).
  • source_account - offset account for the generated padding transaction.
  • metadata - optional map rendered below the directive.

Summary

Types

t()

@type t() :: %Beancount.Directives.Pad{
  account: String.t(),
  date: Date.t(),
  metadata: map(),
  source_account: String.t()
}