Compare commits
298 Commits
release/20
...
feature/no
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b5a2be9392 | ||
|
|
df1e15be60 | ||
|
|
274b572915 | ||
|
|
fa4aa5ca8f | ||
|
|
2b537b65dd | ||
|
|
75b2cb18ca | ||
|
|
5167668958 | ||
|
|
1eacf43669 | ||
|
|
77ed64969e | ||
|
|
44ff032acc | ||
|
|
542637edb2 | ||
|
|
f7971ed60c | ||
|
|
ca71b0479a | ||
|
|
515de38fe6 | ||
|
|
113c62b36f | ||
|
|
c0ea5a9818 | ||
|
|
6b13dffe68 | ||
|
|
51d49be16e | ||
|
|
04c3abd65f | ||
|
|
29dab7312b | ||
|
|
01eb68fda1 | ||
|
|
a4c4329253 | ||
|
|
b738fc9007 | ||
|
|
5484358b32 | ||
|
|
b48d7512a2 | ||
|
|
ae3226efb8 | ||
|
|
da9ddfc419 | ||
|
|
901902c1d1 | ||
|
|
79bfb12063 | ||
|
|
c1bf112aac | ||
|
|
ecfb3e91cd | ||
|
|
e25606070b | ||
|
|
28f0d9a4b2 | ||
|
|
c125cd8ca2 | ||
|
|
123f94a0f5 | ||
|
|
d601617819 | ||
|
|
80bd2dc6d8 | ||
|
|
45bd2d3281 | ||
|
|
b4304c743e | ||
|
|
faf9fbb9d8 | ||
|
|
6d1581a4e1 | ||
|
|
28f6c72de1 | ||
|
|
54577ac680 | ||
|
|
c912681793 | ||
|
|
09f909142b | ||
|
|
89b515fff4 | ||
|
|
fb380a5b31 | ||
|
|
3896a0b03d | ||
|
|
832674662d | ||
|
|
f2b2011900 | ||
|
|
15c305317a | ||
|
|
d6924c2292 | ||
|
|
7ccd356f0a | ||
|
|
592b47b5d4 | ||
|
|
d9beee7f2f | ||
|
|
75743f44e7 | ||
|
|
3d68a7099b | ||
|
|
71f161ec27 | ||
|
|
9b1f24926f | ||
|
|
bcc153caa5 | ||
|
|
f59911d5ab | ||
|
|
417958e1e8 | ||
|
|
ccf2f0ad47 | ||
|
|
bb993ab1fb | ||
|
|
9c39c8d59b | ||
|
|
3439f09d9a | ||
|
|
279e93f0c3 | ||
|
|
92f14d6fa5 | ||
|
|
148c645f18 | ||
|
|
9a65b6a1ce | ||
|
|
839c82abb9 | ||
|
|
471756d7ad | ||
|
|
2e2a4920ca | ||
|
|
f775e09391 | ||
|
|
c0b0bcd55e | ||
|
|
1bc5493f3f | ||
|
|
2579558090 | ||
|
|
bc9a3a21a8 | ||
|
|
f11eb6406d | ||
|
|
3d6bad9e7d | ||
|
|
12a5f17351 | ||
|
|
a2032553d9 | ||
|
|
d22979dadc | ||
|
|
c1068ec92b | ||
|
|
a318f3e74b | ||
|
|
e5a5cb4e85 | ||
|
|
f8151e387e | ||
|
|
b98bfe566a | ||
|
|
c0220f0ca2 | ||
|
|
3e121a1a25 | ||
|
|
a2a8868223 | ||
|
|
80d16b4651 | ||
|
|
ce3fbab1dc | ||
|
|
4c1a333514 | ||
|
|
0660b79c01 | ||
|
|
63ec578b6a | ||
|
|
dcf388ff7c | ||
|
|
0cd1b41ed9 | ||
|
|
79124daa9a | ||
|
|
76ec55d709 | ||
|
|
375b8ba050 | ||
|
|
2192cb1e7c | ||
|
|
65b505035a | ||
|
|
191f3f96a2 | ||
|
|
14d873f795 | ||
|
|
55ad75df8a | ||
|
|
5f112e797d | ||
|
|
b842cee076 | ||
|
|
2c1c11828d | ||
|
|
e7c380d780 | ||
|
|
0958ea5ba6 | ||
|
|
8031f2b2ed | ||
|
|
996863fcb7 | ||
|
|
066f395a40 | ||
|
|
51c5d163a5 | ||
|
|
d8ec6dd997 | ||
|
|
cc636bdfe2 | ||
|
|
a3e8f56728 | ||
|
|
a6f2cfba0f | ||
|
|
2e7d8df781 | ||
|
|
da51aeb135 | ||
|
|
680dd98f6d | ||
|
|
e79b9f9084 | ||
|
|
22e6d596e6 | ||
|
|
1ba904d082 | ||
|
|
62be2b0a0a | ||
|
|
dc77930950 | ||
|
|
520b61706f | ||
|
|
09a87dd2a7 | ||
|
|
f884d2e23f | ||
|
|
b84935efdc | ||
|
|
b3aeee4f45 | ||
|
|
06f266a292 | ||
|
|
a2d54d5dd5 | ||
|
|
b34694f3c4 | ||
|
|
43b8842027 | ||
|
|
0dbb3a446a | ||
|
|
75b2398421 | ||
|
|
2409042450 | ||
|
|
85ccb36b2e | ||
|
|
a616921e2b | ||
|
|
f509ea07c0 | ||
|
|
efb62b59f4 | ||
|
|
e263c32d83 | ||
|
|
30afe97fba | ||
|
|
e383b0800c | ||
|
|
e0507f2d17 | ||
|
|
cdd3841d49 | ||
|
|
4a023faf67 | ||
|
|
e9f4b48839 | ||
|
|
90f0232ff0 | ||
|
|
b94ea099b9 | ||
|
|
9f5b1c4ea5 | ||
|
|
4842605035 | ||
|
|
f9f14255a8 | ||
|
|
139dedd3e7 | ||
|
|
bd9c2cd0af | ||
|
|
e0e2183d86 | ||
|
|
f8695972a3 | ||
|
|
4c70351429 | ||
|
|
bc504d2a78 | ||
|
|
22dfcc215e | ||
|
|
415d6cca29 | ||
|
|
6c0bf67f37 | ||
|
|
351459681c | ||
|
|
e7e9ca6dfc | ||
|
|
39998a279e | ||
|
|
7c66e5cb90 | ||
|
|
b4e0dcc395 | ||
|
|
c16a2a83a5 | ||
|
|
a2dca6c1a1 | ||
|
|
ffb39bbee7 | ||
|
|
46731975e6 | ||
|
|
06f725ebb1 | ||
|
|
8745ffd08f | ||
|
|
634adb6e9a | ||
|
|
b5386be6af | ||
|
|
14e9ac2cdb | ||
|
|
76fb8f453d | ||
|
|
afc674d74c | ||
|
|
8c67a94387 | ||
|
|
a17b2b0923 | ||
|
|
91c5560fe8 | ||
|
|
356928ce77 | ||
|
|
eb05a746c4 | ||
|
|
07b5c5e93c | ||
|
|
7ef8ef5f2f | ||
|
|
dcb9c32336 | ||
|
|
f41277c081 | ||
|
|
7f15e9ef7a | ||
|
|
6d3fc783d6 | ||
|
|
0052a54915 | ||
|
|
375856bd68 | ||
|
|
cf4f6f6e55 | ||
|
|
173e9a278c | ||
|
|
35ab86c5fd | ||
|
|
932c89f8f9 | ||
|
|
ddd5ce4bf0 | ||
|
|
1d0e526466 | ||
|
|
73e2b2d65d | ||
|
|
88bc8d4d05 | ||
|
|
53cecd68f0 | ||
|
|
4bce6d996e | ||
|
|
6a59092d6a | ||
|
|
83b51384c7 | ||
|
|
f5e20b7041 | ||
|
|
8d1988d4ad | ||
|
|
cd071500cf | ||
|
|
09a0309108 | ||
|
|
65d93b8f9b | ||
|
|
b147d4c2ed | ||
|
|
0c8c303d08 | ||
|
|
b19120af3d | ||
|
|
d83e2ace2e | ||
|
|
468227b7b9 | ||
|
|
021098fa2a | ||
|
|
49f5668e89 | ||
|
|
9b444a130b | ||
|
|
25fd90f881 | ||
|
|
aa61aa6702 | ||
|
|
a8b1537cd6 | ||
|
|
2c702da1fd | ||
|
|
cb48ea64f9 | ||
|
|
c17e1e92aa | ||
|
|
b546d90c9e | ||
|
|
3985293cee | ||
|
|
4bd3b851ef | ||
|
|
bef76491d7 | ||
|
|
4f3090c3bd | ||
|
|
9d770a4cd5 | ||
|
|
f71a4b7c83 | ||
|
|
7ddd29ca27 | ||
|
|
ab607e9919 | ||
|
|
5511dd44ce | ||
|
|
d6a84b8b7f | ||
|
|
a20e005583 | ||
|
|
c962d848c1 | ||
|
|
b81d3369af | ||
|
|
febcff3383 | ||
|
|
61090aa04c | ||
|
|
e0f75fa357 | ||
|
|
9aa85b3ab5 | ||
|
|
4704fd9ce1 | ||
|
|
a0f06ffdc2 | ||
|
|
c4eed109e9 | ||
|
|
7d9eb737ec | ||
|
|
6fbf954dc2 | ||
|
|
968da48399 | ||
|
|
83906ea788 | ||
|
|
83255cd316 | ||
|
|
1966e91463 | ||
|
|
413400fa71 | ||
|
|
abf9d0b7f4 | ||
|
|
4deed41a12 | ||
|
|
4a7eb9b373 | ||
|
|
bf81c6dd06 | ||
|
|
7a89781a20 | ||
|
|
34ae2c56b7 | ||
|
|
e2941bfe84 | ||
|
|
821b044515 | ||
|
|
933e0a62fb | ||
|
|
25bc343027 | ||
|
|
9ab08fbdd0 | ||
|
|
77727cc4b1 | ||
|
|
002301c792 | ||
|
|
7ee544b013 | ||
|
|
3bc1785351 | ||
|
|
1f58ee7d67 | ||
|
|
5ec1e84671 | ||
|
|
d9fa00e633 | ||
|
|
1a53e7c2f7 | ||
|
|
53a55c2b6e | ||
|
|
5fe8a15a8c | ||
|
|
70cfbf2f5b | ||
|
|
36a7b8346e | ||
|
|
5e6ab55159 | ||
|
|
2aa6fdfac5 | ||
|
|
8acd51c4f1 | ||
|
|
e1d5558dac | ||
|
|
061212f915 | ||
|
|
14bb735f00 | ||
|
|
9714371a36 | ||
|
|
c7c5feeabe | ||
|
|
1c2a64cf50 | ||
|
|
7d4d97ce4e | ||
|
|
1d70053459 | ||
|
|
675ccff3ce | ||
|
|
25b236072e | ||
|
|
b22318015e | ||
|
|
ddb7d8915e | ||
|
|
bca8ce0898 | ||
|
|
4fff9a5c99 | ||
|
|
e98e3049d8 | ||
|
|
456b00a605 | ||
|
|
cc078df80d | ||
|
|
80582692cf | ||
|
|
1bb0cbaebc | ||
|
|
a20a01dbd1 |
@@ -1,21 +0,0 @@
|
|||||||
{
|
|
||||||
"env": {
|
|
||||||
"es6": true,
|
|
||||||
"node": true
|
|
||||||
},
|
|
||||||
"extends": "eslint:recommended",
|
|
||||||
"globals": {
|
|
||||||
"Atomics": "readonly",
|
|
||||||
"SharedArrayBuffer": "readonly"
|
|
||||||
},
|
|
||||||
|
|
||||||
"parserOptions": {
|
|
||||||
"ecmaVersion": 2018,
|
|
||||||
"sourceType": "module"
|
|
||||||
},
|
|
||||||
"rules": {
|
|
||||||
"no-console": "off"
|
|
||||||
},
|
|
||||||
"settings": {},
|
|
||||||
"plugins": ["cypress"]
|
|
||||||
}
|
|
||||||
@@ -10,7 +10,7 @@ npx hasura migrate apply --endpoint https://db.imex.online/ --admin-secret 'Prod
|
|||||||
npx hasura migrate apply --endpoint https://db.test.bodyshop.app/ --admin-secret 'Test-ImEXOnlineBySnaptSoftware!'
|
npx hasura migrate apply --endpoint https://db.test.bodyshop.app/ --admin-secret 'Test-ImEXOnlineBySnaptSoftware!'
|
||||||
|
|
||||||
NGROK TEsting:
|
NGROK TEsting:
|
||||||
./ngrok.exe http http://localhost:5000 -host-header="localhost:5000"
|
./ngrok.exe http http://localhost:4000 -host-header="localhost:4000"
|
||||||
|
|
||||||
Finding deadfiles - run from client directory
|
Finding deadfiles - run from client directory
|
||||||
npx deadfile ./src/index.js --exclude build templates
|
npx deadfile ./src/index.js --exclude build templates
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -3,82 +3,89 @@
|
|||||||
"version": "0.2.1",
|
"version": "0.2.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"proxy": "http://localhost:4000",
|
"proxy": "http://localhost:4000",
|
||||||
|
"browser": {
|
||||||
|
"fs": false,
|
||||||
|
"path": false,
|
||||||
|
"os": false
|
||||||
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@apollo/client": "^3.5.6",
|
"@apollo/client": "^3.5.10",
|
||||||
"@asseinfo/react-kanban": "^2.2.0",
|
"@asseinfo/react-kanban": "^2.2.0",
|
||||||
"@craco/craco": "^6.4.3",
|
"@craco/craco": "^6.4.3",
|
||||||
"@fingerprintjs/fingerprintjs": "^3.3.1",
|
"@fingerprintjs/fingerprintjs": "^3.3.3",
|
||||||
"@sentry/react": "^6.16.1",
|
"@jsreport/browser-client": "^3.1.0",
|
||||||
"@sentry/tracing": "^6.16.1",
|
"@sentry/react": "^6.19.6",
|
||||||
"@splitsoftware/splitio-react": "^1.3.0",
|
"@sentry/tracing": "^6.19.6",
|
||||||
"@stripe/react-stripe-js": "^1.7.0",
|
"@splitsoftware/splitio-react": "^1.4.0",
|
||||||
"@stripe/stripe-js": "^1.22.0",
|
"@stripe/react-stripe-js": "^1.7.1",
|
||||||
"@tanem/react-nprogress": "^3.0.82",
|
"@stripe/stripe-js": "^1.27.0",
|
||||||
"antd": "^4.17.4",
|
"@tanem/react-nprogress": "^5.0.0",
|
||||||
|
"antd": "^4.19.5",
|
||||||
"apollo-link-logger": "^2.0.0",
|
"apollo-link-logger": "^2.0.0",
|
||||||
"axios": "^0.24.0",
|
"axios": "^0.26.1",
|
||||||
"craco-less": "^1.20.0",
|
"craco-less": "^2.0.0",
|
||||||
"dinero.js": "^1.9.1",
|
"dinero.js": "^1.9.1",
|
||||||
"dotenv": "^10.0.0",
|
"dotenv": "^16.0.0",
|
||||||
"enquire-js": "^0.2.1",
|
"enquire-js": "^0.2.1",
|
||||||
"env-cmd": "^10.1.0",
|
"env-cmd": "^10.1.0",
|
||||||
"exifr": "^7.1.3",
|
"exifr": "^7.1.3",
|
||||||
"firebase": "^9.6.1",
|
"firebase": "^9.6.10",
|
||||||
"graphql": "^16.2.0",
|
"graphql": "^16.3.0",
|
||||||
"i18next": "^21.6.3",
|
"i18next": "^21.6.16",
|
||||||
"i18next-browser-languagedetector": "^6.1.2",
|
"i18next-browser-languagedetector": "^6.1.4",
|
||||||
"jsoneditor": "^9.5.8",
|
"jsoneditor": "^9.7.4",
|
||||||
"jsreport-browser-client-dist": "^1.3.0",
|
"libphonenumber-js": "^1.9.51",
|
||||||
"libphonenumber-js": "^1.9.44",
|
"logrocket": "^2.2.1",
|
||||||
"logrocket": "^2.1.2",
|
"markerjs2": "^2.21.0",
|
||||||
"markerjs2": "^2.17.2",
|
|
||||||
"moment-business-days": "^1.2.0",
|
"moment-business-days": "^1.2.0",
|
||||||
"phone": "^3.1.10",
|
"moment-timezone": "^0.5.34",
|
||||||
|
"phone": "^3.1.15",
|
||||||
"preval.macro": "^5.0.0",
|
"preval.macro": "^5.0.0",
|
||||||
"prop-types": "^15.7.2",
|
"prop-types": "^15.8.1",
|
||||||
"query-string": "^7.0.1",
|
"query-string": "^7.1.1",
|
||||||
"rc-queue-anim": "^2.0.0",
|
"rc-queue-anim": "^2.0.0",
|
||||||
"rc-scroll-anim": "^2.7.6",
|
"rc-scroll-anim": "^2.7.6",
|
||||||
"react": "^17.0.2",
|
"react": "^18.0.0",
|
||||||
"react-big-calendar": "^0.38.2",
|
"react-big-calendar": "^0.40.0",
|
||||||
"react-color": "^2.19.3",
|
"react-color": "^2.19.3",
|
||||||
"react-cookie": "^4.1.1",
|
"react-cookie": "^4.1.1",
|
||||||
"react-dom": "^17.0.2",
|
"react-dom": "^18.0.0",
|
||||||
"react-drag-listview": "^0.1.8",
|
"react-drag-listview": "^0.1.9",
|
||||||
"react-grid-gallery": "^0.5.5",
|
"react-grid-gallery": "^0.5.5",
|
||||||
"react-grid-layout": "^1.3.0",
|
"react-grid-layout": "^1.3.4",
|
||||||
"react-i18next": "^11.15.1",
|
"react-i18next": "^11.16.6",
|
||||||
"react-icons": "^4.3.1",
|
"react-icons": "^4.3.1",
|
||||||
"react-number-format": "^4.9.0",
|
"react-number-format": "^4.9.1",
|
||||||
"react-redux": "^7.2.6",
|
"react-redux": "^7.2.8",
|
||||||
"react-resizable": "^3.0.4",
|
"react-resizable": "^3.0.4",
|
||||||
"react-router-dom": "^5.3.0",
|
"react-router-dom": "^5.3.0",
|
||||||
"react-scripts": "^4.0.3",
|
"react-scripts": "^4.0.3",
|
||||||
|
"react-sticky": "^6.0.3",
|
||||||
"react-sublime-video": "^0.2.5",
|
"react-sublime-video": "^0.2.5",
|
||||||
"react-virtualized": "^9.22.3",
|
"react-virtualized": "^9.22.3",
|
||||||
"recharts": "^2.1.8",
|
"recharts": "^2.1.9",
|
||||||
"redux": "^4.1.2",
|
"redux": "^4.1.2",
|
||||||
"redux-persist": "^6.0.0",
|
"redux-persist": "^6.0.0",
|
||||||
"redux-saga": "^1.1.3",
|
"redux-saga": "^1.1.3",
|
||||||
"redux-state-sync": "^3.1.2",
|
"redux-state-sync": "^3.1.2",
|
||||||
"reselect": "^4.1.5",
|
"reselect": "^4.1.5",
|
||||||
"sass": "^1.45.0",
|
"sass": "^1.50.0",
|
||||||
"socket.io-client": "^4.4.0",
|
"socket.io-client": "^4.4.1",
|
||||||
"styled-components": "^5.3.3",
|
"styled-components": "^5.3.5",
|
||||||
"subscriptions-transport-ws": "^0.11.0",
|
"subscriptions-transport-ws": "^0.11.0",
|
||||||
"web-vitals": "^2.1.2",
|
"web-vitals": "^2.1.4",
|
||||||
"workbox-background-sync": "^6.4.2",
|
"workbox-background-sync": "^6.5.3",
|
||||||
"workbox-broadcast-update": "^6.4.2",
|
"workbox-broadcast-update": "^6.5.3",
|
||||||
"workbox-cacheable-response": "^6.4.2",
|
"workbox-cacheable-response": "^6.5.3",
|
||||||
"workbox-core": "^6.4.2",
|
"workbox-core": "^6.5.3",
|
||||||
"workbox-expiration": "^6.4.2",
|
"workbox-expiration": "^6.5.3",
|
||||||
"workbox-google-analytics": "^6.4.2",
|
"workbox-google-analytics": "^6.5.3",
|
||||||
"workbox-navigation-preload": "^6.4.2",
|
"workbox-navigation-preload": "^6.5.3",
|
||||||
"workbox-precaching": "^6.4.2",
|
"workbox-precaching": "^6.5.3",
|
||||||
"workbox-range-requests": "^6.4.2",
|
"workbox-range-requests": "^6.5.3",
|
||||||
"workbox-routing": "^6.4.2",
|
"workbox-routing": "^6.5.3",
|
||||||
"workbox-strategies": "^6.4.2",
|
"workbox-strategies": "^6.5.3",
|
||||||
"workbox-streams": "^6.4.2",
|
"workbox-streams": "^6.5.3",
|
||||||
"yauzl": "^2.10.0"
|
"yauzl": "^2.10.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -115,11 +122,11 @@
|
|||||||
"react-error-overlay": "6.0.9"
|
"react-error-overlay": "6.0.9"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@sentry/webpack-plugin": "^1.18.3",
|
"@sentry/webpack-plugin": "^1.18.8",
|
||||||
"@testing-library/cypress": "^8.0.2",
|
"@testing-library/cypress": "^8.0.2",
|
||||||
"cypress": "^9.1.1",
|
"cypress": "^9.5.4",
|
||||||
"eslint-plugin-cypress": "^2.12.1",
|
"eslint-plugin-cypress": "^2.12.1",
|
||||||
"react-error-overlay": "6.0.9",
|
"react-error-overlay": "6.0.11",
|
||||||
"redux-logger": "^3.0.6",
|
"redux-logger": "^3.0.6",
|
||||||
"source-map-explorer": "^2.5.2"
|
"source-map-explorer": "^2.5.2"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import { ApolloProvider } from "@apollo/client";
|
|||||||
import { SplitFactory, SplitSdk } from "@splitsoftware/splitio-react";
|
import { SplitFactory, SplitSdk } from "@splitsoftware/splitio-react";
|
||||||
import { ConfigProvider } from "antd";
|
import { ConfigProvider } from "antd";
|
||||||
import enLocale from "antd/es/locale/en_US";
|
import enLocale from "antd/es/locale/en_US";
|
||||||
import LogRocket from "logrocket";
|
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
@@ -10,13 +9,8 @@ import GlobalLoadingBar from "../components/global-loading-bar/global-loading-ba
|
|||||||
import client from "../utils/GraphQLClient";
|
import client from "../utils/GraphQLClient";
|
||||||
import App from "./App";
|
import App from "./App";
|
||||||
|
|
||||||
|
|
||||||
moment.locale("en-US");
|
moment.locale("en-US");
|
||||||
|
|
||||||
|
|
||||||
//tracker.start();
|
|
||||||
if (process.env.NODE_ENV === "production") LogRocket.init("gvfvfw/bodyshopapp");
|
|
||||||
|
|
||||||
export const factory = SplitSdk({
|
export const factory = SplitSdk({
|
||||||
core: {
|
core: {
|
||||||
authorizationKey: process.env.REACT_APP_SPLIT_API,
|
authorizationKey: process.env.REACT_APP_SPLIT_API,
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
|
import { useTreatments } from "@splitsoftware/splitio-react";
|
||||||
import { Button, Result } from "antd";
|
import { Button, Result } from "antd";
|
||||||
|
import LogRocket from "logrocket";
|
||||||
import React, { lazy, Suspense, useEffect } from "react";
|
import React, { lazy, Suspense, useEffect } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
@@ -9,15 +11,18 @@ import ErrorBoundary from "../components/error-boundary/error-boundary.component
|
|||||||
//Component Imports
|
//Component Imports
|
||||||
import LoadingSpinner from "../components/loading-spinner/loading-spinner.component";
|
import LoadingSpinner from "../components/loading-spinner/loading-spinner.component";
|
||||||
import DisclaimerPage from "../pages/disclaimer/disclaimer.page";
|
import DisclaimerPage from "../pages/disclaimer/disclaimer.page";
|
||||||
|
import LandingPage from "../pages/landing/landing.page";
|
||||||
import TechPageContainer from "../pages/tech/tech.page.container";
|
import TechPageContainer from "../pages/tech/tech.page.container";
|
||||||
import { setOnline } from "../redux/application/application.actions";
|
import { setOnline } from "../redux/application/application.actions";
|
||||||
import { selectOnline } from "../redux/application/application.selectors";
|
import { selectOnline } from "../redux/application/application.selectors";
|
||||||
import { checkUserSession } from "../redux/user/user.actions";
|
import { checkUserSession } from "../redux/user/user.actions";
|
||||||
import { selectCurrentUser } from "../redux/user/user.selectors";
|
import {
|
||||||
|
selectBodyshop,
|
||||||
|
selectCurrentUser,
|
||||||
|
} from "../redux/user/user.selectors";
|
||||||
import PrivateRoute from "../utils/private-route";
|
import PrivateRoute from "../utils/private-route";
|
||||||
import "./App.styles.scss";
|
import "./App.styles.scss";
|
||||||
|
|
||||||
import LandingPage from "../pages/landing/landing.page";
|
|
||||||
const ResetPassword = lazy(() =>
|
const ResetPassword = lazy(() =>
|
||||||
import("../pages/reset-password/reset-password.component")
|
import("../pages/reset-password/reset-password.component")
|
||||||
);
|
);
|
||||||
@@ -32,13 +37,26 @@ const MobilePaymentContainer = lazy(() =>
|
|||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
currentUser: selectCurrentUser,
|
currentUser: selectCurrentUser,
|
||||||
online: selectOnline,
|
online: selectOnline,
|
||||||
|
bodyshop: selectBodyshop,
|
||||||
});
|
});
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
checkUserSession: () => dispatch(checkUserSession()),
|
checkUserSession: () => dispatch(checkUserSession()),
|
||||||
setOnline: (isOnline) => dispatch(setOnline(isOnline)),
|
setOnline: (isOnline) => dispatch(setOnline(isOnline)),
|
||||||
});
|
});
|
||||||
|
|
||||||
export function App({ checkUserSession, currentUser, online, setOnline }) {
|
export function App({
|
||||||
|
bodyshop,
|
||||||
|
checkUserSession,
|
||||||
|
currentUser,
|
||||||
|
online,
|
||||||
|
setOnline,
|
||||||
|
}) {
|
||||||
|
const { LogRocket_Tracking } = useTreatments(
|
||||||
|
["LogRocket_Tracking"],
|
||||||
|
{},
|
||||||
|
bodyshop && bodyshop.imexshopid
|
||||||
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!navigator.onLine) {
|
if (!navigator.onLine) {
|
||||||
setOnline(false);
|
setOnline(false);
|
||||||
@@ -59,6 +77,16 @@ export function App({ checkUserSession, currentUser, online, setOnline }) {
|
|||||||
window.addEventListener("online", function (e) {
|
window.addEventListener("online", function (e) {
|
||||||
setOnline(true);
|
setOnline(true);
|
||||||
});
|
});
|
||||||
|
useEffect(() => {
|
||||||
|
if (currentUser.authorized) {
|
||||||
|
if (
|
||||||
|
process.env.NODE_ENV === "production" &&
|
||||||
|
LogRocket_Tracking.treatment === "on"
|
||||||
|
) {
|
||||||
|
LogRocket.init("gvfvfw/bodyshopapp");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [currentUser.authorized, LogRocket_Tracking.treatment]);
|
||||||
|
|
||||||
if (currentUser.authorized === null) {
|
if (currentUser.authorized === null) {
|
||||||
return <LoadingSpinner message={t("general.labels.loggingin")} />;
|
return <LoadingSpinner message={t("general.labels.loggingin")} />;
|
||||||
|
|||||||
@@ -91,13 +91,13 @@
|
|||||||
color: blue;
|
color: blue;
|
||||||
}
|
}
|
||||||
|
|
||||||
.production-completion-1 {
|
.production-completion-soon {
|
||||||
animation: production-completion-1-blinker 5s linear infinite;
|
color: rgba(255, 140, 0, 0.8);
|
||||||
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
@keyframes production-completion-1-blinker {
|
.production-completion-past {
|
||||||
50% {
|
color: rgba(255, 0, 0, 0.8);
|
||||||
background: rgba(207, 12, 12, 0.555);
|
font-weight: bold;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.react-resizable {
|
.react-resizable {
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import QboAuthorizeComponent from "../qbo-authorize/qbo-authorize.component";
|
|||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
|
import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -76,14 +77,12 @@ export function AccountingPayablesTableComponent({
|
|||||||
render: (text, record) => {
|
render: (text, record) => {
|
||||||
return record.job.owner ? (
|
return record.job.owner ? (
|
||||||
<Link to={"/manage/owners/" + record.job.owner.id}>
|
<Link to={"/manage/owners/" + record.job.owner.id}>
|
||||||
{`${record.job.ownr_fn || ""} ${record.job.ownr_ln || ""} ${
|
<OwnerNameDisplay ownerObject={record.job} />
|
||||||
record.job.ownr_co_nm || ""
|
|
||||||
}`}
|
|
||||||
</Link>
|
</Link>
|
||||||
) : (
|
) : (
|
||||||
<span>{`${record.job.ownr_fn || ""} ${record.job.ownr_ln || ""} ${
|
<span>
|
||||||
record.job.ownr_co_nm || ""
|
<OwnerNameDisplay ownerObject={record.job} />
|
||||||
}`}</span>
|
</span>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -162,10 +161,19 @@ export function AccountingPayablesTableComponent({
|
|||||||
const dataSource = state.search
|
const dataSource = state.search
|
||||||
? payments.filter(
|
? payments.filter(
|
||||||
(v) =>
|
(v) =>
|
||||||
(v.vendor.name || "")
|
(v.paymentnum || "")
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.includes(state.search.toLowerCase()) ||
|
.includes(state.search.toLowerCase()) ||
|
||||||
(v.invoice_number || "")
|
((v.job && v.job.ro_number) || "")
|
||||||
|
.toLowerCase()
|
||||||
|
.includes(state.search.toLowerCase()) ||
|
||||||
|
((v.job && v.job.ownr_fn) || "")
|
||||||
|
.toLowerCase()
|
||||||
|
.includes(state.search.toLowerCase()) ||
|
||||||
|
((v.job && v.job.ownr_ln) || "")
|
||||||
|
.toLowerCase()
|
||||||
|
.includes(state.search.toLowerCase()) ||
|
||||||
|
((v.job && v.job.ownr_co_nm) || "")
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.includes(state.search.toLowerCase())
|
.includes(state.search.toLowerCase())
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { useTranslation } from "react-i18next";
|
|||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||||
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
||||||
import { alphaSort } from "../../utils/sorters";
|
import { alphaSort, dateSort } from "../../utils/sorters";
|
||||||
import JobExportButton from "../jobs-close-export-button/jobs-close-export-button.component";
|
import JobExportButton from "../jobs-close-export-button/jobs-close-export-button.component";
|
||||||
import JobsExportAllButton from "../jobs-export-all-button/jobs-export-all-button.component";
|
import JobsExportAllButton from "../jobs-export-all-button/jobs-export-all-button.component";
|
||||||
|
|
||||||
@@ -12,6 +12,9 @@ import { connect } from "react-redux";
|
|||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import QboAuthorizeComponent from "../qbo-authorize/qbo-authorize.component";
|
import QboAuthorizeComponent from "../qbo-authorize/qbo-authorize.component";
|
||||||
|
import { DateFormatter } from "../../utils/DateFormatter";
|
||||||
|
import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
});
|
});
|
||||||
@@ -62,6 +65,18 @@ export function AccountingReceivablesTableComponent({
|
|||||||
sortOrder:
|
sortOrder:
|
||||||
state.sortedInfo.columnKey === "status" && state.sortedInfo.order,
|
state.sortedInfo.columnKey === "status" && state.sortedInfo.order,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: t("jobs.fields.date_invoiced"),
|
||||||
|
dataIndex: "date_invoiced",
|
||||||
|
key: "date_invoiced",
|
||||||
|
sorter: (a, b) => dateSort(a.date_invoiced, b.date_invoiced),
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "date_invoiced" &&
|
||||||
|
state.sortedInfo.order,
|
||||||
|
render: (text, record) => (
|
||||||
|
<DateFormatter>{record.date_invoiced}</DateFormatter>
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: t("jobs.fields.owner"),
|
title: t("jobs.fields.owner"),
|
||||||
dataIndex: "owner",
|
dataIndex: "owner",
|
||||||
@@ -72,14 +87,12 @@ export function AccountingReceivablesTableComponent({
|
|||||||
render: (text, record) => {
|
render: (text, record) => {
|
||||||
return record.owner ? (
|
return record.owner ? (
|
||||||
<Link to={"/manage/owners/" + record.owner.id}>
|
<Link to={"/manage/owners/" + record.owner.id}>
|
||||||
{`${record.ownr_fn || ""} ${record.ownr_ln || ""} ${
|
<OwnerNameDisplay ownerObject={record} />
|
||||||
record.ownr_co_nm || ""
|
|
||||||
}`}
|
|
||||||
</Link>
|
</Link>
|
||||||
) : (
|
) : (
|
||||||
<span>{`${record.ownr_fn || ""} ${record.ownr_ln || ""} ${
|
<span>
|
||||||
record.ownr_co_nm || ""
|
<OwnerNameDisplay ownerObject={record} />
|
||||||
}`}</span>
|
</span>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import React, { useEffect, useState } from "react";
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { useLocation, useHistory } from "react-router-dom";
|
import { useLocation, useHistory } from "react-router-dom";
|
||||||
import {
|
import {
|
||||||
|
DELETE_BILL_LINE,
|
||||||
INSERT_NEW_BILL_LINES,
|
INSERT_NEW_BILL_LINES,
|
||||||
UPDATE_BILL_LINE,
|
UPDATE_BILL_LINE,
|
||||||
} from "../../graphql/bill-lines.queries";
|
} from "../../graphql/bill-lines.queries";
|
||||||
@@ -28,6 +29,7 @@ import { createStructuredSelector } from "reselect";
|
|||||||
import { setModalContext } from "../../redux/modals/modals.actions";
|
import { setModalContext } from "../../redux/modals/modals.actions";
|
||||||
import { insertAuditTrail } from "../../redux/application/application.actions";
|
import { insertAuditTrail } from "../../redux/application/application.actions";
|
||||||
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
||||||
|
import BillMarkExportedButton from "../bill-mark-exported-button/bill-mark-exported-button.component";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
//currentUser: selectCurrentUser
|
//currentUser: selectCurrentUser
|
||||||
@@ -57,6 +59,7 @@ export function BillDetailEditcontainer({
|
|||||||
const [update_bill] = useMutation(UPDATE_BILL);
|
const [update_bill] = useMutation(UPDATE_BILL);
|
||||||
const [insertBillLine] = useMutation(INSERT_NEW_BILL_LINES);
|
const [insertBillLine] = useMutation(INSERT_NEW_BILL_LINES);
|
||||||
const [updateBillLine] = useMutation(UPDATE_BILL_LINE);
|
const [updateBillLine] = useMutation(UPDATE_BILL_LINE);
|
||||||
|
const [deleteBillLine] = useMutation(DELETE_BILL_LINE);
|
||||||
|
|
||||||
const selectedBreakpoint = Object.entries(Grid.useBreakpoint())
|
const selectedBreakpoint = Object.entries(Grid.useBreakpoint())
|
||||||
.filter((screen) => !!screen[1])
|
.filter((screen) => !!screen[1])
|
||||||
@@ -106,8 +109,22 @@ export function BillDetailEditcontainer({
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//Find bill lines that were deleted.
|
||||||
|
const deletedJobLines = [];
|
||||||
|
|
||||||
|
data.bills_by_pk.billlines.forEach((a) => {
|
||||||
|
const matchingRecord = billlines.find((b) => b.id === a.id);
|
||||||
|
if (!matchingRecord) {
|
||||||
|
deletedJobLines.push(a);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
deletedJobLines.forEach((d) => {
|
||||||
|
updates.push(deleteBillLine({ variables: { id: d.id } }));
|
||||||
|
});
|
||||||
|
|
||||||
billlines.forEach((billline) => {
|
billlines.forEach((billline) => {
|
||||||
const { deductedfromlbr, ...il } = billline;
|
const { deductedfromlbr, jobline, ...il } = billline;
|
||||||
delete il.__typename;
|
delete il.__typename;
|
||||||
|
|
||||||
if (il.id) {
|
if (il.id) {
|
||||||
@@ -141,6 +158,7 @@ export function BillDetailEditcontainer({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
await Promise.all(updates);
|
await Promise.all(updates);
|
||||||
|
|
||||||
insertAuditTrail({
|
insertAuditTrail({
|
||||||
@@ -206,6 +224,8 @@ export function BillDetailEditcontainer({
|
|||||||
cost: i.actual_cost,
|
cost: i.actual_cost,
|
||||||
quantity: i.quantity,
|
quantity: i.quantity,
|
||||||
joblineid: i.joblineid,
|
joblineid: i.joblineid,
|
||||||
|
oem_partno: i.jobline && i.jobline.oem_partno,
|
||||||
|
part_type: i.jobline && i.jobline.part_type,
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
isReturn: true,
|
isReturn: true,
|
||||||
@@ -234,6 +254,7 @@ export function BillDetailEditcontainer({
|
|||||||
</Button>
|
</Button>
|
||||||
</Popconfirm>
|
</Popconfirm>
|
||||||
<BillReeportButtonComponent bill={data && data.bills_by_pk} />
|
<BillReeportButtonComponent bill={data && data.bills_by_pk} />
|
||||||
|
<BillMarkExportedButton bill={data && data.bills_by_pk} />
|
||||||
</Space>
|
</Space>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -93,6 +93,7 @@ function BillEnterModalContainer({
|
|||||||
deductedfromlbr,
|
deductedfromlbr,
|
||||||
lbr_adjustment,
|
lbr_adjustment,
|
||||||
location: lineLocation,
|
location: lineLocation,
|
||||||
|
part_type,
|
||||||
...restI
|
...restI
|
||||||
} = i;
|
} = i;
|
||||||
|
|
||||||
@@ -216,7 +217,11 @@ function BillEnterModalContainer({
|
|||||||
|
|
||||||
if (enterAgain) {
|
if (enterAgain) {
|
||||||
form.resetFields();
|
form.resetFields();
|
||||||
form.setFieldsValue({ ...form.getFieldsValue(), billlines: [] });
|
form.resetFields();
|
||||||
|
form.setFieldsValue({
|
||||||
|
...formValues,
|
||||||
|
billlines: [],
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
toggleModalVisible();
|
toggleModalVisible();
|
||||||
}
|
}
|
||||||
@@ -245,7 +250,7 @@ function BillEnterModalContainer({
|
|||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
title={t("bills.labels.new")}
|
title={t("bills.labels.new")}
|
||||||
width={"90%"}
|
width={"98%"}
|
||||||
visible={billEnterModal.visible}
|
visible={billEnterModal.visible}
|
||||||
okText={t("general.actions.save")}
|
okText={t("general.actions.save")}
|
||||||
keyboard="false"
|
keyboard="false"
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ export function BillFormComponent({
|
|||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("bills.fields.vendor")}
|
label={t("bills.fields.vendor")}
|
||||||
name="vendorid"
|
name="vendorid"
|
||||||
style={{ display: billEdit ? "none" : null }}
|
// style={{ display: billEdit ? "none" : null }}
|
||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
@@ -229,6 +229,7 @@ export function BillFormComponent({
|
|||||||
({ getFieldValue }) => ({
|
({ getFieldValue }) => ({
|
||||||
validator(rule, value) {
|
validator(rule, value) {
|
||||||
if (
|
if (
|
||||||
|
!bodyshop.bill_allow_post_to_closed &&
|
||||||
(job.status === bodyshop.md_ro_statuses.default_invoiced ||
|
(job.status === bodyshop.md_ro_statuses.default_invoiced ||
|
||||||
job.status === bodyshop.md_ro_statuses.default_exported ||
|
job.status === bodyshop.md_ro_statuses.default_exported ||
|
||||||
job.status === bodyshop.md_ro_statuses.default_void) &&
|
job.status === bodyshop.md_ro_statuses.default_void) &&
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { DeleteFilled, WarningOutlined } from "@ant-design/icons";
|
import { DeleteFilled, DollarCircleFilled } from "@ant-design/icons";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Form,
|
Form,
|
||||||
@@ -8,6 +8,7 @@ import {
|
|||||||
Space,
|
Space,
|
||||||
Switch,
|
Switch,
|
||||||
Table,
|
Table,
|
||||||
|
Tooltip
|
||||||
} from "antd";
|
} from "antd";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
@@ -43,7 +44,7 @@ export function BillEnterModalLinesComponent({
|
|||||||
title: t("billlines.fields.jobline"),
|
title: t("billlines.fields.jobline"),
|
||||||
dataIndex: "joblineid",
|
dataIndex: "joblineid",
|
||||||
editable: true,
|
editable: true,
|
||||||
|
width: "20rem",
|
||||||
formItemProps: (field) => {
|
formItemProps: (field) => {
|
||||||
return {
|
return {
|
||||||
key: `${field.index}joblinename`,
|
key: `${field.index}joblinename`,
|
||||||
@@ -57,11 +58,24 @@ export function BillEnterModalLinesComponent({
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
wrapper: (props) => (
|
||||||
|
<Form.Item
|
||||||
|
noStyle
|
||||||
|
shouldUpdate={(prev, cur) =>
|
||||||
|
prev.is_credit_memo !== cur.is_credit_memo
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{() => {
|
||||||
|
return props.children;
|
||||||
|
}}
|
||||||
|
</Form.Item>
|
||||||
|
),
|
||||||
formInput: (record, index) => (
|
formInput: (record, index) => (
|
||||||
<BillLineSearchSelect
|
<BillLineSearchSelect
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
options={lineData}
|
options={lineData}
|
||||||
style={{ width: "100%", minWidth: "10rem" }}
|
style={{ width: "100%", minWidth: "10rem" }}
|
||||||
|
allowRemoved={form.getFieldValue("is_credit_memo") || false}
|
||||||
onSelect={(value, opt) => {
|
onSelect={(value, opt) => {
|
||||||
setFieldsValue({
|
setFieldsValue({
|
||||||
billlines: getFieldsValue(["billlines"]).billlines.map(
|
billlines: getFieldsValue(["billlines"]).billlines.map(
|
||||||
@@ -201,23 +215,58 @@ export function BillEnterModalLinesComponent({
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
formInput: (record, index) => (
|
formInput: (record, index) => (
|
||||||
<CurrencyInput min={0} disabled={disabled} />
|
<CurrencyInput
|
||||||
|
min={0}
|
||||||
|
disabled={disabled}
|
||||||
|
controls={false}
|
||||||
|
addonAfter={
|
||||||
|
<Form.Item shouldUpdate noStyle>
|
||||||
|
{() => {
|
||||||
|
const line = getFieldsValue(["billlines"]).billlines[index];
|
||||||
|
if (!!!line) return null;
|
||||||
|
let lineDiscount = 1 - line.actual_cost / line.actual_price;
|
||||||
|
if (isNaN(lineDiscount)) lineDiscount = 0;
|
||||||
|
return (
|
||||||
|
<Tooltip title={`${(lineDiscount * 100).toFixed(2) || 0}%`}>
|
||||||
|
<DollarCircleFilled
|
||||||
|
style={{
|
||||||
|
color:
|
||||||
|
Math.abs(lineDiscount - discount) > 0.005
|
||||||
|
? lineDiscount > discount
|
||||||
|
? "orange"
|
||||||
|
: "red"
|
||||||
|
: "green",
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Tooltip>
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
</Form.Item>
|
||||||
|
}
|
||||||
|
/>
|
||||||
),
|
),
|
||||||
additional: (record, index) => (
|
// additional: (record, index) => (
|
||||||
<Form.Item shouldUpdate>
|
// <Form.Item shouldUpdate>
|
||||||
{() => {
|
// {() => {
|
||||||
const line = getFieldsValue(["billlines"]).billlines[index];
|
// const line = getFieldsValue(["billlines"]).billlines[index];
|
||||||
if (!!!line) return null;
|
// if (!!!line) return null;
|
||||||
const lineDiscount = (
|
// const lineDiscount = (
|
||||||
1 -
|
// 1 -
|
||||||
Math.round((line.actual_cost / line.actual_price) * 100) / 100
|
// Math.round((line.actual_cost / line.actual_price) * 100) / 100
|
||||||
).toPrecision(2);
|
// ).toPrecision(2);
|
||||||
|
|
||||||
if (lineDiscount - discount === 0) return <div />;
|
// return (
|
||||||
return <WarningOutlined style={{ color: "red" }} />;
|
// <Tooltip title={`${(lineDiscount * 100).toFixed(0) || 0}%`}>
|
||||||
}}
|
// <DollarCircleFilled
|
||||||
</Form.Item>
|
// style={{
|
||||||
),
|
// color: lineDiscount - discount !== 0 ? "red" : "green",
|
||||||
|
// }}
|
||||||
|
// />
|
||||||
|
// </Tooltip>
|
||||||
|
// );
|
||||||
|
// }}
|
||||||
|
// </Form.Item>
|
||||||
|
// ),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t("billlines.fields.cost_center"),
|
title: t("billlines.fields.cost_center"),
|
||||||
@@ -285,6 +334,19 @@ export function BillEnterModalLinesComponent({
|
|||||||
additional: (record, index) => (
|
additional: (record, index) => (
|
||||||
<Form.Item shouldUpdate style={{ display: "inline-block" }}>
|
<Form.Item shouldUpdate style={{ display: "inline-block" }}>
|
||||||
{() => {
|
{() => {
|
||||||
|
const price = getFieldValue([
|
||||||
|
"billlines",
|
||||||
|
record.name,
|
||||||
|
"actual_price",
|
||||||
|
]);
|
||||||
|
|
||||||
|
const adjustmentRate = getFieldValue([
|
||||||
|
"billlines",
|
||||||
|
record.name,
|
||||||
|
"lbr_adjustment",
|
||||||
|
"rate",
|
||||||
|
]);
|
||||||
|
|
||||||
if (getFieldValue(["billlines", record.name, "deductedfromlbr"]))
|
if (getFieldValue(["billlines", record.name, "deductedfromlbr"]))
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
@@ -357,6 +419,9 @@ export function BillEnterModalLinesComponent({
|
|||||||
>
|
>
|
||||||
<InputNumber precision={2} min={0.01} />
|
<InputNumber precision={2} min={0.01} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
{price &&
|
||||||
|
adjustmentRate &&
|
||||||
|
`${(price / adjustmentRate).toFixed(1)} hrs`}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
return <></>;
|
return <></>;
|
||||||
@@ -488,6 +553,7 @@ const EditableCell = ({
|
|||||||
formInput,
|
formInput,
|
||||||
formItemProps,
|
formItemProps,
|
||||||
additional,
|
additional,
|
||||||
|
wrapper,
|
||||||
...restProps
|
...restProps
|
||||||
}) => {
|
}) => {
|
||||||
if (additional)
|
if (additional)
|
||||||
@@ -505,7 +571,20 @@ const EditableCell = ({
|
|||||||
</Space>
|
</Space>
|
||||||
</td>
|
</td>
|
||||||
);
|
);
|
||||||
|
if (wrapper)
|
||||||
|
return (
|
||||||
|
<wrapper>
|
||||||
|
<td {...restProps}>
|
||||||
|
<Form.Item
|
||||||
|
labelCol={{ span: 0 }}
|
||||||
|
name={dataIndex}
|
||||||
|
{...(formItemProps && formItemProps(record))}
|
||||||
|
>
|
||||||
|
{(formInput && formInput(record, record.name)) || children}
|
||||||
|
</Form.Item>
|
||||||
|
</td>
|
||||||
|
</wrapper>
|
||||||
|
);
|
||||||
return (
|
return (
|
||||||
<td {...restProps}>
|
<td {...restProps}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
|
|||||||
@@ -4,7 +4,10 @@ import { useTranslation } from "react-i18next";
|
|||||||
|
|
||||||
//To be used as a form element only.
|
//To be used as a form element only.
|
||||||
const { Option } = Select;
|
const { Option } = Select;
|
||||||
const BillLineSearchSelect = ({ options, disabled, ...restProps }, ref) => {
|
const BillLineSearchSelect = (
|
||||||
|
{ options, disabled, allowRemoved, ...restProps },
|
||||||
|
ref
|
||||||
|
) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -12,6 +15,7 @@ const BillLineSearchSelect = ({ options, disabled, ...restProps }, ref) => {
|
|||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
ref={ref}
|
ref={ref}
|
||||||
showSearch
|
showSearch
|
||||||
|
dropdownMatchSelectWidth={false}
|
||||||
// optionFilterProp="line_desc"
|
// optionFilterProp="line_desc"
|
||||||
filterOption={(inputValue, option) => {
|
filterOption={(inputValue, option) => {
|
||||||
return (
|
return (
|
||||||
@@ -36,7 +40,7 @@ const BillLineSearchSelect = ({ options, disabled, ...restProps }, ref) => {
|
|||||||
{options
|
{options
|
||||||
? options.map((item) => (
|
? options.map((item) => (
|
||||||
<Option
|
<Option
|
||||||
disabled={item.removed}
|
disabled={allowRemoved ? false : item.removed}
|
||||||
key={item.id}
|
key={item.id}
|
||||||
value={item.id}
|
value={item.id}
|
||||||
cost={item.act_price ? item.act_price : 0}
|
cost={item.act_price ? item.act_price : 0}
|
||||||
@@ -49,9 +53,14 @@ const BillLineSearchSelect = ({ options, disabled, ...restProps }, ref) => {
|
|||||||
...(item.removed ? { textDecoration: "line-through" } : {}),
|
...(item.removed ? { textDecoration: "line-through" } : {}),
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{`${item.removed ? `(REMOVED) ` : ""}${item.line_desc}${
|
<span>{`${item.removed ? `(REMOVED) ` : ""}${item.line_desc}${
|
||||||
item.oem_partno ? ` - ${item.oem_partno}` : ""
|
item.oem_partno ? ` - ${item.oem_partno}` : ""
|
||||||
}${item.act_price ? ` - $${item.act_price}` : ``}`}
|
}`}</span>
|
||||||
|
<span style={{ float: "right", paddingleft: "1rem" }}>
|
||||||
|
{item.act_price
|
||||||
|
? `$${item.act_price && item.act_price.toFixed(2)}`
|
||||||
|
: ``}
|
||||||
|
</span>
|
||||||
</Option>
|
</Option>
|
||||||
))
|
))
|
||||||
: null}
|
: null}
|
||||||
|
|||||||
@@ -0,0 +1,82 @@
|
|||||||
|
import { useMutation } from "@apollo/client";
|
||||||
|
import { Button, notification } from "antd";
|
||||||
|
import { gql } from "@apollo/client";
|
||||||
|
import React, { useState } from "react";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import {
|
||||||
|
selectAuthLevel,
|
||||||
|
selectBodyshop,
|
||||||
|
} from "../../redux/user/user.selectors";
|
||||||
|
import { HasRbacAccess } from "../rbac-wrapper/rbac-wrapper.component";
|
||||||
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
bodyshop: selectBodyshop,
|
||||||
|
authLevel: selectAuthLevel,
|
||||||
|
});
|
||||||
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
|
});
|
||||||
|
|
||||||
|
export default connect(
|
||||||
|
mapStateToProps,
|
||||||
|
mapDispatchToProps
|
||||||
|
)(BillMarkExportedButton);
|
||||||
|
|
||||||
|
export function BillMarkExportedButton({ bodyshop, authLevel, bill }) {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const [loading, setLoading] = useState(false);
|
||||||
|
|
||||||
|
const [updateBill] = useMutation(gql`
|
||||||
|
mutation UPDATE_BILL($billId: uuid!) {
|
||||||
|
update_bills(where: { id: { _eq: $billId } }, _set: { exported: true }) {
|
||||||
|
returning {
|
||||||
|
id
|
||||||
|
exported
|
||||||
|
exported_at
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`);
|
||||||
|
|
||||||
|
const handleUpdate = async () => {
|
||||||
|
setLoading(true);
|
||||||
|
const result = await updateBill({
|
||||||
|
variables: { billId: bill.id },
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!result.errors) {
|
||||||
|
notification["success"]({
|
||||||
|
message: t("bills.successes.markexported"),
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
notification["error"]({
|
||||||
|
message: t("bills.errors.saving", {
|
||||||
|
error: JSON.stringify(result.errors),
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
setLoading(false);
|
||||||
|
//Get the owner details, populate it all back into the job.
|
||||||
|
};
|
||||||
|
|
||||||
|
const hasAccess = HasRbacAccess({
|
||||||
|
bodyshop,
|
||||||
|
authLevel,
|
||||||
|
action: "bills:reexport",
|
||||||
|
});
|
||||||
|
|
||||||
|
if (hasAccess)
|
||||||
|
return (
|
||||||
|
<Button
|
||||||
|
loading={loading}
|
||||||
|
disabled={bill.exported}
|
||||||
|
onClick={handleUpdate}
|
||||||
|
>
|
||||||
|
{t("bills.labels.markexported")}
|
||||||
|
</Button>
|
||||||
|
);
|
||||||
|
|
||||||
|
return <></>;
|
||||||
|
}
|
||||||
@@ -58,7 +58,8 @@ export function BillsListTableComponent({
|
|||||||
disabled={
|
disabled={
|
||||||
record.is_credit_memo || record.vendorid === bodyshop.inhousevendorid
|
record.is_credit_memo || record.vendorid === bodyshop.inhousevendorid
|
||||||
}
|
}
|
||||||
onClick={() =>
|
onClick={() => {
|
||||||
|
console.log(record);
|
||||||
setPartsOrderContext({
|
setPartsOrderContext({
|
||||||
actions: {},
|
actions: {},
|
||||||
context: {
|
context: {
|
||||||
@@ -74,12 +75,14 @@ export function BillsListTableComponent({
|
|||||||
cost: i.actual_cost,
|
cost: i.actual_cost,
|
||||||
quantity: i.quantity,
|
quantity: i.quantity,
|
||||||
joblineid: i.joblineid,
|
joblineid: i.joblineid,
|
||||||
|
oem_partno: i.jobline && i.jobline.oem_partno,
|
||||||
|
part_type: i.jobline && i.jobline.part_type,
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
isReturn: true,
|
isReturn: true,
|
||||||
},
|
},
|
||||||
})
|
});
|
||||||
}
|
}}
|
||||||
>
|
>
|
||||||
{t("bills.actions.return")}
|
{t("bills.actions.return")}
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -5,21 +5,25 @@ import { connect } from "react-redux";
|
|||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { selectBreadcrumbs } from "../../redux/application/application.selectors";
|
import { selectBreadcrumbs } from "../../redux/application/application.selectors";
|
||||||
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import GlobalSearch from "../global-search/global-search.component";
|
import GlobalSearch from "../global-search/global-search.component";
|
||||||
import "./breadcrumbs.styles.scss";
|
import "./breadcrumbs.styles.scss";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
breadcrumbs: selectBreadcrumbs,
|
breadcrumbs: selectBreadcrumbs,
|
||||||
|
bodyshop: selectBodyshop,
|
||||||
});
|
});
|
||||||
|
|
||||||
export function BreadCrumbs({ breadcrumbs }) {
|
export function BreadCrumbs({ breadcrumbs, bodyshop }) {
|
||||||
return (
|
return (
|
||||||
<Row className="breadcrumb-container">
|
<Row className="breadcrumb-container">
|
||||||
<Col xs={24} sm={24} md={16}>
|
<Col xs={24} sm={24} md={16}>
|
||||||
<Breadcrumb separator=">">
|
<Breadcrumb separator=">">
|
||||||
<Breadcrumb.Item>
|
<Breadcrumb.Item>
|
||||||
<Link to={`/manage`}>
|
<Link to={`/manage`}>
|
||||||
<HomeFilled />
|
<HomeFilled />{" "}
|
||||||
|
{(bodyshop && bodyshop.shopname && `(${bodyshop.shopname})`) ||
|
||||||
|
""}
|
||||||
</Link>
|
</Link>
|
||||||
</Breadcrumb.Item>
|
</Breadcrumb.Item>
|
||||||
{breadcrumbs.map((item) =>
|
{breadcrumbs.map((item) =>
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import { selectSelectedConversation } from "../../redux/messaging/messaging.sele
|
|||||||
import { TimeAgoFormatter } from "../../utils/DateFormatter";
|
import { TimeAgoFormatter } from "../../utils/DateFormatter";
|
||||||
import PhoneFormatter from "../../utils/PhoneFormatter";
|
import PhoneFormatter from "../../utils/PhoneFormatter";
|
||||||
import "./chat-conversation-list.styles.scss";
|
import "./chat-conversation-list.styles.scss";
|
||||||
|
import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
selectedConversation: selectSelectedConversation,
|
selectedConversation: selectSelectedConversation,
|
||||||
@@ -40,9 +41,9 @@ export function ChatConversationListComponent({
|
|||||||
{item.job_conversations.length > 0 ? (
|
{item.job_conversations.length > 0 ? (
|
||||||
<div className="chat-name">
|
<div className="chat-name">
|
||||||
{item.job_conversations.map((j, idx) => (
|
{item.job_conversations.map((j, idx) => (
|
||||||
<div key={idx}>{`${j.job.ownr_fn || ""} ${
|
<div key={idx}>
|
||||||
j.job.ownr_ln || ""
|
<OwnerNameDisplay ownerObject={j.job} />
|
||||||
} ${j.job.ownr_co_nm || ""} `}</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import React from "react";
|
|||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||||
import { REMOVE_CONVERSATION_TAG } from "../../graphql/job-conversations.queries";
|
import { REMOVE_CONVERSATION_TAG } from "../../graphql/job-conversations.queries";
|
||||||
|
import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
|
||||||
|
|
||||||
export default function ChatConversationTitleTags({ jobConversations }) {
|
export default function ChatConversationTitleTags({ jobConversations }) {
|
||||||
const [removeJobConversation] = useMutation(REMOVE_CONVERSATION_TAG);
|
const [removeJobConversation] = useMutation(REMOVE_CONVERSATION_TAG);
|
||||||
@@ -45,9 +46,8 @@ export default function ChatConversationTitleTags({ jobConversations }) {
|
|||||||
onClose={() => handleRemoveTag(item.job.id)}
|
onClose={() => handleRemoveTag(item.job.id)}
|
||||||
>
|
>
|
||||||
<Link to={`/manage/jobs/${item.job.id}`}>
|
<Link to={`/manage/jobs/${item.job.id}`}>
|
||||||
{`${item.job.ro_number || "?"} | ${item.job.ownr_fn || ""} ${
|
{`${item.job.ro_number || "?"} | `}
|
||||||
item.job.ownr_ln || ""
|
<OwnerNameDisplay ownerObject={item.job} />
|
||||||
} ${item.job.ownr_co_nm || ""}`}
|
|
||||||
</Link>
|
</Link>
|
||||||
</Tag>
|
</Tag>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@@ -45,13 +45,14 @@ function ChatSendMessageComponent({
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const handleEnter = () => {
|
const handleEnter = () => {
|
||||||
if (message === "" || !message) return;
|
|
||||||
logImEXEvent("messaging_send_message");
|
|
||||||
const selectedImages = selectedMedia.filter((i) => i.isSelected);
|
const selectedImages = selectedMedia.filter((i) => i.isSelected);
|
||||||
if (selectedImages < 11) {
|
if ((message === "" || !message) && selectedImages.length === 0) return;
|
||||||
|
logImEXEvent("messaging_send_message");
|
||||||
|
|
||||||
|
if (selectedImages.length < 11) {
|
||||||
sendMessage({
|
sendMessage({
|
||||||
to: conversation.phone_num,
|
to: conversation.phone_num,
|
||||||
body: message,
|
body: message || "",
|
||||||
messagingServiceSid: bodyshop.messagingservicesid,
|
messagingServiceSid: bodyshop.messagingservicesid,
|
||||||
conversationid: conversation.id,
|
conversationid: conversation.id,
|
||||||
selectedMedia: selectedImages,
|
selectedMedia: selectedImages,
|
||||||
@@ -92,7 +93,7 @@ function ChatSendMessageComponent({
|
|||||||
</span>
|
</span>
|
||||||
<SendOutlined
|
<SendOutlined
|
||||||
className="imex-flex-row__margin"
|
className="imex-flex-row__margin"
|
||||||
disabled={message === "" || !message}
|
// disabled={message === "" || !message}
|
||||||
onClick={handleEnter}
|
onClick={handleEnter}
|
||||||
/>
|
/>
|
||||||
<Spin
|
<Spin
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import { CloseCircleOutlined, LoadingOutlined } from "@ant-design/icons";
|
import { CloseCircleOutlined, LoadingOutlined } from "@ant-design/icons";
|
||||||
import { Select, Empty, Space } from "antd";
|
import { Empty, Select, Space } from "antd";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { OwnerNameDisplayFunction } from "../owner-name-display/owner-name-display.component";
|
||||||
|
|
||||||
export default function ChatTagRoComponent({
|
export default function ChatTagRoComponent({
|
||||||
roOptions,
|
roOptions,
|
||||||
@@ -27,9 +28,7 @@ export default function ChatTagRoComponent({
|
|||||||
>
|
>
|
||||||
{roOptions.map((item, idx) => (
|
{roOptions.map((item, idx) => (
|
||||||
<Select.Option key={item.id || idx}>
|
<Select.Option key={item.id || idx}>
|
||||||
{` ${item.ro_number || ""} | ${item.ownr_fn || ""} ${
|
{` ${item.ro_number || ""} | ${OwnerNameDisplayFunction(item)}`}
|
||||||
item.ownr_ln || ""
|
|
||||||
} ${item.ownr_co_nm || ""}`}
|
|
||||||
</Select.Option>
|
</Select.Option>
|
||||||
))}
|
))}
|
||||||
</Select>
|
</Select>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import React from "react";
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import DataLabel from "../data-label/data-label.component";
|
import DataLabel from "../data-label/data-label.component";
|
||||||
|
import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
|
||||||
export default function ContractJobBlock({ job }) {
|
export default function ContractJobBlock({ job }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
return (
|
return (
|
||||||
@@ -23,9 +23,7 @@ export default function ContractJobBlock({ job }) {
|
|||||||
} ${(job && job.v_model_desc) || ""}`}
|
} ${(job && job.v_model_desc) || ""}`}
|
||||||
</DataLabel>
|
</DataLabel>
|
||||||
<DataLabel label={t("jobs.fields.owner")}>
|
<DataLabel label={t("jobs.fields.owner")}>
|
||||||
{`${(job && job.ownr_fn) || ""} ${(job && job.ownr_ln) || ""} ${
|
<OwnerNameDisplay ownerObject={job} />
|
||||||
(job && job.ownr_co_nm) || ""
|
|
||||||
}`}
|
|
||||||
</DataLabel>
|
</DataLabel>
|
||||||
</div>
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import React, { useMemo, useState } from "react";
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { alphaSort } from "../../utils/sorters";
|
import { alphaSort } from "../../utils/sorters";
|
||||||
import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component";
|
import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component";
|
||||||
|
import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
|
||||||
|
|
||||||
export default function ContractsJobsComponent({
|
export default function ContractsJobsComponent({
|
||||||
loading,
|
loading,
|
||||||
@@ -43,17 +44,7 @@ export default function ContractsJobsComponent({
|
|||||||
width: "25%",
|
width: "25%",
|
||||||
sortOrder:
|
sortOrder:
|
||||||
state.sortedInfo.columnKey === "owner" && state.sortedInfo.order,
|
state.sortedInfo.columnKey === "owner" && state.sortedInfo.order,
|
||||||
render: (text, record) => {
|
render: (text, record) => <OwnerNameDisplay ownerObject={record} />,
|
||||||
return record.owner ? (
|
|
||||||
<span>
|
|
||||||
{record.ownr_fn} {record.ownr_ln} {record.ownr_co_nm || ""}
|
|
||||||
</span>
|
|
||||||
) : (
|
|
||||||
<span>{`${record.ownr_fn} ${record.ownr_ln} ${
|
|
||||||
record.ownr_co_nm || ""
|
|
||||||
}`}</span>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t("jobs.fields.status"),
|
title: t("jobs.fields.status"),
|
||||||
|
|||||||
@@ -12,17 +12,22 @@ import { setModalContext } from "../../redux/modals/modals.actions";
|
|||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
//currentUser: selectCurrentUser
|
bodyshop: selectBodyshop,
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
setContractFinderContext: (context) =>
|
setContractFinderContext: (context) =>
|
||||||
dispatch(setModalContext({ context: context, modal: "contractFinder" })),
|
dispatch(setModalContext({ context: context, modal: "contractFinder" })),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(ContractsList);
|
export default connect(mapStateToProps, mapDispatchToProps)(ContractsList);
|
||||||
|
|
||||||
export function ContractsList({
|
export function ContractsList({
|
||||||
|
bodyshop,
|
||||||
loading,
|
loading,
|
||||||
contracts,
|
contracts,
|
||||||
refetch,
|
refetch,
|
||||||
@@ -72,7 +77,9 @@ export function ContractsList({
|
|||||||
sortOrder:
|
sortOrder:
|
||||||
state.sortedInfo.columnKey === "driver_ln" && state.sortedInfo.order,
|
state.sortedInfo.columnKey === "driver_ln" && state.sortedInfo.order,
|
||||||
render: (text, record) =>
|
render: (text, record) =>
|
||||||
`${record.driver_fn || ""} ${record.driver_ln || ""}`,
|
bodyshop.last_name_first
|
||||||
|
? `${record.driver_ln || ""}, ${record.driver_fn || ""}`
|
||||||
|
: `${record.driver_fn || ""} ${record.driver_ln || ""}`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t("contracts.labels.vehicle"),
|
title: t("contracts.labels.vehicle"),
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { DateFormatter } from "../../utils/DateFormatter";
|
|||||||
import CourtesyCarFuelSlider from "../courtesy-car-fuel-select/courtesy-car-fuel-select.component";
|
import CourtesyCarFuelSlider from "../courtesy-car-fuel-select/courtesy-car-fuel-select.component";
|
||||||
import CourtesyCarStatus from "../courtesy-car-status-select/courtesy-car-status-select.component";
|
import CourtesyCarStatus from "../courtesy-car-status-select/courtesy-car-status-select.component";
|
||||||
import FormDatePicker from "../form-date-picker/form-date-picker.component";
|
import FormDatePicker from "../form-date-picker/form-date-picker.component";
|
||||||
import FormFieldsChanged from "../form-fields-changed-alert/form-fields-changed-alert.component";
|
//import FormFieldsChanged from "../form-fields-changed-alert/form-fields-changed-alert.component";
|
||||||
import CurrencyInput from "../form-items-formatted/currency-form-item.component";
|
import CurrencyInput from "../form-items-formatted/currency-form-item.component";
|
||||||
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ 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
|
<Form.Item
|
||||||
label={t("courtesycars.fields.make")}
|
label={t("courtesycars.fields.make")}
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
import { Table, Button, Input, Card, Space } from "antd";
|
import { SyncOutlined } from "@ant-design/icons";
|
||||||
|
import { Button, Card, Input, Space, Table } from "antd";
|
||||||
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 { alphaSort } from "../../utils/sorters";
|
import { alphaSort } from "../../utils/sorters";
|
||||||
import { SyncOutlined } from "@ant-design/icons";
|
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: {},
|
||||||
@@ -97,7 +99,9 @@ export default function CourtesyCarsList({ loading, courtesycars, refetch }) {
|
|||||||
render: (text, record) =>
|
render: (text, record) =>
|
||||||
record.cccontracts.length === 1 ? (
|
record.cccontracts.length === 1 ? (
|
||||||
<Link to={`/manage/jobs/${record.cccontracts[0].job.id}`}>
|
<Link to={`/manage/jobs/${record.cccontracts[0].job.id}`}>
|
||||||
{record.cccontracts[0].job.ro_number}
|
{`${
|
||||||
|
record.cccontracts[0].job.ro_number
|
||||||
|
} - ${OwnerNameDisplayFunction(record.cccontracts[0].job)}`}
|
||||||
</Link>
|
</Link>
|
||||||
) : null,
|
) : null,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { useTranslation } from "react-i18next";
|
|||||||
import { Link, useHistory, useLocation } from "react-router-dom";
|
import { Link, useHistory, useLocation } from "react-router-dom";
|
||||||
import { DateFormatter } from "../../utils/DateFormatter";
|
import { DateFormatter } from "../../utils/DateFormatter";
|
||||||
import { alphaSort } from "../../utils/sorters";
|
import { alphaSort } from "../../utils/sorters";
|
||||||
|
import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
|
||||||
|
|
||||||
export default function CsiResponseListPaginated({
|
export default function CsiResponseListPaginated({
|
||||||
refetch,
|
refetch,
|
||||||
@@ -48,14 +49,12 @@ export default function CsiResponseListPaginated({
|
|||||||
render: (text, record) => {
|
render: (text, record) => {
|
||||||
return record.job.owner ? (
|
return record.job.owner ? (
|
||||||
<Link to={"/manage/owners/" + record.job.owner.id}>
|
<Link to={"/manage/owners/" + record.job.owner.id}>
|
||||||
{`${record.job.ownr_fn || ""} ${record.job.ownr_ln || ""} ${
|
<OwnerNameDisplay ownerObject={record.job} />
|
||||||
record.job.ownr_co_nm || ""
|
|
||||||
}`}
|
|
||||||
</Link>
|
</Link>
|
||||||
) : (
|
) : (
|
||||||
<span>{`${record.job.ownr_fn || ""} ${record.job.ownr_ln || ""} ${
|
<span>
|
||||||
record.job.ownr_co_nm || ""
|
<OwnerNameDisplay ownerObject={record.job} />
|
||||||
}`}</span>
|
</span>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ export default function DashboardMonthlyEmployeeEfficiency({
|
|||||||
(dayAcc, dayVal) => {
|
(dayAcc, dayVal) => {
|
||||||
return {
|
return {
|
||||||
actual: dayAcc.actual + dayVal.actualhrs,
|
actual: dayAcc.actual + dayVal.actualhrs,
|
||||||
productive: dayAcc.actual + dayVal.productivehrs,
|
productive: dayAcc.productive + dayVal.productivehrs,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
{ actual: 0, productive: 0 }
|
{ actual: 0, productive: 0 }
|
||||||
@@ -50,11 +50,13 @@ export default function DashboardMonthlyEmployeeEfficiency({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const dailyEfficiency =
|
const dailyEfficiency =
|
||||||
((dailyHrs.productive - dailyHrs.actual) / dailyHrs.productive + 1) * 100;
|
((dailyHrs.productive - dailyHrs.actual) / dailyHrs.actual + 1) * 100;
|
||||||
|
|
||||||
const theValue = {
|
const theValue = {
|
||||||
date: moment(val).format("DD"),
|
date: moment(val).format("DD"),
|
||||||
...dailyHrs,
|
// ...dailyHrs,
|
||||||
|
actual: dailyHrs.actual.toFixed(1),
|
||||||
|
productive: dailyHrs.productive.toFixed(1),
|
||||||
dailyEfficiency: isNaN(dailyEfficiency) ? 0 : dailyEfficiency.toFixed(1),
|
dailyEfficiency: isNaN(dailyEfficiency) ? 0 : dailyEfficiency.toFixed(1),
|
||||||
accActual:
|
accActual:
|
||||||
acc.length > 0
|
acc.length > 0
|
||||||
@@ -67,12 +69,18 @@ export default function DashboardMonthlyEmployeeEfficiency({
|
|||||||
: dailyHrs.productive,
|
: dailyHrs.productive,
|
||||||
accEfficiency: 0,
|
accEfficiency: 0,
|
||||||
};
|
};
|
||||||
theValue.accEfficiency = (
|
|
||||||
|
theValue.accEfficiency =
|
||||||
((theValue.accProductive - theValue.accActual) /
|
((theValue.accProductive - theValue.accActual) /
|
||||||
(theValue.accProductive || 1) +
|
(theValue.accActual || 0) +
|
||||||
1) *
|
1) *
|
||||||
100
|
100;
|
||||||
).toFixed(1);
|
|
||||||
|
if (isNaN(theValue.accEfficiency)) {
|
||||||
|
theValue.accEfficiency = 0;
|
||||||
|
} else {
|
||||||
|
theValue.accEfficiency = theValue.accEfficiency.toFixed(1);
|
||||||
|
}
|
||||||
|
|
||||||
return [...acc, theValue];
|
return [...acc, theValue];
|
||||||
}, []);
|
}, []);
|
||||||
@@ -131,6 +139,7 @@ export default function DashboardMonthlyEmployeeEfficiency({
|
|||||||
//stackId="day"
|
//stackId="day"
|
||||||
barSize={20}
|
barSize={20}
|
||||||
fill="#102568"
|
fill="#102568"
|
||||||
|
format={"0.0"}
|
||||||
/>
|
/>
|
||||||
<Bar
|
<Bar
|
||||||
name="Productive Hours"
|
name="Productive Hours"
|
||||||
@@ -140,6 +149,7 @@ export default function DashboardMonthlyEmployeeEfficiency({
|
|||||||
//stackId="day"
|
//stackId="day"
|
||||||
barSize={20}
|
barSize={20}
|
||||||
fill="#017664"
|
fill="#017664"
|
||||||
|
format={"0.0"}
|
||||||
/>
|
/>
|
||||||
</ComposedChart>
|
</ComposedChart>
|
||||||
</ResponsiveContainer>
|
</ResponsiveContainer>
|
||||||
|
|||||||
@@ -31,16 +31,51 @@ export default function DashboardProjectedMonthlySales({ data, ...cardProps }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const DashboardProjectedMonthlySalesGql = `
|
export const DashboardProjectedMonthlySalesGql = `
|
||||||
projected_monthly_sales: jobs(where: {_or: [{_and: [{date_invoiced: {_gte: "${moment()
|
projected_monthly_sales: jobs(where: {
|
||||||
|
voided: {_eq: false},
|
||||||
|
_or: [
|
||||||
|
{_and: [
|
||||||
|
{date_invoiced:{_is_null: false }},
|
||||||
|
{date_invoiced: {_gte: "${moment()
|
||||||
|
.startOf("month")
|
||||||
|
.startOf("day")
|
||||||
|
.toISOString()}"}}, {date_invoiced: {_lte: "${moment()
|
||||||
|
.endOf("month")
|
||||||
|
.endOf("day")
|
||||||
|
.toISOString()}"}}]},
|
||||||
|
{
|
||||||
|
|
||||||
|
_and:[
|
||||||
|
{date_invoiced:{_is_null: true }},
|
||||||
|
{actual_completion: {_gte: "${moment()
|
||||||
|
.startOf("month")
|
||||||
|
.startOf("day")
|
||||||
|
.toISOString()}"}}, {actual_completion: {_lte: "${moment()
|
||||||
|
.endOf("month")
|
||||||
|
.endOf("day")
|
||||||
|
.toISOString()}"}}
|
||||||
|
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
{_and: [
|
||||||
|
{date_invoiced: {_is_null: true}},
|
||||||
|
{actual_completion: {_is_null: true}}
|
||||||
|
{scheduled_completion: {_gte: "${moment()
|
||||||
.startOf("month")
|
.startOf("month")
|
||||||
.format("YYYY-MM-DD")}"}}, {date_invoiced: {_lte: "${moment()
|
.startOf("day")
|
||||||
|
.toISOString()}"}}, {scheduled_completion: {_lte: "${moment()
|
||||||
.endOf("month")
|
.endOf("month")
|
||||||
.format("YYYY-MM-DD")}"}}]}, {_and: [{scheduled_completion: {_gte: "${moment()
|
.endOf("day")
|
||||||
.startOf("month")
|
.toISOString()}"}}
|
||||||
.format("YYYY-MM-DD")}"}}, {scheduled_completion: {_lte: "${moment()
|
|
||||||
.endOf("month")
|
|
||||||
.format("YYYY-MM-DD")}"}}]}]}) {
|
]}
|
||||||
|
|
||||||
|
]}) {
|
||||||
id
|
id
|
||||||
|
ro_number
|
||||||
|
voided
|
||||||
date_invoiced
|
date_invoiced
|
||||||
job_totals
|
job_totals
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -280,12 +280,13 @@ const createDashboardQuery = (state) => {
|
|||||||
return gql`
|
return gql`
|
||||||
query QUERY_DASHBOARD_DETAILS {
|
query QUERY_DASHBOARD_DETAILS {
|
||||||
${componentBasedAdditions || ""}
|
${componentBasedAdditions || ""}
|
||||||
monthly_sales: jobs(where: {_and: [{date_invoiced: {_gte: "${moment()
|
monthly_sales: jobs(where: {_and: [
|
||||||
.startOf("month")
|
{ voided: {_eq: false}},
|
||||||
.format("YYYY-MM-DD")}"}}, {date_invoiced: {_lte: "${moment()
|
{date_invoiced: {_gte: "${moment()
|
||||||
.endOf("month")
|
.startOf("month").startOf('day').toISOString()}"}}, {date_invoiced: {_lte: "${moment()
|
||||||
.format("YYYY-MM-DD")}"}}]}) {
|
.endOf("month").endOf('day').toISOString()}"}}]}) {
|
||||||
id
|
id
|
||||||
|
ro_number
|
||||||
date_invoiced
|
date_invoiced
|
||||||
job_totals
|
job_totals
|
||||||
rate_la1
|
rate_la1
|
||||||
@@ -333,14 +334,14 @@ const createDashboardQuery = (state) => {
|
|||||||
part_qty
|
part_qty
|
||||||
part_type
|
part_type
|
||||||
}
|
}
|
||||||
labhrs: joblines_aggregate(where: { mod_lbr_ty: { _neq: "LAR" } }) {
|
labhrs: joblines_aggregate(where: { mod_lbr_ty: { _neq: "LAR" }, removed: { _eq: false } }) {
|
||||||
aggregate {
|
aggregate {
|
||||||
sum {
|
sum {
|
||||||
mod_lb_hrs
|
mod_lb_hrs
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
larhrs: joblines_aggregate(where: { mod_lbr_ty: { _eq: "LAR" } }) {
|
larhrs: joblines_aggregate(where: { mod_lbr_ty: { _eq: "LAR" }, removed: { _eq: false } }) {
|
||||||
aggregate {
|
aggregate {
|
||||||
sum {
|
sum {
|
||||||
mod_lb_hrs
|
mod_lb_hrs
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import { DeleteFilled, DownOutlined } from "@ant-design/icons";
|
|||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Card,
|
Card,
|
||||||
DatePicker,
|
|
||||||
Divider,
|
Divider,
|
||||||
Dropdown,
|
Dropdown,
|
||||||
Form,
|
Form,
|
||||||
@@ -15,6 +14,7 @@ import {
|
|||||||
Typography,
|
Typography,
|
||||||
} from "antd";
|
} from "antd";
|
||||||
import Dinero from "dinero.js";
|
import Dinero from "dinero.js";
|
||||||
|
import moment from "moment";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
@@ -23,9 +23,9 @@ import { determineDmsType } from "../../pages/dms/dms.container";
|
|||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import DmsCdkMakes from "../dms-cdk-makes/dms-cdk-makes.component";
|
import DmsCdkMakes from "../dms-cdk-makes/dms-cdk-makes.component";
|
||||||
import DmsCdkMakesRefetch from "../dms-cdk-makes/dms-cdk-makes.refetch.component";
|
import DmsCdkMakesRefetch from "../dms-cdk-makes/dms-cdk-makes.refetch.component";
|
||||||
|
import FormDatePicker from "../form-date-picker/form-date-picker.component";
|
||||||
import CurrencyInput from "../form-items-formatted/currency-form-item.component";
|
import CurrencyInput from "../form-items-formatted/currency-form-item.component";
|
||||||
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
||||||
import moment from "moment";
|
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -80,11 +80,25 @@ export function DmsPostForm({ bodyshop, socket, job, logsRef }) {
|
|||||||
layout="vertical"
|
layout="vertical"
|
||||||
onFinish={handleFinish}
|
onFinish={handleFinish}
|
||||||
initialValues={{
|
initialValues={{
|
||||||
story: t("jobs.labels.dms.defaultstory", {
|
story: `${t("jobs.labels.dms.defaultstory", {
|
||||||
ro_number: job.ro_number,
|
ro_number: job.ro_number,
|
||||||
area_of_damage:
|
ownr_nm: `${job.ownr_fn || ""} ${job.ownr_ln || ""} ${
|
||||||
(job.area_of_damage && job.area_of_damage.impact1) || "UNKNOWN",
|
job.ownr_co_nm || ""
|
||||||
}).substr(0, 239),
|
}`.trim(),
|
||||||
|
ins_co_nm: job.ins_co_nm || "N/A",
|
||||||
|
clm_po: `${job.clm_no ? `${job.clm_no} ` : ""}${
|
||||||
|
job.po_number || ""
|
||||||
|
}`,
|
||||||
|
}).trim()}.${
|
||||||
|
job.area_of_damage && job.area_of_damage.impact1
|
||||||
|
? " " +
|
||||||
|
t("jobs.labels.dms.damageto", {
|
||||||
|
area_of_damage:
|
||||||
|
(job.area_of_damage && job.area_of_damage.impact1) ||
|
||||||
|
"UNKNOWN",
|
||||||
|
})
|
||||||
|
: ""
|
||||||
|
}`.substr(0, 239),
|
||||||
inservicedate: moment("2019-01-01"),
|
inservicedate: moment("2019-01-01"),
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -162,7 +176,7 @@ export function DmsPostForm({ bodyshop, socket, job, logsRef }) {
|
|||||||
name="inservicedate"
|
name="inservicedate"
|
||||||
label={t("jobs.fields.dms.inservicedate")}
|
label={t("jobs.fields.dms.inservicedate")}
|
||||||
>
|
>
|
||||||
<DatePicker format="MM/DD/YYYY" />
|
<FormDatePicker />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
<Space>
|
<Space>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { INSERT_NEW_DOCUMENT } from "../../graphql/documents.queries";
|
|||||||
import { axiosAuthInterceptorId } from "../../utils/CleanAxios";
|
import { axiosAuthInterceptorId } from "../../utils/CleanAxios";
|
||||||
import client from "../../utils/GraphQLClient";
|
import client from "../../utils/GraphQLClient";
|
||||||
import exifr from "exifr";
|
import exifr from "exifr";
|
||||||
|
import { store } from "../../redux/store";
|
||||||
|
|
||||||
//Context: currentUserEmail, bodyshop, jobid, invoiceid
|
//Context: currentUserEmail, bodyshop, jobid, invoiceid
|
||||||
|
|
||||||
@@ -112,7 +113,19 @@ export const uploadToCloudinary = async (
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (cloudinaryUploadResponse.status !== 200) {
|
if (cloudinaryUploadResponse.status !== 200) {
|
||||||
if (!!onError) onError(cloudinaryUploadResponse.statusText);
|
if (!!onError) {
|
||||||
|
onError(cloudinaryUploadResponse.statusText);
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
axios.post("/newlog", {
|
||||||
|
message: "client-cloudinary-upload-error",
|
||||||
|
type: "error",
|
||||||
|
user: store.getState().user.email,
|
||||||
|
object: cloudinaryUploadResponse,
|
||||||
|
});
|
||||||
|
} catch (error) {}
|
||||||
|
|
||||||
notification["error"]({
|
notification["error"]({
|
||||||
message: i18n.t("documents.errors.insert", {
|
message: i18n.t("documents.errors.insert", {
|
||||||
message: cloudinaryUploadResponse.statusText,
|
message: cloudinaryUploadResponse.statusText,
|
||||||
|
|||||||
@@ -16,9 +16,14 @@ import EmailDocumentsComponent from "../email-documents/email-documents.componen
|
|||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import {
|
||||||
|
selectBodyshop,
|
||||||
|
selectCurrentUser,
|
||||||
|
} from "../../redux/user/user.selectors";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
|
currentUser: selectCurrentUser,
|
||||||
});
|
});
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
@@ -28,7 +33,12 @@ export default connect(
|
|||||||
mapDispatchToProps
|
mapDispatchToProps
|
||||||
)(EmailOverlayComponent);
|
)(EmailOverlayComponent);
|
||||||
|
|
||||||
export function EmailOverlayComponent({ form, selectedMediaState, bodyshop }) {
|
export function EmailOverlayComponent({
|
||||||
|
form,
|
||||||
|
selectedMediaState,
|
||||||
|
bodyshop,
|
||||||
|
currentUser,
|
||||||
|
}) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const handleClick = ({ item, key, keyPath }) => {
|
const handleClick = ({ item, key, keyPath }) => {
|
||||||
const email = item.props.value;
|
const email = item.props.value;
|
||||||
@@ -51,6 +61,27 @@ export function EmailOverlayComponent({ form, selectedMediaState, bodyshop }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
<Form.Item
|
||||||
|
label={t("emails.fields.from")}
|
||||||
|
name="from"
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
//message: t("general.validation.required"),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<Select>
|
||||||
|
<Select.Option key={currentUser.email}>
|
||||||
|
{currentUser.email}
|
||||||
|
</Select.Option>
|
||||||
|
<Select.Option key={bodyshop.email}>{bodyshop.email}</Select.Option>
|
||||||
|
{bodyshop.md_from_emails &&
|
||||||
|
bodyshop.md_from_emails.map((e) => (
|
||||||
|
<Select.Option key={e}>{e}</Select.Option>
|
||||||
|
))}
|
||||||
|
</Select>
|
||||||
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={
|
label={
|
||||||
<Space>
|
<Space>
|
||||||
|
|||||||
@@ -56,13 +56,9 @@ export function EmailOverlayContainer({
|
|||||||
: bodyshop.shopname,
|
: bodyshop.shopname,
|
||||||
address: EmailSettings.fromAddress,
|
address: EmailSettings.fromAddress,
|
||||||
},
|
},
|
||||||
ReplyTo: {
|
|
||||||
Email: currentUser.validemail ? currentUser.email : bodyshop.email,
|
|
||||||
Name: currentUser.displayName,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleFinish = async (values) => {
|
const handleFinish = async (allValues) => {
|
||||||
logImEXEvent("email_send_from_modal");
|
logImEXEvent("email_send_from_modal");
|
||||||
|
|
||||||
//const attachments = [];
|
//const attachments = [];
|
||||||
@@ -77,10 +73,15 @@ export function EmailOverlayContainer({
|
|||||||
// attachments.push(t);
|
// attachments.push(t);
|
||||||
// });
|
// });
|
||||||
|
|
||||||
|
const { from, ...values } = allValues;
|
||||||
setSending(true);
|
setSending(true);
|
||||||
try {
|
try {
|
||||||
await axios.post("/sendemail", {
|
await axios.post("/sendemail", {
|
||||||
...defaultEmailFrom,
|
...defaultEmailFrom,
|
||||||
|
ReplyTo: {
|
||||||
|
Email: from,
|
||||||
|
Name: currentUser.displayName,
|
||||||
|
},
|
||||||
...values,
|
...values,
|
||||||
html: rawHtml,
|
html: rawHtml,
|
||||||
attachments: [
|
attachments: [
|
||||||
@@ -138,6 +139,7 @@ export function EmailOverlayContainer({
|
|||||||
}
|
}
|
||||||
|
|
||||||
form.setFieldsValue({
|
form.setFieldsValue({
|
||||||
|
from: currentUser.validemail ? currentUser.email : bodyshop.email,
|
||||||
...emailConfig.messageOptions,
|
...emailConfig.messageOptions,
|
||||||
cc:
|
cc:
|
||||||
emailConfig.messageOptions.cc &&
|
emailConfig.messageOptions.cc &&
|
||||||
|
|||||||
@@ -1,35 +1,83 @@
|
|||||||
import { DatePicker } from "antd";
|
import { DatePicker } from "antd";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import React, { forwardRef } from "react";
|
import React, { useRef } from "react";
|
||||||
//To be used as a form element only.
|
//To be used as a form element only.
|
||||||
|
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
//currentUser: selectCurrentUser
|
||||||
|
bodyshop: selectBodyshop,
|
||||||
|
});
|
||||||
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
|
});
|
||||||
|
export default connect(mapStateToProps, mapDispatchToProps)(FormDatePicker);
|
||||||
|
|
||||||
const dateFormat = "MM/DD/YYYY";
|
const dateFormat = "MM/DD/YYYY";
|
||||||
|
|
||||||
const FormDatePicker = (
|
export function FormDatePicker({
|
||||||
{ value, onChange, onBlur, onlyFuture, ...restProps },
|
bodyshop,
|
||||||
ref
|
value,
|
||||||
) => {
|
onChange,
|
||||||
|
onBlur,
|
||||||
|
onlyFuture,
|
||||||
|
isDateOnly = true,
|
||||||
|
...restProps
|
||||||
|
}) {
|
||||||
|
const ref = useRef();
|
||||||
|
|
||||||
const handleChange = (newDate) => {
|
const handleChange = (newDate) => {
|
||||||
if (value !== newDate && onChange) {
|
if (value !== newDate && onChange) {
|
||||||
onChange(newDate);
|
onChange(isDateOnly ? newDate && newDate.format("YYYY-MM-DD") : newDate);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleKeyDown = (e) => {
|
const handleKeyDown = (e) => {
|
||||||
if (e.key.toLowerCase() === "t") {
|
if (e.key.toLowerCase() === "t") {
|
||||||
if (onChange) {
|
if (onChange) {
|
||||||
onChange(new moment());
|
onChange(isDateOnly ? moment().format("YYYY-MM-DD") : moment());
|
||||||
|
// if (ref.current && ref.current.blur) ref.current.blur();
|
||||||
}
|
}
|
||||||
|
} else if (e.key.toLowerCase() === "enter") {
|
||||||
|
if (ref.current && ref.current.blur) ref.current.blur();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleBlur = (e) => {
|
||||||
|
const v = e.target.value;
|
||||||
|
if (!v) return;
|
||||||
|
|
||||||
|
const _a = moment(
|
||||||
|
v,
|
||||||
|
["MMDDYY", "MMDDYYYY", "MMDD", "MM/DD/YY"],
|
||||||
|
"en",
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
|
if (_a.isValid() && value && value.isValid && value.isValid()) {
|
||||||
|
_a.set({
|
||||||
|
hours: value.hours(),
|
||||||
|
minutes: value.minutes(),
|
||||||
|
seconds: value.seconds(),
|
||||||
|
milliseconds: value.milliseconds(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_a.isValid() && onChange)
|
||||||
|
onChange(isDateOnly ? _a.format("YYYY-MM-DD") : _a);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div onKeyDown={handleKeyDown}>
|
<div onKeyDown={handleKeyDown}>
|
||||||
<DatePicker
|
<DatePicker
|
||||||
|
ref={ref}
|
||||||
value={value ? moment(value) : null}
|
value={value ? moment(value) : null}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
format={dateFormat}
|
format={dateFormat}
|
||||||
onBlur={onBlur}
|
onBlur={onBlur || handleBlur}
|
||||||
|
showToday={false}
|
||||||
disabledTime
|
disabledTime
|
||||||
{...(onlyFuture && {
|
{...(onlyFuture && {
|
||||||
disabledDate: (d) => moment().subtract(1, "day").isAfter(d),
|
disabledDate: (d) => moment().subtract(1, "day").isAfter(d),
|
||||||
@@ -38,6 +86,4 @@ const FormDatePicker = (
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
}
|
||||||
|
|
||||||
export default forwardRef(FormDatePicker);
|
|
||||||
|
|||||||
@@ -26,19 +26,20 @@ const DateTimePicker = (
|
|||||||
value={value}
|
value={value}
|
||||||
onBlur={onBlur}
|
onBlur={onBlur}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
|
isDateOnly={false}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TimePicker
|
<TimePicker
|
||||||
{...restProps}
|
value={value ? moment(value) : null}
|
||||||
value={value ? moment(value) : null}
|
{...(onlyFuture && {
|
||||||
{...(onlyFuture && {
|
disabledDate: (d) => moment().isAfter(d),
|
||||||
disabledDate: (d) => moment().isAfter(d),
|
})}
|
||||||
})}
|
onChange={onChange}
|
||||||
onChange={onChange}
|
showSecond={false}
|
||||||
showSecond={false}
|
minuteStep={15}
|
||||||
minuteStep={15}
|
onBlur={onBlur}
|
||||||
onBlur={onBlur}
|
format="hh:mm a"
|
||||||
format="hh:mm a"
|
{...restProps}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,17 +1,21 @@
|
|||||||
import { useLazyQuery } from "@apollo/client";
|
import { useLazyQuery } from "@apollo/client";
|
||||||
|
import { LoadingOutlined } from "@ant-design/icons";
|
||||||
import { AutoComplete, Divider, Space } from "antd";
|
import { AutoComplete, Divider, Space } from "antd";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Link } from "react-router-dom";
|
import { Link, useHistory } from "react-router-dom";
|
||||||
import { GLOBAL_SEARCH_QUERY } from "../../graphql/search.queries";
|
import { GLOBAL_SEARCH_QUERY } from "../../graphql/search.queries";
|
||||||
import PhoneNumberFormatter from "../../utils/PhoneFormatter";
|
import PhoneNumberFormatter from "../../utils/PhoneFormatter";
|
||||||
import AlertComponent from "../alert/alert.component";
|
import AlertComponent from "../alert/alert.component";
|
||||||
|
import OwnerNameDisplay, {
|
||||||
|
OwnerNameDisplayFunction,
|
||||||
|
} from "../owner-name-display/owner-name-display.component";
|
||||||
export default function GlobalSearch() {
|
export default function GlobalSearch() {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const history = useHistory();
|
||||||
const [callSearch, { error, data }] = useLazyQuery(GLOBAL_SEARCH_QUERY);
|
const [callSearch, { loading, error, data }] =
|
||||||
|
useLazyQuery(GLOBAL_SEARCH_QUERY);
|
||||||
|
|
||||||
const executeSearch = (v) => {
|
const executeSearch = (v) => {
|
||||||
if (v && v.variables.search && v.variables.search !== "") callSearch(v);
|
if (v && v.variables.search && v.variables.search !== "") callSearch(v);
|
||||||
@@ -38,9 +42,10 @@ export default function GlobalSearch() {
|
|||||||
<Link to={`/manage/jobs/${job.id}`}>
|
<Link to={`/manage/jobs/${job.id}`}>
|
||||||
<Space size="small" split={<Divider type="vertical" />}>
|
<Space size="small" split={<Divider type="vertical" />}>
|
||||||
<strong>{job.ro_number || t("general.labels.na")}</strong>
|
<strong>{job.ro_number || t("general.labels.na")}</strong>
|
||||||
<span>{`${job.ownr_fn || ""} ${job.ownr_ln || ""} ${
|
<span>{`${job.status || ""}`}</span>
|
||||||
job.ownr_co_nm || ""
|
<span>
|
||||||
}`}</span>
|
<OwnerNameDisplay ownerObject={job} />
|
||||||
|
</span>
|
||||||
<span>{`${job.v_model_yr || ""} ${job.v_make_desc || ""} ${
|
<span>{`${job.v_model_yr || ""} ${job.v_make_desc || ""} ${
|
||||||
job.v_model_desc || ""
|
job.v_model_desc || ""
|
||||||
}`}</span>
|
}`}</span>
|
||||||
@@ -56,15 +61,13 @@ export default function GlobalSearch() {
|
|||||||
options: data.search_owners.map((owner) => {
|
options: data.search_owners.map((owner) => {
|
||||||
return {
|
return {
|
||||||
key: owner.id,
|
key: owner.id,
|
||||||
value: `${owner.ownr_fn || ""} ${owner.ownr_ln || ""} ${
|
value: OwnerNameDisplayFunction(owner),
|
||||||
owner.ownr_co_nm || ""
|
|
||||||
}`,
|
|
||||||
label: (
|
label: (
|
||||||
<Link to={`/manage/owners/${owner.id}`}>
|
<Link to={`/manage/owners/${owner.id}`}>
|
||||||
<Space size="small" split={<Divider type="vertical" />} wrap>
|
<Space size="small" split={<Divider type="vertical" />} wrap>
|
||||||
<span>{`${owner.ownr_fn || ""} ${owner.ownr_ln || ""} ${
|
<span>
|
||||||
owner.ownr_co_nm || ""
|
<OwnerNameDisplay ownerObject={owner} />
|
||||||
}`}</span>
|
</span>
|
||||||
<PhoneNumberFormatter>
|
<PhoneNumberFormatter>
|
||||||
{owner.ownr_ph1}
|
{owner.ownr_ph1}
|
||||||
</PhoneNumberFormatter>
|
</PhoneNumberFormatter>
|
||||||
@@ -170,8 +173,13 @@ export default function GlobalSearch() {
|
|||||||
<AutoComplete
|
<AutoComplete
|
||||||
options={options}
|
options={options}
|
||||||
onSearch={handleSearch}
|
onSearch={handleSearch}
|
||||||
|
suffixIcon={loading && <LoadingOutlined spin />}
|
||||||
|
defaultActiveFirstOption
|
||||||
placeholder={t("general.labels.globalsearch")}
|
placeholder={t("general.labels.globalsearch")}
|
||||||
allowClear
|
allowClear
|
||||||
|
onSelect={(val, opt) => {
|
||||||
|
history.push(opt.label.props.to);
|
||||||
|
}}
|
||||||
></AutoComplete>
|
></AutoComplete>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ 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 OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -73,9 +74,9 @@ export function ScheduleEventComponent({
|
|||||||
</Space>
|
</Space>
|
||||||
) : (
|
) : (
|
||||||
<Space>
|
<Space>
|
||||||
<strong>{`${(event.job && event.job.ownr_fn) || ""} ${
|
<strong>
|
||||||
(event.job && event.job.ownr_ln) || ""
|
<OwnerNameDisplay ownerObject={event.job} />
|
||||||
}`}</strong>
|
</strong>
|
||||||
<span style={{ margin: 4 }}>
|
<span style={{ margin: 4 }}>
|
||||||
{`${(event.job && event.job.v_model_yr) || ""} ${
|
{`${(event.job && event.job.v_model_yr) || ""} ${
|
||||||
(event.job && event.job.v_make_desc) || ""
|
(event.job && event.job.v_make_desc) || ""
|
||||||
@@ -256,9 +257,9 @@ export function ScheduleEventComponent({
|
|||||||
<Space>
|
<Space>
|
||||||
{event.note && <AlertFilled className="production-alert" />}
|
{event.note && <AlertFilled className="production-alert" />}
|
||||||
<strong>{`${event.job.ro_number || t("general.labels.na")}`}</strong>
|
<strong>{`${event.job.ro_number || t("general.labels.na")}`}</strong>
|
||||||
<span>{`${(event.job && event.job.ownr_fn) || ""} ${
|
<span>
|
||||||
(event.job && event.job.ownr_ln) || ""
|
<OwnerNameDisplay ownerObject={event.job} />
|
||||||
} ${(event.job && event.job.ownr_co_nm) || ""}`}</span>
|
</span>
|
||||||
</Space>
|
</Space>
|
||||||
<Space>
|
<Space>
|
||||||
<span>
|
<span>
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ export default function ScheduleEventContainer({ bodyshop, event, refetch }) {
|
|||||||
job: {
|
job: {
|
||||||
date_scheduled: null,
|
date_scheduled: null,
|
||||||
scheduled_in: null,
|
scheduled_in: null,
|
||||||
|
scheduled_completion:null,
|
||||||
status: bodyshop.md_ro_statuses.default_imported,
|
status: bodyshop.md_ro_statuses.default_imported,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -64,15 +64,15 @@ export default function JobBillsTotalComponent({
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
const totalPartsSublet = Dinero(totals.parts.parts.total).add(
|
const totalPartsSublet = Dinero(totals.parts.parts.total)
|
||||||
Dinero(totals.parts.sublets.total)
|
.add(Dinero(totals.parts.sublets.total))
|
||||||
);
|
.add(Dinero(totals.additional.towing));
|
||||||
|
|
||||||
const discrepancy = totalPartsSublet.subtract(billTotals);
|
const discrepancy = totalPartsSublet.subtract(billTotals);
|
||||||
|
|
||||||
const discrepWithLbrAdj = discrepancy.add(lbrAdjustments);
|
const discrepWithLbrAdj = discrepancy.add(lbrAdjustments);
|
||||||
|
|
||||||
const discrepWithCms = discrepWithLbrAdj.add(billCms);
|
const discrepWithCms = discrepWithLbrAdj.add(totalReturns);
|
||||||
const creditsNotReceived = totalReturns.subtract(billCms); //billCms is tracked as a negative number.
|
const creditsNotReceived = totalReturns.subtract(billCms); //billCms is tracked as a negative number.
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -171,8 +171,8 @@ export default function JobBillsTotalComponent({
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Statistic
|
<Statistic
|
||||||
title={t("bills.labels.billcmtotal")}
|
title={t("bills.labels.totalreturns")}
|
||||||
value={billCms.toFormat()}
|
value={totalReturns.toFormat()}
|
||||||
/>
|
/>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Typography.Title>=</Typography.Title>
|
<Typography.Title>=</Typography.Title>
|
||||||
|
|||||||
@@ -105,6 +105,10 @@ export function JobChecklistForm({
|
|||||||
completed_at: new Date(),
|
completed_at: new Date(),
|
||||||
},
|
},
|
||||||
|
|
||||||
|
...(type === "intake" &&
|
||||||
|
values.scheduled_delivery && {
|
||||||
|
scheduled_delivery: values.scheduled_delivery,
|
||||||
|
}),
|
||||||
...(type === "deliver" && {
|
...(type === "deliver" && {
|
||||||
scheduled_delivery: values.scheduled_delivery,
|
scheduled_delivery: values.scheduled_delivery,
|
||||||
actual_delivery: values.actual_delivery,
|
actual_delivery: values.actual_delivery,
|
||||||
@@ -171,7 +175,12 @@ export function JobChecklistForm({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
console.log(job, {
|
||||||
|
removeFromProduction: true,
|
||||||
|
actual_completion:
|
||||||
|
job && job.actual_completion && moment(job.actual_completion),
|
||||||
|
actual_delivery: job && job.actual_delivery && moment(job.actual_delivery),
|
||||||
|
});
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
title={t("checklist.labels.checklist")}
|
title={t("checklist.labels.checklist")}
|
||||||
@@ -195,21 +204,27 @@ export function JobChecklistForm({
|
|||||||
addToProduction: true,
|
addToProduction: true,
|
||||||
allow_text_message: job.owner && job.owner.allow_text_message,
|
allow_text_message: job.owner && job.owner.allow_text_message,
|
||||||
scheduled_completion:
|
scheduled_completion:
|
||||||
(job && job.scheduled_completion) ||
|
(job &&
|
||||||
(job.labbrs && job.larhrs
|
job.scheduled_completion &&
|
||||||
? moment().businessAdd(
|
moment(job.scheduled_completion)) ||
|
||||||
(job.labhrs.aggregate.sum.mod_lb_hrs +
|
(job &&
|
||||||
job.larhrs.aggregate.sum.mod_lb_hrs) /
|
job.labhrs &&
|
||||||
bodyshop.target_touchtime,
|
job.larhrs &&
|
||||||
"days"
|
moment().businessAdd(
|
||||||
)
|
(job.labhrs.aggregate.sum.mod_lb_hrs ||
|
||||||
: null),
|
0 + job.larhrs.aggregate.sum.mod_lb_hrs ||
|
||||||
scheduled_delivery: job && job.scheduled_delivery,
|
0) / bodyshop.target_touchtime,
|
||||||
|
"days"
|
||||||
|
)),
|
||||||
|
scheduled_delivery:
|
||||||
|
job.scheduled_delivery && moment(job.scheduled_delivery),
|
||||||
}),
|
}),
|
||||||
...(type === "deliver" && {
|
...(type === "deliver" && {
|
||||||
removeFromProduction: true,
|
removeFromProduction: true,
|
||||||
actual_completion: job && job.actual_completion,
|
actual_completion:
|
||||||
actual_delivery: job && job.actual_delivery,
|
job && job.actual_completion && moment(job.actual_completion),
|
||||||
|
actual_delivery:
|
||||||
|
job && job.actual_delivery && moment(job.actual_delivery),
|
||||||
}),
|
}),
|
||||||
...formItems
|
...formItems
|
||||||
.filter((fi) => fi.value)
|
.filter((fi) => fi.value)
|
||||||
|
|||||||
@@ -26,11 +26,6 @@ export function JobCostingModalContainer({
|
|||||||
const { visible, context } = jobCostingModal;
|
const { visible, context } = jobCostingModal;
|
||||||
const { jobId } = context;
|
const { jobId } = context;
|
||||||
|
|
||||||
// const { loading, error, data } = useQuery(QUERY_JOB_COSTING_DETAILS, {
|
|
||||||
// variables: { id: jobId },
|
|
||||||
// skip: !jobId,
|
|
||||||
// });
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
async function getData() {
|
async function getData() {
|
||||||
if (jobId && visible) {
|
if (jobId && visible) {
|
||||||
@@ -46,8 +41,14 @@ export function JobCostingModalContainer({
|
|||||||
<Modal
|
<Modal
|
||||||
visible={visible}
|
visible={visible}
|
||||||
title={t("jobs.labels.jobcosting")}
|
title={t("jobs.labels.jobcosting")}
|
||||||
onOk={() => toggleModalVisible()}
|
onOk={() => {
|
||||||
onCancel={() => toggleModalVisible()}
|
toggleModalVisible();
|
||||||
|
setCostingData(null);
|
||||||
|
}}
|
||||||
|
onCancel={() => {
|
||||||
|
toggleModalVisible();
|
||||||
|
setCostingData(null);
|
||||||
|
}}
|
||||||
cancelButtonProps={{ style: { display: "none" } }}
|
cancelButtonProps={{ style: { display: "none" } }}
|
||||||
width="90%"
|
width="90%"
|
||||||
destroyOnClose
|
destroyOnClose
|
||||||
|
|||||||
@@ -16,6 +16,14 @@ export default function JobCostingStatistics({ summaryData }) {
|
|||||||
value={Dinero(summaryData.totalPartsSales).toFormat()}
|
value={Dinero(summaryData.totalPartsSales).toFormat()}
|
||||||
title={t("jobs.labels.sale_parts")}
|
title={t("jobs.labels.sale_parts")}
|
||||||
/>
|
/>
|
||||||
|
<Statistic
|
||||||
|
value={Dinero(summaryData.totalSubletSales).toFormat()}
|
||||||
|
title={t("jobs.labels.sale_sublet")}
|
||||||
|
/>
|
||||||
|
<Statistic
|
||||||
|
value={Dinero(summaryData.totalAdditionalSales).toFormat()}
|
||||||
|
title={t("jobs.labels.sale_additional")}
|
||||||
|
/>
|
||||||
<Statistic
|
<Statistic
|
||||||
value={Dinero(summaryData.totalSales).toFormat()}
|
value={Dinero(summaryData.totalSales).toFormat()}
|
||||||
title={t("jobs.labels.total_sales")}
|
title={t("jobs.labels.total_sales")}
|
||||||
@@ -28,6 +36,14 @@ export default function JobCostingStatistics({ summaryData }) {
|
|||||||
value={Dinero(summaryData.totalPartsCost).toFormat()}
|
value={Dinero(summaryData.totalPartsCost).toFormat()}
|
||||||
title={t("jobs.labels.cost_parts")}
|
title={t("jobs.labels.cost_parts")}
|
||||||
/>
|
/>
|
||||||
|
<Statistic
|
||||||
|
value={Dinero(summaryData.totalSubletCost).toFormat()}
|
||||||
|
title={t("jobs.labels.cost_sublet")}
|
||||||
|
/>
|
||||||
|
<Statistic
|
||||||
|
value={Dinero(summaryData.totalAdditionalCost).toFormat()}
|
||||||
|
title={t("jobs.labels.cost_Additional")}
|
||||||
|
/>
|
||||||
<Statistic
|
<Statistic
|
||||||
value={Dinero(summaryData.totalCost).toFormat()}
|
value={Dinero(summaryData.totalCost).toFormat()}
|
||||||
title={t("jobs.labels.total_cost")}
|
title={t("jobs.labels.total_cost")}
|
||||||
|
|||||||
@@ -0,0 +1,54 @@
|
|||||||
|
import { useQuery } from "@apollo/client";
|
||||||
|
import { Row, Col, Timeline, Typography, Space, Divider, Skeleton } from "antd";
|
||||||
|
import React from "react";
|
||||||
|
import { GET_JOB_LINE_ORDERS } from "../../graphql/jobs.queries";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import AlertComponent from "../alert/alert.component";
|
||||||
|
import { DateFormatter } from "../../utils/DateFormatter";
|
||||||
|
import { Link } from "react-router-dom";
|
||||||
|
|
||||||
|
export default function JobLinesExpander({ jobline, jobid }) {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const { loading, error, data } = useQuery(GET_JOB_LINE_ORDERS, {
|
||||||
|
fetchPolicy: "network-only",
|
||||||
|
nextFetchPolicy: "network-only",
|
||||||
|
variables: {
|
||||||
|
joblineid: jobline.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (loading) return <Skeleton />;
|
||||||
|
if (error) return <AlertComponent message={error.message} type="error" />;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Row>
|
||||||
|
<Col md={24} lg={12}>
|
||||||
|
<Typography.Title level={4}>
|
||||||
|
{t("parts_orders.labels.parts_orders")}
|
||||||
|
</Typography.Title>
|
||||||
|
<Timeline>
|
||||||
|
{data.parts_order_lines.length > 0 ? (
|
||||||
|
data.parts_order_lines.map((line) => (
|
||||||
|
<Timeline.Item key={line.id}>
|
||||||
|
<Space split={<Divider type="vertical" />} wrap>
|
||||||
|
<Link
|
||||||
|
to={`/manage/jobs/${jobid}?partsorderid=${line.parts_order.id}`}
|
||||||
|
>
|
||||||
|
{line.parts_order.order_number}
|
||||||
|
</Link>
|
||||||
|
<DateFormatter>{line.parts_order.order_date}</DateFormatter>
|
||||||
|
{line.parts_order.vendor.name}
|
||||||
|
</Space>
|
||||||
|
</Timeline.Item>
|
||||||
|
))
|
||||||
|
) : (
|
||||||
|
<Timeline.Item>
|
||||||
|
{t("parts_orders.labels.notyetordered")}
|
||||||
|
</Timeline.Item>
|
||||||
|
)}
|
||||||
|
</Timeline>
|
||||||
|
</Col>
|
||||||
|
<Col md={24} lg={12}></Col>
|
||||||
|
</Row>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -4,6 +4,8 @@ import {
|
|||||||
SyncOutlined,
|
SyncOutlined,
|
||||||
WarningFilled,
|
WarningFilled,
|
||||||
EditFilled,
|
EditFilled,
|
||||||
|
PlusCircleTwoTone,
|
||||||
|
MinusCircleTwoTone,
|
||||||
} from "@ant-design/icons";
|
} from "@ant-design/icons";
|
||||||
import { useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
import {
|
import {
|
||||||
@@ -38,9 +40,11 @@ import JobLinesBillRefernece from "../job-lines-bill-reference/job-lines-bill-re
|
|||||||
import PartsOrderModalContainer from "../parts-order-modal/parts-order-modal.container";
|
import PartsOrderModalContainer from "../parts-order-modal/parts-order-modal.container";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import JobCreateIOU from "../job-create-iou/job-create-iou.component";
|
import JobCreateIOU from "../job-create-iou/job-create-iou.component";
|
||||||
|
import JobLinesExpander from "./job-lines-expander.component";
|
||||||
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
//currentUser: selectCurrentUser
|
bodyshop: selectBodyshop,
|
||||||
jobRO: selectJobReadOnly,
|
jobRO: selectJobReadOnly,
|
||||||
technician: selectTechnician,
|
technician: selectTechnician,
|
||||||
});
|
});
|
||||||
@@ -53,6 +57,7 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
export function JobLinesComponent({
|
export function JobLinesComponent({
|
||||||
|
bodyshop,
|
||||||
jobRO,
|
jobRO,
|
||||||
technician,
|
technician,
|
||||||
setPartsOrderContext,
|
setPartsOrderContext,
|
||||||
@@ -72,6 +77,9 @@ export function JobLinesComponent({
|
|||||||
filteredInfo: {},
|
filteredInfo: {},
|
||||||
});
|
});
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const jobIsPrivate = bodyshop.md_ins_cos.find(
|
||||||
|
(c) => c.name === job.ins_co_nm
|
||||||
|
)?.private;
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
@@ -283,7 +291,7 @@ export function JobLinesComponent({
|
|||||||
key: "actions",
|
key: "actions",
|
||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<div>
|
<div>
|
||||||
{record.manual_line && (
|
{(record.manual_line || jobIsPrivate) && (
|
||||||
<Space>
|
<Space>
|
||||||
<Button
|
<Button
|
||||||
disabled={jobRO}
|
disabled={jobRO}
|
||||||
@@ -449,6 +457,19 @@ export function JobLinesComponent({
|
|||||||
scroll={{
|
scroll={{
|
||||||
x: true,
|
x: true,
|
||||||
}}
|
}}
|
||||||
|
expandable={{
|
||||||
|
expandedRowRender: (record) => (
|
||||||
|
<JobLinesExpander jobline={record} jobid={job.id} />
|
||||||
|
),
|
||||||
|
rowExpandable: (record) => true,
|
||||||
|
//expandRowByClick: true,
|
||||||
|
expandIcon: ({ expanded, onExpand, record }) =>
|
||||||
|
expanded ? (
|
||||||
|
<MinusCircleTwoTone onClick={(e) => onExpand(record, e)} />
|
||||||
|
) : (
|
||||||
|
<PlusCircleTwoTone onClick={(e) => onExpand(record, e)} />
|
||||||
|
),
|
||||||
|
}}
|
||||||
onRow={(record, rowIndex) => {
|
onRow={(record, rowIndex) => {
|
||||||
return {
|
return {
|
||||||
onDoubleClick: (event) => {
|
onDoubleClick: (event) => {
|
||||||
@@ -462,7 +483,7 @@ export function JobLinesComponent({
|
|||||||
};
|
};
|
||||||
}}
|
}}
|
||||||
rowSelection={{
|
rowSelection={{
|
||||||
selectedRowKeys: selectedLines.map((item) => item.id),
|
selectedRowKeys: selectedLines.map((item) => item && item.id),
|
||||||
onSelectAll: (selected, selectedRows, changeRows) => {
|
onSelectAll: (selected, selectedRows, changeRows) => {
|
||||||
setSelectedLines(selectedRows);
|
setSelectedLines(selectedRows);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -55,15 +55,17 @@ export function JobEmployeeAssignments({
|
|||||||
0
|
0
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{bodyshop.employees.map((emp) => (
|
{bodyshop.employees
|
||||||
<Select.Option
|
.filter((emp) => emp.active)
|
||||||
value={emp.id}
|
.map((emp) => (
|
||||||
key={emp.id}
|
<Select.Option
|
||||||
name={`${emp.first_name} ${emp.last_name}`}
|
value={emp.id}
|
||||||
>
|
key={emp.id}
|
||||||
{`${emp.first_name} ${emp.last_name}`}
|
name={`${emp.first_name} ${emp.last_name}`}
|
||||||
</Select.Option>
|
>
|
||||||
))}
|
{`${emp.first_name} ${emp.last_name}`}
|
||||||
|
</Select.Option>
|
||||||
|
))}
|
||||||
</Select>
|
</Select>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export default function JobLinesBillRefernece({ jobline }) {
|
|||||||
{subletRequired && <WarningFilled />}
|
{subletRequired && <WarningFilled />}
|
||||||
{`${(billLine.actual_price * billLine.quantity).toFixed(2)} (${
|
{`${(billLine.actual_price * billLine.quantity).toFixed(2)} (${
|
||||||
billLine.bill.vendor.name
|
billLine.bill.vendor.name
|
||||||
})`}
|
} #${billLine.bill.invoice_number})`}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -216,6 +216,7 @@ export function JobLinesUpsertModalComponent({
|
|||||||
rules={[
|
rules={[
|
||||||
({ getFieldValue }) => ({
|
({ getFieldValue }) => ({
|
||||||
validator(rule, value) {
|
validator(rule, value) {
|
||||||
|
console.log(value);
|
||||||
if (!value || getFieldValue("part_type") !== "PAE") {
|
if (!value || getFieldValue("part_type") !== "PAE") {
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
@@ -226,7 +227,10 @@ export function JobLinesUpsertModalComponent({
|
|||||||
}),
|
}),
|
||||||
({ getFieldValue }) => ({
|
({ getFieldValue }) => ({
|
||||||
validator(rule, value) {
|
validator(rule, value) {
|
||||||
if (!!getFieldValue("part_type") === !!value) {
|
console.log(value, !!value);
|
||||||
|
if (
|
||||||
|
!!getFieldValue("part_type") === (!!value || value === 0)
|
||||||
|
) {
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
return Promise.reject(
|
return Promise.reject(
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export default function JobReconciliationBillsTable({
|
|||||||
dataIndex: "line_desc",
|
dataIndex: "line_desc",
|
||||||
key: "line_desc",
|
key: "line_desc",
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
minWidth: "65rem",
|
width: "10rem",
|
||||||
sorter: (a, b) => alphaSort(a.line_desc, b.line_desc),
|
sorter: (a, b) => alphaSort(a.line_desc, b.line_desc),
|
||||||
sortOrder:
|
sortOrder:
|
||||||
state.sortedInfo.columnKey === "line_desc" && state.sortedInfo.order,
|
state.sortedInfo.columnKey === "line_desc" && state.sortedInfo.order,
|
||||||
@@ -72,11 +72,11 @@ export default function JobReconciliationBillsTable({
|
|||||||
state.sortedInfo.columnKey === "quantity" && state.sortedInfo.order,
|
state.sortedInfo.columnKey === "quantity" && state.sortedInfo.order,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t("bills.fields.is_credit_memo"),
|
title: t("bills.fields.is_credit_memo_short"),
|
||||||
dataIndex: "is_credit_memo",
|
dataIndex: "is_credit_memo",
|
||||||
key: "is_credit_memo",
|
key: "is_credit_memo",
|
||||||
sorter: (a, b) => a.bill.is_credit_memo - b.bill.is_credit_memo,
|
sorter: (a, b) => a.bill.is_credit_memo - b.bill.is_credit_memo,
|
||||||
width: "8rem",
|
width: "3rem",
|
||||||
sortOrder:
|
sortOrder:
|
||||||
state.sortedInfo.columnKey === "is_credit_memo" &&
|
state.sortedInfo.columnKey === "is_credit_memo" &&
|
||||||
state.sortedInfo.order,
|
state.sortedInfo.order,
|
||||||
|
|||||||
@@ -18,7 +18,11 @@ export default function JobReconciliationModalComponent({ job, bills }) {
|
|||||||
.flat() || [];
|
.flat() || [];
|
||||||
|
|
||||||
const jobLineData = job.joblines.filter(
|
const jobLineData = job.joblines.filter(
|
||||||
(j) => j.part_type !== null && j.part_type !== "PAE"
|
(j) =>
|
||||||
|
(j.part_type !== null && j.part_type !== "PAE") ||
|
||||||
|
(j.line_desc &&
|
||||||
|
j.line_desc.toLowerCase().includes("towing") &&
|
||||||
|
j.lbr_op === "OP13")
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import {
|
|||||||
SEARCH_JOBS_FOR_AUTOCOMPLETE,
|
SEARCH_JOBS_FOR_AUTOCOMPLETE,
|
||||||
} from "../../graphql/jobs.queries";
|
} from "../../graphql/jobs.queries";
|
||||||
import AlertComponent from "../alert/alert.component";
|
import AlertComponent from "../alert/alert.component";
|
||||||
|
import { OwnerNameDisplayFunction } from "../owner-name-display/owner-name-display.component";
|
||||||
const { Option } = Select;
|
const { Option } = Select;
|
||||||
|
|
||||||
const JobSearchSelect = (
|
const JobSearchSelect = (
|
||||||
@@ -86,11 +87,9 @@ const JobSearchSelect = (
|
|||||||
<span>
|
<span>
|
||||||
{`${clm_no && o.clm_no ? `${o.clm_no} | ` : ""}${
|
{`${clm_no && o.clm_no ? `${o.clm_no} | ` : ""}${
|
||||||
o.ro_number || t("general.labels.na")
|
o.ro_number || t("general.labels.na")
|
||||||
} | ${o.ownr_ln || ""} ${o.ownr_fn || ""} ${
|
} | ${OwnerNameDisplayFunction(o)} | ${
|
||||||
o.ownr_co_nm ? ` ${o.ownr_co_num}` : ""
|
o.v_model_yr || ""
|
||||||
}| ${o.v_model_yr || ""} ${o.v_make_desc || ""} ${
|
} ${o.v_make_desc || ""} ${o.v_model_desc || ""}`}
|
||||||
o.v_model_desc || ""
|
|
||||||
}`}
|
|
||||||
</span>
|
</span>
|
||||||
<Tag>
|
<Tag>
|
||||||
<strong>{o.status}</strong>
|
<strong>{o.status}</strong>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Table } from "antd";
|
import { Space, Table } from "antd";
|
||||||
import Dinero from "dinero.js";
|
import Dinero from "dinero.js";
|
||||||
import React, { useMemo, useState } from "react";
|
import React, { useMemo, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
@@ -119,7 +119,18 @@ export default function JobTotalsTableLabor({ job }) {
|
|||||||
</Table.Summary.Cell>
|
</Table.Summary.Cell>
|
||||||
</Table.Summary.Row>
|
</Table.Summary.Row>
|
||||||
<Table.Summary.Row>
|
<Table.Summary.Row>
|
||||||
<Table.Summary.Cell>{t("jobs.labels.mapa")}</Table.Summary.Cell>
|
<Table.Summary.Cell>
|
||||||
|
<Space>
|
||||||
|
{t("jobs.labels.mapa")}
|
||||||
|
{job.materials &&
|
||||||
|
job.materials.mapa &&
|
||||||
|
job.materials.mapa.cal_maxdlr &&
|
||||||
|
job.materials.mapa.cal_maxdlr > 0 &&
|
||||||
|
t("jobs.labels.threshhold", {
|
||||||
|
amount: job.materials.mapa.cal_maxdlr,
|
||||||
|
})}
|
||||||
|
</Space>
|
||||||
|
</Table.Summary.Cell>
|
||||||
<Table.Summary.Cell align="right">
|
<Table.Summary.Cell align="right">
|
||||||
<CurrencyFormatter>
|
<CurrencyFormatter>
|
||||||
{job.job_totals.rates.mapa.rate}
|
{job.job_totals.rates.mapa.rate}
|
||||||
@@ -133,7 +144,18 @@ export default function JobTotalsTableLabor({ job }) {
|
|||||||
</Table.Summary.Cell>
|
</Table.Summary.Cell>
|
||||||
</Table.Summary.Row>
|
</Table.Summary.Row>
|
||||||
<Table.Summary.Row>
|
<Table.Summary.Row>
|
||||||
<Table.Summary.Cell>{t("jobs.labels.mash")}</Table.Summary.Cell>
|
<Table.Summary.Cell>
|
||||||
|
<Space wrap>
|
||||||
|
{t("jobs.labels.mash")}
|
||||||
|
{job.materials &&
|
||||||
|
job.materials.mash &&
|
||||||
|
job.materials.mash.cal_maxdlr &&
|
||||||
|
job.materials.mash.cal_maxdlr > 0 &&
|
||||||
|
t("jobs.labels.threshhold", {
|
||||||
|
amount: job.materials.mash.cal_maxdlr,
|
||||||
|
})}
|
||||||
|
</Space>
|
||||||
|
</Table.Summary.Cell>
|
||||||
<Table.Summary.Cell align="right">
|
<Table.Summary.Cell align="right">
|
||||||
<CurrencyFormatter>
|
<CurrencyFormatter>
|
||||||
{job.job_totals.rates.mash.rate}
|
{job.job_totals.rates.mash.rate}
|
||||||
|
|||||||
@@ -33,10 +33,10 @@ export default function JobTotalsTableOther({ job }) {
|
|||||||
key: t("jobs.fields.storage_payable"),
|
key: t("jobs.fields.storage_payable"),
|
||||||
total: job.job_totals.additional.storage,
|
total: job.job_totals.additional.storage,
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
key: t("jobs.fields.ca_bc_pvrt"),
|
// key: t("jobs.fields.ca_bc_pvrt"),
|
||||||
total: job.job_totals.additional.pvrt,
|
// total: job.job_totals.additional.pvrt,
|
||||||
},
|
// },
|
||||||
];
|
];
|
||||||
}, [job.job_totals, t]);
|
}, [job.job_totals, t]);
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,22 @@ import Dinero from "dinero.js";
|
|||||||
import React, { useMemo } from "react";
|
import React, { useMemo } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
export default function JobTotalsTableTotals({ job }) {
|
import { connect } from "react-redux";
|
||||||
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
//currentUser: selectCurrentUser
|
||||||
|
bodyshop: selectBodyshop,
|
||||||
|
});
|
||||||
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
|
});
|
||||||
|
export default connect(
|
||||||
|
mapStateToProps,
|
||||||
|
mapDispatchToProps
|
||||||
|
)(JobTotalsTableTotals);
|
||||||
|
|
||||||
|
export function JobTotalsTableTotals({ bodyshop, job }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const data = useMemo(() => {
|
const data = useMemo(() => {
|
||||||
@@ -21,6 +36,14 @@ export default function JobTotalsTableTotals({ job }) {
|
|||||||
key: t("jobs.labels.state_tax_amt"),
|
key: t("jobs.labels.state_tax_amt"),
|
||||||
total: job.job_totals.totals.state_tax,
|
total: job.job_totals.totals.state_tax,
|
||||||
},
|
},
|
||||||
|
...(bodyshop.region_config === "CA_BC"
|
||||||
|
? [
|
||||||
|
{
|
||||||
|
key: t("jobs.fields.ca_bc_pvrt"),
|
||||||
|
total: job.job_totals.additional.pvrt,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
: []),
|
||||||
{
|
{
|
||||||
key: t("jobs.labels.federal_tax_amt"),
|
key: t("jobs.labels.federal_tax_amt"),
|
||||||
total: job.job_totals.totals.federal_tax,
|
total: job.job_totals.totals.federal_tax,
|
||||||
@@ -58,7 +81,7 @@ export default function JobTotalsTableTotals({ job }) {
|
|||||||
bold: true,
|
bold: true,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}, [job.job_totals, t]);
|
}, [job.job_totals, t, bodyshop.region_config]);
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
import { useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
import { Button, Form, notification, DatePicker } from "antd";
|
import { Button, Form, notification } from "antd";
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { UPDATE_JOB } from "../../graphql/jobs.queries";
|
import { UPDATE_JOB } from "../../graphql/jobs.queries";
|
||||||
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 LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
|
import FormDatePicker from "../form-date-picker/form-date-picker.component";
|
||||||
|
|
||||||
export default function JobsAdminDatesChange({ job }) {
|
export default function JobsAdminDatesChange({ job }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
@@ -54,7 +56,16 @@ export default function JobsAdminDatesChange({ job }) {
|
|||||||
label={t("jobs.fields.date_estimated")}
|
label={t("jobs.fields.date_estimated")}
|
||||||
name="date_estimated"
|
name="date_estimated"
|
||||||
>
|
>
|
||||||
<DatePicker format="MM/DD/YYYY" />
|
<FormDatePicker format="MM/DD/YYYY" />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item label={t("jobs.fields.date_towin")} name="date_towin">
|
||||||
|
<DateTimePicker />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.date_rentalresp")}
|
||||||
|
name="date_rentalresp"
|
||||||
|
>
|
||||||
|
<DateTimePicker />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label={t("jobs.fields.date_open")} name="date_open">
|
<Form.Item label={t("jobs.fields.date_open")} name="date_open">
|
||||||
<DateTimePicker />
|
<DateTimePicker />
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ export const GetSupplementDelta = async (client, jobId, newLines) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
//Wahtever is left in the existing lines, are lines that should be removed.
|
//Wahtever is left in the existing lines, are lines that should be removed.
|
||||||
|
|
||||||
const insertQueries = linesToInsert.reduce((acc, value, idx) => {
|
const insertQueries = linesToInsert.reduce((acc, value, idx) => {
|
||||||
return acc + generateInsertQuery(value, idx, jobId);
|
return acc + generateInsertQuery(value, idx, jobId);
|
||||||
}, "");
|
}, "");
|
||||||
@@ -49,6 +48,13 @@ export const GetSupplementDelta = async (client, jobId, newLines) => {
|
|||||||
const removeQueries = existingLines.reduce((acc, value, idx) => {
|
const removeQueries = existingLines.reduce((acc, value, idx) => {
|
||||||
return acc + generateRemoveQuery(value, idx);
|
return acc + generateRemoveQuery(value, idx);
|
||||||
}, "");
|
}, "");
|
||||||
|
console.log(insertQueries, updateQueries, removeQueries);
|
||||||
|
|
||||||
|
if ((insertQueries + updateQueries + removeQueries).trim() === "") {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
resolve(null);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
resolve(gql`
|
resolve(gql`
|
||||||
|
|||||||
@@ -220,12 +220,13 @@ export function JobsAvailableContainer({
|
|||||||
);
|
);
|
||||||
|
|
||||||
delete supp.joblines;
|
delete supp.joblines;
|
||||||
await client.mutate({
|
if (suppDelta !== null) {
|
||||||
mutation: gql`
|
await client.mutate({
|
||||||
${suppDelta}
|
mutation: gql`
|
||||||
`,
|
${suppDelta}
|
||||||
});
|
`,
|
||||||
|
});
|
||||||
|
}
|
||||||
const updateResult = await updateJob({
|
const updateResult = await updateJob({
|
||||||
variables: {
|
variables: {
|
||||||
jobId: selectedJob,
|
jobId: selectedJob,
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import { insertAuditTrail } from "../../redux/application/application.actions";
|
|||||||
import { selectJobReadOnly } from "../../redux/application/application.selectors";
|
import { selectJobReadOnly } from "../../redux/application/application.selectors";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
||||||
|
import axios from "axios";
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
//currentUser: selectCurrentUser
|
//currentUser: selectCurrentUser
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -53,6 +53,12 @@ export function JobsConvertButton({
|
|||||||
variables: { jobId: job.id, ...values },
|
variables: { jobId: job.id, ...values },
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (values.ca_gst_registrant) {
|
||||||
|
await axios.post("/job/totalsssu", {
|
||||||
|
id: job.id,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (!res.errors) {
|
if (!res.errors) {
|
||||||
refetch();
|
refetch();
|
||||||
notification["success"]({
|
notification["success"]({
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { DatePicker, Form, Statistic, Tooltip } from "antd";
|
import { Form, Statistic, Tooltip } from "antd";
|
||||||
import React, { useMemo } from "react";
|
import React, { useMemo } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
@@ -34,11 +34,17 @@ export function JobsDetailDatesComponent({ jobRO, job, bodyshop }) {
|
|||||||
label={t("jobs.fields.date_estimated")}
|
label={t("jobs.fields.date_estimated")}
|
||||||
name="date_estimated"
|
name="date_estimated"
|
||||||
>
|
>
|
||||||
<DatePicker disabled={jobRO} format="MM/DD/YYYY" />
|
<FormDatePicker disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label={t("jobs.fields.date_open")} name="date_open">
|
<Form.Item label={t("jobs.fields.date_open")} name="date_open">
|
||||||
<DateTimePicker disabled={jobRO} />
|
<DateTimePicker disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<Form.Item label={t("jobs.fields.date_towin")} name="date_towin">
|
||||||
|
<DateTimePicker disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item label={t("jobs.fields.date_rentalresp")} name="date_rentalresp">
|
||||||
|
<DateTimePicker disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
</FormRow>
|
</FormRow>
|
||||||
|
|
||||||
<FormRow header={t("jobs.forms.scheddates")}>
|
<FormRow header={t("jobs.forms.scheddates")}>
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import {
|
import {
|
||||||
Col,
|
Col,
|
||||||
Divider,
|
|
||||||
Form,
|
Form,
|
||||||
Input,
|
Input,
|
||||||
InputNumber,
|
InputNumber,
|
||||||
@@ -23,8 +22,8 @@ import FormItemPhone, {
|
|||||||
} from "../form-items-formatted/phone-form-item.component";
|
} from "../form-items-formatted/phone-form-item.component";
|
||||||
import Car from "../job-damage-visual/job-damage-visual.component";
|
import Car from "../job-damage-visual/job-damage-visual.component";
|
||||||
import JobsDetailChangeEstimator from "../jobs-detail-change-estimator/jobs-detail-change-estimator.component";
|
import JobsDetailChangeEstimator from "../jobs-detail-change-estimator/jobs-detail-change-estimator.component";
|
||||||
import FormRow from "../layout-form-row/layout-form-row.component";
|
|
||||||
import JobsDetailChangeFileHandler from "../jobs-detail-change-filehandler/jobs-detail-change-filehandler.component";
|
import JobsDetailChangeFileHandler from "../jobs-detail-change-filehandler/jobs-detail-change-filehandler.component";
|
||||||
|
import FormRow from "../layout-form-row/layout-form-row.component";
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
jobRO: selectJobReadOnly,
|
jobRO: selectJobReadOnly,
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -220,15 +219,8 @@ export function JobsDetailGeneral({ bodyshop, jobRO, job, form }) {
|
|||||||
)}
|
)}
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
<Divider
|
|
||||||
orientation="left"
|
|
||||||
type="horizontal"
|
|
||||||
style={{ marginTop: ".8rem", float: "right" }}
|
|
||||||
>
|
|
||||||
{t("jobs.forms.appraiserinfo")}
|
|
||||||
</Divider>
|
|
||||||
|
|
||||||
<FormRow noDivider>
|
<FormRow header={t("jobs.forms.appraiserinfo")}>
|
||||||
<Form.Item label={t("jobs.fields.est_co_nm")} name="est_co_nm">
|
<Form.Item label={t("jobs.fields.est_co_nm")} name="est_co_nm">
|
||||||
<Input disabled={jobRO} />
|
<Input disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import { connect } from "react-redux";
|
|||||||
import { Link, useHistory } from "react-router-dom";
|
import { Link, useHistory } from "react-router-dom";
|
||||||
import { createStructuredSelector } from "reselect";
|
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 { DELETE_JOB, UPDATE_JOB, VOID_JOB } from "../../graphql/jobs.queries";
|
import { DELETE_JOB, UPDATE_JOB, VOID_JOB } from "../../graphql/jobs.queries";
|
||||||
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";
|
||||||
@@ -56,6 +57,7 @@ export function JobsDetailHeaderActions({
|
|||||||
const [deleteJob] = useMutation(DELETE_JOB);
|
const [deleteJob] = useMutation(DELETE_JOB);
|
||||||
const [updateJob] = useMutation(UPDATE_JOB);
|
const [updateJob] = useMutation(UPDATE_JOB);
|
||||||
const [voidJob] = useMutation(VOID_JOB);
|
const [voidJob] = useMutation(VOID_JOB);
|
||||||
|
const [cancelAllAppointments] = useMutation(CANCEL_APPOINTMENTS_BY_JOB_ID);
|
||||||
const jobInProduction = useMemo(() => {
|
const jobInProduction = useMemo(() => {
|
||||||
return bodyshop.md_ro_statuses.production_statuses.includes(job.status);
|
return bodyshop.md_ro_statuses.production_statuses.includes(job.status);
|
||||||
}, [job, bodyshop.md_ro_statuses.production_statuses]);
|
}, [job, bodyshop.md_ro_statuses.production_statuses]);
|
||||||
@@ -121,6 +123,39 @@ export function JobsDetailHeaderActions({
|
|||||||
>
|
>
|
||||||
{t("jobs.actions.schedule")}
|
{t("jobs.actions.schedule")}
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
|
<Menu.Item
|
||||||
|
disabled={job.status !== bodyshop.md_ro_statuses.default_scheduled}
|
||||||
|
>
|
||||||
|
<Popconfirm
|
||||||
|
title={t("general.labels.areyousure")}
|
||||||
|
okText="Yes"
|
||||||
|
cancelText="No"
|
||||||
|
onClick={(e) => e.stopPropagation()}
|
||||||
|
disabled={job.status !== bodyshop.md_ro_statuses.default_scheduled}
|
||||||
|
onConfirm={async () => {
|
||||||
|
const jobUpdate = await cancelAllAppointments({
|
||||||
|
variables: {
|
||||||
|
jobid: job.id,
|
||||||
|
job: {
|
||||||
|
date_scheduled: null,
|
||||||
|
scheduled_in: null,
|
||||||
|
scheduled_completion: null,
|
||||||
|
status: bodyshop.md_ro_statuses.default_imported,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
if (!jobUpdate.errors) {
|
||||||
|
notification["success"]({
|
||||||
|
message: t("appointments.successes.canceled"),
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
getPopupContainer={(trigger) => trigger.parentNode}
|
||||||
|
>
|
||||||
|
{t("menus.jobsactions.cancelallappointments")}
|
||||||
|
</Popconfirm>
|
||||||
|
</Menu.Item>
|
||||||
<Menu.Item
|
<Menu.Item
|
||||||
disabled={
|
disabled={
|
||||||
!!job.intakechecklist ||
|
!!job.intakechecklist ||
|
||||||
@@ -401,6 +436,9 @@ export function JobsDetailHeaderActions({
|
|||||||
job: {
|
job: {
|
||||||
status: bodyshop.md_ro_statuses.default_void,
|
status: bodyshop.md_ro_statuses.default_void,
|
||||||
voided: true,
|
voided: true,
|
||||||
|
scheduled_in: null,
|
||||||
|
scheduled_completion: null,
|
||||||
|
inproduction: false,
|
||||||
},
|
},
|
||||||
note: [
|
note: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ import ProductionListColumnProductionNote from "../production-list-columns/produ
|
|||||||
import "./jobs-detail-header.styles.scss";
|
import "./jobs-detail-header.styles.scss";
|
||||||
import JobsRelatedRos from "../jobs-related-ros/jobs-related-ros.component";
|
import JobsRelatedRos from "../jobs-related-ros/jobs-related-ros.component";
|
||||||
import { DateTimeFormatter } from "../../utils/DateFormatter";
|
import { DateTimeFormatter } from "../../utils/DateFormatter";
|
||||||
|
import ProductionListColumnComment from "../production-list-columns/production-list-columns.comment.component";
|
||||||
|
import { OwnerNameDisplayFunction } from "../owner-name-display/owner-name-display.component";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
jobRO: selectJobReadOnly,
|
jobRO: selectJobReadOnly,
|
||||||
@@ -59,6 +61,12 @@ export function JobsDetailHeader({ job, bodyshop, disabled }) {
|
|||||||
);
|
);
|
||||||
}, [job.status, bodyshop.md_ro_statuses.post_production_statuses]);
|
}, [job.status, bodyshop.md_ro_statuses.post_production_statuses]);
|
||||||
|
|
||||||
|
const vehicleTitle = `${job.v_model_yr || ""} ${job.v_color || ""}
|
||||||
|
${job.v_make_desc || ""}
|
||||||
|
${job.v_model_desc || ""}`.trim();
|
||||||
|
|
||||||
|
const ownerTitle = OwnerNameDisplayFunction(job).trim();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Row gutter={[16, 16]} style={{ alignItems: "stretch" }}>
|
<Row gutter={[16, 16]} style={{ alignItems: "stretch" }}>
|
||||||
<Col {...colSpan}>
|
<Col {...colSpan}>
|
||||||
@@ -86,6 +94,12 @@ export function JobsDetailHeader({ job, bodyshop, disabled }) {
|
|||||||
) : null}
|
) : null}
|
||||||
</Space>
|
</Space>
|
||||||
</DataLabel>
|
</DataLabel>
|
||||||
|
<DataLabel
|
||||||
|
label={t("jobs.fields.comment")}
|
||||||
|
valueStyle={{ overflow: "hidden", textOverflow: "ellipsis" }}
|
||||||
|
>
|
||||||
|
<ProductionListColumnComment record={job} />
|
||||||
|
</DataLabel>
|
||||||
<DataLabel label={t("jobs.fields.ins_co_nm_short")}>
|
<DataLabel label={t("jobs.fields.ins_co_nm_short")}>
|
||||||
{job.ins_co_nm}
|
{job.ins_co_nm}
|
||||||
</DataLabel>
|
</DataLabel>
|
||||||
@@ -145,9 +159,9 @@ export function JobsDetailHeader({ job, bodyshop, disabled }) {
|
|||||||
style={{ height: "100%" }}
|
style={{ height: "100%" }}
|
||||||
title={
|
title={
|
||||||
<Link to={disabled ? "#" : `/manage/owners/${job.owner.id}`}>
|
<Link to={disabled ? "#" : `/manage/owners/${job.owner.id}`}>
|
||||||
{`${job.ownr_fn || ""} ${job.ownr_ln || ""} ${
|
{ownerTitle.length > 0
|
||||||
job.ownr_co_nm || ""
|
? ownerTitle
|
||||||
}`}
|
: t("owner.labels.noownerinfo")}
|
||||||
</Link>
|
</Link>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
@@ -181,9 +195,9 @@ export function JobsDetailHeader({ job, bodyshop, disabled }) {
|
|||||||
: job.vehicle && `/manage/vehicles/${job.vehicle.id}`
|
: job.vehicle && `/manage/vehicles/${job.vehicle.id}`
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{`${job.v_model_yr || ""} ${job.v_color || ""}
|
{vehicleTitle.length > 0
|
||||||
${job.v_make_desc || ""}
|
? vehicleTitle
|
||||||
${job.v_model_desc || ""}`}
|
: t("vehicles.labels.novehinfo")}
|
||||||
</Link>
|
</Link>
|
||||||
) : (
|
) : (
|
||||||
<span></span>
|
<span></span>
|
||||||
|
|||||||
@@ -88,6 +88,33 @@ export function JobsDetailRates({ jobRO, form, job, bodyshop }) {
|
|||||||
</Form.Item>
|
</Form.Item>
|
||||||
<CABCpvrtCalculator form={form} disabled={jobRO} />
|
<CABCpvrtCalculator form={form} disabled={jobRO} />
|
||||||
</Space>
|
</Space>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.auto_add_ats")}
|
||||||
|
name="auto_add_ats"
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
|
||||||
|
<Form.Item
|
||||||
|
nostyle
|
||||||
|
shouldUpdate={(prev, cur) => prev.auto_add_ats !== cur.auto_add_ats}
|
||||||
|
>
|
||||||
|
{() => {
|
||||||
|
if (form.getFieldValue("auto_add_ats"))
|
||||||
|
return (
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.rate_ats")}
|
||||||
|
name="rate_ats"
|
||||||
|
initialValue={bodyshop.shoprates.rate_atp}
|
||||||
|
>
|
||||||
|
<CurrencyInput disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}}
|
||||||
|
</Form.Item>
|
||||||
</FormRow>
|
</FormRow>
|
||||||
<FormRow>
|
<FormRow>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
@@ -100,7 +127,13 @@ export function JobsDetailRates({ jobRO, form, job, bodyshop }) {
|
|||||||
label={t("jobs.fields.state_tax_rate")}
|
label={t("jobs.fields.state_tax_rate")}
|
||||||
name="state_tax_rate"
|
name="state_tax_rate"
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} autoComplete="new-password"/>
|
<InputNumber
|
||||||
|
min={0}
|
||||||
|
max={1}
|
||||||
|
precision={2}
|
||||||
|
disabled={jobRO}
|
||||||
|
autoComplete="new-password"
|
||||||
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.local_tax_rate")}
|
label={t("jobs.fields.local_tax_rate")}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ export function JobsDocumentsDownloadButton({
|
|||||||
);
|
);
|
||||||
const imagesToDownload = [
|
const imagesToDownload = [
|
||||||
...galleryImages.images.filter((image) => image.isSelected),
|
...galleryImages.images.filter((image) => image.isSelected),
|
||||||
// ...galleryImages.other.filter((image) => image.isSelected),
|
...galleryImages.other.filter((image) => image.isSelected),
|
||||||
];
|
];
|
||||||
|
|
||||||
function downloadProgress(progressEvent) {
|
function downloadProgress(progressEvent) {
|
||||||
@@ -123,6 +123,7 @@ export function JobsDocumentsDownloadButton({
|
|||||||
a.click();
|
a.click();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import React from "react";
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import PhoneFormatter from "../../utils/PhoneFormatter";
|
import PhoneFormatter from "../../utils/PhoneFormatter";
|
||||||
|
import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
|
||||||
|
|
||||||
export default function JobsFindModalComponent({
|
export default function JobsFindModalComponent({
|
||||||
selectedJob,
|
selectedJob,
|
||||||
@@ -43,15 +44,12 @@ export default function JobsFindModalComponent({
|
|||||||
render: (text, record) => {
|
render: (text, record) => {
|
||||||
return record.owner ? (
|
return record.owner ? (
|
||||||
<Link to={"/manage/owners/" + record.owner.id}>
|
<Link to={"/manage/owners/" + record.owner.id}>
|
||||||
{`${record.ownr_fn || ""} ${record.ownr_ln || ""} ${
|
<OwnerNameDisplay ownerObject={record} />
|
||||||
record.ownr_co_nm || ""
|
|
||||||
}`}
|
|
||||||
</Link>
|
</Link>
|
||||||
) : (
|
) : (
|
||||||
// t("jobs.errors.noowner")
|
<span>
|
||||||
<span>{`${record.ownr_fn || ""} ${record.ownr_ln || ""} ${
|
<OwnerNameDisplay ownerObject={record} />
|
||||||
record.ownr_co_nm || ""
|
</span>
|
||||||
}`}</span>
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import { createStructuredSelector } from "reselect";
|
|||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
||||||
import StartChatButton from "../chat-open-button/chat-open-button.component";
|
import StartChatButton from "../chat-open-button/chat-open-button.component";
|
||||||
|
import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
//currentUser: selectCurrentUser
|
//currentUser: selectCurrentUser
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -30,7 +30,7 @@ export function JobsList({ bodyshop, refetch, loading, jobs, total }) {
|
|||||||
title: t("jobs.fields.ro_number"),
|
title: t("jobs.fields.ro_number"),
|
||||||
dataIndex: "ro_number",
|
dataIndex: "ro_number",
|
||||||
key: "ro_number",
|
key: "ro_number",
|
||||||
width: "8%",
|
|
||||||
sorter: true, //(a, b) => alphaSort(a.ro_number, b.ro_number),
|
sorter: true, //(a, b) => alphaSort(a.ro_number, b.ro_number),
|
||||||
sortOrder: sortcolumn === "ro_number" && sortorder,
|
sortOrder: sortcolumn === "ro_number" && sortorder,
|
||||||
|
|
||||||
@@ -47,19 +47,17 @@ export function JobsList({ bodyshop, refetch, loading, jobs, total }) {
|
|||||||
key: "ownr_ln",
|
key: "ownr_ln",
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
//sorter: true, // (a, b) => alphaSort(a.ownr_ln, b.ownr_ln),
|
//sorter: true, // (a, b) => alphaSort(a.ownr_ln, b.ownr_ln),
|
||||||
width: "25%",
|
|
||||||
//sortOrder: sortcolumn === "ownr_ln" && sortorder,
|
//sortOrder: sortcolumn === "ownr_ln" && sortorder,
|
||||||
render: (text, record) => {
|
render: (text, record) => {
|
||||||
return record.ownerid ? (
|
return record.ownerid ? (
|
||||||
<Link to={"/manage/owners/" + record.ownerid}>
|
<Link to={"/manage/owners/" + record.ownerid}>
|
||||||
{`${record.ownr_fn || ""} ${record.ownr_ln || ""} ${
|
<OwnerNameDisplay ownerObject={record} />
|
||||||
record.ownr_co_nm || ""
|
|
||||||
}`}
|
|
||||||
</Link>
|
</Link>
|
||||||
) : (
|
) : (
|
||||||
<span>{`${record.ownr_fn || ""} ${record.ownr_ln || ""} ${
|
<span>
|
||||||
record.ownr_co_nm || ""
|
<OwnerNameDisplay ownerObject={record} />
|
||||||
}`}</span>
|
</span>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -67,7 +65,7 @@ export function JobsList({ bodyshop, refetch, loading, jobs, total }) {
|
|||||||
title: t("jobs.fields.ownr_ph1"),
|
title: t("jobs.fields.ownr_ph1"),
|
||||||
dataIndex: "ownr_ph1",
|
dataIndex: "ownr_ph1",
|
||||||
key: "ownr_ph1",
|
key: "ownr_ph1",
|
||||||
width: "12%",
|
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<StartChatButton phone={record.ownr_ph1} jobid={record.id} />
|
<StartChatButton phone={record.ownr_ph1} jobid={record.id} />
|
||||||
@@ -77,7 +75,7 @@ export function JobsList({ bodyshop, refetch, loading, jobs, total }) {
|
|||||||
title: t("jobs.fields.ownr_ph2"),
|
title: t("jobs.fields.ownr_ph2"),
|
||||||
dataIndex: "ownr_ph2",
|
dataIndex: "ownr_ph2",
|
||||||
key: "ownr_ph2",
|
key: "ownr_ph2",
|
||||||
width: "12%",
|
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<StartChatButton phone={record.ownr_ph2} jobid={record.id} />
|
<StartChatButton phone={record.ownr_ph2} jobid={record.id} />
|
||||||
@@ -87,7 +85,7 @@ export function JobsList({ bodyshop, refetch, loading, jobs, total }) {
|
|||||||
title: t("jobs.fields.status"),
|
title: t("jobs.fields.status"),
|
||||||
dataIndex: "status",
|
dataIndex: "status",
|
||||||
key: "status",
|
key: "status",
|
||||||
width: "10%",
|
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
sorter: true, // (a, b) => alphaSort(a.status, b.status),
|
sorter: true, // (a, b) => alphaSort(a.status, b.status),
|
||||||
sortOrder: sortcolumn === "status" && sortorder,
|
sortOrder: sortcolumn === "status" && sortorder,
|
||||||
@@ -104,7 +102,7 @@ export function JobsList({ bodyshop, refetch, loading, jobs, total }) {
|
|||||||
title: t("jobs.fields.vehicle"),
|
title: t("jobs.fields.vehicle"),
|
||||||
dataIndex: "vehicle",
|
dataIndex: "vehicle",
|
||||||
key: "vehicle",
|
key: "vehicle",
|
||||||
width: "15%",
|
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
render: (text, record) => {
|
render: (text, record) => {
|
||||||
return record.vehicleid ? (
|
return record.vehicleid ? (
|
||||||
@@ -124,7 +122,7 @@ export function JobsList({ bodyshop, refetch, loading, jobs, total }) {
|
|||||||
title: t("vehicles.fields.plate_no"),
|
title: t("vehicles.fields.plate_no"),
|
||||||
dataIndex: "plate_no",
|
dataIndex: "plate_no",
|
||||||
key: "plate_no",
|
key: "plate_no",
|
||||||
width: "8%",
|
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
sorter: true, //(a, b) => alphaSort(a.plate_no, b.plate_no),
|
sorter: true, //(a, b) => alphaSort(a.plate_no, b.plate_no),
|
||||||
sortOrder: sortcolumn === "plate_no" && sortorder,
|
sortOrder: sortcolumn === "plate_no" && sortorder,
|
||||||
@@ -136,7 +134,7 @@ export function JobsList({ bodyshop, refetch, loading, jobs, total }) {
|
|||||||
title: t("jobs.fields.clm_no"),
|
title: t("jobs.fields.clm_no"),
|
||||||
dataIndex: "clm_no",
|
dataIndex: "clm_no",
|
||||||
key: "clm_no",
|
key: "clm_no",
|
||||||
width: "12%",
|
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
sorter: true, //(a, b) => alphaSort(a.clm_no, b.clm_no),
|
sorter: true, //(a, b) => alphaSort(a.clm_no, b.clm_no),
|
||||||
sortOrder: sortcolumn === "clm_no" && sortorder,
|
sortOrder: sortcolumn === "clm_no" && sortorder,
|
||||||
@@ -155,7 +153,7 @@ export function JobsList({ bodyshop, refetch, loading, jobs, total }) {
|
|||||||
title: t("jobs.fields.clm_total"),
|
title: t("jobs.fields.clm_total"),
|
||||||
dataIndex: "clm_total",
|
dataIndex: "clm_total",
|
||||||
key: "clm_total",
|
key: "clm_total",
|
||||||
width: "10%",
|
|
||||||
sorter: true, //(a, b) => a.clm_total - b.clm_total,
|
sorter: true, //(a, b) => a.clm_total - b.clm_total,
|
||||||
sortOrder: sortcolumn === "clm_total" && sortorder,
|
sortOrder: sortcolumn === "clm_total" && sortorder,
|
||||||
render: (text, record) => {
|
render: (text, record) => {
|
||||||
@@ -170,11 +168,17 @@ export function JobsList({ bodyshop, refetch, loading, jobs, total }) {
|
|||||||
title: t("jobs.fields.owner_owing"),
|
title: t("jobs.fields.owner_owing"),
|
||||||
dataIndex: "owner_owing",
|
dataIndex: "owner_owing",
|
||||||
key: "owner_owing",
|
key: "owner_owing",
|
||||||
width: "8%",
|
|
||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<CurrencyFormatter>{record.owner_owing}</CurrencyFormatter>
|
<CurrencyFormatter>{record.owner_owing}</CurrencyFormatter>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: t("jobs.fields.comment"),
|
||||||
|
dataIndex: "comment",
|
||||||
|
key: "comment",
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const handleTableChange = (pagination, filters, sorter) => {
|
const handleTableChange = (pagination, filters, sorter) => {
|
||||||
@@ -224,7 +228,6 @@ export function JobsList({ bodyshop, refetch, loading, jobs, total }) {
|
|||||||
>
|
>
|
||||||
<Table
|
<Table
|
||||||
loading={loading}
|
loading={loading}
|
||||||
scroll={{ x: true }}
|
|
||||||
pagination={{
|
pagination={{
|
||||||
position: "top",
|
position: "top",
|
||||||
pageSize: 25,
|
pageSize: 25,
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
|||||||
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";
|
||||||
|
import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -60,6 +61,9 @@ export function JobsList({ bodyshop }) {
|
|||||||
(j.ownr_co_nm || "")
|
(j.ownr_co_nm || "")
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.includes(searchText.toLowerCase()) ||
|
.includes(searchText.toLowerCase()) ||
|
||||||
|
(j.comments || "")
|
||||||
|
.toLowerCase()
|
||||||
|
.includes(searchText.toLowerCase()) ||
|
||||||
(j.ownr_fn || "")
|
(j.ownr_fn || "")
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.includes(searchText.toLowerCase()) ||
|
.includes(searchText.toLowerCase()) ||
|
||||||
@@ -138,14 +142,12 @@ export function JobsList({ bodyshop }) {
|
|||||||
to={"/manage/owners/" + record.owner.id}
|
to={"/manage/owners/" + record.owner.id}
|
||||||
onClick={(e) => e.stopPropagation()}
|
onClick={(e) => e.stopPropagation()}
|
||||||
>
|
>
|
||||||
{`${record.ownr_fn || ""} ${record.ownr_ln || ""} ${
|
<OwnerNameDisplay ownerObject={record} />
|
||||||
record.ownr_co_nm || ""
|
|
||||||
}`}
|
|
||||||
</Link>
|
</Link>
|
||||||
) : (
|
) : (
|
||||||
<span>{`${record.ownr_fn || ""} ${record.ownr_ln || ""} ${
|
<span>
|
||||||
record.ownr_co_nm || ""
|
<OwnerNameDisplay ownerObject={record} />
|
||||||
}`}</span>
|
</span>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -262,6 +264,13 @@ export function JobsList({ bodyshop }) {
|
|||||||
<CurrencyFormatter>{record.clm_total}</CurrencyFormatter>
|
<CurrencyFormatter>{record.clm_total}</CurrencyFormatter>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: t("jobs.fields.comment"),
|
||||||
|
dataIndex: "comment",
|
||||||
|
key: "comment",
|
||||||
|
ellipsis: true,
|
||||||
|
responsive: ["md"],
|
||||||
|
},
|
||||||
// {
|
// {
|
||||||
// title: t("jobs.fields.owner_owing"),
|
// title: t("jobs.fields.owner_owing"),
|
||||||
// dataIndex: "owner_owing",
|
// dataIndex: "owner_owing",
|
||||||
|
|||||||
@@ -115,7 +115,6 @@ export function JobNotesComponent({
|
|||||||
<EditFilled />
|
<EditFilled />
|
||||||
</Button>
|
</Button>
|
||||||
<PrintWrapperComponent
|
<PrintWrapperComponent
|
||||||
emailOnly
|
|
||||||
templateObject={{
|
templateObject={{
|
||||||
name: Templates.individual_job_note.key,
|
name: Templates.individual_job_note.key,
|
||||||
|
|
||||||
@@ -124,7 +123,7 @@ export function JobNotesComponent({
|
|||||||
messageObject={{
|
messageObject={{
|
||||||
subject: Templates.individual_job_note.subject,
|
subject: Templates.individual_job_note.subject,
|
||||||
}}
|
}}
|
||||||
id={record.id}
|
id={jobId}
|
||||||
/>
|
/>
|
||||||
</Space>
|
</Space>
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { QUERY_SEARCH_OWNER_BY_IDX } from "../../graphql/owners.queries";
|
|||||||
import AlertComponent from "../alert/alert.component";
|
import AlertComponent from "../alert/alert.component";
|
||||||
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
|
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
|
||||||
import OwnerFindModalComponent from "./owner-find-modal.component";
|
import OwnerFindModalComponent from "./owner-find-modal.component";
|
||||||
|
import { OwnerNameDisplayFunction } from "../owner-name-display/owner-name-display.component";
|
||||||
|
|
||||||
export default function OwnerFindModalContainer({
|
export default function OwnerFindModalContainer({
|
||||||
loading,
|
loading,
|
||||||
@@ -30,9 +31,7 @@ export default function OwnerFindModalContainer({
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (modalProps.visible && owner) {
|
if (modalProps.visible && owner) {
|
||||||
const s = `${owner.ownr_fn || ""} ${owner.ownr_ln || ""} ${
|
const s = OwnerNameDisplayFunction(owner);
|
||||||
owner.ownr_co_nm || ""
|
|
||||||
}`;
|
|
||||||
|
|
||||||
setSearchText(s.trim());
|
setSearchText(s.trim());
|
||||||
callSearchowners({ variables: { search: s.trim() } });
|
callSearchowners({ variables: { search: s.trim() } });
|
||||||
|
|||||||
@@ -0,0 +1,47 @@
|
|||||||
|
import { connect } from "react-redux";
|
||||||
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { store } from "../../redux/store";
|
||||||
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
bodyshop: selectBodyshop,
|
||||||
|
});
|
||||||
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
|
});
|
||||||
|
export default connect(mapStateToProps, mapDispatchToProps)(OwnerNameDisplay);
|
||||||
|
|
||||||
|
export function OwnerNameDisplay({ bodyshop, ownerObject }) {
|
||||||
|
const emptyTest =
|
||||||
|
ownerObject.ownr_fn + ownerObject.ownr_ln + ownerObject.ownr_co_nm;
|
||||||
|
|
||||||
|
if (!emptyTest || emptyTest === "null" || emptyTest.trim() === "")
|
||||||
|
return "N/A";
|
||||||
|
|
||||||
|
if (bodyshop.last_name_first)
|
||||||
|
return `${ownerObject.ownr_ln || ""}, ${ownerObject.ownr_fn || ""} ${
|
||||||
|
ownerObject.ownr_co_nm || ""
|
||||||
|
}`.trim();
|
||||||
|
|
||||||
|
return `${ownerObject.ownr_fn || ""} ${ownerObject.ownr_ln || ""} ${
|
||||||
|
ownerObject.ownr_co_nm || ""
|
||||||
|
}`.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
export function OwnerNameDisplayFunction(ownerObject) {
|
||||||
|
const emptyTest =
|
||||||
|
ownerObject.ownr_fn + ownerObject.ownr_ln + ownerObject.ownr_co_nm;
|
||||||
|
|
||||||
|
if (!emptyTest || emptyTest === "null" || emptyTest.trim() === "")
|
||||||
|
return "N/A";
|
||||||
|
|
||||||
|
const rdxStore = store.getState();
|
||||||
|
|
||||||
|
if (rdxStore.user.bodyshop.last_name_first)
|
||||||
|
return `${ownerObject.ownr_ln || ""}, ${ownerObject.ownr_fn || ""} ${
|
||||||
|
ownerObject.ownr_co_nm || ""
|
||||||
|
}`.trim();
|
||||||
|
|
||||||
|
return `${ownerObject.ownr_fn || ""} ${ownerObject.ownr_ln || ""} ${
|
||||||
|
ownerObject.ownr_co_nm || ""
|
||||||
|
}`.trim();
|
||||||
|
}
|
||||||
@@ -8,6 +8,7 @@ import {
|
|||||||
SEARCH_OWNERS_FOR_AUTOCOMPLETE,
|
SEARCH_OWNERS_FOR_AUTOCOMPLETE,
|
||||||
} from "../../graphql/owners.queries";
|
} from "../../graphql/owners.queries";
|
||||||
import AlertComponent from "../alert/alert.component";
|
import AlertComponent from "../alert/alert.component";
|
||||||
|
import { OwnerNameDisplayFunction } from "../owner-name-display/owner-name-display.component";
|
||||||
|
|
||||||
const { Option } = Select;
|
const { Option } = Select;
|
||||||
|
|
||||||
@@ -16,10 +17,8 @@ const OwnerSearchSelect = ({ value, onChange, onBlur, disabled }, ref) => {
|
|||||||
SEARCH_OWNERS_FOR_AUTOCOMPLETE
|
SEARCH_OWNERS_FOR_AUTOCOMPLETE
|
||||||
);
|
);
|
||||||
|
|
||||||
const [
|
const [callIdSearch, { loading: idLoading, error: idError, data: idData }] =
|
||||||
callIdSearch,
|
useLazyQuery(SEARCH_OWNERS_BY_ID_FOR_AUTOCOMPLETE);
|
||||||
{ loading: idLoading, error: idError, data: idData },
|
|
||||||
] = useLazyQuery(SEARCH_OWNERS_BY_ID_FOR_AUTOCOMPLETE);
|
|
||||||
|
|
||||||
const executeSearch = (v) => {
|
const executeSearch = (v) => {
|
||||||
callSearch(v);
|
callSearch(v);
|
||||||
@@ -78,9 +77,7 @@ const OwnerSearchSelect = ({ value, onChange, onBlur, disabled }, ref) => {
|
|||||||
{theOptions
|
{theOptions
|
||||||
? theOptions.map((o) => (
|
? theOptions.map((o) => (
|
||||||
<Option key={o.id} value={o.id}>
|
<Option key={o.id} value={o.id}>
|
||||||
{`${o.ownr_ln || ""} ${o.ownr_fn || ""} ${
|
{`${OwnerNameDisplayFunction(o)} | ${o.ownr_addr1 || ""} `}
|
||||||
o.ownr_co_nm ? ` ${o.ownr_co_num}` : ""
|
|
||||||
}| ${o.ownr_addr1 || ""} `}
|
|
||||||
</Option>
|
</Option>
|
||||||
))
|
))
|
||||||
: null}
|
: null}
|
||||||
|
|||||||
@@ -3,6 +3,10 @@ import React from "react";
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import PhoneFormatter from "../../utils/PhoneFormatter";
|
import PhoneFormatter from "../../utils/PhoneFormatter";
|
||||||
|
import OwnerNameDisplay, {
|
||||||
|
OwnerNameDisplayFunction,
|
||||||
|
} from "../owner-name-display/owner-name-display.component";
|
||||||
|
|
||||||
export default function OwnerTagPopoverComponent({ job }) {
|
export default function OwnerTagPopoverComponent({ job }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const content = (
|
const content = (
|
||||||
@@ -10,9 +14,9 @@ export default function OwnerTagPopoverComponent({ job }) {
|
|||||||
<Row>
|
<Row>
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Descriptions title={t("owners.labels.fromclaim")} column={1}>
|
<Descriptions title={t("owners.labels.fromclaim")} column={1}>
|
||||||
<Descriptions.Item key="1" label={t("jobs.fields.owner")}>{`${
|
<Descriptions.Item key="1" label={t("jobs.fields.owner")}>
|
||||||
job.ownr_fn || ""
|
<OwnerNameDisplay ownerObject={job} />
|
||||||
} ${job.ownr_ln || ""} ${job.ownr_co_nm || ""}`}</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
<Descriptions.Item key="2" label={t("jobs.fields.ownr_ph1")}>
|
<Descriptions.Item key="2" label={t("jobs.fields.ownr_ph1")}>
|
||||||
<PhoneFormatter>{job.ownr_ph1 || ""}</PhoneFormatter>
|
<PhoneFormatter>{job.ownr_ph1 || ""}</PhoneFormatter>
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
@@ -31,11 +35,9 @@ export default function OwnerTagPopoverComponent({ job }) {
|
|||||||
</Col>
|
</Col>
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Descriptions title={t("owners.labels.fromowner")} column={1}>
|
<Descriptions title={t("owners.labels.fromowner")} column={1}>
|
||||||
<Descriptions.Item key="1" label={t("jobs.fields.owner")}>{`${
|
<Descriptions.Item key="1" label={t("jobs.fields.owner")}>
|
||||||
job.owner.ownr_fn || ""
|
<OwnerNameDisplay ownerObject={job.owner} />
|
||||||
} ${job.owner.ownr_ln || ""} ${
|
</Descriptions.Item>
|
||||||
job.owner.ownr_co_nm || ""
|
|
||||||
}`}</Descriptions.Item>
|
|
||||||
<Descriptions.Item key="2" label={t("jobs.fields.ownr_ph1")}>
|
<Descriptions.Item key="2" label={t("jobs.fields.ownr_ph1")}>
|
||||||
<PhoneFormatter>{job.owner.ownr_ph1 || ""}</PhoneFormatter>
|
<PhoneFormatter>{job.owner.ownr_ph1 || ""}</PhoneFormatter>
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
@@ -68,9 +70,7 @@ export default function OwnerTagPopoverComponent({ job }) {
|
|||||||
<Popover placement="bottom" content={content}>
|
<Popover placement="bottom" content={content}>
|
||||||
<Tag color="cyan">
|
<Tag color="cyan">
|
||||||
<Link to={`/manage/owners/${job.owner.id}`}>
|
<Link to={`/manage/owners/${job.owner.id}`}>
|
||||||
{job.owner
|
{job.owner ? OwnerNameDisplayFunction(job) : t("jobs.errors.noowner")}
|
||||||
? `${job.ownr_co_nm || ""}${job.ownr_fn || ""} ${job.ownr_ln || ""}`
|
|
||||||
: t("jobs.errors.noowner")}
|
|
||||||
</Link>
|
</Link>
|
||||||
</Tag>
|
</Tag>
|
||||||
</Popover>
|
</Popover>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ 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 PhoneFormatter from "../../utils/PhoneFormatter";
|
import PhoneFormatter from "../../utils/PhoneFormatter";
|
||||||
|
import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
|
||||||
|
|
||||||
export default function OwnersListComponent({
|
export default function OwnersListComponent({
|
||||||
loading,
|
loading,
|
||||||
@@ -33,9 +34,7 @@ export default function OwnersListComponent({
|
|||||||
key: "name",
|
key: "name",
|
||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<Link to={"/manage/owners/" + record.id}>
|
<Link to={"/manage/owners/" + record.id}>
|
||||||
{`${record.ownr_fn || ""} ${record.ownr_ln || ""} ${
|
<OwnerNameDisplay ownerObject={record} />
|
||||||
record.ownr_co_nm || ""
|
|
||||||
}`}
|
|
||||||
</Link>
|
</Link>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
import { notification } from "antd";
|
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import React, { useEffect } from "react";
|
import React, { useEffect } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
|
||||||
|
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { setPartnerVersion } from "../../redux/application/application.actions";
|
import { setPartnerVersion } from "../../redux/application/application.actions";
|
||||||
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
|
import {store} from '../../redux/store'
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
//currentUser: selectCurrentUser
|
//currentUser: selectCurrentUser
|
||||||
|
bodyshop: selectBodyshop,
|
||||||
});
|
});
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
@@ -19,36 +18,48 @@ export default connect(
|
|||||||
mapDispatchToProps
|
mapDispatchToProps
|
||||||
)(PartnerPingComponent);
|
)(PartnerPingComponent);
|
||||||
|
|
||||||
export function PartnerPingComponent({ setPartnerVersion }) {
|
export function PartnerPingComponent({ bodyshop, }) {
|
||||||
const { t } = useTranslation();
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// Create an scoped async function in the hook
|
// Create an scoped async function in the hook
|
||||||
async function checkPartnerStatus() {
|
|
||||||
try {
|
|
||||||
//if (process.env.NODE_ENV === "development") return;
|
|
||||||
const PartnerResponse = await axios.post("http://localhost:1337/ping/");
|
|
||||||
const { appver, qbpath } = PartnerResponse.data;
|
|
||||||
|
|
||||||
setPartnerVersion(appver);
|
|
||||||
console.log({ appver, qbpath });
|
|
||||||
if (!qbpath) {
|
|
||||||
notification["error"]({
|
|
||||||
title: "",
|
|
||||||
message: t("general.messages.noacctfilepath"),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
notification["error"]({
|
|
||||||
title: "",
|
|
||||||
message: t("general.messages.partnernotrunning"),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Execute the created function directly
|
// Execute the created function directly
|
||||||
checkPartnerStatus();
|
checkPartnerStatus(bodyshop);
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, []);
|
}, [bodyshop]);
|
||||||
|
|
||||||
return <></>;
|
return <></>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function checkPartnerStatus(bodyshop) {
|
||||||
|
if (!bodyshop) return;
|
||||||
|
try {
|
||||||
|
//if (process.env.NODE_ENV === "development") return;
|
||||||
|
const PartnerResponse = await axios.post("http://localhost:1337/ping/");
|
||||||
|
// const {
|
||||||
|
// appver, //qbpath
|
||||||
|
// } = PartnerResponse.data;
|
||||||
|
console.log(PartnerResponse.data)
|
||||||
|
store.dispatch(setPartnerVersion(PartnerResponse.data));
|
||||||
|
// if (
|
||||||
|
// checkAcctPath &&
|
||||||
|
// !qbpath &&
|
||||||
|
// !(
|
||||||
|
// bodyshop &&
|
||||||
|
// (bodyshop.cdk_dealerid ||
|
||||||
|
// bodyshop.pbs_serialnumber ||
|
||||||
|
// bodyshop.accountingconfig.qbo)
|
||||||
|
// )
|
||||||
|
// ) {
|
||||||
|
// notification["error"]({
|
||||||
|
// title: "",
|
||||||
|
// message: i18n.t("general.messages.noacctfilepath"),
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
} catch (error) {
|
||||||
|
console.log("ImEX Online Partner is not running.", error);
|
||||||
|
// notification["error"]({
|
||||||
|
// title: "",
|
||||||
|
// message: i18n.t("general.messages.partnernotrunning"),
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -319,6 +319,15 @@ export function PartsOrderListTableComponent({
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
: []),
|
: []),
|
||||||
|
{
|
||||||
|
title: t("parts_orders.fields.part_type"),
|
||||||
|
dataIndex: "part_type",
|
||||||
|
key: "part_type",
|
||||||
|
render: (text, record) =>
|
||||||
|
record.part_type
|
||||||
|
? t(`joblines.fields.part_types.${record.part_type}`)
|
||||||
|
: null,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: t("parts_orders.fields.oem_partno"),
|
title: t("parts_orders.fields.oem_partno"),
|
||||||
dataIndex: "oem_partno",
|
dataIndex: "oem_partno",
|
||||||
@@ -416,8 +425,6 @@ export function PartsOrderListTableComponent({
|
|||||||
placement="right"
|
placement="right"
|
||||||
onClose={() => handleOnRowClick(null)}
|
onClose={() => handleOnRowClick(null)}
|
||||||
visible={selectedpartsorder}
|
visible={selectedpartsorder}
|
||||||
//getContainer={false}
|
|
||||||
style={{ position: "absolute" }}
|
|
||||||
closable
|
closable
|
||||||
width={drawerPercentage}
|
width={drawerPercentage}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -1,6 +1,17 @@
|
|||||||
import { DeleteFilled, WarningFilled } from "@ant-design/icons";
|
import { DeleteFilled, WarningFilled, DownOutlined } from "@ant-design/icons";
|
||||||
import { useTreatments } from "@splitsoftware/splitio-react";
|
import { useTreatments } from "@splitsoftware/splitio-react";
|
||||||
import { Divider, Form, Input, InputNumber, Radio, Space, Tag } from "antd";
|
import {
|
||||||
|
Divider,
|
||||||
|
Form,
|
||||||
|
Input,
|
||||||
|
InputNumber,
|
||||||
|
Radio,
|
||||||
|
Space,
|
||||||
|
Tag,
|
||||||
|
Select,
|
||||||
|
Menu,
|
||||||
|
Dropdown,
|
||||||
|
} from "antd";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
@@ -30,6 +41,7 @@ export function PartsOrderModalComponent({
|
|||||||
isReturn,
|
isReturn,
|
||||||
preferredMake,
|
preferredMake,
|
||||||
job,
|
job,
|
||||||
|
form,
|
||||||
}) {
|
}) {
|
||||||
const [sendType, setSendType] = sendTypeState;
|
const [sendType, setSendType] = sendTypeState;
|
||||||
const { OEConnection } = useTreatments(
|
const { OEConnection } = useTreatments(
|
||||||
@@ -37,7 +49,27 @@ export function PartsOrderModalComponent({
|
|||||||
{},
|
{},
|
||||||
bodyshop.imexshopid
|
bodyshop.imexshopid
|
||||||
);
|
);
|
||||||
|
const { OEConnection_PriceChange } = useTreatments(
|
||||||
|
["OEConnection_PriceChange"],
|
||||||
|
{},
|
||||||
|
bodyshop.imexshopid
|
||||||
|
);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const handleClick = ({ item, key, keyPath }) => {
|
||||||
|
form.setFieldsValue({ comments: item.props.value });
|
||||||
|
};
|
||||||
|
|
||||||
|
const menu = (
|
||||||
|
<div>
|
||||||
|
<Menu onClick={handleClick}>
|
||||||
|
{bodyshop.md_parts_order_comment.map((comment, idx) => (
|
||||||
|
<Menu.Item value={comment.comment} key={idx}>
|
||||||
|
{comment.label}
|
||||||
|
</Menu.Item>
|
||||||
|
))}
|
||||||
|
</Menu>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
@@ -59,6 +91,7 @@ export function PartsOrderModalComponent({
|
|||||||
options={vendorList}
|
options={vendorList}
|
||||||
disabled={isReturn}
|
disabled={isReturn}
|
||||||
preferredMake={preferredMake}
|
preferredMake={preferredMake}
|
||||||
|
showPhone
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
@@ -91,68 +124,122 @@ export function PartsOrderModalComponent({
|
|||||||
<div>
|
<div>
|
||||||
{fields.map((field, index) => (
|
{fields.map((field, index) => (
|
||||||
<Form.Item required={false} key={field.key}>
|
<Form.Item required={false} key={field.key}>
|
||||||
<LayoutFormRow grow noDivider>
|
<div style={{ display: "flex" }}>
|
||||||
<Form.Item
|
<LayoutFormRow grow noDivider style={{ flex: 1 }}>
|
||||||
//span={8}
|
|
||||||
label={t("parts_orders.fields.line_desc")}
|
|
||||||
key={`${index}line_desc`}
|
|
||||||
name={[field.name, "line_desc"]}
|
|
||||||
rules={[
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
//message: t("general.validation.required"),
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
<Input />
|
|
||||||
</Form.Item>
|
|
||||||
<Form.Item
|
|
||||||
label={t("parts_orders.fields.line_remarks")}
|
|
||||||
key={`${index}line_remarks`}
|
|
||||||
name={[field.name, "line_remarks"]}
|
|
||||||
>
|
|
||||||
<Input />
|
|
||||||
</Form.Item>
|
|
||||||
{
|
|
||||||
// <Form.Item
|
|
||||||
// label={t("parts_orders.fields.db_price")}
|
|
||||||
// key={`${index}db_price`}
|
|
||||||
// name={[field.name, "db_price"]}
|
|
||||||
// >
|
|
||||||
// <CurrencyInput />
|
|
||||||
// </Form.Item>
|
|
||||||
}
|
|
||||||
<Form.Item
|
|
||||||
label={t("parts_orders.fields.quantity")}
|
|
||||||
key={`${index}quantity`}
|
|
||||||
name={[field.name, "quantity"]}
|
|
||||||
rules={[
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
//message: t("general.validation.required"),
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
<InputNumber />
|
|
||||||
</Form.Item>
|
|
||||||
<Form.Item
|
|
||||||
label={t("parts_orders.fields.act_price")}
|
|
||||||
key={`${index}act_price`}
|
|
||||||
name={[field.name, "act_price"]}
|
|
||||||
>
|
|
||||||
<CurrencyInput />
|
|
||||||
</Form.Item>
|
|
||||||
{isReturn && (
|
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("parts_orders.fields.cost")}
|
//span={8}
|
||||||
key={`${index}cost`}
|
label={t("parts_orders.fields.line_desc")}
|
||||||
name={[field.name, "cost"]}
|
key={`${index}line_desc`}
|
||||||
|
name={[field.name, "line_desc"]}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
//message: t("general.validation.required"),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<Input />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("parts_orders.fields.line_remarks")}
|
||||||
|
key={`${index}line_remarks`}
|
||||||
|
name={[field.name, "line_remarks"]}
|
||||||
|
>
|
||||||
|
<Input />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("parts_orders.fields.part_type")}
|
||||||
|
key={`${index}part_type`}
|
||||||
|
name={[field.name, "part_type"]}
|
||||||
|
>
|
||||||
|
<Select
|
||||||
|
disabled={
|
||||||
|
!(
|
||||||
|
sendType === "oec" &&
|
||||||
|
OEConnection_PriceChange.treatment === "on"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<Select.Option value="PAA">
|
||||||
|
{t("joblines.fields.part_types.PAA")}
|
||||||
|
</Select.Option>
|
||||||
|
<Select.Option value="PAC">
|
||||||
|
{t("joblines.fields.part_types.PAC")}
|
||||||
|
</Select.Option>
|
||||||
|
|
||||||
|
<Select.Option value="PAL">
|
||||||
|
{t("joblines.fields.part_types.PAL")}
|
||||||
|
</Select.Option>
|
||||||
|
<Select.Option value="PAG">
|
||||||
|
{t("joblines.fields.part_types.PAG")}
|
||||||
|
</Select.Option>
|
||||||
|
<Select.Option value="PAM">
|
||||||
|
{t("joblines.fields.part_types.PAM")}
|
||||||
|
</Select.Option>
|
||||||
|
<Select.Option value="PAP">
|
||||||
|
{t("joblines.fields.part_types.PAP")}
|
||||||
|
</Select.Option>
|
||||||
|
<Select.Option value="PAN">
|
||||||
|
{t("joblines.fields.part_types.PAN")}
|
||||||
|
</Select.Option>
|
||||||
|
<Select.Option value="PAO">
|
||||||
|
{t("joblines.fields.part_types.PAO")}
|
||||||
|
</Select.Option>
|
||||||
|
<Select.Option value="PAR">
|
||||||
|
{t("joblines.fields.part_types.PAR")}
|
||||||
|
</Select.Option>
|
||||||
|
<Select.Option value="PAS">
|
||||||
|
{t("joblines.fields.part_types.PAS")}
|
||||||
|
</Select.Option>
|
||||||
|
</Select>
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("parts_orders.fields.oem_partno")}
|
||||||
|
key={`${index}oem_partno`}
|
||||||
|
name={[field.name, "oem_partno"]}
|
||||||
|
>
|
||||||
|
<Input />
|
||||||
|
</Form.Item>
|
||||||
|
{
|
||||||
|
// <Form.Item
|
||||||
|
// label={t("parts_orders.fields.db_price")}
|
||||||
|
// key={`${index}db_price`}
|
||||||
|
// name={[field.name, "db_price"]}
|
||||||
|
// >
|
||||||
|
// <CurrencyInput />
|
||||||
|
// </Form.Item>
|
||||||
|
}
|
||||||
|
<Form.Item
|
||||||
|
label={t("parts_orders.fields.quantity")}
|
||||||
|
key={`${index}quantity`}
|
||||||
|
name={[field.name, "quantity"]}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
//message: t("general.validation.required"),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<InputNumber />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("parts_orders.fields.act_price")}
|
||||||
|
key={`${index}act_price`}
|
||||||
|
name={[field.name, "act_price"]}
|
||||||
>
|
>
|
||||||
<CurrencyInput />
|
<CurrencyInput />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
)}
|
{isReturn && (
|
||||||
|
<Form.Item
|
||||||
<Space wrap align="center">
|
label={t("parts_orders.fields.cost")}
|
||||||
|
key={`${index}cost`}
|
||||||
|
name={[field.name, "cost"]}
|
||||||
|
>
|
||||||
|
<CurrencyInput />
|
||||||
|
</Form.Item>
|
||||||
|
)}
|
||||||
|
</LayoutFormRow>
|
||||||
|
<Space wrap size="small" align="center">
|
||||||
<div>
|
<div>
|
||||||
<DeleteFilled
|
<DeleteFilled
|
||||||
style={{ margin: "1rem" }}
|
style={{ margin: "1rem" }}
|
||||||
@@ -167,14 +254,30 @@ export function PartsOrderModalComponent({
|
|||||||
total={fields.length}
|
total={fields.length}
|
||||||
/>
|
/>
|
||||||
</Space>
|
</Space>
|
||||||
</LayoutFormRow>
|
</div>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
</Form.List>
|
</Form.List>
|
||||||
<Form.Item name="comments" label={t("parts_orders.fields.comments")}>
|
<Form.Item
|
||||||
|
name="comments"
|
||||||
|
label={
|
||||||
|
<Space>
|
||||||
|
{t("parts_orders.fields.comments")}
|
||||||
|
<Dropdown overlay={menu}>
|
||||||
|
<a
|
||||||
|
className="ant-dropdown-link"
|
||||||
|
href=" #"
|
||||||
|
onClick={(e) => e.preventDefault()}
|
||||||
|
>
|
||||||
|
<DownOutlined />
|
||||||
|
</a>
|
||||||
|
</Dropdown>
|
||||||
|
</Space>
|
||||||
|
}
|
||||||
|
>
|
||||||
<Input.TextArea rows={3} />
|
<Input.TextArea rows={3} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Radio.Group
|
<Radio.Group
|
||||||
@@ -184,7 +287,7 @@ export function PartsOrderModalComponent({
|
|||||||
<Radio value={"none"}>{t("general.labels.none")}</Radio>
|
<Radio value={"none"}>{t("general.labels.none")}</Radio>
|
||||||
<Radio value={"e"}>{t("parts_orders.labels.email")}</Radio>
|
<Radio value={"e"}>{t("parts_orders.labels.email")}</Radio>
|
||||||
<Radio value={"p"}>{t("parts_orders.labels.print")}</Radio>
|
<Radio value={"p"}>{t("parts_orders.labels.print")}</Radio>
|
||||||
{OEConnection.treatment === "on" && (
|
{OEConnection.treatment === "on" && !isReturn && (
|
||||||
<Radio value={"oec"}>{t("parts_orders.labels.oec")}</Radio>
|
<Radio value={"oec"}>{t("parts_orders.labels.oec")}</Radio>
|
||||||
)}
|
)}
|
||||||
</Radio.Group>
|
</Radio.Group>
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ import AlertComponent from "../alert/alert.component";
|
|||||||
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
|
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
|
||||||
import PartsOrderModalComponent from "./parts-order-modal.component";
|
import PartsOrderModalComponent from "./parts-order-modal.component";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
import { useTreatments } from "@splitsoftware/splitio-react";
|
||||||
|
import _ from "lodash";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
currentUser: selectCurrentUser,
|
currentUser: selectCurrentUser,
|
||||||
@@ -57,6 +59,11 @@ export function PartsOrderModalContainer({
|
|||||||
}) {
|
}) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const client = useApolloClient();
|
const client = useApolloClient();
|
||||||
|
const { OEConnection_PriceChange } = useTreatments(
|
||||||
|
["OEConnection_PriceChange"],
|
||||||
|
{},
|
||||||
|
bodyshop.imexshopid
|
||||||
|
);
|
||||||
const { visible, context, actions } = partsOrderModal;
|
const { visible, context, actions } = partsOrderModal;
|
||||||
const {
|
const {
|
||||||
jobId,
|
jobId,
|
||||||
@@ -70,7 +77,7 @@ export function PartsOrderModalContainer({
|
|||||||
|
|
||||||
const { refetch } = actions;
|
const { refetch } = actions;
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
|
const [saving, setSaving] = useState(false);
|
||||||
const sendTypeState = useState("e");
|
const sendTypeState = useState("e");
|
||||||
const sendType = sendTypeState[0];
|
const sendType = sendTypeState[0];
|
||||||
|
|
||||||
@@ -86,7 +93,7 @@ export function PartsOrderModalContainer({
|
|||||||
|
|
||||||
const handleFinish = async (values) => {
|
const handleFinish = async (values) => {
|
||||||
logImEXEvent("parts_order_insert");
|
logImEXEvent("parts_order_insert");
|
||||||
|
setSaving(true);
|
||||||
const insertResult = await insertPartOrder({
|
const insertResult = await insertPartOrder({
|
||||||
variables: {
|
variables: {
|
||||||
po: [
|
po: [
|
||||||
@@ -189,6 +196,11 @@ export function PartsOrderModalContainer({
|
|||||||
(item) => item.id === values.vendorid
|
(item) => item.id === values.vendorid
|
||||||
)[0];
|
)[0];
|
||||||
|
|
||||||
|
let vendorEmails =
|
||||||
|
matchingVendor &&
|
||||||
|
matchingVendor.email &&
|
||||||
|
matchingVendor.email.split(RegExp("[;,]"));
|
||||||
|
|
||||||
GenerateDocument(
|
GenerateDocument(
|
||||||
{
|
{
|
||||||
name: isReturn
|
name: isReturn
|
||||||
@@ -199,7 +211,7 @@ export function PartsOrderModalContainer({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
to: matchingVendor ? [matchingVendor.email] : null,
|
to: matchingVendor ? vendorEmails : null,
|
||||||
replyTo: bodyshop.email,
|
replyTo: bodyshop.email,
|
||||||
subject: isReturn
|
subject: isReturn
|
||||||
? Templates.parts_return_slip.subject
|
? Templates.parts_return_slip.subject
|
||||||
@@ -230,11 +242,20 @@ export function PartsOrderModalContainer({
|
|||||||
id: insertResult.data.insert_parts_orders.returning[0].id,
|
id: insertResult.data.insert_parts_orders.returning[0].id,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
let po;
|
||||||
|
//Massage the data based on the split. Should they be able to overwrite OEC pricing?
|
||||||
|
if (OEConnection_PriceChange.treatment === "on") {
|
||||||
|
//Set the flag to include the override.
|
||||||
|
po = _.cloneDeep(partsOrder.data.parts_orders_by_pk);
|
||||||
|
po.parts_order_lines.forEach((pol) => {
|
||||||
|
pol.priceChange = true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const oecResponse = await axios.post(
|
const oecResponse = await axios.post(
|
||||||
"http://localhost:1337/oec/",
|
"http://localhost:1337/oec/",
|
||||||
|
|
||||||
partsOrder.data.parts_orders_by_pk,
|
po || partsOrder.data.parts_orders_by_pk,
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: `Bearer ${await auth.currentUser.getIdToken()}`,
|
Authorization: `Bearer ${await auth.currentUser.getIdToken()}`,
|
||||||
@@ -257,11 +278,11 @@ export function PartsOrderModalContainer({
|
|||||||
error: JSON.stringify(error.message),
|
error: JSON.stringify(error.message),
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
setSaving(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
setSaving(false);
|
||||||
toggleModalVisible();
|
toggleModalVisible();
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -283,6 +304,7 @@ export function PartsOrderModalContainer({
|
|||||||
cost: value.cost,
|
cost: value.cost,
|
||||||
quantity: value.part_qty,
|
quantity: value.part_qty,
|
||||||
job_line_id: isReturn ? value.joblineid : value.id,
|
job_line_id: isReturn ? value.joblineid : value.id,
|
||||||
|
part_type: value.part_type,
|
||||||
});
|
});
|
||||||
return acc;
|
return acc;
|
||||||
}, [])
|
}, [])
|
||||||
@@ -306,6 +328,8 @@ export function PartsOrderModalContainer({
|
|||||||
}
|
}
|
||||||
onCancel={() => toggleModalVisible()}
|
onCancel={() => toggleModalVisible()}
|
||||||
onOk={() => form.submit()}
|
onOk={() => form.submit()}
|
||||||
|
okButtonProps={{ loading: saving }}
|
||||||
|
cancelButtonProps={{ loading: saving }}
|
||||||
destroyOnClose
|
destroyOnClose
|
||||||
width="75%"
|
width="75%"
|
||||||
forceRender
|
forceRender
|
||||||
@@ -322,6 +346,7 @@ export function PartsOrderModalContainer({
|
|||||||
<LoadingSpinner />
|
<LoadingSpinner />
|
||||||
) : (
|
) : (
|
||||||
<PartsOrderModalComponent
|
<PartsOrderModalComponent
|
||||||
|
form={form}
|
||||||
vendorList={(data && data.vendors) || []}
|
vendorList={(data && data.vendors) || []}
|
||||||
sendTypeState={sendTypeState}
|
sendTypeState={sendTypeState}
|
||||||
isReturn={isReturn}
|
isReturn={isReturn}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import { alphaSort } from "../../utils/sorters";
|
|||||||
import { TemplateList } from "../../utils/TemplateConstants";
|
import { TemplateList } from "../../utils/TemplateConstants";
|
||||||
import CaBcEtfTableModalContainer from "../ca-bc-etf-table-modal/ca-bc-etf-table-modal.container";
|
import CaBcEtfTableModalContainer from "../ca-bc-etf-table-modal/ca-bc-etf-table-modal.container";
|
||||||
import PrintWrapperComponent from "../print-wrapper/print-wrapper.component";
|
import PrintWrapperComponent from "../print-wrapper/print-wrapper.component";
|
||||||
|
import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
|
||||||
|
|
||||||
const stripeTestEnv = process.env.REACT_APP_STRIPE_PUBLIC_KEY; //.includes("test");
|
const stripeTestEnv = process.env.REACT_APP_STRIPE_PUBLIC_KEY; //.includes("test");
|
||||||
|
|
||||||
@@ -78,14 +79,12 @@ export function PaymentsListPaginated({
|
|||||||
render: (text, record) => {
|
render: (text, record) => {
|
||||||
return record.job.owner ? (
|
return record.job.owner ? (
|
||||||
<Link to={"/manage/owners/" + record.job.owner.id}>
|
<Link to={"/manage/owners/" + record.job.owner.id}>
|
||||||
{`${record.job.ownr_fn || ""} ${record.job.ownr_ln || ""} ${
|
<OwnerNameDisplay ownerObject={record} />
|
||||||
record.job.ownr_co_nm || ""
|
|
||||||
}`}
|
|
||||||
</Link>
|
</Link>
|
||||||
) : (
|
) : (
|
||||||
<span>{`${record.job.ownr_fn || ""} ${record.job.ownr_ln || ""} ${
|
<span>
|
||||||
record.job.ownr_co_nm || ""
|
<OwnerNameDisplay ownerObject={record} />
|
||||||
}`}</span>
|
</span>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ import ProductionAlert from "../production-list-columns/production-list-columns.
|
|||||||
import ProductionListColumnProductionNote from "../production-list-columns/production-list-columns.productionnote.component";
|
import ProductionListColumnProductionNote from "../production-list-columns/production-list-columns.productionnote.component";
|
||||||
import ProductionSubletsManageComponent from "../production-sublets-manage/production-sublets-manage.component";
|
import ProductionSubletsManageComponent from "../production-sublets-manage/production-sublets-manage.component";
|
||||||
import "./production-board-card.styles.scss";
|
import "./production-board-card.styles.scss";
|
||||||
|
import moment from "moment";
|
||||||
|
import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
|
||||||
|
|
||||||
export default function ProductionBoardCard(
|
export default function ProductionBoardCard(
|
||||||
technician,
|
technician,
|
||||||
@@ -21,7 +23,7 @@ export default function ProductionBoardCard(
|
|||||||
) {
|
) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
let employee_body, employee_prep, employee_refinish; //employee_csr;
|
let employee_body, employee_prep, employee_refinish, employee_csr;
|
||||||
if (card.employee_body) {
|
if (card.employee_body) {
|
||||||
employee_body = bodyshop.employees.find((e) => e.id === card.employee_body);
|
employee_body = bodyshop.employees.find((e) => e.id === card.employee_body);
|
||||||
}
|
}
|
||||||
@@ -33,10 +35,22 @@ export default function ProductionBoardCard(
|
|||||||
(e) => e.id === card.employee_refinish
|
(e) => e.id === card.employee_refinish
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
if (card.employee_csr) {
|
||||||
|
employee_csr = bodyshop.employees.find((e) => e.id === card.employee_csr);
|
||||||
|
}
|
||||||
// if (card.employee_csr) {
|
// if (card.employee_csr) {
|
||||||
// employee_csr = bodyshop.employees.find((e) => e.id === card.employee_csr);
|
// employee_csr = bodyshop.employees.find((e) => e.id === card.employee_csr);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
const pastDueAlert =
|
||||||
|
!!card.scheduled_completion &&
|
||||||
|
((moment().isSameOrAfter(moment(card.scheduled_completion), "day") &&
|
||||||
|
"production-completion-past") ||
|
||||||
|
(moment()
|
||||||
|
.add(1, "day")
|
||||||
|
.isSame(moment(card.scheduled_completion), "day") &&
|
||||||
|
"production-completion-soon"));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
className="react-kanban-card imex-kanban-card"
|
className="react-kanban-card imex-kanban-card"
|
||||||
@@ -48,20 +62,22 @@ export default function ProductionBoardCard(
|
|||||||
<PauseCircleOutlined style={{ color: "orangered" }} />
|
<PauseCircleOutlined style={{ color: "orangered" }} />
|
||||||
)}
|
)}
|
||||||
<span style={{ fontWeight: "bolder" }}>
|
<span style={{ fontWeight: "bolder" }}>
|
||||||
{card.ro_number || t("general.labels.na")}
|
<Link
|
||||||
|
to={
|
||||||
|
technician
|
||||||
|
? `/tech/joblookup?selected=${card.id}`
|
||||||
|
: `/manage/jobs/${card.id}`
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{card.ro_number || t("general.labels.na")}
|
||||||
|
</Link>
|
||||||
</span>
|
</span>
|
||||||
</Space>
|
</Space>
|
||||||
}
|
}
|
||||||
extra={
|
extra={
|
||||||
technician ? (
|
<Link to={{ search: `?selected=${card.id}` }}>
|
||||||
<Link to={`/tech/joblookup?selected=${card.id}`}>
|
<EyeFilled />
|
||||||
<EyeFilled />
|
</Link>
|
||||||
</Link>
|
|
||||||
) : (
|
|
||||||
<Link to={`/manage/jobs/${card.id}`}>
|
|
||||||
<EyeFilled />
|
|
||||||
</Link>
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Row>
|
<Row>
|
||||||
@@ -72,9 +88,9 @@ export default function ProductionBoardCard(
|
|||||||
card.ownr_co_nm || ""
|
card.ownr_co_nm || ""
|
||||||
}`}</div>
|
}`}</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="ellipses">{`${card.ownr_ln || ""}, ${
|
<div className="ellipses">
|
||||||
card.ownr_fn || ""
|
<OwnerNameDisplay ownerObject={card} />
|
||||||
} ${card.ownr_co_nm || ""}`}</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</Col>
|
</Col>
|
||||||
)}
|
)}
|
||||||
@@ -121,11 +137,11 @@ export default function ProductionBoardCard(
|
|||||||
)} ${employee_refinish.last_name.charAt(0)}`
|
)} ${employee_refinish.last_name.charAt(0)}`
|
||||||
: ""
|
: ""
|
||||||
} ${card.larhrs.aggregate.sum.mod_lb_hrs || "?"}h`}</Col>
|
} ${card.larhrs.aggregate.sum.mod_lb_hrs || "?"}h`}</Col>
|
||||||
{/* <Col span={cardSettings && cardSettings.compact ? 24 : 12}>{`C: ${
|
<Col span={cardSettings && cardSettings.compact ? 24 : 12}>{`C: ${
|
||||||
employee_csr
|
employee_csr
|
||||||
? `${employee_csr.first_name} ${employee_csr.last_name}`
|
? `${employee_csr.first_name} ${employee_csr.last_name}`
|
||||||
: ""
|
: ""
|
||||||
}`}</Col> */}
|
}`}</Col>
|
||||||
</Row>
|
</Row>
|
||||||
</Col>
|
</Col>
|
||||||
)}
|
)}
|
||||||
@@ -145,7 +161,7 @@ export default function ProductionBoardCard(
|
|||||||
cardSettings.scheduled_completion &&
|
cardSettings.scheduled_completion &&
|
||||||
card.scheduled_completion && (
|
card.scheduled_completion && (
|
||||||
<Col span={cardSettings && cardSettings.compact ? 24 : 12}>
|
<Col span={cardSettings && cardSettings.compact ? 24 : 12}>
|
||||||
<Space>
|
<Space className={pastDueAlert}>
|
||||||
<CalendarOutlined />
|
<CalendarOutlined />
|
||||||
<DateTimeFormatter format="MM/DD">
|
<DateTimeFormatter format="MM/DD">
|
||||||
{card.scheduled_completion}
|
{card.scheduled_completion}
|
||||||
|
|||||||
@@ -131,6 +131,13 @@ export default function ProductionBoardKanbanCardSettings({
|
|||||||
>
|
>
|
||||||
<Switch />
|
<Switch />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
valuePropName="checked"
|
||||||
|
label={t("production.labels.stickyheader")}
|
||||||
|
name="stickyheader"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
</Form>
|
</Form>
|
||||||
|
|||||||
@@ -1,26 +1,27 @@
|
|||||||
|
import { SyncOutlined } from "@ant-design/icons";
|
||||||
import { useApolloClient } from "@apollo/client";
|
import { useApolloClient } from "@apollo/client";
|
||||||
import Board, { moveCard } from "@asseinfo/react-kanban";
|
import Board, { moveCard } from "@asseinfo/react-kanban";
|
||||||
//import "@asseinfo/react-kanban/dist/styles.css";
|
import { Button, Grid, notification, PageHeader, Space, Statistic } from "antd";
|
||||||
import "./production-board-kanban.styles.scss";
|
|
||||||
import { SyncOutlined } from '@ant-design/icons'
|
|
||||||
import { Grid, notification, Button, PageHeader, Space, Statistic } from "antd";
|
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
|
import { Sticky, StickyContainer } from "react-sticky";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { generate_UPDATE_JOB_KANBAN } from "../../graphql/jobs.queries";
|
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
|
||||||
import ProductionBoardCard from "../production-board-kanban-card/production-board-kanban-card.component";
|
|
||||||
import { createBoardData } from "./production-board-kanban.utils.js";
|
|
||||||
import IndefiniteLoading from "../indefinite-loading/indefinite-loading.component";
|
|
||||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
|
||||||
import ProductionBoardFilters from "../production-board-filters/production-board-filters.component";
|
|
||||||
import { selectTechnician } from "../../redux/tech/tech.selectors";
|
|
||||||
import { insertAuditTrail } from "../../redux/application/application.actions";
|
|
||||||
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
|
||||||
import ProductionBoardKanbanCardSettings from "./production-board-kanban.card-settings.component";
|
|
||||||
import styled from "styled-components";
|
import styled from "styled-components";
|
||||||
|
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||||
|
import { generate_UPDATE_JOB_KANBAN } from "../../graphql/jobs.queries";
|
||||||
|
import { insertAuditTrail } from "../../redux/application/application.actions";
|
||||||
|
import { selectTechnician } from "../../redux/tech/tech.selectors";
|
||||||
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
|
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
||||||
|
import IndefiniteLoading from "../indefinite-loading/indefinite-loading.component";
|
||||||
|
import ProductionBoardFilters from "../production-board-filters/production-board-filters.component";
|
||||||
|
import ProductionBoardCard from "../production-board-kanban-card/production-board-kanban-card.component";
|
||||||
|
import ProductionListDetailComponent from "../production-list-detail/production-list-detail.component";
|
||||||
|
import ProductionBoardKanbanCardSettings from "./production-board-kanban.card-settings.component";
|
||||||
|
//import "@asseinfo/react-kanban/dist/styles.css";
|
||||||
|
import "./production-board-kanban.styles.scss";
|
||||||
|
import { createBoardData } from "./production-board-kanban.utils.js";
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
technician: selectTechnician,
|
technician: selectTechnician,
|
||||||
@@ -49,9 +50,16 @@ export function ProductionBoardKanbanComponent({
|
|||||||
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setBoardLanes(
|
const boardData = createBoardData(
|
||||||
createBoardData(bodyshop.md_ro_statuses.production_statuses, data, filter)
|
bodyshop.md_ro_statuses.production_statuses,
|
||||||
|
data,
|
||||||
|
filter
|
||||||
);
|
);
|
||||||
|
|
||||||
|
boardData.columns = boardData.columns.map((d) => {
|
||||||
|
return { ...d, title: `${d.title} (${d.cards.length})` };
|
||||||
|
});
|
||||||
|
setBoardLanes(boardData);
|
||||||
setIsMoving(false);
|
setIsMoving(false);
|
||||||
}, [
|
}, [
|
||||||
data,
|
data,
|
||||||
@@ -176,9 +184,52 @@ export function ProductionBoardKanbanComponent({
|
|||||||
: standardSizes[selectedBreakpoint[0]]
|
: standardSizes[selectedBreakpoint[0]]
|
||||||
: "250";
|
: "250";
|
||||||
|
|
||||||
|
const stickyHeader = {
|
||||||
|
renderColumnHeader: ({ title }) => (
|
||||||
|
<Sticky>
|
||||||
|
{({
|
||||||
|
style,
|
||||||
|
|
||||||
|
// the following are also available but unused in this example
|
||||||
|
isSticky,
|
||||||
|
wasSticky,
|
||||||
|
distanceFromTop,
|
||||||
|
distanceFromBottom,
|
||||||
|
calculatedHeight,
|
||||||
|
}) => (
|
||||||
|
<div
|
||||||
|
className="react-kanban-column-header"
|
||||||
|
style={{ ...style, zIndex: "99", backgroundColor: "#ddd" }}
|
||||||
|
>
|
||||||
|
{title}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</Sticky>
|
||||||
|
),
|
||||||
|
};
|
||||||
|
|
||||||
|
const cardSettings =
|
||||||
|
associationSettings &&
|
||||||
|
associationSettings.kanban_settings &&
|
||||||
|
Object.keys(associationSettings.kanban_settings).length > 0
|
||||||
|
? associationSettings.kanban_settings
|
||||||
|
: {
|
||||||
|
ats: true,
|
||||||
|
clm_no: true,
|
||||||
|
compact: false,
|
||||||
|
ownr_nm: true,
|
||||||
|
sublets: true,
|
||||||
|
ins_co_nm: true,
|
||||||
|
production_note: true,
|
||||||
|
employeeassignments: true,
|
||||||
|
scheduled_completion: true,
|
||||||
|
stickyheader: false,
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container width={width}>
|
<Container width={width}>
|
||||||
<IndefiniteLoading loading={isMoving} />
|
<IndefiniteLoading loading={isMoving} />
|
||||||
|
|
||||||
<PageHeader
|
<PageHeader
|
||||||
title={
|
title={
|
||||||
<Space>
|
<Space>
|
||||||
@@ -208,34 +259,19 @@ export function ProductionBoardKanbanComponent({
|
|||||||
</Space>
|
</Space>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
<ProductionListDetailComponent jobs={data} />
|
||||||
<Board
|
<StickyContainer>
|
||||||
children={boardLanes}
|
<Board
|
||||||
disableCardDrag={isMoving}
|
style={{ height: "100%" }}
|
||||||
renderCard={(card) =>
|
children={boardLanes}
|
||||||
ProductionBoardCard(
|
disableCardDrag={isMoving}
|
||||||
technician,
|
{...(cardSettings.stickyheader && stickyHeader)}
|
||||||
card,
|
renderCard={(card) =>
|
||||||
bodyshop,
|
ProductionBoardCard(technician, card, bodyshop, cardSettings)
|
||||||
associationSettings &&
|
}
|
||||||
associationSettings.kanban_settings &&
|
onCardDragEnd={handleDragEnd}
|
||||||
Object.keys(associationSettings.kanban_settings).length > 0
|
/>
|
||||||
? associationSettings.kanban_settings
|
</StickyContainer>
|
||||||
: {
|
|
||||||
ats: true,
|
|
||||||
clm_no: true,
|
|
||||||
compact: false,
|
|
||||||
ownr_nm: true,
|
|
||||||
sublets: true,
|
|
||||||
ins_co_nm: true,
|
|
||||||
production_note: true,
|
|
||||||
employeeassignments: true,
|
|
||||||
scheduled_completion: true,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
onCardDragEnd={handleDragEnd}
|
|
||||||
/>
|
|
||||||
</Container>
|
</Container>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ export const createBoardData = (AllStatuses, Jobs, filter) => {
|
|||||||
include ||
|
include ||
|
||||||
j.employee_body === employeeId ||
|
j.employee_body === employeeId ||
|
||||||
j.employee_prep === employeeId ||
|
j.employee_prep === employeeId ||
|
||||||
|
j.employee_csr === employeeId ||
|
||||||
j.employee_refinish === employeeId;
|
j.employee_refinish === employeeId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -76,9 +77,8 @@ export const createBoardData = (AllStatuses, Jobs, filter) => {
|
|||||||
|
|
||||||
Object.keys(DataGroupedByStatus).map((statusGroupKey) => {
|
Object.keys(DataGroupedByStatus).map((statusGroupKey) => {
|
||||||
try {
|
try {
|
||||||
boardLanes.columns.find(
|
boardLanes.columns.find((l) => l.id === statusGroupKey).cards =
|
||||||
(l) => l.id === statusGroupKey
|
sortByParentId(DataGroupedByStatus[statusGroupKey]);
|
||||||
).cards = sortByParentId(DataGroupedByStatus[statusGroupKey]);
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("Error while creating board card", error);
|
console.log("Error while creating board card", error);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,79 @@
|
|||||||
|
import Icon from "@ant-design/icons";
|
||||||
|
import { useMutation } from "@apollo/client";
|
||||||
|
import { Button, Input, Popover } from "antd";
|
||||||
|
import React, { useState } from "react";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { FaRegStickyNote } from "react-icons/fa";
|
||||||
|
import { UPDATE_JOB } from "../../graphql/jobs.queries";
|
||||||
|
export default function ProductionListColumnComment({ record }) {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
const [note, setNote] = useState(record.comment || "");
|
||||||
|
|
||||||
|
const [visible, setVisible] = useState(false);
|
||||||
|
|
||||||
|
const [updateAlert] = useMutation(UPDATE_JOB);
|
||||||
|
|
||||||
|
const handleSaveNote = (e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
setVisible(false);
|
||||||
|
updateAlert({
|
||||||
|
variables: {
|
||||||
|
jobId: record.id,
|
||||||
|
job: {
|
||||||
|
comment: note,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}).then(() => {
|
||||||
|
if (record.refetch) record.refetch();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleChange = (e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
setNote(e.target.value);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleVisibleChange = (flag) => {
|
||||||
|
setVisible(flag);
|
||||||
|
if (flag) setNote(record.comment || "");
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Popover
|
||||||
|
onVisibleChange={handleVisibleChange}
|
||||||
|
visible={visible}
|
||||||
|
content={
|
||||||
|
<div style={{ width: "30em" }}>
|
||||||
|
<Input.TextArea
|
||||||
|
rows={5}
|
||||||
|
value={note}
|
||||||
|
onChange={handleChange}
|
||||||
|
// onPressEnter={handleSaveNote}
|
||||||
|
autoFocus
|
||||||
|
allowClear
|
||||||
|
/>
|
||||||
|
<div>
|
||||||
|
<Button onClick={handleSaveNote}>
|
||||||
|
{t("general.actions.save")}
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
trigger={["click"]}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
width: "100%",
|
||||||
|
height: "19px",
|
||||||
|
cursor: "pointer",
|
||||||
|
overflow: "hidden",
|
||||||
|
textOverflow: "ellipsis",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Icon component={FaRegStickyNote} style={{ marginRight: ".2rem" }} />
|
||||||
|
{record.comment || " "}
|
||||||
|
</div>
|
||||||
|
</Popover>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -18,7 +18,11 @@ import ProductionListLastContacted from "./production-list-columns.lastcontacted
|
|||||||
import ProductionListColumnPaintPriority from "./production-list-columns.paintpriority.component";
|
import ProductionListColumnPaintPriority from "./production-list-columns.paintpriority.component";
|
||||||
import ProductionListColumnNote from "./production-list-columns.productionnote.component";
|
import ProductionListColumnNote from "./production-list-columns.productionnote.component";
|
||||||
import ProductionListColumnStatus from "./production-list-columns.status.component";
|
import ProductionListColumnStatus from "./production-list-columns.status.component";
|
||||||
|
import ProductionListColumnCategory from "./production-list-columns.status.category";
|
||||||
import ProductionlistColumnTouchTime from "./prodution-list-columns.touchtime.component";
|
import ProductionlistColumnTouchTime from "./prodution-list-columns.touchtime.component";
|
||||||
|
import ProductionListColumnComment from "./production-list-columns.comment.component";
|
||||||
|
import ProductionListColumnPartsReceived from "./production-list-columns.partsreceived.component";
|
||||||
|
import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
|
||||||
|
|
||||||
const r = ({ technician, state, activeStatuses, bodyshop }) => {
|
const r = ({ technician, state, activeStatuses, bodyshop }) => {
|
||||||
return [
|
return [
|
||||||
@@ -65,11 +69,7 @@ const r = ({ technician, state, activeStatuses, bodyshop }) => {
|
|||||||
dataIndex: "ownr",
|
dataIndex: "ownr",
|
||||||
key: "ownr",
|
key: "ownr",
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
render: (text, record) => (
|
render: (text, record) => <OwnerNameDisplay ownerObject={record} />,
|
||||||
<span>{`${record.ownr_fn || ""} ${record.ownr_ln || ""} ${
|
|
||||||
record.ownr_co_nm || ""
|
|
||||||
}`}</span>
|
|
||||||
),
|
|
||||||
sorter: (a, b) => alphaSort(a.ownr_ln, b.ownr_ln),
|
sorter: (a, b) => alphaSort(a.ownr_ln, b.ownr_ln),
|
||||||
sortOrder:
|
sortOrder:
|
||||||
state.sortedInfo.columnKey === "ownr" && state.sortedInfo.order,
|
state.sortedInfo.columnKey === "ownr" && state.sortedInfo.order,
|
||||||
@@ -79,6 +79,13 @@ const r = ({ technician, state, activeStatuses, bodyshop }) => {
|
|||||||
dataIndex: "vehicle",
|
dataIndex: "vehicle",
|
||||||
key: "vehicle",
|
key: "vehicle",
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
|
sorter: (a, b) =>
|
||||||
|
alphaSort(
|
||||||
|
a.v_make_desc + a.v_model_desc,
|
||||||
|
b.v_make_desc + b.v_model_desc
|
||||||
|
),
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "ownr" && state.sortedInfo.order,
|
||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<span>{`${record.v_model_yr || ""} ${record.v_make_desc || ""} ${
|
<span>{`${record.v_model_yr || ""} ${record.v_make_desc || ""} ${
|
||||||
record.v_model_desc || ""
|
record.v_model_desc || ""
|
||||||
@@ -94,7 +101,7 @@ const r = ({ technician, state, activeStatuses, bodyshop }) => {
|
|||||||
sortOrder:
|
sortOrder:
|
||||||
state.sortedInfo.columnKey === "actual_in" && state.sortedInfo.order,
|
state.sortedInfo.columnKey === "actual_in" && state.sortedInfo.order,
|
||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<ProductionListDate record={record} field="actual_in" />
|
<ProductionListDate record={record} field="actual_in" time />
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -108,7 +115,12 @@ const r = ({ technician, state, activeStatuses, bodyshop }) => {
|
|||||||
state.sortedInfo.columnKey === "scheduled_completion" &&
|
state.sortedInfo.columnKey === "scheduled_completion" &&
|
||||||
state.sortedInfo.order,
|
state.sortedInfo.order,
|
||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<ProductionListDate record={record} field="scheduled_completion" />
|
<ProductionListDate
|
||||||
|
record={record}
|
||||||
|
field="scheduled_completion"
|
||||||
|
pastIndicator
|
||||||
|
time
|
||||||
|
/>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -155,7 +167,12 @@ const r = ({ technician, state, activeStatuses, bodyshop }) => {
|
|||||||
state.sortedInfo.columnKey === "scheduled_delivery" &&
|
state.sortedInfo.columnKey === "scheduled_delivery" &&
|
||||||
state.sortedInfo.order,
|
state.sortedInfo.order,
|
||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<ProductionListDate record={record} field="scheduled_delivery" />
|
<ProductionListDate
|
||||||
|
record={record}
|
||||||
|
field="scheduled_delivery"
|
||||||
|
pastIndicator
|
||||||
|
time
|
||||||
|
/>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -251,6 +268,29 @@ const r = ({ technician, state, activeStatuses, bodyshop }) => {
|
|||||||
state.sortedInfo.columnKey === "status" && state.sortedInfo.order,
|
state.sortedInfo.columnKey === "status" && state.sortedInfo.order,
|
||||||
render: (text, record) => <ProductionListColumnStatus record={record} />,
|
render: (text, record) => <ProductionListColumnStatus record={record} />,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: i18n.t("jobs.fields.category"),
|
||||||
|
dataIndex: "category",
|
||||||
|
key: "category",
|
||||||
|
ellipsis: true,
|
||||||
|
|
||||||
|
filters:
|
||||||
|
(bodyshop &&
|
||||||
|
bodyshop.md_categories.map((s) => {
|
||||||
|
return {
|
||||||
|
text: s,
|
||||||
|
value: [s],
|
||||||
|
};
|
||||||
|
})) ||
|
||||||
|
[],
|
||||||
|
onFilter: (value, record) => value.includes(record.category),
|
||||||
|
sorter: (a, b) => alphaSort(a.category, b.category),
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "category" && state.sortedInfo.order,
|
||||||
|
render: (text, record) => (
|
||||||
|
<ProductionListColumnCategory record={record} />
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: i18n.t("production.labels.bodyhours"),
|
title: i18n.t("production.labels.bodyhours"),
|
||||||
dataIndex: "labhrs",
|
dataIndex: "labhrs",
|
||||||
@@ -301,6 +341,13 @@ const r = ({ technician, state, activeStatuses, bodyshop }) => {
|
|||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
render: (text, record) => <ProductionListColumnNote record={record} />,
|
render: (text, record) => <ProductionListColumnNote record={record} />,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: i18n.t("production.labels.comment"),
|
||||||
|
dataIndex: "comment",
|
||||||
|
key: "comment",
|
||||||
|
ellipsis: true,
|
||||||
|
render: (text, record) => <ProductionListColumnComment record={record} />,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: i18n.t("production.labels.touchtime"),
|
title: i18n.t("production.labels.touchtime"),
|
||||||
dataIndex: "tt",
|
dataIndex: "tt",
|
||||||
@@ -435,6 +482,14 @@ const r = ({ technician, state, activeStatuses, bodyshop }) => {
|
|||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: i18n.t("jobs.labels.parts_received"),
|
||||||
|
dataIndex: "parts_received",
|
||||||
|
key: "parts_received",
|
||||||
|
render: (text, record) => (
|
||||||
|
<ProductionListColumnPartsReceived record={record} />
|
||||||
|
),
|
||||||
|
},
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
export default r;
|
export default r;
|
||||||
|
|||||||
@@ -1,22 +1,28 @@
|
|||||||
import { useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
import { DatePicker, Dropdown, TimePicker, Button, Card } from "antd";
|
import { Button, Card, Dropdown, TimePicker } from "antd";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||||
import { UPDATE_JOB } from "../../graphql/jobs.queries";
|
import { UPDATE_JOB } from "../../graphql/jobs.queries";
|
||||||
import { DateFormatter } from "../../utils/DateFormatter";
|
import { DateFormatter } from "../../utils/DateFormatter";
|
||||||
|
import FormDatePicker from "../form-date-picker/form-date-picker.component";
|
||||||
|
|
||||||
import { useTranslation } from "react-i18next";
|
export default function ProductionListDate({
|
||||||
|
record,
|
||||||
const OneCalendarDay = 60 * 60 * 24 * 1000;
|
field,
|
||||||
const Now = new Date();
|
time,
|
||||||
|
pastIndicator,
|
||||||
export default function ProductionListDate({ record, field, time }) {
|
}) {
|
||||||
const [updateAlert] = useMutation(UPDATE_JOB);
|
const [updateAlert] = useMutation(UPDATE_JOB);
|
||||||
const [visible, setVisible] = useState(false);
|
const [visible, setVisible] = useState(false);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const handleChange = (date) => {
|
const handleChange = (date) => {
|
||||||
logImEXEvent("product_toggle_date", { field });
|
logImEXEvent("product_toggle_date", { field });
|
||||||
|
// if (date.isSame(record[field] && moment(record[field]))) {
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
//e.stopPropagation();
|
//e.stopPropagation();
|
||||||
updateAlert({
|
updateAlert({
|
||||||
@@ -34,6 +40,15 @@ export default function ProductionListDate({ record, field, time }) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let className = "";
|
||||||
|
if (pastIndicator) {
|
||||||
|
className =
|
||||||
|
!!record[field] &&
|
||||||
|
((moment().isSameOrAfter(moment(record[field]), "day") &&
|
||||||
|
"production-completion-past") ||
|
||||||
|
(moment().add(1, "day").isSame(moment(record[field]), "day") &&
|
||||||
|
"production-completion-soon"));
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Dropdown
|
<Dropdown
|
||||||
@@ -47,17 +62,19 @@ export default function ProductionListDate({ record, field, time }) {
|
|||||||
style={{ padding: "1rem" }}
|
style={{ padding: "1rem" }}
|
||||||
onClick={(e) => e.stopPropagation()}
|
onClick={(e) => e.stopPropagation()}
|
||||||
>
|
>
|
||||||
<DatePicker
|
<FormDatePicker
|
||||||
onClick={(e) => e.stopPropagation()}
|
onClick={(e) => e.stopPropagation()}
|
||||||
value={(record[field] && moment(record[field])) || null}
|
value={(record[field] && moment(record[field])) || null}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
format="MM/DD/YYYY"
|
format="MM/DD/YYYY"
|
||||||
|
isDateOnly={!time}
|
||||||
/>
|
/>
|
||||||
{time && (
|
{time && (
|
||||||
<TimePicker
|
<TimePicker
|
||||||
onClick={(e) => e.stopPropagation()}
|
onClick={(e) => e.stopPropagation()}
|
||||||
value={(record[field] && moment(record[field])) || null}
|
value={(record[field] && moment(record[field])) || null}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
|
minuteStep={15}
|
||||||
format="hh:mm a"
|
format="hh:mm a"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
@@ -72,17 +89,9 @@ export default function ProductionListDate({ record, field, time }) {
|
|||||||
style={{
|
style={{
|
||||||
height: "19px",
|
height: "19px",
|
||||||
}}
|
}}
|
||||||
|
className={className}
|
||||||
>
|
>
|
||||||
<DateFormatter
|
<DateFormatter bordered={false}>{record[field]}</DateFormatter>
|
||||||
bordered={false}
|
|
||||||
className={
|
|
||||||
!!record[field] && new Date(record[field]) - Now < OneCalendarDay
|
|
||||||
? "production-completion-1"
|
|
||||||
: ""
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{record[field]}
|
|
||||||
</DateFormatter>
|
|
||||||
</div>
|
</div>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -116,15 +116,17 @@ export function ProductionListEmpAssignment({
|
|||||||
0
|
0
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{bodyshop.employees.map((emp) => (
|
{bodyshop.employees
|
||||||
<Select.Option
|
.filter((emp) => emp.active)
|
||||||
value={emp.id}
|
.map((emp) => (
|
||||||
key={emp.id}
|
<Select.Option
|
||||||
name={`${emp.first_name} ${emp.last_name}`}
|
value={emp.id}
|
||||||
>
|
key={emp.id}
|
||||||
{`${emp.first_name} ${emp.last_name}`}
|
name={`${emp.first_name} ${emp.last_name}`}
|
||||||
</Select.Option>
|
>
|
||||||
))}
|
{`${emp.first_name} ${emp.last_name}`}
|
||||||
|
</Select.Option>
|
||||||
|
))}
|
||||||
</Select>
|
</Select>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
import { useMemo } from "react";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
|
|
||||||
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
bodyshop: selectBodyshop,
|
||||||
|
});
|
||||||
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
|
});
|
||||||
|
export default connect(
|
||||||
|
mapStateToProps,
|
||||||
|
mapDispatchToProps
|
||||||
|
)(ProductionListColumnPartsReceived);
|
||||||
|
|
||||||
|
export function ProductionListColumnPartsReceived({ bodyshop, record }) {
|
||||||
|
const amount = useMemo(() => {
|
||||||
|
const amount = record.joblines_status.reduce(
|
||||||
|
(acc, val) => {
|
||||||
|
acc.total += val.count;
|
||||||
|
acc.received =
|
||||||
|
val.status === bodyshop.md_order_statuses.default_received
|
||||||
|
? acc.received + val.count
|
||||||
|
: acc.received;
|
||||||
|
return acc;
|
||||||
|
},
|
||||||
|
{ total: 0, received: 0 }
|
||||||
|
);
|
||||||
|
|
||||||
|
return {
|
||||||
|
...amount,
|
||||||
|
percent:
|
||||||
|
amount.total !== 0
|
||||||
|
? ((amount.received / amount.total) * 100).toFixed(0) + "%"
|
||||||
|
: "N/A",
|
||||||
|
};
|
||||||
|
}, [record, bodyshop.md_order_statuses]);
|
||||||
|
|
||||||
|
return `${amount.percent} (${amount.received}/${amount.total})`;
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
import { useMutation } from "@apollo/client";
|
||||||
|
import { Dropdown, Menu, Spin } from "antd";
|
||||||
|
import React, { useState } from "react";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||||
|
import { UPDATE_JOB } from "../../graphql/jobs.queries";
|
||||||
|
import { insertAuditTrail } from "../../redux/application/application.actions";
|
||||||
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
|
|
||||||
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
bodyshop: selectBodyshop,
|
||||||
|
});
|
||||||
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
|
insertAuditTrail: ({ jobid, operation }) =>
|
||||||
|
dispatch(insertAuditTrail({ jobid, operation })),
|
||||||
|
});
|
||||||
|
export function ProductionListColumnCategory({ record, bodyshop }) {
|
||||||
|
const [updateJob] = useMutation(UPDATE_JOB);
|
||||||
|
const [loading, setLoading] = useState(false);
|
||||||
|
|
||||||
|
const handleSetStatus = async (e) => {
|
||||||
|
logImEXEvent("production_change_status");
|
||||||
|
|
||||||
|
setLoading(true);
|
||||||
|
const { key } = e;
|
||||||
|
await updateJob({
|
||||||
|
variables: {
|
||||||
|
jobId: record.id,
|
||||||
|
job: {
|
||||||
|
category: key,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
setLoading(false);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Dropdown
|
||||||
|
overlay={
|
||||||
|
<Menu
|
||||||
|
style={{ maxHeight: "200px", overflowY: "auto" }}
|
||||||
|
onClick={handleSetStatus}
|
||||||
|
>
|
||||||
|
{bodyshop.md_categories.map((item) => (
|
||||||
|
<Menu.Item key={item}>{item}</Menu.Item>
|
||||||
|
))}
|
||||||
|
</Menu>
|
||||||
|
}
|
||||||
|
trigger={["click"]}
|
||||||
|
>
|
||||||
|
<div style={{ width: "100%", height: "19px", cursor: "pointer" }}>
|
||||||
|
{record.category}
|
||||||
|
{loading && <Spin />}
|
||||||
|
</div>
|
||||||
|
</Dropdown>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
export default connect(
|
||||||
|
mapStateToProps,
|
||||||
|
mapDispatchToProps
|
||||||
|
)(ProductionListColumnCategory);
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useQuery } from "@apollo/client";
|
import { useQuery } from "@apollo/client";
|
||||||
import { Descriptions, Drawer, Space } from "antd";
|
import { Descriptions, Drawer, Space, PageHeader, Button } from "antd";
|
||||||
import queryString from "query-string";
|
import queryString from "query-string";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
@@ -16,8 +16,25 @@ import JobEmployeeAssignments from "../job-employee-assignments/job-employee-ass
|
|||||||
import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component";
|
import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component";
|
||||||
import ProductionRemoveButton from "../production-remove-button/production-remove-button.component";
|
import ProductionRemoveButton from "../production-remove-button/production-remove-button.component";
|
||||||
import JobAtChange from "../job-at-change/job-at-change.component";
|
import JobAtChange from "../job-at-change/job-at-change.component";
|
||||||
|
import { PrinterFilled } from "@ant-design/icons";
|
||||||
|
import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { setModalContext } from "../../redux/modals/modals.actions";
|
||||||
|
|
||||||
export default function ProductionListDetail({ jobs }) {
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
//currentUser: selectCurrentUser
|
||||||
|
});
|
||||||
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
|
setPrintCenterContext: (context) =>
|
||||||
|
dispatch(setModalContext({ context: context, modal: "printCenter" })),
|
||||||
|
});
|
||||||
|
export default connect(
|
||||||
|
mapStateToProps,
|
||||||
|
mapDispatchToProps
|
||||||
|
)(ProductionListDetail);
|
||||||
|
|
||||||
|
export function ProductionListDetail({ jobs, setPrintCenterContext }) {
|
||||||
const search = queryString.parse(useLocation().search);
|
const search = queryString.parse(useLocation().search);
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
const { selected } = search;
|
const { selected } = search;
|
||||||
@@ -39,11 +56,29 @@ export default function ProductionListDetail({ jobs }) {
|
|||||||
return (
|
return (
|
||||||
<Drawer
|
<Drawer
|
||||||
title={
|
title={
|
||||||
<Space>
|
<PageHeader
|
||||||
<span>{t("production.labels.jobdetail")}</span>
|
title={theJob.ro_number}
|
||||||
<span>{theJob.ro_number}</span>
|
extra={
|
||||||
<ProductionRemoveButton jobId={theJob.id} />
|
<Space>
|
||||||
</Space>
|
<ProductionRemoveButton jobId={theJob.id} />{" "}
|
||||||
|
<Button
|
||||||
|
onClick={() => {
|
||||||
|
setPrintCenterContext({
|
||||||
|
actions: { refetch: refetch },
|
||||||
|
context: {
|
||||||
|
id: theJob.id,
|
||||||
|
job: theJob,
|
||||||
|
type: "job",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<PrinterFilled />
|
||||||
|
{t("jobs.actions.printCenter")}
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
}
|
||||||
|
/>
|
||||||
}
|
}
|
||||||
placement="right"
|
placement="right"
|
||||||
width={"33%"}
|
width={"33%"}
|
||||||
@@ -72,9 +107,7 @@ export default function ProductionListDetail({ jobs }) {
|
|||||||
{theJob.ins_co_nm || ""}
|
{theJob.ins_co_nm || ""}
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
<Descriptions.Item label={t("jobs.fields.owner")}>
|
<Descriptions.Item label={t("jobs.fields.owner")}>
|
||||||
{`${theJob.ownr_fn || ""} ${theJob.ownr_ln || ""} ${
|
<OwnerNameDisplay ownerObject={theJob} />
|
||||||
theJob.ownr_co_nm || ""
|
|
||||||
}`}
|
|
||||||
<StartChatButton
|
<StartChatButton
|
||||||
phone={data.jobs_by_pk.ownr_ph1}
|
phone={data.jobs_by_pk.ownr_ph1}
|
||||||
jobid={data.jobs_by_pk.id}
|
jobid={data.jobs_by_pk.id}
|
||||||
|
|||||||
@@ -4,9 +4,28 @@ import { TemplateList } from "../../utils/TemplateConstants";
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { GenerateDocument } from "../../utils/RenderTemplate";
|
import { GenerateDocument } from "../../utils/RenderTemplate";
|
||||||
|
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
const ProdTemplates = TemplateList("production");
|
const ProdTemplates = TemplateList("production");
|
||||||
|
const {
|
||||||
|
production_by_technician_one,
|
||||||
|
production_by_category_one,
|
||||||
|
production_by_repair_status_one,
|
||||||
|
} = TemplateList("special");
|
||||||
|
|
||||||
export default function ProductionListPrint() {
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
bodyshop: selectBodyshop,
|
||||||
|
});
|
||||||
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
|
});
|
||||||
|
export default connect(
|
||||||
|
mapStateToProps,
|
||||||
|
mapDispatchToProps
|
||||||
|
)(ProductionListPrint);
|
||||||
|
|
||||||
|
export function ProductionListPrint({ bodyshop }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
return (
|
return (
|
||||||
@@ -33,6 +52,75 @@ export default function ProductionListPrint() {
|
|||||||
{ProdTemplates[key].title}
|
{ProdTemplates[key].title}
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
))}
|
))}
|
||||||
|
<Menu.SubMenu
|
||||||
|
title={t("reportcenter.templates.production_by_technician_one")}
|
||||||
|
>
|
||||||
|
{bodyshop.employees.map((e) => (
|
||||||
|
<Menu.Item
|
||||||
|
key={e.id}
|
||||||
|
onClick={async () => {
|
||||||
|
setLoading(true);
|
||||||
|
await GenerateDocument(
|
||||||
|
{
|
||||||
|
name: production_by_technician_one.key,
|
||||||
|
variables: { id: e.id },
|
||||||
|
},
|
||||||
|
{},
|
||||||
|
"p"
|
||||||
|
);
|
||||||
|
setLoading(false);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{e.first_name} {e.last_name}
|
||||||
|
</Menu.Item>
|
||||||
|
))}
|
||||||
|
</Menu.SubMenu>
|
||||||
|
<Menu.SubMenu
|
||||||
|
title={t("reportcenter.templates.production_by_category_one")}
|
||||||
|
>
|
||||||
|
{bodyshop.md_categories.map((e) => (
|
||||||
|
<Menu.Item
|
||||||
|
key={e}
|
||||||
|
onClick={async () => {
|
||||||
|
setLoading(true);
|
||||||
|
await GenerateDocument(
|
||||||
|
{
|
||||||
|
name: production_by_category_one.key,
|
||||||
|
variables: { category: e },
|
||||||
|
},
|
||||||
|
{},
|
||||||
|
"p"
|
||||||
|
);
|
||||||
|
setLoading(false);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{e}
|
||||||
|
</Menu.Item>
|
||||||
|
))}
|
||||||
|
</Menu.SubMenu>
|
||||||
|
<Menu.SubMenu
|
||||||
|
title={t("reportcenter.templates.production_by_repair_status_one")}
|
||||||
|
>
|
||||||
|
{bodyshop.md_ro_statuses.production_statuses.map((e) => (
|
||||||
|
<Menu.Item
|
||||||
|
key={e}
|
||||||
|
onClick={async () => {
|
||||||
|
setLoading(true);
|
||||||
|
await GenerateDocument(
|
||||||
|
{
|
||||||
|
name: production_by_repair_status_one.key,
|
||||||
|
variables: { status: e },
|
||||||
|
},
|
||||||
|
{},
|
||||||
|
"p"
|
||||||
|
);
|
||||||
|
setLoading(false);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{e}
|
||||||
|
</Menu.Item>
|
||||||
|
))}
|
||||||
|
</Menu.SubMenu>
|
||||||
</Menu>
|
</Menu>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -265,6 +265,7 @@ export function ProductionListTable({
|
|||||||
columns={columns.map((c, index) => {
|
columns={columns.map((c, index) => {
|
||||||
return {
|
return {
|
||||||
...c,
|
...c,
|
||||||
|
filteredValue: state.filteredInfo[c.key] || null,
|
||||||
sortOrder:
|
sortOrder:
|
||||||
state.sortedInfo.columnKey === c.key && state.sortedInfo.order,
|
state.sortedInfo.columnKey === c.key && state.sortedInfo.order,
|
||||||
title: headerItem(c),
|
title: headerItem(c),
|
||||||
|
|||||||
@@ -25,15 +25,20 @@ export function ScheduleCalendarHeaderGraph({ bodyshop, loadData }) {
|
|||||||
const { ssbuckets } = bodyshop;
|
const { ssbuckets } = bodyshop;
|
||||||
|
|
||||||
const data = useMemo(() => {
|
const data = useMemo(() => {
|
||||||
return Object.keys(loadData.expectedLoad).map((key) => {
|
return (
|
||||||
const metadataBucket = ssbuckets.filter((b) => b.id === key)[0];
|
(loadData &&
|
||||||
|
loadData.expectedLoad &&
|
||||||
|
Object.keys(loadData.expectedLoad).map((key) => {
|
||||||
|
const metadataBucket = ssbuckets.filter((b) => b.id === key)[0];
|
||||||
|
|
||||||
return {
|
return {
|
||||||
bucket: loadData.expectedLoad[key].label,
|
bucket: loadData.expectedLoad[key].label,
|
||||||
current: loadData.expectedLoad[key].count,
|
current: loadData.expectedLoad[key].count,
|
||||||
target: metadataBucket && metadataBucket.target,
|
target: metadataBucket && metadataBucket.target,
|
||||||
};
|
};
|
||||||
});
|
})) ||
|
||||||
|
[]
|
||||||
|
);
|
||||||
}, [loadData, ssbuckets]);
|
}, [loadData, ssbuckets]);
|
||||||
|
|
||||||
const popContent = (
|
const popContent = (
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ export function ScheduleCalendarContainer({ calculateScheduleLoad }) {
|
|||||||
color: "red",
|
color: "red",
|
||||||
start: moment(e.start).startOf("day").toDate(),
|
start: moment(e.start).startOf("day").toDate(),
|
||||||
end: moment(e.end).startOf("day").toDate(),
|
end: moment(e.end).startOf("day").toDate(),
|
||||||
|
allDay: true,
|
||||||
vacation: true,
|
vacation: true,
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { DateTimeFormatter } from "../../utils/DateFormatter";
|
|||||||
import AlertComponent from "../alert/alert.component";
|
import AlertComponent from "../alert/alert.component";
|
||||||
import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component";
|
import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component";
|
||||||
import "./schedule-production-list.styles.scss";
|
import "./schedule-production-list.styles.scss";
|
||||||
|
import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
|
||||||
export default function ScheduleProductionList() {
|
export default function ScheduleProductionList() {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [callQuery, { loading, error, data }] = useLazyQuery(
|
const [callQuery, { loading, error, data }] = useLazyQuery(
|
||||||
@@ -36,9 +36,7 @@ export default function ScheduleProductionList() {
|
|||||||
<td>
|
<td>
|
||||||
<Link to={`/manage/jobs/${j.id}`}>{j.ro_number}</Link>
|
<Link to={`/manage/jobs/${j.id}`}>{j.ro_number}</Link>
|
||||||
</td>
|
</td>
|
||||||
<td>{`${j.ownr_fn || ""} ${j.ownr_ln || ""} ${
|
<td><OwnerNameDisplay ownerObject={j} /></td>
|
||||||
j.ownr_co_nm || ""
|
|
||||||
}`}</td>
|
|
||||||
<td>{`${j.v_model_yr || ""} ${j.v_make_desc || ""} ${
|
<td>{`${j.v_model_yr || ""} ${j.v_make_desc || ""} ${
|
||||||
j.v_model_desc || ""
|
j.v_model_desc || ""
|
||||||
}`}</td>
|
}`}</td>
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import { CalendarOutlined } from "@ant-design/icons";
|
import { CalendarOutlined } from "@ant-design/icons";
|
||||||
import { Card, Col, Row, Statistic } from "antd";
|
import { Card, Col, Row, Statistic } from "antd";
|
||||||
import React from "react";
|
import _ from "lodash";
|
||||||
|
import moment from "moment";
|
||||||
|
import React, { useMemo } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
@@ -16,25 +18,78 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const rowGutter = [16, 16];
|
const rowGutter = [16, 16];
|
||||||
const statSpans = { xs: 24, sm: 6 };
|
const statSpans = { xs: 24, sm: 3 };
|
||||||
|
|
||||||
export function ScoreboardTargetsTable({ bodyshop, scoreBoardlist }) {
|
export function ScoreboardTargetsTable({ bodyshop, scoreBoardlist }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
const values = useMemo(() => {
|
||||||
|
const dateHash = _.groupBy(scoreBoardlist, "date");
|
||||||
|
console.log(
|
||||||
|
"🚀 ~ file: scoreboard-targets-table.component.jsx ~ line 31 ~ values ~ dateHash",
|
||||||
|
dateHash
|
||||||
|
);
|
||||||
|
|
||||||
|
let ret = {
|
||||||
|
todayBody: 0,
|
||||||
|
todayPaint: 0,
|
||||||
|
weeklyPaint: 0,
|
||||||
|
weeklyBody: 0,
|
||||||
|
toDateBody: 0,
|
||||||
|
toDatePaint: 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
const today = moment();
|
||||||
|
if (dateHash[today.format("YYYY-MM-DD")]) {
|
||||||
|
dateHash[today.format("YYYY-MM-DD")].forEach((d) => {
|
||||||
|
ret.todayBody = ret.todayBody + d.bodyhrs;
|
||||||
|
ret.todayPaint = ret.todayPaint + d.painthrs;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
let StartOfWeek = moment().startOf("week");
|
||||||
|
while (StartOfWeek.isSameOrBefore(today)) {
|
||||||
|
if (dateHash[StartOfWeek.format("YYYY-MM-DD")]) {
|
||||||
|
dateHash[StartOfWeek.format("YYYY-MM-DD")].forEach((d) => {
|
||||||
|
ret.weeklyBody = ret.weeklyBody + d.bodyhrs;
|
||||||
|
ret.weeklyPaint = ret.weeklyPaint + d.painthrs;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
StartOfWeek = StartOfWeek.add(1, "day");
|
||||||
|
}
|
||||||
|
|
||||||
|
let startOfMonth = moment().startOf("month");
|
||||||
|
while (startOfMonth.isSameOrBefore(today)) {
|
||||||
|
if (dateHash[startOfMonth.format("YYYY-MM-DD")]) {
|
||||||
|
dateHash[startOfMonth.format("YYYY-MM-DD")].forEach((d) => {
|
||||||
|
ret.toDateBody = ret.toDateBody + d.bodyhrs;
|
||||||
|
ret.toDatePaint = ret.toDatePaint + d.painthrs;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
startOfMonth = startOfMonth.add(1, "day");
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}, [scoreBoardlist]);
|
||||||
|
console.log(
|
||||||
|
"🚀 ~ file: scoreboard-targets-table.component.jsx ~ line 51 ~ values ~ values",
|
||||||
|
values
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
title={t("scoreboard.labels.targets")}
|
title={t("scoreboard.labels.targets")}
|
||||||
extra={<ScoreboardJobsList scoreBoardlist={scoreBoardlist} />}
|
extra={<ScoreboardJobsList scoreBoardlist={scoreBoardlist} />}
|
||||||
>
|
>
|
||||||
<Row gutter={rowGutter}>
|
<Row gutter={rowGutter}>
|
||||||
<Col xs={24} sm={{ offset: 0, span: 4 }} lg={{ offset: 5, span: 4 }}>
|
<Col xs={24} sm={{ offset: 0, span: 4 }} lg={{ span: 4 }}>
|
||||||
<Statistic
|
<Statistic
|
||||||
title={t("scoreboard.labels.workingdays")}
|
title={t("scoreboard.labels.workingdays")}
|
||||||
value={Util.CalculateWorkingDaysThisMonth()}
|
value={Util.CalculateWorkingDaysThisMonth()}
|
||||||
prefix={<CalendarOutlined />}
|
prefix={<CalendarOutlined />}
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
<Col xs={24} sm={{ offset: 0, span: 20 }} lg={{ offset: 0, span: 13 }}>
|
<Col xs={24} sm={{ offset: 0, span: 20 }} lg={{ offset: 0, span: 20 }}>
|
||||||
<Row>
|
<Row>
|
||||||
<Col {...statSpans}>
|
<Col {...statSpans}>
|
||||||
<Statistic
|
<Statistic
|
||||||
@@ -43,6 +98,12 @@ export function ScoreboardTargetsTable({ bodyshop, scoreBoardlist }) {
|
|||||||
prefix="B"
|
prefix="B"
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
|
<Col {...statSpans}>
|
||||||
|
<Statistic
|
||||||
|
title={t("scoreboard.labels.dailyactual")}
|
||||||
|
value={values.todayBody.toFixed(1)}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
<Col {...statSpans}>
|
<Col {...statSpans}>
|
||||||
<Statistic
|
<Statistic
|
||||||
title={t("scoreboard.labels.weeklytarget")}
|
title={t("scoreboard.labels.weeklytarget")}
|
||||||
@@ -52,6 +113,12 @@ export function ScoreboardTargetsTable({ bodyshop, scoreBoardlist }) {
|
|||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
|
<Col {...statSpans}>
|
||||||
|
<Statistic
|
||||||
|
title={t("scoreboard.labels.weeklyactual")}
|
||||||
|
value={values.weeklyBody.toFixed(1)}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
<Col {...statSpans}>
|
<Col {...statSpans}>
|
||||||
<Statistic
|
<Statistic
|
||||||
title={t("scoreboard.labels.monthlytarget")}
|
title={t("scoreboard.labels.monthlytarget")}
|
||||||
@@ -70,6 +137,12 @@ export function ScoreboardTargetsTable({ bodyshop, scoreBoardlist }) {
|
|||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
|
<Col {...statSpans}>
|
||||||
|
<Statistic
|
||||||
|
title={t("scoreboard.labels.todateactual")}
|
||||||
|
value={values.toDateBody.toFixed(1)}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
<Row>
|
<Row>
|
||||||
<Col {...statSpans}>
|
<Col {...statSpans}>
|
||||||
@@ -78,6 +151,9 @@ export function ScoreboardTargetsTable({ bodyshop, scoreBoardlist }) {
|
|||||||
prefix="P"
|
prefix="P"
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
|
<Col {...statSpans}>
|
||||||
|
<Statistic value={values.todayPaint.toFixed(1)} />
|
||||||
|
</Col>
|
||||||
<Col {...statSpans}>
|
<Col {...statSpans}>
|
||||||
<Statistic
|
<Statistic
|
||||||
value={Util.WeeklyTargetHrs(
|
value={Util.WeeklyTargetHrs(
|
||||||
@@ -86,6 +162,9 @@ export function ScoreboardTargetsTable({ bodyshop, scoreBoardlist }) {
|
|||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
|
<Col {...statSpans}>
|
||||||
|
<Statistic value={values.weeklyPaint.toFixed(1)} />
|
||||||
|
</Col>
|
||||||
<Col {...statSpans}>
|
<Col {...statSpans}>
|
||||||
<Statistic
|
<Statistic
|
||||||
value={Util.MonthlyTargetHrs(
|
value={Util.MonthlyTargetHrs(
|
||||||
@@ -102,6 +181,9 @@ export function ScoreboardTargetsTable({ bodyshop, scoreBoardlist }) {
|
|||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
|
<Col {...statSpans}>
|
||||||
|
<Statistic value={values.toDatePaint.toFixed(1)} />
|
||||||
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import { selectBodyshop } from "../../redux/user/user.selectors";
|
|||||||
import AlertComponent from "../alert/alert.component";
|
import AlertComponent from "../alert/alert.component";
|
||||||
import ShopEmployeesFormComponent from "./shop-employees-form.component";
|
import ShopEmployeesFormComponent from "./shop-employees-form.component";
|
||||||
import ShopEmployeesListComponent from "./shop-employees-list.component";
|
import ShopEmployeesListComponent from "./shop-employees-list.component";
|
||||||
|
import RbacWrapper from "../rbac-wrapper/rbac-wrapper.component";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
});
|
});
|
||||||
@@ -21,11 +23,13 @@ function ShopEmployeesContainer({ bodyshop }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<ShopEmployeesListComponent
|
<RbacWrapper action="employees:page">
|
||||||
employees={data ? data.employees : []}
|
<ShopEmployeesListComponent
|
||||||
loading={loading}
|
employees={data ? data.employees : []}
|
||||||
/>
|
loading={loading}
|
||||||
<ShopEmployeesFormComponent />
|
/>
|
||||||
|
<ShopEmployeesFormComponent />
|
||||||
|
</RbacWrapper>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
|||||||
import CurrencyInput from "../form-items-formatted/currency-form-item.component";
|
import CurrencyInput from "../form-items-formatted/currency-form-item.component";
|
||||||
import FormItemEmail from "../form-items-formatted/email-form-item.component";
|
import FormItemEmail from "../form-items-formatted/email-form-item.component";
|
||||||
|
|
||||||
|
import momentTZ from "moment-timezone";
|
||||||
|
const timeZonesList = momentTZ.tz.names();
|
||||||
|
|
||||||
export default function ShopInfoGeneral({ form }) {
|
export default function ShopInfoGeneral({ form }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
return (
|
return (
|
||||||
@@ -84,6 +87,7 @@ export default function ShopInfoGeneral({ form }) {
|
|||||||
<Form.Item label={t("bodyshop.fields.email")} name="email">
|
<Form.Item label={t("bodyshop.fields.email")} name="email">
|
||||||
<Input />
|
<Input />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("bodyshop.fields.phone")}
|
label={t("bodyshop.fields.phone")}
|
||||||
name="phone"
|
name="phone"
|
||||||
@@ -97,6 +101,23 @@ export default function ShopInfoGeneral({ form }) {
|
|||||||
<Form.Item label={t("bodyshop.fields.website")} name="website">
|
<Form.Item label={t("bodyshop.fields.website")} name="website">
|
||||||
<Input />
|
<Input />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("bodyshop.fields.timezone")}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
//message: t("general.validation.required"),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
name="timezone"
|
||||||
|
>
|
||||||
|
<Select
|
||||||
|
showSearch
|
||||||
|
options={timeZonesList.map((z) => {
|
||||||
|
return { label: z, value: z };
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("bodyshop.fields.insurance_vendor_id")}
|
label={t("bodyshop.fields.insurance_vendor_id")}
|
||||||
name="insurance_vendor_id"
|
name="insurance_vendor_id"
|
||||||
@@ -121,6 +142,18 @@ export default function ShopInfoGeneral({ form }) {
|
|||||||
>
|
>
|
||||||
<Input />
|
<Input />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("bodyshop.fields.logo_img_header_margin")}
|
||||||
|
name={["logo_img_path", "headerMargin"]}
|
||||||
|
>
|
||||||
|
<InputNumber min={0} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("bodyshop.fields.logo_img_footer_margin")}
|
||||||
|
name={["logo_img_path", "footerMargin"]}
|
||||||
|
>
|
||||||
|
<InputNumber min={0} />
|
||||||
|
</Form.Item>
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
<LayoutFormRow header={t("bodyshop.labels.accountingsetup")}>
|
<LayoutFormRow header={t("bodyshop.labels.accountingsetup")}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
@@ -130,6 +163,27 @@ export default function ShopInfoGeneral({ form }) {
|
|||||||
>
|
>
|
||||||
<Switch />
|
<Switch />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
||||||
|
<Form.Item shouldUpdate noStyle>
|
||||||
|
{() => (
|
||||||
|
<Form.Item
|
||||||
|
label={t("bodyshop.labels.qbo_usa")}
|
||||||
|
shouldUpdate
|
||||||
|
valuePropName="checked"
|
||||||
|
name={["accountingconfig", "qbo_usa"]}
|
||||||
|
>
|
||||||
|
<Switch
|
||||||
|
disabled={!form.getFieldValue(["accountingconfig", "qbo"])}
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
)}
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("bodyshop.labels.qbo_departmentid")}
|
||||||
|
name={["accountingconfig", "qbo_departmentid"]}
|
||||||
|
>
|
||||||
|
<Input />
|
||||||
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("bodyshop.labels.accountingtiers")}
|
label={t("bodyshop.labels.accountingtiers")}
|
||||||
rules={[
|
rules={[
|
||||||
@@ -466,7 +520,6 @@ export default function ShopInfoGeneral({ form }) {
|
|||||||
>
|
>
|
||||||
<CurrencyInput />
|
<CurrencyInput />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name={["attach_pdf_to_email"]}
|
name={["attach_pdf_to_email"]}
|
||||||
label={t("bodyshop.fields.attach_pdf_to_email")}
|
label={t("bodyshop.fields.attach_pdf_to_email")}
|
||||||
@@ -474,6 +527,18 @@ export default function ShopInfoGeneral({ form }) {
|
|||||||
>
|
>
|
||||||
<Switch />
|
<Switch />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
name={["md_from_emails"]}
|
||||||
|
label={t("bodyshop.fields.md_from_emails")}
|
||||||
|
// rules={[
|
||||||
|
// {
|
||||||
|
// //message: t("general.validation.required"),
|
||||||
|
// type: "array",
|
||||||
|
// },
|
||||||
|
// ]}
|
||||||
|
>
|
||||||
|
<Select mode="tags" />
|
||||||
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name={["md_email_cc", "parts_order"]}
|
name={["md_email_cc", "parts_order"]}
|
||||||
label={t("bodyshop.fields.md_email_cc", { template: "parts_order" })}
|
label={t("bodyshop.fields.md_email_cc", { template: "parts_order" })}
|
||||||
@@ -493,6 +558,13 @@ export default function ShopInfoGeneral({ form }) {
|
|||||||
>
|
>
|
||||||
<Switch />
|
<Switch />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
name={["bill_allow_post_to_closed"]}
|
||||||
|
label={t("bodyshop.fields.bill_allow_post_to_closed")}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name={["md_ded_notes"]}
|
name={["md_ded_notes"]}
|
||||||
label={t("bodyshop.fields.md_ded_notes")}
|
label={t("bodyshop.fields.md_ded_notes")}
|
||||||
@@ -505,6 +577,13 @@ export default function ShopInfoGeneral({ form }) {
|
|||||||
>
|
>
|
||||||
<Select mode="tags" />
|
<Select mode="tags" />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
name={["last_name_first"]}
|
||||||
|
label={t("bodyshop.fields.last_name_first")}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
<LayoutFormRow grow header={t("bodyshop.labels.messagingpresets")}>
|
<LayoutFormRow grow header={t("bodyshop.labels.messagingpresets")}>
|
||||||
<Form.List name={["md_messaging_presets"]}>
|
<Form.List name={["md_messaging_presets"]}>
|
||||||
@@ -739,14 +818,23 @@ export default function ShopInfoGeneral({ form }) {
|
|||||||
>
|
>
|
||||||
<Input />
|
<Input />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Space>
|
<Form.Item
|
||||||
<Form.Item
|
label={t("bodyshop.fields.md_ins_co.zip")}
|
||||||
label={t("bodyshop.fields.md_ins_co.zip")}
|
key={`${index}zip`}
|
||||||
key={`${index}zip`}
|
name={[field.name, "zip"]}
|
||||||
name={[field.name, "zip"]}
|
>
|
||||||
>
|
<Input />
|
||||||
<Input />
|
</Form.Item>
|
||||||
</Form.Item>
|
<Form.Item
|
||||||
|
label={t("bodyshop.fields.md_ins_co.private")}
|
||||||
|
key={`${index}private`}
|
||||||
|
name={[field.name, "private"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
|
||||||
|
<Space wrap>
|
||||||
<DeleteFilled
|
<DeleteFilled
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
remove(field.name);
|
remove(field.name);
|
||||||
@@ -1239,6 +1327,72 @@ export default function ShopInfoGeneral({ form }) {
|
|||||||
}}
|
}}
|
||||||
</Form.List>
|
</Form.List>
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
|
<LayoutFormRow grow header={t("bodyshop.fields.md_parts_order_comment")}>
|
||||||
|
<Form.List name={["md_parts_order_comment"]}>
|
||||||
|
{(fields, { add, remove, move }) => {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
{fields.map((field, index) => (
|
||||||
|
<Form.Item key={field.key}>
|
||||||
|
<LayoutFormRow noDivider>
|
||||||
|
<Form.Item
|
||||||
|
label={t("general.labels.label")}
|
||||||
|
key={`${index}label`}
|
||||||
|
name={[field.name, "label"]}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
//message: t("general.validation.required"),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<Input />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("parts_orders.fields.comments")}
|
||||||
|
key={`${index}comment`}
|
||||||
|
name={[field.name, "comment"]}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
//message: t("general.validation.required"),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<Input />
|
||||||
|
</Form.Item>
|
||||||
|
|
||||||
|
<Space wrap>
|
||||||
|
<DeleteFilled
|
||||||
|
onClick={() => {
|
||||||
|
remove(field.name);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<FormListMoveArrows
|
||||||
|
move={move}
|
||||||
|
index={index}
|
||||||
|
total={fields.length}
|
||||||
|
/>
|
||||||
|
</Space>
|
||||||
|
</LayoutFormRow>
|
||||||
|
</Form.Item>
|
||||||
|
))}
|
||||||
|
<Form.Item>
|
||||||
|
<Button
|
||||||
|
type="dashed"
|
||||||
|
onClick={() => {
|
||||||
|
add();
|
||||||
|
}}
|
||||||
|
style={{ width: "100%" }}
|
||||||
|
>
|
||||||
|
{t("general.actions.add")}
|
||||||
|
</Button>
|
||||||
|
</Form.Item>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
</Form.List>
|
||||||
|
</LayoutFormRow>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,9 +75,17 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
|
|||||||
<div>
|
<div>
|
||||||
{(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber) && (
|
{(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber) && (
|
||||||
<>
|
<>
|
||||||
<DataLabel label={t("bodyshop.labels.dms.cdk_dealerid")}>
|
{bodyshop.cdk_dealerid && (
|
||||||
{form.getFieldValue("cdk_dealerid")}
|
<DataLabel label={t("bodyshop.labels.dms.cdk_dealerid")}>
|
||||||
</DataLabel>
|
{form.getFieldValue("cdk_dealerid")}
|
||||||
|
</DataLabel>
|
||||||
|
)}
|
||||||
|
{bodyshop.pbs_serialnumber && (
|
||||||
|
<DataLabel label={t("bodyshop.labels.dms.pbs_serialnumber")}>
|
||||||
|
{form.getFieldValue("pbs_serialnumber")}
|
||||||
|
</DataLabel>
|
||||||
|
)}
|
||||||
|
|
||||||
<LayoutFormRow>
|
<LayoutFormRow>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("bodyshop.fields.dms.default_journal")}
|
label={t("bodyshop.fields.dms.default_journal")}
|
||||||
@@ -121,6 +129,15 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
|
|||||||
>
|
>
|
||||||
<Input />
|
<Input />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
{bodyshop.pbs_serialnumber && (
|
||||||
|
<Form.Item
|
||||||
|
label={t("bodyshop.fields.dms.disablecontactvehiclecreation")}
|
||||||
|
valuePropName="checked"
|
||||||
|
name={["pbs_configuration", "disablecontactvehicle"]}
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
)}
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
<LayoutFormRow header={t("bodyshop.labels.dms.cdk.payers")}>
|
<LayoutFormRow header={t("bodyshop.labels.dms.cdk.payers")}>
|
||||||
<Form.List name={["cdk_configuration", "payers"]}>
|
<Form.List name={["cdk_configuration", "payers"]}>
|
||||||
@@ -158,11 +175,11 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
|
|||||||
label={t("jobs.fields.dms.payer.control_type")}
|
label={t("jobs.fields.dms.payer.control_type")}
|
||||||
key={`${index}control_type`}
|
key={`${index}control_type`}
|
||||||
name={[field.name, "control_type"]}
|
name={[field.name, "control_type"]}
|
||||||
rules={[
|
// rules={[
|
||||||
{
|
// {
|
||||||
required: true,
|
// required: true,
|
||||||
},
|
// },
|
||||||
]}
|
// ]}
|
||||||
>
|
>
|
||||||
<Select showSearch>
|
<Select showSearch>
|
||||||
<Select.Option value="ro_number">
|
<Select.Option value="ro_number">
|
||||||
|
|||||||
@@ -70,6 +70,12 @@ export default function ShopInfoSchedulingComponent({ form }) {
|
|||||||
>
|
>
|
||||||
<Select mode="tags" />
|
<Select mode="tags" />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
name={["ss_configuration", "dailyhrslimit"]}
|
||||||
|
label={t("bodyshop.fields.ss_configuration.dailyhrslimit")}
|
||||||
|
>
|
||||||
|
<InputNumber min={0} />
|
||||||
|
</Form.Item>
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
<Divider orientation="left">{t("bodyshop.labels.workingdays")}</Divider>
|
<Divider orientation="left">{t("bodyshop.labels.workingdays")}</Divider>
|
||||||
<Space wrap size="large">
|
<Space wrap size="large">
|
||||||
|
|||||||
@@ -81,7 +81,10 @@ export function SignInComponent({
|
|||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
{signInError ? (
|
{signInError ? (
|
||||||
<AlertComponent type="error" message={signInError.message} />
|
<AlertComponent
|
||||||
|
type="error"
|
||||||
|
message={t(`users.errors.signinerror.${signInError.code}`)}
|
||||||
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
<Button
|
<Button
|
||||||
className="login-btn"
|
className="login-btn"
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user