WIP RO Closer.
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
|
BabelEdit project file
|
||||||
@@ -18897,6 +18897,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>media</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>
|
<concept_node>
|
||||||
<name>message</name>
|
<name>message</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
@@ -33199,6 +33220,111 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>outstanding_ar</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>outstanding_credit_memos</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>outstanding_reconciliation_discrep</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>outstanding_sublets</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>outstandinghours</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>
|
<concept_node>
|
||||||
<name>override_header</name>
|
<name>override_header</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
@@ -34049,6 +34175,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>roguardwarnings</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>
|
<concept_node>
|
||||||
<name>rosaletotal</name>
|
<name>rosaletotal</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
@@ -34259,6 +34406,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>subletsnotcompleted</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>
|
<concept_node>
|
||||||
<name>subletstotal</name>
|
<name>subletstotal</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
|
|||||||
@@ -1,25 +1,32 @@
|
|||||||
import {Card, Col, Row, Space, Statistic, Tooltip, Typography} from "antd";
|
import { Alert, Card, Col, Row, Space, Statistic, Tooltip, Typography } from "antd";
|
||||||
import Dinero from "dinero.js";
|
import Dinero from "dinero.js";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import {useTranslation} from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
import InstanceRenderManager from "../../utils/instanceRenderMgr";
|
||||||
import AlertComponent from "../alert/alert.component";
|
import AlertComponent from "../alert/alert.component";
|
||||||
import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component";
|
import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component";
|
||||||
import "./job-bills-total.styles.scss";
|
import "./job-bills-total.styles.scss";
|
||||||
import InstanceRenderManager from "../../utils/instanceRenderMgr";
|
|
||||||
|
|
||||||
export default function JobBillsTotalComponent({
|
export default function JobBillsTotalComponent({
|
||||||
loading,
|
loading,
|
||||||
bills,
|
bills,
|
||||||
partsOrders,
|
partsOrders,
|
||||||
jobTotals,
|
jobTotals,
|
||||||
|
showWarning,
|
||||||
|
warningCallback
|
||||||
}) {
|
}) {
|
||||||
const {t} = useTranslation();
|
const {t} = useTranslation();
|
||||||
|
|
||||||
if (loading) return <LoadingSkeleton/>;
|
if (loading) return <LoadingSkeleton/>;
|
||||||
if (!!!jobTotals)
|
if (!!!jobTotals){
|
||||||
return (
|
|
||||||
<AlertComponent type="error" message={t("jobs.errors.nofinancial")}/>
|
if(showWarning && warningCallback && typeof warningCallback === 'function'){
|
||||||
);
|
warningCallback(t("jobs.errors.nofinancial"))
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<AlertComponent type="error" message={t("jobs.errors.nofinancial")}/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const totals = jobTotals;
|
const totals = jobTotals;
|
||||||
|
|
||||||
@@ -99,9 +106,24 @@ export default function JobBillsTotalComponent({
|
|||||||
const discrepWithCms = discrepWithLbrAdj.add(totalReturns);
|
const discrepWithCms = discrepWithLbrAdj.add(totalReturns);
|
||||||
const calculatedCreditsNotReceived = totalReturns.subtract(billCms); //billCms is tracked as a negative number.
|
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
|
||||||
|
) {
|
||||||
|
warningCallback(t('jobs.labels.outstanding_reconciliation_discrep'));
|
||||||
|
}
|
||||||
|
if (calculatedCreditsNotReceived.getAmount() > 0) {
|
||||||
|
warningCallback(t('jobs.labels.outstanding_credit_memos'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Row gutter={16}>
|
<Row gutter={[16,16]}>
|
||||||
<Col span={18}>
|
<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">
|
<Space wrap size="large">
|
||||||
<Tooltip
|
<Tooltip
|
||||||
@@ -218,9 +240,15 @@ export default function JobBillsTotalComponent({
|
|||||||
/>
|
/>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Space>
|
</Space>
|
||||||
|
|
||||||
|
{showWarning && (
|
||||||
|
discrepWithCms.getAmount() !== 0 ||
|
||||||
|
discrepWithLbrAdj.getAmount() !== 0 ||
|
||||||
|
discrepancy.getAmount() !== 0
|
||||||
|
) && <Alert style={{margin: "8px 0px"}} type="warning" message={t("jobs.labels.outstanding_reconciliation_discrep")}/>}
|
||||||
</Card>
|
</Card>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={6}>
|
<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>
|
<Space wrap>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
@@ -288,6 +316,9 @@ export default function JobBillsTotalComponent({
|
|||||||
/>
|
/>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Space>
|
</Space>
|
||||||
|
{showWarning && (
|
||||||
|
calculatedCreditsNotReceived.getAmount() > 0
|
||||||
|
) && <Alert style={{margin: "8px 0px"}} type="warning" message={t("jobs.labels.outstanding_credit_memos")}/>}
|
||||||
</Card>
|
</Card>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
});
|
});
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(JobCloseRoGuardLabor);
|
export default connect(mapStateToProps, mapDispatchToProps)(JobCloseRoGuardLabor);
|
||||||
|
|
||||||
export function JobCloseRoGuardLabor({ job, jobRO, bodyshop, form }) {
|
export function JobCloseRoGuardLabor({ job, jobRO, bodyshop, form, warningCallback }) {
|
||||||
const { loading, error, data, refetch } = useQuery(GET_LINE_TICKET_BY_PK, {
|
const { loading, error, data, refetch } = useQuery(GET_LINE_TICKET_BY_PK, {
|
||||||
variables: { id: job.id },
|
variables: { id: job.id },
|
||||||
fetchPolicy: 'network-only',
|
fetchPolicy: 'network-only',
|
||||||
@@ -44,6 +44,8 @@ export function JobCloseRoGuardLabor({ job, jobRO, bodyshop, form }) {
|
|||||||
timetickets={data ? data.timetickets : []}
|
timetickets={data ? data.timetickets : []}
|
||||||
refetch={refetch}
|
refetch={refetch}
|
||||||
adjustments={data ? data.jobs_by_pk.lbr_adjustments : []}
|
adjustments={data ? data.jobs_by_pk.lbr_adjustments : []}
|
||||||
|
showWarning
|
||||||
|
warningCallback={warningCallback}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<LaborAllocationsTableComponent
|
<LaborAllocationsTableComponent
|
||||||
@@ -52,6 +54,8 @@ export function JobCloseRoGuardLabor({ job, jobRO, bodyshop, form }) {
|
|||||||
timetickets={data ? data.timetickets : []}
|
timetickets={data ? data.timetickets : []}
|
||||||
refetch={refetch}
|
refetch={refetch}
|
||||||
adjustments={data ? data.jobs_by_pk.lbr_adjustments : []}
|
adjustments={data ? data.jobs_by_pk.lbr_adjustments : []}
|
||||||
|
showWarning
|
||||||
|
warningCallback={warningCallback}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
import { Alert, Card } from 'antd';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { connect } from 'react-redux';
|
||||||
|
import { createStructuredSelector } from 'reselect';
|
||||||
|
import { selectJobReadOnly } from '../../redux/application/application.selectors';
|
||||||
|
import { selectBodyshop } from '../../redux/user/user.selectors';
|
||||||
|
import { useMemo } from 'react';
|
||||||
|
import Dinero from 'dinero.js';
|
||||||
|
import DataLabel from '../data-label/data-label.component';
|
||||||
|
|
||||||
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
//currentUser: selectCurrentUser
|
||||||
|
bodyshop: selectBodyshop,
|
||||||
|
jobRO: selectJobReadOnly,
|
||||||
|
});
|
||||||
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
|
});
|
||||||
|
export default connect(mapStateToProps, mapDispatchToProps)(JobCloseRoGuardProfit);
|
||||||
|
|
||||||
|
export function JobCloseRoGuardProfit({ job, jobRO, bodyshop, form }) {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
const total = useMemo(() => {
|
||||||
|
return (
|
||||||
|
job.payments &&
|
||||||
|
job.payments.reduce((acc, val) => {
|
||||||
|
acc = acc.add(Dinero({ amount: Math.round(val.amount * 100) }));
|
||||||
|
return acc;
|
||||||
|
}, Dinero())
|
||||||
|
);
|
||||||
|
}, [job.payments]);
|
||||||
|
|
||||||
|
const balance = useMemo(() => {
|
||||||
|
if (job && job.job_totals && job.job_totals.totals.total_repairs)
|
||||||
|
return Dinero(job.job_totals.totals.total_repairs).subtract(total);
|
||||||
|
return Dinero({ amount: 0 }).subtract(total);
|
||||||
|
}, [job, total]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Card title={t('jobs.labels.accountsreceivable')} style={{ height: '100%' }}>
|
||||||
|
<DataLabel label={t('payments.labels.totalpayments')}>{total.toFormat()}</DataLabel>
|
||||||
|
<DataLabel
|
||||||
|
valueStyle={{ color: balance.getAmount() !== 0 ? 'red' : 'green' }}
|
||||||
|
label={t('payments.labels.balance')}
|
||||||
|
>
|
||||||
|
{balance.toFormat()}
|
||||||
|
</DataLabel>
|
||||||
|
{balance.getAmount !== 0 && (
|
||||||
|
<Alert style={{margin: "8px 0px"}} type="warning" message={t('jobs.labels.outstanding_ar')} />
|
||||||
|
)}
|
||||||
|
</Card>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -18,7 +18,7 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
});
|
});
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(JobCloseRoGuardBills);
|
export default connect(mapStateToProps, mapDispatchToProps)(JobCloseRoGuardBills);
|
||||||
|
|
||||||
export function JobCloseRoGuardBills({ job, jobRO, bodyshop, form }) {
|
export function JobCloseRoGuardBills({ job, jobRO, bodyshop, form, warningCallback }) {
|
||||||
const { loading, error, data } = useQuery(QUERY_BILLS_BY_JOBID, {
|
const { loading, error, data } = useQuery(QUERY_BILLS_BY_JOBID, {
|
||||||
variables: { jobid: job.id },
|
variables: { jobid: job.id },
|
||||||
fetchPolicy: 'network-only',
|
fetchPolicy: 'network-only',
|
||||||
@@ -33,6 +33,8 @@ export function JobCloseRoGuardBills({ job, jobRO, bodyshop, form }) {
|
|||||||
bills={data ? data.bills : []}
|
bills={data ? data.bills : []}
|
||||||
partsOrders={data ? data.parts_orders : []}
|
partsOrders={data ? data.parts_orders : []}
|
||||||
jobTotals={job.job_totals}
|
jobTotals={job.job_totals}
|
||||||
|
showWarning
|
||||||
|
warningCallback={warningCallback}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,20 @@
|
|||||||
import React from 'react';
|
import React, { useCallback, useState } from 'react';
|
||||||
|
|
||||||
import { Col, Row } from 'antd';
|
import { Badge, Card, Col, Collapse, Row, Space } from 'antd';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { createStructuredSelector } from 'reselect';
|
import { createStructuredSelector } from 'reselect';
|
||||||
import { selectJobReadOnly } from '../../redux/application/application.selectors';
|
import { selectJobReadOnly } from '../../redux/application/application.selectors';
|
||||||
import { selectBodyshop } from '../../redux/user/user.selectors';
|
import { selectBodyshop } from '../../redux/user/user.selectors';
|
||||||
import JobCloseRoGuardBills from './job-close-ro-guard.bills';
|
|
||||||
import JobCloseRoGuardTotals from './job-close-ro-guard.totals';
|
|
||||||
import JobCloseRoGuardLabor from './job-close-ro-gaurd.labor';
|
import JobCloseRoGuardLabor from './job-close-ro-gaurd.labor';
|
||||||
import JobCloseRoGuardTtLifecycle from './job-close-ro-guard.tt-lifecycle';
|
import JobCloseRoGuardAr from './job-close-ro-guard.ar';
|
||||||
|
import JobCloseRoGuardBills from './job-close-ro-guard.bills';
|
||||||
|
import JobCloseRoGuardPpd from './job-close-ro-guard.ppd';
|
||||||
import JobCloseRoGuardProfit from './job-close-ro-guard.profit';
|
import JobCloseRoGuardProfit from './job-close-ro-guard.profit';
|
||||||
|
import './job-close-ro-guard.styles.scss';
|
||||||
|
import JobCloseRoGuardSublet from './job-close-ro-guard.sublet';
|
||||||
|
import JobCloseRoGuardTtLifecycle from './job-close-ro-guard.tt-lifecycle';
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
//currentUser: selectCurrentUser
|
//currentUser: selectCurrentUser
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -26,26 +31,67 @@ const colSpans = {
|
|||||||
xl: 8,
|
xl: 8,
|
||||||
};
|
};
|
||||||
export function JobCloseRoGuardContainer({ job, jobRO, bodyshop, form }) {
|
export function JobCloseRoGuardContainer({ job, jobRO, bodyshop, form }) {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const [warnings, setWarnings] = useState([]);
|
||||||
|
|
||||||
|
const warningCallback = useCallback((warning) => setWarnings((state) => [...state, warning]), []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Row gutter={[32,32]}>
|
<>
|
||||||
<Col {...colSpans}>
|
{warnings.length > 0 && (
|
||||||
<JobCloseRoGuardBills job={job} form={form} />
|
<Card
|
||||||
</Col>
|
title={
|
||||||
<Col {...colSpans}>
|
<Space size="small">
|
||||||
<JobCloseRoGuardProfit job={job} form={form} />
|
<Badge count={warnings.length} />
|
||||||
</Col>
|
{t('jobs.labels.roguardwarnings')}
|
||||||
<Col {...colSpans}>
|
</Space>
|
||||||
<JobCloseRoGuardTotals job={job} />
|
}
|
||||||
</Col>
|
>
|
||||||
<Col {...colSpans}>AR Balance</Col>
|
<ul>
|
||||||
<Col {...colSpans}>
|
{warnings.map((warning, index) => (
|
||||||
<JobCloseRoGuardLabor job={job} form={form} />
|
<li key={index}>{warning}</li>
|
||||||
</Col>
|
))}
|
||||||
<Col {...colSpans}>Sublet Manager</Col>
|
</ul>
|
||||||
<Col {...colSpans}>PPD Check</Col>
|
</Card>
|
||||||
<Col {...colSpans}>
|
)}
|
||||||
<JobCloseRoGuardTtLifecycle job={job} />
|
|
||||||
</Col>
|
<Collapse>
|
||||||
</Row>
|
<Collapse.Panel forceRender key="roguard" header={t('jobs.labels.roguard')}>
|
||||||
|
<Row gutter={[32, 32]}>
|
||||||
|
<JobCloseRoGuardBills job={job} form={form} warningCallback={warningCallback} />
|
||||||
|
<Col className="ro-guard-col-multiple" md={24} lg={6}>
|
||||||
|
<Row gutter={[32, 32]} style={{ height: '100%' }}>
|
||||||
|
<Col span={24}>
|
||||||
|
<JobCloseRoGuardProfit
|
||||||
|
job={job}
|
||||||
|
form={form} //warningCallback={warningCallback}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col span={24}>
|
||||||
|
<JobCloseRoGuardAr job={job} form={form} warningCallback={warningCallback} />
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</Col>
|
||||||
|
<Col className="ro-guard-col" md={24} lg={8}>
|
||||||
|
<JobCloseRoGuardSublet job={job} warningCallback={warningCallback} />
|
||||||
|
</Col>
|
||||||
|
<Col className="ro-guard-col" md={24} lg={10}>
|
||||||
|
<JobCloseRoGuardLabor job={job} form={form} warningCallback={warningCallback} />
|
||||||
|
</Col>
|
||||||
|
<Col className="ro-guard-col" {...colSpans}>
|
||||||
|
<JobCloseRoGuardPpd job={job} warningCallback={warningCallback} />
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</Collapse.Panel>
|
||||||
|
|
||||||
|
<Collapse.Panel header={t('jobs.labels.performance')}>
|
||||||
|
<Row gutter={[32, 32]}>
|
||||||
|
<Col className="ro-guard-col" span={24}>
|
||||||
|
<JobCloseRoGuardTtLifecycle job={job} />
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</Collapse.Panel>
|
||||||
|
</Collapse>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,85 @@
|
|||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
import { Card, Table } from 'antd';
|
||||||
|
import { t } from 'i18next';
|
||||||
|
import { connect } from 'react-redux';
|
||||||
|
import { createStructuredSelector } from 'reselect';
|
||||||
|
import { selectJobReadOnly } from '../../redux/application/application.selectors';
|
||||||
|
import { selectBodyshop } from '../../redux/user/user.selectors';
|
||||||
|
import CurrencyFormatter from '../../utils/CurrencyFormatter';
|
||||||
|
import { alphaSort } from '../../utils/sorters';
|
||||||
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
//currentUser: selectCurrentUser
|
||||||
|
bodyshop: selectBodyshop,
|
||||||
|
jobRO: selectJobReadOnly,
|
||||||
|
});
|
||||||
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
|
});
|
||||||
|
export default connect(mapStateToProps, mapDispatchToProps)(JobCloseRGuardPpd);
|
||||||
|
|
||||||
|
export function JobCloseRGuardPpd({ job, jobRO, bodyshop, form }) {
|
||||||
|
const subletsNotDone = job?.joblines.filter(
|
||||||
|
(j) => j.act_price_before_ppc !== 0 && j.act_price_before_ppc !== null
|
||||||
|
);
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{
|
||||||
|
title: t('joblines.fields.line_desc'),
|
||||||
|
dataIndex: 'line_desc',
|
||||||
|
fixed: 'left',
|
||||||
|
key: 'line_desc',
|
||||||
|
sorter: (a, b) => alphaSort(a.line_desc, b.line_desc),
|
||||||
|
onCell: (record) => ({
|
||||||
|
className: record.manual_line && 'job-line-manual',
|
||||||
|
style: {
|
||||||
|
...(record.critical ? { boxShadow: ' -.5em 0 0 #FFC107' } : {}),
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t('joblines.fields.act_price'),
|
||||||
|
dataIndex: 'act_price',
|
||||||
|
key: 'act_price',
|
||||||
|
sorter: (a, b) => a.act_price - b.act_price,
|
||||||
|
|
||||||
|
ellipsis: true,
|
||||||
|
render: (text, record) => <CurrencyFormatter>{record.act_price}</CurrencyFormatter>,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t('joblines.fields.act_price_before_ppc'),
|
||||||
|
dataIndex: 'act_price_before_ppc',
|
||||||
|
key: 'act_price_before_ppc',
|
||||||
|
sorter: (a, b) => a.act_price_before_ppc - b.act_price_before_ppc,
|
||||||
|
|
||||||
|
ellipsis: true,
|
||||||
|
render: (text, record) => (
|
||||||
|
<CurrencyFormatter>{record.act_price_before_ppc}</CurrencyFormatter>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t('joblines.fields.part_qty'),
|
||||||
|
dataIndex: 'part_qty',
|
||||||
|
key: 'part_qty',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t('joblines.fields.notes'),
|
||||||
|
dataIndex: 'notes',
|
||||||
|
key: 'notes',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Card title={t('jobs.labels.subletsnotcompleted')}>
|
||||||
|
<Table
|
||||||
|
dataSource={subletsNotDone}
|
||||||
|
columns={columns}
|
||||||
|
pagination={false}
|
||||||
|
rowKey="id"
|
||||||
|
bordered
|
||||||
|
size="small"
|
||||||
|
/>
|
||||||
|
</Card>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,15 +1,15 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
|
|
||||||
|
import { LockOutlined } from '@ant-design/icons';
|
||||||
|
import { Card, Form, Input } from 'antd';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { createStructuredSelector } from 'reselect';
|
import { createStructuredSelector } from 'reselect';
|
||||||
import { selectJobReadOnly } from '../../redux/application/application.selectors';
|
import { selectJobReadOnly } from '../../redux/application/application.selectors';
|
||||||
import { selectBodyshop } from '../../redux/user/user.selectors';
|
import { selectBodyshop } from '../../redux/user/user.selectors';
|
||||||
import JobCostingStatistics from '../job-costing-statistics/job-costing-statistics.component';
|
import JobCostingStatistics from '../job-costing-statistics/job-costing-statistics.component';
|
||||||
import LoadingSkeleton from '../loading-skeleton/loading-skeleton.component';
|
import LoadingSkeleton from '../loading-skeleton/loading-skeleton.component';
|
||||||
import { Card, Form, Input, Space } from 'antd';
|
|
||||||
import { useTranslation } from 'react-i18next';
|
|
||||||
import { LockOutlined } from '@ant-design/icons';
|
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
//currentUser: selectCurrentUser
|
//currentUser: selectCurrentUser
|
||||||
@@ -21,7 +21,7 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
});
|
});
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(JobCloseRoGuardProfit);
|
export default connect(mapStateToProps, mapDispatchToProps)(JobCloseRoGuardProfit);
|
||||||
|
|
||||||
export function JobCloseRoGuardProfit({ job, jobRO, bodyshop, form }) {
|
export function JobCloseRoGuardProfit({ job, jobRO, bodyshop, form, warningCallback }) {
|
||||||
const [costingData, setCostingData] = useState(null);
|
const [costingData, setCostingData] = useState(null);
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@@ -41,14 +41,21 @@ export function JobCloseRoGuardProfit({ job, jobRO, bodyshop, form }) {
|
|||||||
getData();
|
getData();
|
||||||
}, [job.id]);
|
}, [job.id]);
|
||||||
|
|
||||||
|
const enforceProfitPassword =
|
||||||
|
parseFloat(costingData?.summaryData.gppercent) < bodyshop?.md_ro_guard?.totalgppercent_minimum; //TODO Add bodyshop related values.
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (enforceProfitPassword && typeof warningCallback === 'function') {
|
||||||
|
warningCallback(t('jobs.labels.profitbypassrequired'));
|
||||||
|
}
|
||||||
|
}, [enforceProfitPassword, t, warningCallback]);
|
||||||
|
|
||||||
if (loading || !costingData) return <LoadingSkeleton />;
|
if (loading || !costingData) return <LoadingSkeleton />;
|
||||||
|
|
||||||
const enforceProfitPassword = parseFloat(costingData?.summaryData.gppercent) < 90;
|
|
||||||
return (
|
return (
|
||||||
<Card title={t('jobs.labels.profits')}>
|
<Card title={t('jobs.labels.profits')} style={{ height: '100%' }}>
|
||||||
<Space direction="horizontal">
|
<JobCostingStatistics summaryData={costingData?.summaryData} onlyGP />
|
||||||
<JobCostingStatistics summaryData={costingData?.summaryData} onlyGP />
|
|
||||||
</Space>{' '}
|
|
||||||
{enforceProfitPassword && (
|
{enforceProfitPassword && (
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="profitbypasspassword"
|
name="profitbypasspassword"
|
||||||
@@ -61,10 +68,9 @@ export function JobCloseRoGuardProfit({ job, jobRO, bodyshop, form }) {
|
|||||||
validator(_, value) {
|
validator(_, value) {
|
||||||
if (
|
if (
|
||||||
parseFloat(costingData?.summaryData.gppercent) <
|
parseFloat(costingData?.summaryData.gppercent) <
|
||||||
bodyshop.md_ro_guard.totalgppercent_minimum &&
|
bodyshop?.md_ro_guard?.totalgppercent_minimum &&
|
||||||
value !== bodyshop.md_ro_guard.profitbypasspassword
|
value !== bodyshop.md_ro_guard.profitbypasspassword
|
||||||
) {
|
) {
|
||||||
console.log('We shoudl enforce it.');
|
|
||||||
return Promise.reject(t('jobs.labels.profitbypassrequired'));
|
return Promise.reject(t('jobs.labels.profitbypassrequired'));
|
||||||
}
|
}
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
.ro-guard-col {
|
||||||
|
.ant-card {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
import React, { useEffect } from 'react';
|
||||||
|
|
||||||
|
import { Alert, Card, Table } from 'antd';
|
||||||
|
import { t } from 'i18next';
|
||||||
|
import { connect } from 'react-redux';
|
||||||
|
import { createStructuredSelector } from 'reselect';
|
||||||
|
import { selectJobReadOnly } from '../../redux/application/application.selectors';
|
||||||
|
import { selectBodyshop } from '../../redux/user/user.selectors';
|
||||||
|
import CurrencyFormatter from '../../utils/CurrencyFormatter';
|
||||||
|
import { alphaSort } from '../../utils/sorters';
|
||||||
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
//currentUser: selectCurrentUser
|
||||||
|
bodyshop: selectBodyshop,
|
||||||
|
jobRO: selectJobReadOnly,
|
||||||
|
});
|
||||||
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
|
});
|
||||||
|
export default connect(mapStateToProps, mapDispatchToProps)(JobCloseRGuardSublet);
|
||||||
|
|
||||||
|
export function JobCloseRGuardSublet({ job, jobRO, bodyshop, form, warningCallback }) {
|
||||||
|
const subletsNotDone = job?.joblines.filter(
|
||||||
|
(j) =>
|
||||||
|
(j.part_type === 'PAS' || j.part_type === 'PASL') &&
|
||||||
|
(!j.sublet_completed || !j.sublet_ignored)
|
||||||
|
);
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{
|
||||||
|
title: t('joblines.fields.line_desc'),
|
||||||
|
dataIndex: 'line_desc',
|
||||||
|
fixed: 'left',
|
||||||
|
key: 'line_desc',
|
||||||
|
sorter: (a, b) => alphaSort(a.line_desc, b.line_desc),
|
||||||
|
onCell: (record) => ({
|
||||||
|
className: record.manual_line && 'job-line-manual',
|
||||||
|
style: {
|
||||||
|
...(record.critical ? { boxShadow: ' -.5em 0 0 #FFC107' } : {}),
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t('joblines.fields.act_price'),
|
||||||
|
dataIndex: 'act_price',
|
||||||
|
key: 'act_price',
|
||||||
|
sorter: (a, b) => a.act_price - b.act_price,
|
||||||
|
|
||||||
|
ellipsis: true,
|
||||||
|
render: (text, record) => <CurrencyFormatter>{record.act_price}</CurrencyFormatter>,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t('joblines.fields.part_qty'),
|
||||||
|
dataIndex: 'part_qty',
|
||||||
|
key: 'part_qty',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t('joblines.fields.notes'),
|
||||||
|
dataIndex: 'notes',
|
||||||
|
key: 'notes',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (subletsNotDone.length > 0) {
|
||||||
|
warningCallback(t('jobs.labels.outstanding_sublets'));
|
||||||
|
}
|
||||||
|
}, [subletsNotDone.length, warningCallback]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Card title={t('jobs.labels.subletsnotcompleted')}>
|
||||||
|
<Table
|
||||||
|
dataSource={subletsNotDone}
|
||||||
|
columns={columns}
|
||||||
|
pagination={false}
|
||||||
|
rowKey="id"
|
||||||
|
bordered
|
||||||
|
size="small"
|
||||||
|
/>
|
||||||
|
{subletsNotDone.length > 0 && (
|
||||||
|
<Alert
|
||||||
|
style={{ margin: '8px 0px' }}
|
||||||
|
type="warning"
|
||||||
|
message={t('jobs.labels.outstanding_sublets')}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</Card>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -18,7 +18,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(JobCloseRoGuardTTLif
|
|||||||
export function JobCloseRoGuardTTLifeCycle({ job, jobRO, bodyshop, form }) {
|
export function JobCloseRoGuardTTLifeCycle({ job, jobRO, bodyshop, form }) {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
Add Touch Time
|
//TODO Add Touch Time
|
||||||
<JobLifecycleComponent job={job} statuses={bodyshop.md_ro_statuses} />
|
<JobLifecycleComponent job={job} statuses={bodyshop.md_ro_statuses} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -8,13 +8,26 @@ export default function JobCostingStatistics({ summaryData, onlyGP }) {
|
|||||||
|
|
||||||
const gpTotals = (
|
const gpTotals = (
|
||||||
<>
|
<>
|
||||||
<Statistic
|
<Space wrap direction="horizontal" size={'large'}>
|
||||||
value={Dinero(summaryData.gpdollars).toFormat()}
|
<Statistic
|
||||||
title={t('jobs.labels.gpdollars')}
|
value={Dinero(summaryData.totalSales).toFormat()}
|
||||||
/>
|
title={t('jobs.labels.total_sales')}
|
||||||
<Statistic value={summaryData.gppercentFormatted} title={t('jobs.labels.gppercent')} />
|
/>
|
||||||
|
<Statistic
|
||||||
|
value={Dinero(summaryData.totalCost).toFormat()}
|
||||||
|
title={t('jobs.labels.total_cost')}
|
||||||
|
/>
|
||||||
|
</Space>{' '}
|
||||||
|
<Space wrap direction="horizontal" size={'large'}>
|
||||||
|
<Statistic
|
||||||
|
value={Dinero(summaryData.gpdollars).toFormat()}
|
||||||
|
title={t('jobs.labels.gpdollars')}
|
||||||
|
/>
|
||||||
|
<Statistic value={summaryData.gppercentFormatted} title={t('jobs.labels.gppercent')} />
|
||||||
|
</Space>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
||||||
if (onlyGP) return gpTotals;
|
if (onlyGP) return gpTotals;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -227,7 +227,7 @@ export function JobLifecycleComponent({job, statuses, ...rest}) {
|
|||||||
<Table style={{
|
<Table style={{
|
||||||
overflow: 'auto',
|
overflow: 'auto',
|
||||||
width: '100%',
|
width: '100%',
|
||||||
}} columns={columns} dataSource={lifecycleData.lifecycle}/>
|
}} columns={columns} dataSource={lifecycleData.lifecycle} rowKey={"start"}/>
|
||||||
</Card>
|
</Card>
|
||||||
</Space>
|
</Space>
|
||||||
) : (
|
) : (
|
||||||
@@ -244,4 +244,4 @@ export function JobLifecycleComponent({job, statuses, ...rest}) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default JobLifecycleComponent;
|
export default JobLifecycleComponent;
|
||||||
|
|||||||
@@ -143,6 +143,7 @@ export function JobPayments({
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
//Same as in RO guard. If changed, update in both.
|
||||||
const total = useMemo(() => {
|
const total = useMemo(() => {
|
||||||
return (
|
return (
|
||||||
job.payments &&
|
job.payments &&
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import {EditFilled} from "@ant-design/icons";
|
import {EditFilled} from "@ant-design/icons";
|
||||||
import {Card, Col, Row, Space, Table, Typography} from "antd";
|
import {Alert, Card, Col, Row, Space, Table, Typography} from "antd";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import React, {useEffect, useMemo, useState} from "react";
|
import React, {useEffect, useMemo, useState} from "react";
|
||||||
import {useTranslation} from "react-i18next";
|
import {useTranslation} from "react-i18next";
|
||||||
@@ -26,6 +26,8 @@ export function LaborAllocationsTable({
|
|||||||
bodyshop,
|
bodyshop,
|
||||||
adjustments,
|
adjustments,
|
||||||
technician,
|
technician,
|
||||||
|
showWarning,
|
||||||
|
warningCallback
|
||||||
}) {
|
}) {
|
||||||
const {t} = useTranslation();
|
const {t} = useTranslation();
|
||||||
const [totals, setTotals] = useState([]);
|
const [totals, setTotals] = useState([]);
|
||||||
@@ -202,6 +204,11 @@ export function LaborAllocationsTable({
|
|||||||
{hrs_total: 0, hrs_claimed: 0, adjustments: 0, difference: 0}
|
{hrs_total: 0, hrs_claimed: 0, adjustments: 0, difference: 0}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (summary.difference !== 0 && typeof warningCallback === 'function') {
|
||||||
|
warningCallback(t('jobs.labels.outstandinghours'));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Row gutter={[16, 16]}>
|
<Row gutter={[16, 16]}>
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
@@ -260,7 +267,15 @@ export function LaborAllocationsTable({
|
|||||||
/>
|
/>
|
||||||
</Card>
|
</Card>
|
||||||
</Col>
|
</Col>
|
||||||
)}
|
)}
|
||||||
|
{
|
||||||
|
showWarning && summary.difference !== 0 &&
|
||||||
|
<Alert
|
||||||
|
style={{ margin: '8px 0px' }}
|
||||||
|
type="warning"
|
||||||
|
message={t('jobs.labels.outstandinghours')}
|
||||||
|
/>
|
||||||
|
}
|
||||||
</Row>
|
</Row>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import {Button, Card, Col, notification, Row, Space, Table, Typography,} from "antd";
|
import {Alert, Button, Card, Col, notification, Row, Space, Table, Typography,} from "antd";
|
||||||
import {SyncOutlined} from "@ant-design/icons";
|
import {SyncOutlined} from "@ant-design/icons";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
@@ -24,6 +24,8 @@ export function PayrollLaborAllocationsTable({
|
|||||||
adjustments,
|
adjustments,
|
||||||
technician,
|
technician,
|
||||||
refetch,
|
refetch,
|
||||||
|
showWarning,
|
||||||
|
warningCallback
|
||||||
}) {
|
}) {
|
||||||
const {t} = useTranslation();
|
const {t} = useTranslation();
|
||||||
const [totals, setTotals] = useState([]);
|
const [totals, setTotals] = useState([]);
|
||||||
@@ -216,6 +218,10 @@ export function PayrollLaborAllocationsTable({
|
|||||||
{hrs_total: 0, hrs_claimed: 0, adjustments: 0, difference: 0}
|
{hrs_total: 0, hrs_claimed: 0, adjustments: 0, difference: 0}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (summary.difference !== 0 && typeof warningCallback === 'function') {
|
||||||
|
warningCallback(t('jobs.labels.outstandinghours'));
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Row gutter={[16, 16]}>
|
<Row gutter={[16, 16]}>
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
@@ -318,6 +324,14 @@ export function PayrollLaborAllocationsTable({
|
|||||||
</Card>
|
</Card>
|
||||||
</Col>
|
</Col>
|
||||||
)}
|
)}
|
||||||
|
{
|
||||||
|
showWarning && summary.difference !== 0 &&
|
||||||
|
<Alert
|
||||||
|
style={{ margin: '8px 0px' }}
|
||||||
|
type="warning"
|
||||||
|
message={t('jobs.labels.outstandinghours')}
|
||||||
|
/>
|
||||||
|
}
|
||||||
</Row>
|
</Row>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2030,6 +2030,19 @@ export const QUERY_JOB_CLOSE_DETAILS = gql`
|
|||||||
kmout
|
kmout
|
||||||
qb_multiple_payers
|
qb_multiple_payers
|
||||||
lbr_adjustments
|
lbr_adjustments
|
||||||
|
payments {
|
||||||
|
amount
|
||||||
|
created_at
|
||||||
|
date
|
||||||
|
exportedat
|
||||||
|
id
|
||||||
|
jobid
|
||||||
|
memo
|
||||||
|
payer
|
||||||
|
paymentnum
|
||||||
|
transactionid
|
||||||
|
type
|
||||||
|
}
|
||||||
joblines(where: { removed: { _eq: false } }, order_by: { line_no: asc }) {
|
joblines(where: { removed: { _eq: false } }, order_by: { line_no: asc }) {
|
||||||
id
|
id
|
||||||
removed
|
removed
|
||||||
@@ -2042,6 +2055,7 @@ export const QUERY_JOB_CLOSE_DETAILS = gql`
|
|||||||
db_price
|
db_price
|
||||||
act_price
|
act_price
|
||||||
part_qty
|
part_qty
|
||||||
|
notes
|
||||||
mod_lbr_ty
|
mod_lbr_ty
|
||||||
db_hrs
|
db_hrs
|
||||||
mod_lb_hrs
|
mod_lb_hrs
|
||||||
@@ -2053,6 +2067,9 @@ export const QUERY_JOB_CLOSE_DETAILS = gql`
|
|||||||
prt_dsmk_p
|
prt_dsmk_p
|
||||||
convertedtolbr
|
convertedtolbr
|
||||||
convertedtolbr_data
|
convertedtolbr_data
|
||||||
|
act_price_before_ppc
|
||||||
|
sublet_ignored
|
||||||
|
sublet_completed
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1951,6 +1951,11 @@
|
|||||||
"net_repairs": "Net Repairs",
|
"net_repairs": "Net Repairs",
|
||||||
"notes": "Notes",
|
"notes": "Notes",
|
||||||
"othertotal": "Other Totals",
|
"othertotal": "Other Totals",
|
||||||
|
"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_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?",
|
"override_header": "Override estimate header on import?",
|
||||||
"ownerassociation": "Owner Association",
|
"ownerassociation": "Owner Association",
|
||||||
"parts": "Parts",
|
"parts": "Parts",
|
||||||
@@ -1995,6 +2000,7 @@
|
|||||||
"relatedros": "Related ROs",
|
"relatedros": "Related ROs",
|
||||||
"remove_from_ar": "Remove from AR",
|
"remove_from_ar": "Remove from AR",
|
||||||
"returntotals": "Return Totals",
|
"returntotals": "Return Totals",
|
||||||
|
"roguardwarnings": "RO Guard Warnings",
|
||||||
"rosaletotal": "RO Parts Total",
|
"rosaletotal": "RO Parts Total",
|
||||||
"sale_additional": "Sales - Additional",
|
"sale_additional": "Sales - Additional",
|
||||||
"sale_labor": "Sales - Labor",
|
"sale_labor": "Sales - Labor",
|
||||||
@@ -2005,6 +2011,7 @@
|
|||||||
"scheduledinchange": "The scheduled in is based off the latest appointment. To change this date, please schedule or reschedule the Job. ",
|
"scheduledinchange": "The scheduled in is based off the latest appointment. To change this date, please schedule or reschedule the Job. ",
|
||||||
"specialcoveragepolicy": "Special Coverage Policy Applies",
|
"specialcoveragepolicy": "Special Coverage Policy Applies",
|
||||||
"state_tax_amt": "Provincial/State Taxes",
|
"state_tax_amt": "Provincial/State Taxes",
|
||||||
|
"subletsnotcompleted": "Outstanding Sublets",
|
||||||
"subletstotal": "Sublets Total",
|
"subletstotal": "Sublets Total",
|
||||||
"subtotal": "Subtotal",
|
"subtotal": "Subtotal",
|
||||||
"supplementnote": "The Job had a supplement imported.",
|
"supplementnote": "The Job had a supplement imported.",
|
||||||
|
|||||||
@@ -1165,6 +1165,7 @@
|
|||||||
"loadingshop": "Cargando datos de la tienda ...",
|
"loadingshop": "Cargando datos de la tienda ...",
|
||||||
"loggingin": "Iniciando sesión ...",
|
"loggingin": "Iniciando sesión ...",
|
||||||
"markedexported": "",
|
"markedexported": "",
|
||||||
|
"media": "",
|
||||||
"message": "",
|
"message": "",
|
||||||
"monday": "",
|
"monday": "",
|
||||||
"na": "N / A",
|
"na": "N / A",
|
||||||
@@ -1950,6 +1951,11 @@
|
|||||||
"net_repairs": "",
|
"net_repairs": "",
|
||||||
"notes": "Notas",
|
"notes": "Notas",
|
||||||
"othertotal": "",
|
"othertotal": "",
|
||||||
|
"outstanding_ar": "",
|
||||||
|
"outstanding_credit_memos": "",
|
||||||
|
"outstanding_reconciliation_discrep": "",
|
||||||
|
"outstanding_sublets": "",
|
||||||
|
"outstandinghours": "",
|
||||||
"override_header": "¿Anular encabezado estimado al importar?",
|
"override_header": "¿Anular encabezado estimado al importar?",
|
||||||
"ownerassociation": "",
|
"ownerassociation": "",
|
||||||
"parts": "Partes",
|
"parts": "Partes",
|
||||||
@@ -1994,6 +2000,7 @@
|
|||||||
"relatedros": "",
|
"relatedros": "",
|
||||||
"remove_from_ar": "",
|
"remove_from_ar": "",
|
||||||
"returntotals": "",
|
"returntotals": "",
|
||||||
|
"roguardwarnings": "",
|
||||||
"rosaletotal": "",
|
"rosaletotal": "",
|
||||||
"sale_additional": "",
|
"sale_additional": "",
|
||||||
"sale_labor": "",
|
"sale_labor": "",
|
||||||
@@ -2004,6 +2011,7 @@
|
|||||||
"scheduledinchange": "",
|
"scheduledinchange": "",
|
||||||
"specialcoveragepolicy": "",
|
"specialcoveragepolicy": "",
|
||||||
"state_tax_amt": "",
|
"state_tax_amt": "",
|
||||||
|
"subletsnotcompleted": "",
|
||||||
"subletstotal": "",
|
"subletstotal": "",
|
||||||
"subtotal": "",
|
"subtotal": "",
|
||||||
"supplementnote": "",
|
"supplementnote": "",
|
||||||
|
|||||||
@@ -1165,6 +1165,7 @@
|
|||||||
"loadingshop": "Chargement des données de la boutique ...",
|
"loadingshop": "Chargement des données de la boutique ...",
|
||||||
"loggingin": "Vous connecter ...",
|
"loggingin": "Vous connecter ...",
|
||||||
"markedexported": "",
|
"markedexported": "",
|
||||||
|
"media": "",
|
||||||
"message": "",
|
"message": "",
|
||||||
"monday": "",
|
"monday": "",
|
||||||
"na": "N / A",
|
"na": "N / A",
|
||||||
@@ -1950,6 +1951,11 @@
|
|||||||
"net_repairs": "",
|
"net_repairs": "",
|
||||||
"notes": "Remarques",
|
"notes": "Remarques",
|
||||||
"othertotal": "",
|
"othertotal": "",
|
||||||
|
"outstanding_ar": "",
|
||||||
|
"outstanding_credit_memos": "",
|
||||||
|
"outstanding_reconciliation_discrep": "",
|
||||||
|
"outstanding_sublets": "",
|
||||||
|
"outstandinghours": "",
|
||||||
"override_header": "Remplacer l'en-tête d'estimation à l'importation?",
|
"override_header": "Remplacer l'en-tête d'estimation à l'importation?",
|
||||||
"ownerassociation": "",
|
"ownerassociation": "",
|
||||||
"parts": "les pièces",
|
"parts": "les pièces",
|
||||||
@@ -1994,6 +2000,7 @@
|
|||||||
"relatedros": "",
|
"relatedros": "",
|
||||||
"remove_from_ar": "",
|
"remove_from_ar": "",
|
||||||
"returntotals": "",
|
"returntotals": "",
|
||||||
|
"roguardwarnings": "",
|
||||||
"rosaletotal": "",
|
"rosaletotal": "",
|
||||||
"sale_additional": "",
|
"sale_additional": "",
|
||||||
"sale_labor": "",
|
"sale_labor": "",
|
||||||
@@ -2004,6 +2011,7 @@
|
|||||||
"scheduledinchange": "",
|
"scheduledinchange": "",
|
||||||
"specialcoveragepolicy": "",
|
"specialcoveragepolicy": "",
|
||||||
"state_tax_amt": "",
|
"state_tax_amt": "",
|
||||||
|
"subletsnotcompleted": "",
|
||||||
"subletstotal": "",
|
"subletstotal": "",
|
||||||
"subtotal": "",
|
"subtotal": "",
|
||||||
"supplementnote": "",
|
"supplementnote": "",
|
||||||
|
|||||||
Reference in New Issue
Block a user