Hi,

Living north of the 49th, I have a few of the following types of 
transactions where a stock purchase/sale is in USD, but the final amount 
debited or credited to the cash account is in CAD.

2012-10-25      Buy JPMORGAN
                Assets:Investment:IL:RRSP       100 JPM @ USD 41.5399 {=$ 
1.01}
                ; 4195.5299 CAD
                Expenses:Investment:USD                 USD 9.95 {=$ 1.01}
                ; 10.0495 CAD
                Assets:Investment:IL:CAD         $-4205.58
bkelly@ns1 rrsp $

I have found that if I have *exactly* one space or tab between the 
Investment Account and the quantity  (RRSP 100), hledger appears to balance 
the transaction:

bkelly@ns1 rrsp $ hledger -f jpm.journal bal
           USD -9.95  Assets:Investment:IL
           $-4205.58    CAD
            $4205.58
           USD -9.95    RRSP 100 JPM @ USD 41.5399 {=$ 1.01}
            USD 9.95  Expenses:Investment:USD
--------------------
                   0

However I can't get a balance with either ledger 2.6.3 or 3.0 
(/usr/local/bin/ledger is v 3.0):

bkelly@ns1 rrsp $ /usr/bin/ledger -f jpm.journal bal
While parsing transaction cost:
                Assets:Investment:IL:RRSP       100 JPM @ USD 41.5399 {=$ 
1.01}
                                                            ^
Error: "jpm.journal", line 2: No quantity specified for amount
Error: "jpm.journal", line 3: Line begins with whitespace
Error: "jpm.journal", line 4: Line begins with whitespace
Error: "jpm.journal", line 5: Line begins with whitespace
Error: "jpm.journal", line 6: Line begins with whitespace


bkelly@ns1 rrsp $ /usr/local/bin/ledger -f jpm.journal bal
While parsing file "/home/bkelly/ledger/csv/investment/il/rr         
sp/jpm.journal", line 6:
While balancing transaction from 
"/home/bkelly/Dropbox/home/bkelly/ledger/csv/in         
vestment/il/rrsp/jpm.journal", lines 1-6:
> 2012-10-25    Buy JPMORGAN
>               Assets:Investment:IL:RRSP       100 JPM @ USD 41.5399 {=$ 
1.01}
>               ; 4195.5299 CAD
>               Expenses:Investment:USD                 USD 9.95 {=$ 1.01}
>               ; 10.0495 CAD
>               Assets:Investment:IL:CAD         $-4205.58
Unbalanced remainder is:
           $-4205.58
USD 4163.94 {=$1.01}
Amount to balance against:
USD 4163.94 {=$1.01}
Error: Transaction does not balance
bkelly@ns1 rrsp $


I have tried to follow the syntax in the ledger manual, and several 
variations including using the fixed/endfixed blocks, but without success. 
 Is there something wrong with the syntax or other solution I can find?  If 
necessary I will have to make the conversion, but it would be nice to have 
these original USD amounts in here if possible.

Best regards,

Boyd

-- 

--- 
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].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to