diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 132fd4ea3..83ba120e0 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -14111,27 +14111,6 @@ - - rate_atp - false - - - - - - en-US - false - - - es-MX - false - - - fr-CA - false - - - rate_la1 false diff --git a/client/src/components/job-calculate-totals/job-calculate-totals.component.jsx b/client/src/components/job-calculate-totals/job-calculate-totals.component.jsx index f742d71dc..3f5870f00 100644 --- a/client/src/components/job-calculate-totals/job-calculate-totals.component.jsx +++ b/client/src/components/job-calculate-totals/job-calculate-totals.component.jsx @@ -22,7 +22,6 @@ export function JobCalculateTotals({ bodyshop, job }) { const newTotals = ( await Axios.post("/job/totals", { job: job, - shoprates: bodyshop.shoprates, }) ).data; diff --git a/client/src/components/job-totals-table/job-totals-table.component.jsx b/client/src/components/job-totals-table/job-totals-table.component.jsx index def44dea3..5a5b3c65f 100644 --- a/client/src/components/job-totals-table/job-totals-table.component.jsx +++ b/client/src/components/job-totals-table/job-totals-table.component.jsx @@ -21,8 +21,6 @@ const colSpan = { export function JobsTotalsTableComponent({ bodyshop, job }) { const { t } = useTranslation(); - console.log("job", job); - if (!!!job.job_totals) { return ( - - {t("jobs.fields.rate_atp")} - - {Dinero(job.job_totals.rates.atp.total).toFormat()} - - {`(${job.job_totals.rates.atp.hours.toFixed(2)} @ ${ - job.job_totals.rates.atp.rate - })`} - {t("jobs.labels.rates_subtotal")} diff --git a/client/src/components/jobs-available-new/jobs-available-new.container.jsx b/client/src/components/jobs-available-new/jobs-available-new.container.jsx index b1e1b7bc7..63d6e2815 100644 --- a/client/src/components/jobs-available-new/jobs-available-new.container.jsx +++ b/client/src/components/jobs-available-new/jobs-available-new.container.jsx @@ -66,7 +66,6 @@ export function JobsAvailableContainer({ ...estData.data.available_jobs_by_pk.est_data, joblines: estData.data.available_jobs_by_pk.est_data.joblines.data, }, - shoprates: bodyshop.shoprates, }) ).data; diff --git a/client/src/components/jobs-available-supplement/jobs-available-supplement.container.jsx b/client/src/components/jobs-available-supplement/jobs-available-supplement.container.jsx index 2b2ce5eeb..2f6337a78 100644 --- a/client/src/components/jobs-available-supplement/jobs-available-supplement.container.jsx +++ b/client/src/components/jobs-available-supplement/jobs-available-supplement.container.jsx @@ -81,7 +81,6 @@ export function JobsAvailableSupplementContainer({ ...estData.data.available_jobs_by_pk.est_data, joblines: estData.data.available_jobs_by_pk.est_data.joblines.data, }, - shoprates: bodyshop.shoprates, }) ).data; diff --git a/client/src/components/jobs-create-jobs-info/jobs-create-jobs-info.component.jsx b/client/src/components/jobs-create-jobs-info/jobs-create-jobs-info.component.jsx index 84e917bf9..bc0b8f68f 100644 --- a/client/src/components/jobs-create-jobs-info/jobs-create-jobs-info.component.jsx +++ b/client/src/components/jobs-create-jobs-info/jobs-create-jobs-info.component.jsx @@ -276,10 +276,6 @@ export function JobsCreateJobsInfo({ bodyshop, form, selected }) { - Note //TODO Remove ATP rate? - - - 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 86da2fe22..dfc41bda4 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 @@ -92,9 +92,6 @@ export default function JobsDetailRates({ job, form }) { - - - diff --git a/client/src/components/jobs-detail-totals/jobs-detail-totals.component.jsx b/client/src/components/jobs-detail-totals/jobs-detail-totals.component.jsx index e36fd3d47..7118f1d73 100644 --- a/client/src/components/jobs-detail-totals/jobs-detail-totals.component.jsx +++ b/client/src/components/jobs-detail-totals/jobs-detail-totals.component.jsx @@ -40,8 +40,10 @@ export function JobsDetailTotals({ }, [job.payments]); const balance = useMemo(() => { - return Dinero(job.job_totals.totals.total_repairs).subtract(total); - }, [job.job_totals.totals.total_repairs, total]); + if (job && job.job_totals && job.job_totals.totals.total_repairs) + return Dinero(job.job_totals.totals.total_repairs).subtract(total); + return Dinero({ amount: 0 }).subtract(total); + }, [job, total]); return (
@@ -109,7 +111,7 @@ export function JobsDetailTotals({ /> 0 ? "red" : "green" }} + valueStyle={{ color: balance.getAmount() !== 0 ? "red" : "green" }} value={balance.toFormat()} /> diff --git a/client/src/components/shop-info/shop-info.responsibilitycenters.component.jsx b/client/src/components/shop-info/shop-info.responsibilitycenters.component.jsx index b45fabae6..bff7b98f7 100644 --- a/client/src/components/shop-info/shop-info.responsibilitycenters.component.jsx +++ b/client/src/components/shop-info/shop-info.responsibilitycenters.component.jsx @@ -272,14 +272,14 @@ export default function ShopInfoResponsibilityCenterComponent({ form }) { Costs {profitOptions.map((item, idx) => ( diff --git a/client/src/graphql/jobs.queries.js b/client/src/graphql/jobs.queries.js index b0a5325aa..074a83313 100644 --- a/client/src/graphql/jobs.queries.js +++ b/client/src/graphql/jobs.queries.js @@ -148,7 +148,6 @@ export const QUERY_JOB_COSTING_DETAILS = gql` parts_tax_rates job_totals labor_rate_desc - rate_atp rate_la1 rate_la2 rate_la3 @@ -306,6 +305,7 @@ export const GET_JOB_BY_PK = gql` tax_tow_rt tax_str_rt tax_paint_mat_rt + tax_shop_mat_rt tax_sub_rt tax_lbr_rt tax_levies_rt @@ -335,7 +335,6 @@ export const GET_JOB_BY_PK = gql` ownr_ph1 } labor_rate_desc - rate_atp rate_la1 rate_la2 rate_la3 @@ -397,6 +396,7 @@ export const GET_JOB_BY_PK = gql` status notes location + tax_part parts_order_lines { id parts_order { @@ -872,7 +872,6 @@ export const QUERY_ALL_JOB_FIELDS = gql` plate_st po_number policy_no - rate_atp rate_la1 rate_la2 rate_la3 @@ -1107,7 +1106,6 @@ export const QUERY_JOB_CLOSE_DETAILS = gql` ownr_zip ownr_ctry ownr_ph1 - rate_atp rate_la1 rate_la2 rate_la3 diff --git a/client/src/pages/jobs-detail/jobs-detail.page.component.jsx b/client/src/pages/jobs-detail/jobs-detail.page.component.jsx index 5302e0ff9..5ed5e63c0 100644 --- a/client/src/pages/jobs-detail/jobs-detail.page.component.jsx +++ b/client/src/pages/jobs-detail/jobs-detail.page.component.jsx @@ -104,7 +104,6 @@ export function JobsDetailPage({ const newTotals = ( await Axios.post("/job/totals", { job: { ...job, ...values }, - shoprates: bodyshop.shoprates, }) ).data; diff --git a/client/src/pages/jobs-detail/jobs-detail.page.container.jsx b/client/src/pages/jobs-detail/jobs-detail.page.container.jsx index f3619af37..9d02df77f 100644 --- a/client/src/pages/jobs-detail/jobs-detail.page.container.jsx +++ b/client/src/pages/jobs-detail/jobs-detail.page.container.jsx @@ -10,6 +10,7 @@ import { GET_JOB_BY_PK, UPDATE_JOB } from "../../graphql/jobs.queries"; import { addRecentItem, setBreadcrumbs, + setSelectedHeader, } from "../../redux/application/application.actions"; import { CreateRecentItem } from "../../utils/create-recent-item"; import JobsDetailPage from "./jobs-detail.page.component"; @@ -17,9 +18,15 @@ import JobsDetailPage from "./jobs-detail.page.component"; const mapDispatchToProps = (dispatch) => ({ setBreadcrumbs: (breadcrumbs) => dispatch(setBreadcrumbs(breadcrumbs)), addRecentItem: (item) => dispatch(addRecentItem(item)), + setSelectedHeader: (key) => dispatch(setSelectedHeader(key)), }); -function JobsDetailPageContainer({ match, setBreadcrumbs, addRecentItem }) { +function JobsDetailPageContainer({ + match, + setBreadcrumbs, + addRecentItem, + setSelectedHeader, +}) { const { jobId } = match.params; const { t } = useTranslation(); @@ -30,6 +37,7 @@ function JobsDetailPageContainer({ match, setBreadcrumbs, addRecentItem }) { const [mutationUpdateJob] = useMutation(UPDATE_JOB); useEffect(() => { + setSelectedHeader("activejobs"); document.title = loading ? t("titles.app") : error @@ -62,12 +70,25 @@ function JobsDetailPageContainer({ match, setBreadcrumbs, addRecentItem }) { jobId, "job", `${data.jobs_by_pk.est_number || ""} | ${ - data.jobs_by_pk.ro_number || "" + data.jobs_by_pk.ownr_fn || "" + } ${data.jobs_by_pk.ownr_ln || ""} ${ + data.jobs_by_pk.ownr_co_nm || "" + }${ + data.jobs_by_pk.ro_number ? ` | ${data.jobs_by_pk.ro_number}` : "" }`, `/manage/jobs/${jobId}` ) ); - }, [loading, data, t, error, setBreadcrumbs, jobId, addRecentItem]); + }, [ + loading, + data, + t, + error, + setBreadcrumbs, + jobId, + addRecentItem, + setSelectedHeader, + ]); if (loading) return ; if (error) return ; diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 1cff3bab3..5594e7528 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -886,7 +886,6 @@ "phoneshort": "PH", "policy_no": "Policy #", "ponumber": "PO Number", - "rate_atp": "ATP", "rate_la1": "LA1", "rate_la2": "LA2", "rate_la3": "LA3", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index fa1ecac7e..952af7924 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -886,7 +886,6 @@ "phoneshort": "PH", "policy_no": "Política #", "ponumber": "numero postal", - "rate_atp": "ATP", "rate_la1": "Tarifa LA1", "rate_la2": "Tarifa LA2", "rate_la3": "Tarifa LA3", diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index 2c789f8bc..58f62d391 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -886,7 +886,6 @@ "phoneshort": "PH", "policy_no": "Politique #", "ponumber": "Numéro de bon de commande", - "rate_atp": "ATP", "rate_la1": "Taux LA1", "rate_la2": "Taux LA2", "rate_la3": "Taux LA3", diff --git a/client/src/utils/TestingHelpers.js b/client/src/utils/TestingHelpers.js index 806feaa8b..8a9e503e8 100644 --- a/client/src/utils/TestingHelpers.js +++ b/client/src/utils/TestingHelpers.js @@ -25,7 +25,7 @@ export const MockBodyshop = { "Completed", "Delivered", "Invoiced", - "Exported" + "Exported", ], open_statuses: [ "Open", @@ -35,7 +35,7 @@ export const MockBodyshop = { "Parts", "Body", "Prep", - "Paint" + "Paint", ], default_arrived: "Arrived", default_exported: "Exported", @@ -43,14 +43,14 @@ export const MockBodyshop = { default_invoiced: "Invoiced", default_completed: "Completed", default_delivered: "Delivered", - default_scheduled: "Scheduled" + default_scheduled: "Scheduled", }, md_order_statuses: { statuses: ["Ordered", "Received", "Canceled", "Backordered"], default_bo: "Backordered", default_ordered: "Ordered", default_canceled: "Canceled", - default_received: "Received" + default_received: "Received", }, shopname: "Testing Collision", state: "BC", @@ -61,7 +61,7 @@ export const MockBodyshop = { md_responsibility_centers: { costs: [ "Aftermarket", - "ATP", + "ATS", "Body", "Detail", "Daignostic", @@ -80,11 +80,11 @@ export const MockBodyshop = { "Remanufactured", "Other", "Sublet", - "Towing" + "Towing", ], profits: [ "Aftermarket", - "ATP", + "ATS", "Body", "Detail", "Daignostic", @@ -103,10 +103,10 @@ export const MockBodyshop = { "Remanufactured", "Other", "Sublet", - "Towing" + "Towing", ], defaults: { - ATP: "ATP", + ATS: "ATS", LAB: "Body", LAD: "Diagnostic", LAE: "Electrical", @@ -124,8 +124,8 @@ export const MockBodyshop = { PAO: "Other", PAP: "OEM Partial", PAR: "16", - TOW: "Towing" - } + TOW: "Towing", + }, }, employees: [ { @@ -134,7 +134,7 @@ export const MockBodyshop = { last_name: "BODY123", employee_number: "101", cost_center: "Body", - __typename: "employees" + __typename: "employees", }, { id: "8cc787d3-1cfe-49d3-8a15-8469cd5c2e41", @@ -142,7 +142,7 @@ export const MockBodyshop = { last_name: "Painter", employee_number: "10211", cost_center: "REFINISH", - __typename: "employees" - } - ] + __typename: "employees", + }, + ], }; diff --git a/hasura/migrations/1599681810108_alter_table_public_jobs_alter_column_rate_atp/down.yaml b/hasura/migrations/1599681810108_alter_table_public_jobs_alter_column_rate_atp/down.yaml new file mode 100644 index 000000000..4f83b18be --- /dev/null +++ b/hasura/migrations/1599681810108_alter_table_public_jobs_alter_column_rate_atp/down.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: alter table "public"."jobs" rename column "rate_ats" to "rate_atp"; + type: run_sql diff --git a/hasura/migrations/1599681810108_alter_table_public_jobs_alter_column_rate_atp/up.yaml b/hasura/migrations/1599681810108_alter_table_public_jobs_alter_column_rate_atp/up.yaml new file mode 100644 index 000000000..2f3acf47a --- /dev/null +++ b/hasura/migrations/1599681810108_alter_table_public_jobs_alter_column_rate_atp/up.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: alter table "public"."jobs" rename column "rate_atp" to "rate_ats"; + type: run_sql diff --git a/hasura/migrations/1599685044433_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1599685044433_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..de19515aa --- /dev/null +++ b/hasura/migrations/1599685044433_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,261 @@ +- 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 + - area_of_damage + - asgn_date + - asgn_no + - asgn_type + - 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_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - ded_amt + - ded_status + - deliverchecklist + - depreciation_taxes + - 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_number + - est_ph1 + - est_st + - est_zip + - federal_tax_payable + - 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 + - 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 + - rate_ats + - 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_str_rt + - tax_sub_rt + - tax_thramt + - tax_tow_rt + - theft_ind + - tlos_ind + - towing_payable + - unit_number + - updated_at + - v_color + - v_make_desc + - v_model_desc + - v_model_yr + - v_vin + - vehicleid + set: {} + role: user + table: + name: jobs + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1599685044433_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1599685044433_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..fb5509933 --- /dev/null +++ b/hasura/migrations/1599685044433_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,260 @@ +- 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 + - area_of_damage + - asgn_date + - asgn_no + - asgn_type + - 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_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - ded_amt + - ded_status + - deliverchecklist + - depreciation_taxes + - 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_number + - est_ph1 + - est_st + - est_zip + - federal_tax_payable + - 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 + - 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 + - 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_str_rt + - tax_sub_rt + - tax_thramt + - tax_tow_rt + - theft_ind + - tlos_ind + - towing_payable + - unit_number + - updated_at + - v_color + - v_make_desc + - v_model_desc + - v_model_yr + - v_vin + - vehicleid + set: {} + role: user + table: + name: jobs + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1599685058705_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1599685058705_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..e866fce4c --- /dev/null +++ b/hasura/migrations/1599685058705_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,262 @@ +- 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 + - area_of_damage + - asgn_date + - asgn_no + - asgn_type + - 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_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - ded_amt + - ded_status + - deliverchecklist + - depreciation_taxes + - 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_number + - est_ph1 + - est_st + - est_zip + - federal_tax_payable + - 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 + - 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 + - rate_ats + - 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_str_rt + - tax_sub_rt + - tax_thramt + - tax_tow_rt + - theft_ind + - tlos_ind + - towing_payable + - unit_number + - updated_at + - v_color + - v_make_desc + - v_model_desc + - v_model_yr + - v_vin + - vehicleid + 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/1599685058705_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1599685058705_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..1eea00449 --- /dev/null +++ b/hasura/migrations/1599685058705_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,261 @@ +- 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 + - area_of_damage + - asgn_date + - asgn_no + - asgn_type + - 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_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - ded_amt + - ded_status + - deliverchecklist + - depreciation_taxes + - 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_number + - est_ph1 + - est_st + - est_zip + - federal_tax_payable + - 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 + - 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 + - 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_str_rt + - tax_sub_rt + - tax_thramt + - tax_tow_rt + - theft_ind + - tlos_ind + - towing_payable + - unit_number + - updated_at + - v_color + - v_make_desc + - v_model_desc + - v_model_yr + - v_vin + - vehicleid + 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/1599685070271_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1599685070271_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..0efe18412 --- /dev/null +++ b/hasura/migrations/1599685070271_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,261 @@ +- 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 + - area_of_damage + - asgn_date + - asgn_no + - asgn_type + - 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_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - ded_amt + - ded_status + - deliverchecklist + - depreciation_taxes + - 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_number + - est_ph1 + - est_st + - est_zip + - federal_tax_payable + - 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 + - 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 + - rate_ats + - 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_str_rt + - tax_sub_rt + - tax_thramt + - tax_tow_rt + - theft_ind + - tlos_ind + - towing_payable + - unit_number + - updated_at + - v_color + - v_make_desc + - v_model_desc + - v_model_yr + - v_vin + - vehicleid + 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/1599685070271_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1599685070271_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..5fb88af70 --- /dev/null +++ b/hasura/migrations/1599685070271_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,260 @@ +- 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 + - area_of_damage + - asgn_date + - asgn_no + - asgn_type + - 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_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - ded_amt + - ded_status + - deliverchecklist + - depreciation_taxes + - 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_number + - est_ph1 + - est_st + - est_zip + - federal_tax_payable + - 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 + - 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 + - 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_str_rt + - tax_sub_rt + - tax_thramt + - tax_tow_rt + - theft_ind + - tlos_ind + - towing_payable + - unit_number + - updated_at + - v_color + - v_make_desc + - v_model_desc + - v_model_yr + - v_vin + - vehicleid + 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/1599685084979_alter_table_public_jobs_drop_column_rate_ats/down.yaml b/hasura/migrations/1599685084979_alter_table_public_jobs_drop_column_rate_ats/down.yaml new file mode 100644 index 000000000..726cc3f11 --- /dev/null +++ b/hasura/migrations/1599685084979_alter_table_public_jobs_drop_column_rate_ats/down.yaml @@ -0,0 +1,10 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."jobs" ADD COLUMN "rate_ats" numeric; + type: run_sql +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."jobs" ALTER COLUMN "rate_ats" DROP NOT NULL; + type: run_sql diff --git a/hasura/migrations/1599685084979_alter_table_public_jobs_drop_column_rate_ats/up.yaml b/hasura/migrations/1599685084979_alter_table_public_jobs_drop_column_rate_ats/up.yaml new file mode 100644 index 000000000..8a2e3f1e8 --- /dev/null +++ b/hasura/migrations/1599685084979_alter_table_public_jobs_drop_column_rate_ats/up.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."jobs" DROP COLUMN "rate_ats" CASCADE; + type: run_sql diff --git a/hasura/migrations/1599692038231_alter_table_public_jobs_add_column_tax_shop_mat_rt/down.yaml b/hasura/migrations/1599692038231_alter_table_public_jobs_add_column_tax_shop_mat_rt/down.yaml new file mode 100644 index 000000000..a2cd969e0 --- /dev/null +++ b/hasura/migrations/1599692038231_alter_table_public_jobs_add_column_tax_shop_mat_rt/down.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."jobs" DROP COLUMN "tax_shop_mat_rt"; + type: run_sql diff --git a/hasura/migrations/1599692038231_alter_table_public_jobs_add_column_tax_shop_mat_rt/up.yaml b/hasura/migrations/1599692038231_alter_table_public_jobs_add_column_tax_shop_mat_rt/up.yaml new file mode 100644 index 000000000..b8753826f --- /dev/null +++ b/hasura/migrations/1599692038231_alter_table_public_jobs_add_column_tax_shop_mat_rt/up.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."jobs" ADD COLUMN "tax_shop_mat_rt" numeric NULL; + type: run_sql diff --git a/hasura/migrations/1599692310270_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1599692310270_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..fb5509933 --- /dev/null +++ b/hasura/migrations/1599692310270_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,260 @@ +- 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 + - area_of_damage + - asgn_date + - asgn_no + - asgn_type + - 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_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - ded_amt + - ded_status + - deliverchecklist + - depreciation_taxes + - 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_number + - est_ph1 + - est_st + - est_zip + - federal_tax_payable + - 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 + - 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 + - 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_str_rt + - tax_sub_rt + - tax_thramt + - tax_tow_rt + - theft_ind + - tlos_ind + - towing_payable + - unit_number + - updated_at + - v_color + - v_make_desc + - v_model_desc + - v_model_yr + - v_vin + - vehicleid + set: {} + role: user + table: + name: jobs + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1599692310270_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1599692310270_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..2e778f53c --- /dev/null +++ b/hasura/migrations/1599692310270_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,261 @@ +- 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 + - area_of_damage + - asgn_date + - asgn_no + - asgn_type + - 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_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - ded_amt + - ded_status + - deliverchecklist + - depreciation_taxes + - 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_number + - est_ph1 + - est_st + - est_zip + - federal_tax_payable + - 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 + - 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 + - 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 + - towing_payable + - unit_number + - updated_at + - v_color + - v_make_desc + - v_model_desc + - v_model_yr + - v_vin + - vehicleid + set: {} + role: user + table: + name: jobs + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1599692321158_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1599692321158_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..1eea00449 --- /dev/null +++ b/hasura/migrations/1599692321158_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,261 @@ +- 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 + - area_of_damage + - asgn_date + - asgn_no + - asgn_type + - 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_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - ded_amt + - ded_status + - deliverchecklist + - depreciation_taxes + - 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_number + - est_ph1 + - est_st + - est_zip + - federal_tax_payable + - 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 + - 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 + - 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_str_rt + - tax_sub_rt + - tax_thramt + - tax_tow_rt + - theft_ind + - tlos_ind + - towing_payable + - unit_number + - updated_at + - v_color + - v_make_desc + - v_model_desc + - v_model_yr + - v_vin + - vehicleid + 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/1599692321158_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1599692321158_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..f0fa8af7a --- /dev/null +++ b/hasura/migrations/1599692321158_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,262 @@ +- 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 + - area_of_damage + - asgn_date + - asgn_no + - asgn_type + - 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_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - ded_amt + - ded_status + - deliverchecklist + - depreciation_taxes + - 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_number + - est_ph1 + - est_st + - est_zip + - federal_tax_payable + - 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 + - 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 + - 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 + - towing_payable + - unit_number + - updated_at + - v_color + - v_make_desc + - v_model_desc + - v_model_yr + - v_vin + - vehicleid + 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/1599692329335_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1599692329335_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..5fb88af70 --- /dev/null +++ b/hasura/migrations/1599692329335_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,260 @@ +- 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 + - area_of_damage + - asgn_date + - asgn_no + - asgn_type + - 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_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - ded_amt + - ded_status + - deliverchecklist + - depreciation_taxes + - 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_number + - est_ph1 + - est_st + - est_zip + - federal_tax_payable + - 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 + - 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 + - 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_str_rt + - tax_sub_rt + - tax_thramt + - tax_tow_rt + - theft_ind + - tlos_ind + - towing_payable + - unit_number + - updated_at + - v_color + - v_make_desc + - v_model_desc + - v_model_yr + - v_vin + - vehicleid + 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/1599692329335_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1599692329335_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..f12bd10ee --- /dev/null +++ b/hasura/migrations/1599692329335_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,261 @@ +- 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 + - area_of_damage + - asgn_date + - asgn_no + - asgn_type + - 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_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - ded_amt + - ded_status + - deliverchecklist + - depreciation_taxes + - 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_number + - est_ph1 + - est_st + - est_zip + - federal_tax_payable + - 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 + - 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 + - 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 + - towing_payable + - unit_number + - updated_at + - v_color + - v_make_desc + - v_model_desc + - v_model_yr + - v_vin + - vehicleid + 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 52450df4b..57bf61bb3 100644 --- a/hasura/migrations/metadata.yaml +++ b/hasura/migrations/metadata.yaml @@ -2266,7 +2266,6 @@ tables: - po_number - policy_no - production_vars - - rate_atp - rate_la1 - rate_la2 - rate_la3 @@ -2312,6 +2311,7 @@ tables: - tax_prethr - tax_pstthr - tax_registration_number + - tax_shop_mat_rt - tax_str_rt - tax_sub_rt - tax_thramt @@ -2507,7 +2507,6 @@ tables: - po_number - policy_no - production_vars - - rate_atp - rate_la1 - rate_la2 - rate_la3 @@ -2553,6 +2552,7 @@ tables: - tax_prethr - tax_pstthr - tax_registration_number + - tax_shop_mat_rt - tax_str_rt - tax_sub_rt - tax_thramt @@ -2758,7 +2758,6 @@ tables: - po_number - policy_no - production_vars - - rate_atp - rate_la1 - rate_la2 - rate_la3 @@ -2804,6 +2803,7 @@ tables: - tax_prethr - tax_pstthr - tax_registration_number + - tax_shop_mat_rt - tax_str_rt - tax_sub_rt - tax_thramt diff --git a/server/job/job-totals.js b/server/job/job-totals.js index 5a4cea537..7800b7172 100644 --- a/server/job/job-totals.js +++ b/server/job/job-totals.js @@ -4,12 +4,13 @@ Dinero.defaultCurrency = "CAD"; Dinero.globalLocale = "en-CA"; exports.default = async function (req, res) { - const { job, shoprates } = req.body; + const { job } = req.body; console.log(`Calculating Job Totals for ${job.id} - ${job.ro_number}`); try { let ret = { parts: CalculatePartsTotals(job.joblines), - rates: CalculateRatesTotals(job, shoprates), + rates: CalculateRatesTotals(job), + additional: CalculateAdditional(job), custPayable: CalculateCustPayable(job), }; ret.totals = CalculateTaxesTotals(job, ret); @@ -21,28 +22,61 @@ exports.default = async function (req, res) { } }; +function CalculateAdditional(job) { + return job.joblines + .filter( + (jl) => + jl.lbr_op === "OP2" || + jl.lbr_op === "OP3" || + jl.lbr_op === "OP4" || + jl.lbr_op === "OP5" || + jl.lbr_op === "OP6" || + jl.lbr_op === "OP7" || + jl.lbr_op === "OP8" || + jl.lbr_op === "OP9" || + jl.lbr_op === "OP10" || + jl.lbr_op === "OP13" || + jl.lbr_op === "OP13" || + jl.lbr_op === "OP14" || + jl.lbr_op === "OP15" + ) + .reduce((acc, val) => { + console.log("val", val); + return acc.add( + Dinero({ amount: Math.round((val.act_price || 0) * 100) }) + ); + }, Dinero()); +} + function CalculateTaxesTotals(job, otherTotals) { + const theObj = JSON.parse(JSON.stringify(otherTotals)); + const subtotal = otherTotals.parts.parts.subtotal .add(otherTotals.parts.sublets.subtotal) - .add(otherTotals.rates.subtotal) + .add(otherTotals.rates.rates_subtotal) + .add(otherTotals.additional) .add(Dinero({ amount: (job.towing_payable || 0) * 100 })) .add(Dinero({ amount: (job.storage_payable || 0) * 100 })); //TODO Levies should be included?? const statePartsTax = job.joblines.reduce((acc, val) => { if (!!!val.tax_part) return acc; - if (!!job.parts_tax_rates[val.part_type]) { - return acc.add( - Dinero({ amount: Math.round(val.act_price * 100) }) - .multiply(val.part_qty) - .percentage( - (job.parts_tax_rates[val.part_type].prt_tax_rt || 0) * 100 - ) - ); - } else { - return acc; - } + // if (!!job.parts_tax_rates[val.part_type]) { + // console.log("val.line_desc", val.line_desc); + return acc.add( + Dinero({ amount: Math.round(val.act_price * 100) }) + .multiply(val.part_qty) + .percentage( + ((job.parts_tax_rates[val.part_type] && + job.parts_tax_rates[val.part_type].prt_tax_rt) || + 0.07) * 100 + ) + ); + // } else { + // return acc; + // } }, Dinero({ amount: 0 })); + let ret = { subtotal: subtotal, federal_tax: subtotal.percentage((job.federal_tax_rate || 0) * 100), @@ -61,10 +95,20 @@ function CalculateTaxesTotals(job, otherTotals) { amount: Math.round((job.storage_payable || 0) * 100), }).percentage((job.tax_str_rt || 0) * 100) ) + // .add( + // otherTotals.rates.mapa.total.percentage( + // (job.tax_paint_mat_rt || 0) * 100 + // ) + // ) + // .add( + // otherTotals.rates.mapa.total.percentage( + // (job.tax_paint_mat_rt || 0) * 100 + // ) + // ) .add( - otherTotals.rates.mapa.total - .add(otherTotals.rates.mash.total) - .percentage((job.tax_paint_mat_rt || 0) * 100) + otherTotals.rates.mash.total.percentage( + (job.tax_shop_mat_rt || 0) * 100 + ) ), local_tax: subtotal.percentage((job.local_tax_rate || 0) * 100), }; @@ -77,8 +121,6 @@ function CalculateTaxesTotals(job, otherTotals) { return ret; } -//Rates are multipled by 10 to reduce the errors of rounding. -//Adjusted for when adding to total by dividing by 10. function CalculateRatesTotals(ratesList, shoprates) { const jobLines = ratesList.joblines; @@ -167,26 +209,7 @@ function CalculateRatesTotals(ratesList, shoprates) { .filter((item) => item.mod_lbr_ty === "LAU") .reduce((acc, value) => acc + value.mod_lb_hrs, 0), }, - atp: { - rate: shoprates.rate_atp || 0, - hours: - jobLines.filter((item) => item.line_desc.includes("ATS Amount")) - .length > 0 - ? jobLines - .filter( - (item) => - item.mod_lbr_ty !== "LA1" && - item.mod_lbr_ty !== "LA2" && - item.mod_lbr_ty !== "LA3" && - item.mod_lbr_ty !== "LA4" && - item.mod_lbr_ty !== "LAU" && - item.mod_lbr_ty !== "LAG" && - item.mod_lbr_ty !== "LAS" && - item.mod_lbr_ty !== "LAA" - ) - .reduce((acc, value) => acc + value.mod_lb_hrs, 0) - : 0, - }, + mapa: { rate: ratesList.rate_mapa || 0, hours: jobLines @@ -237,15 +260,7 @@ function CalculatePartsTotals(jobLines) { //TODO Add Adjustments in }, }; - // case "PAA": - // case "PAC": - // case "PAG": - // case "PAL": - // case "PAM": - // case "PAN": - // case "PAO": - // case "PAP": - // case "PAR": + default: if (value.part_type === null) return acc; return {