I've been using
org mode in
emacs for a few years, now, to help me keep track of my assignments, and more recently, to help generate invoices.
To generate a line item for an invoice, an item must have certain “Properties” (a feature of
org mode). Generally speaking, these are:
BillUnitproperty, which answers one of the following questions:
Unitsproperty, which indicates the number of
BillUnits to bill.
UnitRate, which is multiplied by the
Unitsto get the line item total.
If I haven't done work for a certain client or end client for a while, I sometimes forget what
UnitRate to charge, resulting in either (a) having to fish through the archive to find a job for the same client or end client, or (b), if I'm not mentally on the bounce, charging an incorrect—and typically lower—rate for work.
So I got to thinking about automating the process, and just as an experiment, I created the following function in my
.emacs file (the file that
emacs reads upon startup):
(defun clientA-xl8 () 0.xx)
where 0.xx reflects my translation rate for client “A”. Then, instead of assigning the value of 0.xx to the
UnitRate property of the job, I entered the value
and then, when I ran my invoice generation function… lo, and behold (!), my hypothesis—that
emacs evaluates property values in
org mode and then uses any returned value—was demonstrated to have merit.
This is just a first step, but an important one.