e.id === technician.id)[0];
return (
@@ -53,7 +59,7 @@ export function TechClockInComponent({ form, bodyshop, technician }) {
{item.cost_center === "timetickets.labels.shift"
? t(item.cost_center)
- : bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber
+ : bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || Enhanced_Payroll.treatment === "on"
? t(
`joblines.fields.lbr_types.${item.cost_center.toUpperCase()}`
)
diff --git a/client/src/components/tech-job-clock-in-form/tech-job-clock-in-form.container.jsx b/client/src/components/tech-job-clock-in-form/tech-job-clock-in-form.container.jsx
index 7754c07f2..693c685a9 100644
--- a/client/src/components/tech-job-clock-in-form/tech-job-clock-in-form.container.jsx
+++ b/client/src/components/tech-job-clock-in-form/tech-job-clock-in-form.container.jsx
@@ -1,21 +1,26 @@
import { useMutation } from "@apollo/client";
import { Button, Card, Form, notification, Space } from "antd";
import axios from "axios";
+import moment from "moment";
import React, { useState } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { INSERT_NEW_TIME_TICKET } from "../../graphql/timetickets.queries";
-import { selectTechnician } from "../../redux/tech/tech.selectors";
-import { selectBodyshop } from "../../redux/user/user.selectors";
-import TechClockInComponent from "./tech-job-clock-in-form.component";
-import TechJobPrintTickets from "../tech-job-print-tickets/tech-job-print-tickets.component";
-import moment from "moment";
import { setModalContext } from "../../redux/modals/modals.actions";
+import { selectTechnician } from "../../redux/tech/tech.selectors";
+import {
+ selectBodyshop,
+ selectCurrentUser,
+} from "../../redux/user/user.selectors";
+import TechJobPrintTickets from "../tech-job-print-tickets/tech-job-print-tickets.component";
+import TechClockInComponent from "./tech-job-clock-in-form.component";
+import { useTreatments } from "@splitsoftware/splitio-react";
const mapStateToProps = createStructuredSelector({
technician: selectTechnician,
bodyshop: selectBodyshop,
+ currentUser: selectCurrentUser,
});
const mapDispatchToProps = (dispatch) => ({
setTimeTicketContext: (context) =>
@@ -25,10 +30,12 @@ export function TechClockInContainer({
setTimeTicketContext,
technician,
bodyshop,
+ currentUser,
}) {
- console.log(
- "🚀 ~ file: tech-job-clock-in-form.container.jsx:29 ~ technician:",
- technician
+ const { Enhanced_Payroll } = useTreatments(
+ ["Enhanced_Payroll"],
+ {},
+ bodyshop.imexshopid
);
const [form] = Form.useForm();
const [loading, setLoading] = useState(false);
@@ -56,7 +63,7 @@ export function TechClockInContainer({
jobid: values.jobid,
cost_center: values.cost_center,
ciecacode:
- bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber
+ bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || Enhanced_Payroll.treatment === 'on'
? values.cost_center
: Object.keys(
bodyshop.md_responsibility_centers.defaults.costs
@@ -66,6 +73,12 @@ export function TechClockInContainer({
values.cost_center
);
}),
+ created_by: currentUser.email.concat(
+ " | ",
+ technician.employee_number
+ .concat(" ", technician.first_name, " ", technician.last_name)
+ .trim()
+ ),
},
],
},
@@ -100,6 +113,17 @@ export function TechClockInContainer({
employeeid: technician.id,
flat_rate: emps.flat_rate,
},
+ created_by: currentUser.email.concat(
+ " | ",
+ technician.employee_number
+ .concat(
+ " ",
+ technician.first_name,
+ " ",
+ technician.last_name
+ )
+ .trim()
+ ),
},
});
}}
diff --git a/client/src/components/tech-job-clock-out-button/tech-job-clock-out-button.component.jsx b/client/src/components/tech-job-clock-out-button/tech-job-clock-out-button.component.jsx
index d1c5c3528..321ef903d 100644
--- a/client/src/components/tech-job-clock-out-button/tech-job-clock-out-button.component.jsx
+++ b/client/src/components/tech-job-clock-out-button/tech-job-clock-out-button.component.jsx
@@ -24,6 +24,7 @@ import { selectBodyshop } from "../../redux/user/user.selectors";
import { CalculateAllocationsTotals } from "../labor-allocations-table/labor-allocations-table.utility";
import TechJobClockoutDelete from "../tech-job-clock-out-delete/tech-job-clock-out-delete.component";
import { LaborAllocationContainer } from "../time-ticket-modal/time-ticket-modal.component";
+import { useTreatments } from "@splitsoftware/splitio-react";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
@@ -43,6 +44,12 @@ export function TechClockOffButton({
const [updateTimeticket] = useMutation(UPDATE_TIME_TICKET);
const [updateJobStatus] = useMutation(UPDATE_JOB_STATUS);
const [form] = Form.useForm();
+ const { Enhanced_Payroll } = useTreatments(
+ ["Enhanced_Payroll"],
+ {},
+ bodyshop.imexshopid
+ );
+
const { queryLoading, data: lineTicketData } = useQuery(
GET_LINE_TICKET_BY_PK,
{
@@ -76,7 +83,9 @@ export function TechClockOffButton({
?.rate,
flat_rate: emps && emps.flat_rate,
ciecacode:
- bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber
+ bodyshop.cdk_dealerid ||
+ bodyshop.pbs_serialnumber ||
+ Enhanced_Payroll.treatment === "on"
? values.cost_center
: Object.keys(
bodyshop.md_responsibility_centers.defaults.costs
diff --git a/client/src/components/tech-sider/tech-sider.component.jsx b/client/src/components/tech-sider/tech-sider.component.jsx
index ec68cd0f9..49f2487dc 100644
--- a/client/src/components/tech-sider/tech-sider.component.jsx
+++ b/client/src/components/tech-sider/tech-sider.component.jsx
@@ -1,6 +1,7 @@
import Icon, {
SearchOutlined,
ScheduleOutlined,
+ UserAddOutlined,
CarOutlined,
} from "@ant-design/icons";
import { Layout, Menu } from "antd";
@@ -72,19 +73,28 @@ export function TechSider({
{t("menus.tech.joblookup")}
{Enhanced_Payroll.treatment === "on" ? (
- }
- onClick={() => {
- setTimeTicketTaskContext({
- actions: {},
- context: { jobid: null },
- });
- }}
- >
- {t("menus.tech.claimtask")}
-
+ <>
+ }
+ >
+ {t("menus.tech.assignedjobs")}
+
+ }
+ onClick={() => {
+ setTimeTicketTaskContext({
+ actions: {},
+ context: { jobid: null },
+ });
+ }}
+ >
+ {t("menus.tech.claimtask")}
+
+ >
) : (
{t("menus.tech.productionboard")}
- }
- >
- {t("menus.tech.assignedjobs")}
-
+
({
setTimeTicketTaskContext: (context) =>
@@ -34,6 +36,7 @@ export function TimeTicketList({
bodyshop,
setTimeTicketTaskContext,
authLevel,
+ currentUser,
disabled,
loading,
timetickets,
@@ -238,7 +241,15 @@ export function TimeTicketList({
},
},
]),
-
+ {
+ title: t("timetickets.fields.created_by"),
+ dataIndex: "created_by",
+ key: "created_by",
+ sorter: (a, b) => alphaSort(a.created_by, b.created_by),
+ sortOrder:
+ state.sortedInfo.columnKey === "created_by" && state.sortedInfo.order,
+ render: (text, record) => record.created_by,
+ },
// {
// title: "Pay",
// dataIndex: "pay",
@@ -326,7 +337,12 @@ export function TimeTicketList({
(techConsole ? null : (
{t("timetickets.actions.enter")}
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 fcf4ac4e8..2325e4e66 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
@@ -20,6 +20,7 @@ import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component";
import { HasRbacAccess } from "../rbac-wrapper/rbac-wrapper.component";
import TimeTicketList from "../time-ticket-list/time-ticket-list.component";
import TimeTicketCalculatorComponent from "../time-ticket-calculator/time-ticket-calculator.component";
+import { useTreatments } from "@splitsoftware/splitio-react";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
@@ -41,6 +42,11 @@ export function TimeTicketModalComponent({
employeeSelectDisabled,
}) {
const { t } = useTranslation();
+ const { Enhanced_Payroll } = useTreatments(
+ ["Enhanced_Payroll"],
+ {},
+ bodyshop.imexshopid
+ );
const [loadLineTicketData, { called, loading, data: lineTicketData }] =
useLazyQuery(GET_LINE_TICKET_BY_PK, {
fetchPolicy: "network-only",
@@ -58,7 +64,7 @@ export function TimeTicketModalComponent({
{item.cost_center === "timetickets.labels.shift"
? t(item.cost_center)
- : bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber
+ : bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || Enhanced_Payroll.treatment === 'on'
? t(
`joblines.fields.lbr_types.${item.cost_center.toUpperCase()}`
)
diff --git a/client/src/components/time-ticket-modal/time-ticket-modal.container.jsx b/client/src/components/time-ticket-modal/time-ticket-modal.container.jsx
index 4ae2913b6..ca8726893 100644
--- a/client/src/components/time-ticket-modal/time-ticket-modal.container.jsx
+++ b/client/src/components/time-ticket-modal/time-ticket-modal.container.jsx
@@ -1,5 +1,5 @@
import { useMutation, useQuery } from "@apollo/client";
-import { Button, Form, Modal, notification, PageHeader, Space } from "antd";
+import { Button, Form, Modal, PageHeader, Space, notification } from "antd";
import moment from "moment";
import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
@@ -15,6 +15,7 @@ import { selectTimeTicket } from "../../redux/modals/modals.selectors";
import { selectBodyshop } from "../../redux/user/user.selectors";
import TimeTicketModalComponent from "./time-ticket-modal.component";
import TimeTicketsCommitToggleComponent from "../time-tickets-commit-toggle/time-tickets-commit-toggle.component";
+import { useTreatments } from "@splitsoftware/splitio-react";
const mapStateToProps = createStructuredSelector({
timeTicketModal: selectTimeTicket,
@@ -35,7 +36,11 @@ export function TimeTicketModalContainer({
const [enterAgain, setEnterAgain] = useState(false);
const [insertTicket] = useMutation(INSERT_NEW_TIME_TICKET);
const [updateTicket] = useMutation(UPDATE_TIME_TICKET);
-
+ const { Enhanced_Payroll } = useTreatments(
+ ["Enhanced_Payroll"],
+ {},
+ bodyshop.imexshopid
+ );
const { data: EmployeeAutoCompleteData } = useQuery(QUERY_ACTIVE_EMPLOYEES, {
skip: !timeTicketModal.visible,
fetchPolicy: "network-only",
@@ -78,6 +83,7 @@ export function TimeTicketModalContainer({
)[0].rate
: null,
bodyshopid: bodyshop.id,
+ created_by: timeTicketModal.context.created_by,
},
],
},
@@ -147,7 +153,7 @@ export function TimeTicketModalContainer({
if (!!changedFields.cost_center && !!EmployeeAutoCompleteData) {
form.setFieldsValue({
ciecacode:
- bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber
+ bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || Enhanced_Payroll.treatments === 'on'
? changedFields.cost_center
: Object.keys(
bodyshop.md_responsibility_centers.defaults.costs
diff --git a/client/src/components/time-ticket-shift-form/time-ticket-shift-form.container.jsx b/client/src/components/time-ticket-shift-form/time-ticket-shift-form.container.jsx
index 3234039f9..4ec7ae140 100644
--- a/client/src/components/time-ticket-shift-form/time-ticket-shift-form.container.jsx
+++ b/client/src/components/time-ticket-shift-form/time-ticket-shift-form.container.jsx
@@ -65,6 +65,21 @@ export function TimeTicektShiftContainer({
clockon: theTime,
date: theTime,
memo: values.memo,
+ created_by: isTechConsole
+ ? currentUser.email.concat(
+ " | ",
+ technician.employee_number
+ .concat(
+ " ",
+ technician.first_name,
+ " ",
+ technician.last_name
+ )
+ .trim()
+ )
+ : currentUser.displayName
+ ? currentUser.email.concat(" | ", currentUser.displayName)
+ : currentUser.email,
},
],
},
diff --git a/client/src/components/time-ticket-task-modal/time-ticket-task-modal.component.jsx b/client/src/components/time-ticket-task-modal/time-ticket-task-modal.component.jsx
index 4b2ddc76b..fc45add0d 100644
--- a/client/src/components/time-ticket-task-modal/time-ticket-task-modal.component.jsx
+++ b/client/src/components/time-ticket-task-modal/time-ticket-task-modal.component.jsx
@@ -74,7 +74,7 @@ export function TimeTicketTaskModalComponent({
{() => {
const { task } = form.getFieldsValue();
- const theTaskPreset = bodyshop.md_tasks_presets.presets.find(
+ const theTaskPreset = bodyshop.md_tasks_presets?.presets?.find(
(tp) => tp.name === task
);
diff --git a/client/src/graphql/jobs-lines.queries.js b/client/src/graphql/jobs-lines.queries.js
index 13fd03412..47c382054 100644
--- a/client/src/graphql/jobs-lines.queries.js
+++ b/client/src/graphql/jobs-lines.queries.js
@@ -57,6 +57,7 @@ export const GET_LINE_TICKET_BY_PK = gql`
actualhrs
ciecacode
cost_center
+ created_by
date
id
jobid
diff --git a/client/src/graphql/timetickets.queries.js b/client/src/graphql/timetickets.queries.js
index 969b3ec18..35c54f28f 100644
--- a/client/src/graphql/timetickets.queries.js
+++ b/client/src/graphql/timetickets.queries.js
@@ -39,6 +39,7 @@ export const QUERY_TIME_TICKETS_IN_RANGE = gql`
clockon
cost_center
created_at
+ created_by
date
id
rate
@@ -85,6 +86,7 @@ export const QUERY_TIME_TICKETS_TECHNICIAN_IN_RANGE = gql`
clockon
cost_center
created_at
+ created_by
date
id
rate
@@ -119,6 +121,7 @@ export const QUERY_TIME_TICKETS_TECHNICIAN_IN_RANGE = gql`
clockon
cost_center
created_at
+ created_by
date
id
rate
@@ -160,6 +163,7 @@ export const QUERY_TIME_TICKETS_IN_RANGE_SB = gql`
clockon
cost_center
created_at
+ created_by
date
id
rate
@@ -194,6 +198,7 @@ export const QUERY_TIME_TICKETS_IN_RANGE_SB = gql`
clockon
cost_center
created_at
+ created_by
date
id
rate
@@ -223,6 +228,7 @@ export const INSERT_NEW_TIME_TICKET = gql`
insert_timetickets(objects: $timeTicketInput) {
returning {
id
+ created_by
clockon
clockoff
employeeid
diff --git a/client/src/pages/tech-assigned-prod-jobs/tech-assigned-prod-jobs.component.jsx b/client/src/pages/tech-assigned-prod-jobs/tech-assigned-prod-jobs.component.jsx
index b971bd368..65b71f409 100644
--- a/client/src/pages/tech-assigned-prod-jobs/tech-assigned-prod-jobs.component.jsx
+++ b/client/src/pages/tech-assigned-prod-jobs/tech-assigned-prod-jobs.component.jsx
@@ -178,7 +178,7 @@ export function TechAssignedProdJobs({
},
},
{
- title: t("jobs.labels.actions"),
+ title: t("general.labels.actions"),
dataIndex: "actions",
key: "actions",
render: (text, record) => (
diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json
index 6b708787e..beafdd55a 100644
--- a/client/src/translations/en_us/common.json
+++ b/client/src/translations/en_us/common.json
@@ -2755,6 +2755,7 @@
"deleting": "Error deleting time ticket. {{message}}",
"noemployeeforuser": "Unable to use Shift Clock",
"noemployeeforuser_sub": "An employee record has not been created for this user. Please create one before using the shift clock. ",
+ "payall": "Error flagging hours. {{error}}",
"shiftalreadyclockedon": "You are already clocked onto a shift. Unable to create shift entry."
},
"fields": {
@@ -2765,6 +2766,7 @@
"clockon": "Clocked In",
"committed": "Committed",
"cost_center": "Cost Center",
+ "created_by": "Created By",
"date": "Ticket Date",
"efficiency": "Efficiency",
"employee": "Employee",
@@ -2805,7 +2807,8 @@
"clockedout": "Clocked out successfully.",
"committed": "Time Tickets Committed Successfully",
"created": "Time ticket entered successfully.",
- "deleted": "Time ticket deleted successfully."
+ "deleted": "Time ticket deleted successfully.",
+ "payall": "All hours paid out successfully."
},
"validation": {
"clockoffmustbeafterclockon": "Clock off time must be the same or after clock in time.",
diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json
index 771ba8750..0239ac1d0 100644
--- a/client/src/translations/es/common.json
+++ b/client/src/translations/es/common.json
@@ -2755,6 +2755,7 @@
"deleting": "",
"noemployeeforuser": "",
"noemployeeforuser_sub": "",
+ "payall": "",
"shiftalreadyclockedon": ""
},
"fields": {
@@ -2765,6 +2766,7 @@
"clockon": "",
"committed": "",
"cost_center": "",
+ "created_by": "",
"date": "",
"efficiency": "",
"employee": "",
@@ -2805,7 +2807,8 @@
"clockedout": "",
"committed": "",
"created": "",
- "deleted": ""
+ "deleted": "",
+ "payall": ""
},
"validation": {
"clockoffmustbeafterclockon": "",
diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json
index 99bbc2254..a017932ac 100644
--- a/client/src/translations/fr/common.json
+++ b/client/src/translations/fr/common.json
@@ -2755,6 +2755,7 @@
"deleting": "",
"noemployeeforuser": "",
"noemployeeforuser_sub": "",
+ "payall": "",
"shiftalreadyclockedon": ""
},
"fields": {
@@ -2765,6 +2766,7 @@
"clockon": "",
"committed": "",
"cost_center": "",
+ "created_by": "",
"date": "",
"efficiency": "",
"employee": "",
@@ -2805,7 +2807,8 @@
"clockedout": "",
"committed": "",
"created": "",
- "deleted": ""
+ "deleted": "",
+ "payall": ""
},
"validation": {
"clockoffmustbeafterclockon": "",
diff --git a/client/src/utils/TemplateConstants.js b/client/src/utils/TemplateConstants.js
index e9e8e9b6a..65989ac84 100644
--- a/client/src/utils/TemplateConstants.js
+++ b/client/src/utils/TemplateConstants.js
@@ -1049,7 +1049,7 @@ export const TemplateList = (type, context) => {
disabled: false,
rangeFilter: {
object: i18n.t("reportcenter.labels.objects.jobs"),
- field: i18n.t("jobs.fields.date_open"),
+ field: i18n.t("jobs.fields.date_invoiced"),
},
group: "jobs",
},
diff --git a/hasura/metadata/tables.yaml b/hasura/metadata/tables.yaml
index a24db9297..2e44c4b14 100644
--- a/hasura/metadata/tables.yaml
+++ b/hasura/metadata/tables.yaml
@@ -5556,6 +5556,7 @@
- committed_at
- cost_center
- created_at
+ - created_by
- date
- employeeid
- flat_rate
@@ -5580,6 +5581,7 @@
- committed_at
- cost_center
- created_at
+ - created_by
- date
- employeeid
- flat_rate
@@ -5613,6 +5615,7 @@
- committed_at
- cost_center
- created_at
+ - created_by
- date
- employeeid
- flat_rate
diff --git a/hasura/migrations/1691614820968_alter_table_public_timetickets_add_column_created_by/down.sql b/hasura/migrations/1691614820968_alter_table_public_timetickets_add_column_created_by/down.sql
new file mode 100644
index 000000000..1877b51f0
--- /dev/null
+++ b/hasura/migrations/1691614820968_alter_table_public_timetickets_add_column_created_by/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"."timetickets" add column "created_by" text
+-- null;
diff --git a/hasura/migrations/1691614820968_alter_table_public_timetickets_add_column_created_by/up.sql b/hasura/migrations/1691614820968_alter_table_public_timetickets_add_column_created_by/up.sql
new file mode 100644
index 000000000..927b24b87
--- /dev/null
+++ b/hasura/migrations/1691614820968_alter_table_public_timetickets_add_column_created_by/up.sql
@@ -0,0 +1,2 @@
+alter table "public"."timetickets" add column "created_by" text
+ null;
diff --git a/server/graphql-client/queries.js b/server/graphql-client/queries.js
index 731d317ff..413855caf 100644
--- a/server/graphql-client/queries.js
+++ b/server/graphql-client/queries.js
@@ -656,6 +656,7 @@ exports.QUERY_EMPLOYEE_PIN = `query QUERY_EMPLOYEE_PIN($shopId: uuid!, $employee
employee_number
id
pin
+ active
}
}`;
diff --git a/server/payroll/pay-all.js b/server/payroll/pay-all.js
index 81f8ff9d5..935c7d566 100644
--- a/server/payroll/pay-all.js
+++ b/server/payroll/pay-all.js
@@ -32,7 +32,7 @@ exports.payall = async function (req, res) {
const { employeeHash, assignmentHash } = CalculateExpectedHoursForJob(job);
const ticketHash = CalculateTicketsHoursForJob(job);
if (assignmentHash.unassigned > 0) {
- res.json({ success: false, error: "Unassigned hours." });
+ res.json({ success: false, error: "Not all hours have been assigned." });
return;
}
@@ -65,7 +65,7 @@ exports.payall = async function (req, res) {
cost_center:
job.bodyshop.md_responsibility_centers.defaults.costs[key],
flat_rate: true,
- memo: `*SYS-PAY* Add unflagged hours. (${req.user.email})`,
+ memo: `Add unflagged hours. (${req.user.email})`,
});
});
} else {
@@ -83,7 +83,7 @@ exports.payall = async function (req, res) {
job.bodyshop.md_responsibility_centers.defaults.costs[
path.mod_lbr_ty
],
- memo: `*SYS-PAY* Add unflagged hours. (${req.user.email})`,
+ memo: `Add unflagged hours. (${req.user.email})`,
});
}
} else if (diff.op === "update") {
@@ -102,7 +102,7 @@ exports.payall = async function (req, res) {
job.bodyshop.md_responsibility_centers.defaults.costs[
path.mod_lbr_ty
],
- memo: `*SYS-PAY* Adjust flagged hours per assignment. (${req.user.email})`,
+ memo: `Adjust flagged hours per assignment. (${req.user.email})`,
});
} else {
//Has to be a delete
@@ -124,7 +124,7 @@ exports.payall = async function (req, res) {
cost_center:
job.bodyshop.md_responsibility_centers.defaults.costs[key],
flat_rate: true,
- memo: `*SYS-PAY* Remove flagged hours per assignment. (${req.user.email})`,
+ memo: `Remove flagged hours per assignment. (${req.user.email})`,
});
});
} else {
@@ -142,7 +142,7 @@ exports.payall = async function (req, res) {
path.mod_lbr_ty
],
flat_rate: true,
- memo: `*SYS-PAY* Remove flagged hours per assignment. (${req.user.email})`,
+ memo: `Remove flagged hours per assignment. (${req.user.email})`,
});
}
}
@@ -163,10 +163,10 @@ exports.payall = async function (req, res) {
jobid,
{
jobid: jobid,
- error,
+ error: JSON.stringify(error),
}
);
- res.status(503).send();
+ res.status(400).json({ error: error.message });
}
};
diff --git a/server/tech/tech.js b/server/tech/tech.js
index 6709deffc..51839e186 100644
--- a/server/tech/tech.js
+++ b/server/tech/tech.js
@@ -23,7 +23,7 @@ exports.techLogin = async (req, res) => {
let technician;
if (result.employees && result.employees[0]) {
const dbRecord = result.employees[0];
- if (dbRecord.pin === pin) {
+ if (dbRecord.pin === pin && dbRecord.active === true) {
valid = true;
delete dbRecord.pin;
technician = dbRecord;