Mileage

79 views
Skip to first unread message

Russell Adams

unread,
Jul 28, 2008, 2:16:29 PM7/28/08
to ledge...@googlegroups.com
On IRC earlier I was asking if commodities could be used for mileage,
it appears they can.

Here's my samples, including valid rates from the IRS.

-----Prices.dat-----
; From IRS:
; http://www.irs.gov/taxpros/article/0,,id=156624,00.html
P 2008/07/01 00:00:00 miles $0.585
P 2008/01/01 00:00:00 miles $0.505
P 2007/01/01 00:00:00 miles $0.485
P 2006/01/01 00:00:00 miles $0.445

-----Mileage.dat-----
2006/07/25 Home to IAH
Expenses:Business:Reimburseable 10 miles
Assets:Business:Reimburseable

2007/07/25 Home to IAH
Expenses:Business:Reimburseable 10 miles
Assets:Business:Reimburseable

2008/07/25 Home to IAH
Expenses:Business:Reimburseable 10 miles
Assets:Business:Reimburseable

-----Output-----
$ ledger -V reg
2006/07/25 Home to IAH Ex:Bu:Reimburseable $4.450 $4.450
As:Bu:Reimburseable $-4.450 0
2007/07/25 Home to IAH Ex:Bu:Reimburseable $4.850 $4.850
As:Bu:Reimburseable $-4.850 0
2008/07/25 Home to IAH Ex:Bu:Reimburseable $5.850 $5.850
As:Bu:Reimburseable $-5.850 0

So obviously my next question is whether anyone is creating expense
reports from Ledger?

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

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

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

John Wiegley

unread,
Jul 28, 2008, 4:47:45 PM7/28/08
to ledge...@googlegroups.com
On Jul 28, 2008, at 2:16 PM, Russell Adams wrote:

> Here's my samples, including valid rates from the IRS.

If you'd like better dollar precision in your output (2 decimal
places), put this line at the top of your example file:

D $1,000.00

That sets up the display characteristics for the given commodity.

If this still doesn't display the precision right, it's a bug. I've
made a note in the 2.7 sources to verify this before completion.

John

Russell Adams

unread,
Jul 28, 2008, 5:36:30 PM7/28/08
to ledge...@googlegroups.com
On Mon, Jul 28, 2008 at 04:47:45PM -0400, John Wiegley wrote:
>
> If you'd like better dollar precision in your output (2 decimal places),
> put this line at the top of your example file:
>
> D $1,000.00
>
> That sets up the display characteristics for the given commodity.
>
> If this still doesn't display the precision right, it's a bug. I've
> made a note in the 2.7 sources to verify this before completion.
>
> John
>

I didn't see this in the PDF manual, and I tried that code in several
places (the price db, and my main) without changing the output. I'm on
2.6.

Thanks.

John Wiegley

unread,
Jul 28, 2008, 10:21:00 PM7/28/08
to ledge...@googlegroups.com
On Jul 28, 2008, at 5:36 PM, Russell Adams wrote:

> I didn't see this in the PDF manual, and I tried that code in several
> places (the price db, and my main) without changing the output. I'm on
> 2.6.

Ok, it's as I feared then, I'm forgetting to tell the parser not to
adjust the display precision of a commodity when it appears in a
pricing entry. I'll add a bug for this against 2.6.1.

John

Russell Adams

unread,
Feb 9, 2009, 5:01:10 AM2/9/09
to ledge...@googlegroups.com
On Mon, Jul 28, 2008 at 01:16:29PM -0500, Russell Adams wrote:
>
>
> -----Prices.dat-----
> ; From IRS:
> ; http://www.irs.gov/taxpros/article/0,,id=156624,00.html
> P 2008/07/01 00:00:00 miles $0.585
> P 2008/01/01 00:00:00 miles $0.505
> P 2007/01/01 00:00:00 miles $0.485
> P 2006/01/01 00:00:00 miles $0.445
>

I was just testing this, and all I got was the latest value for
miles. Did I misunderstand that Ledger used historical pricing to use
the right value based on the date of the entry?

I worked around by using longer names (ie: milesOhNine) for now.

Thanks.

John Wiegley

unread,
Feb 9, 2009, 5:12:34 AM2/9/09
to ledge...@googlegroups.com
On Feb 9, 2009, at 6:01 AM, Russell Adams wrote:

> On Mon, Jul 28, 2008 at 01:16:29PM -0500, Russell Adams wrote:
>> -----Prices.dat-----
>> ; From IRS:
>> ; http://www.irs.gov/taxpros/article/0,,id=156624,00.html
>> P 2008/07/01 00:00:00 miles $0.585
>> P 2008/01/01 00:00:00 miles $0.505
>> P 2007/01/01 00:00:00 miles $0.485
>> P 2006/01/01 00:00:00 miles $0.445
>>
>
> I was just testing this, and all I got was the latest value for
> miles. Did I misunderstand that Ledger used historical pricing to use
> the right value based on the date of the entry?

It should use the value based on the date of the entry if you're in
the register report.

John

Russell Adams

unread,
Feb 9, 2009, 5:17:11 AM2/9/09
to ledge...@googlegroups.com

Not in bal? Thats what I was looking at and all the values were off. I
didn't check reg.

John Wiegley

unread,
Feb 9, 2009, 12:53:53 PM2/9/09
to ledge...@googlegroups.com
On Feb 9, 2009, at 6:17 AM, Russell Adams wrote:

> Not in bal? Thats what I was looking at and all the values were off. I
> didn't check reg.

The balance report uses the "end date" for all values shown.

You may be confusing -V (current market value) for -B (basis cost). -
B will report things in terms of what you paid, rather than what
they're worth now.

John

Russell Adams

unread,
Feb 10, 2009, 1:36:53 AM2/10/09
to ledge...@googlegroups.com

I was looking at that, but only -V is performing a conversion. -B just
shows the miles, not how much they convert to.

Any suggestions?

John Wiegley

unread,
Feb 10, 2009, 2:09:38 AM2/10/09
to ledge...@googlegroups.com
On Feb 10, 2009, at 2:36 AM, Russell Adams wrote:

> I was looking at that, but only -V is performing a conversion. -B just
> shows the miles, not how much they convert to.

Tell me whether -I doesn't show what you want.

John

Russell Adams

unread,
Feb 10, 2009, 2:16:06 AM2/10/09
to ledge...@googlegroups.com

-I isn't documented in ledger -H. ;]

Nope, -B and -I don't convert, while -V shows latest value only. I
tried 2.6.1 and 2.6.2 (latest git beta).

Thanks.

John Wiegley

unread,
Feb 10, 2009, 2:41:35 AM2/10/09
to ledge...@googlegroups.com
On Feb 10, 2009, at 3:16 AM, Russell Adams wrote:

> Nope, -B and -I don't convert, while -V shows latest value only. I
> tried 2.6.1 and 2.6.2 (latest git beta).

Ok, can you reduce this down to a few entries, with an explanation of
the behavior you expect, so that I can ensure 3.0 is able to do it for
you?

Thanks! John

Reply all
Reply to author
Forward
0 new messages