Skip to content

Commit

Permalink
Revert "is_simplify_report_closure_enabled integrated (#199)" (#203)
Browse files Browse the repository at this point in the history
This reverts commit 4895e6f.
  • Loading branch information
vishalpandeynits authored Jan 20, 2023
1 parent 4895e6f commit b4e7626
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 77 deletions.
19 changes: 0 additions & 19 deletions apps/fyle/migrations/0016_auto_20230117_0616.py

This file was deleted.

10 changes: 1 addition & 9 deletions apps/fyle/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,6 @@ def get_default_ccc_expense_group_fields():
def get_default_expense_state():
return 'PAYMENT_PROCESSING'

def get_default_ccc_expense_state():
return 'PAID'

CCC_EXPENSE_STATE = (
('APPROVED', 'APPROVED'),
('PAID', 'PAID'),
('PAYMENT_PROCESSING', 'PAYMENT_PROCESSING')
)

class ExpenseGroupSettings(models.Model):
"""
Expand All @@ -201,7 +193,7 @@ class ExpenseGroupSettings(models.Model):
max_length=100, default=get_default_expense_state,
help_text='state at which the reimbursable expenses are fetched (PAYMENT_PROCESSING / PAID)', null=True)
ccc_expense_state = models.CharField(
max_length=100, default=get_default_ccc_expense_state, choices=CCC_EXPENSE_STATE,
max_length=100, default=get_default_expense_state,
help_text='state at which the ccc expenses are fetched (PAYMENT_PROCESSING /PAID)', null=True)
reimbursable_export_date_type = models.CharField(max_length=100, default='current_date', help_text='Export Date')
ccc_export_date_type = models.CharField(max_length=100, default='spent_at', help_text='CCC Export Date')
Expand Down
3 changes: 1 addition & 2 deletions apps/fyle/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,13 @@ def async_create_expense_groups(workspace_id: int, fund_source: List[str], task_

if expenses:
workspace.last_synced_at = datetime.now()
reimbursable_expenses_count += len(expenses)
reimbursable_expenses_count = len(expenses)

if 'CCC' in fund_source:
expenses.extend(platform.expenses.get(
source_account_type=['PERSONAL_CORPORATE_CREDIT_CARD_ACCOUNT'],
state=expense_group_settings.ccc_expense_state,
settled_at=ccc_last_synced_at if expense_group_settings.ccc_expense_state == 'PAYMENT_PROCESSING' else None,
approved_at=ccc_last_synced_at if expense_group_settings.ccc_expense_state == 'APPROVED' else None,
filter_credit_expenses=filter_credit_expenses,
last_paid_at=ccc_last_synced_at if expense_group_settings.ccc_expense_state == 'PAID' else None
))
Expand Down
8 changes: 1 addition & 7 deletions apps/workspaces/apis/export_settings/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,7 @@ class WorkspaceGeneralSettingsSerializer(serializers.ModelSerializer):

class Meta:
model = WorkspaceGeneralSettings
fields = [
'reimbursable_expenses_object',
'corporate_credit_card_expenses_object',
'auto_map_employees',
'is_simplify_report_closure_enabled'
]
read_only_fields = ['is_simplify_report_closure_enabled']
fields = ['reimbursable_expenses_object', 'corporate_credit_card_expenses_object', 'auto_map_employees']


class GeneralMappingsSerializer(serializers.ModelSerializer):
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion apps/workspaces/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ class WorkspaceGeneralSettings(models.Model):
skip_cards_mapping = models.BooleanField(default=False, help_text='Skip cards mapping')
import_tax_codes = models.BooleanField(default=False, help_text='Auto import tax codes to Fyle', null=True)
import_customers = models.BooleanField(default=False, help_text='Auto import customers to Fyle')
is_simplify_report_closure_enabled = models.BooleanField(default=False, help_text='Simplify report closure is enabled')
created_at = models.DateTimeField(auto_now_add=True, help_text='Created at')
updated_at = models.DateTimeField(auto_now=True, help_text='Updated at')
charts_of_accounts = ArrayField(
Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ django-rest-framework==0.1.0
djangorestframework==3.11.2
enum34==1.1.10
future==0.18.2
fyle==0.30.0
fyle-accounting-mappings==1.22.0
fyle-accounting-mappings==1.20.0
fyle-integrations-platform-connector==1.22.0
fyle-rest-auth==1.3.1
gunicorn==20.0.4
Expand Down
7 changes: 0 additions & 7 deletions sql/scripts/017-set-ccc-expense-state.sql

This file was deleted.

15 changes: 6 additions & 9 deletions tests/sql_fixtures/reset_db_fixtures/reset_db.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
-- PostgreSQL database dump
--

-- Dumped from database version 15.1 (Debian 15.1-1.pgdg110+1)
-- Dumped by pg_dump version 15.1 (Debian 15.1-1.pgdg100+1)
-- Dumped from database version 14.2 (Debian 14.2-1.pgdg110+1)
-- Dumped by pg_dump version 14.5 (Debian 14.5-1.pgdg100+1)

SET statement_timeout = 0;
SET lock_timeout = 0;
Expand Down Expand Up @@ -1387,8 +1387,7 @@ CREATE TABLE public.workspace_general_settings (
charts_of_accounts character varying(100)[] NOT NULL,
import_customers boolean NOT NULL,
change_accounting_period boolean NOT NULL,
auto_create_merchant_destination_entity boolean NOT NULL,
is_simplify_report_closure_enabled boolean NOT NULL
auto_create_merchant_destination_entity boolean NOT NULL
);


Expand Down Expand Up @@ -2416,8 +2415,6 @@ COPY public.django_migrations (id, app, name, applied) FROM stdin;
124 mappings 0007_auto_20221102_0630 2022-11-03 06:28:39.216754+00
125 workspaces 0030_auto_20221102_1924 2022-11-03 06:28:39.245951+00
126 fyle 0015_auto_20221104_1049 2022-11-04 11:04:25.882513+00
127 workspaces 0031_workspacegeneralsettings_is_simplify_report_closure_enabled 2023-01-11 06:28:22.8634+00
128 fyle 0016_auto_20230117_0616 2023-01-18 09:08:24.092416+00
\.


Expand Down Expand Up @@ -4819,8 +4816,8 @@ COPY public.users (password, last_login, id, email, user_id, full_name, active,
-- Data for Name: workspace_general_settings; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.workspace_general_settings (id, reimbursable_expenses_object, corporate_credit_card_expenses_object, created_at, updated_at, workspace_id, sync_fyle_to_xero_payments, sync_xero_to_fyle_payments, import_categories, auto_map_employees, auto_create_destination_entity, map_merchant_to_contact, skip_cards_mapping, import_tax_codes, charts_of_accounts, import_customers, change_accounting_period, auto_create_merchant_destination_entity, is_simplify_report_closure_enabled) FROM stdin;
1 PURCHASE BILL BANK TRANSACTION 2022-08-02 20:25:24.644164+00 2022-08-02 20:25:24.644209+00 1 f t t EMAIL t t f t {EXPENSE} t t f f
COPY public.workspace_general_settings (id, reimbursable_expenses_object, corporate_credit_card_expenses_object, created_at, updated_at, workspace_id, sync_fyle_to_xero_payments, sync_xero_to_fyle_payments, import_categories, auto_map_employees, auto_create_destination_entity, map_merchant_to_contact, skip_cards_mapping, import_tax_codes, charts_of_accounts, import_customers, change_accounting_period, auto_create_merchant_destination_entity) FROM stdin;
1 PURCHASE BILL BANK TRANSACTION 2022-08-02 20:25:24.644164+00 2022-08-02 20:25:24.644209+00 1 f t t EMAIL t t f t {EXPENSE} t t f
\.


Expand Down Expand Up @@ -4933,7 +4930,7 @@ SELECT pg_catalog.setval('public.django_content_type_id_seq', 37, true);
-- Name: django_migrations_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('public.django_migrations_id_seq', 128, true);
SELECT pg_catalog.setval('public.django_migrations_id_seq', 126, true);


--
Expand Down
1 change: 0 additions & 1 deletion tests/test_workspaces/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
'id':2,
'reimbursable_expenses_object':'PURCHASE BILL',
'corporate_credit_card_expenses_object':'BANK TRANSACTION',
'is_simplify_report_closure_enabled': True,
'sync_fyle_to_xero_payments':False,
'sync_xero_to_fyle_payments':True,
'map_merchant_to_contact':True,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
"workspace_general_settings": {
"reimbursable_expenses_object": "PURCHASE BILL",
"corporate_credit_card_expenses_object": "BANK TRANSACTION",
"auto_map_employees": "EMAIL",
'is_simplify_report_closure_enabled': True
"auto_map_employees": "EMAIL"
},
"expense_group_settings": {
"reimbursable_expense_group_fields": [
Expand Down

0 comments on commit b4e7626

Please sign in to comment.