Re: Understanding the valuation function and the market function

2016-03-19 Thread Jakob Mattsson
I spend money in two currencies, as I line and work in two places. I don't
want expenses in any of these to be revalued over time in terms of the
other and I don't want ledger to report a capital gain on transactions
between those two currencies. For this, the --historical flag makes perfect
sense.

For actual investments, like my stock and my property, I very much want the
opposite. These should be revalued over time and there's a clean capital
gain/loss on every such transaction.

The section in the docs called "complete control over commodity prices" (or
something like that) lists a lot of different ways to work with this, many
of which would solve my use case, but I can't get any of them to work as I
don't seem to have understood the valuation-function and the
market-function properly.

On Sat, 19 Mar 2016 at 22:13, Martin Blais  wrote:

> Why are you trying to do this?
> Can you provide context... what's the use case?
>
>
>
> On Sat, Mar 19, 2016 at 3:58 PM, Jakob Mattsson 
> wrote:
>
>> Thanks, -H gives me the output I expected in this example!
>>
>> Now, the problem is that I don't want to value ALL commodities at
>> their acquisition price, only some of them. I'd like to control it per
>> commodity, per transaction or something like that. The docs makes it sound
>> like "VALUE::" should allow me to do it, but I can't seem to get it to work.
>>
>
>> On Thu, Mar 10, 2016 at 8:44 PM John Wiegley 
>> wrote:
>>
>>> > Jakob Mattsson  writes:
>>>
>>> > The expense has clearly been computed using 1.2 rather than 1.4, which
>>> is
>>> > what I wanted, but it's 100 times too large! Why? I've been fiddling
>>> with
>>> > this for quite a while now and can't understand what is going on.
>>>
>>> I think what you want is to add --historical (or -H) to your -X report.
>>>
>>> --
>>> John Wiegley  GPG fingerprint = 4710 CF98 AF9B 327B B80F
>>> http://newartisans.com  60E1 46C4 BD1A 7AC1 4BA2
>>>
>> --
>>
>> ---
>> 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.
>>
> --
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "Ledger" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/ledger-cli/dc6F-HvZOyE/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> ledger-cli+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 

--- 
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: Understanding the valuation function and the market function

2016-03-19 Thread Martin Blais
Why are you trying to do this?
Can you provide context... what's the use case?



On Sat, Mar 19, 2016 at 3:58 PM, Jakob Mattsson 
wrote:

> Thanks, -H gives me the output I expected in this example!
>
> Now, the problem is that I don't want to value ALL commodities at
> their acquisition price, only some of them. I'd like to control it per
> commodity, per transaction or something like that. The docs makes it sound
> like "VALUE::" should allow me to do it, but I can't seem to get it to work.
>
> On Thu, Mar 10, 2016 at 8:44 PM John Wiegley 
> wrote:
>
>> > Jakob Mattsson  writes:
>>
>> > The expense has clearly been computed using 1.2 rather than 1.4, which
>> is
>> > what I wanted, but it's 100 times too large! Why? I've been fiddling
>> with
>> > this for quite a while now and can't understand what is going on.
>>
>> I think what you want is to add --historical (or -H) to your -X report.
>>
>> --
>> John Wiegley  GPG fingerprint = 4710 CF98 AF9B 327B B80F
>> http://newartisans.com  60E1 46C4 BD1A 7AC1 4BA2
>>
> --
>
> ---
> 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.
>

-- 

--- 
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: Working with per-bank-account files

2016-03-19 Thread Craig Earls
I have an emacs script that reads the CSV files in. It is smart enough to
know what asset account it is reading in and has limited abilities to fuess
at an expense category

I probably hand enter 5% of my transactions (~17 per day across all
accounts)

I would share the enacs code but ut is highly tuned to the CSV i fet from
my banks.

On Thursday, March 17, 2016, Tobias Pfeiffer  wrote:

> Hi Craig,
>
> On Thu, 17 Mar 2016 08:08:25 -0700 Craig Earls wrote:
> > I use one big file.
> >
> > My account tree looks like this:
> >
> > Assets:BankA:Checking
> > Assets:BankA:Savings
> > Assets:BankB:Savings
>
> So how do you get your data into that big file? Do you input the data
> by hand?
>
> Thanks
> Tobias
>
> --
>
> ---
> 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.
>


-- 
Craig, Corona De Tucson, AZ
enderw88.wordpress.com

-- 

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


Working with per-bank-account files

2016-03-19 Thread Tobias Pfeiffer
Hi,

I wanted to ask the mailing list for a kind of "best practice" approach
when working with multiple "physical" (that word doesn't fit at all,
though) accounts, like bank, credit card, PayPal etc.

To import data from the past into ledger, I have written scripts that
read my account statements from multiple accounts (CSV in all possible
formats, PDFs etc.) and write them to ledger files, such as
"credit-card.ledger", "savings.ledger", "paypal.ledger" etc. Now with
that approach, I can do stuff like
  $ ledger -f credit-card.ledger -f savings.ledger -f paypal.ledger bal
and that works correctly, but there are several issues I was thinking
about:

- The entries are in correct date order within each file, but when I
  combine them (either using multiple `-f` parameters or one file with
  `include` directive) then they are not, so without extra sorting
  parameters, `ledger reg` gives an unordered output. Also, balance
  assertions for transactions from one of those account to another
  account do not work if the transaction is not in the correct
  position. Therefore I considered to write a script that merges these
  files in the correct date order into some big "all.ledger" file.

- For future updates, of course I want to use the exact same scripts,
  rather than adding transactions by hand. In fact, since I add my cash
  expenses to a mobile app right away and can import into ledger from
  there, it should hardly be necessary to add transactions manually.
  That means that every month or so (whenever a new account statement
  arrives), I would re-run my scripts and then merge them with
  all.ledger. However, I would have to deal with transactions that
  appear in *two* account statements (like, when sending money from my
  savings account to PayPal).

- Often it will become necessary to edit transactions by hand, for
  example, change the clearing state, add or remove tags or edit the
  payee. I wonder in which files to do this and if it will work
  correctly with merging.

So, all of this is not exactly rocket science and surely doable, but I
thought that probably everyone that maintains multiple files and/or does
not enter all transactions by hand must have run into similar issues, so
maybe there is a set of recommendations or best practices, or even
helper scripts available? Looking forward to hearing any advice!

Thanks,
Tobias

-- 

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


signature.asc
Description: PGP signature


Re: Working with per-bank-account files

2016-03-19 Thread Martin Michlmayr
* Tobias Pfeiffer  [2016-03-17 23:55]:
> - The entries are in correct date order within each file, but when I
>   combine them (either using multiple `-f` parameters or one file with
>   `include` directive) then they are not, so without extra sorting
>   parameters, `ledger reg` gives an unordered output. Also, balance
>   assertions for transactions from one of those account to another
>   account do not work if the transaction is not in the correct
>   position. Therefore I considered to write a script that merges these
>   files in the correct date order into some big "all.ledger" file.

I use something similar at the moment instead of include directives
because the latter doesn't show line numbers of the included files
properly when there are errors.

I do something like:

cat bank/2016/*.ledger | ledger -f - --sort d print > 2016

> - For future updates, of course I want to use the exact same scripts,
>   rather than adding transactions by hand. In fact, since I add my cash
>   expenses to a mobile app right away and can import into ledger from
>   there, it should hardly be necessary to add transactions manually.
>   That means that every month or so (whenever a new account statement
>   arrives), I would re-run my scripts and then merge them with
>   all.ledger. However, I would have to deal with transactions that
>   appear in *two* account statements (like, when sending money from my
>   savings account to PayPal).

I'm not sure I understand the part about adding transactions manually
(I maintain a separate .ledger file with cash expenses that is merged
into my final ledger file.)

But regarding transactions in different accounts (e.g. paying your
credit card bill with your bank account): I use an Assets:Transfer
account, as someone suggested on this list a few years ago. (I can
look for a link if you want, but the basic idea is: one transaction
does: Assets:Bank -> Assets:Transfer; and the other Assets:Transfer ->
Liabilities:Credit Card).

The other solution would be use to an UUID tag; if two transactions
have the same UUID, ledger will ignore one.

> - Often it will become necessary to edit transactions by hand, for
>   example, change the clearing state, add or remove tags or edit the
>   payee. I wonder in which files to do this and if it will work
>   correctly with merging.

I only add *new* transactions to my ledger files with my import scripts.
This way, I can modify old entries without any problems.

-- 
Martin Michlmayr
http://www.cyrius.com/

-- 

--- 
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: Working with per-bank-account files

2016-03-19 Thread Tobias Pfeiffer
Hi Craig,

On Thu, 17 Mar 2016 08:08:25 -0700 Craig Earls wrote:
> I use one big file.
> 
> My account tree looks like this:
> 
> Assets:BankA:Checking
> Assets:BankA:Savings
> Assets:BankB:Savings

So how do you get your data into that big file? Do you input the data
by hand?

Thanks
Tobias

-- 

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


signature.asc
Description: PGP signature