SlideShare a Scribd company logo
1 of 31
Download to read offline
1
ledgerで経理
Tobias Pfeiffer
tgp@preferred.jp
2 . 1
Self-Introduction
Tobias Pfeiffer, Software Engineer @ PFN
Joined PFI in April 2014, moved to PFN in October 2014
Recently worked on: Stream
processing engine, CES demo
Hobbies
Last year: Wedding planning →
Also: Cooking
2 . 2
Today's Topic: Background & Motivation
Not related to work tasks
Not at all an expert or very knowledgeable in the field
(But: Everyone uses money, so needs to manage it.)
Motivation
Household CFO
Until now: LibreOffice & various spreadsheets
One Problem: LibreOffice
Another problem: Merging data sources
Recently discovered ledgerand gave it a try
3 . 1
Accounting
3 . 2
Why Accounting?
For companies: usually required by law
(to calculate taxes, inform shareholders etc.)
For private persons/households:
Locate and track: How much do you get (from
where), how much do you have (where), how much
do you spend (how)?
Manage: Pay your bills on time.
Optimize: What can you do to improve the
situation?
Plan: What can you afford and when?
3 . 3
Double-Entry Accounting (複式簿記)
Published in 1494 (Luca Pacioli: Summa de arithmetica)
Concept: Maintain multiple books (”accounts”) and
record every transaction in two books
  Cash in Wallet     Food expenses   
Amount   Balance   Amount  Balance   
-750 JPY 2,307 JPY 750 JPY 43,108 JPY
-120 JPY 2,187 JPY 120 JPY 43,228 JPY
        Salary               Bank account     
Amount      Balance      Amount     Balance   
-12,345 JPY -246,789 JPY 12,345 JPY 14,679 JPY
3 . 4
Double-Entry Accounting (2)
Notes
In the real world, this is more complex. (Why??)
Observations
The sum of amounts is zero in every transaction.
The sum of balances is zero across all accounts.
Advantages
Location of money is immediately observable.
A lot of “virtual accounts” can be added for fine-
grained reporting.
Invoice date and payment date can be different.
3 . 5
Account Structure
Common structure
Income (収入): where money comes from
Expenses (費用): where money goes to
Assets (資産): where money is
Liabilities (負債): money you owe
Equity (資本?): “the real value of your property”
Examples:
Income»Salary (will get more and more negative)
Expenses»Food (will get more and more positive)
Assets»Cash, Assets»Bank Account
Liabilities»Credit Card
4 . 1
About ledger
4 . 2
Basic Usage
4 . 3
Concept
Maintain a plain text file with your transactions.
(Such a list of transactions is a “ledger”/原簿.)
Plain text: Possible to have it in git, encrypt it, print
it, copy & paste, edit it with scripts, …
Execute ledgeron that file for reporting.
ledgerchecks that everything balances and
computes the numbers for the report.
In particular, ledgeris not a tool to enter
transactions!
4 . 4
Input Format
General format: For example:
date payee
; note
account 1 amount
account 2 amount
2016-02-25 Lawson
; Ham Sandwich
Expenses:Food 325 JPY
Assets:Cash -325 JPY
ledgeralso allows:
One posting without
amount
More than two postings
(must add up to zero)
2016-02-25 Lawson
Expenses:Food 325 JPY
Assets:Cash
2016-02-25 Lawson
Expenses:Food 301 JPY
Expenses:Taxes 24 JPY
Assets:Cash -325 JPY
4 . 5
Balance (残高) Report
ledgercan compute the balance on each account.
Input file: $ ledger balance
(The input file name is passed
with -for the LEDGER_FILE
environment variable.)
2016-02-20 Company
Assets:Bank 123,456 JPY
Income:Salary
2016-02-22 Bank
Assets:Cash 20,000 JPY
Assets:Bank
2016-02-26 Landlord
Expenses:Rent 70,000 JPY
Assets:Bank
2016-02-27 Supermarket
Expenses:Food 2,017 JPY
Assets:Cash
51,439 JPY Assets
33,456 JPY Bank
17,983 JPY Cash
72,017 JPY Expenses
2,017 JPY Food
70,000 JPY Rent
-123,456 JPY Income:Salary
--------------------
0
4 . 6
Register Report
ledgercan display all transaction for an account with a
running total.
$ ledger register Cash
16-Feb-22 Bank Assets:Cash 20,000 JPY 20,000 JPY
16-Feb-25 Lawson Assets:Cash -325 JPY 19,675 JPY
16-Feb-27 Supermarket Assets:Cash -2,017 JPY 17,658 JPY
16-Mar-01 Lawson Assets:Cash -288 JPY 17,370 JPY
$ ledger --period "feb 2016" register Food
16-Feb-25 Lawson Expenses:Food 325 JPY 325 JPY
16-Feb-27 Supermarket Expenses:Food 2,017 JPY 2,342 JPY
4 . 7
Other Reports
Some other commands
equity: collapse all transactions into a single one
xml, csv: list transactions in other formats
xact: create a new transaction from a pattern
Some parameters
--period, --begin, --end: date limit
--strict: check that all used entities exist
all commands take a regular expression to filter
accounts
4 . 8
Example Use Patterns
4 . 9
Dealing With Cash
Problem: Tracking all the little cash expenses
One possible solution: Pay as much as possible using
credit card, and treat cash as “Expense”, not “Asset”.
To track an “important” expense, move money from
Expenses:Cash to the target account:
2016-03-02 ATM
Expenses:Cash 10,000 JPY
Assets:Bank
2016-03-05 Expensive Restaurant
Expenses:Eat Out 8,000 JPY
Expenses:Cash
4 . 10
Dealing With Cash (2)
If you do track your cash expenses (collecting receipts
or using some app), at some point target/actual check
(reconciliation) needs to be done.
For checks, balance assertions can be used.
To correct the amount, balance resets can be used.
2016-03-05 Check balance
; ledger run will fail if we don't have 123 JPY
Assets:Cash = 123 JPY
2016-03-06 Correct balance
; take from Expenses:Loss what is required to get to 123 JPY
Assets:Cash = 123 JPY
Expenses:Loss
4 . 11
Delayed Payments
$ ledger balance
$ ledger balance
When paying a purchase with a credit card, the
payment is done later. However, there is a liability
towards the credit card operator:
Later, the liabilities must be paid back:
2016-02-15 Amazon
Expenses:Books 780 JPY
Liabilities:Credit Card
780 JPY Expenses:Books
-780 JPY Liabilities:Credit Card
---------
0
2016-02-15 Amazon
Expenses:Books 780 JPY
Liabilities:Credit Card
2016-03-27 Pay Invoice
Liabilities:Credit Card 780 JPY
Assets:Bank
-780 JPY Assets:Bank
780 JPY Expenses:Books
---------
0
4 . 12
Tracking Reimbursements
$ ledger balance
$ ledger balance
When paying something on behalf of the company, it is
the other way around, the company owes you money:
If you hand in the receipts properly, the money will be
reimbursed next month:
2016-02-17 Taxi
; no bus in inaka
Liabilities:PFN 3,020 JPY
Assets:Cash
-3,020 JPY Assets:Cash
3,020 JPY Liabilities:PFN
-------------
0
2016-02-17 Taxi
Liabilities:PFN 3,020 JPY
Assets:Cash
2016-03-20 PFN
Assets:Bank 126,476 JPY
Liabilities:PFN -3,020 JPY
Income:Salary -123,456 JPY
123,456 JPY Assets
126,476 JPY Bank
-3,020 JPY Cash
-123,456 JPY Income:Salary
-------------
0
4 . 13
Advanced Features
4 . 14
Currencies/Commodities
$ ledger balance fridge
$ ledger prices
$ ledger balance -X JPY Bank
A “currency” is just any string. You could also do
inventory tracking using ledger:
Currencies can also be exchanged into one another
with exchange rate computation…
… or manually given:
2016-02-29 Shopping day
Fridge
Supermarket -2 Apples
Konbini -3 Beers
2 Apples
3 Beers Fridge
2016-02-29 ATM @ Europe
Assets:Cash 50 EUR
Assets:Bank -6,258 JPY
2016/02/29 EUR 125.16 JPY
2016-02-29 ATM @ Europe
Assets:Cash 50 EUR @ 125 JPY
Assets:Bank
JPY-6250 Assets:Bank
4 . 15
Stock
$ ledger balance brokerage
$ cat prices.db $ ledger --market --price-db
prices.db balance brokerage
$ ledger --gain --price-db
prices.db balance brokerage
Stocks can also be treated like currencies.
If you maintain a price history, you can find out current
value of your stock.
2015-05-04 Buy Stock
Assets:Brokerage 10 BMW
Assets:Bank -1,067.50 EUR
2015-09-24 Buy Stock
Assets:Brokerage 15 BMW
Assets:Bank -1,135.20 EUR
25 BMW Assets:Brokerage
P 2015/05/04 BMW 106.75 EUR
P 2015/09/24 BMW 75.68 EUR
P 2016/03/04 BMW 82.63 EUR
2,065.75 EUR Assets:Brokerage
-136.95 EUR Assets:Brokerage
4 . 16
Metadata
ledgerallows to attach metadata to transactions,
such as effective dates, IDs, clearing state, and tags.
The meaning of metadata is completely up to the user.
Use the data when querying:
$ ledger --effective balance
$ ledger --pending|--cleared register
$ ledger register tag manga
$ ledger register tag ShipmentDate < [2016-02-20]
2016-02-15=2016-03-27 ! (123-7654) Rakuten
Expenses:Books 780 JPY ; payee: HappyBooks 123
Expenses:Household 2,350 JPY ; payee: MyHousehold
Liabilities:Credit Card
; :OnlineShopping:Manga:
; ShippingMethod: deliver to home address
; ShipmentDate:: [2016-02-16]
4 . 17
Budgeting
Set up a budget and compare it against real expenses.
~ Monthly
Expenses:Eat Out 10,000 JPY
Assets:Cash
2016-02-14 Izakaya
Expenses:Eat Out 3,723 JPY
Assets:Cash
2016-02-28 Medium Restaurant
Expenses:Eat Out 5,182 JPY
Assets:Cash
2016-03-04 Expensive Restaurant
Expenses:Eat Out 12,300 JPY
Assets:Cash
$ ledger --monthly --budget register Expenses
16-Feb-01 - 16-Feb-29 Expenses:Eat Out -1,095 JPY -1,095 JPY
16-Mar-01 - 16-Mar-31 Expenses:Eat Out 2,300 JPY 1,205 JPY
4 . 18
Forecasting
Set up a budget and forecast your financial situation.
~ Monthly
Expenses:Eat Out 10,000 JPY
Expenses:Food 15,000 JPY
Expenses:Rent 70,000 JPY
Income:Salary -123,456 JPY
Assets
$ ledger --monthly --forecast "d < [2016-09]" register Assets
16-Apr-01 - 16-Apr-30 Assets 28,456 JPY 28,456 JPY
16-May-01 - 16-May-31 Assets 28,456 JPY 56,912 JPY
16-Jun-01 - 16-Jun-30 Assets 28,456 JPY 85,368 JPY
16-Jul-01 - 16-Jul-31 Assets 28,456 JPY 113,824 JPY
16-Aug-01 - 16-Aug-31 Assets 28,456 JPY 142,280 JPY
4 . 19
The ledgerEcosystem
4 . 20
Related Tools
Forks
(Haskell)
(Python)
and more …
Tools to add transactions
native GnuCash import
(or roll your own using the Python API)
hledger
beancount
ledgerhelpers
tools to import CSV
tools to import OFX
emacs Integration
ledger-modeprovides syntax highlighting, tab
completion, integrated reports etc.
4 . 214 . 22
Features Not Presented Today
Automatic transactions
Python integration
Advanced stock valuation
Report formatting
4 . 23
Summary
ledgerhelps you track your money, stock, and
(optionally) apples.
Powerful reporting commands allow to detect
spending patterns and plan for future expenses.
A number of tools help to get data in and out of your
ledgerfiles.

More Related Content

Viewers also liked

20130116_pfiseminar_gwas_postgwas
20130116_pfiseminar_gwas_postgwas20130116_pfiseminar_gwas_postgwas
20130116_pfiseminar_gwas_postgwas
Preferred Networks
 

Viewers also liked (20)

PFIセミナーH271022 ~コマンドを叩いて遊ぶ コンテナ仮想、その裏側~
PFIセミナーH271022 ~コマンドを叩いて遊ぶ コンテナ仮想、その裏側~PFIセミナーH271022 ~コマンドを叩いて遊ぶ コンテナ仮想、その裏側~
PFIセミナーH271022 ~コマンドを叩いて遊ぶ コンテナ仮想、その裏側~
 
Amazon Picking Challenge 結果報告
Amazon Picking Challenge 結果報告Amazon Picking Challenge 結果報告
Amazon Picking Challenge 結果報告
 
先取り Go1.5
先取り Go1.5先取り Go1.5
先取り Go1.5
 
More modern gpu
More modern gpuMore modern gpu
More modern gpu
 
対話における商品の営業
対話における商品の営業対話における商品の営業
対話における商品の営業
 
Deep Learningと自然言語処理
Deep Learningと自然言語処理Deep Learningと自然言語処理
Deep Learningと自然言語処理
 
ディープラーニングが活かすIoT
ディープラーニングが活かすIoTディープラーニングが活かすIoT
ディープラーニングが活かすIoT
 
ディープラーニングの最新動向
ディープラーニングの最新動向ディープラーニングの最新動向
ディープラーニングの最新動向
 
20130116_pfiseminar_gwas_postgwas
20130116_pfiseminar_gwas_postgwas20130116_pfiseminar_gwas_postgwas
20130116_pfiseminar_gwas_postgwas
 
PFI会社案内
PFI会社案内PFI会社案内
PFI会社案内
 
Pfiセミナー20131128
Pfiセミナー20131128Pfiセミナー20131128
Pfiセミナー20131128
 
ACL読み会2014@PFI "Two Knives Cut Better Than One: Chinese Word Segmentation w...
ACL読み会2014@PFI  "Two Knives Cut Better Than One: Chinese Word Segmentation w...ACL読み会2014@PFI  "Two Knives Cut Better Than One: Chinese Word Segmentation w...
ACL読み会2014@PFI "Two Knives Cut Better Than One: Chinese Word Segmentation w...
 
rcast_20140411
rcast_20140411rcast_20140411
rcast_20140411
 
Chainerで流体計算
Chainerで流体計算Chainerで流体計算
Chainerで流体計算
 
Jubatusハンズオン資料
Jubatusハンズオン資料Jubatusハンズオン資料
Jubatusハンズオン資料
 
Jubatusで始める機械学習/セキュリティと機械学習
Jubatusで始める機械学習/セキュリティと機械学習Jubatusで始める機械学習/セキュリティと機械学習
Jubatusで始める機械学習/セキュリティと機械学習
 
Response Summarizer: An Automatic Summarization System of Call Center Convers...
Response Summarizer: An Automatic Summarization System of Call Center Convers...Response Summarizer: An Automatic Summarization System of Call Center Convers...
Response Summarizer: An Automatic Summarization System of Call Center Convers...
 
Generation of 3D-avatar animation from latent representations
Generation of 3D-avatar animation from latent representationsGeneration of 3D-avatar animation from latent representations
Generation of 3D-avatar animation from latent representations
 
Deep Learning in real world @Deep Learning Tokyo
Deep Learning in real world @Deep Learning TokyoDeep Learning in real world @Deep Learning Tokyo
Deep Learning in real world @Deep Learning Tokyo
 
ディープラーニングと自動運転、コネクティッドカー @ TU-Automotive 2016
ディープラーニングと自動運転、コネクティッドカー @ TU-Automotive 2016ディープラーニングと自動運転、コネクティッドカー @ TU-Automotive 2016
ディープラーニングと自動運転、コネクティッドカー @ TU-Automotive 2016
 

Similar to ledgerで経理

Chapter 02 Financial Background A Review Of Accounting, Financial Statements...
Chapter 02 Financial Background  A Review Of Accounting, Financial Statements...Chapter 02 Financial Background  A Review Of Accounting, Financial Statements...
Chapter 02 Financial Background A Review Of Accounting, Financial Statements...
Alamgir Alwani
 

Similar to ledgerで経理 (20)

Understanding Your Financial Statements
Understanding Your Financial StatementsUnderstanding Your Financial Statements
Understanding Your Financial Statements
 
Cash book
Cash bookCash book
Cash book
 
Acctg fundamentals
Acctg fundamentalsAcctg fundamentals
Acctg fundamentals
 
Financial Accounting by Maliha Tahir 07
Financial  Accounting by Maliha Tahir 07Financial  Accounting by Maliha Tahir 07
Financial Accounting by Maliha Tahir 07
 
Introduction to Financial Statments
Introduction to Financial Statments Introduction to Financial Statments
Introduction to Financial Statments
 
Maximizing QuickBooks
Maximizing QuickBooksMaximizing QuickBooks
Maximizing QuickBooks
 
accounting-technician-major-college (1).pptx
accounting-technician-major-college (1).pptxaccounting-technician-major-college (1).pptx
accounting-technician-major-college (1).pptx
 
Chapter02
Chapter02Chapter02
Chapter02
 
Accounting basics
Accounting basicsAccounting basics
Accounting basics
 
Accounting basics1
Accounting basics1Accounting basics1
Accounting basics1
 
ANALYZING TRANSACTIONS INTO DEBIT AND CREDIT PARTS.docx
ANALYZING TRANSACTIONS  INTO DEBIT AND CREDIT PARTS.docxANALYZING TRANSACTIONS  INTO DEBIT AND CREDIT PARTS.docx
ANALYZING TRANSACTIONS INTO DEBIT AND CREDIT PARTS.docx
 
Chap004
Chap004Chap004
Chap004
 
Chap004
Chap004Chap004
Chap004
 
Accountants Formula
Accountants FormulaAccountants Formula
Accountants Formula
 
Branches of account
Branches of accountBranches of account
Branches of account
 
חשבונאות עקרונות של שכר הנהלת חשבונות - איל הורוביץ
 חשבונאות עקרונות של שכר הנהלת חשבונות - איל הורוביץ חשבונאות עקרונות של שכר הנהלת חשבונות - איל הורוביץ
חשבונאות עקרונות של שכר הנהלת חשבונות - איל הורוביץ
 
accounting information system
accounting information systemaccounting information system
accounting information system
 
HASEEB -
HASEEB - HASEEB -
HASEEB -
 
2.JOURNAL.ppt
2.JOURNAL.ppt2.JOURNAL.ppt
2.JOURNAL.ppt
 
Chapter 02 Financial Background A Review Of Accounting, Financial Statements...
Chapter 02 Financial Background  A Review Of Accounting, Financial Statements...Chapter 02 Financial Background  A Review Of Accounting, Financial Statements...
Chapter 02 Financial Background A Review Of Accounting, Financial Statements...
 

More from Preferred Networks

More from Preferred Networks (20)

PodSecurityPolicy からGatekeeper に移行しました / Kubernetes Meetup Tokyo #57
PodSecurityPolicy からGatekeeper に移行しました / Kubernetes Meetup Tokyo #57PodSecurityPolicy からGatekeeper に移行しました / Kubernetes Meetup Tokyo #57
PodSecurityPolicy からGatekeeper に移行しました / Kubernetes Meetup Tokyo #57
 
Optunaを使ったHuman-in-the-loop最適化の紹介 - 2023/04/27 W&B 東京ミートアップ #3
Optunaを使ったHuman-in-the-loop最適化の紹介 - 2023/04/27 W&B 東京ミートアップ #3Optunaを使ったHuman-in-the-loop最適化の紹介 - 2023/04/27 W&B 東京ミートアップ #3
Optunaを使ったHuman-in-the-loop最適化の紹介 - 2023/04/27 W&B 東京ミートアップ #3
 
Kubernetes + containerd で cgroup v2 に移行したら "failed to create fsnotify watcher...
Kubernetes + containerd で cgroup v2 に移行したら "failed to create fsnotify watcher...Kubernetes + containerd で cgroup v2 に移行したら "failed to create fsnotify watcher...
Kubernetes + containerd で cgroup v2 に移行したら "failed to create fsnotify watcher...
 
深層学習の新しい応用と、 それを支える計算機の進化 - Preferred Networks CEO 西川徹 (SEMICON Japan 2022 Ke...
深層学習の新しい応用と、 それを支える計算機の進化 - Preferred Networks CEO 西川徹 (SEMICON Japan 2022 Ke...深層学習の新しい応用と、 それを支える計算機の進化 - Preferred Networks CEO 西川徹 (SEMICON Japan 2022 Ke...
深層学習の新しい応用と、 それを支える計算機の進化 - Preferred Networks CEO 西川徹 (SEMICON Japan 2022 Ke...
 
Kubernetes ControllerをScale-Outさせる方法 / Kubernetes Meetup Tokyo #55
Kubernetes ControllerをScale-Outさせる方法 / Kubernetes Meetup Tokyo #55Kubernetes ControllerをScale-Outさせる方法 / Kubernetes Meetup Tokyo #55
Kubernetes ControllerをScale-Outさせる方法 / Kubernetes Meetup Tokyo #55
 
Kaggle Happywhaleコンペ優勝解法でのOptuna使用事例 - 2022/12/10 Optuna Meetup #2
Kaggle Happywhaleコンペ優勝解法でのOptuna使用事例 - 2022/12/10 Optuna Meetup #2Kaggle Happywhaleコンペ優勝解法でのOptuna使用事例 - 2022/12/10 Optuna Meetup #2
Kaggle Happywhaleコンペ優勝解法でのOptuna使用事例 - 2022/12/10 Optuna Meetup #2
 
最新リリース:Optuna V3の全て - 2022/12/10 Optuna Meetup #2
最新リリース:Optuna V3の全て - 2022/12/10 Optuna Meetup #2最新リリース:Optuna V3の全て - 2022/12/10 Optuna Meetup #2
最新リリース:Optuna V3の全て - 2022/12/10 Optuna Meetup #2
 
Optuna Dashboardの紹介と設計解説 - 2022/12/10 Optuna Meetup #2
Optuna Dashboardの紹介と設計解説 - 2022/12/10 Optuna Meetup #2Optuna Dashboardの紹介と設計解説 - 2022/12/10 Optuna Meetup #2
Optuna Dashboardの紹介と設計解説 - 2022/12/10 Optuna Meetup #2
 
スタートアップが提案する2030年の材料開発 - 2022/11/11 QPARC講演
スタートアップが提案する2030年の材料開発 - 2022/11/11 QPARC講演スタートアップが提案する2030年の材料開発 - 2022/11/11 QPARC講演
スタートアップが提案する2030年の材料開発 - 2022/11/11 QPARC講演
 
Deep Learningのための専用プロセッサ「MN-Core」の開発と活用(2022/10/19東大大学院「 融合情報学特別講義Ⅲ」)
Deep Learningのための専用プロセッサ「MN-Core」の開発と活用(2022/10/19東大大学院「 融合情報学特別講義Ⅲ」)Deep Learningのための専用プロセッサ「MN-Core」の開発と活用(2022/10/19東大大学院「 融合情報学特別講義Ⅲ」)
Deep Learningのための専用プロセッサ「MN-Core」の開発と活用(2022/10/19東大大学院「 融合情報学特別講義Ⅲ」)
 
PFNにおける研究開発(2022/10/19 東大大学院「融合情報学特別講義Ⅲ」)
PFNにおける研究開発(2022/10/19 東大大学院「融合情報学特別講義Ⅲ」)PFNにおける研究開発(2022/10/19 東大大学院「融合情報学特別講義Ⅲ」)
PFNにおける研究開発(2022/10/19 東大大学院「融合情報学特別講義Ⅲ」)
 
自然言語処理を 役立てるのはなぜ難しいのか(2022/10/25東大大学院「自然言語処理応用」)
自然言語処理を 役立てるのはなぜ難しいのか(2022/10/25東大大学院「自然言語処理応用」)自然言語処理を 役立てるのはなぜ難しいのか(2022/10/25東大大学院「自然言語処理応用」)
自然言語処理を 役立てるのはなぜ難しいのか(2022/10/25東大大学院「自然言語処理応用」)
 
Kubernetes にこれから入るかもしれない注目機能!(2022年11月版) / TechFeed Experts Night #7 〜 コンテナ技術を語る
Kubernetes にこれから入るかもしれない注目機能!(2022年11月版) / TechFeed Experts Night #7 〜 コンテナ技術を語るKubernetes にこれから入るかもしれない注目機能!(2022年11月版) / TechFeed Experts Night #7 〜 コンテナ技術を語る
Kubernetes にこれから入るかもしれない注目機能!(2022年11月版) / TechFeed Experts Night #7 〜 コンテナ技術を語る
 
Matlantis™のニューラルネットワークポテンシャルPFPの適用範囲拡張
Matlantis™のニューラルネットワークポテンシャルPFPの適用範囲拡張Matlantis™のニューラルネットワークポテンシャルPFPの適用範囲拡張
Matlantis™のニューラルネットワークポテンシャルPFPの適用範囲拡張
 
PFNのオンプレ計算機クラスタの取り組み_第55回情報科学若手の会
PFNのオンプレ計算機クラスタの取り組み_第55回情報科学若手の会PFNのオンプレ計算機クラスタの取り組み_第55回情報科学若手の会
PFNのオンプレ計算機クラスタの取り組み_第55回情報科学若手の会
 
続・PFN のオンプレML基盤の取り組み / オンプレML基盤 on Kubernetes 〜PFN、ヤフー〜 #2
続・PFN のオンプレML基盤の取り組み / オンプレML基盤 on Kubernetes 〜PFN、ヤフー〜 #2続・PFN のオンプレML基盤の取り組み / オンプレML基盤 on Kubernetes 〜PFN、ヤフー〜 #2
続・PFN のオンプレML基盤の取り組み / オンプレML基盤 on Kubernetes 〜PFN、ヤフー〜 #2
 
Kubernetes Service Account As Multi-Cloud Identity / Cloud Native Security Co...
Kubernetes Service Account As Multi-Cloud Identity / Cloud Native Security Co...Kubernetes Service Account As Multi-Cloud Identity / Cloud Native Security Co...
Kubernetes Service Account As Multi-Cloud Identity / Cloud Native Security Co...
 
KubeCon + CloudNativeCon Europe 2022 Recap / Kubernetes Meetup Tokyo #51 / #k...
KubeCon + CloudNativeCon Europe 2022 Recap / Kubernetes Meetup Tokyo #51 / #k...KubeCon + CloudNativeCon Europe 2022 Recap / Kubernetes Meetup Tokyo #51 / #k...
KubeCon + CloudNativeCon Europe 2022 Recap / Kubernetes Meetup Tokyo #51 / #k...
 
KubeCon + CloudNativeCon Europe 2022 Recap - Batch/HPCの潮流とScheduler拡張事例 / Kub...
KubeCon + CloudNativeCon Europe 2022 Recap - Batch/HPCの潮流とScheduler拡張事例 / Kub...KubeCon + CloudNativeCon Europe 2022 Recap - Batch/HPCの潮流とScheduler拡張事例 / Kub...
KubeCon + CloudNativeCon Europe 2022 Recap - Batch/HPCの潮流とScheduler拡張事例 / Kub...
 
独断と偏見で選んだ Kubernetes 1.24 の注目機能と今後! / Kubernetes Meetup Tokyo 50
独断と偏見で選んだ Kubernetes 1.24 の注目機能と今後! / Kubernetes Meetup Tokyo 50独断と偏見で選んだ Kubernetes 1.24 の注目機能と今後! / Kubernetes Meetup Tokyo 50
独断と偏見で選んだ Kubernetes 1.24 の注目機能と今後! / Kubernetes Meetup Tokyo 50
 

Recently uploaded

Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
chiefasafspells
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
masabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 

Recently uploaded (20)

Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 

ledgerで経理

  • 2. 2 . 1 Self-Introduction Tobias Pfeiffer, Software Engineer @ PFN Joined PFI in April 2014, moved to PFN in October 2014 Recently worked on: Stream processing engine, CES demo Hobbies Last year: Wedding planning → Also: Cooking
  • 3. 2 . 2 Today's Topic: Background & Motivation Not related to work tasks Not at all an expert or very knowledgeable in the field (But: Everyone uses money, so needs to manage it.) Motivation Household CFO Until now: LibreOffice & various spreadsheets One Problem: LibreOffice Another problem: Merging data sources Recently discovered ledgerand gave it a try
  • 5. 3 . 2 Why Accounting? For companies: usually required by law (to calculate taxes, inform shareholders etc.) For private persons/households: Locate and track: How much do you get (from where), how much do you have (where), how much do you spend (how)? Manage: Pay your bills on time. Optimize: What can you do to improve the situation? Plan: What can you afford and when?
  • 6. 3 . 3 Double-Entry Accounting (複式簿記) Published in 1494 (Luca Pacioli: Summa de arithmetica) Concept: Maintain multiple books (”accounts”) and record every transaction in two books   Cash in Wallet     Food expenses    Amount   Balance   Amount  Balance    -750 JPY 2,307 JPY 750 JPY 43,108 JPY -120 JPY 2,187 JPY 120 JPY 43,228 JPY         Salary               Bank account      Amount      Balance      Amount     Balance    -12,345 JPY -246,789 JPY 12,345 JPY 14,679 JPY
  • 7. 3 . 4 Double-Entry Accounting (2) Notes In the real world, this is more complex. (Why??) Observations The sum of amounts is zero in every transaction. The sum of balances is zero across all accounts. Advantages Location of money is immediately observable. A lot of “virtual accounts” can be added for fine- grained reporting. Invoice date and payment date can be different.
  • 8. 3 . 5 Account Structure Common structure Income (収入): where money comes from Expenses (費用): where money goes to Assets (資産): where money is Liabilities (負債): money you owe Equity (資本?): “the real value of your property” Examples: Income»Salary (will get more and more negative) Expenses»Food (will get more and more positive) Assets»Cash, Assets»Bank Account Liabilities»Credit Card
  • 9. 4 . 1 About ledger
  • 10. 4 . 2 Basic Usage
  • 11. 4 . 3 Concept Maintain a plain text file with your transactions. (Such a list of transactions is a “ledger”/原簿.) Plain text: Possible to have it in git, encrypt it, print it, copy & paste, edit it with scripts, … Execute ledgeron that file for reporting. ledgerchecks that everything balances and computes the numbers for the report. In particular, ledgeris not a tool to enter transactions!
  • 12. 4 . 4 Input Format General format: For example: date payee ; note account 1 amount account 2 amount 2016-02-25 Lawson ; Ham Sandwich Expenses:Food 325 JPY Assets:Cash -325 JPY ledgeralso allows: One posting without amount More than two postings (must add up to zero) 2016-02-25 Lawson Expenses:Food 325 JPY Assets:Cash 2016-02-25 Lawson Expenses:Food 301 JPY Expenses:Taxes 24 JPY Assets:Cash -325 JPY
  • 13. 4 . 5 Balance (残高) Report ledgercan compute the balance on each account. Input file: $ ledger balance (The input file name is passed with -for the LEDGER_FILE environment variable.) 2016-02-20 Company Assets:Bank 123,456 JPY Income:Salary 2016-02-22 Bank Assets:Cash 20,000 JPY Assets:Bank 2016-02-26 Landlord Expenses:Rent 70,000 JPY Assets:Bank 2016-02-27 Supermarket Expenses:Food 2,017 JPY Assets:Cash 51,439 JPY Assets 33,456 JPY Bank 17,983 JPY Cash 72,017 JPY Expenses 2,017 JPY Food 70,000 JPY Rent -123,456 JPY Income:Salary -------------------- 0
  • 14. 4 . 6 Register Report ledgercan display all transaction for an account with a running total. $ ledger register Cash 16-Feb-22 Bank Assets:Cash 20,000 JPY 20,000 JPY 16-Feb-25 Lawson Assets:Cash -325 JPY 19,675 JPY 16-Feb-27 Supermarket Assets:Cash -2,017 JPY 17,658 JPY 16-Mar-01 Lawson Assets:Cash -288 JPY 17,370 JPY $ ledger --period "feb 2016" register Food 16-Feb-25 Lawson Expenses:Food 325 JPY 325 JPY 16-Feb-27 Supermarket Expenses:Food 2,017 JPY 2,342 JPY
  • 15. 4 . 7 Other Reports Some other commands equity: collapse all transactions into a single one xml, csv: list transactions in other formats xact: create a new transaction from a pattern Some parameters --period, --begin, --end: date limit --strict: check that all used entities exist all commands take a regular expression to filter accounts
  • 16. 4 . 8 Example Use Patterns
  • 17. 4 . 9 Dealing With Cash Problem: Tracking all the little cash expenses One possible solution: Pay as much as possible using credit card, and treat cash as “Expense”, not “Asset”. To track an “important” expense, move money from Expenses:Cash to the target account: 2016-03-02 ATM Expenses:Cash 10,000 JPY Assets:Bank 2016-03-05 Expensive Restaurant Expenses:Eat Out 8,000 JPY Expenses:Cash
  • 18. 4 . 10 Dealing With Cash (2) If you do track your cash expenses (collecting receipts or using some app), at some point target/actual check (reconciliation) needs to be done. For checks, balance assertions can be used. To correct the amount, balance resets can be used. 2016-03-05 Check balance ; ledger run will fail if we don't have 123 JPY Assets:Cash = 123 JPY 2016-03-06 Correct balance ; take from Expenses:Loss what is required to get to 123 JPY Assets:Cash = 123 JPY Expenses:Loss
  • 19. 4 . 11 Delayed Payments $ ledger balance $ ledger balance When paying a purchase with a credit card, the payment is done later. However, there is a liability towards the credit card operator: Later, the liabilities must be paid back: 2016-02-15 Amazon Expenses:Books 780 JPY Liabilities:Credit Card 780 JPY Expenses:Books -780 JPY Liabilities:Credit Card --------- 0 2016-02-15 Amazon Expenses:Books 780 JPY Liabilities:Credit Card 2016-03-27 Pay Invoice Liabilities:Credit Card 780 JPY Assets:Bank -780 JPY Assets:Bank 780 JPY Expenses:Books --------- 0
  • 20. 4 . 12 Tracking Reimbursements $ ledger balance $ ledger balance When paying something on behalf of the company, it is the other way around, the company owes you money: If you hand in the receipts properly, the money will be reimbursed next month: 2016-02-17 Taxi ; no bus in inaka Liabilities:PFN 3,020 JPY Assets:Cash -3,020 JPY Assets:Cash 3,020 JPY Liabilities:PFN ------------- 0 2016-02-17 Taxi Liabilities:PFN 3,020 JPY Assets:Cash 2016-03-20 PFN Assets:Bank 126,476 JPY Liabilities:PFN -3,020 JPY Income:Salary -123,456 JPY 123,456 JPY Assets 126,476 JPY Bank -3,020 JPY Cash -123,456 JPY Income:Salary ------------- 0
  • 21. 4 . 13 Advanced Features
  • 22. 4 . 14 Currencies/Commodities $ ledger balance fridge $ ledger prices $ ledger balance -X JPY Bank A “currency” is just any string. You could also do inventory tracking using ledger: Currencies can also be exchanged into one another with exchange rate computation… … or manually given: 2016-02-29 Shopping day Fridge Supermarket -2 Apples Konbini -3 Beers 2 Apples 3 Beers Fridge 2016-02-29 ATM @ Europe Assets:Cash 50 EUR Assets:Bank -6,258 JPY 2016/02/29 EUR 125.16 JPY 2016-02-29 ATM @ Europe Assets:Cash 50 EUR @ 125 JPY Assets:Bank JPY-6250 Assets:Bank
  • 23. 4 . 15 Stock $ ledger balance brokerage $ cat prices.db $ ledger --market --price-db prices.db balance brokerage $ ledger --gain --price-db prices.db balance brokerage Stocks can also be treated like currencies. If you maintain a price history, you can find out current value of your stock. 2015-05-04 Buy Stock Assets:Brokerage 10 BMW Assets:Bank -1,067.50 EUR 2015-09-24 Buy Stock Assets:Brokerage 15 BMW Assets:Bank -1,135.20 EUR 25 BMW Assets:Brokerage P 2015/05/04 BMW 106.75 EUR P 2015/09/24 BMW 75.68 EUR P 2016/03/04 BMW 82.63 EUR 2,065.75 EUR Assets:Brokerage -136.95 EUR Assets:Brokerage
  • 24. 4 . 16 Metadata ledgerallows to attach metadata to transactions, such as effective dates, IDs, clearing state, and tags. The meaning of metadata is completely up to the user. Use the data when querying: $ ledger --effective balance $ ledger --pending|--cleared register $ ledger register tag manga $ ledger register tag ShipmentDate < [2016-02-20] 2016-02-15=2016-03-27 ! (123-7654) Rakuten Expenses:Books 780 JPY ; payee: HappyBooks 123 Expenses:Household 2,350 JPY ; payee: MyHousehold Liabilities:Credit Card ; :OnlineShopping:Manga: ; ShippingMethod: deliver to home address ; ShipmentDate:: [2016-02-16]
  • 25. 4 . 17 Budgeting Set up a budget and compare it against real expenses. ~ Monthly Expenses:Eat Out 10,000 JPY Assets:Cash 2016-02-14 Izakaya Expenses:Eat Out 3,723 JPY Assets:Cash 2016-02-28 Medium Restaurant Expenses:Eat Out 5,182 JPY Assets:Cash 2016-03-04 Expensive Restaurant Expenses:Eat Out 12,300 JPY Assets:Cash $ ledger --monthly --budget register Expenses 16-Feb-01 - 16-Feb-29 Expenses:Eat Out -1,095 JPY -1,095 JPY 16-Mar-01 - 16-Mar-31 Expenses:Eat Out 2,300 JPY 1,205 JPY
  • 26. 4 . 18 Forecasting Set up a budget and forecast your financial situation. ~ Monthly Expenses:Eat Out 10,000 JPY Expenses:Food 15,000 JPY Expenses:Rent 70,000 JPY Income:Salary -123,456 JPY Assets $ ledger --monthly --forecast "d < [2016-09]" register Assets 16-Apr-01 - 16-Apr-30 Assets 28,456 JPY 28,456 JPY 16-May-01 - 16-May-31 Assets 28,456 JPY 56,912 JPY 16-Jun-01 - 16-Jun-30 Assets 28,456 JPY 85,368 JPY 16-Jul-01 - 16-Jul-31 Assets 28,456 JPY 113,824 JPY 16-Aug-01 - 16-Aug-31 Assets 28,456 JPY 142,280 JPY
  • 27. 4 . 19 The ledgerEcosystem
  • 28. 4 . 20 Related Tools Forks (Haskell) (Python) and more … Tools to add transactions native GnuCash import (or roll your own using the Python API) hledger beancount ledgerhelpers tools to import CSV tools to import OFX
  • 29. emacs Integration ledger-modeprovides syntax highlighting, tab completion, integrated reports etc.
  • 30. 4 . 214 . 22 Features Not Presented Today Automatic transactions Python integration Advanced stock valuation Report formatting
  • 31. 4 . 23 Summary ledgerhelps you track your money, stock, and (optionally) apples. Powerful reporting commands allow to detect spending patterns and plan for future expenses. A number of tools help to get data in and out of your ledgerfiles.