Compare commits
38 Commits
release/20
...
feature/IO
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c1b3df9c3b | ||
|
|
7a88dd1aae | ||
|
|
521aa81591 | ||
|
|
d70fee6125 | ||
|
|
1a8fad26e5 | ||
|
|
d69050f006 | ||
|
|
abe1e80844 | ||
|
|
58e897db31 | ||
|
|
b7ed6734a0 | ||
|
|
7d5a866a5c | ||
|
|
23becf6494 | ||
|
|
64ee2c1526 | ||
|
|
c033c0fbc5 | ||
|
|
f8ddfeb7d0 | ||
|
|
bc42d19dff | ||
|
|
c4f7c57c24 | ||
|
|
c0bf829dc0 | ||
|
|
51cd61c932 | ||
|
|
4ab77de591 | ||
|
|
acc6633271 | ||
|
|
2336617077 | ||
|
|
836e9b846a | ||
|
|
897efde14d | ||
|
|
98f7147378 | ||
|
|
fd01746f7d | ||
|
|
54b8f564e4 | ||
|
|
591284c972 | ||
|
|
9e0dae2adf | ||
|
|
4ec171d93b | ||
|
|
608988c67c | ||
|
|
8da4d0b0f1 | ||
|
|
a54668e030 | ||
|
|
2386457cf5 | ||
|
|
45944ae8c9 | ||
|
|
2c32a4891b | ||
|
|
2b9fe61d79 | ||
|
|
95751103a2 | ||
|
|
8ca4c5d7fa |
@@ -1,6 +1,6 @@
|
||||
import { EditFilled, SyncOutlined } from "@ant-design/icons";
|
||||
import { Button, Card, Checkbox, Input, Space, Table } from "antd";
|
||||
import React, { useRef, useState } from "react";
|
||||
import React, { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { FaTasks } from "react-icons/fa";
|
||||
import { connect } from "react-redux";
|
||||
@@ -17,8 +17,7 @@ import BillDetailEditReturnComponent from "../bill-detail-edit/bill-detail-edit-
|
||||
import { HasFeatureAccess } from "../feature-wrapper/feature-wrapper.component";
|
||||
import LockerWrapperComponent from "../lock-wrapper/lock-wrapper.component";
|
||||
import PrintWrapperComponent from "../print-wrapper/print-wrapper.component";
|
||||
import UpsellComponent from "../upsell/upsell.component";
|
||||
import { upsellEnum } from "../upsell/upsell.component";
|
||||
import UpsellComponent, { upsellEnum } from "../upsell/upsell.component";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
jobRO: selectJobReadOnly,
|
||||
@@ -61,7 +60,6 @@ export function BillsListTableComponent({
|
||||
// const search = queryString.parse(useLocation().search);
|
||||
// const selectedBill = search.billid;
|
||||
const [searchText, setSearchText] = useState("");
|
||||
const containerRef = useRef(null);
|
||||
|
||||
const Templates = TemplateList("bill");
|
||||
const bills = billsQuery.data ? billsQuery.data.bills : [];
|
||||
|
||||
@@ -148,7 +148,7 @@ function Header({
|
||||
label: (
|
||||
<Space>
|
||||
<LockWrapper featureName="bills" bodyshop={bodyshop}>
|
||||
{t(t("menus.header.enterbills"))}
|
||||
{t("menus.header.enterbills")}
|
||||
</LockWrapper>
|
||||
</Space>
|
||||
),
|
||||
|
||||
@@ -122,7 +122,7 @@ export function JobDetailCards({ bodyshop, setPrintCenterContext }) {
|
||||
</Col>
|
||||
{!bodyshop.uselocalmediaserver && (
|
||||
<Col {...span}>
|
||||
<JobDetailCardsDocumentsComponent loading={loading} data={data ? data.jobs_by_pk : null} />
|
||||
<JobDetailCardsDocumentsComponent loading={loading} data={data ? data.jobs_by_pk : null} bodyshop={bodyshop} />
|
||||
</Col>
|
||||
)}
|
||||
<Col {...span}>
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
import { Carousel } from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { HasFeatureAccess } from "../feature-wrapper/feature-wrapper.component";
|
||||
import { GenerateThumbUrl } from "../jobs-documents-gallery/job-documents.utility";
|
||||
import CardTemplate from "./job-detail-cards.template.component";
|
||||
import UpsellComponent, { upsellEnum } from "../upsell/upsell.component";
|
||||
import CardTemplate from "./job-detail-cards.template.component";
|
||||
|
||||
export default function JobDetailCardsDocumentsComponent({ loading, data }) {
|
||||
export default function JobDetailCardsDocumentsComponent({ loading, data, bodyshop }) {
|
||||
const { t } = useTranslation();
|
||||
const hasMediaAccess = HasFeatureAccess({ bodyshop, featureName: "media" });
|
||||
|
||||
if (!data)
|
||||
return (
|
||||
@@ -21,17 +23,19 @@ export default function JobDetailCardsDocumentsComponent({ loading, data }) {
|
||||
title={t("jobs.labels.cards.documents")}
|
||||
extraLink={`/manage/jobs/${data.id}?tab=documents`}
|
||||
>
|
||||
<UpsellComponent disableMask upsell={upsellEnum().media.general}>
|
||||
{data.documents.length > 0 ? (
|
||||
<Carousel autoplay>
|
||||
{data.documents.map((item) => (
|
||||
<img key={item.id} src={GenerateThumbUrl(item)} alt={item.name} />
|
||||
))}
|
||||
</Carousel>
|
||||
) : (
|
||||
<div>{t("documents.errors.nodocuments")}</div>
|
||||
)}
|
||||
</UpsellComponent>
|
||||
{!hasMediaAccess && (
|
||||
<UpsellComponent disableMask upsell={upsellEnum().media.general}>
|
||||
{data.documents.length > 0 ? (
|
||||
<Carousel autoplay>
|
||||
{data.documents.map((item) => (
|
||||
<img key={item.id} src={GenerateThumbUrl(item)} alt={item.name} />
|
||||
))}
|
||||
</Carousel>
|
||||
) : (
|
||||
<div>{t("documents.errors.nodocuments")}</div>
|
||||
)}
|
||||
</UpsellComponent>
|
||||
)}
|
||||
</CardTemplate>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -9,14 +9,25 @@ import { useTranslation } from "react-i18next";
|
||||
|
||||
import "./job-lifecycle.styles.scss";
|
||||
import BlurWrapperComponent from "../feature-wrapper/blur-wrapper.component";
|
||||
|
||||
import UpsellComponent, { upsellEnum } from "../upsell/upsell.component";
|
||||
|
||||
import { HasFeatureAccess } from "../feature-wrapper/feature-wrapper.component";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
bodyshop: selectBodyshop
|
||||
});
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||
});
|
||||
// show text on bar if text can fit
|
||||
export function JobLifecycleComponent({ job, statuses, ...rest }) {
|
||||
export function JobLifecycleComponent({ bodyshop, job, statuses, ...rest }) {
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [lifecycleData, setLifecycleData] = useState(null);
|
||||
const { t } = useTranslation(); // Used for tracking external state changes.
|
||||
|
||||
const hasLifeCycleAccess = HasFeatureAccess({ bodyshop, featureName: "lifecycle" });
|
||||
const { data } = useQuery(
|
||||
gql`
|
||||
query get_job_test($id: uuid!) {
|
||||
@@ -143,9 +154,11 @@ export function JobLifecycleComponent({ job, statuses, ...rest }) {
|
||||
}
|
||||
style={{ width: "100%" }}
|
||||
>
|
||||
<Card type="inner" style={{ marginTop: "10px" }}>
|
||||
<UpsellComponent upsell={upsellEnum().lifecycle.general} />
|
||||
</Card>
|
||||
{!hasLifeCycleAccess && (
|
||||
<Card type="inner" style={{ marginTop: "10px" }}>
|
||||
<UpsellComponent upsell={upsellEnum().lifecycle.general} />
|
||||
</Card>
|
||||
)}
|
||||
<BlurWrapperComponent featureName="lifecycle" bypass>
|
||||
<div
|
||||
id="bar-container"
|
||||
@@ -302,5 +315,4 @@ export function JobLifecycleComponent({ job, statuses, ...rest }) {
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
|
||||
export default JobLifecycleComponent;
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(JobLifecycleComponent);
|
||||
|
||||
@@ -9,6 +9,7 @@ import { selectTechnician } from "../../redux/tech/tech.selectors";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
import { GenerateDocument } from "../../utils/RenderTemplate";
|
||||
import LockWrapperComponent from "../lock-wrapper/lock-wrapper.component";
|
||||
import { HasFeatureAccess } from './../feature-wrapper/feature-wrapper.component';
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
printCenterModal: selectPrintCenter,
|
||||
@@ -43,10 +44,12 @@ export function PrintCenterItemComponent({
|
||||
setLoading(false);
|
||||
};
|
||||
|
||||
if (disabled || item.featureNameRestricted)
|
||||
if (disabled || (item.featureNameRestricted && !HasFeatureAccess({"featureName": item.featureNameRestricted, bodyshop})))
|
||||
return (
|
||||
<li className="print-center-item">
|
||||
<LockWrapperComponent featureName={item.featureNameRestricted}>{item.title}</LockWrapperComponent>
|
||||
<LockWrapperComponent featureName={item.featureNameRestricted} bodyshop={bodyshop}>
|
||||
{item.title}
|
||||
</LockWrapperComponent>
|
||||
</li>
|
||||
);
|
||||
return (
|
||||
|
||||
@@ -8,6 +8,7 @@ import { createStructuredSelector } from "reselect";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
import BlurWrapperComponent from "../feature-wrapper/blur-wrapper.component";
|
||||
import { UpsellMaskWrapper, upsellEnum } from "../upsell/upsell.component";
|
||||
import { HasFeatureAccess } from "../feature-wrapper/feature-wrapper.component";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
bodyshop: selectBodyshop
|
||||
@@ -35,6 +36,28 @@ export function ScheduleCalendarHeaderGraph({ bodyshop, loadData }) {
|
||||
[]
|
||||
);
|
||||
}, [loadData, ssbuckets]);
|
||||
const hasSmartSchedulingAccess = HasFeatureAccess({ featureName: "smartscheduling", bodyshop });
|
||||
|
||||
const chartContents = (
|
||||
<>
|
||||
<RadarChart
|
||||
// cx={300}
|
||||
// cy={250}
|
||||
// outerRadius={150}
|
||||
width={800}
|
||||
height={600}
|
||||
data={data}
|
||||
>
|
||||
<PolarGrid />
|
||||
<PolarAngleAxis dataKey="bucket" />
|
||||
<PolarRadiusAxis angle={90} />
|
||||
<Radar name="Ideal Load" dataKey="target" stroke="darkgreen" fill="white" fillOpacity={0} />
|
||||
<Radar name="EOD Load" dataKey="current" stroke="dodgerblue" fill="dodgerblue" fillOpacity={0.6} />
|
||||
<Tooltip />
|
||||
<Legend />
|
||||
</RadarChart>
|
||||
</>
|
||||
);
|
||||
|
||||
const popContent = (
|
||||
<div>
|
||||
@@ -48,26 +71,13 @@ export function ScheduleCalendarHeaderGraph({ bodyshop, loadData }) {
|
||||
<strong>{loadData?.expectedJobCount}</strong>
|
||||
</BlurWrapperComponent>
|
||||
</Space>
|
||||
<UpsellMaskWrapper upsell={upsellEnum().smartscheduling.general}>
|
||||
<BlurWrapperComponent featureName="smartscheduling">
|
||||
<RadarChart
|
||||
// cx={300}
|
||||
// cy={250}
|
||||
// outerRadius={150}
|
||||
width={800}
|
||||
height={600}
|
||||
data={data}
|
||||
>
|
||||
<PolarGrid />
|
||||
<PolarAngleAxis dataKey="bucket" />
|
||||
<PolarRadiusAxis angle={90} />
|
||||
<Radar name="Ideal Load" dataKey="target" stroke="darkgreen" fill="white" fillOpacity={0} />
|
||||
<Radar name="EOD Load" dataKey="current" stroke="dodgerblue" fill="dodgerblue" fillOpacity={0.6} />
|
||||
<Tooltip />
|
||||
<Legend />
|
||||
</RadarChart>
|
||||
</BlurWrapperComponent>
|
||||
</UpsellMaskWrapper>
|
||||
<BlurWrapperComponent featureName="smartscheduling">
|
||||
{hasSmartSchedulingAccess ? (
|
||||
chartContents
|
||||
) : (
|
||||
<UpsellMaskWrapper upsell={upsellEnum().smartscheduling.general}>{chartContents}</UpsellMaskWrapper>
|
||||
)}
|
||||
</BlurWrapperComponent>
|
||||
</div>
|
||||
);
|
||||
|
||||
|
||||
@@ -13,11 +13,12 @@ import { selectScheduleLoad, selectScheduleLoadCalculating } from "../../redux/a
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
import { DateTimeFormatter } from "../../utils/DateFormatter";
|
||||
import { default as BlurWrapper, default as BlurWrapperComponent } from "../feature-wrapper/blur-wrapper.component";
|
||||
import { HasFeatureAccess } from "../feature-wrapper/feature-wrapper.component";
|
||||
import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component";
|
||||
import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
|
||||
import ScheduleBlockDay from "../schedule-block-day/schedule-block-day.component";
|
||||
import UpsellComponent, { upsellEnum } from "../upsell/upsell.component";
|
||||
import ScheduleCalendarHeaderGraph from "./schedule-calendar-header-graph.component";
|
||||
import UpsellComponent, { upsellEnum, UpsellMaskWrapper } from "../upsell/upsell.component";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
bodyshop: selectBodyshop,
|
||||
@@ -52,6 +53,7 @@ export function ScheduleCalendarHeaderComponent({
|
||||
|
||||
const { t } = useTranslation();
|
||||
const loadData = load[date.toISOString().substr(0, 10)];
|
||||
const hasSmartSchedulingAccess = HasFeatureAccess({ featureName: "smartscheduling", bodyshop });
|
||||
|
||||
const jobsOutPopup = () => (
|
||||
<div onClick={(e) => e.stopPropagation()}>
|
||||
@@ -89,9 +91,11 @@ export function ScheduleCalendarHeaderComponent({
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
<Card style={{ maxWidth: "30rem" }}>
|
||||
<UpsellComponent size="small" upsell={upsellEnum().smartscheduling.hrsdelta} />
|
||||
</Card>
|
||||
{!hasSmartSchedulingAccess && (
|
||||
<Card style={{ maxWidth: "30rem" }}>
|
||||
<UpsellComponent size="small" upsell={upsellEnum().smartscheduling.hrsdelta} />
|
||||
</Card>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -129,9 +133,11 @@ export function ScheduleCalendarHeaderComponent({
|
||||
</BlurWrapperComponent>
|
||||
</tr>
|
||||
)}
|
||||
<Card style={{ maxWidth: "30rem" }}>
|
||||
<UpsellComponent size="small" upsell={upsellEnum().smartscheduling.hrsdelta} />
|
||||
</Card>
|
||||
{!hasSmartSchedulingAccess && (
|
||||
<Card style={{ maxWidth: "30rem" }}>
|
||||
<UpsellComponent size="small" upsell={upsellEnum().smartscheduling.hrsdelta} />
|
||||
</Card>
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -16,7 +16,7 @@ import ScheduleDayViewContainer from "../schedule-day-view/schedule-day-view.con
|
||||
import ScheduleExistingAppointmentsList from "../schedule-existing-appointments-list/schedule-existing-appointments-list.component";
|
||||
import "./schedule-job-modal.scss";
|
||||
import LockWrapperComponent from "../lock-wrapper/lock-wrapper.component";
|
||||
import { BlurWrapper } from "../feature-wrapper/blur-wrapper.component";
|
||||
import BlurWrapper from "../feature-wrapper/blur-wrapper.component";
|
||||
import UpsellComponent, { upsellEnum } from "../upsell/upsell.component";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
@@ -138,7 +138,7 @@ export function ScheduleJobModalComponent({
|
||||
</BlurWrapper>
|
||||
</Button>
|
||||
))}
|
||||
{smartOptions.length > 1 && hasSmartSchedulingAccess && (
|
||||
{!smartOptions.length > 1 && hasSmartSchedulingAccess && (
|
||||
<UpsellComponent upsell={upsellEnum().smartscheduling.general} />
|
||||
)}
|
||||
</Space>
|
||||
|
||||
@@ -13,13 +13,15 @@ import { Button, Card, Result } from "antd";
|
||||
import i18n from "i18next";
|
||||
import React, { useEffect, useRef } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Link } from "react-router-dom";
|
||||
import { store } from "../../redux/store.js";
|
||||
import InstanceRenderManager from "../../utils/instanceRenderMgr.js";
|
||||
import "./upsell.styles.scss";
|
||||
|
||||
export default function UpsellComponent({ featureName, subFeatureName, upsell, disableMask }) {
|
||||
const { t } = useTranslation();
|
||||
const resultProps = upsell || upsellEnum[featureName][subFeatureName];
|
||||
|
||||
console.trace("***LOG ~ file: upsell.component.jsx:22 ~ UpsellComponent ~ resultProps:", resultProps);
|
||||
const componentRef = useRef(null);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -65,174 +67,275 @@ export function UpsellMaskWrapper({ children, upsell, featureName, subFeatureNam
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
//This is kept in this function as pulling it out into it's own util/enum prevents passing JSX as an `extra` prop
|
||||
export const upsellEnum = () => ({
|
||||
bills: {
|
||||
autoreconcile: {
|
||||
//icon: null,
|
||||
title: i18n.t("upsell.messages.bills.autoreconcile.title"),
|
||||
subTitle: i18n.t("upsell.messages.bills.autoreconcile.subtitle"),
|
||||
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
//status: null
|
||||
export const upsellEnum = () => {
|
||||
const { currentUser, bodyshop } = store.getState().user;
|
||||
|
||||
const [first_name, ...last_name] = currentUser?.displayName ? currentUser.displayName.split(" ") : [];
|
||||
const LearnMoreLink = encodeURI(
|
||||
InstanceRenderManager({
|
||||
imex: `https://imexsystems.ca/schedule-a-demo/`,
|
||||
rome: `https://forms.zohopublic.com/rometech/form/ROLearnMore/formperma/0G29z8LgLlvKK8nno-b7s-GHgNXwIFlrMeE0mC394L4?first_name=${first_name || ""}&last_name=${last_name.join(" ") || ""}&shop_name=${bodyshop?.shopname || ""}&email=${currentUser?.email || ""}&shop_phone=${bodyshop?.phone || ""}`
|
||||
})
|
||||
);
|
||||
|
||||
return {
|
||||
bills: {
|
||||
autoreconcile: {
|
||||
//icon: null,
|
||||
title: i18n.t("upsell.messages.bills.autoreconcile.title"),
|
||||
subTitle: i18n.t("upsell.messages.bills.autoreconcile.subtitle"),
|
||||
extra: (
|
||||
<Link to={LearnMoreLink} target="_blank">
|
||||
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
</Link>
|
||||
)
|
||||
//status: null
|
||||
},
|
||||
general: {
|
||||
//icon: null,
|
||||
title: i18n.t("upsell.messages.bills.general.title"),
|
||||
subTitle: i18n.t("upsell.messages.bills.general.subtitle"),
|
||||
extra: (
|
||||
<Link to={LearnMoreLink} target="_blank">
|
||||
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
</Link>
|
||||
)
|
||||
//status: null
|
||||
}
|
||||
},
|
||||
general: {
|
||||
//icon: null,
|
||||
title: i18n.t("upsell.messages.bills.general.title"),
|
||||
subTitle: i18n.t("upsell.messages.bills.general.subtitle"),
|
||||
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
//status: null
|
||||
}
|
||||
},
|
||||
checklist: {
|
||||
general: {
|
||||
//icon: null,
|
||||
title: i18n.t("upsell.messages.checklist.general.title"),
|
||||
subTitle: i18n.t("upsell.messages.checklist.general.subtitle"),
|
||||
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
//status: null
|
||||
}
|
||||
},
|
||||
payments: {
|
||||
general: {
|
||||
//icon: null,
|
||||
title: i18n.t("upsell.messages.payments.general.title"),
|
||||
subTitle: i18n.t("upsell.messages.payments.general.subtitle"),
|
||||
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
//status: null
|
||||
}
|
||||
},
|
||||
audit: {
|
||||
general: {
|
||||
//icon: null,
|
||||
title: i18n.t("upsell.messages.audit.general.title"),
|
||||
subTitle: i18n.t("upsell.messages.audit.general.subtitle"),
|
||||
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
//status: null
|
||||
}
|
||||
},
|
||||
lifecycle: {
|
||||
general: {
|
||||
//icon: null,
|
||||
title: i18n.t("upsell.messages.lifecycle.general.title"),
|
||||
subTitle: i18n.t("upsell.messages.lifecycle.general.subtitle"),
|
||||
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
//status: null }
|
||||
}
|
||||
},
|
||||
media: {
|
||||
general: {
|
||||
//icon: null,
|
||||
title: i18n.t("upsell.messages.media.general.title"),
|
||||
subTitle: i18n.t("upsell.messages.media.general.subtitle"),
|
||||
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
//status: null }
|
||||
},
|
||||
mobile: {
|
||||
icon: <MobileOutlined />,
|
||||
title: i18n.t("upsell.messages.media.mobile.title"),
|
||||
subTitle: i18n.t("upsell.messages.media.mobile.subtitle"),
|
||||
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
//status: null }
|
||||
}
|
||||
},
|
||||
timetickets: {
|
||||
allocations: {
|
||||
title: i18n.t("upsell.messages.timetickets.allocations.title"),
|
||||
subTitle: i18n.t("upsell.messages.timetickets.allocations.subtitle"),
|
||||
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
},
|
||||
general: {
|
||||
title: i18n.t("upsell.messages.timetickets.general.title"),
|
||||
subTitle: i18n.t("upsell.messages.timetickets.general.subtitle"),
|
||||
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
}
|
||||
},
|
||||
smartscheduling: {
|
||||
general: {
|
||||
icon: <CalendarOutlined />,
|
||||
title: i18n.t("upsell.messages.smartscheduling.general.title"),
|
||||
subTitle: i18n.t("upsell.messages.smartscheduling.general.subtitle"),
|
||||
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
},
|
||||
hrsdelta: {
|
||||
icon: <CarOutlined />,
|
||||
title: i18n.t("upsell.messages.smartscheduling.hrsdelta.title"),
|
||||
subTitle: i18n.t("upsell.messages.smartscheduling.hrsdelta.subtitle"),
|
||||
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
},
|
||||
datepicker: {
|
||||
icon: <CarOutlined />,
|
||||
title: i18n.t("upsell.messages.smartscheduling.datepicker.title"),
|
||||
subTitle: i18n.t("upsell.messages.smartscheduling.datepicker.subtitle"),
|
||||
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
}
|
||||
},
|
||||
accounting: {
|
||||
payables: {
|
||||
icon: <DollarOutlined />,
|
||||
title: i18n.t("upsell.messages.accounting.payables.title"),
|
||||
subTitle: i18n.t("upsell.messages.accounting.payables.subtitle"),
|
||||
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
},
|
||||
receivables: {
|
||||
icon: <DollarOutlined />,
|
||||
title: i18n.t("upsell.messages.accounting.receivables.title"),
|
||||
subTitle: i18n.t("upsell.messages.accounting.receivables.subtitle"),
|
||||
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
checklist: {
|
||||
general: {
|
||||
//icon: null,
|
||||
title: i18n.t("upsell.messages.checklist.general.title"),
|
||||
subTitle: i18n.t("upsell.messages.checklist.general.subtitle"),
|
||||
extra: (
|
||||
<Link to={LearnMoreLink} target="_blank">
|
||||
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
</Link>
|
||||
)
|
||||
//status: null
|
||||
}
|
||||
},
|
||||
payments: {
|
||||
icon: <DollarOutlined />,
|
||||
title: i18n.t("upsell.messages.accounting.payments.title"),
|
||||
subTitle: i18n.t("upsell.messages.accounting.payments.subtitle"),
|
||||
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
general: {
|
||||
//icon: null,
|
||||
title: i18n.t("upsell.messages.payments.general.title"),
|
||||
subTitle: i18n.t("upsell.messages.payments.general.subtitle"),
|
||||
extra: (
|
||||
<Link to={LearnMoreLink} target="_blank">
|
||||
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
</Link>
|
||||
)
|
||||
//status: null
|
||||
}
|
||||
},
|
||||
audit: {
|
||||
general: {
|
||||
//icon: null,
|
||||
title: i18n.t("upsell.messages.audit.general.title"),
|
||||
subTitle: i18n.t("upsell.messages.audit.general.subtitle"),
|
||||
extra: (
|
||||
<Link to={LearnMoreLink} target="_blank">
|
||||
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
</Link>
|
||||
)
|
||||
//status: null
|
||||
}
|
||||
},
|
||||
lifecycle: {
|
||||
general: {
|
||||
//icon: null,
|
||||
title: i18n.t("upsell.messages.lifecycle.general.title"),
|
||||
subTitle: i18n.t("upsell.messages.lifecycle.general.subtitle"),
|
||||
extra: (
|
||||
<Link to={LearnMoreLink} target="_blank">
|
||||
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
</Link>
|
||||
)
|
||||
//status: null }
|
||||
}
|
||||
},
|
||||
media: {
|
||||
general: {
|
||||
//icon: null,
|
||||
title: i18n.t("upsell.messages.media.general.title"),
|
||||
subTitle: i18n.t("upsell.messages.media.general.subtitle"),
|
||||
extra: (
|
||||
<Link to={LearnMoreLink} target="_blank">
|
||||
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
</Link>
|
||||
)
|
||||
//status: null }
|
||||
},
|
||||
mobile: {
|
||||
icon: <MobileOutlined />,
|
||||
title: i18n.t("upsell.messages.media.mobile.title"),
|
||||
subTitle: i18n.t("upsell.messages.media.mobile.subtitle"),
|
||||
extra: (
|
||||
<Link to={LearnMoreLink} target="_blank">
|
||||
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
</Link>
|
||||
)
|
||||
//status: null }
|
||||
}
|
||||
},
|
||||
timetickets: {
|
||||
allocations: {
|
||||
title: i18n.t("upsell.messages.timetickets.allocations.title"),
|
||||
subTitle: i18n.t("upsell.messages.timetickets.allocations.subtitle"),
|
||||
extra: (
|
||||
<Link to={LearnMoreLink} target="_blank">
|
||||
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
</Link>
|
||||
)
|
||||
},
|
||||
general: {
|
||||
title: i18n.t("upsell.messages.timetickets.general.title"),
|
||||
subTitle: i18n.t("upsell.messages.timetickets.general.subtitle"),
|
||||
extra: (
|
||||
<Link to={LearnMoreLink} target="_blank">
|
||||
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
},
|
||||
smartscheduling: {
|
||||
general: {
|
||||
icon: <CalendarOutlined />,
|
||||
title: i18n.t("upsell.messages.smartscheduling.general.title"),
|
||||
subTitle: i18n.t("upsell.messages.smartscheduling.general.subtitle"),
|
||||
extra: (
|
||||
<Link to={LearnMoreLink} target="_blank">
|
||||
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
</Link>
|
||||
)
|
||||
},
|
||||
hrsdelta: {
|
||||
icon: <CarOutlined />,
|
||||
title: i18n.t("upsell.messages.smartscheduling.hrsdelta.title"),
|
||||
subTitle: i18n.t("upsell.messages.smartscheduling.hrsdelta.subtitle"),
|
||||
extra: (
|
||||
<Link to={LearnMoreLink} target="_blank">
|
||||
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
</Link>
|
||||
)
|
||||
},
|
||||
datepicker: {
|
||||
icon: <CarOutlined />,
|
||||
title: i18n.t("upsell.messages.smartscheduling.datepicker.title"),
|
||||
subTitle: i18n.t("upsell.messages.smartscheduling.datepicker.subtitle"),
|
||||
extra: (
|
||||
<Link to={LearnMoreLink} target="_blank">
|
||||
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
},
|
||||
accounting: {
|
||||
payables: {
|
||||
icon: <DollarOutlined />,
|
||||
title: i18n.t("upsell.messages.accounting.payables.title"),
|
||||
subTitle: i18n.t("upsell.messages.accounting.payables.subtitle"),
|
||||
extra: (
|
||||
<Link to={LearnMoreLink} target="_blank">
|
||||
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
</Link>
|
||||
)
|
||||
},
|
||||
receivables: {
|
||||
icon: <DollarOutlined />,
|
||||
title: i18n.t("upsell.messages.accounting.receivables.title"),
|
||||
subTitle: i18n.t("upsell.messages.accounting.receivables.subtitle"),
|
||||
extra: (
|
||||
<Link to={LearnMoreLink} target="_blank">
|
||||
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
</Link>
|
||||
)
|
||||
},
|
||||
payments: {
|
||||
icon: <DollarOutlined />,
|
||||
title: i18n.t("upsell.messages.accounting.payments.title"),
|
||||
subTitle: i18n.t("upsell.messages.accounting.payments.subtitle"),
|
||||
extra: (
|
||||
<Link to={LearnMoreLink} target="_blank">
|
||||
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
},
|
||||
courtesycars: {
|
||||
general: {
|
||||
icon: <CarOutlined />,
|
||||
title: i18n.t("upsell.messages.courtesycars.general.title"),
|
||||
subTitle: i18n.t("upsell.messages.courtesycars.general.subtitle"),
|
||||
extra: (
|
||||
<Link to={LearnMoreLink} target="_blank">
|
||||
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
},
|
||||
dashboard: {
|
||||
general: {
|
||||
icon: <DashboardOutlined />,
|
||||
title: i18n.t("upsell.messages.dashboard.general.title"),
|
||||
subTitle: i18n.t("upsell.messages.dashboard.general.subtitle"),
|
||||
extra: (
|
||||
<Link to={LearnMoreLink} target="_blank">
|
||||
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
},
|
||||
visualboard: {
|
||||
general: {
|
||||
icon: <BuildOutlined />,
|
||||
title: i18n.t("upsell.messages.visualboard.general.title"),
|
||||
subTitle: i18n.t("upsell.messages.visualboard.general.subtitle"),
|
||||
extra: (
|
||||
<Link to={LearnMoreLink} target="_blank">
|
||||
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
},
|
||||
scoreboard: {
|
||||
general: {
|
||||
icon: <LineChartOutlined />,
|
||||
title: i18n.t("upsell.messages.scoreboard.general.title"),
|
||||
subTitle: i18n.t("upsell.messages.scoreboard.general.subtitle"),
|
||||
extra: (
|
||||
<Link to={LearnMoreLink} target="_blank">
|
||||
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
},
|
||||
techconsole: {
|
||||
general: {
|
||||
icon: <LineChartOutlined />,
|
||||
title: i18n.t("upsell.messages.techconsole.general.title"),
|
||||
subTitle: i18n.t("upsell.messages.techconsole.general.subtitle"),
|
||||
extra: (
|
||||
<Link to={LearnMoreLink} target="_blank">
|
||||
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
},
|
||||
csi: {
|
||||
general: {
|
||||
icon: <StarOutlined />,
|
||||
title: i18n.t("upsell.messages.csi.general.title"),
|
||||
subTitle: i18n.t("upsell.messages.csi.general.subtitle"),
|
||||
extra: (
|
||||
<Link to={LearnMoreLink} target="_blank">
|
||||
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
}
|
||||
},
|
||||
courtesycars: {
|
||||
general: {
|
||||
icon: <CarOutlined />,
|
||||
title: i18n.t("upsell.messages.courtesycars.general.title"),
|
||||
subTitle: i18n.t("upsell.messages.courtesycars.general.subtitle"),
|
||||
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
}
|
||||
},
|
||||
dashboard: {
|
||||
general: {
|
||||
icon: <DashboardOutlined />,
|
||||
title: i18n.t("upsell.messages.dashboard.general.title"),
|
||||
subTitle: i18n.t("upsell.messages.dashboard.general.subtitle"),
|
||||
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
}
|
||||
},
|
||||
visualboard: {
|
||||
general: {
|
||||
icon: <BuildOutlined />,
|
||||
title: i18n.t("upsell.messages.visualboard.general.title"),
|
||||
subTitle: i18n.t("upsell.messages.visualboard.general.subtitle"),
|
||||
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
}
|
||||
},
|
||||
scoreboard: {
|
||||
general: {
|
||||
icon: <LineChartOutlined />,
|
||||
title: i18n.t("upsell.messages.scoreboard.general.title"),
|
||||
subTitle: i18n.t("upsell.messages.scoreboard.general.subtitle"),
|
||||
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
}
|
||||
},
|
||||
techconsole: {
|
||||
general: {
|
||||
icon: <LineChartOutlined />,
|
||||
title: i18n.t("upsell.messages.techconsole.general.title"),
|
||||
subTitle: i18n.t("upsell.messages.techconsole.general.subtitle"),
|
||||
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
}
|
||||
},
|
||||
csi: {
|
||||
general: {
|
||||
icon: <StarOutlined />,
|
||||
title: i18n.t("upsell.messages.csi.general.title"),
|
||||
subTitle: i18n.t("upsell.messages.csi.general.subtitle"),
|
||||
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
@@ -20,7 +20,6 @@ import { FaHardHat, FaRegStickyNote, FaShieldAlt, FaTasks } from "react-icons/fa
|
||||
import { connect } from "react-redux";
|
||||
import { useLocation, useNavigate } from "react-router-dom";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { HasFeatureAccess } from "../../components/feature-wrapper/feature-wrapper.component";
|
||||
import FormFieldsChanged from "../../components/form-fields-changed-alert/form-fields-changed-alert.component";
|
||||
import JobAuditTrail from "../../components/job-audit-trail/job-audit-trail.component";
|
||||
import JobsLinesContainer from "../../components/job-detail-lines/job-lines.container";
|
||||
@@ -42,6 +41,7 @@ import JobsDetailTotals from "../../components/jobs-detail-totals/jobs-detail-to
|
||||
import JobsDocumentsGalleryContainer from "../../components/jobs-documents-gallery/jobs-documents-gallery.container";
|
||||
import JobsDocumentsLocalGallery from "../../components/jobs-documents-local-gallery/jobs-documents-local-gallery.container";
|
||||
import JobNotesContainer from "../../components/jobs-notes/jobs-notes.container";
|
||||
import LockWrapperComponent from "../../components/lock-wrapper/lock-wrapper.component.jsx";
|
||||
import NoteUpsertModalComponent from "../../components/note-upsert-modal/note-upsert-modal.container";
|
||||
import ScheduleJobModalContainer from "../../components/schedule-job-modal/schedule-job-modal.container";
|
||||
import TaskListContainer from "../../components/task-list/task-list.container.jsx";
|
||||
@@ -54,9 +54,7 @@ import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
||||
import { DateTimeFormat } from "../../utils/DateFormatter";
|
||||
import dayjs from "../../utils/day";
|
||||
import InstanceRenderManager from "../../utils/instanceRenderMgr";
|
||||
import UndefinedToNull from "../../utils/undefinedtonull";
|
||||
import LockWrapperComponent from "../../components/lock-wrapper/lock-wrapper.component.jsx";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
bodyshop: selectBodyshop,
|
||||
@@ -403,7 +401,9 @@ export function JobsDetailPage({
|
||||
icon: <BarsOutlined />,
|
||||
id: "job-details-lifecycle",
|
||||
label: (
|
||||
<LockWrapperComponent featureName="lifecycle" bypass>{t("menus.jobsdetail.lifecycle")}</LockWrapperComponent>
|
||||
<LockWrapperComponent featureName="lifecycle" bypass>
|
||||
{t("menus.jobsdetail.lifecycle")}
|
||||
</LockWrapperComponent>
|
||||
),
|
||||
children: <JobLifecycleComponent job={job} statuses={bodyshop.md_ro_statuses} />
|
||||
},
|
||||
@@ -438,7 +438,11 @@ export function JobsDetailPage({
|
||||
key: "audit",
|
||||
icon: <HistoryOutlined />,
|
||||
id: "job-details-audit",
|
||||
label: <LockWrapperComponent featureName="audit" bypass>{t("jobs.labels.audit")}</LockWrapperComponent>,
|
||||
label: (
|
||||
<LockWrapperComponent featureName="audit" bypass>
|
||||
{t("jobs.labels.audit")}
|
||||
</LockWrapperComponent>
|
||||
),
|
||||
children: <JobAuditTrail jobId={job.id} />
|
||||
},
|
||||
{
|
||||
|
||||
@@ -636,7 +636,7 @@
|
||||
"target_touchtime": "Target Touch Time",
|
||||
"timezone": "Timezone",
|
||||
"tt_allow_post_to_invoiced": "Allow Time Tickets to be posted to Invoiced & Exported Jobs",
|
||||
"tt_enforce_hours_for_tech_console": "Restrict Claimable hours from Tech Console",
|
||||
"tt_enforce_hours_for_tech_console": "Restrict Claimable Hours",
|
||||
"use_fippa": "Conceal Customer Information on Generated Documents?",
|
||||
"use_paint_scale_data": "Use Paint Scale Data for Job Costing?",
|
||||
"uselocalmediaserver": "Use Local Media Server?",
|
||||
|
||||
@@ -389,7 +389,7 @@ exports.postback = async (req, res) => {
|
||||
if (decodedComment) {
|
||||
//Shifted the order to have this first to retain backwards compatibility for the old style of short link.
|
||||
//This has been triggered by IO and may have multiple jobs.
|
||||
const parsedComment = JSON.parse(decodedComment);
|
||||
const parsedComment = decodedComment;
|
||||
|
||||
logger.log("intellipay-postback-parsed-comment", "DEBUG", req.user?.email, null, {
|
||||
parsedComment,
|
||||
|
||||
@@ -49,7 +49,8 @@ exports.totalsSsu = async function (req, res) {
|
||||
} catch (error) {
|
||||
logger.log("job-totals-ssu-USA-error", "ERROR", req?.user?.email, id, {
|
||||
jobid: id,
|
||||
error: error.message
|
||||
error: error.message,
|
||||
stack: error.stack
|
||||
});
|
||||
res.status(503).send();
|
||||
}
|
||||
@@ -68,59 +69,63 @@ async function TotalsServerSide(req, res) {
|
||||
ret.additional = CalculateAdditional(job);
|
||||
ret.totals = CalculateTaxesTotals(job, ret);
|
||||
|
||||
// Sub total scrubbbing.
|
||||
const emsTotal =
|
||||
job.cieca_ttl.data.n_ttl_amt === job.cieca_ttl.data.g_ttl_amt //It looks like sometimes, gross and net are the same, but they shouldn't be.
|
||||
? job.cieca_ttl.data.n_ttl_amt - job.cieca_ttl.data.g_tax
|
||||
: job.cieca_ttl.data.g_ttl_amt - job.cieca_ttl.data.g_tax; //If they are, adjust the gross total down by the tax amount.
|
||||
const ttlDifference =
|
||||
emsTotal -
|
||||
ret.totals.subtotal
|
||||
.add(
|
||||
Dinero({
|
||||
amount: Math.round((job.adjustment_bottom_line || 0) * 100)
|
||||
}).multiply(-1) //Add back in the adjustment to the subtotal. We don't want to scrub it twice.
|
||||
)
|
||||
.getAmount() /
|
||||
//If we don't have the CIECA_TTL, we can't scrub. E.g. a private estimate.
|
||||
if (job.cieca_ttl) {
|
||||
// Sub total scrubbbing.
|
||||
const emsTotal =
|
||||
job.cieca_ttl.data.n_ttl_amt === job.cieca_ttl.data.g_ttl_amt //It looks like sometimes, gross and net are the same, but they shouldn't be.
|
||||
? job.cieca_ttl.data.n_ttl_amt - job.cieca_ttl.data.g_tax
|
||||
: job.cieca_ttl.data.g_ttl_amt - job.cieca_ttl.data.g_tax; //If they are, adjust the gross total down by the tax amount.
|
||||
const ttlDifference =
|
||||
emsTotal -
|
||||
ret.totals.subtotal
|
||||
.add(
|
||||
Dinero({
|
||||
amount: Math.round((job.adjustment_bottom_line || 0) * 100)
|
||||
}).multiply(-1) //Add back in the adjustment to the subtotal. We don't want to scrub it twice.
|
||||
)
|
||||
.getAmount() /
|
||||
100;
|
||||
|
||||
if (Math.abs(ttlDifference) > 0.0) {
|
||||
//If difference is greater than a pennny, we need to adjust it.
|
||||
ret.totals.ttl_adjustment = Dinero({ amount: Math.round(ttlDifference * 100) });
|
||||
ret.totals.subtotal = ret.totals.subtotal.add(ret.totals.ttl_adjustment);
|
||||
ret.totals.total_repairs = ret.totals.total_repairs.add(ret.totals.ttl_adjustment);
|
||||
ret.totals.net_repairs = ret.totals.net_repairs.add(ret.totals.ttl_adjustment);
|
||||
logger.log("job-totals-USA-ttl-adj", "DEBUG", null, job.id, {
|
||||
adjAmount: ttlDifference
|
||||
});
|
||||
}
|
||||
|
||||
//Taxes Scrubbing
|
||||
const emsTaxTotal = job.cieca_ttl.data.g_tax;
|
||||
const totalUsTaxes =
|
||||
(ret.totals.us_sales_tax_breakdown.ty1Tax.getAmount() +
|
||||
ret.totals.us_sales_tax_breakdown.ty2Tax.getAmount() +
|
||||
ret.totals.us_sales_tax_breakdown.ty3Tax.getAmount() +
|
||||
ret.totals.us_sales_tax_breakdown.ty4Tax.getAmount() +
|
||||
ret.totals.us_sales_tax_breakdown.ty5Tax.getAmount()) /
|
||||
100;
|
||||
const ttlTaxDifference = emsTaxTotal - totalUsTaxes;
|
||||
|
||||
if (Math.abs(ttlDifference) > 0.0) {
|
||||
//If difference is greater than a pennny, we need to adjust it.
|
||||
ret.totals.ttl_adjustment = Dinero({ amount: Math.round(ttlDifference * 100) });
|
||||
ret.totals.subtotal = ret.totals.subtotal.add(ret.totals.ttl_adjustment);
|
||||
ret.totals.total_repairs = ret.totals.total_repairs.add(ret.totals.ttl_adjustment);
|
||||
ret.totals.net_repairs = ret.totals.net_repairs.add(ret.totals.ttl_adjustment);
|
||||
logger.log("job-totals-USA-ttl-adj", "DEBUG", null, job.id, {
|
||||
adjAmount: ttlDifference
|
||||
});
|
||||
}
|
||||
|
||||
//Taxes Scrubbing
|
||||
const emsTaxTotal = job.cieca_ttl.data.g_tax;
|
||||
const totalUsTaxes =
|
||||
(ret.totals.us_sales_tax_breakdown.ty1Tax.getAmount() +
|
||||
ret.totals.us_sales_tax_breakdown.ty2Tax.getAmount() +
|
||||
ret.totals.us_sales_tax_breakdown.ty3Tax.getAmount() +
|
||||
ret.totals.us_sales_tax_breakdown.ty4Tax.getAmount() +
|
||||
ret.totals.us_sales_tax_breakdown.ty5Tax.getAmount()) /
|
||||
100;
|
||||
const ttlTaxDifference = emsTaxTotal - totalUsTaxes;
|
||||
|
||||
if (Math.abs(ttlTaxDifference) > 0.0) {
|
||||
//If difference is greater than a pennny, we need to adjust it.
|
||||
ret.totals.ttl_tax_adjustment = Dinero({ amount: Math.round(ttlTaxDifference * 100) });
|
||||
ret.totals.total_repairs = ret.totals.total_repairs.add(ret.totals.ttl_tax_adjustment);
|
||||
ret.totals.net_repairs = ret.totals.net_repairs.add(ret.totals.ttl_tax_adjustment);
|
||||
logger.log("job-totals-USA-ttl-tax-adj", "DEBUG", null, job.id, {
|
||||
adjAmount: ttlTaxDifference
|
||||
});
|
||||
if (Math.abs(ttlTaxDifference) > 0.0) {
|
||||
//If difference is greater than a pennny, we need to adjust it.
|
||||
ret.totals.ttl_tax_adjustment = Dinero({ amount: Math.round(ttlTaxDifference * 100) });
|
||||
ret.totals.total_repairs = ret.totals.total_repairs.add(ret.totals.ttl_tax_adjustment);
|
||||
ret.totals.net_repairs = ret.totals.net_repairs.add(ret.totals.ttl_tax_adjustment);
|
||||
logger.log("job-totals-USA-ttl-tax-adj", "DEBUG", null, job.id, {
|
||||
adjAmount: ttlTaxDifference
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
} catch (error) {
|
||||
logger.log("job-totals-ssu-USA-error", "ERROR", req.user?.email, job.id, {
|
||||
jobid: job.id,
|
||||
error
|
||||
error: error.message,
|
||||
stack: error.stack
|
||||
});
|
||||
res.status(400).send(JSON.stringify(error));
|
||||
}
|
||||
@@ -150,7 +155,8 @@ async function Totals(req, res) {
|
||||
} catch (error) {
|
||||
logger.log("job-totals-USA-error", "ERROR", req.user.email, job.id, {
|
||||
jobid: job.id,
|
||||
error
|
||||
error: error.message,
|
||||
stack: error.stack
|
||||
});
|
||||
res.status(400).send(JSON.stringify(error));
|
||||
}
|
||||
@@ -1075,7 +1081,8 @@ function CalculateTaxesTotals(job, otherTotals) {
|
||||
}
|
||||
} catch (error) {
|
||||
logger.log("job-totals-USA - PFP Calculation Error", "error", null, job.id, {
|
||||
error: error.message
|
||||
error: error.message,
|
||||
stack: error.stack
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user