If it's meant to work this way, then there may be a bug somewhere.
With
*= ^Income Liabilities:Tax:$account_base -0.1 $account
0.12024-07-04 * Sale Assets 10 USD Income:Customer A*
the bal query yields
* 10 USD Assets -11 USD Income:Customer A
1 USD Liabilities:Tax:$account_base--------------------
0*
Wrapping it in braces — i.e *$(account_base)* or *($account_base)* doesn't
help either
Is *$account_base* meant to work within the ledger? If so, I could open an
issue on Github and look into why it isn't working as should.
Best,
Igbanam
On Thursday 4 July 2024 at 20:01:43 UTC John Wiegley wrote:
> I think you would then use $account_base?
>
> John
>
> On Jul 4, 2024, at 7:46 AM, Igbanam Ogbuluijah <[email protected]> wrote:
>
>
> account_base — from man ledger — is an expression to "Return the base
> account, i.e. everything after the last account delimiter ':'".
>
> How do I use this within a ledger?
>
> Use case: I want to record tax for sales per customer.
>
> = ^Income
> Liabilities:Tax:$account -0.1
> $account 0.1
>
> 2024-07-04 * Sale
> Assets 10 USD
> Income:Customer A
>
> This results in a Liabilities:Tax:Income:Customer A account automatically
> created. What I would like to end up with is Liabilities:Tax:Customer A — is
> this possible?
> Thanks
>
>
> - Igbanam
>
> --
>
> ---
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ledger-cli/CAOmRJrdYZq_mHEO5QXZQurXTLrX6X5f6bORN1TCWZui27bZ%2BOQ%40mail.gmail.com
>
> <https://groups.google.com/d/msgid/ledger-cli/CAOmRJrdYZq_mHEO5QXZQurXTLrX6X5f6bORN1TCWZui27bZ%2BOQ%40mail.gmail.com?utm_medium=email&utm_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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ledger-cli/955df532-2e12-46ee-9c92-8ed9e980ff8en%40googlegroups.com.