From 87c7f79974d16f62377add99621fc7f2f2ea385e Mon Sep 17 00:00:00 2001 From: Herculino Trotta Date: Thu, 30 Jan 2025 11:01:16 -0300 Subject: [PATCH] Updated How it works? (markdown) --- How-it-works?.md | 75 +----------------------------------------------- 1 file changed, 1 insertion(+), 74 deletions(-) diff --git a/How-it-works?.md b/How-it-works?.md index 3d577bb..97dd8cd 100644 --- a/How-it-works?.md +++ b/How-it-works?.md @@ -356,77 +356,4 @@ The Currency Converter is a tool that allows you to quickly convert amounts betw WYGIWYH has a comprehensive API, it's documentation can be accessed on `/api/docs/` > [!NOTE] -> While the API works, there's still much to be added to it to equipare functionality with the main web app. - -### Transaction Rules - -Transaction Rules are a powerful feature in WYGIWYH that allow for automatic modification of transactions based on specified criteria. This can save time and ensure consistency in your financial tracking. - -Key Aspects of Transaction Rules: - -* **Conditions**: Set specific criteria that a transaction must meet for the rule to apply. This can include attributes like description, amount, account, etc. -* **Actions**: Define what changes should be made to a transaction when the conditions are met. This can include setting categories, tags, or modifying other fields. -* **Activation Options**: Rules can be set to apply when transactions are created, updated, or both. - -#### Actions and Conditions - -When creating a new rule, you will need to add a Condition and, later, Actions. - -Both use a limited subset of Python, via [SimpleEval](https://github.com/danthedeckie/simpleeval). - -The Condition must evaluate to True or False, and the Action must evaluate to a value that will be set on the selected field. - -You may use any of the available [variables](#available-variables) and [functions](#available-functions). - -#### Available variables - -* `account_name` -* `account_id` -* `account_group_name` -* `account_group_id` -* `is_asset_account` -* `is_archived_account` -* `category_name` -* `category_id` -* `tag_names` -* `tag_ids` -* `entities_names` -* `entities_ids` -* `is_expense` -* `is_income` -* `is_paid` -* `description` -* `amount` -* `notes` -* `date` -* `reference_date` - -#### Available functions - -* `relativedelta` - -#### Examples - -Add a tag to an income transaction if it happens in a specific account - -``` -If... -account_name == "My Investing Account" and is_income - -Then... -Set Tags to -tag_names + ["Yield"] -``` - ---- - -Move credit card transactions to next month when they happen at a cutoff date - -``` -If... -account_name == "My credit card" and date.day >= 26 and reference_date.month == date.month - -Then... -Set Reference Date to -reference_date + relativedelta(months=1)).replace(day=1) -``` \ No newline at end of file +> While the API works, there's still much to be added to it to equipare functionality with the main web app. \ No newline at end of file