I am not sure if this is really a novel approach or simply has not
been posted before because it is slightly outside the scope of
Beancount, but personally I cannot remember reading anything like it
before in all my time reading the mailing lists and various other
resources surrounding text based accounting, so I thought I would
share my idea.

My wife (bless her heart) does her best to act like she cares whilst
listening to my technical dissertations (which she (lovingly?) refers
to as "bedtime stories") and I haven't gotten around to making a blog
yet, so you guys will be the lucky ones who get to receive my idiotic
ramblings.  :D

I also think that, like Martin, I write as a way to clarify my own
thoughts.  This may or may not be useful to others; in case it is I
decide to share it here.


----------------------------------------------------------------------
 What this is not
----------------------------------------------------------------------

This is not going to be about computer vision or anything like that.
I am aware these tools exist (in fact apparently some quite mature
libraries, etc. already are available in Python) but I have not got
any further than the most basic of research in this area (yet).  Of
course some working solution along those lines would obsolete
everything I write here, but so far I do not think we are "there" yet
(I could be wrong; perhaps another reason to make this post, to
possibly flush out such answers).

This is also not going to be about any proprietary solutions that may
already be available (and perhaps even working well), as to me
personally those are non-starters.


----------------------------------------------------------------------
 What this is
----------------------------------------------------------------------

The TL;DR is:

1. Take photo of receipt (some times multiple in case of very long
   receipt, etc.).

2. Edit file name of photo(s) to include payee, amount, and which
   account (letter - more on this below) that it came out of,
   following a specified format.  This is the "manual" part (which I
   now believe you will need to do regardless /at some point/).

3. Next is automated part.  A script parses that info out of filename
   and generates two things:

   1. (Most of) a Beancount transaction, including categorizing it (in
      > 80% of cases).

   2. A symlink from actual photo location to correct location within
      Beancount document file structure for that account, so that the
      receipt photo is easily clickable from within Fava.

4. Now I do another little "manual" part.  Double check automated work
   from above, correct categorization and add some narration if
   needed.  Clickable link in Fava makes it very easy to look at photo
   of receipt, if needed.

5. In case it was not already clear, I am now abandoning previous
   (fully) "automated" methods of importing transactions via CSV
   and/or OFX.  The reasons for that were detailed in my latest post
   at the end of the thread titled "Automation being the key to
   success (aka Know Thyself) featuring ofxclient and Selenium
   WebDriver" and thus not repeated here.


----------------------------------------------------------------------
 Background and pre-requisites
----------------------------------------------------------------------

Personal Information Management (PIM) has been a bit of a hobby for me
for about as long as I can remember.  Some time ago I came across Karl
Voit writings [0,1] which certainly had an influence on the workflow I
arrive at here, particularly his ideas around folder hierarchies,
tagging, timeline, and perhaps most importantly the concept of doing
many of these things right in the file name, which is a universal and
cross platform solution.

So for some time I already automatically sort all my photos (using
Python script named aptly enough, sortphotos) every night into a
folder hierarchy and file naming convention which I specify.

Anyway, I suppose I mention this for 2 reasons:

1. The work involved in taking a photo of a receipt, tagging it in
   file name, etc. for me is not such a great addition to (and in fact
   dovetails very nicely with) already existing generalized workflows
   regarding photos and other PIM in general.

2. However if you do not have this infrastructure set up already, you
   may arrive at different conclusion of course.


----------------------------------------------------------------------
 Why photos of receipts?
----------------------------------------------------------------------

Lots of reasons (in addition to those already mentioned above):

- Modern thermal printed receipts fade over time, after a year or two
  (some times only months) they can become completely un-readable.

- Proof!  You may need to submit copies of receipts for any of the
  following.  Having them readily available in an electronic format
  facilitates this process.

  - reimbursement from your employer (or elsewhere)

  - proving things for taxes

  - obtaining warranty service, returns, etc...

  - I am sure there are more

- Easier workflow getting into Beancount.  Honestly I think it is
  debatable whether taking a photo and tagging the file name and then
  looking at that photo later while updating/entering your Beancount
  transactions is less work than dorking around with physical
  receipts.  However when combined with all of above advantages, I
  think the scales are tipped in favor.

- I am sure there are more


----------------------------------------------------------------------
 More details on how it actually works
----------------------------------------------------------------------

First step in this process is using Syncthing to automatically
synchronize the photos in the background.  As soon as I take a photo,
it is synced to an "upload" folder, another copy of which is located
on some Single Board Computer I have running at home.

I suppose the Single Board Computer (or similar always running
"server") itself may or may not be another pre-requisite, but you
could certainly do all this without one.  Anyway these things are
quite inexpensive nowadays and use so little power (i.e., also cheap
to run, quiet, etc.) that I highly recommend their use for any number
of scenarios.  If interested, I highly recommend Armbian "Supported
Hardware" list [2] is an excellent starting point for further
research, as there is so much better and more interesting hardware
available nowadays than the often default recommendation of RPi (which
is also quite a locked down device, amongst many other issues).
Anyway...

Then sortphotos runs nightly, simultaneously renaming the filename to
a format I specify (ex. YYYY-MM-DD_HHMMSS.jpg) and also relocating the
files into a different file tree which looks like:

- timeline
  - 2020
    - 01-Jan
    - 02-Feb
    - 03-Mar
      - 2020-03-11_123423.jpg

This gives me a very predictable file naming scheme as a base,
regardless of what device the photos came from.  It is only after this
nightly sorting process that I begin to add my other tags and
descriptions (including, in this case, _receipt, etc...) to the
filename.  So, for these receipts, the format I devised so far looks
like:

YYYY-MM-DD_HHMMSS_Walmart_23.45_receipt_A_1of2.jpg
|               | |       |             | |
----------------- |       Amount        | Optional
       |          Payee                 |
       |                                Account letter
Already existing from sortphotos

Hopefully I met my goal of making easy to search (using readily
available tools) for any combination of {store name, amount, account}.

Perhaps notably absent is narration, which I will add only in
Beancount, as I don't think it's relevant to include within the file
name of a photo of a receipt.

Certainly you could use proprietary tools for some/all of above
functionality, but personally I do not and will not.


----------------------------------------------------------------------
 A word on account "letter"
----------------------------------------------------------------------

I mentioned briefly in TL;DR but wanted to explain further that I use
a system of account "letters" as shorthand, for example:

|---------+---------------------|
| Account | Description         |
|---------+---------------------|
| A       | primary checking    |
| B       | money market        |
| C       | rewards credit card |
| ...     | etc...              |
|---------+---------------------|

The actual credit/debit card (or even account) numbers can and do
change in the meantime, but overall the "role" of that account remains
mostly the same (or I create a new account letter).  I also maintain a
mapping between card ending numbers and the dates they were relevant,
and what account they are/were associated with.

At the same time it is a shorthand for much longer account numbers, or
names in Beancount, where I even append it to the account name for
example "Assets:Institution:Checking-A", etc.


----------------------------------------------------------------------
 In closing
----------------------------------------------------------------------

This workflow is still pretty new, I am still working on finishing
touches on the script which is WIP as is the whole workflow in
general, but eventually I would be happy to share it if anyone is
interested.  For now mostly just wanted to float the general idea of a
workflow beginning with taking a photo of a receipt which is not one I
thought I had seen before.

Feedback (good or bad), is welcomed.

Cheers,
TRS-80

[0] https://karl-voit.at/folder-hierarchy
[1] https://karl-voit.at/managing-digital-photographs
[2] https://www.armbian.com/download/?device_support=Supported

--
You received this message because you are subscribed to the Google Groups 
"Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/be44cd9bd9f61d291ba001bbea81d8d3%40isnotmyreal.name.

Reply via email to