diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel
index 23707d6e7..f453df8c6 100644
--- a/bodyshop_translations.babel
+++ b/bodyshop_translations.babel
@@ -8864,6 +8864,27 @@
+
+ tt_enforce_hours_for_tech_console
+ false
+
+
+
+
+
+ en-US
+ false
+
+
+ es-MX
+ false
+
+
+ fr-CA
+ false
+
+
+
use_fippa
false
@@ -17310,6 +17331,27 @@
+
+ total
+ false
+
+
+
+
+
+ en-US
+ false
+
+
+ es-MX
+ false
+
+
+ fr-CA
+ false
+
+
+
totals
false
@@ -33806,6 +33848,27 @@
errors
+
+ deleting
+ false
+
+
+
+
+
+ en-US
+ false
+
+
+ es-MX
+ false
+
+
+ fr-CA
+ false
+
+
+
noaccess
false
@@ -34367,6 +34430,27 @@
+
+ deleteconfirm
+ false
+
+
+
+
+
+ en-US
+ false
+
+
+ es-MX
+ false
+
+
+ fr-CA
+ false
+
+
+
existing_owners
false
@@ -34477,6 +34561,27 @@
successes
+
+ delete
+ false
+
+
+
+
+
+ en-US
+ false
+
+
+ es-MX
+ false
+
+
+ fr-CA
+ false
+
+
+
save
false
@@ -44980,6 +45085,27 @@
+
+ hoursenteredmorethanavailable
+ false
+
+
+
+
+
+ en-US
+ false
+
+
+ es-MX
+ false
+
+
+ fr-CA
+ false
+
+
+
@@ -47292,6 +47418,27 @@
errors
+
+ deleting
+ false
+
+
+
+
+
+ en-US
+ false
+
+
+ es-MX
+ false
+
+
+ fr-CA
+ false
+
+
+
noaccess
false
@@ -47916,6 +48063,27 @@
labels
+
+ deleteconfirm
+ false
+
+
+
+
+
+ en-US
+ false
+
+
+ es-MX
+ false
+
+
+ fr-CA
+ false
+
+
+
fromvehicle
false
@@ -48005,6 +48173,27 @@
successes
+
+ delete
+ false
+
+
+
+
+
+ en-US
+ false
+
+
+ es-MX
+ false
+
+
+ fr-CA
+ false
+
+
+
save
false
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 2ce5b4a0b..d236de913 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
@@ -6,10 +6,6 @@ export const CalculateAllocationsTotals = (
timetickets,
adjustments = []
) => {
- console.log(
- "🚀 ~ file: labor-allocations-table.utility.js ~ line 9 ~ adjustments",
- adjustments
- );
const responsibilitycenters = bodyshop.md_responsibility_centers;
const jobCodes = joblines.map((item) => item.mod_lbr_ty);
//.filter((value, index, self) => self.indexOf(value) === index && !!value);
diff --git a/client/src/components/production-list-columns/production-list-columns.data.js b/client/src/components/production-list-columns/production-list-columns.data.js
index bd2f15817..7d122200d 100644
--- a/client/src/components/production-list-columns/production-list-columns.data.js
+++ b/client/src/components/production-list-columns/production-list-columns.data.js
@@ -91,11 +91,13 @@ const r = ({ technician, state, activeStatuses, bodyshop }) => {
b.v_make_desc + b.v_model_desc
),
sortOrder:
- state.sortedInfo.columnKey === "ownr" && state.sortedInfo.order,
+ state.sortedInfo.columnKey === "vehicle" && state.sortedInfo.order,
render: (text, record) => (
- {`${record.v_model_yr || ""} ${record.v_make_desc || ""} ${
- record.v_model_desc || ""
- } ${record.v_color || ""} ${record.plate_no || ""}`}
+ {`${
+ record.v_model_yr || ""
+ } ${record.v_make_desc || ""} ${record.v_model_desc || ""} ${
+ record.v_color || ""
+ } ${record.plate_no || ""}`}
),
},
{
diff --git a/client/src/components/production-list-table/production-list-table.component.jsx b/client/src/components/production-list-table/production-list-table.component.jsx
index 6595476d5..746d956ab 100644
--- a/client/src/components/production-list-table/production-list-table.component.jsx
+++ b/client/src/components/production-list-table/production-list-table.component.jsx
@@ -81,7 +81,7 @@ export function ProductionListTable({
state,
activeStatuses: bodyshop.md_ro_statuses.active_statuses,
}).find((e) => e.key === k.key),
- width: k.width,
+ width: k.width ?? 100,
};
})) ||
[]
@@ -267,6 +267,8 @@ export function ProductionListTable({
sortOrder:
state.sortedInfo.columnKey === c.key && state.sortedInfo.order,
title: headerItem(c),
+ ellipsis: true,
+ width: c.width ?? 100,
onHeaderCell: (column) => ({
width: column.width,
onResize: handleResize(index),
@@ -276,11 +278,12 @@ export function ProductionListTable({
rowKey="id"
loading={loading}
dataSource={dataSource}
- // scroll={{ x: true }}
+ scroll={{ x: 1000 }}
onChange={handleTableChange}
/>
);
}
+
export default connect(mapStateToProps, null)(ProductionListTable);
diff --git a/client/src/components/production-list-table/production-list-table.resizeable.component.jsx b/client/src/components/production-list-table/production-list-table.resizeable.component.jsx
index 2f1324999..618e9e8cd 100644
--- a/client/src/components/production-list-table/production-list-table.resizeable.component.jsx
+++ b/client/src/components/production-list-table/production-list-table.resizeable.component.jsx
@@ -3,8 +3,26 @@ import { Resizable } from "react-resizable";
export default function ResizableComponent(props) {
const { onResize, width, ...restProps } = props;
+
+ if (!width) {
+ return | ;
+ }
+
return (
-
+ {
+ e.stopPropagation();
+ }}
+ />
+ }
+ >
|
);
diff --git a/client/src/components/scoreboard-day-stats/scoreboard-day-stats.component.jsx b/client/src/components/scoreboard-day-stats/scoreboard-day-stats.component.jsx
index 36b4a028b..cfd6d945d 100644
--- a/client/src/components/scoreboard-day-stats/scoreboard-day-stats.component.jsx
+++ b/client/src/components/scoreboard-day-stats/scoreboard-day-stats.component.jsx
@@ -1,4 +1,4 @@
-import { Card, Statistic } from "antd";
+import { Card, Divider, Statistic } from "antd";
import moment from "moment";
import React from "react";
import { connect } from "react-redux";
@@ -41,6 +41,9 @@ export function ScoreboardDayStats({ bodyshop, date, entries }) {
label="P"
value={paintHrs.toFixed(1)}
/>
+
+
+
);
}
diff --git a/client/src/components/scoreboard-targets-table/scoreboard-targets-table.component.jsx b/client/src/components/scoreboard-targets-table/scoreboard-targets-table.component.jsx
index 6f22b3b8a..112d441f6 100644
--- a/client/src/components/scoreboard-targets-table/scoreboard-targets-table.component.jsx
+++ b/client/src/components/scoreboard-targets-table/scoreboard-targets-table.component.jsx
@@ -1,5 +1,5 @@
import { CalendarOutlined } from "@ant-design/icons";
-import { Card, Col, Row, Statistic } from "antd";
+import { Card, Col, Divider, Row, Statistic } from "antd";
import _ from "lodash";
import moment from "moment";
import React, { useMemo } from "react";
@@ -177,6 +177,9 @@ export function ScoreboardTargetsTable({ bodyshop, scoreBoardlist }) {
+
+
+
@@ -184,14 +187,53 @@ export function ScoreboardTargetsTable({ bodyshop, scoreBoardlist }) {
value={(values.todayPaint + values.todayBody).toFixed(1)}
/>
-
+
+
+
-
-
+
+
+
+
+
+
{
@@ -94,6 +95,7 @@ export default function ScoreboardTimeTickets() {
totalLastMonth: 0,
totalOverPeriod: 0,
actualTotalOverPeriod: 0,
+ totalEffieciencyOverPeriod: 0,
};
}
@@ -221,6 +223,32 @@ export default function ScoreboardTimeTickets() {
ret2.push(r);
});
+ console.log(
+ "🚀 ~ file: scoreboard-timetickets.component.jsx:238 ~ calculatedData ~ ret:",
+ ret
+ );
+
+ // Add total efficiency of employees
+ const totalActualAndProductive = Object.keys(ret.employees)
+ .map((key) => {
+ return { employee_number: key, ...ret.employees[key] };
+ })
+ .reduce(
+ (acc, e) => {
+ return {
+ totalOverPeriod: acc.totalOverPeriod + e.totalOverPeriod,
+ actualTotalOverPeriod:
+ acc.actualTotalOverPeriod + e.actualTotalOverPeriod,
+ };
+ },
+ { totalOverPeriod: 0, actualTotalOverPeriod: 0 }
+ );
+
+ ret.totalEffieciencyOverPeriod =
+ (totalActualAndProductive.totalOverPeriod /
+ totalActualAndProductive.actualTotalOverPeriod) *
+ 100;
+
roundObject(ret);
roundObject(totals);
roundObject(ret2);
diff --git a/client/src/components/scoreboard-timetickets/scoreboard-timetickets.stats.component.jsx b/client/src/components/scoreboard-timetickets/scoreboard-timetickets.stats.component.jsx
index 0b1b9b6bf..e31cec3af 100644
--- a/client/src/components/scoreboard-timetickets/scoreboard-timetickets.stats.component.jsx
+++ b/client/src/components/scoreboard-timetickets/scoreboard-timetickets.stats.component.jsx
@@ -62,7 +62,7 @@ export function ScoreboardTicketsStats({ data, bodyshop }) {
key: "efficiencyoverperiod",
render: (text, record) =>
`${(
- (record.totalOverPeriod / (record.actualTotalOverPeriod || .1)) *
+ (record.totalOverPeriod / (record.actualTotalOverPeriod || 0.1)) *
100
).toFixed(1)} %`,
},
@@ -113,6 +113,12 @@ export function ScoreboardTicketsStats({ data, bodyshop }) {
value={data.totalOverPeriod}
/>
+
+
+
{t("scoreboard.labels.calendarperiod")}
@@ -121,7 +127,7 @@ export function ScoreboardTicketsStats({ data, bodyshop }) {
+
+
+
e.id === (technician && technician.id)
@@ -129,6 +141,54 @@ export function TechClockOffButton({
required: true,
//message: t("general.validation.required"),
},
+ ({ getFieldValue }) => ({
+ validator(rule, value) {
+ console.log(
+ bodyshop.tt_enforce_hours_for_tech_console
+ );
+ if (!bodyshop.tt_enforce_hours_for_tech_console) {
+ return Promise.resolve();
+ }
+ if (
+ !value ||
+ getFieldValue("cost_center") === null ||
+ !lineTicketData
+ )
+ return Promise.resolve();
+
+ //Check the cost center,
+ const totals = CalculateAllocationsTotals(
+ bodyshop,
+ lineTicketData.joblines,
+ lineTicketData.timetickets,
+ lineTicketData.jobs_by_pk.lbr_adjustments
+ );
+
+ const fieldTypeToCheck =
+ bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber
+ ? "mod_lbr_ty"
+ : "cost_center";
+
+ const costCenterDiff =
+ Math.round(
+ totals.find(
+ (total) =>
+ total[fieldTypeToCheck] ===
+ getFieldValue("cost_center")
+ )?.difference * 10
+ ) / 10;
+
+ if (value > costCenterDiff)
+ return Promise.reject(
+ t(
+ "timetickets.validation.hoursenteredmorethanavailable"
+ )
+ );
+ else {
+ return Promise.resolve();
+ }
+ },
+ }),
]}
>
@@ -178,7 +238,11 @@ export function TechClockOffButton({
{!isShiftTicket && (
-
+
)}
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 6f61fccf0..a72322851 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
@@ -1,4 +1,4 @@
-import { useQuery } from "@apollo/client";
+import { useLazyQuery } from "@apollo/client";
import { Form, Input, InputNumber, Select, Switch } from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
@@ -14,6 +14,7 @@ import FormDatePicker from "../form-date-picker/form-date-picker.component";
import FormDateTimePicker from "../form-date-time-picker/form-date-time-picker.component";
import JobSearchSelect from "../job-search-select/job-search-select.component";
import LaborAllocationsTable from "../labor-allocations-table/labor-allocations-table.component";
+import { CalculateAllocationsTotals } from "../labor-allocations-table/labor-allocations-table.utility";
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component";
import { HasRbacAccess } from "../rbac-wrapper/rbac-wrapper.component";
@@ -38,7 +39,11 @@ export function TimeTicketModalComponent({
employeeSelectDisabled,
}) {
const { t } = useTranslation();
-
+ const [loadLineTicketData, { called, loading, data: lineTicketData }] =
+ useLazyQuery(GET_LINE_TICKET_BY_PK, {
+ fetchPolicy: "network-only",
+ nextFetchPolicy: "network-only",
+ });
const CostCenterSelect = ({ emps, value, ...props }) => {
return (
- {() => (
-
- )}
+ {() => {
+ const jobid = form.getFieldValue("jobid");
+ if (
+ (!called && jobid) ||
+ (jobid && lineTicketData?.jobs_by_pk?.id !== jobid && !loading)
+ ) {
+ loadLineTicketData({ variables: { id: jobid } });
+ }
+ return (
+
+ );
+ }}
);
}
-export function LaborAllocationContainer({ jobid }) {
- const { loading, data: lineTicketData } = useQuery(GET_LINE_TICKET_BY_PK, {
- variables: { id: jobid },
- skip: !jobid,
- fetchPolicy: "network-only",
- nextFetchPolicy: "network-only",
- });
+export function LaborAllocationContainer({ jobid, loading, lineTicketData }) {
if (loading) return ;
if (!lineTicketData) return null;
return (
diff --git a/client/src/graphql/bodyshop.queries.js b/client/src/graphql/bodyshop.queries.js
index 956bf9dd4..c934c9514 100644
--- a/client/src/graphql/bodyshop.queries.js
+++ b/client/src/graphql/bodyshop.queries.js
@@ -116,6 +116,7 @@ export const QUERY_BODYSHOP = gql`
md_lost_sale_reasons
md_parts_scan
enforce_conversion_category
+ tt_enforce_hours_for_tech_console
employees {
user_email
id
@@ -230,6 +231,7 @@ export const UPDATE_SHOP = gql`
md_lost_sale_reasons
md_parts_scan
enforce_conversion_category
+ tt_enforce_hours_for_tech_console
employees {
id
first_name
diff --git a/client/src/graphql/jobs.queries.js b/client/src/graphql/jobs.queries.js
index dce7aff66..a6273edc4 100644
--- a/client/src/graphql/jobs.queries.js
+++ b/client/src/graphql/jobs.queries.js
@@ -284,6 +284,7 @@ export const QUERY_JOBS_IN_PRODUCTION = gql`
clm_no
v_make_desc
v_color
+ vehicleid
plate_no
actual_in
scheduled_completion
diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json
index d3bdcdcbf..f01d1a186 100644
--- a/client/src/translations/en_us/common.json
+++ b/client/src/translations/en_us/common.json
@@ -541,6 +541,7 @@
"target_touchtime": "Target Touch Time",
"timezone": "Timezone",
"tt_allow_post_to_invoiced": "Allow Time Tickets to be posted to Invoiced & Exported Jobs",
+ "tt_enforce_hours_for_tech_console": "Restrict Claimable hours from Tech Console",
"use_fippa": "Use FIPPA for Names on Generated Documents?",
"uselocalmediaserver": "Use Local Media Server?",
"website": "Website",
@@ -1063,6 +1064,7 @@
"sunday": "Sunday",
"text": "Text",
"thursday": "Thursday",
+ "total": "Total",
"totals": "Totals",
"tuesday": "Tuesday",
"unknown": "Unknown",
@@ -2661,7 +2663,8 @@
},
"validation": {
"clockoffmustbeafterclockon": "Clock off time must be the same or after clock in time.",
- "clockoffwithoutclockon": "Clock off time cannot be set without a clock in time."
+ "clockoffwithoutclockon": "Clock off time cannot be set without a clock in time.",
+ "hoursenteredmorethanavailable": "The number of hours entered is more than what is available for this cost center."
}
},
"titles": {
diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json
index 7f0385f80..552b080a2 100644
--- a/client/src/translations/es/common.json
+++ b/client/src/translations/es/common.json
@@ -541,6 +541,7 @@
"target_touchtime": "",
"timezone": "",
"tt_allow_post_to_invoiced": "",
+ "tt_enforce_hours_for_tech_console": "",
"use_fippa": "",
"uselocalmediaserver": "",
"website": "",
@@ -1063,6 +1064,7 @@
"sunday": "",
"text": "",
"thursday": "",
+ "total": "",
"totals": "",
"tuesday": "",
"unknown": "Desconocido",
@@ -2661,7 +2663,8 @@
},
"validation": {
"clockoffmustbeafterclockon": "",
- "clockoffwithoutclockon": ""
+ "clockoffwithoutclockon": "",
+ "hoursenteredmorethanavailable": ""
}
},
"titles": {
diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json
index 172a44d34..40d15a480 100644
--- a/client/src/translations/fr/common.json
+++ b/client/src/translations/fr/common.json
@@ -541,6 +541,7 @@
"target_touchtime": "",
"timezone": "",
"tt_allow_post_to_invoiced": "",
+ "tt_enforce_hours_for_tech_console": "",
"use_fippa": "",
"uselocalmediaserver": "",
"website": "",
@@ -1063,6 +1064,7 @@
"sunday": "",
"text": "",
"thursday": "",
+ "total": "",
"totals": "",
"tuesday": "",
"unknown": "Inconnu",
@@ -2661,7 +2663,8 @@
},
"validation": {
"clockoffmustbeafterclockon": "",
- "clockoffwithoutclockon": ""
+ "clockoffwithoutclockon": "",
+ "hoursenteredmorethanavailable": ""
}
},
"titles": {
diff --git a/hasura/metadata/tables.yaml b/hasura/metadata/tables.yaml
index a576c160e..a456a9a0f 100644
--- a/hasura/metadata/tables.yaml
+++ b/hasura/metadata/tables.yaml
@@ -761,6 +761,13 @@
table:
name: email_audit_trail
schema: public
+ - name: employee_teams
+ using:
+ foreign_key_constraint_on:
+ column: bodyshopid
+ table:
+ name: employee_teams
+ schema: public
- name: employees
using:
foreign_key_constraint_on:
@@ -928,6 +935,7 @@
- textid
- timezone
- tt_allow_post_to_invoiced
+ - tt_enforce_hours_for_tech_console
- updated_at
- use_fippa
- uselocalmediaserver
@@ -1016,6 +1024,7 @@
- target_touchtime
- timezone
- tt_allow_post_to_invoiced
+ - tt_enforce_hours_for_tech_console
- updated_at
- use_fippa
- uselocalmediaserver
@@ -1945,6 +1954,165 @@
- active:
_eq: true
check: null
+- table:
+ name: employee_team_members
+ schema: public
+ object_relationships:
+ - name: employee
+ using:
+ foreign_key_constraint_on: employeeid
+ - name: employee_team
+ using:
+ foreign_key_constraint_on: teamid
+ insert_permissions:
+ - role: user
+ permission:
+ check:
+ employee_team:
+ bodyshop:
+ associations:
+ _and:
+ - user:
+ authid:
+ _eq: X-Hasura-User-Id
+ - active:
+ _eq: true
+ columns:
+ - labor_rates
+ - percentage
+ - created_at
+ - updated_at
+ - employeeid
+ - id
+ - teamid
+ select_permissions:
+ - role: user
+ permission:
+ columns:
+ - labor_rates
+ - percentage
+ - created_at
+ - updated_at
+ - employeeid
+ - id
+ - teamid
+ filter:
+ employee_team:
+ bodyshop:
+ associations:
+ _and:
+ - user:
+ authid:
+ _eq: X-Hasura-User-Id
+ - active:
+ _eq: true
+ update_permissions:
+ - role: user
+ permission:
+ columns:
+ - labor_rates
+ - percentage
+ - created_at
+ - updated_at
+ - employeeid
+ - id
+ - teamid
+ filter:
+ employee_team:
+ bodyshop:
+ associations:
+ _and:
+ - user:
+ authid:
+ _eq: X-Hasura-User-Id
+ - active:
+ _eq: true
+ check: null
+ delete_permissions:
+ - role: user
+ permission:
+ backend_only: false
+ filter:
+ employee_team:
+ bodyshop:
+ associations:
+ _and:
+ - user:
+ authid:
+ _eq: X-Hasura-User-Id
+ - active:
+ _eq: true
+- table:
+ name: employee_teams
+ schema: public
+ object_relationships:
+ - name: bodyshop
+ using:
+ foreign_key_constraint_on: bodyshopid
+ array_relationships:
+ - name: employee_team_members
+ using:
+ foreign_key_constraint_on:
+ column: teamid
+ table:
+ name: employee_team_members
+ schema: public
+ insert_permissions:
+ - role: user
+ permission:
+ check:
+ bodyshop:
+ associations:
+ _and:
+ - user:
+ authid:
+ _eq: X-Hasura-User-Id
+ - active:
+ _eq: true
+ columns:
+ - active
+ - name
+ - created_at
+ - updated_at
+ - bodyshopid
+ - id
+ select_permissions:
+ - role: user
+ permission:
+ columns:
+ - active
+ - name
+ - created_at
+ - updated_at
+ - bodyshopid
+ - id
+ filter:
+ bodyshop:
+ associations:
+ _and:
+ - user:
+ authid:
+ _eq: X-Hasura-User-Id
+ - active:
+ _eq: true
+ update_permissions:
+ - role: user
+ permission:
+ columns:
+ - active
+ - bodyshopid
+ - name
+ - updated_at
+ filter:
+ bodyshop:
+ associations:
+ _and:
+ - user:
+ authid:
+ _eq: X-Hasura-User-Id
+ - active:
+ _eq: true
+ check: null
- table:
name: employee_vacation
schema: public
@@ -2045,6 +2213,13 @@
table:
name: allocations
schema: public
+ - name: employee_team_members
+ using:
+ foreign_key_constraint_on:
+ column: employeeid
+ table:
+ name: employee_team_members
+ schema: public
- name: employee_vacations
using:
foreign_key_constraint_on:
@@ -2218,30 +2393,32 @@
- active:
_eq: true
columns:
- - id
- - created_at
- - updated_at
- - jobid
- billid
+ - bodyshopid
+ - created_at
+ - id
+ - jobid
+ - message
+ - metadata
- paymentid
- successful
- - message
- - bodyshopid
+ - updated_at
- useremail
select_permissions:
- role: user
permission:
columns:
- - successful
- - message
- - useremail
- - created_at
- - updated_at
- billid
- bodyshopid
+ - created_at
- id
- jobid
+ - message
+ - metadata
- paymentid
+ - successful
+ - updated_at
+ - useremail
filter:
bodyshop:
associations:
@@ -2493,6 +2670,7 @@
_eq: true
columns:
- act_price
+ - act_price_before_ppc
- ah_detail_line
- alt_co_id
- alt_overrd
@@ -2559,6 +2737,7 @@
permission:
columns:
- act_price
+ - act_price_before_ppc
- ah_detail_line
- alt_co_id
- alt_overrd
@@ -2637,6 +2816,7 @@
permission:
columns:
- act_price
+ - act_price_before_ppc
- ah_detail_line
- alt_co_id
- alt_overrd
diff --git a/hasura/migrations/1679343513178_alter_table_public_joblines_add_column_act_price_before_ppc/down.sql b/hasura/migrations/1679343513178_alter_table_public_joblines_add_column_act_price_before_ppc/down.sql
new file mode 100644
index 000000000..641b06fc4
--- /dev/null
+++ b/hasura/migrations/1679343513178_alter_table_public_joblines_add_column_act_price_before_ppc/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"."joblines" add column "act_price_before_ppc" numeric
+-- null;
diff --git a/hasura/migrations/1679343513178_alter_table_public_joblines_add_column_act_price_before_ppc/up.sql b/hasura/migrations/1679343513178_alter_table_public_joblines_add_column_act_price_before_ppc/up.sql
new file mode 100644
index 000000000..c817ce67a
--- /dev/null
+++ b/hasura/migrations/1679343513178_alter_table_public_joblines_add_column_act_price_before_ppc/up.sql
@@ -0,0 +1,2 @@
+alter table "public"."joblines" add column "act_price_before_ppc" numeric
+ null;
diff --git a/hasura/migrations/1681155844658_create_table_public_employee_teams/down.sql b/hasura/migrations/1681155844658_create_table_public_employee_teams/down.sql
new file mode 100644
index 000000000..1639caf73
--- /dev/null
+++ b/hasura/migrations/1681155844658_create_table_public_employee_teams/down.sql
@@ -0,0 +1 @@
+DROP TABLE "public"."employee_teams";
diff --git a/hasura/migrations/1681155844658_create_table_public_employee_teams/up.sql b/hasura/migrations/1681155844658_create_table_public_employee_teams/up.sql
new file mode 100644
index 000000000..994e15280
--- /dev/null
+++ b/hasura/migrations/1681155844658_create_table_public_employee_teams/up.sql
@@ -0,0 +1,18 @@
+CREATE TABLE "public"."employee_teams" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "created_at" timestamptz NOT NULL DEFAULT now(), "updated_at" timestamptz NOT NULL DEFAULT now(), "bodyshopid" uuid NOT NULL, "name" text NOT NULL, "active" boolean NOT NULL DEFAULT true, PRIMARY KEY ("id") , FOREIGN KEY ("bodyshopid") REFERENCES "public"."bodyshops"("id") ON UPDATE cascade ON DELETE cascade);
+CREATE OR REPLACE FUNCTION "public"."set_current_timestamp_updated_at"()
+RETURNS TRIGGER AS $$
+DECLARE
+ _new record;
+BEGIN
+ _new := NEW;
+ _new."updated_at" = NOW();
+ RETURN _new;
+END;
+$$ LANGUAGE plpgsql;
+CREATE TRIGGER "set_public_employee_teams_updated_at"
+BEFORE UPDATE ON "public"."employee_teams"
+FOR EACH ROW
+EXECUTE PROCEDURE "public"."set_current_timestamp_updated_at"();
+COMMENT ON TRIGGER "set_public_employee_teams_updated_at" ON "public"."employee_teams"
+IS 'trigger to set value of column "updated_at" to current timestamp on row update';
+CREATE EXTENSION IF NOT EXISTS pgcrypto;
diff --git a/hasura/migrations/1681156265693_create_table_public_employee_team_members/down.sql b/hasura/migrations/1681156265693_create_table_public_employee_team_members/down.sql
new file mode 100644
index 000000000..14ab424ce
--- /dev/null
+++ b/hasura/migrations/1681156265693_create_table_public_employee_team_members/down.sql
@@ -0,0 +1 @@
+DROP TABLE "public"."employee_team_members";
diff --git a/hasura/migrations/1681156265693_create_table_public_employee_team_members/up.sql b/hasura/migrations/1681156265693_create_table_public_employee_team_members/up.sql
new file mode 100644
index 000000000..e6a32938f
--- /dev/null
+++ b/hasura/migrations/1681156265693_create_table_public_employee_team_members/up.sql
@@ -0,0 +1,18 @@
+CREATE TABLE "public"."employee_team_members" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "created_at" timestamptz NOT NULL DEFAULT now(), "updated_at" timestamptz NOT NULL DEFAULT now(), "teamid" uuid NOT NULL, "employeeid" uuid NOT NULL, "labor_rates" jsonb NOT NULL DEFAULT jsonb_build_object(), "percentage" numeric NOT NULL DEFAULT 0, PRIMARY KEY ("id") , FOREIGN KEY ("teamid") REFERENCES "public"."employee_teams"("id") ON UPDATE cascade ON DELETE cascade, FOREIGN KEY ("employeeid") REFERENCES "public"."employees"("id") ON UPDATE cascade ON DELETE cascade);
+CREATE OR REPLACE FUNCTION "public"."set_current_timestamp_updated_at"()
+RETURNS TRIGGER AS $$
+DECLARE
+ _new record;
+BEGIN
+ _new := NEW;
+ _new."updated_at" = NOW();
+ RETURN _new;
+END;
+$$ LANGUAGE plpgsql;
+CREATE TRIGGER "set_public_employee_team_members_updated_at"
+BEFORE UPDATE ON "public"."employee_team_members"
+FOR EACH ROW
+EXECUTE PROCEDURE "public"."set_current_timestamp_updated_at"();
+COMMENT ON TRIGGER "set_public_employee_team_members_updated_at" ON "public"."employee_team_members"
+IS 'trigger to set value of column "updated_at" to current timestamp on row update';
+CREATE EXTENSION IF NOT EXISTS pgcrypto;
diff --git a/hasura/migrations/1681329377686_alter_table_public_exportlog_add_column_metadata/down.sql b/hasura/migrations/1681329377686_alter_table_public_exportlog_add_column_metadata/down.sql
new file mode 100644
index 000000000..3c175e747
--- /dev/null
+++ b/hasura/migrations/1681329377686_alter_table_public_exportlog_add_column_metadata/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"."exportlog" add column "metadata" jsonb
+-- null;
diff --git a/hasura/migrations/1681329377686_alter_table_public_exportlog_add_column_metadata/up.sql b/hasura/migrations/1681329377686_alter_table_public_exportlog_add_column_metadata/up.sql
new file mode 100644
index 000000000..621b8481c
--- /dev/null
+++ b/hasura/migrations/1681329377686_alter_table_public_exportlog_add_column_metadata/up.sql
@@ -0,0 +1,2 @@
+alter table "public"."exportlog" add column "metadata" jsonb
+ null;
diff --git a/hasura/migrations/1681331289298_alter_table_public_bodyshops_add_column_tt_enforce_hours_for_tech_console/down.sql b/hasura/migrations/1681331289298_alter_table_public_bodyshops_add_column_tt_enforce_hours_for_tech_console/down.sql
new file mode 100644
index 000000000..53e7608da
--- /dev/null
+++ b/hasura/migrations/1681331289298_alter_table_public_bodyshops_add_column_tt_enforce_hours_for_tech_console/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 "tt_enforce_hours_for_tech_console" boolean
+-- not null default 'false';
diff --git a/hasura/migrations/1681331289298_alter_table_public_bodyshops_add_column_tt_enforce_hours_for_tech_console/up.sql b/hasura/migrations/1681331289298_alter_table_public_bodyshops_add_column_tt_enforce_hours_for_tech_console/up.sql
new file mode 100644
index 000000000..86e0f5973
--- /dev/null
+++ b/hasura/migrations/1681331289298_alter_table_public_bodyshops_add_column_tt_enforce_hours_for_tech_console/up.sql
@@ -0,0 +1,2 @@
+alter table "public"."bodyshops" add column "tt_enforce_hours_for_tech_console" boolean
+ not null default 'false';
diff --git a/server/accounting/pbs/pbs-job-export.js b/server/accounting/pbs/pbs-job-export.js
index ee0b3c8a8..cfbe71a19 100644
--- a/server/accounting/pbs/pbs-job-export.js
+++ b/server/accounting/pbs/pbs-job-export.js
@@ -249,10 +249,10 @@ async function QueryCustomersFromDms(socket) {
SerialNumber: socket.JobData.bodyshop.pbs_serialnumber,
//ContactId: "00000000000000000000000000000000",
// ContactCode: socket.JobData.owner.accountingid,
- FirstName: socket.JobData.ownr_co_nm
+ FirstName: socket.JobData.ownr_fn,
+ LastName: socket.JobData.ownr_co_nm
? socket.JobData.ownr_co_nm
- : socket.JobData.ownr_fn,
- LastName: socket.JobData.ownr_ln,
+ : socket.JobData.ownr_ln,
PhoneNumber: socket.JobData.ownr_ph1,
EmailAddress: socket.JobData.ownr_ea,
// ModifiedSince: "0001-01-01T00:00:00.0000000Z",
diff --git a/server/cdk/cdk-job-export.js b/server/cdk/cdk-job-export.js
index d5fb6b295..3987d21bc 100644
--- a/server/cdk/cdk-job-export.js
+++ b/server/cdk/cdk-job-export.js
@@ -224,6 +224,7 @@ async function CdkSelectedCustomer(socket, selectedCustomerId) {
} finally {
//Ensure we always insert logEvents
//GQL to insert logevents.
+
CdkBase.createLogEvent(
socket,
"DEBUG",
@@ -1213,6 +1214,7 @@ async function GenerateTransWips(socket) {
wips.push(item);
});
+ socket.transWips = wips;
return wips;
}
@@ -1388,6 +1390,7 @@ async function MarkJobExported(socket, jobid) {
jobid: jobid,
successful: true,
useremail: socket.user.email,
+ metadata: socket.transWips,
},
bill: {
exported: true,