summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2016-01-20 15:02:44 +0100
committerAlan Pearce2016-01-20 15:02:44 +0100
commit64efe505036594a9ec439fee0e6385ac5e3995ec (patch)
tree87755125d831aee7f8aea7382e0fd81536ec50e7
parente1baa8f48effd39398ab5051a71d67a1d9b40335 (diff)
downloaddotfiles-64efe505036594a9ec439fee0e6385ac5e3995ec.tar.lz
dotfiles-64efe505036594a9ec439fee0e6385ac5e3995ec.tar.zst
dotfiles-64efe505036594a9ec439fee0e6385ac5e3995ec.zip
Emacs: Add reports to ledger-mode configuration
-rw-r--r--tag-emacs/emacs.d/init.org34
1 files changed, 22 insertions, 12 deletions
diff --git a/tag-emacs/emacs.d/init.org b/tag-emacs/emacs.d/init.org
index 40fa173..c7ba94b 100644
--- a/tag-emacs/emacs.d/init.org
+++ b/tag-emacs/emacs.d/init.org
@@ -1525,18 +1525,28 @@ I use [[http://ledger-cli.org/][=ledger=]] to manage my finances.  It has an Ema
 works really nicely.
 
 #+BEGIN_SRC emacs-lisp
-(use-package ledger-mode
-  :mode ("\\.ledger\\'" . ledger-mode)
-  :config (progn
-            (defun setup-ledger-mode ()
-              (setq-local indent-tabs-mode nil))
-            (add-hook 'ledger-mode-hook #'setup-ledger-mode)
-            (setq ledger-use-iso-dates t
-                  ledger-post-use-completion-engine :built-in
-                  ledger-reconcile-default-commodity "€"
-                  ledger-clear-whole-transactions t
-                  ledger-narrow-on-reconcile t
-                  ledger-default-date-format "%Y-%m-%d")))
+  (use-package ledger-mode
+    :mode ("\\.ledger\\'" . ledger-mode)
+    :config (progn
+              (defun setup-ledger-mode ()
+                (setq-local indent-tabs-mode nil))
+              (add-hook 'ledger-mode-hook #'setup-ledger-mode)
+              (setq ledger-use-iso-dates t
+                    ledger-post-use-completion-engine :built-in
+                    ledger-reconcile-default-commodity "€"
+                    ledger-clear-whole-transactions t
+                    ledger-narrow-on-reconcile t
+                    ledger-default-date-format "%Y-%m-%d"
+                    ledger-reports '(("Monthly Expenses" "ledger -f %(ledger-file) reg -M Expenses -l \"commodity == '€'\"")
+                                     ("Forecast:Next Month" "ledger -f %(ledger-file) bal --forecast 'format_date(d, \"%Y%m%d\")<(to_string(to_int(format_date(now, \"%Y%m01\"))+100))' --limit 'format_date(date, \"%Y%m%d\")>(to_string(to_int(format_date(now, \"%Y%m01\"))+200))' ^Expenses: ^Funds:")
+                                     ("Expenses:This Month" "ledger -f %(ledger-file) bal ^Expenses -p \"this month\"")
+                                     ("Asset & Liability Balances" "ledger -f %(ledger-file) bal --current -R :Budget: Assets:Receivable Liabilities:Personal")
+                                     ("Budget" "ledger -f %(ledger-file) bal ^Funds")
+                                     ("bal" "ledger -f %(ledger-file) bal")
+                                     ("reg" "ledger -f %(ledger-file) reg")
+                                     ("equity" "ledger -f %(ledger-file) equity")
+                                     ("payee" "ledger -f %(ledger-file) reg @%(payee)")
+                                     ("account" "ledger -f %(ledger-file) reg %(account)")))))
 #+END_SRC
 
 ** Markdown