# Beancount 치트 시트

## 예시 계정명

```bean
Assets:US:BofA:Checking
```

## 계정 유형

```bean
Assets          +
Liabilities     -
Income          -
Expenses        +
Equity          -
```

## 상품

```bean
CNY, EUR, CAD, AUD
GOOG, AAPL, RBF1005
HOME_MAYST, AIRMILES
HOURS
```

## 지시문

일반 구문

```bean
YYYY-MM-DD <Directive> <Parameters...>
```

## 계정 개설 및 종료

```bean
2001-05-29 open Expenses:Restaurant
2001-05-29 open Assets:Checking     USD,EUR  ; 통화 제약

2015-04-23 close Assets:Checking
```

## 상품 선언 (선택 사항)

```bean
1998-07-22 commodity AAPL
  name: "Apple Computer Inc."
```

## 가격

```bean
2015-04-30 price AAPL   125.15 CNY
2015-05-30 price AAPL   130.28 CNY
```

## 메모

```bean
2013-03-20 note Assets:Checking "Called to ask about rebate"
```

## 문서

```bean
2013-03-20 document Assets:Checking "path/to/statement.pdf"
```

## 거래

```bean
2015-05-30 * "Some narration about this transaction"
  Liabilities:CreditCard   -101.23 CNY
  Expenses:Restaurant       101.23 CNY

2015-05-30 ! "Cable Co" "Phone Bill" #tag ˆlink
  id: "TW378743437"               ; 메타데이터
  Expenses:Home:Phone  87.45 CNY
  Assets:Checking                 ; 금액을 하나 생략할 수 있습니다
```

## 포스팅

```bean
  ...    123.45 USD                             Simple
  ...        10 GOOG {502.12 USD}               With per-unit cost
  ...        10 GOOG {{5021.20 USD}}            With total cost
  ...        10 GOOG {502.12 # 9.95 USD}        With both costs
  ...   1000.00 USD   @ 1.10 CAD                With per-unit price
  ...        10 GOOG {502.12 USD} @ 1.10 CAD    With cost & price
  ...        10 GOOG {502.12 USD, 2014-05-12}   With date
  ! ...   123.45 USD ...                        With flag
```

## 잔액 검증 및 패딩

```bean
; Asserts the amount for only the given currency:
2015-06-01 balance Liabilities:CreditCard  -634.30 CNY

; Automatic insertion of transaction to fulfill the following assertion:
2015-05-31 pad Liabilities:CreditCard Equity:Opening-Balances
```

## 이벤트

```bean
2015-06-01 event "location" "New York, USA"
2015-06-30 event "address" "123 May Street"
```

## 옵션

```bean
option "title" "My Personal Ledger"
```

## 기타

```bean
pushtag #trip-to-peru
...
poptag  #trip-to-peru
; 주석은 세미콜론으로 시작합니다
```
