diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index c8241b88e..01e5865c2 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -13458,6 +13458,27 @@ + + adjustmenthours + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + alt_transport false @@ -16586,6 +16607,27 @@ + + adjustments + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + allocations false diff --git a/client/src/components/jobs-detail-labor/jobs-detail-labor.component.jsx b/client/src/components/jobs-detail-labor/jobs-detail-labor.component.jsx index 170a1e1a0..63df16e6c 100644 --- a/client/src/components/jobs-detail-labor/jobs-detail-labor.component.jsx +++ b/client/src/components/jobs-detail-labor/jobs-detail-labor.component.jsx @@ -21,6 +21,7 @@ export function JobsDetailLaborContainer({ refetch, loading, techConsole, + adjustments, }) { const { t } = useTranslation(); return ( @@ -35,8 +36,10 @@ export function JobsDetailLaborContainer({ )} ); } diff --git a/client/src/components/labor-allocations-adjustment-edit/labor-allocations-adjustment-edit.component.jsx b/client/src/components/labor-allocations-adjustment-edit/labor-allocations-adjustment-edit.component.jsx new file mode 100644 index 000000000..71c07a48e --- /dev/null +++ b/client/src/components/labor-allocations-adjustment-edit/labor-allocations-adjustment-edit.component.jsx @@ -0,0 +1,148 @@ +import { useMutation } from "@apollo/react-hooks"; +import { + Button, + Card, + Form, + InputNumber, + notification, + Popover, + Select, +} from "antd"; +import React, { useState } from "react"; +import { useTranslation } from "react-i18next"; +import { UPDATE_JOB } from "../../graphql/jobs.queries"; + +export default function LaborAllocationsAdjustmentEdit({ + jobId, + mod_lbr_ty, + adjustments = [], + children, +}) { + const [loading, setLoading] = useState(false); + const [updateAdjustments] = useMutation(UPDATE_JOB); + const [form] = Form.useForm(); + + const { t } = useTranslation(); + + const handleFinish = async (values) => { + setLoading(true); + const result = await updateAdjustments({ + variables: { + jobId: jobId, + job: { + lbr_adjustments: [ + { mod_lbr_ty: values.mod_lbr_ty, hours: values.hours }, + ...adjustments.filter((a) => a.mod_lbr_ty !== values.mod_lbr_ty), + ], + }, + }, + }); + + if (!!result.errors) { + notification["error"]({ + message: t("jobs.errors.saving", { + message: JSON.stringify(result.errors), + }), + }); + } else { + notification["success"]({ + message: t("jobs.successes.saved"), + }); + } + setLoading(false); + }; + + const overlay = ( + +
+
i.mod_lbr_ty === mod_lbr_ty)[0] + ?.hours, + }} + > + + + + + + + +
+
+
+ ); + + return ( + + {children} + + ); +} diff --git a/client/src/components/labor-allocations-table/labor-allocations-table.component.jsx b/client/src/components/labor-allocations-table/labor-allocations-table.component.jsx index 26be7de24..127ad163a 100644 --- a/client/src/components/labor-allocations-table/labor-allocations-table.component.jsx +++ b/client/src/components/labor-allocations-table/labor-allocations-table.component.jsx @@ -1,15 +1,25 @@ -import React, { useState, useEffect } from "react"; -import { Typography, Row, Col } from "antd"; +import { EditFilled } from "@ant-design/icons"; +import { Typography } from "antd"; +import React, { useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; -import { CalculateAllocationsTotals } from "./labor-allocations-table.utility"; import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; import { selectBodyshop } from "../../redux/user/user.selectors"; +import LaborAllocationsAdjustmentEdit from "../labor-allocations-adjustment-edit/labor-allocations-adjustment-edit.component"; +import "./labor-allocations-table.styles.scss"; +import { CalculateAllocationsTotals } from "./labor-allocations-table.utility"; + const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, }); -export function LaborAllocationsTable({ joblines, timetickets, bodyshop }) { +export function LaborAllocationsTable({ + jobId, + joblines, + timetickets, + bodyshop, + adjustments, +}) { const { t } = useTranslation(); const [totals, setTotals] = useState([]); @@ -19,47 +29,70 @@ export function LaborAllocationsTable({ joblines, timetickets, bodyshop }) { CalculateAllocationsTotals( bodyshop.md_responsibility_centers, joblines, - timetickets + timetickets, + adjustments ) ); - }, [joblines, timetickets, bodyshop]); + }, [joblines, timetickets, bodyshop, adjustments]); return (
- - {t("jobs.labels.laborallocations")} - - - - - {t("timetickets.fields.cost_center")} - - - {t("jobs.labels.hrs_total")} - - - {t("jobs.labels.hrs_claimed")} - - - {t("jobs.labels.difference")} - - - {totals.map((t, idx) => ( - - {t.cost_center} - {t.total.toFixed(2)} - {t.claimed.toFixed(2)} - - 0 ? "green" : "red", - }} - > - {(t.total - t.claimed).toFixed(2)} - - - - ))} +
+ + {t("jobs.labels.laborallocations")} + +
+ + + + + + + + + + + + {totals.map((t, idx) => ( + + + + + + + + ))} + +
+ {t("timetickets.fields.cost_center")} + + {t("jobs.labels.hrs_total")} + + {t("jobs.labels.hrs_claimed")} + + {t("jobs.labels.adjustments")} + + {t("jobs.labels.difference")} +
{t.cost_center}{t.total.toFixed(1)}{t.claimed.toFixed(1)} + {t.adjustments.toFixed(1)} + + + + + 0 ? "green" : "red", + }} + > + {t.difference} + +
+
+
); } diff --git a/client/src/components/labor-allocations-table/labor-allocations-table.styles.scss b/client/src/components/labor-allocations-table/labor-allocations-table.styles.scss new file mode 100644 index 000000000..afd84fec5 --- /dev/null +++ b/client/src/components/labor-allocations-table/labor-allocations-table.styles.scss @@ -0,0 +1,30 @@ +.labor-allocations-table { + flex: 1; + display: flex; + flex-direction: column; + align-items: center; + + table { + border: 1px solid #ccc; + border-collapse: collapse; + margin: 0; + padding: 0; + width: 80%; + table-layout: fixed; + } + + table tr { + //background-color: #f8f8f8; + border: 1px solid #ddd; + padding: 0.35em; + } + + table th, + table td { + padding: 0.625em; + text-align: center; + } + table td.currency { + text-align: right; + } +} diff --git a/client/src/components/labor-allocations-table/labor-allocations-table.utility.js b/client/src/components/labor-allocations-table/labor-allocations-table.utility.js index 8d36bcfdd..d4f669ed2 100644 --- a/client/src/components/labor-allocations-table/labor-allocations-table.utility.js +++ b/client/src/components/labor-allocations-table/labor-allocations-table.utility.js @@ -1,29 +1,41 @@ export const CalculateAllocationsTotals = ( responsibilitycenters, joblines, - timetickets + timetickets, + adjustments = [] ) => { - const jobCodes = joblines - .map((item) => item.mod_lbr_ty) - .filter((value, index, self) => self.indexOf(value) === index && !!value); - const ticketCodes = timetickets - .map((item) => item.cieca_code) - .filter((value, index, self) => self.indexOf(value) === index && !!value); - const allCodes = [...jobCodes, ...ticketCodes]; + const jobCodes = joblines.map((item) => item.mod_lbr_ty); + //.filter((value, index, self) => self.indexOf(value) === index && !!value); + const ticketCodes = timetickets.map((item) => item.cieca_code); + //.filter((value, index, self) => self.indexOf(value) === index && !!value); + const adjustmentCodes = adjustments.map((item) => item.mod_lbr_ty); + //.filter((value, index, self) => self.indexOf(value) === index && !!value); + const allCodes = [...jobCodes, ...ticketCodes, ...adjustmentCodes].filter( + (value, index, self) => self.indexOf(value) === index && !!value + ); const r = allCodes.reduce((acc, value) => { - acc.push({ + const r = { opcode: value, cost_center: responsibilitycenters.defaults.costs[value], total: joblines.reduce((acc2, val2) => { return val2.mod_lbr_ty === value ? acc2 + val2.mod_lb_hrs : acc2; }, 0), + adjustments: adjustments.reduce((acc3, val3) => { + console.log("acc3", acc3); + console.log("val3", val3); + return val3.mod_lbr_ty === value ? acc3 + val3.hours : acc3; + }, 0), claimed: timetickets.reduce((acc3, val3) => { return val3.ciecacode === value ? acc3 + val3.productivehrs : acc3; }, 0), - }); + }; + + r.difference = (r.total + r.adjustments - r.claimed).toFixed(2); + acc.push(r); return acc; }, []); + console.log("r", r); return r; }; diff --git a/client/src/components/time-ticket-modal/time-ticket-modal.component.jsx b/client/src/components/time-ticket-modal/time-ticket-modal.component.jsx index 3329bf193..1cb2905ae 100644 --- a/client/src/components/time-ticket-modal/time-ticket-modal.component.jsx +++ b/client/src/components/time-ticket-modal/time-ticket-modal.component.jsx @@ -121,10 +121,13 @@ export default function TimeTicketModalComponent({ - + + + ); } diff --git a/client/src/graphql/jobs-lines.queries.js b/client/src/graphql/jobs-lines.queries.js index 54da42982..0eb0b1f22 100644 --- a/client/src/graphql/jobs-lines.queries.js +++ b/client/src/graphql/jobs-lines.queries.js @@ -42,6 +42,10 @@ export const GET_JOB_LINES_BY_PK = gql` export const GET_LINE_TICKET_BY_PK = gql` query GET_LINE_TICKET_BY_PK($id: uuid!) { + jobs_by_pk(id: $id) { + id + lbr_adjustments + } joblines(where: { jobid: { _eq: $id } }) { id line_desc diff --git a/client/src/graphql/jobs.queries.js b/client/src/graphql/jobs.queries.js index 8ba8099a1..5aadeec67 100644 --- a/client/src/graphql/jobs.queries.js +++ b/client/src/graphql/jobs.queries.js @@ -337,7 +337,7 @@ export const GET_JOB_BY_PK = gql` special_coverage_policy scheduled_delivery converted - + lbr_adjustments ro_number clm_total inproduction @@ -706,6 +706,7 @@ export const UPDATE_JOB = gql` alt_transport ro_number production_vars + lbr_adjustments } } } diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 5aafa3c5b..d07d563d1 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -869,6 +869,7 @@ "actual_delivery": "Actual Delivery", "actual_in": "Actual In", "adjustment_bottom_line": "Adjustments", + "adjustmenthours": "Adjustment Hours", "alt_transport": "Alt. Trans.", "ca_gst_registrant": "GST Registrant", "category": "Category", @@ -1025,6 +1026,7 @@ }, "labels": { "additionaltotal": "Additional Total", + "adjustments": "Adjustments", "allocations": "Allocations", "appointmentconfirmation": "Send confirmation to customer?", "audit": "Audit Trail", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index 4b701b711..854e49f28 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -869,6 +869,7 @@ "actual_delivery": "Entrega real", "actual_in": "Real en", "adjustment_bottom_line": "Ajustes", + "adjustmenthours": "", "alt_transport": "", "ca_gst_registrant": "", "category": "", @@ -1025,6 +1026,7 @@ }, "labels": { "additionaltotal": "", + "adjustments": "", "allocations": "", "appointmentconfirmation": "¿Enviar confirmación al cliente?", "audit": "", diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index f4f6ea4a5..6d3c4e7a5 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -869,6 +869,7 @@ "actual_delivery": "Livraison réelle", "actual_in": "En réel", "adjustment_bottom_line": "Ajustements", + "adjustmenthours": "", "alt_transport": "", "ca_gst_registrant": "", "category": "", @@ -1025,6 +1026,7 @@ }, "labels": { "additionaltotal": "", + "adjustments": "", "allocations": "", "appointmentconfirmation": "Envoyer une confirmation au client?", "audit": "", diff --git a/hasura/migrations/1610135319762_alter_table_public_jobs_add_column_lbr_adjustments/down.yaml b/hasura/migrations/1610135319762_alter_table_public_jobs_add_column_lbr_adjustments/down.yaml new file mode 100644 index 000000000..9f0131638 --- /dev/null +++ b/hasura/migrations/1610135319762_alter_table_public_jobs_add_column_lbr_adjustments/down.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."jobs" DROP COLUMN "lbr_adjustments"; + type: run_sql diff --git a/hasura/migrations/1610135319762_alter_table_public_jobs_add_column_lbr_adjustments/up.yaml b/hasura/migrations/1610135319762_alter_table_public_jobs_add_column_lbr_adjustments/up.yaml new file mode 100644 index 000000000..c075283eb --- /dev/null +++ b/hasura/migrations/1610135319762_alter_table_public_jobs_add_column_lbr_adjustments/up.yaml @@ -0,0 +1,6 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."jobs" ADD COLUMN "lbr_adjustments" jsonb NOT NULL DEFAULT + jsonb_build_array(); + type: run_sql diff --git a/hasura/migrations/1610135335076_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1610135335076_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..46b1a447a --- /dev/null +++ b/hasura/migrations/1610135335076_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,262 @@ +- 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_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_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_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 + - 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 + - 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/1610135335076_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1610135335076_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..1446f80b1 --- /dev/null +++ b/hasura/migrations/1610135335076_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,263 @@ +- 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_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_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_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 + - 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/1610135347875_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1610135347875_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..159015d7a --- /dev/null +++ b/hasura/migrations/1610135347875_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,263 @@ +- 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_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_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_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 + - 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 + - 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/1610135347875_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1610135347875_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..eac2bb100 --- /dev/null +++ b/hasura/migrations/1610135347875_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,264 @@ +- 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_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_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_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 + - 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/1610135386514_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1610135386514_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..c396ebece --- /dev/null +++ b/hasura/migrations/1610135386514_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,262 @@ +- 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_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_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_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 + - 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 + - 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/1610135386514_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1610135386514_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..5dbd57336 --- /dev/null +++ b/hasura/migrations/1610135386514_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,263 @@ +- 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_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_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_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 + - 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 bf03167eb..1673ed8b6 100644 --- a/hasura/migrations/metadata.yaml +++ b/hasura/migrations/metadata.yaml @@ -2260,6 +2260,7 @@ tables: - kmout - labor_rate_desc - labor_rate_id + - lbr_adjustments - local_tax_rate - loss_cat - loss_date @@ -2502,6 +2503,7 @@ tables: - kmout - labor_rate_desc - labor_rate_id + - lbr_adjustments - local_tax_rate - loss_cat - loss_date @@ -2754,6 +2756,7 @@ tables: - kmout - labor_rate_desc - labor_rate_id + - lbr_adjustments - local_tax_rate - loss_cat - loss_date