Rent template

This commit is contained in:
Benson Chu 2021-09-27 08:03:58 -05:00
parent a621e19d57
commit 2d11e40507
2 changed files with 41 additions and 1 deletions

View file

@ -118,6 +118,13 @@
(find-file (my/org-file (format "journals/%s" journal)))
(outline-next-heading)))
(defun my/rent-next-month ()
(if (<= 15 (ts-day (ts-now)))
(format-time-string "%B"
(time-convert (time-add (current-time)
(days-to-time 16))))
(format-time-string "%B")))
(setq org-capture-templates
(doct `(("Tasks" :keys "t" :children
(("New Refile Task"
@ -172,7 +179,12 @@
("Reconciliation" :keys "r"
:file ,(my/org-file "entries/reviews.gpg")
:olp ("Reviews")
:template-file ,(my/org-file "templates/fin-recon.org"))))
:template-file ,(my/org-file "templates/fin-recon.org"))
("Rent" :keys "R"
:unnarrowed t :empty-lines 1 :type plain
:function (lambda () (org-capture-put :month-rent (my/rent-next-month)) (end-of-buffer))
:file ,(my/plaintext-file "ledger-finance/ledger.ledger")
:template-file ,(my/org-file "templates/rent.ledger"))))
("Record Comms Message"
:file ,(my/agenda-file "datetree.org")
:keys "C"

View file

@ -0,0 +1,28 @@
;;; my-rent-capture-template.el --- -*- lexical-binding: t -*-
;; Copyright (C) 2021 Benson Chu
;; Author: Benson Chu <bensonchu457@gmail.com>
;; Created: [2021-09-26 17:35]
;; This file is not part of GNU Emacs
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;;; Code:
(provide 'my-rent-capture-template)
;;; my-rent-capture-template.el ends here