Compare commits

..

1 Commits

Author SHA1 Message Date
Patrick Fic
e63f8c7c45 IO-2143 Add truncation for long vehicle notes. 2023-01-20 09:20:07 -08:00
99 changed files with 43380 additions and 1230 deletions

View File

@@ -1,3 +1,14 @@
Yarn Dependency Management:
To force upgrades for some packages:
yarn upgrade-interactive --latest
To Start Hasura CLI:
npx hasura console
Migrating to Staging:
npx hasura migrate apply --endpoint https://db.imex.online/ --admin-secret 'Production-ImEXOnline!@#'
npx hasura migrate apply --endpoint https://db.test.bodyshop.app/ --admin-secret 'Test-ImEXOnlineBySnaptSoftware!'
NGROK TEsting:
./ngrok.exe http http://localhost:4000 -host-header="localhost:4000"
@@ -10,4 +21,4 @@ hasura migrate apply --version "1620771761757" --skip-execution --endpoint https
hasura migrate status --endpoint https://db.imex.online/ --admin-secret 'Production-ImEXOnline!@#'
Generate the license file:
$ generate-license-file --input package.json --output third-party-licenses.txt --overwrite
$ generate-license-file --input package.json --output third-party-licenses.txt --overwrite

View File

@@ -736,27 +736,6 @@
</translation>
</translations>
</concept_node>
<concept_node>
<name>expectedjobs</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node>
<name>expectedprodhrs</name>
<definition_loaded>false</definition_loaded>
@@ -967,27 +946,6 @@
</translation>
</translations>
</concept_node>
<concept_node>
<name>severalerrorsfound</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node>
<name>smartscheduling</name>
<definition_loaded>false</definition_loaded>
@@ -18382,27 +18340,6 @@
</translation>
</translations>
</concept_node>
<concept_node>
<name>ah_detail_line</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node>
<name>db_price</name>
<definition_loaded>false</definition_loaded>
@@ -19730,27 +19667,6 @@
<folder_node>
<name>validations</name>
<children>
<concept_node>
<name>ahdetailonlyonuserdefinedtypes</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node>
<name>hrsrequirediflbrtyp</name>
<definition_loaded>false</definition_loaded>
@@ -29017,27 +28933,6 @@
</concept_node>
</children>
</folder_node>
<concept_node>
<name>profileadjustments</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node>
<name>prt_dsmk_total</name>
<definition_loaded>false</definition_loaded>
@@ -40901,69 +40796,6 @@
</translation>
</translations>
</concept_node>
<concept_node>
<name>gsr_by_atp</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node>
<name>gsr_by_ats</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node>
<name>gsr_by_category</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node>
<name>gsr_by_csr</name>
<definition_loaded>false</definition_loaded>
@@ -41594,48 +41426,6 @@
</translation>
</translations>
</concept_node>
<concept_node>
<name>jobs_completed_not_invoiced</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node>
<name>jobs_invoiced_not_exported</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node>
<name>jobs_reconcile</name>
<definition_loaded>false</definition_loaded>
@@ -41762,27 +41552,6 @@
</translation>
</translations>
</concept_node>
<concept_node>
<name>open_orders_specific_csr</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node>
<name>open_orders_status</name>
<definition_loaded>false</definition_loaded>
@@ -42392,27 +42161,6 @@
</translation>
</translations>
</concept_node>
<concept_node>
<name>scheduled_parts_list</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node>
<name>scoreboard_detail</name>
<definition_loaded>false</definition_loaded>
@@ -46816,48 +46564,6 @@
</translation>
</translations>
</concept_node>
<concept_node>
<name>changepassword</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node>
<name>profileinfo</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
</children>
</folder_node>
<folder_node>

View File

@@ -1,5 +1,6 @@
import { useLazyQuery } from "@apollo/client";
import { AutoComplete, Divider, Input, Space } from "antd";
import { LoadingOutlined } from "@ant-design/icons";
import { AutoComplete, Divider, Space } from "antd";
import _ from "lodash";
import React from "react";
import { useTranslation } from "react-i18next";
@@ -8,7 +9,7 @@ import { GLOBAL_SEARCH_QUERY } from "../../graphql/search.queries";
import PhoneNumberFormatter from "../../utils/PhoneFormatter";
import AlertComponent from "../alert/alert.component";
import OwnerNameDisplay, {
OwnerNameDisplayFunction
OwnerNameDisplayFunction,
} from "../owner-name-display/owner-name-display.component";
import VehicleVinDisplay from "../vehicle-vin-display/vehicle-vin-display.component";
export default function GlobalSearch() {
@@ -177,18 +178,13 @@ export default function GlobalSearch() {
<AutoComplete
options={options}
onSearch={handleSearch}
suffixIcon={loading && <LoadingOutlined spin />}
defaultActiveFirstOption
placeholder={t("general.labels.globalsearch")}
allowClear
onSelect={(val, opt) => {
history.push(opt.label.props.to);
}}
>
<Input.Search
size="large"
placeholder={t("general.labels.globalsearch")}
enterButton
allowClear
loading={loading}
/>
</AutoComplete>
></AutoComplete>
);
}

View File

@@ -22,20 +22,9 @@ export function JoblinePresetButton({ bodyshop, form }) {
};
const menu = (
<Menu
style={{
columnCount: Math.max(
Math.floor(bodyshop.md_jobline_presets.length / 15),
1
),
}}
>
<Menu>
{bodyshop.md_jobline_presets.map((i, idx) => (
<Menu.Item
onClick={() => handleSelect(i)}
key={idx}
style={{ breakInside: "avoid" }}
>
<Menu.Item onClick={() => handleSelect(i)} key={idx}>
{i.label}
</Menu.Item>
))}

View File

@@ -40,11 +40,6 @@ export function JobLinesUpsertModalComponent({
{},
bodyshop.imexshopid
);
const { Autohouse_Detail_line } = useTreatments(
["Autohouse_Detail_line"],
{},
bodyshop.imexshopid
);
return (
<Modal
@@ -160,40 +155,6 @@ export function JobLinesUpsertModalComponent({
>
<InputNumber precision={1} />
</Form.Item>
{Autohouse_Detail_line.treatment === "on" && (
<Form.Item
label={t("joblines.fields.ah_detail_line")}
name="ah_detail_line"
valuePropName="checked"
dependencies={["mod_lbr_ty"]}
initialValue={false}
rules={[
({ getFieldValue }) => ({
validator(rule, value) {
if (
value === false ||
value === undefined ||
value === null
)
return Promise.resolve();
if (
value === true &&
["LA1", "LA2", "LA3", "LA4", "LAU"].includes(
getFieldValue("mod_lbr_ty")
)
) {
return Promise.resolve();
}
return Promise.reject(
t("joblines.validations.ahdetailonlyonuserdefinedtypes")
);
},
}),
]}
>
<Switch />
</Form.Item>
)}
</LayoutFormRow>
<LayoutFormRow>
<Form.Item label={t("joblines.fields.part_type")} name="part_type">
@@ -257,6 +218,7 @@ export function JobLinesUpsertModalComponent({
rules={[
({ getFieldValue }) => ({
validator(rule, value) {
console.log(value);
if (!value || getFieldValue("part_type") !== "PAE") {
return Promise.resolve();
}
@@ -267,6 +229,7 @@ export function JobLinesUpsertModalComponent({
}),
({ getFieldValue }) => ({
validator(rule, value) {
console.log(value, !!value);
if (
!!getFieldValue("part_type") === (!!value || value === 0)
) {
@@ -289,7 +252,7 @@ export function JobLinesUpsertModalComponent({
name="prt_dsmk_p"
initialValue={0}
>
<InputNumber precision={0} min={-100} max={100} />
<InputNumber precision={0} min={0} max={100} />
</Form.Item>
<Form.Item
label={t("joblines.fields.tax_part")}

View File

@@ -13,7 +13,6 @@ import { selectJobLineEditModal } from "../../redux/modals/modals.selectors";
import UndefinedToNull from "../../utils/undefinedtonull";
import JobLinesUpdsertModal from "./job-lines-upsert-modal.component";
import Axios from "axios";
import Dinero from "dinero.js";
const mapStateToProps = createStructuredSelector({
jobLineEditModal: selectJobLineEditModal,
});
@@ -41,15 +40,7 @@ function JobLinesUpsertModalContainer({
manual_line: !(
jobLineEditModal.context && jobLineEditModal.context.id
),
...UndefinedToNull({
...values,
prt_dsmk_m: Dinero({
amount: Math.round((values.act_price || 0) * 100),
})
.percentage(Math.abs(values.prt_dsmk_p || 0))
.multiply(values.prt_dsmk_p >= 0 ? 1 : -1)
.toFormat(0.0),
}),
...UndefinedToNull(values),
},
],
},
@@ -77,15 +68,7 @@ function JobLinesUpsertModalContainer({
const r = await updateJobLine({
variables: {
lineId: jobLineEditModal.context.id,
line: {
...values,
prt_dsmk_m: Dinero({
amount: Math.round(values.act_price * 100),
})
.percentage(Math.abs(values.prt_dsmk_p || 0))
.multiply(values.prt_dsmk_p >= 0 ? 1 : -1)
.toFormat(0.0),
},
line: values,
},
refetchQueries: ["GET_LINE_TICKET_BY_PK"],
});

View File

@@ -43,21 +43,14 @@ export function JobsConvertButton({
const { t } = useTranslation();
const [form] = Form.useForm();
const handleConvert = async ({ employee_csr, ...values }) => {
const handleConvert = async (values) => {
if (parentFormIsFieldsTouched()) {
alert(t("jobs.labels.savebeforeconversion"));
return;
}
setLoading(true);
const res = await mutationConvertJob({
variables: {
jobId: job.id,
job: {
converted: true,
...(bodyshop.enforce_conversion_csr ? { employee_csr } : {}),
...values,
},
},
variables: { jobId: job.id, ...values },
});
if (values.ca_gst_registrant) {

View File

@@ -256,7 +256,7 @@ export function JobsDetailGeneral({ bodyshop, jobRO, job, form }) {
</FormRow>
<FormRow header={t("jobs.forms.other")}>
<Form.Item label={t("jobs.fields.category")} name="category">
<Select disabled={jobRO} allowClear>
<Select disabled={jobRO}>
{bodyshop.md_categories.map((s) => (
<Select.Option key={s} value={s}>
{s}

View File

@@ -182,7 +182,7 @@ export function JobsExportAllButton({
return (
<Button onClick={handleQbxml} loading={loading} disabled={disabled}>
{t("jobs.actions.exportselected")}
{t("jobs.actions.export")}
</Button>
);
}

View File

@@ -34,9 +34,7 @@ function OwnerDetailJobsComponent({ bodyshop, owner }) {
render: (text, record) =>
record.vehicleid ? (
<Link to={`/manage/vehicles/${record.vehicleid}`}>
{`${record.v_model_yr || ""} ${record.v_make_desc || ""} ${
record.v_model_desc || ""
}`.trim()}
{`${record.v_model_yr} ${record.v_make_desc} ${record.v_model_desc}`}
</Link>
) : (
t("jobs.errors.novehicle")

View File

@@ -1,4 +1,4 @@
import { Button, Card, Col, Form, Input, notification } from "antd";
import { Button, Form, Input, notification } from "antd";
import { LockOutlined } from "@ant-design/icons";
import React from "react";
import { useTranslation } from "react-i18next";
@@ -48,99 +48,81 @@ export default connect(
};
return (
<>
<Col span={24}>
<Form
onFinish={handleFinish}
autoComplete={"no"}
initialValues={currentUser}
layout="vertical"
>
<Card
title={t("user.labels.profileinfo")}
extra={
<Button type="primary" key="submit" htmlType="submit">
{t("user.actions.updateprofile")}
</Button>
}
<div>
<Form
onFinish={handleFinish}
autoComplete={"no"}
initialValues={currentUser}
layout="vertical"
>
<LayoutFormRow>
<Form.Item
label={t("user.fields.displayname")}
rules={[
{
required: true,
//message: t("general.validation.required"),
},
]}
name="displayName"
>
<LayoutFormRow noDivider>
<Form.Item
label={t("user.fields.displayname")}
rules={[
{
required: true,
//message: t("general.validation.required"),
},
]}
name="displayName"
>
<Input />
</Form.Item>
<Form.Item label={t("user.fields.photourl")} name="photoURL">
<Input />
</Form.Item>
</LayoutFormRow>
</Card>
</Form>
</Col>
<Col span={24}>
<Form
onFinish={handleChangePassword}
autoComplete={"no"}
initialValues={currentUser}
layout="vertical"
>
<Card
title={t("user.labels.changepassword")}
extra={
<Button type="primary" key="submit" htmlType="submit">
{t("user.actions.changepassword")}
</Button>
}
<Input />
</Form.Item>
<Form.Item label={t("user.fields.photourl")} name="photoURL">
<Input />
</Form.Item>
</LayoutFormRow>
<Button type="primary" key="submit" htmlType="submit">
{t("user.actions.updateprofile")}
</Button>
</Form>
<Form
onFinish={handleChangePassword}
autoComplete={"no"}
initialValues={currentUser}
layout="vertical"
>
<LayoutFormRow>
<Form.Item label={t("general.labels.newpassword")} name="password">
<Input
prefix={<LockOutlined />}
type="password"
placeholder={t("general.labels.password")}
/>
</Form.Item>
<Form.Item
label={t("general.labels.confirmpassword")}
name="password-confirm"
dependencies={["password"]}
rules={[
{
required: true,
//message: t("general.validation.required"),
},
({ getFieldValue }) => ({
validator(rule, value) {
if (!value || getFieldValue("password") === value) {
return Promise.resolve();
}
return Promise.reject(
t("general.labels.passwordsdonotmatch")
);
},
}),
]}
>
<LayoutFormRow>
<Form.Item
label={t("general.labels.newpassword")}
name="password"
>
<Input
prefix={<LockOutlined />}
type="password"
placeholder={t("general.labels.password")}
/>
</Form.Item>
<Form.Item
label={t("general.labels.confirmpassword")}
name="password-confirm"
dependencies={["password"]}
rules={[
{
required: true,
//message: t("general.validation.required"),
},
({ getFieldValue }) => ({
validator(rule, value) {
if (!value || getFieldValue("password") === value) {
return Promise.resolve();
}
return Promise.reject(
t("general.labels.passwordsdonotmatch")
);
},
}),
]}
>
<Input
prefix={<LockOutlined />}
type="password"
placeholder={t("general.labels.password")}
/>
</Form.Item>
</LayoutFormRow>
</Card>
</Form>
</Col>
</>
<Input
prefix={<LockOutlined />}
type="password"
placeholder={t("general.labels.password")}
/>
</Form.Item>
</LayoutFormRow>
<Button type="primary" key="submit" htmlType="submit">
{t("user.actions.changepassword")}
</Button>
</Form>
</div>
);
});

View File

@@ -1,13 +1,13 @@
import { Button, Card, Col, Input, Table, Typography } from "antd";
import React, { useState } from "react";
import React from "react";
import { useTranslation } from "react-i18next";
import { Table, Button, Typography } from "antd";
export default function ProfileShopsComponent({
loading,
data,
updateActiveShop,
}) {
const { t } = useTranslation();
const [search, setSearch] = useState("");
const columns = [
{
title: t("associations.fields.shopname"),
@@ -39,39 +39,18 @@ export default function ProfileShopsComponent({
),
},
];
console.log("🚀 ~ file: profile-shops.component.jsx:45 ~ data", data);
const filteredData =
search === ""
? data
: data.filter((d) =>
d.bodyshop.shopname.toLowerCase().includes(search.toLowerCase())
);
return (
<Col span={24}>
<Card
title={
<Typography.Title level={4}>
{t("profile.labels.activeshop")}
</Typography.Title>
}
extra={
<Input.Search
value={search}
onChange={(e) => setSearch(e.target.value)}
allowClear
placeholder={t("general.labels.search")}
/>
}
>
<Table
pagination={false}
loading={loading}
columns={columns}
rowKey="id"
dataSource={filteredData}
/>
</Card>
</Col>
<Table
title={() => (
<Typography.Title level={4}>
{t("profile.labels.activeshop")}
</Typography.Title>
)}
loading={loading}
columns={columns}
rowKey="id"
dataSource={data}
/>
);
}

View File

@@ -4,13 +4,11 @@ import React, { useMemo } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import {
Legend,
PolarAngleAxis,
Legend, PolarAngleAxis,
PolarGrid,
PolarRadiusAxis,
Radar,
RadarChart,
Tooltip,
Radar, RadarChart,
Tooltip
} from "recharts";
import { createStructuredSelector } from "reselect";
import { selectBodyshop } from "../../redux/user/user.selectors";
@@ -46,8 +44,6 @@ export function ScheduleCalendarHeaderGraph({ bodyshop, loadData }) {
<Space>
{t("appointments.labels.expectedprodhrs")}
<strong>{loadData?.expectedHours?.toFixed(1)}</strong>
{t("appointments.labels.expectedjobs")}
<strong>{loadData?.expectedJobCount}</strong>
</Space>
<RadarChart
// cx={300}

View File

@@ -66,8 +66,8 @@ export function ScheduleCalendarHeaderComponent({
<div onClick={(e) => e.stopPropagation()}>
<table>
<tbody>
{loadData && loadData.allJobsOut ? (
loadData.allJobsOut.map((j) => (
{loadData && loadData.jobsOut ? (
loadData.jobsOut.map((j) => (
<tr key={j.id}>
<td>
<Link to={`/manage/jobs/${j.id}`}>{j.ro_number}</Link>
@@ -102,12 +102,11 @@ export function ScheduleCalendarHeaderComponent({
<div onClick={(e) => e.stopPropagation()}>
<table>
<tbody>
{loadData && loadData.allJobsIn ? (
loadData.allJobsIn.map((j) => (
{loadData && loadData.jobsIn ? (
loadData.jobsIn.map((j) => (
<tr key={j.id}>
<td>
<Link to={`/manage/jobs/${j.id}`}>{j.ro_number}</Link>
{j.status}
</td>
<td>
<OwnerNameDisplay ownerObject={j} />
@@ -143,7 +142,7 @@ export function ScheduleCalendarHeaderComponent({
title={t("appointments.labels.arrivingjobs")}
>
<Icon component={MdFileDownload} style={{ color: "green" }} />
{(loadData.allHoursIn || 0) && loadData.allHoursIn.toFixed(2)}
{(loadData.hoursIn || 0) && loadData.hoursIn.toFixed(2)}
</Popover>
<Popover
placement={"bottom"}
@@ -152,7 +151,7 @@ export function ScheduleCalendarHeaderComponent({
title={t("appointments.labels.completingjobs")}
>
<Icon component={MdFileUpload} style={{ color: "red" }} />
{(loadData.allHoursOut || 0) && loadData.allHoursOut.toFixed(2)}
{(loadData.hoursOut || 0) && loadData.hoursOut.toFixed(2)}
</Popover>
<ScheduleCalendarHeaderGraph loadData={loadData} />
</div>

View File

@@ -11,7 +11,7 @@ import HeaderComponent from "./schedule-calendar-header.component";
import "./schedule-calendar.styles.scss";
import JobDetailCards from "../job-detail-cards/job-detail-cards.component";
import { selectProblemJobs } from "../../redux/application/application.selectors";
import { Alert, Collapse } from "antd";
import { Alert } from "antd";
import { useTranslation } from "react-i18next";
const mapStateToProps = createStructuredSelector({
@@ -53,28 +53,7 @@ export function ScheduleCalendarWrapperComponent({
return (
<>
<JobDetailCards />
{problemJobs && problemJobs.length > 2 ? (
<Collapse>
<Collapse.Panel
header={
<span style={{ color: "tomato" }}>
{t("appointments.labels.severalerrorsfound")}
</span>
}
>
{problemJobs.map((problem) => (
<Alert
key={problem.id}
type="error"
message={t("appointments.labels.dataconsistency", {
ro_number: problem.ro_number,
code: problem.code,
})}
/>
))}
</Collapse.Panel>
</Collapse>
) : (
{problemJobs &&
problemJobs.map((problem) => (
<Alert
key={problem.id}
@@ -84,8 +63,7 @@ export function ScheduleCalendarWrapperComponent({
code: problem.code,
})}
/>
))
)}
))}
<Calendar
events={data}

View File

@@ -15,7 +15,6 @@ import React, { useState } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { calculateScheduleLoad } from "../../redux/application/application.actions";
import { selectBodyshop } from "../../redux/user/user.selectors";
import { DateFormatter } from "../../utils/DateFormatter";
import DateTimePicker from "../form-date-time-picker/form-date-time-picker.component";
@@ -29,7 +28,6 @@ const mapStateToProps = createStructuredSelector({
});
const mapDispatchToProps = (dispatch) => ({
//setUserLanguage: language => dispatch(setUserLanguage(language))
calculateScheduleLoad: (endDate) => dispatch(calculateScheduleLoad(endDate)),
});
export function ScheduleJobModalComponent({
@@ -38,7 +36,6 @@ export function ScheduleJobModalComponent({
existingAppointments,
lbrHrsData,
jobId,
calculateScheduleLoad,
}) {
const { t } = useTranslation();
const [loading, setLoading] = useState(false);
@@ -60,7 +57,6 @@ export function ScheduleJobModalComponent({
const handleDateBlur = () => {
const values = form.getFieldsValue();
if (lbrHrsData) {
const totalHours =
lbrHrsData.jobs_by_pk.labhrs.aggregate.sum.mod_lb_hrs +
@@ -134,12 +130,7 @@ export function ScheduleJobModalComponent({
className="imex-flex-row__margin"
key={idx}
onClick={() => {
const ssDate = moment(d);
if (ssDate.isBefore(moment())) {
form.setFieldsValue({ start: moment() });
} else {
form.setFieldsValue({ start: moment(d).add(8, "hours") });
}
form.setFieldsValue({ start: new moment(d).add(8, "hours") });
handleDateBlur();
}}
>
@@ -200,9 +191,6 @@ export function ScheduleJobModalComponent({
<Form.Item shouldUpdate={(prev, cur) => prev.start !== cur.start}>
{() => {
const values = form.getFieldsValue();
if (values.start) {
calculateScheduleLoad(moment(values.start).add(3, "days"));
}
return (
<div className="schedule-job-modal">
<ScheduleDayViewContainer day={values.start} />

View File

@@ -1,6 +1,5 @@
.schedule-job-modal {
height: 70vh;
overflow-y: auto;
.rbc-calendar {
.rbc-toolbar {
.rbc-btn-group {

View File

@@ -1344,14 +1344,7 @@ export default function ShopInfoGeneral({ form }) {
>
<InputNumber precision={0} min={0} max={100} />
</Form.Item>
<Form.Item
label={t("joblines.fields.ah_detail_line")}
key={`${index}ah_detail_line`}
name={[field.name, "ah_detail_line"]}
valuePropName="checked"
>
<Switch />
</Form.Item>
<Space wrap>
<DeleteFilled
onClick={() => {

View File

@@ -85,7 +85,7 @@ export function TimeTicketList({
text: (() => {
const emp = bodyshop.employees.find((e) => e.id === s);
return `${emp?.first_name} ${emp?.last_name}`;
return `${emp.first_name} ${emp.last_name}`;
})(), //
value: [s],
};

View File

@@ -131,7 +131,6 @@ const JobRelatedTicketsTable = ({
return {
id: `${item.jobKey}${costCenter}`,
costCenter,
item,
actHrs: actHrs.toFixed(1),
prodHrs: prodHrs.toFixed(1),
@@ -152,9 +151,7 @@ const JobRelatedTicketsTable = ({
sortOrder:
state.sortedInfo.columnKey === "empname" && state.sortedInfo.order,
render: (text, record) =>
`${record.item.employee.first_name} ${record.item.employee.last_name} ${
record.costCenter ? `(${record.costCenter})` : ""
}`.trim(),
`${record.item.employee.first_name} ${record.item.employee.last_name}`,
},
{
title: t("timetickets.fields.actualhrs"),

View File

@@ -294,12 +294,6 @@ export const QUERY_SCHEDULE_LOAD_DATA = gql`
where: { inproduction: { _eq: true }, suspended: { _eq: false } }
) {
id
actual_in
scheduled_in
actual_completion
scheduled_completion
inproduction
ro_number
labhrs: joblines_aggregate(
where: { mod_lbr_ty: { _neq: "LAR" }, removed: { _eq: false } }
) {
@@ -333,15 +327,12 @@ export const QUERY_SCHEDULE_LOAD_DATA = gql`
}
) {
id
status
ro_number
scheduled_completion
actual_completion
scheduled_in
ownr_fn
ownr_ln
ownr_co_nm
inproduction
labhrs: joblines_aggregate(
where: { mod_lbr_ty: { _neq: "LAR" }, removed: { _eq: false } }
) {
@@ -369,16 +360,11 @@ export const QUERY_SCHEDULE_LOAD_DATA = gql`
) {
id
scheduled_in
actual_in
scheduled_completion
ro_number
ownr_fn
ownr_ln
ownr_co_nm
alt_transport
actual_completion
inproduction
status
labhrs: joblines_aggregate(
where: { mod_lbr_ty: { _neq: "LAR" }, removed: { _eq: false } }
) {

View File

@@ -720,7 +720,6 @@ export const GET_JOB_BY_PK = gql`
prt_dsmk_m
ioucreated
convertedtolbr
ah_detail_line
billlines(limit: 1, order_by: { bill: { date: desc } }) {
id
quantity
@@ -1153,8 +1152,31 @@ export const UPDATE_JOBS = gql`
`;
export const CONVERT_JOB_TO_RO = gql`
mutation CONVERT_JOB_TO_RO($jobId: uuid!, $job: jobs_set_input!) {
update_jobs(where: { id: { _eq: $jobId } }, _set: $job) {
mutation CONVERT_JOB_TO_RO(
$jobId: uuid!
$class: String
$ins_co_nm: String!
$ca_gst_registrant: Boolean
$driveable: Boolean
$towin: Boolean
$referral_source: String
$referral_source_extra: String
$employee_csr: uuid
) {
update_jobs(
where: { id: { _eq: $jobId } }
_set: {
converted: true
ins_co_nm: $ins_co_nm
class: $class
ca_gst_registrant: $ca_gst_registrant
towin: $towin
driveable: $driveable
referral_source: $referral_source
referral_source_extra: $referral_source_extra
employee_csr: $employee_csr
}
) {
returning {
id
ro_number

View File

@@ -14,7 +14,7 @@ import { persistor, store } from "./redux/store";
import reportWebVitals from "./reportWebVitals";
import "./translations/i18n";
import "./utils/CleanAxios";
//import { BrowserTracing } from "@sentry/tracing";
import { BrowserTracing } from "@sentry/tracing";
// Dinero.defaultCurrency = "CAD";
// Dinero.globalLocale = "en-CA";
@@ -29,18 +29,18 @@ if (process.env.NODE_ENV !== "development") {
"Module specifier, 'zlib' does not start with",
],
integrations: [
// new BrowserTracing(),
new BrowserTracing(),
// 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
// in development and sample at a lower rate in production
// replaysSessionSampleRate: 0.1,
// // If the entire session is not sampled, use the below sample rate to sample
// // sessions when an error occurs.
// replaysOnErrorSampleRate: 1.0,
replaysSessionSampleRate: 0.1,
// If the entire session is not sampled, use the below sample rate to sample
// sessions when an error occurs.
replaysOnErrorSampleRate: 1.0,
environment: process.env.NODE_ENV,
// tracesSampleRate: 0.2,
tracesSampleRate: 0.2,
// We recommend adjusting this value in production, or using tracesSampler
// for finer control
// tracesSampleRate: 0.5,
@@ -49,7 +49,7 @@ if (process.env.NODE_ENV !== "development") {
ReactDOM.render(
<Provider store={store}>
<BrowserRouter>
<BrowserRouter >
<PersistGate
loading={<LoadingSpinner message="Restoring your settings..." />}
persistor={persistor}

View File

@@ -51,7 +51,6 @@ import JobAuditTrail from "../../components/job-audit-trail/job-audit-trail.comp
import AuditTrailMapping from "../../utils/AuditTrailMappings";
import { insertAuditTrail } from "../../redux/application/application.actions";
import JobsDocumentsLocalGallery from "../../components/jobs-documents-local-gallery/jobs-documents-local-gallery.container";
import UndefinedToNull from "../../utils/undefinedtonull";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
@@ -97,7 +96,7 @@ export function JobsDetailPage({
variables: {
jobId: job.id,
job: {
...UndefinedToNull(values, ["alt_transport", "category", "referral_source"]),
...values,
parts_tax_rates: {
...job.parts_tax_rates,
...values.parts_tax_rates,

View File

@@ -1,4 +1,3 @@
import { Row } from "antd";
import React from "react";
import ProfileMyComponent from "../../components/profile-my/profile-my.component";
import ProfileShopsContainer from "../../components/profile-shops/profile-shops.container";
@@ -6,10 +5,8 @@ import ProfileShopsContainer from "../../components/profile-shops/profile-shops.
export default function ProfilePage() {
return (
<div>
<Row gutter={[16, 16]}>
<ProfileMyComponent />
<ProfileShopsContainer />
</Row>
<ProfileMyComponent />
<ProfileShopsContainer />
</div>
);
}

View File

@@ -39,11 +39,9 @@ export function VehicleDetailContainer({
document.title = t("titles.vehicledetail", {
vehicle:
data && data.vehicles_by_pk
? `${(data.vehicles_by_pk && data.vehicles_by_pk.v_model_yr) || ""} ${
(data.vehicles_by_pk && data.vehicles_by_pk.v_make_desc) || ""
} ${
(data.vehicles_by_pk && data.vehicles_by_pk.v_model_desc) || ""
}`
? `${data.vehicles_by_pk && data.vehicles_by_pk.v_model_yr} ${
data.vehicles_by_pk && data.vehicles_by_pk.v_make_desc
} ${data.vehicles_by_pk && data.vehicles_by_pk.v_model_desc}`
: "",
});
setSelectedHeader("vehicles");
@@ -55,14 +53,7 @@ export function VehicleDetailContainer({
label: t("titles.bc.vehicle-details", {
vehicle:
data && data.vehicles_by_pk
? `${
(data.vehicles_by_pk && data.vehicles_by_pk.v_model_yr) || ""
} ${
(data.vehicles_by_pk && data.vehicles_by_pk.v_make_desc) || ""
} ${
(data.vehicles_by_pk && data.vehicles_by_pk.v_model_desc) ||
""
}`
? `${data.vehicles_by_pk.v_model_yr} ${data.vehicles_by_pk.v_make_desc} ${data.vehicles_by_pk.v_model_desc}`
: "",
}),
},
@@ -73,11 +64,7 @@ export function VehicleDetailContainer({
CreateRecentItem(
vehId,
"vehicle",
`${data.vehicles_by_pk.v_vin || "N/A"} | ${
data.vehicles_by_pk.v_model_yr || ""
} ${data.vehicles_by_pk.v_make_desc || ""} ${
data.vehicles_by_pk.v_model_desc || ""
}`.trim(),
`${data.vehicles_by_pk.v_vin} | ${data.vehicles_by_pk.v_model_yr} ${data.vehicles_by_pk.v_make_desc} ${data.vehicles_by_pk.v_model_desc}`,
`/manage/vehicles/${vehId}`
)
);

View File

@@ -37,7 +37,7 @@ export function* calculateScheduleLoad({ payload: end }) {
productionTotal: {},
productionHours: 0,
};
let problemJobs = [];
//Set the current load.
buckets.forEach((bucket) => {
load.productionTotal[bucket.id] = { count: 0, label: bucket.label };
@@ -45,32 +45,6 @@ export function* calculateScheduleLoad({ payload: end }) {
prodJobs.forEach((item) => {
//Add all of the jobs currently in production to the buckets so that we have a starting point.
if (
!item.actual_completion &&
moment(item.scheduled_completion).isBefore(moment().startOf("day"))
) {
problemJobs.push({
...item,
code: "Job was scheduled to go, but it has not been completed. Update the scheduled completion date to correct projections",
});
}
if (
item.actual_completion &&
moment(item.actual_completion).isBefore(moment().startOf("day"))
) {
problemJobs.push({
...item,
code: "Job is already marked as completed, but it is still in production. This job should be removed from production",
});
}
if (!(item.actual_completion || item.scheduled_completion)) {
problemJobs.push({
...item,
code: "Job does not have a scheduled or actual completion date. Update the scheduled or actual completion dates to correct projections",
});
}
const bucketId = CheckJobBucket(buckets, item);
load.productionHours =
load.productionHours +
@@ -85,120 +59,77 @@ export function* calculateScheduleLoad({ payload: end }) {
});
arrJobs.forEach((item) => {
if (!item.scheduled_in) {
if (!item.scheduled_in)
console.log("JOB HAS NO SCHEDULED IN DATE.", item);
problemJobs.push({
...item,
code: "Job has no scheduled in date",
});
}
if (!item.actual_completion && item.actual_in && !item.inproduction) {
problemJobs.push({
...item,
code: "Job has an actual in date, but no actual completion date and is not marked as in production",
});
}
if (item.actual_in && moment(item.actual_in).isAfter(moment())) {
problemJobs.push({
...item,
code: "Job has an actual in date set in the future",
});
}
if (
item.actual_completion &&
moment(item.actual_completion).isAfter(moment())
) {
problemJobs.push({
...item,
code: "Job has an actual completion date set in the future",
});
}
if (item.actual_completion && item.inproduction) {
problemJobs.push({
...item,
code: "Job has an actual completion date but it is still marked in production",
});
}
const itemDate = moment(item.actual_in || item.scheduled_in).format(
"yyyy-MM-DD"
);
const AddJobForSchedulingCalc = !item.inproduction;
const itemDate = moment(item.scheduled_in).format("yyyy-MM-DD");
if (!!load[itemDate]) {
load[itemDate].allHoursIn =
(load[itemDate].allHoursIn || 0) +
load[itemDate].hoursIn =
(load[itemDate].hoursIn || 0) +
item.labhrs.aggregate.sum.mod_lb_hrs +
item.larhrs.aggregate.sum.mod_lb_hrs;
//If the job hasn't already arrived, add it to the jobs in list.
// Make sure it also hasn't already been completed, or isn't an in and out job.
//This prevents the duplicate counting.
load[itemDate].allJobsIn.push(item);
if (AddJobForSchedulingCalc) {
load[itemDate].jobsIn.push(item);
load[itemDate].hoursIn =
(load[itemDate].hoursIn || 0) +
item.labhrs.aggregate.sum.mod_lb_hrs +
item.larhrs.aggregate.sum.mod_lb_hrs;
}
load[itemDate].jobsIn.push(item);
} else {
load[itemDate] = {
allJobsIn: [item],
jobsIn: AddJobForSchedulingCalc ? [item] : [], //Same as above, only add it if it isn't already in production.
jobsIn: [item],
jobsOut: [],
allJobsOut: [],
allHoursIn:
hoursIn:
item.labhrs.aggregate.sum.mod_lb_hrs +
item.larhrs.aggregate.sum.mod_lb_hrs,
hoursIn: AddJobForSchedulingCalc
? item.labhrs.aggregate.sum.mod_lb_hrs +
item.larhrs.aggregate.sum.mod_lb_hrs
: 0,
};
}
});
let problemJobs = [];
compJobs.forEach((item) => {
if (!(item.actual_completion || item.scheduled_completion))
console.warn("JOB HAS NO COMPLETION DATE.", item);
console.log("JOB HAS NO COMPLETION DATE.", item);
const inProdJobs = prodJobs.find((p) => p.id === item.id);
const inArrJobs = arrJobs.find((p) => p.id === item.id);
const AddJobForSchedulingCalc = inProdJobs || inArrJobs;
if (!(inProdJobs || inArrJobs)) {
//Job isn't found in production or coming in.
//is it going today or scheduled to go today?
if (
moment(item.actual_completion || item.scheduled_completion).isSame(
moment(),
"day"
)
) {
console.log("Job is going today anyways, ignore it.", item);
return;
}
if (
moment(item.actual_completion || item.scheduled_completion).isBefore(
moment(),
"day"
)
) {
console.log("Job should have already gone. Ignoring it.", item);
return;
}
problemJobs.push({
...item,
code: "Job is scheduled for completion, but it is not marked in production nor is it an arriving job in this period. Check the scheduled in and completion dates",
});
return;
}
const itemDate = moment(
item.actual_completion || item.scheduled_completion
).format("yyyy-MM-DD");
//Skip it, it's already completed.
if (!!load[itemDate]) {
load[itemDate].allHoursOut =
(load[itemDate].allHoursOut || 0) +
load[itemDate].hoursOut =
(load[itemDate].hoursOut || 0) +
item.labhrs.aggregate.sum.mod_lb_hrs +
item.larhrs.aggregate.sum.mod_lb_hrs;
//Add only the jobs that are still in production to get rid of.
//If it's not in production, we'd subtract unnecessarily.
load[itemDate].allJobsOut.push(item);
if (AddJobForSchedulingCalc) {
load[itemDate].jobsOut.push(item);
load[itemDate].hoursOut =
(load[itemDate].hoursOut || 0) +
item.labhrs.aggregate.sum.mod_lb_hrs +
item.larhrs.aggregate.sum.mod_lb_hrs;
}
load[itemDate].jobsOut.push(item);
} else {
load[itemDate] = {
allJobsOut: [item],
jobsOut: AddJobForSchedulingCalc ? [item] : [], //Same as above.
hoursOut: AddJobForSchedulingCalc
? item.labhrs.aggregate.sum.mod_lb_hrs +
item.larhrs.aggregate.sum.mod_lb_hrs
: 0,
allHoursOut:
jobsOut: [item],
hoursOut:
item.labhrs.aggregate.sum.mod_lb_hrs +
item.larhrs.aggregate.sum.mod_lb_hrs,
};
@@ -206,8 +137,7 @@ export function* calculateScheduleLoad({ payload: end }) {
});
//Propagate the expected load to each day.
const range = Math.round(moment.duration(end.diff(today)).asDays()) + 1;
const range = Math.round(moment.duration(end.diff(today)).asDays());
for (var day = 0; day < range; day++) {
const current = moment(today).add(day, "days").format("yyyy-MM-DD");
const prev = moment(today)
@@ -216,7 +146,6 @@ export function* calculateScheduleLoad({ payload: end }) {
if (!!!load[current]) {
load[current] = {};
}
if (day === 0) {
//Starting on day 1. The load is current.
load[current].expectedLoad = CalculateLoad(
@@ -225,10 +154,6 @@ export function* calculateScheduleLoad({ payload: end }) {
load[current].jobsIn || [],
load[current].jobsOut || []
);
load[current].expectedJobCount =
prodJobs.length +
(load[current].jobsIn || []).length -
(load[current].jobsOut || []).length;
load[current].expectedHours =
load.productionHours +
(load[current].hoursIn || 0) -
@@ -240,10 +165,6 @@ export function* calculateScheduleLoad({ payload: end }) {
load[current].jobsIn || [],
load[current].jobsOut || []
);
load[current].expectedJobCount =
load[prev].expectedJobCount +
(load[current].jobsIn || []).length -
(load[current].jobsOut || []).length;
load[current].expectedHours =
load[prev].expectedHours +
(load[current].hoursIn || 0) -

View File

@@ -49,8 +49,7 @@
"blocked": "Blocked",
"cancelledappointment": "Canceled appointment for: ",
"completingjobs": "Completing Jobs",
"dataconsistency": "{{ro_number}} has a data consistency issue. It may have been excluded for scheduling purposes. CODE: {{code}}.",
"expectedjobs": "Expected Jobs in Production: ",
"dataconsistency": "{{ro_number}} has a data consistency issue. It has been excluded for scheduling purposes. CODE: {{code}}.",
"expectedprodhrs": "Expected Production Hours:",
"history": "History",
"inproduction": "Jobs In Production",
@@ -61,7 +60,6 @@
"priorappointments": "Previous Appointments",
"reminder": "This is {{shopname}} reminding you about an appointment on {{date}} at {{time}}. Please let us know if you are not able to make the appointment. We look forward to seeing you soon. ",
"scheduledfor": "Scheduled appointment for: ",
"severalerrorsfound": "Several jobs have issues which may prevent accurate smart scheduling. Click to expand.",
"smartscheduling": "Smart Scheduling",
"suggesteddates": "Suggested Dates"
},
@@ -1144,7 +1142,6 @@
},
"fields": {
"act_price": "Retail Price",
"ah_detail_line": "Mark as Detail Labor Line (Autohouse Only)",
"db_price": "List Price",
"lbr_types": {
"LA1": "LA1",
@@ -1217,7 +1214,6 @@
"updated": "Job line updated successfully."
},
"validations": {
"ahdetailonlyonuserdefinedtypes": "Detail line indicator can only be set for LA1, LA2, LA3, LA4, and LAU labor types.",
"hrsrequirediflbrtyp": "Labor hours are required if a labor type is selected. Clear the labor type if there are no labor hours.",
"requiredifparttype": "Required if a part type has been specified.",
"zeropriceexistingpart": "This line cannot have any price since it uses an existing part."
@@ -1698,7 +1694,6 @@
"partstotal": "This is the total of all parts and sublet amounts on the vehicle (some of these may require an in-house invoice).<br/>\nItems such as shop and paint materials, labor online lines, etc. are not included in this total.",
"totalreturns": "The total <b>retail</b> amount of returns created for this job."
},
"profileadjustments": "",
"prt_dsmk_total": "Line Item Adjustment",
"rates": "Rates",
"rates_subtotal": "All Rates Subtotal",
@@ -2426,9 +2421,6 @@
"export_payables": "Export Log - Payables",
"export_payments": "Export Log - Payments",
"export_receivables": "Export Log - Receivables",
"gsr_by_atp": "",
"gsr_by_ats": "Gross Sales by ATS",
"gsr_by_category": "Gross Sales by Category",
"gsr_by_csr": "Gross Sales by CSR",
"gsr_by_delivery_date": "Gross Sales by Delivery Date",
"gsr_by_estimator": "Gross Sales by Estimator",
@@ -2459,15 +2451,12 @@
"job_costing_ro_date_summary": "Job Costing by RO - Summary",
"job_costing_ro_estimator": "Job Costing by Estimator",
"job_costing_ro_ins_co": "Job Costing by RO Source",
"jobs_completed_not_invoiced": "Jobs Completed not Invoiced",
"jobs_invoiced_not_exported": "Jobs Invoiced not Exported",
"jobs_reconcile": "Parts/Sublet/Labor Reconciliation",
"lag_time": "Lag Time",
"open_orders": "Open Orders by Date",
"open_orders_csr": "Open Orders by CSR",
"open_orders_estimator": "Open Orders by Estimator",
"open_orders_ins_co": "Open Orders by Insurance Company",
"open_orders_specific_csr": "Open Orders filtered by CSR",
"open_orders_status": "Open Orders by Status",
"parts_backorder": "IOU Parts List",
"parts_not_recieved": "Parts Not Received",
@@ -2485,10 +2474,7 @@
"production_by_target_date": "Production by Target Date",
"production_by_technician": "Production by Technician",
"production_by_technician_one": "Production filtered by Technician",
"production_over_time": "Production Level over Time",
"psr_by_make": "Percent of Sales by Vehicle Make",
"purchase_return_ratio_grouped_by_vendor_detail": "Purchase & Return Ratio by Vendor (Detail)",
"purchase_return_ratio_grouped_by_vendor_summary": "Purchase & Return Ratio by Vendor (Summary)",
"purchases_by_cost_center_detail": "Purchases by Cost Center (Detail)",
"purchases_by_cost_center_summary": "Purchases by Cost Center (Summary)",
"purchases_by_date_range_detail": "Purchases by Date - Detail",
@@ -2500,7 +2486,6 @@
"returns_grouped_by_vendor_detailed": "Returns Grouped by Vendor - Detailed",
"returns_grouped_by_vendor_summary": "Returns Grouped by Vendor - Summary",
"schedule": "Appointment Schedule",
"scheduled_parts_list": "Parts for Jobs Scheduled In",
"scoreboard_detail": "Scoreboard Detail",
"scoreboard_summary": "Scoreboard Summary",
"supplement_ratio_ins_co": "Supplement Ratio by Source",
@@ -2759,9 +2744,7 @@
"photourl": "Avatar URL"
},
"labels": {
"actions": "Actions",
"changepassword": "Change Password",
"profileinfo": "Profile Info"
"actions": "Actions"
},
"successess": {
"passwordchanged": "Password changed successfully. "

View File

@@ -50,7 +50,6 @@
"cancelledappointment": "Cita cancelada para:",
"completingjobs": "",
"dataconsistency": "",
"expectedjobs": "",
"expectedprodhrs": "",
"history": "",
"inproduction": "",
@@ -61,7 +60,6 @@
"priorappointments": "Nombramientos previos",
"reminder": "",
"scheduledfor": "Cita programada para:",
"severalerrorsfound": "",
"smartscheduling": "",
"suggesteddates": ""
},
@@ -1144,7 +1142,6 @@
},
"fields": {
"act_price": "Precio actual",
"ah_detail_line": "",
"db_price": "Precio de base de datos",
"lbr_types": {
"LA1": "",
@@ -1217,7 +1214,6 @@
"updated": ""
},
"validations": {
"ahdetailonlyonuserdefinedtypes": "",
"hrsrequirediflbrtyp": "",
"requiredifparttype": "",
"zeropriceexistingpart": ""
@@ -1698,7 +1694,6 @@
"partstotal": "",
"totalreturns": ""
},
"profileadjustments": "",
"prt_dsmk_total": "",
"rates": "Tarifas",
"rates_subtotal": "",
@@ -2426,9 +2421,6 @@
"export_payables": "",
"export_payments": "",
"export_receivables": "",
"gsr_by_atp": "",
"gsr_by_ats": "",
"gsr_by_category": "",
"gsr_by_csr": "",
"gsr_by_delivery_date": "",
"gsr_by_estimator": "",
@@ -2459,15 +2451,12 @@
"job_costing_ro_date_summary": "",
"job_costing_ro_estimator": "",
"job_costing_ro_ins_co": "",
"jobs_completed_not_invoiced": "",
"jobs_invoiced_not_exported": "",
"jobs_reconcile": "",
"lag_time": "",
"open_orders": "",
"open_orders_csr": "",
"open_orders_estimator": "",
"open_orders_ins_co": "",
"open_orders_specific_csr": "",
"open_orders_status": "",
"parts_backorder": "",
"parts_not_recieved": "",
@@ -2485,10 +2474,7 @@
"production_by_target_date": "",
"production_by_technician": "",
"production_by_technician_one": "",
"production_over_time": "",
"psr_by_make": "",
"purchase_return_ratio_grouped_by_vendor_detail": "",
"purchase_return_ratio_grouped_by_vendor_summary": "",
"purchases_by_cost_center_detail": "",
"purchases_by_cost_center_summary": "",
"purchases_by_date_range_detail": "",
@@ -2500,7 +2486,6 @@
"returns_grouped_by_vendor_detailed": "",
"returns_grouped_by_vendor_summary": "",
"schedule": "",
"scheduled_parts_list": "",
"scoreboard_detail": "",
"scoreboard_summary": "",
"supplement_ratio_ins_co": "",
@@ -2759,9 +2744,7 @@
"photourl": "URL de avatar"
},
"labels": {
"actions": "",
"changepassword": "",
"profileinfo": ""
"actions": ""
},
"successess": {
"passwordchanged": ""

View File

@@ -50,7 +50,6 @@
"cancelledappointment": "Rendez-vous annulé pour:",
"completingjobs": "",
"dataconsistency": "",
"expectedjobs": "",
"expectedprodhrs": "",
"history": "",
"inproduction": "",
@@ -61,7 +60,6 @@
"priorappointments": "Rendez-vous précédents",
"reminder": "",
"scheduledfor": "Rendez-vous prévu pour:",
"severalerrorsfound": "",
"smartscheduling": "",
"suggesteddates": ""
},
@@ -1144,7 +1142,6 @@
},
"fields": {
"act_price": "Prix actuel",
"ah_detail_line": "",
"db_price": "Prix de la base de données",
"lbr_types": {
"LA1": "",
@@ -1217,7 +1214,6 @@
"updated": ""
},
"validations": {
"ahdetailonlyonuserdefinedtypes": "",
"hrsrequirediflbrtyp": "",
"requiredifparttype": "",
"zeropriceexistingpart": ""
@@ -1698,7 +1694,6 @@
"partstotal": "",
"totalreturns": ""
},
"profileadjustments": "",
"prt_dsmk_total": "",
"rates": "Les taux",
"rates_subtotal": "",
@@ -2426,9 +2421,6 @@
"export_payables": "",
"export_payments": "",
"export_receivables": "",
"gsr_by_atp": "",
"gsr_by_ats": "",
"gsr_by_category": "",
"gsr_by_csr": "",
"gsr_by_delivery_date": "",
"gsr_by_estimator": "",
@@ -2459,15 +2451,12 @@
"job_costing_ro_date_summary": "",
"job_costing_ro_estimator": "",
"job_costing_ro_ins_co": "",
"jobs_completed_not_invoiced": "",
"jobs_invoiced_not_exported": "",
"jobs_reconcile": "",
"lag_time": "",
"open_orders": "",
"open_orders_csr": "",
"open_orders_estimator": "",
"open_orders_ins_co": "",
"open_orders_specific_csr": "",
"open_orders_status": "",
"parts_backorder": "",
"parts_not_recieved": "",
@@ -2485,10 +2474,7 @@
"production_by_target_date": "",
"production_by_technician": "",
"production_by_technician_one": "",
"production_over_time": "",
"psr_by_make": "",
"purchase_return_ratio_grouped_by_vendor_detail": "",
"purchase_return_ratio_grouped_by_vendor_summary": "",
"purchases_by_cost_center_detail": "",
"purchases_by_cost_center_summary": "",
"purchases_by_date_range_detail": "",
@@ -2500,7 +2486,6 @@
"returns_grouped_by_vendor_detailed": "",
"returns_grouped_by_vendor_summary": "",
"schedule": "",
"scheduled_parts_list": "",
"scoreboard_detail": "",
"scoreboard_summary": "",
"supplement_ratio_ins_co": "",
@@ -2759,9 +2744,7 @@
"photourl": "URL de l'avatar"
},
"labels": {
"actions": "",
"changepassword": "",
"profileinfo": ""
"actions": ""
},
"successess": {
"passwordchanged": ""

View File

@@ -1343,32 +1343,6 @@ export const TemplateList = (type, context) => {
},
group: "sales",
},
gsr_by_category: {
title: i18n.t("reportcenter.templates.gsr_by_category"),
description: "",
subject: i18n.t("reportcenter.templates.gsr_by_category"),
key: "gsr_by_category",
//idtype: "vendor",
disabled: false,
rangeFilter: {
object: i18n.t("reportcenter.labels.objects.jobs"),
field: i18n.t("jobs.fields.date_invoiced"),
},
group: "sales",
},
gsr_by_ats: {
title: i18n.t("reportcenter.templates.gsr_by_ats"),
description: "",
subject: i18n.t("reportcenter.templates.gsr_by_ats"),
key: "gsr_by_ats",
//idtype: "vendor",
disabled: false,
rangeFilter: {
object: i18n.t("reportcenter.labels.objects.jobs"),
field: i18n.t("jobs.fields.date_invoiced"),
},
group: "sales",
},
gsr_labor_only: {
title: i18n.t("reportcenter.templates.gsr_labor_only"),
description: "",
@@ -1447,19 +1421,6 @@ export const TemplateList = (type, context) => {
},
group: "jobs",
},
open_orders_specific_csr: {
title: i18n.t("reportcenter.templates.open_orders_specific_csr"),
description: "",
subject: i18n.t("reportcenter.templates.open_orders_specific_csr"),
key: "open_orders_specific_csr",
idtype: "employee",
disabled: false,
rangeFilter: {
object: i18n.t("reportcenter.labels.objects.jobs"),
field: i18n.t("jobs.fields.date_open"),
},
group: "jobs",
},
export_payables: {
title: i18n.t("reportcenter.templates.export_payables"),
description: "",
@@ -1773,88 +1734,6 @@ export const TemplateList = (type, context) => {
},
group: "jobs",
},
scheduled_parts_list: {
title: i18n.t("reportcenter.templates.scheduled_parts_list"),
subject: i18n.t("reportcenter.templates.scheduled_parts_list"),
key: "scheduled_parts_list",
//idtype: "vendor",
disabled: false,
rangeFilter: {
object: i18n.t("reportcenter.labels.objects.jobs"),
field: i18n.t("jobs.fields.scheduled_in"),
},
group: "jobs",
},
jobs_completed_not_invoiced: {
title: i18n.t("reportcenter.templates.jobs_completed_not_invoiced"),
subject: i18n.t(
"reportcenter.templates.jobs_completed_not_invoiced"
),
key: "jobs_completed_not_invoiced",
//idtype: "vendor",
disabled: false,
rangeFilter: {
object: i18n.t("reportcenter.labels.objects.jobs"),
field: i18n.t("jobs.fields.date_invoiced"),
},
group: "jobs",
},
jobs_invoiced_not_exported: {
title: i18n.t("reportcenter.templates.jobs_invoiced_not_exported"),
subject: i18n.t(
"reportcenter.templates.jobs_invoiced_not_exported"
),
key: "jobs_invoiced_not_exported",
//idtype: "vendor",
disabled: false,
rangeFilter: {
object: i18n.t("reportcenter.labels.objects.jobs"),
field: i18n.t("jobs.fields.date_invoiced"),
},
group: "jobs",
},
purchase_return_ratio_grouped_by_vendor_detail: {
title: i18n.t("reportcenter.templates.purchase_return_ratio_grouped_by_vendor_detail"),
subject: i18n.t(
"reportcenter.templates.purchase_return_ratio_grouped_by_vendor_detail"
),
key: "purchase_return_ratio_grouped_by_vendor_detail",
//idtype: "vendor",
disabled: false,
rangeFilter: {
object: i18n.t("reportcenter.labels.objects.bills"),
field: i18n.t("bills.fields.date"),
},
group: "purchases",
},
purchase_return_ratio_grouped_by_vendor_summary: {
title: i18n.t("reportcenter.templates.purchase_return_ratio_grouped_by_vendor_summary"),
subject: i18n.t(
"reportcenter.templates.purchase_return_ratio_grouped_by_vendor_summary"
),
key: "purchase_return_ratio_grouped_by_vendor_summary",
//idtype: "vendor",
disabled: false,
rangeFilter: {
object: i18n.t("reportcenter.labels.objects.bills"),
field: i18n.t("bills.fields.date"),
},
group: "purchases",
},
production_over_time: {
title: i18n.t("reportcenter.templates.production_over_time"),
subject: i18n.t(
"reportcenter.templates.production_over_time"
),
key: "production_over_time",
//idtype: "vendor",
disabled: false,
rangeFilter: {
object: i18n.t("reportcenter.labels.objects.jobs"),
field: i18n.t("jobs.fields.actual_in"),
},
group: "jobs",
},
}
: {}),
...(!type || type === "courtesycarcontract"

View File

@@ -1,10 +1,6 @@
export default function UndefinedToNull(obj, keys) {
export default function UndefinedToNull(obj) {
Object.keys(obj).forEach((key) => {
if (keys && keys.indexOf(key) >= 0) {
if (obj[key] === undefined) obj[key] = null;
} else {
if (obj[key] === undefined) obj[key] = null;
}
});
return obj;
}

View File

@@ -2482,7 +2482,6 @@
_eq: true
columns:
- act_price
- ah_detail_line
- alt_co_id
- alt_overrd
- alt_part_i
@@ -2548,7 +2547,6 @@
permission:
columns:
- act_price
- ah_detail_line
- alt_co_id
- alt_overrd
- alt_part_i
@@ -2625,7 +2623,6 @@
permission:
columns:
- act_price
- ah_detail_line
- alt_co_id
- alt_overrd
- alt_part_i
@@ -4502,62 +4499,6 @@
_eq: X-Hasura-User-Id
- active:
_eq: true
- table:
name: payment_response
schema: public
object_relationships:
- name: bodyshop
using:
foreign_key_constraint_on: bodyshopid
- name: job
using:
foreign_key_constraint_on: jobid
- name: payment
using:
foreign_key_constraint_on: paymentid
insert_permissions:
- role: user
permission:
check:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
columns:
- amount
- bodyshopid
- declinereason
- ext_paymentid
- jobid
- paymentid
- response
- successful
select_permissions:
- role: user
permission:
columns:
- successful
- response
- amount
- declinereason
- ext_paymentid
- bodyshopid
- id
- jobid
- paymentid
filter:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
- table:
name: payments
schema: public

View File

@@ -1,4 +0,0 @@
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- alter table "public"."joblines" add column "ah_detail_line" boolean
-- not null default 'false';

View File

@@ -1,2 +0,0 @@
alter table "public"."joblines" add column "ah_detail_line" boolean
not null default 'false';

View File

@@ -1,10 +0,0 @@
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- CREATE OR REPLACE VIEW "public"."joblines_status" AS
-- SELECT j.jobid,
-- j.status,
-- count(1) AS count,
-- j.part_type
-- FROM joblines j
-- WHERE ((j.part_type IS NOT NULL) AND (j.part_type <> 'PAE'::text) AND (j.part_type <> 'PAS'::text) AND (j.part_type <> 'PASL'::text) AND (j.removed IS FALSE))
-- GROUP BY j.jobid, j.status, j.part_type;

View File

@@ -1,8 +0,0 @@
CREATE OR REPLACE VIEW "public"."joblines_status" AS
SELECT j.jobid,
j.status,
count(1) AS count,
j.part_type
FROM joblines j
WHERE ((j.part_type IS NOT NULL) AND (j.part_type <> 'PAE'::text) AND (j.part_type <> 'PAS'::text) AND (j.part_type <> 'PASL'::text) AND (j.removed IS FALSE))
GROUP BY j.jobid, j.status, j.part_type;

View File

@@ -1 +0,0 @@
DROP INDEX IF EXISTS "public"."exportlog_billid";

View File

@@ -1,2 +0,0 @@
CREATE INDEX "exportlog_billid" on
"public"."exportlog" using btree ("billid");

View File

@@ -1 +0,0 @@
DROP INDEX IF EXISTS "public"."exportlog_jobid";

View File

@@ -1,2 +0,0 @@
CREATE INDEX "exportlog_jobid" on
"public"."exportlog" using btree ("jobid");

View File

@@ -1 +0,0 @@
DROP INDEX IF EXISTS "public"."exportlog_payments";

View File

@@ -1,2 +0,0 @@
CREATE INDEX "exportlog_payments" on
"public"."exportlog" using btree ("paymentid");

View File

@@ -1 +0,0 @@
DROP INDEX IF EXISTS "public"."jobs_idx_date_open";

View File

@@ -1,2 +0,0 @@
CREATE INDEX "jobs_idx_date_open" on
"public"."jobs" using btree ("date_open");

View File

@@ -1 +0,0 @@
DROP INDEX IF EXISTS "public"."jobs_idx_date_invoiced";

View File

@@ -1,2 +0,0 @@
CREATE INDEX "jobs_idx_date_invoiced" on
"public"."jobs" using btree ("date_invoiced");

View File

@@ -1 +0,0 @@
DROP INDEX IF EXISTS "public"."idx_bills_vendorid";

View File

@@ -1,2 +0,0 @@
CREATE INDEX "idx_bills_vendorid" on
"public"."bills" using btree ("vendorid");

View File

@@ -1 +0,0 @@
DROP INDEX IF EXISTS "public"."idx_parts_orders_vendorid";

View File

@@ -1,2 +0,0 @@
CREATE INDEX "idx_parts_orders_vendorid" on
"public"."parts_orders" using btree ("vendorid");

View File

@@ -1 +0,0 @@
DROP INDEX IF EXISTS "public"."idx_ccc_jobid";

View File

@@ -1,2 +0,0 @@
CREATE INDEX "idx_ccc_jobid" on
"public"."cccontracts" using btree ("jobid");

View File

@@ -1 +0,0 @@
DROP INDEX IF EXISTS "public"."idx_ccc_courtesycarid";

View File

@@ -1,2 +0,0 @@
CREATE INDEX "idx_ccc_courtesycarid" on
"public"."cccontracts" using btree ("courtesycarid");

View File

@@ -1 +0,0 @@
DROP INDEX IF EXISTS "public"."idx_jobs_actual_completion";

View File

@@ -1,2 +0,0 @@
CREATE INDEX "idx_jobs_actual_completion" on
"public"."jobs" using btree ("actual_completion");

View File

@@ -1 +0,0 @@
DROP INDEX IF EXISTS "public"."idx_jobs_actual_in";

View File

@@ -1,2 +0,0 @@
CREATE INDEX "idx_jobs_actual_in" on
"public"."jobs" using btree ("actual_in");

View File

@@ -1 +0,0 @@
DROP INDEX IF EXISTS "public"."idx_jobs_employee_csr";

View File

@@ -1,2 +0,0 @@
CREATE INDEX "idx_jobs_employee_csr" on
"public"."jobs" using btree ("employee_csr");

View File

@@ -1 +0,0 @@
DROP INDEX IF EXISTS "public"."idx_jobs_body_csr";

View File

@@ -1,2 +0,0 @@
CREATE INDEX "idx_jobs_body_csr" on
"public"."jobs" using btree ("employee_body");

View File

@@ -1 +0,0 @@
DROP INDEX IF EXISTS "public"."idx_jobs_employee_refinish";

View File

@@ -1,2 +0,0 @@
CREATE INDEX "idx_jobs_employee_refinish" on
"public"."jobs" using btree ("employee_refinish");

View File

@@ -1 +0,0 @@
DROP INDEX IF EXISTS "public"."idx_timetickets_employeeid";

View File

@@ -1,2 +0,0 @@
CREATE INDEX "idx_timetickets_employeeid" on
"public"."timetickets" using btree ("employeeid");

View File

@@ -1 +0,0 @@
DROP INDEX IF EXISTS "public"."idx_timetickets_cost_center";

View File

@@ -1,2 +0,0 @@
CREATE INDEX "idx_timetickets_cost_center" on
"public"."timetickets" using btree ("cost_center");

View File

@@ -1 +0,0 @@
DROP INDEX IF EXISTS "public"."idx_scoreboard_jobid";

View File

@@ -1,2 +0,0 @@
CREATE INDEX "idx_scoreboard_jobid" on
"public"."scoreboard" using btree ("jobid");

View File

@@ -1 +0,0 @@
DROP INDEX IF EXISTS "public"."idx_scoreboard_date";

View File

@@ -1,2 +0,0 @@
CREATE INDEX "idx_scoreboard_date" on
"public"."scoreboard" using btree ("date");

View File

@@ -1 +0,0 @@
DROP INDEX IF EXISTS "public"."idx_payments_date";

View File

@@ -1,2 +0,0 @@
CREATE INDEX "idx_payments_date" on
"public"."payments" using btree ("date");

View File

@@ -1 +0,0 @@
DROP INDEX IF EXISTS "public"."exportlog_createdat";

View File

@@ -1,2 +0,0 @@
CREATE INDEX "exportlog_createdat" on
"public"."exportlog" using btree ("created_at");

View File

@@ -1 +0,0 @@
DROP INDEX IF EXISTS "public"."idx_transitions_jobid";

View File

@@ -1,2 +0,0 @@
CREATE INDEX "idx_transitions_jobid" on
"public"."transitions" using btree ("jobid");

View File

@@ -1 +0,0 @@
DROP INDEX IF EXISTS "public"."idx_transitions_start";

View File

@@ -1,2 +0,0 @@
CREATE INDEX "idx_transitions_start" on
"public"."transitions" using btree ("start");

View File

@@ -1 +0,0 @@
DROP INDEX IF EXISTS "public"."idx_transitions_end";

View File

@@ -1,2 +0,0 @@
CREATE INDEX "idx_transitions_end" on
"public"."transitions" using btree ("end");

View File

@@ -1 +0,0 @@
DROP INDEX IF EXISTS "public"."idx_audit_bodyshopid";

View File

@@ -1,2 +0,0 @@
CREATE INDEX "idx_audit_bodyshopid" on
"public"."audit_trail" using btree ("bodyshopid");

View File

@@ -1 +0,0 @@
DROP INDEX IF EXISTS "public"."idx_audit_jobid";

View File

@@ -1,2 +0,0 @@
CREATE INDEX "idx_audit_jobid" on
"public"."audit_trail" using btree ("jobid");

View File

@@ -1 +0,0 @@
DROP INDEX IF EXISTS "public"."idx_audit_billid";

View File

@@ -1,2 +0,0 @@
CREATE INDEX "idx_audit_billid" on
"public"."audit_trail" using btree ("billid");

View File

@@ -1,11 +0,0 @@
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- CREATE INDEX idx_phonebook_firstname ON public.phonebook USING gin (firstname public.gin_trgm_ops);
-- CREATE INDEX idx_phonebook_lastname ON public.phonebook USING gin (lastname public.gin_trgm_ops);
-- CREATE INDEX idx_phonebook_company ON public.phonebook USING gin (company public.gin_trgm_ops);
-- CREATE INDEX idx_phonebook_address1 ON public.phonebook USING gin (address1 public.gin_trgm_ops);
-- CREATE INDEX idx_phonebook_phone1 ON public.phonebook USING gin (phone1 public.gin_trgm_ops);
-- CREATE INDEX idx_phonebook_phone2 ON public.phonebook USING gin (phone2 public.gin_trgm_ops);
-- CREATE INDEX idx_phonebook_email ON public.phonebook USING gin (email public.gin_trgm_ops);
-- CREATE INDEX idx_phonebook_category ON public.phonebook USING gin (category public.gin_trgm_ops);
-- CREATE INDEX idx_vendor_name ON public.vendors USING gin (name public.gin_trgm_ops);

View File

@@ -1,9 +0,0 @@
CREATE INDEX idx_phonebook_firstname ON public.phonebook USING gin (firstname public.gin_trgm_ops);
CREATE INDEX idx_phonebook_lastname ON public.phonebook USING gin (lastname public.gin_trgm_ops);
CREATE INDEX idx_phonebook_company ON public.phonebook USING gin (company public.gin_trgm_ops);
CREATE INDEX idx_phonebook_address1 ON public.phonebook USING gin (address1 public.gin_trgm_ops);
CREATE INDEX idx_phonebook_phone1 ON public.phonebook USING gin (phone1 public.gin_trgm_ops);
CREATE INDEX idx_phonebook_phone2 ON public.phonebook USING gin (phone2 public.gin_trgm_ops);
CREATE INDEX idx_phonebook_email ON public.phonebook USING gin (email public.gin_trgm_ops);
CREATE INDEX idx_phonebook_category ON public.phonebook USING gin (category public.gin_trgm_ops);
CREATE INDEX idx_vendor_name ON public.vendors USING gin (name public.gin_trgm_ops);

View File

@@ -1 +0,0 @@
DROP TABLE "public"."payment_response";

View File

@@ -1,2 +0,0 @@
CREATE TABLE "public"."payment_response" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "bodyshopid" uuid NOT NULL, "jobid" uuid, "paymentid" uuid, "successful" boolean NOT NULL DEFAULT false, "ext_paymentid" text NOT NULL, "amount" numeric NOT NULL, "declinereason" text, "response" jsonb NOT NULL DEFAULT jsonb_build_object(), PRIMARY KEY ("id") , FOREIGN KEY ("bodyshopid") REFERENCES "public"."bodyshops"("id") ON UPDATE cascade ON DELETE cascade, FOREIGN KEY ("jobid") REFERENCES "public"."jobs"("id") ON UPDATE cascade ON DELETE cascade, FOREIGN KEY ("paymentid") REFERENCES "public"."payments"("id") ON UPDATE cascade ON DELETE cascade);
CREATE EXTENSION IF NOT EXISTS pgcrypto;

43065
logs/oAuthClient-log.log Normal file

File diff suppressed because one or more lines are too long

View File

@@ -7,7 +7,7 @@
"npm": ">=8.0.0"
},
"scripts": {
"setup": "rm -rf node_modules && yarn && cd client && rm -rf node_modules && yarn",
"setup": "yarn && cd client && yarn",
"admin": "cd admin && yarn start",
"client": "cd client && yarn start",
"server": "nodemon server.js",

View File

@@ -214,30 +214,6 @@ const CreateRepairOrderTag = (job, errorCallback) => {
const repairCosts = CreateCosts(job);
if (job.ro_number === "QBD209") {
console.log("Stop here");
}
//Calculate detail only lines.
const detailAdjustments = job.joblines
.filter((jl) => jl.ah_detail_line && jl.mod_lbr_ty)
.reduce(
(acc, val) => {
return {
hours: acc.hours + val.mod_lb_hrs,
amount: acc.amount.add(
Dinero({
amount: Math.round(
(job.job_totals.rates[val.mod_lbr_ty.toLowerCase()].rate || 0) *
val.mod_lb_hrs *
100
),
})
),
};
},
{ hours: 0, amount: Dinero() }
);
try {
const ret = {
RepairOrderInformation: {
@@ -429,7 +405,7 @@ const CreateRepairOrderTag = (job, errorCallback) => {
ElectricalRate: job.rate_lae || 0,
FrameRate: job.rate_laf || 0,
GlassRate: job.rate_lag || 0,
DetailRate: 0, // job.rate_lad || 0,
DetailRate: job.rate_lad || 0,
LaborMiscRate: 0,
PMRate: job.rate_mapa || 0,
BMRate: job.rate_mash || 0,
@@ -524,14 +500,13 @@ const CreateRepairOrderTag = (job, errorCallback) => {
ElectricalHours: job.job_totals.rates.lae.hours.toFixed(2),
FrameHours: job.job_totals.rates.laf.hours.toFixed(2),
GlassHours: job.job_totals.rates.lag.hours.toFixed(2),
DetailHours: detailAdjustments.hours, //job.job_totals.rates.lad.hours.toFixed(2),
DetailHours: job.job_totals.rates.lad.hours.toFixed(2),
LaborMiscHours: (
job.job_totals.rates.la1.hours +
job.job_totals.rates.la2.hours +
job.job_totals.rates.la3.hours +
job.job_totals.rates.la4.hours +
job.job_totals.rates.lau.hours -
detailAdjustments.hours
job.job_totals.rates.lau.hours
).toFixed(2),
PartsTotal: Dinero(job.job_totals.parts.parts.total).toFormat(
@@ -610,18 +585,16 @@ const CreateRepairOrderTag = (job, errorCallback) => {
),
GlassLaborTotalCost:
repairCosts.GlassLaborTotalCost.toFormat(AHDineroFormat),
DetailLaborTotal: detailAdjustments.amount.toFormat(AHDineroFormat),
// Dinero(job.job_totals.rates.lad.total).toFormat(
// AHDineroFormat
// ),
DetailLaborTotalCost: Dinero().toFormat(AHDineroFormat),
// repairCosts.DetailLaborTotalCost.toFormat(AHDineroFormat),
DetailLaborTotal: Dinero(job.job_totals.rates.lad.total).toFormat(
AHDineroFormat
),
DetailLaborTotalCost:
repairCosts.DetailLaborTotalCost.toFormat(AHDineroFormat),
LaborMiscTotal: Dinero(job.job_totals.rates.la1.total)
.add(Dinero(job.job_totals.rates.la2.total))
.add(Dinero(job.job_totals.rates.la3.total))
.add(Dinero(job.job_totals.rates.la4.total))
.add(Dinero(job.job_totals.rates.lau.total))
.subtract(detailAdjustments.amount)
.toFormat(AHDineroFormat),
LaborMiscTotalCost: 0,
MiscellaneousChargeTotal: 0,
@@ -646,7 +619,7 @@ const CreateRepairOrderTag = (job, errorCallback) => {
AHDineroFormat
),
StorageTotalCost: repairCosts.StorageTotalCost.toFormat(AHDineroFormat),
DetailTotal: detailAdjustments.amount.toFormat(AHDineroFormat),
DetailTotal: 0,
DetailTotalCost: 0,
SalesTaxTotal: Dinero(job.job_totals.totals.local_tax)
.add(Dinero(job.job_totals.totals.state_tax))
@@ -893,14 +866,8 @@ const CreateCosts = (job) => {
ticketTotalsByCostCenter[defaultCosts.LAE] || Dinero(),
FrameLaborTotalCost: ticketTotalsByCostCenter[defaultCosts.LAF] || Dinero(),
GlassLaborTotalCost: ticketTotalsByCostCenter[defaultCosts.LAG] || Dinero(),
DetailLaborTotalCost: Dinero(),
// ticketTotalsByCostCenter[defaultCosts.LAD] || Dinero(),
LaborMiscTotalCost: (ticketTotalsByCostCenter[defaultCosts.LA1] || Dinero())
.add(ticketTotalsByCostCenter[defaultCosts.LA2] || Dinero())
.add(ticketTotalsByCostCenter[defaultCosts.LA2] || Dinero())
.add(ticketTotalsByCostCenter[defaultCosts.LA3] || Dinero())
.add(ticketTotalsByCostCenter[defaultCosts.LA4] || Dinero())
.add(ticketTotalsByCostCenter[defaultCosts.LAU] || Dinero()),
DetailLaborTotalCost:
ticketTotalsByCostCenter[defaultCosts.LAD] || Dinero(),
PMTotalCost: billTotalsByCostCenters[defaultCosts.MAPA] || Dinero(),
BMTotalCost: billTotalsByCostCenters[defaultCosts.MASH] || Dinero(),
MiscTotalCost: billTotalsByCostCenters[defaultCosts.PAO] || Dinero(),

View File

@@ -23,12 +23,11 @@ let transporter = nodemailer.createTransport({
});
exports.sendServerEmail = async function ({ subject, text }) {
if (process.env.NODE_ENV === undefined) return;
try {
transporter.sendMail(
{
from: `ImEX Online API - ${process.env.NODE_ENV} <noreply@imex.online>`,
to: ["patrick@imexsystems.ca"],
to: ["patrick@snapt.ca"],
subject: subject,
text: text,
ses: {

View File

@@ -536,16 +536,7 @@ exports.QUERY_UPCOMING_APPOINTMENTS = `query QUERY_UPCOMING_APPOINTMENTS($now: t
arrJobs: jobs(where: {scheduled_in: {_gte: $now}, suspended: {_eq: false}}) {
id
scheduled_in
actual_in
scheduled_completion
ro_number
ownr_fn
ownr_ln
ownr_co_nm
alt_transport
actual_completion
inproduction
status
labhrs: joblines_aggregate(where: {mod_lbr_ty: {_neq: "LAR"}, removed: {_eq: false}}) {
aggregate {
sum {
@@ -563,15 +554,9 @@ exports.QUERY_UPCOMING_APPOINTMENTS = `query QUERY_UPCOMING_APPOINTMENTS($now: t
}
compJobs: jobs(where: {_and: [{suspended: {_eq: false}}, {_or: [{scheduled_completion: {_gte: $now}}, {actual_completion: {_gte: $now}}]}]}) {
id
status
ro_number
scheduled_completion
actual_completion
scheduled_in
ownr_fn
ownr_ln
ownr_co_nm
inproduction
labhrs: joblines_aggregate(where: {mod_lbr_ty: {_neq: "LAR"}, removed: {_eq: false}}) {
aggregate {
sum {
@@ -589,20 +574,15 @@ exports.QUERY_UPCOMING_APPOINTMENTS = `query QUERY_UPCOMING_APPOINTMENTS($now: t
}
prodJobs: jobs(where: {inproduction: {_eq: true}, suspended: {_eq: false}}) {
id
actual_in
scheduled_in
actual_completion
scheduled_completion
inproduction
ro_number
labhrs: joblines_aggregate(where: {mod_lbr_ty: {_neq: "LAR"}, removed: {_eq: false}}) {
labhrs: joblines_aggregate(where: {_and: [{mod_lbr_ty: {_neq: "LAR"}}, {removed: {_eq: false}}]}) {
aggregate {
sum {
mod_lb_hrs
}
}
}
larhrs: joblines_aggregate(where: {mod_lbr_ty: {_eq: "LAR"}, removed: {_eq: false}}) {
larhrs: joblines_aggregate(where: {_and: [{mod_lbr_ty: {_eq: "LAR"}}, {removed: {_eq: false}}]}) {
aggregate {
sum {
mod_lb_hrs
@@ -610,8 +590,7 @@ exports.QUERY_UPCOMING_APPOINTMENTS = `query QUERY_UPCOMING_APPOINTMENTS($now: t
}
}
}
}
`;
}`;
exports.QUERY_EMPLOYEE_PIN = `query QUERY_EMPLOYEE_PIN($shopId: uuid!, $employeeId: String!) {
employees(where: {_and: {shopid: {_eq: $shopId}, employee_number: {_eq: $employeeId}}}) {
@@ -736,7 +715,6 @@ exports.AUTOHOUSE_QUERY = `query AUTOHOUSE_EXPORT($start: timestamptz, $bodyshop
lbr_op
profitcenter_part
profitcenter_labor
ah_detail_line
parts_order_lines(order_by: {parts_order: {order_date: desc_nulls_last}} limit: 1){
parts_order{
id

View File

@@ -41,9 +41,9 @@ exports.job = async (req, res) => {
(bucket) =>
bucket.gte <= jobHrs && (!!bucket.lt ? bucket.lt > jobHrs : true)
)[0];
const load = {
productionTotal: {},
productionHours: 0,
};
//Set the current load.
ssbuckets.forEach((bucket) => {
@@ -70,6 +70,27 @@ exports.job = async (req, res) => {
// );
const filteredArrJobs = [];
// filteredArrJobs.forEach((item) => {
// const itemDate = moment(item.scheduled_in)
// .tz(timezone)
// .format("yyyy-MM-DD");
// if (!!load[itemDate]) {
// load[itemDate].hoursIn =
// (load[itemDate].hoursIn || 0) +
// item.labhrs.aggregate.sum.mod_lb_hrs +
// item.larhrs.aggregate.sum.mod_lb_hrs;
// load[itemDate].jobsIn.push(item);
// } else {
// load[itemDate] = {
// jobsIn: [item],
// jobsOut: [],
// hoursIn:
// item.labhrs.aggregate.sum.mod_lb_hrs +
// item.larhrs.aggregate.sum.mod_lb_hrs,
// };
// }
// });
arrJobs.forEach((item) => {
let isSameBucket = false;
if (JobBucket.id === CheckJobBucket(ssbuckets, item)) {
@@ -81,27 +102,21 @@ exports.job = async (req, res) => {
item.labhrs.aggregate.sum.mod_lb_hrs +
item.larhrs.aggregate.sum.mod_lb_hrs;
const AddJobForSchedulingCalc = !item.inproduction;
const itemDate = moment(item.actual_in || item.scheduled_in)
const itemDate = moment(item.scheduled_in)
.tz(timezone)
.format("yyyy-MM-DD");
if (isSameBucket) {
if (!!load[itemDate]) {
load[itemDate].hoursIn =
(load[itemDate].hoursIn || 0) + AddJobForSchedulingCalc
? jobHours
: 0;
if (AddJobForSchedulingCalc) load[itemDate].jobsIn.push(item);
load[itemDate].hoursIn = (load[itemDate].hoursIn || 0) + jobHours;
load[itemDate].jobsIn.push(item);
} else {
load[itemDate] = {
jobsIn: AddJobForSchedulingCalc ? [item] : [],
jobsIn: [item],
jobsOut: [],
hoursIn: AddJobForSchedulingCalc ? jobHours : 0,
hoursIn: jobHours,
};
}
}
if (!load[itemDate]) {
load[itemDate] = {
jobsIn: [],
@@ -124,28 +139,52 @@ exports.job = async (req, res) => {
const inProdJobs = filteredProdJobsList.find((p) => p.id === item.id);
const inArrJobs = filteredArrJobs.find((p) => p.id === item.id);
const AddJobForSchedulingCalc = inProdJobs || inArrJobs;
if (!(inProdJobs || inArrJobs)) {
//Job isn't found in production or coming in.
//is it going today or scheduled to go today?
if (
moment(item.actual_completion || item.scheduled_completion)
.tz(timezone)
.isSame(moment().tz(timezone), "day")
) {
console.log("Job is going today anyways, ignore it.", item);
return;
}
const itemDate = moment(
item.actual_completion || item.scheduled_completion
)
.tz(timezone)
.format("yyyy-MM-DD");
if (!!load[itemDate]) {
load[itemDate].hoursOut =
(load[itemDate].hoursOut || 0) + AddJobForSchedulingCalc
? item.labhrs.aggregate.sum.mod_lb_hrs +
item.larhrs.aggregate.sum.mod_lb_hrs
: 0;
if (AddJobForSchedulingCalc) load[itemDate].jobsOut.push(item);
if (
moment(item.actual_completion || item.scheduled_completion)
.tz(timezone)
.isBefore(moment().tz(timezone), "day")
) {
console.log("Job should have already gone. Ignoring it.", item);
return;
}
console.log("PROBLEM JOB", item);
problemJobs.push({
...item,
code: "Job is scheduled for completion, but it is not marked in production nor is it an arriving job in this period. Check the scheduled in and completion dates",
});
return;
} else {
load[itemDate] = {
jobsOut: AddJobForSchedulingCalc ? [item] : [],
hoursOut: AddJobForSchedulingCalc
? item.labhrs.aggregate.sum.mod_lb_hrs +
item.larhrs.aggregate.sum.mod_lb_hrs
: 0,
};
const itemDate = moment(
item.actual_completion || item.scheduled_completion
)
.tz(timezone)
.format("yyyy-MM-DD");
if (!!load[itemDate]) {
load[itemDate].hoursOut =
(load[itemDate].hoursOut || 0) +
item.labhrs.aggregate.sum.mod_lb_hrs +
item.larhrs.aggregate.sum.mod_lb_hrs;
load[itemDate].jobsOut.push(item);
} else {
load[itemDate] = {
jobsOut: [item],
hoursOut:
item.labhrs.aggregate.sum.mod_lb_hrs +
item.larhrs.aggregate.sum.mod_lb_hrs,
};
}
}
});