Re: Re-naming accounts..

2016-01-04 Thread Jeffrey Brent McBeth
On Mon, Jan 04, 2016 at 02:04:38PM -0800, John Wiegley wrote:
> > Douglas Philips  writes:
> 
> > What I have been doing as an experiment is to add in something additional:
> 
> > 2016/01/01 Fix the thing
> > Expenses:Thing $20.00
> > Liabilities:Credit Card:Pursuit   $-20.00
> > (Budget:Pursuit)   $20.00
> 
> Now you can just do a balance query of Assets:Checking against Budget and see
> what the net result will be.  Or use --real to strip away the budget, or just
> don't query against Budget.

I'm really happy using the imperative (I forget the term) virtual accounts 
(surrounded by []), it maintains the accounting equation, I can easily query 
how much is really in my checking vs how much is unallocated to ther budget 
things, and I can square things up periodically if I choose.

Jeff

-- 
"The man who does not read good books has no advantage over 
 the man who cannot read them."
 -- Mark Twain

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


ledger print

2014-12-07 Thread Jeffrey Brent McBeth
I am having problems with queries of ledger when I pass in my ledger file 
(approximately 10k lines) 
If I make the same query of the file that results from a ledger -f 
origFile.ledger print  foo.ledger
Then, the problem goes away (the resulting file is 13k-ish lines)

This is causing me no end of heartache when it comes to creating a minimal 
failing example for you folks.

The original file does use several matching automatic transactions like:
= /^Expenses:Insurance:Jeff/ and date  [2014/12/01]
  [Assets:ESL:Checking]  1
  [Savings:Bill:Insurance:Jeff]  -1
= /^Expenses:Insurance:Elnora/ and date  [2014/12/01]
  [Assets:ESL:Checking]  1
  [Savings:Bill:Insurance:Elnora]  -1

In fact, it was upon adding these two that I first started noticing the problem.
Essentially, there are transactions being created that don't match the limiting 
expressions.
But, those spuruous transactions don't appear if I call print, only when I 
call register or balance

If there are some suggestions on where I could start looking and debugging, I 
would be willing to take a crack at it, as I have some christmas vacation 
coming.
If there is somebody willing to look at it, I probably could send an encrypted 
zip of the ledger files as they stand, too.

Thanks for your patience,
 Jeffrey McBeth

-- 
The man who does not read good books has no advantage over 
 the man who cannot read them.
 -- Mark Twain

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Ledger does not work with boost=1.56.0-1/boost-libs=1.56.0

2014-09-10 Thread Jeffrey Brent McBeth
On Wed, Sep 10, 2014 at 09:17:12PM +0200, Thorsten Jolitz wrote:
 Johann Klähn kljoh...@gmail.com writes:
 
 Hi Craig, Hi Johann, 
 
  I just built the master branch on arch linux using boost 1.56.
 
  On Wed, Sep 10, 2014 at 7:37 PM, Thorsten Jolitz
  tjol...@gmail.com wrote:
 
  acprep: DEBUG: configure does not need to be run
 
  You may need to run cmake again. Try to delete your build directory
  (or just the Makefile) and run acprep again. To be on the safe side
  you can use a fresh checkout.
 
 I just nuked the repo and cloned it again since I had no stuff of my own
 in there, and mow it works again:

cmake caches which library version it finds, so the other answer would have 
been to flush that cache

-- 
The man who does not read good books has no advantage over 
 the man who cannot read them.
 -- Mark Twain

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: value expressions and automatic transactions

2014-05-12 Thread Jeffrey Brent McBeth
On Mon, May 12, 2014 at 06:11:33AM +, John Wiegley wrote:
  Jeffrey Brent McBeth mcb...@broggs.org writes:
 
  I swear I'm smarter than this
  #+BEGIN_EXAMPLE
  account =~ /^Liabilities:CrushingDebt/ and date  [2014/04/15]
   Assets:Checking  0.5
   Assets:RichUncle  -0.5
 
 You'll need:
 
   = expr account =~ ...

Ahh, perfect.  Given that that is exactly what you said, one would think I 
could have done that.  Thanks so much for such a great tool and your patience 
with us.

Jeff

-- 
The man who does not read good books has no advantage over 
 the man who cannot read them.
 -- Mark Twain

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: value expressions and automatic transactions

2014-05-11 Thread Jeffrey Brent McBeth
On Sat, May 10, 2014 at 05:37:14PM +, John Wiegley wrote:
  Jeffrey Brent McBeth mcb...@broggs.org writes:
 
  I'm struggling to get my head around how to write value expressions with
  respect to automatic transactions
 
  /^Liabilities:CrushingDebt/ and (d  [2014/04/15])
 
 Try:
 
 expr account =~ /^Liabilities:CrushingDebt/ and date  [2014/04/15]

I swear I'm smarter than this

#+BEGIN_EXAMPLE
account =~ /^Liabilities:CrushingDebt/ and date  [2014/04/15]
 Assets:Checking  0.5
 Assets:RichUncle  -0.5

2014/04/01 * Foo
  Liabilities:CrushingDebt  $100
  Assets:Checking

2014/04/25 * Bar
  Liabilities:CrushingDebt  $150
  Assets:Checking

2014/04/25 * Unrelated
  Liabilities:TolerableDebt  $150
  Assets:Gubment
#+END_EXAMPLE

ledger --debug expr.calc -f foo.ledger bal

#+BEGIN_EXAMPLE
   $-400  Assets
   $-250Checking
   $-150Gubment
$400  Liabilities
$250CrushingDebt
$150TolerableDebt

   0
#+END_EXAMPLE

  Pointers on how one debugs this sort of thing would be appreciated too.
 
 The best is:
 
 --debug expr.calc
 
 Which requires that you've built with debugging support enabled.

so, I thought that that was what I would get when I ran
./acprep debug  sudo make install

but, the debug switch, while recognized appears to responf with nothing?
again, I recognize I'm being dense.  Thank you for yur time and efforts.


-- 
The man who does not read good books has no advantage over 
 the man who cannot read them.
 -- Mark Twain

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


value expressions and automatic transactions

2014-05-10 Thread Jeffrey Brent McBeth
I'm struggling to get my head around how to write value expressions with 
respect to automatic transactions

#+BEGIN_EXAMPLE
= /^Liabilities:CrushingDebt/ and (d  [2014/04/15])
 Assets:Checking  0.5
 Assets:RichUncle  -0.5


2014/04/01 * Foo
  Liabilities:CrushingDebt  $100
  Assets:Checking

2014/04/25 * Bar
  Liabilities:CrushingDebt  $150
  Assets:Checking

2014/04/25 * Unrelated
  Liabilities:TolerableDebt  $100
  Assets:Gubment

#+END_EXAMPLE

I'm getting:
ledger -f example.ledger bal
#+BEGIN_EXAMPLE
   $-400  Assets
   $-125Checking
   $-150Gubment
   $-125RichUncle
$400  Liabilities
$250CrushingDebt
$150TolerableDebt

   0
#+END_EXAMPLE

I was hoping for
#+BEGIN_EXAMPLE
   $-400  Assets
   $-175Checking
   $-150Gubment
$-75RichUncle
$400  Liabilities
$250CrushingDebt
$150TolerableDebt

   0
#+END_EXAMPLE

Pointers on how one debugs this sort of thing would be appreciated too.  I 
tried --trace, but below 10 gives me no interesting information and above 9 
caused a segfault with the error:

#+BEGIN_EXAMPLE
terminate called after throwing an instance of 'std::logic_error'
  what():  Argument to --trace must be an integer
#+END_EXAMPLE

The ledger parse stuff seems to use a different syntax from the automatic 
stuff, as if I do a 

ledger parse d[2004/05/15]
#+BEGIN_EXAMPLE
--- Context is first posting of the following transaction ---
2004/05/27 Book Store
; This note applies to all postings. :SecondTag:
Expenses:Books 20 BOOK @ $10
; Metadata: Some Value
; Typed:: $100 + $200
; :ExampleTag:
; Here follows a note describing the posting.
Liabilities:MasterCard$-200.00

--- Input expression ---
d[2004/05/15]

--- Text as parsed ---
(d  [2004/05/15])

--- Expression tree ---
0xb6e710  O_GT (1)
0xb6e760   IDENT: d (1)
0xb6e860   VALUE: [2004/05/15] (1)

--- Compiled tree ---
0xb6c0f0  O_GT (1)
0xb6bcb0   IDENT: d (1)
0xb6bc60FUNCTION (1)
0xb6e860   VALUE: [2004/05/15] (1)

--- Calculated value ---
true
#+END_EXAMPLE
It actually parses the date like I would expect, but the =/^Liabilities/ fails

ledger parse =/^Liabilities/

#+BEGIN_SRC
--- Context is first posting of the following transaction ---
2004/05/27 Book Store
; This note applies to all postings. :SecondTag:
Expenses:Books 20 BOOK @ $10
; Metadata: Some Value
; Typed:: $100 + $200
; :ExampleTag:
; Here follows a note describing the posting.
Liabilities:MasterCard$-200.00

--- Input expression ---
=/^Liabilities/

--- Text as parsed ---


--- Expression tree ---

--- Compiled tree ---

--- Calculated value ---
Error: Assertion failed in /home/mcbeth/Source/Offsite/ledger/src/exprbase.h, 
line 182: ledger::expr_base_tResultType::result_type 
ledger::expr_base_tResultType::calc() [with ResultType = ledger::value_t; 
ledger::expr_base_tResultType::result_type = ledger::value_t]: context
#+END_EXAMPLE

Hopefully this is enough information for someone to help me in my 
misunderstanding...

Jeff
-- 
The man who does not read good books has no advantage over 
 the man who cannot read them.
 -- Mark Twain

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Virtual postings, and money transfers

2013-03-04 Thread Jeffrey Brent McBeth
On Mon, Mar 04, 2013 at 06:47:47PM -0500, Sam Stuck wrote:
 In the second transaction, you pull a *different* 100 to be
 transferred. You move 100 into Savings:Toys, then move another 100
 into Assets:Checking. The amount must be in either Savings:Toys or
 Assets:Savings, but cannot be in both.

I understand why I'm currently being double booked.  What I don't understand is 
how to sanely start with:
ledger bal
   100 Assets:Checking
50 Savings:Toys
50 Assets:Savings
  -200 Equity

ledger bal --real
   150 Assets:Checking
50 Assets:Savings
  -150 Equity

And end up with:
ledger bal
   100 Assets:Checking
50 Savings:Toys
50 Assets:Savings
  -200 Equity

ledger bal --real
  100 Assets:Checking
  100 Assets:Savings
 -200 Equity

-- 
The man who does not read good books has no advantage over 
 the man who cannot read them.
 -- Mark Twain

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Virtual postings, and money transfers

2013-03-04 Thread Jeffrey Brent McBeth
Err, the second equity should read -200.  That'll teach me to try to imitate 
Ledger's output by hand :)


On Mon, Mar 04, 2013 at 07:08:56PM -0500, Jeffrey Brent McBeth wrote:
 On Mon, Mar 04, 2013 at 06:47:47PM -0500, Sam Stuck wrote:
  In the second transaction, you pull a *different* 100 to be
  transferred. You move 100 into Savings:Toys, then move another 100
  into Assets:Checking. The amount must be in either Savings:Toys or
  Assets:Savings, but cannot be in both.
 
 I understand why I'm currently being double booked.  What I don't understand 
 is how to sanely start with:
 ledger bal
100 Assets:Checking
 50 Savings:Toys
   50 Assets:Savings
   -200 Equity
 
 ledger bal --real
150 Assets:Checking
 50 Assets:Savings
   -150 Equity
 
 And end up with:
 ledger bal
100 Assets:Checking
 50 Savings:Toys
   50 Assets:Savings
   -200 Equity
 
 ledger bal --real
   100 Assets:Checking
   100 Assets:Savings
  -200 Equity
 
 -- 
 The man who does not read good books has no advantage over 
  the man who cannot read them.
  -- Mark Twain
 
 -- 
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 Ledger group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to ledger-cli+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.
 
 

-- 
The man who does not read good books has no advantage over 
 the man who cannot read them.
 -- Mark Twain

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Virtual postings, and money transfers

2013-03-03 Thread Jeffrey Brent McBeth
On Sun, Mar 03, 2013 at 02:24:25PM -0600, John Wiegley wrote:
  mcbeth  mcb...@broggs.org writes:
 
  The best I've come up with so far is to transfer the money from Savings:Toys
  back into checking, then from Checking to Assets:Saving and from
  Assets:Saving to Savings:Toys again...  Seems cumbersome.  What am I
  missing?
 
 Can you explain in more detail the functionality you gain by round-tripping
 the funds like this through several accounts only to come back to
 Savings:Toys?

Maybe none.  What I'm hoping for is if I call ledger with --real, I would get 
the correct amounts in my real accounts.  If I call ledger without it, I want 
the money that is in my savings to not be in either real account.  What I have 
done right now is wrong

I have
Date Save
 [Assets:Checking]
 [Savings:Toys]  100

and
LaterDate Transfer
 Assets:Checking
 Assets:Savings 100

The second entry makes sure that my Assets have the right totals with --real, 
but double books the savings with virtual postings on.  So, I'm wondering how 
to modify my entries to get the totals right in both situations.

Hopefully, this is slightly more clear?

Jeff

-- 
The man who does not read good books has no advantage over 
 the man who cannot read them.
 -- Mark Twain

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.