From b0ec7867b5708cb1fa2e50620aea71911489eb15 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Tue, 3 Aug 2021 11:27:03 -0700 Subject: [PATCH] IO-1281 System setting for posting time tickets to closed RO --- bodyshop_translations.babel | 21 +++++ .../job-search-select.component.jsx | 2 + .../shop-info/shop-info.general.component.jsx | 7 ++ .../tech-job-clock-in-form.component.jsx | 5 +- .../time-ticket-modal.component.jsx | 5 +- client/src/graphql/bodyshop.queries.js | 2 + client/src/graphql/jobs.queries.js | 2 + client/src/translations/en_us/common.json | 1 + client/src/translations/es/common.json | 1 + client/src/translations/fr/common.json | 1 + .../down.yaml | 5 ++ .../up.yaml | 6 ++ .../down.yaml | 88 ++++++++++++++++++ .../up.yaml | 89 +++++++++++++++++++ .../down.yaml | 80 +++++++++++++++++ .../up.yaml | 81 +++++++++++++++++ hasura/migrations/metadata.yaml | 2 + 17 files changed, 396 insertions(+), 2 deletions(-) create mode 100644 hasura/migrations/1628014681446_alter_table_public_bodyshops_add_column_tt_allow_post_to_invoiced/down.yaml create mode 100644 hasura/migrations/1628014681446_alter_table_public_bodyshops_add_column_tt_allow_post_to_invoiced/up.yaml create mode 100644 hasura/migrations/1628014693949_update_permission_user_public_table_bodyshops/down.yaml create mode 100644 hasura/migrations/1628014693949_update_permission_user_public_table_bodyshops/up.yaml create mode 100644 hasura/migrations/1628014707161_update_permission_user_public_table_bodyshops/down.yaml create mode 100644 hasura/migrations/1628014707161_update_permission_user_public_table_bodyshops/up.yaml diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 2c43e6db6..c2bb2b5a5 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -7054,6 +7054,27 @@ + + tt_allow_post_to_invoiced + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + use_fippa false diff --git a/client/src/components/job-search-select/job-search-select.component.jsx b/client/src/components/job-search-select/job-search-select.component.jsx index 3d31d2e5a..11dcafcb4 100644 --- a/client/src/components/job-search-select/job-search-select.component.jsx +++ b/client/src/components/job-search-select/job-search-select.component.jsx @@ -15,6 +15,7 @@ const JobSearchSelect = ( { disabled, convertedOnly = false, + notInvoiced = false, notExported = true, clm_no = false, ...restProps @@ -30,6 +31,7 @@ const JobSearchSelect = ( variables: { ...(convertedOnly ? { isConverted: true } : {}), ...(notExported ? { notExported: true } : {}), + ...(notInvoiced ? { notInvoiced: true } : {}), }, } : {}), diff --git a/client/src/components/shop-info/shop-info.general.component.jsx b/client/src/components/shop-info/shop-info.general.component.jsx index 26a92dcab..c58635431 100644 --- a/client/src/components/shop-info/shop-info.general.component.jsx +++ b/client/src/components/shop-info/shop-info.general.component.jsx @@ -444,6 +444,13 @@ export default function ShopInfoGeneral({ form }) { > + + + diff --git a/client/src/components/tech-job-clock-in-form/tech-job-clock-in-form.component.jsx b/client/src/components/tech-job-clock-in-form/tech-job-clock-in-form.component.jsx index 114dad1f0..e7920ee95 100644 --- a/client/src/components/tech-job-clock-in-form/tech-job-clock-in-form.component.jsx +++ b/client/src/components/tech-job-clock-in-form/tech-job-clock-in-form.component.jsx @@ -30,7 +30,10 @@ export function TechClockInComponent({ form, bodyshop, technician }) { }, ]} > - + - + )} diff --git a/client/src/graphql/bodyshop.queries.js b/client/src/graphql/bodyshop.queries.js index 0b65d35d8..41073abdb 100644 --- a/client/src/graphql/bodyshop.queries.js +++ b/client/src/graphql/bodyshop.queries.js @@ -92,6 +92,7 @@ export const QUERY_BODYSHOP = gql` cdk_dealerid features attach_pdf_to_email + tt_allow_post_to_invoiced employees { id active @@ -180,6 +181,7 @@ export const UPDATE_SHOP = gql` md_jobline_presets cdk_dealerid attach_pdf_to_email + tt_allow_post_to_invoiced employees { id first_name diff --git a/client/src/graphql/jobs.queries.js b/client/src/graphql/jobs.queries.js index 8bbcc6e1a..aad807da1 100644 --- a/client/src/graphql/jobs.queries.js +++ b/client/src/graphql/jobs.queries.js @@ -1025,6 +1025,7 @@ export const SEARCH_JOBS_FOR_AUTOCOMPLETE = gql` $search: String $isConverted: Boolean $notExported: Boolean + $notInvoiced: Boolean ) { search_jobs( args: { search: $search } @@ -1033,6 +1034,7 @@ export const SEARCH_JOBS_FOR_AUTOCOMPLETE = gql` _and: { converted: { _eq: $isConverted } date_exported: { _is_null: $notExported } + date_invoiced: { _is_null: $notInvoiced } } } ) { diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index f5c1fb355..7c629ead4 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -446,6 +446,7 @@ "production_statuses": "Production Statuses" }, "target_touchtime": "Target Touch Time", + "tt_allow_post_to_invoiced": "Allow Time Tickets to be posted to Invoiced & Exported Jobs", "use_fippa": "Use FIPPA for Names on Generated Documents?", "website": "Website", "zip_post": "Zip/Postal Code" diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index dc16fe66b..63e5f30df 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -446,6 +446,7 @@ "production_statuses": "" }, "target_touchtime": "", + "tt_allow_post_to_invoiced": "", "use_fippa": "", "website": "", "zip_post": "" diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index 63d29f9fe..32f7b95d9 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -446,6 +446,7 @@ "production_statuses": "" }, "target_touchtime": "", + "tt_allow_post_to_invoiced": "", "use_fippa": "", "website": "", "zip_post": "" diff --git a/hasura/migrations/1628014681446_alter_table_public_bodyshops_add_column_tt_allow_post_to_invoiced/down.yaml b/hasura/migrations/1628014681446_alter_table_public_bodyshops_add_column_tt_allow_post_to_invoiced/down.yaml new file mode 100644 index 000000000..1ac7830ce --- /dev/null +++ b/hasura/migrations/1628014681446_alter_table_public_bodyshops_add_column_tt_allow_post_to_invoiced/down.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."bodyshops" DROP COLUMN "tt_allow_post_to_invoiced"; + type: run_sql diff --git a/hasura/migrations/1628014681446_alter_table_public_bodyshops_add_column_tt_allow_post_to_invoiced/up.yaml b/hasura/migrations/1628014681446_alter_table_public_bodyshops_add_column_tt_allow_post_to_invoiced/up.yaml new file mode 100644 index 000000000..7cbe393e4 --- /dev/null +++ b/hasura/migrations/1628014681446_alter_table_public_bodyshops_add_column_tt_allow_post_to_invoiced/up.yaml @@ -0,0 +1,6 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."bodyshops" ADD COLUMN "tt_allow_post_to_invoiced" boolean + NOT NULL DEFAULT false; + type: run_sql diff --git a/hasura/migrations/1628014693949_update_permission_user_public_table_bodyshops/down.yaml b/hasura/migrations/1628014693949_update_permission_user_public_table_bodyshops/down.yaml new file mode 100644 index 000000000..c8a09ddd4 --- /dev/null +++ b/hasura/migrations/1628014693949_update_permission_user_public_table_bodyshops/down.yaml @@ -0,0 +1,88 @@ +- args: + role: user + table: + name: bodyshops + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - accountingconfig + - address1 + - address2 + - appt_alt_transport + - appt_colors + - appt_length + - attach_pdf_to_email + - bill_tax_rates + - cdk_dealerid + - city + - country + - created_at + - default_adjustment_rate + - deliverchecklist + - email + - enforce_class + - enforce_referral + - features + - federal_tax_id + - id + - imexshopid + - inhousevendorid + - insurance_vendor_id + - intakechecklist + - jc_hourly_rates + - jobsizelimit + - logo_img_path + - md_categories + - md_ccc_rates + - md_classes + - md_hour_split + - md_ins_cos + - md_jobline_presets + - md_labor_rates + - md_messaging_presets + - md_notes_presets + - md_order_statuses + - md_parts_locations + - md_payment_types + - md_rbac + - md_referral_sources + - md_responsibility_centers + - md_ro_statuses + - messagingservicesid + - phone + - prodtargethrs + - production_config + - region_config + - schedule_end_time + - schedule_start_time + - scoreboard_target + - shopname + - shoprates + - speedprint + - ssbuckets + - state + - state_tax_id + - stripe_acct_id + - sub_status + - target_touchtime + - template_header + - textid + - updated_at + - use_fippa + - website + - workingdays + - zip_post + computed_fields: [] + filter: + associations: + user: + authid: + _eq: X-Hasura-User-Id + role: user + table: + name: bodyshops + schema: public + type: create_select_permission diff --git a/hasura/migrations/1628014693949_update_permission_user_public_table_bodyshops/up.yaml b/hasura/migrations/1628014693949_update_permission_user_public_table_bodyshops/up.yaml new file mode 100644 index 000000000..69267f8fa --- /dev/null +++ b/hasura/migrations/1628014693949_update_permission_user_public_table_bodyshops/up.yaml @@ -0,0 +1,89 @@ +- args: + role: user + table: + name: bodyshops + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - accountingconfig + - address1 + - address2 + - appt_alt_transport + - appt_colors + - appt_length + - attach_pdf_to_email + - bill_tax_rates + - cdk_dealerid + - city + - country + - created_at + - default_adjustment_rate + - deliverchecklist + - email + - enforce_class + - enforce_referral + - features + - federal_tax_id + - id + - imexshopid + - inhousevendorid + - insurance_vendor_id + - intakechecklist + - jc_hourly_rates + - jobsizelimit + - logo_img_path + - md_categories + - md_ccc_rates + - md_classes + - md_hour_split + - md_ins_cos + - md_jobline_presets + - md_labor_rates + - md_messaging_presets + - md_notes_presets + - md_order_statuses + - md_parts_locations + - md_payment_types + - md_rbac + - md_referral_sources + - md_responsibility_centers + - md_ro_statuses + - messagingservicesid + - phone + - prodtargethrs + - production_config + - region_config + - schedule_end_time + - schedule_start_time + - scoreboard_target + - shopname + - shoprates + - speedprint + - ssbuckets + - state + - state_tax_id + - stripe_acct_id + - sub_status + - target_touchtime + - template_header + - textid + - tt_allow_post_to_invoiced + - updated_at + - use_fippa + - website + - workingdays + - zip_post + computed_fields: [] + filter: + associations: + user: + authid: + _eq: X-Hasura-User-Id + role: user + table: + name: bodyshops + schema: public + type: create_select_permission diff --git a/hasura/migrations/1628014707161_update_permission_user_public_table_bodyshops/down.yaml b/hasura/migrations/1628014707161_update_permission_user_public_table_bodyshops/down.yaml new file mode 100644 index 000000000..adce758ee --- /dev/null +++ b/hasura/migrations/1628014707161_update_permission_user_public_table_bodyshops/down.yaml @@ -0,0 +1,80 @@ +- args: + role: user + table: + name: bodyshops + schema: public + type: drop_update_permission +- args: + permission: + columns: + - accountingconfig + - address1 + - address2 + - appt_alt_transport + - appt_colors + - appt_length + - attach_pdf_to_email + - bill_tax_rates + - city + - country + - created_at + - default_adjustment_rate + - deliverchecklist + - email + - enforce_class + - enforce_referral + - federal_tax_id + - id + - inhousevendorid + - insurance_vendor_id + - intakechecklist + - jc_hourly_rates + - logo_img_path + - md_categories + - md_ccc_rates + - md_classes + - md_hour_split + - md_ins_cos + - md_jobline_presets + - md_labor_rates + - md_messaging_presets + - md_notes_presets + - md_order_statuses + - md_parts_locations + - md_payment_types + - md_rbac + - md_referral_sources + - md_responsibility_centers + - md_ro_statuses + - phone + - prodtargethrs + - production_config + - schedule_end_time + - schedule_start_time + - scoreboard_target + - shopname + - shoprates + - speedprint + - ssbuckets + - state + - state_tax_id + - target_touchtime + - updated_at + - use_fippa + - website + - workingdays + - zip_post + filter: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + set: {} + role: user + table: + name: bodyshops + schema: public + type: create_update_permission diff --git a/hasura/migrations/1628014707161_update_permission_user_public_table_bodyshops/up.yaml b/hasura/migrations/1628014707161_update_permission_user_public_table_bodyshops/up.yaml new file mode 100644 index 000000000..410a953e4 --- /dev/null +++ b/hasura/migrations/1628014707161_update_permission_user_public_table_bodyshops/up.yaml @@ -0,0 +1,81 @@ +- args: + role: user + table: + name: bodyshops + schema: public + type: drop_update_permission +- args: + permission: + columns: + - accountingconfig + - address1 + - address2 + - appt_alt_transport + - appt_colors + - appt_length + - attach_pdf_to_email + - bill_tax_rates + - city + - country + - created_at + - default_adjustment_rate + - deliverchecklist + - email + - enforce_class + - enforce_referral + - federal_tax_id + - id + - inhousevendorid + - insurance_vendor_id + - intakechecklist + - jc_hourly_rates + - logo_img_path + - md_categories + - md_ccc_rates + - md_classes + - md_hour_split + - md_ins_cos + - md_jobline_presets + - md_labor_rates + - md_messaging_presets + - md_notes_presets + - md_order_statuses + - md_parts_locations + - md_payment_types + - md_rbac + - md_referral_sources + - md_responsibility_centers + - md_ro_statuses + - phone + - prodtargethrs + - production_config + - schedule_end_time + - schedule_start_time + - scoreboard_target + - shopname + - shoprates + - speedprint + - ssbuckets + - state + - state_tax_id + - target_touchtime + - tt_allow_post_to_invoiced + - updated_at + - use_fippa + - website + - workingdays + - zip_post + filter: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + set: {} + role: user + table: + name: bodyshops + schema: public + type: create_update_permission diff --git a/hasura/migrations/metadata.yaml b/hasura/migrations/metadata.yaml index 70289c99f..3ec04fbf7 100644 --- a/hasura/migrations/metadata.yaml +++ b/hasura/migrations/metadata.yaml @@ -850,6 +850,7 @@ tables: - target_touchtime - template_header - textid + - tt_allow_post_to_invoiced - updated_at - use_fippa - website @@ -916,6 +917,7 @@ tables: - state - state_tax_id - target_touchtime + - tt_allow_post_to_invoiced - updated_at - use_fippa - website