How do I generate expenses claim forms from ledger?

261 views
Skip to first unread message

ed

unread,
Aug 3, 2011, 11:41:23 AM8/3/11
to Ledger
I am looking to catch up with my expenses as it is accounts time
again. Historically I have maintained the accounts claims as
spreadsheets filled in from receipts, tickets etc. If I switch over to
ledger I would quite like to enter all expenses transactions into
ledger and then export all transactions from a given date range into
csv or some other format that I could use to produce expenses claim
forms.

Is anyone doing something like this? How are you doing it?

Russell Adams

unread,
Aug 3, 2011, 11:55:40 AM8/3/11
to Ledger
Ed,

I have a huge expenses setup for Ledger.

The workflow is straightforward:

- Spend money & collect receipts
- Scan receipts (I use Shoeboxed.com)
- Download CSV from my credit card
- Use CSV2Ledger to import CC data into Ledger format
- Tag expenses with project code and receipt
- Generate an expense report from Ledger data via Perl script into Latex for PDF publishing
- Distribute the PDF

Ledger works GREAT at this, and I heavily abuse metadata to allow me
to do project cost accounting. On the other hand, it's still a pretty
manual process.

My biggest issue is consistency, a data entry widget to enforce
metadata and ledger formatting would go a long way.

Come hang out on IRC sometime and ask more. Maybe we can find a way to
make a "skeleton" workflow to share.

Thanks.


------------------------------------------------------------------
Russell Adams RLA...@AdamsInfoServ.com

PGP Key ID: 0x1160DCB3 http://www.adamsinfoserv.com/

Fingerprint: 1723 D8CA 4280 1EC9 557F 66E8 1154 E018 1160 DCB3

ed

unread,
Aug 3, 2011, 1:42:22 PM8/3/11
to Ledger
Any chance of sharing your Perl script(s)? Generating Latex seems a
bit daunting.

And, erm, I've just remembered I asked pretty much this question a
year or so ago and you provided a similar answer, thanks again :-)

On Aug 3, 4:55 pm, Russell Adams <RLAd...@AdamsInfoServ.Com> wrote:
snipped

ed

unread,
Aug 3, 2011, 2:18:17 PM8/3/11
to Ledger
Another option is to massage the XML content of a docx or xlsx file
and produce the form that way .... Probably simpler (for me) than
messing about with Latex.

Ed

Doug Philips

unread,
Aug 3, 2011, 2:42:33 PM8/3/11
to ledge...@googlegroups.com

OMG. Having to work with tools that take XML and build docx files as
part of my day job, I weep for you if you go down that path. If LaTeX
means a learning curve, then maybe going to CSV or Tab separated
values and pulling into a spreadsheet would be simpler...

-Doug

Russell Adams

unread,
Aug 3, 2011, 5:12:49 PM8/3/11
to ledge...@googlegroups.com
Really, XML? I hope you bought stock in the makers of Tums & Pepsid.

The Latex table is easy, here's a single line from a Latex table:

2011/05/20 & TravelAgencyFee & AGENT FEE & \$40.00 & \\ \hline

It's '&' separated.

Latex also links in all my receipt images seamlessly that I get via
Ledger metadata.

\includegraphics[scale=.6,angle=90]{./Receipts/PROJ3009/20110527_NJTransit_3_00.jpg} \\

Tada. All that and a fully function PDF with TOC to boot.

The perl script interrogates Ledger and parses the output to reformat
to Latex.

To get you started, here's a sample txn:

2011/03/13 (03/15/2011) HAMPTON INNS
; RECEIPT: Receipts/PROJ0000/hampton.jpg
Source:Visa $-246.34
Dest:Projects
; ER: ER0001
; PROJECT: PROJ0000
; CATEGORY: Lodging

Then you can play with --pivot and ER, PROJECT, and use %ER=ER0001 to
see your expense.

Thanks.

ed

unread,
Aug 4, 2011, 9:21:35 AM8/4/11
to Ledger
Warnings about XML heeded.

How would I get/produce a Latex template to populate? Is there
anything which could take a Libreoffice or Word Doc and produce a
Latex representataion?

Michael Farnbach

unread,
Aug 4, 2011, 10:14:45 AM8/4/11
to ledge...@googlegroups.com
You might try klyx or texmacs.

Zack Williams

unread,
Aug 4, 2011, 10:26:52 AM8/4/11
to ledge...@googlegroups.com
On Thu, Aug 4, 2011 at 6:21 AM, ed <ed.te...@gmail.com> wrote:

While it won't do exactly what you mention, this might be helpful:

http://johnmacfarlane.net/pandoc/

- Zack

Reply all
Reply to author
Forward
0 new messages