diff --git a/hasura/metadata/tables.yaml b/hasura/metadata/tables.yaml index 111374fb5..1ce055244 100644 --- a/hasura/metadata/tables.yaml +++ b/hasura/metadata/tables.yaml @@ -2092,6 +2092,13 @@ table: name: employee_team_members schema: public + - name: joblines + using: + foreign_key_constraint_on: + column: assigned_team + table: + name: joblines + schema: public insert_permissions: - role: user permission: @@ -2665,6 +2672,9 @@ name: joblines schema: public object_relationships: + - name: employee_team + using: + foreign_key_constraint_on: assigned_team - name: job using: foreign_key_constraint_on: jobid @@ -2726,6 +2736,7 @@ - alt_part_i - alt_partm - alt_partno + - assigned_team - bett_amt - bett_pctg - bett_tax @@ -2734,6 +2745,7 @@ - convertedtolbr - convertedtolbr_data - created_at + - critical - db_hrs - db_price - db_ref @@ -2793,6 +2805,7 @@ - alt_part_i - alt_partm - alt_partno + - assigned_team - bett_amt - bett_pctg - bett_tax @@ -2872,6 +2885,7 @@ - alt_part_i - alt_partm - alt_partno + - assigned_team - bett_amt - bett_pctg - bett_tax diff --git a/hasura/migrations/1688674667178_alter_table_public_joblines_add_column_assigned_team/down.sql b/hasura/migrations/1688674667178_alter_table_public_joblines_add_column_assigned_team/down.sql new file mode 100644 index 000000000..61af19807 --- /dev/null +++ b/hasura/migrations/1688674667178_alter_table_public_joblines_add_column_assigned_team/down.sql @@ -0,0 +1,4 @@ +-- Could not auto-generate a down migration. +-- Please write an appropriate down migration for the SQL below: +-- alter table "public"."joblines" add column "assigned_team" uuid +-- null; diff --git a/hasura/migrations/1688674667178_alter_table_public_joblines_add_column_assigned_team/up.sql b/hasura/migrations/1688674667178_alter_table_public_joblines_add_column_assigned_team/up.sql new file mode 100644 index 000000000..0128442fe --- /dev/null +++ b/hasura/migrations/1688674667178_alter_table_public_joblines_add_column_assigned_team/up.sql @@ -0,0 +1,2 @@ +alter table "public"."joblines" add column "assigned_team" uuid + null; diff --git a/hasura/migrations/1688674763806_set_fk_public_joblines_assigned_team/down.sql b/hasura/migrations/1688674763806_set_fk_public_joblines_assigned_team/down.sql new file mode 100644 index 000000000..651570671 --- /dev/null +++ b/hasura/migrations/1688674763806_set_fk_public_joblines_assigned_team/down.sql @@ -0,0 +1 @@ +alter table "public"."joblines" drop constraint "joblines_assigned_team_fkey"; diff --git a/hasura/migrations/1688674763806_set_fk_public_joblines_assigned_team/up.sql b/hasura/migrations/1688674763806_set_fk_public_joblines_assigned_team/up.sql new file mode 100644 index 000000000..4740318f8 --- /dev/null +++ b/hasura/migrations/1688674763806_set_fk_public_joblines_assigned_team/up.sql @@ -0,0 +1,5 @@ +alter table "public"."joblines" + add constraint "joblines_assigned_team_fkey" + foreign key ("assigned_team") + references "public"."employee_teams" + ("id") on update restrict on delete restrict; diff --git a/server/accounting/qbxml/qbxml-payables.js b/server/accounting/qbxml/qbxml-payables.js index 6b9951500..26f0f2d8a 100644 --- a/server/accounting/qbxml/qbxml-payables.js +++ b/server/accounting/qbxml/qbxml-payables.js @@ -135,7 +135,10 @@ const findTaxCode = (billLine, taxcode) => { applicable_taxes: { local, state, federal }, } = billLine.applicable_taxes === null - ? { applicable_taxes: { local: false, state: false, federal: false } } + ? { + ...billLine, + applicable_taxes: { local: false, state: false, federal: false }, + } : billLine; const t = taxcode.filter( (t) =>