diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 8561cd2a7..0e0557154 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -2485,6 +2485,7 @@ "production_by_target_date": "Production by Target Date", "production_by_technician": "Production by Technician", "production_by_technician_one": "Production filtered by Technician", + "production_over_time": "Production Level over Time", "psr_by_make": "Percent of Sales by Vehicle Make", "purchase_return_ratio_grouped_by_vendor_detail": "Purchase & Return Ratio by Vendor (Detail)", "purchase_return_ratio_grouped_by_vendor_summary": "Purchase & Return Ratio by Vendor (Summary)", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index 27525eff9..87f85887a 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -2485,6 +2485,7 @@ "production_by_target_date": "", "production_by_technician": "", "production_by_technician_one": "", + "production_over_time": "", "psr_by_make": "", "purchase_return_ratio_grouped_by_vendor_detail": "", "purchase_return_ratio_grouped_by_vendor_summary": "", diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index 5fdda7707..51fab4a37 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -2485,6 +2485,7 @@ "production_by_target_date": "", "production_by_technician": "", "production_by_technician_one": "", + "production_over_time": "", "psr_by_make": "", "purchase_return_ratio_grouped_by_vendor_detail": "", "purchase_return_ratio_grouped_by_vendor_summary": "", diff --git a/client/src/utils/TemplateConstants.js b/client/src/utils/TemplateConstants.js index 6c72e8fa4..6f6891bc8 100644 --- a/client/src/utils/TemplateConstants.js +++ b/client/src/utils/TemplateConstants.js @@ -1841,6 +1841,20 @@ export const TemplateList = (type, context) => { }, group: "purchases", }, + production_over_time: { + title: i18n.t("reportcenter.templates.production_over_time"), + subject: i18n.t( + "reportcenter.templates.production_over_time" + ), + key: "production_over_time", + //idtype: "vendor", + disabled: false, + rangeFilter: { + object: i18n.t("reportcenter.labels.objects.jobs"), + field: i18n.t("jobs.fields.actual_in"), + }, + group: "jobs", + }, } : {}), ...(!type || type === "courtesycarcontract" diff --git a/hasura/metadata/tables.yaml b/hasura/metadata/tables.yaml index 6810d55d3..08e234281 100644 --- a/hasura/metadata/tables.yaml +++ b/hasura/metadata/tables.yaml @@ -4502,6 +4502,62 @@ _eq: X-Hasura-User-Id - active: _eq: true +- table: + name: payment_response + schema: public + object_relationships: + - name: bodyshop + using: + foreign_key_constraint_on: bodyshopid + - name: job + using: + foreign_key_constraint_on: jobid + - name: payment + using: + foreign_key_constraint_on: paymentid + insert_permissions: + - role: user + permission: + check: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - amount + - bodyshopid + - declinereason + - ext_paymentid + - jobid + - paymentid + - response + - successful + select_permissions: + - role: user + permission: + columns: + - successful + - response + - amount + - declinereason + - ext_paymentid + - bodyshopid + - id + - jobid + - paymentid + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true - table: name: payments schema: public diff --git a/hasura/migrations/1677082378941_create_table_public_payment_response/down.sql b/hasura/migrations/1677082378941_create_table_public_payment_response/down.sql new file mode 100644 index 000000000..be122bd24 --- /dev/null +++ b/hasura/migrations/1677082378941_create_table_public_payment_response/down.sql @@ -0,0 +1 @@ +DROP TABLE "public"."payment_response"; diff --git a/hasura/migrations/1677082378941_create_table_public_payment_response/up.sql b/hasura/migrations/1677082378941_create_table_public_payment_response/up.sql new file mode 100644 index 000000000..4cacf9df9 --- /dev/null +++ b/hasura/migrations/1677082378941_create_table_public_payment_response/up.sql @@ -0,0 +1,2 @@ +CREATE TABLE "public"."payment_response" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "bodyshopid" uuid NOT NULL, "jobid" uuid, "paymentid" uuid, "successful" boolean NOT NULL DEFAULT false, "ext_paymentid" text NOT NULL, "amount" numeric NOT NULL, "declinereason" text, "response" jsonb NOT NULL DEFAULT jsonb_build_object(), PRIMARY KEY ("id") , FOREIGN KEY ("bodyshopid") REFERENCES "public"."bodyshops"("id") ON UPDATE cascade ON DELETE cascade, FOREIGN KEY ("jobid") REFERENCES "public"."jobs"("id") ON UPDATE cascade ON DELETE cascade, FOREIGN KEY ("paymentid") REFERENCES "public"."payments"("id") ON UPDATE cascade ON DELETE cascade); +CREATE EXTENSION IF NOT EXISTS pgcrypto;