Re: Automatically Credit an Account

2014-06-03 Thread Jostein Berntsen


On Tuesday, June 3, 2014 12:42:50 AM UTC+2, b0ef wrote:

 Jostein Berntsen jbe...@broadpark.no javascript: writes: 

  This seems to work for me: 
  
  = /Assets:1500/ 
   
 Assets:Total  1 
   Income:3010  -1 
  2014-06-02 foo   
  
 Assets:1500:foo:101011337 
  Assets:Total 
  2014-06-03 foo   
  
 Assets:1500:foo:201015100 
  Assets:Total 

 That's because you're doing something totally different. 

 If you look at my example, I only have one line in each transaction. 

 I don't want to write, ie Assets:Total 15 brazillion times. 



Then you can do something like this:

bucket 
Income:3010 




2014-06-02 
foo 

 

Assets:1500:foo:101011337

2014-06-03 
foo 

 

Assets:1500:foo:201015100
 
 ledger -f ~/Documents/Finans/testing/test.dat bal
6437  Assets:1500:foo
133710101
510020101
   -6437  Income:3010

   0

Jostein

-- 

--- 
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: Automatically Credit an Account

2014-06-03 Thread Esben Stien
Jostein Berntsen jber...@broadpark.no writes:

 Then you can do something like this:
 bucket Income:3010 

Now that's what I'm talking about;)

Hehe, that's excellent. I just placed the bucket statement in the top of
my file and it's working

Found it in the manual also. 

Really great; thanks.

I should probably put these income files in a different file, so as to
not auto balance any other transaction. 

-- 
Esben Stien is b0ef@e s  a 
 http://www. s tn m
  irc://irc.  b  -  i  .   e/%23contact
   sip:b0ef@   e e 
   jid:b0ef@n n

-- 

--- 
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: Automatically Credit an Account

2014-06-03 Thread Martin Blais
On Mon, Jun 2, 2014 at 8:55 PM, Martin Blais bl...@furius.ca wrote:

 Why don't you build a tool for printing out the result of these rule-based
 modifications? Do you think that would be useful? Is it possible? I see a
 lot of questions like: Why doesn't my rule such and such work? I see
 unexpected results in the register. If Ledger had a command to expand
 everything, and print the expanded results, all of these questions would
 be easily answered by inspecting what it's doing, no? Is that easy to
 implement?

 Just an idea. I'm building something exactly like that for Beancount, to
 help in debugging plugins, which are essentially functions that transform a
 list of entries in arbitrary ways, into a new, modified list of entries.
 One should be able to diff the files and round-trip between data-structure
 to text and back.


Actually, I just completed support for round-trips tonight (I had been
writing comparison code lately in order to make it easier to write tests by
writing a list of expected transactions in the input syntax itself, so it
was a-propos). This means that Beancount can now read a complete ledger
file, spit it back out in text, and re-reading that output generates the
same data structures in memory. Writing that re-read structure out again to
a second file also shows no file diff against the first output to text,
it's identical. I tested this on my gigantic personal ledger of 8 years,
and it passes clean.

I'll add a new report type called print shortly, which will just spit out
the data structure it read in memory back to text, after running all the
transformations (e.g. automatically setting the amounts on postings,
processing the tag directives, adding price entries for postings at a
price, and whatever else the plugins do). This should be a nice debugging
tool in the future, as it reflects what it does, e.g., what was
automatically generated by the syntax shortcuts.

-- 

--- 
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.