Add rules to predict account based on regex patterns#360
Open
tonypius wants to merge 8 commits intoananthakumaran:masterfrom
Open
Add rules to predict account based on regex patterns#360tonypius wants to merge 8 commits intoananthakumaran:masterfrom
tonypius wants to merge 8 commits intoananthakumaran:masterfrom
Conversation
Add regex rules functionality for account prediction
Revert "Add regex rules functionality for account prediction"
Owner
|
Have you tried the {{#if (isDate ROW.B "DD/MM/YYYY")}}
{{date ROW.B "DD/MM/YYYY"}} {{ROW.D}}
{{#if (or (eq (trim ROW.I) "0.00") (isBlank (trim ROW.I)))}}
{{or (match ROW.D Expenses:Food="ZOMATO" Expenses:Groceries="paytm" Liabilities:CreditCard:UB="POS")
"Expenses:Unknown"}} {{trim ROW.H}} INR
Assets:Checking:Union
{{else}}
Assets:Checking:Union
{{predictAccount prefix="Income"}} -{{trim ROW.I}} INR
{{/if}}
{{/if}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Account Rules Feature
This implementation adds regex-based account prediction rules to Paisa's import system.
Overview
The new feature provides:
/more/account-rulespredictAccountWithRulesfunction for import templatesHow to Use
1. Create Account Rules
AMAZON.*|AMZ.*)Expenses:Shopping:Online)2. Update Import Templates
Replace
predictAccountwithpredictAccountWithRulesin your import templates:Before:
After:
3. How It Works
predictAccountWithRulesfirst tries to match transaction data against your regex rulesprefixparameter if providedExample Rules
E-commerce
AMAZON.*|AMZ.*→ Account:Expenses:Shopping:OnlineFLIPKART|FKRT.*→ Account:Expenses:Shopping:OnlineTransportation
UBER|LYFT|OLA→ Account:Expenses:Transportation:RideshareMETRO|SUBWAY→ Account:Expenses:Transportation:PublicUtilities
ELECTRIC.*|POWER.*→ Account:Expenses:Utilities:ElectricWATER.*|H2O→ Account:Expenses:Utilities:WaterBanking
ATM.*FEE|WITHDRAWAL.*FEE→ Account:Expenses:Banking:FeesINTEREST.*CREDIT→ Account:Income:Interest:BankTechnical Details
Configuration Storage
Rules are stored in the
paisa.yamlconfiguration file underaccount_rules:API Endpoints
GET /api/account-rules- List all rulesPOST /api/account-rules/upsert- Create/update a rulePOST /api/account-rules/delete- Delete a ruleFunction Signature
Same parameters as
predictAccount, with the added regex matching logic.Benefits
predictAccounttemplates continue to work