Compare commits
158 Commits
feature/IO
...
feature/IO
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f96fefbfdc | ||
|
|
6570d38719 | ||
|
|
f299c685e2 | ||
|
|
59075ee610 | ||
|
|
0716920dfc | ||
|
|
07119e4e7e | ||
|
|
7dcdd64a17 | ||
|
|
f26b045727 | ||
|
|
8eff1dfc4c | ||
|
|
74da3ec1ca | ||
|
|
7e99a51495 | ||
|
|
8d170a5bb4 | ||
|
|
1f62108e57 | ||
|
|
8715ef4f24 | ||
|
|
85b137f0d6 | ||
|
|
14ebb280a3 | ||
|
|
f1953eef29 | ||
|
|
55842faedd | ||
|
|
9c50de85de | ||
|
|
e6df079431 | ||
|
|
36ce547579 | ||
|
|
ae5fef435a | ||
|
|
fe55701079 | ||
|
|
87b567e990 | ||
|
|
c2b3905c8e | ||
|
|
32072f1d6c | ||
|
|
e84d3bf53a | ||
|
|
67a7e4b865 | ||
|
|
3d7da0b28a | ||
|
|
9320587595 | ||
|
|
7bceba7ed5 | ||
|
|
0db72cd9e4 | ||
|
|
53fc5e361f | ||
|
|
54af163ddf | ||
|
|
c0d756fa38 | ||
|
|
fc16190ec4 | ||
|
|
cf7f4f1b46 | ||
|
|
ba95a636cf | ||
|
|
2478fedf1a | ||
|
|
bc6c889afc | ||
|
|
33bcf250d0 | ||
|
|
bad32e069b | ||
|
|
9acf20d4f3 | ||
|
|
26f1ee0d89 | ||
|
|
9c86be8250 | ||
|
|
4a06f9a686 | ||
|
|
98700f54b4 | ||
|
|
9a37cb5cb8 | ||
|
|
673d0bb7c5 | ||
|
|
04c7bc445b | ||
|
|
41782fe120 | ||
|
|
4e8e25a336 | ||
|
|
3c2d3156cb | ||
|
|
0dac15391f | ||
|
|
106534b59b | ||
|
|
19c0553746 | ||
|
|
5f1475d2ec | ||
|
|
84f4d5956a | ||
|
|
4330ddd926 | ||
|
|
0711210512 | ||
|
|
458ec76835 | ||
|
|
682ea860fb | ||
|
|
99977934e7 | ||
|
|
3e05b21c90 | ||
|
|
4e1dd52bea | ||
|
|
f6bcc743d8 | ||
|
|
7472285641 | ||
|
|
d747594e39 | ||
|
|
67ff9f30c6 | ||
|
|
a27092dbcc | ||
|
|
ca41bff446 | ||
|
|
cf8280590c | ||
|
|
b649ca1f00 | ||
|
|
b441301007 | ||
|
|
2e93238b5c | ||
|
|
ce4fe84536 | ||
|
|
9b7c0af025 | ||
|
|
dfdaf36ed1 | ||
|
|
cc8d1b3793 | ||
|
|
a33bfedbb8 | ||
|
|
eb359d83c5 | ||
|
|
ae13e9e36a | ||
|
|
4a62ac2a11 | ||
|
|
016a62b6d5 | ||
|
|
3e226b50ab | ||
|
|
ab84cb5ada | ||
|
|
7825aa4122 | ||
|
|
8d43fbfcd9 | ||
|
|
47a01628d3 | ||
|
|
c008660023 | ||
|
|
5da34cbeac | ||
|
|
5b29aec14b | ||
|
|
ca6aa682f6 | ||
|
|
eb3786cebf | ||
|
|
53843e22a4 | ||
|
|
e1693674ca | ||
|
|
2d2190e4fa | ||
|
|
02fd8097a8 | ||
|
|
fcfbc85683 | ||
|
|
802dd696f4 | ||
|
|
60a0222dd0 | ||
|
|
9114abd3ef | ||
|
|
f7fc0e6a6d | ||
|
|
ffebbe3b2a | ||
|
|
25b8c1b1eb | ||
|
|
17f8625108 | ||
|
|
e3c21f0373 | ||
|
|
859ff00277 | ||
|
|
e7c3be5231 | ||
|
|
85e3c5a433 | ||
|
|
d8d5cde3f1 | ||
|
|
6efa08fee3 | ||
|
|
636c13373c | ||
|
|
3659fbec84 | ||
|
|
05f1a9b280 | ||
|
|
34b4baac3d | ||
|
|
5884d5eba0 | ||
|
|
6b4709b76b | ||
|
|
4dd2137006 | ||
|
|
03315836a6 | ||
|
|
f703ba2cf9 | ||
|
|
dc05e4e166 | ||
|
|
4513acc640 | ||
|
|
612e359d4c | ||
|
|
c8fb1ce302 | ||
|
|
b29d8e1912 | ||
|
|
f1aa7944a3 | ||
|
|
74b6c2b6b5 | ||
|
|
4313cf471f | ||
|
|
fce8039dad | ||
|
|
085ae141ae | ||
|
|
fbc9ccc018 | ||
|
|
f2ede519d7 | ||
|
|
21c53473d3 | ||
|
|
fbc622fa04 | ||
|
|
c998e4901f | ||
|
|
06c35a4ff8 | ||
|
|
171c0b2b5a | ||
|
|
fd4820336f | ||
|
|
46840266ee | ||
|
|
82a0d287d6 | ||
|
|
4de604ef7c | ||
|
|
ec2c26ca69 | ||
|
|
026ce853e2 | ||
|
|
720b7f891b | ||
|
|
b5332458ec | ||
|
|
3c7b16412b | ||
|
|
a454c57bc9 | ||
|
|
86ff7cbc69 | ||
|
|
fbfdbc903c | ||
|
|
9e64fdc985 | ||
|
|
d7c23297ab | ||
|
|
f6e095e0a6 | ||
|
|
d7ec2e717c | ||
|
|
35fd74d3fe | ||
|
|
8325e2d9cf | ||
|
|
cc3c1242f5 | ||
|
|
b2f4a5539c |
@@ -8,13 +8,13 @@ orbs:
|
|||||||
jobs:
|
jobs:
|
||||||
api-deploy:
|
api-deploy:
|
||||||
docker:
|
docker:
|
||||||
- image: "cimg/base:stable"
|
- image: cimg/node:18.18.2
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- eb/setup
|
- eb/setup
|
||||||
- run:
|
- run:
|
||||||
command: |
|
command: |
|
||||||
eb init imex-online-production-api -r ca-central-1 -p "Node.js 16 running on 64bit Amazon Linux 2"
|
eb init imex-online-production-api -r ca-central-1 -p "Node.js 18 running on 64bit Amazon Linux 2"
|
||||||
eb status --verbose
|
eb status --verbose
|
||||||
eb deploy
|
eb deploy
|
||||||
eb status
|
eb status
|
||||||
|
|||||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -117,4 +117,6 @@ logs/oAuthClient-log.log
|
|||||||
|
|
||||||
.node-persist/**
|
.node-persist/**
|
||||||
|
|
||||||
/*.env.*
|
/*.env.*
|
||||||
|
.idea/*
|
||||||
|
.idea
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
<babeledit_project be_version="2.7.1" version="1.2">
|
<babeledit_project version="1.2" be_version="2.7.1">
|
||||||
<!--
|
<!--
|
||||||
|
|
||||||
BabelEdit project file
|
BabelEdit project file
|
||||||
@@ -364,6 +364,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>unblock</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>viewjob</name>
|
<name>viewjob</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
@@ -17755,6 +17776,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>reports</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>required</name>
|
<name>required</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
@@ -19472,6 +19514,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>paymentnum</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>paymenttype</name>
|
<name>paymenttype</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
@@ -24075,6 +24138,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>dms_model_override</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>dms_unsold</name>
|
<name>dms_unsold</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
@@ -43260,6 +43344,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>hours_sold_detail_closed_estimator</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>hours_sold_detail_closed_ins_co</name>
|
<name>hours_sold_detail_closed_ins_co</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
@@ -43344,6 +43449,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>hours_sold_detail_open_estimator</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>hours_sold_detail_open_ins_co</name>
|
<name>hours_sold_detail_open_ins_co</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
@@ -43428,6 +43554,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>hours_sold_summary_closed_estimator</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>hours_sold_summary_closed_ins_co</name>
|
<name>hours_sold_summary_closed_ins_co</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
@@ -43512,6 +43659,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>hours_sold_summary_open_estimator</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>hours_sold_summary_open_ins_co</name>
|
<name>hours_sold_summary_open_ins_co</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
@@ -43848,6 +44016,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>open_orders_referral</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>open_orders_specific_csr</name>
|
<name>open_orders_specific_csr</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
@@ -46227,6 +46416,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>created_by</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>date</name>
|
<name>date</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
|
|||||||
24522
client/package-lock.json
generated
Normal file
24522
client/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -7,7 +7,7 @@
|
|||||||
"@apollo/client": "^3.7.9",
|
"@apollo/client": "^3.7.9",
|
||||||
"@asseinfo/react-kanban": "^2.2.0",
|
"@asseinfo/react-kanban": "^2.2.0",
|
||||||
"@craco/craco": "^7.0.0",
|
"@craco/craco": "^7.0.0",
|
||||||
"@fingerprintjs/fingerprintjs": "^3.3.3",
|
"@fingerprintjs/fingerprintjs": "^3.4.2",
|
||||||
"@jsreport/browser-client": "^3.1.0",
|
"@jsreport/browser-client": "^3.1.0",
|
||||||
"@sentry/react": "^7.40.0",
|
"@sentry/react": "^7.40.0",
|
||||||
"@sentry/tracing": "^7.40.0",
|
"@sentry/tracing": "^7.40.0",
|
||||||
@@ -89,8 +89,8 @@
|
|||||||
"analyze": "source-map-explorer 'build/static/js/*.js'",
|
"analyze": "source-map-explorer 'build/static/js/*.js'",
|
||||||
"start": "craco start",
|
"start": "craco start",
|
||||||
"build": "REACT_APP_GIT_SHA=`git rev-parse --short HEAD` craco build",
|
"build": "REACT_APP_GIT_SHA=`git rev-parse --short HEAD` craco build",
|
||||||
"build:test": "env-cmd -f .env.test yarn run build",
|
"build:test": "env-cmd -f .env.test npm run build",
|
||||||
"build-deploy:test": "yarn run build:test && s3cmd sync build/* s3://imex-online-test && echo '🚀 TESTING Deployed!'",
|
"build-deploy:test": "npm run build:test && s3cmd sync build/* s3://imex-online-test && echo '🚀 TESTING Deployed!'",
|
||||||
"buildcra": "REACT_APP_GIT_SHA=`git rev-parse --short HEAD` craco build",
|
"buildcra": "REACT_APP_GIT_SHA=`git rev-parse --short HEAD` craco build",
|
||||||
"test": "cypress open",
|
"test": "cypress open",
|
||||||
"eject": "react-scripts eject",
|
"eject": "react-scripts eject",
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ function BillEnterModalContainer({
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
refetchQueries: ["QUERY_PARTS_BILLS_BY_JOBID"],
|
refetchQueries: ["QUERY_PARTS_BILLS_BY_JOBID", "GET_JOB_BY_PK"],
|
||||||
});
|
});
|
||||||
|
|
||||||
const adjKeys = Object.keys(adjustmentsToInsert);
|
const adjKeys = Object.keys(adjustmentsToInsert);
|
||||||
@@ -316,7 +316,9 @@ function BillEnterModalContainer({
|
|||||||
insertAuditTrail({
|
insertAuditTrail({
|
||||||
jobid: values.jobid,
|
jobid: values.jobid,
|
||||||
billid: billId,
|
billid: billId,
|
||||||
operation: AuditTrailMapping.billposted(r1.data.insert_bills.returning[0].invoice_number),
|
operation: AuditTrailMapping.billposted(
|
||||||
|
r1.data.insert_bills.returning[0].invoice_number
|
||||||
|
),
|
||||||
});
|
});
|
||||||
|
|
||||||
if (enterAgain) {
|
if (enterAgain) {
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ export function BillFormComponent({
|
|||||||
job,
|
job,
|
||||||
loadOutstandingReturns,
|
loadOutstandingReturns,
|
||||||
loadInventory,
|
loadInventory,
|
||||||
|
preferredMake,
|
||||||
}) {
|
}) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const client = useApolloClient();
|
const client = useApolloClient();
|
||||||
@@ -185,6 +186,7 @@ export function BillFormComponent({
|
|||||||
<VendorSearchSelect
|
<VendorSearchSelect
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
options={vendorAutoCompleteOptions}
|
options={vendorAutoCompleteOptions}
|
||||||
|
preferredMake={preferredMake}
|
||||||
onSelect={handleVendorSelect}
|
onSelect={handleVendorSelect}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
import { useLazyQuery, useQuery } from "@apollo/client";
|
import { useLazyQuery, useQuery } from "@apollo/client";
|
||||||
|
import { useTreatments } from "@splitsoftware/splitio-react";
|
||||||
import React from "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 { GET_JOB_LINES_TO_ENTER_BILL } from "../../graphql/jobs-lines.queries";
|
import { GET_JOB_LINES_TO_ENTER_BILL } from "../../graphql/jobs-lines.queries";
|
||||||
|
import { QUERY_UNRECEIVED_LINES } from "../../graphql/parts-orders.queries";
|
||||||
import { SEARCH_VENDOR_AUTOCOMPLETE } from "../../graphql/vendors.queries";
|
import { SEARCH_VENDOR_AUTOCOMPLETE } from "../../graphql/vendors.queries";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import BillFormComponent from "./bill-form.component";
|
|
||||||
import BillCmdReturnsTableComponent from "../bill-cm-returns-table/bill-cm-returns-table.component";
|
import BillCmdReturnsTableComponent from "../bill-cm-returns-table/bill-cm-returns-table.component";
|
||||||
import { QUERY_UNRECEIVED_LINES } from "../../graphql/parts-orders.queries";
|
|
||||||
import BillInventoryTable from "../bill-inventory-table/bill-inventory-table.component";
|
import BillInventoryTable from "../bill-inventory-table/bill-inventory-table.component";
|
||||||
import { QUERY_OUTSTANDING_INVENTORY } from "../../graphql/inventory.queries";
|
import BillFormComponent from "./bill-form.component";
|
||||||
import { useTreatments } from "@splitsoftware/splitio-react";
|
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -59,6 +59,7 @@ export function BillFormContainer({
|
|||||||
disableInvNumber={disableInvNumber}
|
disableInvNumber={disableInvNumber}
|
||||||
loadOutstandingReturns={loadOutstandingReturns}
|
loadOutstandingReturns={loadOutstandingReturns}
|
||||||
loadInventory={loadInventory}
|
loadInventory={loadInventory}
|
||||||
|
preferredMake={lineData ? lineData.jobs_by_pk.v_make_desc : null}
|
||||||
/>
|
/>
|
||||||
{!billEdit && (
|
{!billEdit && (
|
||||||
<BillCmdReturnsTableComponent
|
<BillCmdReturnsTableComponent
|
||||||
|
|||||||
@@ -8,15 +8,23 @@ import PhoneNumberFormatter from "../../utils/PhoneFormatter";
|
|||||||
|
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
|
import { searchingForConversation } from "../../redux/messaging/messaging.selectors";
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
|
searchingForConversation: searchingForConversation,
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
openChatByPhone: (phone) => dispatch(openChatByPhone(phone)),
|
openChatByPhone: (phone) => dispatch(openChatByPhone(phone)),
|
||||||
});
|
});
|
||||||
|
|
||||||
export function ChatOpenButton({ bodyshop, phone, jobid, openChatByPhone }) {
|
export function ChatOpenButton({
|
||||||
|
bodyshop,
|
||||||
|
searchingForConversation,
|
||||||
|
phone,
|
||||||
|
jobid,
|
||||||
|
openChatByPhone,
|
||||||
|
}) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
if (!phone) return <></>;
|
if (!phone) return <></>;
|
||||||
|
|
||||||
@@ -29,7 +37,7 @@ export function ChatOpenButton({ bodyshop, phone, jobid, openChatByPhone }) {
|
|||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
const p = parsePhoneNumber(phone, "CA");
|
const p = parsePhoneNumber(phone, "CA");
|
||||||
|
if (searchingForConversation) return; //This is to prevent finding the same thing twice.
|
||||||
if (p && p.isValid()) {
|
if (p && p.isValid()) {
|
||||||
openChatByPhone({ phone_num: p.formatInternational(), jobid: jobid });
|
openChatByPhone({ phone_num: p.formatInternational(), jobid: jobid });
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ import { useQuery } from "@apollo/client";
|
|||||||
import React from "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_ALL_ACTIVE_JOBS } from "../../graphql/jobs.queries";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import AlertComponent from "../alert/alert.component";
|
import AlertComponent from "../alert/alert.component";
|
||||||
import ContractJobsComponent from "./contract-jobs.component";
|
import ContractJobsComponent from "./contract-jobs.component";
|
||||||
import { QUERY_ALL_ACTIVE_JOBS } from "../../graphql/jobs.queries";
|
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
//currentUser: selectCurrentUser
|
//currentUser: selectCurrentUser
|
||||||
@@ -15,6 +15,7 @@ export function ContractJobsContainer({ selectedJobState, bodyshop }) {
|
|||||||
const { loading, error, data } = useQuery(QUERY_ALL_ACTIVE_JOBS, {
|
const { loading, error, data } = useQuery(QUERY_ALL_ACTIVE_JOBS, {
|
||||||
variables: {
|
variables: {
|
||||||
statuses: bodyshop.md_ro_statuses.active_statuses || ["Open"],
|
statuses: bodyshop.md_ro_statuses.active_statuses || ["Open"],
|
||||||
|
isConverted: true,
|
||||||
},
|
},
|
||||||
fetchPolicy: "network-only",
|
fetchPolicy: "network-only",
|
||||||
nextFetchPolicy: "network-only",
|
nextFetchPolicy: "network-only",
|
||||||
|
|||||||
@@ -4,14 +4,14 @@ import queryString from "query-string";
|
|||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Link, useHistory, useLocation } from "react-router-dom";
|
import { Link, useHistory, useLocation } from "react-router-dom";
|
||||||
|
import { setModalContext } from "../../redux/modals/modals.actions";
|
||||||
import { DateTimeFormatter } from "../../utils/DateFormatter";
|
import { DateTimeFormatter } from "../../utils/DateFormatter";
|
||||||
import { alphaSort } from "../../utils/sorters";
|
import { alphaSort } from "../../utils/sorters";
|
||||||
import ContractsFindModalContainer from "../contracts-find-modal/contracts-find-modal.container";
|
import ContractsFindModalContainer from "../contracts-find-modal/contracts-find-modal.container";
|
||||||
import { setModalContext } from "../../redux/modals/modals.actions";
|
|
||||||
|
|
||||||
|
import moment from "moment";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import moment from "moment";
|
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
|||||||
@@ -34,6 +34,18 @@ export default function CourtesyCarCreateFormComponent({ form, saveLoading }) {
|
|||||||
|
|
||||||
{/* <FormFieldsChanged form={form} /> */}
|
{/* <FormFieldsChanged form={form} /> */}
|
||||||
<LayoutFormRow header={t("courtesycars.labels.vehicle")}>
|
<LayoutFormRow header={t("courtesycars.labels.vehicle")}>
|
||||||
|
<Form.Item
|
||||||
|
label={t("courtesycars.fields.year")}
|
||||||
|
name="year"
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
//message: t("general.validation.required"),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<Input />
|
||||||
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("courtesycars.fields.make")}
|
label={t("courtesycars.fields.make")}
|
||||||
name="make"
|
name="make"
|
||||||
@@ -58,18 +70,6 @@ export default function CourtesyCarCreateFormComponent({ form, saveLoading }) {
|
|||||||
>
|
>
|
||||||
<Input />
|
<Input />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
|
||||||
label={t("courtesycars.fields.year")}
|
|
||||||
name="year"
|
|
||||||
rules={[
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
//message: t("general.validation.required"),
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
<Input />
|
|
||||||
</Form.Item>
|
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("courtesycars.fields.plate")}
|
label={t("courtesycars.fields.plate")}
|
||||||
name="plate"
|
name="plate"
|
||||||
@@ -118,7 +118,7 @@ export default function CourtesyCarCreateFormComponent({ form, saveLoading }) {
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<InputNumber precision={0} />
|
<InputNumber min={0} precision={0} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("courtesycars.fields.fleetnumber")}
|
label={t("courtesycars.fields.fleetnumber")}
|
||||||
@@ -213,49 +213,24 @@ export default function CourtesyCarCreateFormComponent({ form, saveLoading }) {
|
|||||||
>
|
>
|
||||||
<CourtesyCarStatus />
|
<CourtesyCarStatus />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
|
||||||
label={t("courtesycars.fields.nextservicekm")}
|
|
||||||
name="nextservicekm"
|
|
||||||
rules={[
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
//message: t("general.validation.required"),
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
<InputNumber />
|
|
||||||
</Form.Item>
|
|
||||||
<div>
|
<div>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("courtesycars.fields.nextservicedate")}
|
label={t("courtesycars.fields.nextservicekm")}
|
||||||
name="nextservicedate"
|
name="nextservicekm"
|
||||||
rules={[
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
//message: t("general.validation.required"),
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
>
|
>
|
||||||
<FormDatePicker />
|
<InputNumber min={0} precision={0} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
shouldUpdate={(p, c) =>
|
shouldUpdate={(p, c) =>
|
||||||
p.mileage !== c.mileage ||
|
p.mileage !== c.mileage || p.nextservicekm !== c.nextservicekm
|
||||||
p.nextservicedate !== c.nextservicedate ||
|
|
||||||
p.nextservicekm !== c.nextservicekm
|
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{() => {
|
{() => {
|
||||||
const nextservicedate = form.getFieldValue("nextservicedate");
|
|
||||||
const nextservicekm = form.getFieldValue("nextservicekm");
|
const nextservicekm = form.getFieldValue("nextservicekm");
|
||||||
|
|
||||||
const mileageOver =
|
const mileageOver =
|
||||||
nextservicekm <= form.getFieldValue("mileage");
|
nextservicekm <= form.getFieldValue("mileage");
|
||||||
|
|
||||||
const dueForService =
|
if (mileageOver)
|
||||||
nextservicedate && moment(nextservicedate).isBefore(moment());
|
|
||||||
|
|
||||||
if (mileageOver || dueForService)
|
|
||||||
return (
|
return (
|
||||||
<Space direction="vertical" style={{ color: "tomato" }}>
|
<Space direction="vertical" style={{ color: "tomato" }}>
|
||||||
<span>
|
<span>
|
||||||
@@ -263,6 +238,36 @@ export default function CourtesyCarCreateFormComponent({ form, saveLoading }) {
|
|||||||
{t("contracts.labels.cardueforservice")}
|
{t("contracts.labels.cardueforservice")}
|
||||||
</span>
|
</span>
|
||||||
<span>{`${nextservicekm} km`}</span>
|
<span>{`${nextservicekm} km`}</span>
|
||||||
|
</Space>
|
||||||
|
);
|
||||||
|
|
||||||
|
return <></>;
|
||||||
|
}}
|
||||||
|
</Form.Item>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<Form.Item
|
||||||
|
label={t("courtesycars.fields.nextservicedate")}
|
||||||
|
name="nextservicedate"
|
||||||
|
>
|
||||||
|
<FormDatePicker />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
shouldUpdate={(p, c) => p.nextservicedate !== c.nextservicedate}
|
||||||
|
>
|
||||||
|
{() => {
|
||||||
|
const nextservicedate = form.getFieldValue("nextservicedate");
|
||||||
|
const dueForService =
|
||||||
|
nextservicedate &&
|
||||||
|
moment(nextservicedate).endOf("day").isSameOrBefore(moment());
|
||||||
|
|
||||||
|
if (dueForService)
|
||||||
|
return (
|
||||||
|
<Space direction="vertical" style={{ color: "tomato" }}>
|
||||||
|
<span>
|
||||||
|
<WarningFilled style={{ marginRight: ".3rem" }} />
|
||||||
|
{t("contracts.labels.cardueforservice")}
|
||||||
|
</span>
|
||||||
<span>
|
<span>
|
||||||
<DateFormatter>{nextservicedate}</DateFormatter>
|
<DateFormatter>{nextservicedate}</DateFormatter>
|
||||||
</span>
|
</span>
|
||||||
@@ -283,12 +288,6 @@ export default function CourtesyCarCreateFormComponent({ form, saveLoading }) {
|
|||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("courtesycars.fields.registrationexpires")}
|
label={t("courtesycars.fields.registrationexpires")}
|
||||||
name="registrationexpires"
|
name="registrationexpires"
|
||||||
rules={[
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
//message: t("general.validation.required"),
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
>
|
>
|
||||||
<FormDatePicker />
|
<FormDatePicker />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
@@ -300,7 +299,8 @@ export default function CourtesyCarCreateFormComponent({ form, saveLoading }) {
|
|||||||
{() => {
|
{() => {
|
||||||
const expires = form.getFieldValue("registrationexpires");
|
const expires = form.getFieldValue("registrationexpires");
|
||||||
|
|
||||||
const dateover = expires && moment(expires).isBefore(moment());
|
const dateover =
|
||||||
|
expires && moment(expires).endOf("day").isBefore(moment());
|
||||||
|
|
||||||
if (dateover)
|
if (dateover)
|
||||||
return (
|
return (
|
||||||
@@ -330,14 +330,13 @@ export default function CourtesyCarCreateFormComponent({ form, saveLoading }) {
|
|||||||
<FormDatePicker />
|
<FormDatePicker />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
shouldUpdate={(p, c) =>
|
shouldUpdate={(p, c) => p.insuranceexpires !== c.insuranceexpires}
|
||||||
p.insuranceexpires !== c.insuranceexpires
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
{() => {
|
{() => {
|
||||||
const expires = form.getFieldValue("insuranceexpires");
|
const expires = form.getFieldValue("insuranceexpires");
|
||||||
|
|
||||||
const dateover = expires && moment(expires).isBefore(moment());
|
const dateover =
|
||||||
|
expires && moment(expires).endOf("day").isBefore(moment());
|
||||||
|
|
||||||
if (dateover)
|
if (dateover)
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -9,15 +9,15 @@ import {
|
|||||||
Table,
|
Table,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
} from "antd";
|
} from "antd";
|
||||||
|
import moment from "moment";
|
||||||
import React, { useState } from "react";
|
import React, { 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";
|
||||||
import { alphaSort } from "../../utils/sorters";
|
|
||||||
import { OwnerNameDisplayFunction } from "../owner-name-display/owner-name-display.component";
|
|
||||||
import moment from "moment";
|
|
||||||
import { GenerateDocument } from "../../utils/RenderTemplate";
|
import { GenerateDocument } from "../../utils/RenderTemplate";
|
||||||
import { TemplateList } from "../../utils/TemplateConstants";
|
import { TemplateList } from "../../utils/TemplateConstants";
|
||||||
|
import { alphaSort } from "../../utils/sorters";
|
||||||
|
import { OwnerNameDisplayFunction } from "../owner-name-display/owner-name-display.component";
|
||||||
export default function CourtesyCarsList({ loading, courtesycars, refetch }) {
|
export default function CourtesyCarsList({ loading, courtesycars, refetch }) {
|
||||||
const [state, setState] = useState({
|
const [state, setState] = useState({
|
||||||
sortedInfo: {},
|
sortedInfo: {},
|
||||||
@@ -115,6 +115,14 @@ export default function CourtesyCarsList({ loading, courtesycars, refetch }) {
|
|||||||
sortOrder:
|
sortOrder:
|
||||||
state.sortedInfo.columnKey === "model" && state.sortedInfo.order,
|
state.sortedInfo.columnKey === "model" && state.sortedInfo.order,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: t("courtesycars.fields.color"),
|
||||||
|
dataIndex: "color",
|
||||||
|
key: "color",
|
||||||
|
sorter: (a, b) => alphaSort(a.color, b.color),
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "color" && state.sortedInfo.order,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: t("courtesycars.fields.plate"),
|
title: t("courtesycars.fields.plate"),
|
||||||
dataIndex: "plate",
|
dataIndex: "plate",
|
||||||
@@ -166,6 +174,7 @@ export default function CourtesyCarsList({ loading, courtesycars, refetch }) {
|
|||||||
(c.year || "").toLowerCase().includes(searchText.toLowerCase()) ||
|
(c.year || "").toLowerCase().includes(searchText.toLowerCase()) ||
|
||||||
(c.make || "").toLowerCase().includes(searchText.toLowerCase()) ||
|
(c.make || "").toLowerCase().includes(searchText.toLowerCase()) ||
|
||||||
(c.model || "").toLowerCase().includes(searchText.toLowerCase()) ||
|
(c.model || "").toLowerCase().includes(searchText.toLowerCase()) ||
|
||||||
|
(c.plate || "").toLowerCase().includes(searchText.toLowerCase()) ||
|
||||||
(t(c.status) || "").toLowerCase().includes(searchText.toLowerCase())
|
(t(c.status) || "").toLowerCase().includes(searchText.toLowerCase())
|
||||||
)
|
)
|
||||||
: courtesycars;
|
: courtesycars;
|
||||||
|
|||||||
@@ -191,6 +191,13 @@ export function DmsPostForm({ bodyshop, socket, job, logsRef }) {
|
|||||||
>
|
>
|
||||||
<Switch />
|
<Switch />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
name="dms_model_override"
|
||||||
|
label={t("jobs.fields.dms.dms_model_override")}
|
||||||
|
initialValue={false}
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
</Space>
|
</Space>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ export function EmailOverlayContainer({
|
|||||||
]
|
]
|
||||||
: []),
|
: []),
|
||||||
],
|
],
|
||||||
media: selectedMedia.filter((m) => m.isSelected).map((m) => m.src),
|
media: selectedMedia.filter((m) => m.isSelected).map((m) => m.fullsize),
|
||||||
//attachments,
|
//attachments,
|
||||||
});
|
});
|
||||||
notification["success"]({ message: t("emails.successes.sent") });
|
notification["success"]({ message: t("emails.successes.sent") });
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ export default function GlobalSearchOs() {
|
|||||||
job.v_make_desc || ""
|
job.v_make_desc || ""
|
||||||
} ${job.v_model_desc || ""}`}</span>
|
} ${job.v_model_desc || ""}`}</span>
|
||||||
<span>{`${job.clm_no || ""}`}</span>
|
<span>{`${job.clm_no || ""}`}</span>
|
||||||
|
<span>{`${job.plate_no || ""}`}</span>
|
||||||
</Space>
|
</Space>
|
||||||
</Link>
|
</Link>
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import {
|
|||||||
Divider,
|
Divider,
|
||||||
Dropdown,
|
Dropdown,
|
||||||
Form,
|
Form,
|
||||||
|
Input,
|
||||||
Menu,
|
Menu,
|
||||||
notification,
|
notification,
|
||||||
Popover,
|
Popover,
|
||||||
@@ -34,6 +35,8 @@ import ScheduleManualEvent from "../schedule-manual-event/schedule-manual-event.
|
|||||||
import ScheduleAtChange from "./job-at-change.component";
|
import ScheduleAtChange from "./job-at-change.component";
|
||||||
import ScheduleEventColor from "./schedule-event.color.component";
|
import ScheduleEventColor from "./schedule-event.color.component";
|
||||||
import ScheduleEventNote from "./schedule-event.note.component";
|
import ScheduleEventNote from "./schedule-event.note.component";
|
||||||
|
import { useMutation } from "@apollo/client";
|
||||||
|
import { UPDATE_APPOINTMENT } from "../../graphql/appointments.queries";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -58,16 +61,44 @@ export function ScheduleEventComponent({
|
|||||||
const [visible, setVisible] = useState(false);
|
const [visible, setVisible] = useState(false);
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
const searchParams = queryString.parse(useLocation().search);
|
const searchParams = queryString.parse(useLocation().search);
|
||||||
|
const [updateAppointment] = useMutation(UPDATE_APPOINTMENT);
|
||||||
|
const [title, setTitle] = useState(event.title);
|
||||||
const blockContent = (
|
const blockContent = (
|
||||||
<div>
|
<Space direction="vertical" wrap>
|
||||||
|
<Input
|
||||||
|
value={title}
|
||||||
|
onChange={(e) => setTitle(e.currentTarget.value)}
|
||||||
|
onBlur={async () => {
|
||||||
|
await updateAppointment({
|
||||||
|
variables: {
|
||||||
|
appid: event.id,
|
||||||
|
app: {
|
||||||
|
title: title,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
optimisticResponse: {
|
||||||
|
update_appointments: {
|
||||||
|
__typename: "appointments_mutation_response",
|
||||||
|
returning: [
|
||||||
|
{
|
||||||
|
...event,
|
||||||
|
title: title,
|
||||||
|
__typename: "appointments",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
onClick={() => handleCancel({ id: event.id })}
|
onClick={() => handleCancel({ id: event.id })}
|
||||||
disabled={event.arrived}
|
disabled={event.arrived}
|
||||||
>
|
>
|
||||||
{t("appointments.actions.cancel")}
|
{t("appointments.actions.unblock")}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</Space>
|
||||||
);
|
);
|
||||||
|
|
||||||
const popoverContent = (
|
const popoverContent = (
|
||||||
|
|||||||
@@ -2,12 +2,16 @@ import { useMutation } from "@apollo/client";
|
|||||||
import { notification } from "antd";
|
import { notification } from "antd";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { useDispatch } from "react-redux";
|
||||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||||
import { CANCEL_APPOINTMENT_BY_ID } from "../../graphql/appointments.queries";
|
import { CANCEL_APPOINTMENT_BY_ID } from "../../graphql/appointments.queries";
|
||||||
import { UPDATE_JOB } from "../../graphql/jobs.queries";
|
import { UPDATE_JOB } from "../../graphql/jobs.queries";
|
||||||
|
import { insertAuditTrail } from "../../redux/application/application.actions";
|
||||||
|
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
||||||
import ScheduleEventComponent from "./schedule-event.component";
|
import ScheduleEventComponent from "./schedule-event.component";
|
||||||
|
|
||||||
export default function ScheduleEventContainer({ bodyshop, event, refetch }) {
|
export default function ScheduleEventContainer({ bodyshop, event, refetch }) {
|
||||||
|
const dispatch = useDispatch();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [cancelAppointment] = useMutation(CANCEL_APPOINTMENT_BY_ID);
|
const [cancelAppointment] = useMutation(CANCEL_APPOINTMENT_BY_ID);
|
||||||
const [updateJob] = useMutation(UPDATE_JOB);
|
const [updateJob] = useMutation(UPDATE_JOB);
|
||||||
@@ -34,16 +38,24 @@ export default function ScheduleEventContainer({ bodyshop, event, refetch }) {
|
|||||||
const jobUpdate = await updateJob({
|
const jobUpdate = await updateJob({
|
||||||
variables: {
|
variables: {
|
||||||
jobId: event.job.id,
|
jobId: event.job.id,
|
||||||
|
|
||||||
job: {
|
job: {
|
||||||
date_scheduled: null,
|
date_scheduled: null,
|
||||||
scheduled_in: null,
|
scheduled_in: null,
|
||||||
scheduled_completion: null,
|
scheduled_completion: null,
|
||||||
lost_sale_reason,
|
lost_sale_reason,
|
||||||
|
date_lost_sale: new Date(),
|
||||||
status: bodyshop.md_ro_statuses.default_imported,
|
status: bodyshop.md_ro_statuses.default_imported,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
if (!jobUpdate.errors) {
|
||||||
|
dispatch(
|
||||||
|
insertAuditTrail({
|
||||||
|
jobid: event.job.id,
|
||||||
|
operation: AuditTrailMapping.appointmentcancel(lost_sale_reason),
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
if (!!jobUpdate.errors) {
|
if (!!jobUpdate.errors) {
|
||||||
notification["error"]({
|
notification["error"]({
|
||||||
message: t("jobs.errors.updating", {
|
message: t("jobs.errors.updating", {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
import { Button, Card, Form, Input, notification, Switch } from "antd";
|
import { Button, Card, Form, Input, notification, Switch } from "antd";
|
||||||
|
import moment from "moment-business-days";
|
||||||
import queryString from "query-string";
|
import queryString from "query-string";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
@@ -12,16 +13,15 @@ import {
|
|||||||
MARK_LATEST_APPOINTMENT_ARRIVED,
|
MARK_LATEST_APPOINTMENT_ARRIVED,
|
||||||
} from "../../../../graphql/appointments.queries";
|
} from "../../../../graphql/appointments.queries";
|
||||||
import { UPDATE_JOB } from "../../../../graphql/jobs.queries";
|
import { UPDATE_JOB } from "../../../../graphql/jobs.queries";
|
||||||
|
import { UPDATE_OWNER } from "../../../../graphql/owners.queries";
|
||||||
|
import { insertAuditTrail } from "../../../../redux/application/application.actions";
|
||||||
import {
|
import {
|
||||||
selectBodyshop,
|
selectBodyshop,
|
||||||
selectCurrentUser,
|
selectCurrentUser,
|
||||||
} from "../../../../redux/user/user.selectors";
|
} from "../../../../redux/user/user.selectors";
|
||||||
|
import AuditTrailMapping from "../../../../utils/AuditTrailMappings";
|
||||||
import ConfigFormComponents from "../../../config-form-components/config-form-components.component";
|
import ConfigFormComponents from "../../../config-form-components/config-form-components.component";
|
||||||
import DateTimePicker from "../../../form-date-time-picker/form-date-time-picker.component";
|
import DateTimePicker from "../../../form-date-time-picker/form-date-time-picker.component";
|
||||||
import moment from "moment-business-days";
|
|
||||||
import { insertAuditTrail } from "../../../../redux/application/application.actions";
|
|
||||||
import AuditTrailMapping from "../../../../utils/AuditTrailMappings";
|
|
||||||
import { UPDATE_OWNER } from "../../../../graphql/owners.queries";
|
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -230,6 +230,7 @@ export function JobChecklistForm({
|
|||||||
)),
|
)),
|
||||||
scheduled_delivery:
|
scheduled_delivery:
|
||||||
job.scheduled_delivery && moment(job.scheduled_delivery),
|
job.scheduled_delivery && moment(job.scheduled_delivery),
|
||||||
|
production_vars: job.production_vars,
|
||||||
}),
|
}),
|
||||||
...(type === "deliver" && {
|
...(type === "deliver" && {
|
||||||
removeFromProduction: true,
|
removeFromProduction: true,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
import { useMutation } from "@apollo/client";
|
||||||
import { notification, Select } from "antd";
|
import { notification, Select } from "antd";
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { useMutation } from "@apollo/client";
|
|
||||||
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";
|
||||||
@@ -56,8 +56,10 @@ export function JobLineLocationPopup({ bodyshop, jobline, disabled }) {
|
|||||||
<LoadingSpinner loading={loading}>
|
<LoadingSpinner loading={loading}>
|
||||||
<Select
|
<Select
|
||||||
autoFocus
|
autoFocus
|
||||||
|
allowClear
|
||||||
dropdownMatchSelectWidth={100}
|
dropdownMatchSelectWidth={100}
|
||||||
value={location}
|
value={location}
|
||||||
|
onClear={() => setLocation(null)}
|
||||||
onSelect={handleChange}
|
onSelect={handleChange}
|
||||||
onBlur={handleSave}
|
onBlur={handleSave}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ export default function JobLinesBillRefernece({ jobline }) {
|
|||||||
return (
|
return (
|
||||||
<div style={{ color: subletRequired && "tomato" }}>
|
<div style={{ color: subletRequired && "tomato" }}>
|
||||||
{subletRequired && <WarningFilled />}
|
{subletRequired && <WarningFilled />}
|
||||||
{`${(billLine.actual_price * billLine.quantity).toFixed(2)} (${
|
{`${billLine.actual_price.toFixed(2)} x ${billLine.quantity} (${
|
||||||
billLine.bill.vendor.name
|
billLine.bill.vendor.name
|
||||||
} #${billLine.bill.invoice_number})`}
|
} #${billLine.bill.invoice_number})`}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -33,7 +33,9 @@ const JobSearchSelect = (
|
|||||||
useLazyQuery(SEARCH_JOBS_BY_ID_FOR_AUTOCOMPLETE);
|
useLazyQuery(SEARCH_JOBS_BY_ID_FOR_AUTOCOMPLETE);
|
||||||
|
|
||||||
const executeSearch = (v) => {
|
const executeSearch = (v) => {
|
||||||
if (v && v !== "") callSearch(v);
|
console.log(v);
|
||||||
|
if (v && v.variables?.search !== "" && v.variables.search.length >= 2)
|
||||||
|
callSearch(v);
|
||||||
};
|
};
|
||||||
const debouncedExecuteSearch = _.debounce(executeSearch, 500);
|
const debouncedExecuteSearch = _.debounce(executeSearch, 500);
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
|||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { insertAuditTrail } from "../../redux/application/application.actions";
|
import { insertAuditTrail } from "../../redux/application/application.actions";
|
||||||
|
import { DateTimeFormat } from "./../../utils/DateFormatter";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
//currentUser: selectCurrentUser
|
//currentUser: selectCurrentUser
|
||||||
@@ -53,7 +54,7 @@ export function JobsAdminDatesChange({ insertAuditTrail, job }) {
|
|||||||
operation: AuditTrailMapping.admin_jobfieldchange(
|
operation: AuditTrailMapping.admin_jobfieldchange(
|
||||||
key,
|
key,
|
||||||
changedAuditFields[key] instanceof moment
|
changedAuditFields[key] instanceof moment
|
||||||
? moment(changedAuditFields[key]).format("MM/DD/YYYY hh:mm a")
|
? DateTimeFormat(changedAuditFields[key])
|
||||||
: changedAuditFields[key]
|
: changedAuditFields[key]
|
||||||
),
|
),
|
||||||
});
|
});
|
||||||
@@ -179,6 +180,12 @@ export function JobsAdminDatesChange({ insertAuditTrail, job }) {
|
|||||||
<Form.Item label={t("jobs.fields.date_void")} name="date_void">
|
<Form.Item label={t("jobs.fields.date_void")} name="date_void">
|
||||||
<DateTimePicker />
|
<DateTimePicker />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.date_lost_sale")}
|
||||||
|
name="date_lost_sale"
|
||||||
|
>
|
||||||
|
<DateTimePicker />
|
||||||
|
</Form.Item>
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
</Form>
|
</Form>
|
||||||
|
|
||||||
|
|||||||
@@ -73,6 +73,8 @@ export function JobsAvailableContainer({
|
|||||||
|
|
||||||
const [selectedJob, setSelectedJob] = useState(null);
|
const [selectedJob, setSelectedJob] = useState(null);
|
||||||
const [selectedOwner, setSelectedOwner] = useState(null);
|
const [selectedOwner, setSelectedOwner] = useState(null);
|
||||||
|
const [partsQueueToggle, setPartsQueueToggle] = useState(bodyshop.md_functionality_toggles.parts_queue_toggle);
|
||||||
|
|
||||||
const [insertLoading, setInsertLoading] = useState(false);
|
const [insertLoading, setInsertLoading] = useState(false);
|
||||||
|
|
||||||
const [insertNote] = useMutation(INSERT_NEW_NOTE);
|
const [insertNote] = useMutation(INSERT_NEW_NOTE);
|
||||||
@@ -94,6 +96,7 @@ export function JobsAvailableContainer({
|
|||||||
logImEXEvent("job_import_new");
|
logImEXEvent("job_import_new");
|
||||||
|
|
||||||
setOwnerModalVisible(false);
|
setOwnerModalVisible(false);
|
||||||
|
|
||||||
setInsertLoading(true);
|
setInsertLoading(true);
|
||||||
|
|
||||||
const estData = replaceEmpty(estDataRaw.data.available_jobs_by_pk);
|
const estData = replaceEmpty(estDataRaw.data.available_jobs_by_pk);
|
||||||
@@ -120,7 +123,7 @@ export function JobsAvailableContainer({
|
|||||||
|
|
||||||
let existingVehicles;
|
let existingVehicles;
|
||||||
if (estData.est_data.v_vin) {
|
if (estData.est_data.v_vin) {
|
||||||
//There's vehicle data, need to double check the VIN.
|
//There's vehicle data, need to double-check the VIN.
|
||||||
existingVehicles = await client.query({
|
existingVehicles = await client.query({
|
||||||
query: SEARCH_VEHICLE_BY_VIN,
|
query: SEARCH_VEHICLE_BY_VIN,
|
||||||
variables: {
|
variables: {
|
||||||
@@ -143,7 +146,7 @@ export function JobsAvailableContainer({
|
|||||||
text: t("jobs.labels.importnote"),
|
text: t("jobs.labels.importnote"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
queued_for_parts: true,
|
queued_for_parts: partsQueueToggle,
|
||||||
...(existingVehicles && existingVehicles.data.vehicles.length > 0
|
...(existingVehicles && existingVehicles.data.vehicles.length > 0
|
||||||
? { vehicleid: existingVehicles.data.vehicles[0].id, vehicle: null }
|
? { vehicleid: existingVehicles.data.vehicles[0].id, vehicle: null }
|
||||||
: {}),
|
: {}),
|
||||||
@@ -157,46 +160,51 @@ export function JobsAvailableContainer({
|
|||||||
delete newJob.vehicle;
|
delete newJob.vehicle;
|
||||||
}
|
}
|
||||||
|
|
||||||
insertNewJob({
|
try {
|
||||||
variables: {
|
const r = await insertNewJob({
|
||||||
job: newJob,
|
variables: {
|
||||||
},
|
job: newJob,
|
||||||
})
|
},
|
||||||
.then((r) => {
|
});
|
||||||
if (CriticalPartsScanning.treatment === "on") {
|
|
||||||
CriticalPartsScan(r.data.insert_jobs.returning[0].id);
|
|
||||||
}
|
|
||||||
notification["success"]({
|
|
||||||
message: t("jobs.successes.created"),
|
|
||||||
onClick: () => {
|
|
||||||
history.push(`/manage/jobs/${r.data.insert_jobs.returning[0].id}`);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
//Job has been inserted. Clean up the available jobs record.
|
|
||||||
|
|
||||||
insertAuditTrail({
|
if (CriticalPartsScanning.treatment === "on") {
|
||||||
jobid: r.data.insert_jobs.returning[0].id,
|
CriticalPartsScan(r.data.insert_jobs.returning[0].id);
|
||||||
operation: AuditTrailMapping.jobimported(),
|
}
|
||||||
});
|
|
||||||
|
|
||||||
deleteJob({
|
notification["success"]({
|
||||||
variables: { id: estData.id },
|
message: t("jobs.successes.created"),
|
||||||
}).then((r) => {
|
onClick: () => {
|
||||||
refetch();
|
history.push(`/manage/jobs/${r.data.insert_jobs.returning[0].id}`);
|
||||||
setInsertLoading(false);
|
},
|
||||||
});
|
});
|
||||||
})
|
//Job has been inserted. Clean up the available jobs record.
|
||||||
.catch((r) => {
|
|
||||||
//error while inserting
|
insertAuditTrail({
|
||||||
notification["error"]({
|
jobid: r.data.insert_jobs.returning[0].id,
|
||||||
message: t("jobs.errors.creating", { error: r.message }),
|
operation: AuditTrailMapping.jobimported(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
deleteJob({
|
||||||
|
variables: { id: estData.id },
|
||||||
|
}).then((r) => {
|
||||||
refetch();
|
refetch();
|
||||||
setInsertLoading(false);
|
setInsertLoading(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
setPartsQueueToggle(bodyshop.md_functionality_toggles.parts_queue_toggle);
|
||||||
|
} catch (err) {
|
||||||
|
//error while inserting
|
||||||
|
notification["error"]({
|
||||||
|
message: t("jobs.errors.creating", { error: err.message }),
|
||||||
|
});
|
||||||
|
refetch().catch(e => {console.error(`Something went wrong in jobs available table container - ${err.message || ''}`)});
|
||||||
|
setInsertLoading(false);
|
||||||
|
setPartsQueueToggle(bodyshop.md_functionality_toggles.parts_queue_toggle);
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//Suplement scenario
|
//Supplement scenario
|
||||||
const onJobFindModalOk = async () => {
|
const onJobFindModalOk = async () => {
|
||||||
logImEXEvent("job_import_supplement");
|
logImEXEvent("job_import_supplement");
|
||||||
|
|
||||||
@@ -248,11 +256,14 @@ export function JobsAvailableContainer({
|
|||||||
// "0.00"
|
// "0.00"
|
||||||
// ),
|
// ),
|
||||||
// job_totals: newTotals,
|
// job_totals: newTotals,
|
||||||
// queued_for_parts: true,
|
queued_for_parts: partsQueueToggle,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (CriticalPartsScanning.treatment === "on") {
|
|
||||||
|
setPartsQueueToggle(bodyshop.md_functionality_toggles.parts_queue_toggle);
|
||||||
|
|
||||||
|
if (CriticalPartsScanning.treatment === "on") {
|
||||||
CriticalPartsScan(updateResult.data.update_jobs.returning[0].id);
|
CriticalPartsScan(updateResult.data.update_jobs.returning[0].id);
|
||||||
}
|
}
|
||||||
if (updateResult.errors) {
|
if (updateResult.errors) {
|
||||||
@@ -327,12 +338,14 @@ export function JobsAvailableContainer({
|
|||||||
const onOwnerModalCancel = () => {
|
const onOwnerModalCancel = () => {
|
||||||
setOwnerModalVisible(false);
|
setOwnerModalVisible(false);
|
||||||
setSelectedOwner(null);
|
setSelectedOwner(null);
|
||||||
|
setPartsQueueToggle(bodyshop.md_functionality_toggles.parts_queue_toggle);
|
||||||
};
|
};
|
||||||
|
|
||||||
const onJobModalCancel = () => {
|
const onJobModalCancel = () => {
|
||||||
setJobModalVisible(false);
|
setJobModalVisible(false);
|
||||||
modalSearchState[1]("");
|
modalSearchState[1]("");
|
||||||
setSelectedJob(null);
|
setSelectedJob(null);
|
||||||
|
setPartsQueueToggle(bodyshop.md_functionality_toggles.parts_queue_toggle);
|
||||||
};
|
};
|
||||||
|
|
||||||
const addJobAsNew = (record) => {
|
const addJobAsNew = (record) => {
|
||||||
@@ -353,6 +366,8 @@ export function JobsAvailableContainer({
|
|||||||
}, [addJobAsSupp, availableJobId, clm_no]);
|
}, [addJobAsSupp, availableJobId, clm_no]);
|
||||||
|
|
||||||
if (error) return <AlertComponent type="error" message={error.message} />;
|
if (error) return <AlertComponent type="error" message={error.message} />;
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<LoadingSpinner
|
<LoadingSpinner
|
||||||
loading={insertLoading}
|
loading={insertLoading}
|
||||||
@@ -362,11 +377,14 @@ export function JobsAvailableContainer({
|
|||||||
loading={estDataRaw.loading}
|
loading={estDataRaw.loading}
|
||||||
error={estDataRaw.error}
|
error={estDataRaw.error}
|
||||||
owner={owner}
|
owner={owner}
|
||||||
|
partsQueueToggle={partsQueueToggle}
|
||||||
|
setPartsQueueToggle={setPartsQueueToggle}
|
||||||
selectedOwner={selectedOwner}
|
selectedOwner={selectedOwner}
|
||||||
setSelectedOwner={setSelectedOwner}
|
setSelectedOwner={setSelectedOwner}
|
||||||
visible={ownerModalVisible}
|
visible={ownerModalVisible}
|
||||||
onOk={onOwnerFindModalOk}
|
onOk={onOwnerFindModalOk}
|
||||||
onCancel={onOwnerModalCancel}
|
onCancel={onOwnerModalCancel}
|
||||||
|
|
||||||
/>
|
/>
|
||||||
<JobsFindModalContainer
|
<JobsFindModalContainer
|
||||||
loading={estDataRaw.loading}
|
loading={estDataRaw.loading}
|
||||||
@@ -378,6 +396,8 @@ export function JobsAvailableContainer({
|
|||||||
onOk={onJobFindModalOk}
|
onOk={onJobFindModalOk}
|
||||||
onCancel={onJobModalCancel}
|
onCancel={onJobModalCancel}
|
||||||
modalSearchState={modalSearchState}
|
modalSearchState={modalSearchState}
|
||||||
|
partsQueueToggle={partsQueueToggle}
|
||||||
|
setPartsQueueToggle={setPartsQueueToggle}
|
||||||
/>
|
/>
|
||||||
<Row gutter={[16, 16]}>
|
<Row gutter={[16, 16]}>
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ export function JobsConvertButton({
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<Select>
|
<Select showSearch>
|
||||||
{bodyshop.md_ins_cos.map((s, i) => (
|
{bodyshop.md_ins_cos.map((s, i) => (
|
||||||
<Select.Option key={i} value={s.name}>
|
<Select.Option key={i} value={s.name}>
|
||||||
{s.name}
|
{s.name}
|
||||||
|
|||||||
@@ -145,6 +145,13 @@ export function JobsDetailDatesComponent({ jobRO, job, bodyshop }) {
|
|||||||
<Form.Item label={t("jobs.fields.date_void")} name="date_void">
|
<Form.Item label={t("jobs.fields.date_void")} name="date_void">
|
||||||
<DateTimePicker disabled={true || jobRO} />
|
<DateTimePicker disabled={true || jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.date_lost_sale")}
|
||||||
|
name="date_lost_sale"
|
||||||
|
>
|
||||||
|
<DateTimePicker disabled={true || jobRO} />
|
||||||
|
</Form.Item>
|
||||||
</FormRow>
|
</FormRow>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -18,12 +18,14 @@ import { createStructuredSelector } from "reselect";
|
|||||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||||
import { CANCEL_APPOINTMENTS_BY_JOB_ID } from "../../graphql/appointments.queries";
|
import { CANCEL_APPOINTMENTS_BY_JOB_ID } from "../../graphql/appointments.queries";
|
||||||
import { DELETE_JOB, UPDATE_JOB, VOID_JOB } from "../../graphql/jobs.queries";
|
import { DELETE_JOB, UPDATE_JOB, VOID_JOB } from "../../graphql/jobs.queries";
|
||||||
|
import { insertAuditTrail } from "../../redux/application/application.actions";
|
||||||
import { selectJobReadOnly } from "../../redux/application/application.selectors";
|
import { selectJobReadOnly } from "../../redux/application/application.selectors";
|
||||||
import { setModalContext } from "../../redux/modals/modals.actions";
|
import { setModalContext } from "../../redux/modals/modals.actions";
|
||||||
import {
|
import {
|
||||||
selectBodyshop,
|
selectBodyshop,
|
||||||
selectCurrentUser,
|
selectCurrentUser,
|
||||||
} from "../../redux/user/user.selectors";
|
} from "../../redux/user/user.selectors";
|
||||||
|
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
||||||
import RbacWrapper from "../rbac-wrapper/rbac-wrapper.component";
|
import RbacWrapper from "../rbac-wrapper/rbac-wrapper.component";
|
||||||
import JobsDetailHeaderActionsAddevent from "./jobs-detail-header-actions.addevent";
|
import JobsDetailHeaderActionsAddevent from "./jobs-detail-header-actions.addevent";
|
||||||
import AddToProduction from "./jobs-detail-header-actions.addtoproduction.util";
|
import AddToProduction from "./jobs-detail-header-actions.addtoproduction.util";
|
||||||
@@ -50,6 +52,8 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
dispatch(setModalContext({ context: context, modal: "timeTicket" })),
|
dispatch(setModalContext({ context: context, modal: "timeTicket" })),
|
||||||
setCardPaymentContext: (context) =>
|
setCardPaymentContext: (context) =>
|
||||||
dispatch(setModalContext({ context: context, modal: "cardPayment" })),
|
dispatch(setModalContext({ context: context, modal: "cardPayment" })),
|
||||||
|
insertAuditTrail: ({ jobid, operation }) =>
|
||||||
|
dispatch(insertAuditTrail({ jobid, operation })),
|
||||||
});
|
});
|
||||||
|
|
||||||
export function JobsDetailHeaderActions({
|
export function JobsDetailHeaderActions({
|
||||||
@@ -64,6 +68,7 @@ export function JobsDetailHeaderActions({
|
|||||||
jobRO,
|
jobRO,
|
||||||
setTimeTicketContext,
|
setTimeTicketContext,
|
||||||
setCardPaymentContext,
|
setCardPaymentContext,
|
||||||
|
insertAuditTrail,
|
||||||
}) {
|
}) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const client = useApolloClient();
|
const client = useApolloClient();
|
||||||
@@ -158,6 +163,7 @@ export function JobsDetailHeaderActions({
|
|||||||
scheduled_in: null,
|
scheduled_in: null,
|
||||||
scheduled_completion: null,
|
scheduled_completion: null,
|
||||||
lost_sale_reason,
|
lost_sale_reason,
|
||||||
|
date_lost_sale: new Date(),
|
||||||
status: bodyshop.md_ro_statuses.default_imported,
|
status: bodyshop.md_ro_statuses.default_imported,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -166,6 +172,11 @@ export function JobsDetailHeaderActions({
|
|||||||
notification["success"]({
|
notification["success"]({
|
||||||
message: t("appointments.successes.canceled"),
|
message: t("appointments.successes.canceled"),
|
||||||
});
|
});
|
||||||
|
insertAuditTrail({
|
||||||
|
jobid: job.id,
|
||||||
|
operation:
|
||||||
|
AuditTrailMapping.appointmentcancel(lost_sale_reason),
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ export default async function DuplicateJob(
|
|||||||
delete existingJob.id;
|
delete existingJob.id;
|
||||||
delete existingJob.createdat;
|
delete existingJob.createdat;
|
||||||
delete existingJob.updatedat;
|
delete existingJob.updatedat;
|
||||||
|
delete existingJob.cieca_stl;
|
||||||
|
delete existingJob.cieca_ttl;
|
||||||
|
|
||||||
const newJob = {
|
const newJob = {
|
||||||
...existingJob,
|
...existingJob,
|
||||||
@@ -81,6 +83,8 @@ export async function CreateIouForJob(
|
|||||||
delete existingJob.id;
|
delete existingJob.id;
|
||||||
delete existingJob.createdat;
|
delete existingJob.createdat;
|
||||||
delete existingJob.updatedat;
|
delete existingJob.updatedat;
|
||||||
|
delete existingJob.cieca_stl;
|
||||||
|
delete existingJob.cieca_ttl;
|
||||||
|
|
||||||
const newJob = {
|
const newJob = {
|
||||||
...existingJob,
|
...existingJob,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useEffect } from "react";
|
import React, { useEffect } from "react";
|
||||||
import { Gallery } from "react-grid-gallery";
|
import { Gallery } from "react-grid-gallery";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { GenerateThumbUrl } from "./job-documents.utility";
|
import { GenerateSrcUrl, GenerateThumbUrl } from "./job-documents.utility";
|
||||||
|
|
||||||
function JobsDocumentGalleryExternal({
|
function JobsDocumentGalleryExternal({
|
||||||
data,
|
data,
|
||||||
@@ -15,7 +15,7 @@ function JobsDocumentGalleryExternal({
|
|||||||
let documents = data.reduce((acc, value) => {
|
let documents = data.reduce((acc, value) => {
|
||||||
if (value.type.startsWith("image")) {
|
if (value.type.startsWith("image")) {
|
||||||
acc.push({
|
acc.push({
|
||||||
//src: GenerateSrcUrl(value),
|
fullsize: GenerateSrcUrl(value),
|
||||||
src: GenerateThumbUrl(value),
|
src: GenerateThumbUrl(value),
|
||||||
thumbnailHeight: 225,
|
thumbnailHeight: 225,
|
||||||
thumbnailWidth: 225,
|
thumbnailWidth: 225,
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ function JobDocumentsLocalGalleryExternal({
|
|||||||
val.type.mime &&
|
val.type.mime &&
|
||||||
val.type.mime.startsWith("image")
|
val.type.mime.startsWith("image")
|
||||||
) {
|
) {
|
||||||
acc.push({ ...val, src: val.thumbnail });
|
acc.push({ ...val, src: val.thumbnail, fullsize: val.src });
|
||||||
}
|
}
|
||||||
return acc;
|
return acc;
|
||||||
}, [])
|
}, [])
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ export default function JobsFindModalComponent({
|
|||||||
importOptionsState,
|
importOptionsState,
|
||||||
modalSearchState,
|
modalSearchState,
|
||||||
jobsListRefetch,
|
jobsListRefetch,
|
||||||
|
partsQueueToggle,
|
||||||
|
setPartsQueueToggle,
|
||||||
}) {
|
}) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [modalSearch, setModalSearch] = modalSearchState;
|
const [modalSearch, setModalSearch] = modalSearchState;
|
||||||
@@ -199,6 +201,12 @@ export default function JobsFindModalComponent({
|
|||||||
>
|
>
|
||||||
{t("jobs.labels.override_header")}
|
{t("jobs.labels.override_header")}
|
||||||
</Checkbox>
|
</Checkbox>
|
||||||
|
<Checkbox
|
||||||
|
checked={partsQueueToggle}
|
||||||
|
onChange={(e) => setPartsQueueToggle(e.target.checked)}
|
||||||
|
>
|
||||||
|
{t("bodyshop.fields.md_functionality_toggles.parts_queue_toggle")}
|
||||||
|
</Checkbox>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ export default connect(
|
|||||||
setSelectedJob,
|
setSelectedJob,
|
||||||
importOptionsState,
|
importOptionsState,
|
||||||
modalSearchState,
|
modalSearchState,
|
||||||
|
partsQueueToggle,
|
||||||
|
setPartsQueueToggle,
|
||||||
...modalProps
|
...modalProps
|
||||||
}) {
|
}) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@@ -91,6 +93,8 @@ export default connect(
|
|||||||
jobsListRefetch={jobsList.refetch}
|
jobsListRefetch={jobsList.refetch}
|
||||||
jobsList={jobsData}
|
jobsList={jobsData}
|
||||||
modalSearchState={modalSearchState}
|
modalSearchState={modalSearchState}
|
||||||
|
partsQueueToggle={partsQueueToggle}
|
||||||
|
setPartsQueueToggle={setPartsQueueToggle}
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import {
|
import {
|
||||||
|
BranchesOutlined,
|
||||||
ExclamationCircleFilled,
|
ExclamationCircleFilled,
|
||||||
PauseCircleOutlined,
|
PauseCircleOutlined,
|
||||||
SyncOutlined,
|
SyncOutlined,
|
||||||
BranchesOutlined,
|
|
||||||
} from "@ant-design/icons";
|
} from "@ant-design/icons";
|
||||||
import { useQuery } from "@apollo/client";
|
import { useQuery } from "@apollo/client";
|
||||||
import { Button, Card, Grid, Input, Space, Table, Tooltip } from "antd";
|
import { Button, Card, Grid, Input, Space, Table, Tooltip } from "antd";
|
||||||
@@ -14,8 +14,8 @@ import { Link, useHistory, useLocation } from "react-router-dom";
|
|||||||
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";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import { onlyUnique } from "../../utils/arrayHelper";
|
|
||||||
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
||||||
|
import { onlyUnique } from "../../utils/arrayHelper";
|
||||||
import { alphaSort } from "../../utils/sorters";
|
import { alphaSort } from "../../utils/sorters";
|
||||||
import AlertComponent from "../alert/alert.component";
|
import AlertComponent from "../alert/alert.component";
|
||||||
import ChatOpenButton from "../chat-open-button/chat-open-button.component";
|
import ChatOpenButton from "../chat-open-button/chat-open-button.component";
|
||||||
@@ -46,6 +46,7 @@ export function JobsReadyList({ bodyshop }) {
|
|||||||
const { loading, error, data, refetch } = useQuery(QUERY_ALL_ACTIVE_JOBS, {
|
const { loading, error, data, refetch } = useQuery(QUERY_ALL_ACTIVE_JOBS, {
|
||||||
variables: {
|
variables: {
|
||||||
statuses: readyStatuses,
|
statuses: readyStatuses,
|
||||||
|
isConverted: true,
|
||||||
},
|
},
|
||||||
fetchPolicy: "network-only",
|
fetchPolicy: "network-only",
|
||||||
nextFetchPolicy: "network-only",
|
nextFetchPolicy: "network-only",
|
||||||
|
|||||||
@@ -231,7 +231,14 @@ export function LaborAllocationsTable({
|
|||||||
{summary.adjustments.toFixed(1)}
|
{summary.adjustments.toFixed(1)}
|
||||||
</Table.Summary.Cell>
|
</Table.Summary.Cell>
|
||||||
<Table.Summary.Cell>
|
<Table.Summary.Cell>
|
||||||
{summary.difference.toFixed(1)}
|
<Typography.Text
|
||||||
|
style={{
|
||||||
|
fontWeight: "bold",
|
||||||
|
color: summary.difference >= 0 ? "green" : "red",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{summary.difference.toFixed(1)}
|
||||||
|
</Typography.Text>
|
||||||
</Table.Summary.Cell>
|
</Table.Summary.Cell>
|
||||||
</Table.Summary.Row>
|
</Table.Summary.Row>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -8,10 +8,11 @@ export default function OwnerFindModalComponent({
|
|||||||
setSelectedOwner,
|
setSelectedOwner,
|
||||||
ownersListLoading,
|
ownersListLoading,
|
||||||
ownersList,
|
ownersList,
|
||||||
|
partsQueueToggle,
|
||||||
|
setPartsQueueToggle,
|
||||||
}) {
|
}) {
|
||||||
//setSelectedOwner is used to set the record id of the owner to use for adding the job.
|
//setSelectedOwner is used to set the record id of the owner to use for adding the job.
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
title: t("owners.fields.ownr_ln"),
|
title: t("owners.fields.ownr_ln"),
|
||||||
@@ -109,6 +110,12 @@ export default function OwnerFindModalComponent({
|
|||||||
>
|
>
|
||||||
{t("owners.labels.create_new")}
|
{t("owners.labels.create_new")}
|
||||||
</Checkbox>
|
</Checkbox>
|
||||||
|
<Checkbox
|
||||||
|
checked={partsQueueToggle}
|
||||||
|
onChange={(e) => setPartsQueueToggle(e.target.checked)}
|
||||||
|
>
|
||||||
|
{t("bodyshop.fields.md_functionality_toggles.parts_queue_toggle")}
|
||||||
|
</Checkbox>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ export default function OwnerFindModalContainer({
|
|||||||
owner,
|
owner,
|
||||||
selectedOwner,
|
selectedOwner,
|
||||||
setSelectedOwner,
|
setSelectedOwner,
|
||||||
|
partsQueueToggle,
|
||||||
|
setPartsQueueToggle,
|
||||||
...modalProps
|
...modalProps
|
||||||
}) {
|
}) {
|
||||||
//use owner object to run query and find what possible owners there are.
|
//use owner object to run query and find what possible owners there are.
|
||||||
@@ -59,6 +61,8 @@ export default function OwnerFindModalContainer({
|
|||||||
selectedOwner={selectedOwner}
|
selectedOwner={selectedOwner}
|
||||||
setSelectedOwner={setSelectedOwner}
|
setSelectedOwner={setSelectedOwner}
|
||||||
ownersListLoading={ownersList.loading}
|
ownersListLoading={ownersList.loading}
|
||||||
|
partsQueueToggle={partsQueueToggle}
|
||||||
|
setPartsQueueToggle={setPartsQueueToggle}
|
||||||
ownersList={
|
ownersList={
|
||||||
ownersList.data && ownersList.data.search_owners
|
ownersList.data && ownersList.data.search_owners
|
||||||
? ownersList.data.search_owners
|
? ownersList.data.search_owners
|
||||||
|
|||||||
@@ -21,7 +21,8 @@ const OwnerSearchSelect = ({ value, onChange, onBlur, disabled }, ref) => {
|
|||||||
useLazyQuery(SEARCH_OWNERS_BY_ID_FOR_AUTOCOMPLETE);
|
useLazyQuery(SEARCH_OWNERS_BY_ID_FOR_AUTOCOMPLETE);
|
||||||
|
|
||||||
const executeSearch = (v) => {
|
const executeSearch = (v) => {
|
||||||
callSearch(v);
|
if (v && v.variables?.search !== "" && v.variables.search.length >= 2)
|
||||||
|
callSearch(v);
|
||||||
};
|
};
|
||||||
const debouncedExecuteSearch = _.debounce(executeSearch, 500);
|
const debouncedExecuteSearch = _.debounce(executeSearch, 500);
|
||||||
|
|
||||||
|
|||||||
@@ -106,7 +106,11 @@ export default function OwnersListComponent({
|
|||||||
<Input.Search
|
<Input.Search
|
||||||
placeholder={search.search || t("general.labels.search")}
|
placeholder={search.search || t("general.labels.search")}
|
||||||
onSearch={(value) => {
|
onSearch={(value) => {
|
||||||
search.search = value;
|
if (value?.length >= 3) {
|
||||||
|
search.search = value;
|
||||||
|
} else {
|
||||||
|
delete search.search;
|
||||||
|
}
|
||||||
history.push({ search: queryString.stringify(search) });
|
history.push({ search: queryString.stringify(search) });
|
||||||
}}
|
}}
|
||||||
enterButton
|
enterButton
|
||||||
|
|||||||
@@ -20,9 +20,9 @@ import ProductionBoardCard from "../production-board-kanban-card/production-boar
|
|||||||
import ProductionListDetailComponent from "../production-list-detail/production-list-detail.component";
|
import ProductionListDetailComponent from "../production-list-detail/production-list-detail.component";
|
||||||
import ProductionBoardKanbanCardSettings from "./production-board-kanban.card-settings.component";
|
import ProductionBoardKanbanCardSettings from "./production-board-kanban.card-settings.component";
|
||||||
//import "@asseinfo/react-kanban/dist/styles.css";
|
//import "@asseinfo/react-kanban/dist/styles.css";
|
||||||
|
import CardColorLegend from "../production-board-kanban-card/production-board-kanban-card-color-legend.component";
|
||||||
import "./production-board-kanban.styles.scss";
|
import "./production-board-kanban.styles.scss";
|
||||||
import { createBoardData } from "./production-board-kanban.utils.js";
|
import { createBoardData } from "./production-board-kanban.utils.js";
|
||||||
import CardColorLegend from "../production-board-kanban-card/production-board-kanban-card-color-legend.component";
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
technician: selectTechnician,
|
technician: selectTechnician,
|
||||||
@@ -153,6 +153,18 @@ export function ProductionBoardKanbanComponent({
|
|||||||
0
|
0
|
||||||
)
|
)
|
||||||
.toFixed(1);
|
.toFixed(1);
|
||||||
|
const totalLAB = data
|
||||||
|
.reduce(
|
||||||
|
(acc, val) => acc + (val.labhrs?.aggregate?.sum?.mod_lb_hrs || 0),
|
||||||
|
0
|
||||||
|
)
|
||||||
|
.toFixed(1);
|
||||||
|
const totalLAR = data
|
||||||
|
.reduce(
|
||||||
|
(acc, val) => acc + (val.larhrs?.aggregate?.sum?.mod_lb_hrs || 0),
|
||||||
|
0
|
||||||
|
)
|
||||||
|
.toFixed(1);
|
||||||
const selectedBreakpoint = Object.entries(Grid.useBreakpoint())
|
const selectedBreakpoint = Object.entries(Grid.useBreakpoint())
|
||||||
.filter((screen) => !!screen[1])
|
.filter((screen) => !!screen[1])
|
||||||
.slice(-1)[0];
|
.slice(-1)[0];
|
||||||
@@ -236,6 +248,14 @@ export function ProductionBoardKanbanComponent({
|
|||||||
title={t("dashboard.titles.productionhours")}
|
title={t("dashboard.titles.productionhours")}
|
||||||
value={totalHrs}
|
value={totalHrs}
|
||||||
/>
|
/>
|
||||||
|
<Statistic
|
||||||
|
title={t("dashboard.titles.labhours")}
|
||||||
|
value={totalLAB}
|
||||||
|
/>
|
||||||
|
<Statistic
|
||||||
|
title={t("dashboard.titles.larhours")}
|
||||||
|
value={totalLAR}
|
||||||
|
/>
|
||||||
<Statistic
|
<Statistic
|
||||||
title={t("appointments.labels.inproduction")}
|
title={t("appointments.labels.inproduction")}
|
||||||
value={data && data.length}
|
value={data && data.length}
|
||||||
|
|||||||
@@ -455,8 +455,8 @@ const r = ({ technician, state, activeStatuses, bodyshop }) => {
|
|||||||
state.sortedInfo.order,
|
state.sortedInfo.order,
|
||||||
sorter: (a, b) =>
|
sorter: (a, b) =>
|
||||||
alphaSort(
|
alphaSort(
|
||||||
bodyshop.employees.find((e) => e.id === a.employee_body)?.first_name,
|
bodyshop.employees?.find((e) => e.id === a.employee_body)?.first_name,
|
||||||
bodyshop.employees.find((e) => e.id === b.employee_body)?.first_name
|
bodyshop.employees?.find((e) => e.id === b.employee_body)?.first_name
|
||||||
),
|
),
|
||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<ProductionListEmployeeAssignment
|
<ProductionListEmployeeAssignment
|
||||||
@@ -474,8 +474,8 @@ const r = ({ technician, state, activeStatuses, bodyshop }) => {
|
|||||||
state.sortedInfo.order,
|
state.sortedInfo.order,
|
||||||
sorter: (a, b) =>
|
sorter: (a, b) =>
|
||||||
alphaSort(
|
alphaSort(
|
||||||
bodyshop.employees.find((e) => e.id === a.employee_prep)?.first_name,
|
bodyshop.employees?.find((e) => e.id === a.employee_prep)?.first_name,
|
||||||
bodyshop.employees.find((e) => e.id === b.employee_prep)?.first_name
|
bodyshop.employees?.find((e) => e.id === b.employee_prep)?.first_name
|
||||||
),
|
),
|
||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<ProductionListEmployeeAssignment
|
<ProductionListEmployeeAssignment
|
||||||
@@ -492,8 +492,8 @@ const r = ({ technician, state, activeStatuses, bodyshop }) => {
|
|||||||
state.sortedInfo.columnKey === "employee_csr" && state.sortedInfo.order,
|
state.sortedInfo.columnKey === "employee_csr" && state.sortedInfo.order,
|
||||||
sorter: (a, b) =>
|
sorter: (a, b) =>
|
||||||
alphaSort(
|
alphaSort(
|
||||||
bodyshop.employees.find((e) => e.id === a.employee_csr)?.first_name,
|
bodyshop.employees?.find((e) => e.id === a.employee_csr)?.first_name,
|
||||||
bodyshop.employees.find((e) => e.id === b.employee_csr)?.first_name
|
bodyshop.employees?.find((e) => e.id === b.employee_csr)?.first_name
|
||||||
),
|
),
|
||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<ProductionListEmployeeAssignment record={record} type="employee_csr" />
|
<ProductionListEmployeeAssignment record={record} type="employee_csr" />
|
||||||
@@ -508,9 +508,9 @@ const r = ({ technician, state, activeStatuses, bodyshop }) => {
|
|||||||
state.sortedInfo.order,
|
state.sortedInfo.order,
|
||||||
sorter: (a, b) =>
|
sorter: (a, b) =>
|
||||||
alphaSort(
|
alphaSort(
|
||||||
bodyshop.employees.find((e) => e.id === a.employee_refinish)
|
bodyshop.employees?.find((e) => e.id === a.employee_refinish)
|
||||||
?.first_name,
|
?.first_name,
|
||||||
bodyshop.employees.find((e) => e.id === b.employee_refinish)
|
bodyshop.employees?.find((e) => e.id === b.employee_refinish)
|
||||||
?.first_name
|
?.first_name
|
||||||
),
|
),
|
||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
|
|||||||
@@ -55,25 +55,27 @@ export function ProductionListPrint({ bodyshop }) {
|
|||||||
<Menu.SubMenu
|
<Menu.SubMenu
|
||||||
title={t("reportcenter.templates.production_by_technician_one")}
|
title={t("reportcenter.templates.production_by_technician_one")}
|
||||||
>
|
>
|
||||||
{bodyshop.employees.map((e) => (
|
{bodyshop.employees
|
||||||
<Menu.Item
|
.filter((e) => e.active)
|
||||||
key={e.id}
|
.map((e) => (
|
||||||
onClick={async () => {
|
<Menu.Item
|
||||||
setLoading(true);
|
key={e.id}
|
||||||
await GenerateDocument(
|
onClick={async () => {
|
||||||
{
|
setLoading(true);
|
||||||
name: production_by_technician_one.key,
|
await GenerateDocument(
|
||||||
variables: { id: e.id },
|
{
|
||||||
},
|
name: production_by_technician_one.key,
|
||||||
{},
|
variables: { id: e.id },
|
||||||
"p"
|
},
|
||||||
);
|
{},
|
||||||
setLoading(false);
|
"p"
|
||||||
}}
|
);
|
||||||
>
|
setLoading(false);
|
||||||
{e.first_name} {e.last_name}
|
}}
|
||||||
</Menu.Item>
|
>
|
||||||
))}
|
{e.first_name} {e.last_name}
|
||||||
|
</Menu.Item>
|
||||||
|
))}
|
||||||
</Menu.SubMenu>
|
</Menu.SubMenu>
|
||||||
<Menu.SubMenu
|
<Menu.SubMenu
|
||||||
title={t("reportcenter.templates.production_by_category_one")}
|
title={t("reportcenter.templates.production_by_category_one")}
|
||||||
|
|||||||
@@ -184,6 +184,18 @@ export function ProductionListTable({
|
|||||||
0
|
0
|
||||||
)
|
)
|
||||||
.toFixed(1);
|
.toFixed(1);
|
||||||
|
const totalLAB = data
|
||||||
|
.reduce(
|
||||||
|
(acc, val) => acc + (val.labhrs?.aggregate?.sum?.mod_lb_hrs || 0),
|
||||||
|
0
|
||||||
|
)
|
||||||
|
.toFixed(1);
|
||||||
|
const totalLAR = data
|
||||||
|
.reduce(
|
||||||
|
(acc, val) => acc + (val.larhrs?.aggregate?.sum?.mod_lb_hrs || 0),
|
||||||
|
0
|
||||||
|
)
|
||||||
|
.toFixed(1);
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<PageHeader
|
<PageHeader
|
||||||
@@ -193,6 +205,14 @@ export function ProductionListTable({
|
|||||||
title={t("dashboard.titles.productionhours")}
|
title={t("dashboard.titles.productionhours")}
|
||||||
value={totalHrs}
|
value={totalHrs}
|
||||||
/>
|
/>
|
||||||
|
<Statistic
|
||||||
|
title={t("dashboard.titles.labhours")}
|
||||||
|
value={totalLAB}
|
||||||
|
/>
|
||||||
|
<Statistic
|
||||||
|
title={t("dashboard.titles.larhours")}
|
||||||
|
value={totalLAR}
|
||||||
|
/>
|
||||||
<Statistic
|
<Statistic
|
||||||
title={t("appointments.labels.inproduction")}
|
title={t("appointments.labels.inproduction")}
|
||||||
value={dataSource && dataSource.length}
|
value={dataSource && dataSource.length}
|
||||||
|
|||||||
@@ -13,20 +13,29 @@ import {
|
|||||||
QUERY_APPOINTMENTS_BY_JOBID,
|
QUERY_APPOINTMENTS_BY_JOBID,
|
||||||
} from "../../graphql/appointments.queries";
|
} from "../../graphql/appointments.queries";
|
||||||
import { QUERY_LBR_HRS_BY_PK, UPDATE_JOBS } from "../../graphql/jobs.queries";
|
import { QUERY_LBR_HRS_BY_PK, UPDATE_JOBS } from "../../graphql/jobs.queries";
|
||||||
|
import { insertAuditTrail } from "../../redux/application/application.actions";
|
||||||
import { setEmailOptions } from "../../redux/email/email.actions";
|
import { setEmailOptions } from "../../redux/email/email.actions";
|
||||||
import { toggleModalVisible } from "../../redux/modals/modals.actions";
|
import { toggleModalVisible } from "../../redux/modals/modals.actions";
|
||||||
import { selectSchedule } from "../../redux/modals/modals.selectors";
|
import { selectSchedule } from "../../redux/modals/modals.selectors";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import {
|
||||||
|
selectBodyshop,
|
||||||
|
selectCurrentUser,
|
||||||
|
} from "../../redux/user/user.selectors";
|
||||||
|
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
||||||
|
import { DateTimeFormat } from "../../utils/DateFormatter";
|
||||||
import { TemplateList } from "../../utils/TemplateConstants";
|
import { TemplateList } from "../../utils/TemplateConstants";
|
||||||
import ScheduleJobModalComponent from "./schedule-job-modal.component";
|
import ScheduleJobModalComponent from "./schedule-job-modal.component";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
scheduleModal: selectSchedule,
|
scheduleModal: selectSchedule,
|
||||||
|
currentUser: selectCurrentUser,
|
||||||
});
|
});
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
toggleModalVisible: () => dispatch(toggleModalVisible("schedule")),
|
toggleModalVisible: () => dispatch(toggleModalVisible("schedule")),
|
||||||
setEmailOptions: (e) => dispatch(setEmailOptions(e)),
|
setEmailOptions: (e) => dispatch(setEmailOptions(e)),
|
||||||
|
insertAuditTrail: ({ jobid, operation }) =>
|
||||||
|
dispatch(insertAuditTrail({ jobid, operation })),
|
||||||
});
|
});
|
||||||
|
|
||||||
export function ScheduleJobModalContainer({
|
export function ScheduleJobModalContainer({
|
||||||
@@ -34,6 +43,8 @@ export function ScheduleJobModalContainer({
|
|||||||
bodyshop,
|
bodyshop,
|
||||||
toggleModalVisible,
|
toggleModalVisible,
|
||||||
setEmailOptions,
|
setEmailOptions,
|
||||||
|
currentUser,
|
||||||
|
insertAuditTrail,
|
||||||
}) {
|
}) {
|
||||||
const { visible, context, actions } = scheduleModal;
|
const { visible, context, actions } = scheduleModal;
|
||||||
const { jobId, job, previousEvent } = context;
|
const { jobId, job, previousEvent } = context;
|
||||||
@@ -122,12 +133,22 @@ export function ScheduleJobModalContainer({
|
|||||||
end: moment(values.start).add(bodyshop.appt_length || 60, "minutes"),
|
end: moment(values.start).add(bodyshop.appt_length || 60, "minutes"),
|
||||||
color: values.color,
|
color: values.color,
|
||||||
note: values.note,
|
note: values.note,
|
||||||
|
created_by: currentUser.email,
|
||||||
},
|
},
|
||||||
jobId: jobId,
|
jobId: jobId,
|
||||||
altTransport: values.alt_transport,
|
altTransport: values.alt_transport,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (!appt.errors) {
|
||||||
|
insertAuditTrail({
|
||||||
|
jobid: job.id,
|
||||||
|
operation: AuditTrailMapping.appointmentinsert(
|
||||||
|
DateTimeFormat(values.start)
|
||||||
|
),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (!!appt.errors) {
|
if (!!appt.errors) {
|
||||||
notification["error"]({
|
notification["error"]({
|
||||||
message: t("appointments.errors.saving", {
|
message: t("appointments.errors.saving", {
|
||||||
@@ -149,6 +170,7 @@ export function ScheduleJobModalContainer({
|
|||||||
scheduled_in: values.start,
|
scheduled_in: values.start,
|
||||||
scheduled_completion: values.scheduled_completion,
|
scheduled_completion: values.scheduled_completion,
|
||||||
lost_sale_reason: null,
|
lost_sale_reason: null,
|
||||||
|
date_lost_sale: null,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -8,18 +8,45 @@ export const CalculateWorkingDaysThisMonth = () => {
|
|||||||
return moment().endOf("month").businessDaysIntoMonth();
|
return moment().endOf("month").businessDaysIntoMonth();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const CalculateWorkingDaysInPeriod = (start, end) => {
|
||||||
|
return moment(start).businessDiff(moment(end));
|
||||||
|
};
|
||||||
|
|
||||||
export const CalculateWorkingDaysAsOfToday = () => {
|
export const CalculateWorkingDaysAsOfToday = () => {
|
||||||
return moment().businessDaysIntoMonth();
|
return moment().businessDaysIntoMonth();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const CalculateWorkingDaysLastMonth = () => {
|
||||||
|
return moment().subtract(1, "month").endOf("month").businessDaysIntoMonth();
|
||||||
|
};
|
||||||
|
|
||||||
export const WeeklyTargetHrs = (dailyTargetHrs, bodyshop) => {
|
export const WeeklyTargetHrs = (dailyTargetHrs, bodyshop) => {
|
||||||
return dailyTargetHrs * 5;
|
return (
|
||||||
|
dailyTargetHrs *
|
||||||
|
CalculateWorkingDaysInPeriod(
|
||||||
|
moment().startOf("week"),
|
||||||
|
moment().endOf("week")
|
||||||
|
)
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const WeeklyTargetHrsInPeriod = (
|
||||||
|
dailyTargetHrs,
|
||||||
|
start,
|
||||||
|
end,
|
||||||
|
bodyshop
|
||||||
|
) => {
|
||||||
|
return dailyTargetHrs * CalculateWorkingDaysInPeriod(start, end);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const MonthlyTargetHrs = (dailyTargetHrs, bodyshop) => {
|
export const MonthlyTargetHrs = (dailyTargetHrs, bodyshop) => {
|
||||||
return dailyTargetHrs * CalculateWorkingDaysThisMonth();
|
return dailyTargetHrs * CalculateWorkingDaysThisMonth();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const LastMonthTargetHrs = (dailyTargetHrs, bodyshop) => {
|
||||||
|
return dailyTargetHrs * CalculateWorkingDaysLastMonth();
|
||||||
|
};
|
||||||
|
|
||||||
export const AsOfTodayTargetHrs = (dailyTargetHrs, bodyshop) => {
|
export const AsOfTodayTargetHrs = (dailyTargetHrs, bodyshop) => {
|
||||||
return dailyTargetHrs * CalculateWorkingDaysAsOfToday();
|
return dailyTargetHrs * CalculateWorkingDaysAsOfToday();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
const CustomTooltip = ({ active, payload, label }) => {
|
||||||
|
if (active && payload && payload.length) {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
backgroundColor: "white",
|
||||||
|
border: "1px solid gray",
|
||||||
|
padding: "0.5rem",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<p style={{ margin: "0" }}>{label}</p>
|
||||||
|
{payload.map((data, index) => {
|
||||||
|
return (
|
||||||
|
<p style={{ margin: "10px 0", color: data.color }} key={index}>{`${
|
||||||
|
data.name
|
||||||
|
} : ${data.value.toFixed(1)}`}</p>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default CustomTooltip;
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
import { Card } from "antd";
|
||||||
|
import React from "react";
|
||||||
|
import {
|
||||||
|
Area,
|
||||||
|
CartesianGrid,
|
||||||
|
ComposedChart,
|
||||||
|
Legend,
|
||||||
|
Line,
|
||||||
|
ResponsiveContainer,
|
||||||
|
Tooltip,
|
||||||
|
XAxis,
|
||||||
|
YAxis,
|
||||||
|
} from "recharts";
|
||||||
|
import CustomTooltip from "./chart-custom-tooltip";
|
||||||
|
|
||||||
|
const graphProps = {
|
||||||
|
strokeWidth: 3,
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function ScoreboardTimeTicketsChart({ data, chartTitle }) {
|
||||||
|
return (
|
||||||
|
<Card title={chartTitle}>
|
||||||
|
<ResponsiveContainer width="100%" height={275}>
|
||||||
|
<ComposedChart
|
||||||
|
data={data}
|
||||||
|
margin={{ top: 20, right: 20, bottom: 20, left: 20 }}
|
||||||
|
>
|
||||||
|
<CartesianGrid stroke="#f5f5f5" />
|
||||||
|
<XAxis dataKey="date" strokeWidth={graphProps.strokeWidth} />
|
||||||
|
<YAxis yAxisId="left" strokeWidth={graphProps.strokeWidth} />
|
||||||
|
<Tooltip content={<CustomTooltip />} />
|
||||||
|
<Legend />
|
||||||
|
<Line
|
||||||
|
name="Target Hours"
|
||||||
|
type="monotone"
|
||||||
|
dataKey="accTargetHrs"
|
||||||
|
stroke="#ff7300"
|
||||||
|
yAxisId="left"
|
||||||
|
strokeWidth={graphProps.strokeWidth}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Area
|
||||||
|
type="monotone"
|
||||||
|
name="MTD Hours"
|
||||||
|
dataKey="accHrs"
|
||||||
|
fill="lightblue"
|
||||||
|
stroke="blue"
|
||||||
|
yAxisId="left"
|
||||||
|
/>
|
||||||
|
</ComposedChart>
|
||||||
|
</ResponsiveContainer>
|
||||||
|
</Card>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,393 @@
|
|||||||
|
import { useQuery } from "@apollo/client";
|
||||||
|
import { Col, Row } from "antd";
|
||||||
|
import _ from "lodash";
|
||||||
|
import moment from "moment";
|
||||||
|
import React, { useMemo } from "react";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { QUERY_TIME_TICKETS_IN_RANGE_SB } from "../../graphql/timetickets.queries";
|
||||||
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
|
import AlertComponent from "../alert/alert.component";
|
||||||
|
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
|
||||||
|
import * as Utils from "../scoreboard-targets-table/scoreboard-targets-table.util";
|
||||||
|
import ScoreboardTimeTicketsChart from "./scoreboard-timetickets.chart.component";
|
||||||
|
import ScoreboardTicketsStats from "./scoreboard-timetickets.stats.component";
|
||||||
|
import ScoreboardTimeticketsTargetsTable from "./scoreboard-timetickets.targets-table.component";
|
||||||
|
|
||||||
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
bodyshop: selectBodyshop,
|
||||||
|
});
|
||||||
|
|
||||||
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
|
});
|
||||||
|
export default connect(
|
||||||
|
mapStateToProps,
|
||||||
|
mapDispatchToProps
|
||||||
|
)(ScoreboardTimeTicketsStats);
|
||||||
|
|
||||||
|
export function ScoreboardTimeTicketsStats({ bodyshop }) {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const startDate = moment().startOf("month")
|
||||||
|
const endDate = moment().endOf("month");
|
||||||
|
|
||||||
|
const fixedPeriods = useMemo(() => {
|
||||||
|
const endOfThisMonth = moment().endOf("month");
|
||||||
|
const startofthisMonth = moment().startOf("month");
|
||||||
|
|
||||||
|
const endOfLastmonth = moment().subtract(1, "month").endOf("month");
|
||||||
|
const startOfLastmonth = moment().subtract(1, "month").startOf("month");
|
||||||
|
|
||||||
|
const endOfThisWeek = moment().endOf("week");
|
||||||
|
const startOfThisWeek = moment().startOf("week");
|
||||||
|
|
||||||
|
const endOfLastWeek = moment().subtract(1, "week").endOf("week");
|
||||||
|
const startOfLastWeek = moment().subtract(1, "week").startOf("week");
|
||||||
|
|
||||||
|
const endOfPriorWeek = moment().subtract(2, "week").endOf("week");
|
||||||
|
const startOfPriorWeek = moment().subtract(2, "week").startOf("week");
|
||||||
|
|
||||||
|
const allDates = [
|
||||||
|
endOfThisMonth,
|
||||||
|
startofthisMonth,
|
||||||
|
endOfLastmonth,
|
||||||
|
startOfLastmonth,
|
||||||
|
endOfThisWeek,
|
||||||
|
startOfThisWeek,
|
||||||
|
endOfLastWeek,
|
||||||
|
startOfLastWeek,
|
||||||
|
endOfPriorWeek,
|
||||||
|
startOfPriorWeek,
|
||||||
|
];
|
||||||
|
const start = moment.min(allDates);
|
||||||
|
const end = moment.max(allDates);
|
||||||
|
return {
|
||||||
|
start,
|
||||||
|
end,
|
||||||
|
endOfThisMonth,
|
||||||
|
startofthisMonth,
|
||||||
|
endOfLastmonth,
|
||||||
|
startOfLastmonth,
|
||||||
|
endOfThisWeek,
|
||||||
|
startOfThisWeek,
|
||||||
|
endOfLastWeek,
|
||||||
|
startOfLastWeek,
|
||||||
|
endOfPriorWeek,
|
||||||
|
startOfPriorWeek,
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const { loading, error, data } = useQuery(QUERY_TIME_TICKETS_IN_RANGE_SB, {
|
||||||
|
variables: {
|
||||||
|
start: startDate.format("YYYY-MM-DD"),
|
||||||
|
end: endDate.format("YYYY-MM-DD"),
|
||||||
|
fixedStart: fixedPeriods.start.format("YYYY-MM-DD"),
|
||||||
|
fixedEnd: fixedPeriods.end.format("YYYY-MM-DD"),
|
||||||
|
},
|
||||||
|
fetchPolicy: "network-only",
|
||||||
|
nextFetchPolicy: "network-only",
|
||||||
|
pollInterval: 60000,
|
||||||
|
skip: !fixedPeriods,
|
||||||
|
});
|
||||||
|
|
||||||
|
const calculatedData = useMemo(() => {
|
||||||
|
if (!data) return [];
|
||||||
|
const ret = {
|
||||||
|
totalThisWeek: 0,
|
||||||
|
totalThisWeekLAB: 0,
|
||||||
|
totalThisWeekLAR: 0,
|
||||||
|
totalLastWeek: 0,
|
||||||
|
totalLastWeekLAB: 0,
|
||||||
|
totalLastWeekLAR: 0,
|
||||||
|
totalPriorWeek: 0,
|
||||||
|
totalPriorWeekLAB: 0,
|
||||||
|
totalPriorWeekLAR: 0,
|
||||||
|
totalThisMonth: 0,
|
||||||
|
totalThisMonthLAB: 0,
|
||||||
|
totalThisMonthLAR: 0,
|
||||||
|
totalLastMonth: 0,
|
||||||
|
totalLastMonthLAB: 0,
|
||||||
|
totalLastMonthLAR: 0,
|
||||||
|
actualTotalOverPeriod: 0,
|
||||||
|
actualTotalOverPeriodLAB: 0,
|
||||||
|
actualTotalOverPeriodLAR: 0,
|
||||||
|
totalEffieciencyOverPeriod: 0,
|
||||||
|
totalEffieciencyOverPeriodLAB: 0,
|
||||||
|
totalEffieciencyOverPeriodLAR: 0,
|
||||||
|
seperatedThisWeek: {
|
||||||
|
sunday: {
|
||||||
|
total: 0,
|
||||||
|
lab: 0,
|
||||||
|
lar: 0,
|
||||||
|
},
|
||||||
|
monday: {
|
||||||
|
total: 0,
|
||||||
|
lab: 0,
|
||||||
|
lar: 0,
|
||||||
|
},
|
||||||
|
tuesday: {
|
||||||
|
total: 0,
|
||||||
|
lab: 0,
|
||||||
|
lar: 0,
|
||||||
|
},
|
||||||
|
wednesday: {
|
||||||
|
total: 0,
|
||||||
|
lab: 0,
|
||||||
|
lar: 0,
|
||||||
|
},
|
||||||
|
thursday: {
|
||||||
|
total: 0,
|
||||||
|
lab: 0,
|
||||||
|
lar: 0,
|
||||||
|
},
|
||||||
|
friday: {
|
||||||
|
total: 0,
|
||||||
|
lab: 0,
|
||||||
|
lar: 0,
|
||||||
|
},
|
||||||
|
saturday: {
|
||||||
|
total: 0,
|
||||||
|
lab: 0,
|
||||||
|
lar: 0,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
data.fixedperiod.forEach((ticket) => {
|
||||||
|
const ticketDate = moment(ticket.date);
|
||||||
|
if (
|
||||||
|
ticketDate.isBetween(
|
||||||
|
fixedPeriods.startOfThisWeek,
|
||||||
|
fixedPeriods.endOfThisWeek,
|
||||||
|
undefined,
|
||||||
|
"[]"
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
ret.totalThisWeek = ret.totalThisWeek + ticket.productivehrs;
|
||||||
|
if (ticket.ciecacode !== "LAR")
|
||||||
|
ret.totalThisWeekLAB = ret.totalThisWeekLAB + ticket.productivehrs;
|
||||||
|
if (ticket.ciecacode === "LAR")
|
||||||
|
ret.totalThisWeekLAR = ret.totalThisWeekLAR + ticket.productivehrs;
|
||||||
|
|
||||||
|
//Seperate out to Day of Week
|
||||||
|
ret.seperatedThisWeek[
|
||||||
|
moment(ticket.date).format("dddd").toLowerCase()
|
||||||
|
].total =
|
||||||
|
ret.seperatedThisWeek[
|
||||||
|
moment(ticket.date).format("dddd").toLowerCase()
|
||||||
|
].total + ticket.productivehrs;
|
||||||
|
if (ticket.ciecacode !== "LAR")
|
||||||
|
ret.seperatedThisWeek[
|
||||||
|
moment(ticket.date).format("dddd").toLowerCase()
|
||||||
|
].lab =
|
||||||
|
ret.seperatedThisWeek[
|
||||||
|
moment(ticket.date).format("dddd").toLowerCase()
|
||||||
|
].lab + ticket.productivehrs;
|
||||||
|
if (ticket.ciecacode === "LAR")
|
||||||
|
ret.seperatedThisWeek[
|
||||||
|
moment(ticket.date).format("dddd").toLowerCase()
|
||||||
|
].lar =
|
||||||
|
ret.seperatedThisWeek[
|
||||||
|
moment(ticket.date).format("dddd").toLowerCase()
|
||||||
|
].lar + ticket.productivehrs;
|
||||||
|
} else if (
|
||||||
|
ticketDate.isBetween(
|
||||||
|
fixedPeriods.startOfLastWeek,
|
||||||
|
fixedPeriods.endOfLastWeek,
|
||||||
|
undefined,
|
||||||
|
"[]"
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
ret.totalLastWeek = ret.totalLastWeek + ticket.productivehrs;
|
||||||
|
if (ticket.ciecacode !== "LAR")
|
||||||
|
ret.totalLastWeekLAB = ret.totalLastWeekLAB + ticket.productivehrs;
|
||||||
|
if (ticket.ciecacode === "LAR")
|
||||||
|
ret.totalLastWeekLAR = ret.totalLastWeekLAR + ticket.productivehrs;
|
||||||
|
} else if (
|
||||||
|
ticketDate.isBetween(
|
||||||
|
fixedPeriods.startOfPriorWeek,
|
||||||
|
fixedPeriods.endOfPriorWeek,
|
||||||
|
undefined,
|
||||||
|
"[]"
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
ret.totalPriorWeek = ret.totalPriorWeek + ticket.productivehrs;
|
||||||
|
if (ticket.ciecacode !== "LAR")
|
||||||
|
ret.totalPriorWeekLAB = ret.totalPriorWeekLAB + ticket.productivehrs;
|
||||||
|
if (ticket.ciecacode === "LAR")
|
||||||
|
ret.totalPriorWeekLAR = ret.totalPriorWeekLAR + ticket.productivehrs;
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
ticketDate.isBetween(
|
||||||
|
fixedPeriods.startofthisMonth,
|
||||||
|
fixedPeriods.endOfThisMonth,
|
||||||
|
undefined,
|
||||||
|
"[]"
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
ret.totalThisMonth = ret.totalThisMonth + ticket.productivehrs;
|
||||||
|
ret.actualTotalOverPeriod =
|
||||||
|
ret.actualTotalOverPeriod + (ticket.actualhrs || 0);
|
||||||
|
if (ticket.ciecacode !== "LAR") {
|
||||||
|
ret.totalThisMonthLAB = ret.totalThisMonthLAB + ticket.productivehrs;
|
||||||
|
ret.actualTotalOverPeriodLAB =
|
||||||
|
ret.actualTotalOverPeriodLAB + (ticket.actualhrs || 0);
|
||||||
|
}
|
||||||
|
if (ticket.ciecacode === "LAR") {
|
||||||
|
ret.totalThisMonthLAR = ret.totalThisMonthLAR + ticket.productivehrs;
|
||||||
|
ret.actualTotalOverPeriodLAR =
|
||||||
|
ret.actualTotalOverPeriodLAR + (ticket.actualhrs || 0);
|
||||||
|
}
|
||||||
|
} else if (
|
||||||
|
ticketDate.isBetween(
|
||||||
|
fixedPeriods.startOfLastmonth,
|
||||||
|
fixedPeriods.endOfLastmonth,
|
||||||
|
undefined,
|
||||||
|
"[]"
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
ret.totalLastMonth = ret.totalLastMonth + ticket.productivehrs;
|
||||||
|
if (ticket.ciecacode !== "LAR")
|
||||||
|
ret.totalLastMonthLAB = ret.totalLastMonthLAB + ticket.productivehrs;
|
||||||
|
if (ticket.ciecacode === "LAR")
|
||||||
|
ret.totalLastMonthLAR = ret.totalLastMonthLAR + ticket.productivehrs;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
ret.totalEffieciencyOverPeriod = ret.actualTotalOverPeriod
|
||||||
|
? (ret.totalThisMonth / ret.actualTotalOverPeriod) * 100
|
||||||
|
: 0;
|
||||||
|
ret.totalEffieciencyOverPeriodLAB = ret.actualTotalOverPeriodLAB
|
||||||
|
? (ret.totalThisMonthLAB / ret.actualTotalOverPeriodLAB) * 100
|
||||||
|
: 0;
|
||||||
|
ret.totalEffieciencyOverPeriodLAR = ret.actualTotalOverPeriodLAR
|
||||||
|
? (ret.totalThisMonthLAR / ret.actualTotalOverPeriodLAR) * 100
|
||||||
|
: 0;
|
||||||
|
|
||||||
|
roundObject(ret);
|
||||||
|
|
||||||
|
const ticketsGroupedByDate = _.groupBy(data.timetickets, "date");
|
||||||
|
|
||||||
|
const listOfDays = Utils.ListOfDaysInCurrentMonth();
|
||||||
|
|
||||||
|
const combinedData = [],
|
||||||
|
labData = [],
|
||||||
|
larData = [];
|
||||||
|
var acc_comb = 0;
|
||||||
|
var acc_lab = 0;
|
||||||
|
var acc_lar = 0;
|
||||||
|
|
||||||
|
listOfDays.forEach((day) => {
|
||||||
|
const r = {
|
||||||
|
date: moment(day).format("MM/DD"),
|
||||||
|
actualhrs: 0,
|
||||||
|
productivehrs: 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
const combined = {
|
||||||
|
accTargetHrs: _.round(
|
||||||
|
Utils.AsOfDateTargetHours(
|
||||||
|
bodyshop.scoreboard_target.dailyBodyTarget +
|
||||||
|
bodyshop.scoreboard_target.dailyPaintTarget,
|
||||||
|
day
|
||||||
|
) +
|
||||||
|
(bodyshop.scoreboard_target.dailyBodyTarget +
|
||||||
|
bodyshop.scoreboard_target.dailyPaintTarget),
|
||||||
|
1
|
||||||
|
),
|
||||||
|
accHrs: 0,
|
||||||
|
};
|
||||||
|
const lab = {
|
||||||
|
accTargetHrs: _.round(
|
||||||
|
Utils.AsOfDateTargetHours(
|
||||||
|
bodyshop.scoreboard_target.dailyBodyTarget,
|
||||||
|
day
|
||||||
|
) + bodyshop.scoreboard_target.dailyBodyTarget,
|
||||||
|
1
|
||||||
|
),
|
||||||
|
accHrs: 0,
|
||||||
|
};
|
||||||
|
const lar = {
|
||||||
|
accTargetHrs: _.round(
|
||||||
|
Utils.AsOfDateTargetHours(
|
||||||
|
bodyshop.scoreboard_target.dailyPaintTarget,
|
||||||
|
day
|
||||||
|
) + bodyshop.scoreboard_target.dailyPaintTarget,
|
||||||
|
1
|
||||||
|
),
|
||||||
|
accHrs: 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
if (ticketsGroupedByDate[day]) {
|
||||||
|
ticketsGroupedByDate[day].forEach((ticket) => {
|
||||||
|
r.actualhrs = r.actualhrs + ticket.actualhrs;
|
||||||
|
r.productivehrs = r.productivehrs + ticket.productivehrs;
|
||||||
|
acc_comb = acc_comb + ticket.productivehrs;
|
||||||
|
|
||||||
|
if (ticket.ciecacode !== "LAR")
|
||||||
|
acc_lab = acc_lab + ticket.productivehrs;
|
||||||
|
if (ticket.ciecacode === "LAR")
|
||||||
|
acc_lar = acc_lar + ticket.productivehrs;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
combined.accHrs = acc_comb;
|
||||||
|
lab.accHrs = acc_lab;
|
||||||
|
lar.accHrs = acc_lar;
|
||||||
|
|
||||||
|
combinedData.push({ ...r, ...combined });
|
||||||
|
labData.push({ ...r, ...lab });
|
||||||
|
larData.push({ ...r, ...lar });
|
||||||
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
fixed: ret,
|
||||||
|
combinedData: combinedData,
|
||||||
|
labData: labData,
|
||||||
|
larData: larData,
|
||||||
|
};
|
||||||
|
}, [fixedPeriods, data, bodyshop]);
|
||||||
|
|
||||||
|
if (error) return <AlertComponent message={error.message} type="error" />;
|
||||||
|
if (loading) return <LoadingSpinner />;
|
||||||
|
return (
|
||||||
|
<Row gutter={[16, 16]}>
|
||||||
|
<Col span={24}>
|
||||||
|
<ScoreboardTimeticketsTargetsTable />
|
||||||
|
</Col>
|
||||||
|
<Col span={24}>
|
||||||
|
<ScoreboardTicketsStats data={calculatedData.fixed} />
|
||||||
|
</Col>
|
||||||
|
<Col span={24}>
|
||||||
|
<ScoreboardTimeTicketsChart
|
||||||
|
data={calculatedData.combinedData}
|
||||||
|
chartTitle={t("scoreboard.labels.combinedcharttitle")}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col span={12}>
|
||||||
|
<ScoreboardTimeTicketsChart
|
||||||
|
data={calculatedData.labData}
|
||||||
|
chartTitle={t("scoreboard.labels.bodycharttitle")}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col span={12}>
|
||||||
|
<ScoreboardTimeTicketsChart
|
||||||
|
data={calculatedData.larData}
|
||||||
|
chartTitle={t("scoreboard.labels.refinishcharttitle")}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function roundObject(inputObj) {
|
||||||
|
for (var key of Object.keys(inputObj)) {
|
||||||
|
if (typeof inputObj[key] === "number") {
|
||||||
|
inputObj[key] = inputObj[key].toFixed(1);
|
||||||
|
} else if (Array.isArray(inputObj[key])) {
|
||||||
|
inputObj[key].forEach((item) => roundObject(item));
|
||||||
|
} else if (typeof inputObj[key] === "object") {
|
||||||
|
roundObject(inputObj[key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,617 @@
|
|||||||
|
import {
|
||||||
|
Card,
|
||||||
|
Col,
|
||||||
|
Form,
|
||||||
|
Row,
|
||||||
|
Space,
|
||||||
|
Statistic,
|
||||||
|
Switch,
|
||||||
|
Typography,
|
||||||
|
} from "antd";
|
||||||
|
import moment from "moment";
|
||||||
|
import React, { useEffect, useState } from "react";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
|
import * as Util from "../scoreboard-targets-table/scoreboard-targets-table.util";
|
||||||
|
|
||||||
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
bodyshop: selectBodyshop,
|
||||||
|
});
|
||||||
|
|
||||||
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
|
});
|
||||||
|
export default connect(
|
||||||
|
mapStateToProps,
|
||||||
|
mapDispatchToProps
|
||||||
|
)(ScoreboardTicketsStats);
|
||||||
|
|
||||||
|
function useLocalStorage(key, initialValue) {
|
||||||
|
const [storedValue, setStoredValue] = useState(() => {
|
||||||
|
const item = localStorage.getItem(key);
|
||||||
|
return item ? JSON.parse(item) : initialValue;
|
||||||
|
});
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
localStorage.setItem(key, JSON.stringify(storedValue));
|
||||||
|
}, [key, storedValue]);
|
||||||
|
|
||||||
|
return [storedValue, setStoredValue];
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ScoreboardTicketsStats({ data, bodyshop }) {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const [isLarge, setIsLarge] = useLocalStorage("isLargeStatistic", false);
|
||||||
|
|
||||||
|
const statisticSize = isLarge ? 36 : 24;
|
||||||
|
const statisticWeight = isLarge ? 550 : "normal";
|
||||||
|
const daySpan =
|
||||||
|
Util.CalculateWorkingDaysInPeriod(
|
||||||
|
moment().startOf("week"),
|
||||||
|
moment().endOf("week")
|
||||||
|
) > 5
|
||||||
|
? 3
|
||||||
|
: 4;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Card
|
||||||
|
title={t("scoreboard.labels.productivestatistics")}
|
||||||
|
extra={
|
||||||
|
<Form.Item
|
||||||
|
label={t("general.labels.tvmode")}
|
||||||
|
valuePropName="checked"
|
||||||
|
name={["tvmode"]}
|
||||||
|
>
|
||||||
|
<Switch
|
||||||
|
onClick={() => setIsLarge(!isLarge)}
|
||||||
|
defaultChecked={isLarge}
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<Row gutter={[16, 16]}>
|
||||||
|
<Col md={24}>
|
||||||
|
{/* Daily Stats */}
|
||||||
|
<Space direction="vertical" size="middle" style={{ display: "flex" }}>
|
||||||
|
<Row gutter={[16, 16]} align="center">
|
||||||
|
{[
|
||||||
|
"sunday",
|
||||||
|
"monday",
|
||||||
|
"tuesday",
|
||||||
|
"wednesday",
|
||||||
|
"thursday",
|
||||||
|
"friday",
|
||||||
|
"saturday",
|
||||||
|
].map((day) => {
|
||||||
|
if (bodyshop.workingdays[day] === true) {
|
||||||
|
return (
|
||||||
|
<Col key={day} span={daySpan} align="center">
|
||||||
|
<Card size="small" title={t("general.labels." + day)}>
|
||||||
|
<Row gutter={[8, 8]}>
|
||||||
|
<Col span={24}>
|
||||||
|
<Statistic
|
||||||
|
value={data.seperatedThisWeek[day].total}
|
||||||
|
valueStyle={{
|
||||||
|
color:
|
||||||
|
parseFloat(
|
||||||
|
data.seperatedThisWeek[day].total
|
||||||
|
) >=
|
||||||
|
bodyshop.scoreboard_target.dailyBodyTarget +
|
||||||
|
bodyshop.scoreboard_target.dailyPaintTarget
|
||||||
|
? "green"
|
||||||
|
: "red",
|
||||||
|
fontSize: statisticSize,
|
||||||
|
fontWeight: statisticWeight,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
<Row gutter={[16, 16]}>
|
||||||
|
<Col span={12}>
|
||||||
|
<Statistic
|
||||||
|
title={
|
||||||
|
<Typography.Text strong>
|
||||||
|
{t("scoreboard.labels.body")}
|
||||||
|
</Typography.Text>
|
||||||
|
}
|
||||||
|
value={data.seperatedThisWeek[day].lab}
|
||||||
|
valueStyle={{
|
||||||
|
color:
|
||||||
|
parseFloat(data.seperatedThisWeek[day].lab) >=
|
||||||
|
bodyshop.scoreboard_target.dailyBodyTarget
|
||||||
|
? "green"
|
||||||
|
: "red",
|
||||||
|
fontSize: statisticSize,
|
||||||
|
fontWeight: statisticWeight,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col span={12}>
|
||||||
|
<Statistic
|
||||||
|
title={
|
||||||
|
<Typography.Text strong>
|
||||||
|
{t("scoreboard.labels.refinish")}
|
||||||
|
</Typography.Text>
|
||||||
|
}
|
||||||
|
value={data.seperatedThisWeek[day].lar}
|
||||||
|
valueStyle={{
|
||||||
|
color:
|
||||||
|
parseFloat(data.seperatedThisWeek[day].lar) >=
|
||||||
|
bodyshop.scoreboard_target.dailyPaintTarget
|
||||||
|
? "green"
|
||||||
|
: "red",
|
||||||
|
fontSize: statisticSize,
|
||||||
|
fontWeight: statisticWeight,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</Card>
|
||||||
|
</Col>
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
})}
|
||||||
|
</Row>
|
||||||
|
{/* Weekly Stats */}
|
||||||
|
<Row gutter={[16, 16]}>
|
||||||
|
{/* This Week */}
|
||||||
|
<Col span={8} align="center">
|
||||||
|
<Card size="small" title={t("scoreboard.labels.thisweek")}>
|
||||||
|
<Row gutter={[16, 16]}>
|
||||||
|
<Col span={24}>
|
||||||
|
<Statistic
|
||||||
|
value={data.totalThisWeek}
|
||||||
|
valueStyle={{
|
||||||
|
color:
|
||||||
|
parseFloat(data.totalThisWeek) >=
|
||||||
|
Util.WeeklyTargetHrsInPeriod(
|
||||||
|
bodyshop.scoreboard_target.dailyBodyTarget,
|
||||||
|
moment().startOf("week"),
|
||||||
|
moment().endOf("week"),
|
||||||
|
bodyshop
|
||||||
|
) +
|
||||||
|
Util.WeeklyTargetHrsInPeriod(
|
||||||
|
bodyshop.scoreboard_target.dailyPaintTarget,
|
||||||
|
moment().startOf("week"),
|
||||||
|
moment().endOf("week"),
|
||||||
|
bodyshop
|
||||||
|
)
|
||||||
|
? "green"
|
||||||
|
: "red",
|
||||||
|
fontSize: statisticSize,
|
||||||
|
fontWeight: statisticWeight,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
<Row gutter={[16, 16]}>
|
||||||
|
<Col span={12}>
|
||||||
|
<Statistic
|
||||||
|
title={
|
||||||
|
<Typography.Text strong>
|
||||||
|
{t("scoreboard.labels.body")}
|
||||||
|
</Typography.Text>
|
||||||
|
}
|
||||||
|
value={data.totalThisWeekLAB}
|
||||||
|
valueStyle={{
|
||||||
|
color:
|
||||||
|
parseFloat(data.totalThisWeekLAB) >=
|
||||||
|
Util.WeeklyTargetHrsInPeriod(
|
||||||
|
bodyshop.scoreboard_target.dailyBodyTarget,
|
||||||
|
moment().startOf("week"),
|
||||||
|
moment().endOf("week"),
|
||||||
|
bodyshop
|
||||||
|
)
|
||||||
|
? "green"
|
||||||
|
: "red",
|
||||||
|
fontSize: statisticSize,
|
||||||
|
fontWeight: statisticWeight,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col span={12}>
|
||||||
|
<Statistic
|
||||||
|
title={
|
||||||
|
<Typography.Text strong>
|
||||||
|
{t("scoreboard.labels.refinish")}
|
||||||
|
</Typography.Text>
|
||||||
|
}
|
||||||
|
value={data.totalThisWeekLAR}
|
||||||
|
valueStyle={{
|
||||||
|
color:
|
||||||
|
parseFloat(data.totalThisWeekLAR) >=
|
||||||
|
Util.WeeklyTargetHrsInPeriod(
|
||||||
|
bodyshop.scoreboard_target.dailyPaintTarget,
|
||||||
|
moment().startOf("week"),
|
||||||
|
moment().endOf("week"),
|
||||||
|
bodyshop
|
||||||
|
)
|
||||||
|
? "green"
|
||||||
|
: "red",
|
||||||
|
fontSize: statisticSize,
|
||||||
|
fontWeight: statisticWeight,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</Card>
|
||||||
|
</Col>
|
||||||
|
{/* Last Week */}
|
||||||
|
<Col span={8} align="center">
|
||||||
|
<Card size="small" title={t("scoreboard.labels.lastweek")}>
|
||||||
|
<Row gutter={[16, 16]}>
|
||||||
|
<Col span={24}>
|
||||||
|
<Statistic
|
||||||
|
value={data.totalLastWeek}
|
||||||
|
valueStyle={{
|
||||||
|
color:
|
||||||
|
parseFloat(data.totalLastWeek) >=
|
||||||
|
Util.WeeklyTargetHrsInPeriod(
|
||||||
|
bodyshop.scoreboard_target.dailyBodyTarget,
|
||||||
|
moment().subtract(1, "week").startOf("week"),
|
||||||
|
moment().subtract(1, "week").endOf("week"),
|
||||||
|
bodyshop
|
||||||
|
) +
|
||||||
|
Util.WeeklyTargetHrsInPeriod(
|
||||||
|
bodyshop.scoreboard_target.dailyPaintTarget,
|
||||||
|
moment().subtract(1, "week").startOf("week"),
|
||||||
|
moment().subtract(1, "week").endOf("week"),
|
||||||
|
bodyshop
|
||||||
|
)
|
||||||
|
? "green"
|
||||||
|
: "red",
|
||||||
|
fontSize: statisticSize,
|
||||||
|
fontWeight: statisticWeight,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
<Row gutter={[16, 16]}>
|
||||||
|
<Col span={12}>
|
||||||
|
<Statistic
|
||||||
|
title={
|
||||||
|
<Typography.Text strong>
|
||||||
|
{t("scoreboard.labels.body")}
|
||||||
|
</Typography.Text>
|
||||||
|
}
|
||||||
|
value={data.totalLastWeekLAB}
|
||||||
|
valueStyle={{
|
||||||
|
color:
|
||||||
|
parseFloat(data.totalLastWeekLAB) >=
|
||||||
|
Util.WeeklyTargetHrsInPeriod(
|
||||||
|
bodyshop.scoreboard_target.dailyBodyTarget,
|
||||||
|
moment().subtract(1, "week").startOf("week"),
|
||||||
|
moment().subtract(1, "week").endOf("week"),
|
||||||
|
bodyshop
|
||||||
|
)
|
||||||
|
? "green"
|
||||||
|
: "red",
|
||||||
|
fontSize: statisticSize,
|
||||||
|
fontWeight: statisticWeight,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col span={12}>
|
||||||
|
<Statistic
|
||||||
|
title={
|
||||||
|
<Typography.Text strong>
|
||||||
|
{t("scoreboard.labels.refinish")}
|
||||||
|
</Typography.Text>
|
||||||
|
}
|
||||||
|
value={data.totalLastWeekLAR}
|
||||||
|
valueStyle={{
|
||||||
|
color:
|
||||||
|
parseFloat(data.totalLastWeekLAR) >=
|
||||||
|
Util.WeeklyTargetHrsInPeriod(
|
||||||
|
bodyshop.scoreboard_target.dailyPaintTarget,
|
||||||
|
moment().subtract(1, "week").startOf("week"),
|
||||||
|
moment().subtract(1, "week").endOf("week"),
|
||||||
|
bodyshop
|
||||||
|
)
|
||||||
|
? "green"
|
||||||
|
: "red",
|
||||||
|
fontSize: statisticSize,
|
||||||
|
fontWeight: statisticWeight,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</Card>
|
||||||
|
</Col>
|
||||||
|
{/* Prior Week */}
|
||||||
|
<Col span={8} align="center">
|
||||||
|
<Card size="small" title={t("scoreboard.labels.priorweek")}>
|
||||||
|
<Row gutter={[16, 16]}>
|
||||||
|
<Col span={24}>
|
||||||
|
<Statistic
|
||||||
|
value={data.totalPriorWeek}
|
||||||
|
valueStyle={{
|
||||||
|
color:
|
||||||
|
parseFloat(data.totalPriorWeek) >=
|
||||||
|
Util.WeeklyTargetHrsInPeriod(
|
||||||
|
bodyshop.scoreboard_target.dailyBodyTarget,
|
||||||
|
moment().subtract(2, "week").startOf("week"),
|
||||||
|
moment().subtract(2, "week").endOf("week"),
|
||||||
|
bodyshop
|
||||||
|
) +
|
||||||
|
Util.WeeklyTargetHrsInPeriod(
|
||||||
|
bodyshop.scoreboard_target.dailyPaintTarget,
|
||||||
|
moment().subtract(2, "week").startOf("week"),
|
||||||
|
moment().subtract(2, "week").endOf("week"),
|
||||||
|
bodyshop
|
||||||
|
)
|
||||||
|
? "green"
|
||||||
|
: "red",
|
||||||
|
fontSize: statisticSize,
|
||||||
|
fontWeight: statisticWeight,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
<Row gutter={[16, 16]}>
|
||||||
|
<Col span={12}>
|
||||||
|
<Statistic
|
||||||
|
title={
|
||||||
|
<Typography.Text strong>
|
||||||
|
{t("scoreboard.labels.body")}
|
||||||
|
</Typography.Text>
|
||||||
|
}
|
||||||
|
value={data.totalPriorWeekLAB}
|
||||||
|
valueStyle={{
|
||||||
|
color:
|
||||||
|
parseFloat(data.totalPriorWeekLAB) >=
|
||||||
|
Util.WeeklyTargetHrsInPeriod(
|
||||||
|
bodyshop.scoreboard_target.dailyBodyTarget,
|
||||||
|
moment().subtract(2, "week").startOf("week"),
|
||||||
|
moment().subtract(2, "week").endOf("week"),
|
||||||
|
bodyshop
|
||||||
|
)
|
||||||
|
? "green"
|
||||||
|
: "red",
|
||||||
|
fontSize: statisticSize,
|
||||||
|
fontWeight: statisticWeight,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col span={12}>
|
||||||
|
<Statistic
|
||||||
|
title={
|
||||||
|
<Typography.Text strong>
|
||||||
|
{t("scoreboard.labels.refinish")}
|
||||||
|
</Typography.Text>
|
||||||
|
}
|
||||||
|
value={data.totalPriorWeekLAR}
|
||||||
|
valueStyle={{
|
||||||
|
color:
|
||||||
|
parseFloat(data.totalPriorWeekLAR) >=
|
||||||
|
Util.WeeklyTargetHrsInPeriod(
|
||||||
|
bodyshop.scoreboard_target.dailyPaintTarget,
|
||||||
|
moment().subtract(2, "week").startOf("week"),
|
||||||
|
moment().subtract(2, "week").endOf("week"),
|
||||||
|
bodyshop
|
||||||
|
)
|
||||||
|
? "green"
|
||||||
|
: "red",
|
||||||
|
fontSize: statisticSize,
|
||||||
|
fontWeight: statisticWeight,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</Card>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
{/* Monthly Stats */}
|
||||||
|
<Row gutter={[16, 16]}>
|
||||||
|
{/* This Month */}
|
||||||
|
<Col span={8} align="center">
|
||||||
|
<Card size="small" title={t("scoreboard.labels.thismonth")}>
|
||||||
|
<Row gutter={[16, 16]}>
|
||||||
|
<Col span={24}>
|
||||||
|
<Statistic
|
||||||
|
value={data.totalThisMonth}
|
||||||
|
valueStyle={{
|
||||||
|
color:
|
||||||
|
parseFloat(data.totalThisMonth) >=
|
||||||
|
Util.MonthlyTargetHrs(
|
||||||
|
bodyshop.scoreboard_target.dailyBodyTarget,
|
||||||
|
bodyshop
|
||||||
|
) +
|
||||||
|
Util.MonthlyTargetHrs(
|
||||||
|
bodyshop.scoreboard_target.dailyPaintTarget,
|
||||||
|
bodyshop
|
||||||
|
)
|
||||||
|
? "green"
|
||||||
|
: "red",
|
||||||
|
fontSize: statisticSize,
|
||||||
|
fontWeight: statisticWeight,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
<Row gutter={[16, 16]}>
|
||||||
|
<Col span={12}>
|
||||||
|
<Statistic
|
||||||
|
title={
|
||||||
|
<Typography.Text strong>
|
||||||
|
{t("scoreboard.labels.body")}
|
||||||
|
</Typography.Text>
|
||||||
|
}
|
||||||
|
value={data.totalThisMonthLAB}
|
||||||
|
valueStyle={{
|
||||||
|
color:
|
||||||
|
parseFloat(data.totalThisMonthLAB) >=
|
||||||
|
Util.MonthlyTargetHrs(
|
||||||
|
bodyshop.scoreboard_target.dailyBodyTarget,
|
||||||
|
bodyshop
|
||||||
|
)
|
||||||
|
? "green"
|
||||||
|
: "red",
|
||||||
|
fontSize: statisticSize,
|
||||||
|
fontWeight: statisticWeight,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col span={12}>
|
||||||
|
<Statistic
|
||||||
|
title={
|
||||||
|
<Typography.Text strong>
|
||||||
|
{t("scoreboard.labels.refinish")}
|
||||||
|
</Typography.Text>
|
||||||
|
}
|
||||||
|
value={data.totalThisMonthLAR}
|
||||||
|
valueStyle={{
|
||||||
|
color:
|
||||||
|
parseFloat(data.totalThisMonthLAR) >=
|
||||||
|
Util.MonthlyTargetHrs(
|
||||||
|
bodyshop.scoreboard_target.dailyPaintTarget,
|
||||||
|
bodyshop
|
||||||
|
)
|
||||||
|
? "green"
|
||||||
|
: "red",
|
||||||
|
fontSize: statisticSize,
|
||||||
|
fontWeight: statisticWeight,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</Card>
|
||||||
|
</Col>
|
||||||
|
{/* Last Month */}
|
||||||
|
<Col span={8} align="center">
|
||||||
|
<Card size="small" title={t("scoreboard.labels.lastmonth")}>
|
||||||
|
<Row gutter={[16, 16]}>
|
||||||
|
<Col span={24}>
|
||||||
|
<Statistic
|
||||||
|
value={data.totalLastMonth}
|
||||||
|
valueStyle={{
|
||||||
|
color:
|
||||||
|
parseFloat(data.totalLastMonth) >=
|
||||||
|
Util.LastMonthTargetHrs(
|
||||||
|
bodyshop.scoreboard_target.dailyBodyTarget,
|
||||||
|
bodyshop
|
||||||
|
) +
|
||||||
|
Util.LastMonthTargetHrs(
|
||||||
|
bodyshop.scoreboard_target.dailyPaintTarget,
|
||||||
|
bodyshop
|
||||||
|
)
|
||||||
|
? "green"
|
||||||
|
: "red",
|
||||||
|
fontSize: statisticSize,
|
||||||
|
fontWeight: statisticWeight,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
<Row gutter={[16, 16]}>
|
||||||
|
<Col span={12}>
|
||||||
|
<Statistic
|
||||||
|
title={
|
||||||
|
<Typography.Text strong>
|
||||||
|
{t("scoreboard.labels.body")}
|
||||||
|
</Typography.Text>
|
||||||
|
}
|
||||||
|
value={data.totalLastMonthLAB}
|
||||||
|
valueStyle={{
|
||||||
|
color:
|
||||||
|
parseFloat(data.totalLastMonthLAB) >=
|
||||||
|
Util.LastMonthTargetHrs(
|
||||||
|
bodyshop.scoreboard_target.dailyBodyTarget,
|
||||||
|
bodyshop
|
||||||
|
)
|
||||||
|
? "green"
|
||||||
|
: "red",
|
||||||
|
fontSize: statisticSize,
|
||||||
|
fontWeight: statisticWeight,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col span={12}>
|
||||||
|
<Statistic
|
||||||
|
title={
|
||||||
|
<Typography.Text strong>
|
||||||
|
{t("scoreboard.labels.refinish")}
|
||||||
|
</Typography.Text>
|
||||||
|
}
|
||||||
|
value={data.totalLastMonthLAR}
|
||||||
|
valueStyle={{
|
||||||
|
color:
|
||||||
|
parseFloat(data.totalLastMonthLAR) >=
|
||||||
|
Util.LastMonthTargetHrs(
|
||||||
|
bodyshop.scoreboard_target.dailyPaintTarget,
|
||||||
|
bodyshop
|
||||||
|
)
|
||||||
|
? "green"
|
||||||
|
: "red",
|
||||||
|
fontSize: statisticSize,
|
||||||
|
fontWeight: statisticWeight,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</Card>
|
||||||
|
</Col>
|
||||||
|
{/* Efficiency Over Period */}
|
||||||
|
<Col span={8} align="center">
|
||||||
|
<Card
|
||||||
|
size="small"
|
||||||
|
title={t("scoreboard.labels.efficiencyoverperiod")}
|
||||||
|
>
|
||||||
|
<Row gutter={[16, 16]}>
|
||||||
|
<Col span={24}>
|
||||||
|
<Statistic
|
||||||
|
value={`${data.totalEffieciencyOverPeriod || 0}%`}
|
||||||
|
valueStyle={{
|
||||||
|
fontSize: statisticSize,
|
||||||
|
fontWeight: statisticWeight,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
<Row gutter={[16, 16]}>
|
||||||
|
<Col span={12}>
|
||||||
|
<Statistic
|
||||||
|
title={
|
||||||
|
<Typography.Text strong>
|
||||||
|
{t("scoreboard.labels.body")}
|
||||||
|
</Typography.Text>
|
||||||
|
}
|
||||||
|
value={`${data.totalEffieciencyOverPeriodLAB || 0}%`}
|
||||||
|
valueStyle={{
|
||||||
|
fontSize: statisticSize,
|
||||||
|
fontWeight: statisticWeight,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col span={12}>
|
||||||
|
<Statistic
|
||||||
|
title={
|
||||||
|
<Typography.Text strong>
|
||||||
|
{t("scoreboard.labels.refinish")}
|
||||||
|
</Typography.Text>
|
||||||
|
}
|
||||||
|
value={`${data.totalEffieciencyOverPeriodLAR || 0}%`}
|
||||||
|
valueStyle={{
|
||||||
|
fontSize: statisticSize,
|
||||||
|
fontWeight: statisticWeight,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</Card>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</Space>
|
||||||
|
{/* Disclaimer */}
|
||||||
|
<Typography.Text type="secondary">
|
||||||
|
*{t("scoreboard.labels.calendarperiod")}
|
||||||
|
</Typography.Text>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</Card>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,285 @@
|
|||||||
|
import { CalendarOutlined } from "@ant-design/icons";
|
||||||
|
import { Card, Col, Divider, Row, Statistic } from "antd";
|
||||||
|
import moment from "moment";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
|
import * as Util from "../scoreboard-targets-table/scoreboard-targets-table.util";
|
||||||
|
|
||||||
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
bodyshop: selectBodyshop,
|
||||||
|
});
|
||||||
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
|
});
|
||||||
|
|
||||||
|
const rowGutter = [16, 16];
|
||||||
|
const statSpans = { xs: 24, sm: 3 };
|
||||||
|
|
||||||
|
export function ScoreboardTimeticketsTargetsTable({ bodyshop }) {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Card title={t("scoreboard.labels.targets")}>
|
||||||
|
<Row gutter={rowGutter}>
|
||||||
|
<Col xs={24} sm={{ offset: 0, span: 3 }} lg={{ span: 3 }}>
|
||||||
|
<Statistic
|
||||||
|
title={t("scoreboard.labels.workingdays")}
|
||||||
|
value={Util.CalculateWorkingDaysThisMonth()}
|
||||||
|
prefix={<CalendarOutlined />}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col xs={24} sm={{ offset: 0, span: 20 }} lg={{ offset: 0, span: 20 }}>
|
||||||
|
<Row>
|
||||||
|
<Col {...statSpans}>
|
||||||
|
<Statistic title="Type" value={t("scoreboard.labels.body")} />
|
||||||
|
</Col>
|
||||||
|
<Col {...statSpans}>
|
||||||
|
<Statistic
|
||||||
|
title={t("scoreboard.labels.dailytarget")}
|
||||||
|
value={bodyshop.scoreboard_target.dailyBodyTarget}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col {...statSpans}>
|
||||||
|
<Statistic
|
||||||
|
title={t("scoreboard.labels.thisweek")}
|
||||||
|
value={Util.WeeklyTargetHrs(
|
||||||
|
bodyshop.scoreboard_target.dailyBodyTarget,
|
||||||
|
moment().startOf("week"),
|
||||||
|
moment().endOf("week"),
|
||||||
|
bodyshop
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col {...statSpans}>
|
||||||
|
<Statistic
|
||||||
|
title={t("scoreboard.labels.lastweek")}
|
||||||
|
value={Util.WeeklyTargetHrs(
|
||||||
|
bodyshop.scoreboard_target.dailyBodyTarget,
|
||||||
|
moment().subtract(1, "week").startOf("week"),
|
||||||
|
moment().subtract(1, "week").endOf("week"),
|
||||||
|
bodyshop
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col {...statSpans}>
|
||||||
|
<Statistic
|
||||||
|
title={t("scoreboard.labels.priorweek")}
|
||||||
|
value={Util.WeeklyTargetHrs(
|
||||||
|
bodyshop.scoreboard_target.dailyBodyTarget,
|
||||||
|
moment().subtract(2, "week").startOf("week"),
|
||||||
|
moment().subtract(2, "week").endOf("week"),
|
||||||
|
bodyshop
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col {...statSpans}>
|
||||||
|
<Statistic
|
||||||
|
title={t("scoreboard.labels.thismonth")}
|
||||||
|
value={Util.MonthlyTargetHrs(
|
||||||
|
bodyshop.scoreboard_target.dailyBodyTarget,
|
||||||
|
bodyshop
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col {...statSpans}>
|
||||||
|
<Statistic
|
||||||
|
title={t("scoreboard.labels.lastmonth")}
|
||||||
|
value={Util.LastMonthTargetHrs(
|
||||||
|
bodyshop.scoreboard_target.dailyBodyTarget,
|
||||||
|
bodyshop
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col {...statSpans}>
|
||||||
|
<Statistic
|
||||||
|
title={t("scoreboard.labels.asoftodaytarget")}
|
||||||
|
value={Util.AsOfTodayTargetHrs(
|
||||||
|
bodyshop.scoreboard_target.dailyBodyTarget,
|
||||||
|
bodyshop
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
<Row>
|
||||||
|
<Col {...statSpans}>
|
||||||
|
<Statistic value={t("scoreboard.labels.refinish")} />
|
||||||
|
</Col>
|
||||||
|
<Col {...statSpans}>
|
||||||
|
<Statistic value={bodyshop.scoreboard_target.dailyPaintTarget} />
|
||||||
|
</Col>
|
||||||
|
<Col {...statSpans}>
|
||||||
|
<Statistic
|
||||||
|
value={Util.WeeklyTargetHrsInPeriod(
|
||||||
|
bodyshop.scoreboard_target.dailyPaintTarget,
|
||||||
|
moment().startOf("week"),
|
||||||
|
moment().endOf("week"),
|
||||||
|
bodyshop
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col {...statSpans}>
|
||||||
|
<Statistic
|
||||||
|
value={Util.WeeklyTargetHrs(
|
||||||
|
bodyshop.scoreboard_target.dailyPaintTarget,
|
||||||
|
moment().subtract(1, "week").startOf("week"),
|
||||||
|
moment().subtract(1, "week").endOf("week"),
|
||||||
|
bodyshop
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col {...statSpans}>
|
||||||
|
<Statistic
|
||||||
|
value={Util.WeeklyTargetHrs(
|
||||||
|
bodyshop.scoreboard_target.dailyPaintTarget,
|
||||||
|
moment().subtract(2, "week").startOf("week"),
|
||||||
|
moment().subtract(2, "week").endOf("week"),
|
||||||
|
bodyshop
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col {...statSpans}>
|
||||||
|
<Statistic
|
||||||
|
value={Util.MonthlyTargetHrs(
|
||||||
|
bodyshop.scoreboard_target.dailyPaintTarget,
|
||||||
|
bodyshop
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col {...statSpans}>
|
||||||
|
<Statistic
|
||||||
|
value={Util.LastMonthTargetHrs(
|
||||||
|
bodyshop.scoreboard_target.dailyPaintTarget,
|
||||||
|
bodyshop
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col {...statSpans}>
|
||||||
|
<Statistic
|
||||||
|
value={Util.AsOfTodayTargetHrs(
|
||||||
|
bodyshop.scoreboard_target.dailyPaintTarget,
|
||||||
|
bodyshop
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
<Row>
|
||||||
|
<Divider style={{ margin: 5 }} />
|
||||||
|
</Row>
|
||||||
|
<Row>
|
||||||
|
<Col {...statSpans}></Col>
|
||||||
|
<Col {...statSpans}>
|
||||||
|
<Statistic
|
||||||
|
value={(
|
||||||
|
bodyshop.scoreboard_target.dailyBodyTarget +
|
||||||
|
bodyshop.scoreboard_target.dailyPaintTarget
|
||||||
|
).toFixed(1)}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col {...statSpans}>
|
||||||
|
<Statistic
|
||||||
|
value={(
|
||||||
|
Util.WeeklyTargetHrs(
|
||||||
|
bodyshop.scoreboard_target.dailyBodyTarget,
|
||||||
|
moment().startOf("week"),
|
||||||
|
moment().endOf("week"),
|
||||||
|
bodyshop
|
||||||
|
) +
|
||||||
|
Util.WeeklyTargetHrs(
|
||||||
|
bodyshop.scoreboard_target.dailyPaintTarget,
|
||||||
|
moment().startOf("week"),
|
||||||
|
moment().endOf("week"),
|
||||||
|
bodyshop
|
||||||
|
)
|
||||||
|
).toFixed(1)}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col {...statSpans}>
|
||||||
|
<Statistic
|
||||||
|
value={(
|
||||||
|
Util.WeeklyTargetHrs(
|
||||||
|
bodyshop.scoreboard_target.dailyBodyTarget,
|
||||||
|
moment().subtract(1, "week").startOf("week"),
|
||||||
|
moment().subtract(1, "week").endOf("week"),
|
||||||
|
bodyshop
|
||||||
|
) +
|
||||||
|
Util.WeeklyTargetHrs(
|
||||||
|
bodyshop.scoreboard_target.dailyPaintTarget,
|
||||||
|
moment().subtract(1, "week").startOf("week"),
|
||||||
|
moment().subtract(1, "week").endOf("week"),
|
||||||
|
bodyshop
|
||||||
|
)
|
||||||
|
).toFixed(1)}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col {...statSpans}>
|
||||||
|
<Statistic
|
||||||
|
value={(
|
||||||
|
Util.WeeklyTargetHrs(
|
||||||
|
bodyshop.scoreboard_target.dailyBodyTarget,
|
||||||
|
moment().subtract(2, "week").startOf("week"),
|
||||||
|
moment().subtract(2, "week").endOf("week"),
|
||||||
|
bodyshop
|
||||||
|
) +
|
||||||
|
Util.WeeklyTargetHrs(
|
||||||
|
bodyshop.scoreboard_target.dailyPaintTarget,
|
||||||
|
moment().subtract(2, "week").startOf("week"),
|
||||||
|
moment().subtract(2, "week").endOf("week"),
|
||||||
|
bodyshop
|
||||||
|
)
|
||||||
|
).toFixed(1)}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col {...statSpans}>
|
||||||
|
<Statistic
|
||||||
|
value={(
|
||||||
|
Util.MonthlyTargetHrs(
|
||||||
|
bodyshop.scoreboard_target.dailyBodyTarget,
|
||||||
|
bodyshop
|
||||||
|
) +
|
||||||
|
Util.MonthlyTargetHrs(
|
||||||
|
bodyshop.scoreboard_target.dailyPaintTarget,
|
||||||
|
bodyshop
|
||||||
|
)
|
||||||
|
).toFixed(1)}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col {...statSpans}>
|
||||||
|
<Statistic
|
||||||
|
value={(
|
||||||
|
Util.LastMonthTargetHrs(
|
||||||
|
bodyshop.scoreboard_target.dailyBodyTarget,
|
||||||
|
bodyshop
|
||||||
|
) +
|
||||||
|
Util.LastMonthTargetHrs(
|
||||||
|
bodyshop.scoreboard_target.dailyPaintTarget,
|
||||||
|
bodyshop
|
||||||
|
)
|
||||||
|
).toFixed(1)}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col {...statSpans}>
|
||||||
|
<Statistic
|
||||||
|
value={(
|
||||||
|
Util.AsOfTodayTargetHrs(
|
||||||
|
bodyshop.scoreboard_target.dailyBodyTarget,
|
||||||
|
bodyshop
|
||||||
|
) +
|
||||||
|
Util.AsOfTodayTargetHrs(
|
||||||
|
bodyshop.scoreboard_target.dailyPaintTarget,
|
||||||
|
bodyshop
|
||||||
|
)
|
||||||
|
).toFixed(1)}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</Card>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
export default connect(
|
||||||
|
mapStateToProps,
|
||||||
|
mapDispatchToProps
|
||||||
|
)(ScoreboardTimeticketsTargetsTable);
|
||||||
@@ -42,6 +42,7 @@ export function ShopInfoGeneral({ form, bodyshop }) {
|
|||||||
bodyshop && bodyshop.imexshopid
|
bodyshop && bodyshop.imexshopid
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<LayoutFormRow
|
<LayoutFormRow
|
||||||
@@ -680,6 +681,13 @@ export function ShopInfoGeneral({ form, bodyshop }) {
|
|||||||
>
|
>
|
||||||
<Select mode="tags" />
|
<Select mode="tags" />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("bodyshop.fields.md_functionality_toggles.parts_queue_toggle")}
|
||||||
|
name={["md_functionality_toggles","parts_queue_toggle"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name={["last_name_first"]}
|
name={["last_name_first"]}
|
||||||
label={t("bodyshop.fields.last_name_first")}
|
label={t("bodyshop.fields.last_name_first")}
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ export function TechLookupJobsList({ bodyshop }) {
|
|||||||
const { loading, error, data, refetch } = useQuery(QUERY_ALL_ACTIVE_JOBS, {
|
const { loading, error, data, refetch } = useQuery(QUERY_ALL_ACTIVE_JOBS, {
|
||||||
variables: {
|
variables: {
|
||||||
statuses: bodyshop.md_ro_statuses.active_statuses || ["Open", "Open*"],
|
statuses: bodyshop.md_ro_statuses.active_statuses || ["Open", "Open*"],
|
||||||
|
isConverted: true,
|
||||||
},
|
},
|
||||||
fetchPolicy: "network-only",
|
fetchPolicy: "network-only",
|
||||||
nextFetchPolicy: "network-only",
|
nextFetchPolicy: "network-only",
|
||||||
|
|||||||
@@ -16,13 +16,12 @@ const VehicleSearchSelect = ({ value, onChange, onBlur, disabled }, ref) => {
|
|||||||
SEARCH_VEHICLES_FOR_AUTOCOMPLETE
|
SEARCH_VEHICLES_FOR_AUTOCOMPLETE
|
||||||
);
|
);
|
||||||
|
|
||||||
const [
|
const [callIdSearch, { loading: idLoading, error: idError, data: idData }] =
|
||||||
callIdSearch,
|
useLazyQuery(SEARCH_VEHICLES_BY_ID_FOR_AUTOCOMPLETE);
|
||||||
{ loading: idLoading, error: idError, data: idData },
|
|
||||||
] = useLazyQuery(SEARCH_VEHICLES_BY_ID_FOR_AUTOCOMPLETE);
|
|
||||||
|
|
||||||
const executeSearch = (v) => {
|
const executeSearch = (v) => {
|
||||||
callSearch(v);
|
if (v && v.variables?.search !== "" && v.variables.search.length >= 2)
|
||||||
|
callSearch(v);
|
||||||
};
|
};
|
||||||
const debouncedExecuteSearch = _.debounce(executeSearch, 500);
|
const debouncedExecuteSearch = _.debounce(executeSearch, 500);
|
||||||
|
|
||||||
|
|||||||
@@ -154,7 +154,6 @@ export function VendorsFormComponent({
|
|||||||
label={t("vendors.fields.phone")}
|
label={t("vendors.fields.phone")}
|
||||||
name="phone"
|
name="phone"
|
||||||
rules={[
|
rules={[
|
||||||
{ required: true, message: t("general.validation.required") },
|
|
||||||
({ getFieldValue }) =>
|
({ getFieldValue }) =>
|
||||||
PhoneItemFormatterValidation(getFieldValue, "phone"),
|
PhoneItemFormatterValidation(getFieldValue, "phone"),
|
||||||
]}
|
]}
|
||||||
|
|||||||
@@ -271,6 +271,7 @@ export const CANCEL_APPOINTMENTS_BY_JOB_ID = gql`
|
|||||||
scheduled_completion
|
scheduled_completion
|
||||||
status
|
status
|
||||||
lost_sale_reason
|
lost_sale_reason
|
||||||
|
date_lost_sale
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ export const QUERY_BODYSHOP = gql`
|
|||||||
logo_img_path
|
logo_img_path
|
||||||
md_ro_statuses
|
md_ro_statuses
|
||||||
md_order_statuses
|
md_order_statuses
|
||||||
|
md_functionality_toggles
|
||||||
shopname
|
shopname
|
||||||
state
|
state
|
||||||
state_tax_id
|
state_tax_id
|
||||||
@@ -158,6 +159,7 @@ export const UPDATE_SHOP = gql`
|
|||||||
logo_img_path
|
logo_img_path
|
||||||
md_ro_statuses
|
md_ro_statuses
|
||||||
md_order_statuses
|
md_order_statuses
|
||||||
|
md_functionality_toggles
|
||||||
shopname
|
shopname
|
||||||
state
|
state
|
||||||
state_tax_id
|
state_tax_id
|
||||||
|
|||||||
@@ -219,6 +219,7 @@ export const GET_JOB_LINES_TO_ENTER_BILL = gql`
|
|||||||
id
|
id
|
||||||
ro_number
|
ro_number
|
||||||
}
|
}
|
||||||
|
v_make_desc
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { gql } from "@apollo/client";
|
import { gql } from "@apollo/client";
|
||||||
|
|
||||||
export const QUERY_ALL_ACTIVE_JOBS = gql`
|
export const QUERY_ALL_ACTIVE_JOBS = gql`
|
||||||
query QUERY_ALL_ACTIVE_JOBS($statuses: [String!]!) {
|
query QUERY_ALL_ACTIVE_JOBS($statuses: [String!]!, $isConverted: Boolean) {
|
||||||
jobs(
|
jobs(
|
||||||
where: { status: { _in: $statuses } }
|
where: { status: { _in: $statuses }, converted: { _eq: $isConverted } }
|
||||||
order_by: { created_at: desc }
|
order_by: { created_at: desc }
|
||||||
) {
|
) {
|
||||||
iouparent
|
iouparent
|
||||||
@@ -432,7 +432,6 @@ export const QUERY_JOB_COSTING_DETAILS = gql`
|
|||||||
status
|
status
|
||||||
ca_bc_pvrt
|
ca_bc_pvrt
|
||||||
ca_customer_gst
|
ca_customer_gst
|
||||||
|
|
||||||
joblines(where: { removed: { _eq: false } }) {
|
joblines(where: { removed: { _eq: false } }) {
|
||||||
id
|
id
|
||||||
unq_seq
|
unq_seq
|
||||||
@@ -676,6 +675,7 @@ export const GET_JOB_BY_PK = gql`
|
|||||||
date_scheduled
|
date_scheduled
|
||||||
date_invoiced
|
date_invoiced
|
||||||
date_last_contacted
|
date_last_contacted
|
||||||
|
date_lost_sale
|
||||||
date_next_contact
|
date_next_contact
|
||||||
date_towin
|
date_towin
|
||||||
date_rentalresp
|
date_rentalresp
|
||||||
@@ -1001,7 +1001,6 @@ export const QUERY_TECH_JOB_DETAILS = gql`
|
|||||||
actual_completion
|
actual_completion
|
||||||
actual_delivery
|
actual_delivery
|
||||||
actual_in
|
actual_in
|
||||||
|
|
||||||
id
|
id
|
||||||
ins_co_nm
|
ins_co_nm
|
||||||
clm_no
|
clm_no
|
||||||
@@ -1079,6 +1078,7 @@ export const UPDATE_JOB = gql`
|
|||||||
actual_in
|
actual_in
|
||||||
date_repairstarted
|
date_repairstarted
|
||||||
date_void
|
date_void
|
||||||
|
date_lost_sale
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1242,7 +1242,7 @@ export const SEARCH_JOBS_FOR_AUTOCOMPLETE = gql`
|
|||||||
) {
|
) {
|
||||||
search_jobs(
|
search_jobs(
|
||||||
args: { search: $search }
|
args: { search: $search }
|
||||||
limit: 50
|
limit: 25
|
||||||
where: {
|
where: {
|
||||||
_and: {
|
_and: {
|
||||||
converted: { _eq: $isConverted }
|
converted: { _eq: $isConverted }
|
||||||
@@ -1586,7 +1586,6 @@ export const QUERY_ALL_JOB_FIELDS = gql`
|
|||||||
clm_title
|
clm_title
|
||||||
clm_total
|
clm_total
|
||||||
clm_zip
|
clm_zip
|
||||||
|
|
||||||
cust_pr
|
cust_pr
|
||||||
ded_amt
|
ded_amt
|
||||||
ded_status
|
ded_status
|
||||||
@@ -1669,7 +1668,6 @@ export const QUERY_ALL_JOB_FIELDS = gql`
|
|||||||
parts_tax_rates
|
parts_tax_rates
|
||||||
pay_amt
|
pay_amt
|
||||||
pay_chknm
|
pay_chknm
|
||||||
|
|
||||||
pay_type
|
pay_type
|
||||||
payee_nms
|
payee_nms
|
||||||
plate_no
|
plate_no
|
||||||
@@ -2077,6 +2075,7 @@ export const QUERY_JOB_EXPORT_DMS = gql`
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const QUERY_RELATED_ROS = gql`
|
export const QUERY_RELATED_ROS = gql`
|
||||||
query QUERY_RELATED_ROS($jobid: uuid!) {
|
query QUERY_RELATED_ROS($jobid: uuid!) {
|
||||||
relatedjobs(
|
relatedjobs(
|
||||||
@@ -2098,6 +2097,7 @@ export const QUERY_RELATED_ROS = gql`
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const INSERT_RELATED_ROS = gql`
|
export const INSERT_RELATED_ROS = gql`
|
||||||
mutation INSERT_RELATED_ROS($relationship: relatedjobs_insert_input!) {
|
mutation INSERT_RELATED_ROS($relationship: relatedjobs_insert_input!) {
|
||||||
insert_relatedjobs_one(object: $relationship) {
|
insert_relatedjobs_one(object: $relationship) {
|
||||||
@@ -2115,6 +2115,7 @@ export const INSERT_RELATED_ROS = gql`
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const DELETE_RELATED_RO = gql`
|
export const DELETE_RELATED_RO = gql`
|
||||||
mutation DELETE_RELATED_RO($relationshipid: uuid!) {
|
mutation DELETE_RELATED_RO($relationshipid: uuid!) {
|
||||||
delete_relatedjobs_by_pk(id: $relationshipid) {
|
delete_relatedjobs_by_pk(id: $relationshipid) {
|
||||||
@@ -2122,6 +2123,7 @@ export const DELETE_RELATED_RO = gql`
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const GET_JOB_LINE_ORDERS = gql`
|
export const GET_JOB_LINE_ORDERS = gql`
|
||||||
query GET_JOB_LINE_ORDERS($joblineid: uuid!) {
|
query GET_JOB_LINE_ORDERS($joblineid: uuid!) {
|
||||||
billlines(where: { joblineid: { _eq: $joblineid } }) {
|
billlines(where: { joblineid: { _eq: $joblineid } }) {
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ export const SEARCH_OWNERS_FOR_AUTOCOMPLETE = gql`
|
|||||||
query SEARCH_OWNERS_FOR_AUTOCOMPLETE($search: String) {
|
query SEARCH_OWNERS_FOR_AUTOCOMPLETE($search: String) {
|
||||||
search_owners(
|
search_owners(
|
||||||
args: { search: $search }
|
args: { search: $search }
|
||||||
limit: 50
|
limit: 25
|
||||||
order_by: { ownr_ln: desc_nulls_last }
|
order_by: { ownr_ln: desc_nulls_last }
|
||||||
) {
|
) {
|
||||||
id
|
id
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ export const QUERY_TIME_TICKETS_IN_RANGE_SB = gql`
|
|||||||
$fixedEnd: date!
|
$fixedEnd: date!
|
||||||
) {
|
) {
|
||||||
timetickets(
|
timetickets(
|
||||||
where: { date: { _gte: $start, _lte: $end } }
|
where: { date: { _gte: $start, _lte: $end }, cost_center: {_neq: "timetickets.labels.shift"} }
|
||||||
order_by: { date: desc_nulls_first }
|
order_by: { date: desc_nulls_first }
|
||||||
) {
|
) {
|
||||||
actualhrs
|
actualhrs
|
||||||
@@ -176,7 +176,7 @@ export const QUERY_TIME_TICKETS_IN_RANGE_SB = gql`
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
fixedperiod: timetickets(
|
fixedperiod: timetickets(
|
||||||
where: { date: { _gte: $fixedStart, _lte: $fixedEnd } }
|
where: { date: { _gte: $fixedStart, _lte: $fixedEnd }, cost_center: {_neq: "timetickets.labels.shift"} }
|
||||||
order_by: { date: desc_nulls_first }
|
order_by: { date: desc_nulls_first }
|
||||||
) {
|
) {
|
||||||
actualhrs
|
actualhrs
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ export const SEARCH_VEHICLES_BY_ID_FOR_AUTOCOMPLETE = gql`
|
|||||||
`;
|
`;
|
||||||
export const SEARCH_VEHICLES_FOR_AUTOCOMPLETE = gql`
|
export const SEARCH_VEHICLES_FOR_AUTOCOMPLETE = gql`
|
||||||
query SEARCH_VEHICLES_FOR_AUTOCOMPLETE($search: String) {
|
query SEARCH_VEHICLES_FOR_AUTOCOMPLETE($search: String) {
|
||||||
search_vehicles(args: { search: $search }, limit: 50) {
|
search_vehicles(args: { search: $search }, limit: 25) {
|
||||||
id
|
id
|
||||||
v_vin
|
v_vin
|
||||||
v_model_yr
|
v_model_yr
|
||||||
|
|||||||
@@ -104,6 +104,7 @@ export const SEARCH_VENDOR_AUTOCOMPLETE = gql`
|
|||||||
id
|
id
|
||||||
cost_center
|
cost_center
|
||||||
active
|
active
|
||||||
|
favorite
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -3,19 +3,19 @@ import Icon, {
|
|||||||
CalendarFilled,
|
CalendarFilled,
|
||||||
DollarCircleOutlined,
|
DollarCircleOutlined,
|
||||||
FileImageFilled,
|
FileImageFilled,
|
||||||
PrinterFilled,
|
|
||||||
ToolFilled,
|
|
||||||
HistoryOutlined,
|
HistoryOutlined,
|
||||||
|
PrinterFilled,
|
||||||
SyncOutlined,
|
SyncOutlined,
|
||||||
|
ToolFilled,
|
||||||
} from "@ant-design/icons";
|
} from "@ant-design/icons";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Divider,
|
Divider,
|
||||||
Form,
|
Form,
|
||||||
notification,
|
|
||||||
PageHeader,
|
PageHeader,
|
||||||
Space,
|
Space,
|
||||||
Tabs,
|
Tabs,
|
||||||
|
notification,
|
||||||
} from "antd";
|
} from "antd";
|
||||||
import Axios from "axios";
|
import Axios from "axios";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
@@ -27,6 +27,7 @@ import { connect } from "react-redux";
|
|||||||
import { useHistory, useLocation } from "react-router-dom";
|
import { useHistory, useLocation } from "react-router-dom";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import FormFieldsChanged from "../../components/form-fields-changed-alert/form-fields-changed-alert.component";
|
import FormFieldsChanged from "../../components/form-fields-changed-alert/form-fields-changed-alert.component";
|
||||||
|
import JobAuditTrail from "../../components/job-audit-trail/job-audit-trail.component";
|
||||||
import JobsLinesContainer from "../../components/job-detail-lines/job-lines.container";
|
import JobsLinesContainer from "../../components/job-detail-lines/job-lines.container";
|
||||||
import JobLineUpsertModalContainer from "../../components/job-lines-upsert-modal/job-lines-upsert-modal.container";
|
import JobLineUpsertModalContainer from "../../components/job-lines-upsert-modal/job-lines-upsert-modal.container";
|
||||||
import JobReconciliationModal from "../../components/job-reconciliation-modal/job-reconciliation.modal.container";
|
import JobReconciliationModal from "../../components/job-reconciliation-modal/job-reconciliation.modal.container";
|
||||||
@@ -42,17 +43,17 @@ import JobsDetailPliContainer from "../../components/jobs-detail-pli/jobs-detail
|
|||||||
import JobsDetailRates from "../../components/jobs-detail-rates/jobs-detail-rates.component";
|
import JobsDetailRates from "../../components/jobs-detail-rates/jobs-detail-rates.component";
|
||||||
import JobsDetailTotals from "../../components/jobs-detail-totals/jobs-detail-totals.component";
|
import JobsDetailTotals from "../../components/jobs-detail-totals/jobs-detail-totals.component";
|
||||||
import JobsDocumentsGalleryContainer from "../../components/jobs-documents-gallery/jobs-documents-gallery.container";
|
import JobsDocumentsGalleryContainer from "../../components/jobs-documents-gallery/jobs-documents-gallery.container";
|
||||||
|
import JobsDocumentsLocalGallery from "../../components/jobs-documents-local-gallery/jobs-documents-local-gallery.container";
|
||||||
import JobNotesContainer from "../../components/jobs-notes/jobs-notes.container";
|
import JobNotesContainer from "../../components/jobs-notes/jobs-notes.container";
|
||||||
|
import NoteUpsertModalComponent from "../../components/note-upsert-modal/note-upsert-modal.container";
|
||||||
import ScheduleJobModalContainer from "../../components/schedule-job-modal/schedule-job-modal.container";
|
import ScheduleJobModalContainer from "../../components/schedule-job-modal/schedule-job-modal.container";
|
||||||
|
import { insertAuditTrail } from "../../redux/application/application.actions";
|
||||||
import { selectJobReadOnly } from "../../redux/application/application.selectors";
|
import { selectJobReadOnly } from "../../redux/application/application.selectors";
|
||||||
import { setModalContext } from "../../redux/modals/modals.actions";
|
import { setModalContext } from "../../redux/modals/modals.actions";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import JobAuditTrail from "../../components/job-audit-trail/job-audit-trail.component";
|
|
||||||
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
||||||
import { insertAuditTrail } from "../../redux/application/application.actions";
|
|
||||||
import JobsDocumentsLocalGallery from "../../components/jobs-documents-local-gallery/jobs-documents-local-gallery.container";
|
|
||||||
import UndefinedToNull from "../../utils/undefinedtonull";
|
import UndefinedToNull from "../../utils/undefinedtonull";
|
||||||
import NoteUpsertModalComponent from "../../components/note-upsert-modal/note-upsert-modal.container";
|
import { DateTimeFormat } from "./../../utils/DateFormatter";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -172,7 +173,7 @@ export function JobsDetailPage({
|
|||||||
operation: AuditTrailMapping.jobfieldchange(
|
operation: AuditTrailMapping.jobfieldchange(
|
||||||
key,
|
key,
|
||||||
changedAuditFields[key] instanceof moment
|
changedAuditFields[key] instanceof moment
|
||||||
? moment(changedAuditFields[key]).format("MM/DD/YYYY hh:mm a")
|
? DateTimeFormat(changedAuditFields[key])
|
||||||
: changedAuditFields[key]
|
: changedAuditFields[key]
|
||||||
),
|
),
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,21 +1,22 @@
|
|||||||
import Icon, { FieldTimeOutlined } from "@ant-design/icons";
|
import Icon, { FieldTimeOutlined } from "@ant-design/icons";
|
||||||
import { Tabs } from "antd";
|
import { Tabs } from "antd";
|
||||||
|
import queryString from "query-string";
|
||||||
import React, { useEffect } from "react";
|
import React, { useEffect } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { FaShieldAlt } from "react-icons/fa";
|
import { FaShieldAlt } from "react-icons/fa";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
|
import { useHistory, useLocation } from "react-router-dom";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import FeatureWrapper from "../../components/feature-wrapper/feature-wrapper.component";
|
import FeatureWrapper from "../../components/feature-wrapper/feature-wrapper.component";
|
||||||
import RbacWrapper from "../../components/rbac-wrapper/rbac-wrapper.component";
|
import RbacWrapper from "../../components/rbac-wrapper/rbac-wrapper.component";
|
||||||
import ScoreboardDisplay from "../../components/scoreboard-display/scoreboard-display.component";
|
import ScoreboardDisplay from "../../components/scoreboard-display/scoreboard-display.component";
|
||||||
|
import ScoreboardTimeTicketsStats from "../../components/scoreboard-timetickets-stats/scoreboard-timetickets.component";
|
||||||
import ScoreboardTimeTickets from "../../components/scoreboard-timetickets/scoreboard-timetickets.component";
|
import ScoreboardTimeTickets from "../../components/scoreboard-timetickets/scoreboard-timetickets.component";
|
||||||
import {
|
import {
|
||||||
setBreadcrumbs,
|
setBreadcrumbs,
|
||||||
setSelectedHeader,
|
setSelectedHeader,
|
||||||
} from "../../redux/application/application.actions";
|
} from "../../redux/application/application.actions";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import queryString from "query-string";
|
|
||||||
import { useHistory, useLocation } from "react-router-dom";
|
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -71,7 +72,7 @@ export function ScoreboardContainer({ setBreadcrumbs, setSelectedHeader }) {
|
|||||||
tab={
|
tab={
|
||||||
<span>
|
<span>
|
||||||
<FieldTimeOutlined />
|
<FieldTimeOutlined />
|
||||||
{t("scoreboard.labels.timetickets")}
|
{t("scoreboard.labels.timeticketsemployee")}
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
destroyInactiveTabPane
|
destroyInactiveTabPane
|
||||||
@@ -79,6 +80,18 @@ export function ScoreboardContainer({ setBreadcrumbs, setSelectedHeader }) {
|
|||||||
>
|
>
|
||||||
<ScoreboardTimeTickets />
|
<ScoreboardTimeTickets />
|
||||||
</Tabs.TabPane>
|
</Tabs.TabPane>
|
||||||
|
<Tabs.TabPane
|
||||||
|
tab={
|
||||||
|
<span>
|
||||||
|
<FieldTimeOutlined />
|
||||||
|
{t("scoreboard.labels.allemployeetimetickets")}
|
||||||
|
</span>
|
||||||
|
}
|
||||||
|
destroyInactiveTabPane
|
||||||
|
key="ticketsstats"
|
||||||
|
>
|
||||||
|
<ScoreboardTimeTicketsStats />
|
||||||
|
</Tabs.TabPane>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</RbacWrapper>
|
</RbacWrapper>
|
||||||
</FeatureWrapper>
|
</FeatureWrapper>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ const INITIAL_STATE = {
|
|||||||
isSending: false,
|
isSending: false,
|
||||||
error: null,
|
error: null,
|
||||||
message: null,
|
message: null,
|
||||||
|
searchingForConversation: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
const messagingReducer = (state = INITIAL_STATE, action) => {
|
const messagingReducer = (state = INITIAL_STATE, action) => {
|
||||||
@@ -17,10 +18,16 @@ const messagingReducer = (state = INITIAL_STATE, action) => {
|
|||||||
...state,
|
...state,
|
||||||
visible: !state.visible,
|
visible: !state.visible,
|
||||||
};
|
};
|
||||||
|
case MessagingActionTypes.OPEN_CHAT_BY_PHONE:
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
searchingForConversation: true,
|
||||||
|
};
|
||||||
case MessagingActionTypes.SET_SELECTED_CONVERSATION:
|
case MessagingActionTypes.SET_SELECTED_CONVERSATION:
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
visible: true,
|
visible: true,
|
||||||
|
searchingForConversation: false,
|
||||||
selectedConversationId: action.payload,
|
selectedConversationId: action.payload,
|
||||||
};
|
};
|
||||||
case MessagingActionTypes.SEND_MESSAGE:
|
case MessagingActionTypes.SEND_MESSAGE:
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { all, call, put, select, takeLatest } from "redux-saga/effects";
|
|||||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||||
import {
|
import {
|
||||||
CONVERSATION_ID_BY_PHONE,
|
CONVERSATION_ID_BY_PHONE,
|
||||||
CREATE_CONVERSATION
|
CREATE_CONVERSATION,
|
||||||
} from "../../graphql/conversations.queries";
|
} from "../../graphql/conversations.queries";
|
||||||
import { INSERT_CONVERSATION_TAG } from "../../graphql/job-conversations.queries";
|
import { INSERT_CONVERSATION_TAG } from "../../graphql/job-conversations.queries";
|
||||||
import client from "../../utils/GraphQLClient";
|
import client from "../../utils/GraphQLClient";
|
||||||
@@ -12,7 +12,7 @@ import { selectBodyshop } from "../user/user.selectors";
|
|||||||
import {
|
import {
|
||||||
sendMessageFailure,
|
sendMessageFailure,
|
||||||
sendMessageSuccess,
|
sendMessageSuccess,
|
||||||
setSelectedConversation
|
setSelectedConversation,
|
||||||
} from "./messaging.actions";
|
} from "./messaging.actions";
|
||||||
import MessagingActionTypes from "./messaging.types";
|
import MessagingActionTypes from "./messaging.types";
|
||||||
|
|
||||||
@@ -79,6 +79,7 @@ export function* openChatByPhone({ payload }) {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
console.log("ERROR: Multiple conversations found. ");
|
console.log("ERROR: Multiple conversations found. ");
|
||||||
|
yield put(setSelectedConversation(null));
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("Error in sendMessage saga.", error);
|
console.log("Error in sendMessage saga.", error);
|
||||||
|
|||||||
@@ -26,3 +26,8 @@ export const selectMessage = createSelector(
|
|||||||
[selectMessaging],
|
[selectMessaging],
|
||||||
(messaging) => messaging.message
|
(messaging) => messaging.message
|
||||||
);
|
);
|
||||||
|
|
||||||
|
export const searchingForConversation = createSelector(
|
||||||
|
[selectMessaging],
|
||||||
|
(messaging) => messaging.searchingForConversation
|
||||||
|
);
|
||||||
|
|||||||
@@ -1,15 +1,17 @@
|
|||||||
import Fingerprint2 from "@fingerprintjs/fingerprintjs";
|
import FingerprintJS from "@fingerprintjs/fingerprintjs";
|
||||||
import * as Sentry from "@sentry/browser";
|
import * as Sentry from "@sentry/browser";
|
||||||
import { notification } from "antd";
|
import { notification } from "antd";
|
||||||
|
import axios from "axios";
|
||||||
import { setUserId, setUserProperties } from "firebase/analytics";
|
import { setUserId, setUserProperties } from "firebase/analytics";
|
||||||
import {
|
import {
|
||||||
checkActionCode,
|
checkActionCode,
|
||||||
confirmPasswordReset,
|
confirmPasswordReset,
|
||||||
|
sendPasswordResetEmail,
|
||||||
signInWithEmailAndPassword,
|
signInWithEmailAndPassword,
|
||||||
signOut,
|
signOut,
|
||||||
sendPasswordResetEmail,
|
|
||||||
} from "firebase/auth";
|
} from "firebase/auth";
|
||||||
import { doc } from "firebase/firestore";
|
import { doc, getDoc, setDoc } from "firebase/firestore";
|
||||||
|
import { getToken } from "firebase/messaging";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
import LogRocket from "logrocket";
|
import LogRocket from "logrocket";
|
||||||
import { all, call, delay, put, select, takeLatest } from "redux-saga/effects";
|
import { all, call, delay, put, select, takeLatest } from "redux-saga/effects";
|
||||||
@@ -20,6 +22,7 @@ import {
|
|||||||
firestore,
|
firestore,
|
||||||
getCurrentUser,
|
getCurrentUser,
|
||||||
logImEXEvent,
|
logImEXEvent,
|
||||||
|
messaging,
|
||||||
updateCurrentUser,
|
updateCurrentUser,
|
||||||
} from "../../firebase/firebase.utils";
|
} from "../../firebase/firebase.utils";
|
||||||
import {
|
import {
|
||||||
@@ -28,6 +31,7 @@ import {
|
|||||||
sendPasswordResetSuccess,
|
sendPasswordResetSuccess,
|
||||||
setAuthlevel,
|
setAuthlevel,
|
||||||
setInstanceConflict,
|
setInstanceConflict,
|
||||||
|
setInstanceId,
|
||||||
setLocalFingerprint,
|
setLocalFingerprint,
|
||||||
signInFailure,
|
signInFailure,
|
||||||
signInSuccess,
|
signInSuccess,
|
||||||
@@ -39,9 +43,8 @@ import {
|
|||||||
validatePasswordResetSuccess,
|
validatePasswordResetSuccess,
|
||||||
} from "./user.actions";
|
} from "./user.actions";
|
||||||
import UserActionTypes from "./user.types";
|
import UserActionTypes from "./user.types";
|
||||||
import axios from "axios";
|
|
||||||
import { messaging } from "../../firebase/firebase.utils";
|
const fpPromise = FingerprintJS.load();
|
||||||
import { getToken } from "firebase/messaging";
|
|
||||||
|
|
||||||
export function* onEmailSignInStart() {
|
export function* onEmailSignInStart() {
|
||||||
yield takeLatest(UserActionTypes.EMAIL_SIGN_IN_START, signInWithEmail);
|
yield takeLatest(UserActionTypes.EMAIL_SIGN_IN_START, signInWithEmail);
|
||||||
@@ -148,17 +151,15 @@ export function* setInstanceIdSaga({ payload: uid }) {
|
|||||||
try {
|
try {
|
||||||
const userInstanceRef = doc(firestore, `userInstance/${uid}`);
|
const userInstanceRef = doc(firestore, `userInstance/${uid}`);
|
||||||
|
|
||||||
const fingerprint = Fingerprint2.x64hash128(
|
// Get the visitor identifier when you need it.
|
||||||
(yield Fingerprint2.getPromise({})).map((c) => c.value).join(""),
|
const fp = yield fpPromise;
|
||||||
31
|
const result = yield fp.get();
|
||||||
);
|
yield setDoc(userInstanceRef, {
|
||||||
|
|
||||||
yield userInstanceRef.set({
|
|
||||||
timestamp: new Date(),
|
timestamp: new Date(),
|
||||||
fingerprint,
|
fingerprint: result.visitorId,
|
||||||
});
|
});
|
||||||
|
|
||||||
yield put(setLocalFingerprint(fingerprint));
|
yield put(setLocalFingerprint(result.visitorId));
|
||||||
yield delay(5 * 60 * 1000);
|
yield delay(5 * 60 * 1000);
|
||||||
if (process.env.NODE_ENV === "production") yield put(checkInstanceId(uid));
|
if (process.env.NODE_ENV === "production") yield put(checkInstanceId(uid));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -171,11 +172,9 @@ export function* onCheckInstanceId() {
|
|||||||
}
|
}
|
||||||
export function* checkInstanceIdSaga({ payload: uid }) {
|
export function* checkInstanceIdSaga({ payload: uid }) {
|
||||||
try {
|
try {
|
||||||
const userInstanceRef = doc(firestore, `userInstance/${uid}`);
|
const snapshot = yield getDoc(doc(firestore, `userInstance/${uid}`));
|
||||||
|
|
||||||
const snapshot = yield userInstanceRef.get();
|
|
||||||
let fingerprint = yield select((state) => state.user.fingerprint);
|
let fingerprint = yield select((state) => state.user.fingerprint);
|
||||||
|
yield put(setInstanceConflict());
|
||||||
if (snapshot.data().fingerprint === fingerprint) {
|
if (snapshot.data().fingerprint === fingerprint) {
|
||||||
yield delay(5 * 60 * 1000);
|
yield delay(5 * 60 * 1000);
|
||||||
yield put(checkInstanceId(uid));
|
yield put(checkInstanceId(uid));
|
||||||
@@ -215,7 +214,6 @@ export function* signInSuccessSaga({ payload }) {
|
|||||||
console.log("Error updating Crisp settings.", error);
|
console.log("Error updating Crisp settings.", error);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (!payload.email.includes("@imex.")) yield put(setInstanceId(payload.uid));
|
|
||||||
setUserId(analytics, payload.email);
|
setUserId(analytics, payload.email);
|
||||||
setUserProperties(analytics, payload);
|
setUserProperties(analytics, payload);
|
||||||
yield logImEXEvent("redux_sign_in_success");
|
yield logImEXEvent("redux_sign_in_success");
|
||||||
@@ -289,6 +287,14 @@ export function* SetAuthLevelFromShopDetails({ payload }) {
|
|||||||
: { validemail: false }
|
: { validemail: false }
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (payload.features.singleDeviceOnly) {
|
||||||
|
const user = yield select((state) => state.user.currentUser);
|
||||||
|
|
||||||
|
if (!(user.email.includes("@imex.") || user.email.includes("@rome.")))
|
||||||
|
yield put(setInstanceId(user.uid));
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
window.$crisp.push(["set", "user:company", [payload.shopname]]);
|
window.$crisp.push(["set", "user:company", [payload.shopname]]);
|
||||||
if (authRecord[0] && authRecord[0].user.validemail) {
|
if (authRecord[0] && authRecord[0].user.validemail) {
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
"preview": "Preview",
|
"preview": "Preview",
|
||||||
"reschedule": "Reschedule",
|
"reschedule": "Reschedule",
|
||||||
"sendreminder": "Send Reminder",
|
"sendreminder": "Send Reminder",
|
||||||
|
"unblock": "Unblock",
|
||||||
"viewjob": "View Job"
|
"viewjob": "View Job"
|
||||||
},
|
},
|
||||||
"errors": {
|
"errors": {
|
||||||
@@ -102,6 +103,8 @@
|
|||||||
"admin_jobmarkforreexport": "ADMIN: Job marked for re-export.",
|
"admin_jobmarkforreexport": "ADMIN: Job marked for re-export.",
|
||||||
"admin_jobuninvoice": "ADMIN: Job has been uninvoiced.",
|
"admin_jobuninvoice": "ADMIN: Job has been uninvoiced.",
|
||||||
"admin_jobunvoid": "ADMIN: Job has been unvoided.",
|
"admin_jobunvoid": "ADMIN: Job has been unvoided.",
|
||||||
|
"appointmentcancel": "Appointment canceled. Lost Reason: {{lost_sale_reason}}.",
|
||||||
|
"appointmentinsert": "Appointment created. Appointment Date: {{start}}.",
|
||||||
"billposted": "Bill with invoice number {{invoice_number}} posted.",
|
"billposted": "Bill with invoice number {{invoice_number}} posted.",
|
||||||
"billupdated": "Bill with invoice number {{invoice_number}} updated.",
|
"billupdated": "Bill with invoice number {{invoice_number}} updated.",
|
||||||
"failedpayment": "Failed payment",
|
"failedpayment": "Failed payment",
|
||||||
@@ -346,6 +349,9 @@
|
|||||||
},
|
},
|
||||||
"md_payment_types": "Payment Types",
|
"md_payment_types": "Payment Types",
|
||||||
"md_referral_sources": "Referral Sources",
|
"md_referral_sources": "Referral Sources",
|
||||||
|
"md_functionality_toggles": {
|
||||||
|
"parts_queue_toggle": "Auto Add Imported/Supplemented Jobs to Parts Queue"
|
||||||
|
},
|
||||||
"md_tasks_presets": {
|
"md_tasks_presets": {
|
||||||
"hourstype": "",
|
"hourstype": "",
|
||||||
"memo": "",
|
"memo": "",
|
||||||
@@ -854,14 +860,16 @@
|
|||||||
"refhrs": "Refinish Hrs"
|
"refhrs": "Refinish Hrs"
|
||||||
},
|
},
|
||||||
"titles": {
|
"titles": {
|
||||||
|
"labhours": "Total Body Hours",
|
||||||
|
"larhours": "Total Refinish Hours",
|
||||||
"monthlyemployeeefficiency": "Monthly Employee Efficiency",
|
"monthlyemployeeefficiency": "Monthly Employee Efficiency",
|
||||||
"monthlyjobcosting": "Monthly Job Costing ",
|
"monthlyjobcosting": "Monthly Job Costing ",
|
||||||
"monthlylaborsales": "Monthly Labor Sales",
|
"monthlylaborsales": "Monthly Labor Sales",
|
||||||
"monthlypartssales": "Monthly Parts Sales",
|
"monthlypartssales": "Monthly Parts Sales",
|
||||||
"monthlyrevenuegraph": "Monthly Revenue Graph",
|
"monthlyrevenuegraph": "Monthly Revenue Graph",
|
||||||
"prodhrssummary": "Production Hours Summary",
|
"prodhrssummary": "Production Hours Summary",
|
||||||
"productiondollars": "Total dollars in Production",
|
"productiondollars": "Total Dollars in Production",
|
||||||
"productionhours": "Total hours in Production",
|
"productionhours": "Total Hours in Production",
|
||||||
"projectedmonthlysales": "Projected Monthly Sales",
|
"projectedmonthlysales": "Projected Monthly Sales",
|
||||||
"scheduledintoday": "Sheduled In Today: {{date}}",
|
"scheduledintoday": "Sheduled In Today: {{date}}",
|
||||||
"scheduledouttoday": "Sheduled Out Today: {{date}}"
|
"scheduledouttoday": "Sheduled Out Today: {{date}}"
|
||||||
@@ -1114,6 +1122,7 @@
|
|||||||
"total": "Total",
|
"total": "Total",
|
||||||
"totals": "Totals",
|
"totals": "Totals",
|
||||||
"tuesday": "Tuesday",
|
"tuesday": "Tuesday",
|
||||||
|
"tvmode": "TV Mode",
|
||||||
"unknown": "Unknown",
|
"unknown": "Unknown",
|
||||||
"username": "Username",
|
"username": "Username",
|
||||||
"view": "View",
|
"view": "View",
|
||||||
@@ -1440,6 +1449,7 @@
|
|||||||
"date_exported": "Exported",
|
"date_exported": "Exported",
|
||||||
"date_invoiced": "Invoiced",
|
"date_invoiced": "Invoiced",
|
||||||
"date_last_contacted": "Last Contacted Date",
|
"date_last_contacted": "Last Contacted Date",
|
||||||
|
"date_lost_sale": "Lost Sale",
|
||||||
"date_next_contact": "Next Contact Date",
|
"date_next_contact": "Next Contact Date",
|
||||||
"date_open": "Open",
|
"date_open": "Open",
|
||||||
"date_rentalresp": "Shop Rental Responsibility Start",
|
"date_rentalresp": "Shop Rental Responsibility Start",
|
||||||
@@ -1462,6 +1472,7 @@
|
|||||||
"cost_dms_acctnumber": "Cost DMS Acct #",
|
"cost_dms_acctnumber": "Cost DMS Acct #",
|
||||||
"dms_make": "DMS Make",
|
"dms_make": "DMS Make",
|
||||||
"dms_model": "DMS Model",
|
"dms_model": "DMS Model",
|
||||||
|
"dms_model_override": "Override DMS Make/Model",
|
||||||
"dms_unsold": "New, Unsold Vehicle",
|
"dms_unsold": "New, Unsold Vehicle",
|
||||||
"dms_wip_acctnumber": "Cost WIP DMS Acct #",
|
"dms_wip_acctnumber": "Cost WIP DMS Acct #",
|
||||||
"id": "DMS ID",
|
"id": "DMS ID",
|
||||||
@@ -2191,7 +2202,7 @@
|
|||||||
"parts_orders": "Parts Orders",
|
"parts_orders": "Parts Orders",
|
||||||
"print": "Show Printed Form",
|
"print": "Show Printed Form",
|
||||||
"receive": "Receive Parts Order",
|
"receive": "Receive Parts Order",
|
||||||
"removefrompartsqueue": "Remove from Parts Queue?",
|
"removefrompartsqueue": "Unqueue from Parts Queue?",
|
||||||
"returnpartsorder": "Return Parts Order",
|
"returnpartsorder": "Return Parts Order",
|
||||||
"sublet_order": "Sublet Order"
|
"sublet_order": "Sublet Order"
|
||||||
},
|
},
|
||||||
@@ -2565,18 +2576,22 @@
|
|||||||
"gsr_labor_only": "Gross Sales - Labor Only",
|
"gsr_labor_only": "Gross Sales - Labor Only",
|
||||||
"hours_sold_detail_closed": "Hours Sold Detail - Closed",
|
"hours_sold_detail_closed": "Hours Sold Detail - Closed",
|
||||||
"hours_sold_detail_closed_csr": "Hours Sold Detail - Closed by CSR",
|
"hours_sold_detail_closed_csr": "Hours Sold Detail - Closed by CSR",
|
||||||
|
"hours_sold_detail_closed_estimator": "Hours Sold Detail - Closed by Estimator",
|
||||||
"hours_sold_detail_closed_ins_co": "Hours Sold Detail - Closed by Source",
|
"hours_sold_detail_closed_ins_co": "Hours Sold Detail - Closed by Source",
|
||||||
"hours_sold_detail_closed_status": "Hours Sold Detail - Closed by Status",
|
"hours_sold_detail_closed_status": "Hours Sold Detail - Closed by Status",
|
||||||
"hours_sold_detail_open": "Hours Sold Detail - Open",
|
"hours_sold_detail_open": "Hours Sold Detail - Open",
|
||||||
"hours_sold_detail_open_csr": "Hours Sold Detail - Open by CSR",
|
"hours_sold_detail_open_csr": "Hours Sold Detail - Open by CSR",
|
||||||
|
"hours_sold_detail_open_estimator": "Hours Sold Detail - Open by Estimator",
|
||||||
"hours_sold_detail_open_ins_co": "Hours Sold Detail - Open by Source",
|
"hours_sold_detail_open_ins_co": "Hours Sold Detail - Open by Source",
|
||||||
"hours_sold_detail_open_status": "Hours Sold Detail - Open by Status",
|
"hours_sold_detail_open_status": "Hours Sold Detail - Open by Status",
|
||||||
"hours_sold_summary_closed": "Hours Sold Summary - Closed",
|
"hours_sold_summary_closed": "Hours Sold Summary - Closed",
|
||||||
"hours_sold_summary_closed_csr": "Hours Sold Summary - Closed by CSR",
|
"hours_sold_summary_closed_csr": "Hours Sold Summary - Closed by CSR",
|
||||||
|
"hours_sold_summary_closed_estimator": "Hours Sold Summary - Closed by Estimator",
|
||||||
"hours_sold_summary_closed_ins_co": "Hours Sold Summary - Closed by Source",
|
"hours_sold_summary_closed_ins_co": "Hours Sold Summary - Closed by Source",
|
||||||
"hours_sold_summary_closed_status": "Hours Sold Summary - Closed by Status",
|
"hours_sold_summary_closed_status": "Hours Sold Summary - Closed by Status",
|
||||||
"hours_sold_summary_open": "Hours Sold Summary - Open",
|
"hours_sold_summary_open": "Hours Sold Summary - Open",
|
||||||
"hours_sold_summary_open_csr": "Hours Sold Summary - Open CSR",
|
"hours_sold_summary_open_csr": "Hours Sold Summary - Open CSR",
|
||||||
|
"hours_sold_summary_open_estimator": "Hours Sold Summary - Open Estimator",
|
||||||
"hours_sold_summary_open_ins_co": "Hours Sold Summary - Open by Source",
|
"hours_sold_summary_open_ins_co": "Hours Sold Summary - Open by Source",
|
||||||
"hours_sold_summary_open_status": "Hours Sold Summary - Open by Status",
|
"hours_sold_summary_open_status": "Hours Sold Summary - Open by Status",
|
||||||
"job_costing_ro_csr": "Job Costing by CSR",
|
"job_costing_ro_csr": "Job Costing by CSR",
|
||||||
@@ -2589,10 +2604,12 @@
|
|||||||
"jobs_reconcile": "Parts/Sublet/Labor Reconciliation",
|
"jobs_reconcile": "Parts/Sublet/Labor Reconciliation",
|
||||||
"jobs_scheduled_completion": "Jobs Scheduled Completion",
|
"jobs_scheduled_completion": "Jobs Scheduled Completion",
|
||||||
"lag_time": "Lag Time",
|
"lag_time": "Lag Time",
|
||||||
|
"lost_sales": "Lost Sales",
|
||||||
"open_orders": "Open Orders by Date",
|
"open_orders": "Open Orders by Date",
|
||||||
"open_orders_csr": "Open Orders by CSR",
|
"open_orders_csr": "Open Orders by CSR",
|
||||||
"open_orders_estimator": "Open Orders by Estimator",
|
"open_orders_estimator": "Open Orders by Estimator",
|
||||||
"open_orders_ins_co": "Open Orders by Insurance Company",
|
"open_orders_ins_co": "Open Orders by Insurance Company",
|
||||||
|
"open_orders_referral": "Open Orders by Referral Source",
|
||||||
"open_orders_specific_csr": "Open Orders filtered by CSR",
|
"open_orders_specific_csr": "Open Orders filtered by CSR",
|
||||||
"open_orders_status": "Open Orders by Status",
|
"open_orders_status": "Open Orders by Status",
|
||||||
"parts_backorder": "IOU Parts List",
|
"parts_backorder": "IOU Parts List",
|
||||||
@@ -2667,8 +2684,12 @@
|
|||||||
"painthrs": "Paint Hours"
|
"painthrs": "Paint Hours"
|
||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
|
"allemployeetimetickets": "All Employee Time Tickets",
|
||||||
"asoftodaytarget": "As of Today",
|
"asoftodaytarget": "As of Today",
|
||||||
|
"body": "Body",
|
||||||
|
"bodycharttitle": "Body Targets vs Actual",
|
||||||
"calendarperiod": "Periods based on calendar weeks/months.",
|
"calendarperiod": "Periods based on calendar weeks/months.",
|
||||||
|
"combinedcharttitle": "Combined Targets vs Actual",
|
||||||
"dailyactual": "Actual (D)",
|
"dailyactual": "Actual (D)",
|
||||||
"dailytarget": "Daily",
|
"dailytarget": "Daily",
|
||||||
"efficiencyoverperiod": "Efficiency over Selected Dates",
|
"efficiencyoverperiod": "Efficiency over Selected Dates",
|
||||||
@@ -2677,12 +2698,16 @@
|
|||||||
"lastmonth": "Last Month",
|
"lastmonth": "Last Month",
|
||||||
"lastweek": "Last Week",
|
"lastweek": "Last Week",
|
||||||
"monthlytarget": "Monthly",
|
"monthlytarget": "Monthly",
|
||||||
|
"priorweek": "Prior Week",
|
||||||
"productivestatistics": "Productive Hours Statistics",
|
"productivestatistics": "Productive Hours Statistics",
|
||||||
"productivetimeticketsoverdate": "Productive Hours over Selected Dates",
|
"productivetimeticketsoverdate": "Productive Hours over Selected Dates",
|
||||||
|
"refinish": "Refinish",
|
||||||
|
"refinishcharttitle": "Refinish Targets vs Actual",
|
||||||
"targets": "Targets",
|
"targets": "Targets",
|
||||||
"thismonth": "This Month",
|
"thismonth": "This Month",
|
||||||
"thisweek": "This Week",
|
"thisweek": "This Week",
|
||||||
"timetickets": "Timetickets",
|
"timetickets": "Time Tickets",
|
||||||
|
"timeticketsemployee": "Time Tickets by Employee",
|
||||||
"todateactual": "Actual (MTD)",
|
"todateactual": "Actual (MTD)",
|
||||||
"totaloverperiod": "Total over Selected Dates",
|
"totaloverperiod": "Total over Selected Dates",
|
||||||
"weeklyactual": "Actual (W)",
|
"weeklyactual": "Actual (W)",
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
"preview": "",
|
"preview": "",
|
||||||
"reschedule": "Reprogramar",
|
"reschedule": "Reprogramar",
|
||||||
"sendreminder": "",
|
"sendreminder": "",
|
||||||
|
"unblock": "",
|
||||||
"viewjob": "Ver trabajo"
|
"viewjob": "Ver trabajo"
|
||||||
},
|
},
|
||||||
"errors": {
|
"errors": {
|
||||||
@@ -102,6 +103,8 @@
|
|||||||
"admin_jobmarkforreexport": "",
|
"admin_jobmarkforreexport": "",
|
||||||
"admin_jobuninvoice": "",
|
"admin_jobuninvoice": "",
|
||||||
"admin_jobunvoid": "",
|
"admin_jobunvoid": "",
|
||||||
|
"appointmentcancel": "",
|
||||||
|
"appointmentinsert": "",
|
||||||
"billposted": "",
|
"billposted": "",
|
||||||
"billupdated": "",
|
"billupdated": "",
|
||||||
"failedpayment": "",
|
"failedpayment": "",
|
||||||
@@ -251,6 +254,9 @@
|
|||||||
"address1": "",
|
"address1": "",
|
||||||
"address2": "",
|
"address2": "",
|
||||||
"appt_alt_transport": "",
|
"appt_alt_transport": "",
|
||||||
|
"md_functionality_toggles": {
|
||||||
|
"parts_queue_toggle": ""
|
||||||
|
},
|
||||||
"appt_colors": {
|
"appt_colors": {
|
||||||
"color": "",
|
"color": "",
|
||||||
"label": ""
|
"label": ""
|
||||||
@@ -854,6 +860,8 @@
|
|||||||
"refhrs": ""
|
"refhrs": ""
|
||||||
},
|
},
|
||||||
"titles": {
|
"titles": {
|
||||||
|
"labhours": "",
|
||||||
|
"larhours": "",
|
||||||
"monthlyemployeeefficiency": "",
|
"monthlyemployeeefficiency": "",
|
||||||
"monthlyjobcosting": "",
|
"monthlyjobcosting": "",
|
||||||
"monthlylaborsales": "",
|
"monthlylaborsales": "",
|
||||||
@@ -1114,6 +1122,7 @@
|
|||||||
"total": "",
|
"total": "",
|
||||||
"totals": "",
|
"totals": "",
|
||||||
"tuesday": "",
|
"tuesday": "",
|
||||||
|
"tvmode": "",
|
||||||
"unknown": "Desconocido",
|
"unknown": "Desconocido",
|
||||||
"username": "",
|
"username": "",
|
||||||
"view": "",
|
"view": "",
|
||||||
@@ -1440,6 +1449,7 @@
|
|||||||
"date_exported": "Exportado",
|
"date_exported": "Exportado",
|
||||||
"date_invoiced": "Facturado",
|
"date_invoiced": "Facturado",
|
||||||
"date_last_contacted": "",
|
"date_last_contacted": "",
|
||||||
|
"date_lost_sale": "",
|
||||||
"date_next_contact": "",
|
"date_next_contact": "",
|
||||||
"date_open": "Abierto",
|
"date_open": "Abierto",
|
||||||
"date_rentalresp": "",
|
"date_rentalresp": "",
|
||||||
@@ -1462,6 +1472,7 @@
|
|||||||
"cost_dms_acctnumber": "",
|
"cost_dms_acctnumber": "",
|
||||||
"dms_make": "",
|
"dms_make": "",
|
||||||
"dms_model": "",
|
"dms_model": "",
|
||||||
|
"dms_model_override": "",
|
||||||
"dms_unsold": "",
|
"dms_unsold": "",
|
||||||
"dms_wip_acctnumber": "",
|
"dms_wip_acctnumber": "",
|
||||||
"id": "",
|
"id": "",
|
||||||
@@ -2565,18 +2576,22 @@
|
|||||||
"gsr_labor_only": "",
|
"gsr_labor_only": "",
|
||||||
"hours_sold_detail_closed": "",
|
"hours_sold_detail_closed": "",
|
||||||
"hours_sold_detail_closed_csr": "",
|
"hours_sold_detail_closed_csr": "",
|
||||||
|
"hours_sold_detail_closed_estimator": "",
|
||||||
"hours_sold_detail_closed_ins_co": "",
|
"hours_sold_detail_closed_ins_co": "",
|
||||||
"hours_sold_detail_closed_status": "",
|
"hours_sold_detail_closed_status": "",
|
||||||
"hours_sold_detail_open": "",
|
"hours_sold_detail_open": "",
|
||||||
"hours_sold_detail_open_csr": "",
|
"hours_sold_detail_open_csr": "",
|
||||||
|
"hours_sold_detail_open_estimator": "",
|
||||||
"hours_sold_detail_open_ins_co": "",
|
"hours_sold_detail_open_ins_co": "",
|
||||||
"hours_sold_detail_open_status": "",
|
"hours_sold_detail_open_status": "",
|
||||||
"hours_sold_summary_closed": "",
|
"hours_sold_summary_closed": "",
|
||||||
"hours_sold_summary_closed_csr": "",
|
"hours_sold_summary_closed_csr": "",
|
||||||
|
"hours_sold_summary_closed_estimator": "",
|
||||||
"hours_sold_summary_closed_ins_co": "",
|
"hours_sold_summary_closed_ins_co": "",
|
||||||
"hours_sold_summary_closed_status": "",
|
"hours_sold_summary_closed_status": "",
|
||||||
"hours_sold_summary_open": "",
|
"hours_sold_summary_open": "",
|
||||||
"hours_sold_summary_open_csr": "",
|
"hours_sold_summary_open_csr": "",
|
||||||
|
"hours_sold_summary_open_estimator": "",
|
||||||
"hours_sold_summary_open_ins_co": "",
|
"hours_sold_summary_open_ins_co": "",
|
||||||
"hours_sold_summary_open_status": "",
|
"hours_sold_summary_open_status": "",
|
||||||
"job_costing_ro_csr": "",
|
"job_costing_ro_csr": "",
|
||||||
@@ -2589,10 +2604,12 @@
|
|||||||
"jobs_reconcile": "",
|
"jobs_reconcile": "",
|
||||||
"jobs_scheduled_completion": "",
|
"jobs_scheduled_completion": "",
|
||||||
"lag_time": "",
|
"lag_time": "",
|
||||||
|
"lost_sales": "",
|
||||||
"open_orders": "",
|
"open_orders": "",
|
||||||
"open_orders_csr": "",
|
"open_orders_csr": "",
|
||||||
"open_orders_estimator": "",
|
"open_orders_estimator": "",
|
||||||
"open_orders_ins_co": "",
|
"open_orders_ins_co": "",
|
||||||
|
"open_orders_referral": "",
|
||||||
"open_orders_specific_csr": "",
|
"open_orders_specific_csr": "",
|
||||||
"open_orders_status": "",
|
"open_orders_status": "",
|
||||||
"parts_backorder": "",
|
"parts_backorder": "",
|
||||||
@@ -2667,8 +2684,12 @@
|
|||||||
"painthrs": ""
|
"painthrs": ""
|
||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
|
"allemployeetimetickets": "",
|
||||||
"asoftodaytarget": "",
|
"asoftodaytarget": "",
|
||||||
|
"body": "",
|
||||||
|
"bodycharttitle": "",
|
||||||
"calendarperiod": "",
|
"calendarperiod": "",
|
||||||
|
"combinedcharttitle": "",
|
||||||
"dailyactual": "",
|
"dailyactual": "",
|
||||||
"dailytarget": "",
|
"dailytarget": "",
|
||||||
"efficiencyoverperiod": "",
|
"efficiencyoverperiod": "",
|
||||||
@@ -2677,12 +2698,16 @@
|
|||||||
"lastmonth": "",
|
"lastmonth": "",
|
||||||
"lastweek": "",
|
"lastweek": "",
|
||||||
"monthlytarget": "",
|
"monthlytarget": "",
|
||||||
|
"priorweek": "",
|
||||||
"productivestatistics": "",
|
"productivestatistics": "",
|
||||||
"productivetimeticketsoverdate": "",
|
"productivetimeticketsoverdate": "",
|
||||||
|
"refinish": "",
|
||||||
|
"refinishcharttitle": "",
|
||||||
"targets": "",
|
"targets": "",
|
||||||
"thismonth": "",
|
"thismonth": "",
|
||||||
"thisweek": "",
|
"thisweek": "",
|
||||||
"timetickets": "",
|
"timetickets": "",
|
||||||
|
"timeticketsemployee": "",
|
||||||
"todateactual": "",
|
"todateactual": "",
|
||||||
"totaloverperiod": "",
|
"totaloverperiod": "",
|
||||||
"weeklyactual": "",
|
"weeklyactual": "",
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
"preview": "",
|
"preview": "",
|
||||||
"reschedule": "Replanifier",
|
"reschedule": "Replanifier",
|
||||||
"sendreminder": "",
|
"sendreminder": "",
|
||||||
|
"unblock": "",
|
||||||
"viewjob": "Voir le travail"
|
"viewjob": "Voir le travail"
|
||||||
},
|
},
|
||||||
"errors": {
|
"errors": {
|
||||||
@@ -102,6 +103,8 @@
|
|||||||
"admin_jobmarkforreexport": "",
|
"admin_jobmarkforreexport": "",
|
||||||
"admin_jobuninvoice": "",
|
"admin_jobuninvoice": "",
|
||||||
"admin_jobunvoid": "",
|
"admin_jobunvoid": "",
|
||||||
|
"appointmentcancel": "",
|
||||||
|
"appointmentinsert": "",
|
||||||
"billposted": "",
|
"billposted": "",
|
||||||
"billupdated": "",
|
"billupdated": "",
|
||||||
"failedpayment": "",
|
"failedpayment": "",
|
||||||
@@ -328,6 +331,9 @@
|
|||||||
"paint": "",
|
"paint": "",
|
||||||
"prep": ""
|
"prep": ""
|
||||||
},
|
},
|
||||||
|
"md_functionality_toggles": {
|
||||||
|
"parts_queue_toggle": ""
|
||||||
|
},
|
||||||
"md_ins_co": {
|
"md_ins_co": {
|
||||||
"city": "",
|
"city": "",
|
||||||
"name": "",
|
"name": "",
|
||||||
@@ -854,6 +860,8 @@
|
|||||||
"refhrs": ""
|
"refhrs": ""
|
||||||
},
|
},
|
||||||
"titles": {
|
"titles": {
|
||||||
|
"labhours": "",
|
||||||
|
"larhours": "",
|
||||||
"monthlyemployeeefficiency": "",
|
"monthlyemployeeefficiency": "",
|
||||||
"monthlyjobcosting": "",
|
"monthlyjobcosting": "",
|
||||||
"monthlylaborsales": "",
|
"monthlylaborsales": "",
|
||||||
@@ -1114,6 +1122,7 @@
|
|||||||
"total": "",
|
"total": "",
|
||||||
"totals": "",
|
"totals": "",
|
||||||
"tuesday": "",
|
"tuesday": "",
|
||||||
|
"tvmode": "",
|
||||||
"unknown": "Inconnu",
|
"unknown": "Inconnu",
|
||||||
"username": "",
|
"username": "",
|
||||||
"view": "",
|
"view": "",
|
||||||
@@ -1440,6 +1449,7 @@
|
|||||||
"date_exported": "Exportés",
|
"date_exported": "Exportés",
|
||||||
"date_invoiced": "Facturé",
|
"date_invoiced": "Facturé",
|
||||||
"date_last_contacted": "",
|
"date_last_contacted": "",
|
||||||
|
"date_lost_sale": "",
|
||||||
"date_next_contact": "",
|
"date_next_contact": "",
|
||||||
"date_open": "Ouvrir",
|
"date_open": "Ouvrir",
|
||||||
"date_rentalresp": "",
|
"date_rentalresp": "",
|
||||||
@@ -1462,6 +1472,7 @@
|
|||||||
"cost_dms_acctnumber": "",
|
"cost_dms_acctnumber": "",
|
||||||
"dms_make": "",
|
"dms_make": "",
|
||||||
"dms_model": "",
|
"dms_model": "",
|
||||||
|
"dms_model_override": "",
|
||||||
"dms_unsold": "",
|
"dms_unsold": "",
|
||||||
"dms_wip_acctnumber": "",
|
"dms_wip_acctnumber": "",
|
||||||
"id": "",
|
"id": "",
|
||||||
@@ -2565,18 +2576,22 @@
|
|||||||
"gsr_labor_only": "",
|
"gsr_labor_only": "",
|
||||||
"hours_sold_detail_closed": "",
|
"hours_sold_detail_closed": "",
|
||||||
"hours_sold_detail_closed_csr": "",
|
"hours_sold_detail_closed_csr": "",
|
||||||
|
"hours_sold_detail_closed_estimator": "",
|
||||||
"hours_sold_detail_closed_ins_co": "",
|
"hours_sold_detail_closed_ins_co": "",
|
||||||
"hours_sold_detail_closed_status": "",
|
"hours_sold_detail_closed_status": "",
|
||||||
"hours_sold_detail_open": "",
|
"hours_sold_detail_open": "",
|
||||||
"hours_sold_detail_open_csr": "",
|
"hours_sold_detail_open_csr": "",
|
||||||
|
"hours_sold_detail_open_estimator": "",
|
||||||
"hours_sold_detail_open_ins_co": "",
|
"hours_sold_detail_open_ins_co": "",
|
||||||
"hours_sold_detail_open_status": "",
|
"hours_sold_detail_open_status": "",
|
||||||
"hours_sold_summary_closed": "",
|
"hours_sold_summary_closed": "",
|
||||||
"hours_sold_summary_closed_csr": "",
|
"hours_sold_summary_closed_csr": "",
|
||||||
|
"hours_sold_summary_closed_estimator": "",
|
||||||
"hours_sold_summary_closed_ins_co": "",
|
"hours_sold_summary_closed_ins_co": "",
|
||||||
"hours_sold_summary_closed_status": "",
|
"hours_sold_summary_closed_status": "",
|
||||||
"hours_sold_summary_open": "",
|
"hours_sold_summary_open": "",
|
||||||
"hours_sold_summary_open_csr": "",
|
"hours_sold_summary_open_csr": "",
|
||||||
|
"hours_sold_summary_open_estimator": "",
|
||||||
"hours_sold_summary_open_ins_co": "",
|
"hours_sold_summary_open_ins_co": "",
|
||||||
"hours_sold_summary_open_status": "",
|
"hours_sold_summary_open_status": "",
|
||||||
"job_costing_ro_csr": "",
|
"job_costing_ro_csr": "",
|
||||||
@@ -2589,10 +2604,12 @@
|
|||||||
"jobs_reconcile": "",
|
"jobs_reconcile": "",
|
||||||
"jobs_scheduled_completion": "",
|
"jobs_scheduled_completion": "",
|
||||||
"lag_time": "",
|
"lag_time": "",
|
||||||
|
"lost_sales": "",
|
||||||
"open_orders": "",
|
"open_orders": "",
|
||||||
"open_orders_csr": "",
|
"open_orders_csr": "",
|
||||||
"open_orders_estimator": "",
|
"open_orders_estimator": "",
|
||||||
"open_orders_ins_co": "",
|
"open_orders_ins_co": "",
|
||||||
|
"open_orders_referral": "",
|
||||||
"open_orders_specific_csr": "",
|
"open_orders_specific_csr": "",
|
||||||
"open_orders_status": "",
|
"open_orders_status": "",
|
||||||
"parts_backorder": "",
|
"parts_backorder": "",
|
||||||
@@ -2667,8 +2684,12 @@
|
|||||||
"painthrs": ""
|
"painthrs": ""
|
||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
|
"allemployeetimetickets": "",
|
||||||
"asoftodaytarget": "",
|
"asoftodaytarget": "",
|
||||||
|
"body": "",
|
||||||
|
"bodycharttitle": "",
|
||||||
"calendarperiod": "",
|
"calendarperiod": "",
|
||||||
|
"combinedcharttitle": "",
|
||||||
"dailyactual": "",
|
"dailyactual": "",
|
||||||
"dailytarget": "",
|
"dailytarget": "",
|
||||||
"efficiencyoverperiod": "",
|
"efficiencyoverperiod": "",
|
||||||
@@ -2677,12 +2698,16 @@
|
|||||||
"lastmonth": "",
|
"lastmonth": "",
|
||||||
"lastweek": "",
|
"lastweek": "",
|
||||||
"monthlytarget": "",
|
"monthlytarget": "",
|
||||||
|
"priorweek": "",
|
||||||
"productivestatistics": "",
|
"productivestatistics": "",
|
||||||
"productivetimeticketsoverdate": "",
|
"productivetimeticketsoverdate": "",
|
||||||
|
"refinish": "",
|
||||||
|
"refinishcharttitle": "",
|
||||||
"targets": "",
|
"targets": "",
|
||||||
"thismonth": "",
|
"thismonth": "",
|
||||||
"thisweek": "",
|
"thisweek": "",
|
||||||
"timetickets": "",
|
"timetickets": "",
|
||||||
|
"timeticketsemployee": "",
|
||||||
"todateactual": "",
|
"todateactual": "",
|
||||||
"totaloverperiod": "",
|
"totaloverperiod": "",
|
||||||
"weeklyactual": "",
|
"weeklyactual": "",
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
import i18n from "i18next";
|
import i18n from "i18next";
|
||||||
|
|
||||||
const AuditTrailMapping = {
|
const AuditTrailMapping = {
|
||||||
|
appointmentcancel: (lost_sale_reason) =>
|
||||||
|
i18n.t("audit_trail.messages.appointmentcancel", { lost_sale_reason }),
|
||||||
|
appointmentinsert: (start) =>
|
||||||
|
i18n.t("audit_trail.messages.appointmentinsert", { start }),
|
||||||
jobstatuschange: (status) =>
|
jobstatuschange: (status) =>
|
||||||
i18n.t("audit_trail.messages.jobstatuschange", { status }),
|
i18n.t("audit_trail.messages.jobstatuschange", { status }),
|
||||||
admin_jobstatuschange: (status) =>
|
admin_jobstatuschange: (status) =>
|
||||||
|
|||||||
@@ -31,3 +31,7 @@ export function TimeAgoFormatter(props) {
|
|||||||
</Tooltip>
|
</Tooltip>
|
||||||
) : null;
|
) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function DateTimeFormat(value) {
|
||||||
|
return moment(value).format("MM/DD/YYYY hh:mm A");
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,15 +1,14 @@
|
|||||||
import { gql } from "@apollo/client";
|
import { gql } from "@apollo/client";
|
||||||
import { notification } from "antd";
|
|
||||||
import jsreport from "@jsreport/browser-client";
|
import jsreport from "@jsreport/browser-client";
|
||||||
|
import { notification } from "antd";
|
||||||
|
import axios from "axios";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import moment from "moment";
|
|
||||||
import { auth } from "../firebase/firebase.utils";
|
import { auth } from "../firebase/firebase.utils";
|
||||||
import { setEmailOptions } from "../redux/email/email.actions";
|
import { setEmailOptions } from "../redux/email/email.actions";
|
||||||
import { store } from "../redux/store";
|
import { store } from "../redux/store";
|
||||||
import client from "../utils/GraphQLClient";
|
import client from "../utils/GraphQLClient";
|
||||||
import { TemplateList } from "./TemplateConstants";
|
|
||||||
import cleanAxios from "./CleanAxios";
|
import cleanAxios from "./CleanAxios";
|
||||||
import axios from "axios";
|
import { TemplateList } from "./TemplateConstants";
|
||||||
const server = process.env.REACT_APP_REPORTS_SERVER_URL;
|
const server = process.env.REACT_APP_REPORTS_SERVER_URL;
|
||||||
|
|
||||||
jsreport.serverUrl = server;
|
jsreport.serverUrl = server;
|
||||||
@@ -255,7 +254,7 @@ export async function RenderTemplates(
|
|||||||
headerpath: `/${bodyshop.imexshopid}/header.html`,
|
headerpath: `/${bodyshop.imexshopid}/header.html`,
|
||||||
footerpath: `/${bodyshop.imexshopid}/footer.html`,
|
footerpath: `/${bodyshop.imexshopid}/footer.html`,
|
||||||
bodyshop: bodyshop,
|
bodyshop: bodyshop,
|
||||||
offset: moment().utcOffset(),
|
offset: bodyshop.timezone,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -818,6 +818,74 @@ export const TemplateList = (type, context) => {
|
|||||||
},
|
},
|
||||||
group: "sales",
|
group: "sales",
|
||||||
},
|
},
|
||||||
|
hours_sold_detail_closed_estimator: {
|
||||||
|
title: i18n.t(
|
||||||
|
"reportcenter.templates.hours_sold_detail_closed_estimator"
|
||||||
|
),
|
||||||
|
description: "",
|
||||||
|
subject: i18n.t(
|
||||||
|
"reportcenter.templates.hours_sold_detail_closed_estimator"
|
||||||
|
),
|
||||||
|
key: "hours_sold_detail_closed_estimator",
|
||||||
|
//idtype: "vendor",
|
||||||
|
disabled: false,
|
||||||
|
rangeFilter: {
|
||||||
|
object: i18n.t("reportcenter.labels.objects.jobs"),
|
||||||
|
field: i18n.t("jobs.fields.date_invoiced"),
|
||||||
|
},
|
||||||
|
group: "sales",
|
||||||
|
},
|
||||||
|
hours_sold_detail_open_estimator: {
|
||||||
|
title: i18n.t(
|
||||||
|
"reportcenter.templates.hours_sold_detail_open_estimator"
|
||||||
|
),
|
||||||
|
description: "",
|
||||||
|
subject: i18n.t(
|
||||||
|
"reportcenter.templates.hours_sold_detail_open_estimator"
|
||||||
|
),
|
||||||
|
key: "hours_sold_detail_open_estimator",
|
||||||
|
//idtype: "vendor",
|
||||||
|
disabled: false,
|
||||||
|
rangeFilter: {
|
||||||
|
object: i18n.t("reportcenter.labels.objects.jobs"),
|
||||||
|
field: i18n.t("jobs.fields.date_open"),
|
||||||
|
},
|
||||||
|
group: "sales",
|
||||||
|
},
|
||||||
|
hours_sold_summary_closed_estimator: {
|
||||||
|
title: i18n.t(
|
||||||
|
"reportcenter.templates.hours_sold_summary_closed_estimator"
|
||||||
|
),
|
||||||
|
description: "",
|
||||||
|
subject: i18n.t(
|
||||||
|
"reportcenter.templates.hours_sold_summary_closed_estimator"
|
||||||
|
),
|
||||||
|
key: "hours_sold_summary_closed_estimator",
|
||||||
|
//idtype: "vendor",
|
||||||
|
disabled: false,
|
||||||
|
rangeFilter: {
|
||||||
|
object: i18n.t("reportcenter.labels.objects.jobs"),
|
||||||
|
field: i18n.t("jobs.fields.date_invoiced"),
|
||||||
|
},
|
||||||
|
group: "sales",
|
||||||
|
},
|
||||||
|
hours_sold_summary_open_estimator: {
|
||||||
|
title: i18n.t(
|
||||||
|
"reportcenter.templates.hours_sold_summary_open_estimator"
|
||||||
|
),
|
||||||
|
description: "",
|
||||||
|
subject: i18n.t(
|
||||||
|
"reportcenter.templates.hours_sold_summary_open_estimator"
|
||||||
|
),
|
||||||
|
key: "hours_sold_summary_open_estimator",
|
||||||
|
//idtype: "vendor",
|
||||||
|
disabled: false,
|
||||||
|
rangeFilter: {
|
||||||
|
object: i18n.t("reportcenter.labels.objects.jobs"),
|
||||||
|
field: i18n.t("jobs.fields.date_invoiced"),
|
||||||
|
},
|
||||||
|
group: "sales",
|
||||||
|
},
|
||||||
hours_sold_summary_open_status: {
|
hours_sold_summary_open_status: {
|
||||||
title: i18n.t(
|
title: i18n.t(
|
||||||
"reportcenter.templates.hours_sold_summary_open_status"
|
"reportcenter.templates.hours_sold_summary_open_status"
|
||||||
@@ -1434,6 +1502,19 @@ export const TemplateList = (type, context) => {
|
|||||||
},
|
},
|
||||||
group: "jobs",
|
group: "jobs",
|
||||||
},
|
},
|
||||||
|
open_orders_specific_csr: {
|
||||||
|
title: i18n.t("reportcenter.templates.open_orders_specific_csr"),
|
||||||
|
description: "",
|
||||||
|
subject: i18n.t("reportcenter.templates.open_orders_specific_csr"),
|
||||||
|
key: "open_orders_specific_csr",
|
||||||
|
idtype: "employee",
|
||||||
|
disabled: false,
|
||||||
|
rangeFilter: {
|
||||||
|
object: i18n.t("reportcenter.labels.objects.jobs"),
|
||||||
|
field: i18n.t("jobs.fields.date_open"),
|
||||||
|
},
|
||||||
|
group: "jobs",
|
||||||
|
},
|
||||||
open_orders_estimator: {
|
open_orders_estimator: {
|
||||||
title: i18n.t("reportcenter.templates.open_orders_estimator"),
|
title: i18n.t("reportcenter.templates.open_orders_estimator"),
|
||||||
description: "",
|
description: "",
|
||||||
@@ -1460,12 +1541,12 @@ export const TemplateList = (type, context) => {
|
|||||||
},
|
},
|
||||||
group: "jobs",
|
group: "jobs",
|
||||||
},
|
},
|
||||||
open_orders_specific_csr: {
|
open_orders_referral: {
|
||||||
title: i18n.t("reportcenter.templates.open_orders_specific_csr"),
|
title: i18n.t("reportcenter.templates.open_orders_referral"),
|
||||||
description: "",
|
description: "",
|
||||||
subject: i18n.t("reportcenter.templates.open_orders_specific_csr"),
|
subject: i18n.t("reportcenter.templates.open_orders_referral"),
|
||||||
key: "open_orders_specific_csr",
|
key: "open_orders_referral",
|
||||||
idtype: "employee",
|
//idtype: "vendor",
|
||||||
disabled: false,
|
disabled: false,
|
||||||
rangeFilter: {
|
rangeFilter: {
|
||||||
object: i18n.t("reportcenter.labels.objects.jobs"),
|
object: i18n.t("reportcenter.labels.objects.jobs"),
|
||||||
@@ -1933,6 +2014,18 @@ export const TemplateList = (type, context) => {
|
|||||||
},
|
},
|
||||||
group: "jobs",
|
group: "jobs",
|
||||||
},
|
},
|
||||||
|
lost_sales: {
|
||||||
|
title: i18n.t("reportcenter.templates.lost_sales"),
|
||||||
|
subject: i18n.t("reportcenter.templates.lost_sales"),
|
||||||
|
key: "lost_sales",
|
||||||
|
//idtype: "vendor",
|
||||||
|
disabled: false,
|
||||||
|
rangeFilter: {
|
||||||
|
object: i18n.t("reportcenter.labels.objects.jobs"),
|
||||||
|
field: i18n.t("jobs.fields.date_lost_sale"),
|
||||||
|
},
|
||||||
|
group: "customers",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
: {}),
|
: {}),
|
||||||
...(!type || type === "courtesycarcontract"
|
...(!type || type === "courtesycarcontract"
|
||||||
|
|||||||
@@ -12,6 +12,13 @@ export default async function FcmHandler({ client, payload }) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
client.cache.modify({
|
||||||
|
fields: {
|
||||||
|
messages_aggregate(cached) {
|
||||||
|
return { aggregate: { count: cached.aggregate.count + 1 } };
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
case "messaging-outbound":
|
case "messaging-outbound":
|
||||||
client.cache.modify({
|
client.cache.modify({
|
||||||
@@ -30,6 +37,7 @@ export default async function FcmHandler({ client, payload }) {
|
|||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case "messaging-mark-conversation-read":
|
case "messaging-mark-conversation-read":
|
||||||
|
let previousUnreadCount = 0;
|
||||||
client.cache.modify({
|
client.cache.modify({
|
||||||
id: client.cache.identify({
|
id: client.cache.identify({
|
||||||
__typename: "conversations",
|
__typename: "conversations",
|
||||||
@@ -37,10 +45,22 @@ export default async function FcmHandler({ client, payload }) {
|
|||||||
}),
|
}),
|
||||||
fields: {
|
fields: {
|
||||||
messages_aggregate(cached) {
|
messages_aggregate(cached) {
|
||||||
|
previousUnreadCount = cached.aggregate.count;
|
||||||
return { aggregate: { count: 0 } };
|
return { aggregate: { count: 0 } };
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
client.cache.modify({
|
||||||
|
fields: {
|
||||||
|
messages_aggregate(cached) {
|
||||||
|
return {
|
||||||
|
aggregate: {
|
||||||
|
count: cached.aggregate.count - previousUnreadCount,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
console.log("No payload type set.");
|
console.log("No payload type set.");
|
||||||
|
|||||||
4642
client/yarn.lock
4642
client/yarn.lock
File diff suppressed because it is too large
Load Diff
@@ -110,6 +110,7 @@
|
|||||||
- canceled
|
- canceled
|
||||||
- color
|
- color
|
||||||
- created_at
|
- created_at
|
||||||
|
- created_by
|
||||||
- end
|
- end
|
||||||
- id
|
- id
|
||||||
- isintake
|
- isintake
|
||||||
@@ -128,6 +129,7 @@
|
|||||||
- canceled
|
- canceled
|
||||||
- color
|
- color
|
||||||
- created_at
|
- created_at
|
||||||
|
- created_by
|
||||||
- end
|
- end
|
||||||
- id
|
- id
|
||||||
- isintake
|
- isintake
|
||||||
@@ -156,6 +158,7 @@
|
|||||||
- canceled
|
- canceled
|
||||||
- color
|
- color
|
||||||
- created_at
|
- created_at
|
||||||
|
- created_by
|
||||||
- end
|
- end
|
||||||
- id
|
- id
|
||||||
- isintake
|
- isintake
|
||||||
@@ -887,11 +890,13 @@
|
|||||||
- appt_colors
|
- appt_colors
|
||||||
- appt_length
|
- appt_length
|
||||||
- attach_pdf_to_email
|
- attach_pdf_to_email
|
||||||
|
- autohouseid
|
||||||
- bill_allow_post_to_closed
|
- bill_allow_post_to_closed
|
||||||
- bill_tax_rates
|
- bill_tax_rates
|
||||||
- cdk_configuration
|
- cdk_configuration
|
||||||
- cdk_dealerid
|
- cdk_dealerid
|
||||||
- city
|
- city
|
||||||
|
- claimscorpid
|
||||||
- country
|
- country
|
||||||
- created_at
|
- created_at
|
||||||
- default_adjustment_rate
|
- default_adjustment_rate
|
||||||
@@ -925,6 +930,7 @@
|
|||||||
- md_estimators
|
- md_estimators
|
||||||
- md_filehandlers
|
- md_filehandlers
|
||||||
- md_from_emails
|
- md_from_emails
|
||||||
|
- md_functionality_toggles
|
||||||
- md_hour_split
|
- md_hour_split
|
||||||
- md_ins_cos
|
- md_ins_cos
|
||||||
- md_jobline_presets
|
- md_jobline_presets
|
||||||
@@ -1023,6 +1029,7 @@
|
|||||||
- md_estimators
|
- md_estimators
|
||||||
- md_filehandlers
|
- md_filehandlers
|
||||||
- md_from_emails
|
- md_from_emails
|
||||||
|
- md_functionality_toggles
|
||||||
- md_hour_split
|
- md_hour_split
|
||||||
- md_ins_cos
|
- md_ins_cos
|
||||||
- md_jobline_presets
|
- md_jobline_presets
|
||||||
@@ -3274,6 +3281,7 @@
|
|||||||
- cat_no
|
- cat_no
|
||||||
- category
|
- category
|
||||||
- cieca_pfl
|
- cieca_pfl
|
||||||
|
- cieca_pfo
|
||||||
- cieca_pft
|
- cieca_pft
|
||||||
- cieca_stl
|
- cieca_stl
|
||||||
- cieca_ttl
|
- cieca_ttl
|
||||||
@@ -3542,6 +3550,7 @@
|
|||||||
- cat_no
|
- cat_no
|
||||||
- category
|
- category
|
||||||
- cieca_pfl
|
- cieca_pfl
|
||||||
|
- cieca_pfo
|
||||||
- cieca_pft
|
- cieca_pft
|
||||||
- cieca_stl
|
- cieca_stl
|
||||||
- cieca_ttl
|
- cieca_ttl
|
||||||
@@ -3578,6 +3587,7 @@
|
|||||||
- date_exported
|
- date_exported
|
||||||
- date_invoiced
|
- date_invoiced
|
||||||
- date_last_contacted
|
- date_last_contacted
|
||||||
|
- date_lost_sale
|
||||||
- date_next_contact
|
- date_next_contact
|
||||||
- date_open
|
- date_open
|
||||||
- date_rentalresp
|
- date_rentalresp
|
||||||
@@ -3821,6 +3831,7 @@
|
|||||||
- cat_no
|
- cat_no
|
||||||
- category
|
- category
|
||||||
- cieca_pfl
|
- cieca_pfl
|
||||||
|
- cieca_pfo
|
||||||
- cieca_pft
|
- cieca_pft
|
||||||
- cieca_stl
|
- cieca_stl
|
||||||
- cieca_ttl
|
- cieca_ttl
|
||||||
@@ -3857,6 +3868,7 @@
|
|||||||
- date_exported
|
- date_exported
|
||||||
- date_invoiced
|
- date_invoiced
|
||||||
- date_last_contacted
|
- date_last_contacted
|
||||||
|
- date_lost_sale
|
||||||
- date_next_contact
|
- date_next_contact
|
||||||
- date_open
|
- date_open
|
||||||
- date_rentalresp
|
- date_rentalresp
|
||||||
@@ -4073,12 +4085,7 @@
|
|||||||
event_triggers:
|
event_triggers:
|
||||||
- name: job_status_transition
|
- name: job_status_transition
|
||||||
definition:
|
definition:
|
||||||
enable_manual: false
|
enable_manual: true
|
||||||
insert:
|
|
||||||
columns: '*'
|
|
||||||
update:
|
|
||||||
columns:
|
|
||||||
- status
|
|
||||||
retry_conf:
|
retry_conf:
|
||||||
interval_sec: 10
|
interval_sec: 10
|
||||||
num_retries: 0
|
num_retries: 0
|
||||||
@@ -4088,29 +4095,14 @@
|
|||||||
- name: event-secret
|
- name: event-secret
|
||||||
value_from_env: EVENT_SECRET
|
value_from_env: EVENT_SECRET
|
||||||
request_transform:
|
request_transform:
|
||||||
|
method: POST
|
||||||
query_params: {}
|
query_params: {}
|
||||||
template_engine: Kriti
|
template_engine: Kriti
|
||||||
url: '{{$base_url}}/job/statustransition'
|
url: '{{$base_url}}/job/statustransition'
|
||||||
version: 2
|
version: 2
|
||||||
- name: jobs_arms
|
- name: jobs_arms
|
||||||
definition:
|
definition:
|
||||||
enable_manual: false
|
enable_manual: true
|
||||||
update:
|
|
||||||
columns:
|
|
||||||
- actual_delivery
|
|
||||||
- scheduled_delivery
|
|
||||||
- scheduled_completion
|
|
||||||
- actual_completion
|
|
||||||
- date_scheduled
|
|
||||||
- inproduction
|
|
||||||
- clm_total
|
|
||||||
- suspended
|
|
||||||
- job_totals
|
|
||||||
- converted
|
|
||||||
- employee_body
|
|
||||||
- ro_number
|
|
||||||
- actual_in
|
|
||||||
- scheduled_in
|
|
||||||
retry_conf:
|
retry_conf:
|
||||||
interval_sec: 10
|
interval_sec: 10
|
||||||
num_retries: 0
|
num_retries: 0
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
-- Could not auto-generate a down migration.
|
||||||
|
-- Please write an appropriate down migration for the SQL below:
|
||||||
|
-- alter table "public"."jobs" add column "cieca_pfo" jsonb
|
||||||
|
-- null default jsonb_build_object();
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
alter table "public"."jobs" add column "cieca_pfo" jsonb
|
||||||
|
null default jsonb_build_object();
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
-- Could not auto-generate a down migration.
|
||||||
|
-- Please write an appropriate down migration for the SQL below:
|
||||||
|
-- alter table "public"."appointments" add column "created_by" text
|
||||||
|
-- null;
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
alter table "public"."appointments" add column "created_by" text
|
||||||
|
null;
|
||||||
38
hasura/migrations/1699662574943_run_sql_migration/down.sql
Normal file
38
hasura/migrations/1699662574943_run_sql_migration/down.sql
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
-- Could not auto-generate a down migration.
|
||||||
|
-- Please write an appropriate down migration for the SQL below:
|
||||||
|
-- CREATE OR REPLACE FUNCTION public.search_cccontracts(search text)
|
||||||
|
-- RETURNS SETOF cccontracts
|
||||||
|
-- LANGUAGE plpgsql
|
||||||
|
-- STABLE
|
||||||
|
-- AS $function$
|
||||||
|
-- BEGIN
|
||||||
|
-- IF search = '' THEN
|
||||||
|
-- RETURN query
|
||||||
|
-- SELECT
|
||||||
|
-- *
|
||||||
|
-- FROM
|
||||||
|
-- cccontracts c;
|
||||||
|
-- ELSE
|
||||||
|
-- RETURN query
|
||||||
|
-- SELECT
|
||||||
|
-- contracts.*
|
||||||
|
-- FROM
|
||||||
|
-- courtesycars cars,
|
||||||
|
-- jobs jobs,
|
||||||
|
-- cccontracts contracts
|
||||||
|
-- WHERE (jobs.ro_number ILIKE '%' || search || '%'
|
||||||
|
-- OR jobs.ownr_fn ILIKE '%' || search || '%'
|
||||||
|
-- OR jobs.ownr_ln ILIKE '%' || search || '%'
|
||||||
|
-- OR jobs.ownr_co_nm ILIKE '%' || search || '%'
|
||||||
|
-- OR (cast(contracts.agreementnumber as text)) ILIKE '%' || search || '%'
|
||||||
|
-- OR contracts.driver_fn ILIKE '%' || search || '%'
|
||||||
|
-- OR contracts.driver_ln ILIKE '%' || search || '%'
|
||||||
|
-- OR cars.fleetnumber ILIKE '%' || search || '%'
|
||||||
|
-- OR cars.make ILIKE '%' || search || '%'
|
||||||
|
-- OR cars.model ILIKE '%' || search || '%'
|
||||||
|
-- OR cars.plate ILIKE '%' || search || '%')
|
||||||
|
-- AND contracts.jobid = jobs.id
|
||||||
|
-- AND contracts.courtesycarid = cars.id;
|
||||||
|
-- END IF;
|
||||||
|
-- END
|
||||||
|
-- $function$;
|
||||||
36
hasura/migrations/1699662574943_run_sql_migration/up.sql
Normal file
36
hasura/migrations/1699662574943_run_sql_migration/up.sql
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
CREATE OR REPLACE FUNCTION public.search_cccontracts(search text)
|
||||||
|
RETURNS SETOF cccontracts
|
||||||
|
LANGUAGE plpgsql
|
||||||
|
STABLE
|
||||||
|
AS $function$
|
||||||
|
BEGIN
|
||||||
|
IF search = '' THEN
|
||||||
|
RETURN query
|
||||||
|
SELECT
|
||||||
|
*
|
||||||
|
FROM
|
||||||
|
cccontracts c;
|
||||||
|
ELSE
|
||||||
|
RETURN query
|
||||||
|
SELECT
|
||||||
|
contracts.*
|
||||||
|
FROM
|
||||||
|
courtesycars cars,
|
||||||
|
jobs jobs,
|
||||||
|
cccontracts contracts
|
||||||
|
WHERE (jobs.ro_number ILIKE '%' || search || '%'
|
||||||
|
OR jobs.ownr_fn ILIKE '%' || search || '%'
|
||||||
|
OR jobs.ownr_ln ILIKE '%' || search || '%'
|
||||||
|
OR jobs.ownr_co_nm ILIKE '%' || search || '%'
|
||||||
|
OR (cast(contracts.agreementnumber as text)) ILIKE '%' || search || '%'
|
||||||
|
OR contracts.driver_fn ILIKE '%' || search || '%'
|
||||||
|
OR contracts.driver_ln ILIKE '%' || search || '%'
|
||||||
|
OR cars.fleetnumber ILIKE '%' || search || '%'
|
||||||
|
OR cars.make ILIKE '%' || search || '%'
|
||||||
|
OR cars.model ILIKE '%' || search || '%'
|
||||||
|
OR cars.plate ILIKE '%' || search || '%')
|
||||||
|
AND contracts.jobid = jobs.id
|
||||||
|
AND contracts.courtesycarid = cars.id;
|
||||||
|
END IF;
|
||||||
|
END
|
||||||
|
$function$;
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
-- Could not auto-generate a down migration.
|
||||||
|
-- Please write an appropriate down migration for the SQL below:
|
||||||
|
-- alter table "public"."bodyshops" add column "md_functionality_toggles" jsonb
|
||||||
|
-- null default jsonb_build_object();
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
alter table "public"."bodyshops" add column "md_functionality_toggles" jsonb
|
||||||
|
null default jsonb_build_object();
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
-- Could not auto-generate a down migration.
|
||||||
|
-- Please write an appropriate down migration for the SQL below:
|
||||||
|
-- alter table "public"."jobs" add column "date_lost_sale" timestamp with time zone
|
||||||
|
-- null;
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
alter table "public"."jobs" add column "date_lost_sale" timestamp with time zone
|
||||||
|
null;
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
ALTER TABLE "public"."jobs" ALTER COLUMN "date_lost_sale" TYPE timestamp with time zone;
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
ALTER TABLE "public"."jobs" ALTER COLUMN "date_lost_sale" TYPE timestamp with time zone;
|
||||||
7156
package-lock.json
generated
Normal file
7156
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
61
package.json
61
package.json
@@ -3,64 +3,63 @@
|
|||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"license": "UNLICENSED",
|
"license": "UNLICENSED",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16.0.0",
|
"node": ">=18.0.0",
|
||||||
"npm": ">=8.0.0"
|
"npm": ">=8.0.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"setup": "rm -rf node_modules && yarn && cd client && rm -rf node_modules && yarn",
|
"setup": "rm -rf node_modules && npm i && cd client && rm -rf node_modules && npm i",
|
||||||
"admin": "cd admin && yarn start",
|
"admin": "cd admin && npm start",
|
||||||
"client": "cd client && yarn start",
|
"client": "cd client && npm start",
|
||||||
"server": "nodemon server.js",
|
"server": "nodemon server.js",
|
||||||
"build": "cd client && yarn run build",
|
"build": "cd client && npm run build",
|
||||||
"dev": "concurrently --kill-others-on-fail \"yarn run server\" \"yarn run client\"",
|
"dev": "concurrently --kill-others-on-fail \"npm run server\" \"npm run client\"",
|
||||||
"deva": "concurrently --kill-others-on-fail \"yarn run server\" \"yarn run client\" \"yarn run admin\"",
|
"deva": "concurrently --kill-others-on-fail \"npm run server\" \"npm run client\" \"npm run admin\"",
|
||||||
"start": "node server.js"
|
"start": "node server.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@aws-sdk/client-secrets-manager": "^3.388.0",
|
"@aws-sdk/client-secrets-manager": "^3.454.0",
|
||||||
"@aws-sdk/credential-provider-node": "^3.319.0",
|
"@aws-sdk/client-ses": "^3.454.0",
|
||||||
"@opensearch-project/opensearch": "^2.2.1",
|
"@aws-sdk/credential-provider-node": "^3.451.0",
|
||||||
"aws-sdk": "^2.1326.0",
|
"@opensearch-project/opensearch": "^2.4.0",
|
||||||
"aws4": "^1.12.0",
|
"aws4": "^1.12.0",
|
||||||
"axios": "^0.27.2",
|
"axios": "^1.6.2",
|
||||||
"bluebird": "^3.7.2",
|
"bluebird": "^3.7.2",
|
||||||
"body-parser": "^1.20.2",
|
"body-parser": "^1.20.2",
|
||||||
"cloudinary": "^1.34.0",
|
"cloudinary": "^1.41.0",
|
||||||
"compression": "^1.7.4",
|
"compression": "^1.7.4",
|
||||||
"cookie-parser": "^1.4.6",
|
"cookie-parser": "^1.4.6",
|
||||||
"cors": "2.8.5",
|
"cors": "2.8.5",
|
||||||
"csrf": "^3.1.0",
|
"csrf": "^3.1.0",
|
||||||
"dinero.js": "^1.9.1",
|
"dinero.js": "^1.9.1",
|
||||||
"dotenv": "16.0.3",
|
"dotenv": "^16.3.1",
|
||||||
"express": "^4.18.2",
|
"express": "^4.18.2",
|
||||||
"firebase-admin": "^11.5.0",
|
"firebase-admin": "^11.11.0",
|
||||||
"graphql": "^16.6.0",
|
"graphql": "^16.8.1",
|
||||||
"graphql-request": "^4.2.0",
|
"graphql-request": "^6.1.0",
|
||||||
"graylog2": "^0.2.1",
|
"graylog2": "^0.2.1",
|
||||||
"inline-css": "^4.0.2",
|
"inline-css": "^4.0.2",
|
||||||
"intuit-oauth": "^4.0.0",
|
"intuit-oauth": "^4.0.0",
|
||||||
"json-2-csv": "^3.19.0",
|
"json-2-csv": "^5.0.1",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"moment": "^2.29.4",
|
"moment": "^2.29.4",
|
||||||
"moment-timezone": "^0.5.41",
|
"moment-timezone": "^0.5.41",
|
||||||
"multer": "^1.4.5-lts.1",
|
"multer": "^1.4.5-lts.1",
|
||||||
"node-mailjet": "^6.0.2",
|
"node-mailjet": "^6.0.4",
|
||||||
"node-persist": "^3.1.3",
|
"node-persist": "^3.1.3",
|
||||||
"node-quickbooks": "^2.0.41",
|
"node-quickbooks": "^2.0.43",
|
||||||
"nodemailer": "^6.9.1",
|
"nodemailer": "^6.9.7",
|
||||||
"phone": "^3.1.35",
|
"phone": "^3.1.41",
|
||||||
"query-string": "^7.1.1",
|
|
||||||
"soap": "^1.0.0",
|
"soap": "^1.0.0",
|
||||||
"socket.io": "^4.6.1",
|
"socket.io": "^4.7.2",
|
||||||
"ssh2-sftp-client": "^9.0.4",
|
"ssh2-sftp-client": "^9.1.0",
|
||||||
"stripe": "^9.15.0",
|
"stripe": "^14.5.0",
|
||||||
"twilio": "^4.8.0",
|
"twilio": "^4.19.0",
|
||||||
"uuid": "^9.0.0",
|
"uuid": "^9.0.1",
|
||||||
"xml2js": "^0.4.23",
|
"xml2js": "^0.6.2",
|
||||||
"xmlbuilder2": "^3.0.2"
|
"xmlbuilder2": "^3.1.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"concurrently": "^7.3.0",
|
"concurrently": "^8.2.2",
|
||||||
"source-map-explorer": "^2.5.2"
|
"source-map-explorer": "^2.5.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ const path = require("path");
|
|||||||
const compression = require("compression");
|
const compression = require("compression");
|
||||||
const twilio = require("twilio");
|
const twilio = require("twilio");
|
||||||
const logger = require("./server/utils/logger");
|
const logger = require("./server/utils/logger");
|
||||||
var fb = require("./server/firebase/firebase-handler");
|
const fb = require("./server/firebase/firebase-handler");
|
||||||
var cookieParser = require("cookie-parser");
|
const cookieParser = require("cookie-parser");
|
||||||
const multer = require("multer");
|
const multer = require("multer");
|
||||||
const upload = multer();
|
const upload = multer();
|
||||||
//var enforce = require("express-sslify");
|
//var enforce = require("express-sslify");
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ const logger = require("../../utils/logger");
|
|||||||
const OAuthClient = require("intuit-oauth");
|
const OAuthClient = require("intuit-oauth");
|
||||||
const client = require("../../graphql-client/graphql-client").client;
|
const client = require("../../graphql-client/graphql-client").client;
|
||||||
const queries = require("../../graphql-client/queries");
|
const queries = require("../../graphql-client/queries");
|
||||||
const queryString = require("query-string");
|
const {parse, stringify} = require("querystring");
|
||||||
|
|
||||||
const oauthClient = new OAuthClient({
|
const oauthClient = new OAuthClient({
|
||||||
clientId: process.env.QBO_CLIENT_ID,
|
clientId: process.env.QBO_CLIENT_ID,
|
||||||
@@ -30,7 +30,8 @@ if (process.env.NODE_ENV === "production") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
exports.default = async (req, res) => {
|
exports.default = async (req, res) => {
|
||||||
const params = queryString.parse(req.url.split("?").reverse()[0]);
|
const queryString = req.url.split("?").reverse()[0];
|
||||||
|
const params = parse(queryString);
|
||||||
try {
|
try {
|
||||||
logger.log("qbo-callback-create-token", "DEBUG", params.state, null, null);
|
logger.log("qbo-callback-create-token", "DEBUG", params.state, null, null);
|
||||||
const authResponse = await oauthClient.createToken(req.url);
|
const authResponse = await oauthClient.createToken(req.url);
|
||||||
@@ -58,7 +59,7 @@ exports.default = async (req, res) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
res.redirect(
|
res.redirect(
|
||||||
`${url}/manage/accounting/qbo?${queryString.stringify(params)}`
|
`${url}/manage/accounting/qbo?${stringify(params)}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
@@ -879,6 +879,12 @@ async function UpdateDmsVehicle(socket) {
|
|||||||
},
|
},
|
||||||
vehicle: {
|
vehicle: {
|
||||||
...socket.DMSVeh.vehicle,
|
...socket.DMSVeh.vehicle,
|
||||||
|
...(socket.txEnvelope.dms_model_override
|
||||||
|
? {
|
||||||
|
make: socket.txEnvelope.dms_make,
|
||||||
|
modelAbrev: socket.txEnvelope.dms_model,
|
||||||
|
}
|
||||||
|
: {}),
|
||||||
deliveryDate:
|
deliveryDate:
|
||||||
socket.txEnvelope.dms_unsold === true
|
socket.txEnvelope.dms_unsold === true
|
||||||
? ""
|
? ""
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ exports.default = async (req, res) => {
|
|||||||
start: start
|
start: start
|
||||||
? moment(start).startOf("day")
|
? moment(start).startOf("day")
|
||||||
: moment().subtract(5, "days").startOf("day"),
|
: moment().subtract(5, "days").startOf("day"),
|
||||||
...(end && { end: moment(end).startOf("day") }),
|
...(end && { end: moment(end).endOf("day") }),
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ let Client = require("ssh2-sftp-client");
|
|||||||
const client = require("../graphql-client/graphql-client").client;
|
const client = require("../graphql-client/graphql-client").client;
|
||||||
const { sendServerEmail } = require("../email/sendemail");
|
const { sendServerEmail } = require("../email/sendemail");
|
||||||
const CCDineroFormat = "0,0.00";
|
const CCDineroFormat = "0,0.00";
|
||||||
const AhDateFormat = "MMDDYYYY";
|
const AhDateFormat = "MM/DD/YYYY";
|
||||||
|
|
||||||
const repairOpCodes = ["OP4", "OP9", "OP10"];
|
const repairOpCodes = ["OP4", "OP9", "OP10"];
|
||||||
const replaceOpCodes = ["OP2", "OP5", "OP11", "OP12"];
|
const replaceOpCodes = ["OP2", "OP5", "OP11", "OP12"];
|
||||||
@@ -62,22 +62,24 @@ exports.default = async (req, res) => {
|
|||||||
start: start
|
start: start
|
||||||
? moment(start).startOf("day")
|
? moment(start).startOf("day")
|
||||||
: moment().subtract(5, "days").startOf("day"),
|
: moment().subtract(5, "days").startOf("day"),
|
||||||
...(end && { end: moment(end).startOf("day") }),
|
...(end && { end: moment(end).endOf("day") }),
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
const claimsCorpObject = {
|
const claimsCorpObject = {
|
||||||
ClaimsCorpExport: {
|
DataFeed: {
|
||||||
ShopID: bodyshops_by_pk.claimscorpid,
|
ShopInfo: {
|
||||||
ShopName: bodyshops_by_pk.shopname,
|
ShopID: bodyshops_by_pk.claimscorpid,
|
||||||
RO: jobs.map((j) =>
|
ShopName: bodyshops_by_pk.shopname,
|
||||||
CreateRepairOrderTag(
|
RO: jobs.map((j) =>
|
||||||
{ ...j, bodyshop: bodyshops_by_pk },
|
CreateRepairOrderTag(
|
||||||
function ({ job, error }) {
|
{ ...j, bodyshop: bodyshops_by_pk },
|
||||||
erroredJobs.push({ job: job, error: error.toString() });
|
function ({ job, error }) {
|
||||||
}
|
erroredJobs.push({ job: job, error: error.toString() });
|
||||||
)
|
}
|
||||||
),
|
)
|
||||||
|
),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -100,9 +102,9 @@ exports.default = async (req, res) => {
|
|||||||
.end({ allowEmptyTags: true });
|
.end({ allowEmptyTags: true });
|
||||||
|
|
||||||
allxmlsToUpload.push({
|
allxmlsToUpload.push({
|
||||||
count: claimsCorpObject.ClaimsCorpExport.RO.length,
|
count: claimsCorpObject.DataFeed.ShopInfo.RO.length,
|
||||||
xml: ret,
|
xml: ret,
|
||||||
filename: `${bodyshop.claimscorpid}-MIS-${moment().format(
|
filename: `${bodyshop.claimscorpid}-${moment().format(
|
||||||
"YYYYMMDDTHHMMss"
|
"YYYYMMDDTHHMMss"
|
||||||
)}.xml`,
|
)}.xml`,
|
||||||
});
|
});
|
||||||
@@ -243,7 +245,7 @@ const CreateRepairOrderTag = (job, errorCallback) => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const ret = {
|
const ret = {
|
||||||
RONumber: job.ro_number,
|
RoNumber: job.ro_number,
|
||||||
Customer: {
|
Customer: {
|
||||||
CustomerZip: (job.ownr_zip && job.ownr_zip.substring(0, 3)) || "",
|
CustomerZip: (job.ownr_zip && job.ownr_zip.substring(0, 3)) || "",
|
||||||
CustomerState: job.ownr_st || "",
|
CustomerState: job.ownr_st || "",
|
||||||
@@ -261,8 +263,8 @@ const CreateRepairOrderTag = (job, errorCallback) => {
|
|||||||
VIN: job.v_vin || "",
|
VIN: job.v_vin || "",
|
||||||
},
|
},
|
||||||
Carrier: {
|
Carrier: {
|
||||||
InsuranceCo: job.ins_co_nm || "",
|
UniqueID: job.ins_co_nm || "",
|
||||||
CompanyName: job.ins_co_nm || "",
|
InsuranceCompany: job.ins_co_nm || "",
|
||||||
},
|
},
|
||||||
Claim: job.clm_no || "",
|
Claim: job.clm_no || "",
|
||||||
Contacts: {
|
Contacts: {
|
||||||
@@ -279,7 +281,7 @@ const CreateRepairOrderTag = (job, errorCallback) => {
|
|||||||
: "",
|
: "",
|
||||||
Phone1: "",
|
Phone1: "",
|
||||||
Phone2: "",
|
Phone2: "",
|
||||||
EstimatorName: `${job.est_ct_ln ? job.est_ct_ln : ""}${
|
Estimator: `${job.est_ct_ln ? job.est_ct_ln : ""}${
|
||||||
job.est_ct_ln ? ", " : ""
|
job.est_ct_ln ? ", " : ""
|
||||||
}${job.est_ct_fn ? job.est_ct_fn : ""}`,
|
}${job.est_ct_fn ? job.est_ct_fn : ""}`,
|
||||||
BodyTechnician: job.employee_body_rel
|
BodyTechnician: job.employee_body_rel
|
||||||
@@ -310,7 +312,7 @@ const CreateRepairOrderTag = (job, errorCallback) => {
|
|||||||
(job.date_estimated &&
|
(job.date_estimated &&
|
||||||
moment(job.date_estimated).format(AhDateFormat)) ||
|
moment(job.date_estimated).format(AhDateFormat)) ||
|
||||||
"",
|
"",
|
||||||
DateofLoss:
|
DateLoss:
|
||||||
(job.loss_date && moment(job.loss_date).format(AhDateFormat)) || "",
|
(job.loss_date && moment(job.loss_date).format(AhDateFormat)) || "",
|
||||||
DateFNOL: "",
|
DateFNOL: "",
|
||||||
DateContact: "",
|
DateContact: "",
|
||||||
@@ -337,7 +339,7 @@ const CreateRepairOrderTag = (job, errorCallback) => {
|
|||||||
.tz(job.bodyshop.timezone)
|
.tz(job.bodyshop.timezone)
|
||||||
.format(AhDateFormat)) ||
|
.format(AhDateFormat)) ||
|
||||||
"",
|
"",
|
||||||
StartDate: job.date_repairstarted
|
DateStart: job.date_repairstarted
|
||||||
? (job.date_repairstarted &&
|
? (job.date_repairstarted &&
|
||||||
moment(job.date_repairstarted)
|
moment(job.date_repairstarted)
|
||||||
.tz(job.bodyshop.timezone)
|
.tz(job.bodyshop.timezone)
|
||||||
@@ -382,7 +384,7 @@ const CreateRepairOrderTag = (job, errorCallback) => {
|
|||||||
"",
|
"",
|
||||||
BilledDate: "",
|
BilledDate: "",
|
||||||
PaidInFullDate: "",
|
PaidInFullDate: "",
|
||||||
RoStatus: job.tlos_ind
|
ROStatus: job.tlos_ind
|
||||||
? "TOT"
|
? "TOT"
|
||||||
: StatusMapping(job.status, job.bodyshop.md_ro_statuses),
|
: StatusMapping(job.status, job.bodyshop.md_ro_statuses),
|
||||||
},
|
},
|
||||||
@@ -392,14 +394,10 @@ const CreateRepairOrderTag = (job, errorCallback) => {
|
|||||||
.add(Dinero(job.job_totals.rates.lad.total))
|
.add(Dinero(job.job_totals.rates.lad.total))
|
||||||
.add(Dinero(job.job_totals.rates.las.total))
|
.add(Dinero(job.job_totals.rates.las.total))
|
||||||
.toFormat(CCDineroFormat),
|
.toFormat(CCDineroFormat),
|
||||||
Refinish: Dinero(job.job_totals.rates.lar.total).toFormat(
|
Paint: Dinero(job.job_totals.rates.lar.total).toFormat(CCDineroFormat),
|
||||||
CCDineroFormat
|
|
||||||
),
|
|
||||||
Prep: Dinero().toFormat(CCDineroFormat),
|
Prep: Dinero().toFormat(CCDineroFormat),
|
||||||
Frame: Dinero(job.job_totals.rates.laf.total).toFormat(CCDineroFormat),
|
Frame: Dinero(job.job_totals.rates.laf.total).toFormat(CCDineroFormat),
|
||||||
Mechanical: Dinero(job.job_totals.rates.lam.total).toFormat(
|
Mech: Dinero(job.job_totals.rates.lam.total).toFormat(CCDineroFormat),
|
||||||
CCDineroFormat
|
|
||||||
),
|
|
||||||
Glass: Dinero(job.job_totals.rates.lag.total).toFormat(CCDineroFormat),
|
Glass: Dinero(job.job_totals.rates.lag.total).toFormat(CCDineroFormat),
|
||||||
Elec: Dinero(job.job_totals.rates.lae.total).toFormat(CCDineroFormat),
|
Elec: Dinero(job.job_totals.rates.lae.total).toFormat(CCDineroFormat),
|
||||||
Detail: detailAdjustments.amount.toFormat(CCDineroFormat),
|
Detail: detailAdjustments.amount.toFormat(CCDineroFormat),
|
||||||
@@ -446,6 +444,7 @@ const CreateRepairOrderTag = (job, errorCallback) => {
|
|||||||
Towing: Dinero(job.job_totals.additional.towing).toFormat(
|
Towing: Dinero(job.job_totals.additional.towing).toFormat(
|
||||||
CCDineroFormat
|
CCDineroFormat
|
||||||
),
|
),
|
||||||
|
Storage: "0.00",
|
||||||
Rental:
|
Rental:
|
||||||
job.job_totals.additional.additionalCostItems.includes(
|
job.job_totals.additional.additionalCostItems.includes(
|
||||||
"ATS Amount"
|
"ATS Amount"
|
||||||
@@ -480,17 +479,17 @@ const CreateRepairOrderTag = (job, errorCallback) => {
|
|||||||
.filter((line) => repairOpCodes.includes(line.lbr_op))
|
.filter((line) => repairOpCodes.includes(line.lbr_op))
|
||||||
.reduce((acc, val) => acc + val.mod_lb_hrs, 0)
|
.reduce((acc, val) => acc + val.mod_lb_hrs, 0)
|
||||||
.toFixed(2),
|
.toFixed(2),
|
||||||
BodyReplaceHours: job.joblines
|
BodyReplacehours: job.joblines
|
||||||
.filter((line) => replaceOpCodes.includes(line.lbr_op))
|
.filter((line) => replaceOpCodes.includes(line.lbr_op))
|
||||||
.reduce((acc, val) => acc + val.mod_lb_hrs, 0)
|
.reduce((acc, val) => acc + val.mod_lb_hrs, 0)
|
||||||
.toFixed(2),
|
.toFixed(2),
|
||||||
Paint: job.job_totals.rates.lar.hours.toFixed(2),
|
Paint: job.job_totals.rates.lar.hours.toFixed(2),
|
||||||
Prep: "0.00",
|
Prep: "0.00",
|
||||||
FrameHours: job.job_totals.rates.laf.hours.toFixed(2),
|
Frame: job.job_totals.rates.laf.hours.toFixed(2),
|
||||||
MechanicalHours: job.job_totals.rates.lam.hours.toFixed(2),
|
Mech: job.job_totals.rates.lam.hours.toFixed(2),
|
||||||
GlassHours: job.job_totals.rates.lag.hours.toFixed(2),
|
Glass: job.job_totals.rates.lag.hours.toFixed(2),
|
||||||
ElectricalHours: job.job_totals.rates.lae.hours.toFixed(2),
|
Elec: job.job_totals.rates.lae.hours.toFixed(2),
|
||||||
DetailHours: detailAdjustments.hours,
|
Detail: detailAdjustments.hours,
|
||||||
Reassem: "0.00",
|
Reassem: "0.00",
|
||||||
Other: (
|
Other: (
|
||||||
job.job_totals.rates.la1.hours +
|
job.job_totals.rates.la1.hours +
|
||||||
@@ -522,7 +521,7 @@ const CreateRepairOrderTag = (job, errorCallback) => {
|
|||||||
AM: repairCosts.PartsAMCost.toFormat(CCDineroFormat),
|
AM: repairCosts.PartsAMCost.toFormat(CCDineroFormat),
|
||||||
MechParts: Dinero().toFormat(CCDineroFormat),
|
MechParts: Dinero().toFormat(CCDineroFormat),
|
||||||
OtherParts: Dinero().toFormat(CCDineroFormat), //Check Synergy
|
OtherParts: Dinero().toFormat(CCDineroFormat), //Check Synergy
|
||||||
OtherCosts: repairCosts.PartsOtherCost.toFormat(CCDineroFormat),
|
OtherCost: repairCosts.PartsOtherCost.toFormat(CCDineroFormat),
|
||||||
Sublet: repairCosts.SubletTotalCost.toFormat(CCDineroFormat),
|
Sublet: repairCosts.SubletTotalCost.toFormat(CCDineroFormat),
|
||||||
Towing: repairCosts.TowingTotalCost.toFormat(CCDineroFormat),
|
Towing: repairCosts.TowingTotalCost.toFormat(CCDineroFormat),
|
||||||
Storage: repairCosts.StorageTotalCost.toFormat(CCDineroFormat),
|
Storage: repairCosts.StorageTotalCost.toFormat(CCDineroFormat),
|
||||||
|
|||||||
@@ -7,15 +7,19 @@ require("dotenv").config({
|
|||||||
});
|
});
|
||||||
const axios = require("axios");
|
const axios = require("axios");
|
||||||
let nodemailer = require("nodemailer");
|
let nodemailer = require("nodemailer");
|
||||||
let aws = require("aws-sdk");
|
let aws = require("@aws-sdk/client-ses");
|
||||||
|
let { defaultProvider } = require("@aws-sdk/credential-provider-node");
|
||||||
|
|
||||||
const logger = require("../utils/logger");
|
const logger = require("../utils/logger");
|
||||||
const client = require("../graphql-client/graphql-client").client;
|
const client = require("../graphql-client/graphql-client").client;
|
||||||
const queries = require("../graphql-client/queries");
|
const queries = require("../graphql-client/queries");
|
||||||
|
|
||||||
const ses = new aws.SES({
|
const ses = new aws.SES({
|
||||||
|
// The key apiVersion is no longer supported in v3, and can be removed.
|
||||||
|
// @deprecated The client uses the "latest" apiVersion.
|
||||||
apiVersion: "latest",
|
apiVersion: "latest",
|
||||||
|
|
||||||
region: "ca-central-1",
|
region: "ca-central-1",
|
||||||
|
defaultProvider
|
||||||
});
|
});
|
||||||
|
|
||||||
let transporter = nodemailer.createTransport({
|
let transporter = nodemailer.createTransport({
|
||||||
@@ -48,7 +52,6 @@ exports.sendServerEmail = async function ({ subject, text }) {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
logger.log("server-email-failure", "error", null, null, error);
|
logger.log("server-email-failure", "error", null, null, error);
|
||||||
res.status(500).json(error);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
exports.sendTaskEmail = async function ({ to, subject, text, attachments }) {
|
exports.sendTaskEmail = async function ({ to, subject, text, attachments }) {
|
||||||
|
|||||||
@@ -1,16 +1,12 @@
|
|||||||
exports.FIND_BODYSHOP_BY_MESSAGING_SERVICE_SID = `
|
exports.FIND_BODYSHOP_BY_MESSAGING_SERVICE_SID = `
|
||||||
query FIND_BODYSHOP_BY_MESSAGING_SERVICE_SID(
|
query FIND_BODYSHOP_BY_MESSAGING_SERVICE_SID($mssid: String!, $phone: String!) {
|
||||||
$mssid: String!
|
|
||||||
$phone: String!
|
|
||||||
) {
|
|
||||||
bodyshops(where: { messagingservicesid: { _eq: $mssid } }) {
|
bodyshops(where: { messagingservicesid: { _eq: $mssid } }) {
|
||||||
id
|
id
|
||||||
conversations(where: { phone_num: { _eq: $phone } }) {
|
conversations(where: { phone_num: { _eq: $phone } }) {
|
||||||
id
|
id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
`;
|
|
||||||
|
|
||||||
exports.GET_JOB_BY_RO_NUMBER = `
|
exports.GET_JOB_BY_RO_NUMBER = `
|
||||||
query GET_JOB_BY_RO_NUMBER($ro_number: String!) {
|
query GET_JOB_BY_RO_NUMBER($ro_number: String!) {
|
||||||
@@ -20,8 +16,7 @@ exports.GET_JOB_BY_RO_NUMBER = `
|
|||||||
id
|
id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
`;
|
|
||||||
|
|
||||||
exports.INSERT_NEW_PAYMENT = `
|
exports.INSERT_NEW_PAYMENT = `
|
||||||
mutation INSERT_NEW_PAYMENT($paymentInput: [payments_insert_input!]!) {
|
mutation INSERT_NEW_PAYMENT($paymentInput: [payments_insert_input!]!) {
|
||||||
@@ -30,28 +25,23 @@ exports.INSERT_NEW_PAYMENT = `
|
|||||||
id
|
id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
`;
|
|
||||||
|
|
||||||
exports.INSERT_PAYMENT_RESPONSE = `
|
exports.INSERT_PAYMENT_RESPONSE = `
|
||||||
mutation INSERT_PAYMENT_RESPONSE(
|
mutation INSERT_PAYMENT_RESPONSE($paymentResponse: [payment_response_insert_input!]!) {
|
||||||
$paymentResponse: [payment_response_insert_input!]!
|
|
||||||
) {
|
|
||||||
insert_payment_response(objects: $paymentResponse) {
|
insert_payment_response(objects: $paymentResponse) {
|
||||||
returning {
|
returning {
|
||||||
id
|
id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
`;
|
|
||||||
|
|
||||||
exports.UNARCHIVE_CONVERSATION = `
|
exports.UNARCHIVE_CONVERSATION = `
|
||||||
mutation UNARCHIVE_CONVERSATION($id: uuid!) {
|
mutation UNARCHIVE_CONVERSATION($id: uuid!) {
|
||||||
update_conversations_by_pk(pk_columns: {id: $id}, _set: {archived: false}) {
|
update_conversations_by_pk(pk_columns: {id: $id}, _set: {archived: false}) {
|
||||||
id
|
id
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
`;
|
|
||||||
|
|
||||||
exports.INSERT_NEW_JOB_LINE = `
|
exports.INSERT_NEW_JOB_LINE = `
|
||||||
mutation INSERT_NEW_JOB_LINE($lineInput: [joblines_insert_input!]!) {
|
mutation INSERT_NEW_JOB_LINE($lineInput: [joblines_insert_input!]!) {
|
||||||
@@ -60,8 +50,7 @@ exports.INSERT_NEW_JOB_LINE = `
|
|||||||
id
|
id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
`;
|
|
||||||
|
|
||||||
exports.UPDATE_JOB_LINE = `
|
exports.UPDATE_JOB_LINE = `
|
||||||
mutation UPDATE_JOB_LINE($lineId: uuid!, $line: joblines_set_input!) {
|
mutation UPDATE_JOB_LINE($lineId: uuid!, $line: joblines_set_input!) {
|
||||||
@@ -82,8 +71,7 @@ exports.UPDATE_JOB_LINE = `
|
|||||||
removed
|
removed
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
`;
|
|
||||||
|
|
||||||
exports.RECEIVE_MESSAGE = `
|
exports.RECEIVE_MESSAGE = `
|
||||||
mutation RECEIVE_MESSAGE($msg: [messages_insert_input!]!) {
|
mutation RECEIVE_MESSAGE($msg: [messages_insert_input!]!) {
|
||||||
@@ -92,7 +80,7 @@ mutation RECEIVE_MESSAGE($msg: [messages_insert_input!]!) {
|
|||||||
conversation {
|
conversation {
|
||||||
id
|
id
|
||||||
archived
|
archived
|
||||||
bodyshop{
|
bodyshop {
|
||||||
imexshopid
|
imexshopid
|
||||||
}
|
}
|
||||||
created_at
|
created_at
|
||||||
@@ -114,10 +102,7 @@ mutation RECEIVE_MESSAGE($msg: [messages_insert_input!]!) {
|
|||||||
userid
|
userid
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
|
|
||||||
|
|
||||||
`;
|
|
||||||
|
|
||||||
exports.INSERT_MESSAGE = `
|
exports.INSERT_MESSAGE = `
|
||||||
mutation INSERT_MESSAGE($msg: [messages_insert_input!]!, $conversationid: uuid!) {
|
mutation INSERT_MESSAGE($msg: [messages_insert_input!]!, $conversationid: uuid!) {
|
||||||
@@ -130,7 +115,7 @@ mutation INSERT_MESSAGE($msg: [messages_insert_input!]!, $conversationid: uuid!)
|
|||||||
conversation {
|
conversation {
|
||||||
id
|
id
|
||||||
archived
|
archived
|
||||||
bodyshop{
|
bodyshop {
|
||||||
imexshopid
|
imexshopid
|
||||||
}
|
}
|
||||||
created_at
|
created_at
|
||||||
@@ -152,10 +137,7 @@ mutation INSERT_MESSAGE($msg: [messages_insert_input!]!, $conversationid: uuid!)
|
|||||||
userid
|
userid
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
|
|
||||||
|
|
||||||
`;
|
|
||||||
|
|
||||||
exports.UPDATE_MESSAGE_STATUS = `
|
exports.UPDATE_MESSAGE_STATUS = `
|
||||||
mutation UPDATE_MESSAGE($msid: String!, $fields: messages_set_input!) {
|
mutation UPDATE_MESSAGE($msid: String!, $fields: messages_set_input!) {
|
||||||
@@ -164,8 +146,7 @@ mutation UPDATE_MESSAGE($msid: String!, $fields: messages_set_input!) {
|
|||||||
id
|
id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
`;
|
|
||||||
|
|
||||||
exports.QUERY_JOBS_FOR_RECEIVABLES_EXPORT = `
|
exports.QUERY_JOBS_FOR_RECEIVABLES_EXPORT = `
|
||||||
query QUERY_JOBS_FOR_RECEIVABLES_EXPORT($ids: [uuid!]!) {
|
query QUERY_JOBS_FOR_RECEIVABLES_EXPORT($ids: [uuid!]!) {
|
||||||
@@ -228,7 +209,7 @@ query QUERY_JOBS_FOR_RECEIVABLES_EXPORT($ids: [uuid!]!) {
|
|||||||
owner {
|
owner {
|
||||||
accountingid
|
accountingid
|
||||||
}
|
}
|
||||||
joblines(where:{removed: {_eq:false}}) {
|
joblines(where:{removed: {_eq:false}}) {
|
||||||
id
|
id
|
||||||
line_desc
|
line_desc
|
||||||
part_type
|
part_type
|
||||||
@@ -257,8 +238,7 @@ query QUERY_JOBS_FOR_RECEIVABLES_EXPORT($ids: [uuid!]!) {
|
|||||||
timezone
|
timezone
|
||||||
md_ro_statuses
|
md_ro_statuses
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
`;
|
|
||||||
|
|
||||||
exports.QUERY_JOBS_FOR_CDK_EXPORT = `
|
exports.QUERY_JOBS_FOR_CDK_EXPORT = `
|
||||||
query QUERY_JOBS_FOR_CDK_EXPORT($id: uuid!) {
|
query QUERY_JOBS_FOR_CDK_EXPORT($id: uuid!) {
|
||||||
@@ -318,19 +298,19 @@ query QUERY_JOBS_FOR_CDK_EXPORT($id: uuid!) {
|
|||||||
v_make_desc
|
v_make_desc
|
||||||
v_color
|
v_color
|
||||||
ca_customer_gst
|
ca_customer_gst
|
||||||
bodyshop {
|
bodyshop {
|
||||||
id
|
id
|
||||||
md_ro_statuses
|
md_ro_statuses
|
||||||
md_responsibility_centers
|
md_responsibility_centers
|
||||||
accountingconfig
|
accountingconfig
|
||||||
cdk_dealerid
|
cdk_dealerid
|
||||||
cdk_configuration
|
cdk_configuration
|
||||||
timezone
|
timezone
|
||||||
}
|
}
|
||||||
owner {
|
owner {
|
||||||
accountingid
|
accountingid
|
||||||
}
|
}
|
||||||
joblines(where:{removed: {_eq:false}}) {
|
joblines(where:{removed: {_eq:false}}) {
|
||||||
id
|
id
|
||||||
line_desc
|
line_desc
|
||||||
part_type
|
part_type
|
||||||
@@ -345,9 +325,7 @@ query QUERY_JOBS_FOR_CDK_EXPORT($id: uuid!) {
|
|||||||
prt_dsmk_p
|
prt_dsmk_p
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}`;
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
exports.QUERY_JOBS_FOR_PBS_EXPORT = `
|
exports.QUERY_JOBS_FOR_PBS_EXPORT = `
|
||||||
query QUERY_JOBS_FOR_PBS_EXPORT($id: uuid!) {
|
query QUERY_JOBS_FOR_PBS_EXPORT($id: uuid!) {
|
||||||
@@ -410,24 +388,24 @@ query QUERY_JOBS_FOR_PBS_EXPORT($id: uuid!) {
|
|||||||
v_make_desc
|
v_make_desc
|
||||||
v_color
|
v_color
|
||||||
ca_customer_gst
|
ca_customer_gst
|
||||||
vehicle{
|
vehicle {
|
||||||
v_trimcode
|
v_trimcode
|
||||||
v_makecode
|
v_makecode
|
||||||
}
|
}
|
||||||
bodyshop {
|
bodyshop {
|
||||||
id
|
id
|
||||||
md_ro_statuses
|
md_ro_statuses
|
||||||
md_responsibility_centers
|
md_responsibility_centers
|
||||||
accountingconfig
|
accountingconfig
|
||||||
pbs_serialnumber
|
pbs_serialnumber
|
||||||
pbs_configuration
|
pbs_configuration
|
||||||
timezone
|
timezone
|
||||||
}
|
}
|
||||||
owner {
|
owner {
|
||||||
id
|
id
|
||||||
accountingid
|
accountingid
|
||||||
}
|
}
|
||||||
joblines(where:{removed: {_eq:false}}) {
|
joblines(where:{removed: {_eq:false}}) {
|
||||||
id
|
id
|
||||||
line_desc
|
line_desc
|
||||||
part_type
|
part_type
|
||||||
@@ -444,9 +422,7 @@ query QUERY_JOBS_FOR_PBS_EXPORT($id: uuid!) {
|
|||||||
line_ref
|
line_ref
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}`;
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
exports.QUERY_BILLS_FOR_PAYABLES_EXPORT = `
|
exports.QUERY_BILLS_FOR_PAYABLES_EXPORT = `
|
||||||
query QUERY_BILLS_FOR_PAYABLES_EXPORT($bills: [uuid!]!) {
|
query QUERY_BILLS_FOR_PAYABLES_EXPORT($bills: [uuid!]!) {
|
||||||
@@ -490,18 +466,17 @@ query QUERY_BILLS_FOR_PAYABLES_EXPORT($bills: [uuid!]!) {
|
|||||||
due_date
|
due_date
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
`;
|
|
||||||
|
|
||||||
exports.QUERY_PAYMENTS_FOR_EXPORT = `
|
exports.QUERY_PAYMENTS_FOR_EXPORT = `
|
||||||
query QUERY_PAYMENTS_FOR_EXPORT($payments: [uuid!]!)
|
query QUERY_PAYMENTS_FOR_EXPORT($payments: [uuid!]!) {
|
||||||
{ bodyshops(where: {associations: {active: {_eq: true}}}) {
|
bodyshops(where: {associations: {active: {_eq: true}}}) {
|
||||||
id
|
id
|
||||||
md_responsibility_centers
|
md_responsibility_centers
|
||||||
accountingconfig
|
accountingconfig
|
||||||
timezone
|
timezone
|
||||||
md_ins_cos
|
md_ins_cos
|
||||||
}
|
}
|
||||||
payments(where: {id: {_in: $payments}}) {
|
payments(where: {id: {_in: $payments}}) {
|
||||||
id
|
id
|
||||||
created_at
|
created_at
|
||||||
@@ -509,15 +484,14 @@ exports.QUERY_PAYMENTS_FOR_EXPORT = `
|
|||||||
job {
|
job {
|
||||||
id
|
id
|
||||||
ro_number
|
ro_number
|
||||||
ownerid
|
ownerid
|
||||||
ownr_ln
|
ownr_ln
|
||||||
ownr_fn
|
ownr_fn
|
||||||
ownr_addr1
|
ownr_addr1
|
||||||
ownr_addr2
|
ownr_addr2
|
||||||
ownr_zip
|
ownr_zip
|
||||||
ownr_city
|
ownr_city
|
||||||
ownr_st
|
ownr_st
|
||||||
|
|
||||||
ins_co_nm
|
ins_co_nm
|
||||||
owner{
|
owner{
|
||||||
accountingid
|
accountingid
|
||||||
@@ -525,7 +499,7 @@ exports.QUERY_PAYMENTS_FOR_EXPORT = `
|
|||||||
ownr_fn
|
ownr_fn
|
||||||
ownr_ln
|
ownr_ln
|
||||||
ownr_co_nm
|
ownr_co_nm
|
||||||
bodyshop{
|
bodyshop {
|
||||||
accountingconfig
|
accountingconfig
|
||||||
md_responsibility_centers
|
md_responsibility_centers
|
||||||
md_ins_cos
|
md_ins_cos
|
||||||
@@ -542,8 +516,7 @@ exports.QUERY_PAYMENTS_FOR_EXPORT = `
|
|||||||
paymentnum
|
paymentnum
|
||||||
date
|
date
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
`;
|
|
||||||
|
|
||||||
exports.QUERY_UPCOMING_APPOINTMENTS = `query QUERY_UPCOMING_APPOINTMENTS($now: timestamptz!, $jobId: uuid!) {
|
exports.QUERY_UPCOMING_APPOINTMENTS = `query QUERY_UPCOMING_APPOINTMENTS($now: timestamptz!, $jobId: uuid!) {
|
||||||
jobs_by_pk(id: $jobId) {
|
jobs_by_pk(id: $jobId) {
|
||||||
@@ -643,8 +616,7 @@ exports.QUERY_UPCOMING_APPOINTMENTS = `query QUERY_UPCOMING_APPOINTMENTS($now: t
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
`;
|
|
||||||
|
|
||||||
exports.QUERY_EMPLOYEE_PIN = `query QUERY_EMPLOYEE_PIN($shopId: uuid!, $employeeId: String!) {
|
exports.QUERY_EMPLOYEE_PIN = `query QUERY_EMPLOYEE_PIN($shopId: uuid!, $employeeId: String!) {
|
||||||
employees(where: {_and: {shopid: {_eq: $shopId}, employee_number: {_eq: $employeeId}}}) {
|
employees(where: {_and: {shopid: {_eq: $shopId}, employee_number: {_eq: $employeeId}}}) {
|
||||||
@@ -835,8 +807,7 @@ exports.AUTOHOUSE_QUERY = `query AUTOHOUSE_EXPORT($start: timestamptz, $bodyshop
|
|||||||
totalliquidcost
|
totalliquidcost
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
`;
|
|
||||||
|
|
||||||
exports.CLAIMSCORP_QUERY = `query CLAIMSCORP_EXPORT($start: timestamptz, $bodyshopid: uuid!, $end: timestamptz) {
|
exports.CLAIMSCORP_QUERY = `query CLAIMSCORP_EXPORT($start: timestamptz, $bodyshopid: uuid!, $end: timestamptz) {
|
||||||
bodyshops_by_pk(id: $bodyshopid){
|
bodyshops_by_pk(id: $bodyshopid){
|
||||||
@@ -1008,8 +979,7 @@ exports.CLAIMSCORP_QUERY = `query CLAIMSCORP_EXPORT($start: timestamptz, $bodysh
|
|||||||
totalliquidcost
|
totalliquidcost
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
`;
|
|
||||||
|
|
||||||
exports.ENTEGRAL_EXPORT = `
|
exports.ENTEGRAL_EXPORT = `
|
||||||
query ENTEGRAL_EXPORT($bodyshopid: uuid!) {
|
query ENTEGRAL_EXPORT($bodyshopid: uuid!) {
|
||||||
@@ -1098,8 +1068,7 @@ query ENTEGRAL_EXPORT($bodyshopid: uuid!) {
|
|||||||
cieca_ttl
|
cieca_ttl
|
||||||
adjustment_bottom_line
|
adjustment_bottom_line
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
`;
|
|
||||||
|
|
||||||
exports.UPDATE_JOB = `
|
exports.UPDATE_JOB = `
|
||||||
mutation UPDATE_JOB($jobId: uuid!, $job: jobs_set_input!) {
|
mutation UPDATE_JOB($jobId: uuid!, $job: jobs_set_input!) {
|
||||||
@@ -1114,8 +1083,7 @@ exports.UPDATE_JOB = `
|
|||||||
lbr_adjustments
|
lbr_adjustments
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
`;
|
|
||||||
|
|
||||||
exports.GET_JOB_BY_PK = `query GET_JOB_BY_PK($id: uuid!) {
|
exports.GET_JOB_BY_PK = `query GET_JOB_BY_PK($id: uuid!) {
|
||||||
jobs_by_pk(id: $id) {
|
jobs_by_pk(id: $id) {
|
||||||
@@ -1127,7 +1095,7 @@ exports.GET_JOB_BY_PK = `query GET_JOB_BY_PK($id: uuid!) {
|
|||||||
kmout
|
kmout
|
||||||
comment
|
comment
|
||||||
referral_source
|
referral_source
|
||||||
referral_source_extra
|
referral_source_extra
|
||||||
unit_number
|
unit_number
|
||||||
po_number
|
po_number
|
||||||
special_coverage_policy
|
special_coverage_policy
|
||||||
@@ -1163,10 +1131,10 @@ exports.GET_JOB_BY_PK = `query GET_JOB_BY_PK($id: uuid!) {
|
|||||||
est_ct_fn
|
est_ct_fn
|
||||||
shopid
|
shopid
|
||||||
est_ct_ln
|
est_ct_ln
|
||||||
vehicle{
|
vehicle {
|
||||||
id
|
id
|
||||||
notes
|
notes
|
||||||
}
|
}
|
||||||
est_ph1
|
est_ph1
|
||||||
est_ea
|
est_ea
|
||||||
selling_dealer
|
selling_dealer
|
||||||
@@ -1526,19 +1494,17 @@ exports.QUERY_JOB_COSTING_DETAILS_MULTI = ` query QUERY_JOB_COSTING_DETAILS_MULT
|
|||||||
use_paint_scale_data
|
use_paint_scale_data
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
`;
|
|
||||||
|
|
||||||
exports.INSERT_IOEVENT = ` mutation INSERT_IOEVENT($event: ioevents_insert_input!) {
|
exports.INSERT_IOEVENT = ` mutation INSERT_IOEVENT($event: ioevents_insert_input!) {
|
||||||
insert_ioevents_one(object: $event) {
|
insert_ioevents_one(object: $event) {
|
||||||
id
|
id
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
`;
|
|
||||||
|
|
||||||
exports.GET_AUTOHOUSE_SHOPS = `query GET_AUTOHOUSE_SHOPS {
|
exports.GET_AUTOHOUSE_SHOPS = `query GET_AUTOHOUSE_SHOPS {
|
||||||
bodyshops(where: {autohouseid: {_is_null: false}}){
|
bodyshops(where: {autohouseid: {_is_null: false}, _or: {autohouseid: {_neq: ""}}}){
|
||||||
id
|
id
|
||||||
shopname
|
shopname
|
||||||
address1
|
address1
|
||||||
city
|
city
|
||||||
@@ -1554,11 +1520,10 @@ exports.GET_AUTOHOUSE_SHOPS = `query GET_AUTOHOUSE_SHOPS {
|
|||||||
imexshopid
|
imexshopid
|
||||||
timezone
|
timezone
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
`;
|
|
||||||
|
|
||||||
exports.GET_CLAIMSCORP_SHOPS = `query GET_CLAIMSCORP_SHOPS {
|
exports.GET_CLAIMSCORP_SHOPS = `query GET_CLAIMSCORP_SHOPS {
|
||||||
bodyshops(where: {claimscorpid: {_is_null: false}}){
|
bodyshops(where: {claimscorpid: {_is_null: false}, _or: {claimscorpid: {_neq: ""}}}){
|
||||||
id
|
id
|
||||||
shopname
|
shopname
|
||||||
address1
|
address1
|
||||||
@@ -1575,12 +1540,11 @@ exports.GET_CLAIMSCORP_SHOPS = `query GET_CLAIMSCORP_SHOPS {
|
|||||||
imexshopid
|
imexshopid
|
||||||
timezone
|
timezone
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
`;
|
|
||||||
|
|
||||||
exports.GET_ENTEGRAL_SHOPS = `query GET_AUTOHOUSE_SHOPS {
|
exports.GET_ENTEGRAL_SHOPS = `query GET_AUTOHOUSE_SHOPS {
|
||||||
bodyshops(where: {entegral_id: {_is_null: false}}){
|
bodyshops(where: {entegral_id: {_is_null: false}, _or: {entegral_id: {_neq: ""}}}){
|
||||||
id
|
id
|
||||||
shopname
|
shopname
|
||||||
address1
|
address1
|
||||||
city
|
city
|
||||||
@@ -1596,22 +1560,19 @@ exports.GET_ENTEGRAL_SHOPS = `query GET_AUTOHOUSE_SHOPS {
|
|||||||
timezone
|
timezone
|
||||||
features
|
features
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
`;
|
|
||||||
|
|
||||||
exports.DELETE_ALL_DMS_VEHICLES = `mutation DELETE_ALL_DMS_VEHICLES{
|
exports.DELETE_ALL_DMS_VEHICLES = `mutation DELETE_ALL_DMS_VEHICLES{
|
||||||
delete_dms_vehicles(where: {}) {
|
delete_dms_vehicles(where: {}) {
|
||||||
affected_rows
|
affected_rows
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
`;
|
|
||||||
exports.INSERT_DMS_VEHICLES = `mutation INSERT_DMS_VEHICLES($vehicles: [dms_vehicles_insert_input!]!) {
|
exports.INSERT_DMS_VEHICLES = `mutation INSERT_DMS_VEHICLES($vehicles: [dms_vehicles_insert_input!]!) {
|
||||||
insert_dms_vehicles(objects: $vehicles) {
|
insert_dms_vehicles(objects: $vehicles) {
|
||||||
affected_rows
|
affected_rows
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
|
|
||||||
`;
|
|
||||||
|
|
||||||
exports.GET_CDK_ALLOCATIONS = `query QUERY_JOB_CLOSE_DETAILS($id: uuid!) {
|
exports.GET_CDK_ALLOCATIONS = `query QUERY_JOB_CLOSE_DETAILS($id: uuid!) {
|
||||||
jobs_by_pk(id: $id) {
|
jobs_by_pk(id: $id) {
|
||||||
@@ -1728,8 +1689,7 @@ exports.GET_CDK_ALLOCATIONS = `query QUERY_JOB_CLOSE_DETAILS($id: uuid!) {
|
|||||||
unq_seq
|
unq_seq
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
`;
|
|
||||||
|
|
||||||
exports.GET_QBO_AUTH = `query GET_QBO_AUTH($email: String!) {
|
exports.GET_QBO_AUTH = `query GET_QBO_AUTH($email: String!) {
|
||||||
associations(where: {_and: {active: {_eq: true}, useremail: {_eq: $email}}}){
|
associations(where: {_and: {active: {_eq: true}, useremail: {_eq: $email}}}){
|
||||||
@@ -1743,15 +1703,13 @@ exports.SET_QBO_AUTH_WITH_REALM = `mutation SET_QBO_AUTH($email: String!, $qbo_a
|
|||||||
update_associations(_set: {qbo_auth: $qbo_auth, qbo_realmId: $qbo_realmId}, where: {_and: {active: {_eq: true}, useremail: {_eq: $email}}}){
|
update_associations(_set: {qbo_auth: $qbo_auth, qbo_realmId: $qbo_realmId}, where: {_and: {active: {_eq: true}, useremail: {_eq: $email}}}){
|
||||||
affected_rows
|
affected_rows
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
`;
|
|
||||||
|
|
||||||
exports.SET_QBO_AUTH = `mutation SET_QBO_AUTH($email: String!, $qbo_auth: jsonb!) {
|
exports.SET_QBO_AUTH = `mutation SET_QBO_AUTH($email: String!, $qbo_auth: jsonb!) {
|
||||||
update_associations(_set: {qbo_auth: $qbo_auth}, where: {_and: {active: {_eq: true}, useremail: {_eq: $email}}}){
|
update_associations(_set: {qbo_auth: $qbo_auth}, where: {_and: {active: {_eq: true}, useremail: {_eq: $email}}}){
|
||||||
affected_rows
|
affected_rows
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
`;
|
|
||||||
|
|
||||||
exports.MARK_JOB_EXPORTED = `
|
exports.MARK_JOB_EXPORTED = `
|
||||||
mutation MARK_JOB_EXPORTED($jobId: uuid!, $job: jobs_set_input!, $log: exportlog_insert_input!, $bill: bills_set_input!) {
|
mutation MARK_JOB_EXPORTED($jobId: uuid!, $job: jobs_set_input!, $log: exportlog_insert_input!, $bill: bills_set_input!) {
|
||||||
@@ -1770,10 +1728,9 @@ mutation MARK_JOB_EXPORTED($jobId: uuid!, $job: jobs_set_input!, $log: exportlog
|
|||||||
id
|
id
|
||||||
}
|
}
|
||||||
update_bills(where:{jobid:{_eq :$jobId}}, _set:$bill){
|
update_bills(where:{jobid:{_eq :$jobId}}, _set:$bill){
|
||||||
affected_rows
|
affected_rows
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
`;
|
|
||||||
|
|
||||||
exports.MARK_BILLS_EXPORTED = `
|
exports.MARK_BILLS_EXPORTED = `
|
||||||
mutation UPDATE_BILLS($billids: [uuid!]!, $bill: bills_set_input!, $logs: [exportlog_insert_input!]!) {
|
mutation UPDATE_BILLS($billids: [uuid!]!, $bill: bills_set_input!, $logs: [exportlog_insert_input!]!) {
|
||||||
@@ -1785,28 +1742,25 @@ mutation UPDATE_BILLS($billids: [uuid!]!, $bill: bills_set_input!, $logs: [expor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
insert_exportlog(objects: $logs) {
|
insert_exportlog(objects: $logs) {
|
||||||
returning{
|
returning{
|
||||||
id
|
id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
`;
|
|
||||||
|
|
||||||
exports.INSERT_EXPORT_LOG = `
|
exports.INSERT_EXPORT_LOG = `
|
||||||
mutation INSERT_EXPORT_LOG($log: exportlog_insert_input!) {
|
mutation INSERT_EXPORT_LOG($log: exportlog_insert_input!) {
|
||||||
insert_exportlog_one(object: $log) {
|
insert_exportlog_one(object: $log) {
|
||||||
id
|
id
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
`;
|
|
||||||
|
|
||||||
exports.QUERY_EXISTING_TRANSITION = `
|
exports.QUERY_EXISTING_TRANSITION = `
|
||||||
mutation INSERT_EXPORT_LOG($log: exportlog_insert_input!) {
|
mutation INSERT_EXPORT_LOG($log: exportlog_insert_input!) {
|
||||||
insert_exportlog_one(object: $log) {
|
insert_exportlog_one(object: $log) {
|
||||||
id
|
id
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
`;
|
|
||||||
|
|
||||||
exports.UPDATE_OLD_TRANSITION = `mutation UPDATE_OLD_TRANSITION($jobid: uuid!, $existingTransition: transitions_set_input!){
|
exports.UPDATE_OLD_TRANSITION = `mutation UPDATE_OLD_TRANSITION($jobid: uuid!, $existingTransition: transitions_set_input!){
|
||||||
update_transitions(where:{jobid:{_eq:$jobid}, end:{_is_null:true
|
update_transitions(where:{jobid:{_eq:$jobid}, end:{_is_null:true
|
||||||
@@ -1830,9 +1784,7 @@ exports.INSERT_NEW_TRANSITION = `mutation INSERT_NEW_TRANSITION($newTransition:
|
|||||||
update_transitions(where: {id: {_eq: $oldTransitionId}}, _set: {duration: $duration}) {
|
update_transitions(where: {id: {_eq: $oldTransitionId}}, _set: {duration: $duration}) {
|
||||||
affected_rows
|
affected_rows
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
|
|
||||||
`;
|
|
||||||
|
|
||||||
exports.QUERY_JOB_ID_MIXDATA = `query QUERY_JOB_ID_MIXDATA($roNumbers: [String!]!) {
|
exports.QUERY_JOB_ID_MIXDATA = `query QUERY_JOB_ID_MIXDATA($roNumbers: [String!]!) {
|
||||||
jobs(where: {ro_number: {_in: $roNumbers}}) {
|
jobs(where: {ro_number: {_in: $roNumbers}}) {
|
||||||
@@ -1842,9 +1794,7 @@ exports.QUERY_JOB_ID_MIXDATA = `query QUERY_JOB_ID_MIXDATA($roNumbers: [String!]
|
|||||||
id
|
id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
|
|
||||||
`;
|
|
||||||
|
|
||||||
exports.QBO_MARK_JOB_EXPORTED = `
|
exports.QBO_MARK_JOB_EXPORTED = `
|
||||||
mutation QBO_MARK_JOB_EXPORTED($jobId: uuid!, $job: jobs_set_input!, $logs: [exportlog_insert_input!]!) {
|
mutation QBO_MARK_JOB_EXPORTED($jobId: uuid!, $job: jobs_set_input!, $logs: [exportlog_insert_input!]!) {
|
||||||
@@ -1857,9 +1807,8 @@ mutation QBO_MARK_JOB_EXPORTED($jobId: uuid!, $job: jobs_set_input!, $logs: [exp
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
|
|
||||||
`;
|
|
||||||
exports.QBO_MARK_BILL_EXPORTED = `
|
exports.QBO_MARK_BILL_EXPORTED = `
|
||||||
mutation QBO_MARK_BILL_EXPORTED($billId: uuid!, $bill: bills_set_input!, $logs: [exportlog_insert_input!]!) {
|
mutation QBO_MARK_BILL_EXPORTED($billId: uuid!, $bill: bills_set_input!, $logs: [exportlog_insert_input!]!) {
|
||||||
insert_exportlog(objects: $logs) {
|
insert_exportlog(objects: $logs) {
|
||||||
@@ -1870,9 +1819,7 @@ mutation QBO_MARK_BILL_EXPORTED($billId: uuid!, $bill: bills_set_input!, $logs:
|
|||||||
id
|
id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
|
|
||||||
`;
|
|
||||||
|
|
||||||
exports.QBO_MARK_PAYMENT_EXPORTED = `
|
exports.QBO_MARK_PAYMENT_EXPORTED = `
|
||||||
mutation QBO_MARK_PAYMENT_EXPORTED($paymentId: uuid!, $payment: payments_set_input!, $logs: [exportlog_insert_input!]!) {
|
mutation QBO_MARK_PAYMENT_EXPORTED($paymentId: uuid!, $payment: payments_set_input!, $logs: [exportlog_insert_input!]!) {
|
||||||
@@ -1887,19 +1834,17 @@ mutation QBO_MARK_PAYMENT_EXPORTED($paymentId: uuid!, $payment: payments_set_inp
|
|||||||
}`;
|
}`;
|
||||||
|
|
||||||
exports.INSERT_EXPORT_LOG = `
|
exports.INSERT_EXPORT_LOG = `
|
||||||
mutation INSERT_EXPORT_LOG($logs: [exportlog_insert_input!]!) {
|
mutation INSERT_EXPORT_LOG($logs: [exportlog_insert_input!]!) {
|
||||||
insert_exportlog(objects: $logs) {
|
insert_exportlog(objects: $logs) {
|
||||||
affected_rows
|
affected_rows
|
||||||
}
|
|
||||||
}
|
}
|
||||||
`;
|
}`;
|
||||||
|
|
||||||
exports.INSERT_EMAIL_AUDIT = `mutation INSERT_EMAIL_AUDIT($email: email_audit_trail_insert_input!) {
|
exports.INSERT_EMAIL_AUDIT = `mutation INSERT_EMAIL_AUDIT($email: email_audit_trail_insert_input!) {
|
||||||
insert_email_audit_trail_one(object: $email) {
|
insert_email_audit_trail_one(object: $email) {
|
||||||
id
|
id
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
`;
|
|
||||||
|
|
||||||
exports.DELETE_MEDIA_DOCUMENTS = `
|
exports.DELETE_MEDIA_DOCUMENTS = `
|
||||||
mutation DELETE_DOCUMENTS($ids: [uuid!]!) {
|
mutation DELETE_DOCUMENTS($ids: [uuid!]!) {
|
||||||
@@ -1908,8 +1853,7 @@ mutation DELETE_DOCUMENTS($ids: [uuid!]!) {
|
|||||||
id
|
id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
`;
|
|
||||||
|
|
||||||
exports.UPDATE_EMAIL_AUDIT = `
|
exports.UPDATE_EMAIL_AUDIT = `
|
||||||
mutation ($sesid: String!, $status: String, $context: jsonb) {
|
mutation ($sesid: String!, $status: String, $context: jsonb) {
|
||||||
@@ -1961,8 +1905,7 @@ query GET_PBS_AP_ALLOCATIONS($billids: [uuid!]) {
|
|||||||
quantity
|
quantity
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
`;
|
|
||||||
|
|
||||||
exports.QUERY_PARTS_SCAN = `query QUERY_PARTS_SCAN ($id: uuid!) {
|
exports.QUERY_PARTS_SCAN = `query QUERY_PARTS_SCAN ($id: uuid!) {
|
||||||
jobs_by_pk(id: $id) {
|
jobs_by_pk(id: $id) {
|
||||||
@@ -1976,8 +1919,7 @@ exports.QUERY_PARTS_SCAN = `query QUERY_PARTS_SCAN ($id: uuid!) {
|
|||||||
critical
|
critical
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
`;
|
|
||||||
|
|
||||||
exports.UPDATE_PARTS_CRITICAL = `mutation UPDATE_PARTS_CRITICAL ($IdsToMarkCritical:[uuid!]!, $jobid: uuid!){
|
exports.UPDATE_PARTS_CRITICAL = `mutation UPDATE_PARTS_CRITICAL ($IdsToMarkCritical:[uuid!]!, $jobid: uuid!){
|
||||||
critical: update_joblines(where:{id:{_in:$IdsToMarkCritical}}, _set:{critical: true}){
|
critical: update_joblines(where:{id:{_in:$IdsToMarkCritical}}, _set:{critical: true}){
|
||||||
@@ -1993,5 +1935,4 @@ exports.ACTIVE_SHOP_BY_USER = `query ACTIVE_SHOP_BY_USER($user: String) {
|
|||||||
id
|
id
|
||||||
shopid
|
shopid
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
`;
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const AWS = require("aws-sdk");
|
const awsSecretManager = require("@aws-sdk/client-secrets-manager");
|
||||||
|
|
||||||
class SecretsManager {
|
class SecretsManager {
|
||||||
/**
|
/**
|
||||||
@@ -8,11 +8,10 @@ class SecretsManager {
|
|||||||
*/
|
*/
|
||||||
static async getSecret(secretName, region) {
|
static async getSecret(secretName, region) {
|
||||||
const config = { region: region };
|
const config = { region: region };
|
||||||
let secretsManager = new AWS.SecretsManager(config);
|
let secretsManager = new awsSecretManager.SecretsManager(config);
|
||||||
try {
|
try {
|
||||||
let secretValue = await secretsManager
|
let secretValue = await secretsManager
|
||||||
.getSecretValue({ SecretId: secretName })
|
.getSecretValue({ SecretId: secretName });
|
||||||
.promise();
|
|
||||||
if ("SecretString" in secretValue) {
|
if ("SecretString" in secretValue) {
|
||||||
return secretValue.SecretString;
|
return secretValue.SecretString;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user