From 26abbdcc62d72433fa23df7014c55e57fb05276e Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Wed, 8 Apr 2020 10:41:19 -0700 Subject: [PATCH] WIP Financial Calculation --- apollo.config.js | 11 - .../job-totals-table/job-totals.utility.js | 122 +++++---- client/src/graphql/jobs.queries.js | 7 + .../down.yaml | 5 + .../up.yaml | 5 + .../down.yaml | 252 +++++++++++++++++ .../up.yaml | 253 ++++++++++++++++++ .../down.yaml | 250 +++++++++++++++++ .../up.yaml | 251 +++++++++++++++++ .../down.yaml | 252 +++++++++++++++++ .../up.yaml | 253 ++++++++++++++++++ jsconfig.json | 11 + 12 files changed, 1614 insertions(+), 58 deletions(-) delete mode 100644 apollo.config.js create mode 100644 hasura/migrations/1586365217566_alter_table_public_jobs_add_column_parts_tax_rates/down.yaml create mode 100644 hasura/migrations/1586365217566_alter_table_public_jobs_add_column_parts_tax_rates/up.yaml create mode 100644 hasura/migrations/1586365232521_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1586365232521_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1586365248281_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1586365248281_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1586365257227_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1586365257227_update_permission_user_public_table_jobs/up.yaml create mode 100644 jsconfig.json diff --git a/apollo.config.js b/apollo.config.js deleted file mode 100644 index e949522fb..000000000 --- a/apollo.config.js +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = { - client: { - service: { - name: "Dev", - url: "https://bodyshop-dev-db.herokuapp.com/v1/graphql", - headers: { - "x-hasura-admin-secret": "Dev-BodyShopAppBySnaptSoftware!" - } - } - } -}; diff --git a/client/src/components/job-totals-table/job-totals.utility.js b/client/src/components/job-totals-table/job-totals.utility.js index 3e6218488..0014dc69b 100644 --- a/client/src/components/job-totals-table/job-totals.utility.js +++ b/client/src/components/job-totals-table/job-totals.utility.js @@ -2,7 +2,7 @@ export function CalculateJob(job, shoprates) { let ret = { parts: CalculatePartsTotals(job.joblines), rates: CalculateRatesTotals(job, shoprates), - custPayable: CalculateCustPayable(job) + custPayable: CalculateCustPayable(job), }; ret.totals = CalculateTaxesTotals(job, ret); @@ -14,12 +14,35 @@ function CalculateTaxesTotals(job, otherTotals) { const subtotal = otherTotals.parts.parts.subtotal + otherTotals.parts.sublets.subtotal + - otherTotals.rates.subtotal; + otherTotals.rates.subtotal + + job.towing_payable + + job.storage_payable; //Levies should be included?? + + console.log("job.parts_tax_rates", job.parts_tax_rates); + + const statePartsTax = job.joblines.reduce((acc, val) => { + if (!!!val.part_type) return acc; + if (!!job.parts_tax_rates[val.part_type]) { + return ( + acc + + (val.act_price * job.parts_tax_rates[val.part_type].prt_tax_rt || 0) + ); + } else { + return acc; + } + }, 0); + let ret = { subtotal: subtotal, federal_tax: subtotal * job.federal_tax_rate || 0, - state_tax: subtotal * job.state_tax_rate || 0, - local_tax: subtotal * job.local_tax_rate || 0 + statePartsTax, + state_tax: + statePartsTax + + (otherTotals.rates.rates_subtotal * job.tax_lbr_rate || 0) + + (job.towing_payable || 0 * job.tax_tow_rt || 0) + + (job.storage_payable || 0 * job.tax_str_rt || 0) + + (otherTotals.rates.paint_mat.subtotal * job.tax_paint_mat_rt || 0), + local_tax: subtotal * job.local_tax_rate || 0, }; ret.total_repairs = @@ -35,93 +58,93 @@ function CalculateRatesTotals(ratesList, shoprates) { let ret = { rate_la1: { hours: jobLines - .filter(item => item.mod_lbr_ty === "LA1") + .filter((item) => item.mod_lbr_ty === "LA1") .reduce((acc, value) => acc + value.mod_lb_hrs, 0), - rate: ratesList.rate_la1 + rate: ratesList.rate_la1, }, rate_la2: { hours: jobLines - .filter(item => item.mod_lbr_ty === "LA2") + .filter((item) => item.mod_lbr_ty === "LA2") .reduce((acc, value) => acc + value.mod_lb_hrs, 0), - rate: ratesList.rate_la2 + rate: ratesList.rate_la2, }, rate_la3: { rate: ratesList.rate_la3, hours: jobLines - .filter(item => item.mod_lbr_ty === "LA3") - .reduce((acc, value) => acc + value.mod_lb_hrs, 0) + .filter((item) => item.mod_lbr_ty === "LA3") + .reduce((acc, value) => acc + value.mod_lb_hrs, 0), }, rate_la4: { rate: ratesList.rate_la4, hours: jobLines - .filter(item => item.mod_lbr_ty === "LA4") - .reduce((acc, value) => acc + value.mod_lb_hrs, 0) + .filter((item) => item.mod_lbr_ty === "LA4") + .reduce((acc, value) => acc + value.mod_lb_hrs, 0), }, rate_laa: { rate: ratesList.rate_laa, hours: jobLines - .filter(item => item.mod_lbr_ty === "LAA") - .reduce((acc, value) => acc + value.mod_lb_hrs, 0) + .filter((item) => item.mod_lbr_ty === "LAA") + .reduce((acc, value) => acc + value.mod_lb_hrs, 0), }, rate_lab: { rate: ratesList.rate_lab, hours: jobLines - .filter(item => item.mod_lbr_ty === "LAB") - .reduce((acc, value) => acc + value.mod_lb_hrs, 0) + .filter((item) => item.mod_lbr_ty === "LAB") + .reduce((acc, value) => acc + value.mod_lb_hrs, 0), }, rate_lad: { rate: ratesList.rate_lad, hours: jobLines - .filter(item => item.mod_lbr_ty === "LAD") - .reduce((acc, value) => acc + value.mod_lb_hrs, 0) + .filter((item) => item.mod_lbr_ty === "LAD") + .reduce((acc, value) => acc + value.mod_lb_hrs, 0), }, rate_lae: { rate: ratesList.rate_lae, hours: jobLines - .filter(item => item.mod_lbr_ty === "LAE") - .reduce((acc, value) => acc + value.mod_lb_hrs, 0) + .filter((item) => item.mod_lbr_ty === "LAE") + .reduce((acc, value) => acc + value.mod_lb_hrs, 0), }, rate_laf: { rate: ratesList.rate_laf, hours: jobLines - .filter(item => item.mod_lbr_ty === "LAF") - .reduce((acc, value) => acc + value.mod_lb_hrs, 0) + .filter((item) => item.mod_lbr_ty === "LAF") + .reduce((acc, value) => acc + value.mod_lb_hrs, 0), }, rate_lag: { rate: ratesList.rate_lag, hours: jobLines - .filter(item => item.mod_lbr_ty === "LAG") - .reduce((acc, value) => acc + value.mod_lb_hrs, 0) + .filter((item) => item.mod_lbr_ty === "LAG") + .reduce((acc, value) => acc + value.mod_lb_hrs, 0), }, rate_lam: { rate: ratesList.rate_lam, hours: jobLines - .filter(item => item.mod_lbr_ty === "LAM") - .reduce((acc, value) => acc + value.mod_lb_hrs, 0) + .filter((item) => item.mod_lbr_ty === "LAM") + .reduce((acc, value) => acc + value.mod_lb_hrs, 0), }, rate_lar: { rate: ratesList.rate_lar, hours: jobLines - .filter(item => item.mod_lbr_ty === "LAR") - .reduce((acc, value) => acc + value.mod_lb_hrs, 0) + .filter((item) => item.mod_lbr_ty === "LAR") + .reduce((acc, value) => acc + value.mod_lb_hrs, 0), }, rate_las: { rate: ratesList.rate_las, hours: jobLines - .filter(item => item.mod_lbr_ty === "LAS") - .reduce((acc, value) => acc + value.mod_lb_hrs, 0) + .filter((item) => item.mod_lbr_ty === "LAS") + .reduce((acc, value) => acc + value.mod_lb_hrs, 0), }, rate_lau: { rate: ratesList.rate_lau, hours: jobLines - .filter(item => item.mod_lbr_ty === "LAU") - .reduce((acc, value) => acc + value.mod_lb_hrs, 0) + .filter((item) => item.mod_lbr_ty === "LAU") + .reduce((acc, value) => acc + value.mod_lb_hrs, 0), }, rate_atp: { rate: shoprates.rate_atp || 0, hours: jobLines .filter( - item => + (item) => item.mod_lbr_ty !== "LA1" && item.mod_lbr_ty !== "LA2" && item.mod_lbr_ty !== "LA3" && @@ -131,28 +154,33 @@ function CalculateRatesTotals(ratesList, shoprates) { item.mod_lbr_ty !== "LAS" && item.mod_lbr_ty !== "LAA" ) - .reduce((acc, value) => acc + value.mod_lb_hrs, 0) + .reduce((acc, value) => acc + value.mod_lb_hrs, 0), }, paint_mat: { rate: ratesList.rate_mapa, hours: jobLines - .filter(item => item.mod_lbr_ty === "LAR") - .reduce((acc, value) => acc + value.mod_lb_hrs, 0) + .filter((item) => item.mod_lbr_ty === "LAR") + .reduce((acc, value) => acc + value.mod_lb_hrs, 0), }, shop_mat: { rate: ratesList.rate_mash, hours: jobLines - .filter(item => item.mod_lbr_ty !== "LAR") - .reduce((acc, value) => acc + value.mod_lb_hrs, 0) - } + .filter((item) => item.mod_lbr_ty !== "LAR") + .reduce((acc, value) => acc + value.mod_lb_hrs, 0), + }, }; let subtotal = 0; + let rates_subtotal = 0; for (const property in ret) { ret[property].total = ret[property].hours * ret[property].rate; subtotal = subtotal + ret[property].hours * ret[property].rate; + if (property !== "paint_mat" && property !== "shop_mat") + rates_subtotal = + rates_subtotal + ret[property].hours * ret[property].rate; } ret.subtotal = subtotal; + ret.rates_subtotal = rates_subtotal; return ret; } @@ -173,9 +201,9 @@ function CalculatePartsTotals(jobLines) { ...acc, parts: { ...acc.parts, - subtotal: acc.parts.subtotal + value.act_price + subtotal: acc.parts.subtotal + value.act_price, //TODO Add Adjustments in - } + }, }; case "PAS": case "PASL": @@ -183,9 +211,9 @@ function CalculatePartsTotals(jobLines) { ...acc, sublets: { ...acc.sublets, - subtotal: acc.sublets.subtotal + value.act_price + subtotal: acc.sublets.subtotal + value.act_price, //TODO Add Adjustments in - } + }, }; default: return acc; @@ -193,7 +221,7 @@ function CalculatePartsTotals(jobLines) { }, { parts: { subtotal: 0, adjustments: 0, total: 0 }, - sublets: { subtotal: 0, adjustments: 0, total: 0 } + sublets: { subtotal: 0, adjustments: 0, total: 0 }, } ); @@ -201,8 +229,8 @@ function CalculatePartsTotals(jobLines) { parts: { ...ret.parts, total: ret.parts.subtotal + ret.parts.adjustments }, sublets: { ...ret.sublets, - total: ret.sublets.subtotal + ret.sublets.adjustments - } + total: ret.sublets.subtotal + ret.sublets.adjustments, + }, }; } @@ -217,6 +245,6 @@ function CalculateCustPayable(job) { 0 + job.federal_tax_payable || 0 + job.other_amount_payable || 0 + job.depreciation_taxes || - 0 + 0, }; } diff --git a/client/src/graphql/jobs.queries.js b/client/src/graphql/jobs.queries.js index 0d6b8a6d0..cddfd6ae9 100644 --- a/client/src/graphql/jobs.queries.js +++ b/client/src/graphql/jobs.queries.js @@ -402,6 +402,13 @@ export const QUERY_JOB_FINANCIALS = gql` federal_tax_rate state_tax_rate local_tax_rate + tax_tow_rt + tax_str_rt + tax_paint_mat_rt + tax_sub_rt + tax_lbr_rt + tax_levies_rt + parts_tax_rates rate_atp rate_la1 rate_la2 diff --git a/hasura/migrations/1586365217566_alter_table_public_jobs_add_column_parts_tax_rates/down.yaml b/hasura/migrations/1586365217566_alter_table_public_jobs_add_column_parts_tax_rates/down.yaml new file mode 100644 index 000000000..9f7a0cd30 --- /dev/null +++ b/hasura/migrations/1586365217566_alter_table_public_jobs_add_column_parts_tax_rates/down.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."jobs" DROP COLUMN "parts_tax_rates"; + type: run_sql diff --git a/hasura/migrations/1586365217566_alter_table_public_jobs_add_column_parts_tax_rates/up.yaml b/hasura/migrations/1586365217566_alter_table_public_jobs_add_column_parts_tax_rates/up.yaml new file mode 100644 index 000000000..e5a499ab2 --- /dev/null +++ b/hasura/migrations/1586365217566_alter_table_public_jobs_add_column_parts_tax_rates/up.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."jobs" ADD COLUMN "parts_tax_rates" jsonb NULL; + type: run_sql diff --git a/hasura/migrations/1586365232521_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1586365232521_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..4715fb662 --- /dev/null +++ b/hasura/migrations/1586365232521_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,252 @@ +- 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 + - cieca_stl + - cieca_ttl + - ciecaid + - 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 + - depreciation_taxes + - 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 + - invoice_date + - 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 + - pay_amt + - pay_chknm + - pay_date + - pay_type + - payee_nms + - plate_no + - plate_st + - po_number + - policy_no + - rate_atp + - 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 + - statusid + - storage_payable + - tax_lbr_rt + - tax_levies_rt + - tax_paint_mat_rt + - tax_predis + - tax_prethr + - tax_pstthr + - 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 + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: jobs + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1586365232521_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1586365232521_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..43bf2e0ab --- /dev/null +++ b/hasura/migrations/1586365232521_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,253 @@ +- 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 + - cieca_stl + - cieca_ttl + - ciecaid + - 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 + - depreciation_taxes + - 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 + - invoice_date + - 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 + - rate_atp + - 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 + - statusid + - storage_payable + - tax_lbr_rt + - tax_levies_rt + - tax_paint_mat_rt + - tax_predis + - tax_prethr + - tax_pstthr + - 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 + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: jobs + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1586365248281_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1586365248281_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..cf9388142 --- /dev/null +++ b/hasura/migrations/1586365248281_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,250 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + 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 + - cieca_stl + - cieca_ttl + - ciecaid + - 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 + - depreciation_taxes + - 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 + - invoice_date + - 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 + - pay_amt + - pay_chknm + - pay_date + - pay_type + - payee_nms + - plate_no + - plate_st + - po_number + - policy_no + - rate_atp + - 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 + - statusid + - storage_payable + - tax_lbr_rt + - tax_levies_rt + - tax_paint_mat_rt + - tax_predis + - tax_prethr + - tax_pstthr + - 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/1586365248281_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1586365248281_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..1f52ac4cf --- /dev/null +++ b/hasura/migrations/1586365248281_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,251 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + 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 + - cieca_stl + - cieca_ttl + - ciecaid + - 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 + - depreciation_taxes + - 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 + - invoice_date + - 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 + - rate_atp + - 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 + - statusid + - storage_payable + - tax_lbr_rt + - tax_levies_rt + - tax_paint_mat_rt + - tax_predis + - tax_prethr + - tax_pstthr + - 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/1586365257227_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1586365257227_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..87f60eed1 --- /dev/null +++ b/hasura/migrations/1586365257227_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,252 @@ +- 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 + - cieca_stl + - cieca_ttl + - ciecaid + - 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 + - depreciation_taxes + - 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 + - invoice_date + - 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 + - pay_amt + - pay_chknm + - pay_date + - pay_type + - payee_nms + - plate_no + - plate_st + - po_number + - policy_no + - rate_atp + - 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 + - statusid + - storage_payable + - tax_lbr_rt + - tax_levies_rt + - tax_paint_mat_rt + - tax_predis + - tax_prethr + - tax_pstthr + - 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 + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: jobs + schema: public + type: create_update_permission diff --git a/hasura/migrations/1586365257227_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1586365257227_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..68a2a7ed5 --- /dev/null +++ b/hasura/migrations/1586365257227_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,253 @@ +- 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 + - cieca_stl + - cieca_ttl + - ciecaid + - 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 + - depreciation_taxes + - 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 + - invoice_date + - 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 + - rate_atp + - 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 + - statusid + - storage_payable + - tax_lbr_rt + - tax_levies_rt + - tax_paint_mat_rt + - tax_predis + - tax_prethr + - tax_pstthr + - 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 + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: jobs + schema: public + type: create_update_permission diff --git a/jsconfig.json b/jsconfig.json new file mode 100644 index 000000000..9c5c96413 --- /dev/null +++ b/jsconfig.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "target": "ES6", + "module": "commonjs", + "allowSyntheticDefaultImports": true + }, + "exclude": [ + "dist", + "node_modules" + ] +} \ No newline at end of file