Re: Understanding primary commodities

2021-12-08 Thread psionl0
For my 2 cents, I prefer method 1 since it correctly records the day the 
paypal account is settled. Note that the Currency Exchange transaction is 
wrong because it suggests that Paypal provided the AED for you to settle 
the Paypal account. It is more likely that you got the AED from your bank 
account to settle the paypal account.
So the transaction should look like
2021/04/01 * Currency Exchange
Assets:Paypal 25.00 EUR @@ 100.00 AED
Assets:Bank


On Thursday, December 9, 2021 at 8:27:53 AM UTC+8 Martin Michlmayr wrote:

> I don't have time to think through your samples right now and I hope
> someone else will respond.
>
> However, I wanted to mention Peter Selinger's tutorial on multiple
> currency accounting:
> https://www.mathstat.dal.ca/~selinger/accounting/tutorial.html
>
> Reading/applying this has been on my TODO list for years, but I'm
> being told it's a good way to handle transactions with multiple
> currencies.
>
> (If anyone uses this and wants to comment, I'd appreciate it.)
>
> -- 
> 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/cf24589d-6e0a-4289-a1a4-c140ea60f12dn%40googlegroups.com.


Re: Transaction does not balance

2021-12-08 Thread psionl0
"Maybe you could give an example, so it's clearer".
When I tried POliveira's original example using the @@ option I couldn't 
get an output (I don't know why).

I have since tried an example of my own and these options appear to work as 
desired:
2021/01/01 * Stock up
   Assets:Fruit   100 apples @@ $10.00
   Assets:Fruit80 oranges @@ $50.00
   Assets:Meat50 steaks @@ $ 200.00
   Bank:Bank Account

2021/01/02 * Cash Sale
   Assets:Meat  -1 steaks @@ $10.00
   Bank:Cash

2021/01/03 * Mrs Smith
   Assets:Fruit -5 oranges @@ $10.00
   Assets:Fruit-10 apples @@ $5.00
   Assets:Accounts Receivable
   
ledger -f shop.txt bal | cat
 $15
   90 apples
  75 oranges
   49 steaks  Assets
 $15Accounts Receivable
   90 apples
  75 orangesFruit
   49 steaksMeat
   $-250  Bank
   $-260Bank Account
 $10Cash

   $-235
   90 apples
  75 oranges
   49 steaks



On Wednesday, December 8, 2021 at 5:30:25 PM UTC+8 Martin Michlmayr wrote:

> * psionl0  [2021-12-07 19:18]:
> > Ledger doesn't need to "know" the conversion rate when a transaction
> > contains multiple currencies. It just has to "assume" that whatever
> > the exchange rate is will balance the transaction (ie assume
> > nothing).
>
> Your "assume nothing" is to assume something.
>
> I don't want ledger to make assumptions. I want ledger to enforce
> the balancing requirement.
>
> Personally I don't like that ledger allows implicit conversations
> since ledger assumes an exchange rate. Beancount, for example,
> requires an explicit exchange rate when there are only two postings /
> two commodities.
>
> Let's do:
>
> 2021-12-08 * Test
> Assets:A 10.00 EUR
> Assets:B -8.52 GBP
>
> If you know roughly the values of EUR and GBP, this transaction
> looks obviously correct to you. But this requires a lot of knowledge
> (i.e. assumptions about the world).
>
> Now:
>
> 2021-12-08 * Test
> Assets:A 1000 EUR ; let's say I forgot the . between the 00s
> Assets:B -8.52 GBP
>
> You'd probably agree that this isn't quite right, yet ledger will
> happily assume an (incorrect) exchange rate.
>
> Using explicit exchange rates makes ledger enforce the balancing
> requirement.
>
> If I had done:
>
> 2021-12-08 * Test
> Assets:A 1000 EUR @ 0.852 GBP
> Assets:B -8.52 GBP
>
> ledger would complain.
>
> You *WANT* ledger to complain.
>
> You don't want ledger to assume.
>
> > The reason why I question this is that ledger could also be used to
> > record items of stock in the same way that it records currencies.
> > Unfortunately, as it stands, I have to record the purchase or sale
> > of each item of stock individually which breaks up the bank
> > transaction and makes it more difficult to reconcile with my bank
> > statement. Using @ or @@ prevents ledger from displaying the
> > individual item totals in the balance report (they have all been
> > converted).
>
> Maybe you could give an example, so it's clearer.
>
> -- 
> 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/0bd073dd-d85f-4990-bdfb-da4457399dc4n%40googlegroups.com.


Re: Understanding primary commodities

2021-12-08 Thread Martin Michlmayr
I don't have time to think through your samples right now and I hope
someone else will respond.

However, I wanted to mention Peter Selinger's tutorial on multiple
currency accounting:
https://www.mathstat.dal.ca/~selinger/accounting/tutorial.html

Reading/applying this has been on my TODO list for years, but I'm
being told it's a good way to handle transactions with multiple
currencies.

(If anyone uses this and wants to comment, I'd appreciate it.)

-- 
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/YbFNgCScR5BNObiV%40jirafa.cyrius.com.


Re: Transaction does not balance

2021-12-08 Thread Martin Michlmayr
* psionl0  [2021-12-07 19:18]:
> Ledger doesn't need to "know" the conversion rate when a transaction
> contains multiple currencies. It just has to "assume" that whatever
> the exchange rate is will balance the transaction (ie assume
> nothing).

Your "assume nothing" is to assume something.

I don't want ledger to make assumptions.  I want ledger to enforce
the balancing requirement.

Personally I don't like that ledger allows implicit conversations
since ledger assumes an exchange rate.  Beancount, for example,
requires an explicit exchange rate when there are only two postings /
two commodities.

Let's do:

2021-12-08 * Test
Assets:A 10.00 EUR
Assets:B -8.52 GBP

If you know roughly the values of EUR and GBP, this transaction
looks obviously correct to you.  But this requires a lot of knowledge
(i.e. assumptions about the world).

Now:

2021-12-08 * Test
Assets:A   1000 EUR ; let's say I forgot the . between the 00s
Assets:B -8.52 GBP

You'd probably agree that this isn't quite right, yet ledger will
happily assume an (incorrect) exchange rate.

Using explicit exchange rates makes ledger enforce the balancing
requirement.

If I had done:

2021-12-08 * Test
Assets:A   1000 EUR @ 0.852 GBP
Assets:B -8.52 GBP

ledger would complain.

You *WANT* ledger to complain.

You don't want ledger to assume.

> The reason why I question this is that ledger could also be used to
> record items of stock in the same way that it records currencies.
> Unfortunately, as it stands, I have to record the purchase or sale
> of each item of stock individually which breaks up the bank
> transaction and makes it more difficult to reconcile with my bank
> statement. Using @ or @@ prevents ledger from displaying the
> individual item totals in the balance report (they have all been
> converted).

Maybe you could give an example, so it's clearer.

-- 
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/YbB7KSmzmRXC9OX7%40jirafa.cyrius.com.