all repos — nixfiles @ 64efe505036594a9ec439fee0e6385ac5e3995ec

System and user configuration, managed by nix and home-manager

Emacs: Add reports to ledger-mode configuration
Alan Pearce alan.pearce@spotcap.com
Wed, 20 Jan 2016 15:02:44 +0100
commit

64efe505036594a9ec439fee0e6385ac5e3995ec

parent

e1baa8f48effd39398ab5051a71d67a1d9b40335

1 files changed, 22 insertions(+), 12 deletions(-)

jump to
M tag-emacs/emacs.d/init.orgtag-emacs/emacs.d/init.org
@@ -1525,18 +1525,28 @@ I use [[http://ledger-cli.org/][=ledger=]] to manage my finances.  It has an Emacs mode, which 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