WIP RO Closer.

This commit is contained in:
Patrick Fic
2024-03-25 15:38:38 -07:00
parent 15a9988894
commit 815ada0516
20 changed files with 635 additions and 60 deletions

View File

@@ -1,5 +1,5 @@
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 React, {useEffect, useMemo, useState} from "react";
import {useTranslation} from "react-i18next";
@@ -26,6 +26,8 @@ export function LaborAllocationsTable({
bodyshop,
adjustments,
technician,
showWarning,
warningCallback
}) {
const {t} = useTranslation();
const [totals, setTotals] = useState([]);
@@ -202,6 +204,11 @@ export function LaborAllocationsTable({
{hrs_total: 0, hrs_claimed: 0, adjustments: 0, difference: 0}
);
if (summary.difference !== 0 && typeof warningCallback === 'function') {
warningCallback(t('jobs.labels.outstandinghours'));
}
return (
<Row gutter={[16, 16]}>
<Col span={24}>
@@ -260,7 +267,15 @@ export function LaborAllocationsTable({
/>
</Card>
</Col>
)}
)}
{
showWarning && summary.difference !== 0 &&
<Alert
style={{ margin: '8px 0px' }}
type="warning"
message={t('jobs.labels.outstandinghours')}
/>
}
</Row>
);
}

View File

@@ -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 axios from "axios";
import _ from "lodash";
@@ -24,6 +24,8 @@ export function PayrollLaborAllocationsTable({
adjustments,
technician,
refetch,
showWarning,
warningCallback
}) {
const {t} = useTranslation();
const [totals, setTotals] = useState([]);
@@ -216,6 +218,10 @@ export function PayrollLaborAllocationsTable({
{hrs_total: 0, hrs_claimed: 0, adjustments: 0, difference: 0}
);
if (summary.difference !== 0 && typeof warningCallback === 'function') {
warningCallback(t('jobs.labels.outstandinghours'));
}
return (
<Row gutter={[16, 16]}>
<Col span={24}>
@@ -318,6 +324,14 @@ export function PayrollLaborAllocationsTable({
</Card>
</Col>
)}
{
showWarning && summary.difference !== 0 &&
<Alert
style={{ margin: '8px 0px' }}
type="warning"
message={t('jobs.labels.outstandinghours')}
/>
}
</Row>
);
}