Re: Grouping by account and total by month

2024-04-19 Thread John Wiegley
> "NT" == Nothing ToSee  writes:

NT> When I try to run this command: ledger --pedantic -f journal.lgr reg
NT> expenses -b 2023-01-01 -X USD --no-revalued --group-by 'account' -M , the
NT> transactions are grouped by account, but they are repeated in each account
NT> starting from the second group.

I confirm this error is happening for me too locally, although I don’t know
yet what might be causing this. I’m on vacation now, so it will be a little
while before I can look into it.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2cyql3sns.fsf%40newartisans.com.


Re: What could be the reason for this warning?

2024-02-02 Thread John Wiegley
> "lf" == lipp f  writes:

lf> Getting many warnings like this:
lf> Warning: "/mnt/e/Data/Invest/data//ldg-t14/t14.j", line 27591:
lf> Transaction check failed: (commodity == "TDB164")

Elsewhere in your file do you have a ‘check’ directive that is assertion some
condition for each of your postings?

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2zfwimukt.fsf%40newartisans.com.


Re: fixed lot prices

2024-01-05 Thread John Wiegley
> "TO" == Tavis Ormandy  writes:

TO> 09-Jan-01 Shell Expenses:Gasoline  11 GAL {=$2.299} 11 GAL 
{=$2.299}
TO> Assets:Checking$-25.29 $-25.29
TO>   11 GAL {=$2.299}
TO> 
TO> Shouldn't it debit the checking account (11 * $2.30) = $25.30, not ($11 *
TO> $2.299) = $25.29?

Yes, according to the text in the manual it sounds like it should be $25.30.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2cyuf1dr1.fsf%40newartisans.com.


Re: Filtering by commodity issue

2023-12-15 Thread John Wiegley
> "lf" == lipp f  writes:

lf> I have a commodity called "T 210618C0003" and I want to filter the
lf> register by this  commodity.

lf> When I use "like" operator it works fine but when I use equal operator
lf> does not work. Any advice?

That’s very interesting. The quotes are part of the name, it appears. You can
use this:

ledger reg -l 'commodity=="\"T 210618C0003\""'

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m24jgjp1uo.fsf%40newartisans.com.


Re: Capital gain records

2023-12-14 Thread John Wiegley
> "lf" == lipp f  writes:

lf> Sorry, my question was if there is  a way to automate this. I have more
lf> than 2000 transactions and doing that manually is not really an option.

I see, I wrote a Haskell program to generate these entries from a CSV file. I
don’t know of any automation that wouldn’t involve some coding.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2o7esgfpb.fsf%40newartisans.com.


Re: Capital gain records

2023-12-14 Thread John Wiegley
> "lf" == lipp f  writes:

lf> I'm importing all transactions from my broker. They are buy / sell
lf> securities. Is there a easy way to create the capital gain records?

For purchases, just to be sure to record the price at purchase of the late.

For sales, you need to record the price of the lot along with the price of the
sale, which will create an need for Ledger to balance the gain or less.

Here’s a real example:

2021/01/29 * BOT +100 AMC @13.00
Assets:TD:Brokerage:Equities 100 AMC @ $13.00
Assets:TD:Brokerage:Cash  $-1,300.00

2021/02/01 * SOLD -100 AMC @14.00
(Expenses:TD:Fees) $0.04
Income:Capital:Short $-99.96
Assets:TD:Brokerage:Equities-100 AMC {$13.00} @ $14.00
Assets:TD:Brokerage:Cash   $1,399.96

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m25y10b5wy.fsf%40newartisans.com.


Re: Error: Only one posting with null amount allowed per transaction

2023-11-30 Thread John Wiegley
> "RM" == Roger Mason  writes:

RM> touch my.ledger
RM> ledger convert /home/rmason/Personal/Finances/PlainText/foo.csv -f 
/home/rmason/Personal/Finances/PlainText/my.ledger
RM> While parsing file "/home/rmason/Personal/Finances/PlainText/foo.csv", line 
1:
RM> While parsing CSV line:
RM>   2023-11-20,"Point of Sale - Interac RETAIL PURCHASE 01553028 CIRCLE K 
# 252",100.54,

RM> Error: Only one posting with null amount allowed per transaction

OK, now can you get me a small enough file that reproduces this issue so that
I can manifest the error on my side?

Thanks,
  John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2y1efneis.fsf%40newartisans.com.


Apologies about the spam

2023-11-28 Thread John Wiegley
Somehow a user who had posted valid content in the past had their account 
taken over and was able to submit a lot of spam. They've been banned and 
the spam reported.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/669bca08-b066-40e1-a8bf-be5417662d59n%40googlegroups.com.


Re: Error: Only one posting with null amount allowed per transaction

2023-11-27 Thread John Wiegley
> "RM" == Roger Mason  writes:

RM> If I run:

RM> ledger convert foo.csv -f ./my.ledger

RM> I get: Error: Cannot read journal file
RM> "/usr/home/rmason/Personal/Finances/PlainText/foo.csv"

Can you try with absolute paths for both files?

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2a5qyhqlp.fsf%40newartisans.com.


Re: Error: Only one posting with null amount allowed per transaction

2023-11-22 Thread John Wiegley
> "RM" == Roger Mason  writes:

RM> I don't know what information you need but this is the top few lines of
RM> the CSV file:

RM> date,description,debit,credit
RM> 2023-11-20,"Point of Sale - Interac RETAIL PURCHASE 01553028 CIRCLE K # 
252",100.54,
RM> 2023-11-20,Point of Sale - Interac RETAIL PURCHASE 01671085 SOBEYS 
#590,3.00,
RM> 2023-11-20,Point of Sale - Interac RETAIL PURCHASE 332310187408 DOLLARAMA 
#1440,50.60,

When I create a file containing these lines, and run “ledger convert” on it,
it outputs the following:

  Vulcan ~/dl $ ledger convert foo.dat
  2023/11/20 * Point of Sale - Interac RETAIL PURCHASE 01553028 CIRCLE K # 
252
  Expenses:Unknown$-100.54
  Equity:Unknown
  
  2023/11/20 * Point of Sale - Interac RETAIL PURCHASE 01671085 SOBEYS #590
  Expenses:Unknown  $-3.00
  Equity:Unknown
  
  2023/11/20 * Point of Sale - Interac RETAIL PURCHASE 332310187408 DOLLARAMA 
#1440
  Expenses:Unknown $-50.60
  Equity:Unknown

Is there anything more I need to reproduce the error?

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2v89tfq8b.fsf%40newartisans.com.


Re: Make "reg" output the account balance

2023-11-22 Thread John Wiegley
> Ondřej Čertík  writes:

>> Does something like `--display-total account.total` help?

> It doesn't seem to show the correct totals. Consider:

Hmm… this doesn’t seem like something that the ‘reg’ report will ever be able
to do, since it’s designed around a running total that reflects the direct
summation of the amounts displayed. What you want is almost like a
running-form version of the balance report. I don’t think Ledger has anything
like this built in.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2h6ldegxl.fsf%40newartisans.com.


Re: Error: Only one posting with null amount allowed per transaction

2023-11-22 Thread John Wiegley
> "s" == sprock   writes:

s> I'm getting this error:

s> While parsing file "/usr/home/sprock/Personal/Finances/ledger.csv", line 1:
s> While parsing CSV line:   2023-11-20,Point of Sale - Interac RETAIL
s> PURCHASE 01553028 CIRCLE K # 252,100.54,

s> Error: Only one posting with null amount allowed per transaction

s> using this command line:
s> ledger convert ledger.csv --input-date-format "%Y-%m-%d" -f my.ledger

The convert sub-command does quite a bit of work, so it’s hard to say exactly
what’s going wrong in this scenario from the information provided.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2leapegzv.fsf%40newartisans.com.


Re: Make "reg" output the account balance

2023-11-15 Thread John Wiegley
> "OČ" == Ondřej Čertík  writes:

OČ> Does anybody know how to do that?

Does something like `--display-total account.total` help?

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m24jhmx0ru.fsf%40newartisans.com.


Re: Force balance report to always put sub accounts in own node

2023-10-11 Thread John Wiegley
> "NS" == Nikita Skobelevs  writes:

NS> --empty seems relevant but not quite what I'm looking for.
NS> It would help in the above example if I already had some account
NS> Baz:* that was 0 and not displayed, but in this case Foo is the only
NS> subaccount in Baz so --empty doesn't change how it's displayed
NS> I'm assuming there's logic somewhere checking if there's more than 1
NS> subaccount and if so putting them over multiple lines - I'm looking
NS> for a way to force that behaviour so every ":" forces a new node in
NS> the indented tree.

I’m reading the code, but it’s been a while since I last worked on it. I don’t
think this feature exists, but I agree it’s a pretty obvious omission for it
not to be there. There should be a way to ask it not to collapse accounts,
even if they are empty or unused.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m28r89jav7.fsf%40newartisans.com.


Re: Force balance report to always put sub accounts in own node

2023-10-09 Thread John Wiegley
> "NS" == Nikita Skobelevs  writes:

NS> I was wondering if it's possible to force the balance report to
NS> always have sub accounts as new nodes in the indented tree even if
NS> there's only 1 sub account? Either with some flag or custom
NS> --balance-format?

Does --empty does what you want?

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2a5srz9bq.fsf%40newartisans.com.


Re: Ledger turns 20 today!

2023-09-29 Thread John Wiegley
Thank you for noticing, Alexis! Indeed, it did begin that long ago, originally 
as a CVS repository on my G4 MacBook at the time. I was staying at my brother's 
house in San Jose for a few weeks while looking for an apartment, living off 
savings, which is what made knowing my financial situation at the time a 
critical factor. Thus Ledger was born, since GNUcash wasn't satisfying all of 
the different reporting needs that I had then.

On to another 20! :)

John

On Fri, Sep 29, 2023, at 11:40 AM, Alexis wrote:
> Hi all,
>
> according to the commit history on GitHub¹ ledger turns 20 today!
> And ledger has come a long way since its initial revision.
>
> Thank you, John, for writing ledger and thank you everyone else who
> has contributed over the years to or is using it!!
>
>
> Here's to 20 more
> Alexis

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/b2175cff-5a60-4937-b258-a055ee0336d7%40app.fastmail.com.


Re: Is there any way to do a currency conversion with "ledger csv"

2023-09-12 Thread John Wiegley
> "lf" == lipp f  writes:

lf> Using "reg":
lf> $ ledger reg INV:Assets:External -X CAD 

lf> I'm getting 1230 lines like this:

Ah, try the --no-revalued option.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2sf7j2u9l.fsf%40newartisans.com.


Re: Is there any way to do a currency conversion with "ledger csv"

2023-09-11 Thread John Wiegley
> "lf" == lipp f  writes:

lf> $ ledger csv INV:Assets:External -X CAD -V | csvcut -c 1,6,5

The -X and -V options are mutually exclusive, so I would use only “-X CAD”.
Maybe you can use it with the register command, to find out what all of those
entries are that it’s reporting?

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2h6o05gjc.fsf%40newartisans.com.


Re: Owner withdrawals in journal?

2023-09-07 Thread John Wiegley
> "MJ" == Michael Jones  writes:

MJ> Owner withdrawals - I mean money that I take out of my business each
MJ> month.

It sounds like an asset transfer, from the company’s assets to your assets, is
that about right?

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2a5tx3bqn.fsf%40newartisans.com.


Re: Owner withdrawals in journal?

2023-09-07 Thread John Wiegley
> "MJ" == Michael Jones  writes:

MJ> Apologies if this has been asked before. I'm just staring out with Ledger
MJ> and have got a bit stuck.

MJ> I'm not quite sure I understand how to enter owner withdrawals in my
MJ> journal. I know it's not an asset or a liability. What type of account is
MJ> it?

MJ> At the moment I've just got something like this:

MJ> 2023/06/11  MJ Monthly
MJ>   Assets:PW Current            £ -2500.00
MJ>   Withdrawals                  £ 2500.00

MJ> Do I need to be doing something with Equity?

Can you say more about what “owner withdrawals” are?

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2fs3p66oq.fsf%40newartisans.com.


Re: Subtracting subtree values

2023-08-12 Thread John Wiegley
Won’t that option collapse the sub account balances into the parent?

John

On Sat, Aug 12, 2023, at 12:41 PM, david kayal wrote:
> Why not use —collapse?
> 
> On Sat, Aug 12, 2023 at 12:27 PM John Wiegley  wrote:
>> >>>>> "DC" == Dillan Chang  writes:
>> 
>> DC> If you run bal Assets, you currently get:
>> DC> $100.00   Assets:Checking
>> DC> $30.00   Virtual-A
>> DC> $70.00   Virtual-B
>> 
>> You’d need to run:
>> 
>> ledger bal -T amount '^Assets$'
>> 
>> In order to report amounts, not aggregate totals, and to confine your report
>> to exactly the Assets account alone.
>> 
>> John
>> 
>> -- 
>> 
>> --- 
>> 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 
>> <mailto:ledger-cli%2bunsubscr...@googlegroups.com>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ledger-cli/m21qg8f4eu.fsf%40newartisans.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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ledger-cli/CAKr7iWiX2Y_ghkJ9u-_Mrs1D3c4OO5JDS%3D-dD1ieRKjB49cvZQ%40mail.gmail.com
>  
> <https://groups.google.com/d/msgid/ledger-cli/CAKr7iWiX2Y_ghkJ9u-_Mrs1D3c4OO5JDS%3D-dD1ieRKjB49cvZQ%40mail.gmail.com?utm_medium=email_source=footer>.

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/d472c81a-81f6-41ad-96a9-2133ca3ea994%40app.fastmail.com.


Re: Subtracting subtree values

2023-08-12 Thread John Wiegley
> "DC" == Dillan Chang  writes:

DC> If you run bal Assets, you currently get:
DC> $100.00   Assets:Checking
DC> $30.00       Virtual-A
DC> $70.00       Virtual-B

You’d need to run:

ledger bal -T amount '^Assets$'

In order to report amounts, not aggregate totals, and to confine your report
to exactly the Assets account alone.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m21qg8f4eu.fsf%40newartisans.com.


Re: Register Report Output

2023-07-16 Thread John Wiegley
> "J" == Jasel17212   writes:

J> I looked through the manual and didn’t see an option for this, but hoping
J> someone knows of a way to produce a register report and force ledger to
J> print the payee on every line.

If you look at the register-format that’s defined in report.h, it contains a
%/ character followed by lines that are used when the “header line” is
unchanged. You would want a version of the format string that simply deletes
%/ and everything that follows it. Then it should print the same thing for
every posting, which would mean repeating the postings. You should be able to
do this with the -F option, but it’s going to be a very long string that you
pass, so wrapping it up in a shell script is recommend.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2351om4le.fsf%40newartisans.com.


Re: Sync Ledger with the MyExpenses Android App

2023-06-20 Thread John Wiegley
> "I" == IanTwenty   writes:

I> Just want to let you know about a new script I wrote that lets you
I> sync your ledger files with the android app MyExpenses. It's open
I> source (GPL3.0) and written in BASH for Linux:

This is great to hear about, thank you!

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2legevsyw.fsf%40newartisans.com.


Re: Multiple Currencies: Budgeting

2023-06-11 Thread John Wiegley
> "SAN" == Scott A Nichols  writes:

SAN> Note: Everything else works perfect for me in ledger using multiple
SAN> currencies (data input, running reports, and so forth), the only thing
SAN> I'm struggling with is budgeting. I want it to work exactly (or at least
SAN> very similar) to the "budget" command in Ledger.

When the budgeting feature was designed, I just never took multiple currencies
into account. Does it help if you use -V or -X , in order to report
things in one currency or the other?

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2r0qhs6fx.fsf%40newartisans.com.


Re: Printing to stdout

2023-06-11 Thread John Wiegley
> Alexis   writes:

> * Should ledger really be looking for and use less if PAGER is unset? Isn't
> the absence of PAGER and indicator that the user prefers their output
> straight to the terminal?

I don’t think it should. If PAGER is not set, it shouldn’t use a pager…

> * When looking for less shouldn't ledger search all directories in PATH
> instead of hard-coded locations? If yes, does anyone know of a UNIX PATH
> searching function readily available, e.g. in the Boost Filesystem Library¹
> before a custom one is added?

Yes, searching PATH is The Right Way.

> * Where and how is LEDGER_PAGER used in the source code?
>   A quick grep for LEDGER_PAGER did not

>   Is there some generic code that allows any ledger command-line option
>   to be used as an upper-cased and LEDGER_-prefix environment variable?
>   If yes, where is it implemented?

Yes, the code to do so begins here:

  https://github.com/ledger/ledger/blob/master/src/global.cc#L394

> * How could this be tested along with other unit tests, so that once a
> desired behaviour is defined its implementation is tested.

You could use a pager that ignores everything and just outputs “I was used”,
and then set the test expectation to that value?

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m28rcptl1x.fsf%40newartisans.com.


Re: Printing to stdout

2023-06-10 Thread John Wiegley
> "BW" == Bob Wilson  writes:

BW> --no-pager works. Terminology in hand, the guide suggested looking at the
BW> LEDGER_PAGER environment variable, which is unset on my platform.

BW> I installed via homebrew (I'm on macos 13.4). Perhaps some detail on how
BW> they compiled ledger is relevant?

It looks like this may have broken in commit
21280a9da3ca6ed70a10f95e1ef0717d5f65ee99:

  commit 21280a9da3ca6ed70a10f95e1ef0717d5f65ee99
  Author: Martin Michlmayr 
  Date:   Tue Jun 16 13:17:53 2020 +0800
  
  Use PAGER when environment variable is set
  
  The code looked for "less" if $PAGER is not set, but it didn't
  actually use $PAGER when it it defined.
  
  Fixes #1674

Nothing else since that earlier release date has changed the PAGER logic.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2legrw1no.fsf%40newartisans.com.


Re: Reducing repetition/duplication of amount value in entries

2023-06-10 Thread John Wiegley
> "VA" == Viraj Alankar  writes:

VA> Something I was a bit confused about. If I change the automated
VA> transaction to:

VA> = "Liabilities:Apple Card" and has_tag("cashback")

This is a bug in the query parser, which you can see by running:

  ledger query '"Liabilities:Apple Card" and has_tag("cashback")'

It seems that %cashback also has a bug, but it’s harmless and so you don’t
notice the problem.

The query parser needs an overhaul.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2pm63w1s0.fsf%40newartisans.com.


Re: Printing to stdout

2023-06-10 Thread John Wiegley
> "BW" == Bob Wilson  writes:

BW> Previously, running a command like `ledger -f ledger.dat balance ^ Assets`
BW> would print results directly to the screen and return me to the prompt,
BW> but now that same command prints results to some kind of temporary screen
BW> that disappears when I hit `q`. It's like the difference between `cat` and
BW> `less`. Sorry I don't know the right terminology!

Can you try with the --no-pager option? I’m not sure why the default behavior
would have changed, though…

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2ttvfvn7a.fsf%40newartisans.com.


Re: Reducing repetition/duplication of amount value in entries

2023-06-09 Thread John Wiegley
> "VA" == Viraj Alankar  writes:

VA> I found one way that I think should work:
VA> = "Liabilities:Apple Card" and %cashback
VA> Assets:Apple Cash   (-tag("cashback"))
VA> Income:Credit Card Rewards   (tag("cashback"))

VA> 2023/06/06 McDonalds
VA> ; cashback:: 0.02
VA> Expenses:Food:Restaurants   $23.98
VA> Liabilities:Apple Card
VA> 2023/06/07 Transfer
VA> Liabilities:Apple Card  $23.98
VA> Assets:Some bank

VA> Mainly found by searching bugs. The manual would really benefit with some
VA> more realistic examples in the Automated Transactions section.

Interesting example! Please feel free to submit it as an addition to the docs,
if you’d be willing.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2o7lompl5.fsf%40newartisans.com.


Re: Strange sorting when using --market and multiple currencies

2023-04-14 Thread John Wiegley
> "VA" == Viraj Alankar  writes:

VA> Hm, strange it gives me a segmentation fault:
VA> ledger -f ledger.ledger --price-db prices.db -Y -V -c --period-sort '
VA> (display_amount)' -b "2023" register ^expenses
VA> Segmentation fault

Using this same options with my own data, I didn't not see a segmentation
fault. I'd like to get to the bottom of that!

VA> ledger --version
VA> Ledger 3.2.1-20200518, the command-line accounting tool

VA> Perhaps I should try a newer version? This is installed from
VA> conda-forge.

If you can, it would be helpful. Also, is there a small example you'd be
willing to send me directly, that exhibits the crash?

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m27cuex9lk.fsf%40newartisans.com.


Re: Strange sorting when using --market and multiple currencies

2023-04-14 Thread John Wiegley
> "VA" == Viraj Alankar  writes:

VA> I'm trying to understand why sorting by amount doesn't seem to work
VA> right when using multiple currencies and --market:

VA> ledger -f ledger.ledger --price-db prices.db -Y -V -c --period-sort '
VA> (amount)' -b "2023" register ^expenses

Please try sorting by the `display_amount`.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m21qkmmpf0.fsf%40newartisans.com.


Re: Balance comparing date with date/time

2023-04-11 Thread John Wiegley
> "PFS" == Paulo Flabiano Smorigo  writes:

PFS> If I pass a date in --display to register command, like below, it works
PFS> fine. $ ledger reg -d "d>=[2023-04-01] and d<[2023-05-01]

PFS> If I use the same argument with the balance command, it fails:

PFS> $ ledger bal -d "d>=[2023-04-01] and d<[2023-05-01]"
PFS> While evaluating value expression:
PFS>   ((d >= [2023-04-01]) & (d < [2023-05-01]))
PFS>^^^
PFS> While comparing if 2023/04/11 20:34:59 is less than 2023-04-01:

PFS> Is this expected or is it a bug?

This sounds like a bug to me.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m23555yaed.fsf%40newartisans.com.


Re: divide by zero processing transaction

2023-03-23 Thread John Wiegley
> "MM" == Martin Michlmayr  writes:

MM> Yeah, I thought "format" was for *display* precision only, so it doesn't
MM> make sense that this cuts off precision. Am I misunderstanding "format?"

This has been fixed in https://github.com/ledger/ledger/pull/2224. Good find!

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m24jqbb9rr.fsf%40newartisans.com.


Re: Updating Ledger's dependencies regularly

2023-03-22 Thread John Wiegley
> "A" == Alexis   writes:

A> A conservative approach—possibly maintaining overly high backwards
A> compatibility—could be to decide that once a year Ledger's dependencies are
A> updated to the latest version of each dependency that is 4 years old.

I think I definitely fall on the conservative side of the spectrum...

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2cz50e1qi.fsf%40newartisans.com.


Re: Register filter for a specific currency

2023-02-23 Thread John Wiegley
> "PFS" == Paulo Flabiano Smorigo  writes:

PFS> Is this a bug or the expected result? If this is expected, how can I use
PFS> a register filter to show only the entries in a specific currency that
PFS> also works with --market argument?

It looks like there is no predicate that's "late" enough to catch the
post-market valuation amount, handled by this function:

  https://github.com/ledger/ledger/blob/master/src/chain.cc#L108

I thought that instead of --limit you would just need --display or --only, but
those are still not late enough. We may need a fourth type of predicate, like
--finally which only filters at the very end.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2edqh1c4x.fsf%40newartisans.com.


Re: Unexpected balance verification

2023-02-23 Thread John Wiegley
> "'WvL" == 'Dave Webb' via Ledger  writes:

'WvL> I found a transaction in my ledger for which I think balance
'WvL> verification should fail but ledger accepts it. I am using 3.3.0.
'WvL> Here is a simplified example of what I found

'WvL> 2016-08-19 OpeningBalances
'WvL>   Assets:Cash  £ 3
'WvL>   Equity:OpeningBalances

'WvL> 2016-09-25 X
'WvL>   Expenses:Other  £ 2
'WvL>   Assets:Cash  = £ 1

'WvL> 2016-09-26 X
'WvL>   Expenses:Other  £ 1
'WvL>   Assets:Cash   = £ 1       ; I would expect this to fail

Just to note, a balance assertion that has no associated amount will always
just adjust the balance to match.

Now, I edited this file to get rid of a lot of really strange whitespace, and
I changed the currency to $, just to rule out all strangeness. After I did
that, I got the output I expected to see:

  Vulcan ~/dl $ ledger -f foo.dat reg
  While parsing file "/Users/johnw/Downloads/foo.dat", line 11:
  While balancing transaction from "/Users/johnw/Downloads/foo.dat", lines 9-11:
  > 2022/09/26 X
  > Expenses:Other$1
  > Assets:Cash= $1
  Unbalanced remainder is:
$1
  Amount to balance against:
$1
  Error: Transaction does not balance

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2a6151bln.fsf%40newartisans.com.


A feature idea: An alternative org-mode input format

2023-02-09 Thread John Wiegley
Hi all,

I was thinking of creating a separate tool for translating specially formatted
Org-mode files into Ledger files. For example, this entry:

2023-01-10 Adobe Acrobat Pro
; ID: 076497DC-45F7-43EC-BFDA-00177EFC3C0D
; CREATED:  [2023-01-25 Wed 21:40]
Expenses:Administrative   $33.59
Equity:Admin:Somebody

Would be processed from this Org-mode entry:

* [2023-01-10 Tue] Adobe Acrobat Pro
   | Expenses:Administrative | $33.59 |
   | Equity:Admin:Somebody   ||
:PROPERTIES:
:ID:   076497DC-45F7-43EC-BFDA-00177EFC3C0D
:CREATED:  [2023-01-25 Wed 21:40]
:END:

Now, why might you want to record Ledger entry in Org-mode? Because you get
these added benefits:

  - Org-mode's hierarchical organization, narrowing, searching, filtering
  - Org-mode tags become Ledger tags for the whole transaction
  - Org-mode properties become Ledger metadata for the whole transaction
  - You can use Org-attach to attach files to entries
  - You can use cross-linking to jump between entries
  - You can use the agenda and calendar to review entries on given dates

There's already a Haskell library for parsing Org-mode files, so I was
thinking that building this as a UNIX tool shouldn't be but a few days work.
It would be run as follows:

org2ledger ledger.org | ledger -f - reg

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2ilga4ofw.fsf%40newartisans.com.


Re: [ANNOUNCE] ledger 3.3.0

2023-02-08 Thread John Wiegley
> "A" == Alexis   writes:

A> Thank you Martin for driving this release! It's been long overdue, so great
A> to see all these fixes and improvements finally being officially released.

Yes, thank you so much to Martin and everyone who was a part of it!

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2k00s6kl7.fsf%40newartisans.com.


Re: Query Help

2023-02-08 Thread John Wiegley
> "J" == Jasel17212   writes:

J> I'm using zsh so entered:

J> ledger reg ^exp and "(%tag1 | %tag2)" 

Sadly, it has to be more separated than this:


  ledger reg ^exp and '(%tag1' '|' '%tag2)'

It's a bug to me that the query parser interprets "(%tag1 | %tag2)"  as if you
had written "(%tag1 |" "%tag2)".

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2o7q46kmi.fsf%40newartisans.com.


Re: Query Help

2023-02-07 Thread John Wiegley
> "J" == Jasel17212   writes:

J> Is there a shorthand way to write the following query?

J> ledger reg ^exp and expr "has_meta('tag1')" or ^exp and expr
J> "has_meta('tag2')"

You may need to escape it from your shell, but this should do it:

ledger reg ^exp & (%tag1 | %tag2)

J> ledger reg ^exp and expr "has_meta('tag1')" or ^exp and expr
J> "has_meta('tag2')" --group-by 

--group-by tag('tag1')

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2edr1m32k.fsf%40newartisans.com.


Re: Stats Report Failure

2023-02-03 Thread John Wiegley
> "J" == Jasel17212   writes:

J> Is this a bug? Other than commenting out the automatic transaction, is
J> there a workaround?

Any assertion failure is always a bug.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2357mmvz3.fsf%40newartisans.com.


Re: How do period expressions work with --begin and --end?

2023-02-03 Thread John Wiegley
> "MB" == Marcin Borkowski  writes:

MB> Is that correct?  Also, is it documented somewhere?

Try the "ledger period EXPR" command, which will tell you how Ledger
interprets any given date expression. Not sure if this debugging subcommand is
documented...

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m27cwymvzx.fsf%40newartisans.com.


Re: Two questions about budgeting

2023-02-03 Thread John Wiegley
> "MB" == Marcin Borkowski  writes:

MB> 1. I can do
MB> ~ Daily from 2022-01-01 to 2023-01-01
MB> ~ Daily from 2023-01-01
MB> (the intervals are closed-open, like with -b/-e).  Right?

Yes, intervals should always be closed-open, everywhere.

MB> 2. The --invert option does nothing for the `budget` report. Correct?

I wouldn't be surprised at all if that were the case.

MB> 3. If I don't provide -b, the default for the budget seems to be what was
MB> in `~ Daily from`, but the transactions from before that date also count
MB> towards the actual expenses. That probably means that I should /always/
MB> provide -b to the `budget` report. Is that right?

I would, yes.

MB> 4. If I don't provide -e, the default (for the `budget` report) is
MB> --current. Is that correct?

That sounds right.

MB> 5. If I don't provide `from` in `~ Daily`, the default seems to be the
MB> date if the /first/ transaction on a given account. Right?

Correct.

MB> 6. (Almost) last but not least -- the `budget` report gives me a table
MB> with 5 columns: - actual expenses - budgeted expenses - the difference
MB> (negative means I spent less than the budget -- a bit counterintuitive,
MB> but makes sense given the order of the previous two) - what percentage of
MB> the budget was spent - name of the account

MB> Using classical spreadsheet column names: C = A - B and D = A/B (as
MB> percentage). Do I guess correctly?

I think so?

MB> If so, this means that the web app I wrote to present this exact
MB> information is mostly irrelevant. %-P Still, it draws a nice chart which
MB> is accessible from a smartphone. I have a post-commit hook which scp's the
MB> file to my VPS, and the web app there serves the chart - that's a very
MB> useful arrangement I plan to blog about one day.

I'm glad it's useful, but definitely, custom code can always go further.

MB> Now, my final question is this. Much of what we discuss here is apparently
MB> undocumented in the Ledger manual. My book is my book, and it contains
MB> examples and such, but I think it is fair to have these options at least
MB> mentioned in the manual. I have just fetched the ledger repo, and I can
MB> see that the last commit in `ledger/doc/ledger3.texi` was 7 years ago...
MB> Would you accept a PR with a small manual update? (One minor issue with
MB> that idea is that I don't speak texinfo, so you'd have to check every my
MB> edit very carefully.)

Absolutely! I'd be honored to accept your PR.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2bkmamw2k.fsf%40newartisans.com.


Re: How to compute average monthly expenses?

2023-01-27 Thread John Wiegley
> "MB" == Marcin Borkowski  writes:

MB> Thanks for the answer, but that still does not explain the "450" figure
MB> for me. Of course, the total is 2700, so I assume Ledger divided it by 6
MB> -- but why 6?

Hmmm.. good question, I wonder where that count is coming from.

MB> (Also, since I've decided to finally finish my booklet on accounting with
MB> Ledger, expect more questions soon;-) -- hope that's ok with you...)

Yes, very OK with me!

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2h6wbejv7.fsf%40newartisans.com.


Re: Two questions about budgeting

2023-01-27 Thread John Wiegley
> "MB" == Marcin Borkowski  writes:

> 1. Why is there no "budget transaction" for groceries for 2022-01-01?

Use this:

~ Daily from 2022-01-01

> 2. I would assume that after these three days my "books" budget should
>allow me to spend 155 PLN more on books and my "food" budget would
>be short of 30 PLN.  Yet I can see neither of these amounts in the
>report.  How to make Ledger compute them?

Did you try the "budget" report?

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2357vmzbx.fsf%40newartisans.com.


Re: Assertion failure in unistring

2023-01-25 Thread John Wiegley
> "TO" == Tavis Ormandy  writes:

TO> Hello! I've been hitting an assertion when experimenting with register
TO> formats: $ ledger --file finance.dat reg -F '%12(total)' Error: Assertion
TO> failed in "/build/ledger-SR1_DQ/ledger-3.1.3/src/unistring.h", line
TO> 72:ledger::unistring::unistring(const string&): len < 1024

Hi Tavis, the example data in your message doesn't abort on my machine. Do you
have a reproducible example I could use for debugging?

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2fsbyclkc.fsf%40Vulcan.attlocal.net.


Re: How to compute average monthly expenses?

2023-01-23 Thread John Wiegley
> o1bigtenor   writes:

> That - sir - - - -begs the question - - - what is 'average' supposed to do?

Average just takes the number of entries in a group, and divides the total by
the count. Here's the implementation:

  OPTION_(report_t, average, DO() { // -A
  OTHER(empty).on(whence);
  OTHER(display_total_)
.on(whence, "count>0?(display_total/count):0");
});

Which means that `--average` is just a short-hand for:

  --empty --display-total "count>0?(display_total/count):0"

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m235806bjk.fsf%40newartisans.com.


Re: How to compute average monthly expenses?

2023-01-23 Thread John Wiegley
> "MB" == Marcin Borkowski  writes:

MB> What is going on here? (Obviously, I expected 900 PLN monthly average.)
MB> Even more unexpectedly, when I use -p "last year", the result is exactly
MB> the same (and I would expect 300 PLN then).

I'm not sure that "--average" has ever done what everyone expects in the
balance report.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2a628c0yw.fsf%40newartisans.com.


Re: Planning new ledger release

2023-01-20 Thread John Wiegley
> "MM" == Martin Michlmayr  writes:

MM> I've been saying for months that we need a new release of ledger. There
MM> have been a lot of fixes in the last ~2 years.

MM> If anyone has pending fixes or contributions, please open PRs now.

I definitely support this, and will devote time this month to commenting and
reviewing. Please ping me anywhere that my eyes are needed, Martin.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2bkmsoejp.fsf%40newartisans.com.


Re: How to split expenses

2023-01-09 Thread John Wiegley
> "AR" == Alexandre Rademaker  writes:

AR> I am traveling friends. We are splitting some expenses like the car
AR> rental, full, some restaurants etc. but I also want to record how I paid
AR> each expense (credit card, cash etc). Idea? What is the best practice?

I usually do something like this:

2023/01/01 Sample
  Expenses:Food   $10
  Assets:Payable:Joe  $10
  Assets:Payable:Bob  $10
  Assets:Payable:Nancy$10
  Liabilities:Credit

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m27cxv2p57.fsf%40newartisans.com.


Re: Automated transaction amounts "doubled"

2022-11-10 Thread John Wiegley
> "RS" == Robert Shanley  writes:

RS> journal.txt:
RS> = expr payee == "Joe"
RS> SetAside$100
RS> MoreMoney  -$100

RS> 2022/01/05 * Joe
RS> Stuff $600.00
RS> Checking

RS> ledger -f journal.txt balance :

RS> $-600.00  Checking
RS> $-200.00  MoreMoney
RS>  $200.00  SetAside
RS>  $600.00  Stuff

RS> What am I doing wrong?

Your automated transaction expression is matching each posting within your
transaction, since they both have a payee of Joe. Imagine your file had looked
like this:

2022/01/05 * Joe
Stuff $600.00

2022/01/05 * Joe
Checking

That's where the doubling is coming from.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2bkpe1zvg.fsf%40newartisans.com.


Re: squash weekly totals across sub-accounts?

2022-11-09 Thread John Wiegley
> "A" == Alan   writes:

A> I have some of my Expense accounts organized hierarchically. For example,
A> rather than simply "Expenses:Food" I have a few accounts, such as:

A> Expenses:Food:Groceries
A> Expenses:Food:Chicken
A> Expenses:Food: ... (a few others)

A> But now I would like to get a weekly or monthly subtotal (using `-W` or
A> `-M`), summed across all Food categories. If I just query `reg
A> Expenses:Food` then of course as a regular expression that matches all of
A> the sub-categories individually. If I add `--depth 2` then it ignores all
A> the subcategories, reporting only the cases where the ledger has just
A> "Expenses:Food" exactly.

Actually, `--depth 2` should be exactly what you need, according to the --help
description:

Limit the depth of displayed accounts in balance and register reports. Any
accounts of greater depth are folded into their parent at the specified
level. For example with --depth 2 the account
Expenses:Entertainment:Dining would be folded into Expenses:Entertainment
for display. Importantly, this is a display predicate, which means it only
affects display, not the total calculations.

I'm rather surprised if it is truncating the totals as you describe. Can you
reproduce the issue in a small test case?

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2sfirh9kq.fsf%40newartisans.com.


Re: Function to regex match accounts in a transaction?

2022-10-30 Thread John Wiegley
> Martin Michlmayr  writes:

> You want to --group-by the Assets: account to find on which broker account
> you received dividends, e.g.:

> bal Income:Dividends --group-by get_account("^Assets:Broker")

I'm not sure this means what you expect it to mean...

--group-by EXPR evaluates EXPR *for every entry in the report* and then groups
the results by the strings yielded from that evaluation.

What you seem to want is this:

  1. for an entry that matches account X
  2. filter the *other* posts in that transaction by those matching account Y
  3. use the (assumed single) account name resulting from this for grouping

This can't be done with Ledger's command-line option, although it would be
possible as a Python script.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2a65duf42.fsf%40newartisans.com.


Re: is this a bug?

2022-08-31 Thread John Wiegley
> "LF" == Lipp F  writes:

LF> Thanks John. I am wondering if you can be more specific. I have tried to
LF> add -G to "ledger reg" and it throws an error - "Error: Cannot add a
LF> sequence to an integer"

LF> I am looking to get a list with account values, it could be either balance
LF> or gain, for a period of time. Is there any way to do that?

Hmm... without knowing more about the data, I can't quite tell. But if you
build with debugging support enabled, and run with `--debug expr.calc`, it
should become clearer which two values it's trying to add that are not
compatible.

But other than the "revaluation" entries introduced by -G, Ledger does not
report entries for days where nothing happened. Maybe see if -E will give you
the empty entries you need for days with no change?

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m27d2owdga.fsf%40newartisans.com.


Re: is this a bug?

2022-08-30 Thread John Wiegley
> "lf" == lipp f  writes:

lf> Those are investment / trading accounts and, although there are no always
lf> transactions for the last day, the value of the accounts always change due
lf> to daily changes for prices of securities held. There are daily entries in
lf> the pricedb for all securities.

In that case you may want to add -G for the gain/loss report, since that
generates "daily positions adjustments" beyond the last entry in the ledger.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2zgfl60ij.fsf%40newartisans.com.


Re: is this a bug?

2022-08-30 Thread John Wiegley
> "lf" == lipp f  writes:

lf> "ledger reg" command is missing records at the end. I am running these on
lf> Aug 31. For acc1 the last row is 2022-08-21 (2 weeks missing) and for acc2
lf> the last row is 2022-07-03 (9 weeks missing). Is this a bug? Any
lf> workaround?

And you have transactions related to account acc1 in your file beyond
2022-08-21?

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2v8q9eo0u.fsf%40newartisans.com.


Re: Time tracking: time formatting and hourly rates

2022-05-25 Thread John Wiegley
> "CT" == Carl Tappan  writes:

CT> 1.) Is it possible to enter time in "HH:MM" format? Converting to decimal
CT> hours is clunky, and the various timeclock options don't fit my workflow
CT> well. I know that I can add a timelog entry with "time in" and "time out",
CT> but ideally I'd be able to post directly to the account.

You won't be able to use such a syntax to express durations of time, but what
you COULD do is use the format you'd like and then write a processing script
to convert those HH:MM entries into seconds.

CT> 2.) Is it possible to define an hourly rate in a price history file, or
CT> some other persistent way that doesn't require recording each entry as
CT> xx.yyh @ $ ? The documentation implies under 3.4.2 that time is just
CT> a commodity, but setting a price as P h $ doesn't seem to work. If I
CT> log in units of 'hours' instead of 'h' then defining P hour $ works
CT> as expected, but I think that breaks the predefined equivalencies between
CT> different time units.

Price histories work differently from associating a conversion value with a
posting. I don't think the "P" directive will ever fully do what you'd wish
here.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2czg1xxkb.fsf%40newartisans.com.


Re: Check balance of account and all its children

2022-05-07 Thread John Wiegley
> "JJ" == J J  writes:

JJ> O - The total of all postings seen so far, or the total of an account and
JJ> all its children.

I would just use "total". The O syntax is from the old version of value
expressions. Does that work?

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2fsllrv9q.fsf%40newartisans.com.


Re: Ledger Convert should add an amount to the stated account, not the guessed account

2022-04-15 Thread John Wiegley
> "JJ" == J J  writes:

JJ> The proposed change would instead have Ledger provide the amount on the
JJ> given account and elide the expense side. This way, a user can easily add
JJ> new expense lines to make a split.

Sounds like a great feature request to me!

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2fsmdd4lc.fsf%40newartisans.com.


Re: Crypto Chart of Accounts setup (staking, DeFi, impermanent loss etc).

2022-02-07 Thread John Wiegley
> "DM" == Daryl Manning  writes:

DM> Interesting. I was rather hoping there was something like Reckon that
DM> could suck in csvs from the various CEX and DEX exports (where they have
DM> them) and then figure out how to write the entries in Ledger themselves.
DM> (tho recognize that this makes it hard perhaps to see if a particular
DM> strategy eg looping is working as you have no semantic information in the
DM> transactions about it.)

In addition to modules for managing staking for different cryptos, there will
also be modules for snarfing data from different transaction exports. It will
have to be done as an open architecture where all that you need to provide is
any executable that can convert the input to the expected CSV input.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2y22my553.fsf%40newartisans.com.


Re: Crypto Chart of Accounts setup (staking, DeFi, impermanent loss etc).

2022-02-06 Thread John Wiegley
> "DM" == Daryl Manning  writes:

DM> Your comment about different staking schemes is interesting though.
DM> Did you find ledger-cli just impossible to support those in? (to my
DM> initial question, really.).

Ledger can represent them, but it ends up being a very manual affair. The
objective of trade-journal is to give you the simplest syntax possible to
express the "events" that occurred relative to your staking, and then to
generate Ledger transactions from these, so that Ledger is the reporting tool,
but trade-journal is the input scheme.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2o83j99ip.fsf%40newartisans.com.


Re: Crypto Chart of Accounts setup (staking, DeFi, impermanent loss etc).

2022-02-05 Thread John Wiegley
> "DM" == Daryl Manning  writes:

DM> Would love to see some examples or descriptions (or pointers to blog
DM> posts) of how you might be cleverly handling the issue(s) since I need to
DM> get this sorted relatively soon and realize my current setup is
DM> inadequate. (also, end up using multiple currencies for purchase which
DM> further complicates things).

I've been working on a tool for this, that is extensible so that you can
program different staking schemes, etc.:

https://github.com/jwiegley/trade-journal

It's just a matter of finding more time to keep making progress!

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2ilttgqk5.fsf%40newartisans.com.


Re: [Entries that are expressions]

2021-12-30 Thread John Wiegley
> "UB" == Uwe Brauer  writes:

UB> 2010/07/23 User2:User1-Compensation
UB>   expenses:User2:User1-Compensation  ((110-60)*0.5)
UB>   expenses:User1:User1-Compensation

UB> Does not work!

I'm not entirely sure why, but Ledger doesn't like the absence of spaces
around the '-' sign. This does work:

((110 - 60)*0.5)

Btw, you see what Ledger is thinking using:

ledger expr "((110-60)*0.5)"

This seems like a parsing bug to me.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2wnjlqlq1.fsf%40newartisans.com.


signature.asc
Description: PGP signature


Re: currency trading accounts

2021-12-29 Thread John Wiegley
> "PB" == Pierre Bastoul  writes:

PB> I'm working on tracking my cryptocurrencies trades with ledger-cli as
PB> described in the "Multiple currencies with currency trading accounts "
PB> wiki page.

I'd like to note that my trade-journal project:

  https://github.com/jwiegley/trade-journal

Is aiming at providing good support for crypto transactions, including
taxation laws for different countries (it will be a modular system). The first
version will work on CSV exports of Coinbase fills, and so far only support
staking operation for one crypto (ICP). But again, it's meant to be fully
modular.

The idea is to take data from a crypto exchange, apply know-how in terms of
staking taxation events and local tax laws, and then to output a Ledger file
that allows you to do your year-end and performance reporting.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2czlevaso.fsf%40newartisans.com.


Re: Invoicing (feature request??)

2021-12-28 Thread John Wiegley
> "o" == o1bigtenor   writes:

o> Maybe I'm just slow but I can't think of how to write things so that I can
o> do all the things I need to do to an invoice. (tracking, aging, closing,
o> etc etc) in ledger. There may be some way but I'm not seeing it.

o> Maybe trying to add this to ledger would stretch it out of shape? I hope
o> not - - - I like the way it works. Just need to be able to do AR. Ledger
o> does AP very very well so how do I bend my brain to get AR thinking
o> working?

Sometimes, rather than fitting the idea into ledger, it's better to fit ledger
into the idea. Imagine what higher level syntax would be best to express
invoicing, and then write a tool to publish a Ledger file from this syntax for
your reporting needs. I'm doing that right now for stock trades, which are
possible to track in Ledger but far too verbose, yet it's not too hard to
imagine a convenient syntax plus some extra math that wouldn't be right to add
directly into Ledger itself.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2y244s3h1.fsf%40newartisans.com.


Re: Invoicing (feature request??)

2021-12-28 Thread John Wiegley
> "o" == o1bigtenor   writes:

o> So things like invoice aging and tracking are just 2 things to be able to
o> do.

These sound like great features to add to the Ledger ecosystem, but I would be
hesitant to integrate them into the Ledger "core", where there is
intentionally very little knowledge of what different account types mean...

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2v8z8wenj.fsf%40newartisans.com.


Re: Currency Designator/Reporting Issues

2021-11-08 Thread John Wiegley
> "J" == Jasel17212   writes:

J> As mentioned in my original post, running the report with -X USD produces
J> the expected output. It sounds like I've stumbled upon a bug related to the
J> -V option.

Yes, could very well be. Really the -V should be removed, I think, but it's
been relatively harmless until now.

J> BTW, I've been meaning to ask, are you still personally using PTA? If so,
J> are you still using Ledger, or are you using Hledger?

I use Ledger every week, lately to track crypto transactions. I also use it
for time reporting when applicable, and for tracking investments, progress on
loans, and a "yearly income report" where I basically enter in the data from
my tax return every year.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2h7cme92k.fsf%40newartisans.com.


Re: Currency Designator/Reporting Issues

2021-11-07 Thread John Wiegley
> "o" == o1bigtenor   writes:

o> Any ideas on what’s happening here?

I'm not sure what's going on, but -V tries to be smart and maybe it's failing
in your case. What happens if you use "-X USD" instead?

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m28rxzcepc.fsf%40newartisans.com.


Re: investment reporting

2021-10-24 Thread John Wiegley
The gain option may not work with -M or -X

On Sun, Oct 24, 2021, at 11:54 AM, lipp f wrote:
> It does not work, throws different errors:
> 
> $ ledger reg  Assets:Investment  -p 2021 -X USD -M --gain
> While calling function 'get_at (CAD 97.45000
> -2,234.66891242292 USD, 1)':
> Error: Attempting to get argument at index 1 from a balance
> 
> $ ledger reg  Assets:Investment  -p 2019 -X USD -M --gain
> While adding (7.0 TLT {122.650 USD} [2019-04-12], 7.0 TLT 
> {122.650 USD} [2019-04-12]) to (353.020 USD, 353.020 
> USD, CAD -104.8
> -440.13695725000 USD):
> Error: Cannot add sequences of different lengths
> On Sunday, October 24, 2021 at 12:49:43 PM UTC-4 jwie...@gmail.com wrote:
>> > "lf" == lipp f  writes: 
>> 
>> lf> Assuming that all the investments are in Assets:Investment, how do I get 
>> a 
>> lf> weekly / monthly report for realized / unrealized gains? 
>> 
>> lf> I have tryed 
>> 
>> lf> $ ledger reg Assets:Investment -p 2021 -X USD -M --unrealized 
>> 
>> lf> and it is not showing the proper numbers. 
>> 
>> Try --gain 
>> 
>> John 
> 
> 
> -- 
> 
> --- 
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ledger-cli/3cf4f1cd-cea6-4937-94ae-5ec756e12ed9n%40googlegroups.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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/4fb9e6d4-4ad3-44ce-8705-ba84d2354c80%40www.fastmail.com.


Re: investment reporting

2021-10-24 Thread John Wiegley
> "lf" == lipp f  writes:

lf> Assuming that all the investments are in Assets:Investment, how do I get a
lf> weekly / monthly report for realized / unrealized gains?

lf> I have tryed 

lf> $ ledger reg Assets:Investment -p 2021 -X USD -M --unrealized

lf> and it is not showing the proper numbers.

Try --gain

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2fssq2wrm.fsf%40newartisans.com.


Re: Looking for Formal Specification

2021-10-16 Thread John Wiegley
> "ДП" == Дмитрий Поляков  writes:

ДП> Have ledger something like paper or document that describe so-called
ДП> "Ledger Data Structure" with corresponding methods or something like this?

Great question; I don't think anything like this exists, at least for the C++
version of the project. Maybe the other ports have something?

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m235p0li7j.fsf%40newartisans.com.


Re: ledger python module documentation

2021-10-05 Thread John Wiegley
> "MM" == Martin Michlmayr  writes:

>> I have seen python/demo.py in the distribution but I am looking for
>> somethin more detaled. Like a standard python module documentation.
>> 
>> Is it available anywhere? TIA.

MM> Unfortunately not.

There's just the code, in the py*.cc modules, from which you can determine
which types and methods are available.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m27derlyqw.fsf%40newartisans.com.


Re: Is it possible to abbreviate very large numbers? Using megs (M), kilos (K), etc? (EOM)

2021-09-17 Thread John Wiegley
> "FM" == Felipe Mica  writes:

FM> The ledger-cli starts to ignore the conversion.
FM> It seems a bug behavior.

I agree that this sounds like a bug. --exchange should always take priority,
if a conversion exists into your desired display commodity.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2mtob5d4v.fsf%40newartisans.com.


Re: Timeclock transactions balanced?

2021-09-14 Thread John Wiegley
> "CM" == Cassie McCarthy <759...@gmail.com> writes:

CM> Is this possible to do still? I know I'm 10 years late but I am also
CM> having this issue.

I don't think anything has changed with time reporting since then. :(

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2lf3yfmij.fsf%40newartisans.com.


Re: GitHub workflows for ledger CI - help required

2021-09-14 Thread John Wiegley
> "MM" == Martin Michlmayr  writes:

MM> I removed the Travis hook already but I can't figure out how to remove the
MM> Travis requirement for pull requests. Do you know how?

I've removed the Travis requirement. It was in the Branch protection settings,
under "Status checks".

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2pmtafmj9.fsf%40newartisans.com.


Re: Is it possible to abbreviate very large numbers? Using megs (M), kilos (K), etc? (EOM)

2021-09-14 Thread John Wiegley
> "CD" == Colin Dean  writes:

CD> You should be able to use commodity equivalencies to solve this problem to
CD> a degree, but it won't be automatic based on the magnitude in context,
CD> only whatever you set as the exchange, I think.

Actually, it should adjust the magnitude dependent on context, this is how the
automated conversions to hours, minutes and seconds work for time values. Just
use something like this:

C 1 KB = 1000 B
C 1 MB = 1000 KB
C 1 GB = 1000 MB
etc.

It should then pick whichever one can be reported at a value of 1 or more.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2tuimfml7.fsf%40newartisans.com.


Re: Termux Ledger package now supports Python

2021-06-15 Thread John Wiegley
> "R" == Randy   writes:

R> I noticed that Ledger wasn't compiled with Python support in the
R> Termux package on Android, so I made a pull request and it has just
R> been accepted. Now you can do Python stuff with Ledger in Termux.
R> Just thought I'd share the news in case anyone was interested.

Thank you for that work!

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2a6nr89dj.fsf%40newartisans.com.


Re: periodic transaction

2021-03-14 Thread John Wiegley
> "BC" == Banait Clinic  writes:

BC> I am not getting how periodic transactions are added to ledger on windows
BC> using emacs. I tried these, but they don't seem to have effect on balance

Periodic transactions are only used for budgeting and forecasting; they are
not "actual" transactions and never contribute to the reported balance.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2eeghmsdq.fsf%40newartisans.com.


Re: Updating lot information for an automated transaction

2021-03-07 Thread John Wiegley
> "s" == samt   writes:

s> Any guidance on this? It would really help me a lot to have the sale date
s> and sale price of each of these "Sold Lots" lots. I need to be able to
s> determine the fraction of the capital gain that was earned in the calendar
s> year of the sale (i.e. (asset sale price) - (asset price on Jan 1st in the
s> year of the sale)).

What I do is assign a unique identifier to each "position", so that by
querying later I can see every transaction related to that position, including
those short-term sales and repurchases that do nothing more than effect the
cost basis.

Btw, I'm working on a new utility called "trade-journal" that is a simplified
Ledger focused just on keeping a trading journal, which converts its input
files into properly annotated Ledger files, thus saving you from most of the
calculation and repetition.

  https://github.com/jwiegley/thinkorswim/tree/master/trade-journal

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m28s6yhlad.fsf%40newartisans.com.


Re: Year end date

2021-02-22 Thread John Wiegley
> "DS" == Dan Sladden  writes:

DS> But none of this does what I want - a single list of tallied
DS> transactions for each financial year from one ledger command. Yes, I
DS> can do it by executing multiple commands with different -b and -e
DS> arguments, but that's IMHO not very elegant.

Have you tried --group-by 'format_date(date, "%Y")'?

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m235xnq0dn.fsf%40newartisans.com.


Re: ledger

2020-10-17 Thread John Wiegley
> "EL" == Ed Laux  writes:

EL> It will put entries for that day in amount order.

When you say "it will put", can you tell me which command you're running? And
if you have a ~/.ledgerrc with anything in it?

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2mu0kfjkd.fsf%40newartisans.com.


Re: Custom format to remove the currency

2020-10-17 Thread John Wiegley
> "JD" == Jimi Damon  writes:

JD> Thanks for that...also you solved a problem for me with roundto. Why is
JD> roundto() so sensitive to spaces in it's argument ?

JD> This works

JD> roundto(amount, 2 )

JD> but this doesn't ??

JD> roundto(amount,2)

Well, comma might be a European decimal separator, and "amount" might be the
name of a commodity, and you might be specifying 0,2 of that commodity very
lazily.

I agree this should be an error, and welcome a bug report, but that's what
Ledger is thinking in this case.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2h7qso1wf.fsf%40newartisans.com.


Re: ledger

2020-10-16 Thread John Wiegley
> "EL" == Ed Laux  writes:

EL> If I post say 10 transactions of various amounts on a certain day - how do
EL> I get the system to stop putting the transactions in amount order? I want
EL> to keep them in the order as I enter them.

What is amount order? The 'register' and 'print' commands in C++Ledger always
outputs postings in the order you entered them.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m25z79c33z.fsf%40newartisans.com.


Re: Historical balance

2020-09-15 Thread John Wiegley
> "JF" == Jun Furukawa  writes:

JF> I have one thing that I can’t find a good way to do this.
JF> ‘ledger b bankname’ will show the latest balance of the asset, but I
JF> want to get a list of ending balance for each month (not sum of cash
JF> in and out)
JF> What I want to get is some like:
JF> 20-Jun-01 - 20-Jun-30.. ..   100
JF> 20-Jul-01 - 20-Jul-31.. ..  110
JF> 20-Aug-01 - 20-Aug-31.. ..   112
JF> 20-Sep-01 - 20-Sep-30.. ..   108

Isn't this exactly what `ledger reg --collapse -M bankname` would show you?

JOhn

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m25z8ecyih.fsf%40newartisans.com.


Re: Forecasting beginning in the future

2020-09-13 Thread John Wiegley
> "A" == Alan   writes:

A> Is it correct to glean from this that it doesn't work to give a "from" date
A> in a periodic transaction? I was trying to do so, but I was not able to
A> make it work.

I would definitely expect periodic transactions to accept date ranges.

https://www.ledger-cli.org/3.0/doc/ledger3.html#Period-Expressions

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m28sdd2n7u.fsf%40newartisans.com.


Re: Question for users

2020-09-08 Thread John Wiegley
> "o" == o1bigtenor   writes:

o> Mr John - - - - - would there be a relatively easy way of using printed bar
o> codes as account numbers?

Since an account name can be pretty anything at all, I don't see why not. :)

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2r1rcrn5y.fsf%40newartisans.com.


Re: data formats for ledger convert

2020-07-20 Thread John Wiegley
> "o" == o1bigtenor   writes:

o> You may wish to consider using the ISO date/time format  - - - - - your 
o> example would look like   20160805T0850   .

Ledger currently does not track the time of a transaction, although you're
free to record that information bin metadata.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2pn8psovm.fsf%40newartisans.com.


Re: data formats for ledger convert

2020-07-15 Thread John Wiegley
> "J" == Joel   writes:

J> The ledger manual gives a bit of guidance for csv conversion of data
J> formats.

J> Can ledger convert handle dates such as this:  Aug. 05, 2016, 08:50 AM

I think if you set --input-date-format correctly, you should be able to
achieve this.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2365txqad.fsf%40newartisans.com.


Re: amount multipliers based on the value of a tag

2020-06-23 Thread John Wiegley
> "mm" == mail mitko  writes:

mm> Can an "amount multiplier" in an "automated transaction" be based on the
mm> value of a tag?

Sounds like an interesting idea. You'd have to use this:

(Me->Roommate)(to_val(tag("SHARED")))

Not sure if it works, though!

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m27dvxujsz.fsf%40newartisans.com.


Re: --date-format

2020-05-26 Thread John Wiegley
> "MM" == Martin Michlmayr  writes:

MM> * Joost Kremers  [2020-05-26 14:33]:
>> So I think ledger-mode should not use ledger's `--date-format` for
>> *reading*

MM> I don't use ledger-mode but based on your description it sounds like it
MM> should use --input-date-format instead.

Sounds right to me.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2v9kiw8qg.fsf%40newartisans.com.


Re: [ANNOUNCE] ledger 3.2.1

2020-05-20 Thread John Wiegley
> "MM" == Martin Michlmayr  writes:

MM> - Fix regression with expression evaluation by reverting commit
MM> `Correction to the way parens are parsed in query expressions` (bug #1894)

MM> - Fix --invert breakage by reverting commit `Change --invert to invert
MM> displayed amounts and totals, not amounts` (bug #1895)

MM> - Fix performance regression by reverting commit `Compare price
MM> annotations using their textual rendering` (bug #1907)

Well, that teaches me a lesson. :)

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2wo56dxbh.fsf%40newartisans.com.


Re: Is it possible to query an account note?

2020-05-20 Thread John Wiegley
> "dw" == david whiting  writes:

dw> ledger.dat reg expr "note =~ /1234/"

It would be "tag("ID") =~ /1234/", for your example. Which is also what
'%ID=1234' should mean.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2v9kqmctv.fsf%40newartisans.com.


Re: Expressions in ledger, query interface

2020-05-11 Thread John Wiegley
> "MM" == Martin Michlmayr  writes:

MM> So the command line expects a "query", which can be a regex, @regex,
MM> %regex. Or you can add an expression with "expr EXPRESSION". Anything else
MM> that is allowed as a query? (And is "query" the right word, or what are
MM> those things that are not expressions?)

MM> And options like -l expect an expression.

This is correct. In fact, you can directly determine the differences using
these two debugging commands (which are probably undocumented?):

  ledger expr a and b
  ledger query a and b

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2imh14vpz.fsf%40newartisans.com.


Re: Archiving Previous Years

2020-05-10 Thread John Wiegley
> "J" == Joel   writes:

J> Is there a way to do this that carries cost basis forward for transactions
J> with commodities or currencies where one wants to track the cost basis? Or
J> must I manually run a report with the lot information and then add that to
J> the opening balances statement?

Try using the `--lots` option when generating the equity report. Cost basis is
tracked as the lot price. It is likely to also generate a lot more
transactions, one for each distinct lot.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2k11ki8ss.fsf%40newartisans.com.


Re: Stock/Commodities fee posting positions and cost basis

2020-05-09 Thread John Wiegley
> "o" == o1bigtenor   writes:

o> The example here you are putting the  inside the transaction
o> information. Would you also use this technique in a currency exchange
o> transaction (transaction done in a different currency than the ledger's
o> 'base currency)?

Sure. I also use the "lot note" to track wash sale adjustments to the cost
basis, and when I want to (personally) track a an option rollover, since to me
it's the continuation of an ongoing position but to my broker it's not. So I
might have:

(387437466,W$128.99/364736412)

I.e., this lot was opened in transaction 387437466, but its cost basis was
adjusted due to a wash sale in transaction 364736412.

Since the contents of the lot note are entirely free form, you can afterwards
process this to create your own "audit trail" of a particular instrument,
without having to use a specially named account or anything.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2r1vsygvg.fsf%40newartisans.com.


Re: Stock/Commodities fee posting positions and cost basis

2020-05-08 Thread John Wiegley
> "o" == o1bigtenor   writes:

o> A semantical question - - - - AIUI what you are referring to in the above
o> is a 'stock' not a 'commodity' - - - yes?

I guess I'm mixing Ledger terminology with market terminology. To Ledger,
everything is a commodity. But yes, in this particular case, the item we're
tracking is a stock.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2wo5mj7b6.fsf%40newartisans.com.


Re: Stock/Commodities fee posting positions and cost basis

2020-05-07 Thread John Wiegley
> "JS" == Joel Swanson  writes:

JS> Does posting order affect stock or commodity cost basis in Ledger?

JS> Is that really the desired behavior, where changing the order of postings
JS> changes the items for which ledger tracks lots? Does this have something
JS> to do with which postings are considered primary and secondary in a
JS> transaction with three or more postings?

Yes, that is actually the reasoning. The first posting establishes the
secondary commodity, while the second is the primary.

You can avoid this confusing by not using the auto-calculation logic, and
identifying your lots explicitly:

2004/05/01 Stock purchase
Expenses:Broker:Commissions$19.95
Assets:Broker 50 AAPL {$30.00} [2004/05/01] 
() @ $30.00
Assets:Broker  $-1,519.95

If you use this fully elaborated lot specification everywhere, then you'll
always know what Ledger is based its numbers on. Generally when I sell a
commodity I just copy the details from the opening transaction.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2k11n2hpe.fsf%40newartisans.com.


Re: Newbie questions

2020-05-07 Thread John Wiegley
> "NC" == Nikos Charonitakis  writes:

NC> I ll try to see what is wrong with my file because i set stock prices with
NC> eg @ EUR 20 when i first recorded (opening balance) my assets, and after
NC> your reply i set at the end of my file P 7/5/2020 STOCK_NAME EUR 20 but
NC> even this does not change behaviour and ledger instists reporting stock
NC> quantity and no value.

That is indeed odd!

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2wo5n36ij.fsf%40newartisans.com.


Re: Newbie questions

2020-05-07 Thread John Wiegley
> "NC" == Nikos Charonitakis  writes:

NC> a) Is it possible to change the number format when entering transactions?
NC> Ledger uses , for thousands and . for decimal. Can we use (and how) them
NC> the opposite way: (.) for thousands and , for decimal?

Ledger uses whatever it sees you use.

NC> b) My assets are mixed with stocks,bonds,and different currencies. When i
NC> use ledger to show balance  expressed in EUR, stocks and bonds are
NC> reported in quantity and not in their EUR value.

NC> So the result of this command:

NC> ledger -f file.ldg   -V  bal  Assets --X EUR

NC> is something like that:

NC> 100
NC> 550EUR Assets

This is because it doesn't know price of that item in EUR...

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2sggbbrnd.fsf%40newartisans.com.


  1   2   3   4   5   6   7   8   9   10   >