Merge branch 'master' into feature/major-package-upgrades
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
<babeledit_project version="1.2" be_version="2.7.1">
|
<babeledit_project be_version="2.7.1" version="1.2">
|
||||||
<!--
|
<!--
|
||||||
|
|
||||||
BabelEdit project file
|
BabelEdit project file
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import {
|
|||||||
Space,
|
Space,
|
||||||
Switch,
|
Switch,
|
||||||
} from "antd";
|
} from "antd";
|
||||||
|
import axios from "axios";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
@@ -18,7 +19,6 @@ import { insertAuditTrail } from "../../redux/application/application.actions";
|
|||||||
import { selectJobReadOnly } from "../../redux/application/application.selectors";
|
import { selectJobReadOnly } from "../../redux/application/application.selectors";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
||||||
import axios from "axios";
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
//currentUser: selectCurrentUser
|
//currentUser: selectCurrentUser
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -235,7 +235,11 @@ export function JobsConvertButton({
|
|||||||
loading={loading}
|
loading={loading}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
form.resetFields();
|
form.setFieldsValue({
|
||||||
|
driveable: true,
|
||||||
|
towin: false,
|
||||||
|
employee_csr: job.employee_csr,
|
||||||
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{t("jobs.actions.convert")}
|
{t("jobs.actions.convert")}
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
import { Space } from "antd";
|
import { Space } from "antd";
|
||||||
import React from "react";
|
import React, { useMemo } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { useLocation } from "react-router-dom";
|
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { selectScheduleLoad } from "../../redux/application/application.selectors";
|
import { selectScheduleLoad } from "../../redux/application/application.selectors";
|
||||||
import queryString from "query-string";
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
//currentUser: selectCurrentUser
|
//currentUser: selectCurrentUser
|
||||||
scheduleLoad: selectScheduleLoad,
|
scheduleLoad: selectScheduleLoad,
|
||||||
@@ -14,20 +12,33 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
});
|
});
|
||||||
|
|
||||||
export function ScheduleAtsSummary({ scheduleLoad }) {
|
export function ScheduleAtsSummary({ scheduleLoad, appointments }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const search = queryString.parse(useLocation().search);
|
|
||||||
|
|
||||||
if (
|
const atsSummary = useMemo(() => {
|
||||||
(search.view === undefined || search.view === "week") &&
|
let atsSummary = {};
|
||||||
scheduleLoad.atsSummary &&
|
if (!appointments || appointments.length === 0) {
|
||||||
Object.keys(scheduleLoad.atsSummary).length > 0
|
return {};
|
||||||
)
|
}
|
||||||
|
appointments
|
||||||
|
.filter((a) => a.isintake)
|
||||||
|
.forEach((a) => {
|
||||||
|
if (!a.job.alt_transport) return;
|
||||||
|
if (!atsSummary[a.job.alt_transport]) {
|
||||||
|
atsSummary[a.job.alt_transport] = 1;
|
||||||
|
} else {
|
||||||
|
atsSummary[a.job.alt_transport] = atsSummary[a.job.alt_transport] + 1;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return atsSummary;
|
||||||
|
}, [appointments]);
|
||||||
|
|
||||||
|
if (Object.keys(atsSummary).length > 0)
|
||||||
return (
|
return (
|
||||||
<Space wrap>
|
<Space wrap>
|
||||||
{t("schedule.labels.atssummary")}
|
{t("schedule.labels.atssummary")}
|
||||||
{Object.keys(scheduleLoad.atsSummary).map((key) => (
|
{Object.keys(atsSummary).map((key) => (
|
||||||
<span key={key}>{`${key}: ${scheduleLoad.atsSummary[key]}`}</span>
|
<span key={key}>{`${key}: ${atsSummary[key]}`}</span>
|
||||||
))}
|
))}
|
||||||
</Space>
|
</Space>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { Button, Card, Checkbox, Col, PageHeader, Row, Space } from "antd";
|
|||||||
import { t } from "i18next";
|
import { t } from "i18next";
|
||||||
import React, { useMemo } from "react";
|
import React, { useMemo } from "react";
|
||||||
import useLocalStorage from "../../utils/useLocalStorage";
|
import useLocalStorage from "../../utils/useLocalStorage";
|
||||||
import ScheduleAtsSummary from "../schedule-ats-summary/schedule-ats-summary.component";
|
import ScheduleAtsSummary from "../schedule-ats-summary/schedule-ats-summary.component";
|
||||||
import ScheduleCalendarWrapperComponent from "../schedule-calendar-wrapper/scheduler-calendar-wrapper.component";
|
import ScheduleCalendarWrapperComponent from "../schedule-calendar-wrapper/scheduler-calendar-wrapper.component";
|
||||||
import ScheduleModal from "../schedule-job-modal/schedule-job-modal.container";
|
import ScheduleModal from "../schedule-job-modal/schedule-job-modal.container";
|
||||||
import ScheduleManualEvent from "../schedule-manual-event/schedule-manual-event.component";
|
import ScheduleManualEvent from "../schedule-manual-event/schedule-manual-event.component";
|
||||||
@@ -11,7 +11,6 @@ import ScheduleProductionList from "../schedule-production-list/schedule-product
|
|||||||
import ScheduleVerifyIntegrity from "../schedule-verify-integrity/schedule-verify-integrity.component";
|
import ScheduleVerifyIntegrity from "../schedule-verify-integrity/schedule-verify-integrity.component";
|
||||||
|
|
||||||
export default function ScheduleCalendarComponent({ data, refetch }) {
|
export default function ScheduleCalendarComponent({ data, refetch }) {
|
||||||
|
|
||||||
const [filter, setFilter] = useLocalStorage("filter_events", {
|
const [filter, setFilter] = useLocalStorage("filter_events", {
|
||||||
intake: true,
|
intake: true,
|
||||||
manual: true,
|
manual: true,
|
||||||
@@ -37,7 +36,7 @@ export default function ScheduleCalendarComponent({ data, refetch }) {
|
|||||||
<PageHeader
|
<PageHeader
|
||||||
extra={
|
extra={
|
||||||
<Space wrap>
|
<Space wrap>
|
||||||
<ScheduleAtsSummary/>
|
<ScheduleAtsSummary appointments={filteredData} />
|
||||||
<Checkbox
|
<Checkbox
|
||||||
checked={filter?.intake}
|
checked={filter?.intake}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
@@ -73,8 +72,6 @@ export default function ScheduleCalendarComponent({ data, refetch }) {
|
|||||||
<ScheduleProductionList />
|
<ScheduleProductionList />
|
||||||
|
|
||||||
<ScheduleManualEvent />
|
<ScheduleManualEvent />
|
||||||
|
|
||||||
|
|
||||||
</Space>
|
</Space>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1101,6 +1101,9 @@ export const UPDATE_JOB_ASSIGNMENTS = gql`
|
|||||||
first_name
|
first_name
|
||||||
last_name
|
last_name
|
||||||
}
|
}
|
||||||
|
employee_csr
|
||||||
|
employee_body
|
||||||
|
employee_prep
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import { persistor, store } from "./redux/store";
|
|||||||
import reportWebVitals from "./reportWebVitals";
|
import reportWebVitals from "./reportWebVitals";
|
||||||
import "./translations/i18n";
|
import "./translations/i18n";
|
||||||
import "./utils/CleanAxios";
|
import "./utils/CleanAxios";
|
||||||
import { BrowserTracing } from "@sentry/tracing";
|
//import { BrowserTracing } from "@sentry/tracing";
|
||||||
|
|
||||||
// Dinero.defaultCurrency = "CAD";
|
// Dinero.defaultCurrency = "CAD";
|
||||||
// Dinero.globalLocale = "en-CA";
|
// Dinero.globalLocale = "en-CA";
|
||||||
@@ -29,18 +29,18 @@ if (process.env.NODE_ENV !== "development") {
|
|||||||
"Module specifier, 'zlib' does not start with",
|
"Module specifier, 'zlib' does not start with",
|
||||||
],
|
],
|
||||||
integrations: [
|
integrations: [
|
||||||
new BrowserTracing(),
|
// new BrowserTracing(),
|
||||||
// new Sentry.Integrations.Breadcrumbs({ console: true }),
|
// new Sentry.Integrations.Breadcrumbs({ console: true }),
|
||||||
new Sentry.Replay(),
|
// new Sentry.Replay(),
|
||||||
],
|
],
|
||||||
// This sets the sample rate to be 10%. You may want this to be 100% while
|
// This sets the sample rate to be 10%. You may want this to be 100% while
|
||||||
// in development and sample at a lower rate in production
|
// in development and sample at a lower rate in production
|
||||||
replaysSessionSampleRate: 0.1,
|
// replaysSessionSampleRate: 0.1,
|
||||||
// If the entire session is not sampled, use the below sample rate to sample
|
// // If the entire session is not sampled, use the below sample rate to sample
|
||||||
// sessions when an error occurs.
|
// // sessions when an error occurs.
|
||||||
replaysOnErrorSampleRate: 1.0,
|
// replaysOnErrorSampleRate: 1.0,
|
||||||
environment: process.env.NODE_ENV,
|
environment: process.env.NODE_ENV,
|
||||||
tracesSampleRate: 0.2,
|
// tracesSampleRate: 0.2,
|
||||||
// We recommend adjusting this value in production, or using tracesSampler
|
// We recommend adjusting this value in production, or using tracesSampler
|
||||||
// for finer control
|
// for finer control
|
||||||
// tracesSampleRate: 0.5,
|
// tracesSampleRate: 0.5,
|
||||||
@@ -52,7 +52,7 @@ const root = createRoot(container); // createRoot(container!) if you use TypeScr
|
|||||||
|
|
||||||
root.render(
|
root.render(
|
||||||
<Provider store={store}>
|
<Provider store={store}>
|
||||||
<BrowserRouter >
|
<BrowserRouter>
|
||||||
<PersistGate
|
<PersistGate
|
||||||
loading={<LoadingSpinner message="Restoring your settings..." />}
|
loading={<LoadingSpinner message="Restoring your settings..." />}
|
||||||
persistor={persistor}
|
persistor={persistor}
|
||||||
|
|||||||
@@ -172,21 +172,6 @@ export function* calculateScheduleLoad({ payload: end }) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Calculate weekly ATS summary.
|
|
||||||
const startOfWeek = moment(end).startOf("week");
|
|
||||||
const endOfWeek = moment(end).endOf("week");
|
|
||||||
load.atsSummary = {};
|
|
||||||
arrJobs
|
|
||||||
.filter((j) => moment(j.scheduled_in).isBetween(startOfWeek, endOfWeek))
|
|
||||||
.forEach((j) => {
|
|
||||||
if (!load.atsSummary[j.alt_transport]) {
|
|
||||||
load.atsSummary[j.alt_transport] = 1;
|
|
||||||
} else {
|
|
||||||
load.atsSummary[j.alt_transport] =
|
|
||||||
load.atsSummary[j.alt_transport] + 1;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
yield put(setProblemJobs(problemJobs));
|
yield put(setProblemJobs(problemJobs));
|
||||||
yield put(scheduleLoadSuccess(load));
|
yield put(scheduleLoadSuccess(load));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -2501,7 +2501,7 @@
|
|||||||
},
|
},
|
||||||
"schedule": {
|
"schedule": {
|
||||||
"labels": {
|
"labels": {
|
||||||
"atssummary": "Weekly ATS Summary",
|
"atssummary": "ATS Summary",
|
||||||
"employeevacation": "Employee Vacations",
|
"employeevacation": "Employee Vacations",
|
||||||
"intake": "Intake Events",
|
"intake": "Intake Events",
|
||||||
"manual": "Manual Events",
|
"manual": "Manual Events",
|
||||||
|
|||||||
@@ -654,9 +654,9 @@ exports.default = function ({
|
|||||||
if (qbo) {
|
if (qbo) {
|
||||||
InvoiceLineAdd.push({
|
InvoiceLineAdd.push({
|
||||||
DetailType: "SalesItemLineDetail",
|
DetailType: "SalesItemLineDetail",
|
||||||
Amount: Dinero({ amount: (payer.amount || 0) * 100 * -1 }).toFormat(
|
Amount: Dinero({
|
||||||
DineroQbFormat
|
amount: Math.round((payer.amount || 0) * 100) * -1,
|
||||||
),
|
}).toFormat(DineroQbFormat),
|
||||||
SalesItemLineDetail: {
|
SalesItemLineDetail: {
|
||||||
...(jobs_by_pk.class
|
...(jobs_by_pk.class
|
||||||
? { ClassRef: { value: classes[jobs_by_pk.class] } }
|
? { ClassRef: { value: classes[jobs_by_pk.class] } }
|
||||||
@@ -687,9 +687,9 @@ exports.default = function ({
|
|||||||
FullName: responsibilityCenters.qb_multiple_payers?.accountitem,
|
FullName: responsibilityCenters.qb_multiple_payers?.accountitem,
|
||||||
},
|
},
|
||||||
Desc: `${payer.name} Liability`,
|
Desc: `${payer.name} Liability`,
|
||||||
Amount: Dinero({ amount: (payer.amount || 0) * 100 * -1 }).toFormat(
|
Amount: Dinero({
|
||||||
DineroQbFormat
|
amount: Math.round((payer.amount || 0) * 100) * -1,
|
||||||
),
|
}).toFormat(DineroQbFormat),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user