Compare commits

...

13 Commits

Author SHA1 Message Date
Allan Carr
bb3d3fbe72 IO-2520 Change Logging back to default and adjust start and end to be default
Datapump will be run daily as per Sofia

Signed-off-by: Allan Carr <allan.carr@thinkimex.com>
2024-08-22 11:35:15 -07:00
Allan Carr
4fa0593bb5 Merge branch 'master-AIO' into feature/IO-2520-Kaizen-Data-Pump
Signed-off-by: Allan Carr <allan.carr@thinkimex.com>
2024-08-22 10:23:57 -07:00
Dave Richer
41517ca7d4 Merged in release/2024-08-23 (pull request #1653)
Release/2024 08 23
2024-08-22 14:44:29 +00:00
Dave Richer
35c9f649ad - Rollback ZOHO
Signed-off-by: Dave Richer <dave@imexsystems.ca>
2024-08-22 10:41:27 -04:00
Dave Richer
ad2f2e55a5 Merge branch 'feature/IO-2834-Enhance-DateTime-Picker' into release/2024-08-23 2024-08-21 21:09:17 -04:00
Dave Richer
41c446ddb3 - Checkpoint
Signed-off-by: Dave Richer <dave@imexsystems.ca>
2024-08-21 21:04:52 -04:00
Dave Richer
7d6aa8489d - Checkpoint
Signed-off-by: Dave Richer <dave@imexsystems.ca>
2024-08-21 20:49:50 -04:00
Allan Carr
63f1e0f07c IO-2834 Placeholder Translations
Signed-off-by: Allan Carr <allan.carr@thinkimex.com>
2024-08-21 15:44:00 -07:00
Dave Richer
98f4423624 - Checkpoint
Signed-off-by: Dave Richer <dave@imexsystems.ca>
2024-08-21 17:55:40 -04:00
Dave Richer
1ac4cbb59f Merged in feature/IO-2886-Product-List-Profiles (pull request #1647)
Feature/IO-2886 Product List Profiles
2024-08-21 20:51:47 +00:00
Allan Carr
24ebfbfbf5 Merged in feature/IO-2888-Production-Employee-Sort-Enhancment (pull request #1646)
IO-2888 Production List Employee Sort Enhacement

Approved-by: Dave Richer
2024-08-21 20:50:51 +00:00
Allan Carr
cc9979ff4b IO-2834 Split Date and DateTime formats, remove shorthand and checks
Signed-off-by: Allan Carr <allan.carr@thinkimex.com>
2024-08-21 12:25:38 -07:00
Allan Carr
ad1ce7b220 IO-2888 Production List Employee Sort Enhacement
Signed-off-by: Allan Carr <allan.carr@thinkimex.com>
2024-08-21 11:00:59 -07:00
8 changed files with 2330 additions and 2265 deletions

View File

@@ -46,23 +46,77 @@
<% } %> <% if (env.VITE_APP_INSTANCE === 'ROME') { %>
<meta name="description" content="Rome Online"/>
<title>Rome Online</title>
<script type="text/javascript" id="zsiqchat">
var $zoho = $zoho || {};
$zoho.salesiq = $zoho.salesiq || {
widgetcode: "siq01bb8ac617280bdacddfeb528f07734dadc64ef3f05efef9f769c1ec171af666",
values: {},
ready: function () {
}
};
var d = document;
s = d.createElement("script");
s.type = "text/javascript";
s.id = "zsiqscript";
s.defer = true;
s.src = "https://salesiq.zohopublic.com/widget";
t = d.getElementsByTagName("script")[0];
t.parentNode.insertBefore(s, t);
</script>
<!--Use the below code snippet to provide real time updates to the live chat plugin without the need of copying and paste each time to your website when changes are made via PBX-->
<call-us-selector phonesystem-url=https://rometech.east.3cx.us:5001
party="LiveChat528346"></call-us-selector>
<!--Incase you don't want real time updates to the live chat plugin when options are changed, use the below code snippet. Please note that each time you change the settings you will need to copy and paste the snippet code to your website-->
<!--<call-us
phonesystem-url=https://rometech.east.3cx.us:5001
style="position:fixed;font-size:16px;line-height:17px;z-index: 99999;right: 20px; bottom: 20px;"
id="wp-live-chat-by-3CX"
minimized="true"
animation-style="noanimation"
party="LiveChat528346"
minimized-style="bubbleright"
allow-call="true"
allow-video="false"
allow-soundnotifications="true"
enable-mute="true"
enable-onmobile="true"
offline-enabled="true"
enable="true"
ignore-queueownership="false"
authentication="both"
show-operator-actual-name="true"
aknowledge-received="true"
gdpr-enabled="false"
message-userinfo-format="name"
message-dateformat="both"
lang="browser"
button-icon-type="default"
greeting-visibility="none"
greeting-offline-visibility="none"
chat-delay="2000"
enable-direct-call="true"
enable-ga="false"
></call-us>-->
<script defer src=https://downloads-global.3cx.com/downloads/livechatandtalk/v1/callus.js
id="tcx-callus-js" charset="utf-8"></script>
<% } %> <% if (env.VITE_APP_INSTANCE === 'PROMANAGER') { %>
<title>ProManager</title>

View File

@@ -1,11 +1,13 @@
import React, { useCallback, useState } from "react";
import { DatePicker } from "antd";
import dayjs from "../../utils/day";
import { formats, shorthandFormats } from "./formats.js";
import PropTypes from "prop-types";
import React, { useCallback, useState } from "react";
import { useTranslation } from "react-i18next";
import dayjs from "../../utils/day";
import { dateFormats, dateTimeFormats } from "./formats.js";
const DateTimePicker = ({ value, onChange, onBlur, id, onlyFuture, onlyToday, isDateOnly = false, ...restProps }) => {
const [isManualInput, setIsManualInput] = useState(false);
const { t } = useTranslation();
const handleChange = useCallback(
(newDate) => {
@@ -19,6 +21,24 @@ const DateTimePicker = ({ value, onChange, onBlur, id, onlyFuture, onlyToday, is
[onChange]
);
const normalizeDateTimeString = (input) => {
const upperV = input.toUpperCase().replaceAll(".", "/").replaceAll("-", "/");
const [datePart, ...timeParts] = upperV.split(" ");
if (timeParts.length === 0) {
return datePart; // If there's no time part, just return the date part.
}
const timePart = timeParts.join(" "); // In case there are multiple spaces, join them back
// Normalize the time part by ensuring there's a space before AM/PM if not already present
const normalizedTime = timePart.replace(/(\d{1,2})(:\d{2})?\s?(AM|PM)/, "$1$2 $3");
// Combine the date part with the normalized time part
return `${datePart} ${normalizedTime}`.trim();
};
const handleBlur = useCallback(
(e) => {
if (!isManualInput) {
@@ -30,29 +50,21 @@ const DateTimePicker = ({ value, onChange, onBlur, id, onlyFuture, onlyToday, is
const v = e.target.value;
if (!v) return;
const upperV = v.toUpperCase();
const upperV = normalizeDateTimeString(v);
let parsedDate;
let _a;
for (const format of shorthandFormats) {
_a = dayjs(upperV, format);
if (_a.isValid()) break;
for (const format of isDateOnly ? dateFormats : dateTimeFormats) {
parsedDate = dayjs(upperV, format);
if (parsedDate.isValid()) break;
}
if (!_a || !_a.isValid()) {
for (const format of formats) {
_a = dayjs(upperV, format);
if (_a.isValid()) break;
}
}
if (_a && _a.isValid()) {
if (parsedDate && parsedDate.isValid()) {
if (isDateOnly) {
_a = _a.startOf("day");
parsedDate = parsedDate.startOf("day");
}
if (value && value.isValid && value.isValid()) {
_a.set({
parsedDate = parsedDate.set({
hours: value.hours(),
minutes: value.minutes(),
seconds: value.seconds(),
@@ -61,13 +73,13 @@ const DateTimePicker = ({ value, onChange, onBlur, id, onlyFuture, onlyToday, is
}
if (onlyFuture) {
if (dayjs().subtract(1, "day").isBefore(_a)) {
onChange(_a);
if (dayjs().subtract(1, "day").isBefore(parsedDate)) {
onChange(parsedDate);
} else {
onChange(dayjs().startOf("day"));
}
} else {
onChange(_a);
onChange(parsedDate);
}
}
},
@@ -79,6 +91,7 @@ const DateTimePicker = ({ value, onChange, onBlur, id, onlyFuture, onlyToday, is
setIsManualInput(true);
if (e.key.toLowerCase() === "t" && onChange) {
e.preventDefault();
setIsManualInput(false);
onChange(dayjs());
} else if (e.key.toLowerCase() === "enter") {
@@ -115,6 +128,7 @@ const DateTimePicker = ({ value, onChange, onBlur, id, onlyFuture, onlyToday, is
format={isDateOnly ? "MM/DD/YYYY" : "MM/DD/YYYY hh:mm a"}
value={value ? dayjs(value) : null}
onChange={handleChange}
placeholder={isDateOnly ? t("general.labels.date") : t("general.labels.datetime")}
onBlur={onBlur || handleBlur}
disabledDate={handleDisabledDate}
{...restProps}

View File

@@ -1,93 +1,96 @@
export const shorthandFormats = [
"M/D/YY hA",
"M/D/YY h:mmA",
"M/D/YYYY hA",
"M/D/YYYY h:mmA",
"M/D/YY ha",
"M/D/YY h:mma",
"M/D/YYYY ha",
"M/D/YYYY h:mma"
export const dateTimeFormats = [
// Four-digit year with time
"M/D/YYYY h:mm A", // Example: 1/5/2023 9:00 AM
"M/D/YYYY h:mmA", // Example: 1/5/2023 9:00AM
"M/D/YYYY h A", // Example: 1/5/2023 9 AM
"M/D/YYYY hA", // Example: 1/5/2023 9AM
"M/D/YYYY hh:mm A", // Example: 1/5/2023 02:25 PM
"M/D/YYYY hh:mm:ss A", // Example: 1/5/2023 02:25:45 PM
"MM/D/YYYY h:mm A", // Example: 12/5/2023 9:00 AM
"MM/D/YYYY h:mmA", // Example: 12/5/2023 9:00AM
"MM/D/YYYY h A", // Example: 12/5/2023 9 AM
"MM/D/YYYY hA", // Example: 12/5/2023 9AM
"MM/D/YYYY hh:mm A", // Example: 12/5/2023 02:25 PM
"MM/D/YYYY hh:mm:ss A", // Example: 12/5/2023 02:25:45 PM
"M/DD/YYYY h:mm A", // Example: 1/25/2023 9:00 AM
"M/DD/YYYY h:mmA", // Example: 1/25/2023 9:00AM
"M/DD/YYYY h A", // Example: 1/25/2023 9 AM
"M/DD/YYYY hA", // Example: 1/25/2023 9AM
"M/DD/YYYY hh:mm A", // Example: 1/25/2023 02:25 PM
"M/DD/YYYY hh:mm:ss A", // Example: 1/25/2023 02:25:45 PM
"MM/DD/YYYY h:mm A", // Example: 12/25/2023 9:00 AM
"MM/DD/YYYY h:mmA", // Example: 12/25/2023 9:00AM
"MM/DD/YYYY h A", // Example: 12/25/2023 9 AM
"MM/DD/YYYY hA", // Example: 12/25/2023 9AM
"MM/DD/YYYY hh:mm A", // Example: 12/25/2023 02:25 PM
"MM/DD/YYYY hh:mm:ss A", // Example: 12/25/2023 02:25:45 PM
// Two-digit year with time
"M/D/YY h:mm A", // Example: 1/5/23 9:00 AM
"M/D/YY h:mmA", // Example: 1/5/23 9:00AM
"M/D/YY h A", // Example: 1/5/23 9 AM
"M/D/YY hA", // Example: 1/5/23 9AM
"M/D/YY hh:mm A", // Example: 1/5/23 02:25 PM
"M/D/YY hh:mm:ss A", // Example: 1/5/23 02:25:45 PM
"MM/D/YY h:mm A", // Example: 12/5/23 9:00 AM
"MM/D/YY h:mmA", // Example: 12/5/23 9:00AM
"MM/D/YY h A", // Example: 12/5/23 9 AM
"MM/D/YY hA", // Example: 12/5/23 9AM
"MM/D/YY hh:mm A", // Example: 12/5/23 02:25 PM
"MM/D/YY hh:mm:ss A", // Example: 12/5/23 02:25:45 PM
"M/DD/YY h:mm A", // Example: 1/25/23 9:00 AM
"M/DD/YY h:mmA", // Example: 1/25/23 9:00AM
"M/DD/YY h A", // Example: 1/25/23 9 AM
"M/DD/YY hA", // Example: 1/25/23 9AM
"M/DD/YY hh:mm A", // Example: 1/25/23 02:25 PM
"M/DD/YY hh:mm:ss A", // Example: 1/25/23 02:25:45 PM
"MM/DD/YY h:mm A", // Example: 12/25/23 9:00 AM
"MM/DD/YY h:mmA", // Example: 12/25/23 9:00AM
"MM/DD/YY h A", // Example: 12/25/23 9 AM
"MM/DD/YY hA", // Example: 12/25/23 9AM
"MM/DD/YY hh:mm A", // Example: 12/25/23 02:25 PM
"MM/DD/YY hh:mm:ss A", // Example: 12/25/23 02:25:45 PM
// Four-digit year without time
"M/D/YYYY", // Example: 1/5/2023
"MM/D/YYYY", // Example: 12/5/2023
"M/DD/YYYY", // Example: 1/25/2023
"MM/DD/YYYY", // Example: 12/25/2023
// Two-digit year without time
"M/D/YY", // Example: 1/5/23
"MM/D/YY", // Example: 12/5/23
"M/DD/YY", // Example: 1/25/23
"MM/DD/YY" // Example: 12/25/23
];
export const formats = [
"MMDDYY",
// CONFIRMED
export const dateFormats = [
"MMDDYYYY",
"MM/DD/YY",
"MM/DD/YYYY",
"M/DD/YY",
"M/DD/YYYY",
"MM/D/YY",
"MM/D/YYYY",
"M/D/YY",
"M/D/YYYY",
"D/MM/YY",
"D/MM/YYYY",
"DD/M/YY",
"DD/M/YYYY",
"D/M/YY",
"D/M/YYYY",
"MMDDYY hh:mm A",
"MMDDYYYY hh:mm A",
"MM/DD/YY hh:mm A",
"MM/DD/YYYY hh:mm A",
"M/DD/YY hh:mm A",
"M/DD/YYYY hh:mm A",
"MM/D/YY hh:mm A",
"MM/D/YYYY hh:mm A",
"M/D/YY hh:mm A",
"M/D/YYYY hh:mm A",
"D/MM/YY hh:mm A",
"D/MM/YYYY hh:mm A",
"DD/M/YY hh:mm A",
"DD/M/YYYY hh:mm A",
"D/M/YY hh:mm A",
"D/M/YYYY hh:mm A",
"MMDDYY hh:mm:ss A",
"MMDDYYYY hh:mm:ss A",
"MM/DD/YY hh:mm:ss A",
"MM/DD/YYYY hh:mm:ss A",
"M/DD/YY hh:mm:ss A",
"M/DD/YYYY hh:mm:ss A",
"MM/D/YY hh:mm:ss A",
"MM/D/YYYY hh:mm:ss A",
"M/D/YY hh:mm:ss A",
"M/D/YYYY hh:mm:ss A",
"D/MM/YY hh:mm:ss A",
"D/MM/YYYY hh:mm:ss A",
"DD/M/YY hh:mm:ss A",
"DD/M/YYYY hh:mm:ss A",
"D/M/YY hh:mm:ss A",
"D/M/YYYY hh:mm:ss A",
"MMDDYY HH:mm",
"MMDDYYYY HH:mm",
"MM/DD/YY HH:mm",
"MM/DD/YYYY HH:mm",
"M/DD/YY HH:mm",
"M/DD/YYYY HH:mm",
"MM/D/YY HH:mm",
"MM/D/YYYY HH:mm",
"M/D/YY HH:mm",
"M/D/YYYY HH:mm",
"D/MM/YY HH:mm",
"D/MM/YYYY HH:mm",
"DD/M/YY HH:mm",
"DD/M/YYYY HH:mm",
"D/M/YY HH:mm",
"D/M/YYYY HH:mm",
"MMDDYY HH:mm:ss",
"MMDDYYYY HH:mm:ss",
"MM/DD/YY HH:mm:ss",
"MM/DD/YYYY HH:mm:ss",
"M/DD/YY HH:mm:ss",
"M/DD/YYYY HH:mm:ss",
"MM/D/YY HH:mm:ss",
"MM/D/YYYY HH:mm:ss",
"M/D/YY HH:mm:ss",
"M/D/YYYY HH:mm:ss",
"D/MM/YY HH:mm:ss",
"D/MM/YYYY HH:mm:ss",
"DD/M/YY HH:mm:ss",
"DD/M/YYYY HH:mm:ss",
"D/M/YY HH:mm:ss",
"D/M/YYYY HH:mm:ss"
"MMDDYY",
// Four-digit year
"M/D/YYYY", // Example: 1/5/2023
"MM/D/YYYY", // Example: 12/5/2023
"M/DD/YYYY", // Example: 1/25/2023
"MM/DD/YYYY", // Example: 12/25/2023
// Two-digit year
"M/D/YY", // Example: 1/5/23
"MM/D/YY", // Example: 12/5/23
"M/DD/YY", // Example: 1/25/23
"MM/DD/YY", // Example: 12/25/23
// Explicitly handle single-digit month and day
"M/D/YY", // Example: 1/5/23
"M/D/YYYY", // Example: 1/5/2023
"M/DD/YY", // Example: 1/25/23
"M/DD/YYYY", // Example: 1/25/2023
"MM/D/YY", // Example: 12/5/23
"MM/D/YYYY" // Example: 12/5/2023
];

View File

@@ -28,6 +28,11 @@ import ProductionListColumnCategory from "./production-list-columns.status.categ
import ProductionListColumnStatus from "./production-list-columns.status.component";
import ProductionListColumnTouchTime from "./prodution-list-columns.touchtime.component";
const getEmployeeName = (employeeId, employees) => {
const employee = employees.find((e) => e.id === employeeId);
return employee ? `${employee.first_name} ${employee.last_name}` : "";
};
const r = ({ technician, state, activeStatuses, data, bodyshop, refetch, treatments }) => {
const { Enhanced_Payroll } = treatments;
return [
@@ -426,8 +431,8 @@ const r = ({ technician, state, activeStatuses, data, bodyshop, refetch, treatme
sortOrder: state.sortedInfo.columnKey === "employee_body" && state.sortedInfo.order,
sorter: (a, b) =>
alphaSort(
bodyshop.employees?.find((e) => e.id === a.employee_body)?.first_name,
bodyshop.employees?.find((e) => e.id === b.employee_body)?.first_name
getEmployeeName(a.employee_body, bodyshop.employees),
getEmployeeName(b.employee_body, bodyshop.employees)
),
render: (text, record) => (
<ProductionListEmployeeAssignment refetch={refetch} record={record} type="employee_body" />
@@ -440,8 +445,8 @@ const r = ({ technician, state, activeStatuses, data, bodyshop, refetch, treatme
sortOrder: state.sortedInfo.columnKey === "employee_prep" && state.sortedInfo.order,
sorter: (a, b) =>
alphaSort(
bodyshop.employees?.find((e) => e.id === a.employee_prep)?.first_name,
bodyshop.employees?.find((e) => e.id === b.employee_prep)?.first_name
getEmployeeName(a.employee_prep, bodyshop.employees),
getEmployeeName(b.employee_prep, bodyshop.employees)
),
render: (text, record) => (
<ProductionListEmployeeAssignment record={record} refetch={refetch} type="employee_prep" />
@@ -460,8 +465,8 @@ const r = ({ technician, state, activeStatuses, data, bodyshop, refetch, treatme
sortOrder: state.sortedInfo.columnKey === "employee_csr" && state.sortedInfo.order,
sorter: (a, b) =>
alphaSort(
bodyshop.employees?.find((e) => e.id === a.employee_csr)?.first_name,
bodyshop.employees?.find((e) => e.id === b.employee_csr)?.first_name
getEmployeeName(a.employee_csr, bodyshop.employees),
getEmployeeName(b.employee_csr, bodyshop.employees)
),
render: (text, record) => (
<ProductionListEmployeeAssignment refetch={refetch} record={record} type="employee_csr" />
@@ -474,8 +479,8 @@ const r = ({ technician, state, activeStatuses, data, bodyshop, refetch, treatme
sortOrder: state.sortedInfo.columnKey === "employee_refinish" && state.sortedInfo.order,
sorter: (a, b) =>
alphaSort(
bodyshop.employees?.find((e) => e.id === a.employee_refinish)?.first_name,
bodyshop.employees?.find((e) => e.id === b.employee_refinish)?.first_name
getEmployeeName(a.employee_refinish, bodyshop.employees),
getEmployeeName(b.employee_refinish, bodyshop.employees)
),
render: (text, record) => (
<ProductionListEmployeeAssignment record={record} refetch={refetch} type="employee_refinish" />

View File

@@ -1189,6 +1189,8 @@
"clear": "Clear",
"confirmpassword": "Confirm Password",
"created_at": "Created At",
"date": "Select Date",
"datetime": "Select Date & Time",
"email": "Email",
"errors": "Errors",
"excel": "Excel",
@@ -2737,7 +2739,7 @@
}
},
"production": {
"constants":{
"constants": {
"main_profile": "Default"
},
"options": {

File diff suppressed because it is too large Load Diff

View File

@@ -1189,6 +1189,8 @@
"clear": "",
"confirmpassword": "",
"created_at": "",
"date": "",
"datetime": "",
"email": "",
"errors": "",
"excel": "",
@@ -2737,7 +2739,7 @@
}
},
"production": {
"constants":{
"constants": {
"main_profile": ""
},
"options": {

View File

@@ -56,8 +56,8 @@ exports.default = async (req, res) => {
try {
const { jobs, bodyshops_by_pk } = await client.request(queries.KAIZEN_QUERY, {
bodyshopid: bodyshop.id,
start: start ? moment(start).startOf("hours") : moment().subtract(2, "hours").startOf("hour"),
...(end && { end: moment(end).endOf("hours") })
start: start ? moment(start).startOf("day") : moment().subtract(5, "days").startOf("day"),
...(end && { end: moment(end).endOf("day") })
});
const kaizenObject = {
@@ -176,24 +176,19 @@ exports.default = async (req, res) => {
} finally {
sftp.end();
}
// sendServerEmail({
// subject: `Kaizen Report ${moment().format("MM-DD-YY")}`,
// text: `Errors: ${allErrors.map((e) => JSON.stringify(e, null, 2))}
// Uploaded: ${JSON.stringify(
// allxmlsToUpload.map((x) => ({ filename: x.filename, count: x.count })),
// null,
// 2
// )}
// `,
// });
sendServerEmail({
subject: `Kaizen Report ${moment().format("MM-DD-YY")}`,
text: `Errors: ${allErrors.map((e) => JSON.stringify(e, null, 2))}
Uploaded: ${JSON.stringify(
allxmlsToUpload.map((x) => ({ filename: x.filename, count: x.count })),
null,
2
)}
`
});
res.sendStatus(200);
} catch (error) {
res.status(200).json(error);
sendServerEmail({
subject: `Kaizen Report ${moment().format("MM-DD-YY @ HH:mm:ss")}`,
text: `Errors: JSON.stringify(error)}
All Errors: ${allErrors.map((e) => JSON.stringify(e, null, 2))}`
});
}
};