From 92b1c95c133e5032edc7df854af6922828619618 Mon Sep 17 00:00:00 2001 From: anishfyle Date: Wed, 13 Nov 2024 21:32:35 +0530 Subject: [PATCH 1/3] feat: handle posted at --- apps/fyle/models.py | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/fyle/models.py b/apps/fyle/models.py index bcb1cc36..cad6b5ee 100644 --- a/apps/fyle/models.py +++ b/apps/fyle/models.py @@ -135,6 +135,7 @@ class Expense(models.Model): posted_at = models.DateTimeField( null=True, help_text="Date when the money is taken from the bank" ) + is_posted_at_null = models.BooleanField(default=False, help_text='Flag check if posted at is null or not') expense_created_at = models.DateTimeField(help_text="Expense created at") expense_updated_at = models.DateTimeField(help_text="Expense created at") created_at = models.DateTimeField(auto_now_add=True, help_text="Created at") From 3ce6f94a7fc05a0a10d06882c479bb235f74ea71 Mon Sep 17 00:00:00 2001 From: anishfyle Date: Mon, 18 Nov 2024 02:43:54 +0530 Subject: [PATCH 2/3] migrations and resetdb --- .../0021_expense_is_posted_at_null.py | 18 ++++++ .../reset_db_fixtures/reset_db.sql | 55 ++++++++++--------- 2 files changed, 48 insertions(+), 25 deletions(-) create mode 100644 apps/fyle/migrations/0021_expense_is_posted_at_null.py diff --git a/apps/fyle/migrations/0021_expense_is_posted_at_null.py b/apps/fyle/migrations/0021_expense_is_posted_at_null.py new file mode 100644 index 00000000..3ef2e81b --- /dev/null +++ b/apps/fyle/migrations/0021_expense_is_posted_at_null.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.14 on 2024-11-17 21:05 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('fyle', '0020_expensegroup_export_url'), + ] + + operations = [ + migrations.AddField( + model_name='expense', + name='is_posted_at_null', + field=models.BooleanField(default=False, help_text='Flag check if posted at is null or not'), + ), + ] diff --git a/tests/sql_fixtures/reset_db_fixtures/reset_db.sql b/tests/sql_fixtures/reset_db_fixtures/reset_db.sql index fa250596..4698b0d7 100644 --- a/tests/sql_fixtures/reset_db_fixtures/reset_db.sql +++ b/tests/sql_fixtures/reset_db_fixtures/reset_db.sql @@ -2,7 +2,7 @@ -- PostgreSQL database dump -- --- Dumped from database version 15.7 (Debian 15.7-1.pgdg120+1) +-- Dumped from database version 15.9 (Debian 15.9-1.pgdg120+1) -- Dumped by pg_dump version 15.8 (Debian 15.8-1.pgdg120+1) SET statement_timeout = 0; @@ -943,7 +943,8 @@ CREATE TABLE public.expenses ( accounting_export_summary jsonb NOT NULL, previous_export_state character varying(255), workspace_id integer, - paid_on_fyle boolean NOT NULL + paid_on_fyle boolean NOT NULL, + is_posted_at_null boolean NOT NULL ); @@ -2636,6 +2637,8 @@ COPY public.django_migrations (id, app, name, applied) FROM stdin; 153 fyle 0020_expensegroup_export_url 2024-08-03 14:33:54.988078+00 154 xero 0010_bill_is_retired 2024-09-03 11:40:50.93784+00 155 fyle_accounting_mappings 0026_destinationattribute_code 2024-10-01 09:00:27.71815+00 +156 fyle 0021_expense_is_posted_at_null 2024-11-17 21:11:41.101604+00 +157 tasks 0010_alter_tasklog_expense_group 2024-11-17 21:11:41.133814+00 \. @@ -4876,17 +4879,17 @@ COPY public.expense_groups_expenses (id, expensegroup_id, expense_id) FROM stdin -- Data for Name: expenses; Type: TABLE DATA; Schema: public; Owner: postgres -- -COPY public.expenses (id, employee_email, category, sub_category, project, expense_id, expense_number, claim_number, amount, currency, foreign_amount, foreign_currency, settlement_id, reimbursable, state, vendor, cost_center, purpose, report_id, spent_at, approved_at, expense_created_at, expense_updated_at, created_at, updated_at, fund_source, verified_at, custom_properties, paid_on_xero, org_id, file_ids, corporate_card_id, tax_amount, tax_group_id, billable, employee_name, posted_at, accounting_export_summary, previous_export_state, workspace_id, paid_on_fyle) FROM stdin; -1 ashwin.t@fyle.in Food \N \N txaaVBj3yKGW E/2022/06/T/4 C/2022/06/R/2 1 USD \N \N setrunCck8hLH t PAYMENT_PROCESSING \N \N \N rp9EvDF8Umk6 2022-06-27 17:00:00+00 2022-06-27 09:06:52.951+00 2022-06-27 09:06:13.135764+00 2022-06-27 09:08:23.340321+00 2022-08-02 20:26:22.81033+00 2022-08-02 20:26:22.810363+00 PERSONAL \N {"Card": "", "Killua": "", "Classes": "", "avc_123": null, "New Field": "", "Multi field": "", "Testing This": "", "abc in [123]": null, "Postman Field": "", "Netsuite Class": ""} f orPJvXuoLqvJ {} \N \N \N f \N \N {} \N \N f -2 ashwin.t@fyle.in Food \N \N txB6D8k0Ws8a E/2022/06/T/2 C/2022/06/R/3 4 USD \N \N setrunCck8hLH t PAYMENT_PROCESSING \N \N \N rpNeZt3cv9wz 2022-06-27 17:00:00+00 2022-06-27 09:07:16.556+00 2022-06-27 09:05:45.738+00 2022-06-27 09:08:23.340321+00 2022-08-02 20:26:22.82716+00 2022-08-02 20:26:22.827194+00 PERSONAL \N {"Card": "", "Killua": "", "Classes": "", "avc_123": null, "New Field": "", "Multi field": "", "Testing This": "", "abc in [123]": null, "Postman Field": "", "Netsuite Class": ""} f orPJvXuoLqvJ {} \N \N \N f \N \N {} \N \N f -3 sravan.kumar@fyle.in Food \N Bebe Rexha txGilVGolf60 E/2022/06/T/1 C/2022/06/R/1 10 USD \N \N setlpIUKpdvsT t PAYMENT_PROCESSING \N Adidas \N rpKuJtEv6h0n 2020-01-01 17:00:00+00 2022-06-08 04:28:30.61+00 2022-06-08 04:27:35.274447+00 2022-06-08 04:28:51.237261+00 2022-08-02 20:26:22.835984+00 2022-08-02 20:26:22.83608+00 PERSONAL \N {"Card": "", "Killua": "", "Classes": "", "avc_123": null, "New Field": "", "Multi field": "", "Testing This": "", "abc in [123]": null, "POSTMAN FIELD": "", "Netsuite Class": ""} f orPJvXuoLqvJ {} \N 1 tg0gTsClGjLp f \N \N {} \N \N f -4 sravan.kumar@fyle.in Food \N \N txjIqTCtkkC8 E/2022/05/T/21 C/2022/05/R/18 100 USD \N \N set3ZMFXrDPL3 f PAYMENT_PROCESSING \N \N \N rpLawO11bFib 2022-05-25 17:00:00+00 2022-05-25 08:59:25.649+00 2022-05-25 08:59:07.718891+00 2022-05-25 09:04:05.66983+00 2022-08-02 20:26:22.844927+00 2022-08-02 20:26:22.844961+00 CCC \N {"Card": "", "Killua": "", "Classes": "", "avc_123": null, "New Field": "", "Multi field": "", "Testing This": "", "abc in [123]": null, "POSTMAN FIELD": "", "Netsuite Class": ""} f orPJvXuoLqvJ {} \N \N \N f \N \N {} \N \N f -5 sravan.kumar@fyle.in WIP \N Bebe Rexha txUPRc3VwxOP E/2022/05/T/19 C/2022/05/R/17 101 USD \N \N setb1pSLMIok8 f PAYMENT_PROCESSING \N Adidas \N rpv1txzAsgr3 2021-01-01 17:00:00+00 2022-05-25 07:24:12.987+00 2022-05-25 07:21:40.598113+00 2022-05-25 07:25:00.848892+00 2022-08-02 20:26:22.857516+00 2022-08-02 20:26:22.857675+00 CCC \N {"Card": "", "Killua": "", "Classes": "", "avc_123": null, "New Field": "", "Multi field": "", "Testing This": "", "abc in [123]": null, "POSTMAN FIELD": "", "Netsuite Class": ""} f orPJvXuoLqvJ {} \N \N \N f \N \N {} \N \N f -6 ashwin.t@fyle.in Food \N \N txUDvDmEV4ep E/2022/05/T/18 C/2022/05/R/16 5 USD \N \N set33iAVXO7BA t PAYMENT_PROCESSING \N \N \N rpE2JyATZhDe 2020-05-25 17:00:00+00 2022-05-25 06:05:23.362+00 2022-05-25 06:04:46.557927+00 2022-05-25 06:05:47.36985+00 2022-08-02 20:26:22.870854+00 2022-08-02 20:26:22.87089+00 PERSONAL \N {"Card": "", "Killua": "", "Classes": "", "avc_123": null, "New Field": "", "Multi field": "", "Testing This": "", "abc in [123]": null, "POSTMAN FIELD": "", "Netsuite Class": ""} f orPJvXuoLqvJ {} \N \N \N f \N \N {} \N \N f -7 sravan.kumar@fyle.in WIP \N Bebe Rexha tx1FW3uxYZG6 E/2022/05/T/16 C/2022/05/R/15 151 USD \N \N setzFn3FK5t80 f PAYMENT_PROCESSING \N Adidas \N rprwGgzOZyfR 2022-05-25 17:00:00+00 2022-05-25 03:41:49.042+00 2022-05-25 03:41:28.839711+00 2022-05-25 03:42:10.145663+00 2022-08-02 20:26:22.882803+00 2022-08-02 20:26:22.882836+00 CCC \N {"Card": "", "Killua": "", "Classes": "", "avc_123": null, "New Field": "", "Multi field": "", "Testing This": "", "abc in [123]": null, "POSTMAN FIELD": "", "Netsuite Class": ""} f orPJvXuoLqvJ {} \N \N \N f \N \N {} \N \N f -8 sravan.kumar@fyle.in WIP \N Bebe Rexha txVXhyVB8mgK E/2022/05/T/15 C/2022/05/R/14 45 USD \N \N setsN8cLD9KIn f PAYMENT_PROCESSING \N Adidas \N rpnG3lZYDsHU 2022-05-25 17:00:00+00 2022-05-25 02:48:53.791+00 2022-05-25 02:48:37.432989+00 2022-05-25 02:49:18.189037+00 2022-08-02 20:26:22.894793+00 2022-08-02 20:26:22.894827+00 CCC \N {"Card": "", "Killua": "", "Classes": "", "avc_123": null, "New Field": "", "Multi field": "", "Testing This": "", "abc in [123]": null, "POSTMAN FIELD": "", "Netsuite Class": ""} f orPJvXuoLqvJ {} \N \N \N f \N \N {} \N \N f -9 sravan.kumar@fyle.in WIP \N Bebe Rexha txBMQRkBQciI E/2022/05/T/14 C/2022/05/R/13 10 USD \N \N setanDKqMZfXB f PAYMENT_PROCESSING \N Adidas \N rpVvNQvE2wbm 2022-05-25 17:00:00+00 2022-05-25 02:38:40.858+00 2022-05-25 02:38:25.832419+00 2022-05-25 02:39:08.208877+00 2022-08-02 20:26:22.908632+00 2022-08-02 20:26:22.908661+00 CCC \N {"Card": "", "Killua": "", "Classes": "", "avc_123": null, "New Field": "", "Multi field": "", "Testing This": "", "abc in [123]": null, "POSTMAN FIELD": "", "Netsuite Class": ""} f orPJvXuoLqvJ {} \N \N \N f \N \N {} \N \N f -10 sravan.kumar@fyle.in WIP \N Bebe Rexha txkw3dt3umkN E/2022/05/T/12 C/2022/05/R/12 101 USD \N \N setBe6qAlNXPU f PAYMENT_PROCESSING \N Adidas \N rp5lITpxFLxE 2022-05-24 17:00:00+00 2022-05-24 15:59:13.26+00 2022-05-24 15:55:50.369024+00 2022-05-24 16:00:27.982+00 2022-08-02 20:26:22.921466+00 2022-08-02 20:26:22.9215+00 CCC \N {"Card": "", "Killua": "", "Classes": "", "avc_123": null, "New Field": "", "Multi field": "", "Testing This": "", "abc in [123]": null, "POSTMAN FIELD": "", "Netsuite Class": ""} f orPJvXuoLqvJ {} \N 1 tg0gTsClGjLp f \N \N {} \N \N f +COPY public.expenses (id, employee_email, category, sub_category, project, expense_id, expense_number, claim_number, amount, currency, foreign_amount, foreign_currency, settlement_id, reimbursable, state, vendor, cost_center, purpose, report_id, spent_at, approved_at, expense_created_at, expense_updated_at, created_at, updated_at, fund_source, verified_at, custom_properties, paid_on_xero, org_id, file_ids, corporate_card_id, tax_amount, tax_group_id, billable, employee_name, posted_at, accounting_export_summary, previous_export_state, workspace_id, paid_on_fyle, is_posted_at_null) FROM stdin; +1 ashwin.t@fyle.in Food \N \N txaaVBj3yKGW E/2022/06/T/4 C/2022/06/R/2 1 USD \N \N setrunCck8hLH t PAYMENT_PROCESSING \N \N \N rp9EvDF8Umk6 2022-06-27 17:00:00+00 2022-06-27 09:06:52.951+00 2022-06-27 09:06:13.135764+00 2022-06-27 09:08:23.340321+00 2022-08-02 20:26:22.81033+00 2022-08-02 20:26:22.810363+00 PERSONAL \N {"Card": "", "Killua": "", "Classes": "", "avc_123": null, "New Field": "", "Multi field": "", "Testing This": "", "abc in [123]": null, "Postman Field": "", "Netsuite Class": ""} f orPJvXuoLqvJ {} \N \N \N f \N \N {} \N \N f f +2 ashwin.t@fyle.in Food \N \N txB6D8k0Ws8a E/2022/06/T/2 C/2022/06/R/3 4 USD \N \N setrunCck8hLH t PAYMENT_PROCESSING \N \N \N rpNeZt3cv9wz 2022-06-27 17:00:00+00 2022-06-27 09:07:16.556+00 2022-06-27 09:05:45.738+00 2022-06-27 09:08:23.340321+00 2022-08-02 20:26:22.82716+00 2022-08-02 20:26:22.827194+00 PERSONAL \N {"Card": "", "Killua": "", "Classes": "", "avc_123": null, "New Field": "", "Multi field": "", "Testing This": "", "abc in [123]": null, "Postman Field": "", "Netsuite Class": ""} f orPJvXuoLqvJ {} \N \N \N f \N \N {} \N \N f f +3 sravan.kumar@fyle.in Food \N Bebe Rexha txGilVGolf60 E/2022/06/T/1 C/2022/06/R/1 10 USD \N \N setlpIUKpdvsT t PAYMENT_PROCESSING \N Adidas \N rpKuJtEv6h0n 2020-01-01 17:00:00+00 2022-06-08 04:28:30.61+00 2022-06-08 04:27:35.274447+00 2022-06-08 04:28:51.237261+00 2022-08-02 20:26:22.835984+00 2022-08-02 20:26:22.83608+00 PERSONAL \N {"Card": "", "Killua": "", "Classes": "", "avc_123": null, "New Field": "", "Multi field": "", "Testing This": "", "abc in [123]": null, "POSTMAN FIELD": "", "Netsuite Class": ""} f orPJvXuoLqvJ {} \N 1 tg0gTsClGjLp f \N \N {} \N \N f f +4 sravan.kumar@fyle.in Food \N \N txjIqTCtkkC8 E/2022/05/T/21 C/2022/05/R/18 100 USD \N \N set3ZMFXrDPL3 f PAYMENT_PROCESSING \N \N \N rpLawO11bFib 2022-05-25 17:00:00+00 2022-05-25 08:59:25.649+00 2022-05-25 08:59:07.718891+00 2022-05-25 09:04:05.66983+00 2022-08-02 20:26:22.844927+00 2022-08-02 20:26:22.844961+00 CCC \N {"Card": "", "Killua": "", "Classes": "", "avc_123": null, "New Field": "", "Multi field": "", "Testing This": "", "abc in [123]": null, "POSTMAN FIELD": "", "Netsuite Class": ""} f orPJvXuoLqvJ {} \N \N \N f \N \N {} \N \N f f +5 sravan.kumar@fyle.in WIP \N Bebe Rexha txUPRc3VwxOP E/2022/05/T/19 C/2022/05/R/17 101 USD \N \N setb1pSLMIok8 f PAYMENT_PROCESSING \N Adidas \N rpv1txzAsgr3 2021-01-01 17:00:00+00 2022-05-25 07:24:12.987+00 2022-05-25 07:21:40.598113+00 2022-05-25 07:25:00.848892+00 2022-08-02 20:26:22.857516+00 2022-08-02 20:26:22.857675+00 CCC \N {"Card": "", "Killua": "", "Classes": "", "avc_123": null, "New Field": "", "Multi field": "", "Testing This": "", "abc in [123]": null, "POSTMAN FIELD": "", "Netsuite Class": ""} f orPJvXuoLqvJ {} \N \N \N f \N \N {} \N \N f f +6 ashwin.t@fyle.in Food \N \N txUDvDmEV4ep E/2022/05/T/18 C/2022/05/R/16 5 USD \N \N set33iAVXO7BA t PAYMENT_PROCESSING \N \N \N rpE2JyATZhDe 2020-05-25 17:00:00+00 2022-05-25 06:05:23.362+00 2022-05-25 06:04:46.557927+00 2022-05-25 06:05:47.36985+00 2022-08-02 20:26:22.870854+00 2022-08-02 20:26:22.87089+00 PERSONAL \N {"Card": "", "Killua": "", "Classes": "", "avc_123": null, "New Field": "", "Multi field": "", "Testing This": "", "abc in [123]": null, "POSTMAN FIELD": "", "Netsuite Class": ""} f orPJvXuoLqvJ {} \N \N \N f \N \N {} \N \N f f +7 sravan.kumar@fyle.in WIP \N Bebe Rexha tx1FW3uxYZG6 E/2022/05/T/16 C/2022/05/R/15 151 USD \N \N setzFn3FK5t80 f PAYMENT_PROCESSING \N Adidas \N rprwGgzOZyfR 2022-05-25 17:00:00+00 2022-05-25 03:41:49.042+00 2022-05-25 03:41:28.839711+00 2022-05-25 03:42:10.145663+00 2022-08-02 20:26:22.882803+00 2022-08-02 20:26:22.882836+00 CCC \N {"Card": "", "Killua": "", "Classes": "", "avc_123": null, "New Field": "", "Multi field": "", "Testing This": "", "abc in [123]": null, "POSTMAN FIELD": "", "Netsuite Class": ""} f orPJvXuoLqvJ {} \N \N \N f \N \N {} \N \N f f +8 sravan.kumar@fyle.in WIP \N Bebe Rexha txVXhyVB8mgK E/2022/05/T/15 C/2022/05/R/14 45 USD \N \N setsN8cLD9KIn f PAYMENT_PROCESSING \N Adidas \N rpnG3lZYDsHU 2022-05-25 17:00:00+00 2022-05-25 02:48:53.791+00 2022-05-25 02:48:37.432989+00 2022-05-25 02:49:18.189037+00 2022-08-02 20:26:22.894793+00 2022-08-02 20:26:22.894827+00 CCC \N {"Card": "", "Killua": "", "Classes": "", "avc_123": null, "New Field": "", "Multi field": "", "Testing This": "", "abc in [123]": null, "POSTMAN FIELD": "", "Netsuite Class": ""} f orPJvXuoLqvJ {} \N \N \N f \N \N {} \N \N f f +9 sravan.kumar@fyle.in WIP \N Bebe Rexha txBMQRkBQciI E/2022/05/T/14 C/2022/05/R/13 10 USD \N \N setanDKqMZfXB f PAYMENT_PROCESSING \N Adidas \N rpVvNQvE2wbm 2022-05-25 17:00:00+00 2022-05-25 02:38:40.858+00 2022-05-25 02:38:25.832419+00 2022-05-25 02:39:08.208877+00 2022-08-02 20:26:22.908632+00 2022-08-02 20:26:22.908661+00 CCC \N {"Card": "", "Killua": "", "Classes": "", "avc_123": null, "New Field": "", "Multi field": "", "Testing This": "", "abc in [123]": null, "POSTMAN FIELD": "", "Netsuite Class": ""} f orPJvXuoLqvJ {} \N \N \N f \N \N {} \N \N f f +10 sravan.kumar@fyle.in WIP \N Bebe Rexha txkw3dt3umkN E/2022/05/T/12 C/2022/05/R/12 101 USD \N \N setBe6qAlNXPU f PAYMENT_PROCESSING \N Adidas \N rp5lITpxFLxE 2022-05-24 17:00:00+00 2022-05-24 15:59:13.26+00 2022-05-24 15:55:50.369024+00 2022-05-24 16:00:27.982+00 2022-08-02 20:26:22.921466+00 2022-08-02 20:26:22.9215+00 CCC \N {"Card": "", "Killua": "", "Classes": "", "avc_123": null, "New Field": "", "Multi field": "", "Testing This": "", "abc in [123]": null, "POSTMAN FIELD": "", "Netsuite Class": ""} f orPJvXuoLqvJ {} \N 1 tg0gTsClGjLp f \N \N {} \N \N f f \. @@ -5173,7 +5176,7 @@ SELECT pg_catalog.setval('public.django_content_type_id_seq', 40, true); -- Name: django_migrations_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres -- -SELECT pg_catalog.setval('public.django_migrations_id_seq', 155, true); +SELECT pg_catalog.setval('public.django_migrations_id_seq', 157, true); -- @@ -5867,6 +5870,14 @@ ALTER TABLE ONLY public.task_logs ADD CONSTRAINT task_log_pkey PRIMARY KEY (id); +-- +-- Name: task_logs task_logs_expense_group_id_f19c75f9_uniq; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.task_logs + ADD CONSTRAINT task_logs_expense_group_id_f19c75f9_uniq UNIQUE (expense_group_id); + + -- -- Name: tenant_mappings tenant_mappings_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- @@ -6282,13 +6293,6 @@ CREATE INDEX task_log_bank_transaction_id_eaafbba2 ON public.task_logs USING btr CREATE INDEX task_log_bill_id_30283abe ON public.task_logs USING btree (bill_id); --- --- Name: task_log_expense_group_id_241da11b; Type: INDEX; Schema: public; Owner: postgres --- - -CREATE INDEX task_log_expense_group_id_241da11b ON public.task_logs USING btree (expense_group_id); - - -- -- Name: task_log_workspace_id_7ccc2065; Type: INDEX; Schema: public; Owner: postgres -- @@ -6708,19 +6712,19 @@ ALTER TABLE ONLY public.task_logs -- --- Name: task_logs task_log_expense_group_id_241da11b_fk_expense_groups_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres +-- Name: task_logs task_log_workspace_id_7ccc2065_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.task_logs - ADD CONSTRAINT task_log_expense_group_id_241da11b_fk_expense_groups_id FOREIGN KEY (expense_group_id) REFERENCES public.expense_groups(id) DEFERRABLE INITIALLY DEFERRED; + ADD CONSTRAINT task_log_workspace_id_7ccc2065_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES public.workspaces(id) DEFERRABLE INITIALLY DEFERRED; -- --- Name: task_logs task_log_workspace_id_7ccc2065_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres +-- Name: task_logs task_logs_expense_group_id_f19c75f9_fk_expense_groups_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.task_logs - ADD CONSTRAINT task_log_workspace_id_7ccc2065_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES public.workspaces(id) DEFERRABLE INITIALLY DEFERRED; + ADD CONSTRAINT task_logs_expense_group_id_f19c75f9_fk_expense_groups_id FOREIGN KEY (expense_group_id) REFERENCES public.expense_groups(id) DEFERRABLE INITIALLY DEFERRED; -- @@ -6790,3 +6794,4 @@ ALTER TABLE ONLY public.xero_credentials -- -- PostgreSQL database dump complete -- + From 48a27617ae9c84423bc06c40b67e5335b828b085 Mon Sep 17 00:00:00 2001 From: Anish Kr Singh <116036738+anishfyle@users.noreply.github.com> Date: Mon, 18 Nov 2024 14:21:08 +0530 Subject: [PATCH 3/3] feat: auto enable accounting period (#410) * feat: auto enable accounting period * migrations * reset db * platform connector ver --- ...generalsettings_change_accounting_period.py | 18 ++++++++++++++++++ apps/workspaces/models.py | 2 +- requirements.txt | 2 +- .../reset_db_fixtures/reset_db.sql | 3 ++- 4 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 apps/workspaces/migrations/0039_alter_workspacegeneralsettings_change_accounting_period.py diff --git a/apps/workspaces/migrations/0039_alter_workspacegeneralsettings_change_accounting_period.py b/apps/workspaces/migrations/0039_alter_workspacegeneralsettings_change_accounting_period.py new file mode 100644 index 00000000..a9a8b183 --- /dev/null +++ b/apps/workspaces/migrations/0039_alter_workspacegeneralsettings_change_accounting_period.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.14 on 2024-11-18 04:41 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('workspaces', '0038_alter_workspace_onboarding_state'), + ] + + operations = [ + migrations.AlterField( + model_name='workspacegeneralsettings', + name='change_accounting_period', + field=models.BooleanField(default=True, help_text='Change the accounting period'), + ), + ] diff --git a/apps/workspaces/models.py b/apps/workspaces/models.py index c999f9aa..e849297a 100644 --- a/apps/workspaces/models.py +++ b/apps/workspaces/models.py @@ -167,7 +167,7 @@ class WorkspaceGeneralSettings(models.Model): default=False, help_text="Map Merchant to Contact for CCC Expenses" ) change_accounting_period = models.BooleanField( - default=False, help_text="Change the accounting period" + default=True, help_text="Change the accounting period" ) import_categories = models.BooleanField( default=False, help_text="Auto import Categories to Fyle" diff --git a/requirements.txt b/requirements.txt index f8b93c4b..0753ef4e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -19,7 +19,7 @@ enum34==1.1.10 future==0.18.2 fyle==0.37.2 fyle-accounting-mappings==1.34.8 -fyle-integrations-platform-connector==1.38.4 +fyle-integrations-platform-connector==1.39.3 fyle-rest-auth==1.7.2 gevent==23.9.1 gunicorn==20.1.0 diff --git a/tests/sql_fixtures/reset_db_fixtures/reset_db.sql b/tests/sql_fixtures/reset_db_fixtures/reset_db.sql index 4698b0d7..cf286609 100644 --- a/tests/sql_fixtures/reset_db_fixtures/reset_db.sql +++ b/tests/sql_fixtures/reset_db_fixtures/reset_db.sql @@ -2639,6 +2639,7 @@ COPY public.django_migrations (id, app, name, applied) FROM stdin; 155 fyle_accounting_mappings 0026_destinationattribute_code 2024-10-01 09:00:27.71815+00 156 fyle 0021_expense_is_posted_at_null 2024-11-17 21:11:41.101604+00 157 tasks 0010_alter_tasklog_expense_group 2024-11-17 21:11:41.133814+00 +158 workspaces 0039_alter_workspacegeneralsettings_change_accounting_period 2024-11-18 04:43:45.472917+00 \. @@ -5176,7 +5177,7 @@ SELECT pg_catalog.setval('public.django_content_type_id_seq', 40, true); -- Name: django_migrations_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres -- -SELECT pg_catalog.setval('public.django_migrations_id_seq', 157, true); +SELECT pg_catalog.setval('public.django_migrations_id_seq', 158, true); --