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.


Multiple Currencies: Budgeting

2023-06-11 Thread Scott A. Nichols
Hello,

Everything about Ledger is perfect for me accept managing a budget with 
multiple currencies. The issue, for me, is that I spend money in two 
different currencies. For example, while living abroad I will spending in 
"Expenses:Restaurants" but sometimes I will use my credit card to pay (USD) 
and sometimes I will use the foreign currency. If my budget for Restaurants 
is $600 USD how can I manage this in ledger if sometimes I use a foreign 
currency and sometimes I use USD?

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

Thanks for your help/advice,
Scott

-- 

--- 
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/15f21f9a-3c8b-4c2e-a673-6dbce03d9426n%40googlegroups.com.


Re: Printing to stdout

2023-06-11 Thread Alexis
Thanks John for providing support and thanks for raising this issue Bob.
Looking at the code there are few questions that arise for me:

* 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?

* 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?

* 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?
  
* How could this be tested along with other unit tests, so that
  once a desired behaviour is defined its implementation is tested.


Alexis

¹ https://www.boost.org/doc/libs/1_82_0/libs/filesystem/doc/index.htm

-- 

--- 
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/fqhkfu4f5mo4x3zven7u4zjnizlxbkf3pba25hihlimkaclsle%40istn5dx5viwl.