-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support split expense grouping (#402)
* feat: add fields to support split expense grouping * fix: update sql fixture * test: add unit tests for split expense grouping and update existing fixtures (#401) * test: add unit tests for split expense grouping and update existing fixtures * refactor: lint * feat: add `split_expense_grouping` to the expense group settings serializer (#404) * feat: add `split_expense_grouping` to the expense group settings serializer * feat: implement split expense grouping functionality (#405) * feat: implement split expense grouping functionality * fix: skip only `expense_id` and `expense_number` while grouping while defining the fields to group split expenses by, skip only `expense_id` and `expense_number`, NOT `spent_at` or `posted_at` * feat: add script for split expense grouping (#406) Set the default split expense grouping config to `SINGLE_LINE_ITEM` for all old orgs
- Loading branch information
1 parent
c4da2fb
commit 86effd4
Showing
11 changed files
with
426 additions
and
26 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
apps/fyle/migrations/0022_support_split_expense_grouping.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Generated by Django 3.2.14 on 2024-11-18 09:48 | ||
|
||
import apps.fyle.models | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('fyle', '0021_expense_is_posted_at_null'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='expense', | ||
name='bank_transaction_id', | ||
field=models.CharField(blank=True, help_text='Bank Transaction ID', max_length=255, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='expensegroupsettings', | ||
name='split_expense_grouping', | ||
field=models.CharField(choices=[('SINGLE_LINE_ITEM', 'SINGLE_LINE_ITEM'), ('MULTIPLE_LINE_ITEM', 'MULTIPLE_LINE_ITEM')], default=apps.fyle.models.get_default_split_expense_grouping, help_text='specify line items for split expenses grouping', max_length=100), | ||
), | ||
] |
This file contains 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
This file contains 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
5 changes: 5 additions & 0 deletions
5
sql/scripts/027-default-split-expense-grouping-for-old-orgs.sql
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
rollback; | ||
begin; | ||
|
||
UPDATE expense_group_settings | ||
SET split_expense_grouping = 'SINGLE_LINE_ITEM'; |
Oops, something went wrong.