Skip to content

Categories

Errietta Kostala edited this page Jul 23, 2018 · 2 revisions

Categories

Default categories:

  • Income [id: "income", class: "cat-income"]
    • matches all transactions with a credit amount above 0
  • Main Income [id: "main-income", class: "main-income]
    • You should configure this one as you see fit
  • Expenditure [id: "exp", class: "cat-exp"]
    • matches all transactions with a debit amount above 0
  • Refunds [id: "refunds", class: "cat-refunds"]
    • Matches "DEBIT" type transactions whose credit amount is above 0. This is how refunds show up in my bank statements, but there is no guarantee that your bank will do the same.

Rules:

Example:

   {
      "name": "Rent",
      "category_rules": {
        "txn_type": {
          "rules": [
            ["=", "SO"]
          ]
        },
        "txn_desc": {
          "mode": "STRICT",
          "rules": [ [ "=~", "YOUR LANDLORD'S NAME" ] ]
        }
      },
      "className": "cat-rent",
      "id": "rent"
    },

The category_rules property is how you configure which transactions match a category. They take one or more of the following properties:

  • txn_type (string) - The transaction type
  • txn_desc (string) - the description
  • txn_src (string) - the source the transaction was imported from
  • txn_amount_credit (number) - the credit amount.
  • txn_amount_debit (number) - the credit amount.
  • txn_day (number) - day of the month the transaction was made.

Each object above takes an array of arrays containing an operator and a value. The allowed operators for numbers are: =, !=, >, <, >=, <=. The allowed operators for strings are: =, !=, =~ (matches), '!~` (doesn't match)

If the mode is not given or is set to STRICT (strict), all rules for a given property have to match. If it's set to FLEX (flex), one of the rules has to match.

Examples:

        "txn_type": {
          "rules": [
            ["=", "SO"]
          ]
        },
        "txn_desc": {
          "mode": "STRICT",
          "rules": [ [ "=~", "YOUR LANDLORD'S NAME" ] ]
        }

This will match all transactions whose type is "SO" and description matches "YOUR LANDLORD'S NAME".

For example it will match the following: £1500 SO YOUR LOUR LANDLORD'S NAME But not the following: £100 SO SOME OTHER STANDING ORDER

"txn_amount_debit": { "mode": "STRICT", rules: [ [ ">=", 100 ], [ "<=", 200 ] ] }

This will match all transactions whose debit amount is between £100 and £200 inclusive. For example it will match the following:

PLUSHIES DEB £150 PIZZAS DEB £100 ELECTRIC DD £40 But not MORE PLUSHIES DEB £1000

       "txn_desc": {
          "mode": "FLEX",
          "rules": [
            ["=~", "VIRGIN MEDIA"],
            ["=~", "BT"]
          ]
        },

This will match transactions whose description matches "VIRGIN MEDIA" or "BT"

Hiding categories

Use "hidden_on_cat_list": true to hide a category from the categories list. "hidden_on_txn_list": true to hide it from the transactions list.

Modifying the transaction month

By default, all transactions will be considered in the month they were made (according to your bank). For example, if you pay rent on the 31st of April, the rent will show in the April statement. If you pay rent on the 1st of May, it will show in the May statement. Sometimes, you don't want to do this. For example, being paid at the end of the month and wanting your salary to count on the next month's statement. Or, in the rent case above, wanting to defend yourself against the possibility of the transaction ending up in the next month because the 31st was a weekend. Or maybe you want to count rent on the beginning of next month, together with your salary? (now that might be sensible). Or maybe I'm the only one who thinks this is useful.

Either way, txn_month_modifier is your friend! Observe:

 {
      "name": "Rent2",
      "category_rules": {
        "txn_type": {
          "rules": [
            ["=", "SO"]
          ]
        },
        "txn_day": {
          "rules": [
            ["<", 15]
          ]
        }
      },
      "txn_month_modifier": -1,
      "className": "cat-rent",
      "id": "rent-bring-back",
      "hidden_on_cat_list": true,
      "hidden_on_txn_list": true
    },

Now if rent comes in before the 15th (which means that it came out in the beginning of the month because the end of the month was a bank holiday), it'll count as the previous month.

Or:

{
      "name": "Main Income",
      "category_rules": {
        "txn_amount_credit": {
          "rules": [
            [">=", "DON'T BE NOSY"]
          ]
        },
        "txn_desc": {
          "rules": [
            ["!~", "MY NAME"]
          ]
        }
      },
      "className": "cat-income",
      "id": "main-income",
      "txn_month_modifier": 1
    },

Now your "main income" transactions will show on the next month's statement from the month they were made! (so the one from the 31st of April will show on May's statement)

Clone this wiki locally