From fe49161718002f78934574bc54501389faf95cbc Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Mon, 15 May 2023 15:18:24 -0700 Subject: [PATCH 1/8] IO-2258 Scoreboard Chart Add in target paint and body to the overall calculation to bump the start value up to the target instead of zero. --- .../scoreboard-chart/scoreboard-chart.component.jsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/client/src/components/scoreboard-chart/scoreboard-chart.component.jsx b/client/src/components/scoreboard-chart/scoreboard-chart.component.jsx index 802697a02..545030397 100644 --- a/client/src/components/scoreboard-chart/scoreboard-chart.component.jsx +++ b/client/src/components/scoreboard-chart/scoreboard-chart.component.jsx @@ -1,5 +1,6 @@ -import Dinero from "dinero.js"; import { Card } from "antd"; +import Dinero from "dinero.js"; +import _ from "lodash"; import moment from "moment"; import React from "react"; import { connect } from "react-redux"; @@ -18,7 +19,6 @@ import { import { createStructuredSelector } from "reselect"; import { selectBodyshop } from "../../redux/user/user.selectors"; import * as Utils from "../scoreboard-targets-table/scoreboard-targets-table.util"; -import _ from "lodash"; import CustomTooltip from "./chart-custom-tooltip"; const graphProps = { @@ -71,7 +71,9 @@ export function ScoreboardChart({ sbEntriesByDate, bodyshop }) { bodyshop.scoreboard_target.dailyBodyTarget + bodyshop.scoreboard_target.dailyPaintTarget, val - ), + ) + + bodyshop.scoreboard_target.dailyBodyTarget + + bodyshop.scoreboard_target.dailyPaintTarget, 1 ), accHrs: _.round( From 2c80c8119728867ffe58f2252e68bab786274371 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Wed, 17 May 2023 07:38:49 -0700 Subject: [PATCH 2/8] Added tasks presets to database schema. --- hasura/metadata/tables.yaml | 2 ++ .../down.sql | 4 ++++ .../up.sql | 2 ++ 3 files changed, 8 insertions(+) create mode 100644 hasura/migrations/1684251223317_alter_table_public_bodyshops_add_column_md_tasks_presets/down.sql create mode 100644 hasura/migrations/1684251223317_alter_table_public_bodyshops_add_column_md_tasks_presets/up.sql diff --git a/hasura/metadata/tables.yaml b/hasura/metadata/tables.yaml index b49797a78..ebed06a7c 100644 --- a/hasura/metadata/tables.yaml +++ b/hasura/metadata/tables.yaml @@ -941,6 +941,7 @@ - md_referral_sources - md_responsibility_centers - md_ro_statuses + - md_tasks_presets - md_to_emails - messagingservicesid - pbs_configuration @@ -1038,6 +1039,7 @@ - md_referral_sources - md_responsibility_centers - md_ro_statuses + - md_tasks_presets - md_to_emails - pbs_configuration - phone diff --git a/hasura/migrations/1684251223317_alter_table_public_bodyshops_add_column_md_tasks_presets/down.sql b/hasura/migrations/1684251223317_alter_table_public_bodyshops_add_column_md_tasks_presets/down.sql new file mode 100644 index 000000000..df054809e --- /dev/null +++ b/hasura/migrations/1684251223317_alter_table_public_bodyshops_add_column_md_tasks_presets/down.sql @@ -0,0 +1,4 @@ +-- Could not auto-generate a down migration. +-- Please write an appropriate down migration for the SQL below: +-- alter table "public"."bodyshops" add column "md_tasks_presets" jsonb +-- not null default jsonb_build_object(); diff --git a/hasura/migrations/1684251223317_alter_table_public_bodyshops_add_column_md_tasks_presets/up.sql b/hasura/migrations/1684251223317_alter_table_public_bodyshops_add_column_md_tasks_presets/up.sql new file mode 100644 index 000000000..a9439a13e --- /dev/null +++ b/hasura/migrations/1684251223317_alter_table_public_bodyshops_add_column_md_tasks_presets/up.sql @@ -0,0 +1,2 @@ +alter table "public"."bodyshops" add column "md_tasks_presets" jsonb + not null default jsonb_build_object(); From f5533075870084d06fb0d65c9983a2cb8450665b Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Wed, 17 May 2023 10:11:27 -0700 Subject: [PATCH 3/8] Added rounding to job costing for adjustments. --- server/job/job-costing.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/job/job-costing.js b/server/job/job-costing.js index 33ae5722b..2096ac7d1 100644 --- a/server/job/job-costing.js +++ b/server/job/job-costing.js @@ -840,7 +840,9 @@ function GenerateCostingData(job) { //Push adjustments to bottom line. if (job.adjustment_bottom_line) { //Add to totals. - const Adjustment = Dinero({ amount: job.adjustment_bottom_line * 100 }); //Need to invert, since this is being assigned as a cost. + const Adjustment = Dinero({ + amount: Math.round(job.adjustment_bottom_line * 100), + }); //Need to invert, since this is being assigned as a cost. summaryData.totalLaborSales = summaryData.totalLaborSales.add(Adjustment); summaryData.totalSales = summaryData.totalSales.add(Adjustment); //Add to lines. From 5e36a4ae89e751b0ce725efe30a79386c06f362c Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Wed, 17 May 2023 12:09:21 -0700 Subject: [PATCH 4/8] IO-2275 Remove PVRT and GST References in USA App. --- .../jobs-convert-button.component.jsx | 16 +++-- .../jobs-create-jobs-info.component.jsx | 16 +++-- .../jobs-detail-rates.component.jsx | 68 ++++++++++--------- 3 files changed, 55 insertions(+), 45 deletions(-) diff --git a/client/src/components/jobs-convert-button/jobs-convert-button.component.jsx b/client/src/components/jobs-convert-button/jobs-convert-button.component.jsx index 108a3e89f..b48deb3b5 100644 --- a/client/src/components/jobs-convert-button/jobs-convert-button.component.jsx +++ b/client/src/components/jobs-convert-button/jobs-convert-button.component.jsx @@ -219,13 +219,15 @@ export function JobsConvertButton({ )} - - - + {bodyshop.region_config.toLowerCase().startsWith("ca") && ( + + + + )} - - - + {bodyshop.region_config.toLowerCase().startsWith("ca") && ( + + + + )} - - - - - + {bodyshop.region_config.toLowerCase().startsWith("ca") && ( + + + + + + )} - - - - - - + {bodyshop.region_config === "CA_BC" && ( + + + + + + + )} - - - + {bodyshop.region_config.toLowerCase().startsWith("ca") && ( + + + + )} Date: Wed, 17 May 2023 12:36:15 -0700 Subject: [PATCH 5/8] IO-2286 Resolve duplication of cost centers when sorting labor allocations. --- .../labor-allocations-table.component.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 88cd67a45..3c264dafc 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 @@ -207,7 +207,7 @@ export function LaborAllocationsTable({ `${record.cost_center} ${record.mod_lbr_ty}`} pagination={false} onChange={handleTableChange} dataSource={totals} From e36904794b53b8018d427ccd0985a3b2015e967b Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Wed, 17 May 2023 13:31:15 -0700 Subject: [PATCH 6/8] IO-2274 Add typing to notes. --- bodyshop_translations.babel | 1290 ++++++++++++++++- .../jobs-notes/jobs.notes.component.jsx | 23 +- .../note-upsert-modal.component.jsx | 34 +- client/src/graphql/notes.queries.js | 3 + client/src/translations/en_us/common.json | 93 +- client/src/translations/es/common.json | 86 ++ client/src/translations/fr/common.json | 86 ++ hasura/metadata/tables.yaml | 3 + .../down.sql | 4 + .../up.sql | 2 + 10 files changed, 1616 insertions(+), 8 deletions(-) create mode 100644 hasura/migrations/1684353031975_alter_table_public_notes_add_column_type/down.sql create mode 100644 hasura/migrations/1684353031975_alter_table_public_notes_add_column_type/up.sql diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 1d299f13f..b52de475e 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -1,4 +1,4 @@ - +