summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorViraj Alankar <valankar@gmail.com>2023-06-10 12:21:31 +0200
committerViraj Alankar <valankar@gmail.com>2023-06-10 12:21:31 +0200
commitc9abb5959b13b38f7667c885bf93737ac301741c (patch)
treed169b2907a501c092a9a2e56a34e12eb24aecc64 /doc
parent5e2afd286a332b93481750821be4785fbbd555a4 (diff)
downloadfork-ledger-c9abb5959b13b38f7667c885bf93737ac301741c.tar.gz
fork-ledger-c9abb5959b13b38f7667c885bf93737ac301741c.tar.bz2
fork-ledger-c9abb5959b13b38f7667c885bf93737ac301741c.zip
Add example for credit card cashback.
Diffstat (limited to 'doc')
-rw-r--r--doc/ledger3.texi25
1 files changed, 25 insertions, 0 deletions
diff --git a/doc/ledger3.texi b/doc/ledger3.texi
index e29c1082..06eb31fd 100644
--- a/doc/ledger3.texi
+++ b/doc/ledger3.texi
@@ -4082,6 +4082,8 @@ Forecasting}.
@node Concrete Example of Automated Transactions, , Periodic Transactions, Automated Transactions
@subsection Concrete Example of Automated Transactions
+@subsubsection Tithing
+
As a Bahá'í, I need to compute Huqúqu'lláh whenever I acquire assets.
It is similar to tithing for Jews and Christians, or to Zakát for
Muslims. The exact details of computing Huqúqu'lláh are somewhat
@@ -4174,6 +4176,29 @@ This example causes 10% of the matching account's total to be deferred
to the @samp{Savings} account---as a balanced virtual posting, which
may be excluded from reports by using @option{--real}.
+@subsubsection Credit Card Cashback
+
+Credit cards sometimes provide a cashback percentage of purchases. This
+can be setup with the following:
+
+@smallexample @c input:C371854
+; This automated transaction will add to "Assets:Credit Card Cashback"
+; the amount of the transaction multiplied by the "cashback" tag.
+
+= "Liabilities:Credit Card" and %cashback
+ Assets:Credit Card Cashback (-tag("cashback"))
+ Income:Credit Card Rewards (tag("cashback"))
+@end smallexample
+
+To add a transaction that gives 2% cashback:
+
+@smallexample @c input:C371854
+2023/06/06 McDonalds
+ ; cashback:: 0.02
+ Expenses:Food:Restaurants $23.98
+ Liabilities:Credit Card
+@end smallexample
+
@node Building Reports, Reporting Commands, Transactions, Top
@chapter Building Reports