Re: Make "reg" output the account balance

2023-11-23 Thread Ondřej Čertík



On Wed, Nov 22, 2023, at 12:17 PM, John Wiegley wrote:
>> 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.

Yes, running-form balance report is one way to look at it. The algorithm for it 
is trivial, it's about 10 lines of Python code here: 
https://github.com/ledger/ledger/issues/2297. However it's probably more 
complicated to take into account all corner cases and integrate into ledger-cli.

Martin, thanks for the suggestion of "ledger reg --daily". It's not quite 
there, as you said.

I see now that the design of "reg" is to always have a running total of the 
amounts displayed. So it should probably be another command, or an option.

Ondrej

-- 

--- 
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/3ef81908-360b-4cb1-9a99-1c3554f00a53%40app.fastmail.com.


Re: Make "reg" output the account balance

2023-11-22 Thread Martin Michlmayr
How about:
ledger reg --daily
It doesn't quite do what you want but I think it's the best there is
for now.

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

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/20231122234157.GA2819100%40jirafa.cyrius.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: Make "reg" output the account balance

2023-11-15 Thread Ondřej Čertík



On Wed, Nov 15, 2023, at 12:41 PM, John Wiegley wrote:
>> "OČ" == Ondřej Čertík  writes:
>
> OČ> Does anybody know how to do that?
>
> Does something like `--display-total account.total` help?

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

test/input(master) $ python process.py 
  Date  NameAccount  Amount  
Account Balance
2010/12/01  Checking balanceAssets:Checking 1000.00 
1000.00
2010/12/01  Checking balanceEquity:Opening Balances-1000.00
-1000.00
2010/12/20 Organic Co-opExpenses:Food:Groceries   37.50   
37.50
2010/12/20 Organic Co-opExpenses:Food:Groceries   37.50   
75.00
2010/12/20 Organic Co-opExpenses:Food:Groceries   37.50  
112.50
2010/12/20 Organic Co-opExpenses:Food:Groceries   37.50  
150.00
2010/12/20 Organic Co-opExpenses:Food:Groceries   37.50  
187.50
2010/12/20 Organic Co-opExpenses:Food:Groceries   37.50  
225.00
2010/12/20 Organic Co-opAssets:Checking -225.00  
775.00
2010/12/28 Acme Mortgage  Liabilities:Mortgage:Principal  200.00
  200.00
2010/12/28 Acme Mortgage  Expenses:Interest:Mortgage  500.00  
500.00
2010/12/28 Acme MortgageExpenses:Escrow  300.00  
300.00
2010/12/28 Acme MortgageAssets:Checking-1000.00 
-225.00
2011/01/02 Grocery StoreExpenses:Food:Groceries   65.00  
290.00
2011/01/02 Grocery StoreAssets:Checking  -65.00 
-290.00
2011/01/05  EmployerAssets:Checking 2000.00 
1710.00
2011/01/05  Employer  Income:Salary-2000.00
-2000.00
2011/01/14  Bank Assets:Savings  300.00  
300.00
2011/01/14  BankAssets:Checking -300.00 
1410.00
2011/01/19 Grocery StoreExpenses:Food:Groceries   44.00  
334.00
2011/01/19 Grocery StoreAssets:Checking  -44.00 
1366.00
2011/01/25  BankAssets:Checking 5500.00 
6866.00
2011/01/25  Bank Assets:Savings-5500.00
-5200.00
2011/01/25   Tom's Used Cars  Expenses:Auto 5500.00 
5500.00
2011/01/25   Tom's Used CarsAssets:Checking-5500.00 
1366.00
2011/01/27Book Store Expenses:Books   20.00   
20.00
2011/01/27Book Store Liabilities:MasterCard  -20.00  
-20.00
2011/04/25   Tom's Used Cars  Expenses:Auto 5500.00
11000.00
2011/04/25   Tom's Used CarsAssets:Checking-5500.00
-4134.00
2011/04/27 Bookstore Expenses:Books   20.00   
40.00
2011/04/27 BookstoreAssets:Checking  -20.00
-4154.00
2011/12/01  SaleAssets:Checking   30.00
-4124.00
2011/12/01  Sale   Income:Sales  -30.00  
-30.00

test/input(master) $ ledger -f demo.ledger reg --display-total account.total
10-Dec-01 Checking balance  Assets:Checking 
   $ 1,000.00 $ 1,000.00
Equity:Opening Balances 
  $ -1,000.00$ -1,000.00
10-Dec-20 Organic Co-op Expenses:Food:Groceries 
  $ 37.50$ 37.50
Expenses:Food:Groceries 
  $ 37.50$ 37.50
Expenses:Food:Groceries 
  $ 37.50$ 37.50
Expenses:Food:Groceries 
  $ 37.50$ 37.50
Expenses:Food:Groceries 
  $ 37.50$ 37.50
Expenses:Food:Groceries 
  $ 37.50$ 37.50
Assets:Checking 
$ -225.00 $ 1,000.00
10-Dec-28 Acme Mortgage Liabilities:Mortgage:Principal  
 $ 200.00   $ 200.00
Expenses:Interest:Mortgage  
 $ 500.00   $ 500.00
Expenses:Escrow 
 $ 300.00   $ 300.00
Assets:Checking 

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.


Make "reg" output the account balance

2023-11-13 Thread Ondřej Čertík
Hi,

I am new to ledger. I would like the "reg" command print all the 
transactions and for each account individually print the total (cumulative) 
balance of that account at the point of the transaction. I opened up an 
issue here:

https://github.com/ledger/ledger/issues/2297

That explains all the details on an example, and contains a Python script 
that does this. It would be nice to do it using ledger itself.

Does anybody know how to do that?

Thanks,
Ondrej

-- 

--- 
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/e13b8a02-9c14-47a9-87bb-ca5df4a5cd8an%40googlegroups.com.