quentinsf / icsv2ledger

Interactive importing of CSV files to Ledger
196 stars 70 forks source link

Add support for the "transfer" account pattern #126

Closed riclage closed 5 years ago

riclage commented 5 years ago

When the csv row being imported refers to a transfer to another account, it would be great if icsv2ledger could support the "transfer" pattern as described here:

Using the Transfer account pattern, you'd tweak your CSV > ledger
conversion to generate the following records:

2012/01/01 Transfer from Checking to Savings
 ; Generated from Checking account CSV > ledger
 Transfers:Checking_Savings  $100
 Assets:Checking

2012/01/01 Transfer from Checking to Savings
 ; Generated from Savings account CSV > ledger
 Assets:Savings  $100
 Transfers:Checking_Savings

According to the original poster, this pattern has the following advantages, e.g.:

  1. No manual tweaking after a CSV > ledger conversion.
  2. You can immediately know where any transfer went wrong (and which account didn't register it)
  3. When everything has cleared, the balance in the Transfer account is zero so it doesn't appear in any balance reports

I could try to make a PR to support the above but not sure how to approach it. Maybe we can add a third parameter to the mapping file to indicate a "transfer" pattern account?

yisraeldov commented 5 years ago

Why can't you do this using the existing features? Just when you are importing CSV of savings enter Transfers:Checking_Savings for the account when prompted, then do the revers when importing csv of checking ...

riclage commented 5 years ago

Most of the time the other account does not have a csv. It could be, for example, a virtual account or a "transfer" to a cash account.

Also, in a savings account, by doing the transfer pattern, I wouldn't need to bother with using the csv of that account. Since I'm almost always only transferring money to it, just importing the csv of my current account would do the job.