From 1482786b2c6a127f55904eb847787efd699eabd3 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Mon, 3 May 2021 11:53:23 -0700 Subject: [PATCH] IO-975 IO-978 IO-922 Multiple bug fixes. --- bodyshop_translations.babel | 42 +++ .../jobs-detail-header.component.jsx | 26 +- .../jobs-detail-rates.component.jsx | 11 +- client/src/graphql/jobs.queries.js | 2 + client/src/translations/en_us/common.json | 40 +-- client/src/translations/es/common.json | 4 +- client/src/translations/fr/common.json | 4 +- .../down.yaml | 5 + .../up.yaml | 6 + .../down.yaml | 266 +++++++++++++++++ .../up.yaml | 267 +++++++++++++++++ .../down.yaml | 267 +++++++++++++++++ .../up.yaml | 268 ++++++++++++++++++ .../down.yaml | 266 +++++++++++++++++ .../up.yaml | 267 +++++++++++++++++ hasura/migrations/metadata.yaml | 3 + server/graphql-client/queries.js | 4 + server/job/job-totals.js | 6 +- 18 files changed, 1722 insertions(+), 32 deletions(-) create mode 100644 hasura/migrations/1620066724099_alter_table_public_jobs_add_column_ca_customer_gst/down.yaml create mode 100644 hasura/migrations/1620066724099_alter_table_public_jobs_add_column_ca_customer_gst/up.yaml create mode 100644 hasura/migrations/1620066736411_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1620066736411_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1620066749181_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1620066749181_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1620066758022_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1620066758022_update_permission_user_public_table_jobs/up.yaml diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index c2ecd9f56..379a97df2 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -16543,6 +16543,27 @@ + + ca_customer_gst + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + ca_gst_registrant false @@ -20248,6 +20269,27 @@ + + ca_gst_all_if_null + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + cards diff --git a/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx b/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx index c4ce7a0ca..85a7d5083 100644 --- a/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx +++ b/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx @@ -86,14 +86,24 @@ export function JobsDetailHeader({ job, bodyshop, disabled }) { )} - {job.special_coverage_policy && ( - - - - {t("jobs.labels.specialcoveragepolicy")} - - - )} + + {job.special_coverage_policy && ( + + + + {t("jobs.labels.specialcoveragepolicy")} + + + )} + {job.ca_gst_registrant && ( + + + + {t("jobs.fields.ca_gst_registrant")} + + + )} + diff --git a/client/src/components/jobs-detail-rates/jobs-detail-rates.component.jsx b/client/src/components/jobs-detail-rates/jobs-detail-rates.component.jsx index e04dbf645..e077a2aa5 100644 --- a/client/src/components/jobs-detail-rates/jobs-detail-rates.component.jsx +++ b/client/src/components/jobs-detail-rates/jobs-detail-rates.component.jsx @@ -1,4 +1,4 @@ -import { Form, Input, InputNumber, Select, Space, Switch } from "antd"; +import { Form, Input, InputNumber, Select, Space, Switch, Tooltip } from "antd"; import React from "react"; import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; @@ -28,6 +28,14 @@ export function JobsDetailRates({ jobRO, form }) { > + + + + + - diff --git a/client/src/graphql/jobs.queries.js b/client/src/graphql/jobs.queries.js index 79aea1eb2..bfa28ae1c 100644 --- a/client/src/graphql/jobs.queries.js +++ b/client/src/graphql/jobs.queries.js @@ -280,6 +280,7 @@ export const QUERY_JOB_COSTING_DETAILS = gql` actual_in status ca_bc_pvrt + ca_customer_gst joblines(where: { removed: { _eq: false } }) { id unq_seq @@ -499,6 +500,7 @@ export const GET_JOB_BY_PK = gql` deliverchecklist voided ca_bc_pvrt + ca_customer_gst joblines(where: { removed: { _eq: false } }, order_by: { line_no: asc }) { id line_no diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 002b0d189..5d4d3183c 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -130,7 +130,7 @@ "is_credit_memo": "Credit Memo?", "local_tax_rate": "Local Tax Rate", "ro_number": "RO Number", - "state_tax_rate": "State Tax Rate", + "state_tax_rate": "Provincial/State Tax Rate", "total": "Bill Total", "vendor": "Vendor", "vendorname": "Vendor Name" @@ -156,7 +156,7 @@ "new": "New Bill", "noneselected": "No bill selected.", "retailtotal": "Bills Retail Total", - "state_tax": "State Tax", + "state_tax": "Provincial/State Tax", "subtotal": "Subtotal", "totalreturns": "Total Returns" }, @@ -195,8 +195,8 @@ }, "appt_length": "Default Appointment Length", "bill_federal_tax_rate": "Bills - Federal Tax Rate %", - "bill_local_tax_rate": "Bill - State Tax Rate %", - "bill_state_tax_rate": "Bill - State Tax Rate %", + "bill_local_tax_rate": "Bill - Provincial/State Tax Rate %", + "bill_state_tax_rate": "Bill - Provincial/State Tax Rate %", "city": "City", "country": "Country", "dailybodytarget": "Scoreboard - Daily Body Target", @@ -216,7 +216,7 @@ }, "invoice_federal_tax_rate": "Invoices - Federal Tax Rate", "invoice_local_tax_rate": "Invoices - Local Tax Rate", - "invoice_state_tax_rate": "Invoices - State Tax Rate", + "invoice_state_tax_rate": "Invoices - Provincial/State Tax Rate", "lastnumberworkingdays": "Scoreboard - Last Number of Working Days", "logo_img_path": "Shop Logo", "logo_img_path_height": "Logo Image Height", @@ -231,7 +231,7 @@ "md_ins_co": { "city": "City", "name": "Insurance Company Name", - "state": "State/Province", + "state": "Province/State", "street1": "Street 1", "street2": "Street 2", "zip": "Zip/Postal Code" @@ -369,9 +369,9 @@ "description": "Description", "federal": "Federal Tax Applies", "local": "Local Tax Applies", - "state": "State Tax Applies" + "state": "Provincial/State Tax Applies" }, - "state_tax": "State Tax", + "state_tax": "Provincial/State Tax", "tow": "Towing" }, "schedule_end_time": "Schedule Ending Time", @@ -389,8 +389,8 @@ "lt": "Less than (hrs)", "target": "Target (count)" }, - "state": "State/Province", - "state_tax_id": "State Tax ID (PST, QST)", + "state": "Province/State", + "state_tax_id": "Provincial/State Tax ID (PST, QST)", "status": "Status Label", "statuses": { "active_statuses": "Active Statuses (Filtering for Active Jobs throughout system)", @@ -519,12 +519,12 @@ "driver_city": "Driver City", "driver_dlexpiry": "Driver's License Expiration Date", "driver_dlnumber": "Driver's License Number", - "driver_dlst": "Driver's License State", + "driver_dlst": "Driver's License Province/State", "driver_dob": "Driver's DOB", "driver_fn": "Driver's First Name", "driver_ln": "Driver's Last Name", "driver_ph1": "Driver's Phone", - "driver_state": "Driver's State ", + "driver_state": "Driver's Province/State ", "driver_zip": "Driver's Postal/ZIP Code", "excesskmrate": "Excess Mileage", "federaltax": "Federal Taxes", @@ -536,7 +536,7 @@ "refuelcharge": "Refuel Charge (per liter/gallon)", "scheduledreturn": "Scheduled Return", "start": "Contract Start", - "statetax": "State Taxes", + "statetax": "Provincial/State Taxes", "status": "Status" }, "labels": { @@ -1030,6 +1030,7 @@ "adjustmenthours": "Adjustment Hours", "alt_transport": "Alt. Trans.", "ca_bc_pvrt": "PVRT", + "ca_customer_gst": "Customer Portion of GST", "ca_gst_registrant": "GST Registrant", "category": "Category", "ccc": "CC Cleaning", @@ -1174,7 +1175,7 @@ "servicing_dealer": "Servicing Dealer", "servicing_dealer_contact": "Servicing Dealer Contact", "specialcoveragepolicy": "Special Coverage Policy", - "state_tax_rate": "State Tax Rate", + "state_tax_rate": "Provincial/State Tax Rate", "status": "Job Status", "storage_payable": "Storage", "tax_lbr_rt": "Labor Tax Rate", @@ -1217,6 +1218,7 @@ "days": "Days", "rate": "PVRT Rate" }, + "ca_gst_all_if_null": "If the job is marked as a \"GST Registrant\" and this value is set to $0, the customer will be responsible for paying all of the GST by default. ", "cards": { "customer": "Customer Information", "damage": "Area of Damage", @@ -1326,7 +1328,7 @@ "sales": "Sales", "scheduledinchange": "The scheduled in is based off the latest appointment. To change this date, please schedule or reschedule the job. ", "specialcoveragepolicy": "Special Coverage Policy Applies", - "state_tax_amt": "State/Provincial Taxes", + "state_tax_amt": "Provincial/State Taxes", "subletstotal": "Sublets Total", "subtotal": "Subtotal", "supplementnote": "The job had a supplement imported on {{date}} at {{time}}.", @@ -1518,7 +1520,7 @@ "ownr_fn": "First Name", "ownr_ln": "Last Name", "ownr_ph1": "Phone 1", - "ownr_st": "State/Province", + "ownr_st": "Province/State", "ownr_title": "Title", "ownr_zip": "Zip/Postal Code", "preferred_contact": "Preferred Contact Method" @@ -1647,7 +1649,7 @@ "lastname": "Last Name", "phone1": "Phone 1", "phone2": "Phone 2", - "state": "state" + "state": "Province/State" }, "labels": { "vendorcategory": "Vendor" @@ -1791,7 +1793,7 @@ }, "profile": { "errors": { - "state": "Error reading page state. Please refresh." + "state": "Error reading page state. Please refresh." }, "labels": { "activeshop": "Active Shop" @@ -2131,7 +2133,7 @@ "oem": "OEM", "phone": "Phone", "prompt_discount": "Prompt Discount %", - "state": "State/Province", + "state": "Province/State", "street1": "Street", "street2": "Address 2", "taxid": "Tax ID", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index 1a224a0ea..dc5559f2a 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -1030,6 +1030,7 @@ "adjustmenthours": "", "alt_transport": "", "ca_bc_pvrt": "", + "ca_customer_gst": "", "ca_gst_registrant": "", "category": "", "ccc": "", @@ -1217,6 +1218,7 @@ "days": "", "rate": "" }, + "ca_gst_all_if_null": "", "cards": { "customer": "Información al cliente", "damage": "Área de Daño", @@ -1791,7 +1793,7 @@ }, "profile": { "errors": { - "state": "Error al leer el estado de la página. Porfavor refresca." + "state": "Error al leer el estado de la página. Porfavor refresca." }, "labels": { "activeshop": "" diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index b234d8486..0e5c64aed 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -1030,6 +1030,7 @@ "adjustmenthours": "", "alt_transport": "", "ca_bc_pvrt": "", + "ca_customer_gst": "", "ca_gst_registrant": "", "category": "", "ccc": "", @@ -1217,6 +1218,7 @@ "days": "", "rate": "" }, + "ca_gst_all_if_null": "", "cards": { "customer": "Informations client", "damage": "Zone de dommages", @@ -1791,7 +1793,7 @@ }, "profile": { "errors": { - "state": "Erreur lors de la lecture de l'état de la page. Rafraichissez, s'il vous plait." + "state": "Erreur lors de la lecture de l'état de la page. Rafraichissez, s'il vous plait." }, "labels": { "activeshop": "" diff --git a/hasura/migrations/1620066724099_alter_table_public_jobs_add_column_ca_customer_gst/down.yaml b/hasura/migrations/1620066724099_alter_table_public_jobs_add_column_ca_customer_gst/down.yaml new file mode 100644 index 000000000..b9730b3cb --- /dev/null +++ b/hasura/migrations/1620066724099_alter_table_public_jobs_add_column_ca_customer_gst/down.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."jobs" DROP COLUMN "ca_customer_gst"; + type: run_sql diff --git a/hasura/migrations/1620066724099_alter_table_public_jobs_add_column_ca_customer_gst/up.yaml b/hasura/migrations/1620066724099_alter_table_public_jobs_add_column_ca_customer_gst/up.yaml new file mode 100644 index 000000000..543a74068 --- /dev/null +++ b/hasura/migrations/1620066724099_alter_table_public_jobs_add_column_ca_customer_gst/up.yaml @@ -0,0 +1,6 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."jobs" ADD COLUMN "ca_customer_gst" numeric NULL DEFAULT + 0; + type: run_sql diff --git a/hasura/migrations/1620066736411_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1620066736411_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..5b060e4ad --- /dev/null +++ b/hasura/migrations/1620066736411_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,266 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_insert_permission +- args: + permission: + check: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - actual_completion + - actual_delivery + - actual_in + - adj_g_disc + - adj_strdis + - adj_towdis + - adjustment_bottom_line + - agt_addr1 + - agt_addr2 + - agt_city + - agt_co_id + - agt_co_nm + - agt_ct_fn + - agt_ct_ln + - agt_ct_ph + - agt_ct_phx + - agt_ctry + - agt_ea + - agt_fax + - agt_faxx + - agt_lic_no + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_st + - agt_zip + - alt_transport + - area_of_damage + - asgn_date + - asgn_no + - asgn_type + - ca_bc_pvrt + - ca_gst_registrant + - cat_no + - category + - cieca_stl + - cieca_ttl + - ciecaid + - class + - clm_addr1 + - clm_addr2 + - clm_city + - clm_ct_fn + - clm_ct_ln + - clm_ct_ph + - clm_ct_phx + - clm_ctry + - clm_ea + - clm_fax + - clm_faxx + - clm_no + - clm_ofc_id + - clm_ofc_nm + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_st + - clm_title + - clm_total + - clm_zip + - converted + - created_at + - csr + - cust_pr + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - ded_amt + - ded_status + - deliverchecklist + - depreciation_taxes + - driveable + - employee_body + - employee_prep + - employee_refinish + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_ph1 + - est_st + - est_zip + - federal_tax_rate + - g_bett_amt + - id + - inproduction + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - insd_addr1 + - insd_addr2 + - insd_city + - insd_co_nm + - insd_ctry + - insd_ea + - insd_fax + - insd_faxx + - insd_fn + - insd_ln + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_st + - insd_title + - insd_zip + - intakechecklist + - invoice_allocation + - invoice_date + - job_totals + - kanbanparent + - kmin + - kmout + - labor_rate_desc + - labor_rate_id + - lbr_adjustments + - local_tax_rate + - loss_cat + - loss_date + - loss_desc + - loss_type + - other_amount_payable + - owner_owing + - ownerid + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fax + - ownr_faxx + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_st + - ownr_title + - ownr_zip + - parts_tax_rates + - pay_amt + - pay_chknm + - pay_date + - pay_type + - payee_nms + - plate_no + - plate_st + - po_number + - policy_no + - production_vars + - queued_for_parts + - rate_la1 + - rate_la2 + - rate_la3 + - rate_la4 + - rate_laa + - rate_lab + - rate_lad + - rate_lae + - rate_laf + - rate_lag + - rate_lam + - rate_lar + - rate_las + - rate_lau + - rate_ma2s + - rate_ma2t + - rate_ma3s + - rate_mabl + - rate_macs + - rate_mahw + - rate_mapa + - rate_mash + - rate_matd + - referral_source + - regie_number + - ro_number + - scheduled_completion + - scheduled_delivery + - scheduled_in + - selling_dealer + - selling_dealer_contact + - servicing_dealer + - servicing_dealer_contact + - shopid + - special_coverage_policy + - state_tax_rate + - status + - storage_payable + - tax_lbr_rt + - tax_levies_rt + - tax_paint_mat_rt + - tax_predis + - tax_prethr + - tax_pstthr + - tax_registration_number + - tax_shop_mat_rt + - tax_str_rt + - tax_sub_rt + - tax_thramt + - tax_tow_rt + - theft_ind + - tlos_ind + - towin + - towing_payable + - unit_number + - updated_at + - v_color + - v_make_desc + - v_model_desc + - v_model_yr + - v_vin + - vehicleid + - voided + set: {} + role: user + table: + name: jobs + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1620066736411_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1620066736411_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..1710da406 --- /dev/null +++ b/hasura/migrations/1620066736411_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,267 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_insert_permission +- args: + permission: + check: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - actual_completion + - actual_delivery + - actual_in + - adj_g_disc + - adj_strdis + - adj_towdis + - adjustment_bottom_line + - agt_addr1 + - agt_addr2 + - agt_city + - agt_co_id + - agt_co_nm + - agt_ct_fn + - agt_ct_ln + - agt_ct_ph + - agt_ct_phx + - agt_ctry + - agt_ea + - agt_fax + - agt_faxx + - agt_lic_no + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_st + - agt_zip + - alt_transport + - area_of_damage + - asgn_date + - asgn_no + - asgn_type + - ca_bc_pvrt + - ca_customer_gst + - ca_gst_registrant + - cat_no + - category + - cieca_stl + - cieca_ttl + - ciecaid + - class + - clm_addr1 + - clm_addr2 + - clm_city + - clm_ct_fn + - clm_ct_ln + - clm_ct_ph + - clm_ct_phx + - clm_ctry + - clm_ea + - clm_fax + - clm_faxx + - clm_no + - clm_ofc_id + - clm_ofc_nm + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_st + - clm_title + - clm_total + - clm_zip + - converted + - created_at + - csr + - cust_pr + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - ded_amt + - ded_status + - deliverchecklist + - depreciation_taxes + - driveable + - employee_body + - employee_prep + - employee_refinish + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_ph1 + - est_st + - est_zip + - federal_tax_rate + - g_bett_amt + - id + - inproduction + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - insd_addr1 + - insd_addr2 + - insd_city + - insd_co_nm + - insd_ctry + - insd_ea + - insd_fax + - insd_faxx + - insd_fn + - insd_ln + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_st + - insd_title + - insd_zip + - intakechecklist + - invoice_allocation + - invoice_date + - job_totals + - kanbanparent + - kmin + - kmout + - labor_rate_desc + - labor_rate_id + - lbr_adjustments + - local_tax_rate + - loss_cat + - loss_date + - loss_desc + - loss_type + - other_amount_payable + - owner_owing + - ownerid + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fax + - ownr_faxx + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_st + - ownr_title + - ownr_zip + - parts_tax_rates + - pay_amt + - pay_chknm + - pay_date + - pay_type + - payee_nms + - plate_no + - plate_st + - po_number + - policy_no + - production_vars + - queued_for_parts + - rate_la1 + - rate_la2 + - rate_la3 + - rate_la4 + - rate_laa + - rate_lab + - rate_lad + - rate_lae + - rate_laf + - rate_lag + - rate_lam + - rate_lar + - rate_las + - rate_lau + - rate_ma2s + - rate_ma2t + - rate_ma3s + - rate_mabl + - rate_macs + - rate_mahw + - rate_mapa + - rate_mash + - rate_matd + - referral_source + - regie_number + - ro_number + - scheduled_completion + - scheduled_delivery + - scheduled_in + - selling_dealer + - selling_dealer_contact + - servicing_dealer + - servicing_dealer_contact + - shopid + - special_coverage_policy + - state_tax_rate + - status + - storage_payable + - tax_lbr_rt + - tax_levies_rt + - tax_paint_mat_rt + - tax_predis + - tax_prethr + - tax_pstthr + - tax_registration_number + - tax_shop_mat_rt + - tax_str_rt + - tax_sub_rt + - tax_thramt + - tax_tow_rt + - theft_ind + - tlos_ind + - towin + - towing_payable + - unit_number + - updated_at + - v_color + - v_make_desc + - v_model_desc + - v_model_yr + - v_vin + - vehicleid + - voided + set: {} + role: user + table: + name: jobs + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1620066749181_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1620066749181_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..787406311 --- /dev/null +++ b/hasura/migrations/1620066749181_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,267 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: true + columns: + - actual_completion + - actual_delivery + - actual_in + - adj_g_disc + - adj_strdis + - adj_towdis + - adjustment_bottom_line + - agt_addr1 + - agt_addr2 + - agt_city + - agt_co_id + - agt_co_nm + - agt_ct_fn + - agt_ct_ln + - agt_ct_ph + - agt_ct_phx + - agt_ctry + - agt_ea + - agt_fax + - agt_faxx + - agt_lic_no + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_st + - agt_zip + - alt_transport + - area_of_damage + - asgn_date + - asgn_no + - asgn_type + - ca_bc_pvrt + - ca_gst_registrant + - cat_no + - category + - cieca_stl + - cieca_ttl + - ciecaid + - class + - clm_addr1 + - clm_addr2 + - clm_city + - clm_ct_fn + - clm_ct_ln + - clm_ct_ph + - clm_ct_phx + - clm_ctry + - clm_ea + - clm_fax + - clm_faxx + - clm_no + - clm_ofc_id + - clm_ofc_nm + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_st + - clm_title + - clm_total + - clm_zip + - converted + - created_at + - csr + - cust_pr + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - ded_amt + - ded_status + - deliverchecklist + - depreciation_taxes + - driveable + - employee_body + - employee_prep + - employee_refinish + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_ph1 + - est_st + - est_zip + - federal_tax_rate + - g_bett_amt + - id + - inproduction + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - insd_addr1 + - insd_addr2 + - insd_city + - insd_co_nm + - insd_ctry + - insd_ea + - insd_fax + - insd_faxx + - insd_fn + - insd_ln + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_st + - insd_title + - insd_zip + - intakechecklist + - invoice_allocation + - invoice_date + - job_totals + - kanbanparent + - kmin + - kmout + - labor_rate_desc + - labor_rate_id + - lbr_adjustments + - local_tax_rate + - loss_cat + - loss_date + - loss_desc + - loss_type + - other_amount_payable + - owner_owing + - ownerid + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fax + - ownr_faxx + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_st + - ownr_title + - ownr_zip + - parts_tax_rates + - pay_amt + - pay_chknm + - pay_date + - pay_type + - payee_nms + - plate_no + - plate_st + - po_number + - policy_no + - production_vars + - queued_for_parts + - rate_la1 + - rate_la2 + - rate_la3 + - rate_la4 + - rate_laa + - rate_lab + - rate_lad + - rate_lae + - rate_laf + - rate_lag + - rate_lam + - rate_lar + - rate_las + - rate_lau + - rate_ma2s + - rate_ma2t + - rate_ma3s + - rate_mabl + - rate_macs + - rate_mahw + - rate_mapa + - rate_mash + - rate_matd + - referral_source + - regie_number + - ro_number + - scheduled_completion + - scheduled_delivery + - scheduled_in + - selling_dealer + - selling_dealer_contact + - servicing_dealer + - servicing_dealer_contact + - shopid + - special_coverage_policy + - state_tax_rate + - status + - storage_payable + - tax_lbr_rt + - tax_levies_rt + - tax_paint_mat_rt + - tax_predis + - tax_prethr + - tax_pstthr + - tax_registration_number + - tax_shop_mat_rt + - tax_str_rt + - tax_sub_rt + - tax_thramt + - tax_tow_rt + - theft_ind + - tlos_ind + - towin + - towing_payable + - unit_number + - updated_at + - v_color + - v_make_desc + - v_model_desc + - v_model_yr + - v_vin + - vehicleid + - voided + computed_fields: [] + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + role: user + table: + name: jobs + schema: public + type: create_select_permission diff --git a/hasura/migrations/1620066749181_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1620066749181_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..211f64230 --- /dev/null +++ b/hasura/migrations/1620066749181_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,268 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: true + columns: + - actual_completion + - actual_delivery + - actual_in + - adj_g_disc + - adj_strdis + - adj_towdis + - adjustment_bottom_line + - agt_addr1 + - agt_addr2 + - agt_city + - agt_co_id + - agt_co_nm + - agt_ct_fn + - agt_ct_ln + - agt_ct_ph + - agt_ct_phx + - agt_ctry + - agt_ea + - agt_fax + - agt_faxx + - agt_lic_no + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_st + - agt_zip + - alt_transport + - area_of_damage + - asgn_date + - asgn_no + - asgn_type + - ca_bc_pvrt + - ca_customer_gst + - ca_gst_registrant + - cat_no + - category + - cieca_stl + - cieca_ttl + - ciecaid + - class + - clm_addr1 + - clm_addr2 + - clm_city + - clm_ct_fn + - clm_ct_ln + - clm_ct_ph + - clm_ct_phx + - clm_ctry + - clm_ea + - clm_fax + - clm_faxx + - clm_no + - clm_ofc_id + - clm_ofc_nm + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_st + - clm_title + - clm_total + - clm_zip + - converted + - created_at + - csr + - cust_pr + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - ded_amt + - ded_status + - deliverchecklist + - depreciation_taxes + - driveable + - employee_body + - employee_prep + - employee_refinish + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_ph1 + - est_st + - est_zip + - federal_tax_rate + - g_bett_amt + - id + - inproduction + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - insd_addr1 + - insd_addr2 + - insd_city + - insd_co_nm + - insd_ctry + - insd_ea + - insd_fax + - insd_faxx + - insd_fn + - insd_ln + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_st + - insd_title + - insd_zip + - intakechecklist + - invoice_allocation + - invoice_date + - job_totals + - kanbanparent + - kmin + - kmout + - labor_rate_desc + - labor_rate_id + - lbr_adjustments + - local_tax_rate + - loss_cat + - loss_date + - loss_desc + - loss_type + - other_amount_payable + - owner_owing + - ownerid + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fax + - ownr_faxx + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_st + - ownr_title + - ownr_zip + - parts_tax_rates + - pay_amt + - pay_chknm + - pay_date + - pay_type + - payee_nms + - plate_no + - plate_st + - po_number + - policy_no + - production_vars + - queued_for_parts + - rate_la1 + - rate_la2 + - rate_la3 + - rate_la4 + - rate_laa + - rate_lab + - rate_lad + - rate_lae + - rate_laf + - rate_lag + - rate_lam + - rate_lar + - rate_las + - rate_lau + - rate_ma2s + - rate_ma2t + - rate_ma3s + - rate_mabl + - rate_macs + - rate_mahw + - rate_mapa + - rate_mash + - rate_matd + - referral_source + - regie_number + - ro_number + - scheduled_completion + - scheduled_delivery + - scheduled_in + - selling_dealer + - selling_dealer_contact + - servicing_dealer + - servicing_dealer_contact + - shopid + - special_coverage_policy + - state_tax_rate + - status + - storage_payable + - tax_lbr_rt + - tax_levies_rt + - tax_paint_mat_rt + - tax_predis + - tax_prethr + - tax_pstthr + - tax_registration_number + - tax_shop_mat_rt + - tax_str_rt + - tax_sub_rt + - tax_thramt + - tax_tow_rt + - theft_ind + - tlos_ind + - towin + - towing_payable + - unit_number + - updated_at + - v_color + - v_make_desc + - v_model_desc + - v_model_yr + - v_vin + - vehicleid + - voided + computed_fields: [] + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + role: user + table: + name: jobs + schema: public + type: create_select_permission diff --git a/hasura/migrations/1620066758022_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1620066758022_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..967533024 --- /dev/null +++ b/hasura/migrations/1620066758022_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,266 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_update_permission +- args: + permission: + columns: + - actual_completion + - actual_delivery + - actual_in + - adj_g_disc + - adj_strdis + - adj_towdis + - adjustment_bottom_line + - agt_addr1 + - agt_addr2 + - agt_city + - agt_co_id + - agt_co_nm + - agt_ct_fn + - agt_ct_ln + - agt_ct_ph + - agt_ct_phx + - agt_ctry + - agt_ea + - agt_fax + - agt_faxx + - agt_lic_no + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_st + - agt_zip + - alt_transport + - area_of_damage + - asgn_date + - asgn_no + - asgn_type + - ca_bc_pvrt + - ca_gst_registrant + - cat_no + - category + - cieca_stl + - cieca_ttl + - ciecaid + - class + - clm_addr1 + - clm_addr2 + - clm_city + - clm_ct_fn + - clm_ct_ln + - clm_ct_ph + - clm_ct_phx + - clm_ctry + - clm_ea + - clm_fax + - clm_faxx + - clm_no + - clm_ofc_id + - clm_ofc_nm + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_st + - clm_title + - clm_total + - clm_zip + - converted + - created_at + - csr + - cust_pr + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - ded_amt + - ded_status + - deliverchecklist + - depreciation_taxes + - driveable + - employee_body + - employee_prep + - employee_refinish + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_ph1 + - est_st + - est_zip + - federal_tax_rate + - g_bett_amt + - id + - inproduction + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - insd_addr1 + - insd_addr2 + - insd_city + - insd_co_nm + - insd_ctry + - insd_ea + - insd_fax + - insd_faxx + - insd_fn + - insd_ln + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_st + - insd_title + - insd_zip + - intakechecklist + - invoice_allocation + - invoice_date + - job_totals + - kanbanparent + - kmin + - kmout + - labor_rate_desc + - labor_rate_id + - lbr_adjustments + - local_tax_rate + - loss_cat + - loss_date + - loss_desc + - loss_type + - other_amount_payable + - owner_owing + - ownerid + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fax + - ownr_faxx + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_st + - ownr_title + - ownr_zip + - parts_tax_rates + - pay_amt + - pay_chknm + - pay_date + - pay_type + - payee_nms + - plate_no + - plate_st + - po_number + - policy_no + - production_vars + - queued_for_parts + - rate_la1 + - rate_la2 + - rate_la3 + - rate_la4 + - rate_laa + - rate_lab + - rate_lad + - rate_lae + - rate_laf + - rate_lag + - rate_lam + - rate_lar + - rate_las + - rate_lau + - rate_ma2s + - rate_ma2t + - rate_ma3s + - rate_mabl + - rate_macs + - rate_mahw + - rate_mapa + - rate_mash + - rate_matd + - referral_source + - regie_number + - ro_number + - scheduled_completion + - scheduled_delivery + - scheduled_in + - selling_dealer + - selling_dealer_contact + - servicing_dealer + - servicing_dealer_contact + - shopid + - special_coverage_policy + - state_tax_rate + - status + - storage_payable + - tax_lbr_rt + - tax_levies_rt + - tax_paint_mat_rt + - tax_predis + - tax_prethr + - tax_pstthr + - tax_registration_number + - tax_shop_mat_rt + - tax_str_rt + - tax_sub_rt + - tax_thramt + - tax_tow_rt + - theft_ind + - tlos_ind + - towin + - towing_payable + - unit_number + - updated_at + - v_color + - v_make_desc + - v_model_desc + - v_model_yr + - v_vin + - vehicleid + - voided + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + set: {} + role: user + table: + name: jobs + schema: public + type: create_update_permission diff --git a/hasura/migrations/1620066758022_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1620066758022_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..feed2e0f9 --- /dev/null +++ b/hasura/migrations/1620066758022_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,267 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_update_permission +- args: + permission: + columns: + - actual_completion + - actual_delivery + - actual_in + - adj_g_disc + - adj_strdis + - adj_towdis + - adjustment_bottom_line + - agt_addr1 + - agt_addr2 + - agt_city + - agt_co_id + - agt_co_nm + - agt_ct_fn + - agt_ct_ln + - agt_ct_ph + - agt_ct_phx + - agt_ctry + - agt_ea + - agt_fax + - agt_faxx + - agt_lic_no + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_st + - agt_zip + - alt_transport + - area_of_damage + - asgn_date + - asgn_no + - asgn_type + - ca_bc_pvrt + - ca_customer_gst + - ca_gst_registrant + - cat_no + - category + - cieca_stl + - cieca_ttl + - ciecaid + - class + - clm_addr1 + - clm_addr2 + - clm_city + - clm_ct_fn + - clm_ct_ln + - clm_ct_ph + - clm_ct_phx + - clm_ctry + - clm_ea + - clm_fax + - clm_faxx + - clm_no + - clm_ofc_id + - clm_ofc_nm + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_st + - clm_title + - clm_total + - clm_zip + - converted + - created_at + - csr + - cust_pr + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - ded_amt + - ded_status + - deliverchecklist + - depreciation_taxes + - driveable + - employee_body + - employee_prep + - employee_refinish + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_ph1 + - est_st + - est_zip + - federal_tax_rate + - g_bett_amt + - id + - inproduction + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - insd_addr1 + - insd_addr2 + - insd_city + - insd_co_nm + - insd_ctry + - insd_ea + - insd_fax + - insd_faxx + - insd_fn + - insd_ln + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_st + - insd_title + - insd_zip + - intakechecklist + - invoice_allocation + - invoice_date + - job_totals + - kanbanparent + - kmin + - kmout + - labor_rate_desc + - labor_rate_id + - lbr_adjustments + - local_tax_rate + - loss_cat + - loss_date + - loss_desc + - loss_type + - other_amount_payable + - owner_owing + - ownerid + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fax + - ownr_faxx + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_st + - ownr_title + - ownr_zip + - parts_tax_rates + - pay_amt + - pay_chknm + - pay_date + - pay_type + - payee_nms + - plate_no + - plate_st + - po_number + - policy_no + - production_vars + - queued_for_parts + - rate_la1 + - rate_la2 + - rate_la3 + - rate_la4 + - rate_laa + - rate_lab + - rate_lad + - rate_lae + - rate_laf + - rate_lag + - rate_lam + - rate_lar + - rate_las + - rate_lau + - rate_ma2s + - rate_ma2t + - rate_ma3s + - rate_mabl + - rate_macs + - rate_mahw + - rate_mapa + - rate_mash + - rate_matd + - referral_source + - regie_number + - ro_number + - scheduled_completion + - scheduled_delivery + - scheduled_in + - selling_dealer + - selling_dealer_contact + - servicing_dealer + - servicing_dealer_contact + - shopid + - special_coverage_policy + - state_tax_rate + - status + - storage_payable + - tax_lbr_rt + - tax_levies_rt + - tax_paint_mat_rt + - tax_predis + - tax_prethr + - tax_pstthr + - tax_registration_number + - tax_shop_mat_rt + - tax_str_rt + - tax_sub_rt + - tax_thramt + - tax_tow_rt + - theft_ind + - tlos_ind + - towin + - towing_payable + - unit_number + - updated_at + - v_color + - v_make_desc + - v_model_desc + - v_model_yr + - v_vin + - vehicleid + - voided + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + set: {} + role: user + table: + name: jobs + schema: public + type: create_update_permission diff --git a/hasura/migrations/metadata.yaml b/hasura/migrations/metadata.yaml index b2e186913..fbb20cb85 100644 --- a/hasura/migrations/metadata.yaml +++ b/hasura/migrations/metadata.yaml @@ -2367,6 +2367,7 @@ tables: - asgn_no - asgn_type - ca_bc_pvrt + - ca_customer_gst - ca_gst_registrant - cat_no - category @@ -2613,6 +2614,7 @@ tables: - asgn_no - asgn_type - ca_bc_pvrt + - ca_customer_gst - ca_gst_registrant - cat_no - category @@ -2869,6 +2871,7 @@ tables: - asgn_no - asgn_type - ca_bc_pvrt + - ca_customer_gst - ca_gst_registrant - cat_no - category diff --git a/server/graphql-client/queries.js b/server/graphql-client/queries.js index dfea14c62..722bd476b 100644 --- a/server/graphql-client/queries.js +++ b/server/graphql-client/queries.js @@ -85,6 +85,7 @@ query QUERY_JOBS_FOR_RECEIVABLES_EXPORT($ids: [uuid!]!) { rate_matd class ca_bc_pvrt + ca_customer_gst owner { accountingid } @@ -540,6 +541,7 @@ exports.GET_JOB_BY_PK = ` query GET_JOB_BY_PK($id: uuid!) { deliverchecklist voided ca_bc_pvrt + ca_customer_gst joblines(where: { removed: { _eq: false } }){ id line_no @@ -630,6 +632,7 @@ exports.QUERY_JOB_COSTING_DETAILS = ` query QUERY_JOB_COSTING_DETAILS($id: uuid! actual_in status ca_bc_pvrt + ca_customer_gst joblines(where: { removed: { _eq: false } }) { id unq_seq @@ -729,6 +732,7 @@ exports.QUERY_JOB_COSTING_DETAILS_MULTI = ` query QUERY_JOB_COSTING_DETAILS_MULT actual_in status ca_bc_pvrt + ca_customer_gst joblines(where: {removed: {_eq: false}}) { id unq_seq diff --git a/server/job/job-totals.js b/server/job/job-totals.js index 06c5674a3..293245918 100644 --- a/server/job/job-totals.js +++ b/server/job/job-totals.js @@ -401,7 +401,11 @@ function CalculateTaxesTotals(job, otherTotals) { ret.custPayable = { deductible: Dinero({ amount: (job.ded_amt || 0) * 100 }) || 0, - federal_tax: job.ca_gst_registrant ? ret.federal_tax : Dinero(), + federal_tax: job.ca_gst_registrant + ? job.ca_customer_gst !== 0 + ? Dinero({ amount: job.ca_customer_gst * 100 }) + : ret.federal_tax + : Dinero(), other_customer_amount: Dinero({ amount: (job.other_amount_payable || 0) * 100, }),