clerk/tests/journal/actual-borrowing.journal (view raw)
| 1 | ; source: hledger/examples/borrowing.journal |
| 2 | ; some simple borrowing and lending transactions |
| 3 | |
| 4 | ; money to be repaid to others is a liability, usually called "accounts payable" |
| 5 | |
| 6 | 1/1 borrow from alice |
| 7 | assets:cash 10 |
| 8 | liabilities:payable:alice -10 |
| 9 | |
| 10 | 1/2 repay alice |
| 11 | assets:cash -10 |
| 12 | liabilities:payable:alice 10 = 0 ; optional balance assertion showing alice is fully repaid |
| 13 | |
| 14 | ; money to be repaid to you is an asset, usually called "accounts receivable" |
| 15 | |
| 16 | 1/3 lend to bob |
| 17 | assets:cash ; omitting the second amount this time |
| 18 | assets:receivable:bob 25 |
| 19 | |
| 20 | 1/4 receive repayment from bob |
| 21 | assets:cash |
| 22 | assets:receivable:bob -25 = 0 ; balance assertion showing no more money is due from bob |
| 23 | |
| 24 | ; a loan with interest and late fees |
| 25 | |
| 26 | 2/1 assume some money in checking at the start |
| 27 | (assets:bank:checking) 30 |
| 28 | |
| 29 | 2/1 borrow from bank |
| 30 | liabilities:payable:bank |
| 31 | assets:bank:checking 1000 |
| 32 | |
| 33 | 3/1 a bank repayment |
| 34 | liabilities:payable:bank 97 = -903 |
| 35 | expenses:interest:bank 3 |
| 36 | assets:bank:checking -100 |
| 37 | |
| 38 | 4/15 a bank repayment, late |
| 39 | liabilities:payable:bank 97 = -806 |
| 40 | expenses:interest:bank 3 |
| 41 | assets:bank:checking -100 |
| 42 | |
| 43 | 5/1 repay bank in full |
| 44 | liabilities:payable:bank 806 = 0 |
| 45 | expenses:interest:bank 3 |
| 46 | expenses:late fees:bank 15 |
| 47 | assets:bank:checking |