Lint all the things
This commit is contained in:
@@ -11,7 +11,6 @@ node_modules
|
|||||||
# Files to exclude
|
# Files to exclude
|
||||||
.ebignore
|
.ebignore
|
||||||
.editorconfig
|
.editorconfig
|
||||||
.eslintrc.json
|
|
||||||
.gitignore
|
.gitignore
|
||||||
.prettierrc.js
|
.prettierrc.js
|
||||||
Dockerfile
|
Dockerfile
|
||||||
@@ -19,6 +18,6 @@ README.MD
|
|||||||
bodyshop_translations.babel
|
bodyshop_translations.babel
|
||||||
docker-compose.yml
|
docker-compose.yml
|
||||||
ecosystem.config.js
|
ecosystem.config.js
|
||||||
|
eslint.config.mjs
|
||||||
# Optional: Exclude logs and temporary files
|
# Optional: Exclude logs and temporary files
|
||||||
*.log
|
*.log
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
"env": {
|
|
||||||
"es6": true,
|
|
||||||
"node": true
|
|
||||||
},
|
|
||||||
"extends": "eslint:recommended",
|
|
||||||
"globals": {
|
|
||||||
"Atomics": "readonly",
|
|
||||||
"SharedArrayBuffer": "readonly"
|
|
||||||
},
|
|
||||||
"parserOptions": {
|
|
||||||
"ecmaVersion": 2018,
|
|
||||||
"sourceType": "module"
|
|
||||||
},
|
|
||||||
"rules": {
|
|
||||||
"no-console": "off"
|
|
||||||
},
|
|
||||||
"settings": {}
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": [
|
|
||||||
"react-app"
|
|
||||||
],
|
|
||||||
"rules": {
|
|
||||||
"no-useless-rename": "off"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -2,9 +2,9 @@ import globals from "globals";
|
|||||||
import pluginJs from "@eslint/js";
|
import pluginJs from "@eslint/js";
|
||||||
import pluginReact from "eslint-plugin-react";
|
import pluginReact from "eslint-plugin-react";
|
||||||
|
|
||||||
/** @type {import('eslint').Linter.Config[]} */
|
/** @type {import("eslint").Linter.Config[]} */
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
|
{ ignores: ["node_modules/**", "dist/**", "build/**", "dev-dist/**"] },
|
||||||
{
|
{
|
||||||
files: ["**/*.{js,mjs,cjs,jsx}"]
|
files: ["**/*.{js,mjs,cjs,jsx}"]
|
||||||
},
|
},
|
||||||
@@ -12,9 +12,13 @@ export default [
|
|||||||
pluginJs.configs.recommended,
|
pluginJs.configs.recommended,
|
||||||
{
|
{
|
||||||
...pluginReact.configs.flat.recommended,
|
...pluginReact.configs.flat.recommended,
|
||||||
|
settings: {
|
||||||
|
react: { version: "detect" }
|
||||||
|
},
|
||||||
rules: {
|
rules: {
|
||||||
...pluginReact.configs.flat.recommended.rules,
|
...pluginReact.configs.flat.recommended.rules,
|
||||||
"react/prop-types": 0
|
"react/prop-types": 0,
|
||||||
|
"react/no-children-prop": 0 // Disable react/no-children-prop rule
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
pluginReact.configs.flat["jsx-runtime"]
|
pluginReact.configs.flat["jsx-runtime"]
|
||||||
|
|||||||
1857
client/package-lock.json
generated
1857
client/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -24,7 +24,7 @@
|
|||||||
"@sentry/vite-plugin": "^4.1.1",
|
"@sentry/vite-plugin": "^4.1.1",
|
||||||
"@splitsoftware/splitio-react": "^2.3.1",
|
"@splitsoftware/splitio-react": "^2.3.1",
|
||||||
"@tanem/react-nprogress": "^5.0.53",
|
"@tanem/react-nprogress": "^5.0.53",
|
||||||
"antd": "^5.27.0",
|
"antd": "^5.27.1",
|
||||||
"apollo-link-logger": "^2.0.1",
|
"apollo-link-logger": "^2.0.1",
|
||||||
"apollo-link-sentry": "^4.4.0",
|
"apollo-link-sentry": "^4.4.0",
|
||||||
"autosize": "^6.0.1",
|
"autosize": "^6.0.1",
|
||||||
@@ -107,7 +107,9 @@
|
|||||||
"test:e2e:rome": "playwright test --config playwright.rome.config.js",
|
"test:e2e:rome": "playwright test --config playwright.rome.config.js",
|
||||||
"test:e2e:imex:headed": "playwright test --config playwright.config.js --headed",
|
"test:e2e:imex:headed": "playwright test --config playwright.config.js --headed",
|
||||||
"test:e2e:rome:headed": "playwright test --config playwright.rome.config.js --headed",
|
"test:e2e:rome:headed": "playwright test --config playwright.rome.config.js --headed",
|
||||||
"test:e2e:report": "playwright show-report"
|
"test:e2e:report": "playwright show-report",
|
||||||
|
"lint": "eslint .",
|
||||||
|
"lint:fix": "eslint . --fix"
|
||||||
},
|
},
|
||||||
"browserslist": {
|
"browserslist": {
|
||||||
"production": [
|
"production": [
|
||||||
@@ -131,7 +133,7 @@
|
|||||||
"@ant-design/icons": "^6.0.0",
|
"@ant-design/icons": "^6.0.0",
|
||||||
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
|
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
|
||||||
"@babel/preset-react": "^7.27.1",
|
"@babel/preset-react": "^7.27.1",
|
||||||
"@dotenvx/dotenvx": "^1.48.4",
|
"@dotenvx/dotenvx": "^1.49.0",
|
||||||
"@emotion/babel-plugin": "^11.13.5",
|
"@emotion/babel-plugin": "^11.13.5",
|
||||||
"@emotion/react": "^11.14.0",
|
"@emotion/react": "^11.14.0",
|
||||||
"@eslint/js": "^9.33.0",
|
"@eslint/js": "^9.33.0",
|
||||||
@@ -141,21 +143,20 @@
|
|||||||
"@testing-library/jest-dom": "^6.7.0",
|
"@testing-library/jest-dom": "^6.7.0",
|
||||||
"@testing-library/react": "^16.3.0",
|
"@testing-library/react": "^16.3.0",
|
||||||
"@vitejs/plugin-react": "^4.6.0",
|
"@vitejs/plugin-react": "^4.6.0",
|
||||||
"browserslist": "^4.25.2",
|
"browserslist": "^4.25.3",
|
||||||
"browserslist-to-esbuild": "^2.1.1",
|
"browserslist-to-esbuild": "^2.1.1",
|
||||||
"chalk": "^5.5.0",
|
"chalk": "^5.6.0",
|
||||||
"eslint": "^8.57.1",
|
"eslint": "^9.33.0",
|
||||||
"eslint-config-react-app": "^7.0.1",
|
|
||||||
"eslint-plugin-react": "^7.37.5",
|
"eslint-plugin-react": "^7.37.5",
|
||||||
"globals": "^15.15.0",
|
"globals": "^15.15.0",
|
||||||
"jsdom": "^26.0.0",
|
"jsdom": "^26.0.0",
|
||||||
"memfs": "^4.36.0",
|
"memfs": "^4.36.3",
|
||||||
"os-browserify": "^0.3.0",
|
"os-browserify": "^0.3.0",
|
||||||
"playwright": "^1.54.2",
|
"playwright": "^1.54.2",
|
||||||
"react-error-overlay": "^6.1.0",
|
"react-error-overlay": "^6.1.0",
|
||||||
"redux-logger": "^3.0.6",
|
"redux-logger": "^3.0.6",
|
||||||
"source-map-explorer": "^2.5.3",
|
"source-map-explorer": "^2.5.3",
|
||||||
"vite": "^7.1.2",
|
"vite": "^7.1.3",
|
||||||
"vite-plugin-babel": "^1.3.2",
|
"vite-plugin-babel": "^1.3.2",
|
||||||
"vite-plugin-eslint": "^1.8.1",
|
"vite-plugin-eslint": "^1.8.1",
|
||||||
"vite-plugin-node-polyfills": "^0.24.0",
|
"vite-plugin-node-polyfills": "^0.24.0",
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ export default defineConfig({
|
|||||||
command: "npm run start:imex",
|
command: "npm run start:imex",
|
||||||
ignoreHTTPSErrors: true,
|
ignoreHTTPSErrors: true,
|
||||||
url: "https://localhost:3000/health", // Health check endpoint will tell us when the server is ready
|
url: "https://localhost:3000/health", // Health check endpoint will tell us when the server is ready
|
||||||
|
// eslint-disable-next-line no-undef
|
||||||
reuseExistingServer: !process.env.CI // Reuse server locally, not in CI
|
reuseExistingServer: !process.env.CI // Reuse server locally, not in CI
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ export default defineConfig({
|
|||||||
command: "npm run start:rome",
|
command: "npm run start:rome",
|
||||||
ignoreHTTPSErrors: true,
|
ignoreHTTPSErrors: true,
|
||||||
url: "https://localhost:3000/health", // Health check endpoint will tell us when the server is ready
|
url: "https://localhost:3000/health", // Health check endpoint will tell us when the server is ready
|
||||||
|
// eslint-disable-next-line no-undef
|
||||||
reuseExistingServer: !process.env.CI // Reuse server locally, not in CI
|
reuseExistingServer: !process.env.CI // Reuse server locally, not in CI
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
// Scripts for firebase and firebase messaging
|
// Scripts for firebase and firebase messaging
|
||||||
|
// eslint-disable-next-line no-undef
|
||||||
importScripts("https://www.gstatic.com/firebasejs/10.14.1/firebase-app-compat.js");
|
importScripts("https://www.gstatic.com/firebasejs/10.14.1/firebase-app-compat.js");
|
||||||
|
// eslint-disable-next-line no-undef
|
||||||
importScripts("https://www.gstatic.com/firebasejs/10.14.1/firebase-messaging-compat.js");
|
importScripts("https://www.gstatic.com/firebasejs/10.14.1/firebase-messaging-compat.js");
|
||||||
|
|
||||||
// Initialize the Firebase app in the service worker by passing the generated config
|
// Initialize the Firebase app in the service worker by passing the generated config
|
||||||
@@ -42,13 +44,16 @@ switch (this.location.hostname) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-undef
|
||||||
firebase.initializeApp(firebaseConfig);
|
firebase.initializeApp(firebaseConfig);
|
||||||
|
|
||||||
// Retrieve firebase messaging
|
// Retrieve firebase messaging
|
||||||
|
// eslint-disable-next-line no-undef
|
||||||
const messaging = firebase.messaging();
|
const messaging = firebase.messaging();
|
||||||
|
|
||||||
messaging.onBackgroundMessage(function (payload) {
|
messaging.onBackgroundMessage(function (payload) {
|
||||||
// Customize notification here
|
// Customize notification here
|
||||||
console.log("[firebase-messaging-sw.js] Received background message ", payload);
|
console.log("[firebase-messaging-sw.js] Received background message ", payload);
|
||||||
|
// eslint-disable-next-line no-undef
|
||||||
self.registration.showNotification(notificationTitle, notificationOptions);
|
self.registration.showNotification(notificationTitle, notificationOptions);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -67,7 +67,6 @@ function AppContainer({ currentUser, setDarkMode }) {
|
|||||||
} else {
|
} else {
|
||||||
setDarkMode(false);
|
setDarkMode(false);
|
||||||
}
|
}
|
||||||
// eslint-disable-next-line
|
|
||||||
}, [currentUser?.uid]);
|
}, [currentUser?.uid]);
|
||||||
|
|
||||||
// Persist darkMode to localStorage when it or user changes
|
// Persist darkMode to localStorage when it or user changes
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
import React from "react";
|
import { memo } from "react";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import { ProductFruits } from "react-product-fruits";
|
import { ProductFruits } from "react-product-fruits";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
const ProductFruitsWrapper = React.memo(({ currentUser, bodyshop, workspaceCode, isPartsEntry }) => {
|
const ProductFruitsWrapper = memo(({ currentUser, bodyshop, workspaceCode, isPartsEntry }) => {
|
||||||
const featureProps = bodyshop?.features
|
const featureProps = bodyshop?.features
|
||||||
? Object.entries(bodyshop.features).reduce((acc, [key, value]) => {
|
? Object.entries(bodyshop.features).reduce((acc, [key, value]) => {
|
||||||
acc[key] = value === true || (typeof value === "string" && dayjs(value).isAfter(dayjs()));
|
acc[key] = value === true || (typeof value === "string" && dayjs(value).isAfter(dayjs()));
|
||||||
return acc;
|
return acc;
|
||||||
}, {})
|
}, {})
|
||||||
: {};
|
: {};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
!isPartsEntry &&
|
!isPartsEntry &&
|
||||||
workspaceCode &&
|
workspaceCode &&
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import { Outlet, useLocation, useNavigate } from "react-router-dom";
|
import { Outlet, useLocation, useNavigate } from "react-router-dom";
|
||||||
|
|
||||||
function PrivateRoute({ component: Component, isAuthorized, ...rest }) {
|
function PrivateRoute({ isAuthorized }) {
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { Button } from "antd";
|
import { Button } from "antd";
|
||||||
import React from "react";
|
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { setModalContext } from "../../redux/modals/modals.actions";
|
import { setModalContext } from "../../redux/modals/modals.actions";
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { Alert } from "antd";
|
import { Alert } from "antd";
|
||||||
import React from "react";
|
|
||||||
|
|
||||||
export default function AlertComponent(props) {
|
export default function AlertComponent(props) {
|
||||||
return <Alert {...props} />;
|
return <Alert {...props} />;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { Button, InputNumber, Popover, Select } from "antd";
|
import { Button, InputNumber, Popover, Select } from "antd";
|
||||||
import React from "react";
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useState } from "react";
|
import { useState } from "react";
|
||||||
import AllocationsAssignmentComponent from "./allocations-assignment.component";
|
import AllocationsAssignmentComponent from "./allocations-assignment.component";
|
||||||
import { useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
import { INSERT_ALLOCATION } from "../../graphql/allocations.queries";
|
import { INSERT_ALLOCATION } from "../../graphql/allocations.queries";
|
||||||
@@ -18,7 +18,7 @@ export default function AllocationsAssignmentContainer({ jobLineId, hours, refet
|
|||||||
|
|
||||||
const handleAssignment = () => {
|
const handleAssignment = () => {
|
||||||
insertAllocation({ variables: { alloc: { ...assignment } } })
|
insertAllocation({ variables: { alloc: { ...assignment } } })
|
||||||
.then((r) => {
|
.then(() => {
|
||||||
notification["success"]({
|
notification["success"]({
|
||||||
message: t("allocations.successes.save")
|
message: t("allocations.successes.save")
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { Button, Popover, Select } from "antd";
|
import { Button, Popover, Select } from "antd";
|
||||||
import React from "react";
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useState } from "react";
|
import { useState } from "react";
|
||||||
import AllocationsBulkAssignment from "./allocations-bulk-assignment.component";
|
import AllocationsBulkAssignment from "./allocations-bulk-assignment.component";
|
||||||
import { useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
import { INSERT_ALLOCATION } from "../../graphql/allocations.queries";
|
import { INSERT_ALLOCATION } from "../../graphql/allocations.queries";
|
||||||
@@ -24,7 +24,7 @@ export default function AllocationsBulkAssignmentContainer({ jobLines, refetch }
|
|||||||
return acc;
|
return acc;
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
insertAllocation({ variables: { alloc: allocs } }).then((r) => {
|
insertAllocation({ variables: { alloc: allocs } }).then(() => {
|
||||||
notification["success"]({
|
notification["success"]({
|
||||||
message: t("employees.successes.save")
|
message: t("employees.successes.save")
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import Icon from "@ant-design/icons";
|
import Icon from "@ant-design/icons";
|
||||||
import React from "react";
|
|
||||||
import { MdRemoveCircleOutline } from "react-icons/md";
|
import { MdRemoveCircleOutline } from "react-icons/md";
|
||||||
|
|
||||||
export default function AllocationsLabelComponent({ allocation, handleClick }) {
|
export default function AllocationsLabelComponent({ allocation, handleClick }) {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import React from "react";
|
|
||||||
import { useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
import { DELETE_ALLOCATION } from "../../graphql/allocations.queries";
|
import { DELETE_ALLOCATION } from "../../graphql/allocations.queries";
|
||||||
import AllocationsLabelComponent from "./allocations-employee-label.component";
|
import AllocationsLabelComponent from "./allocations-employee-label.component";
|
||||||
@@ -13,13 +12,13 @@ export default function AllocationsLabelContainer({ allocation, refetch }) {
|
|||||||
const handleClick = (e) => {
|
const handleClick = (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
deleteAllocation({ variables: { id: allocation.id } })
|
deleteAllocation({ variables: { id: allocation.id } })
|
||||||
.then((r) => {
|
.then(() => {
|
||||||
notification["success"]({
|
notification["success"]({
|
||||||
message: t("allocations.successes.deleted")
|
message: t("allocations.successes.deleted")
|
||||||
});
|
});
|
||||||
if (refetch) refetch();
|
if (refetch) refetch();
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch(() => {
|
||||||
notification["error"]({ message: t("allocations.errors.deleting") });
|
notification["error"]({ message: t("allocations.errors.deleting") });
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useState } from "react";
|
import { useState } from "react";
|
||||||
import { Table } from "antd";
|
import { Table } from "antd";
|
||||||
import { alphaSort } from "../../utils/sorters";
|
import { alphaSort } from "../../utils/sorters";
|
||||||
import { DateTimeFormatter } from "../../utils/DateFormatter";
|
import { DateTimeFormatter } from "../../utils/DateFormatter";
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import React from "react";
|
|
||||||
import AuditTrailListComponent from "./audit-trail-list.component";
|
import AuditTrailListComponent from "./audit-trail-list.component";
|
||||||
import { useQuery } from "@apollo/client";
|
import { useQuery } from "@apollo/client";
|
||||||
import { QUERY_AUDIT_TRAIL } from "../../graphql/audit_trail.queries";
|
import { QUERY_AUDIT_TRAIL } from "../../graphql/audit_trail.queries";
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Table } from "antd";
|
import { Table } from "antd";
|
||||||
import React, { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { DateTimeFormatter } from "../../utils/DateFormatter";
|
import { DateTimeFormatter } from "../../utils/DateFormatter";
|
||||||
import { alphaSort } from "../../utils/sorters";
|
import { alphaSort } from "../../utils/sorters";
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import React from "react";
|
|
||||||
import { List } from "antd";
|
import { List } from "antd";
|
||||||
import Icon from "@ant-design/icons";
|
import Icon from "@ant-design/icons";
|
||||||
import { FaArrowRight } from "react-icons/fa";
|
import { FaArrowRight } from "react-icons/fa";
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { Popover, Tag } from "antd";
|
import { Popover, Tag } from "antd";
|
||||||
import React from "react";
|
|
||||||
import Barcode from "react-barcode";
|
import Barcode from "react-barcode";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Checkbox, Form, Skeleton, Typography } from "antd";
|
import { Checkbox, Form, Skeleton, Typography } from "antd";
|
||||||
import React, { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import ReadOnlyFormItemComponent from "../form-items-formatted/read-only-form-item.component";
|
import ReadOnlyFormItemComponent from "../form-items-formatted/read-only-form-item.component";
|
||||||
import "./bill-cm-returns-table.styles.scss";
|
import "./bill-cm-returns-table.styles.scss";
|
||||||
@@ -33,7 +33,7 @@ export default function BillCmdReturnsTableComponent({ form, returnLoading, retu
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Form.List name="outstanding_returns">
|
<Form.List name="outstanding_returns">
|
||||||
{(fields, { add, remove, move }) => {
|
{(fields) => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Typography.Title level={4}>{t("bills.labels.creditsnotreceived")}</Typography.Title>
|
<Typography.Title level={4}>{t("bills.labels.creditsnotreceived")}</Typography.Title>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { DeleteFilled } from "@ant-design/icons";
|
import { DeleteFilled } from "@ant-design/icons";
|
||||||
import { useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
import { Button, Popconfirm } from "antd";
|
import { Button, Popconfirm } from "antd";
|
||||||
import React, { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { DELETE_BILL } from "../../graphql/bills.queries";
|
import { DELETE_BILL } from "../../graphql/bills.queries";
|
||||||
import RbacWrapper from "../rbac-wrapper/rbac-wrapper.component";
|
import RbacWrapper from "../rbac-wrapper/rbac-wrapper.component";
|
||||||
@@ -43,7 +43,7 @@ export function BillDeleteButton({ bill, jobid, callback, insertAuditTrail }) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!!!result.errors) {
|
if (!result.errors) {
|
||||||
notification["success"]({ message: t("bills.successes.deleted") });
|
notification["success"]({ message: t("bills.successes.deleted") });
|
||||||
insertAuditTrail({
|
insertAuditTrail({
|
||||||
jobid: jobid,
|
jobid: jobid,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { PageHeader } from "@ant-design/pro-layout";
|
|||||||
import { useMutation, useQuery } from "@apollo/client";
|
import { useMutation, useQuery } from "@apollo/client";
|
||||||
import { Button, Divider, Form, Popconfirm, Space } from "antd";
|
import { Button, Divider, Form, Popconfirm, Space } from "antd";
|
||||||
import queryString from "query-string";
|
import queryString from "query-string";
|
||||||
import React, { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { useLocation } from "react-router-dom";
|
import { useLocation } from "react-router-dom";
|
||||||
@@ -10,7 +10,6 @@ import { createStructuredSelector } from "reselect";
|
|||||||
import { DELETE_BILL_LINE, INSERT_NEW_BILL_LINES, UPDATE_BILL_LINE } from "../../graphql/bill-lines.queries";
|
import { DELETE_BILL_LINE, INSERT_NEW_BILL_LINES, UPDATE_BILL_LINE } from "../../graphql/bill-lines.queries";
|
||||||
import { QUERY_BILL_BY_PK, UPDATE_BILL } from "../../graphql/bills.queries";
|
import { QUERY_BILL_BY_PK, UPDATE_BILL } from "../../graphql/bills.queries";
|
||||||
import { insertAuditTrail } from "../../redux/application/application.actions";
|
import { insertAuditTrail } from "../../redux/application/application.actions";
|
||||||
import { setModalContext } from "../../redux/modals/modals.actions";
|
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
||||||
import dayjs from "../../utils/day";
|
import dayjs from "../../utils/day";
|
||||||
@@ -28,13 +27,12 @@ const mapStateToProps = createStructuredSelector({
|
|||||||
bodyshop: selectBodyshop
|
bodyshop: selectBodyshop
|
||||||
});
|
});
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
setPartsOrderContext: (context) => dispatch(setModalContext({ context: context, modal: "partsOrder" })),
|
|
||||||
insertAuditTrail: ({ jobid, operation, type }) => dispatch(insertAuditTrail({ jobid, operation, type }))
|
insertAuditTrail: ({ jobid, operation, type }) => dispatch(insertAuditTrail({ jobid, operation, type }))
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(BillDetailEditcontainer);
|
export default connect(mapStateToProps, mapDispatchToProps)(BillDetailEditcontainer);
|
||||||
|
|
||||||
export function BillDetailEditcontainer({ setPartsOrderContext, insertAuditTrail, bodyshop }) {
|
export function BillDetailEditcontainer({ insertAuditTrail, bodyshop }) {
|
||||||
const search = queryString.parse(useLocation().search);
|
const search = queryString.parse(useLocation().search);
|
||||||
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@@ -48,7 +46,7 @@ export function BillDetailEditcontainer({ setPartsOrderContext, insertAuditTrail
|
|||||||
|
|
||||||
const { loading, error, data, refetch } = useQuery(QUERY_BILL_BY_PK, {
|
const { loading, error, data, refetch } = useQuery(QUERY_BILL_BY_PK, {
|
||||||
variables: { billid: search.billid },
|
variables: { billid: search.billid },
|
||||||
skip: !!!search.billid,
|
skip: !search.billid,
|
||||||
fetchPolicy: "network-only",
|
fetchPolicy: "network-only",
|
||||||
nextFetchPolicy: "network-only"
|
nextFetchPolicy: "network-only"
|
||||||
});
|
});
|
||||||
@@ -71,7 +69,7 @@ export function BillDetailEditcontainer({ setPartsOrderContext, insertAuditTrail
|
|||||||
setUpdateLoading(true);
|
setUpdateLoading(true);
|
||||||
//let adjustmentsToInsert = {};
|
//let adjustmentsToInsert = {};
|
||||||
|
|
||||||
const { billlines, upload, ...bill } = values;
|
const { billlines, ...bill } = values;
|
||||||
const updates = [];
|
const updates = [];
|
||||||
updates.push(
|
updates.push(
|
||||||
update_bill({
|
update_bill({
|
||||||
@@ -98,6 +96,7 @@ export function BillDetailEditcontainer({ setPartsOrderContext, insertAuditTrail
|
|||||||
});
|
});
|
||||||
|
|
||||||
billlines.forEach((billline) => {
|
billlines.forEach((billline) => {
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { deductedfromlbr, inventories, jobline, original_actual_price, create_ppc, ...il } = billline;
|
const { deductedfromlbr, inventories, jobline, original_actual_price, create_ppc, ...il } = billline;
|
||||||
delete il.__typename;
|
delete il.__typename;
|
||||||
|
|
||||||
@@ -152,8 +151,8 @@ export function BillDetailEditcontainer({ setPartsOrderContext, insertAuditTrail
|
|||||||
if (error) return <AlertComponent message={error.message} type="error" />;
|
if (error) return <AlertComponent message={error.message} type="error" />;
|
||||||
if (!search.billid) return <></>; //<div>{t("bills.labels.noneselected")}</div>;
|
if (!search.billid) return <></>; //<div>{t("bills.labels.noneselected")}</div>;
|
||||||
|
|
||||||
const exported = data && data.bills_by_pk && data.bills_by_pk.exported;
|
const exported = data?.bills_by_pk && data.bills_by_pk.exported;
|
||||||
const isinhouse = data && data.bills_by_pk && data.bills_by_pk.isinhouse;
|
const isinhouse = data?.bills_by_pk && data.bills_by_pk.isinhouse;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -183,8 +182,8 @@ export function BillDetailEditcontainer({ setPartsOrderContext, insertAuditTrail
|
|||||||
{t("general.actions.save")}
|
{t("general.actions.save")}
|
||||||
</Button>
|
</Button>
|
||||||
</Popconfirm>
|
</Popconfirm>
|
||||||
<BillReeportButtonComponent bill={data && data.bills_by_pk} />
|
<BillReeportButtonComponent bill={data?.bills_by_pk} />
|
||||||
<BillMarkExportedButton bill={data && data.bills_by_pk} />
|
<BillMarkExportedButton bill={data?.bills_by_pk} />
|
||||||
</Space>
|
</Space>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
@@ -220,11 +219,11 @@ const transformData = (data) => {
|
|||||||
billlines: data.bills_by_pk.billlines.map((i) => {
|
billlines: data.bills_by_pk.billlines.map((i) => {
|
||||||
return {
|
return {
|
||||||
...i,
|
...i,
|
||||||
joblineid: !!i.joblineid ? i.joblineid : "noline",
|
joblineid: i.joblineid ? i.joblineid : "noline",
|
||||||
applicable_taxes: {
|
applicable_taxes: {
|
||||||
federal: (i.applicable_taxes && i.applicable_taxes.federal) || false,
|
federal: i.applicable_taxes?.federal || false,
|
||||||
state: (i.applicable_taxes && i.applicable_taxes.state) || false,
|
state: i.applicable_taxes?.state || false,
|
||||||
local: (i.applicable_taxes && i.applicable_taxes.local) || false
|
local: i.applicable_taxes?.local || false
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -1,18 +1,15 @@
|
|||||||
import { Button, Checkbox, Form, Modal } from "antd";
|
import { Button, Checkbox, Form, Modal } from "antd";
|
||||||
import queryString from "query-string";
|
import queryString from "query-string";
|
||||||
import React, { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { useLocation, useNavigate } from "react-router-dom";
|
import { useLocation, useNavigate } from "react-router-dom";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { insertAuditTrail } from "../../redux/application/application.actions";
|
|
||||||
import { setModalContext } from "../../redux/modals/modals.actions";
|
import { setModalContext } from "../../redux/modals/modals.actions";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
|
||||||
import ReadOnlyFormItemComponent from "../form-items-formatted/read-only-form-item.component";
|
import ReadOnlyFormItemComponent from "../form-items-formatted/read-only-form-item.component";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({});
|
||||||
bodyshop: selectBodyshop
|
|
||||||
});
|
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
setPartsOrderContext: (context) =>
|
setPartsOrderContext: (context) =>
|
||||||
dispatch(
|
dispatch(
|
||||||
@@ -20,20 +17,12 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
context: context,
|
context: context,
|
||||||
modal: "partsOrder"
|
modal: "partsOrder"
|
||||||
})
|
})
|
||||||
),
|
|
||||||
insertAuditTrail: ({ jobid, operation, type }) =>
|
|
||||||
dispatch(
|
|
||||||
insertAuditTrail({
|
|
||||||
jobid,
|
|
||||||
operation,
|
|
||||||
type
|
|
||||||
})
|
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(BillDetailEditReturn);
|
export default connect(mapStateToProps, mapDispatchToProps)(BillDetailEditReturn);
|
||||||
|
|
||||||
export function BillDetailEditReturn({ setPartsOrderContext, insertAuditTrail, bodyshop, data, disabled }) {
|
export function BillDetailEditReturn({ setPartsOrderContext, data, disabled }) {
|
||||||
const search = queryString.parse(useLocation().search);
|
const search = queryString.parse(useLocation().search);
|
||||||
const history = useNavigate();
|
const history = useNavigate();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@@ -86,9 +75,9 @@ export function BillDetailEditReturn({ setPartsOrderContext, insertAuditTrail, b
|
|||||||
title={t("bills.actions.return")}
|
title={t("bills.actions.return")}
|
||||||
onOk={() => form.submit()}
|
onOk={() => form.submit()}
|
||||||
>
|
>
|
||||||
<Form initialValues={data && data.bills_by_pk} onFinish={handleFinish} form={form}>
|
<Form initialValues={data?.bills_by_pk} onFinish={handleFinish} form={form}>
|
||||||
<Form.List name={["billlines"]}>
|
<Form.List name={["billlines"]}>
|
||||||
{(fields, { add, remove, move }) => {
|
{(fields) => {
|
||||||
return (
|
return (
|
||||||
<table style={{ tableLayout: "auto", width: "100%" }}>
|
<table style={{ tableLayout: "auto", width: "100%" }}>
|
||||||
<thead>
|
<thead>
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { Drawer, Grid } from "antd";
|
import { Drawer, Grid } from "antd";
|
||||||
import queryString from "query-string";
|
import queryString from "query-string";
|
||||||
import React from "react";
|
|
||||||
import { useLocation, useNavigate } from "react-router-dom";
|
import { useLocation, useNavigate } from "react-router-dom";
|
||||||
import BillDetailEditComponent from "./bill-detail-edit-component";
|
import BillDetailEditComponent from "./bill-detail-edit-component";
|
||||||
|
|
||||||
|
|||||||
@@ -85,6 +85,8 @@ function BillEnterModalContainer({ billEnterModal, toggleModalVisible, bodyshop,
|
|||||||
}
|
}
|
||||||
|
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { upload, location, outstanding_returns, inventory, federal_tax_exempt, ...remainingValues } = values;
|
const { upload, location, outstanding_returns, inventory, federal_tax_exempt, ...remainingValues } = values;
|
||||||
|
|
||||||
let adjustmentsToInsert = {};
|
let adjustmentsToInsert = {};
|
||||||
@@ -102,9 +104,13 @@ function BillEnterModalContainer({ billEnterModal, toggleModalVisible, bodyshop,
|
|||||||
const {
|
const {
|
||||||
deductedfromlbr,
|
deductedfromlbr,
|
||||||
lbr_adjustment,
|
lbr_adjustment,
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
location: lineLocation,
|
location: lineLocation,
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
part_type,
|
part_type,
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
create_ppc,
|
create_ppc,
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
original_actual_price,
|
original_actual_price,
|
||||||
...restI
|
...restI
|
||||||
} = i;
|
} = i;
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { Form, Input, Table } from "antd";
|
import { Form, Input, Table } from "antd";
|
||||||
import React, { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
||||||
import { alphaSort } from "../../utils/sorters";
|
import { alphaSort } from "../../utils/sorters";
|
||||||
import BillFormItemsExtendedFormItem from "./bill-form-lines.extended.formitem.component";
|
import BillFormItemsExtendedFormItem from "./bill-form-lines.extended.formitem.component";
|
||||||
|
|
||||||
export default function BillFormLinesExtended({ lineData, discount, form, responsibilityCenters, disabled }) {
|
export default function BillFormLinesExtended({ lineData, discount, form, responsibilityCenters }) {
|
||||||
const [search, setSearch] = useState("");
|
const [search, setSearch] = useState("");
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const columns = [
|
const columns = [
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import React from "react";
|
|
||||||
import { MinusCircleFilled, PlusCircleFilled, WarningOutlined } from "@ant-design/icons";
|
import { MinusCircleFilled, PlusCircleFilled, WarningOutlined } from "@ant-design/icons";
|
||||||
import { Button, Form, Input, InputNumber, Select, Space, Switch } from "antd";
|
import { Button, Form, Input, InputNumber, Select, Space, Switch } from "antd";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
@@ -12,7 +11,7 @@ import CiecaSelect from "../../utils/Ciecaselect";
|
|||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop
|
bodyshop: selectBodyshop
|
||||||
});
|
});
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = () => ({
|
||||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
});
|
});
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(BillFormItemsExtendedFormItem);
|
export default connect(mapStateToProps, mapDispatchToProps)(BillFormItemsExtendedFormItem);
|
||||||
@@ -22,7 +21,6 @@ export function BillFormItemsExtendedFormItem({
|
|||||||
bodyshop,
|
bodyshop,
|
||||||
form,
|
form,
|
||||||
record,
|
record,
|
||||||
index,
|
|
||||||
disabled,
|
disabled,
|
||||||
responsibilityCenters,
|
responsibilityCenters,
|
||||||
discount
|
discount
|
||||||
@@ -78,7 +76,7 @@ export function BillFormItemsExtendedFormItem({
|
|||||||
...billlineskeys,
|
...billlineskeys,
|
||||||
[record.id]: {
|
[record.id]: {
|
||||||
...billlineskeys[billlineskeys],
|
...billlineskeys[billlineskeys],
|
||||||
actual_cost: !!billlineskeys[billlineskeys].actual_cost
|
actual_cost: billlineskeys[billlineskeys].actual_cost
|
||||||
? billlineskeys[billlineskeys].actual_cost
|
? billlineskeys[billlineskeys].actual_cost
|
||||||
: Math.round((parseFloat(e.target.value) * (1 - discount) + Number.EPSILON) * 100) / 100
|
: Math.round((parseFloat(e.target.value) * (1 - discount) + Number.EPSILON) * 100) / 100
|
||||||
}
|
}
|
||||||
@@ -93,7 +91,7 @@ export function BillFormItemsExtendedFormItem({
|
|||||||
<Form.Item shouldUpdate>
|
<Form.Item shouldUpdate>
|
||||||
{() => {
|
{() => {
|
||||||
const line = value;
|
const line = value;
|
||||||
if (!!!line) return null;
|
if (!line) return null;
|
||||||
const lineDiscount = (1 - Math.round((line.actual_cost / line.actual_price) * 100) / 100).toPrecision(2);
|
const lineDiscount = (1 - Math.round((line.actual_cost / line.actual_price) * 100) / 100).toPrecision(2);
|
||||||
|
|
||||||
if (lineDiscount - discount === 0) return <div />;
|
if (lineDiscount - discount === 0) return <div />;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import Icon, { UploadOutlined } from "@ant-design/icons";
|
|||||||
import { useApolloClient } from "@apollo/client";
|
import { useApolloClient } from "@apollo/client";
|
||||||
import { useSplitTreatments } from "@splitsoftware/splitio-react";
|
import { useSplitTreatments } from "@splitsoftware/splitio-react";
|
||||||
import { Alert, Divider, Form, Input, Select, Space, Statistic, Switch, Upload } from "antd";
|
import { Alert, Divider, Form, Input, Select, Space, Statistic, Switch, Upload } from "antd";
|
||||||
import React, { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { MdOpenInNew } from "react-icons/md";
|
import { MdOpenInNew } from "react-icons/md";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
@@ -26,7 +26,7 @@ import DateTimePicker from "../form-date-time-picker/form-date-time-picker.compo
|
|||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop
|
bodyshop: selectBodyshop
|
||||||
});
|
});
|
||||||
const mapDispatchToProps = (dispatch) => ({});
|
const mapDispatchToProps = () => ({});
|
||||||
|
|
||||||
export function BillFormComponent({
|
export function BillFormComponent({
|
||||||
bodyshop,
|
bodyshop,
|
||||||
@@ -254,7 +254,7 @@ export function BillFormComponent({
|
|||||||
required: true
|
required: true
|
||||||
//message: t("general.validation.required"),
|
//message: t("general.validation.required"),
|
||||||
},
|
},
|
||||||
({ getFieldValue }) => ({
|
() => ({
|
||||||
validator(rule, value) {
|
validator(rule, value) {
|
||||||
if (ClosingPeriod.treatment === "on" && bodyshop.accountingconfig.ClosingPeriod) {
|
if (ClosingPeriod.treatment === "on" && bodyshop.accountingconfig.ClosingPeriod) {
|
||||||
if (
|
if (
|
||||||
@@ -374,8 +374,10 @@ export function BillFormComponent({
|
|||||||
let totals;
|
let totals;
|
||||||
if (!!values.total && !!values.billlines && values.billlines.length > 0)
|
if (!!values.total && !!values.billlines && values.billlines.length > 0)
|
||||||
totals = CalculateBillTotal(values);
|
totals = CalculateBillTotal(values);
|
||||||
if (!!totals)
|
if (totals)
|
||||||
return (
|
return (
|
||||||
|
// TODO: Align is not correct
|
||||||
|
// eslint-disable-next-line react/no-unknown-property
|
||||||
<div align="right">
|
<div align="right">
|
||||||
<Space size="large" wrap>
|
<Space size="large" wrap>
|
||||||
<Statistic title={t("bills.labels.subtotal")} value={totals.subtotal.toFormat()} precision={2} />
|
<Statistic title={t("bills.labels.subtotal")} value={totals.subtotal.toFormat()} precision={2} />
|
||||||
@@ -458,7 +460,7 @@ export function BillFormComponent({
|
|||||||
if (Array.isArray(e)) {
|
if (Array.isArray(e)) {
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
return e && e.fileList;
|
return e?.fileList;
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Upload.Dragger multiple={true} name="logo" beforeUpload={() => false} listType="picture">
|
<Upload.Dragger multiple={true} name="logo" beforeUpload={() => false} listType="picture">
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { useLazyQuery, useQuery } from "@apollo/client";
|
import { useLazyQuery, useQuery } from "@apollo/client";
|
||||||
import { useSplitTreatments } from "@splitsoftware/splitio-react";
|
import { useSplitTreatments } from "@splitsoftware/splitio-react";
|
||||||
import React from "react";
|
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { QUERY_OUTSTANDING_INVENTORY } from "../../graphql/inventory.queries";
|
import { QUERY_OUTSTANDING_INVENTORY } from "../../graphql/inventory.queries";
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { DeleteFilled, DollarCircleFilled } from "@ant-design/icons";
|
import { DeleteFilled, DollarCircleFilled } from "@ant-design/icons";
|
||||||
import { useSplitTreatments } from "@splitsoftware/splitio-react";
|
import { useSplitTreatments } from "@splitsoftware/splitio-react";
|
||||||
import { Button, Checkbox, Form, Input, InputNumber, Select, Space, Switch, Table, Tooltip } from "antd";
|
import { Button, Checkbox, Form, Input, InputNumber, Select, Space, Switch, Table, Tooltip } from "antd";
|
||||||
import React from "react";
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
@@ -16,7 +15,7 @@ const mapStateToProps = createStructuredSelector({
|
|||||||
//currentUser: selectCurrentUser
|
//currentUser: selectCurrentUser
|
||||||
bodyshop: selectBodyshop
|
bodyshop: selectBodyshop
|
||||||
});
|
});
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = () => ({
|
||||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -27,8 +26,7 @@ export function BillEnterModalLinesComponent({
|
|||||||
discount,
|
discount,
|
||||||
form,
|
form,
|
||||||
responsibilityCenters,
|
responsibilityCenters,
|
||||||
billEdit,
|
billEdit
|
||||||
billid
|
|
||||||
}) {
|
}) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { setFieldsValue, getFieldsValue, getFieldValue } = form;
|
const { setFieldsValue, getFieldsValue, getFieldValue } = form;
|
||||||
@@ -126,7 +124,7 @@ export function BillEnterModalLinesComponent({
|
|||||||
]
|
]
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
formInput: (record, index) => <Input.TextArea disabled={disabled} autoSize />
|
formInput: () => <Input.TextArea disabled={disabled} autoSize />
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t("billlines.fields.quantity"),
|
title: t("billlines.fields.quantity"),
|
||||||
@@ -158,7 +156,7 @@ export function BillEnterModalLinesComponent({
|
|||||||
]
|
]
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
formInput: (record, index) => <InputNumber precision={0} min={1} disabled={disabled} />
|
formInput: () => <InputNumber precision={0} min={1} disabled={disabled} />
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t("billlines.fields.actual_price"),
|
title: t("billlines.fields.actual_price"),
|
||||||
@@ -188,7 +186,7 @@ export function BillEnterModalLinesComponent({
|
|||||||
if (idx === index) {
|
if (idx === index) {
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
actual_cost: !!item.actual_cost
|
actual_cost: item.actual_cost
|
||||||
? item.actual_cost
|
? item.actual_cost
|
||||||
: Math.round((parseFloat(e.target.value) * (1 - discount) + Number.EPSILON) * 100) / 100
|
: Math.round((parseFloat(e.target.value) * (1 - discount) + Number.EPSILON) * 100) / 100
|
||||||
};
|
};
|
||||||
@@ -258,7 +256,7 @@ export function BillEnterModalLinesComponent({
|
|||||||
<Form.Item shouldUpdate noStyle>
|
<Form.Item shouldUpdate noStyle>
|
||||||
{() => {
|
{() => {
|
||||||
const line = getFieldsValue(["billlines"]).billlines[index];
|
const line = getFieldsValue(["billlines"]).billlines[index];
|
||||||
if (!!!line) return null;
|
if (!line) return null;
|
||||||
let lineDiscount = 1 - line.actual_cost / line.actual_price;
|
let lineDiscount = 1 - line.actual_cost / line.actual_price;
|
||||||
if (isNaN(lineDiscount)) lineDiscount = 0;
|
if (isNaN(lineDiscount)) lineDiscount = 0;
|
||||||
return (
|
return (
|
||||||
@@ -322,7 +320,7 @@ export function BillEnterModalLinesComponent({
|
|||||||
]
|
]
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
formInput: (record, index) => (
|
formInput: () => (
|
||||||
<Select showSearch style={{ minWidth: "3rem" }} disabled={disabled}>
|
<Select showSearch style={{ minWidth: "3rem" }} disabled={disabled}>
|
||||||
{bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber
|
{bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber
|
||||||
? CiecaSelect(true, false)
|
? CiecaSelect(true, false)
|
||||||
@@ -344,7 +342,7 @@ export function BillEnterModalLinesComponent({
|
|||||||
name: [field.name, "location"]
|
name: [field.name, "location"]
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
formInput: (record, index) => (
|
formInput: () => (
|
||||||
<Select disabled={disabled}>
|
<Select disabled={disabled}>
|
||||||
{bodyshop.md_parts_locations.map((loc, idx) => (
|
{bodyshop.md_parts_locations.map((loc, idx) => (
|
||||||
<Select.Option key={idx} value={loc}>
|
<Select.Option key={idx} value={loc}>
|
||||||
@@ -366,7 +364,7 @@ export function BillEnterModalLinesComponent({
|
|||||||
name: [field.name, "deductedfromlbr"]
|
name: [field.name, "deductedfromlbr"]
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
formInput: (record, index) => <Switch disabled={disabled} />,
|
formInput: () => <Switch disabled={disabled} />,
|
||||||
additional: (record, index) => (
|
additional: (record, index) => (
|
||||||
<Form.Item shouldUpdate noStyle style={{ display: "inline-block" }}>
|
<Form.Item shouldUpdate noStyle style={{ display: "inline-block" }}>
|
||||||
{() => {
|
{() => {
|
||||||
@@ -478,7 +476,7 @@ export function BillEnterModalLinesComponent({
|
|||||||
name: [field.name, "applicable_taxes", "federal"]
|
name: [field.name, "applicable_taxes", "federal"]
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
formInput: (record, index) => <Switch disabled={disabled} />
|
formInput: () => <Switch disabled={disabled} />
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}),
|
}),
|
||||||
@@ -495,7 +493,7 @@ export function BillEnterModalLinesComponent({
|
|||||||
name: [field.name, "applicable_taxes", "state"]
|
name: [field.name, "applicable_taxes", "state"]
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
formInput: (record, index) => <Switch disabled={disabled} />
|
formInput: () => <Switch disabled={disabled} />
|
||||||
},
|
},
|
||||||
|
|
||||||
...InstanceRenderManager({
|
...InstanceRenderManager({
|
||||||
@@ -513,7 +511,7 @@ export function BillEnterModalLinesComponent({
|
|||||||
name: [field.name, "applicable_taxes", "local"]
|
name: [field.name, "applicable_taxes", "local"]
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
formInput: (record, index) => <Switch disabled={disabled} />
|
formInput: () => <Switch disabled={disabled} />
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}),
|
}),
|
||||||
@@ -575,7 +573,7 @@ export function BillEnterModalLinesComponent({
|
|||||||
}
|
}
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
{(fields, { add, remove, move }) => {
|
{(fields, { add, remove }) => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Table
|
<Table
|
||||||
@@ -612,19 +610,7 @@ export function BillEnterModalLinesComponent({
|
|||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(BillEnterModalLinesComponent);
|
export default connect(mapStateToProps, mapDispatchToProps)(BillEnterModalLinesComponent);
|
||||||
|
|
||||||
const EditableCell = ({
|
const EditableCell = ({ dataIndex, record, children, formInput, formItemProps, additional, wrapper, ...restProps }) => {
|
||||||
dataIndex,
|
|
||||||
title,
|
|
||||||
inputType,
|
|
||||||
record,
|
|
||||||
index,
|
|
||||||
children,
|
|
||||||
formInput,
|
|
||||||
formItemProps,
|
|
||||||
additional,
|
|
||||||
wrapper,
|
|
||||||
...restProps
|
|
||||||
}) => {
|
|
||||||
const propsFinal = formItemProps && formItemProps(record);
|
const propsFinal = formItemProps && formItemProps(record);
|
||||||
if (propsFinal && "key" in propsFinal) {
|
if (propsFinal && "key" in propsFinal) {
|
||||||
delete propsFinal.key;
|
delete propsFinal.key;
|
||||||
|
|||||||
@@ -9,10 +9,10 @@ export const CalculateBillTotal = (invoice) => {
|
|||||||
let stateTax = Dinero({ amount: 0 });
|
let stateTax = Dinero({ amount: 0 });
|
||||||
let localTax = Dinero({ amount: 0 });
|
let localTax = Dinero({ amount: 0 });
|
||||||
|
|
||||||
if (!!!billlines) return null;
|
if (!billlines) return null;
|
||||||
|
|
||||||
billlines.forEach((i) => {
|
billlines.forEach((i) => {
|
||||||
if (!!i) {
|
if (i) {
|
||||||
const itemTotal = Dinero({
|
const itemTotal = Dinero({
|
||||||
amount: Math.round((i.actual_cost || 0) * 100)
|
amount: Math.round((i.actual_cost || 0) * 100)
|
||||||
}).multiply(i.quantity || 1);
|
}).multiply(i.quantity || 1);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Checkbox, Form, Skeleton, Typography } from "antd";
|
import { Checkbox, Form, Skeleton, Typography } from "antd";
|
||||||
import React, { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import ReadOnlyFormItemComponent from "../form-items-formatted/read-only-form-item.component";
|
import ReadOnlyFormItemComponent from "../form-items-formatted/read-only-form-item.component";
|
||||||
import "./bill-inventory-table.styles.scss";
|
import "./bill-inventory-table.styles.scss";
|
||||||
@@ -13,7 +13,7 @@ const mapStateToProps = createStructuredSelector({
|
|||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
billEnterModal: selectBillEnterModal
|
billEnterModal: selectBillEnterModal
|
||||||
});
|
});
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = () => ({
|
||||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
});
|
});
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(BillInventoryTable);
|
export default connect(mapStateToProps, mapDispatchToProps)(BillInventoryTable);
|
||||||
@@ -22,7 +22,7 @@ export function BillInventoryTable({ billEnterModal, bodyshop, form, billEdit, i
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (inventoryData && inventoryData.inventory) {
|
if (inventoryData?.inventory) {
|
||||||
form.setFieldsValue({
|
form.setFieldsValue({
|
||||||
inventory: billEnterModal.context.consumeinventoryid
|
inventory: billEnterModal.context.consumeinventoryid
|
||||||
? inventoryData.inventory.map((i) => {
|
? inventoryData.inventory.map((i) => {
|
||||||
@@ -47,7 +47,7 @@ export function BillInventoryTable({ billEnterModal, bodyshop, form, billEdit, i
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Form.List name="inventory">
|
<Form.List name="inventory">
|
||||||
{(fields, { add, remove, move }) => {
|
{(fields) => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Typography.Title level={4}>{t("inventory.labels.inventory")}</Typography.Title>
|
<Typography.Title level={4}>{t("inventory.labels.inventory")}</Typography.Title>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { gql, useMutation } from "@apollo/client";
|
import { gql, useMutation } from "@apollo/client";
|
||||||
import { Button } from "antd";
|
import { Button } from "antd";
|
||||||
import React, { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
@@ -15,7 +15,7 @@ const mapStateToProps = createStructuredSelector({
|
|||||||
authLevel: selectAuthLevel,
|
authLevel: selectAuthLevel,
|
||||||
currentUser: selectCurrentUser
|
currentUser: selectCurrentUser
|
||||||
});
|
});
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = () => ({
|
||||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Button, Space } from "antd";
|
import { Button, Space } from "antd";
|
||||||
import React, { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { GenerateDocument } from "../../utils/RenderTemplate";
|
import { GenerateDocument } from "../../utils/RenderTemplate";
|
||||||
import { TemplateList } from "../../utils/TemplateConstants";
|
import { TemplateList } from "../../utils/TemplateConstants";
|
||||||
@@ -26,7 +26,7 @@ export default function BillPrintButton({ billid }) {
|
|||||||
null,
|
null,
|
||||||
notification
|
notification
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch {
|
||||||
console.warn("Warning: Error generating a document.");
|
console.warn("Warning: Error generating a document.");
|
||||||
}
|
}
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { gql, useMutation } from "@apollo/client";
|
import { gql, useMutation } from "@apollo/client";
|
||||||
import { Button } from "antd";
|
import { Button } from "antd";
|
||||||
import React, { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
@@ -13,7 +13,7 @@ const mapStateToProps = createStructuredSelector({
|
|||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
authLevel: selectAuthLevel
|
authLevel: selectAuthLevel
|
||||||
});
|
});
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = () => ({
|
||||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { useMutation } from "@apollo/client";
|
|||||||
import { Button, Tooltip } from "antd";
|
import { Button, Tooltip } from "antd";
|
||||||
import { t } from "i18next";
|
import { t } from "i18next";
|
||||||
import dayjs from "./../../utils/day";
|
import dayjs from "./../../utils/day";
|
||||||
import React, { useState } from "react";
|
import { useState } from "react";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { INSERT_INVENTORY_AND_CREDIT } from "../../graphql/inventory.queries";
|
import { INSERT_INVENTORY_AND_CREDIT } from "../../graphql/inventory.queries";
|
||||||
@@ -17,7 +17,7 @@ const mapStateToProps = createStructuredSelector({
|
|||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
currentUser: selectCurrentUser
|
currentUser: selectCurrentUser
|
||||||
});
|
});
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = () => ({
|
||||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
});
|
});
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(BilllineAddInventory);
|
export default connect(mapStateToProps, mapDispatchToProps)(BilllineAddInventory);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useState } from "react";
|
import { useState } from "react";
|
||||||
import { QUERY_ALL_VENDORS } from "../../graphql/vendors.queries";
|
import { QUERY_ALL_VENDORS } from "../../graphql/vendors.queries";
|
||||||
import { useQuery } from "@apollo/client";
|
import { useQuery } from "@apollo/client";
|
||||||
import queryString from "query-string";
|
import queryString from "query-string";
|
||||||
@@ -100,9 +100,9 @@ export default function BillsVendorsList() {
|
|||||||
selectedRowKeys: [search.vendorid],
|
selectedRowKeys: [search.vendorid],
|
||||||
type: "radio"
|
type: "radio"
|
||||||
}}
|
}}
|
||||||
onRow={(record, rowIndex) => {
|
onRow={(record) => {
|
||||||
return {
|
return {
|
||||||
onClick: (event) => {
|
onClick: () => {
|
||||||
handleOnRowClick(record);
|
handleOnRowClick(record);
|
||||||
} // click row
|
} // click row
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Button, Form, Modal } from "antd";
|
import { Button, Form, Modal } from "antd";
|
||||||
import React, { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
@@ -32,12 +32,13 @@ export function ContractsFindModalContainer({ caBcEtfTableModal, toggleModalVisi
|
|||||||
logImEXEvent("ca_bc_etf_table_parse");
|
logImEXEvent("ca_bc_etf_table_parse");
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
const claimNumbers = [];
|
const claimNumbers = [];
|
||||||
values.table.split("\n").forEach((row, idx, arr) => {
|
values.table.split("\n").forEach((row) => {
|
||||||
const { 1: claim, 2: shortclaim, 4: amount } = row.split("\t");
|
const { 1: claim, 2: shortclaim, 4: amount } = row.split("\t");
|
||||||
if (!claim || !shortclaim) return;
|
if (!claim || !shortclaim) return;
|
||||||
const trimmedShortClaim = shortclaim.trim();
|
const trimmedShortClaim = shortclaim.trim();
|
||||||
// const trimmedClaim = claim.trim();
|
// const trimmedClaim = claim.trim();
|
||||||
if (amount.slice(-1) === "-") {
|
if (amount.slice(-1) === "-") {
|
||||||
|
// NO OP
|
||||||
}
|
}
|
||||||
|
|
||||||
claimNumbers.push({
|
claimNumbers.push({
|
||||||
|
|||||||
@@ -1,17 +1,13 @@
|
|||||||
import { Form, Input, Radio } from "antd";
|
import { Form, Input, Radio } from "antd";
|
||||||
import React from "react";
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({});
|
||||||
bodyshop: selectBodyshop
|
|
||||||
});
|
|
||||||
|
|
||||||
export default connect(mapStateToProps, null)(PartsReceiveModalComponent);
|
export default connect(mapStateToProps, null)(PartsReceiveModalComponent);
|
||||||
|
|
||||||
export function PartsReceiveModalComponent({ bodyshop, form }) {
|
export function PartsReceiveModalComponent() {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { CalculatorFilled } from "@ant-design/icons";
|
import { CalculatorFilled } from "@ant-design/icons";
|
||||||
import { Button, Form, InputNumber, Popover, Space } from "antd";
|
import { Button, Form, InputNumber, Popover, Space } from "antd";
|
||||||
import React, { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { CopyFilled, DeleteFilled } from "@ant-design/icons";
|
|||||||
import { useLazyQuery, useMutation } from "@apollo/client";
|
import { useLazyQuery, useMutation } from "@apollo/client";
|
||||||
import { Button, Card, Col, Form, Input, message, Row, Space, Spin, Statistic } from "antd";
|
import { Button, Card, Col, Form, Input, message, Row, Space, Spin, Statistic } from "antd";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import React, { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
@@ -133,7 +133,6 @@ const CardPaymentModalComponent = ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (window.intellipay) {
|
if (window.intellipay) {
|
||||||
// eslint-disable-next-line no-eval
|
|
||||||
eval(response.data);
|
eval(response.data);
|
||||||
pollForIntelliPay(() => {
|
pollForIntelliPay(() => {
|
||||||
SetIntellipayCallbackFunctions();
|
SetIntellipayCallbackFunctions();
|
||||||
@@ -149,7 +148,7 @@ const CardPaymentModalComponent = ({
|
|||||||
window.intellipay.initialize();
|
window.intellipay.initialize();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch {
|
||||||
notification.open({
|
notification.open({
|
||||||
type: "error",
|
type: "error",
|
||||||
message: t("job_payments.notifications.error.openingip")
|
message: t("job_payments.notifications.error.openingip")
|
||||||
@@ -187,7 +186,7 @@ const CardPaymentModalComponent = ({
|
|||||||
message.success(t("general.actions.copied"));
|
message.success(t("general.actions.copied"));
|
||||||
}
|
}
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
} catch (error) {
|
} catch {
|
||||||
notification.open({
|
notification.open({
|
||||||
type: "error",
|
type: "error",
|
||||||
message: t("job_payments.notifications.error.openingip")
|
message: t("job_payments.notifications.error.openingip")
|
||||||
@@ -359,7 +358,7 @@ function pollForIntelliPay(callbackFunction) {
|
|||||||
const startTime = Date.now();
|
const startTime = Date.now();
|
||||||
|
|
||||||
function checkFixAmount() {
|
function checkFixAmount() {
|
||||||
if (window.intellipay && window.intellipay.fixAmount !== undefined) {
|
if (window.intellipay?.fixAmount) {
|
||||||
callbackFunction();
|
callbackFunction();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,23 +1,20 @@
|
|||||||
import { Button, Modal } from "antd";
|
import { Button, Modal } from "antd";
|
||||||
import React from "react";
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { toggleModalVisible } from "../../redux/modals/modals.actions";
|
import { toggleModalVisible } from "../../redux/modals/modals.actions";
|
||||||
import { selectCardPayment } from "../../redux/modals/modals.selectors";
|
import { selectCardPayment } from "../../redux/modals/modals.selectors";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
|
||||||
import CardPaymentModalComponent from "./card-payment-modal.component";
|
import CardPaymentModalComponent from "./card-payment-modal.component";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
cardPaymentModal: selectCardPayment,
|
cardPaymentModal: selectCardPayment
|
||||||
bodyshop: selectBodyshop
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
toggleModalVisible: () => dispatch(toggleModalVisible("cardPayment"))
|
toggleModalVisible: () => dispatch(toggleModalVisible("cardPayment"))
|
||||||
});
|
});
|
||||||
|
|
||||||
function CardPaymentModalContainer({ cardPaymentModal, toggleModalVisible, bodyshop }) {
|
function CardPaymentModalContainer({ cardPaymentModal, toggleModalVisible }) {
|
||||||
const { open } = cardPaymentModal;
|
const { open } = cardPaymentModal;
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ export const registerMessagingHandlers = ({ socket, client }) => {
|
|||||||
existingConversation: true
|
existingConversation: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch {
|
||||||
logLocal("handleNewMessageSummary - Cache miss", { conversationId });
|
logLocal("handleNewMessageSummary - Cache miss", { conversationId });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -328,8 +328,7 @@ export const registerMessagingHandlers = ({ socket, client }) => {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "tag-added":
|
case "tag-added": { // Ensure `job_conversations` is properly formatted
|
||||||
// Ensure `job_conversations` is properly formatted
|
|
||||||
const formattedJobConversations = job_conversations.map((jc) => ({
|
const formattedJobConversations = job_conversations.map((jc) => ({
|
||||||
__typename: "job_conversations",
|
__typename: "job_conversations",
|
||||||
jobid: jc.jobid || jc.job?.id,
|
jobid: jc.jobid || jc.job?.id,
|
||||||
@@ -375,6 +374,7 @@ export const registerMessagingHandlers = ({ socket, client }) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case "tag-removed":
|
case "tag-removed":
|
||||||
try {
|
try {
|
||||||
@@ -462,7 +462,7 @@ export const registerMessagingHandlers = ({ socket, client }) => {
|
|||||||
logLocal("handlePhoneNumberOptedOut - Error", { error: error.message });
|
logLocal("handlePhoneNumberOptedOut - Error", { error: error.message });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// New handler for phone number opt-in
|
// New handler for phone number opt-in
|
||||||
const handlePhoneNumberOptedIn = async (data) => {
|
const handlePhoneNumberOptedIn = async (data) => {
|
||||||
const { bodyshopid, phone_number } = data;
|
const { bodyshopid, phone_number } = data;
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ function ChatConversationListComponent({ conversationList, selectedConversation,
|
|||||||
item.job_conversations.length > 0
|
item.job_conversations.length > 0
|
||||||
? item.job_conversations.map((j, idx) => <Tag key={idx}>{j.job.ro_number}</Tag>)
|
? item.job_conversations.map((j, idx) => <Tag key={idx}>{j.job.ro_number}</Tag>)
|
||||||
: null;
|
: null;
|
||||||
const names = <>{_.uniq(item.job_conversations.map((j, idx) => OwnerNameDisplayFunction(j.job)))}</>;
|
const names = <>{_.uniq(item.job_conversations.map((j) => OwnerNameDisplayFunction(j.job)))}</>;
|
||||||
const cardTitle = (
|
const cardTitle = (
|
||||||
<>
|
<>
|
||||||
{item.label && <Tag color="blue">{item.label}</Tag>}
|
{item.label && <Tag color="blue">{item.label}</Tag>}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export function ChatConversationTitleTags({ jobConversations, bodyshop }) {
|
|||||||
|
|
||||||
const handleRemoveTag = async (jobId) => {
|
const handleRemoveTag = async (jobId) => {
|
||||||
const convId = jobConversations[0].conversationid;
|
const convId = jobConversations[0].conversationid;
|
||||||
if (!!convId) {
|
if (convId) {
|
||||||
await removeJobConversation({
|
await removeJobConversation({
|
||||||
variables: {
|
variables: {
|
||||||
conversationId: convId,
|
conversationId: convId,
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { Space } from "antd";
|
import { Space } from "antd";
|
||||||
import React from "react";
|
|
||||||
import PhoneNumberFormatter from "../../utils/PhoneFormatter";
|
import PhoneNumberFormatter from "../../utils/PhoneFormatter";
|
||||||
import ChatArchiveButton from "../chat-archive-button/chat-archive-button.component";
|
import ChatArchiveButton from "../chat-archive-button/chat-archive-button.component";
|
||||||
import ChatConversationTitleTags from "../chat-conversation-title-tags/chat-conversation-title-tags.component";
|
import ChatConversationTitleTags from "../chat-conversation-title-tags/chat-conversation-title-tags.component";
|
||||||
@@ -16,10 +15,10 @@ const mapDispatchToProps = () => ({});
|
|||||||
export function ChatConversationTitle({ conversation }) {
|
export function ChatConversationTitle({ conversation }) {
|
||||||
return (
|
return (
|
||||||
<Space className="chat-title" wrap>
|
<Space className="chat-title" wrap>
|
||||||
<PhoneNumberFormatter>{conversation && conversation.phone_num}</PhoneNumberFormatter>
|
<PhoneNumberFormatter>{conversation?.phone_num}</PhoneNumberFormatter>
|
||||||
<ChatLabelComponent conversation={conversation} />
|
<ChatLabelComponent conversation={conversation} />
|
||||||
<ChatPrintButton conversation={conversation} />
|
<ChatPrintButton conversation={conversation} />
|
||||||
<ChatConversationTitleTags jobConversations={(conversation && conversation.job_conversations) || []} />
|
<ChatConversationTitleTags jobConversations={conversation?.job_conversations || []} />
|
||||||
<ChatTagRoContainer conversation={conversation || []} />
|
<ChatTagRoContainer conversation={conversation || []} />
|
||||||
<ChatArchiveButton conversation={conversation} />
|
<ChatArchiveButton conversation={conversation} />
|
||||||
</Space>
|
</Space>
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import React from "react";
|
|
||||||
import AlertComponent from "../alert/alert.component";
|
import AlertComponent from "../alert/alert.component";
|
||||||
import ChatConversationTitle from "../chat-conversation-title/chat-conversation-title.component";
|
import ChatConversationTitle from "../chat-conversation-title/chat-conversation-title.component";
|
||||||
import ChatMessageListComponent from "../chat-messages-list/chat-message-list.component";
|
import ChatMessageListComponent from "../chat-messages-list/chat-message-list.component";
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ const mapStateToProps = createStructuredSelector({
|
|||||||
bodyshop: selectBodyshop
|
bodyshop: selectBodyshop
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => ({});
|
const mapDispatchToProps = () => ({});
|
||||||
|
|
||||||
export function ChatLabel({ conversation, bodyshop }) {
|
export function ChatLabel({ conversation, bodyshop }) {
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ const mapStateToProps = createStructuredSelector({
|
|||||||
bodyshop: selectBodyshop
|
bodyshop: selectBodyshop
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => ({});
|
const mapDispatchToProps = () => ({});
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(ChatMediaSelector);
|
export default connect(mapStateToProps, mapDispatchToProps)(ChatMediaSelector);
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useCallback, useEffect, useRef, useState } from "react";
|
import { useCallback, useEffect, useRef, useState } from "react";
|
||||||
import { Virtuoso } from "react-virtuoso";
|
import { Virtuoso } from "react-virtuoso";
|
||||||
import { renderMessage } from "./renderMessage";
|
import { renderMessage } from "./renderMessage";
|
||||||
import "./chat-message-list.styles.scss";
|
import "./chat-message-list.styles.scss";
|
||||||
@@ -76,7 +76,7 @@ export default function ChatMessageListComponent({ messages }) {
|
|||||||
<Virtuoso
|
<Virtuoso
|
||||||
ref={virtuosoRef}
|
ref={virtuosoRef}
|
||||||
data={messages}
|
data={messages}
|
||||||
overscan={!!messages.reduce((acc, message) => acc + (message.image_path?.length || 0), 0) ? messages.length : 0}
|
overscan={messages.reduce((acc, message) => acc + (message.image_path?.length || 0), 0) ? messages.length : 0}
|
||||||
itemContent={(index) => renderMessage(messages, index)}
|
itemContent={(index) => renderMessage(messages, index)}
|
||||||
followOutput={(isAtBottom) => handleScrollStateChange(isAtBottom)}
|
followOutput={(isAtBottom) => handleScrollStateChange(isAtBottom)}
|
||||||
initialTopMostItemIndex={messages.length - 1}
|
initialTopMostItemIndex={messages.length - 1}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { PlusCircleOutlined } from "@ant-design/icons";
|
import { PlusCircleOutlined } from "@ant-design/icons";
|
||||||
import { Dropdown } from "antd";
|
import { Dropdown } from "antd";
|
||||||
import React from "react";
|
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { setMessage } from "../../redux/messaging/messaging.actions";
|
import { setMessage } from "../../redux/messaging/messaging.actions";
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { MailOutlined, PrinterOutlined } from "@ant-design/icons";
|
import { MailOutlined, PrinterOutlined } from "@ant-design/icons";
|
||||||
import { Space, Spin } from "antd";
|
import { Space, Spin } from "antd";
|
||||||
import React, { useState } from "react";
|
import { useState } from "react";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { setEmailOptions } from "../../redux/email/email.actions";
|
import { setEmailOptions } from "../../redux/email/email.actions";
|
||||||
@@ -31,7 +31,7 @@ export function ChatPrintButton({ conversation }) {
|
|||||||
type,
|
type,
|
||||||
conversation.id,
|
conversation.id,
|
||||||
notification
|
notification
|
||||||
).catch((e) => {
|
).catch(() => {
|
||||||
console.warn("Something went wrong generating a document.");
|
console.warn("Something went wrong generating a document.");
|
||||||
});
|
});
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { CloseCircleOutlined, LoadingOutlined } from "@ant-design/icons";
|
import { CloseCircleOutlined, LoadingOutlined } from "@ant-design/icons";
|
||||||
import { Empty, Select, Space } from "antd";
|
import { Empty, Select, Space } from "antd";
|
||||||
import React from "react";
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { OwnerNameDisplayFunction } from "../owner-name-display/owner-name-display.component";
|
import { OwnerNameDisplayFunction } from "../owner-name-display/owner-name-display.component";
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { Checkbox, Form } from "antd";
|
import { Checkbox, Form } from "antd";
|
||||||
import React from "react";
|
|
||||||
|
|
||||||
export default function JobIntakeFormCheckboxComponent({ formItem, readOnly }) {
|
export default function JobIntakeFormCheckboxComponent({ formItem, readOnly }) {
|
||||||
const { name, label, required } = formItem;
|
const { name, label, required } = formItem;
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import React from "react";
|
|
||||||
import FormTypes from "./config-form-types";
|
import FormTypes from "./config-form-types";
|
||||||
|
|
||||||
export default function ConfirmFormComponents({ componentList, readOnly }) {
|
export default function ConfirmFormComponents({ componentList, readOnly }) {
|
||||||
@@ -7,7 +6,7 @@ export default function ConfirmFormComponents({ componentList, readOnly }) {
|
|||||||
{componentList.map((f, idx) => {
|
{componentList.map((f, idx) => {
|
||||||
const Comp = FormTypes[f.type];
|
const Comp = FormTypes[f.type];
|
||||||
|
|
||||||
if (!!Comp) {
|
if (Comp) {
|
||||||
return <Comp key={idx} formItem={f} readOnly={readOnly} />;
|
return <Comp key={idx} formItem={f} readOnly={readOnly} />;
|
||||||
} else {
|
} else {
|
||||||
return <div key={idx}>Error</div>;
|
return <div key={idx}>Error</div>;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { Form, Rate } from "antd";
|
import { Form, Rate } from "antd";
|
||||||
import React from "react";
|
|
||||||
|
|
||||||
export default function JobIntakeFormCheckboxComponent({ formItem, readOnly }) {
|
export default function JobIntakeFormCheckboxComponent({ formItem, readOnly }) {
|
||||||
const { name, label, required } = formItem;
|
const { name, label, required } = formItem;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { Form, Slider } from "antd";
|
import { Form, Slider } from "antd";
|
||||||
import React from "react";
|
|
||||||
|
|
||||||
export default function JobIntakeFormCheckboxComponent({ formItem, readOnly }) {
|
export default function JobIntakeFormCheckboxComponent({ formItem, readOnly }) {
|
||||||
const { name, label, required, min, max } = formItem;
|
const { name, label, required, min, max } = formItem;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { Form, Input } from "antd";
|
import { Form, Input } from "antd";
|
||||||
import React from "react";
|
|
||||||
|
|
||||||
export default function JobIntakeFormCheckboxComponent({ formItem, readOnly }) {
|
export default function JobIntakeFormCheckboxComponent({ formItem, readOnly }) {
|
||||||
const { name, label, required } = formItem;
|
const { name, label, required } = formItem;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { Form, Input } from "antd";
|
import { Form, Input } from "antd";
|
||||||
import React from "react";
|
|
||||||
|
|
||||||
export default function JobIntakeFormCheckboxComponent({ formItem, readOnly }) {
|
export default function JobIntakeFormCheckboxComponent({ formItem, readOnly }) {
|
||||||
const { name, label, required, rows } = formItem;
|
const { name, label, required, rows } = formItem;
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import React from "react";
|
|
||||||
import { Button, Result } from "antd";
|
import { Button, Result } from "antd";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import InstanceRenderManager from "../../utils/instanceRenderMgr";
|
import InstanceRenderManager from "../../utils/instanceRenderMgr";
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Card, Input, Table } from "antd";
|
import { Card, Input, Table } from "antd";
|
||||||
import React, { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { alphaSort } from "../../utils/sorters";
|
import { alphaSort } from "../../utils/sorters";
|
||||||
|
|
||||||
@@ -114,9 +114,9 @@ export default function ContractsCarsComponent({ loading, data, selectedCarId, h
|
|||||||
type: "radio",
|
type: "radio",
|
||||||
selectedRowKeys: [selectedCarId]
|
selectedRowKeys: [selectedCarId]
|
||||||
}}
|
}}
|
||||||
onRow={(record, rowIndex) => {
|
onRow={(record) => {
|
||||||
return {
|
return {
|
||||||
onClick: (event) => {
|
onClick: () => {
|
||||||
handleSelect(record);
|
handleSelect(record);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { useQuery } from "@apollo/client";
|
import { useQuery } from "@apollo/client";
|
||||||
import dayjs from "../../utils/day";
|
import dayjs from "../../utils/day";
|
||||||
import React from "react";
|
|
||||||
import { QUERY_AVAILABLE_CC } from "../../graphql/courtesy-car.queries";
|
import { QUERY_AVAILABLE_CC } from "../../graphql/courtesy-car.queries";
|
||||||
import AlertComponent from "../alert/alert.component";
|
import AlertComponent from "../alert/alert.component";
|
||||||
import ContractCarsComponent from "./contract-cars.component";
|
import ContractCarsComponent from "./contract-cars.component";
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { useMutation } from "@apollo/client";
|
|||||||
import { Button, Form, InputNumber, Popover, Radio, Select, Space } from "antd";
|
import { Button, Form, InputNumber, Popover, Radio, Select, Space } from "antd";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import dayjs from "../../utils/day";
|
import dayjs from "../../utils/day";
|
||||||
import React, { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
@@ -16,7 +16,7 @@ const mapStateToProps = createStructuredSelector({
|
|||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
currentUser: selectCurrentUser
|
currentUser: selectCurrentUser
|
||||||
});
|
});
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = () => ({
|
||||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -270,7 +270,7 @@ export function ContractConvertToRo({ bodyshop, currentUser, contract, disabled
|
|||||||
// awaitRefetchQueries: true,
|
// awaitRefetchQueries: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!!result.errors) {
|
if (result.errors) {
|
||||||
notification["error"]({
|
notification["error"]({
|
||||||
message: t("jobs.errors.inserting", {
|
message: t("jobs.errors.inserting", {
|
||||||
message: JSON.stringify(result.errors)
|
message: JSON.stringify(result.errors)
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { Card } from "antd";
|
import { Card } from "antd";
|
||||||
import React from "react";
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import DataLabel from "../data-label/data-label.component";
|
import DataLabel from "../data-label/data-label.component";
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { useLazyQuery } from "@apollo/client";
|
import { useLazyQuery } from "@apollo/client";
|
||||||
import { Button } from "antd";
|
import { Button } from "antd";
|
||||||
import React, { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { GET_JOB_FOR_CC_CONTRACT } from "../../graphql/jobs.queries";
|
import { GET_JOB_FOR_CC_CONTRACT } from "../../graphql/jobs.queries";
|
||||||
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { WarningFilled } from "@ant-design/icons";
|
import { WarningFilled } from "@ant-design/icons";
|
||||||
import { Form, Input, InputNumber, Space } from "antd";
|
import { Form, Input, InputNumber, Space } from "antd";
|
||||||
import React from "react";
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { DateFormatter } from "../../utils/DateFormatter";
|
import { DateFormatter } from "../../utils/DateFormatter";
|
||||||
import dayjs from "../../utils/day";
|
import dayjs from "../../utils/day";
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { Card } from "antd";
|
import { Card } from "antd";
|
||||||
import React from "react";
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import DataLabel from "../data-label/data-label.component";
|
import DataLabel from "../data-label/data-label.component";
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Card, Input, Table } from "antd";
|
import { Card, Input, Table } from "antd";
|
||||||
import React, { useMemo, useState } from "react";
|
import { useMemo, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { alphaSort } from "../../utils/sorters";
|
import { alphaSort } from "../../utils/sorters";
|
||||||
import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component";
|
import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component";
|
||||||
@@ -142,9 +142,9 @@ export default function ContractsJobsComponent({ loading, data, selectedJob, han
|
|||||||
type: "radio",
|
type: "radio",
|
||||||
selectedRowKeys: [selectedJob]
|
selectedRowKeys: [selectedJob]
|
||||||
}}
|
}}
|
||||||
onRow={(record, rowIndex) => {
|
onRow={(record) => {
|
||||||
return {
|
return {
|
||||||
onClick: (event) => {
|
onClick: () => {
|
||||||
handleSelect(record);
|
handleSelect(record);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { useQuery } from "@apollo/client";
|
import { useQuery } from "@apollo/client";
|
||||||
import React from "react";
|
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { QUERY_ALL_ACTIVE_JOBS } from "../../graphql/jobs.queries";
|
import { QUERY_ALL_ACTIVE_JOBS } from "../../graphql/jobs.queries";
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Button, Input, Modal, Typography } from "antd";
|
import { Button, Input, Modal, Typography } from "antd";
|
||||||
import dayjs from "../../utils/day";
|
import dayjs from "../../utils/day";
|
||||||
import React, { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import aamva from "../../utils/aamva";
|
import aamva from "../../utils/aamva";
|
||||||
import DataLabel from "../data-label/data-label.component";
|
import DataLabel from "../data-label/data-label.component";
|
||||||
@@ -54,7 +54,7 @@ export default function ContractLicenseDecodeButton({ form }) {
|
|||||||
open={modalVisible}
|
open={modalVisible}
|
||||||
okText={t("contracts.actions.senddltoform")}
|
okText={t("contracts.actions.senddltoform")}
|
||||||
onOk={handleInsertForm}
|
onOk={handleInsertForm}
|
||||||
okButtonProps={{ disabled: !!!decodedBarcode }}
|
okButtonProps={{ disabled: !decodedBarcode }}
|
||||||
onCancel={handleCancel}
|
onCancel={handleCancel}
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
@@ -62,7 +62,7 @@ export default function ContractLicenseDecodeButton({ form }) {
|
|||||||
<Input
|
<Input
|
||||||
autoFocus
|
autoFocus
|
||||||
allowClear
|
allowClear
|
||||||
onChange={(e) => {
|
onChange={() => {
|
||||||
if (!loading) setLoading(true);
|
if (!loading) setLoading(true);
|
||||||
}}
|
}}
|
||||||
onPressEnter={handleDecode}
|
onPressEnter={handleDecode}
|
||||||
|
|||||||
@@ -1,18 +1,14 @@
|
|||||||
import { Form, Input } from "antd";
|
import { Form, Input } from "antd";
|
||||||
import React from "react";
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
|
||||||
import FormDateTimePicker from "../form-date-time-picker/form-date-time-picker.component";
|
import FormDateTimePicker from "../form-date-time-picker/form-date-time-picker.component";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({});
|
||||||
bodyshop: selectBodyshop
|
|
||||||
});
|
|
||||||
|
|
||||||
export default connect(mapStateToProps, null)(PartsReceiveModalComponent);
|
export default connect(mapStateToProps, null)(PartsReceiveModalComponent);
|
||||||
|
|
||||||
export function PartsReceiveModalComponent({ bodyshop, form }) {
|
export function PartsReceiveModalComponent() {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { useLazyQuery } from "@apollo/client";
|
import { useLazyQuery } from "@apollo/client";
|
||||||
import { Button, Form, Modal, Table } from "antd";
|
import { Button, Form, Modal, Table } from "antd";
|
||||||
import React, { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
@@ -9,13 +9,11 @@ import { logImEXEvent } from "../../firebase/firebase.utils";
|
|||||||
import { FIND_CONTRACT } from "../../graphql/cccontracts.queries";
|
import { FIND_CONTRACT } from "../../graphql/cccontracts.queries";
|
||||||
import { toggleModalVisible } from "../../redux/modals/modals.actions";
|
import { toggleModalVisible } from "../../redux/modals/modals.actions";
|
||||||
import { selectContractFinder } from "../../redux/modals/modals.selectors";
|
import { selectContractFinder } from "../../redux/modals/modals.selectors";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
|
||||||
import { DateTimeFormatter } from "../../utils/DateFormatter";
|
import { DateTimeFormatter } from "../../utils/DateFormatter";
|
||||||
import ContractsFindModalComponent from "./contracts-find-modal.component";
|
import ContractsFindModalComponent from "./contracts-find-modal.component";
|
||||||
import AlertComponent from "../alert/alert.component";
|
import AlertComponent from "../alert/alert.component";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
|
||||||
contractFinderModal: selectContractFinder
|
contractFinderModal: selectContractFinder
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -23,12 +21,7 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
toggleModalVisible: () => dispatch(toggleModalVisible("contractFinder"))
|
toggleModalVisible: () => dispatch(toggleModalVisible("contractFinder"))
|
||||||
});
|
});
|
||||||
|
|
||||||
export function ContractsFindModalContainer({
|
export function ContractsFindModalContainer({ contractFinderModal, toggleModalVisible }) {
|
||||||
contractFinderModal,
|
|
||||||
toggleModalVisible,
|
|
||||||
|
|
||||||
bodyshop
|
|
||||||
}) {
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const { open } = contractFinderModal;
|
const { open } = contractFinderModal;
|
||||||
@@ -133,7 +126,7 @@ export function ContractsFindModalContainer({
|
|||||||
}
|
}
|
||||||
]}
|
]}
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
dataSource={data && data.cccontracts}
|
dataSource={data?.cccontracts}
|
||||||
/>
|
/>
|
||||||
</Form>
|
</Form>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { SyncOutlined } from "@ant-design/icons";
|
import { SyncOutlined } from "@ant-design/icons";
|
||||||
import { Button, Card, Input, Space, Table, Typography } from "antd";
|
import { Button, Card, Input, Space, Table, Typography } from "antd";
|
||||||
import queryString from "query-string";
|
import queryString from "query-string";
|
||||||
import React, { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Link, useLocation, useNavigate } from "react-router-dom";
|
import { Link, useLocation, useNavigate } from "react-router-dom";
|
||||||
import { setModalContext } from "../../redux/modals/modals.actions";
|
import { setModalContext } from "../../redux/modals/modals.actions";
|
||||||
@@ -175,7 +175,7 @@ export function ContractsList({ bodyshop, loading, contracts, refetch, total, se
|
|||||||
pagination={{
|
pagination={{
|
||||||
position: "top",
|
position: "top",
|
||||||
pageSize: pageLimit,
|
pageSize: pageLimit,
|
||||||
current: parseInt(page || 1),
|
current: parseInt(page || 1, 10),
|
||||||
total: total
|
total: total
|
||||||
}}
|
}}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { DownOutlined } from "@ant-design/icons";
|
import { DownOutlined } from "@ant-design/icons";
|
||||||
import { Dropdown } from "antd";
|
import { Dropdown } from "antd";
|
||||||
import React from "react";
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
@@ -13,8 +12,8 @@ const mapStateToProps = createStructuredSelector({
|
|||||||
export function ContractsRatesChangeButton({ disabled, form, bodyshop }) {
|
export function ContractsRatesChangeButton({ disabled, form, bodyshop }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const handleClick = ({ item, key, keyPath }) => {
|
const handleClick = ({ item }) => {
|
||||||
const { label, ...rate } = item.props.value;
|
const { ...rate } = item.props.value;
|
||||||
form.setFieldsValue(rate);
|
form.setFieldsValue(rate);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { Card, Table } from "antd";
|
import { Card, Table } from "antd";
|
||||||
import queryString from "query-string";
|
import queryString from "query-string";
|
||||||
import React from "react";
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Link, useLocation, useNavigate } from "react-router-dom";
|
import { Link, useLocation, useNavigate } from "react-router-dom";
|
||||||
import { DateFormatter } from "../../utils/DateFormatter";
|
import { DateFormatter } from "../../utils/DateFormatter";
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import { useApolloClient } from "@apollo/client";
|
|||||||
import { Button, Form, Input, InputNumber, Space } from "antd";
|
import { Button, Form, Input, InputNumber, Space } from "antd";
|
||||||
import { PageHeader } from "@ant-design/pro-layout";
|
import { PageHeader } from "@ant-design/pro-layout";
|
||||||
import dayjs from "../../utils/day";
|
import dayjs from "../../utils/day";
|
||||||
import React from "react";
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { CHECK_CC_FLEET_NUMBER } from "../../graphql/courtesy-car.queries";
|
import { CHECK_CC_FLEET_NUMBER } from "../../graphql/courtesy-car.queries";
|
||||||
import { DateFormatter } from "../../utils/DateFormatter";
|
import { DateFormatter } from "../../utils/DateFormatter";
|
||||||
@@ -128,7 +127,7 @@ export default function CourtesyCarCreateFormComponent({ form, saveLoading, newC
|
|||||||
required: true
|
required: true
|
||||||
//message: t("general.validation.required"),
|
//message: t("general.validation.required"),
|
||||||
},
|
},
|
||||||
({ getFieldValue }) => ({
|
() => ({
|
||||||
async validator(rule, value) {
|
async validator(rule, value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
const response = await client.query({
|
const response = await client.query({
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Select } from "antd";
|
import { Select } from "antd";
|
||||||
import React, { forwardRef, useEffect, useState } from "react";
|
import { forwardRef, useEffect, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
const { Option } = Select;
|
const { Option } = Select;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { Form, InputNumber } from "antd";
|
import { Form, InputNumber } from "antd";
|
||||||
import React from "react";
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import CourtesyCarFuelSlider from "../courtesy-car-fuel-select/courtesy-car-fuel-select.component";
|
import CourtesyCarFuelSlider from "../courtesy-car-fuel-select/courtesy-car-fuel-select.component";
|
||||||
import DateTimePicker from "../form-date-time-picker/form-date-time-picker.component.jsx";
|
import DateTimePicker from "../form-date-time-picker/form-date-time-picker.component.jsx";
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
import { Form, Modal } from "antd";
|
import { Form, Modal } from "antd";
|
||||||
import React, { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { toggleModalVisible } from "../../redux/modals/modals.actions";
|
import { toggleModalVisible } from "../../redux/modals/modals.actions";
|
||||||
import { selectCourtesyCarReturn } from "../../redux/modals/modals.selectors";
|
import { selectCourtesyCarReturn } from "../../redux/modals/modals.selectors";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
|
||||||
import CourtesyCarReturnModalComponent from "./courtesy-car-return-modal.component";
|
import CourtesyCarReturnModalComponent from "./courtesy-car-return-modal.component";
|
||||||
import dayjs from "../../utils/day";
|
import dayjs from "../../utils/day";
|
||||||
import { RETURN_CONTRACT } from "../../graphql/cccontracts.queries";
|
import { RETURN_CONTRACT } from "../../graphql/cccontracts.queries";
|
||||||
@@ -13,15 +12,14 @@ import { useMutation } from "@apollo/client";
|
|||||||
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
courtesyCarReturnModal: selectCourtesyCarReturn,
|
courtesyCarReturnModal: selectCourtesyCarReturn
|
||||||
bodyshop: selectBodyshop
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
toggleModalVisible: () => dispatch(toggleModalVisible("courtesyCarReturn"))
|
toggleModalVisible: () => dispatch(toggleModalVisible("courtesyCarReturn"))
|
||||||
});
|
});
|
||||||
|
|
||||||
export function CCReturnModalContainer({ courtesyCarReturnModal, toggleModalVisible, bodyshop }) {
|
export function CCReturnModalContainer({ courtesyCarReturnModal, toggleModalVisible }) {
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const { open, context, actions } = courtesyCarReturnModal;
|
const { open, context, actions } = courtesyCarReturnModal;
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@@ -48,7 +46,7 @@ export function CCReturnModalContainer({ courtesyCarReturnModal, toggleModalVisi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then((r) => {
|
.then(() => {
|
||||||
if (actions.refetch) actions.refetch();
|
if (actions.refetch) actions.refetch();
|
||||||
toggleModalVisible();
|
toggleModalVisible();
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { forwardRef, useEffect, useState } from "react";
|
import { forwardRef, useEffect, useState } from "react";
|
||||||
import { Select } from "antd";
|
import { Select } from "antd";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { SyncOutlined, WarningFilled } from "@ant-design/icons";
|
import { SyncOutlined, WarningFilled } from "@ant-design/icons";
|
||||||
import { Button, Card, Dropdown, Input, Space, Table, Tooltip } from "antd";
|
import { Button, Card, Dropdown, Input, Space, Table, Tooltip } from "antd";
|
||||||
import dayjs from "../../utils/day";
|
import dayjs from "../../utils/day";
|
||||||
import React, { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { DateTimeFormatter } from "../../utils/DateFormatter";
|
import { DateTimeFormatter } from "../../utils/DateFormatter";
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { useQuery } from "@apollo/client";
|
import { useQuery } from "@apollo/client";
|
||||||
import { Card, Form, Result } from "antd";
|
import { Card, Form, Result } from "antd";
|
||||||
import queryString from "query-string";
|
import queryString from "query-string";
|
||||||
import React, { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { useLocation } from "react-router-dom";
|
import { useLocation } from "react-router-dom";
|
||||||
import { QUERY_CSI_RESPONSE_BY_PK } from "../../graphql/csi.queries";
|
import { QUERY_CSI_RESPONSE_BY_PK } from "../../graphql/csi.queries";
|
||||||
@@ -19,7 +19,7 @@ export default function CsiResponseFormContainer() {
|
|||||||
variables: {
|
variables: {
|
||||||
id: responseid
|
id: responseid
|
||||||
},
|
},
|
||||||
skip: !!!responseid,
|
skip: !responseid,
|
||||||
fetchPolicy: "network-only",
|
fetchPolicy: "network-only",
|
||||||
nextFetchPolicy: "network-only"
|
nextFetchPolicy: "network-only"
|
||||||
});
|
});
|
||||||
@@ -28,7 +28,7 @@ export default function CsiResponseFormContainer() {
|
|||||||
form.resetFields();
|
form.resetFields();
|
||||||
}, [data, form]);
|
}, [data, form]);
|
||||||
|
|
||||||
if (!!!responseid)
|
if (!responseid)
|
||||||
return (
|
return (
|
||||||
<Card>
|
<Card>
|
||||||
<Result title={t("csi.labels.noneselected")} />
|
<Result title={t("csi.labels.noneselected")} />
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { SyncOutlined } from "@ant-design/icons";
|
import { SyncOutlined } from "@ant-design/icons";
|
||||||
import { Button, Card, Table } from "antd";
|
import { Button, Card, Table } from "antd";
|
||||||
import queryString from "query-string";
|
import queryString from "query-string";
|
||||||
import React, { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Link, useLocation, useNavigate } from "react-router-dom";
|
import { Link, useLocation, useNavigate } from "react-router-dom";
|
||||||
import { DateFormatter } from "../../utils/DateFormatter";
|
import { DateFormatter } from "../../utils/DateFormatter";
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { Card } from "antd";
|
import { Card } from "antd";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import dayjs from "../../../utils/day";
|
import dayjs from "../../../utils/day";
|
||||||
import React from "react";
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Bar, CartesianGrid, ComposedChart, Legend, Line, ResponsiveContainer, Tooltip, XAxis, YAxis } from "recharts";
|
import { Bar, CartesianGrid, ComposedChart, Legend, Line, ResponsiveContainer, Tooltip, XAxis, YAxis } from "recharts";
|
||||||
import * as Utils from "../../scoreboard-targets-table/scoreboard-targets-table.util";
|
import * as Utils from "../../scoreboard-targets-table/scoreboard-targets-table.util";
|
||||||
@@ -19,7 +18,7 @@ export default function DashboardMonthlyEmployeeEfficiency({ data, ...cardProps
|
|||||||
const chartData = listOfDays.reduce((acc, val) => {
|
const chartData = listOfDays.reduce((acc, val) => {
|
||||||
//Sum up the current day.
|
//Sum up the current day.
|
||||||
let dailyHrs;
|
let dailyHrs;
|
||||||
if (!!ticketsByDate[val]) {
|
if (ticketsByDate[val]) {
|
||||||
dailyHrs = ticketsByDate[val].reduce(
|
dailyHrs = ticketsByDate[val].reduce(
|
||||||
(dayAcc, dayVal) => {
|
(dayAcc, dayVal) => {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Card, Input, Space, Table, Typography } from "antd";
|
import { Card, Input, Space, Table, Typography } from "antd";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import React, { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { alphaSort } from "../../../utils/sorters";
|
import { alphaSort } from "../../../utils/sorters";
|
||||||
import LoadingSkeleton from "../../loading-skeleton/loading-skeleton.component";
|
import LoadingSkeleton from "../../loading-skeleton/loading-skeleton.component";
|
||||||
@@ -19,7 +19,7 @@ export default function DashboardMonthlyJobCosting({ data, ...cardProps }) {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
async function getCostingData() {
|
async function getCostingData() {
|
||||||
if (data && data.monthly_sales) {
|
if (data?.monthly_sales) {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
const response = await axios.post("/job/costingmulti", {
|
const response = await axios.post("/job/costingmulti", {
|
||||||
jobids: data.monthly_sales.map((x) => x.id)
|
jobids: data.monthly_sales.map((x) => x.id)
|
||||||
@@ -79,7 +79,7 @@ export default function DashboardMonthlyJobCosting({ data, ...cardProps }) {
|
|||||||
];
|
];
|
||||||
const filteredData =
|
const filteredData =
|
||||||
searchText === ""
|
searchText === ""
|
||||||
? (costingData && costingData.allCostCenterData) || []
|
? costingData?.allCostCenterData || []
|
||||||
: costingData.allCostCenterData.filter((d) =>
|
: costingData.allCostCenterData.filter((d) =>
|
||||||
(d.cost_center || "").toString().toLowerCase().includes(searchText.toLowerCase())
|
(d.cost_center || "").toString().toLowerCase().includes(searchText.toLowerCase())
|
||||||
);
|
);
|
||||||
@@ -117,15 +117,13 @@ export default function DashboardMonthlyJobCosting({ data, ...cardProps }) {
|
|||||||
<Typography.Title level={4}>{t("general.labels.totals")}</Typography.Title>
|
<Typography.Title level={4}>{t("general.labels.totals")}</Typography.Title>
|
||||||
</Table.Summary.Cell>
|
</Table.Summary.Cell>
|
||||||
<Table.Summary.Cell>
|
<Table.Summary.Cell>
|
||||||
{Dinero(
|
{Dinero(costingData?.allSummaryData && costingData.allSummaryData.totalSales).toFormat()}
|
||||||
costingData && costingData.allSummaryData && costingData.allSummaryData.totalSales
|
|
||||||
).toFormat()}
|
|
||||||
</Table.Summary.Cell>
|
</Table.Summary.Cell>
|
||||||
<Table.Summary.Cell>
|
<Table.Summary.Cell>
|
||||||
{Dinero(costingData && costingData.allSummaryData && costingData.allSummaryData.totalCost).toFormat()}
|
{Dinero(costingData?.allSummaryData && costingData.allSummaryData.totalCost).toFormat()}
|
||||||
</Table.Summary.Cell>
|
</Table.Summary.Cell>
|
||||||
<Table.Summary.Cell>
|
<Table.Summary.Cell>
|
||||||
{Dinero(costingData && costingData.allSummaryData && costingData.allSummaryData.gpdollars).toFormat()}
|
{Dinero(costingData?.allSummaryData && costingData.allSummaryData.gpdollars).toFormat()}
|
||||||
</Table.Summary.Cell>
|
</Table.Summary.Cell>
|
||||||
<Table.Summary.Cell></Table.Summary.Cell>
|
<Table.Summary.Cell></Table.Summary.Cell>
|
||||||
</Table.Summary.Row>
|
</Table.Summary.Row>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Card } from "antd";
|
import { Card } from "antd";
|
||||||
import Dinero from "dinero.js";
|
import Dinero from "dinero.js";
|
||||||
import React, { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Cell, Pie, PieChart, ResponsiveContainer, Sector } from "recharts";
|
import { Cell, Pie, PieChart, ResponsiveContainer, Sector } from "recharts";
|
||||||
import DashboardRefreshRequired from "../refresh-required.component";
|
import DashboardRefreshRequired from "../refresh-required.component";
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Card } from "antd";
|
import { Card } from "antd";
|
||||||
import Dinero from "dinero.js";
|
import Dinero from "dinero.js";
|
||||||
import React, { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Cell, Pie, PieChart, ResponsiveContainer, Sector } from "recharts";
|
import { Cell, Pie, PieChart, ResponsiveContainer, Sector } from "recharts";
|
||||||
import DashboardRefreshRequired from "../refresh-required.component";
|
import DashboardRefreshRequired from "../refresh-required.component";
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { Card } from "antd";
|
import { Card } from "antd";
|
||||||
import dayjs from "../../../utils/day";
|
import dayjs from "../../../utils/day";
|
||||||
import React from "react";
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { Area, Bar, CartesianGrid, ComposedChart, Legend, ResponsiveContainer, Tooltip, XAxis, YAxis } from "recharts";
|
import { Area, Bar, CartesianGrid, ComposedChart, Legend, ResponsiveContainer, Tooltip, XAxis, YAxis } from "recharts";
|
||||||
@@ -20,7 +19,7 @@ export default function DashboardMonthlyRevenueGraph({ data, ...cardProps }) {
|
|||||||
const chartData = listOfDays.reduce((acc, val) => {
|
const chartData = listOfDays.reduce((acc, val) => {
|
||||||
//Sum up the current day.
|
//Sum up the current day.
|
||||||
let dailySales;
|
let dailySales;
|
||||||
if (!!jobsByDate[val]) {
|
if (jobsByDate[val]) {
|
||||||
dailySales = jobsByDate[val].reduce((dayAcc, dayVal) => {
|
dailySales = jobsByDate[val].reduce((dayAcc, dayVal) => {
|
||||||
return dayAcc.add(Dinero((dayVal.job_totals && dayVal.job_totals.totals.subtotal) || 0));
|
return dayAcc.add(Dinero((dayVal.job_totals && dayVal.job_totals.totals.subtotal) || 0));
|
||||||
}, Dinero());
|
}, Dinero());
|
||||||
@@ -46,7 +45,7 @@ export default function DashboardMonthlyRevenueGraph({ data, ...cardProps }) {
|
|||||||
<CartesianGrid stroke="#f5f5f5" />
|
<CartesianGrid stroke="#f5f5f5" />
|
||||||
<XAxis dataKey="date" />
|
<XAxis dataKey="date" />
|
||||||
<YAxis />
|
<YAxis />
|
||||||
<Tooltip formatter={(value, name, props) => value && value.toFixed(2)} />
|
<Tooltip formatter={(value) => value && value.toFixed(2)} />
|
||||||
<Legend />
|
<Legend />
|
||||||
<Area type="monotone" name="Accumulated Sales" dataKey="accSales" fill="#3CB371" stroke="#3CB371" />
|
<Area type="monotone" name="Accumulated Sales" dataKey="accSales" fill="#3CB371" stroke="#3CB371" />
|
||||||
<Bar
|
<Bar
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { Card, Statistic } from "antd";
|
import { Card, Statistic } from "antd";
|
||||||
import Dinero from "dinero.js";
|
import Dinero from "dinero.js";
|
||||||
import dayjs from "../../../utils/day";
|
import dayjs from "../../../utils/day";
|
||||||
import React from "react";
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import DashboardRefreshRequired from "../refresh-required.component";
|
import DashboardRefreshRequired from "../refresh-required.component";
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { SyncOutlined } from "@ant-design/icons";
|
import { SyncOutlined } from "@ant-design/icons";
|
||||||
import { Card } from "antd";
|
import { Card } from "antd";
|
||||||
import React from "react";
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
export default function DashboardRefreshRequired(props) {
|
export default function DashboardRefreshRequired(props) {
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { Card, Statistic } from "antd";
|
import { Card, Statistic } from "antd";
|
||||||
import Dinero from "dinero.js";
|
import Dinero from "dinero.js";
|
||||||
import React from "react";
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import DashboardRefreshRequired from "../refresh-required.component";
|
import DashboardRefreshRequired from "../refresh-required.component";
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { Card, Space, Statistic } from "antd";
|
import { Card, Space, Statistic } from "antd";
|
||||||
import React from "react";
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
@@ -9,7 +8,7 @@ import DashboardRefreshRequired from "../refresh-required.component";
|
|||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop
|
bodyshop: selectBodyshop
|
||||||
});
|
});
|
||||||
const mapDispatchToProps = (dispatch) => ({});
|
const mapDispatchToProps = () => ({});
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(DashboardTotalProductionHours);
|
export default connect(mapStateToProps, mapDispatchToProps)(DashboardTotalProductionHours);
|
||||||
|
|
||||||
export function DashboardTotalProductionHours({ bodyshop, data, ...cardProps }) {
|
export function DashboardTotalProductionHours({ bodyshop, data, ...cardProps }) {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ const createDashboardQuery = (state) => {
|
|||||||
const componentBasedAdditions =
|
const componentBasedAdditions =
|
||||||
state &&
|
state &&
|
||||||
Array.isArray(state.layout) &&
|
Array.isArray(state.layout) &&
|
||||||
state.layout.map((item, index) => componentList[item.i].gqlFragment || "").join("");
|
state.layout.map((item) => componentList[item.i].gqlFragment || "").join("");
|
||||||
return gql`
|
return gql`
|
||||||
query QUERY_DASHBOARD_DETAILS { ${componentBasedAdditions || ""}
|
query QUERY_DASHBOARD_DETAILS { ${componentBasedAdditions || ""}
|
||||||
monthly_sales: jobs(where: {_and: [
|
monthly_sales: jobs(where: {_and: [
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import Icon, { SyncOutlined } from "@ant-design/icons";
|
import Icon, { SyncOutlined } from "@ant-design/icons";
|
||||||
import { isEmpty, cloneDeep } from "lodash";
|
import { cloneDeep, isEmpty } from "lodash";
|
||||||
import { useMutation, useQuery } from "@apollo/client";
|
import { useMutation, useQuery } from "@apollo/client";
|
||||||
import { Button, Dropdown, Space } from "antd";
|
import { Button, Dropdown, Space } from "antd";
|
||||||
import { PageHeader } from "@ant-design/pro-layout";
|
import { PageHeader } from "@ant-design/pro-layout";
|
||||||
@@ -28,7 +28,7 @@ const mapStateToProps = createStructuredSelector({
|
|||||||
bodyshop: selectBodyshop
|
bodyshop: selectBodyshop
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = () => ({
|
||||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -134,7 +134,7 @@ export function DashboardGridComponent({ currentUser, bodyshop }) {
|
|||||||
layouts={state.layouts}
|
layouts={state.layouts}
|
||||||
onLayoutChange={handleLayoutChange}
|
onLayoutChange={handleLayoutChange}
|
||||||
>
|
>
|
||||||
{state.items.map((item, index) => {
|
{state.items.map((item) => {
|
||||||
const TheComponent = componentList[item.i].component;
|
const TheComponent = componentList[item.i].component;
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user