Balance comparing date with date/time

2023-04-11 Thread Paulo Flabiano Smorigo
If I pass a date in --display to register command, like below, it works fine.

$ ledger reg -d "d>=[2023-04-01] and d<[2023-05-01]

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

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

Is this expected or is it a bug?

--
P. F. Smorigo

-- 

--- 
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/CABaM_XsOkojr_aRucgmz5ZMtT%2ByCi_gTcdAC682h%3DZ3XiDcAEQ%40mail.gmail.com.


Register filter for a specific currency

2023-02-20 Thread Paulo Flabiano Smorigo
Hello,

I have the following entry:

2023-03-15 Entry
Expenses  100.00 USD {= 5 BRL }
Assets:Bank

If I use a currency filter like bellow and the market value, it won't
shows the entry:

ledger -f ./example.ledger --limit "commodity=='BRL'" --market reg Expenses
< no output >

If I use original currency, it will show:

ledger --limit "commodity=='USD'" --market reg Expenses
23-Mar-15 Entry  Expenses   500.00 BRL
   500.00 BRL

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

Thanks in advance!
--
P. F. Smorigo

-- 

--- 
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/CABaM_Xs3cWS4%3DkPL%3DHnc97e1WgEkVoHjPSKiT-Xu09k%3D%2BGeRrQ%40mail.gmail.com.


Missing transactions when use --group_by with --effective and --related

2017-12-22 Thread Paulo Flabiano Smorigo
Hello,

I have the following ledger with two transactions, both using effective dates:

$ cat group_by.ledger
2017-01-01=2017-01-15 Grocery
Expenses:Fuel$200.00
Liabilities:CreditCard

2017-01-01 Grocery
Expenses:Grocery $100.00 ; [=2017-01-15]
Expenses:Grocery $100.00 ; [=2017-02-15]
Expenses:Grocery $100.00 ; [=2017-03-15]
Expenses:Grocery $100.00 ; [=2017-04-15]
Expenses:Grocery $100.00 ; [=2017-05-15]
Expenses:Grocery $100.00 ; [=2017-06-15]
Liabilities:CreditCard

I use --effective and --related to see my credit card liabilites over
the months like:

$ ledger -f group_by.ledger --effective reg Liabilities:CreditCard -r
2017-01-15 Grocery  Expenses:Fuel
   $200.00  $200.00
2017-01-15 Grocery  Expenses:Grocery
   $100.00  $300.00
2017-02-15 Grocery  Expenses:Grocery
   $100.00  $400.00
2017-03-15 Grocery  Expenses:Grocery
   $100.00  $500.00
2017-04-15 Grocery  Expenses:Grocery
   $100.00  $600.00
2017-05-15 Grocery  Expenses:Grocery
   $100.00  $700.00
2017-06-15 Grocery  Expenses:Grocery
   $100.00  $800.00

It works perfectly but when I try to group by effective date it seems
to skip the transactions with multiple accounts:

$ ledger -f group_by.ledger --effective reg Liabilities:CreditCard -r
--group-by effective_date
2017/01/15
2017-01-15 Grocery  Expenses:Fuel
   $200.00  $200.00

Does this work as expected or is it a bug?

--
P. F. Smorigo

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Space in format string

2017-12-18 Thread Paulo Flabiano Smorigo
On Mon, Dec 18, 2017 at 3:58 AM, John Wiegley <jwieg...@gmail.com> wrote:
>>>>>> "PFS" == Paulo Flabiano Smorigo <pfsmor...@gmail.com> writes:
>
> PFS> $ echo "%(account) %(abs(amount))\n"
> PFS> %(account) %(abs(amount))\n
>
> Hmm, then I am quite stumped. Without a way to reproduce it, I can't determine
> the cause.

It's seems that it's a problem in the fedora build since I built
ledger from source yesterday and worked fine in the same machine with
the bug.

>
> John

--
P. F. Smorigo

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Space in format string

2017-12-17 Thread Paulo Flabiano Smorigo
On Sun, Dec 17, 2017 at 6:38 AM, John Wiegley <jwieg...@gmail.com> wrote:
>>>>>> "PFS" == Paulo Flabiano Smorigo <pfsmor...@gmail.com> writes:
>
> FPS> $ ledger --format "%(account) %(abs(amount))\n" reg assets
> FPS> Error: Unrecognized command '%(abs(amount))\n'
>
> I'm unable to reproduce this behavior here, using bash. What happens if you
> say:
>
>   echo "%(account) %(abs(amount))\n"

$ echo "%(account) %(abs(amount))\n"
%(account) %(abs(amount))\n

>
> John

--
P. F. Smorigo

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Space in format string

2017-12-16 Thread Paulo Flabiano Smorigo
Hello,

I'm having problems with the format parameters when it has spaces in it.

Like if I use the example from manual I get an error:

$ ledger --format "%(account) %(abs(amount))\n" reg assets
Error: Unrecognized command '%(abs(amount))\n'

If I replace the space with a dash it works nice:

$ ledger --format "%(account)-%(abs(amount))\n" reg assets
(it works :P)

I use bash but I don't believe that it's something related to it. I
did some tests with it and the return was:

1: --format
2: %(account) %(abs(amount))\n
3: reg
4: assets

Using Fedora and ledger is 3.1.1-20160111

Thanks in advance,
--
P. F. Smorigo

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Liabilities in foreign currency

2017-12-03 Thread Paulo Flabiano Smorigo
Hello all,

I live in Brazil and from time to time I buy things in USD so I keep
my records like:

2017-05-15 Car rental
Expenses:Travel   263.90 USD {=3.43 BRL}
Liabilities:CreditCard

Then after some days I pay my credit card card in my local currency:

2017-05-20 Pay CreditCard
Liabilities:CreditCard905.18 BRL
Assets:Checking

So I don't have any more debit in USD but if I print my balance it shows:

$ ledger -f doubt.ledger bal
 -905.18 BRL  Assets:Checking
  263.90 USD  Expenses:Travel
  905.18 BRL
 -263.90 USD  Liabilities:CreditCard

   0

Of course that's right but I want to know how can I tell ledger that
when I pay my debits, my liabilities in foreign currency are zero.

What's the best way to do it?

--
P. F. Smorigo

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Value with a discount

2017-09-11 Thread Paulo Flabiano Smorigo
On Monday, September 11, 2017 at 8:59:28 AM UTC-3, Martin Michlmayr wrote:
>
> * Paulo Flabiano Smorigo <pfsm...@gmail.com > [2017-09-11 
> 04:33]: 
> > 2017-06-13 Car fuel 
> > Expenses:Auto:Fuel 36.21 GAS 
> > Assets:Checking 
> > 
> > The gas station usually gives me a discount of 0.06% and I want to know 
> how 
> > can I use the full value and apply the discount. 
>
> You could use something like this: 
>
> (I see a mistake and did 6% instead of 0.06%, but the principle is the 
> same) 
>
> 2017-06-13 Car fuel 
> Expenses:Auto:Fuel  36.21 GAS @ $3.199 
> Income:Discounts-$6.95 ; 6% discount 
> Assets:Checking   -$108.89 
>
> -- 
> Martin Michlmayr 
> http://www.cyrius.com/ 
>

Nice,tks!


 

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Value with a discount

2017-09-11 Thread Paulo Flabiano Smorigo
Hello,

I usually have a discount when I refuel my car and want to declare the 
price with the discount and maybe also track it. Currently I'm declare the 
price of the gas like:

P 2017-06-13 GAS $3.199

And then I declare:

2017-06-13 Car fuel
Expenses:Auto:Fuel 36.21 GAS
Assets:Checking

The gas station usually gives me a discount of 0.06% and I want to know how 
can I use the full value and apply the discount.

Thanks in advance!

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.