Re: Multiple posting costs in a transaction

2015-03-13 Thread 远洋
Hi Alok,

You need to book the remaining 0.01 EUR somewhere, so it doesn't get lost
:-) E.g. it could be an Expenses:Bank Charges if it's due to your bank
taking some fee out of it. Or maybe it's a rounding error, or the
difference is due to some other reason.

Personally, I usually book currency exchanges through a Currency account,
so that any remainders accrue there.

On Fri, Mar 13, 2015 at 6:45 PM, Alok Parlikar happy...@gmail.com wrote:

 It seems I can't always use multiple posting costs in the same
 transaction. Here are two hypothetical test cases. Is this the expected
 behavior?

 *Case 1*:
 2015/03/05 * Payee
 Assets:Bank$1.00 @ 1.02 EUR
 Income:Revenue-$1.00 @ 1.01 EUR

 Expected output of bal is that the transaction fails to balance.
 Seen output:
 $ ledger -f /tmp/x.dat bal
$1.00  Assets:Bank
   $-1.00  Income:Revenue
 
0

 *Case 2*: Add D entries for each currency.
 D $1.00
 D 1.00 EUR

 2015/03/05 * Payee
 Assets:Bank$1.00 @ 1.02 EUR
 Income:Revenue-$1.00 @ 1.01 EUR

 Now I get the expected error:
 $ ledger -f /tmp/x.dat bal
 While parsing file /tmp/x.dat, line 6:
 While balancing transaction from /tmp/x.dat, lines 4-6:
  2015/03/05 * Payee
  Assets:Bank$1.00 @ 1.02 EUR
  Income:Revenue-$1.00 @ 1.01 EUR
 Unbalanced remainder is:
 0.01 EUR
 Amount to balance against:
 1.02 EUR
 Error: Transaction does not balance

  --

 ---
 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.




-- 
--
Best regards,
Daniël Bos


Your government is reading your email. Slow them down with encryption.

My public key: http://goo.gl/gms497 (4096 bit RSA, id EF2D5D91)
Fingerprint  : D8D0 9FBE F075 F709 7B52  2F73 326C 2123 EF2D 5D91

-- 

--- 
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: Multiple posting costs in a transaction

2015-03-13 Thread Alok Parlikar
Hi Daniel,

Thanks. What makes me wonder is why in case 1, the ledger command doesn't 
throw an error even if the 0.01 EUR isn't accounted for :) 

As I was preparing my returns for the previous year, ledger ran through the 
whole journal balancing each transaction, and yet in the end I had a $2.95 
left over, instead of the end balance showing 0. Searching for the error 
led me to a transaction that had multiple posting costs for the same 
commodities.

Alok

On Friday, March 13, 2015 at 5:39:30 PM UTC+5:30, Daniel Bos wrote:

 Hi Alok,

 You need to book the remaining 0.01 EUR somewhere, so it doesn't get lost 
 :-) E.g. it could be an Expenses:Bank Charges if it's due to your bank 
 taking some fee out of it. Or maybe it's a rounding error, or the 
 difference is due to some other reason.

 Personally, I usually book currency exchanges through a Currency 
 account, so that any remainders accrue there.

 On Fri, Mar 13, 2015 at 6:45 PM, Alok Parlikar happ...@gmail.com 
 javascript: wrote:

 It seems I can't always use multiple posting costs in the same 
 transaction. Here are two hypothetical test cases. Is this the expected 
 behavior?

 *Case 1*:
 2015/03/05 * Payee
 Assets:Bank$1.00 @ 1.02 EUR
 Income:Revenue-$1.00 @ 1.01 EUR

 Expected output of bal is that the transaction fails to balance.
 Seen output:
 $ ledger -f /tmp/x.dat bal
$1.00  Assets:Bank
   $-1.00  Income:Revenue
 
0

 *Case 2*: Add D entries for each currency.
 D $1.00
 D 1.00 EUR

 2015/03/05 * Payee
 Assets:Bank$1.00 @ 1.02 EUR
 Income:Revenue-$1.00 @ 1.01 EUR

 Now I get the expected error:
 $ ledger -f /tmp/x.dat bal
 While parsing file /tmp/x.dat, line 6:
 While balancing transaction from /tmp/x.dat, lines 4-6:
  2015/03/05 * Payee
  Assets:Bank$1.00 @ 1.02 EUR
  Income:Revenue-$1.00 @ 1.01 EUR
 Unbalanced remainder is:
 0.01 EUR
 Amount to balance against:
 1.02 EUR
 Error: Transaction does not balance

  -- 

 --- 
 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+...@googlegroups.com javascript:.
 For more options, visit https://groups.google.com/d/optout.




 -- 
 --
 Best regards,
 Daniël Bos


 Your government is reading your email. Slow them down with encryption.

 My public key: http://goo.gl/gms497 (4096 bit RSA, id EF2D5D91)
 Fingerprint  : D8D0 9FBE F075 F709 7B52  2F73 326C 2123 EF2D 5D91
  

-- 

--- 
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: Multiple posting costs in a transaction

2015-03-13 Thread Simon Michael
On 3/13/15 5:33 AM, Alok Parlikar wrote:
 Thanks. What makes me wonder is why in case 1, the ledger command doesn't 
 throw an error even if the 0.01 EUR isn't accounted for :) 

It should, worth a bug report if it happens with the latest version.


-- 

--- 
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.