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

Add 'complex tokens' to tokens.yaml #62

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nathankot
Copy link
Contributor

This PR adds 'complex tokens' that look like this:

Expenses:
  Personal:
    - McDonalds
    - Pattern: /OFFSHORE SERVICE MARGINS/
      Account: Liabilities:Visa:Personal
  Business:
    Bank Fees:
      - Pattern: /OFFSHORE SERVICE MARGINS/
        Account: Liabilities:Visa:Business

The motivation being that sometimes transactions will have the same
description, but depending on the statement that they were recorded in,
need to go into different accounts.

It also adds a skip feature which I use like this:

Global:
  - Pattern: /PAYMENT RECEIVED THANK YOU/
    Account: Liabilities:Visa:Personal
    Skip: true

Things like credit card payments are usually recorded on two separate
statements (e.g Checking and Visa,) therefore it's desirable to skip one
of these transactions in order to prevent doubling them up.

Some more features could be added to the complex token in the future,
I'm thinking it'd be nice to define rules so that e.g a sum coming out
of a statement account can go into multiple accounts based on given proportions

account: account,
skip: data["Skip"] == true
}
elsif parse_regexps && data.start_with?('/')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think it makes sense to move everything to complex tokens, adding these to complex_tokens as well, instead of having complex_tokens and regexps?

@cantino
Copy link
Owner

cantino commented May 16, 2016

Thanks @nathankot!

@varac
Copy link

varac commented Jul 4, 2017

@nathankot, @cantino It would be lovely to finally merge this!

@nathankot
Copy link
Contributor Author

@varac happy to rebase this if @cantino thinks this will likely go into reckon, personally I've moved to reading csv files with hledger instead

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

Successfully merging this pull request may close these issues.

3 participants