aboutsummaryrefslogtreecommitdiff
path: root/examples/invoices.conf
blob: 9fca0185100f3cdbc98756abb86ac4b492df2d0e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
;; -*- mode: lisp -*-
;; vim: set ft=lisp :
;;
;; invoices.conf — file invoices by content, into a folder per year.
;;
;; Demonstrates: (content ...) matching text pulled out of PDFs and other
;; documents (see krino.conf(5), CONTENT EXTRACTION), and the {mtime:%Y}
;; placeholder in a (move ...) destination.
;;
;; 0000000000 below is a placeholder, not an issued Polish NIP — no such
;; number is ever assigned. The conditions in (when ...) must all hold, and
;; one (content ...) is true when any of its keywords appears, so the rule
;; needs a keyword AND the number. Replace the number with your supplier's
;; or your own NIP to narrow the rule to that tax number, or delete the
;; (content "0000000000") condition to match on keywords alone.
;;
;; To use: copy this to dirs/<name>.conf, fix (path ...) below, and add
;; <name> to (include ...) in krino.conf. A short tutorial on the syntax is
;; docs/sexp-primer.md in the source repository, installed alongside this
;; file at $PREFIX/share/doc/krino/sexp-primer.md; every form is described
;; in krino.conf(5).

(path "~/Downloads")            ; CHANGE THIS to the directory to sort

;; Leave partial downloads and dotfiles alone.
(ignore "*.part" "*.crdownload" "*.aria2" ".*")

(rule "acme-invoices"
  (when (type document)
        (content "faktura" "invoice")
        (content "0000000000"))         ; 0000000000: fake NIP, see above
  (move "Filed/Invoices/{mtime:%Y}")
  (stop))