Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: Find offset account by payee *and* AutosyncPayee #111

Open
501st-alpha1 opened this issue Jul 24, 2020 · 1 comment
Open

Suggestion: Find offset account by payee *and* AutosyncPayee #111

501st-alpha1 opened this issue Jul 24, 2020 · 1 comment

Comments

@501st-alpha1
Copy link
Contributor

@emin63's recent issue #108 has reminded me that the way ledger-autosync determines the offsetting account could be improved. Currently, we rely heavily on matching with Ledger's payee field. The current process goes something like this:

  1. Get payee field from imported file.
  2. Map payee to an existing Ledger payee, if applicable, by finding a matching AutosyncPayee tag.
  3. Using the modified (or original) payee, look up the appropriate offsetting account.

The problem is that steps 2 and 3 aren't really tied together, but I might have several different kinds of transactions that have the same payee. For example, at my bank, I might have a cash withdrawal:

2020/01/01 * My Bank
    ; AutosyncPayee: CASH WITHDRAW
    Assets:My Bank:Checking    $-20.00
    ; ofxid: ...
    Assets:Cash                 $20.00

Interest earned:

2020/01/01 * My Bank
    ; AutosyncPayee: INTEREST
    Assets:My Bank:Savings       $2.00
    ; ofxid: ...
    Income:Interest             $-2.00

A credit card payment (to a card owned by the same bank):

2020/01/01 * My Bank
    ; AutosyncPayee: CREDIT CARD PAYMENT
    Assets:My Bank:Checking   $-100.00
    ; ofxid: ...
    Liabilities:My CC         $-100.00

and so on. But as it is now, the offsetting account for all three types of transactions will be determined by whichever transaction appears with an AutosyncPayee tag most recently in my Ledgerfile. (And in my case, this is almost guaranteed to not be what I want, because I add AutosyncPayee values only as I find new transactions that need them, which means the most recent is most likely to be the least-frequent type of transaction.)

As the solution that appears the most obvious to me, should ledger-autosync instead tie steps 2 and 3 together, so that for my last example transaction, it considers not just transactions from My Bank, but from My Bank that have an AutosyncPayee of CREDIT CARD PAYMENT?

@claytonrcarter
Copy link

I just ran into this as well. In my case, I get rewards $$ from a credit card, but I also make payments to that card. The AutosyncPayee is different for each, but the ledger payee name that I've been using is not. The workaround if to tie each AutosyncPayee to a unique payee name (ie My Bank (Payment) and My Bank (Reward)) but it would be great if there were more fine grained controls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants