Expand description
§Beankeeper
Idiomatic, ergonomic library of primitives for professional double-entry accounting.
§Core Invariant
Every core::Transaction enforces the fundamental accounting equation:
total debits must equal total credits.
§Quick Start
use beankeeper::prelude::*;
// Create accounts
let cash = Account::new(
AccountCode::new("1000").unwrap(),
"Cash",
AccountType::Asset,
);
let revenue = Account::new(
AccountCode::new("4000").unwrap(),
"Sales Revenue",
AccountType::Revenue,
);
// Build a balanced transaction
let txn = JournalEntry::new("Sale of goods")
.debit(&cash, Money::usd(500_00))
.unwrap()
.credit(&revenue, Money::usd(500_00))
.unwrap()
.post()
.unwrap();
assert_eq!(txn.description(), "Sale of goods");