Minor bug fixes.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<babeledit_project be_version="2.7.1" version="1.2">
|
||||
<babeledit_project version="1.2" be_version="2.7.1">
|
||||
<!--
|
||||
|
||||
BabelEdit project file
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { Alert, Card, Col, Row, Space, Statistic, Tooltip, Typography } from 'antd';
|
||||
import Dinero from 'dinero.js';
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import InstanceRenderManager from '../../utils/instanceRenderMgr';
|
||||
import AlertComponent from '../alert/alert.component';
|
||||
import LoadingSkeleton from '../loading-skeleton/loading-skeleton.component';
|
||||
import './job-bills-total.styles.scss';
|
||||
import { Alert, Card, Col, Row, Space, Statistic, Tooltip, Typography } from "antd";
|
||||
import Dinero from "dinero.js";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import InstanceRenderManager from "../../utils/instanceRenderMgr";
|
||||
import AlertComponent from "../alert/alert.component";
|
||||
import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component";
|
||||
import "./job-bills-total.styles.scss";
|
||||
|
||||
export default function JobBillsTotalComponent({
|
||||
loading,
|
||||
@@ -13,16 +13,16 @@ export default function JobBillsTotalComponent({
|
||||
partsOrders,
|
||||
jobTotals,
|
||||
showWarning,
|
||||
warningCallback,
|
||||
warningCallback
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
if (loading) return <LoadingSkeleton />;
|
||||
if (!!!jobTotals) {
|
||||
if (showWarning && warningCallback && typeof warningCallback === 'function') {
|
||||
warningCallback({ key: 'bills', warning: t('jobs.errors.nofinancial') });
|
||||
if (showWarning && warningCallback && typeof warningCallback === "function") {
|
||||
warningCallback({ key: "bills", warning: t("jobs.errors.nofinancial") });
|
||||
}
|
||||
return <AlertComponent type="error" message={t('jobs.errors.nofinancial')} />;
|
||||
return <AlertComponent type="error" message={t("jobs.errors.nofinancial")} />;
|
||||
}
|
||||
|
||||
const totals = jobTotals;
|
||||
@@ -109,64 +109,60 @@ export default function JobBillsTotalComponent({
|
||||
const discrepWithCms = discrepWithLbrAdj.add(totalReturns);
|
||||
const calculatedCreditsNotReceived = totalReturns.subtract(billCms); //billCms is tracked as a negative number.
|
||||
|
||||
if (showWarning && warningCallback && typeof warningCallback === 'function') {
|
||||
if (
|
||||
discrepWithCms.getAmount() !== 0 ||
|
||||
discrepWithLbrAdj.getAmount() !== 0 ||
|
||||
discrepancy.getAmount() !== 0
|
||||
) {
|
||||
if (showWarning && warningCallback && typeof warningCallback === "function") {
|
||||
if (discrepWithCms.getAmount() !== 0) {
|
||||
warningCallback({
|
||||
key: 'bills',
|
||||
warning: t('jobs.labels.outstanding_reconciliation_discrep'),
|
||||
key: "bills",
|
||||
warning: t("jobs.labels.outstanding_reconciliation_discrep")
|
||||
});
|
||||
}
|
||||
if (calculatedCreditsNotReceived.getAmount() > 0) {
|
||||
warningCallback({ key: 'cm', warning: t('jobs.labels.outstanding_credit_memos') });
|
||||
warningCallback({ key: "cm", warning: t("jobs.labels.outstanding_credit_memos") });
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<Row gutter={[16, 16]}>
|
||||
<Col md={24} lg={18}>
|
||||
<Card title={t('jobs.labels.jobtotals')} style={{ height: '100%' }}>
|
||||
<Card title={t("jobs.labels.jobtotals")} style={{ height: "100%" }}>
|
||||
<Space wrap size="large">
|
||||
<Tooltip
|
||||
title={
|
||||
<div
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: t('jobs.labels.plitooltips.partstotal'),
|
||||
__html: t("jobs.labels.plitooltips.partstotal")
|
||||
}}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<Statistic title={t('jobs.labels.rosaletotal')} value={totalPartsSublet.toFormat()} />
|
||||
<Statistic title={t("jobs.labels.rosaletotal")} value={totalPartsSublet.toFormat()} />
|
||||
</Tooltip>
|
||||
<Typography.Title>-</Typography.Title>
|
||||
<Tooltip
|
||||
title={
|
||||
<div
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: t('jobs.labels.plitooltips.billtotal'),
|
||||
__html: t("jobs.labels.plitooltips.billtotal")
|
||||
}}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<Statistic title={t('bills.labels.retailtotal')} value={billTotals.toFormat()} />
|
||||
<Statistic title={t("bills.labels.retailtotal")} value={billTotals.toFormat()} />
|
||||
</Tooltip>
|
||||
<Typography.Title>=</Typography.Title>
|
||||
<Tooltip
|
||||
title={
|
||||
<div
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: t('jobs.labels.plitooltips.discrep1'),
|
||||
__html: t("jobs.labels.plitooltips.discrep1")
|
||||
}}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<Statistic
|
||||
title={t('bills.labels.discrepancy')}
|
||||
title={t("bills.labels.discrepancy")}
|
||||
valueStyle={{
|
||||
color: discrepancy.getAmount() === 0 ? 'green' : 'red',
|
||||
color: discrepancy.getAmount() === 0 ? "green" : "red"
|
||||
}}
|
||||
value={discrepancy.toFormat()}
|
||||
/>
|
||||
@@ -176,27 +172,27 @@ export default function JobBillsTotalComponent({
|
||||
title={
|
||||
<div
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: t('jobs.labels.plitooltips.laboradj'),
|
||||
__html: t("jobs.labels.plitooltips.laboradj")
|
||||
}}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<Statistic title={t('bills.labels.dedfromlbr')} value={lbrAdjustments.toFormat()} />
|
||||
<Statistic title={t("bills.labels.dedfromlbr")} value={lbrAdjustments.toFormat()} />
|
||||
</Tooltip>
|
||||
<Typography.Title>=</Typography.Title>
|
||||
<Tooltip
|
||||
title={
|
||||
<div
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: t('jobs.labels.plitooltips.discrep2'),
|
||||
__html: t("jobs.labels.plitooltips.discrep2")
|
||||
}}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<Statistic
|
||||
title={t('bills.labels.discrepancy')}
|
||||
title={t("bills.labels.discrepancy")}
|
||||
valueStyle={{
|
||||
color: discrepWithLbrAdj.getAmount() === 0 ? 'green' : 'red',
|
||||
color: discrepWithLbrAdj.getAmount() === 0 ? "green" : "red"
|
||||
}}
|
||||
value={discrepWithLbrAdj.toFormat()}
|
||||
/>
|
||||
@@ -206,27 +202,27 @@ export default function JobBillsTotalComponent({
|
||||
title={
|
||||
<div
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: t('jobs.labels.plitooltips.creditmemos'),
|
||||
__html: t("jobs.labels.plitooltips.creditmemos")
|
||||
}}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<Statistic title={t('bills.labels.totalreturns')} value={totalReturns.toFormat()} />
|
||||
<Statistic title={t("bills.labels.totalreturns")} value={totalReturns.toFormat()} />
|
||||
</Tooltip>
|
||||
<Typography.Title>=</Typography.Title>
|
||||
<Tooltip
|
||||
title={
|
||||
<div
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: t('jobs.labels.plitooltips.discrep3'),
|
||||
__html: t("jobs.labels.plitooltips.discrep3")
|
||||
}}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<Statistic
|
||||
title={t('bills.labels.discrepancy')}
|
||||
title={t("bills.labels.discrepancy")}
|
||||
valueStyle={{
|
||||
color: discrepWithCms.getAmount() === 0 ? 'green' : 'red',
|
||||
color: discrepWithCms.getAmount() === 0 ? "green" : "red"
|
||||
}}
|
||||
value={discrepWithCms.toFormat()}
|
||||
/>
|
||||
@@ -238,40 +234,40 @@ export default function JobBillsTotalComponent({
|
||||
discrepWithLbrAdj.getAmount() !== 0 ||
|
||||
discrepancy.getAmount() !== 0) && (
|
||||
<Alert
|
||||
style={{ margin: '8px 0px' }}
|
||||
style={{ margin: "8px 0px" }}
|
||||
type="warning"
|
||||
message={t('jobs.labels.outstanding_reconciliation_discrep')}
|
||||
message={t("jobs.labels.outstanding_reconciliation_discrep")}
|
||||
/>
|
||||
)}
|
||||
</Card>
|
||||
</Col>
|
||||
<Col md={24} lg={6}>
|
||||
<Card title={t('jobs.labels.returntotals')} style={{ height: '100%' }}>
|
||||
<Card title={t("jobs.labels.returntotals")} style={{ height: "100%" }}>
|
||||
<Space wrap>
|
||||
<Tooltip
|
||||
title={
|
||||
<div
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: t('jobs.labels.plitooltips.totalreturns'),
|
||||
__html: t("jobs.labels.plitooltips.totalreturns")
|
||||
}}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<Statistic title={t('bills.labels.totalreturns')} value={totalReturns.toFormat()} />
|
||||
<Statistic title={t("bills.labels.totalreturns")} value={totalReturns.toFormat()} />
|
||||
</Tooltip>
|
||||
<Tooltip
|
||||
title={
|
||||
<div
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: t('jobs.labels.plitooltips.calculatedcreditsnotreceived'),
|
||||
__html: t("jobs.labels.plitooltips.calculatedcreditsnotreceived")
|
||||
}}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<Statistic
|
||||
title={t('bills.labels.calculatedcreditsnotreceived')}
|
||||
title={t("bills.labels.calculatedcreditsnotreceived")}
|
||||
valueStyle={{
|
||||
color: calculatedCreditsNotReceived.getAmount() <= 0 ? 'green' : 'red',
|
||||
color: calculatedCreditsNotReceived.getAmount() <= 0 ? "green" : "red"
|
||||
}}
|
||||
value={
|
||||
calculatedCreditsNotReceived.getAmount() >= 0
|
||||
@@ -284,15 +280,15 @@ export default function JobBillsTotalComponent({
|
||||
title={
|
||||
<div
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: t('jobs.labels.plitooltips.creditsnotreceived'),
|
||||
__html: t("jobs.labels.plitooltips.creditsnotreceived")
|
||||
}}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<Statistic
|
||||
title={t('bills.labels.creditsnotreceived')}
|
||||
title={t("bills.labels.creditsnotreceived")}
|
||||
valueStyle={{
|
||||
color: totalReturnsMarkedNotReceived.getAmount() <= 0 ? 'green' : 'red',
|
||||
color: totalReturnsMarkedNotReceived.getAmount() <= 0 ? "green" : "red"
|
||||
}}
|
||||
value={
|
||||
totalReturnsMarkedNotReceived.getAmount() >= 0
|
||||
@@ -303,11 +299,7 @@ export default function JobBillsTotalComponent({
|
||||
</Tooltip>
|
||||
</Space>
|
||||
{showWarning && calculatedCreditsNotReceived.getAmount() > 0 && (
|
||||
<Alert
|
||||
style={{ margin: '8px 0px' }}
|
||||
type="warning"
|
||||
message={t('jobs.labels.outstanding_credit_memos')}
|
||||
/>
|
||||
<Alert style={{ margin: "8px 0px" }} type="warning" message={t("jobs.labels.outstanding_credit_memos")} />
|
||||
)}
|
||||
</Card>
|
||||
</Col>
|
||||
|
||||
@@ -84,12 +84,6 @@ export function JobCloseRoGuardContainer({ job, jobRO, bodyshop, form }) {
|
||||
</Row>
|
||||
</Col>
|
||||
{InstanceRenderManager({
|
||||
imex: (
|
||||
<Col md={24} lg={8}>
|
||||
{/* <JobCloseRoGuardSublet job={job} warningCallback={warningCallback} /> */}
|
||||
<JobCloseRoGuardPpd job={job} warningCallback={warningCallback} />
|
||||
</Col>
|
||||
),
|
||||
rome: (
|
||||
<Col md={24} lg={8}>
|
||||
{/* <JobCloseRoGuardSublet job={job} warningCallback={warningCallback} /> */}
|
||||
|
||||
@@ -1974,7 +1974,7 @@
|
||||
"outstanding_ar": "A balance is outstanding on this RO. Payments can still be entered when the job is closed. ",
|
||||
"outstanding_credit_memos": "Outstanding credit memos have not been entered against this job. Credit Memos may still be posted once the job is closed.",
|
||||
"outstanding_ppd": "There are outstanding PPDs that may not have been synced back to the estimate.",
|
||||
"outstanding_reconciliation_discrep": "At least one discrepancy is not 0. This may indicate that this job is not properly reconciled and should not be closed.",
|
||||
"outstanding_reconciliation_discrep": "At least one discrepancy is not $0. This may indicate that this job is not properly reconciled and should not be closed.",
|
||||
"outstanding_sublets": "There are sublet lines on the job which have not been marked as completed. ",
|
||||
"outstandinghours": "There are outstanding hours on the job that have not been paid or have been overpaid.",
|
||||
"override_header": "Override estimate header on import?",
|
||||
|
||||
Reference in New Issue
Block a user